Codebase list libseccomp / 556cfd8
Imported Debian patch 2.2.3-3 Kees Cook authored 8 years ago Luca Bruno committed 8 years ago
189 changed file(s) with 60742 addition(s) and 3007 deletion(s). Raw diff Collapse all Expand all
00 libseccomp: Releases
11 ===============================================================================
2 http://libseccomp.sf.net
2 https://github.com/seccomp/libseccomp
3
4 * Version 2.2.3 - July 8, 2015
5 - Fix a problem with 'make check' on 32-bit ARM systems
6
7 * Version 2.2.2 - July 6, 2015
8 - Fix a problem with the masked equality operator
9 - Fix a problem on x86_64/x32 involving invalid architectures
10 - Fix a problem with the ARM specific syscalls
11 - Fix a build problem when the source and build directories differ
12
13 * Version 2.2.1 - May 13, 2015
14 - Fix a problem with syscall argument filtering on 64-bit systems
15 - Fix some problems with the 32-bit ARM syscall table
16 - Fix build problems on very old systems
17 - Update the README file with the GitHub and Google Groups information
18
19 * Version 2.2.0 - February 12, 2015
20 - Migrated the build system to autotools
21 - Added support for the aarch64 architecture
22 - Added support for the mips, mips64, and mips64n32 architectures for both big
23 and little endian systems
24 - Added support for using the new seccomp() syscall and the thread sync
25 functionality
26 - Added Python bindings
27 - Updated the internal syscall tables to Linux v3.19
28 - Added documentation to help contributors wishing to submit patches
29 - Migrated to GitHub for git hosting and Google Groups for the mailing list
30 - Numerous minor bug fixes
331
432 * Version 2.1.1 - October 31, 2013
533 - Build system improvements
6 - Automated test improvments, including a "check" target for use by
34 - Automated test improvements, including a "check" target for use by
735 packagers to verify the build
836 - Numerous bug fixes related to the filter's internal rule database which
937 affect those creating rules with syscall arguments
2048
2149 * Version 2.0.0 - January 28, 2013
2250 - Fixes for the x86 multiplexed syscalls
23 - Additions to the API to better support non-native architecures
24 - Additions to the API to support multiple architecures in one filter
51 - Additions to the API to better support non-native architectures
52 - Additions to the API to support multiple architectures in one filter
2553 - Additions to the API to resolve syscall name/number mappings
2654 - Assorted minor bug fixes
2755 - Improved build messages regardless of build verbosity
00 libseccomp: Contributors
11 ===============================================================================
2 http://libseccomp.sf.net
2 https://github.com/seccomp/libseccomp
33
4 Andrew Jones <drjones@redhat.com>
45 Andy Lutomirski <luto@amacapital.net>
56 Ashley Lai <adlai@us.ibm.com>
7 Colin Walters <walters@verbum.org>
68 Corey Bryant <coreyb@linux.vnet.ibm.com>
79 Eduardo Otubo <otubo@linux.vnet.ibm.com>
810 Eric Paris <eparis@redhat.com>
911 Jake Edge <jake@lwn.net>
12 Jan Engelhardt <jengelh@inai.de>
1013 Joe MacDonald <joe@deserted.net>
1114 Kees Cook <keescook@chromium.org>
15 Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
16 Marcus Meissner <meissner@suse.de>
17 Markos Chandras <markos.chandras@imgtec.com>
18 Mathias Krause <minipli@googlemail.com>
19 Michael Forney <mforney@mforney.org>
20 Mike Strosaker <strosake@linux.vnet.ibm.com>
1221 Paul Moore <pmoore@redhat.com>
22 Serge Hallyn <serge.hallyn@ubuntu.com>
1323 Thiago Marcos P. Santos <thiago.santos@intel.com>
24 Vicente Olivert Riera <Vincent.Riera@imgtec.com>
1425 Vitaly Vi Shukela <vi0oss@gmail.com>
+0
-126
Makefile less more
0 #
1 # Enhanced Seccomp Library Makefile
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 # macros
23 #
24
25 include macros.mk
26
27 #
28 # configuration
29 #
30
31 -include version_info.mk
32 -include configure.mk
33 include install.mk
34
35 #
36 # targets
37 #
38
39 CONFIGS = configure.mk configure.h version_info.mk libseccomp.pc
40 SUBDIRS_BUILD = include src tests tools
41 SUBDIRS_INSTALL = include src tools doc
42
43 .PHONY: tarball install check check-syntax ctags cstags clean dist-clean \
44 $(SUBDIRS_BUILD)
45
46 all: $(SUBDIRS_BUILD)
47
48 $(CONFIGS): version_info
49 @$(ECHO_INFO) "automatically generating configuration ..."
50 @./configure
51
52 tarball: dist-clean
53 @ver=$(VERSION_RELEASE); \
54 tarball=libseccomp-$$ver.tar.gz; \
55 $(ECHO_INFO) "creating the tarball ../$$tarball"; \
56 tmp_dir=$$(mktemp -d /tmp/libseccomp.XXXXX); \
57 rel_dir=$$tmp_dir/libseccomp-$$ver; \
58 $(MKDIR) $$rel_dir; \
59 $(TAR) cf - --exclude=*~ --exclude=.git* --exclude=.stgit* . | \
60 (cd $$rel_dir; tar xf -); \
61 (cd $$tmp_dir; $(TAR) zcf $$tarball libseccomp-$$ver); \
62 $(MV) $$tmp_dir/$$tarball ..; \
63 $(RM) -rf $$tmp_dir;
64
65 $(VERSION_HDR): version_info.mk
66 @$(ECHO_INFO) "creating the version header file"
67 @hdr="$(VERSION_HDR)"; \
68 $(ECHO) "/* automatically generated - do not edit */" > $$hdr; \
69 $(ECHO) "#ifndef _VERSION_H" >> $$hdr; \
70 $(ECHO) "#define _VERSION_H" >> $$hdr; \
71 $(ECHO) "#define VERSION_RELEASE \"$(VERSION_RELEASE)\"" >> $$hdr; \
72 $(ECHO) "#define VERSION_MAJOR $(VERSION_MAJOR)" >> $$hdr; \
73 $(ECHO) "#define VERSION_MINOR $(VERSION_MINOR)" >> $$hdr; \
74 $(ECHO) "#define VERSION_MICRO $(VERSION_MICRO)" >> $$hdr; \
75 $(ECHO) "#endif" >> $$hdr;
76
77 include: $(VERSION_HDR) $(CONFIGS)
78 @$(ECHO_INFO) "building in directory $@/ ..."
79 @$(MAKE) -C $@
80
81 src: $(VERSION_HDR) $(CONFIGS) include
82 @$(ECHO_INFO) "building in directory $@/ ..."
83 @$(MAKE) -C $@
84
85 tests: src include
86 @$(ECHO_INFO) "building in directory $@/ ..."
87 @$(MAKE) -C $@
88
89 tools: src include
90 @$(ECHO_INFO) "building in directory $@/ ..."
91 @$(MAKE) -C $@
92
93 install: $(SUBDIRS_BUILD)
94 @$(ECHO_INFO) "installing in $(INSTALL_PREFIX) ..."
95 $(INSTALL_PC_MACRO) libseccomp.pc
96 @for dir in $(SUBDIRS_INSTALL); do \
97 $(ECHO_INFO) "installing from $$dir/"; \
98 $(MAKE) -C $$dir install; \
99 done
100
101 check: tools tests
102 @$(ECHO_INFO) "checking in directory tests/ ..."
103 @$(MAKE) -C tests check
104
105 check-syntax:
106 @./tools/check-syntax
107
108 ctags:
109 @$(ECHO_INFO) "generating ctags for the project ..."
110 @ctags -R *
111
112 cstags:
113 @$(ECHO_INFO) "generating cscope tags for the project ..."
114 @find -iname *.[ch] > cscope.files
115 @cscope -b -q -k
116
117 clean:
118 @$(ECHO_INFO) "cleaning up libseccomp"
119 @for dir in $(SUBDIRS_BUILD); do \
120 $(MAKE) -C $$dir clean; \
121 done
122
123 dist-clean: clean
124 @$(ECHO_INFO) "removing the configuration files"
125 @$(RM) $(CONFIGS)
0 ####
1 # Seccomp Library
2 #
3
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the terms of version 2.1 of the GNU Lesser General Public License
7 # as published by the Free Software Foundation.
8 #
9 # This library is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses>.
16 #
17
18 ACLOCAL_AMFLAGS = -I m4
19 SUBDIRS = include src tools tests doc
20
21 pkgconfdir = ${libdir}/pkgconfig
22 pkgconf_DATA = libseccomp.pc
23
24 EXTRA_DIST = CHANGELOG CREDITS LICENSE README SUBMITTING_PATCHES
25
26 # support silent builds
27 AM_MAKEFLAGS_0 = --quiet --no-print-directory
28 AM_MAKEFLAGS_1 =
29 AM_MAKEFLAGS_ = ${AM_MAKEFLAGS_0}
30 AM_MAKEFLAGS = ${AM_MAKEFLAGS_@AM_V@}
31
32 check-build: all
33 ${MAKE} ${AM_MAKEFLAGS} -C src check-build
34 ${MAKE} ${AM_MAKEFLAGS} -C tests check-build
35
36 check-syntax:
37 @./tools/check-syntax
38
39 if COVERITY
40 coverity-build: clean
41 cov-build --dir cov-int ${MAKE} ${AM_MAKEFLAGS} check-build
42 endif
43
44 if COVERITY
45 coverity-tarball: coverity-build
46 @if git rev-parse HEAD &> /dev/null; then \
47 rev_full=$$(git rev-parse HEAD); \
48 rev=$$(echo $$rev_full | cut -c1-8); \
49 else \
50 rev_full=$$(date --iso-8601=date); \
51 rev=$$rev_full; \
52 fi; \
53 tar czf libseccomp-coverity_$$rev.tar.gz cov-int; \
54 echo " HEAD revision: $$rev_full"; \
55 ls -l libseccomp-coverity_$$rev.tar.gz
56 endif
57
58 clean-local:
59 ${RM} -rf cov-int libseccomp-coverity_*.tar.gz
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
4
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 ####
17 # Seccomp Library
18 #
19
20 #
21 # This library is free software; you can redistribute it and/or modify it
22 # under the terms of version 2.1 of the GNU Lesser General Public License
23 # as published by the Free Software Foundation.
24 #
25 # This library is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
28 # General Public License for more details.
29 #
30 # You should have received a copy of the GNU Lesser General Public License
31 # along with this library; if not, see <http://www.gnu.org/licenses>.
32 #
33
34 VPATH = @srcdir@
35 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
36 am__make_running_with_option = \
37 case $${target_option-} in \
38 ?) ;; \
39 *) echo "am__make_running_with_option: internal error: invalid" \
40 "target option '$${target_option-}' specified" >&2; \
41 exit 1;; \
42 esac; \
43 has_opt=no; \
44 sane_makeflags=$$MAKEFLAGS; \
45 if $(am__is_gnu_make); then \
46 sane_makeflags=$$MFLAGS; \
47 else \
48 case $$MAKEFLAGS in \
49 *\\[\ \ ]*) \
50 bs=\\; \
51 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
52 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
53 esac; \
54 fi; \
55 skip_next=no; \
56 strip_trailopt () \
57 { \
58 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
59 }; \
60 for flg in $$sane_makeflags; do \
61 test $$skip_next = yes && { skip_next=no; continue; }; \
62 case $$flg in \
63 *=*|--*) continue;; \
64 -*I) strip_trailopt 'I'; skip_next=yes;; \
65 -*I?*) strip_trailopt 'I';; \
66 -*O) strip_trailopt 'O'; skip_next=yes;; \
67 -*O?*) strip_trailopt 'O';; \
68 -*l) strip_trailopt 'l'; skip_next=yes;; \
69 -*l?*) strip_trailopt 'l';; \
70 -[dEDm]) skip_next=yes;; \
71 -[JT]) skip_next=yes;; \
72 esac; \
73 case $$flg in \
74 *$$target_option*) has_opt=yes; break;; \
75 esac; \
76 done; \
77 test $$has_opt = yes
78 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
79 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
80 pkgdatadir = $(datadir)/@PACKAGE@
81 pkgincludedir = $(includedir)/@PACKAGE@
82 pkglibdir = $(libdir)/@PACKAGE@
83 pkglibexecdir = $(libexecdir)/@PACKAGE@
84 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
85 install_sh_DATA = $(install_sh) -c -m 644
86 install_sh_PROGRAM = $(install_sh) -c
87 install_sh_SCRIPT = $(install_sh) -c
88 INSTALL_HEADER = $(INSTALL_DATA)
89 transform = $(program_transform_name)
90 NORMAL_INSTALL = :
91 PRE_INSTALL = :
92 POST_INSTALL = :
93 NORMAL_UNINSTALL = :
94 PRE_UNINSTALL = :
95 POST_UNINSTALL = :
96 build_triplet = @build@
97 host_triplet = @host@
98 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
111 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
116 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
117 $(ACLOCAL_M4)
118 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
119 configure.lineno config.status.lineno
120 mkinstalldirs = $(install_sh) -d
121 CONFIG_HEADER = configure.h
122 CONFIG_CLEAN_FILES = libseccomp.pc
123 CONFIG_CLEAN_VPATH_FILES =
124 AM_V_P = $(am__v_P_@AM_V@)
125 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
126 am__v_P_0 = false
127 am__v_P_1 = :
128 AM_V_GEN = $(am__v_GEN_@AM_V@)
129 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
130 am__v_GEN_0 = @echo " GEN " $@;
131 am__v_GEN_1 =
132 AM_V_at = $(am__v_at_@AM_V@)
133 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
134 am__v_at_0 = @
135 am__v_at_1 =
136 SOURCES =
137 DIST_SOURCES =
138 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
139 ctags-recursive dvi-recursive html-recursive info-recursive \
140 install-data-recursive install-dvi-recursive \
141 install-exec-recursive install-html-recursive \
142 install-info-recursive install-pdf-recursive \
143 install-ps-recursive install-recursive installcheck-recursive \
144 installdirs-recursive pdf-recursive ps-recursive \
145 tags-recursive uninstall-recursive
146 am__can_run_installinfo = \
147 case $$AM_UPDATE_INFO_DIR in \
148 n|no|NO) false;; \
149 *) (install-info --version) >/dev/null 2>&1;; \
150 esac
151 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
152 am__vpath_adj = case $$p in \
153 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
154 *) f=$$p;; \
155 esac;
156 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
157 am__install_max = 40
158 am__nobase_strip_setup = \
159 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
160 am__nobase_strip = \
161 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
162 am__nobase_list = $(am__nobase_strip_setup); \
163 for p in $$list; do echo "$$p $$p"; done | \
164 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
165 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
166 if (++n[$$2] == $(am__install_max)) \
167 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
168 END { for (dir in files) print dir, files[dir] }'
169 am__base_list = \
170 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
171 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
172 am__uninstall_files_from_dir = { \
173 test -z "$$files" \
174 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
175 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
176 $(am__cd) "$$dir" && rm -f $$files; }; \
177 }
178 am__installdirs = "$(DESTDIR)$(pkgconfdir)"
179 DATA = $(pkgconf_DATA)
180 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
181 distclean-recursive maintainer-clean-recursive
182 am__recursive_targets = \
183 $(RECURSIVE_TARGETS) \
184 $(RECURSIVE_CLEAN_TARGETS) \
185 $(am__extra_recursive_targets)
186 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
187 cscope distdir dist dist-all distcheck
188 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
189 $(LISP)configure.h.in
190 # Read a list of newline-separated strings from the standard input,
191 # and print each of them once, without duplicates. Input order is
192 # *not* preserved.
193 am__uniquify_input = $(AWK) '\
194 BEGIN { nonempty = 0; } \
195 { items[$$0] = 1; nonempty = 1; } \
196 END { if (nonempty) { for (i in items) print i; }; } \
197 '
198 # Make sure the list of sources is unique. This is necessary because,
199 # e.g., the same source file might be shared among _SOURCES variables
200 # for different programs/libraries.
201 am__define_uniq_tagged_files = \
202 list='$(am__tagged_files)'; \
203 unique=`for i in $$list; do \
204 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
205 done | $(am__uniquify_input)`
206 ETAGS = etags
207 CTAGS = ctags
208 CSCOPE = cscope
209 DIST_SUBDIRS = $(SUBDIRS)
210 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
211 distdir = $(PACKAGE)-$(VERSION)
212 top_distdir = $(distdir)
213 am__remove_distdir = \
214 if test -d "$(distdir)"; then \
215 find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
216 && rm -rf "$(distdir)" \
217 || { sleep 5 && rm -rf "$(distdir)"; }; \
218 else :; fi
219 am__post_remove_distdir = $(am__remove_distdir)
220 am__relativize = \
221 dir0=`pwd`; \
222 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
223 sed_rest='s,^[^/]*/*,,'; \
224 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
225 sed_butlast='s,/*[^/]*$$,,'; \
226 while test -n "$$dir1"; do \
227 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
228 if test "$$first" != "."; then \
229 if test "$$first" = ".."; then \
230 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
231 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
232 else \
233 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
234 if test "$$first2" = "$$first"; then \
235 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
236 else \
237 dir2="../$$dir2"; \
238 fi; \
239 dir0="$$dir0"/"$$first"; \
240 fi; \
241 fi; \
242 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
243 done; \
244 reldir="$$dir2"
245 DIST_ARCHIVES = $(distdir).tar.gz
246 GZIP_ENV = --best
247 DIST_TARGETS = dist-gzip
248 distuninstallcheck_listfiles = find . -type f -print
249 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
250 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
251 distcleancheck_listfiles = find . -type f -print
252 ACLOCAL = @ACLOCAL@
253 AMTAR = @AMTAR@
254 AM_CFLAGS = @AM_CFLAGS@
255 AM_CPPFLAGS = @AM_CPPFLAGS@
256 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
257 AM_LDFLAGS = @AM_LDFLAGS@
258 AR = @AR@
259 AUTOCONF = @AUTOCONF@
260 AUTOHEADER = @AUTOHEADER@
261 AUTOMAKE = @AUTOMAKE@
262 AWK = @AWK@
263 CC = @CC@
264 CCDEPMODE = @CCDEPMODE@
265 CFLAGS = @CFLAGS@
266 CPP = @CPP@
267 CPPFLAGS = @CPPFLAGS@
268 CYGPATH_W = @CYGPATH_W@
269 DEFS = @DEFS@
270 DEPDIR = @DEPDIR@
271 DLLTOOL = @DLLTOOL@
272 DSYMUTIL = @DSYMUTIL@
273 DUMPBIN = @DUMPBIN@
274 ECHO_C = @ECHO_C@
275 ECHO_N = @ECHO_N@
276 ECHO_T = @ECHO_T@
277 EGREP = @EGREP@
278 EXEEXT = @EXEEXT@
279 FGREP = @FGREP@
280 GREP = @GREP@
281 INSTALL = @INSTALL@
282 INSTALL_DATA = @INSTALL_DATA@
283 INSTALL_PROGRAM = @INSTALL_PROGRAM@
284 INSTALL_SCRIPT = @INSTALL_SCRIPT@
285 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
286 LD = @LD@
287 LDFLAGS = @LDFLAGS@
288 LIBOBJS = @LIBOBJS@
289 LIBS = @LIBS@
290 LIBTOOL = @LIBTOOL@
291 LIPO = @LIPO@
292 LN_S = @LN_S@
293 LTLIBOBJS = @LTLIBOBJS@
294 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
295 MAKEINFO = @MAKEINFO@
296 MANIFEST_TOOL = @MANIFEST_TOOL@
297 MKDIR_P = @MKDIR_P@
298 NM = @NM@
299 NMEDIT = @NMEDIT@
300 OBJDUMP = @OBJDUMP@
301 OBJEXT = @OBJEXT@
302 OTOOL = @OTOOL@
303 OTOOL64 = @OTOOL64@
304 PACKAGE = @PACKAGE@
305 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
306 PACKAGE_NAME = @PACKAGE_NAME@
307 PACKAGE_STRING = @PACKAGE_STRING@
308 PACKAGE_TARNAME = @PACKAGE_TARNAME@
309 PACKAGE_URL = @PACKAGE_URL@
310 PACKAGE_VERSION = @PACKAGE_VERSION@
311 PATH_SEPARATOR = @PATH_SEPARATOR@
312 RANLIB = @RANLIB@
313 SED = @SED@
314 SET_MAKE = @SET_MAKE@
315 SHELL = @SHELL@
316 STRIP = @STRIP@
317 VERSION = @VERSION@
318 VERSION_MAJOR = @VERSION_MAJOR@
319 VERSION_MICRO = @VERSION_MICRO@
320 VERSION_MINOR = @VERSION_MINOR@
321 abs_builddir = @abs_builddir@
322 abs_srcdir = @abs_srcdir@
323 abs_top_builddir = @abs_top_builddir@
324 abs_top_srcdir = @abs_top_srcdir@
325 ac_ct_AR = @ac_ct_AR@
326 ac_ct_CC = @ac_ct_CC@
327 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
328 am__include = @am__include@
329 am__leading_dot = @am__leading_dot@
330 am__quote = @am__quote@
331 am__tar = @am__tar@
332 am__untar = @am__untar@
333 bindir = @bindir@
334 build = @build@
335 build_alias = @build_alias@
336 build_cpu = @build_cpu@
337 build_os = @build_os@
338 build_vendor = @build_vendor@
339 builddir = @builddir@
340 datadir = @datadir@
341 datarootdir = @datarootdir@
342 docdir = @docdir@
343 dvidir = @dvidir@
344 exec_prefix = @exec_prefix@
345 have_coverity = @have_coverity@
346 have_cython = @have_cython@
347 host = @host@
348 host_alias = @host_alias@
349 host_cpu = @host_cpu@
350 host_os = @host_os@
351 host_vendor = @host_vendor@
352 htmldir = @htmldir@
353 includedir = @includedir@
354 infodir = @infodir@
355 install_sh = @install_sh@
356 libdir = @libdir@
357 libexecdir = @libexecdir@
358 localedir = @localedir@
359 localstatedir = @localstatedir@
360 mandir = @mandir@
361 mkdir_p = @mkdir_p@
362 oldincludedir = @oldincludedir@
363 pdfdir = @pdfdir@
364 prefix = @prefix@
365 program_transform_name = @program_transform_name@
366 psdir = @psdir@
367 sbindir = @sbindir@
368 sharedstatedir = @sharedstatedir@
369 srcdir = @srcdir@
370 sysconfdir = @sysconfdir@
371 target_alias = @target_alias@
372 top_build_prefix = @top_build_prefix@
373 top_builddir = @top_builddir@
374 top_srcdir = @top_srcdir@
375 ACLOCAL_AMFLAGS = -I m4
376 SUBDIRS = include src tools tests doc
377 pkgconfdir = ${libdir}/pkgconfig
378 pkgconf_DATA = libseccomp.pc
379 EXTRA_DIST = CHANGELOG CREDITS LICENSE README SUBMITTING_PATCHES
380
381 # support silent builds
382 AM_MAKEFLAGS_0 = --quiet --no-print-directory
383 AM_MAKEFLAGS_1 =
384 AM_MAKEFLAGS_ = ${AM_MAKEFLAGS_0}
385 AM_MAKEFLAGS = ${AM_MAKEFLAGS_@AM_V@}
386 all: configure.h
387 $(MAKE) $(AM_MAKEFLAGS) all-recursive
388
389 .SUFFIXES:
390 am--refresh: Makefile
391 @:
392 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
393 @for dep in $?; do \
394 case '$(am__configure_deps)' in \
395 *$$dep*) \
396 echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
397 $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
398 && exit 0; \
399 exit 1;; \
400 esac; \
401 done; \
402 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
403 $(am__cd) $(top_srcdir) && \
404 $(AUTOMAKE) --foreign Makefile
405 .PRECIOUS: Makefile
406 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
407 @case '$?' in \
408 *config.status*) \
409 echo ' $(SHELL) ./config.status'; \
410 $(SHELL) ./config.status;; \
411 *) \
412 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
413 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
414 esac;
415
416 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
417 $(SHELL) ./config.status --recheck
418
419 $(top_srcdir)/configure: $(am__configure_deps)
420 $(am__cd) $(srcdir) && $(AUTOCONF)
421 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
422 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
423 $(am__aclocal_m4_deps):
424
425 configure.h: stamp-h1
426 @test -f $@ || rm -f stamp-h1
427 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
428
429 stamp-h1: $(srcdir)/configure.h.in $(top_builddir)/config.status
430 @rm -f stamp-h1
431 cd $(top_builddir) && $(SHELL) ./config.status configure.h
432 $(srcdir)/configure.h.in: $(am__configure_deps)
433 ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
434 rm -f stamp-h1
435 touch $@
436
437 distclean-hdr:
438 -rm -f configure.h stamp-h1
439 libseccomp.pc: $(top_builddir)/config.status $(srcdir)/libseccomp.pc.in
440 cd $(top_builddir) && $(SHELL) ./config.status $@
441
442 mostlyclean-libtool:
443 -rm -f *.lo
444
445 clean-libtool:
446 -rm -rf .libs _libs
447
448 distclean-libtool:
449 -rm -f libtool config.lt
450 install-pkgconfDATA: $(pkgconf_DATA)
451 @$(NORMAL_INSTALL)
452 @list='$(pkgconf_DATA)'; test -n "$(pkgconfdir)" || list=; \
453 if test -n "$$list"; then \
454 echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfdir)'"; \
455 $(MKDIR_P) "$(DESTDIR)$(pkgconfdir)" || exit 1; \
456 fi; \
457 for p in $$list; do \
458 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
459 echo "$$d$$p"; \
460 done | $(am__base_list) | \
461 while read files; do \
462 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfdir)'"; \
463 $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfdir)" || exit $$?; \
464 done
465
466 uninstall-pkgconfDATA:
467 @$(NORMAL_UNINSTALL)
468 @list='$(pkgconf_DATA)'; test -n "$(pkgconfdir)" || list=; \
469 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
470 dir='$(DESTDIR)$(pkgconfdir)'; $(am__uninstall_files_from_dir)
471
472 # This directory's subdirectories are mostly independent; you can cd
473 # into them and run 'make' without going through this Makefile.
474 # To change the values of 'make' variables: instead of editing Makefiles,
475 # (1) if the variable is set in 'config.status', edit 'config.status'
476 # (which will cause the Makefiles to be regenerated when you run 'make');
477 # (2) otherwise, pass the desired values on the 'make' command line.
478 $(am__recursive_targets):
479 @fail=; \
480 if $(am__make_keepgoing); then \
481 failcom='fail=yes'; \
482 else \
483 failcom='exit 1'; \
484 fi; \
485 dot_seen=no; \
486 target=`echo $@ | sed s/-recursive//`; \
487 case "$@" in \
488 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
489 *) list='$(SUBDIRS)' ;; \
490 esac; \
491 for subdir in $$list; do \
492 echo "Making $$target in $$subdir"; \
493 if test "$$subdir" = "."; then \
494 dot_seen=yes; \
495 local_target="$$target-am"; \
496 else \
497 local_target="$$target"; \
498 fi; \
499 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
500 || eval $$failcom; \
501 done; \
502 if test "$$dot_seen" = "no"; then \
503 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
504 fi; test -z "$$fail"
505
506 ID: $(am__tagged_files)
507 $(am__define_uniq_tagged_files); mkid -fID $$unique
508 tags: tags-recursive
509 TAGS: tags
510
511 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
512 set x; \
513 here=`pwd`; \
514 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
515 include_option=--etags-include; \
516 empty_fix=.; \
517 else \
518 include_option=--include; \
519 empty_fix=; \
520 fi; \
521 list='$(SUBDIRS)'; for subdir in $$list; do \
522 if test "$$subdir" = .; then :; else \
523 test ! -f $$subdir/TAGS || \
524 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
525 fi; \
526 done; \
527 $(am__define_uniq_tagged_files); \
528 shift; \
529 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
530 test -n "$$unique" || unique=$$empty_fix; \
531 if test $$# -gt 0; then \
532 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
533 "$$@" $$unique; \
534 else \
535 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
536 $$unique; \
537 fi; \
538 fi
539 ctags: ctags-recursive
540
541 CTAGS: ctags
542 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
543 $(am__define_uniq_tagged_files); \
544 test -z "$(CTAGS_ARGS)$$unique" \
545 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
546 $$unique
547
548 GTAGS:
549 here=`$(am__cd) $(top_builddir) && pwd` \
550 && $(am__cd) $(top_srcdir) \
551 && gtags -i $(GTAGS_ARGS) "$$here"
552 cscope: cscope.files
553 test ! -s cscope.files \
554 || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
555 clean-cscope:
556 -rm -f cscope.files
557 cscope.files: clean-cscope cscopelist
558 cscopelist: cscopelist-recursive
559
560 cscopelist-am: $(am__tagged_files)
561 list='$(am__tagged_files)'; \
562 case "$(srcdir)" in \
563 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
564 *) sdir=$(subdir)/$(srcdir) ;; \
565 esac; \
566 for i in $$list; do \
567 if test -f "$$i"; then \
568 echo "$(subdir)/$$i"; \
569 else \
570 echo "$$sdir/$$i"; \
571 fi; \
572 done >> $(top_builddir)/cscope.files
573
574 distclean-tags:
575 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
576 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
577
578 distdir: $(DISTFILES)
579 $(am__remove_distdir)
580 test -d "$(distdir)" || mkdir "$(distdir)"
581 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
582 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
583 list='$(DISTFILES)'; \
584 dist_files=`for file in $$list; do echo $$file; done | \
585 sed -e "s|^$$srcdirstrip/||;t" \
586 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
587 case $$dist_files in \
588 */*) $(MKDIR_P) `echo "$$dist_files" | \
589 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
590 sort -u` ;; \
591 esac; \
592 for file in $$dist_files; do \
593 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
594 if test -d $$d/$$file; then \
595 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
596 if test -d "$(distdir)/$$file"; then \
597 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
598 fi; \
599 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
600 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
601 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
602 fi; \
603 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
604 else \
605 test -f "$(distdir)/$$file" \
606 || cp -p $$d/$$file "$(distdir)/$$file" \
607 || exit 1; \
608 fi; \
609 done
610 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
611 if test "$$subdir" = .; then :; else \
612 $(am__make_dryrun) \
613 || test -d "$(distdir)/$$subdir" \
614 || $(MKDIR_P) "$(distdir)/$$subdir" \
615 || exit 1; \
616 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
617 $(am__relativize); \
618 new_distdir=$$reldir; \
619 dir1=$$subdir; dir2="$(top_distdir)"; \
620 $(am__relativize); \
621 new_top_distdir=$$reldir; \
622 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
623 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
624 ($(am__cd) $$subdir && \
625 $(MAKE) $(AM_MAKEFLAGS) \
626 top_distdir="$$new_top_distdir" \
627 distdir="$$new_distdir" \
628 am__remove_distdir=: \
629 am__skip_length_check=: \
630 am__skip_mode_fix=: \
631 distdir) \
632 || exit 1; \
633 fi; \
634 done
635 -test -n "$(am__skip_mode_fix)" \
636 || find "$(distdir)" -type d ! -perm -755 \
637 -exec chmod u+rwx,go+rx {} \; -o \
638 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
639 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
640 ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
641 || chmod -R a+r "$(distdir)"
642 dist-gzip: distdir
643 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
644 $(am__post_remove_distdir)
645
646 dist-bzip2: distdir
647 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
648 $(am__post_remove_distdir)
649
650 dist-lzip: distdir
651 tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
652 $(am__post_remove_distdir)
653
654 dist-xz: distdir
655 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
656 $(am__post_remove_distdir)
657
658 dist-tarZ: distdir
659 @echo WARNING: "Support for shar distribution archives is" \
660 "deprecated." >&2
661 @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
670 $(am__post_remove_distdir)
671
672 dist-zip: distdir
673 -rm -f $(distdir).zip
674 zip -rq $(distdir).zip $(distdir)
675 $(am__post_remove_distdir)
676
677 dist dist-all:
678 $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
679 $(am__post_remove_distdir)
680
681 # This target untars the dist file and tries a VPATH configuration. Then
682 # it guarantees that the distribution is self-contained by making another
683 # tarfile.
684 distcheck: dist
685 case '$(DIST_ARCHIVES)' in \
686 *.tar.gz*) \
687 GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
688 *.tar.bz2*) \
689 bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
690 *.tar.lz*) \
691 lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
692 *.tar.xz*) \
693 xz -dc $(distdir).tar.xz | $(am__untar) ;;\
694 *.tar.Z*) \
695 uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
696 *.shar.gz*) \
697 GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
698 *.zip*) \
699 unzip $(distdir).zip ;;\
700 esac
701 chmod -R a-w $(distdir)
702 chmod u+w $(distdir)
703 mkdir $(distdir)/_build $(distdir)/_inst
704 chmod a-w $(distdir)
705 test -d $(distdir)/_build || exit 0; \
706 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
707 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
708 && am__cwd=`pwd` \
709 && $(am__cd) $(distdir)/_build \
710 && ../configure \
711 $(AM_DISTCHECK_CONFIGURE_FLAGS) \
712 $(DISTCHECK_CONFIGURE_FLAGS) \
713 --srcdir=.. --prefix="$$dc_install_base" \
714 && $(MAKE) $(AM_MAKEFLAGS) \
715 && $(MAKE) $(AM_MAKEFLAGS) dvi \
716 && $(MAKE) $(AM_MAKEFLAGS) check \
717 && $(MAKE) $(AM_MAKEFLAGS) install \
718 && $(MAKE) $(AM_MAKEFLAGS) installcheck \
719 && $(MAKE) $(AM_MAKEFLAGS) uninstall \
720 && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
721 distuninstallcheck \
722 && chmod -R a-w "$$dc_install_base" \
723 && ({ \
724 (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
725 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
726 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
727 && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
728 distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
729 } || { rm -rf "$$dc_destdir"; exit 1; }) \
730 && rm -rf "$$dc_destdir" \
731 && $(MAKE) $(AM_MAKEFLAGS) dist \
732 && rm -rf $(DIST_ARCHIVES) \
733 && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
734 && cd "$$am__cwd" \
735 || exit 1
736 $(am__post_remove_distdir)
737 @(echo "$(distdir) archives ready for distribution: "; \
738 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
739 sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
740 distuninstallcheck:
741 @test -n '$(distuninstallcheck_dir)' || { \
742 echo 'ERROR: trying to run $@ with an empty' \
743 '$$(distuninstallcheck_dir)' >&2; \
744 exit 1; \
745 }; \
746 $(am__cd) '$(distuninstallcheck_dir)' || { \
747 echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
748 exit 1; \
749 }; \
750 test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
751 || { echo "ERROR: files left after uninstall:" ; \
752 if test -n "$(DESTDIR)"; then \
753 echo " (check DESTDIR support)"; \
754 fi ; \
755 $(distuninstallcheck_listfiles) ; \
756 exit 1; } >&2
757 distcleancheck: distclean
758 @if test '$(srcdir)' = . ; then \
759 echo "ERROR: distcleancheck can only run from a VPATH build" ; \
760 exit 1 ; \
761 fi
762 @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
763 || { echo "ERROR: files left in build directory after distclean:" ; \
764 $(distcleancheck_listfiles) ; \
765 exit 1; } >&2
766 check-am: all-am
767 check: check-recursive
768 all-am: Makefile $(DATA) configure.h
769 installdirs: installdirs-recursive
770 installdirs-am:
771 for dir in "$(DESTDIR)$(pkgconfdir)"; do \
772 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
773 done
774 install: install-recursive
775 install-exec: install-exec-recursive
776 install-data: install-data-recursive
777 uninstall: uninstall-recursive
778
779 install-am: all-am
780 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
781
782 installcheck: installcheck-recursive
783 install-strip:
784 if test -z '$(STRIP)'; then \
785 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
786 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
787 install; \
788 else \
789 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
790 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
791 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
792 fi
793 mostlyclean-generic:
794
795 clean-generic:
796
797 distclean-generic:
798 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
799 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
800
801 maintainer-clean-generic:
802 @echo "This command is intended for maintainers to use"
803 @echo "it deletes files that may require special tools to rebuild."
804 clean: clean-recursive
805
806 clean-am: clean-generic clean-libtool clean-local mostlyclean-am
807
808 distclean: distclean-recursive
809 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
810 -rm -f Makefile
811 distclean-am: clean-am distclean-generic distclean-hdr \
812 distclean-libtool distclean-tags
813
814 dvi: dvi-recursive
815
816 dvi-am:
817
818 html: html-recursive
819
820 html-am:
821
822 info: info-recursive
823
824 info-am:
825
826 install-data-am: install-pkgconfDATA
827
828 install-dvi: install-dvi-recursive
829
830 install-dvi-am:
831
832 install-exec-am:
833
834 install-html: install-html-recursive
835
836 install-html-am:
837
838 install-info: install-info-recursive
839
840 install-info-am:
841
842 install-man:
843
844 install-pdf: install-pdf-recursive
845
846 install-pdf-am:
847
848 install-ps: install-ps-recursive
849
850 install-ps-am:
851
852 installcheck-am:
853
854 maintainer-clean: maintainer-clean-recursive
855 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
856 -rm -rf $(top_srcdir)/autom4te.cache
857 -rm -f Makefile
858 maintainer-clean-am: distclean-am maintainer-clean-generic
859
860 mostlyclean: mostlyclean-recursive
861
862 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
863
864 pdf: pdf-recursive
865
866 pdf-am:
867
868 ps: ps-recursive
869
870 ps-am:
871
872 uninstall-am: uninstall-pkgconfDATA
873
874 .MAKE: $(am__recursive_targets) all install-am install-strip
875
876 .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
877 am--refresh check check-am clean clean-cscope clean-generic \
878 clean-libtool clean-local cscope cscopelist-am ctags ctags-am \
879 dist dist-all dist-bzip2 dist-gzip dist-lzip dist-shar \
880 dist-tarZ dist-xz dist-zip distcheck distclean \
881 distclean-generic distclean-hdr distclean-libtool \
882 distclean-tags distcleancheck distdir distuninstallcheck dvi \
883 dvi-am html html-am info info-am install install-am \
884 install-data install-data-am install-dvi install-dvi-am \
885 install-exec install-exec-am install-html install-html-am \
886 install-info install-info-am install-man install-pdf \
887 install-pdf-am install-pkgconfDATA install-ps install-ps-am \
888 install-strip installcheck installcheck-am installdirs \
889 installdirs-am maintainer-clean maintainer-clean-generic \
890 mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
891 ps ps-am tags tags-am uninstall uninstall-am \
892 uninstall-pkgconfDATA
893
894
895 check-build: all
896 ${MAKE} ${AM_MAKEFLAGS} -C src check-build
897 ${MAKE} ${AM_MAKEFLAGS} -C tests check-build
898
899 check-syntax:
900 @./tools/check-syntax
901
902 @COVERITY_TRUE@coverity-build: clean
903 @COVERITY_TRUE@ cov-build --dir cov-int ${MAKE} ${AM_MAKEFLAGS} check-build
904
905 @COVERITY_TRUE@coverity-tarball: coverity-build
906 @COVERITY_TRUE@ @if git rev-parse HEAD &> /dev/null; then \
907 @COVERITY_TRUE@ rev_full=$$(git rev-parse HEAD); \
908 @COVERITY_TRUE@ rev=$$(echo $$rev_full | cut -c1-8); \
909 @COVERITY_TRUE@ else \
910 @COVERITY_TRUE@ rev_full=$$(date --iso-8601=date); \
911 @COVERITY_TRUE@ rev=$$rev_full; \
912 @COVERITY_TRUE@ fi; \
913 @COVERITY_TRUE@ tar czf libseccomp-coverity_$$rev.tar.gz cov-int; \
914 @COVERITY_TRUE@ echo " HEAD revision: $$rev_full"; \
915 @COVERITY_TRUE@ ls -l libseccomp-coverity_$$rev.tar.gz
916
917 clean-local:
918 ${RM} -rf cov-int libseccomp-coverity_*.tar.gz
919
920 # Tell versions [3.59,3.63) of GNU make to not export all variables.
921 # Otherwise a system limit (for SysV at least) may be exceeded.
922 .NOEXPORT:
00 libseccomp: An Enhanced Seccomp (mode 2) Helper Library
11 ===============================================================================
2 http://libseccomp.sf.net
2 https://github.com/seccomp/libseccomp
33
4 The libseccomp library provides and easy to use, platform independent,
5 interface to the Linux Kernel's syscall filtering mechanism: seccomp. The
6 libseccomp API is designed to abstract away the underlying BPF based syscall
7 filter language and present a more conventional function-call based filtering
8 interface that should be familiar to, and easily adopted by application
9 developers.
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/d/forum/libseccomp
1021
1122 * Documentation
1223
13 The "doc/" directory contains all of the documentation aside from the README
14 file (this file) and the LICENSE file which can be found in the top level
15 directory.
24 The "doc/" directory contains all of the currently available documentation,
25 mostly in the form of manpages. The top level directory also contains a README
26 file (this file) as well as the LICENSE, CREDITS, SUBMITTING_PATCHES, and
27 CHANGELOG files.
28
29 Those who are interested in contributing to the the project are encouraged to
30 read the SUBMITTING_PATCHES in the top level directory.
1631
1732 * Building and Installing the Library
1833
19 In order to build the library you should follow the familiar three step
20 process used by most applications:
34 If you are building the libseccomp library from an official release tarball,
35 you should follow the familiar three step process used by most autotools based
36 applications:
2137
2238 # ./configure
2339 # make [V=0|1]
2440 # make install
2541
26 As usual, running "./configure -h" will display a list of build-time
42 However, if you are building the library from sources retrieved from the source
43 repository you may need to run the autogen.sh script before running configure.
44 In both cases, running "./configure -h" will display a list of build-time
2745 configuration options.
2846
2947 * Testing the Library
3048
31 There are a number of tests located in the "tests/" directory and a script
32 which can be used to help automate their execution, "regression". If you want
33 to run all of the tests you can simply run the script:
49 There are a number of tests located in the "tests/" directory and a make target
50 which can be used to help automate their execution. If you want to run the
51 standard regression tests you can execute the following after building the
52 library:
3453
35 # ./configure
36 # make
37 # cd tests
38 # ./regression
54 # make check
3955
40 However, the script takes a number of options to customize its execution; the
41 options can be displayed by running "./regression -h".
56 Be warned that the test run can take a while to run and produces a lot of
57 output.
4258
4359 * Other Useful Tools
4460
4561 The "tools/" directory includes a number of tools which may be helpful in the
46 development of the library, or applications using the library, but for various
47 reasons are not installed by default.
62 development of the library, or applications using the library. Not all of
63 these tools are installed by default.
0 How to Submit Patches to the libseccomp Project
1 ===============================================================================
2 https://github.com/seccomp/libseccomp
3
4 This document is intended to act as a guide to help you contribute to the
5 libseccomp project. It is not perfect, and there will always be exceptions
6 to the rules described here, but by following the instructions below you
7 should have a much easier time getting your work merged with the upstream
8 project.
9
10 * Test Your Code
11
12 There are three possible tests you can run to verify your code. The first
13 test is used to check the formatting and coding style of your changes, you
14 can run the test with the following command:
15
16 # make check-syntax
17
18 ... if there are any problems with your changes a diff/patch will be shown
19 which indicates the problems and how to fix them.
20
21 The second possible test is used to ensure that the different internal syscall
22 tables are consistent and to test your changes against the automated test
23 suite. You can run the test with the following command:
24
25 # make check
26
27 ... if there are any faults or errors they will be displayed; beware that the
28 tests can run for some time and produce a lot of output.
29
30 The third possible test is used to validate libseccomp against a live, running
31 system using some simple regression tests. After ensuring that your system
32 supports seccomp filters you can run the live tests with the following
33 command:
34
35 # make check-build
36 # cd tests
37 # ./regression -T live
38
39 ... if there are any faults or errors they will be displayed.
40
41 * Generate the Patch(es)
42
43 Depending on how you decided to work with the libseccomp code base and what
44 tools you are using there are different ways to generate your patch(es).
45 However, regardless of what tools you use, you should always generate your
46 patches using the "unified" diff/patch format and the patches should always
47 apply to the libseccomp source tree using the following command from the top
48 directory of the libseccomp sources:
49
50 # patch -p1 < changes.patch
51
52 If you are not using git, stacked git (stgit), or some other tool which can
53 generate patch files for you automatically, you may find the following command
54 helpful in generating patches, where "libseccomp.orig/" is the unmodified
55 source code directory and "libseccomp/" is the source code directory with your
56 changes:
57
58 # diff -purN libseccomp.orig/ libseccomp/
59
60 When in doubt please generate your patch and try applying it to an unmodified
61 copy of the libseccomp sources; if it fails for you, it will fail for the rest
62 of us.
63
64 * Explain Your Work
65
66 At the top of every patch you should include a description of the problem you
67 are trying to solve, how you solved it, and why you chose the solution you
68 implemented. If you are submitting a bug fix, it is also incredibly helpful
69 if you can describe/include a reproducer for the problem in the description as
70 well as instructions on how to test for the bug and verify that it has been
71 fixed.
72
73 * Sign Your Work
74
75 The sign-off is a simple line at the end of the patch description, which
76 certifies that you wrote it or otherwise have the right to pass it on as an
77 open-source patch. The "Developer's Certificate of Origin" pledge is taken
78 from the Linux Kernel and the rules are pretty simple:
79
80 Developer's Certificate of Origin 1.1
81
82 By making a contribution to this project, I certify that:
83
84 (a) The contribution was created in whole or in part by me and I
85 have the right to submit it under the open source license
86 indicated in the file; or
87
88 (b) The contribution is based upon previous work that, to the best
89 of my knowledge, is covered under an appropriate open source
90 license and I have the right under that license to submit that
91 work with modifications, whether created in whole or in part
92 by me, under the same open source license (unless I am
93 permitted to submit under a different license), as indicated
94 in the file; or
95
96 (c) The contribution was provided directly to me by some other
97 person who certified (a), (b) or (c) and I have not modified
98 it.
99
100 (d) I understand and agree that this project and the contribution
101 are public and that a record of the contribution (including all
102 personal information I submit with it, including my sign-off) is
103 maintained indefinitely and may be redistributed consistent with
104 this project or the open source license(s) involved.
105
106 ... then you just add a line to the bottom of your patch description, with
107 your real name, saying:
108
109 Signed-off-by: Random J Developer <random@developer.example.org>
110
111 * Email Your Patch(es)
112
113 Finally, you will need to email your patches to the mailing list so they can
114 be reviewed and potentially merged into the main libseccomp repository. When
115 sending patches to the mailing list it is important to send your email in text
116 form, no HTML mail please, and ensure that your email client does not mangle
117 your patches. It should be possible to save your raw email to disk and apply
118 it directly to the libseccomp source code; if that fails then you likely have
119 a problem with your email client. When in doubt try a test first by sending
120 yourself an email with your patch and attempting to apply the emailed patch to
121 the libseccomp repository; if it fails for you, it will fail for the rest of
122 us trying to test your patch and include it in the main libseccomp repository.
0 # generated automatically by aclocal 1.14.1 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
3
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
7
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 # PARTICULAR PURPOSE.
12
13 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
14 m4_ifndef([AC_AUTOCONF_VERSION],
15 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
17 [m4_warning([this file was generated for autoconf 2.69.
18 You have another version of autoconf. It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
21
22 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
23 #
24 # This file is free software; the Free Software Foundation
25 # gives unlimited permission to copy and/or distribute it,
26 # with or without modifications, as long as this notice is preserved.
27
28 # AM_AUTOMAKE_VERSION(VERSION)
29 # ----------------------------
30 # Automake X.Y traces this macro to ensure aclocal.m4 has been
31 # generated from the m4 files accompanying Automake X.Y.
32 # (This private macro should not be called outside this file.)
33 AC_DEFUN([AM_AUTOMAKE_VERSION],
34 [am__api_version='1.14'
35 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
36 dnl require some minimum version. Point them to the right macro.
37 m4_if([$1], [1.14.1], [],
38 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
39 ])
40
41 # _AM_AUTOCONF_VERSION(VERSION)
42 # -----------------------------
43 # aclocal traces this macro to find the Autoconf version.
44 # This is a private macro too. Using m4_define simplifies
45 # the logic in aclocal, which can simply ignore this definition.
46 m4_define([_AM_AUTOCONF_VERSION], [])
47
48 # AM_SET_CURRENT_AUTOMAKE_VERSION
49 # -------------------------------
50 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
51 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
52 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53 [AM_AUTOMAKE_VERSION([1.14.1])dnl
54 m4_ifndef([AC_AUTOCONF_VERSION],
55 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
56 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
57
58 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
59 #
60 # This file is free software; the Free Software Foundation
61 # gives unlimited permission to copy and/or distribute it,
62 # with or without modifications, as long as this notice is preserved.
63
64 # AM_PROG_AR([ACT-IF-FAIL])
65 # -------------------------
66 # Try to determine the archiver interface, and trigger the ar-lib wrapper
67 # if it is needed. If the detection of archiver interface fails, run
68 # ACT-IF-FAIL (default is to abort configure with a proper error message).
69 AC_DEFUN([AM_PROG_AR],
70 [AC_BEFORE([$0], [LT_INIT])dnl
71 AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
72 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
73 AC_REQUIRE_AUX_FILE([ar-lib])dnl
74 AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
75 : ${AR=ar}
76
77 AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
78 [AC_LANG_PUSH([C])
79 am_cv_ar_interface=ar
80 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
81 [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
82 AC_TRY_EVAL([am_ar_try])
83 if test "$ac_status" -eq 0; then
84 am_cv_ar_interface=ar
85 else
86 am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
87 AC_TRY_EVAL([am_ar_try])
88 if test "$ac_status" -eq 0; then
89 am_cv_ar_interface=lib
90 else
91 am_cv_ar_interface=unknown
92 fi
93 fi
94 rm -f conftest.lib libconftest.a
95 ])
96 AC_LANG_POP([C])])
97
98 case $am_cv_ar_interface in
99 ar)
100 ;;
101 lib)
102 # Microsoft lib, so override with the ar-lib wrapper script.
103 # FIXME: It is wrong to rewrite AR.
104 # But if we don't then we get into trouble of one sort or another.
105 # A longer-term fix would be to have automake use am__AR in this case,
106 # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
107 # similar.
108 AR="$am_aux_dir/ar-lib $AR"
109 ;;
110 unknown)
111 m4_default([$1],
112 [AC_MSG_ERROR([could not determine $AR interface])])
113 ;;
114 esac
115 AC_SUBST([AR])dnl
116 ])
117
118 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
119
120 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
121 #
122 # This file is free software; the Free Software Foundation
123 # gives unlimited permission to copy and/or distribute it,
124 # with or without modifications, as long as this notice is preserved.
125
126 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
127 # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
128 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
129 #
130 # Of course, Automake must honor this variable whenever it calls a
131 # tool from the auxiliary directory. The problem is that $srcdir (and
132 # therefore $ac_aux_dir as well) can be either absolute or relative,
133 # depending on how configure is run. This is pretty annoying, since
134 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
135 # source directory, any form will work fine, but in subdirectories a
136 # relative path needs to be adjusted first.
137 #
138 # $ac_aux_dir/missing
139 # fails when called from a subdirectory if $ac_aux_dir is relative
140 # $top_srcdir/$ac_aux_dir/missing
141 # fails if $ac_aux_dir is absolute,
142 # fails when called from a subdirectory in a VPATH build with
143 # a relative $ac_aux_dir
144 #
145 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
146 # are both prefixed by $srcdir. In an in-source build this is usually
147 # harmless because $srcdir is '.', but things will broke when you
148 # start a VPATH build or use an absolute $srcdir.
149 #
150 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
151 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
152 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
153 # and then we would define $MISSING as
154 # MISSING="\${SHELL} $am_aux_dir/missing"
155 # This will work as long as MISSING is not called from configure, because
156 # unfortunately $(top_srcdir) has no meaning in configure.
157 # However there are other variables, like CC, which are often used in
158 # configure, and could therefore not use this "fixed" $ac_aux_dir.
159 #
160 # Another solution, used here, is to always expand $ac_aux_dir to an
161 # absolute PATH. The drawback is that using absolute paths prevent a
162 # configured tree to be moved without reconfiguration.
163
164 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`
169 ])
170
171 # AM_CONDITIONAL -*- Autoconf -*-
172
173 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
174 #
175 # This file is free software; the Free Software Foundation
176 # gives unlimited permission to copy and/or distribute it,
177 # with or without modifications, as long as this notice is preserved.
178
179 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
180 # -------------------------------------
181 # Define a conditional.
182 AC_DEFUN([AM_CONDITIONAL],
183 [AC_PREREQ([2.52])dnl
184 m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
185 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
186 AC_SUBST([$1_TRUE])dnl
187 AC_SUBST([$1_FALSE])dnl
188 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
189 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
190 m4_define([_AM_COND_VALUE_$1], [$2])dnl
191 if $2; then
192 $1_TRUE=
193 $1_FALSE='#'
194 else
195 $1_TRUE='#'
196 $1_FALSE=
197 fi
198 AC_CONFIG_COMMANDS_PRE(
199 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
200 AC_MSG_ERROR([[conditional "$1" was never defined.
201 Usually this means the macro was only invoked conditionally.]])
202 fi])])
203
204 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
205 #
206 # This file is free software; the Free Software Foundation
207 # gives unlimited permission to copy and/or distribute it,
208 # with or without modifications, as long as this notice is preserved.
209
210
211 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
212 # written in clear, in which case automake, when reading aclocal.m4,
213 # will think it sees a *use*, and therefore will trigger all it's
214 # C support machinery. Also note that it means that autoscan, seeing
215 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
216
217
218 # _AM_DEPENDENCIES(NAME)
219 # ----------------------
220 # See how the compiler implements dependency checking.
221 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
222 # We try a few techniques and use that to set a single cache variable.
223 #
224 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
225 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
226 # dependency, and given that the user is not expected to run this macro,
227 # just rely on AC_PROG_CC.
228 AC_DEFUN([_AM_DEPENDENCIES],
229 [AC_REQUIRE([AM_SET_DEPDIR])dnl
230 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
231 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
232 AC_REQUIRE([AM_DEP_TRACK])dnl
233
234 m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
235 [$1], [CXX], [depcc="$CXX" am_compiler_list=],
236 [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
237 [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
238 [$1], [UPC], [depcc="$UPC" am_compiler_list=],
239 [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
240 [depcc="$$1" am_compiler_list=])
241
242 AC_CACHE_CHECK([dependency style of $depcc],
243 [am_cv_$1_dependencies_compiler_type],
244 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
245 # We make a subdir and do the tests there. Otherwise we can end up
246 # making bogus files that we don't know about and never remove. For
247 # instance it was reported that on HP-UX the gcc test will end up
248 # making a dummy file named 'D' -- because '-MD' means "put the output
249 # in D".
250 rm -rf conftest.dir
251 mkdir conftest.dir
252 # Copy depcomp to subdir because otherwise we won't find it if we're
253 # using a relative directory.
254 cp "$am_depcomp" conftest.dir
255 cd conftest.dir
256 # We will build objects and dependencies in a subdirectory because
257 # it helps to detect inapplicable dependency modes. For instance
258 # both Tru64's cc and ICC support -MD to output dependencies as a
259 # side effect of compilation, but ICC will put the dependencies in
260 # the current directory while Tru64 will put them in the object
261 # directory.
262 mkdir sub
263
264 am_cv_$1_dependencies_compiler_type=none
265 if test "$am_compiler_list" = ""; then
266 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
267 fi
268 am__universal=false
269 m4_case([$1], [CC],
270 [case " $depcc " in #(
271 *\ -arch\ *\ -arch\ *) am__universal=true ;;
272 esac],
273 [CXX],
274 [case " $depcc " in #(
275 *\ -arch\ *\ -arch\ *) am__universal=true ;;
276 esac])
277
278 for depmode in $am_compiler_list; do
279 # Setup a source with many dependencies, because some compilers
280 # like to wrap large dependency lists on column 80 (with \), and
281 # we should not choose a depcomp mode which is confused by this.
282 #
283 # We need to recreate these files for each test, as the compiler may
284 # overwrite some of them when testing with obscure command lines.
285 # This happens at least with the AIX C compiler.
286 : > sub/conftest.c
287 for i in 1 2 3 4 5 6; do
288 echo '#include "conftst'$i'.h"' >> sub/conftest.c
289 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
290 # Solaris 10 /bin/sh.
291 echo '/* dummy */' > sub/conftst$i.h
292 done
293 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
294
295 # We check with '-c' and '-o' for the sake of the "dashmstdout"
296 # mode. It turns out that the SunPro C++ compiler does not properly
297 # handle '-M -o', and we need to detect this. Also, some Intel
298 # versions had trouble with output in subdirs.
299 am__obj=sub/conftest.${OBJEXT-o}
300 am__minus_obj="-o $am__obj"
301 case $depmode in
302 gcc)
303 # This depmode causes a compiler race in universal mode.
304 test "$am__universal" = false || continue
305 ;;
306 nosideeffect)
307 # After this tag, mechanisms are not by side-effect, so they'll
308 # only be used when explicitly requested.
309 if test "x$enable_dependency_tracking" = xyes; then
310 continue
311 else
312 break
313 fi
314 ;;
315 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
316 # This compiler won't grok '-c -o', but also, the minuso test has
317 # not run yet. These depmodes are late enough in the game, and
318 # so weak that their functioning should not be impacted.
319 am__obj=conftest.${OBJEXT-o}
320 am__minus_obj=
321 ;;
322 none) break ;;
323 esac
324 if depmode=$depmode \
325 source=sub/conftest.c object=$am__obj \
326 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
327 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
328 >/dev/null 2>conftest.err &&
329 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
330 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
331 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
332 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
333 # icc doesn't choke on unknown options, it will just issue warnings
334 # or remarks (even with -Werror). So we grep stderr for any message
335 # that says an option was ignored or not supported.
336 # When given -MP, icc 7.0 and 7.1 complain thusly:
337 # icc: Command line warning: ignoring option '-M'; no argument required
338 # The diagnosis changed in icc 8.0:
339 # icc: Command line remark: option '-MP' not supported
340 if (grep 'ignoring option' conftest.err ||
341 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
342 am_cv_$1_dependencies_compiler_type=$depmode
343 break
344 fi
345 fi
346 done
347
348 cd ..
349 rm -rf conftest.dir
350 else
351 am_cv_$1_dependencies_compiler_type=none
352 fi
353 ])
354 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
355 AM_CONDITIONAL([am__fastdep$1], [
356 test "x$enable_dependency_tracking" != xno \
357 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
358 ])
359
360
361 # AM_SET_DEPDIR
362 # -------------
363 # Choose a directory name for dependency files.
364 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
365 AC_DEFUN([AM_SET_DEPDIR],
366 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
367 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
368 ])
369
370
371 # AM_DEP_TRACK
372 # ------------
373 AC_DEFUN([AM_DEP_TRACK],
374 [AC_ARG_ENABLE([dependency-tracking], [dnl
375 AS_HELP_STRING(
376 [--enable-dependency-tracking],
377 [do not reject slow dependency extractors])
378 AS_HELP_STRING(
379 [--disable-dependency-tracking],
380 [speeds up one-time build])])
381 if test "x$enable_dependency_tracking" != xno; then
382 am_depcomp="$ac_aux_dir/depcomp"
383 AMDEPBACKSLASH='\'
384 am__nodep='_no'
385 fi
386 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
387 AC_SUBST([AMDEPBACKSLASH])dnl
388 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
389 AC_SUBST([am__nodep])dnl
390 _AM_SUBST_NOTMAKE([am__nodep])dnl
391 ])
392
393 # Generate code to set up dependency tracking. -*- Autoconf -*-
394
395 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
396 #
397 # This file is free software; the Free Software Foundation
398 # gives unlimited permission to copy and/or distribute it,
399 # with or without modifications, as long as this notice is preserved.
400
401
402 # _AM_OUTPUT_DEPENDENCY_COMMANDS
403 # ------------------------------
404 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
405 [{
406 # Older Autoconf quotes --file arguments for eval, but not when files
407 # are listed without --file. Let's play safe and only enable the eval
408 # if we detect the quoting.
409 case $CONFIG_FILES in
410 *\'*) eval set x "$CONFIG_FILES" ;;
411 *) set x $CONFIG_FILES ;;
412 esac
413 shift
414 for mf
415 do
416 # Strip MF so we end up with the name of the file.
417 mf=`echo "$mf" | sed -e 's/:.*$//'`
418 # Check whether this is an Automake generated Makefile or not.
419 # We used to match only the files named 'Makefile.in', but
420 # some people rename them; so instead we look at the file content.
421 # Grep'ing the first line is not enough: some people post-process
422 # each Makefile.in and add a new line on top of each file to say so.
423 # Grep'ing the whole file is not good either: AIX grep has a line
424 # limit of 2048, but all sed's we know have understand at least 4000.
425 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
426 dirpart=`AS_DIRNAME("$mf")`
427 else
428 continue
429 fi
430 # Extract the definition of DEPDIR, am__include, and am__quote
431 # from the Makefile without running 'make'.
432 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
433 test -z "$DEPDIR" && continue
434 am__include=`sed -n 's/^am__include = //p' < "$mf"`
435 test -z "$am__include" && continue
436 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
437 # Find all dependency output files, they are included files with
438 # $(DEPDIR) in their names. We invoke sed twice because it is the
439 # simplest approach to changing $(DEPDIR) to its actual value in the
440 # expansion.
441 for file in `sed -n "
442 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
443 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
444 # Make sure the directory exists.
445 test -f "$dirpart/$file" && continue
446 fdir=`AS_DIRNAME(["$file"])`
447 AS_MKDIR_P([$dirpart/$fdir])
448 # echo "creating $dirpart/$file"
449 echo '# dummy' > "$dirpart/$file"
450 done
451 done
452 }
453 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
454
455
456 # AM_OUTPUT_DEPENDENCY_COMMANDS
457 # -----------------------------
458 # This macro should only be invoked once -- use via AC_REQUIRE.
459 #
460 # This code is only required when automatic dependency tracking
461 # is enabled. FIXME. This creates each '.P' file that we will
462 # need in order to bootstrap the dependency handling code.
463 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
464 [AC_CONFIG_COMMANDS([depfiles],
465 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
466 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
467 ])
468
469 # Do all the work for Automake. -*- Autoconf -*-
470
471 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
472 #
473 # This file is free software; the Free Software Foundation
474 # gives unlimited permission to copy and/or distribute it,
475 # with or without modifications, as long as this notice is preserved.
476
477 # This macro actually does too much. Some checks are only needed if
478 # your package does certain things. But this isn't really a big deal.
479
480 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
481 m4_define([AC_PROG_CC],
482 m4_defn([AC_PROG_CC])
483 [_AM_PROG_CC_C_O
484 ])
485
486 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
487 # AM_INIT_AUTOMAKE([OPTIONS])
488 # -----------------------------------------------
489 # The call with PACKAGE and VERSION arguments is the old style
490 # call (pre autoconf-2.50), which is being phased out. PACKAGE
491 # and VERSION should now be passed to AC_INIT and removed from
492 # the call to AM_INIT_AUTOMAKE.
493 # We support both call styles for the transition. After
494 # the next Automake release, Autoconf can make the AC_INIT
495 # arguments mandatory, and then we can depend on a new Autoconf
496 # release and drop the old call support.
497 AC_DEFUN([AM_INIT_AUTOMAKE],
498 [AC_PREREQ([2.65])dnl
499 dnl Autoconf wants to disallow AM_ names. We explicitly allow
500 dnl the ones we care about.
501 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
502 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
503 AC_REQUIRE([AC_PROG_INSTALL])dnl
504 if test "`cd $srcdir && pwd`" != "`pwd`"; then
505 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
506 # is not polluted with repeated "-I."
507 AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
508 # test to see if srcdir already configured
509 if test -f $srcdir/config.status; then
510 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
511 fi
512 fi
513
514 # test whether we have cygpath
515 if test -z "$CYGPATH_W"; then
516 if (cygpath --version) >/dev/null 2>/dev/null; then
517 CYGPATH_W='cygpath -w'
518 else
519 CYGPATH_W=echo
520 fi
521 fi
522 AC_SUBST([CYGPATH_W])
523
524 # Define the identity of the package.
525 dnl Distinguish between old-style and new-style calls.
526 m4_ifval([$2],
527 [AC_DIAGNOSE([obsolete],
528 [$0: two- and three-arguments forms are deprecated.])
529 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
530 AC_SUBST([PACKAGE], [$1])dnl
531 AC_SUBST([VERSION], [$2])],
532 [_AM_SET_OPTIONS([$1])dnl
533 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
534 m4_if(
535 m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
536 [ok:ok],,
537 [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
538 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
539 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
540
541 _AM_IF_OPTION([no-define],,
542 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
543 AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
544
545 # Some tools Automake needs.
546 AC_REQUIRE([AM_SANITY_CHECK])dnl
547 AC_REQUIRE([AC_ARG_PROGRAM])dnl
548 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
549 AM_MISSING_PROG([AUTOCONF], [autoconf])
550 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
551 AM_MISSING_PROG([AUTOHEADER], [autoheader])
552 AM_MISSING_PROG([MAKEINFO], [makeinfo])
553 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
554 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
555 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
556 # For better backward compatibility. To be removed once Automake 1.9.x
557 # dies out for good. For more background, see:
558 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
559 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
560 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
561 # We need awk for the "check" target. The system "awk" is bad on
562 # some platforms.
563 AC_REQUIRE([AC_PROG_AWK])dnl
564 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
565 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
566 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
567 [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
568 [_AM_PROG_TAR([v7])])])
569 _AM_IF_OPTION([no-dependencies],,
570 [AC_PROVIDE_IFELSE([AC_PROG_CC],
571 [_AM_DEPENDENCIES([CC])],
572 [m4_define([AC_PROG_CC],
573 m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
574 AC_PROVIDE_IFELSE([AC_PROG_CXX],
575 [_AM_DEPENDENCIES([CXX])],
576 [m4_define([AC_PROG_CXX],
577 m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
578 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
579 [_AM_DEPENDENCIES([OBJC])],
580 [m4_define([AC_PROG_OBJC],
581 m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
582 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
583 [_AM_DEPENDENCIES([OBJCXX])],
584 [m4_define([AC_PROG_OBJCXX],
585 m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
586 ])
587 AC_REQUIRE([AM_SILENT_RULES])dnl
588 dnl The testsuite driver may need to know about EXEEXT, so add the
589 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
590 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
591 AC_CONFIG_COMMANDS_PRE(dnl
592 [m4_provide_if([_AM_COMPILER_EXEEXT],
593 [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
594
595 # POSIX will say in a future version that running "rm -f" with no argument
596 # is OK; and we want to be able to make that assumption in our Makefile
597 # recipes. So use an aggressive probe to check that the usage we want is
598 # actually supported "in the wild" to an acceptable degree.
599 # See automake bug#10828.
600 # To make any issue more visible, cause the running configure to be aborted
601 # by default if the 'rm' program in use doesn't match our expectations; the
602 # user can still override this though.
603 if rm -f && rm -fr && rm -rf; then : OK; else
604 cat >&2 <<'END'
605 Oops!
606
607 Your 'rm' program seems unable to run without file operands specified
608 on the command line, even when the '-f' option is present. This is contrary
609 to the behaviour of most rm programs out there, and not conforming with
610 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
611
612 Please tell bug-automake@gnu.org about your system, including the value
613 of your $PATH and any error possibly output before this message. This
614 can help us improve future automake versions.
615
616 END
617 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
618 echo 'Configuration will proceed anyway, since you have set the' >&2
619 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
620 echo >&2
621 else
622 cat >&2 <<'END'
623 Aborting the configuration process, to ensure you take notice of the issue.
624
625 You can download and install GNU coreutils to get an 'rm' implementation
626 that behaves properly: <http://www.gnu.org/software/coreutils/>.
627
628 If you want to complete the configuration process using your problematic
629 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
630 to "yes", and re-run configure.
631
632 END
633 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
634 fi
635 fi])
636
637 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
638 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
639 dnl mangled by Autoconf and run in a shell conditional statement.
640 m4_define([_AC_COMPILER_EXEEXT],
641 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
642
643 # When config.status generates a header, we must update the stamp-h file.
644 # This file resides in the same directory as the config header
645 # that is generated. The stamp files are numbered to have different names.
646
647 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
648 # loop where config.status creates the headers, so we can generate
649 # our stamp files there.
650 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
651 [# Compute $1's index in $config_headers.
652 _am_arg=$1
653 _am_stamp_count=1
654 for _am_header in $config_headers :; do
655 case $_am_header in
656 $_am_arg | $_am_arg:* )
657 break ;;
658 * )
659 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
660 esac
661 done
662 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
663
664 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
665 #
666 # This file is free software; the Free Software Foundation
667 # gives unlimited permission to copy and/or distribute it,
668 # with or without modifications, as long as this notice is preserved.
669
670 # AM_PROG_INSTALL_SH
671 # ------------------
672 # Define $install_sh.
673 AC_DEFUN([AM_PROG_INSTALL_SH],
674 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
675 if test x"${install_sh}" != xset; then
676 case $am_aux_dir in
677 *\ * | *\ *)
678 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
679 *)
680 install_sh="\${SHELL} $am_aux_dir/install-sh"
681 esac
682 fi
683 AC_SUBST([install_sh])])
684
685 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
686 #
687 # This file is free software; the Free Software Foundation
688 # gives unlimited permission to copy and/or distribute it,
689 # with or without modifications, as long as this notice is preserved.
690
691 # Check whether the underlying file-system supports filenames
692 # with a leading dot. For instance MS-DOS doesn't.
693 AC_DEFUN([AM_SET_LEADING_DOT],
694 [rm -rf .tst 2>/dev/null
695 mkdir .tst 2>/dev/null
696 if test -d .tst; then
697 am__leading_dot=.
698 else
699 am__leading_dot=_
700 fi
701 rmdir .tst 2>/dev/null
702 AC_SUBST([am__leading_dot])])
703
704 # Check to see how 'make' treats includes. -*- Autoconf -*-
705
706 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
707 #
708 # This file is free software; the Free Software Foundation
709 # gives unlimited permission to copy and/or distribute it,
710 # with or without modifications, as long as this notice is preserved.
711
712 # AM_MAKE_INCLUDE()
713 # -----------------
714 # Check to see how make treats includes.
715 AC_DEFUN([AM_MAKE_INCLUDE],
716 [am_make=${MAKE-make}
717 cat > confinc << 'END'
718 am__doit:
719 @echo this is the am__doit target
720 .PHONY: am__doit
721 END
722 # If we don't find an include directive, just comment out the code.
723 AC_MSG_CHECKING([for style of include used by $am_make])
724 am__include="#"
725 am__quote=
726 _am_result=none
727 # First try GNU make style include.
728 echo "include confinc" > confmf
729 # Ignore all kinds of additional output from 'make'.
730 case `$am_make -s -f confmf 2> /dev/null` in #(
731 *the\ am__doit\ target*)
732 am__include=include
733 am__quote=
734 _am_result=GNU
735 ;;
736 esac
737 # Now try BSD make style include.
738 if test "$am__include" = "#"; then
739 echo '.include "confinc"' > confmf
740 case `$am_make -s -f confmf 2> /dev/null` in #(
741 *the\ am__doit\ target*)
742 am__include=.include
743 am__quote="\""
744 _am_result=BSD
745 ;;
746 esac
747 fi
748 AC_SUBST([am__include])
749 AC_SUBST([am__quote])
750 AC_MSG_RESULT([$_am_result])
751 rm -f confinc confmf
752 ])
753
754 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
755
756 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
757 #
758 # This file is free software; the Free Software Foundation
759 # gives unlimited permission to copy and/or distribute it,
760 # with or without modifications, as long as this notice is preserved.
761
762 # AM_MISSING_PROG(NAME, PROGRAM)
763 # ------------------------------
764 AC_DEFUN([AM_MISSING_PROG],
765 [AC_REQUIRE([AM_MISSING_HAS_RUN])
766 $1=${$1-"${am_missing_run}$2"}
767 AC_SUBST($1)])
768
769 # AM_MISSING_HAS_RUN
770 # ------------------
771 # Define MISSING if not defined so far and test if it is modern enough.
772 # If it is, set am_missing_run to use it, otherwise, to nothing.
773 AC_DEFUN([AM_MISSING_HAS_RUN],
774 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
775 AC_REQUIRE_AUX_FILE([missing])dnl
776 if test x"${MISSING+set}" != xset; then
777 case $am_aux_dir in
778 *\ * | *\ *)
779 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
780 *)
781 MISSING="\${SHELL} $am_aux_dir/missing" ;;
782 esac
783 fi
784 # Use eval to expand $SHELL
785 if eval "$MISSING --is-lightweight"; then
786 am_missing_run="$MISSING "
787 else
788 am_missing_run=
789 AC_MSG_WARN(['missing' script is too old or missing])
790 fi
791 ])
792
793 # Helper functions for option handling. -*- Autoconf -*-
794
795 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
796 #
797 # This file is free software; the Free Software Foundation
798 # gives unlimited permission to copy and/or distribute it,
799 # with or without modifications, as long as this notice is preserved.
800
801 # _AM_MANGLE_OPTION(NAME)
802 # -----------------------
803 AC_DEFUN([_AM_MANGLE_OPTION],
804 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
805
806 # _AM_SET_OPTION(NAME)
807 # --------------------
808 # Set option NAME. Presently that only means defining a flag for this option.
809 AC_DEFUN([_AM_SET_OPTION],
810 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
811
812 # _AM_SET_OPTIONS(OPTIONS)
813 # ------------------------
814 # OPTIONS is a space-separated list of Automake options.
815 AC_DEFUN([_AM_SET_OPTIONS],
816 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
817
818 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
819 # -------------------------------------------
820 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
821 AC_DEFUN([_AM_IF_OPTION],
822 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
823
824 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
825 #
826 # This file is free software; the Free Software Foundation
827 # gives unlimited permission to copy and/or distribute it,
828 # with or without modifications, as long as this notice is preserved.
829
830 # _AM_PROG_CC_C_O
831 # ---------------
832 # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
833 # to automatically call this.
834 AC_DEFUN([_AM_PROG_CC_C_O],
835 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
836 AC_REQUIRE_AUX_FILE([compile])dnl
837 AC_LANG_PUSH([C])dnl
838 AC_CACHE_CHECK(
839 [whether $CC understands -c and -o together],
840 [am_cv_prog_cc_c_o],
841 [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
842 # Make sure it works both with $CC and with simple cc.
843 # Following AC_PROG_CC_C_O, we do the test twice because some
844 # compilers refuse to overwrite an existing .o file with -o,
845 # though they will create one.
846 am_cv_prog_cc_c_o=yes
847 for am_i in 1 2; do
848 if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
849 && test -f conftest2.$ac_objext; then
850 : OK
851 else
852 am_cv_prog_cc_c_o=no
853 break
854 fi
855 done
856 rm -f core conftest*
857 unset am_i])
858 if test "$am_cv_prog_cc_c_o" != yes; then
859 # Losing compiler, so override with the script.
860 # FIXME: It is wrong to rewrite CC.
861 # But if we don't then we get into trouble of one sort or another.
862 # A longer-term fix would be to have automake use am__CC in this case,
863 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
864 CC="$am_aux_dir/compile $CC"
865 fi
866 AC_LANG_POP([C])])
867
868 # For backward compatibility.
869 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
870
871 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
872 #
873 # This file is free software; the Free Software Foundation
874 # gives unlimited permission to copy and/or distribute it,
875 # with or without modifications, as long as this notice is preserved.
876
877 # AM_RUN_LOG(COMMAND)
878 # -------------------
879 # Run COMMAND, save the exit status in ac_status, and log it.
880 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
881 AC_DEFUN([AM_RUN_LOG],
882 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
883 ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
884 ac_status=$?
885 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
886 (exit $ac_status); }])
887
888 # Check to make sure that the build environment is sane. -*- Autoconf -*-
889
890 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
891 #
892 # This file is free software; the Free Software Foundation
893 # gives unlimited permission to copy and/or distribute it,
894 # with or without modifications, as long as this notice is preserved.
895
896 # AM_SANITY_CHECK
897 # ---------------
898 AC_DEFUN([AM_SANITY_CHECK],
899 [AC_MSG_CHECKING([whether build environment is sane])
900 # Reject unsafe characters in $srcdir or the absolute working directory
901 # name. Accept space and tab only in the latter.
902 am_lf='
903 '
904 case `pwd` in
905 *[[\\\"\#\$\&\'\`$am_lf]]*)
906 AC_MSG_ERROR([unsafe absolute working directory name]);;
907 esac
908 case $srcdir in
909 *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
910 AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
911 esac
912
913 # Do 'set' in a subshell so we don't clobber the current shell's
914 # arguments. Must try -L first in case configure is actually a
915 # symlink; some systems play weird games with the mod time of symlinks
916 # (eg FreeBSD returns the mod time of the symlink's containing
917 # directory).
918 if (
919 am_has_slept=no
920 for am_try in 1 2; do
921 echo "timestamp, slept: $am_has_slept" > conftest.file
922 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
923 if test "$[*]" = "X"; then
924 # -L didn't work.
925 set X `ls -t "$srcdir/configure" conftest.file`
926 fi
927 if test "$[*]" != "X $srcdir/configure conftest.file" \
928 && test "$[*]" != "X conftest.file $srcdir/configure"; then
929
930 # If neither matched, then we have a broken ls. This can happen
931 # if, for instance, CONFIG_SHELL is bash and it inherits a
932 # broken ls alias from the environment. This has actually
933 # happened. Such a system could not be considered "sane".
934 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
935 alias in your environment])
936 fi
937 if test "$[2]" = conftest.file || test $am_try -eq 2; then
938 break
939 fi
940 # Just in case.
941 sleep 1
942 am_has_slept=yes
943 done
944 test "$[2]" = conftest.file
945 )
946 then
947 # Ok.
948 :
949 else
950 AC_MSG_ERROR([newly created file is older than distributed files!
951 Check your system clock])
952 fi
953 AC_MSG_RESULT([yes])
954 # If we didn't sleep, we still need to ensure time stamps of config.status and
955 # generated files are strictly newer.
956 am_sleep_pid=
957 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
958 ( sleep 1 ) &
959 am_sleep_pid=$!
960 fi
961 AC_CONFIG_COMMANDS_PRE(
962 [AC_MSG_CHECKING([that generated files are newer than configure])
963 if test -n "$am_sleep_pid"; then
964 # Hide warnings about reused PIDs.
965 wait $am_sleep_pid 2>/dev/null
966 fi
967 AC_MSG_RESULT([done])])
968 rm -f conftest.file
969 ])
970
971 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
972 #
973 # This file is free software; the Free Software Foundation
974 # gives unlimited permission to copy and/or distribute it,
975 # with or without modifications, as long as this notice is preserved.
976
977 # AM_SILENT_RULES([DEFAULT])
978 # --------------------------
979 # Enable less verbose build rules; with the default set to DEFAULT
980 # ("yes" being less verbose, "no" or empty being verbose).
981 AC_DEFUN([AM_SILENT_RULES],
982 [AC_ARG_ENABLE([silent-rules], [dnl
983 AS_HELP_STRING(
984 [--enable-silent-rules],
985 [less verbose build output (undo: "make V=1")])
986 AS_HELP_STRING(
987 [--disable-silent-rules],
988 [verbose build output (undo: "make V=0")])dnl
989 ])
990 case $enable_silent_rules in @%:@ (((
991 yes) AM_DEFAULT_VERBOSITY=0;;
992 no) AM_DEFAULT_VERBOSITY=1;;
993 *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
994 esac
995 dnl
996 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
997 dnl do not support nested variable expansions.
998 dnl See automake bug#9928 and bug#10237.
999 am_make=${MAKE-make}
1000 AC_CACHE_CHECK([whether $am_make supports nested variables],
1001 [am_cv_make_support_nested_variables],
1002 [if AS_ECHO([['TRUE=$(BAR$(V))
1003 BAR0=false
1004 BAR1=true
1005 V=1
1006 am__doit:
1007 @$(TRUE)
1008 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
1009 am_cv_make_support_nested_variables=yes
1010 else
1011 am_cv_make_support_nested_variables=no
1012 fi])
1013 if test $am_cv_make_support_nested_variables = yes; then
1014 dnl Using '$V' instead of '$(V)' breaks IRIX make.
1015 AM_V='$(V)'
1016 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
1017 else
1018 AM_V=$AM_DEFAULT_VERBOSITY
1019 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
1020 fi
1021 AC_SUBST([AM_V])dnl
1022 AM_SUBST_NOTMAKE([AM_V])dnl
1023 AC_SUBST([AM_DEFAULT_V])dnl
1024 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
1025 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
1026 AM_BACKSLASH='\'
1027 AC_SUBST([AM_BACKSLASH])dnl
1028 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1029 ])
1030
1031 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1032 #
1033 # This file is free software; the Free Software Foundation
1034 # gives unlimited permission to copy and/or distribute it,
1035 # with or without modifications, as long as this notice is preserved.
1036
1037 # AM_PROG_INSTALL_STRIP
1038 # ---------------------
1039 # One issue with vendor 'install' (even GNU) is that you can't
1040 # specify the program used to strip binaries. This is especially
1041 # annoying in cross-compiling environments, where the build's strip
1042 # is unlikely to handle the host's binaries.
1043 # Fortunately install-sh will honor a STRIPPROG variable, so we
1044 # always use install-sh in "make install-strip", and initialize
1045 # STRIPPROG with the value of the STRIP variable (set by the user).
1046 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1047 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1048 # Installed binaries are usually stripped using 'strip' when the user
1049 # run "make install-strip". However 'strip' might not be the right
1050 # tool to use in cross-compilation environments, therefore Automake
1051 # will honor the 'STRIP' environment variable to overrule this program.
1052 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
1053 if test "$cross_compiling" != no; then
1054 AC_CHECK_TOOL([STRIP], [strip], :)
1055 fi
1056 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1057 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1058
1059 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
1060 #
1061 # This file is free software; the Free Software Foundation
1062 # gives unlimited permission to copy and/or distribute it,
1063 # with or without modifications, as long as this notice is preserved.
1064
1065 # _AM_SUBST_NOTMAKE(VARIABLE)
1066 # ---------------------------
1067 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1068 # This macro is traced by Automake.
1069 AC_DEFUN([_AM_SUBST_NOTMAKE])
1070
1071 # AM_SUBST_NOTMAKE(VARIABLE)
1072 # --------------------------
1073 # Public sister of _AM_SUBST_NOTMAKE.
1074 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1075
1076 # Check how to create a tarball. -*- Autoconf -*-
1077
1078 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
1079 #
1080 # This file is free software; the Free Software Foundation
1081 # gives unlimited permission to copy and/or distribute it,
1082 # with or without modifications, as long as this notice is preserved.
1083
1084 # _AM_PROG_TAR(FORMAT)
1085 # --------------------
1086 # Check how to create a tarball in format FORMAT.
1087 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
1088 #
1089 # Substitute a variable $(am__tar) that is a command
1090 # writing to stdout a FORMAT-tarball containing the directory
1091 # $tardir.
1092 # tardir=directory && $(am__tar) > result.tar
1093 #
1094 # Substitute a variable $(am__untar) that extract such
1095 # a tarball read from stdin.
1096 # $(am__untar) < result.tar
1097 #
1098 AC_DEFUN([_AM_PROG_TAR],
1099 [# Always define AMTAR for backward compatibility. Yes, it's still used
1100 # in the wild :-( We should find a proper way to deprecate it ...
1101 AC_SUBST([AMTAR], ['$${TAR-tar}'])
1102
1103 # We'll loop over all known methods to create a tar archive until one works.
1104 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1105
1106 m4_if([$1], [v7],
1107 [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1108
1109 [m4_case([$1],
1110 [ustar],
1111 [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
1112 # There is notably a 21 bits limit for the UID and the GID. In fact,
1113 # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
1114 # and bug#13588).
1115 am_max_uid=2097151 # 2^21 - 1
1116 am_max_gid=$am_max_uid
1117 # The $UID and $GID variables are not portable, so we need to resort
1118 # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
1119 # below are definitely unexpected, so allow the users to see them
1120 # (that is, avoid stderr redirection).
1121 am_uid=`id -u || echo unknown`
1122 am_gid=`id -g || echo unknown`
1123 AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
1124 if test $am_uid -le $am_max_uid; then
1125 AC_MSG_RESULT([yes])
1126 else
1127 AC_MSG_RESULT([no])
1128 _am_tools=none
1129 fi
1130 AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
1131 if test $am_gid -le $am_max_gid; then
1132 AC_MSG_RESULT([yes])
1133 else
1134 AC_MSG_RESULT([no])
1135 _am_tools=none
1136 fi],
1137
1138 [pax],
1139 [],
1140
1141 [m4_fatal([Unknown tar format])])
1142
1143 AC_MSG_CHECKING([how to create a $1 tar archive])
1144
1145 # Go ahead even if we have the value already cached. We do so because we
1146 # need to set the values for the 'am__tar' and 'am__untar' variables.
1147 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1148
1149 for _am_tool in $_am_tools; do
1150 case $_am_tool in
1151 gnutar)
1152 for _am_tar in tar gnutar gtar; do
1153 AM_RUN_LOG([$_am_tar --version]) && break
1154 done
1155 am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1156 am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1157 am__untar="$_am_tar -xf -"
1158 ;;
1159 plaintar)
1160 # Must skip GNU tar: if it does not support --format= it doesn't create
1161 # ustar tarball either.
1162 (tar --version) >/dev/null 2>&1 && continue
1163 am__tar='tar chf - "$$tardir"'
1164 am__tar_='tar chf - "$tardir"'
1165 am__untar='tar xf -'
1166 ;;
1167 pax)
1168 am__tar='pax -L -x $1 -w "$$tardir"'
1169 am__tar_='pax -L -x $1 -w "$tardir"'
1170 am__untar='pax -r'
1171 ;;
1172 cpio)
1173 am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1174 am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1175 am__untar='cpio -i -H $1 -d'
1176 ;;
1177 none)
1178 am__tar=false
1179 am__tar_=false
1180 am__untar=false
1181 ;;
1182 esac
1183
1184 # If the value was cached, stop now. We just wanted to have am__tar
1185 # and am__untar set.
1186 test -n "${am_cv_prog_tar_$1}" && break
1187
1188 # tar/untar a dummy directory, and stop if the command works.
1189 rm -rf conftest.dir
1190 mkdir conftest.dir
1191 echo GrepMe > conftest.dir/file
1192 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1193 rm -rf conftest.dir
1194 if test -s conftest.tar; then
1195 AM_RUN_LOG([$am__untar <conftest.tar])
1196 AM_RUN_LOG([cat conftest.dir/file])
1197 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1198 fi
1199 done
1200 rm -rf conftest.dir
1201
1202 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1203 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1204
1205 AC_SUBST([am__tar])
1206 AC_SUBST([am__untar])
1207 ]) # _AM_PROG_TAR
1208
1209 m4_include([m4/libtool.m4])
1210 m4_include([m4/ltoptions.m4])
1211 m4_include([m4/ltsugar.m4])
1212 m4_include([m4/ltversion.m4])
1213 m4_include([m4/lt~obsolete.m4])
0 #! /bin/sh
1 # Wrapper for Microsoft lib.exe
2
3 me=ar-lib
4 scriptversion=2012-03-01.08; # UTC
5
6 # Copyright (C) 2010-2013 Free Software Foundation, Inc.
7 # Written by Peter Rosin <peda@lysator.liu.se>.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
12 # any later version.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
26
27 # This file is maintained in Automake, please report
28 # bugs to <bug-automake@gnu.org> or send patches to
29 # <automake-patches@gnu.org>.
30
31
32 # func_error message
33 func_error ()
34 {
35 echo "$me: $1" 1>&2
36 exit 1
37 }
38
39 file_conv=
40
41 # func_file_conv build_file
42 # Convert a $build file to $host form and store it in $file
43 # Currently only supports Windows hosts.
44 func_file_conv ()
45 {
46 file=$1
47 case $file in
48 / | /[!/]*) # absolute file, and not a UNC file
49 if test -z "$file_conv"; then
50 # lazily determine how to convert abs files
51 case `uname -s` in
52 MINGW*)
53 file_conv=mingw
54 ;;
55 CYGWIN*)
56 file_conv=cygwin
57 ;;
58 *)
59 file_conv=wine
60 ;;
61 esac
62 fi
63 case $file_conv in
64 mingw)
65 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
66 ;;
67 cygwin)
68 file=`cygpath -m "$file" || echo "$file"`
69 ;;
70 wine)
71 file=`winepath -w "$file" || echo "$file"`
72 ;;
73 esac
74 ;;
75 esac
76 }
77
78 # func_at_file at_file operation archive
79 # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
80 # for each of them.
81 # When interpreting the content of the @FILE, do NOT use func_file_conv,
82 # since the user would need to supply preconverted file names to
83 # binutils ar, at least for MinGW.
84 func_at_file ()
85 {
86 operation=$2
87 archive=$3
88 at_file_contents=`cat "$1"`
89 eval set x "$at_file_contents"
90 shift
91
92 for member
93 do
94 $AR -NOLOGO $operation:"$member" "$archive" || exit $?
95 done
96 }
97
98 case $1 in
99 '')
100 func_error "no command. Try '$0 --help' for more information."
101 ;;
102 -h | --h*)
103 cat <<EOF
104 Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
105
106 Members may be specified in a file named with @FILE.
107 EOF
108 exit $?
109 ;;
110 -v | --v*)
111 echo "$me, version $scriptversion"
112 exit $?
113 ;;
114 esac
115
116 if test $# -lt 3; then
117 func_error "you must specify a program, an action and an archive"
118 fi
119
120 AR=$1
121 shift
122 while :
123 do
124 if test $# -lt 2; then
125 func_error "you must specify a program, an action and an archive"
126 fi
127 case $1 in
128 -lib | -LIB \
129 | -ltcg | -LTCG \
130 | -machine* | -MACHINE* \
131 | -subsystem* | -SUBSYSTEM* \
132 | -verbose | -VERBOSE \
133 | -wx* | -WX* )
134 AR="$AR $1"
135 shift
136 ;;
137 *)
138 action=$1
139 shift
140 break
141 ;;
142 esac
143 done
144 orig_archive=$1
145 shift
146 func_file_conv "$orig_archive"
147 archive=$file
148
149 # strip leading dash in $action
150 action=${action#-}
151
152 delete=
153 extract=
154 list=
155 quick=
156 replace=
157 index=
158 create=
159
160 while test -n "$action"
161 do
162 case $action in
163 d*) delete=yes ;;
164 x*) extract=yes ;;
165 t*) list=yes ;;
166 q*) quick=yes ;;
167 r*) replace=yes ;;
168 s*) index=yes ;;
169 S*) ;; # the index is always updated implicitly
170 c*) create=yes ;;
171 u*) ;; # TODO: don't ignore the update modifier
172 v*) ;; # TODO: don't ignore the verbose modifier
173 *)
174 func_error "unknown action specified"
175 ;;
176 esac
177 action=${action#?}
178 done
179
180 case $delete$extract$list$quick$replace,$index in
181 yes,* | ,yes)
182 ;;
183 yesyes*)
184 func_error "more than one action specified"
185 ;;
186 *)
187 func_error "no action specified"
188 ;;
189 esac
190
191 if test -n "$delete"; then
192 if test ! -f "$orig_archive"; then
193 func_error "archive not found"
194 fi
195 for member
196 do
197 case $1 in
198 @*)
199 func_at_file "${1#@}" -REMOVE "$archive"
200 ;;
201 *)
202 func_file_conv "$1"
203 $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
204 ;;
205 esac
206 done
207
208 elif test -n "$extract"; then
209 if test ! -f "$orig_archive"; then
210 func_error "archive not found"
211 fi
212 if test $# -gt 0; then
213 for member
214 do
215 case $1 in
216 @*)
217 func_at_file "${1#@}" -EXTRACT "$archive"
218 ;;
219 *)
220 func_file_conv "$1"
221 $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
222 ;;
223 esac
224 done
225 else
226 $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
227 do
228 $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
229 done
230 fi
231
232 elif test -n "$quick$replace"; then
233 if test ! -f "$orig_archive"; then
234 if test -z "$create"; then
235 echo "$me: creating $orig_archive"
236 fi
237 orig_archive=
238 else
239 orig_archive=$archive
240 fi
241
242 for member
243 do
244 case $1 in
245 @*)
246 func_file_conv "${1#@}"
247 set x "$@" "@$file"
248 ;;
249 *)
250 func_file_conv "$1"
251 set x "$@" "$file"
252 ;;
253 esac
254 shift
255 shift
256 done
257
258 if test -n "$orig_archive"; then
259 $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
260 else
261 $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
262 fi
263
264 elif test -n "$list"; then
265 if test ! -f "$orig_archive"; then
266 func_error "archive not found"
267 fi
268 $AR -NOLOGO -LIST "$archive" || exit $?
269 fi
0 #! /bin/sh
1 # Wrapper for compilers which do not understand '-c -o'.
2
3 scriptversion=2012-10-14.11; # UTC
4
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
6 # Written by Tom Tromey <tromey@cygnus.com>.
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 # This file is maintained in Automake, please report
27 # bugs to <bug-automake@gnu.org> or send patches to
28 # <automake-patches@gnu.org>.
29
30 nl='
31 '
32
33 # We need space, tab and new line, in precisely that order. Quoting is
34 # there to prevent tools from complaining about whitespace usage.
35 IFS=" "" $nl"
36
37 file_conv=
38
39 # func_file_conv build_file lazy
40 # Convert a $build file to $host form and store it in $file
41 # Currently only supports Windows hosts. If the determined conversion
42 # type is listed in (the comma separated) LAZY, no conversion will
43 # take place.
44 func_file_conv ()
45 {
46 file=$1
47 case $file in
48 / | /[!/]*) # absolute file, and not a UNC file
49 if test -z "$file_conv"; then
50 # lazily determine how to convert abs files
51 case `uname -s` in
52 MINGW*)
53 file_conv=mingw
54 ;;
55 CYGWIN*)
56 file_conv=cygwin
57 ;;
58 *)
59 file_conv=wine
60 ;;
61 esac
62 fi
63 case $file_conv/,$2, in
64 *,$file_conv,*)
65 ;;
66 mingw/*)
67 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
68 ;;
69 cygwin/*)
70 file=`cygpath -m "$file" || echo "$file"`
71 ;;
72 wine/*)
73 file=`winepath -w "$file" || echo "$file"`
74 ;;
75 esac
76 ;;
77 esac
78 }
79
80 # func_cl_dashL linkdir
81 # Make cl look for libraries in LINKDIR
82 func_cl_dashL ()
83 {
84 func_file_conv "$1"
85 if test -z "$lib_path"; then
86 lib_path=$file
87 else
88 lib_path="$lib_path;$file"
89 fi
90 linker_opts="$linker_opts -LIBPATH:$file"
91 }
92
93 # func_cl_dashl library
94 # Do a library search-path lookup for cl
95 func_cl_dashl ()
96 {
97 lib=$1
98 found=no
99 save_IFS=$IFS
100 IFS=';'
101 for dir in $lib_path $LIB
102 do
103 IFS=$save_IFS
104 if $shared && test -f "$dir/$lib.dll.lib"; then
105 found=yes
106 lib=$dir/$lib.dll.lib
107 break
108 fi
109 if test -f "$dir/$lib.lib"; then
110 found=yes
111 lib=$dir/$lib.lib
112 break
113 fi
114 if test -f "$dir/lib$lib.a"; then
115 found=yes
116 lib=$dir/lib$lib.a
117 break
118 fi
119 done
120 IFS=$save_IFS
121
122 if test "$found" != yes; then
123 lib=$lib.lib
124 fi
125 }
126
127 # func_cl_wrapper cl arg...
128 # Adjust compile command to suit cl
129 func_cl_wrapper ()
130 {
131 # Assume a capable shell
132 lib_path=
133 shared=:
134 linker_opts=
135 for arg
136 do
137 if test -n "$eat"; then
138 eat=
139 else
140 case $1 in
141 -o)
142 # configure might choose to run compile as 'compile cc -o foo foo.c'.
143 eat=1
144 case $2 in
145 *.o | *.[oO][bB][jJ])
146 func_file_conv "$2"
147 set x "$@" -Fo"$file"
148 shift
149 ;;
150 *)
151 func_file_conv "$2"
152 set x "$@" -Fe"$file"
153 shift
154 ;;
155 esac
156 ;;
157 -I)
158 eat=1
159 func_file_conv "$2" mingw
160 set x "$@" -I"$file"
161 shift
162 ;;
163 -I*)
164 func_file_conv "${1#-I}" mingw
165 set x "$@" -I"$file"
166 shift
167 ;;
168 -l)
169 eat=1
170 func_cl_dashl "$2"
171 set x "$@" "$lib"
172 shift
173 ;;
174 -l*)
175 func_cl_dashl "${1#-l}"
176 set x "$@" "$lib"
177 shift
178 ;;
179 -L)
180 eat=1
181 func_cl_dashL "$2"
182 ;;
183 -L*)
184 func_cl_dashL "${1#-L}"
185 ;;
186 -static)
187 shared=false
188 ;;
189 -Wl,*)
190 arg=${1#-Wl,}
191 save_ifs="$IFS"; IFS=','
192 for flag in $arg; do
193 IFS="$save_ifs"
194 linker_opts="$linker_opts $flag"
195 done
196 IFS="$save_ifs"
197 ;;
198 -Xlinker)
199 eat=1
200 linker_opts="$linker_opts $2"
201 ;;
202 -*)
203 set x "$@" "$1"
204 shift
205 ;;
206 *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
207 func_file_conv "$1"
208 set x "$@" -Tp"$file"
209 shift
210 ;;
211 *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
212 func_file_conv "$1" mingw
213 set x "$@" "$file"
214 shift
215 ;;
216 *)
217 set x "$@" "$1"
218 shift
219 ;;
220 esac
221 fi
222 shift
223 done
224 if test -n "$linker_opts"; then
225 linker_opts="-link$linker_opts"
226 fi
227 exec "$@" $linker_opts
228 exit 1
229 }
230
231 eat=
232
233 case $1 in
234 '')
235 echo "$0: No command. Try '$0 --help' for more information." 1>&2
236 exit 1;
237 ;;
238 -h | --h*)
239 cat <<\EOF
240 Usage: compile [--help] [--version] PROGRAM [ARGS]
241
242 Wrapper for compilers which do not understand '-c -o'.
243 Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
244 arguments, and rename the output as expected.
245
246 If you are trying to build a whole package this is not the
247 right script to run: please start by reading the file 'INSTALL'.
248
249 Report bugs to <bug-automake@gnu.org>.
250 EOF
251 exit $?
252 ;;
253 -v | --v*)
254 echo "compile $scriptversion"
255 exit $?
256 ;;
257 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
258 func_cl_wrapper "$@" # Doesn't return...
259 ;;
260 esac
261
262 ofile=
263 cfile=
264
265 for arg
266 do
267 if test -n "$eat"; then
268 eat=
269 else
270 case $1 in
271 -o)
272 # configure might choose to run compile as 'compile cc -o foo foo.c'.
273 # So we strip '-o arg' only if arg is an object.
274 eat=1
275 case $2 in
276 *.o | *.obj)
277 ofile=$2
278 ;;
279 *)
280 set x "$@" -o "$2"
281 shift
282 ;;
283 esac
284 ;;
285 *.c)
286 cfile=$1
287 set x "$@" "$1"
288 shift
289 ;;
290 *)
291 set x "$@" "$1"
292 shift
293 ;;
294 esac
295 fi
296 shift
297 done
298
299 if test -z "$ofile" || test -z "$cfile"; then
300 # If no '-o' option was seen then we might have been invoked from a
301 # pattern rule where we don't need one. That is ok -- this is a
302 # normal compilation that the losing compiler can handle. If no
303 # '.c' file was seen then we are probably linking. That is also
304 # ok.
305 exec "$@"
306 fi
307
308 # Name of file we expect compiler to create.
309 cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
310
311 # Create the lock directory.
312 # Note: use '[/\\:.-]' here to ensure that we don't use the same name
313 # that we are using for the .o file. Also, base the name on the expected
314 # object file name, since that is what matters with a parallel build.
315 lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
316 while true; do
317 if mkdir "$lockdir" >/dev/null 2>&1; then
318 break
319 fi
320 sleep 1
321 done
322 # FIXME: race condition here if user kills between mkdir and trap.
323 trap "rmdir '$lockdir'; exit 1" 1 2 15
324
325 # Run the compile.
326 "$@"
327 ret=$?
328
329 if test -f "$cofile"; then
330 test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
331 elif test -f "${cofile}bj"; then
332 test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
333 fi
334
335 rmdir "$lockdir"
336 exit $ret
337
338 # Local Variables:
339 # mode: shell-script
340 # sh-indentation: 2
341 # eval: (add-hook 'write-file-hooks 'time-stamp)
342 # time-stamp-start: "scriptversion="
343 # time-stamp-format: "%:y-%02m-%02d.%02H"
344 # time-stamp-time-zone: "UTC"
345 # time-stamp-end: "; # UTC"
346 # End:
0 #! /bin/sh
1 # Attempt to guess a canonical system name.
2 # Copyright 1992-2015 Free Software Foundation, Inc.
3
4 timestamp='2015-03-04'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25 #
26 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
27 #
28 # 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
30 #
31 # Please send patches to <config-patches@gnu.org>.
32
33
34 me=`echo "$0" | sed -e 's,.*/,,'`
35
36 usage="\
37 Usage: $0 [OPTION]
38
39 Output the configuration name of the system \`$me' is run on.
40
41 Operation modes:
42 -h, --help print this help, then exit
43 -t, --time-stamp print date of last modification, then exit
44 -v, --version print version number, then exit
45
46 Report bugs and patches to <config-patches@gnu.org>."
47
48 version="\
49 GNU config.guess ($timestamp)
50
51 Originally written by Per Bothner.
52 Copyright 1992-2015 Free Software Foundation, Inc.
53
54 This is free software; see the source for copying conditions. There is NO
55 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
56
57 help="
58 Try \`$me --help' for more information."
59
60 # Parse command line
61 while test $# -gt 0 ; do
62 case $1 in
63 --time-stamp | --time* | -t )
64 echo "$timestamp" ; exit ;;
65 --version | -v )
66 echo "$version" ; exit ;;
67 --help | --h* | -h )
68 echo "$usage"; exit ;;
69 -- ) # Stop option processing
70 shift; break ;;
71 - ) # Use stdin as input.
72 break ;;
73 -* )
74 echo "$me: invalid option $1$help" >&2
75 exit 1 ;;
76 * )
77 break ;;
78 esac
79 done
80
81 if test $# != 0; then
82 echo "$me: too many arguments$help" >&2
83 exit 1
84 fi
85
86 trap 'exit 1' 1 2 15
87
88 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
89 # compiler to aid in system detection is discouraged as it requires
90 # temporary files to be created and, as you can see below, it is a
91 # headache to deal with in a portable fashion.
92
93 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
94 # use `HOST_CC' if defined, but it is deprecated.
95
96 # Portable tmp directory creation inspired by the Autoconf team.
97
98 set_cc_for_build='
99 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
100 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
101 : ${TMPDIR=/tmp} ;
102 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
103 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
104 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
105 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
106 dummy=$tmp/dummy ;
107 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
108 case $CC_FOR_BUILD,$HOST_CC,$CC in
109 ,,) echo "int x;" > $dummy.c ;
110 for c in cc gcc c89 c99 ; do
111 if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
112 CC_FOR_BUILD="$c"; break ;
113 fi ;
114 done ;
115 if test x"$CC_FOR_BUILD" = x ; then
116 CC_FOR_BUILD=no_compiler_found ;
117 fi
118 ;;
119 ,,*) CC_FOR_BUILD=$CC ;;
120 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
121 esac ; set_cc_for_build= ;'
122
123 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
124 # (ghazi@noc.rutgers.edu 1994-08-24)
125 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
126 PATH=$PATH:/.attbin ; export PATH
127 fi
128
129 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
130 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
131 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
132 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133
134 case "${UNAME_SYSTEM}" in
135 Linux|GNU|GNU/*)
136 # If the system lacks a compiler, then just pick glibc.
137 # We could probably try harder.
138 LIBC=gnu
139
140 eval $set_cc_for_build
141 cat <<-EOF > $dummy.c
142 #include <features.h>
143 #if defined(__UCLIBC__)
144 LIBC=uclibc
145 #elif defined(__dietlibc__)
146 LIBC=dietlibc
147 #else
148 LIBC=gnu
149 #endif
150 EOF
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
152 ;;
153 esac
154
155 # Note: order is significant - the case branches are not exclusive.
156
157 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
158 *:NetBSD:*:*)
159 # NetBSD (nbsd) targets should (where applicable) match one or
160 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
161 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
162 # switched to ELF, *-*-netbsd* would select the old
163 # object file format. This provides both forward
164 # compatibility and a consistent mechanism for selecting the
165 # object file format.
166 #
167 # Note: NetBSD doesn't particularly care about the vendor
168 # portion of the name. We always set it to "unknown".
169 sysctl="sysctl -n hw.machine_arch"
170 UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
171 /sbin/$sysctl 2>/dev/null || \
172 /usr/sbin/$sysctl 2>/dev/null || \
173 echo unknown)`
174 case "${UNAME_MACHINE_ARCH}" in
175 armeb) machine=armeb-unknown ;;
176 arm*) machine=arm-unknown ;;
177 sh3el) machine=shl-unknown ;;
178 sh3eb) machine=sh-unknown ;;
179 sh5el) machine=sh5le-unknown ;;
180 earmv*)
181 arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
182 endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
183 machine=${arch}${endian}-unknown
184 ;;
185 *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
186 esac
187 # The Operating System including object format, if it has switched
188 # to ELF recently, or will in the future.
189 case "${UNAME_MACHINE_ARCH}" in
190 arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
191 eval $set_cc_for_build
192 if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
193 | grep -q __ELF__
194 then
195 # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
196 # Return netbsd for either. FIX?
197 os=netbsd
198 else
199 os=netbsdelf
200 fi
201 ;;
202 *)
203 os=netbsd
204 ;;
205 esac
206 # Determine ABI tags.
207 case "${UNAME_MACHINE_ARCH}" in
208 earm*)
209 expr='s/^earmv[0-9]/-eabi/;s/eb$//'
210 abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
211 ;;
212 esac
213 # The OS release
214 # Debian GNU/NetBSD machines have a different userland, and
215 # thus, need a distinct triplet. However, they do not need
216 # kernel version information, so it can be replaced with a
217 # suitable tag, in the style of linux-gnu.
218 case "${UNAME_VERSION}" in
219 Debian*)
220 release='-gnu'
221 ;;
222 *)
223 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
224 ;;
225 esac
226 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
227 # contains redundant information, the shorter form:
228 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
229 echo "${machine}-${os}${release}${abi}"
230 exit ;;
231 *:Bitrig:*:*)
232 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
233 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
234 exit ;;
235 *:OpenBSD:*:*)
236 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
237 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
238 exit ;;
239 *:ekkoBSD:*:*)
240 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
241 exit ;;
242 *:SolidBSD:*:*)
243 echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
244 exit ;;
245 macppc:MirBSD:*:*)
246 echo powerpc-unknown-mirbsd${UNAME_RELEASE}
247 exit ;;
248 *:MirBSD:*:*)
249 echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
250 exit ;;
251 alpha:OSF1:*:*)
252 case $UNAME_RELEASE in
253 *4.0)
254 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
255 ;;
256 *5.*)
257 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
258 ;;
259 esac
260 # According to Compaq, /usr/sbin/psrinfo has been available on
261 # OSF/1 and Tru64 systems produced since 1995. I hope that
262 # covers most systems running today. This code pipes the CPU
263 # types through head -n 1, so we only detect the type of CPU 0.
264 ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
265 case "$ALPHA_CPU_TYPE" in
266 "EV4 (21064)")
267 UNAME_MACHINE="alpha" ;;
268 "EV4.5 (21064)")
269 UNAME_MACHINE="alpha" ;;
270 "LCA4 (21066/21068)")
271 UNAME_MACHINE="alpha" ;;
272 "EV5 (21164)")
273 UNAME_MACHINE="alphaev5" ;;
274 "EV5.6 (21164A)")
275 UNAME_MACHINE="alphaev56" ;;
276 "EV5.6 (21164PC)")
277 UNAME_MACHINE="alphapca56" ;;
278 "EV5.7 (21164PC)")
279 UNAME_MACHINE="alphapca57" ;;
280 "EV6 (21264)")
281 UNAME_MACHINE="alphaev6" ;;
282 "EV6.7 (21264A)")
283 UNAME_MACHINE="alphaev67" ;;
284 "EV6.8CB (21264C)")
285 UNAME_MACHINE="alphaev68" ;;
286 "EV6.8AL (21264B)")
287 UNAME_MACHINE="alphaev68" ;;
288 "EV6.8CX (21264D)")
289 UNAME_MACHINE="alphaev68" ;;
290 "EV6.9A (21264/EV69A)")
291 UNAME_MACHINE="alphaev69" ;;
292 "EV7 (21364)")
293 UNAME_MACHINE="alphaev7" ;;
294 "EV7.9 (21364A)")
295 UNAME_MACHINE="alphaev79" ;;
296 esac
297 # A Pn.n version is a patched version.
298 # A Vn.n version is a released version.
299 # A Tn.n version is a released field test version.
300 # A Xn.n version is an unreleased experimental baselevel.
301 # 1.2 uses "1.2" for uname -r.
302 echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
303 # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
304 exitcode=$?
305 trap '' 0
306 exit $exitcode ;;
307 Alpha\ *:Windows_NT*:*)
308 # How do we know it's Interix rather than the generic POSIX subsystem?
309 # Should we change UNAME_MACHINE based on the output of uname instead
310 # of the specific Alpha model?
311 echo alpha-pc-interix
312 exit ;;
313 21064:Windows_NT:50:3)
314 echo alpha-dec-winnt3.5
315 exit ;;
316 Amiga*:UNIX_System_V:4.0:*)
317 echo m68k-unknown-sysv4
318 exit ;;
319 *:[Aa]miga[Oo][Ss]:*:*)
320 echo ${UNAME_MACHINE}-unknown-amigaos
321 exit ;;
322 *:[Mm]orph[Oo][Ss]:*:*)
323 echo ${UNAME_MACHINE}-unknown-morphos
324 exit ;;
325 *:OS/390:*:*)
326 echo i370-ibm-openedition
327 exit ;;
328 *:z/VM:*:*)
329 echo s390-ibm-zvmoe
330 exit ;;
331 *:OS400:*:*)
332 echo powerpc-ibm-os400
333 exit ;;
334 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
335 echo arm-acorn-riscix${UNAME_RELEASE}
336 exit ;;
337 arm*:riscos:*:*|arm*:RISCOS:*:*)
338 echo arm-unknown-riscos
339 exit ;;
340 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
341 echo hppa1.1-hitachi-hiuxmpp
342 exit ;;
343 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
344 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
345 if test "`(/bin/universe) 2>/dev/null`" = att ; then
346 echo pyramid-pyramid-sysv3
347 else
348 echo pyramid-pyramid-bsd
349 fi
350 exit ;;
351 NILE*:*:*:dcosx)
352 echo pyramid-pyramid-svr4
353 exit ;;
354 DRS?6000:unix:4.0:6*)
355 echo sparc-icl-nx6
356 exit ;;
357 DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
358 case `/usr/bin/uname -p` in
359 sparc) echo sparc-icl-nx7; exit ;;
360 esac ;;
361 s390x:SunOS:*:*)
362 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
363 exit ;;
364 sun4H:SunOS:5.*:*)
365 echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
366 exit ;;
367 sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
368 echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
369 exit ;;
370 i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
371 echo i386-pc-auroraux${UNAME_RELEASE}
372 exit ;;
373 i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
374 eval $set_cc_for_build
375 SUN_ARCH="i386"
376 # If there is a compiler, see if it is configured for 64-bit objects.
377 # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
378 # This test works for both compilers.
379 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
380 if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
381 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
382 grep IS_64BIT_ARCH >/dev/null
383 then
384 SUN_ARCH="x86_64"
385 fi
386 fi
387 echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
388 exit ;;
389 sun4*:SunOS:6*:*)
390 # According to config.sub, this is the proper way to canonicalize
391 # SunOS6. Hard to guess exactly what SunOS6 will be like, but
392 # it's likely to be more like Solaris than SunOS4.
393 echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
394 exit ;;
395 sun4*:SunOS:*:*)
396 case "`/usr/bin/arch -k`" in
397 Series*|S4*)
398 UNAME_RELEASE=`uname -v`
399 ;;
400 esac
401 # Japanese Language versions have a version number like `4.1.3-JL'.
402 echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
403 exit ;;
404 sun3*:SunOS:*:*)
405 echo m68k-sun-sunos${UNAME_RELEASE}
406 exit ;;
407 sun*:*:4.2BSD:*)
408 UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
409 test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
410 case "`/bin/arch`" in
411 sun3)
412 echo m68k-sun-sunos${UNAME_RELEASE}
413 ;;
414 sun4)
415 echo sparc-sun-sunos${UNAME_RELEASE}
416 ;;
417 esac
418 exit ;;
419 aushp:SunOS:*:*)
420 echo sparc-auspex-sunos${UNAME_RELEASE}
421 exit ;;
422 # The situation for MiNT is a little confusing. The machine name
423 # can be virtually everything (everything which is not
424 # "atarist" or "atariste" at least should have a processor
425 # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
426 # to the lowercase version "mint" (or "freemint"). Finally
427 # the system name "TOS" denotes a system which is actually not
428 # MiNT. But MiNT is downward compatible to TOS, so this should
429 # be no problem.
430 atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
431 echo m68k-atari-mint${UNAME_RELEASE}
432 exit ;;
433 atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
434 echo m68k-atari-mint${UNAME_RELEASE}
435 exit ;;
436 *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
437 echo m68k-atari-mint${UNAME_RELEASE}
438 exit ;;
439 milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
440 echo m68k-milan-mint${UNAME_RELEASE}
441 exit ;;
442 hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
443 echo m68k-hades-mint${UNAME_RELEASE}
444 exit ;;
445 *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
446 echo m68k-unknown-mint${UNAME_RELEASE}
447 exit ;;
448 m68k:machten:*:*)
449 echo m68k-apple-machten${UNAME_RELEASE}
450 exit ;;
451 powerpc:machten:*:*)
452 echo powerpc-apple-machten${UNAME_RELEASE}
453 exit ;;
454 RISC*:Mach:*:*)
455 echo mips-dec-mach_bsd4.3
456 exit ;;
457 RISC*:ULTRIX:*:*)
458 echo mips-dec-ultrix${UNAME_RELEASE}
459 exit ;;
460 VAX*:ULTRIX*:*:*)
461 echo vax-dec-ultrix${UNAME_RELEASE}
462 exit ;;
463 2020:CLIX:*:* | 2430:CLIX:*:*)
464 echo clipper-intergraph-clix${UNAME_RELEASE}
465 exit ;;
466 mips:*:*:UMIPS | mips:*:*:RISCos)
467 eval $set_cc_for_build
468 sed 's/^ //' << EOF >$dummy.c
469 #ifdef __cplusplus
470 #include <stdio.h> /* for printf() prototype */
471 int main (int argc, char *argv[]) {
472 #else
473 int main (argc, argv) int argc; char *argv[]; {
474 #endif
475 #if defined (host_mips) && defined (MIPSEB)
476 #if defined (SYSTYPE_SYSV)
477 printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
478 #endif
479 #if defined (SYSTYPE_SVR4)
480 printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
481 #endif
482 #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
483 printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
484 #endif
485 #endif
486 exit (-1);
487 }
488 EOF
489 $CC_FOR_BUILD -o $dummy $dummy.c &&
490 dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
491 SYSTEM_NAME=`$dummy $dummyarg` &&
492 { echo "$SYSTEM_NAME"; exit; }
493 echo mips-mips-riscos${UNAME_RELEASE}
494 exit ;;
495 Motorola:PowerMAX_OS:*:*)
496 echo powerpc-motorola-powermax
497 exit ;;
498 Motorola:*:4.3:PL8-*)
499 echo powerpc-harris-powermax
500 exit ;;
501 Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
502 echo powerpc-harris-powermax
503 exit ;;
504 Night_Hawk:Power_UNIX:*:*)
505 echo powerpc-harris-powerunix
506 exit ;;
507 m88k:CX/UX:7*:*)
508 echo m88k-harris-cxux7
509 exit ;;
510 m88k:*:4*:R4*)
511 echo m88k-motorola-sysv4
512 exit ;;
513 m88k:*:3*:R3*)
514 echo m88k-motorola-sysv3
515 exit ;;
516 AViiON:dgux:*:*)
517 # DG/UX returns AViiON for all architectures
518 UNAME_PROCESSOR=`/usr/bin/uname -p`
519 if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
520 then
521 if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
522 [ ${TARGET_BINARY_INTERFACE}x = x ]
523 then
524 echo m88k-dg-dgux${UNAME_RELEASE}
525 else
526 echo m88k-dg-dguxbcs${UNAME_RELEASE}
527 fi
528 else
529 echo i586-dg-dgux${UNAME_RELEASE}
530 fi
531 exit ;;
532 M88*:DolphinOS:*:*) # DolphinOS (SVR3)
533 echo m88k-dolphin-sysv3
534 exit ;;
535 M88*:*:R3*:*)
536 # Delta 88k system running SVR3
537 echo m88k-motorola-sysv3
538 exit ;;
539 XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
540 echo m88k-tektronix-sysv3
541 exit ;;
542 Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
543 echo m68k-tektronix-bsd
544 exit ;;
545 *:IRIX*:*:*)
546 echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
547 exit ;;
548 ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
549 echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
550 exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
551 i*86:AIX:*:*)
552 echo i386-ibm-aix
553 exit ;;
554 ia64:AIX:*:*)
555 if [ -x /usr/bin/oslevel ] ; then
556 IBM_REV=`/usr/bin/oslevel`
557 else
558 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
559 fi
560 echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
561 exit ;;
562 *:AIX:2:3)
563 if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
564 eval $set_cc_for_build
565 sed 's/^ //' << EOF >$dummy.c
566 #include <sys/systemcfg.h>
567
568 main()
569 {
570 if (!__power_pc())
571 exit(1);
572 puts("powerpc-ibm-aix3.2.5");
573 exit(0);
574 }
575 EOF
576 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
577 then
578 echo "$SYSTEM_NAME"
579 else
580 echo rs6000-ibm-aix3.2.5
581 fi
582 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
583 echo rs6000-ibm-aix3.2.4
584 else
585 echo rs6000-ibm-aix3.2
586 fi
587 exit ;;
588 *:AIX:*:[4567])
589 IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
590 if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
591 IBM_ARCH=rs6000
592 else
593 IBM_ARCH=powerpc
594 fi
595 if [ -x /usr/bin/lslpp ] ; then
596 IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
597 awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
598 else
599 IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
600 fi
601 echo ${IBM_ARCH}-ibm-aix${IBM_REV}
602 exit ;;
603 *:AIX:*:*)
604 echo rs6000-ibm-aix
605 exit ;;
606 ibmrt:4.4BSD:*|romp-ibm:BSD:*)
607 echo romp-ibm-bsd4.4
608 exit ;;
609 ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
610 echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
611 exit ;; # report: romp-ibm BSD 4.3
612 *:BOSX:*:*)
613 echo rs6000-bull-bosx
614 exit ;;
615 DPX/2?00:B.O.S.:*:*)
616 echo m68k-bull-sysv3
617 exit ;;
618 9000/[34]??:4.3bsd:1.*:*)
619 echo m68k-hp-bsd
620 exit ;;
621 hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
622 echo m68k-hp-bsd4.4
623 exit ;;
624 9000/[34678]??:HP-UX:*:*)
625 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
626 case "${UNAME_MACHINE}" in
627 9000/31? ) HP_ARCH=m68000 ;;
628 9000/[34]?? ) HP_ARCH=m68k ;;
629 9000/[678][0-9][0-9])
630 if [ -x /usr/bin/getconf ]; then
631 sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
632 sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
633 case "${sc_cpu_version}" in
634 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
635 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
636 532) # CPU_PA_RISC2_0
637 case "${sc_kernel_bits}" in
638 32) HP_ARCH="hppa2.0n" ;;
639 64) HP_ARCH="hppa2.0w" ;;
640 '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
641 esac ;;
642 esac
643 fi
644 if [ "${HP_ARCH}" = "" ]; then
645 eval $set_cc_for_build
646 sed 's/^ //' << EOF >$dummy.c
647
648 #define _HPUX_SOURCE
649 #include <stdlib.h>
650 #include <unistd.h>
651
652 int main ()
653 {
654 #if defined(_SC_KERNEL_BITS)
655 long bits = sysconf(_SC_KERNEL_BITS);
656 #endif
657 long cpu = sysconf (_SC_CPU_VERSION);
658
659 switch (cpu)
660 {
661 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
662 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
663 case CPU_PA_RISC2_0:
664 #if defined(_SC_KERNEL_BITS)
665 switch (bits)
666 {
667 case 64: puts ("hppa2.0w"); break;
668 case 32: puts ("hppa2.0n"); break;
669 default: puts ("hppa2.0"); break;
670 } break;
671 #else /* !defined(_SC_KERNEL_BITS) */
672 puts ("hppa2.0"); break;
673 #endif
674 default: puts ("hppa1.0"); break;
675 }
676 exit (0);
677 }
678 EOF
679 (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
680 test -z "$HP_ARCH" && HP_ARCH=hppa
681 fi ;;
682 esac
683 if [ ${HP_ARCH} = "hppa2.0w" ]
684 then
685 eval $set_cc_for_build
686
687 # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
688 # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
689 # generating 64-bit code. GNU and HP use different nomenclature:
690 #
691 # $ CC_FOR_BUILD=cc ./config.guess
692 # => hppa2.0w-hp-hpux11.23
693 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
694 # => hppa64-hp-hpux11.23
695
696 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
697 grep -q __LP64__
698 then
699 HP_ARCH="hppa2.0w"
700 else
701 HP_ARCH="hppa64"
702 fi
703 fi
704 echo ${HP_ARCH}-hp-hpux${HPUX_REV}
705 exit ;;
706 ia64:HP-UX:*:*)
707 HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
708 echo ia64-hp-hpux${HPUX_REV}
709 exit ;;
710 3050*:HI-UX:*:*)
711 eval $set_cc_for_build
712 sed 's/^ //' << EOF >$dummy.c
713 #include <unistd.h>
714 int
715 main ()
716 {
717 long cpu = sysconf (_SC_CPU_VERSION);
718 /* The order matters, because CPU_IS_HP_MC68K erroneously returns
719 true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
720 results, however. */
721 if (CPU_IS_PA_RISC (cpu))
722 {
723 switch (cpu)
724 {
725 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
726 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
727 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
728 default: puts ("hppa-hitachi-hiuxwe2"); break;
729 }
730 }
731 else if (CPU_IS_HP_MC68K (cpu))
732 puts ("m68k-hitachi-hiuxwe2");
733 else puts ("unknown-hitachi-hiuxwe2");
734 exit (0);
735 }
736 EOF
737 $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
738 { echo "$SYSTEM_NAME"; exit; }
739 echo unknown-hitachi-hiuxwe2
740 exit ;;
741 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
742 echo hppa1.1-hp-bsd
743 exit ;;
744 9000/8??:4.3bsd:*:*)
745 echo hppa1.0-hp-bsd
746 exit ;;
747 *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
748 echo hppa1.0-hp-mpeix
749 exit ;;
750 hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
751 echo hppa1.1-hp-osf
752 exit ;;
753 hp8??:OSF1:*:*)
754 echo hppa1.0-hp-osf
755 exit ;;
756 i*86:OSF1:*:*)
757 if [ -x /usr/sbin/sysversion ] ; then
758 echo ${UNAME_MACHINE}-unknown-osf1mk
759 else
760 echo ${UNAME_MACHINE}-unknown-osf1
761 fi
762 exit ;;
763 parisc*:Lites*:*:*)
764 echo hppa1.1-hp-lites
765 exit ;;
766 C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
767 echo c1-convex-bsd
768 exit ;;
769 C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
770 if getsysinfo -f scalar_acc
771 then echo c32-convex-bsd
772 else echo c2-convex-bsd
773 fi
774 exit ;;
775 C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
776 echo c34-convex-bsd
777 exit ;;
778 C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
779 echo c38-convex-bsd
780 exit ;;
781 C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
782 echo c4-convex-bsd
783 exit ;;
784 CRAY*Y-MP:*:*:*)
785 echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
786 exit ;;
787 CRAY*[A-Z]90:*:*:*)
788 echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
789 | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
790 -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
791 -e 's/\.[^.]*$/.X/'
792 exit ;;
793 CRAY*TS:*:*:*)
794 echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
795 exit ;;
796 CRAY*T3E:*:*:*)
797 echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
798 exit ;;
799 CRAY*SV1:*:*:*)
800 echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
801 exit ;;
802 *:UNICOS/mp:*:*)
803 echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
804 exit ;;
805 F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
806 FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
807 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
808 FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
809 echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
810 exit ;;
811 5000:UNIX_System_V:4.*:*)
812 FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
813 FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
814 echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
815 exit ;;
816 i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
817 echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
818 exit ;;
819 sparc*:BSD/OS:*:*)
820 echo sparc-unknown-bsdi${UNAME_RELEASE}
821 exit ;;
822 *:BSD/OS:*:*)
823 echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
824 exit ;;
825 *:FreeBSD:*:*)
826 UNAME_PROCESSOR=`/usr/bin/uname -p`
827 case ${UNAME_PROCESSOR} in
828 amd64)
829 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
830 *)
831 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
832 esac
833 exit ;;
834 i*:CYGWIN*:*)
835 echo ${UNAME_MACHINE}-pc-cygwin
836 exit ;;
837 *:MINGW64*:*)
838 echo ${UNAME_MACHINE}-pc-mingw64
839 exit ;;
840 *:MINGW*:*)
841 echo ${UNAME_MACHINE}-pc-mingw32
842 exit ;;
843 *:MSYS*:*)
844 echo ${UNAME_MACHINE}-pc-msys
845 exit ;;
846 i*:windows32*:*)
847 # uname -m includes "-pc" on this system.
848 echo ${UNAME_MACHINE}-mingw32
849 exit ;;
850 i*:PW*:*)
851 echo ${UNAME_MACHINE}-pc-pw32
852 exit ;;
853 *:Interix*:*)
854 case ${UNAME_MACHINE} in
855 x86)
856 echo i586-pc-interix${UNAME_RELEASE}
857 exit ;;
858 authenticamd | genuineintel | EM64T)
859 echo x86_64-unknown-interix${UNAME_RELEASE}
860 exit ;;
861 IA64)
862 echo ia64-unknown-interix${UNAME_RELEASE}
863 exit ;;
864 esac ;;
865 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
866 echo i${UNAME_MACHINE}-pc-mks
867 exit ;;
868 8664:Windows_NT:*)
869 echo x86_64-pc-mks
870 exit ;;
871 i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
872 # How do we know it's Interix rather than the generic POSIX subsystem?
873 # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
874 # UNAME_MACHINE based on the output of uname instead of i386?
875 echo i586-pc-interix
876 exit ;;
877 i*:UWIN*:*)
878 echo ${UNAME_MACHINE}-pc-uwin
879 exit ;;
880 amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
881 echo x86_64-unknown-cygwin
882 exit ;;
883 p*:CYGWIN*:*)
884 echo powerpcle-unknown-cygwin
885 exit ;;
886 prep*:SunOS:5.*:*)
887 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
888 exit ;;
889 *:GNU:*:*)
890 # the GNU system
891 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
892 exit ;;
893 *:GNU/*:*:*)
894 # other systems with GNU libc and userland
895 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
896 exit ;;
897 i*86:Minix:*:*)
898 echo ${UNAME_MACHINE}-pc-minix
899 exit ;;
900 aarch64:Linux:*:*)
901 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
902 exit ;;
903 aarch64_be:Linux:*:*)
904 UNAME_MACHINE=aarch64_be
905 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
906 exit ;;
907 alpha:Linux:*:*)
908 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
909 EV5) UNAME_MACHINE=alphaev5 ;;
910 EV56) UNAME_MACHINE=alphaev56 ;;
911 PCA56) UNAME_MACHINE=alphapca56 ;;
912 PCA57) UNAME_MACHINE=alphapca56 ;;
913 EV6) UNAME_MACHINE=alphaev6 ;;
914 EV67) UNAME_MACHINE=alphaev67 ;;
915 EV68*) UNAME_MACHINE=alphaev68 ;;
916 esac
917 objdump --private-headers /bin/sh | grep -q ld.so.1
918 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
919 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
920 exit ;;
921 arc:Linux:*:* | arceb:Linux:*:*)
922 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
923 exit ;;
924 arm*:Linux:*:*)
925 eval $set_cc_for_build
926 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
927 | grep -q __ARM_EABI__
928 then
929 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
930 else
931 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
932 | grep -q __ARM_PCS_VFP
933 then
934 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
935 else
936 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
937 fi
938 fi
939 exit ;;
940 avr32*:Linux:*:*)
941 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
942 exit ;;
943 cris:Linux:*:*)
944 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
945 exit ;;
946 crisv32:Linux:*:*)
947 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
948 exit ;;
949 e2k:Linux:*:*)
950 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
951 exit ;;
952 frv:Linux:*:*)
953 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
954 exit ;;
955 hexagon:Linux:*:*)
956 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
957 exit ;;
958 i*86:Linux:*:*)
959 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
960 exit ;;
961 ia64:Linux:*:*)
962 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
963 exit ;;
964 m32r*:Linux:*:*)
965 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
966 exit ;;
967 m68*:Linux:*:*)
968 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
969 exit ;;
970 mips:Linux:*:* | mips64:Linux:*:*)
971 eval $set_cc_for_build
972 sed 's/^ //' << EOF >$dummy.c
973 #undef CPU
974 #undef ${UNAME_MACHINE}
975 #undef ${UNAME_MACHINE}el
976 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
977 CPU=${UNAME_MACHINE}el
978 #else
979 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
980 CPU=${UNAME_MACHINE}
981 #else
982 CPU=
983 #endif
984 #endif
985 EOF
986 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
987 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
988 ;;
989 openrisc*:Linux:*:*)
990 echo or1k-unknown-linux-${LIBC}
991 exit ;;
992 or32:Linux:*:* | or1k*:Linux:*:*)
993 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
994 exit ;;
995 padre:Linux:*:*)
996 echo sparc-unknown-linux-${LIBC}
997 exit ;;
998 parisc64:Linux:*:* | hppa64:Linux:*:*)
999 echo hppa64-unknown-linux-${LIBC}
1000 exit ;;
1001 parisc:Linux:*:* | hppa:Linux:*:*)
1002 # Look for CPU level
1003 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1004 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
1005 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
1006 *) echo hppa-unknown-linux-${LIBC} ;;
1007 esac
1008 exit ;;
1009 ppc64:Linux:*:*)
1010 echo powerpc64-unknown-linux-${LIBC}
1011 exit ;;
1012 ppc:Linux:*:*)
1013 echo powerpc-unknown-linux-${LIBC}
1014 exit ;;
1015 ppc64le:Linux:*:*)
1016 echo powerpc64le-unknown-linux-${LIBC}
1017 exit ;;
1018 ppcle:Linux:*:*)
1019 echo powerpcle-unknown-linux-${LIBC}
1020 exit ;;
1021 s390:Linux:*:* | s390x:Linux:*:*)
1022 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1023 exit ;;
1024 sh64*:Linux:*:*)
1025 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1026 exit ;;
1027 sh*:Linux:*:*)
1028 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1029 exit ;;
1030 sparc:Linux:*:* | sparc64:Linux:*:*)
1031 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1032 exit ;;
1033 tile*:Linux:*:*)
1034 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1035 exit ;;
1036 vax:Linux:*:*)
1037 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1038 exit ;;
1039 x86_64:Linux:*:*)
1040 eval $set_cc_for_build
1041 X86_64_ABI=
1042 # If there is a compiler, see if it is configured for 32-bit objects.
1043 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1044 if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
1045 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1046 grep IS_X32 >/dev/null
1047 then
1048 X86_64_ABI=x32
1049 fi
1050 fi
1051 echo x86_64-unknown-linux-gnu${X86_64_ABI}
1052 exit ;;
1053 xtensa*:Linux:*:*)
1054 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1055 exit ;;
1056 i*86:DYNIX/ptx:4*:*)
1057 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1058 # earlier versions are messed up and put the nodename in both
1059 # sysname and nodename.
1060 echo i386-sequent-sysv4
1061 exit ;;
1062 i*86:UNIX_SV:4.2MP:2.*)
1063 # Unixware is an offshoot of SVR4, but it has its own version
1064 # number series starting with 2...
1065 # I am not positive that other SVR4 systems won't match this,
1066 # I just have to hope. -- rms.
1067 # Use sysv4.2uw... so that sysv4* matches it.
1068 echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1069 exit ;;
1070 i*86:OS/2:*:*)
1071 # If we were able to find `uname', then EMX Unix compatibility
1072 # is probably installed.
1073 echo ${UNAME_MACHINE}-pc-os2-emx
1074 exit ;;
1075 i*86:XTS-300:*:STOP)
1076 echo ${UNAME_MACHINE}-unknown-stop
1077 exit ;;
1078 i*86:atheos:*:*)
1079 echo ${UNAME_MACHINE}-unknown-atheos
1080 exit ;;
1081 i*86:syllable:*:*)
1082 echo ${UNAME_MACHINE}-pc-syllable
1083 exit ;;
1084 i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1085 echo i386-unknown-lynxos${UNAME_RELEASE}
1086 exit ;;
1087 i*86:*DOS:*:*)
1088 echo ${UNAME_MACHINE}-pc-msdosdjgpp
1089 exit ;;
1090 i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1091 UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1092 if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1093 echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1094 else
1095 echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1096 fi
1097 exit ;;
1098 i*86:*:5:[678]*)
1099 # UnixWare 7.x, OpenUNIX and OpenServer 6.
1100 case `/bin/uname -X | grep "^Machine"` in
1101 *486*) UNAME_MACHINE=i486 ;;
1102 *Pentium) UNAME_MACHINE=i586 ;;
1103 *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1104 esac
1105 echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1106 exit ;;
1107 i*86:*:3.2:*)
1108 if test -f /usr/options/cb.name; then
1109 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1110 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1111 elif /bin/uname -X 2>/dev/null >/dev/null ; then
1112 UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1113 (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1114 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1115 && UNAME_MACHINE=i586
1116 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1117 && UNAME_MACHINE=i686
1118 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1119 && UNAME_MACHINE=i686
1120 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1121 else
1122 echo ${UNAME_MACHINE}-pc-sysv32
1123 fi
1124 exit ;;
1125 pc:*:*:*)
1126 # Left here for compatibility:
1127 # uname -m prints for DJGPP always 'pc', but it prints nothing about
1128 # the processor, so we play safe by assuming i586.
1129 # Note: whatever this is, it MUST be the same as what config.sub
1130 # prints for the "djgpp" host, or else GDB configury will decide that
1131 # this is a cross-build.
1132 echo i586-pc-msdosdjgpp
1133 exit ;;
1134 Intel:Mach:3*:*)
1135 echo i386-pc-mach3
1136 exit ;;
1137 paragon:*:*:*)
1138 echo i860-intel-osf1
1139 exit ;;
1140 i860:*:4.*:*) # i860-SVR4
1141 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1142 echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1143 else # Add other i860-SVR4 vendors below as they are discovered.
1144 echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
1145 fi
1146 exit ;;
1147 mini*:CTIX:SYS*5:*)
1148 # "miniframe"
1149 echo m68010-convergent-sysv
1150 exit ;;
1151 mc68k:UNIX:SYSTEM5:3.51m)
1152 echo m68k-convergent-sysv
1153 exit ;;
1154 M680?0:D-NIX:5.3:*)
1155 echo m68k-diab-dnix
1156 exit ;;
1157 M68*:*:R3V[5678]*:*)
1158 test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1159 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1160 OS_REL=''
1161 test -r /etc/.relid \
1162 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1163 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1164 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1165 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1166 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1167 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1168 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1169 && { echo i486-ncr-sysv4; exit; } ;;
1170 NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1171 OS_REL='.3'
1172 test -r /etc/.relid \
1173 && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1174 /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1175 && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1176 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1177 && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1178 /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1179 && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1180 m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1181 echo m68k-unknown-lynxos${UNAME_RELEASE}
1182 exit ;;
1183 mc68030:UNIX_System_V:4.*:*)
1184 echo m68k-atari-sysv4
1185 exit ;;
1186 TSUNAMI:LynxOS:2.*:*)
1187 echo sparc-unknown-lynxos${UNAME_RELEASE}
1188 exit ;;
1189 rs6000:LynxOS:2.*:*)
1190 echo rs6000-unknown-lynxos${UNAME_RELEASE}
1191 exit ;;
1192 PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1193 echo powerpc-unknown-lynxos${UNAME_RELEASE}
1194 exit ;;
1195 SM[BE]S:UNIX_SV:*:*)
1196 echo mips-dde-sysv${UNAME_RELEASE}
1197 exit ;;
1198 RM*:ReliantUNIX-*:*:*)
1199 echo mips-sni-sysv4
1200 exit ;;
1201 RM*:SINIX-*:*:*)
1202 echo mips-sni-sysv4
1203 exit ;;
1204 *:SINIX-*:*:*)
1205 if uname -p 2>/dev/null >/dev/null ; then
1206 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1207 echo ${UNAME_MACHINE}-sni-sysv4
1208 else
1209 echo ns32k-sni-sysv
1210 fi
1211 exit ;;
1212 PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1213 # says <Richard.M.Bartel@ccMail.Census.GOV>
1214 echo i586-unisys-sysv4
1215 exit ;;
1216 *:UNIX_System_V:4*:FTX*)
1217 # From Gerald Hewes <hewes@openmarket.com>.
1218 # How about differentiating between stratus architectures? -djm
1219 echo hppa1.1-stratus-sysv4
1220 exit ;;
1221 *:*:*:FTX*)
1222 # From seanf@swdc.stratus.com.
1223 echo i860-stratus-sysv4
1224 exit ;;
1225 i*86:VOS:*:*)
1226 # From Paul.Green@stratus.com.
1227 echo ${UNAME_MACHINE}-stratus-vos
1228 exit ;;
1229 *:VOS:*:*)
1230 # From Paul.Green@stratus.com.
1231 echo hppa1.1-stratus-vos
1232 exit ;;
1233 mc68*:A/UX:*:*)
1234 echo m68k-apple-aux${UNAME_RELEASE}
1235 exit ;;
1236 news*:NEWS-OS:6*:*)
1237 echo mips-sony-newsos6
1238 exit ;;
1239 R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1240 if [ -d /usr/nec ]; then
1241 echo mips-nec-sysv${UNAME_RELEASE}
1242 else
1243 echo mips-unknown-sysv${UNAME_RELEASE}
1244 fi
1245 exit ;;
1246 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1247 echo powerpc-be-beos
1248 exit ;;
1249 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1250 echo powerpc-apple-beos
1251 exit ;;
1252 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1253 echo i586-pc-beos
1254 exit ;;
1255 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1256 echo i586-pc-haiku
1257 exit ;;
1258 x86_64:Haiku:*:*)
1259 echo x86_64-unknown-haiku
1260 exit ;;
1261 SX-4:SUPER-UX:*:*)
1262 echo sx4-nec-superux${UNAME_RELEASE}
1263 exit ;;
1264 SX-5:SUPER-UX:*:*)
1265 echo sx5-nec-superux${UNAME_RELEASE}
1266 exit ;;
1267 SX-6:SUPER-UX:*:*)
1268 echo sx6-nec-superux${UNAME_RELEASE}
1269 exit ;;
1270 SX-7:SUPER-UX:*:*)
1271 echo sx7-nec-superux${UNAME_RELEASE}
1272 exit ;;
1273 SX-8:SUPER-UX:*:*)
1274 echo sx8-nec-superux${UNAME_RELEASE}
1275 exit ;;
1276 SX-8R:SUPER-UX:*:*)
1277 echo sx8r-nec-superux${UNAME_RELEASE}
1278 exit ;;
1279 Power*:Rhapsody:*:*)
1280 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1281 exit ;;
1282 *:Rhapsody:*:*)
1283 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1284 exit ;;
1285 *:Darwin:*:*)
1286 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1287 eval $set_cc_for_build
1288 if test "$UNAME_PROCESSOR" = unknown ; then
1289 UNAME_PROCESSOR=powerpc
1290 fi
1291 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1292 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1293 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1294 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1295 grep IS_64BIT_ARCH >/dev/null
1296 then
1297 case $UNAME_PROCESSOR in
1298 i386) UNAME_PROCESSOR=x86_64 ;;
1299 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1300 esac
1301 fi
1302 fi
1303 elif test "$UNAME_PROCESSOR" = i386 ; then
1304 # Avoid executing cc on OS X 10.9, as it ships with a stub
1305 # that puts up a graphical alert prompting to install
1306 # developer tools. Any system running Mac OS X 10.7 or
1307 # later (Darwin 11 and later) is required to have a 64-bit
1308 # processor. This is not true of the ARM version of Darwin
1309 # that Apple uses in portable devices.
1310 UNAME_PROCESSOR=x86_64
1311 fi
1312 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1313 exit ;;
1314 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1315 UNAME_PROCESSOR=`uname -p`
1316 if test "$UNAME_PROCESSOR" = "x86"; then
1317 UNAME_PROCESSOR=i386
1318 UNAME_MACHINE=pc
1319 fi
1320 echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1321 exit ;;
1322 *:QNX:*:4*)
1323 echo i386-pc-qnx
1324 exit ;;
1325 NEO-?:NONSTOP_KERNEL:*:*)
1326 echo neo-tandem-nsk${UNAME_RELEASE}
1327 exit ;;
1328 NSE-*:NONSTOP_KERNEL:*:*)
1329 echo nse-tandem-nsk${UNAME_RELEASE}
1330 exit ;;
1331 NSR-?:NONSTOP_KERNEL:*:*)
1332 echo nsr-tandem-nsk${UNAME_RELEASE}
1333 exit ;;
1334 *:NonStop-UX:*:*)
1335 echo mips-compaq-nonstopux
1336 exit ;;
1337 BS2000:POSIX*:*:*)
1338 echo bs2000-siemens-sysv
1339 exit ;;
1340 DS/*:UNIX_System_V:*:*)
1341 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1342 exit ;;
1343 *:Plan9:*:*)
1344 # "uname -m" is not consistent, so use $cputype instead. 386
1345 # is converted to i386 for consistency with other x86
1346 # operating systems.
1347 if test "$cputype" = "386"; then
1348 UNAME_MACHINE=i386
1349 else
1350 UNAME_MACHINE="$cputype"
1351 fi
1352 echo ${UNAME_MACHINE}-unknown-plan9
1353 exit ;;
1354 *:TOPS-10:*:*)
1355 echo pdp10-unknown-tops10
1356 exit ;;
1357 *:TENEX:*:*)
1358 echo pdp10-unknown-tenex
1359 exit ;;
1360 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1361 echo pdp10-dec-tops20
1362 exit ;;
1363 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1364 echo pdp10-xkl-tops20
1365 exit ;;
1366 *:TOPS-20:*:*)
1367 echo pdp10-unknown-tops20
1368 exit ;;
1369 *:ITS:*:*)
1370 echo pdp10-unknown-its
1371 exit ;;
1372 SEI:*:*:SEIUX)
1373 echo mips-sei-seiux${UNAME_RELEASE}
1374 exit ;;
1375 *:DragonFly:*:*)
1376 echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1377 exit ;;
1378 *:*VMS:*:*)
1379 UNAME_MACHINE=`(uname -p) 2>/dev/null`
1380 case "${UNAME_MACHINE}" in
1381 A*) echo alpha-dec-vms ; exit ;;
1382 I*) echo ia64-dec-vms ; exit ;;
1383 V*) echo vax-dec-vms ; exit ;;
1384 esac ;;
1385 *:XENIX:*:SysV)
1386 echo i386-pc-xenix
1387 exit ;;
1388 i*86:skyos:*:*)
1389 echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1390 exit ;;
1391 i*86:rdos:*:*)
1392 echo ${UNAME_MACHINE}-pc-rdos
1393 exit ;;
1394 i*86:AROS:*:*)
1395 echo ${UNAME_MACHINE}-pc-aros
1396 exit ;;
1397 x86_64:VMkernel:*:*)
1398 echo ${UNAME_MACHINE}-unknown-esx
1399 exit ;;
1400 esac
1401
1402 cat >&2 <<EOF
1403 $0: unable to guess system type
1404
1405 This script, last modified $timestamp, has failed to recognize
1406 the operating system you are using. It is advised that you
1407 download the most up to date version of the config scripts from
1408
1409 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1410 and
1411 http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1412
1413 If the version you run ($0) is already up to date, please
1414 send the following data and any information you think might be
1415 pertinent to <config-patches@gnu.org> in order to provide the needed
1416 information to handle your system.
1417
1418 config.guess timestamp = $timestamp
1419
1420 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1421 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1422 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1423 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1424
1425 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1426 /bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1427
1428 hostinfo = `(hostinfo) 2>/dev/null`
1429 /bin/universe = `(/bin/universe) 2>/dev/null`
1430 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1431 /bin/arch = `(/bin/arch) 2>/dev/null`
1432 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1433 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1434
1435 UNAME_MACHINE = ${UNAME_MACHINE}
1436 UNAME_RELEASE = ${UNAME_RELEASE}
1437 UNAME_SYSTEM = ${UNAME_SYSTEM}
1438 UNAME_VERSION = ${UNAME_VERSION}
1439 EOF
1440
1441 exit 1
1442
1443 # Local variables:
1444 # eval: (add-hook 'write-file-hooks 'time-stamp)
1445 # time-stamp-start: "timestamp='"
1446 # time-stamp-format: "%:y-%02m-%02d"
1447 # time-stamp-end: "'"
1448 # End:
0 #! /bin/sh
1 # Configuration validation subroutine script.
2 # Copyright 1992-2015 Free Software Foundation, Inc.
3
4 timestamp='2015-03-08'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, see <http://www.gnu.org/licenses/>.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program that contains a
21 # configuration script generated by Autoconf, you may include it under
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25
26
27 # Please send patches to <config-patches@gnu.org>.
28 #
29 # Configuration subroutine to validate and canonicalize a configuration type.
30 # Supply the specified configuration type as an argument.
31 # If it is invalid, we print an error message on stderr and exit with code 1.
32 # Otherwise, we print the canonical config type on stdout and succeed.
33
34 # 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
36
37 # This file is supposed to be the same for all GNU packages
38 # and recognize all the CPU types, system types and aliases
39 # that are meaningful with *any* GNU software.
40 # Each package is responsible for reporting which valid configurations
41 # it does not support. The user should be able to distinguish
42 # a failure to support a valid configuration from a meaningless
43 # configuration.
44
45 # The goal of this file is to map all the various variations of a given
46 # machine specification into a single specification in the form:
47 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
48 # or in some cases, the newer four-part form:
49 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
50 # It is wrong to echo any other type of specification.
51
52 me=`echo "$0" | sed -e 's,.*/,,'`
53
54 usage="\
55 Usage: $0 [OPTION] CPU-MFR-OPSYS
56 $0 [OPTION] ALIAS
57
58 Canonicalize a configuration name.
59
60 Operation modes:
61 -h, --help print this help, then exit
62 -t, --time-stamp print date of last modification, then exit
63 -v, --version print version number, then exit
64
65 Report bugs and patches to <config-patches@gnu.org>."
66
67 version="\
68 GNU config.sub ($timestamp)
69
70 Copyright 1992-2015 Free Software Foundation, Inc.
71
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 help="
76 Try \`$me --help' for more information."
77
78 # Parse command line
79 while test $# -gt 0 ; do
80 case $1 in
81 --time-stamp | --time* | -t )
82 echo "$timestamp" ; exit ;;
83 --version | -v )
84 echo "$version" ; exit ;;
85 --help | --h* | -h )
86 echo "$usage"; exit ;;
87 -- ) # Stop option processing
88 shift; break ;;
89 - ) # Use stdin as input.
90 break ;;
91 -* )
92 echo "$me: invalid option $1$help"
93 exit 1 ;;
94
95 *local*)
96 # First pass through any local machine types.
97 echo $1
98 exit ;;
99
100 * )
101 break ;;
102 esac
103 done
104
105 case $# in
106 0) echo "$me: missing argument$help" >&2
107 exit 1;;
108 1) ;;
109 *) echo "$me: too many arguments$help" >&2
110 exit 1;;
111 esac
112
113 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
114 # Here we must recognize all the valid KERNEL-OS combinations.
115 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
116 case $maybe_os in
117 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
118 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119 knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
120 kopensolaris*-gnu* | \
121 storm-chaos* | os2-emx* | rtmk-nova*)
122 os=-$maybe_os
123 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124 ;;
125 android-linux)
126 os=-linux-android
127 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
128 ;;
129 *)
130 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131 if [ $basic_machine != $1 ]
132 then os=`echo $1 | sed 's/.*-/-/'`
133 else os=; fi
134 ;;
135 esac
136
137 ### Let's recognize common machines as not being operating systems so
138 ### that things like config.sub decstation-3100 work. We also
139 ### recognize some manufacturers as not being operating systems, so we
140 ### can provide default operating systems below.
141 case $os in
142 -sun*os*)
143 # Prevent following clause from handling this invalid input.
144 ;;
145 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
146 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
147 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
148 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151 -apple | -axis | -knuth | -cray | -microblaze*)
152 os=
153 basic_machine=$1
154 ;;
155 -bluegene*)
156 os=-cnk
157 ;;
158 -sim | -cisco | -oki | -wec | -winbond)
159 os=
160 basic_machine=$1
161 ;;
162 -scout)
163 ;;
164 -wrs)
165 os=-vxworks
166 basic_machine=$1
167 ;;
168 -chorusos*)
169 os=-chorusos
170 basic_machine=$1
171 ;;
172 -chorusrdb)
173 os=-chorusrdb
174 basic_machine=$1
175 ;;
176 -hiux*)
177 os=-hiuxwe2
178 ;;
179 -sco6)
180 os=-sco5v6
181 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182 ;;
183 -sco5)
184 os=-sco3.2v5
185 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186 ;;
187 -sco4)
188 os=-sco3.2v4
189 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190 ;;
191 -sco3.2.[4-9]*)
192 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194 ;;
195 -sco3.2v[4-9]*)
196 # Don't forget version if it is 3.2v4 or newer.
197 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198 ;;
199 -sco5v6*)
200 # Don't forget version if it is 3.2v4 or newer.
201 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202 ;;
203 -sco*)
204 os=-sco3.2v2
205 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206 ;;
207 -udk*)
208 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209 ;;
210 -isc)
211 os=-isc2.2
212 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
213 ;;
214 -clix*)
215 basic_machine=clipper-intergraph
216 ;;
217 -isc*)
218 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219 ;;
220 -lynx*178)
221 os=-lynxos178
222 ;;
223 -lynx*5)
224 os=-lynxos5
225 ;;
226 -lynx*)
227 os=-lynxos
228 ;;
229 -ptx*)
230 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231 ;;
232 -windowsnt*)
233 os=`echo $os | sed -e 's/windowsnt/winnt/'`
234 ;;
235 -psos*)
236 os=-psos
237 ;;
238 -mint | -mint[0-9]*)
239 basic_machine=m68k-atari
240 os=-mint
241 ;;
242 esac
243
244 # Decode aliases for certain CPU-COMPANY combinations.
245 case $basic_machine in
246 # Recognize the basic CPU types without company name.
247 # Some are omitted here because they have special meanings below.
248 1750a | 580 \
249 | a29k \
250 | aarch64 | aarch64_be \
251 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
252 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
253 | am33_2.0 \
254 | arc | arceb \
255 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
256 | avr | avr32 \
257 | be32 | be64 \
258 | bfin \
259 | c4x | c8051 | clipper \
260 | d10v | d30v | dlx | dsp16xx | dvp \
261 | e2k | epiphany \
262 | fido | fr30 | frv | ft32 \
263 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
264 | hexagon \
265 | i370 | i860 | i960 | ia64 \
266 | ip2k | iq2000 \
267 | k1om \
268 | le32 | le64 \
269 | lm32 \
270 | m32c | m32r | m32rle | m68000 | m68k | m88k \
271 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
272 | mips | mipsbe | mipseb | mipsel | mipsle \
273 | mips16 \
274 | mips64 | mips64el \
275 | mips64octeon | mips64octeonel \
276 | mips64orion | mips64orionel \
277 | mips64r5900 | mips64r5900el \
278 | mips64vr | mips64vrel \
279 | mips64vr4100 | mips64vr4100el \
280 | mips64vr4300 | mips64vr4300el \
281 | mips64vr5000 | mips64vr5000el \
282 | mips64vr5900 | mips64vr5900el \
283 | mipsisa32 | mipsisa32el \
284 | mipsisa32r2 | mipsisa32r2el \
285 | mipsisa32r6 | mipsisa32r6el \
286 | mipsisa64 | mipsisa64el \
287 | mipsisa64r2 | mipsisa64r2el \
288 | mipsisa64r6 | mipsisa64r6el \
289 | mipsisa64sb1 | mipsisa64sb1el \
290 | mipsisa64sr71k | mipsisa64sr71kel \
291 | mipsr5900 | mipsr5900el \
292 | mipstx39 | mipstx39el \
293 | mn10200 | mn10300 \
294 | moxie \
295 | mt \
296 | msp430 \
297 | nds32 | nds32le | nds32be \
298 | nios | nios2 | nios2eb | nios2el \
299 | ns16k | ns32k \
300 | open8 | or1k | or1knd | or32 \
301 | pdp10 | pdp11 | pj | pjl \
302 | powerpc | powerpc64 | powerpc64le | powerpcle \
303 | pyramid \
304 | riscv32 | riscv64 \
305 | rl78 | rx \
306 | score \
307 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
308 | sh64 | sh64le \
309 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
310 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
311 | spu \
312 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
313 | ubicom32 \
314 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
315 | visium \
316 | we32k \
317 | x86 | xc16x | xstormy16 | xtensa \
318 | z8k | z80)
319 basic_machine=$basic_machine-unknown
320 ;;
321 c54x)
322 basic_machine=tic54x-unknown
323 ;;
324 c55x)
325 basic_machine=tic55x-unknown
326 ;;
327 c6x)
328 basic_machine=tic6x-unknown
329 ;;
330 leon|leon[3-9])
331 basic_machine=sparc-$basic_machine
332 ;;
333 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
334 basic_machine=$basic_machine-unknown
335 os=-none
336 ;;
337 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
338 ;;
339 ms1)
340 basic_machine=mt-unknown
341 ;;
342
343 strongarm | thumb | xscale)
344 basic_machine=arm-unknown
345 ;;
346 xgate)
347 basic_machine=$basic_machine-unknown
348 os=-none
349 ;;
350 xscaleeb)
351 basic_machine=armeb-unknown
352 ;;
353
354 xscaleel)
355 basic_machine=armel-unknown
356 ;;
357
358 # We use `pc' rather than `unknown'
359 # because (1) that's what they normally are, and
360 # (2) the word "unknown" tends to confuse beginning users.
361 i*86 | x86_64)
362 basic_machine=$basic_machine-pc
363 ;;
364 # Object if more than one company name word.
365 *-*-*)
366 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
367 exit 1
368 ;;
369 # Recognize the basic CPU types with company name.
370 580-* \
371 | a29k-* \
372 | aarch64-* | aarch64_be-* \
373 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
374 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
375 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
376 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
377 | avr-* | avr32-* \
378 | be32-* | be64-* \
379 | bfin-* | bs2000-* \
380 | c[123]* | c30-* | [cjt]90-* | c4x-* \
381 | c8051-* | clipper-* | craynv-* | cydra-* \
382 | d10v-* | d30v-* | dlx-* \
383 | e2k-* | elxsi-* \
384 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
385 | h8300-* | h8500-* \
386 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
387 | hexagon-* \
388 | i*86-* | i860-* | i960-* | ia64-* \
389 | ip2k-* | iq2000-* \
390 | k1om-* \
391 | le32-* | le64-* \
392 | lm32-* \
393 | m32c-* | m32r-* | m32rle-* \
394 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
395 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
396 | microblaze-* | microblazeel-* \
397 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
398 | mips16-* \
399 | mips64-* | mips64el-* \
400 | mips64octeon-* | mips64octeonel-* \
401 | mips64orion-* | mips64orionel-* \
402 | mips64r5900-* | mips64r5900el-* \
403 | mips64vr-* | mips64vrel-* \
404 | mips64vr4100-* | mips64vr4100el-* \
405 | mips64vr4300-* | mips64vr4300el-* \
406 | mips64vr5000-* | mips64vr5000el-* \
407 | mips64vr5900-* | mips64vr5900el-* \
408 | mipsisa32-* | mipsisa32el-* \
409 | mipsisa32r2-* | mipsisa32r2el-* \
410 | mipsisa32r6-* | mipsisa32r6el-* \
411 | mipsisa64-* | mipsisa64el-* \
412 | mipsisa64r2-* | mipsisa64r2el-* \
413 | mipsisa64r6-* | mipsisa64r6el-* \
414 | mipsisa64sb1-* | mipsisa64sb1el-* \
415 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
416 | mipsr5900-* | mipsr5900el-* \
417 | mipstx39-* | mipstx39el-* \
418 | mmix-* \
419 | mt-* \
420 | msp430-* \
421 | nds32-* | nds32le-* | nds32be-* \
422 | nios-* | nios2-* | nios2eb-* | nios2el-* \
423 | none-* | np1-* | ns16k-* | ns32k-* \
424 | open8-* \
425 | or1k*-* \
426 | orion-* \
427 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
428 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
429 | pyramid-* \
430 | rl78-* | romp-* | rs6000-* | rx-* \
431 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
432 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
433 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
434 | sparclite-* \
435 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
436 | tahoe-* \
437 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
438 | tile*-* \
439 | tron-* \
440 | ubicom32-* \
441 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
442 | vax-* \
443 | visium-* \
444 | we32k-* \
445 | x86-* | x86_64-* | xc16x-* | xps100-* \
446 | xstormy16-* | xtensa*-* \
447 | ymp-* \
448 | z8k-* | z80-*)
449 ;;
450 # Recognize the basic CPU types without company name, with glob match.
451 xtensa*)
452 basic_machine=$basic_machine-unknown
453 ;;
454 # Recognize the various machine names and aliases which stand
455 # for a CPU type and a company and sometimes even an OS.
456 386bsd)
457 basic_machine=i386-unknown
458 os=-bsd
459 ;;
460 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
461 basic_machine=m68000-att
462 ;;
463 3b*)
464 basic_machine=we32k-att
465 ;;
466 a29khif)
467 basic_machine=a29k-amd
468 os=-udi
469 ;;
470 abacus)
471 basic_machine=abacus-unknown
472 ;;
473 adobe68k)
474 basic_machine=m68010-adobe
475 os=-scout
476 ;;
477 alliant | fx80)
478 basic_machine=fx80-alliant
479 ;;
480 altos | altos3068)
481 basic_machine=m68k-altos
482 ;;
483 am29k)
484 basic_machine=a29k-none
485 os=-bsd
486 ;;
487 amd64)
488 basic_machine=x86_64-pc
489 ;;
490 amd64-*)
491 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
492 ;;
493 amdahl)
494 basic_machine=580-amdahl
495 os=-sysv
496 ;;
497 amiga | amiga-*)
498 basic_machine=m68k-unknown
499 ;;
500 amigaos | amigados)
501 basic_machine=m68k-unknown
502 os=-amigaos
503 ;;
504 amigaunix | amix)
505 basic_machine=m68k-unknown
506 os=-sysv4
507 ;;
508 apollo68)
509 basic_machine=m68k-apollo
510 os=-sysv
511 ;;
512 apollo68bsd)
513 basic_machine=m68k-apollo
514 os=-bsd
515 ;;
516 aros)
517 basic_machine=i386-pc
518 os=-aros
519 ;;
520 asmjs)
521 basic_machine=asmjs-unknown
522 ;;
523 aux)
524 basic_machine=m68k-apple
525 os=-aux
526 ;;
527 balance)
528 basic_machine=ns32k-sequent
529 os=-dynix
530 ;;
531 blackfin)
532 basic_machine=bfin-unknown
533 os=-linux
534 ;;
535 blackfin-*)
536 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
537 os=-linux
538 ;;
539 bluegene*)
540 basic_machine=powerpc-ibm
541 os=-cnk
542 ;;
543 c54x-*)
544 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
545 ;;
546 c55x-*)
547 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
548 ;;
549 c6x-*)
550 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
551 ;;
552 c90)
553 basic_machine=c90-cray
554 os=-unicos
555 ;;
556 cegcc)
557 basic_machine=arm-unknown
558 os=-cegcc
559 ;;
560 convex-c1)
561 basic_machine=c1-convex
562 os=-bsd
563 ;;
564 convex-c2)
565 basic_machine=c2-convex
566 os=-bsd
567 ;;
568 convex-c32)
569 basic_machine=c32-convex
570 os=-bsd
571 ;;
572 convex-c34)
573 basic_machine=c34-convex
574 os=-bsd
575 ;;
576 convex-c38)
577 basic_machine=c38-convex
578 os=-bsd
579 ;;
580 cray | j90)
581 basic_machine=j90-cray
582 os=-unicos
583 ;;
584 craynv)
585 basic_machine=craynv-cray
586 os=-unicosmp
587 ;;
588 cr16 | cr16-*)
589 basic_machine=cr16-unknown
590 os=-elf
591 ;;
592 crds | unos)
593 basic_machine=m68k-crds
594 ;;
595 crisv32 | crisv32-* | etraxfs*)
596 basic_machine=crisv32-axis
597 ;;
598 cris | cris-* | etrax*)
599 basic_machine=cris-axis
600 ;;
601 crx)
602 basic_machine=crx-unknown
603 os=-elf
604 ;;
605 da30 | da30-*)
606 basic_machine=m68k-da30
607 ;;
608 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
609 basic_machine=mips-dec
610 ;;
611 decsystem10* | dec10*)
612 basic_machine=pdp10-dec
613 os=-tops10
614 ;;
615 decsystem20* | dec20*)
616 basic_machine=pdp10-dec
617 os=-tops20
618 ;;
619 delta | 3300 | motorola-3300 | motorola-delta \
620 | 3300-motorola | delta-motorola)
621 basic_machine=m68k-motorola
622 ;;
623 delta88)
624 basic_machine=m88k-motorola
625 os=-sysv3
626 ;;
627 dicos)
628 basic_machine=i686-pc
629 os=-dicos
630 ;;
631 djgpp)
632 basic_machine=i586-pc
633 os=-msdosdjgpp
634 ;;
635 dpx20 | dpx20-*)
636 basic_machine=rs6000-bull
637 os=-bosx
638 ;;
639 dpx2* | dpx2*-bull)
640 basic_machine=m68k-bull
641 os=-sysv3
642 ;;
643 ebmon29k)
644 basic_machine=a29k-amd
645 os=-ebmon
646 ;;
647 elxsi)
648 basic_machine=elxsi-elxsi
649 os=-bsd
650 ;;
651 encore | umax | mmax)
652 basic_machine=ns32k-encore
653 ;;
654 es1800 | OSE68k | ose68k | ose | OSE)
655 basic_machine=m68k-ericsson
656 os=-ose
657 ;;
658 fx2800)
659 basic_machine=i860-alliant
660 ;;
661 genix)
662 basic_machine=ns32k-ns
663 ;;
664 gmicro)
665 basic_machine=tron-gmicro
666 os=-sysv
667 ;;
668 go32)
669 basic_machine=i386-pc
670 os=-go32
671 ;;
672 h3050r* | hiux*)
673 basic_machine=hppa1.1-hitachi
674 os=-hiuxwe2
675 ;;
676 h8300hms)
677 basic_machine=h8300-hitachi
678 os=-hms
679 ;;
680 h8300xray)
681 basic_machine=h8300-hitachi
682 os=-xray
683 ;;
684 h8500hms)
685 basic_machine=h8500-hitachi
686 os=-hms
687 ;;
688 harris)
689 basic_machine=m88k-harris
690 os=-sysv3
691 ;;
692 hp300-*)
693 basic_machine=m68k-hp
694 ;;
695 hp300bsd)
696 basic_machine=m68k-hp
697 os=-bsd
698 ;;
699 hp300hpux)
700 basic_machine=m68k-hp
701 os=-hpux
702 ;;
703 hp3k9[0-9][0-9] | hp9[0-9][0-9])
704 basic_machine=hppa1.0-hp
705 ;;
706 hp9k2[0-9][0-9] | hp9k31[0-9])
707 basic_machine=m68000-hp
708 ;;
709 hp9k3[2-9][0-9])
710 basic_machine=m68k-hp
711 ;;
712 hp9k6[0-9][0-9] | hp6[0-9][0-9])
713 basic_machine=hppa1.0-hp
714 ;;
715 hp9k7[0-79][0-9] | hp7[0-79][0-9])
716 basic_machine=hppa1.1-hp
717 ;;
718 hp9k78[0-9] | hp78[0-9])
719 # FIXME: really hppa2.0-hp
720 basic_machine=hppa1.1-hp
721 ;;
722 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
723 # FIXME: really hppa2.0-hp
724 basic_machine=hppa1.1-hp
725 ;;
726 hp9k8[0-9][13679] | hp8[0-9][13679])
727 basic_machine=hppa1.1-hp
728 ;;
729 hp9k8[0-9][0-9] | hp8[0-9][0-9])
730 basic_machine=hppa1.0-hp
731 ;;
732 hppa-next)
733 os=-nextstep3
734 ;;
735 hppaosf)
736 basic_machine=hppa1.1-hp
737 os=-osf
738 ;;
739 hppro)
740 basic_machine=hppa1.1-hp
741 os=-proelf
742 ;;
743 i370-ibm* | ibm*)
744 basic_machine=i370-ibm
745 ;;
746 i*86v32)
747 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
748 os=-sysv32
749 ;;
750 i*86v4*)
751 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
752 os=-sysv4
753 ;;
754 i*86v)
755 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
756 os=-sysv
757 ;;
758 i*86sol2)
759 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
760 os=-solaris2
761 ;;
762 i386mach)
763 basic_machine=i386-mach
764 os=-mach
765 ;;
766 i386-vsta | vsta)
767 basic_machine=i386-unknown
768 os=-vsta
769 ;;
770 iris | iris4d)
771 basic_machine=mips-sgi
772 case $os in
773 -irix*)
774 ;;
775 *)
776 os=-irix4
777 ;;
778 esac
779 ;;
780 isi68 | isi)
781 basic_machine=m68k-isi
782 os=-sysv
783 ;;
784 leon-*|leon[3-9]-*)
785 basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
786 ;;
787 m68knommu)
788 basic_machine=m68k-unknown
789 os=-linux
790 ;;
791 m68knommu-*)
792 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
793 os=-linux
794 ;;
795 m88k-omron*)
796 basic_machine=m88k-omron
797 ;;
798 magnum | m3230)
799 basic_machine=mips-mips
800 os=-sysv
801 ;;
802 merlin)
803 basic_machine=ns32k-utek
804 os=-sysv
805 ;;
806 microblaze*)
807 basic_machine=microblaze-xilinx
808 ;;
809 mingw64)
810 basic_machine=x86_64-pc
811 os=-mingw64
812 ;;
813 mingw32)
814 basic_machine=i686-pc
815 os=-mingw32
816 ;;
817 mingw32ce)
818 basic_machine=arm-unknown
819 os=-mingw32ce
820 ;;
821 miniframe)
822 basic_machine=m68000-convergent
823 ;;
824 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
825 basic_machine=m68k-atari
826 os=-mint
827 ;;
828 mipsEE* | ee | ps2)
829 basic_machine=mips64r5900el-scei
830 case $os in
831 -linux*)
832 ;;
833 *)
834 os=-elf
835 ;;
836 esac
837 ;;
838 iop)
839 basic_machine=mipsel-scei
840 os=-irx
841 ;;
842 dvp)
843 basic_machine=dvp-scei
844 os=-elf
845 ;;
846 mips3*-*)
847 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
848 ;;
849 mips3*)
850 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
851 ;;
852 monitor)
853 basic_machine=m68k-rom68k
854 os=-coff
855 ;;
856 morphos)
857 basic_machine=powerpc-unknown
858 os=-morphos
859 ;;
860 moxiebox)
861 basic_machine=moxie-unknown
862 os=-moxiebox
863 ;;
864 msdos)
865 basic_machine=i386-pc
866 os=-msdos
867 ;;
868 ms1-*)
869 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
870 ;;
871 msys)
872 basic_machine=i686-pc
873 os=-msys
874 ;;
875 mvs)
876 basic_machine=i370-ibm
877 os=-mvs
878 ;;
879 nacl)
880 basic_machine=le32-unknown
881 os=-nacl
882 ;;
883 ncr3000)
884 basic_machine=i486-ncr
885 os=-sysv4
886 ;;
887 netbsd386)
888 basic_machine=i386-unknown
889 os=-netbsd
890 ;;
891 netwinder)
892 basic_machine=armv4l-rebel
893 os=-linux
894 ;;
895 news | news700 | news800 | news900)
896 basic_machine=m68k-sony
897 os=-newsos
898 ;;
899 news1000)
900 basic_machine=m68030-sony
901 os=-newsos
902 ;;
903 news-3600 | risc-news)
904 basic_machine=mips-sony
905 os=-newsos
906 ;;
907 necv70)
908 basic_machine=v70-nec
909 os=-sysv
910 ;;
911 next | m*-next )
912 basic_machine=m68k-next
913 case $os in
914 -nextstep* )
915 ;;
916 -ns2*)
917 os=-nextstep2
918 ;;
919 *)
920 os=-nextstep3
921 ;;
922 esac
923 ;;
924 nh3000)
925 basic_machine=m68k-harris
926 os=-cxux
927 ;;
928 nh[45]000)
929 basic_machine=m88k-harris
930 os=-cxux
931 ;;
932 nindy960)
933 basic_machine=i960-intel
934 os=-nindy
935 ;;
936 mon960)
937 basic_machine=i960-intel
938 os=-mon960
939 ;;
940 nonstopux)
941 basic_machine=mips-compaq
942 os=-nonstopux
943 ;;
944 np1)
945 basic_machine=np1-gould
946 ;;
947 neo-tandem)
948 basic_machine=neo-tandem
949 ;;
950 nse-tandem)
951 basic_machine=nse-tandem
952 ;;
953 nsr-tandem)
954 basic_machine=nsr-tandem
955 ;;
956 op50n-* | op60c-*)
957 basic_machine=hppa1.1-oki
958 os=-proelf
959 ;;
960 openrisc | openrisc-*)
961 basic_machine=or32-unknown
962 ;;
963 os400)
964 basic_machine=powerpc-ibm
965 os=-os400
966 ;;
967 OSE68000 | ose68000)
968 basic_machine=m68000-ericsson
969 os=-ose
970 ;;
971 os68k)
972 basic_machine=m68k-none
973 os=-os68k
974 ;;
975 pa-hitachi)
976 basic_machine=hppa1.1-hitachi
977 os=-hiuxwe2
978 ;;
979 paragon)
980 basic_machine=i860-intel
981 os=-osf
982 ;;
983 parisc)
984 basic_machine=hppa-unknown
985 os=-linux
986 ;;
987 parisc-*)
988 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
989 os=-linux
990 ;;
991 pbd)
992 basic_machine=sparc-tti
993 ;;
994 pbb)
995 basic_machine=m68k-tti
996 ;;
997 pc532 | pc532-*)
998 basic_machine=ns32k-pc532
999 ;;
1000 pc98)
1001 basic_machine=i386-pc
1002 ;;
1003 pc98-*)
1004 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
1005 ;;
1006 pentium | p5 | k5 | k6 | nexgen | viac3)
1007 basic_machine=i586-pc
1008 ;;
1009 pentiumpro | p6 | 6x86 | athlon | athlon_*)
1010 basic_machine=i686-pc
1011 ;;
1012 pentiumii | pentium2 | pentiumiii | pentium3)
1013 basic_machine=i686-pc
1014 ;;
1015 pentium4)
1016 basic_machine=i786-pc
1017 ;;
1018 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1019 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
1020 ;;
1021 pentiumpro-* | p6-* | 6x86-* | athlon-*)
1022 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1023 ;;
1024 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1025 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1026 ;;
1027 pentium4-*)
1028 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
1029 ;;
1030 pn)
1031 basic_machine=pn-gould
1032 ;;
1033 power) basic_machine=power-ibm
1034 ;;
1035 ppc | ppcbe) basic_machine=powerpc-unknown
1036 ;;
1037 ppc-* | ppcbe-*)
1038 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1039 ;;
1040 ppcle | powerpclittle | ppc-le | powerpc-little)
1041 basic_machine=powerpcle-unknown
1042 ;;
1043 ppcle-* | powerpclittle-*)
1044 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
1045 ;;
1046 ppc64) basic_machine=powerpc64-unknown
1047 ;;
1048 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
1049 ;;
1050 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1051 basic_machine=powerpc64le-unknown
1052 ;;
1053 ppc64le-* | powerpc64little-*)
1054 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1055 ;;
1056 ps2)
1057 basic_machine=i386-ibm
1058 ;;
1059 pw32)
1060 basic_machine=i586-unknown
1061 os=-pw32
1062 ;;
1063 rdos | rdos64)
1064 basic_machine=x86_64-pc
1065 os=-rdos
1066 ;;
1067 rdos32)
1068 basic_machine=i386-pc
1069 os=-rdos
1070 ;;
1071 rom68k)
1072 basic_machine=m68k-rom68k
1073 os=-coff
1074 ;;
1075 rm[46]00)
1076 basic_machine=mips-siemens
1077 ;;
1078 rtpc | rtpc-*)
1079 basic_machine=romp-ibm
1080 ;;
1081 s390 | s390-*)
1082 basic_machine=s390-ibm
1083 ;;
1084 s390x | s390x-*)
1085 basic_machine=s390x-ibm
1086 ;;
1087 sa29200)
1088 basic_machine=a29k-amd
1089 os=-udi
1090 ;;
1091 sb1)
1092 basic_machine=mipsisa64sb1-unknown
1093 ;;
1094 sb1el)
1095 basic_machine=mipsisa64sb1el-unknown
1096 ;;
1097 sde)
1098 basic_machine=mipsisa32-sde
1099 os=-elf
1100 ;;
1101 sei)
1102 basic_machine=mips-sei
1103 os=-seiux
1104 ;;
1105 sequent)
1106 basic_machine=i386-sequent
1107 ;;
1108 sh)
1109 basic_machine=sh-hitachi
1110 os=-hms
1111 ;;
1112 sh5el)
1113 basic_machine=sh5le-unknown
1114 ;;
1115 sh64)
1116 basic_machine=sh64-unknown
1117 ;;
1118 sparclite-wrs | simso-wrs)
1119 basic_machine=sparclite-wrs
1120 os=-vxworks
1121 ;;
1122 sps7)
1123 basic_machine=m68k-bull
1124 os=-sysv2
1125 ;;
1126 spur)
1127 basic_machine=spur-unknown
1128 ;;
1129 st2000)
1130 basic_machine=m68k-tandem
1131 ;;
1132 stratus)
1133 basic_machine=i860-stratus
1134 os=-sysv4
1135 ;;
1136 strongarm-* | thumb-*)
1137 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1138 ;;
1139 sun2)
1140 basic_machine=m68000-sun
1141 ;;
1142 sun2os3)
1143 basic_machine=m68000-sun
1144 os=-sunos3
1145 ;;
1146 sun2os4)
1147 basic_machine=m68000-sun
1148 os=-sunos4
1149 ;;
1150 sun3os3)
1151 basic_machine=m68k-sun
1152 os=-sunos3
1153 ;;
1154 sun3os4)
1155 basic_machine=m68k-sun
1156 os=-sunos4
1157 ;;
1158 sun4os3)
1159 basic_machine=sparc-sun
1160 os=-sunos3
1161 ;;
1162 sun4os4)
1163 basic_machine=sparc-sun
1164 os=-sunos4
1165 ;;
1166 sun4sol2)
1167 basic_machine=sparc-sun
1168 os=-solaris2
1169 ;;
1170 sun3 | sun3-*)
1171 basic_machine=m68k-sun
1172 ;;
1173 sun4)
1174 basic_machine=sparc-sun
1175 ;;
1176 sun386 | sun386i | roadrunner)
1177 basic_machine=i386-sun
1178 ;;
1179 sv1)
1180 basic_machine=sv1-cray
1181 os=-unicos
1182 ;;
1183 symmetry)
1184 basic_machine=i386-sequent
1185 os=-dynix
1186 ;;
1187 t3e)
1188 basic_machine=alphaev5-cray
1189 os=-unicos
1190 ;;
1191 t90)
1192 basic_machine=t90-cray
1193 os=-unicos
1194 ;;
1195 tile*)
1196 basic_machine=$basic_machine-unknown
1197 os=-linux-gnu
1198 ;;
1199 tx39)
1200 basic_machine=mipstx39-unknown
1201 ;;
1202 tx39el)
1203 basic_machine=mipstx39el-unknown
1204 ;;
1205 toad1)
1206 basic_machine=pdp10-xkl
1207 os=-tops20
1208 ;;
1209 tower | tower-32)
1210 basic_machine=m68k-ncr
1211 ;;
1212 tpf)
1213 basic_machine=s390x-ibm
1214 os=-tpf
1215 ;;
1216 udi29k)
1217 basic_machine=a29k-amd
1218 os=-udi
1219 ;;
1220 ultra3)
1221 basic_machine=a29k-nyu
1222 os=-sym1
1223 ;;
1224 v810 | necv810)
1225 basic_machine=v810-nec
1226 os=-none
1227 ;;
1228 vaxv)
1229 basic_machine=vax-dec
1230 os=-sysv
1231 ;;
1232 vms)
1233 basic_machine=vax-dec
1234 os=-vms
1235 ;;
1236 vpp*|vx|vx-*)
1237 basic_machine=f301-fujitsu
1238 ;;
1239 vxworks960)
1240 basic_machine=i960-wrs
1241 os=-vxworks
1242 ;;
1243 vxworks68)
1244 basic_machine=m68k-wrs
1245 os=-vxworks
1246 ;;
1247 vxworks29k)
1248 basic_machine=a29k-wrs
1249 os=-vxworks
1250 ;;
1251 w65*)
1252 basic_machine=w65-wdc
1253 os=-none
1254 ;;
1255 w89k-*)
1256 basic_machine=hppa1.1-winbond
1257 os=-proelf
1258 ;;
1259 xbox)
1260 basic_machine=i686-pc
1261 os=-mingw32
1262 ;;
1263 xps | xps100)
1264 basic_machine=xps100-honeywell
1265 ;;
1266 xscale-* | xscalee[bl]-*)
1267 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1268 ;;
1269 ymp)
1270 basic_machine=ymp-cray
1271 os=-unicos
1272 ;;
1273 z8k-*-coff)
1274 basic_machine=z8k-unknown
1275 os=-sim
1276 ;;
1277 z80-*-coff)
1278 basic_machine=z80-unknown
1279 os=-sim
1280 ;;
1281 none)
1282 basic_machine=none-none
1283 os=-none
1284 ;;
1285
1286 # Here we handle the default manufacturer of certain CPU types. It is in
1287 # some cases the only manufacturer, in others, it is the most popular.
1288 w89k)
1289 basic_machine=hppa1.1-winbond
1290 ;;
1291 op50n)
1292 basic_machine=hppa1.1-oki
1293 ;;
1294 op60c)
1295 basic_machine=hppa1.1-oki
1296 ;;
1297 romp)
1298 basic_machine=romp-ibm
1299 ;;
1300 mmix)
1301 basic_machine=mmix-knuth
1302 ;;
1303 rs6000)
1304 basic_machine=rs6000-ibm
1305 ;;
1306 vax)
1307 basic_machine=vax-dec
1308 ;;
1309 pdp10)
1310 # there are many clones, so DEC is not a safe bet
1311 basic_machine=pdp10-unknown
1312 ;;
1313 pdp11)
1314 basic_machine=pdp11-dec
1315 ;;
1316 we32k)
1317 basic_machine=we32k-att
1318 ;;
1319 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1320 basic_machine=sh-unknown
1321 ;;
1322 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1323 basic_machine=sparc-sun
1324 ;;
1325 cydra)
1326 basic_machine=cydra-cydrome
1327 ;;
1328 orion)
1329 basic_machine=orion-highlevel
1330 ;;
1331 orion105)
1332 basic_machine=clipper-highlevel
1333 ;;
1334 mac | mpw | mac-mpw)
1335 basic_machine=m68k-apple
1336 ;;
1337 pmac | pmac-mpw)
1338 basic_machine=powerpc-apple
1339 ;;
1340 *-unknown)
1341 # Make sure to match an already-canonicalized machine name.
1342 ;;
1343 *)
1344 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1345 exit 1
1346 ;;
1347 esac
1348
1349 # Here we canonicalize certain aliases for manufacturers.
1350 case $basic_machine in
1351 *-digital*)
1352 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1353 ;;
1354 *-commodore*)
1355 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1356 ;;
1357 *)
1358 ;;
1359 esac
1360
1361 # Decode manufacturer-specific aliases for certain operating systems.
1362
1363 if [ x"$os" != x"" ]
1364 then
1365 case $os in
1366 # First match some system type aliases
1367 # that might get confused with valid system types.
1368 # -solaris* is a basic system type, with this one exception.
1369 -auroraux)
1370 os=-auroraux
1371 ;;
1372 -solaris1 | -solaris1.*)
1373 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1374 ;;
1375 -solaris)
1376 os=-solaris2
1377 ;;
1378 -svr4*)
1379 os=-sysv4
1380 ;;
1381 -unixware*)
1382 os=-sysv4.2uw
1383 ;;
1384 -gnu/linux*)
1385 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1386 ;;
1387 # First accept the basic system types.
1388 # The portable systems comes first.
1389 # Each alternative MUST END IN A *, to match a version number.
1390 # -sysv* is not here because it comes later, after sysvr4.
1391 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1392 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1393 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1394 | -sym* | -kopensolaris* | -plan9* \
1395 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1396 | -aos* | -aros* | -cloudabi* \
1397 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1398 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1399 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1400 | -bitrig* | -openbsd* | -solidbsd* \
1401 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1402 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1403 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1404 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1405 | -chorusos* | -chorusrdb* | -cegcc* \
1406 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1407 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1408 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1409 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
1410 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1411 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1412 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \
1413 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1414 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1415 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1416 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
1417 # Remember, each alternative MUST END IN *, to match a version number.
1418 ;;
1419 -qnx*)
1420 case $basic_machine in
1421 x86-* | i*86-*)
1422 ;;
1423 *)
1424 os=-nto$os
1425 ;;
1426 esac
1427 ;;
1428 -nto-qnx*)
1429 ;;
1430 -nto*)
1431 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1432 ;;
1433 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1434 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1435 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1436 ;;
1437 -mac*)
1438 os=`echo $os | sed -e 's|mac|macos|'`
1439 ;;
1440 -linux-dietlibc)
1441 os=-linux-dietlibc
1442 ;;
1443 -linux*)
1444 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1445 ;;
1446 -sunos5*)
1447 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1448 ;;
1449 -sunos6*)
1450 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1451 ;;
1452 -opened*)
1453 os=-openedition
1454 ;;
1455 -os400*)
1456 os=-os400
1457 ;;
1458 -wince*)
1459 os=-wince
1460 ;;
1461 -osfrose*)
1462 os=-osfrose
1463 ;;
1464 -osf*)
1465 os=-osf
1466 ;;
1467 -utek*)
1468 os=-bsd
1469 ;;
1470 -dynix*)
1471 os=-bsd
1472 ;;
1473 -acis*)
1474 os=-aos
1475 ;;
1476 -atheos*)
1477 os=-atheos
1478 ;;
1479 -syllable*)
1480 os=-syllable
1481 ;;
1482 -386bsd)
1483 os=-bsd
1484 ;;
1485 -ctix* | -uts*)
1486 os=-sysv
1487 ;;
1488 -nova*)
1489 os=-rtmk-nova
1490 ;;
1491 -ns2 )
1492 os=-nextstep2
1493 ;;
1494 -nsk*)
1495 os=-nsk
1496 ;;
1497 # Preserve the version number of sinix5.
1498 -sinix5.*)
1499 os=`echo $os | sed -e 's|sinix|sysv|'`
1500 ;;
1501 -sinix*)
1502 os=-sysv4
1503 ;;
1504 -tpf*)
1505 os=-tpf
1506 ;;
1507 -triton*)
1508 os=-sysv3
1509 ;;
1510 -oss*)
1511 os=-sysv3
1512 ;;
1513 -svr4)
1514 os=-sysv4
1515 ;;
1516 -svr3)
1517 os=-sysv3
1518 ;;
1519 -sysvr4)
1520 os=-sysv4
1521 ;;
1522 # This must come after -sysvr4.
1523 -sysv*)
1524 ;;
1525 -ose*)
1526 os=-ose
1527 ;;
1528 -es1800*)
1529 os=-ose
1530 ;;
1531 -xenix)
1532 os=-xenix
1533 ;;
1534 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1535 os=-mint
1536 ;;
1537 -aros*)
1538 os=-aros
1539 ;;
1540 -zvmoe)
1541 os=-zvmoe
1542 ;;
1543 -dicos*)
1544 os=-dicos
1545 ;;
1546 -nacl*)
1547 ;;
1548 -none)
1549 ;;
1550 *)
1551 # Get rid of the `-' at the beginning of $os.
1552 os=`echo $os | sed 's/[^-]*-//'`
1553 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1554 exit 1
1555 ;;
1556 esac
1557 else
1558
1559 # Here we handle the default operating systems that come with various machines.
1560 # The value should be what the vendor currently ships out the door with their
1561 # machine or put another way, the most popular os provided with the machine.
1562
1563 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1564 # "-sun"), then you have to tell the case statement up towards the top
1565 # that MANUFACTURER isn't an operating system. Otherwise, code above
1566 # will signal an error saying that MANUFACTURER isn't an operating
1567 # system, and we'll never get to this point.
1568
1569 case $basic_machine in
1570 score-*)
1571 os=-elf
1572 ;;
1573 spu-*)
1574 os=-elf
1575 ;;
1576 *-acorn)
1577 os=-riscix1.2
1578 ;;
1579 arm*-rebel)
1580 os=-linux
1581 ;;
1582 arm*-semi)
1583 os=-aout
1584 ;;
1585 c4x-* | tic4x-*)
1586 os=-coff
1587 ;;
1588 c8051-*)
1589 os=-elf
1590 ;;
1591 hexagon-*)
1592 os=-elf
1593 ;;
1594 tic54x-*)
1595 os=-coff
1596 ;;
1597 tic55x-*)
1598 os=-coff
1599 ;;
1600 tic6x-*)
1601 os=-coff
1602 ;;
1603 # This must come before the *-dec entry.
1604 pdp10-*)
1605 os=-tops20
1606 ;;
1607 pdp11-*)
1608 os=-none
1609 ;;
1610 *-dec | vax-*)
1611 os=-ultrix4.2
1612 ;;
1613 m68*-apollo)
1614 os=-domain
1615 ;;
1616 i386-sun)
1617 os=-sunos4.0.2
1618 ;;
1619 m68000-sun)
1620 os=-sunos3
1621 ;;
1622 m68*-cisco)
1623 os=-aout
1624 ;;
1625 mep-*)
1626 os=-elf
1627 ;;
1628 mips*-cisco)
1629 os=-elf
1630 ;;
1631 mips*-*)
1632 os=-elf
1633 ;;
1634 or32-*)
1635 os=-coff
1636 ;;
1637 *-tti) # must be before sparc entry or we get the wrong os.
1638 os=-sysv3
1639 ;;
1640 sparc-* | *-sun)
1641 os=-sunos4.1.1
1642 ;;
1643 *-be)
1644 os=-beos
1645 ;;
1646 *-haiku)
1647 os=-haiku
1648 ;;
1649 *-ibm)
1650 os=-aix
1651 ;;
1652 *-knuth)
1653 os=-mmixware
1654 ;;
1655 *-wec)
1656 os=-proelf
1657 ;;
1658 *-winbond)
1659 os=-proelf
1660 ;;
1661 *-oki)
1662 os=-proelf
1663 ;;
1664 *-hp)
1665 os=-hpux
1666 ;;
1667 *-hitachi)
1668 os=-hiux
1669 ;;
1670 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1671 os=-sysv
1672 ;;
1673 *-cbm)
1674 os=-amigaos
1675 ;;
1676 *-dg)
1677 os=-dgux
1678 ;;
1679 *-dolphin)
1680 os=-sysv3
1681 ;;
1682 m68k-ccur)
1683 os=-rtu
1684 ;;
1685 m88k-omron*)
1686 os=-luna
1687 ;;
1688 *-next )
1689 os=-nextstep
1690 ;;
1691 *-sequent)
1692 os=-ptx
1693 ;;
1694 *-crds)
1695 os=-unos
1696 ;;
1697 *-ns)
1698 os=-genix
1699 ;;
1700 i370-*)
1701 os=-mvs
1702 ;;
1703 *-next)
1704 os=-nextstep3
1705 ;;
1706 *-gould)
1707 os=-sysv
1708 ;;
1709 *-highlevel)
1710 os=-bsd
1711 ;;
1712 *-encore)
1713 os=-bsd
1714 ;;
1715 *-sgi)
1716 os=-irix
1717 ;;
1718 *-siemens)
1719 os=-sysv4
1720 ;;
1721 *-masscomp)
1722 os=-rtu
1723 ;;
1724 f30[01]-fujitsu | f700-fujitsu)
1725 os=-uxpv
1726 ;;
1727 *-rom68k)
1728 os=-coff
1729 ;;
1730 *-*bug)
1731 os=-coff
1732 ;;
1733 *-apple)
1734 os=-macos
1735 ;;
1736 *-atari*)
1737 os=-mint
1738 ;;
1739 *)
1740 os=-none
1741 ;;
1742 esac
1743 fi
1744
1745 # Here we handle the case where we know the os, and the CPU type, but not the
1746 # manufacturer. We pick the logical manufacturer.
1747 vendor=unknown
1748 case $basic_machine in
1749 *-unknown)
1750 case $os in
1751 -riscix*)
1752 vendor=acorn
1753 ;;
1754 -sunos*)
1755 vendor=sun
1756 ;;
1757 -cnk*|-aix*)
1758 vendor=ibm
1759 ;;
1760 -beos*)
1761 vendor=be
1762 ;;
1763 -hpux*)
1764 vendor=hp
1765 ;;
1766 -mpeix*)
1767 vendor=hp
1768 ;;
1769 -hiux*)
1770 vendor=hitachi
1771 ;;
1772 -unos*)
1773 vendor=crds
1774 ;;
1775 -dgux*)
1776 vendor=dg
1777 ;;
1778 -luna*)
1779 vendor=omron
1780 ;;
1781 -genix*)
1782 vendor=ns
1783 ;;
1784 -mvs* | -opened*)
1785 vendor=ibm
1786 ;;
1787 -os400*)
1788 vendor=ibm
1789 ;;
1790 -ptx*)
1791 vendor=sequent
1792 ;;
1793 -tpf*)
1794 vendor=ibm
1795 ;;
1796 -vxsim* | -vxworks* | -windiss*)
1797 vendor=wrs
1798 ;;
1799 -aux*)
1800 vendor=apple
1801 ;;
1802 -hms*)
1803 vendor=hitachi
1804 ;;
1805 -mpw* | -macos*)
1806 vendor=apple
1807 ;;
1808 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1809 vendor=atari
1810 ;;
1811 -vos*)
1812 vendor=stratus
1813 ;;
1814 esac
1815 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1816 ;;
1817 esac
1818
1819 echo $basic_machine$os
1820 exit
1821
1822 # Local variables:
1823 # eval: (add-hook 'write-file-hooks 'time-stamp)
1824 # time-stamp-start: "timestamp='"
1825 # time-stamp-format: "%:y-%02m-%02d"
1826 # time-stamp-end: "'"
1827 # End:
0 #! /bin/sh
1 # depcomp - compile a program generating dependencies as side-effects
2
3 scriptversion=2013-05-30.07; # UTC
4
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
24
25 # Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
26
27 case $1 in
28 '')
29 echo "$0: No command. Try '$0 --help' for more information." 1>&2
30 exit 1;
31 ;;
32 -h | --h*)
33 cat <<\EOF
34 Usage: depcomp [--help] [--version] PROGRAM [ARGS]
35
36 Run PROGRAMS ARGS to compile a file, generating dependencies
37 as side-effects.
38
39 Environment variables:
40 depmode Dependency tracking mode.
41 source Source file read by 'PROGRAMS ARGS'.
42 object Object file output by 'PROGRAMS ARGS'.
43 DEPDIR directory where to store dependencies.
44 depfile Dependency file to output.
45 tmpdepfile Temporary file to use when outputting dependencies.
46 libtool Whether libtool is used (yes/no).
47
48 Report bugs to <bug-automake@gnu.org>.
49 EOF
50 exit $?
51 ;;
52 -v | --v*)
53 echo "depcomp $scriptversion"
54 exit $?
55 ;;
56 esac
57
58 # Get the directory component of the given path, and save it in the
59 # global variables '$dir'. Note that this directory component will
60 # be either empty or ending with a '/' character. This is deliberate.
61 set_dir_from ()
62 {
63 case $1 in
64 */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
65 *) dir=;;
66 esac
67 }
68
69 # Get the suffix-stripped basename of the given path, and save it the
70 # global variable '$base'.
71 set_base_from ()
72 {
73 base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
74 }
75
76 # If no dependency file was actually created by the compiler invocation,
77 # we still have to create a dummy depfile, to avoid errors with the
78 # Makefile "include basename.Plo" scheme.
79 make_dummy_depfile ()
80 {
81 echo "#dummy" > "$depfile"
82 }
83
84 # Factor out some common post-processing of the generated depfile.
85 # Requires the auxiliary global variable '$tmpdepfile' to be set.
86 aix_post_process_depfile ()
87 {
88 # If the compiler actually managed to produce a dependency file,
89 # post-process it.
90 if test -f "$tmpdepfile"; then
91 # Each line is of the form 'foo.o: dependency.h'.
92 # Do two passes, one to just change these to
93 # $object: dependency.h
94 # and one to simply output
95 # dependency.h:
96 # which is needed to avoid the deleted-header problem.
97 { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
98 sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
99 } > "$depfile"
100 rm -f "$tmpdepfile"
101 else
102 make_dummy_depfile
103 fi
104 }
105
106 # A tabulation character.
107 tab=' '
108 # A newline character.
109 nl='
110 '
111 # Character ranges might be problematic outside the C locale.
112 # These definitions help.
113 upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
114 lower=abcdefghijklmnopqrstuvwxyz
115 digits=0123456789
116 alpha=${upper}${lower}
117
118 if test -z "$depmode" || test -z "$source" || test -z "$object"; then
119 echo "depcomp: Variables source, object and depmode must be set" 1>&2
120 exit 1
121 fi
122
123 # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
124 depfile=${depfile-`echo "$object" |
125 sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
126 tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
127
128 rm -f "$tmpdepfile"
129
130 # Avoid interferences from the environment.
131 gccflag= dashmflag=
132
133 # Some modes work just like other modes, but use different flags. We
134 # parameterize here, but still list the modes in the big case below,
135 # to make depend.m4 easier to write. Note that we *cannot* use a case
136 # here, because this file can only contain one case statement.
137 if test "$depmode" = hp; then
138 # HP compiler uses -M and no extra arg.
139 gccflag=-M
140 depmode=gcc
141 fi
142
143 if test "$depmode" = dashXmstdout; then
144 # This is just like dashmstdout with a different argument.
145 dashmflag=-xM
146 depmode=dashmstdout
147 fi
148
149 cygpath_u="cygpath -u -f -"
150 if test "$depmode" = msvcmsys; then
151 # This is just like msvisualcpp but w/o cygpath translation.
152 # Just convert the backslash-escaped backslashes to single forward
153 # slashes to satisfy depend.m4
154 cygpath_u='sed s,\\\\,/,g'
155 depmode=msvisualcpp
156 fi
157
158 if test "$depmode" = msvc7msys; then
159 # This is just like msvc7 but w/o cygpath translation.
160 # Just convert the backslash-escaped backslashes to single forward
161 # slashes to satisfy depend.m4
162 cygpath_u='sed s,\\\\,/,g'
163 depmode=msvc7
164 fi
165
166 if test "$depmode" = xlc; then
167 # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
168 gccflag=-qmakedep=gcc,-MF
169 depmode=gcc
170 fi
171
172 case "$depmode" in
173 gcc3)
174 ## gcc 3 implements dependency tracking that does exactly what
175 ## we want. Yay! Note: for some reason libtool 1.4 doesn't like
176 ## it if -MD -MP comes after the -MF stuff. Hmm.
177 ## Unfortunately, FreeBSD c89 acceptance of flags depends upon
178 ## the command line argument order; so add the flags where they
179 ## appear in depend2.am. Note that the slowdown incurred here
180 ## affects only configure: in makefiles, %FASTDEP% shortcuts this.
181 for arg
182 do
183 case $arg in
184 -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
185 *) set fnord "$@" "$arg" ;;
186 esac
187 shift # fnord
188 shift # $arg
189 done
190 "$@"
191 stat=$?
192 if test $stat -ne 0; then
193 rm -f "$tmpdepfile"
194 exit $stat
195 fi
196 mv "$tmpdepfile" "$depfile"
197 ;;
198
199 gcc)
200 ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
201 ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
202 ## (see the conditional assignment to $gccflag above).
203 ## There are various ways to get dependency output from gcc. Here's
204 ## why we pick this rather obscure method:
205 ## - Don't want to use -MD because we'd like the dependencies to end
206 ## up in a subdir. Having to rename by hand is ugly.
207 ## (We might end up doing this anyway to support other compilers.)
208 ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
209 ## -MM, not -M (despite what the docs say). Also, it might not be
210 ## supported by the other compilers which use the 'gcc' depmode.
211 ## - Using -M directly means running the compiler twice (even worse
212 ## than renaming).
213 if test -z "$gccflag"; then
214 gccflag=-MD,
215 fi
216 "$@" -Wp,"$gccflag$tmpdepfile"
217 stat=$?
218 if test $stat -ne 0; then
219 rm -f "$tmpdepfile"
220 exit $stat
221 fi
222 rm -f "$depfile"
223 echo "$object : \\" > "$depfile"
224 # The second -e expression handles DOS-style file names with drive
225 # letters.
226 sed -e 's/^[^:]*: / /' \
227 -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
228 ## This next piece of magic avoids the "deleted header file" problem.
229 ## The problem is that when a header file which appears in a .P file
230 ## is deleted, the dependency causes make to die (because there is
231 ## typically no way to rebuild the header). We avoid this by adding
232 ## dummy dependencies for each header file. Too bad gcc doesn't do
233 ## this for us directly.
234 ## Some versions of gcc put a space before the ':'. On the theory
235 ## that the space means something, we add a space to the output as
236 ## well. hp depmode also adds that space, but also prefixes the VPATH
237 ## to the object. Take care to not repeat it in the output.
238 ## Some versions of the HPUX 10.20 sed can't process this invocation
239 ## correctly. Breaking it into two sed invocations is a workaround.
240 tr ' ' "$nl" < "$tmpdepfile" \
241 | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
242 | sed -e 's/$/ :/' >> "$depfile"
243 rm -f "$tmpdepfile"
244 ;;
245
246 hp)
247 # This case exists only to let depend.m4 do its work. It works by
248 # looking at the text of this script. This case will never be run,
249 # since it is checked for above.
250 exit 1
251 ;;
252
253 sgi)
254 if test "$libtool" = yes; then
255 "$@" "-Wp,-MDupdate,$tmpdepfile"
256 else
257 "$@" -MDupdate "$tmpdepfile"
258 fi
259 stat=$?
260 if test $stat -ne 0; then
261 rm -f "$tmpdepfile"
262 exit $stat
263 fi
264 rm -f "$depfile"
265
266 if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
267 echo "$object : \\" > "$depfile"
268 # Clip off the initial element (the dependent). Don't try to be
269 # clever and replace this with sed code, as IRIX sed won't handle
270 # lines with more than a fixed number of characters (4096 in
271 # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
272 # the IRIX cc adds comments like '#:fec' to the end of the
273 # dependency line.
274 tr ' ' "$nl" < "$tmpdepfile" \
275 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
276 | tr "$nl" ' ' >> "$depfile"
277 echo >> "$depfile"
278 # The second pass generates a dummy entry for each header file.
279 tr ' ' "$nl" < "$tmpdepfile" \
280 | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
281 >> "$depfile"
282 else
283 make_dummy_depfile
284 fi
285 rm -f "$tmpdepfile"
286 ;;
287
288 xlc)
289 # This case exists only to let depend.m4 do its work. It works by
290 # looking at the text of this script. This case will never be run,
291 # since it is checked for above.
292 exit 1
293 ;;
294
295 aix)
296 # The C for AIX Compiler uses -M and outputs the dependencies
297 # in a .u file. In older versions, this file always lives in the
298 # current directory. Also, the AIX compiler puts '$object:' at the
299 # start of each line; $object doesn't have directory information.
300 # Version 6 uses the directory in both cases.
301 set_dir_from "$object"
302 set_base_from "$object"
303 if test "$libtool" = yes; then
304 tmpdepfile1=$dir$base.u
305 tmpdepfile2=$base.u
306 tmpdepfile3=$dir.libs/$base.u
307 "$@" -Wc,-M
308 else
309 tmpdepfile1=$dir$base.u
310 tmpdepfile2=$dir$base.u
311 tmpdepfile3=$dir$base.u
312 "$@" -M
313 fi
314 stat=$?
315 if test $stat -ne 0; then
316 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
317 exit $stat
318 fi
319
320 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
321 do
322 test -f "$tmpdepfile" && break
323 done
324 aix_post_process_depfile
325 ;;
326
327 tcc)
328 # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
329 # FIXME: That version still under development at the moment of writing.
330 # Make that this statement remains true also for stable, released
331 # versions.
332 # It will wrap lines (doesn't matter whether long or short) with a
333 # trailing '\', as in:
334 #
335 # foo.o : \
336 # foo.c \
337 # foo.h \
338 #
339 # It will put a trailing '\' even on the last line, and will use leading
340 # spaces rather than leading tabs (at least since its commit 0394caf7
341 # "Emit spaces for -MD").
342 "$@" -MD -MF "$tmpdepfile"
343 stat=$?
344 if test $stat -ne 0; then
345 rm -f "$tmpdepfile"
346 exit $stat
347 fi
348 rm -f "$depfile"
349 # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
350 # We have to change lines of the first kind to '$object: \'.
351 sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
352 # And for each line of the second kind, we have to emit a 'dep.h:'
353 # dummy dependency, to avoid the deleted-header problem.
354 sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
355 rm -f "$tmpdepfile"
356 ;;
357
358 ## The order of this option in the case statement is important, since the
359 ## shell code in configure will try each of these formats in the order
360 ## listed in this file. A plain '-MD' option would be understood by many
361 ## compilers, so we must ensure this comes after the gcc and icc options.
362 pgcc)
363 # Portland's C compiler understands '-MD'.
364 # Will always output deps to 'file.d' where file is the root name of the
365 # source file under compilation, even if file resides in a subdirectory.
366 # The object file name does not affect the name of the '.d' file.
367 # pgcc 10.2 will output
368 # foo.o: sub/foo.c sub/foo.h
369 # and will wrap long lines using '\' :
370 # foo.o: sub/foo.c ... \
371 # sub/foo.h ... \
372 # ...
373 set_dir_from "$object"
374 # Use the source, not the object, to determine the base name, since
375 # that's sadly what pgcc will do too.
376 set_base_from "$source"
377 tmpdepfile=$base.d
378
379 # For projects that build the same source file twice into different object
380 # files, the pgcc approach of using the *source* file root name can cause
381 # problems in parallel builds. Use a locking strategy to avoid stomping on
382 # the same $tmpdepfile.
383 lockdir=$base.d-lock
384 trap "
385 echo '$0: caught signal, cleaning up...' >&2
386 rmdir '$lockdir'
387 exit 1
388 " 1 2 13 15
389 numtries=100
390 i=$numtries
391 while test $i -gt 0; do
392 # mkdir is a portable test-and-set.
393 if mkdir "$lockdir" 2>/dev/null; then
394 # This process acquired the lock.
395 "$@" -MD
396 stat=$?
397 # Release the lock.
398 rmdir "$lockdir"
399 break
400 else
401 # If the lock is being held by a different process, wait
402 # until the winning process is done or we timeout.
403 while test -d "$lockdir" && test $i -gt 0; do
404 sleep 1
405 i=`expr $i - 1`
406 done
407 fi
408 i=`expr $i - 1`
409 done
410 trap - 1 2 13 15
411 if test $i -le 0; then
412 echo "$0: failed to acquire lock after $numtries attempts" >&2
413 echo "$0: check lockdir '$lockdir'" >&2
414 exit 1
415 fi
416
417 if test $stat -ne 0; then
418 rm -f "$tmpdepfile"
419 exit $stat
420 fi
421 rm -f "$depfile"
422 # Each line is of the form `foo.o: dependent.h',
423 # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
424 # Do two passes, one to just change these to
425 # `$object: dependent.h' and one to simply `dependent.h:'.
426 sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
427 # Some versions of the HPUX 10.20 sed can't process this invocation
428 # correctly. Breaking it into two sed invocations is a workaround.
429 sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
430 | sed -e 's/$/ :/' >> "$depfile"
431 rm -f "$tmpdepfile"
432 ;;
433
434 hp2)
435 # The "hp" stanza above does not work with aCC (C++) and HP's ia64
436 # compilers, which have integrated preprocessors. The correct option
437 # to use with these is +Maked; it writes dependencies to a file named
438 # 'foo.d', which lands next to the object file, wherever that
439 # happens to be.
440 # Much of this is similar to the tru64 case; see comments there.
441 set_dir_from "$object"
442 set_base_from "$object"
443 if test "$libtool" = yes; then
444 tmpdepfile1=$dir$base.d
445 tmpdepfile2=$dir.libs/$base.d
446 "$@" -Wc,+Maked
447 else
448 tmpdepfile1=$dir$base.d
449 tmpdepfile2=$dir$base.d
450 "$@" +Maked
451 fi
452 stat=$?
453 if test $stat -ne 0; then
454 rm -f "$tmpdepfile1" "$tmpdepfile2"
455 exit $stat
456 fi
457
458 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
459 do
460 test -f "$tmpdepfile" && break
461 done
462 if test -f "$tmpdepfile"; then
463 sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
464 # Add 'dependent.h:' lines.
465 sed -ne '2,${
466 s/^ *//
467 s/ \\*$//
468 s/$/:/
469 p
470 }' "$tmpdepfile" >> "$depfile"
471 else
472 make_dummy_depfile
473 fi
474 rm -f "$tmpdepfile" "$tmpdepfile2"
475 ;;
476
477 tru64)
478 # The Tru64 compiler uses -MD to generate dependencies as a side
479 # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
480 # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
481 # dependencies in 'foo.d' instead, so we check for that too.
482 # Subdirectories are respected.
483 set_dir_from "$object"
484 set_base_from "$object"
485
486 if test "$libtool" = yes; then
487 # Libtool generates 2 separate objects for the 2 libraries. These
488 # two compilations output dependencies in $dir.libs/$base.o.d and
489 # in $dir$base.o.d. We have to check for both files, because
490 # one of the two compilations can be disabled. We should prefer
491 # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
492 # automatically cleaned when .libs/ is deleted, while ignoring
493 # the former would cause a distcleancheck panic.
494 tmpdepfile1=$dir$base.o.d # libtool 1.5
495 tmpdepfile2=$dir.libs/$base.o.d # Likewise.
496 tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
497 "$@" -Wc,-MD
498 else
499 tmpdepfile1=$dir$base.d
500 tmpdepfile2=$dir$base.d
501 tmpdepfile3=$dir$base.d
502 "$@" -MD
503 fi
504
505 stat=$?
506 if test $stat -ne 0; then
507 rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
508 exit $stat
509 fi
510
511 for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
512 do
513 test -f "$tmpdepfile" && break
514 done
515 # Same post-processing that is required for AIX mode.
516 aix_post_process_depfile
517 ;;
518
519 msvc7)
520 if test "$libtool" = yes; then
521 showIncludes=-Wc,-showIncludes
522 else
523 showIncludes=-showIncludes
524 fi
525 "$@" $showIncludes > "$tmpdepfile"
526 stat=$?
527 grep -v '^Note: including file: ' "$tmpdepfile"
528 if test $stat -ne 0; then
529 rm -f "$tmpdepfile"
530 exit $stat
531 fi
532 rm -f "$depfile"
533 echo "$object : \\" > "$depfile"
534 # The first sed program below extracts the file names and escapes
535 # backslashes for cygpath. The second sed program outputs the file
536 # name when reading, but also accumulates all include files in the
537 # hold buffer in order to output them again at the end. This only
538 # works with sed implementations that can handle large buffers.
539 sed < "$tmpdepfile" -n '
540 /^Note: including file: *\(.*\)/ {
541 s//\1/
542 s/\\/\\\\/g
543 p
544 }' | $cygpath_u | sort -u | sed -n '
545 s/ /\\ /g
546 s/\(.*\)/'"$tab"'\1 \\/p
547 s/.\(.*\) \\/\1:/
548 H
549 $ {
550 s/.*/'"$tab"'/
551 G
552 p
553 }' >> "$depfile"
554 echo >> "$depfile" # make sure the fragment doesn't end with a backslash
555 rm -f "$tmpdepfile"
556 ;;
557
558 msvc7msys)
559 # This case exists only to let depend.m4 do its work. It works by
560 # looking at the text of this script. This case will never be run,
561 # since it is checked for above.
562 exit 1
563 ;;
564
565 #nosideeffect)
566 # This comment above is used by automake to tell side-effect
567 # dependency tracking mechanisms from slower ones.
568
569 dashmstdout)
570 # Important note: in order to support this mode, a compiler *must*
571 # always write the preprocessed file to stdout, regardless of -o.
572 "$@" || exit $?
573
574 # Remove the call to Libtool.
575 if test "$libtool" = yes; then
576 while test "X$1" != 'X--mode=compile'; do
577 shift
578 done
579 shift
580 fi
581
582 # Remove '-o $object'.
583 IFS=" "
584 for arg
585 do
586 case $arg in
587 -o)
588 shift
589 ;;
590 $object)
591 shift
592 ;;
593 *)
594 set fnord "$@" "$arg"
595 shift # fnord
596 shift # $arg
597 ;;
598 esac
599 done
600
601 test -z "$dashmflag" && dashmflag=-M
602 # Require at least two characters before searching for ':'
603 # in the target name. This is to cope with DOS-style filenames:
604 # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
605 "$@" $dashmflag |
606 sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
607 rm -f "$depfile"
608 cat < "$tmpdepfile" > "$depfile"
609 # Some versions of the HPUX 10.20 sed can't process this sed invocation
610 # correctly. Breaking it into two sed invocations is a workaround.
611 tr ' ' "$nl" < "$tmpdepfile" \
612 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
613 | sed -e 's/$/ :/' >> "$depfile"
614 rm -f "$tmpdepfile"
615 ;;
616
617 dashXmstdout)
618 # This case only exists to satisfy depend.m4. It is never actually
619 # run, as this mode is specially recognized in the preamble.
620 exit 1
621 ;;
622
623 makedepend)
624 "$@" || exit $?
625 # Remove any Libtool call
626 if test "$libtool" = yes; then
627 while test "X$1" != 'X--mode=compile'; do
628 shift
629 done
630 shift
631 fi
632 # X makedepend
633 shift
634 cleared=no eat=no
635 for arg
636 do
637 case $cleared in
638 no)
639 set ""; shift
640 cleared=yes ;;
641 esac
642 if test $eat = yes; then
643 eat=no
644 continue
645 fi
646 case "$arg" in
647 -D*|-I*)
648 set fnord "$@" "$arg"; shift ;;
649 # Strip any option that makedepend may not understand. Remove
650 # the object too, otherwise makedepend will parse it as a source file.
651 -arch)
652 eat=yes ;;
653 -*|$object)
654 ;;
655 *)
656 set fnord "$@" "$arg"; shift ;;
657 esac
658 done
659 obj_suffix=`echo "$object" | sed 's/^.*\././'`
660 touch "$tmpdepfile"
661 ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
662 rm -f "$depfile"
663 # makedepend may prepend the VPATH from the source file name to the object.
664 # No need to regex-escape $object, excess matching of '.' is harmless.
665 sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
666 # Some versions of the HPUX 10.20 sed can't process the last invocation
667 # correctly. Breaking it into two sed invocations is a workaround.
668 sed '1,2d' "$tmpdepfile" \
669 | tr ' ' "$nl" \
670 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
671 | sed -e 's/$/ :/' >> "$depfile"
672 rm -f "$tmpdepfile" "$tmpdepfile".bak
673 ;;
674
675 cpp)
676 # Important note: in order to support this mode, a compiler *must*
677 # always write the preprocessed file to stdout.
678 "$@" || exit $?
679
680 # Remove the call to Libtool.
681 if test "$libtool" = yes; then
682 while test "X$1" != 'X--mode=compile'; do
683 shift
684 done
685 shift
686 fi
687
688 # Remove '-o $object'.
689 IFS=" "
690 for arg
691 do
692 case $arg in
693 -o)
694 shift
695 ;;
696 $object)
697 shift
698 ;;
699 *)
700 set fnord "$@" "$arg"
701 shift # fnord
702 shift # $arg
703 ;;
704 esac
705 done
706
707 "$@" -E \
708 | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
709 -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
710 | sed '$ s: \\$::' > "$tmpdepfile"
711 rm -f "$depfile"
712 echo "$object : \\" > "$depfile"
713 cat < "$tmpdepfile" >> "$depfile"
714 sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
715 rm -f "$tmpdepfile"
716 ;;
717
718 msvisualcpp)
719 # Important note: in order to support this mode, a compiler *must*
720 # always write the preprocessed file to stdout.
721 "$@" || exit $?
722
723 # Remove the call to Libtool.
724 if test "$libtool" = yes; then
725 while test "X$1" != 'X--mode=compile'; do
726 shift
727 done
728 shift
729 fi
730
731 IFS=" "
732 for arg
733 do
734 case "$arg" in
735 -o)
736 shift
737 ;;
738 $object)
739 shift
740 ;;
741 "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
742 set fnord "$@"
743 shift
744 shift
745 ;;
746 *)
747 set fnord "$@" "$arg"
748 shift
749 shift
750 ;;
751 esac
752 done
753 "$@" -E 2>/dev/null |
754 sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
755 rm -f "$depfile"
756 echo "$object : \\" > "$depfile"
757 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
758 echo "$tab" >> "$depfile"
759 sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
760 rm -f "$tmpdepfile"
761 ;;
762
763 msvcmsys)
764 # This case exists only to let depend.m4 do its work. It works by
765 # looking at the text of this script. This case will never be run,
766 # since it is checked for above.
767 exit 1
768 ;;
769
770 none)
771 exec "$@"
772 ;;
773
774 *)
775 echo "Unknown depmode $depmode" 1>&2
776 exit 1
777 ;;
778 esac
779
780 exit 0
781
782 # Local Variables:
783 # mode: shell-script
784 # sh-indentation: 2
785 # eval: (add-hook 'write-file-hooks 'time-stamp)
786 # time-stamp-start: "scriptversion="
787 # time-stamp-format: "%:y-%02m-%02d.%02H"
788 # time-stamp-time-zone: "UTC"
789 # time-stamp-end: "; # UTC"
790 # End:
0 #!/bin/sh
1 # install - install a program, script, or datafile
2
3 scriptversion=2011-11-20.07; # UTC
4
5 # This originates from X11R5 (mit/util/scripts/install.sh), which was
6 # later released in X11R6 (xc/config/util/install.sh) with the
7 # following copyright and license.
8 #
9 # Copyright (C) 1994 X Consortium
10 #
11 # Permission is hereby granted, free of charge, to any person obtaining a copy
12 # of this software and associated documentation files (the "Software"), to
13 # deal in the Software without restriction, including without limitation the
14 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
15 # sell copies of the Software, and to permit persons to whom the Software is
16 # furnished to do so, subject to the following conditions:
17 #
18 # The above copyright notice and this permission notice shall be included in
19 # all copies or substantial portions of the Software.
20 #
21 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
25 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
26 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #
28 # Except as contained in this notice, the name of the X Consortium shall not
29 # be used in advertising or otherwise to promote the sale, use or other deal-
30 # ings in this Software without prior written authorization from the X Consor-
31 # tium.
32 #
33 #
34 # FSF changes to this file are in the public domain.
35 #
36 # Calling this script install-sh is preferred over install.sh, to prevent
37 # 'make' implicit rules from creating a file called install from it
38 # when there is no Makefile.
39 #
40 # This script is compatible with the BSD install script, but was written
41 # from scratch.
42
43 nl='
44 '
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.
50 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
56
57 # Put in absolute file names if you don't have them in your path;
58 # or use environment vars.
59
60 chgrpprog=${CHGRPPROG-chgrp}
61 chmodprog=${CHMODPROG-chmod}
62 chownprog=${CHOWNPROG-chown}
63 cmpprog=${CMPPROG-cmp}
64 cpprog=${CPPROG-cp}
65 mkdirprog=${MKDIRPROG-mkdir}
66 mvprog=${MVPROG-mv}
67 rmprog=${RMPROG-rm}
68 stripprog=${STRIPPROG-strip}
69
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
81 posix_mkdir=
82
83 # Desired mode of installed file.
84 mode=0755
85
86 chgrpcmd=
87 chmodcmd=$chmodprog
88 chowncmd=
89 mvcmd=$mvprog
90 rmcmd="$rmprog -f"
91 stripcmd=
92
93 src=
94 dst=
95 dir_arg=
96 dst_arg=
97
98 copy_on_change=false
99 no_target_directory=
100
101 usage="\
102 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
103 or: $0 [OPTION]... SRCFILES... DIRECTORY
104 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
105 or: $0 [OPTION]... -d DIRECTORIES...
106
107 In the 1st form, copy SRCFILE to DSTFILE.
108 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
109 In the 4th, create DIRECTORIES.
110
111 Options:
112 --help display this help and exit.
113 --version display version info and exit.
114
115 -c (ignored)
116 -C install only if different (preserve the last data modification time)
117 -d create directories instead of installing files.
118 -g GROUP $chgrpprog installed files to GROUP.
119 -m MODE $chmodprog installed files to MODE.
120 -o USER $chownprog installed files to USER.
121 -s $stripprog installed files.
122 -t DIRECTORY install into DIRECTORY.
123 -T report an error if DSTFILE is a directory.
124
125 Environment variables override the default commands:
126 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
127 RMPROG STRIPPROG
128 "
129
130 while test $# -ne 0; do
131 case $1 in
132 -c) ;;
133
134 -C) copy_on_change=true;;
135
136 -d) dir_arg=true;;
137
138 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
140
141 --help) echo "$usage"; exit $?;;
142
143 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
151
152 -o) chowncmd="$chownprog $2"
153 shift;;
154
155 -s) stripcmd=$stripprog;;
156
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;;
165
166 --version) echo "$0 $scriptversion"; exit $?;;
167
168 --) shift
169 break;;
170
171 -*) echo "$0: invalid option: $1" >&2
172 exit 1;;
173
174 *) break;;
175 esac
176 shift
177 done
178
179 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
180 # When -d is used, all remaining arguments are directories to create.
181 # When -t is used, the destination is already specified.
182 # Otherwise, the last argument is the destination. Remove it from $@.
183 for arg
184 do
185 if test -n "$dst_arg"; then
186 # $@ is not empty: it contains at least $arg.
187 set fnord "$@" "$dst_arg"
188 shift # fnord
189 fi
190 shift # arg
191 dst_arg=$arg
192 # Protect names problematic for 'test' and other utilities.
193 case $dst_arg in
194 -* | [=\(\)!]) dst_arg=./$dst_arg;;
195 esac
196 done
197 fi
198
199 if test $# -eq 0; then
200 if test -z "$dir_arg"; then
201 echo "$0: no input file specified." >&2
202 exit 1
203 fi
204 # It's OK to call 'install-sh -d' without argument.
205 # This can happen when creating conditional directories.
206 exit 0
207 fi
208
209 if test -z "$dir_arg"; then
210 do_exit='(exit $ret); exit $ret'
211 trap "ret=129; $do_exit" 1
212 trap "ret=130; $do_exit" 2
213 trap "ret=141; $do_exit" 13
214 trap "ret=143; $do_exit" 15
215
216 # Set umask so as not to create temps with too-generous modes.
217 # However, 'strip' requires both read and write access to temps.
218 case $mode in
219 # Optimize common cases.
220 *644) cp_umask=133;;
221 *755) cp_umask=22;;
222
223 *[0-7])
224 if test -z "$stripcmd"; then
225 u_plus_rw=
226 else
227 u_plus_rw='% 200'
228 fi
229 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
230 *)
231 if test -z "$stripcmd"; then
232 u_plus_rw=
233 else
234 u_plus_rw=,u+rw
235 fi
236 cp_umask=$mode$u_plus_rw;;
237 esac
238 fi
239
240 for src
241 do
242 # Protect names problematic for 'test' and other utilities.
243 case $src in
244 -* | [=\(\)!]) src=./$src;;
245 esac
246
247 if test -n "$dir_arg"; then
248 dst=$src
249 dstdir=$dst
250 test -d "$dstdir"
251 dstdir_status=$?
252 else
253
254 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
255 # might cause directories to be created, which would be especially bad
256 # if $src (and thus $dsttmp) contains '*'.
257 if test ! -f "$src" && test ! -d "$src"; then
258 echo "$0: $src does not exist." >&2
259 exit 1
260 fi
261
262 if test -z "$dst_arg"; then
263 echo "$0: no destination specified." >&2
264 exit 1
265 fi
266 dst=$dst_arg
267
268 # If destination is a directory, append the input filename; won't work
269 # if double slashes aren't ignored.
270 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
274 fi
275 dstdir=$dst
276 dst=$dstdir/`basename "$src"`
277 dstdir_status=0
278 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
306 test -d "$dstdir"
307 dstdir_status=$?
308 fi
309 fi
310
311 obsolete_mkdir_used=false
312
313 if test $dstdir_status != 0; then
314 case $posix_mkdir in
315 '')
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;;
378 esac
379
380 if
381 $posix_mkdir && (
382 umask $mkdir_umask &&
383 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
384 )
385 then :
386 else
387
388 # The umask is ridiculous, or mkdir does not conform to POSIX,
389 # or it failed possibly due to a race condition. Create the
390 # directory the slow way, step by step, checking for races as we go.
391
392 case $dstdir in
393 /*) prefix='/';;
394 [-=\(\)!]*) prefix='./';;
395 *) prefix='';;
396 esac
397
398 eval "$initialize_posix_glob"
399
400 oIFS=$IFS
401 IFS=/
402 $posix_glob set -f
403 set fnord $dstdir
404 shift
405 $posix_glob set +f
406 IFS=$oIFS
407
408 prefixes=
409
410 for d
411 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/
432 done
433
434 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
440 fi
441 fi
442 fi
443
444 if test -n "$dir_arg"; then
445 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
446 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
447 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
448 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
449 else
450
451 # Make a couple of temp file names in the proper directory.
452 dsttmp=$dstdir/_inst.$$_
453 rmtmp=$dstdir/_rm.$$_
454
455 # Trap to clean up those temp files at exit.
456 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
457
458 # Copy the file name to the temp name.
459 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
460
461 # and set any options; do chmod last to preserve setuid bits.
462 #
463 # If any of these fail, we abort the whole thing. If we want to
464 # ignore errors from any of these, just make sure not to ignore
465 # errors from the above "$doit $cpprog $src $dsttmp" command.
466 #
467 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
468 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
469 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
470 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
471
472 # If -C, don't bother to copy if it wouldn't change the file.
473 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 &&
479 set X $old && old=:$2:$4:$5:$6 &&
480 set X $new && new=:$2:$4:$5:$6 &&
481 $posix_glob set +f &&
482
483 test "$old" = "$new" &&
484 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
485 then
486 rm -f "$dsttmp"
487 else
488 # Rename the file to the real destination.
489 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
490
491 # The rename failed, perhaps because mv can't rename something else
492 # to itself, or perhaps because mv is so ancient that it does not
493 # support -f.
494 {
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"
513 }
514 fi || exit 1
515
516 trap '' 0
517 fi
518 done
519
520 # Local variables:
521 # eval: (add-hook 'write-file-hooks 'time-stamp)
522 # time-stamp-start: "scriptversion="
523 # time-stamp-format: "%:y-%02m-%02d.%02H"
524 # time-stamp-time-zone: "UTC"
525 # time-stamp-end: "; # UTC"
526 # End:
0 #! /bin/sh
1 ## 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
5 # Provide generalized library-building support services.
6 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
8 # Copyright (C) 1996-2015 Free Software Foundation, Inc.
9 # This is free software; see the source for copying conditions. There is NO
10 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12 # GNU Libtool is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # As a special exception to the GNU General Public License,
18 # if you distribute this file as part of a program or library that
19 # is built using GNU Libtool, you may include this file under the
20 # same distribution terms that you use for the rest of that program.
21 #
22 # GNU Libtool is distributed in the hope that it will be useful, but
23 # WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 # General Public License for more details.
26 #
27 # You should have received a copy of the GNU General Public License
28 # along with this program. If not, see <http://www.gnu.org/licenses/>.
29
30
31 PROGRAM=libtool
32 PACKAGE=libtool
33 VERSION=2.4.6
34 package_revision=2.4.6
35
36
37 ## ------ ##
38 ## Usage. ##
39 ## ------ ##
40
41 # Run './libtool --help' for help with using this script from the
42 # command line.
43
44
45 ## ------------------------------- ##
46 ## User overridable command paths. ##
47 ## ------------------------------- ##
48
49 # After configure completes, it has a better idea of some of the
50 # shell tools we need than the defaults used by the functions shared
51 # with bootstrap, so set those here where they can still be over-
52 # ridden by the user, but otherwise take precedence.
53
54 : ${AUTOCONF="autoconf"}
55 : ${AUTOMAKE="automake"}
56
57
58 ## -------------------------- ##
59 ## Source external libraries. ##
60 ## -------------------------- ##
61
62 # Much of our low-level functionality needs to be sourced from external
63 # libraries, which are installed to $pkgauxdir.
64
65 # Set a version string for this script.
66 scriptversion=2015-01-20.17; # UTC
67
68 # General shell script boiler plate, and helper functions.
69 # Written by Gary V. Vaughan, 2004
70
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.
94
95
96 ## ------ ##
97 ## Usage. ##
98 ## ------ ##
99
100 # Evaluate this file near the top of your script to gain access to
101 # the functions and variables defined here:
102 #
103 # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
104 #
105 # If you need to override any of the default environment variable
106 # settings, do that before evaluating this file.
107
108
109 ## -------------------- ##
110 ## Shell normalisation. ##
111 ## -------------------- ##
112
113 # Some shells need a little help to be as Bourne compatible as possible.
114 # Before doing anything else, make sure all that help has been provided!
115
116 DUALCASE=1; export DUALCASE # for MKS sh
117 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
118 emulate sh
119 NULLCMD=:
120 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
121 # is contrary to our usage. Disable this feature.
122 alias -g '${1+"$@"}'='"$@"'
123 setopt NO_GLOB_SUBST
124 else
125 case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
126 fi
127
128 # NLS nuisances: We save the old values in case they are required later.
129 _G_user_locale=
130 _G_safe_locale=
131 for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
132 do
133 eval "if test set = \"\${$_G_var+set}\"; then
134 save_$_G_var=\$$_G_var
135 $_G_var=C
136 export $_G_var
137 _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
138 _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
139 fi"
140 done
141
142 # CDPATH.
143 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
144
145 # Make sure IFS has a sensible default
146 sp=' '
147 nl='
148 '
149 IFS="$sp $nl"
150
151 # There are apparently some retarded systems that use ';' as a PATH separator!
152 if test "${PATH_SEPARATOR+set}" != set; then
153 PATH_SEPARATOR=:
154 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
155 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
156 PATH_SEPARATOR=';'
157 }
158 fi
159
160
161
162 ## ------------------------- ##
163 ## Locate command utilities. ##
164 ## ------------------------- ##
165
166
167 # func_executable_p FILE
168 # ----------------------
169 # Check that FILE is an executable regular file.
170 func_executable_p ()
171 {
172 test -f "$1" && test -x "$1"
173 }
174
175
176 # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
177 # --------------------------------------------
178 # Search for either a program that responds to --version with output
179 # containing "GNU", or else returned by CHECK_FUNC otherwise, by
180 # trying all the directories in PATH with each of the elements of
181 # PROGS_LIST.
182 #
183 # CHECK_FUNC should accept the path to a candidate program, and
184 # set $func_check_prog_result if it truncates its output less than
185 # $_G_path_prog_max characters.
186 func_path_progs ()
187 {
188 _G_progs_list=$1
189 _G_check_func=$2
190 _G_PATH=${3-"$PATH"}
191
192 _G_path_prog_max=0
193 _G_path_prog_found=false
194 _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
195 for _G_dir in $_G_PATH; do
196 IFS=$_G_save_IFS
197 test -z "$_G_dir" && _G_dir=.
198 for _G_prog_name in $_G_progs_list; do
199 for _exeext in '' .EXE; do
200 _G_path_prog=$_G_dir/$_G_prog_name$_exeext
201 func_executable_p "$_G_path_prog" || continue
202 case `"$_G_path_prog" --version 2>&1` in
203 *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
204 *) $_G_check_func $_G_path_prog
205 func_path_progs_result=$func_check_prog_result
206 ;;
207 esac
208 $_G_path_prog_found && break 3
209 done
210 done
211 done
212 IFS=$_G_save_IFS
213 test -z "$func_path_progs_result" && {
214 echo "no acceptable sed could be found in \$PATH" >&2
215 exit 1
216 }
217 }
218
219
220 # We want to be able to use the functions in this file before configure
221 # has figured out where the best binaries are kept, which means we have
222 # to search for them ourselves - except when the results are already set
223 # where we skip the searches.
224
225 # Unless the user overrides by setting SED, search the path for either GNU
226 # sed, or the sed that truncates its output the least.
227 test -z "$SED" && {
228 _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
229 for _G_i in 1 2 3 4 5 6 7; do
230 _G_sed_script=$_G_sed_script$nl$_G_sed_script
231 done
232 echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
233 _G_sed_script=
234
235 func_check_prog_sed ()
236 {
237 _G_path_prog=$1
238
239 _G_count=0
240 printf 0123456789 >conftest.in
241 while :
242 do
243 cat conftest.in conftest.in >conftest.tmp
244 mv conftest.tmp conftest.in
245 cp conftest.in conftest.nl
246 echo '' >> conftest.nl
247 "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
248 diff conftest.out conftest.nl >/dev/null 2>&1 || break
249 _G_count=`expr $_G_count + 1`
250 if test "$_G_count" -gt "$_G_path_prog_max"; then
251 # Best one so far, save it but keep looking for a better one
252 func_check_prog_result=$_G_path_prog
253 _G_path_prog_max=$_G_count
254 fi
255 # 10*(2^10) chars as input seems more than enough
256 test 10 -lt "$_G_count" && break
257 done
258 rm -f conftest.in conftest.tmp conftest.nl conftest.out
259 }
260
261 func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
262 rm -f conftest.sed
263 SED=$func_path_progs_result
264 }
265
266
267 # Unless the user overrides by setting GREP, search the path for either GNU
268 # grep, or the grep that truncates its output the least.
269 test -z "$GREP" && {
270 func_check_prog_grep ()
271 {
272 _G_path_prog=$1
273
274 _G_count=0
275 _G_path_prog_max=0
276 printf 0123456789 >conftest.in
277 while :
278 do
279 cat conftest.in conftest.in >conftest.tmp
280 mv conftest.tmp conftest.in
281 cp conftest.in conftest.nl
282 echo 'GREP' >> conftest.nl
283 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
284 diff conftest.out conftest.nl >/dev/null 2>&1 || break
285 _G_count=`expr $_G_count + 1`
286 if test "$_G_count" -gt "$_G_path_prog_max"; then
287 # Best one so far, save it but keep looking for a better one
288 func_check_prog_result=$_G_path_prog
289 _G_path_prog_max=$_G_count
290 fi
291 # 10*(2^10) chars as input seems more than enough
292 test 10 -lt "$_G_count" && break
293 done
294 rm -f conftest.in conftest.tmp conftest.nl conftest.out
295 }
296
297 func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
298 GREP=$func_path_progs_result
299 }
300
301
302 ## ------------------------------- ##
303 ## User overridable command paths. ##
304 ## ------------------------------- ##
305
306 # All uppercase variable names are used for environment variables. These
307 # variables can be overridden by the user before calling a script that
308 # uses them if a suitable command of that name is not already available
309 # in the command search PATH.
310
311 : ${CP="cp -f"}
312 : ${ECHO="printf %s\n"}
313 : ${EGREP="$GREP -E"}
314 : ${FGREP="$GREP -F"}
315 : ${LN_S="ln -s"}
316 : ${MAKE="make"}
317 : ${MKDIR="mkdir"}
318 : ${MV="mv -f"}
319 : ${RM="rm -f"}
320 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
321
322
323 ## -------------------- ##
324 ## Useful sed snippets. ##
325 ## -------------------- ##
326
327 sed_dirname='s|/[^/]*$||'
328 sed_basename='s|^.*/||'
329
330 # Sed substitution that helps us do robust quoting. It backslashifies
331 # metacharacters that are still active within double-quoted strings.
332 sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
333
334 # Same as above, but do not quote variable references.
335 sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
336
337 # Sed substitution that turns a string into a regex matching for the
338 # string literally.
339 sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
340
341 # Sed substitution that converts a w32 file name or path
342 # that contains forward slashes, into one that contains
343 # (escaped) backslashes. A very naive implementation.
344 sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
345
346 # Re-'\' parameter expansions in output of sed_double_quote_subst that
347 # were '\'-ed in input to the same. If an odd number of '\' preceded a
348 # '$' in input to sed_double_quote_subst, that '$' was protected from
349 # expansion. Since each input '\' is now two '\'s, look for any number
350 # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
351 _G_bs='\\'
352 _G_bs2='\\\\'
353 _G_bs4='\\\\\\\\'
354 _G_dollar='\$'
355 sed_double_backslash="\
356 s/$_G_bs4/&\\
357 /g
358 s/^$_G_bs2$_G_dollar/$_G_bs&/
359 s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
360 s/\n//g"
361
362
363 ## ----------------- ##
364 ## Global variables. ##
365 ## ----------------- ##
366
367 # Except for the global variables explicitly listed below, the following
368 # functions in the '^func_' namespace, and the '^require_' namespace
369 # variables initialised in the 'Resource management' section, sourcing
370 # this file will not pollute your global namespace with anything
371 # else. There's no portable way to scope variables in Bourne shell
372 # though, so actually running these functions will sometimes place
373 # results into a variable named after the function, and often use
374 # temporary variables in the '^_G_' namespace. If you are careful to
375 # avoid using those namespaces casually in your sourcing script, things
376 # should continue to work as you expect. And, of course, you can freely
377 # overwrite any of the functions or variables defined here before
378 # calling anything to customize them.
379
380 EXIT_SUCCESS=0
381 EXIT_FAILURE=1
382 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
383 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
384
385 # Allow overriding, eg assuming that you follow the convention of
386 # putting '$debug_cmd' at the start of all your functions, you can get
387 # bash to show function call trace with:
388 #
389 # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
390 debug_cmd=${debug_cmd-":"}
391 exit_cmd=:
392
393 # By convention, finish your script with:
394 #
395 # exit $exit_status
396 #
397 # so that you can set exit_status to non-zero if you want to indicate
398 # something went wrong during execution without actually bailing out at
399 # the point of failure.
400 exit_status=$EXIT_SUCCESS
401
402 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
403 # is ksh but when the shell is invoked as "sh" and the current value of
404 # the _XPG environment variable is not equal to 1 (one), the special
405 # positional parameter $0, within a function call, is the name of the
406 # function.
407 progpath=$0
408
409 # The name of this program.
410 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
411
412 # Make sure we have an absolute progpath for reexecution:
413 case $progpath in
414 [\\/]*|[A-Za-z]:\\*) ;;
415 *[\\/]*)
416 progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
417 progdir=`cd "$progdir" && pwd`
418 progpath=$progdir/$progname
419 ;;
420 *)
421 _G_IFS=$IFS
422 IFS=${PATH_SEPARATOR-:}
423 for progdir in $PATH; do
424 IFS=$_G_IFS
425 test -x "$progdir/$progname" && break
426 done
427 IFS=$_G_IFS
428 test -n "$progdir" || progdir=`pwd`
429 progpath=$progdir/$progname
430 ;;
431 esac
432
433
434 ## ----------------- ##
435 ## Standard options. ##
436 ## ----------------- ##
437
438 # The following options affect the operation of the functions defined
439 # below, and should be set appropriately depending on run-time para-
440 # meters passed on the command line.
441
442 opt_dry_run=false
443 opt_quiet=false
444 opt_verbose=false
445
446 # Categories 'all' and 'none' are always available. Append any others
447 # you will pass as the first argument to func_warning from your own
448 # code.
449 warning_categories=
450
451 # By default, display warnings according to 'opt_warning_types'. Set
452 # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
453 # treat the next displayed warning as a fatal error.
454 warning_func=func_warn_and_continue
455
456 # Set to 'all' to display all warnings, 'none' to suppress all
457 # warnings, or a space delimited list of some subset of
458 # 'warning_categories' to display only the listed warnings.
459 opt_warning_types=all
460
461
462 ## -------------------- ##
463 ## Resource management. ##
464 ## -------------------- ##
465
466 # This section contains definitions for functions that each ensure a
467 # particular resource (a file, or a non-empty configuration variable for
468 # example) is available, and if appropriate to extract default values
469 # from pertinent package files. Call them using their associated
470 # 'require_*' variable to ensure that they are executed, at most, once.
471 #
472 # It's entirely deliberate that calling these functions can set
473 # variables that don't obey the namespace limitations obeyed by the rest
474 # of this file, in order that that they be as useful as possible to
475 # callers.
476
477
478 # require_term_colors
479 # -------------------
480 # Allow display of bold text on terminals that support it.
481 require_term_colors=func_require_term_colors
482 func_require_term_colors ()
483 {
484 $debug_cmd
485
486 test -t 1 && {
487 # COLORTERM and USE_ANSI_COLORS environment variables take
488 # precedence, because most terminfo databases neglect to describe
489 # whether color sequences are supported.
490 test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
491
492 if test 1 = "$USE_ANSI_COLORS"; then
493 # Standard ANSI escape sequences
494 tc_reset=''
495 tc_bold=''; tc_standout=''
496 tc_red=''; tc_green=''
497 tc_blue=''; tc_cyan=''
498 else
499 # Otherwise trust the terminfo database after all.
500 test -n "`tput sgr0 2>/dev/null`" && {
501 tc_reset=`tput sgr0`
502 test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
503 tc_standout=$tc_bold
504 test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
505 test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
506 test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
507 test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
508 test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
509 }
510 fi
511 }
512
513 require_term_colors=:
514 }
515
516
517 ## ----------------- ##
518 ## Function library. ##
519 ## ----------------- ##
520
521 # This section contains a variety of useful functions to call in your
522 # scripts. Take note of the portable wrappers for features provided by
523 # some modern shells, which will fall back to slower equivalents on
524 # less featureful shells.
525
526
527 # func_append VAR VALUE
528 # ---------------------
529 # Append VALUE onto the existing contents of VAR.
530
531 # We should try to minimise forks, especially on Windows where they are
532 # unreasonably slow, so skip the feature probes when bash or zsh are
533 # being used:
534 if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
535 : ${_G_HAVE_ARITH_OP="yes"}
536 : ${_G_HAVE_XSI_OPS="yes"}
537 # The += operator was introduced in bash 3.1
538 case $BASH_VERSION in
539 [12].* | 3.0 | 3.0*) ;;
540 *)
541 : ${_G_HAVE_PLUSEQ_OP="yes"}
542 ;;
543 esac
544 fi
545
546 # _G_HAVE_PLUSEQ_OP
547 # Can be empty, in which case the shell is probed, "yes" if += is
548 # useable or anything else if it does not work.
549 test -z "$_G_HAVE_PLUSEQ_OP" \
550 && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
551 && _G_HAVE_PLUSEQ_OP=yes
552
553 if test yes = "$_G_HAVE_PLUSEQ_OP"
554 then
555 # This is an XSI compatible shell, allowing a faster implementation...
556 eval 'func_append ()
557 {
558 $debug_cmd
559
560 eval "$1+=\$2"
561 }'
562 else
563 # ...otherwise fall back to using expr, which is often a shell builtin.
564 func_append ()
565 {
566 $debug_cmd
567
568 eval "$1=\$$1\$2"
569 }
570 fi
571
572
573 # func_append_quoted VAR VALUE
574 # ----------------------------
575 # Quote VALUE and append to the end of shell variable VAR, separated
576 # by a space.
577 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
578 eval 'func_append_quoted ()
579 {
580 $debug_cmd
581
582 func_quote_for_eval "$2"
583 eval "$1+=\\ \$func_quote_for_eval_result"
584 }'
585 else
586 func_append_quoted ()
587 {
588 $debug_cmd
589
590 func_quote_for_eval "$2"
591 eval "$1=\$$1\\ \$func_quote_for_eval_result"
592 }
593 fi
594
595
596 # func_append_uniq VAR VALUE
597 # --------------------------
598 # Append unique VALUE onto the existing contents of VAR, assuming
599 # entries are delimited by the first character of VALUE. For example:
600 #
601 # func_append_uniq options " --another-option option-argument"
602 #
603 # will only append to $options if " --another-option option-argument "
604 # is not already present somewhere in $options already (note spaces at
605 # each end implied by leading space in second argument).
606 func_append_uniq ()
607 {
608 $debug_cmd
609
610 eval _G_current_value='`$ECHO $'$1'`'
611 _G_delim=`expr "$2" : '\(.\)'`
612
613 case $_G_delim$_G_current_value$_G_delim in
614 *"$2$_G_delim"*) ;;
615 *) func_append "$@" ;;
616 esac
617 }
618
619
620 # func_arith TERM...
621 # ------------------
622 # Set func_arith_result to the result of evaluating TERMs.
623 test -z "$_G_HAVE_ARITH_OP" \
624 && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
625 && _G_HAVE_ARITH_OP=yes
626
627 if test yes = "$_G_HAVE_ARITH_OP"; then
628 eval 'func_arith ()
629 {
630 $debug_cmd
631
632 func_arith_result=$(( $* ))
633 }'
634 else
635 func_arith ()
636 {
637 $debug_cmd
638
639 func_arith_result=`expr "$@"`
640 }
641 fi
642
643
644 # func_basename FILE
645 # ------------------
646 # Set func_basename_result to FILE with everything up to and including
647 # the last / stripped.
648 if test yes = "$_G_HAVE_XSI_OPS"; then
649 # If this shell supports suffix pattern removal, then use it to avoid
650 # forking. Hide the definitions single quotes in case the shell chokes
651 # on unsupported syntax...
652 _b='func_basename_result=${1##*/}'
653 _d='case $1 in
654 */*) func_dirname_result=${1%/*}$2 ;;
655 * ) func_dirname_result=$3 ;;
656 esac'
657
658 else
659 # ...otherwise fall back to using sed.
660 _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
661 _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
662 if test "X$func_dirname_result" = "X$1"; then
663 func_dirname_result=$3
664 else
665 func_append func_dirname_result "$2"
666 fi'
667 fi
668
669 eval 'func_basename ()
670 {
671 $debug_cmd
672
673 '"$_b"'
674 }'
675
676
677 # func_dirname FILE APPEND NONDIR_REPLACEMENT
678 # -------------------------------------------
679 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
680 # otherwise set result to NONDIR_REPLACEMENT.
681 eval 'func_dirname ()
682 {
683 $debug_cmd
684
685 '"$_d"'
686 }'
687
688
689 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
690 # --------------------------------------------------------
691 # Perform func_basename and func_dirname in a single function
692 # call:
693 # dirname: Compute the dirname of FILE. If nonempty,
694 # add APPEND to the result, otherwise set result
695 # to NONDIR_REPLACEMENT.
696 # value returned in "$func_dirname_result"
697 # basename: Compute filename of FILE.
698 # value retuned in "$func_basename_result"
699 # For efficiency, we do not delegate to the functions above but instead
700 # duplicate the functionality here.
701 eval 'func_dirname_and_basename ()
702 {
703 $debug_cmd
704
705 '"$_b"'
706 '"$_d"'
707 }'
708
709
710 # func_echo ARG...
711 # ----------------
712 # Echo program name prefixed message.
713 func_echo ()
714 {
715 $debug_cmd
716
717 _G_message=$*
718
719 func_echo_IFS=$IFS
720 IFS=$nl
721 for _G_line in $_G_message; do
722 IFS=$func_echo_IFS
723 $ECHO "$progname: $_G_line"
724 done
725 IFS=$func_echo_IFS
726 }
727
728
729 # func_echo_all ARG...
730 # --------------------
731 # Invoke $ECHO with all args, space-separated.
732 func_echo_all ()
733 {
734 $ECHO "$*"
735 }
736
737
738 # func_echo_infix_1 INFIX ARG...
739 # ------------------------------
740 # Echo program name, followed by INFIX on the first line, with any
741 # additional lines not showing INFIX.
742 func_echo_infix_1 ()
743 {
744 $debug_cmd
745
746 $require_term_colors
747
748 _G_infix=$1; shift
749 _G_indent=$_G_infix
750 _G_prefix="$progname: $_G_infix: "
751 _G_message=$*
752
753 # Strip color escape sequences before counting printable length
754 for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
755 do
756 test -n "$_G_tc" && {
757 _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
758 _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
759 }
760 done
761 _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
762
763 func_echo_infix_1_IFS=$IFS
764 IFS=$nl
765 for _G_line in $_G_message; do
766 IFS=$func_echo_infix_1_IFS
767 $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
768 _G_prefix=$_G_indent
769 done
770 IFS=$func_echo_infix_1_IFS
771 }
772
773
774 # func_error ARG...
775 # -----------------
776 # Echo program name prefixed message to standard error.
777 func_error ()
778 {
779 $debug_cmd
780
781 $require_term_colors
782
783 func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
784 }
785
786
787 # func_fatal_error ARG...
788 # -----------------------
789 # Echo program name prefixed message to standard error, and exit.
790 func_fatal_error ()
791 {
792 $debug_cmd
793
794 func_error "$*"
795 exit $EXIT_FAILURE
796 }
797
798
799 # func_grep EXPRESSION FILENAME
800 # -----------------------------
801 # Check whether EXPRESSION matches any line of FILENAME, without output.
802 func_grep ()
803 {
804 $debug_cmd
805
806 $GREP "$1" "$2" >/dev/null 2>&1
807 }
808
809
810 # func_len STRING
811 # ---------------
812 # Set func_len_result to the length of STRING. STRING may not
813 # start with a hyphen.
814 test -z "$_G_HAVE_XSI_OPS" \
815 && (eval 'x=a/b/c;
816 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
817 && _G_HAVE_XSI_OPS=yes
818
819 if test yes = "$_G_HAVE_XSI_OPS"; then
820 eval 'func_len ()
821 {
822 $debug_cmd
823
824 func_len_result=${#1}
825 }'
826 else
827 func_len ()
828 {
829 $debug_cmd
830
831 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
832 }
833 fi
834
835
836 # func_mkdir_p DIRECTORY-PATH
837 # ---------------------------
838 # Make sure the entire path to DIRECTORY-PATH is available.
839 func_mkdir_p ()
840 {
841 $debug_cmd
842
843 _G_directory_path=$1
844 _G_dir_list=
845
846 if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
847
848 # Protect directory names starting with '-'
849 case $_G_directory_path in
850 -*) _G_directory_path=./$_G_directory_path ;;
851 esac
852
853 # While some portion of DIR does not yet exist...
854 while test ! -d "$_G_directory_path"; do
855 # ...make a list in topmost first order. Use a colon delimited
856 # list incase some portion of path contains whitespace.
857 _G_dir_list=$_G_directory_path:$_G_dir_list
858
859 # If the last portion added has no slash in it, the list is done
860 case $_G_directory_path in */*) ;; *) break ;; esac
861
862 # ...otherwise throw away the child directory and loop
863 _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
864 done
865 _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
866
867 func_mkdir_p_IFS=$IFS; IFS=:
868 for _G_dir in $_G_dir_list; do
869 IFS=$func_mkdir_p_IFS
870 # mkdir can fail with a 'File exist' error if two processes
871 # try to create one of the directories concurrently. Don't
872 # stop in that case!
873 $MKDIR "$_G_dir" 2>/dev/null || :
874 done
875 IFS=$func_mkdir_p_IFS
876
877 # Bail out if we (or some other process) failed to create a directory.
878 test -d "$_G_directory_path" || \
879 func_fatal_error "Failed to create '$1'"
880 fi
881 }
882
883
884 # func_mktempdir [BASENAME]
885 # -------------------------
886 # Make a temporary directory that won't clash with other running
887 # libtool processes, and avoids race conditions if possible. If
888 # given, BASENAME is the basename for that directory.
889 func_mktempdir ()
890 {
891 $debug_cmd
892
893 _G_template=${TMPDIR-/tmp}/${1-$progname}
894
895 if test : = "$opt_dry_run"; then
896 # Return a directory name, but don't create it in dry-run mode
897 _G_tmpdir=$_G_template-$$
898 else
899
900 # If mktemp works, use that first and foremost
901 _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
902
903 if test ! -d "$_G_tmpdir"; then
904 # Failing that, at least try and use $RANDOM to avoid a race
905 _G_tmpdir=$_G_template-${RANDOM-0}$$
906
907 func_mktempdir_umask=`umask`
908 umask 0077
909 $MKDIR "$_G_tmpdir"
910 umask $func_mktempdir_umask
911 fi
912
913 # If we're not in dry-run mode, bomb out on failure
914 test -d "$_G_tmpdir" || \
915 func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
916 fi
917
918 $ECHO "$_G_tmpdir"
919 }
920
921
922 # func_normal_abspath PATH
923 # ------------------------
924 # Remove doubled-up and trailing slashes, "." path components,
925 # and cancel out any ".." path components in PATH after making
926 # it an absolute path.
927 func_normal_abspath ()
928 {
929 $debug_cmd
930
931 # These SED scripts presuppose an absolute path with a trailing slash.
932 _G_pathcar='s|^/\([^/]*\).*$|\1|'
933 _G_pathcdr='s|^/[^/]*||'
934 _G_removedotparts=':dotsl
935 s|/\./|/|g
936 t dotsl
937 s|/\.$|/|'
938 _G_collapseslashes='s|/\{1,\}|/|g'
939 _G_finalslash='s|/*$|/|'
940
941 # Start from root dir and reassemble the path.
942 func_normal_abspath_result=
943 func_normal_abspath_tpath=$1
944 func_normal_abspath_altnamespace=
945 case $func_normal_abspath_tpath in
946 "")
947 # Empty path, that just means $cwd.
948 func_stripname '' '/' "`pwd`"
949 func_normal_abspath_result=$func_stripname_result
950 return
951 ;;
952 # The next three entries are used to spot a run of precisely
953 # two leading slashes without using negated character classes;
954 # we take advantage of case's first-match behaviour.
955 ///*)
956 # Unusual form of absolute path, do nothing.
957 ;;
958 //*)
959 # Not necessarily an ordinary path; POSIX reserves leading '//'
960 # and for example Cygwin uses it to access remote file shares
961 # over CIFS/SMB, so we conserve a leading double slash if found.
962 func_normal_abspath_altnamespace=/
963 ;;
964 /*)
965 # Absolute path, do nothing.
966 ;;
967 *)
968 # Relative path, prepend $cwd.
969 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
970 ;;
971 esac
972
973 # Cancel out all the simple stuff to save iterations. We also want
974 # the path to end with a slash for ease of parsing, so make sure
975 # there is one (and only one) here.
976 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
977 -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
978 while :; do
979 # Processed it all yet?
980 if test / = "$func_normal_abspath_tpath"; then
981 # If we ascended to the root using ".." the result may be empty now.
982 if test -z "$func_normal_abspath_result"; then
983 func_normal_abspath_result=/
984 fi
985 break
986 fi
987 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
988 -e "$_G_pathcar"`
989 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
990 -e "$_G_pathcdr"`
991 # Figure out what to do with it
992 case $func_normal_abspath_tcomponent in
993 "")
994 # Trailing empty path component, ignore it.
995 ;;
996 ..)
997 # Parent dir; strip last assembled component from result.
998 func_dirname "$func_normal_abspath_result"
999 func_normal_abspath_result=$func_dirname_result
1000 ;;
1001 *)
1002 # Actual path component, append it.
1003 func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
1004 ;;
1005 esac
1006 done
1007 # Restore leading double-slash if one was found on entry.
1008 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1009 }
1010
1011
1012 # func_notquiet ARG...
1013 # --------------------
1014 # Echo program name prefixed message only when not in quiet mode.
1015 func_notquiet ()
1016 {
1017 $debug_cmd
1018
1019 $opt_quiet || func_echo ${1+"$@"}
1020
1021 # A bug in bash halts the script if the last line of a function
1022 # fails when set -e is in force, so we need another command to
1023 # work around that:
1024 :
1025 }
1026
1027
1028 # func_relative_path SRCDIR DSTDIR
1029 # --------------------------------
1030 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
1031 func_relative_path ()
1032 {
1033 $debug_cmd
1034
1035 func_relative_path_result=
1036 func_normal_abspath "$1"
1037 func_relative_path_tlibdir=$func_normal_abspath_result
1038 func_normal_abspath "$2"
1039 func_relative_path_tbindir=$func_normal_abspath_result
1040
1041 # Ascend the tree starting from libdir
1042 while :; do
1043 # check if we have found a prefix of bindir
1044 case $func_relative_path_tbindir in
1045 $func_relative_path_tlibdir)
1046 # found an exact match
1047 func_relative_path_tcancelled=
1048 break
1049 ;;
1050 $func_relative_path_tlibdir*)
1051 # found a matching prefix
1052 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
1053 func_relative_path_tcancelled=$func_stripname_result
1054 if test -z "$func_relative_path_result"; then
1055 func_relative_path_result=.
1056 fi
1057 break
1058 ;;
1059 *)
1060 func_dirname $func_relative_path_tlibdir
1061 func_relative_path_tlibdir=$func_dirname_result
1062 if test -z "$func_relative_path_tlibdir"; then
1063 # Have to descend all the way to the root!
1064 func_relative_path_result=../$func_relative_path_result
1065 func_relative_path_tcancelled=$func_relative_path_tbindir
1066 break
1067 fi
1068 func_relative_path_result=../$func_relative_path_result
1069 ;;
1070 esac
1071 done
1072
1073 # Now calculate path; take care to avoid doubling-up slashes.
1074 func_stripname '' '/' "$func_relative_path_result"
1075 func_relative_path_result=$func_stripname_result
1076 func_stripname '/' '/' "$func_relative_path_tcancelled"
1077 if test -n "$func_stripname_result"; then
1078 func_append func_relative_path_result "/$func_stripname_result"
1079 fi
1080
1081 # Normalisation. If bindir is libdir, return '.' else relative path.
1082 if test -n "$func_relative_path_result"; then
1083 func_stripname './' '' "$func_relative_path_result"
1084 func_relative_path_result=$func_stripname_result
1085 fi
1086
1087 test -n "$func_relative_path_result" || func_relative_path_result=.
1088
1089 :
1090 }
1091
1092
1093 # func_quote_for_eval ARG...
1094 # --------------------------
1095 # Aesthetically quote ARGs to be evaled later.
1096 # This function returns two values:
1097 # i) func_quote_for_eval_result
1098 # double-quoted, suitable for a subsequent eval
1099 # ii) func_quote_for_eval_unquoted_result
1100 # has all characters that are still active within double
1101 # quotes backslashified.
1102 func_quote_for_eval ()
1103 {
1104 $debug_cmd
1105
1106 func_quote_for_eval_unquoted_result=
1107 func_quote_for_eval_result=
1108 while test 0 -lt $#; do
1109 case $1 in
1110 *[\\\`\"\$]*)
1111 _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
1112 *)
1113 _G_unquoted_arg=$1 ;;
1114 esac
1115 if test -n "$func_quote_for_eval_unquoted_result"; then
1116 func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
1117 else
1118 func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
1119 fi
1120
1121 case $_G_unquoted_arg in
1122 # Double-quote args containing shell metacharacters to delay
1123 # word splitting, command substitution and variable expansion
1124 # for a subsequent eval.
1125 # Many Bourne shells cannot handle close brackets correctly
1126 # in scan sets, so we specify it separately.
1127 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1128 _G_quoted_arg=\"$_G_unquoted_arg\"
1129 ;;
1130 *)
1131 _G_quoted_arg=$_G_unquoted_arg
1132 ;;
1133 esac
1134
1135 if test -n "$func_quote_for_eval_result"; then
1136 func_append func_quote_for_eval_result " $_G_quoted_arg"
1137 else
1138 func_append func_quote_for_eval_result "$_G_quoted_arg"
1139 fi
1140 shift
1141 done
1142 }
1143
1144
1145 # func_quote_for_expand ARG
1146 # -------------------------
1147 # Aesthetically quote ARG to be evaled later; same as above,
1148 # but do not quote variable references.
1149 func_quote_for_expand ()
1150 {
1151 $debug_cmd
1152
1153 case $1 in
1154 *[\\\`\"]*)
1155 _G_arg=`$ECHO "$1" | $SED \
1156 -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
1157 *)
1158 _G_arg=$1 ;;
1159 esac
1160
1161 case $_G_arg in
1162 # Double-quote args containing shell metacharacters to delay
1163 # word splitting and command substitution for a subsequent eval.
1164 # Many Bourne shells cannot handle close brackets correctly
1165 # in scan sets, so we specify it separately.
1166 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1167 _G_arg=\"$_G_arg\"
1168 ;;
1169 esac
1170
1171 func_quote_for_expand_result=$_G_arg
1172 }
1173
1174
1175 # func_stripname PREFIX SUFFIX NAME
1176 # ---------------------------------
1177 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1178 # PREFIX and SUFFIX must not contain globbing or regex special
1179 # characters, hashes, percent signs, but SUFFIX may contain a leading
1180 # dot (in which case that matches only a dot).
1181 if test yes = "$_G_HAVE_XSI_OPS"; then
1182 eval 'func_stripname ()
1183 {
1184 $debug_cmd
1185
1186 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1187 # positional parameters, so assign one to ordinary variable first.
1188 func_stripname_result=$3
1189 func_stripname_result=${func_stripname_result#"$1"}
1190 func_stripname_result=${func_stripname_result%"$2"}
1191 }'
1192 else
1193 func_stripname ()
1194 {
1195 $debug_cmd
1196
1197 case $2 in
1198 .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
1199 *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1200 esac
1201 }
1202 fi
1203
1204
1205 # func_show_eval CMD [FAIL_EXP]
1206 # -----------------------------
1207 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1208 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1209 # is given, then evaluate it.
1210 func_show_eval ()
1211 {
1212 $debug_cmd
1213
1214 _G_cmd=$1
1215 _G_fail_exp=${2-':'}
1216
1217 func_quote_for_expand "$_G_cmd"
1218 eval "func_notquiet $func_quote_for_expand_result"
1219
1220 $opt_dry_run || {
1221 eval "$_G_cmd"
1222 _G_status=$?
1223 if test 0 -ne "$_G_status"; then
1224 eval "(exit $_G_status); $_G_fail_exp"
1225 fi
1226 }
1227 }
1228
1229
1230 # func_show_eval_locale CMD [FAIL_EXP]
1231 # ------------------------------------
1232 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1233 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1234 # is given, then evaluate it. Use the saved locale for evaluation.
1235 func_show_eval_locale ()
1236 {
1237 $debug_cmd
1238
1239 _G_cmd=$1
1240 _G_fail_exp=${2-':'}
1241
1242 $opt_quiet || {
1243 func_quote_for_expand "$_G_cmd"
1244 eval "func_echo $func_quote_for_expand_result"
1245 }
1246
1247 $opt_dry_run || {
1248 eval "$_G_user_locale
1249 $_G_cmd"
1250 _G_status=$?
1251 eval "$_G_safe_locale"
1252 if test 0 -ne "$_G_status"; then
1253 eval "(exit $_G_status); $_G_fail_exp"
1254 fi
1255 }
1256 }
1257
1258
1259 # func_tr_sh
1260 # ----------
1261 # Turn $1 into a string suitable for a shell variable name.
1262 # Result is stored in $func_tr_sh_result. All characters
1263 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1264 # if $1 begins with a digit, a '_' is prepended as well.
1265 func_tr_sh ()
1266 {
1267 $debug_cmd
1268
1269 case $1 in
1270 [0-9]* | *[!a-zA-Z0-9_]*)
1271 func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
1272 ;;
1273 * )
1274 func_tr_sh_result=$1
1275 ;;
1276 esac
1277 }
1278
1279
1280 # func_verbose ARG...
1281 # -------------------
1282 # Echo program name prefixed message in verbose mode only.
1283 func_verbose ()
1284 {
1285 $debug_cmd
1286
1287 $opt_verbose && func_echo "$*"
1288
1289 :
1290 }
1291
1292
1293 # func_warn_and_continue ARG...
1294 # -----------------------------
1295 # Echo program name prefixed warning message to standard error.
1296 func_warn_and_continue ()
1297 {
1298 $debug_cmd
1299
1300 $require_term_colors
1301
1302 func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
1303 }
1304
1305
1306 # func_warning CATEGORY ARG...
1307 # ----------------------------
1308 # Echo program name prefixed warning message to standard error. Warning
1309 # messages can be filtered according to CATEGORY, where this function
1310 # elides messages where CATEGORY is not listed in the global variable
1311 # 'opt_warning_types'.
1312 func_warning ()
1313 {
1314 $debug_cmd
1315
1316 # CATEGORY must be in the warning_categories list!
1317 case " $warning_categories " in
1318 *" $1 "*) ;;
1319 *) func_internal_error "invalid warning category '$1'" ;;
1320 esac
1321
1322 _G_category=$1
1323 shift
1324
1325 case " $opt_warning_types " in
1326 *" $_G_category "*) $warning_func ${1+"$@"} ;;
1327 esac
1328 }
1329
1330
1331 # func_sort_ver VER1 VER2
1332 # -----------------------
1333 # 'sort -V' is not generally available.
1334 # Note this deviates from the version comparison in automake
1335 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1336 # but this should suffice as we won't be specifying old
1337 # version formats or redundant trailing .0 in bootstrap.conf.
1338 # If we did want full compatibility then we should probably
1339 # use m4_version_compare from autoconf.
1340 func_sort_ver ()
1341 {
1342 $debug_cmd
1343
1344 printf '%s\n%s\n' "$1" "$2" \
1345 | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
1346 }
1347
1348 # func_lt_ver PREV CURR
1349 # ---------------------
1350 # Return true if PREV and CURR are in the correct order according to
1351 # func_sort_ver, otherwise false. Use it like this:
1352 #
1353 # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1354 func_lt_ver ()
1355 {
1356 $debug_cmd
1357
1358 test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1359 }
1360
1361
1362 # Local variables:
1363 # mode: shell-script
1364 # sh-indentation: 2
1365 # eval: (add-hook 'before-save-hook 'time-stamp)
1366 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1367 # time-stamp-time-zone: "UTC"
1368 # End:
1369 #! /bin/sh
1370
1371 # Set a version string for this script.
1372 scriptversion=2014-01-07.03; # UTC
1373
1374 # A portable, pluggable option parser for Bourne shell.
1375 # Written by Gary V. Vaughan, 2010
1376
1377 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
1378 # This is free software; see the source for copying conditions. There is NO
1379 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1380
1381 # This program is free software: you can redistribute it and/or modify
1382 # it under the terms of the GNU General Public License as published by
1383 # the Free Software Foundation, either version 3 of the License, or
1384 # (at your option) any later version.
1385
1386 # This program is distributed in the hope that it will be useful,
1387 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1388 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1389 # GNU General Public License for more details.
1390
1391 # You should have received a copy of the GNU General Public License
1392 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1393
1394 # Please report bugs or propose patches to gary@gnu.org.
1395
1396
1397 ## ------ ##
1398 ## Usage. ##
1399 ## ------ ##
1400
1401 # This file is a library for parsing options in your shell scripts along
1402 # with assorted other useful supporting features that you can make use
1403 # of too.
1404 #
1405 # For the simplest scripts you might need only:
1406 #
1407 # #!/bin/sh
1408 # . relative/path/to/funclib.sh
1409 # . relative/path/to/options-parser
1410 # scriptversion=1.0
1411 # func_options ${1+"$@"}
1412 # eval set dummy "$func_options_result"; shift
1413 # ...rest of your script...
1414 #
1415 # In order for the '--version' option to work, you will need to have a
1416 # suitably formatted comment like the one at the top of this file
1417 # starting with '# Written by ' and ending with '# warranty; '.
1418 #
1419 # For '-h' and '--help' to work, you will also need a one line
1420 # description of your script's purpose in a comment directly above the
1421 # '# Written by ' line, like the one at the top of this file.
1422 #
1423 # The default options also support '--debug', which will turn on shell
1424 # execution tracing (see the comment above debug_cmd below for another
1425 # use), and '--verbose' and the func_verbose function to allow your script
1426 # to display verbose messages only when your user has specified
1427 # '--verbose'.
1428 #
1429 # After sourcing this file, you can plug processing for additional
1430 # options by amending the variables from the 'Configuration' section
1431 # below, and following the instructions in the 'Option parsing'
1432 # section further down.
1433
1434 ## -------------- ##
1435 ## Configuration. ##
1436 ## -------------- ##
1437
1438 # You should override these variables in your script after sourcing this
1439 # file so that they reflect the customisations you have added to the
1440 # option parser.
1441
1442 # The usage line for option parsing errors and the start of '-h' and
1443 # '--help' output messages. You can embed shell variables for delayed
1444 # expansion at the time the message is displayed, but you will need to
1445 # quote other shell meta-characters carefully to prevent them being
1446 # expanded when the contents are evaled.
1447 usage='$progpath [OPTION]...'
1448
1449 # Short help message in response to '-h' and '--help'. Add to this or
1450 # override it after sourcing this library to reflect the full set of
1451 # options your script accepts.
1452 usage_message="\
1453 --debug enable verbose shell tracing
1454 -W, --warnings=CATEGORY
1455 report the warnings falling in CATEGORY [all]
1456 -v, --verbose verbosely report processing
1457 --version print version information and exit
1458 -h, --help print short or long help message and exit
1459 "
1460
1461 # Additional text appended to 'usage_message' in response to '--help'.
1462 long_help_message="
1463 Warning categories include:
1464 'all' show all warnings
1465 'none' turn off all the warnings
1466 'error' warnings are treated as fatal errors"
1467
1468 # Help message printed before fatal option parsing errors.
1469 fatal_help="Try '\$progname --help' for more information."
1470
1471
1472
1473 ## ------------------------- ##
1474 ## Hook function management. ##
1475 ## ------------------------- ##
1476
1477 # This section contains functions for adding, removing, and running hooks
1478 # to the main code. A hook is just a named list of of function, that can
1479 # be run in order later on.
1480
1481 # func_hookable FUNC_NAME
1482 # -----------------------
1483 # Declare that FUNC_NAME will run hooks added with
1484 # 'func_add_hook FUNC_NAME ...'.
1485 func_hookable ()
1486 {
1487 $debug_cmd
1488
1489 func_append hookable_fns " $1"
1490 }
1491
1492
1493 # func_add_hook FUNC_NAME HOOK_FUNC
1494 # ---------------------------------
1495 # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
1496 # first have been declared "hookable" by a call to 'func_hookable'.
1497 func_add_hook ()
1498 {
1499 $debug_cmd
1500
1501 case " $hookable_fns " in
1502 *" $1 "*) ;;
1503 *) func_fatal_error "'$1' does not accept hook functions." ;;
1504 esac
1505
1506 eval func_append ${1}_hooks '" $2"'
1507 }
1508
1509
1510 # func_remove_hook FUNC_NAME HOOK_FUNC
1511 # ------------------------------------
1512 # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
1513 func_remove_hook ()
1514 {
1515 $debug_cmd
1516
1517 eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1518 }
1519
1520
1521 # func_run_hooks FUNC_NAME [ARG]...
1522 # ---------------------------------
1523 # Run all hook functions registered to FUNC_NAME.
1524 # It is assumed that the list of hook functions contains nothing more
1525 # than a whitespace-delimited list of legal shell function names, and
1526 # no effort is wasted trying to catch shell meta-characters or preserve
1527 # whitespace.
1528 func_run_hooks ()
1529 {
1530 $debug_cmd
1531
1532 case " $hookable_fns " in
1533 *" $1 "*) ;;
1534 *) func_fatal_error "'$1' does not support hook funcions.n" ;;
1535 esac
1536
1537 eval _G_hook_fns=\$$1_hooks; shift
1538
1539 for _G_hook in $_G_hook_fns; do
1540 eval $_G_hook '"$@"'
1541
1542 # store returned options list back into positional
1543 # parameters for next 'cmd' execution.
1544 eval _G_hook_result=\$${_G_hook}_result
1545 eval set dummy "$_G_hook_result"; shift
1546 done
1547
1548 func_quote_for_eval ${1+"$@"}
1549 func_run_hooks_result=$func_quote_for_eval_result
1550 }
1551
1552
1553
1554 ## --------------- ##
1555 ## Option parsing. ##
1556 ## --------------- ##
1557
1558 # In order to add your own option parsing hooks, you must accept the
1559 # full positional parameter list in your hook function, remove any
1560 # options that you action, and then pass back the remaining unprocessed
1561 # options in '<hooked_function_name>_result', escaped suitably for
1562 # 'eval'. Like this:
1563 #
1564 # my_options_prep ()
1565 # {
1566 # $debug_cmd
1567 #
1568 # # Extend the existing usage message.
1569 # usage_message=$usage_message'
1570 # -s, --silent don'\''t print informational messages
1571 # '
1572 #
1573 # func_quote_for_eval ${1+"$@"}
1574 # my_options_prep_result=$func_quote_for_eval_result
1575 # }
1576 # func_add_hook func_options_prep my_options_prep
1577 #
1578 #
1579 # my_silent_option ()
1580 # {
1581 # $debug_cmd
1582 #
1583 # # Note that for efficiency, we parse as many options as we can
1584 # # recognise in a loop before passing the remainder back to the
1585 # # caller on the first unrecognised argument we encounter.
1586 # while test $# -gt 0; do
1587 # opt=$1; shift
1588 # case $opt in
1589 # --silent|-s) opt_silent=: ;;
1590 # # Separate non-argument short options:
1591 # -s*) func_split_short_opt "$_G_opt"
1592 # set dummy "$func_split_short_opt_name" \
1593 # "-$func_split_short_opt_arg" ${1+"$@"}
1594 # shift
1595 # ;;
1596 # *) set dummy "$_G_opt" "$*"; shift; break ;;
1597 # esac
1598 # done
1599 #
1600 # func_quote_for_eval ${1+"$@"}
1601 # my_silent_option_result=$func_quote_for_eval_result
1602 # }
1603 # func_add_hook func_parse_options my_silent_option
1604 #
1605 #
1606 # my_option_validation ()
1607 # {
1608 # $debug_cmd
1609 #
1610 # $opt_silent && $opt_verbose && func_fatal_help "\
1611 # '--silent' and '--verbose' options are mutually exclusive."
1612 #
1613 # func_quote_for_eval ${1+"$@"}
1614 # my_option_validation_result=$func_quote_for_eval_result
1615 # }
1616 # func_add_hook func_validate_options my_option_validation
1617 #
1618 # You'll alse need to manually amend $usage_message to reflect the extra
1619 # options you parse. It's preferable to append if you can, so that
1620 # multiple option parsing hooks can be added safely.
1621
1622
1623 # func_options [ARG]...
1624 # ---------------------
1625 # All the functions called inside func_options are hookable. See the
1626 # individual implementations for details.
1627 func_hookable func_options
1628 func_options ()
1629 {
1630 $debug_cmd
1631
1632 func_options_prep ${1+"$@"}
1633 eval func_parse_options \
1634 ${func_options_prep_result+"$func_options_prep_result"}
1635 eval func_validate_options \
1636 ${func_parse_options_result+"$func_parse_options_result"}
1637
1638 eval func_run_hooks func_options \
1639 ${func_validate_options_result+"$func_validate_options_result"}
1640
1641 # save modified positional parameters for caller
1642 func_options_result=$func_run_hooks_result
1643 }
1644
1645
1646 # func_options_prep [ARG]...
1647 # --------------------------
1648 # All initialisations required before starting the option parse loop.
1649 # Note that when calling hook functions, we pass through the list of
1650 # positional parameters. If a hook function modifies that list, and
1651 # needs to propogate that back to rest of this script, then the complete
1652 # modified list must be put in 'func_run_hooks_result' before
1653 # returning.
1654 func_hookable func_options_prep
1655 func_options_prep ()
1656 {
1657 $debug_cmd
1658
1659 # Option defaults:
1660 opt_verbose=false
1661 opt_warning_types=
1662
1663 func_run_hooks func_options_prep ${1+"$@"}
1664
1665 # save modified positional parameters for caller
1666 func_options_prep_result=$func_run_hooks_result
1667 }
1668
1669
1670 # func_parse_options [ARG]...
1671 # ---------------------------
1672 # The main option parsing loop.
1673 func_hookable func_parse_options
1674 func_parse_options ()
1675 {
1676 $debug_cmd
1677
1678 func_parse_options_result=
1679
1680 # this just eases exit handling
1681 while test $# -gt 0; do
1682 # Defer to hook functions for initial option parsing, so they
1683 # get priority in the event of reusing an option name.
1684 func_run_hooks func_parse_options ${1+"$@"}
1685
1686 # Adjust func_parse_options positional parameters to match
1687 eval set dummy "$func_run_hooks_result"; shift
1688
1689 # Break out of the loop if we already parsed every option.
1690 test $# -gt 0 || break
1691
1692 _G_opt=$1
1693 shift
1694 case $_G_opt in
1695 --debug|-x) debug_cmd='set -x'
1696 func_echo "enabling shell trace mode"
1697 $debug_cmd
1698 ;;
1699
1700 --no-warnings|--no-warning|--no-warn)
1701 set dummy --warnings none ${1+"$@"}
1702 shift
1703 ;;
1704
1705 --warnings|--warning|-W)
1706 test $# = 0 && func_missing_arg $_G_opt && break
1707 case " $warning_categories $1" in
1708 *" $1 "*)
1709 # trailing space prevents matching last $1 above
1710 func_append_uniq opt_warning_types " $1"
1711 ;;
1712 *all)
1713 opt_warning_types=$warning_categories
1714 ;;
1715 *none)
1716 opt_warning_types=none
1717 warning_func=:
1718 ;;
1719 *error)
1720 opt_warning_types=$warning_categories
1721 warning_func=func_fatal_error
1722 ;;
1723 *)
1724 func_fatal_error \
1725 "unsupported warning category: '$1'"
1726 ;;
1727 esac
1728 shift
1729 ;;
1730
1731 --verbose|-v) opt_verbose=: ;;
1732 --version) func_version ;;
1733 -\?|-h) func_usage ;;
1734 --help) func_help ;;
1735
1736 # Separate optargs to long options (plugins may need this):
1737 --*=*) func_split_equals "$_G_opt"
1738 set dummy "$func_split_equals_lhs" \
1739 "$func_split_equals_rhs" ${1+"$@"}
1740 shift
1741 ;;
1742
1743 # Separate optargs to short options:
1744 -W*)
1745 func_split_short_opt "$_G_opt"
1746 set dummy "$func_split_short_opt_name" \
1747 "$func_split_short_opt_arg" ${1+"$@"}
1748 shift
1749 ;;
1750
1751 # Separate non-argument short options:
1752 -\?*|-h*|-v*|-x*)
1753 func_split_short_opt "$_G_opt"
1754 set dummy "$func_split_short_opt_name" \
1755 "-$func_split_short_opt_arg" ${1+"$@"}
1756 shift
1757 ;;
1758
1759 --) break ;;
1760 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1761 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1762 esac
1763 done
1764
1765 # save modified positional parameters for caller
1766 func_quote_for_eval ${1+"$@"}
1767 func_parse_options_result=$func_quote_for_eval_result
1768 }
1769
1770
1771 # func_validate_options [ARG]...
1772 # ------------------------------
1773 # Perform any sanity checks on option settings and/or unconsumed
1774 # arguments.
1775 func_hookable func_validate_options
1776 func_validate_options ()
1777 {
1778 $debug_cmd
1779
1780 # Display all warnings if -W was not given.
1781 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
1782
1783 func_run_hooks func_validate_options ${1+"$@"}
1784
1785 # Bail if the options were screwed!
1786 $exit_cmd $EXIT_FAILURE
1787
1788 # save modified positional parameters for caller
1789 func_validate_options_result=$func_run_hooks_result
1790 }
1791
1792
1793
1794 ## ----------------- ##
1795 ## Helper functions. ##
1796 ## ----------------- ##
1797
1798 # This section contains the helper functions used by the rest of the
1799 # hookable option parser framework in ascii-betical order.
1800
1801
1802 # func_fatal_help ARG...
1803 # ----------------------
1804 # Echo program name prefixed message to standard error, followed by
1805 # a help hint, and exit.
1806 func_fatal_help ()
1807 {
1808 $debug_cmd
1809
1810 eval \$ECHO \""Usage: $usage"\"
1811 eval \$ECHO \""$fatal_help"\"
1812 func_error ${1+"$@"}
1813 exit $EXIT_FAILURE
1814 }
1815
1816
1817 # func_help
1818 # ---------
1819 # Echo long help message to standard output and exit.
1820 func_help ()
1821 {
1822 $debug_cmd
1823
1824 func_usage_message
1825 $ECHO "$long_help_message"
1826 exit 0
1827 }
1828
1829
1830 # func_missing_arg ARGNAME
1831 # ------------------------
1832 # Echo program name prefixed message to standard error and set global
1833 # exit_cmd.
1834 func_missing_arg ()
1835 {
1836 $debug_cmd
1837
1838 func_error "Missing argument for '$1'."
1839 exit_cmd=exit
1840 }
1841
1842
1843 # func_split_equals STRING
1844 # ------------------------
1845 # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
1846 # splitting STRING at the '=' sign.
1847 test -z "$_G_HAVE_XSI_OPS" \
1848 && (eval 'x=a/b/c;
1849 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
1850 && _G_HAVE_XSI_OPS=yes
1851
1852 if test yes = "$_G_HAVE_XSI_OPS"
1853 then
1854 # This is an XSI compatible shell, allowing a faster implementation...
1855 eval 'func_split_equals ()
1856 {
1857 $debug_cmd
1858
1859 func_split_equals_lhs=${1%%=*}
1860 func_split_equals_rhs=${1#*=}
1861 test "x$func_split_equals_lhs" = "x$1" \
1862 && func_split_equals_rhs=
1863 }'
1864 else
1865 # ...otherwise fall back to using expr, which is often a shell builtin.
1866 func_split_equals ()
1867 {
1868 $debug_cmd
1869
1870 func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
1871 func_split_equals_rhs=
1872 test "x$func_split_equals_lhs" = "x$1" \
1873 || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
1874 }
1875 fi #func_split_equals
1876
1877
1878 # func_split_short_opt SHORTOPT
1879 # -----------------------------
1880 # Set func_split_short_opt_name and func_split_short_opt_arg shell
1881 # variables after splitting SHORTOPT after the 2nd character.
1882 if test yes = "$_G_HAVE_XSI_OPS"
1883 then
1884 # This is an XSI compatible shell, allowing a faster implementation...
1885 eval 'func_split_short_opt ()
1886 {
1887 $debug_cmd
1888
1889 func_split_short_opt_arg=${1#??}
1890 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1891 }'
1892 else
1893 # ...otherwise fall back to using expr, which is often a shell builtin.
1894 func_split_short_opt ()
1895 {
1896 $debug_cmd
1897
1898 func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
1899 func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
1900 }
1901 fi #func_split_short_opt
1902
1903
1904 # func_usage
1905 # ----------
1906 # Echo short help message to standard output and exit.
1907 func_usage ()
1908 {
1909 $debug_cmd
1910
1911 func_usage_message
1912 $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
1913 exit 0
1914 }
1915
1916
1917 # func_usage_message
1918 # ------------------
1919 # Echo short help message to standard output.
1920 func_usage_message ()
1921 {
1922 $debug_cmd
1923
1924 eval \$ECHO \""Usage: $usage"\"
1925 echo
1926 $SED -n 's|^# ||
1927 /^Written by/{
1928 x;p;x
1929 }
1930 h
1931 /^Written by/q' < "$progpath"
1932 echo
1933 eval \$ECHO \""$usage_message"\"
1934 }
1935
1936
1937 # func_version
1938 # ------------
1939 # Echo version message to standard output and exit.
1940 func_version ()
1941 {
1942 $debug_cmd
1943
1944 printf '%s\n' "$progname $scriptversion"
1945 $SED -n '
1946 /(C)/!b go
1947 :more
1948 /\./!{
1949 N
1950 s|\n# | |
1951 b more
1952 }
1953 :go
1954 /^# Written by /,/# warranty; / {
1955 s|^# ||
1956 s|^# *$||
1957 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
1958 p
1959 }
1960 /^# Written by / {
1961 s|^# ||
1962 p
1963 }
1964 /^warranty; /q' < "$progpath"
1965
1966 exit $?
1967 }
1968
1969
1970 # Local variables:
1971 # mode: shell-script
1972 # sh-indentation: 2
1973 # eval: (add-hook 'before-save-hook 'time-stamp)
1974 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1975 # time-stamp-time-zone: "UTC"
1976 # End:
1977
1978 # Set a version string.
1979 scriptversion='(GNU libtool) 2.4.6'
1980
1981
1982 # func_echo ARG...
1983 # ----------------
1984 # Libtool also displays the current mode in messages, so override
1985 # funclib.sh func_echo with this custom definition.
1986 func_echo ()
1987 {
1988 $debug_cmd
1989
1990 _G_message=$*
1991
1992 func_echo_IFS=$IFS
1993 IFS=$nl
1994 for _G_line in $_G_message; do
1995 IFS=$func_echo_IFS
1996 $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
1997 done
1998 IFS=$func_echo_IFS
1999 }
2000
2001
2002 # func_warning ARG...
2003 # -------------------
2004 # Libtool warnings are not categorized, so override funclib.sh
2005 # func_warning with this simpler definition.
2006 func_warning ()
2007 {
2008 $debug_cmd
2009
2010 $warning_func ${1+"$@"}
2011 }
2012
2013
2014 ## ---------------- ##
2015 ## Options parsing. ##
2016 ## ---------------- ##
2017
2018 # Hook in the functions to make sure our own options are parsed during
2019 # the option parsing loop.
2020
2021 usage='$progpath [OPTION]... [MODE-ARG]...'
2022
2023 # Short help message in response to '-h'.
2024 usage_message="Options:
2025 --config show all configuration variables
2026 --debug enable verbose shell tracing
2027 -n, --dry-run display commands without modifying any files
2028 --features display basic configuration information and exit
2029 --mode=MODE use operation mode MODE
2030 --no-warnings equivalent to '-Wnone'
2031 --preserve-dup-deps don't remove duplicate dependency libraries
2032 --quiet, --silent don't print informational messages
2033 --tag=TAG use configuration variables from tag TAG
2034 -v, --verbose print more informational messages than default
2035 --version print version information
2036 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
2037 -h, --help, --help-all print short, long, or detailed help message
2038 "
2039
2040 # Additional text appended to 'usage_message' in response to '--help'.
2041 func_help ()
2042 {
2043 $debug_cmd
2044
2045 func_usage_message
2046 $ECHO "$long_help_message
2047
2048 MODE must be one of the following:
2049
2050 clean remove files from the build directory
2051 compile compile a source file into a libtool object
2052 execute automatically set library path, then run a program
2053 finish complete the installation of libtool libraries
2054 install install libraries or executables
2055 link create a library or an executable
2056 uninstall remove libraries from an installed directory
2057
2058 MODE-ARGS vary depending on the MODE. When passed as first option,
2059 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2060 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2061
2062 When reporting a bug, please describe a test case to reproduce it and
2063 include the following information:
2064
2065 host-triplet: $host
2066 shell: $SHELL
2067 compiler: $LTCC
2068 compiler flags: $LTCFLAGS
2069 linker: $LD (gnu? $with_gnu_ld)
2070 version: $progname (GNU libtool) 2.4.6
2071 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2072 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2073
2074 Report bugs to <bug-libtool@gnu.org>.
2075 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2076 General help using GNU software: <http://www.gnu.org/gethelp/>."
2077 exit 0
2078 }
2079
2080
2081 # func_lo2o OBJECT-NAME
2082 # ---------------------
2083 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2084 # object suffix.
2085
2086 lo2o=s/\\.lo\$/.$objext/
2087 o2lo=s/\\.$objext\$/.lo/
2088
2089 if test yes = "$_G_HAVE_XSI_OPS"; then
2090 eval 'func_lo2o ()
2091 {
2092 case $1 in
2093 *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2094 * ) func_lo2o_result=$1 ;;
2095 esac
2096 }'
2097
2098 # func_xform LIBOBJ-OR-SOURCE
2099 # ---------------------------
2100 # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2101 # suffix to a '.lo' libtool-object suffix.
2102 eval 'func_xform ()
2103 {
2104 func_xform_result=${1%.*}.lo
2105 }'
2106 else
2107 # ...otherwise fall back to using sed.
2108 func_lo2o ()
2109 {
2110 func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2111 }
2112
2113 func_xform ()
2114 {
2115 func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2116 }
2117 fi
2118
2119
2120 # func_fatal_configuration ARG...
2121 # -------------------------------
2122 # Echo program name prefixed message to standard error, followed by
2123 # a configuration failure hint, and exit.
2124 func_fatal_configuration ()
2125 {
2126 func__fatal_error ${1+"$@"} \
2127 "See the $PACKAGE documentation for more information." \
2128 "Fatal configuration error."
2129 }
2130
2131
2132 # func_config
2133 # -----------
2134 # Display the configuration for all the tags in this script.
2135 func_config ()
2136 {
2137 re_begincf='^# ### BEGIN LIBTOOL'
2138 re_endcf='^# ### END LIBTOOL'
2139
2140 # Default configuration.
2141 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
2142
2143 # Now print the configurations for the tags.
2144 for tagname in $taglist; do
2145 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
2146 done
2147
2148 exit $?
2149 }
2150
2151
2152 # func_features
2153 # -------------
2154 # Display the features supported by this script.
2155 func_features ()
2156 {
2157 echo "host: $host"
2158 if test yes = "$build_libtool_libs"; then
2159 echo "enable shared libraries"
2160 else
2161 echo "disable shared libraries"
2162 fi
2163 if test yes = "$build_old_libs"; then
2164 echo "enable static libraries"
2165 else
2166 echo "disable static libraries"
2167 fi
2168
2169 exit $?
2170 }
2171
2172
2173 # func_enable_tag TAGNAME
2174 # -----------------------
2175 # Verify that TAGNAME is valid, and either flag an error and exit, or
2176 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
2177 # variable here.
2178 func_enable_tag ()
2179 {
2180 # Global variable:
2181 tagname=$1
2182
2183 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2184 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2185 sed_extractcf=/$re_begincf/,/$re_endcf/p
2186
2187 # Validate tagname.
2188 case $tagname in
2189 *[!-_A-Za-z0-9,/]*)
2190 func_fatal_error "invalid tag name: $tagname"
2191 ;;
2192 esac
2193
2194 # Don't test for the "default" C tag, as we know it's
2195 # there but not specially marked.
2196 case $tagname in
2197 CC) ;;
2198 *)
2199 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2200 taglist="$taglist $tagname"
2201
2202 # Evaluate the configuration. Be careful to quote the path
2203 # and the sed script, to avoid splitting on whitespace, but
2204 # also don't use non-portable quotes within backquotes within
2205 # quotes we have to do it in 2 steps:
2206 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2207 eval "$extractedcf"
2208 else
2209 func_error "ignoring unknown tag $tagname"
2210 fi
2211 ;;
2212 esac
2213 }
2214
2215
2216 # func_check_version_match
2217 # ------------------------
2218 # Ensure that we are using m4 macros, and libtool script from the same
2219 # release of libtool.
2220 func_check_version_match ()
2221 {
2222 if test "$package_revision" != "$macro_revision"; then
2223 if test "$VERSION" != "$macro_version"; then
2224 if test -z "$macro_version"; then
2225 cat >&2 <<_LT_EOF
2226 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2227 $progname: definition of this LT_INIT comes from an older release.
2228 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2229 $progname: and run autoconf again.
2230 _LT_EOF
2231 else
2232 cat >&2 <<_LT_EOF
2233 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2234 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
2235 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2236 $progname: and run autoconf again.
2237 _LT_EOF
2238 fi
2239 else
2240 cat >&2 <<_LT_EOF
2241 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
2242 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
2243 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
2244 $progname: of $PACKAGE $VERSION and run autoconf again.
2245 _LT_EOF
2246 fi
2247
2248 exit $EXIT_MISMATCH
2249 fi
2250 }
2251
2252
2253 # libtool_options_prep [ARG]...
2254 # -----------------------------
2255 # Preparation for options parsed by libtool.
2256 libtool_options_prep ()
2257 {
2258 $debug_mode
2259
2260 # Option defaults:
2261 opt_config=false
2262 opt_dlopen=
2263 opt_dry_run=false
2264 opt_help=false
2265 opt_mode=
2266 opt_preserve_dup_deps=false
2267 opt_quiet=false
2268
2269 nonopt=
2270 preserve_args=
2271
2272 # Shorthand for --mode=foo, only valid as the first argument
2273 case $1 in
2274 clean|clea|cle|cl)
2275 shift; set dummy --mode clean ${1+"$@"}; shift
2276 ;;
2277 compile|compil|compi|comp|com|co|c)
2278 shift; set dummy --mode compile ${1+"$@"}; shift
2279 ;;
2280 execute|execut|execu|exec|exe|ex|e)
2281 shift; set dummy --mode execute ${1+"$@"}; shift
2282 ;;
2283 finish|finis|fini|fin|fi|f)
2284 shift; set dummy --mode finish ${1+"$@"}; shift
2285 ;;
2286 install|instal|insta|inst|ins|in|i)
2287 shift; set dummy --mode install ${1+"$@"}; shift
2288 ;;
2289 link|lin|li|l)
2290 shift; set dummy --mode link ${1+"$@"}; shift
2291 ;;
2292 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2293 shift; set dummy --mode uninstall ${1+"$@"}; shift
2294 ;;
2295 esac
2296
2297 # Pass back the list of options.
2298 func_quote_for_eval ${1+"$@"}
2299 libtool_options_prep_result=$func_quote_for_eval_result
2300 }
2301 func_add_hook func_options_prep libtool_options_prep
2302
2303
2304 # libtool_parse_options [ARG]...
2305 # ---------------------------------
2306 # Provide handling for libtool specific options.
2307 libtool_parse_options ()
2308 {
2309 $debug_cmd
2310
2311 # Perform our own loop to consume as many options as possible in
2312 # each iteration.
2313 while test $# -gt 0; do
2314 _G_opt=$1
2315 shift
2316 case $_G_opt in
2317 --dry-run|--dryrun|-n)
2318 opt_dry_run=:
2319 ;;
2320
2321 --config) func_config ;;
2322
2323 --dlopen|-dlopen)
2324 opt_dlopen="${opt_dlopen+$opt_dlopen
2325 }$1"
2326 shift
2327 ;;
2328
2329 --preserve-dup-deps)
2330 opt_preserve_dup_deps=: ;;
2331
2332 --features) func_features ;;
2333
2334 --finish) set dummy --mode finish ${1+"$@"}; shift ;;
2335
2336 --help) opt_help=: ;;
2337
2338 --help-all) opt_help=': help-all' ;;
2339
2340 --mode) test $# = 0 && func_missing_arg $_G_opt && break
2341 opt_mode=$1
2342 case $1 in
2343 # Valid mode arguments:
2344 clean|compile|execute|finish|install|link|relink|uninstall) ;;
2345
2346 # Catch anything else as an error
2347 *) func_error "invalid argument for $_G_opt"
2348 exit_cmd=exit
2349 break
2350 ;;
2351 esac
2352 shift
2353 ;;
2354
2355 --no-silent|--no-quiet)
2356 opt_quiet=false
2357 func_append preserve_args " $_G_opt"
2358 ;;
2359
2360 --no-warnings|--no-warning|--no-warn)
2361 opt_warning=false
2362 func_append preserve_args " $_G_opt"
2363 ;;
2364
2365 --no-verbose)
2366 opt_verbose=false
2367 func_append preserve_args " $_G_opt"
2368 ;;
2369
2370 --silent|--quiet)
2371 opt_quiet=:
2372 opt_verbose=false
2373 func_append preserve_args " $_G_opt"
2374 ;;
2375
2376 --tag) test $# = 0 && func_missing_arg $_G_opt && break
2377 opt_tag=$1
2378 func_append preserve_args " $_G_opt $1"
2379 func_enable_tag "$1"
2380 shift
2381 ;;
2382
2383 --verbose|-v) opt_quiet=false
2384 opt_verbose=:
2385 func_append preserve_args " $_G_opt"
2386 ;;
2387
2388 # An option not handled by this hook function:
2389 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2390 esac
2391 done
2392
2393
2394 # save modified positional parameters for caller
2395 func_quote_for_eval ${1+"$@"}
2396 libtool_parse_options_result=$func_quote_for_eval_result
2397 }
2398 func_add_hook func_parse_options libtool_parse_options
2399
2400
2401
2402 # libtool_validate_options [ARG]...
2403 # ---------------------------------
2404 # Perform any sanity checks on option settings and/or unconsumed
2405 # arguments.
2406 libtool_validate_options ()
2407 {
2408 # save first non-option argument
2409 if test 0 -lt $#; then
2410 nonopt=$1
2411 shift
2412 fi
2413
2414 # preserve --debug
2415 test : = "$debug_cmd" || func_append preserve_args " --debug"
2416
2417 case $host in
2418 # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
2419 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
2420 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
2421 # don't eliminate duplications in $postdeps and $predeps
2422 opt_duplicate_compiler_generated_deps=:
2423 ;;
2424 *)
2425 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2426 ;;
2427 esac
2428
2429 $opt_help || {
2430 # Sanity checks first:
2431 func_check_version_match
2432
2433 test yes != "$build_libtool_libs" \
2434 && test yes != "$build_old_libs" \
2435 && func_fatal_configuration "not configured to build any kind of library"
2436
2437 # Darwin sucks
2438 eval std_shrext=\"$shrext_cmds\"
2439
2440 # Only execute mode is allowed to have -dlopen flags.
2441 if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2442 func_error "unrecognized option '-dlopen'"
2443 $ECHO "$help" 1>&2
2444 exit $EXIT_FAILURE
2445 fi
2446
2447 # Change the help message to a mode-specific one.
2448 generic_help=$help
2449 help="Try '$progname --help --mode=$opt_mode' for more information."
2450 }
2451
2452 # Pass back the unparsed argument list
2453 func_quote_for_eval ${1+"$@"}
2454 libtool_validate_options_result=$func_quote_for_eval_result
2455 }
2456 func_add_hook func_validate_options libtool_validate_options
2457
2458
2459 # Process options as early as possible so that --help and --version
2460 # can return quickly.
2461 func_options ${1+"$@"}
2462 eval set dummy "$func_options_result"; shift
2463
2464
2465
2466 ## ----------- ##
2467 ## Main. ##
2468 ## ----------- ##
2469
2470 magic='%%%MAGIC variable%%%'
2471 magic_exe='%%%MAGIC EXE variable%%%'
2472
2473 # Global variables.
2474 extracted_archives=
2475 extracted_serial=0
2476
2477 # If this variable is set in any of the actions, the command in it
2478 # will be execed at the end. This prevents here-documents from being
2479 # left over by shells.
2480 exec_cmd=
2481
2482
2483 # A function that is used when there is no print builtin or printf.
2484 func_fallback_echo ()
2485 {
2486 eval 'cat <<_LTECHO_EOF
2487 $1
2488 _LTECHO_EOF'
2489 }
2490
2491 # func_generated_by_libtool
2492 # True iff stdin has been generated by Libtool. This function is only
2493 # a basic sanity check; it will hardly flush out determined imposters.
2494 func_generated_by_libtool_p ()
2495 {
2496 $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2497 }
2498
2499 # func_lalib_p file
2500 # True iff FILE is a libtool '.la' library or '.lo' object file.
2501 # This function is only a basic sanity check; it will hardly flush out
2502 # determined imposters.
2503 func_lalib_p ()
2504 {
2505 test -f "$1" &&
2506 $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
2507 }
2508
2509 # func_lalib_unsafe_p file
2510 # True iff FILE is a libtool '.la' library or '.lo' object file.
2511 # This function implements the same check as func_lalib_p without
2512 # resorting to external programs. To this end, it redirects stdin and
2513 # closes it afterwards, without saving the original file descriptor.
2514 # As a safety measure, use it only where a negative result would be
2515 # fatal anyway. Works if 'file' does not exist.
2516 func_lalib_unsafe_p ()
2517 {
2518 lalib_p=no
2519 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
2520 for lalib_p_l in 1 2 3 4
2521 do
2522 read lalib_p_line
2523 case $lalib_p_line in
2524 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
2525 esac
2526 done
2527 exec 0<&5 5<&-
2528 fi
2529 test yes = "$lalib_p"
2530 }
2531
2532 # func_ltwrapper_script_p file
2533 # True iff FILE is a libtool wrapper script
2534 # This function is only a basic sanity check; it will hardly flush out
2535 # determined imposters.
2536 func_ltwrapper_script_p ()
2537 {
2538 test -f "$1" &&
2539 $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
2540 }
2541
2542 # func_ltwrapper_executable_p file
2543 # True iff FILE is a libtool wrapper executable
2544 # This function is only a basic sanity check; it will hardly flush out
2545 # determined imposters.
2546 func_ltwrapper_executable_p ()
2547 {
2548 func_ltwrapper_exec_suffix=
2549 case $1 in
2550 *.exe) ;;
2551 *) func_ltwrapper_exec_suffix=.exe ;;
2552 esac
2553 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
2554 }
2555
2556 # func_ltwrapper_scriptname file
2557 # Assumes file is an ltwrapper_executable
2558 # uses $file to determine the appropriate filename for a
2559 # temporary ltwrapper_script.
2560 func_ltwrapper_scriptname ()
2561 {
2562 func_dirname_and_basename "$1" "" "."
2563 func_stripname '' '.exe' "$func_basename_result"
2564 func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
2565 }
2566
2567 # func_ltwrapper_p file
2568 # True iff FILE is a libtool wrapper script or wrapper executable
2569 # This function is only a basic sanity check; it will hardly flush out
2570 # determined imposters.
2571 func_ltwrapper_p ()
2572 {
2573 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
2574 }
2575
2576
2577 # func_execute_cmds commands fail_cmd
2578 # Execute tilde-delimited COMMANDS.
2579 # If FAIL_CMD is given, eval that upon failure.
2580 # FAIL_CMD may read-access the current command in variable CMD!
2581 func_execute_cmds ()
2582 {
2583 $debug_cmd
2584
2585 save_ifs=$IFS; IFS='~'
2586 for cmd in $1; do
2587 IFS=$sp$nl
2588 eval cmd=\"$cmd\"
2589 IFS=$save_ifs
2590 func_show_eval "$cmd" "${2-:}"
2591 done
2592 IFS=$save_ifs
2593 }
2594
2595
2596 # func_source file
2597 # Source FILE, adding directory component if necessary.
2598 # Note that it is not necessary on cygwin/mingw to append a dot to
2599 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
2600 # behavior happens only for exec(3), not for open(2)! Also, sourcing
2601 # 'FILE.' does not work on cygwin managed mounts.
2602 func_source ()
2603 {
2604 $debug_cmd
2605
2606 case $1 in
2607 */* | *\\*) . "$1" ;;
2608 *) . "./$1" ;;
2609 esac
2610 }
2611
2612
2613 # func_resolve_sysroot PATH
2614 # Replace a leading = in PATH with a sysroot. Store the result into
2615 # func_resolve_sysroot_result
2616 func_resolve_sysroot ()
2617 {
2618 func_resolve_sysroot_result=$1
2619 case $func_resolve_sysroot_result in
2620 =*)
2621 func_stripname '=' '' "$func_resolve_sysroot_result"
2622 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
2623 ;;
2624 esac
2625 }
2626
2627 # func_replace_sysroot PATH
2628 # If PATH begins with the sysroot, replace it with = and
2629 # store the result into func_replace_sysroot_result.
2630 func_replace_sysroot ()
2631 {
2632 case $lt_sysroot:$1 in
2633 ?*:"$lt_sysroot"*)
2634 func_stripname "$lt_sysroot" '' "$1"
2635 func_replace_sysroot_result='='$func_stripname_result
2636 ;;
2637 *)
2638 # Including no sysroot.
2639 func_replace_sysroot_result=$1
2640 ;;
2641 esac
2642 }
2643
2644 # func_infer_tag arg
2645 # Infer tagged configuration to use if any are available and
2646 # if one wasn't chosen via the "--tag" command line option.
2647 # Only attempt this if the compiler in the base compile
2648 # command doesn't match the default compiler.
2649 # arg is usually of the form 'gcc ...'
2650 func_infer_tag ()
2651 {
2652 $debug_cmd
2653
2654 if test -n "$available_tags" && test -z "$tagname"; then
2655 CC_quoted=
2656 for arg in $CC; do
2657 func_append_quoted CC_quoted "$arg"
2658 done
2659 CC_expanded=`func_echo_all $CC`
2660 CC_quoted_expanded=`func_echo_all $CC_quoted`
2661 case $@ in
2662 # Blanks in the command may have been stripped by the calling shell,
2663 # but not from the CC environment variable when configure was run.
2664 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
2665 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
2666 # Blanks at the start of $base_compile will cause this to fail
2667 # if we don't check for them as well.
2668 *)
2669 for z in $available_tags; do
2670 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
2671 # Evaluate the configuration.
2672 eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
2673 CC_quoted=
2674 for arg in $CC; do
2675 # Double-quote args containing other shell metacharacters.
2676 func_append_quoted CC_quoted "$arg"
2677 done
2678 CC_expanded=`func_echo_all $CC`
2679 CC_quoted_expanded=`func_echo_all $CC_quoted`
2680 case "$@ " in
2681 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
2682 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
2683 # The compiler in the base compile command matches
2684 # the one in the tagged configuration.
2685 # Assume this is the tagged configuration we want.
2686 tagname=$z
2687 break
2688 ;;
2689 esac
2690 fi
2691 done
2692 # If $tagname still isn't set, then no tagged configuration
2693 # was found and let the user know that the "--tag" command
2694 # line option must be used.
2695 if test -z "$tagname"; then
2696 func_echo "unable to infer tagged configuration"
2697 func_fatal_error "specify a tag with '--tag'"
2698 # else
2699 # func_verbose "using $tagname tagged configuration"
2700 fi
2701 ;;
2702 esac
2703 fi
2704 }
2705
2706
2707
2708 # func_write_libtool_object output_name pic_name nonpic_name
2709 # Create a libtool object file (analogous to a ".la" file),
2710 # but don't create it if we're doing a dry run.
2711 func_write_libtool_object ()
2712 {
2713 write_libobj=$1
2714 if test yes = "$build_libtool_libs"; then
2715 write_lobj=\'$2\'
2716 else
2717 write_lobj=none
2718 fi
2719
2720 if test yes = "$build_old_libs"; then
2721 write_oldobj=\'$3\'
2722 else
2723 write_oldobj=none
2724 fi
2725
2726 $opt_dry_run || {
2727 cat >${write_libobj}T <<EOF
2728 # $write_libobj - a libtool object file
2729 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
2730 #
2731 # Please DO NOT delete this file!
2732 # It is necessary for linking the library.
2733
2734 # Name of the PIC object.
2735 pic_object=$write_lobj
2736
2737 # Name of the non-PIC object
2738 non_pic_object=$write_oldobj
2739
2740 EOF
2741 $MV "${write_libobj}T" "$write_libobj"
2742 }
2743 }
2744
2745
2746 ##################################################
2747 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
2748 ##################################################
2749
2750 # func_convert_core_file_wine_to_w32 ARG
2751 # Helper function used by file name conversion functions when $build is *nix,
2752 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
2753 # correctly configured wine environment available, with the winepath program
2754 # in $build's $PATH.
2755 #
2756 # ARG is the $build file name to be converted to w32 format.
2757 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
2758 # be empty on error (or when ARG is empty)
2759 func_convert_core_file_wine_to_w32 ()
2760 {
2761 $debug_cmd
2762
2763 func_convert_core_file_wine_to_w32_result=$1
2764 if test -n "$1"; then
2765 # Unfortunately, winepath does not exit with a non-zero error code, so we
2766 # are forced to check the contents of stdout. On the other hand, if the
2767 # command is not found, the shell will set an exit code of 127 and print
2768 # *an error message* to stdout. So we must check for both error code of
2769 # zero AND non-empty stdout, which explains the odd construction:
2770 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
2771 if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
2772 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
2773 $SED -e "$sed_naive_backslashify"`
2774 else
2775 func_convert_core_file_wine_to_w32_result=
2776 fi
2777 fi
2778 }
2779 # end: func_convert_core_file_wine_to_w32
2780
2781
2782 # func_convert_core_path_wine_to_w32 ARG
2783 # Helper function used by path conversion functions when $build is *nix, and
2784 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
2785 # configured wine environment available, with the winepath program in $build's
2786 # $PATH. Assumes ARG has no leading or trailing path separator characters.
2787 #
2788 # ARG is path to be converted from $build format to win32.
2789 # Result is available in $func_convert_core_path_wine_to_w32_result.
2790 # Unconvertible file (directory) names in ARG are skipped; if no directory names
2791 # are convertible, then the result may be empty.
2792 func_convert_core_path_wine_to_w32 ()
2793 {
2794 $debug_cmd
2795
2796 # unfortunately, winepath doesn't convert paths, only file names
2797 func_convert_core_path_wine_to_w32_result=
2798 if test -n "$1"; then
2799 oldIFS=$IFS
2800 IFS=:
2801 for func_convert_core_path_wine_to_w32_f in $1; do
2802 IFS=$oldIFS
2803 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
2804 if test -n "$func_convert_core_file_wine_to_w32_result"; then
2805 if test -z "$func_convert_core_path_wine_to_w32_result"; then
2806 func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
2807 else
2808 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
2809 fi
2810 fi
2811 done
2812 IFS=$oldIFS
2813 fi
2814 }
2815 # end: func_convert_core_path_wine_to_w32
2816
2817
2818 # func_cygpath ARGS...
2819 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
2820 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
2821 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
2822 # (2), returns the Cygwin file name or path in func_cygpath_result (input
2823 # file name or path is assumed to be in w32 format, as previously converted
2824 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
2825 # or path in func_cygpath_result (input file name or path is assumed to be in
2826 # Cygwin format). Returns an empty string on error.
2827 #
2828 # ARGS are passed to cygpath, with the last one being the file name or path to
2829 # be converted.
2830 #
2831 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
2832 # environment variable; do not put it in $PATH.
2833 func_cygpath ()
2834 {
2835 $debug_cmd
2836
2837 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
2838 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
2839 if test "$?" -ne 0; then
2840 # on failure, ensure result is empty
2841 func_cygpath_result=
2842 fi
2843 else
2844 func_cygpath_result=
2845 func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
2846 fi
2847 }
2848 #end: func_cygpath
2849
2850
2851 # func_convert_core_msys_to_w32 ARG
2852 # Convert file name or path ARG from MSYS format to w32 format. Return
2853 # result in func_convert_core_msys_to_w32_result.
2854 func_convert_core_msys_to_w32 ()
2855 {
2856 $debug_cmd
2857
2858 # awkward: cmd appends spaces to result
2859 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2860 $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
2861 }
2862 #end: func_convert_core_msys_to_w32
2863
2864
2865 # func_convert_file_check ARG1 ARG2
2866 # Verify that ARG1 (a file name in $build format) was converted to $host
2867 # format in ARG2. Otherwise, emit an error message, but continue (resetting
2868 # func_to_host_file_result to ARG1).
2869 func_convert_file_check ()
2870 {
2871 $debug_cmd
2872
2873 if test -z "$2" && test -n "$1"; then
2874 func_error "Could not determine host file name corresponding to"
2875 func_error " '$1'"
2876 func_error "Continuing, but uninstalled executables may not work."
2877 # Fallback:
2878 func_to_host_file_result=$1
2879 fi
2880 }
2881 # end func_convert_file_check
2882
2883
2884 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
2885 # Verify that FROM_PATH (a path in $build format) was converted to $host
2886 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
2887 # func_to_host_file_result to a simplistic fallback value (see below).
2888 func_convert_path_check ()
2889 {
2890 $debug_cmd
2891
2892 if test -z "$4" && test -n "$3"; then
2893 func_error "Could not determine the host path corresponding to"
2894 func_error " '$3'"
2895 func_error "Continuing, but uninstalled executables may not work."
2896 # Fallback. This is a deliberately simplistic "conversion" and
2897 # should not be "improved". See libtool.info.
2898 if test "x$1" != "x$2"; then
2899 lt_replace_pathsep_chars="s|$1|$2|g"
2900 func_to_host_path_result=`echo "$3" |
2901 $SED -e "$lt_replace_pathsep_chars"`
2902 else
2903 func_to_host_path_result=$3
2904 fi
2905 fi
2906 }
2907 # end func_convert_path_check
2908
2909
2910 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
2911 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
2912 # and appending REPL if ORIG matches BACKPAT.
2913 func_convert_path_front_back_pathsep ()
2914 {
2915 $debug_cmd
2916
2917 case $4 in
2918 $1 ) func_to_host_path_result=$3$func_to_host_path_result
2919 ;;
2920 esac
2921 case $4 in
2922 $2 ) func_append func_to_host_path_result "$3"
2923 ;;
2924 esac
2925 }
2926 # end func_convert_path_front_back_pathsep
2927
2928
2929 ##################################################
2930 # $build to $host FILE NAME CONVERSION FUNCTIONS #
2931 ##################################################
2932 # invoked via '$to_host_file_cmd ARG'
2933 #
2934 # In each case, ARG is the path to be converted from $build to $host format.
2935 # Result will be available in $func_to_host_file_result.
2936
2937
2938 # func_to_host_file ARG
2939 # Converts the file name ARG from $build format to $host format. Return result
2940 # in func_to_host_file_result.
2941 func_to_host_file ()
2942 {
2943 $debug_cmd
2944
2945 $to_host_file_cmd "$1"
2946 }
2947 # end func_to_host_file
2948
2949
2950 # func_to_tool_file ARG LAZY
2951 # converts the file name ARG from $build format to toolchain format. Return
2952 # result in func_to_tool_file_result. If the conversion in use is listed
2953 # in (the comma separated) LAZY, no conversion takes place.
2954 func_to_tool_file ()
2955 {
2956 $debug_cmd
2957
2958 case ,$2, in
2959 *,"$to_tool_file_cmd",*)
2960 func_to_tool_file_result=$1
2961 ;;
2962 *)
2963 $to_tool_file_cmd "$1"
2964 func_to_tool_file_result=$func_to_host_file_result
2965 ;;
2966 esac
2967 }
2968 # end func_to_tool_file
2969
2970
2971 # func_convert_file_noop ARG
2972 # Copy ARG to func_to_host_file_result.
2973 func_convert_file_noop ()
2974 {
2975 func_to_host_file_result=$1
2976 }
2977 # end func_convert_file_noop
2978
2979
2980 # func_convert_file_msys_to_w32 ARG
2981 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
2982 # conversion to w32 is not available inside the cwrapper. Returns result in
2983 # func_to_host_file_result.
2984 func_convert_file_msys_to_w32 ()
2985 {
2986 $debug_cmd
2987
2988 func_to_host_file_result=$1
2989 if test -n "$1"; then
2990 func_convert_core_msys_to_w32 "$1"
2991 func_to_host_file_result=$func_convert_core_msys_to_w32_result
2992 fi
2993 func_convert_file_check "$1" "$func_to_host_file_result"
2994 }
2995 # end func_convert_file_msys_to_w32
2996
2997
2998 # func_convert_file_cygwin_to_w32 ARG
2999 # Convert file name ARG from Cygwin to w32 format. Returns result in
3000 # func_to_host_file_result.
3001 func_convert_file_cygwin_to_w32 ()
3002 {
3003 $debug_cmd
3004
3005 func_to_host_file_result=$1
3006 if test -n "$1"; then
3007 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
3008 # LT_CYGPATH in this case.
3009 func_to_host_file_result=`cygpath -m "$1"`
3010 fi
3011 func_convert_file_check "$1" "$func_to_host_file_result"
3012 }
3013 # end func_convert_file_cygwin_to_w32
3014
3015
3016 # func_convert_file_nix_to_w32 ARG
3017 # Convert file name ARG from *nix to w32 format. Requires a wine environment
3018 # and a working winepath. Returns result in func_to_host_file_result.
3019 func_convert_file_nix_to_w32 ()
3020 {
3021 $debug_cmd
3022
3023 func_to_host_file_result=$1
3024 if test -n "$1"; then
3025 func_convert_core_file_wine_to_w32 "$1"
3026 func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
3027 fi
3028 func_convert_file_check "$1" "$func_to_host_file_result"
3029 }
3030 # end func_convert_file_nix_to_w32
3031
3032
3033 # func_convert_file_msys_to_cygwin ARG
3034 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
3035 # Returns result in func_to_host_file_result.
3036 func_convert_file_msys_to_cygwin ()
3037 {
3038 $debug_cmd
3039
3040 func_to_host_file_result=$1
3041 if test -n "$1"; then
3042 func_convert_core_msys_to_w32 "$1"
3043 func_cygpath -u "$func_convert_core_msys_to_w32_result"
3044 func_to_host_file_result=$func_cygpath_result
3045 fi
3046 func_convert_file_check "$1" "$func_to_host_file_result"
3047 }
3048 # end func_convert_file_msys_to_cygwin
3049
3050
3051 # func_convert_file_nix_to_cygwin ARG
3052 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
3053 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
3054 # in func_to_host_file_result.
3055 func_convert_file_nix_to_cygwin ()
3056 {
3057 $debug_cmd
3058
3059 func_to_host_file_result=$1
3060 if test -n "$1"; then
3061 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
3062 func_convert_core_file_wine_to_w32 "$1"
3063 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
3064 func_to_host_file_result=$func_cygpath_result
3065 fi
3066 func_convert_file_check "$1" "$func_to_host_file_result"
3067 }
3068 # end func_convert_file_nix_to_cygwin
3069
3070
3071 #############################################
3072 # $build to $host PATH CONVERSION FUNCTIONS #
3073 #############################################
3074 # invoked via '$to_host_path_cmd ARG'
3075 #
3076 # In each case, ARG is the path to be converted from $build to $host format.
3077 # The result will be available in $func_to_host_path_result.
3078 #
3079 # Path separators are also converted from $build format to $host format. If
3080 # ARG begins or ends with a path separator character, it is preserved (but
3081 # converted to $host format) on output.
3082 #
3083 # All path conversion functions are named using the following convention:
3084 # file name conversion function : func_convert_file_X_to_Y ()
3085 # path conversion function : func_convert_path_X_to_Y ()
3086 # where, for any given $build/$host combination the 'X_to_Y' value is the
3087 # same. If conversion functions are added for new $build/$host combinations,
3088 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
3089 # will break.
3090
3091
3092 # func_init_to_host_path_cmd
3093 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
3094 # appropriate value, based on the value of $to_host_file_cmd.
3095 to_host_path_cmd=
3096 func_init_to_host_path_cmd ()
3097 {
3098 $debug_cmd
3099
3100 if test -z "$to_host_path_cmd"; then
3101 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
3102 to_host_path_cmd=func_convert_path_$func_stripname_result
3103 fi
3104 }
3105
3106
3107 # func_to_host_path ARG
3108 # Converts the path ARG from $build format to $host format. Return result
3109 # in func_to_host_path_result.
3110 func_to_host_path ()
3111 {
3112 $debug_cmd
3113
3114 func_init_to_host_path_cmd
3115 $to_host_path_cmd "$1"
3116 }
3117 # end func_to_host_path
3118
3119
3120 # func_convert_path_noop ARG
3121 # Copy ARG to func_to_host_path_result.
3122 func_convert_path_noop ()
3123 {
3124 func_to_host_path_result=$1
3125 }
3126 # end func_convert_path_noop
3127
3128
3129 # func_convert_path_msys_to_w32 ARG
3130 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
3131 # conversion to w32 is not available inside the cwrapper. Returns result in
3132 # func_to_host_path_result.
3133 func_convert_path_msys_to_w32 ()
3134 {
3135 $debug_cmd
3136
3137 func_to_host_path_result=$1
3138 if test -n "$1"; then
3139 # Remove leading and trailing path separator characters from ARG. MSYS
3140 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
3141 # and winepath ignores them completely.
3142 func_stripname : : "$1"
3143 func_to_host_path_tmp1=$func_stripname_result
3144 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3145 func_to_host_path_result=$func_convert_core_msys_to_w32_result
3146 func_convert_path_check : ";" \
3147 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3148 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3149 fi
3150 }
3151 # end func_convert_path_msys_to_w32
3152
3153
3154 # func_convert_path_cygwin_to_w32 ARG
3155 # Convert path ARG from Cygwin to w32 format. Returns result in
3156 # func_to_host_file_result.
3157 func_convert_path_cygwin_to_w32 ()
3158 {
3159 $debug_cmd
3160
3161 func_to_host_path_result=$1
3162 if test -n "$1"; then
3163 # See func_convert_path_msys_to_w32:
3164 func_stripname : : "$1"
3165 func_to_host_path_tmp1=$func_stripname_result
3166 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
3167 func_convert_path_check : ";" \
3168 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3169 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3170 fi
3171 }
3172 # end func_convert_path_cygwin_to_w32
3173
3174
3175 # func_convert_path_nix_to_w32 ARG
3176 # Convert path ARG from *nix to w32 format. Requires a wine environment and
3177 # a working winepath. Returns result in func_to_host_file_result.
3178 func_convert_path_nix_to_w32 ()
3179 {
3180 $debug_cmd
3181
3182 func_to_host_path_result=$1
3183 if test -n "$1"; then
3184 # See func_convert_path_msys_to_w32:
3185 func_stripname : : "$1"
3186 func_to_host_path_tmp1=$func_stripname_result
3187 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3188 func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
3189 func_convert_path_check : ";" \
3190 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3191 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3192 fi
3193 }
3194 # end func_convert_path_nix_to_w32
3195
3196
3197 # func_convert_path_msys_to_cygwin ARG
3198 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
3199 # Returns result in func_to_host_file_result.
3200 func_convert_path_msys_to_cygwin ()
3201 {
3202 $debug_cmd
3203
3204 func_to_host_path_result=$1
3205 if test -n "$1"; then
3206 # See func_convert_path_msys_to_w32:
3207 func_stripname : : "$1"
3208 func_to_host_path_tmp1=$func_stripname_result
3209 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3210 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
3211 func_to_host_path_result=$func_cygpath_result
3212 func_convert_path_check : : \
3213 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3214 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3215 fi
3216 }
3217 # end func_convert_path_msys_to_cygwin
3218
3219
3220 # func_convert_path_nix_to_cygwin ARG
3221 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
3222 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
3223 # func_to_host_file_result.
3224 func_convert_path_nix_to_cygwin ()
3225 {
3226 $debug_cmd
3227
3228 func_to_host_path_result=$1
3229 if test -n "$1"; then
3230 # Remove leading and trailing path separator characters from
3231 # ARG. msys behavior is inconsistent here, cygpath turns them
3232 # into '.;' and ';.', and winepath ignores them completely.
3233 func_stripname : : "$1"
3234 func_to_host_path_tmp1=$func_stripname_result
3235 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3236 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
3237 func_to_host_path_result=$func_cygpath_result
3238 func_convert_path_check : : \
3239 "$func_to_host_path_tmp1" "$func_to_host_path_result"
3240 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3241 fi
3242 }
3243 # end func_convert_path_nix_to_cygwin
3244
3245
3246 # func_dll_def_p FILE
3247 # True iff FILE is a Windows DLL '.def' file.
3248 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
3249 func_dll_def_p ()
3250 {
3251 $debug_cmd
3252
3253 func_dll_def_p_tmp=`$SED -n \
3254 -e 's/^[ ]*//' \
3255 -e '/^\(;.*\)*$/d' \
3256 -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
3257 -e q \
3258 "$1"`
3259 test DEF = "$func_dll_def_p_tmp"
3260 }
3261
3262
3263 # func_mode_compile arg...
3264 func_mode_compile ()
3265 {
3266 $debug_cmd
3267
3268 # Get the compilation command and the source file.
3269 base_compile=
3270 srcfile=$nonopt # always keep a non-empty value in "srcfile"
3271 suppress_opt=yes
3272 suppress_output=
3273 arg_mode=normal
3274 libobj=
3275 later=
3276 pie_flag=
3277
3278 for arg
3279 do
3280 case $arg_mode in
3281 arg )
3282 # do not "continue". Instead, add this to base_compile
3283 lastarg=$arg
3284 arg_mode=normal
3285 ;;
3286
3287 target )
3288 libobj=$arg
3289 arg_mode=normal
3290 continue
3291 ;;
3292
3293 normal )
3294 # Accept any command-line options.
3295 case $arg in
3296 -o)
3297 test -n "$libobj" && \
3298 func_fatal_error "you cannot specify '-o' more than once"
3299 arg_mode=target
3300 continue
3301 ;;
3302
3303 -pie | -fpie | -fPIE)
3304 func_append pie_flag " $arg"
3305 continue
3306 ;;
3307
3308 -shared | -static | -prefer-pic | -prefer-non-pic)
3309 func_append later " $arg"
3310 continue
3311 ;;
3312
3313 -no-suppress)
3314 suppress_opt=no
3315 continue
3316 ;;
3317
3318 -Xcompiler)
3319 arg_mode=arg # the next one goes into the "base_compile" arg list
3320 continue # The current "srcfile" will either be retained or
3321 ;; # replaced later. I would guess that would be a bug.
3322
3323 -Wc,*)
3324 func_stripname '-Wc,' '' "$arg"
3325 args=$func_stripname_result
3326 lastarg=
3327 save_ifs=$IFS; IFS=,
3328 for arg in $args; do
3329 IFS=$save_ifs
3330 func_append_quoted lastarg "$arg"
3331 done
3332 IFS=$save_ifs
3333 func_stripname ' ' '' "$lastarg"
3334 lastarg=$func_stripname_result
3335
3336 # Add the arguments to base_compile.
3337 func_append base_compile " $lastarg"
3338 continue
3339 ;;
3340
3341 *)
3342 # Accept the current argument as the source file.
3343 # The previous "srcfile" becomes the current argument.
3344 #
3345 lastarg=$srcfile
3346 srcfile=$arg
3347 ;;
3348 esac # case $arg
3349 ;;
3350 esac # case $arg_mode
3351
3352 # Aesthetically quote the previous argument.
3353 func_append_quoted base_compile "$lastarg"
3354 done # for arg
3355
3356 case $arg_mode in
3357 arg)
3358 func_fatal_error "you must specify an argument for -Xcompile"
3359 ;;
3360 target)
3361 func_fatal_error "you must specify a target with '-o'"
3362 ;;
3363 *)
3364 # Get the name of the library object.
3365 test -z "$libobj" && {
3366 func_basename "$srcfile"
3367 libobj=$func_basename_result
3368 }
3369 ;;
3370 esac
3371
3372 # Recognize several different file suffixes.
3373 # If the user specifies -o file.o, it is replaced with file.lo
3374 case $libobj in
3375 *.[cCFSifmso] | \
3376 *.ada | *.adb | *.ads | *.asm | \
3377 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
3378 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
3379 func_xform "$libobj"
3380 libobj=$func_xform_result
3381 ;;
3382 esac
3383
3384 case $libobj in
3385 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
3386 *)
3387 func_fatal_error "cannot determine name of library object from '$libobj'"
3388 ;;
3389 esac
3390
3391 func_infer_tag $base_compile
3392
3393 for arg in $later; do
3394 case $arg in
3395 -shared)
3396 test yes = "$build_libtool_libs" \
3397 || func_fatal_configuration "cannot build a shared library"
3398 build_old_libs=no
3399 continue
3400 ;;
3401
3402 -static)
3403 build_libtool_libs=no
3404 build_old_libs=yes
3405 continue
3406 ;;
3407
3408 -prefer-pic)
3409 pic_mode=yes
3410 continue
3411 ;;
3412
3413 -prefer-non-pic)
3414 pic_mode=no
3415 continue
3416 ;;
3417 esac
3418 done
3419
3420 func_quote_for_eval "$libobj"
3421 test "X$libobj" != "X$func_quote_for_eval_result" \
3422 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
3423 && func_warning "libobj name '$libobj' may not contain shell special characters."
3424 func_dirname_and_basename "$obj" "/" ""
3425 objname=$func_basename_result
3426 xdir=$func_dirname_result
3427 lobj=$xdir$objdir/$objname
3428
3429 test -z "$base_compile" && \
3430 func_fatal_help "you must specify a compilation command"
3431
3432 # Delete any leftover library objects.
3433 if test yes = "$build_old_libs"; then
3434 removelist="$obj $lobj $libobj ${libobj}T"
3435 else
3436 removelist="$lobj $libobj ${libobj}T"
3437 fi
3438
3439 # On Cygwin there's no "real" PIC flag so we must build both object types
3440 case $host_os in
3441 cygwin* | mingw* | pw32* | os2* | cegcc*)
3442 pic_mode=default
3443 ;;
3444 esac
3445 if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
3446 # non-PIC code in shared libraries is not supported
3447 pic_mode=default
3448 fi
3449
3450 # Calculate the filename of the output object if compiler does
3451 # not support -o with -c
3452 if test no = "$compiler_c_o"; then
3453 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
3454 lockfile=$output_obj.lock
3455 else
3456 output_obj=
3457 need_locks=no
3458 lockfile=
3459 fi
3460
3461 # Lock this critical section if it is needed
3462 # We use this script file to make the link, it avoids creating a new file
3463 if test yes = "$need_locks"; then
3464 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3465 func_echo "Waiting for $lockfile to be removed"
3466 sleep 2
3467 done
3468 elif test warn = "$need_locks"; then
3469 if test -f "$lockfile"; then
3470 $ECHO "\
3471 *** ERROR, $lockfile exists and contains:
3472 `cat $lockfile 2>/dev/null`
3473
3474 This indicates that another process is trying to use the same
3475 temporary object file, and libtool could not work around it because
3476 your compiler does not support '-c' and '-o' together. If you
3477 repeat this compilation, it may succeed, by chance, but you had better
3478 avoid parallel builds (make -j) in this platform, or get a better
3479 compiler."
3480
3481 $opt_dry_run || $RM $removelist
3482 exit $EXIT_FAILURE
3483 fi
3484 func_append removelist " $output_obj"
3485 $ECHO "$srcfile" > "$lockfile"
3486 fi
3487
3488 $opt_dry_run || $RM $removelist
3489 func_append removelist " $lockfile"
3490 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
3491
3492 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
3493 srcfile=$func_to_tool_file_result
3494 func_quote_for_eval "$srcfile"
3495 qsrcfile=$func_quote_for_eval_result
3496
3497 # Only build a PIC object if we are building libtool libraries.
3498 if test yes = "$build_libtool_libs"; then
3499 # Without this assignment, base_compile gets emptied.
3500 fbsd_hideous_sh_bug=$base_compile
3501
3502 if test no != "$pic_mode"; then
3503 command="$base_compile $qsrcfile $pic_flag"
3504 else
3505 # Don't build PIC code
3506 command="$base_compile $qsrcfile"
3507 fi
3508
3509 func_mkdir_p "$xdir$objdir"
3510
3511 if test -z "$output_obj"; then
3512 # Place PIC objects in $objdir
3513 func_append command " -o $lobj"
3514 fi
3515
3516 func_show_eval_locale "$command" \
3517 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
3518
3519 if test warn = "$need_locks" &&
3520 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3521 $ECHO "\
3522 *** ERROR, $lockfile contains:
3523 `cat $lockfile 2>/dev/null`
3524
3525 but it should contain:
3526 $srcfile
3527
3528 This indicates that another process is trying to use the same
3529 temporary object file, and libtool could not work around it because
3530 your compiler does not support '-c' and '-o' together. If you
3531 repeat this compilation, it may succeed, by chance, but you had better
3532 avoid parallel builds (make -j) in this platform, or get a better
3533 compiler."
3534
3535 $opt_dry_run || $RM $removelist
3536 exit $EXIT_FAILURE
3537 fi
3538
3539 # Just move the object if needed, then go on to compile the next one
3540 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
3541 func_show_eval '$MV "$output_obj" "$lobj"' \
3542 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3543 fi
3544
3545 # Allow error messages only from the first compilation.
3546 if test yes = "$suppress_opt"; then
3547 suppress_output=' >/dev/null 2>&1'
3548 fi
3549 fi
3550
3551 # Only build a position-dependent object if we build old libraries.
3552 if test yes = "$build_old_libs"; then
3553 if test yes != "$pic_mode"; then
3554 # Don't build PIC code
3555 command="$base_compile $qsrcfile$pie_flag"
3556 else
3557 command="$base_compile $qsrcfile $pic_flag"
3558 fi
3559 if test yes = "$compiler_c_o"; then
3560 func_append command " -o $obj"
3561 fi
3562
3563 # Suppress compiler output if we already did a PIC compilation.
3564 func_append command "$suppress_output"
3565 func_show_eval_locale "$command" \
3566 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
3567
3568 if test warn = "$need_locks" &&
3569 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3570 $ECHO "\
3571 *** ERROR, $lockfile contains:
3572 `cat $lockfile 2>/dev/null`
3573
3574 but it should contain:
3575 $srcfile
3576
3577 This indicates that another process is trying to use the same
3578 temporary object file, and libtool could not work around it because
3579 your compiler does not support '-c' and '-o' together. If you
3580 repeat this compilation, it may succeed, by chance, but you had better
3581 avoid parallel builds (make -j) in this platform, or get a better
3582 compiler."
3583
3584 $opt_dry_run || $RM $removelist
3585 exit $EXIT_FAILURE
3586 fi
3587
3588 # Just move the object if needed
3589 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
3590 func_show_eval '$MV "$output_obj" "$obj"' \
3591 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3592 fi
3593 fi
3594
3595 $opt_dry_run || {
3596 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
3597
3598 # Unlock the critical section if it was locked
3599 if test no != "$need_locks"; then
3600 removelist=$lockfile
3601 $RM "$lockfile"
3602 fi
3603 }
3604
3605 exit $EXIT_SUCCESS
3606 }
3607
3608 $opt_help || {
3609 test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
3610 }
3611
3612 func_mode_help ()
3613 {
3614 # We need to display help for each of the modes.
3615 case $opt_mode in
3616 "")
3617 # Generic help is extracted from the usage comments
3618 # at the start of this file.
3619 func_help
3620 ;;
3621
3622 clean)
3623 $ECHO \
3624 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
3625
3626 Remove files from the build directory.
3627
3628 RM is the name of the program to use to delete files associated with each FILE
3629 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
3630 to RM.
3631
3632 If FILE is a libtool library, object or program, all the files associated
3633 with it are deleted. Otherwise, only FILE itself is deleted using RM."
3634 ;;
3635
3636 compile)
3637 $ECHO \
3638 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3639
3640 Compile a source file into a libtool library object.
3641
3642 This mode accepts the following additional options:
3643
3644 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3645 -no-suppress do not suppress compiler output for multiple passes
3646 -prefer-pic try to build PIC objects only
3647 -prefer-non-pic try to build non-PIC objects only
3648 -shared do not build a '.o' file suitable for static linking
3649 -static only build a '.o' file suitable for static linking
3650 -Wc,FLAG pass FLAG directly to the compiler
3651
3652 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
3653 from the given SOURCEFILE.
3654
3655 The output file name is determined by removing the directory component from
3656 SOURCEFILE, then substituting the C source code suffix '.c' with the
3657 library object suffix, '.lo'."
3658 ;;
3659
3660 execute)
3661 $ECHO \
3662 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
3663
3664 Automatically set library path, then run a program.
3665
3666 This mode accepts the following additional options:
3667
3668 -dlopen FILE add the directory containing FILE to the library path
3669
3670 This mode sets the library path environment variable according to '-dlopen'
3671 flags.
3672
3673 If any of the ARGS are libtool executable wrappers, then they are translated
3674 into their corresponding uninstalled binary, and any of their required library
3675 directories are added to the library path.
3676
3677 Then, COMMAND is executed, with ARGS as arguments."
3678 ;;
3679
3680 finish)
3681 $ECHO \
3682 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
3683
3684 Complete the installation of libtool libraries.
3685
3686 Each LIBDIR is a directory that contains libtool libraries.
3687
3688 The commands that this mode executes may require superuser privileges. Use
3689 the '--dry-run' option if you just want to see what would be executed."
3690 ;;
3691
3692 install)
3693 $ECHO \
3694 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
3695
3696 Install executables or libraries.
3697
3698 INSTALL-COMMAND is the installation command. The first component should be
3699 either the 'install' or 'cp' program.
3700
3701 The following components of INSTALL-COMMAND are treated specially:
3702
3703 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
3704
3705 The rest of the components are interpreted as arguments to that command (only
3706 BSD-compatible install options are recognized)."
3707 ;;
3708
3709 link)
3710 $ECHO \
3711 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
3712
3713 Link object files or libraries together to form another library, or to
3714 create an executable program.
3715
3716 LINK-COMMAND is a command using the C compiler that you would use to create
3717 a program from several object files.
3718
3719 The following components of LINK-COMMAND are treated specially:
3720
3721 -all-static do not do any dynamic linking at all
3722 -avoid-version do not add a version suffix if possible
3723 -bindir BINDIR specify path to binaries directory (for systems where
3724 libraries must be found in the PATH setting at runtime)
3725 -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
3726 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3727 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3728 -export-symbols SYMFILE
3729 try to export only the symbols listed in SYMFILE
3730 -export-symbols-regex REGEX
3731 try to export only the symbols matching REGEX
3732 -LLIBDIR search LIBDIR for required installed libraries
3733 -lNAME OUTPUT-FILE requires the installed library libNAME
3734 -module build a library that can dlopened
3735 -no-fast-install disable the fast-install mode
3736 -no-install link a not-installable executable
3737 -no-undefined declare that a library does not refer to external symbols
3738 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3739 -objectlist FILE use a list of object files found in FILE to specify objects
3740 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
3741 -precious-files-regex REGEX
3742 don't remove output files matching REGEX
3743 -release RELEASE specify package release information
3744 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3745 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3746 -shared only do dynamic linking of libtool libraries
3747 -shrext SUFFIX override the standard shared library file extension
3748 -static do not do any dynamic linking of uninstalled libtool libraries
3749 -static-libtool-libs
3750 do not do any dynamic linking of libtool libraries
3751 -version-info CURRENT[:REVISION[:AGE]]
3752 specify library version info [each variable defaults to 0]
3753 -weak LIBNAME declare that the target provides the LIBNAME interface
3754 -Wc,FLAG
3755 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
3756 -Wl,FLAG
3757 -Xlinker FLAG pass linker-specific FLAG directly to the linker
3758 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
3759
3760 All other options (arguments beginning with '-') are ignored.
3761
3762 Every other argument is treated as a filename. Files ending in '.la' are
3763 treated as uninstalled libtool libraries, other files are standard or library
3764 object files.
3765
3766 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
3767 only library objects ('.lo' files) may be specified, and '-rpath' is
3768 required, except when creating a convenience library.
3769
3770 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
3771 using 'ar' and 'ranlib', or on Windows using 'lib'.
3772
3773 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
3774 is created, otherwise an executable program is created."
3775 ;;
3776
3777 uninstall)
3778 $ECHO \
3779 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
3780
3781 Remove libraries from an installation directory.
3782
3783 RM is the name of the program to use to delete files associated with each FILE
3784 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
3785 to RM.
3786
3787 If FILE is a libtool library, all the files associated with it are deleted.
3788 Otherwise, only FILE itself is deleted using RM."
3789 ;;
3790
3791 *)
3792 func_fatal_help "invalid operation mode '$opt_mode'"
3793 ;;
3794 esac
3795
3796 echo
3797 $ECHO "Try '$progname --help' for more information about other modes."
3798 }
3799
3800 # Now that we've collected a possible --mode arg, show help if necessary
3801 if $opt_help; then
3802 if test : = "$opt_help"; then
3803 func_mode_help
3804 else
3805 {
3806 func_help noexit
3807 for opt_mode in compile link execute install finish uninstall clean; do
3808 func_mode_help
3809 done
3810 } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
3811 {
3812 func_help noexit
3813 for opt_mode in compile link execute install finish uninstall clean; do
3814 echo
3815 func_mode_help
3816 done
3817 } |
3818 $SED '1d
3819 /^When reporting/,/^Report/{
3820 H
3821 d
3822 }
3823 $x
3824 /information about other modes/d
3825 /more detailed .*MODE/d
3826 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
3827 fi
3828 exit $?
3829 fi
3830
3831
3832 # func_mode_execute arg...
3833 func_mode_execute ()
3834 {
3835 $debug_cmd
3836
3837 # The first argument is the command name.
3838 cmd=$nonopt
3839 test -z "$cmd" && \
3840 func_fatal_help "you must specify a COMMAND"
3841
3842 # Handle -dlopen flags immediately.
3843 for file in $opt_dlopen; do
3844 test -f "$file" \
3845 || func_fatal_help "'$file' is not a file"
3846
3847 dir=
3848 case $file in
3849 *.la)
3850 func_resolve_sysroot "$file"
3851 file=$func_resolve_sysroot_result
3852
3853 # Check to see that this really is a libtool archive.
3854 func_lalib_unsafe_p "$file" \
3855 || func_fatal_help "'$lib' is not a valid libtool archive"
3856
3857 # Read the libtool library.
3858 dlname=
3859 library_names=
3860 func_source "$file"
3861
3862 # Skip this library if it cannot be dlopened.
3863 if test -z "$dlname"; then
3864 # Warn if it was a shared library.
3865 test -n "$library_names" && \
3866 func_warning "'$file' was not linked with '-export-dynamic'"
3867 continue
3868 fi
3869
3870 func_dirname "$file" "" "."
3871 dir=$func_dirname_result
3872
3873 if test -f "$dir/$objdir/$dlname"; then
3874 func_append dir "/$objdir"
3875 else
3876 if test ! -f "$dir/$dlname"; then
3877 func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
3878 fi
3879 fi
3880 ;;
3881
3882 *.lo)
3883 # Just add the directory containing the .lo file.
3884 func_dirname "$file" "" "."
3885 dir=$func_dirname_result
3886 ;;
3887
3888 *)
3889 func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
3890 continue
3891 ;;
3892 esac
3893
3894 # Get the absolute pathname.
3895 absdir=`cd "$dir" && pwd`
3896 test -n "$absdir" && dir=$absdir
3897
3898 # Now add the directory to shlibpath_var.
3899 if eval "test -z \"\$$shlibpath_var\""; then
3900 eval "$shlibpath_var=\"\$dir\""
3901 else
3902 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3903 fi
3904 done
3905
3906 # This variable tells wrapper scripts just to set shlibpath_var
3907 # rather than running their programs.
3908 libtool_execute_magic=$magic
3909
3910 # Check if any of the arguments is a wrapper script.
3911 args=
3912 for file
3913 do
3914 case $file in
3915 -* | *.la | *.lo ) ;;
3916 *)
3917 # Do a test to see if this is really a libtool program.
3918 if func_ltwrapper_script_p "$file"; then
3919 func_source "$file"
3920 # Transform arg to wrapped name.
3921 file=$progdir/$program
3922 elif func_ltwrapper_executable_p "$file"; then
3923 func_ltwrapper_scriptname "$file"
3924 func_source "$func_ltwrapper_scriptname_result"
3925 # Transform arg to wrapped name.
3926 file=$progdir/$program
3927 fi
3928 ;;
3929 esac
3930 # Quote arguments (to preserve shell metacharacters).
3931 func_append_quoted args "$file"
3932 done
3933
3934 if $opt_dry_run; then
3935 # Display what would be done.
3936 if test -n "$shlibpath_var"; then
3937 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3938 echo "export $shlibpath_var"
3939 fi
3940 $ECHO "$cmd$args"
3941 exit $EXIT_SUCCESS
3942 else
3943 if test -n "$shlibpath_var"; then
3944 # Export the shlibpath_var.
3945 eval "export $shlibpath_var"
3946 fi
3947
3948 # Restore saved environment variables
3949 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
3950 do
3951 eval "if test \"\${save_$lt_var+set}\" = set; then
3952 $lt_var=\$save_$lt_var; export $lt_var
3953 else
3954 $lt_unset $lt_var
3955 fi"
3956 done
3957
3958 # Now prepare to actually exec the command.
3959 exec_cmd=\$cmd$args
3960 fi
3961 }
3962
3963 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
3964
3965
3966 # func_mode_finish arg...
3967 func_mode_finish ()
3968 {
3969 $debug_cmd
3970
3971 libs=
3972 libdirs=
3973 admincmds=
3974
3975 for opt in "$nonopt" ${1+"$@"}
3976 do
3977 if test -d "$opt"; then
3978 func_append libdirs " $opt"
3979
3980 elif test -f "$opt"; then
3981 if func_lalib_unsafe_p "$opt"; then
3982 func_append libs " $opt"
3983 else
3984 func_warning "'$opt' is not a valid libtool archive"
3985 fi
3986
3987 else
3988 func_fatal_error "invalid argument '$opt'"
3989 fi
3990 done
3991
3992 if test -n "$libs"; then
3993 if test -n "$lt_sysroot"; then
3994 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3995 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
3996 else
3997 sysroot_cmd=
3998 fi
3999
4000 # Remove sysroot references
4001 if $opt_dry_run; then
4002 for lib in $libs; do
4003 echo "removing references to $lt_sysroot and '=' prefixes from $lib"
4004 done
4005 else
4006 tmpdir=`func_mktempdir`
4007 for lib in $libs; do
4008 $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
4009 > $tmpdir/tmp-la
4010 mv -f $tmpdir/tmp-la $lib
4011 done
4012 ${RM}r "$tmpdir"
4013 fi
4014 fi
4015
4016 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4017 for libdir in $libdirs; do
4018 if test -n "$finish_cmds"; then
4019 # Do each command in the finish commands.
4020 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
4021 '"$cmd"'"'
4022 fi
4023 if test -n "$finish_eval"; then
4024 # Do the single finish_eval.
4025 eval cmds=\"$finish_eval\"
4026 $opt_dry_run || eval "$cmds" || func_append admincmds "
4027 $cmds"
4028 fi
4029 done
4030 fi
4031
4032 # Exit here if they wanted silent mode.
4033 $opt_quiet && exit $EXIT_SUCCESS
4034
4035 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4036 echo "----------------------------------------------------------------------"
4037 echo "Libraries have been installed in:"
4038 for libdir in $libdirs; do
4039 $ECHO " $libdir"
4040 done
4041 echo
4042 echo "If you ever happen to want to link against installed libraries"
4043 echo "in a given directory, LIBDIR, you must either use libtool, and"
4044 echo "specify the full pathname of the library, or use the '-LLIBDIR'"
4045 echo "flag during linking and do at least one of the following:"
4046 if test -n "$shlibpath_var"; then
4047 echo " - add LIBDIR to the '$shlibpath_var' environment variable"
4048 echo " during execution"
4049 fi
4050 if test -n "$runpath_var"; then
4051 echo " - add LIBDIR to the '$runpath_var' environment variable"
4052 echo " during linking"
4053 fi
4054 if test -n "$hardcode_libdir_flag_spec"; then
4055 libdir=LIBDIR
4056 eval flag=\"$hardcode_libdir_flag_spec\"
4057
4058 $ECHO " - use the '$flag' linker flag"
4059 fi
4060 if test -n "$admincmds"; then
4061 $ECHO " - have your system administrator run these commands:$admincmds"
4062 fi
4063 if test -f /etc/ld.so.conf; then
4064 echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
4065 fi
4066 echo
4067
4068 echo "See any operating system documentation about shared libraries for"
4069 case $host in
4070 solaris2.[6789]|solaris2.1[0-9])
4071 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
4072 echo "pages."
4073 ;;
4074 *)
4075 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4076 ;;
4077 esac
4078 echo "----------------------------------------------------------------------"
4079 fi
4080 exit $EXIT_SUCCESS
4081 }
4082
4083 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
4084
4085
4086 # func_mode_install arg...
4087 func_mode_install ()
4088 {
4089 $debug_cmd
4090
4091 # There may be an optional sh(1) argument at the beginning of
4092 # install_prog (especially on Windows NT).
4093 if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
4094 # Allow the use of GNU shtool's install command.
4095 case $nonopt in *shtool*) :;; *) false;; esac
4096 then
4097 # Aesthetically quote it.
4098 func_quote_for_eval "$nonopt"
4099 install_prog="$func_quote_for_eval_result "
4100 arg=$1
4101 shift
4102 else
4103 install_prog=
4104 arg=$nonopt
4105 fi
4106
4107 # The real first argument should be the name of the installation program.
4108 # Aesthetically quote it.
4109 func_quote_for_eval "$arg"
4110 func_append install_prog "$func_quote_for_eval_result"
4111 install_shared_prog=$install_prog
4112 case " $install_prog " in
4113 *[\\\ /]cp\ *) install_cp=: ;;
4114 *) install_cp=false ;;
4115 esac
4116
4117 # We need to accept at least all the BSD install flags.
4118 dest=
4119 files=
4120 opts=
4121 prev=
4122 install_type=
4123 isdir=false
4124 stripme=
4125 no_mode=:
4126 for arg
4127 do
4128 arg2=
4129 if test -n "$dest"; then
4130 func_append files " $dest"
4131 dest=$arg
4132 continue
4133 fi
4134
4135 case $arg in
4136 -d) isdir=: ;;
4137 -f)
4138 if $install_cp; then :; else
4139 prev=$arg
4140 fi
4141 ;;
4142 -g | -m | -o)
4143 prev=$arg
4144 ;;
4145 -s)
4146 stripme=" -s"
4147 continue
4148 ;;
4149 -*)
4150 ;;
4151 *)
4152 # If the previous option needed an argument, then skip it.
4153 if test -n "$prev"; then
4154 if test X-m = "X$prev" && test -n "$install_override_mode"; then
4155 arg2=$install_override_mode
4156 no_mode=false
4157 fi
4158 prev=
4159 else
4160 dest=$arg
4161 continue
4162 fi
4163 ;;
4164 esac
4165
4166 # Aesthetically quote the argument.
4167 func_quote_for_eval "$arg"
4168 func_append install_prog " $func_quote_for_eval_result"
4169 if test -n "$arg2"; then
4170 func_quote_for_eval "$arg2"
4171 fi
4172 func_append install_shared_prog " $func_quote_for_eval_result"
4173 done
4174
4175 test -z "$install_prog" && \
4176 func_fatal_help "you must specify an install program"
4177
4178 test -n "$prev" && \
4179 func_fatal_help "the '$prev' option requires an argument"
4180
4181 if test -n "$install_override_mode" && $no_mode; then
4182 if $install_cp; then :; else
4183 func_quote_for_eval "$install_override_mode"
4184 func_append install_shared_prog " -m $func_quote_for_eval_result"
4185 fi
4186 fi
4187
4188 if test -z "$files"; then
4189 if test -z "$dest"; then
4190 func_fatal_help "no file or destination specified"
4191 else
4192 func_fatal_help "you must specify a destination"
4193 fi
4194 fi
4195
4196 # Strip any trailing slash from the destination.
4197 func_stripname '' '/' "$dest"
4198 dest=$func_stripname_result
4199
4200 # Check to see that the destination is a directory.
4201 test -d "$dest" && isdir=:
4202 if $isdir; then
4203 destdir=$dest
4204 destname=
4205 else
4206 func_dirname_and_basename "$dest" "" "."
4207 destdir=$func_dirname_result
4208 destname=$func_basename_result
4209
4210 # Not a directory, so check to see that there is only one file specified.
4211 set dummy $files; shift
4212 test "$#" -gt 1 && \
4213 func_fatal_help "'$dest' is not a directory"
4214 fi
4215 case $destdir in
4216 [\\/]* | [A-Za-z]:[\\/]*) ;;
4217 *)
4218 for file in $files; do
4219 case $file in
4220 *.lo) ;;
4221 *)
4222 func_fatal_help "'$destdir' must be an absolute directory name"
4223 ;;
4224 esac
4225 done
4226 ;;
4227 esac
4228
4229 # This variable tells wrapper scripts just to set variables rather
4230 # than running their programs.
4231 libtool_install_magic=$magic
4232
4233 staticlibs=
4234 future_libdirs=
4235 current_libdirs=
4236 for file in $files; do
4237
4238 # Do each installation.
4239 case $file in
4240 *.$libext)
4241 # Do the static libraries later.
4242 func_append staticlibs " $file"
4243 ;;
4244
4245 *.la)
4246 func_resolve_sysroot "$file"
4247 file=$func_resolve_sysroot_result
4248
4249 # Check to see that this really is a libtool archive.
4250 func_lalib_unsafe_p "$file" \
4251 || func_fatal_help "'$file' is not a valid libtool archive"
4252
4253 library_names=
4254 old_library=
4255 relink_command=
4256 func_source "$file"
4257
4258 # Add the libdir to current_libdirs if it is the destination.
4259 if test "X$destdir" = "X$libdir"; then
4260 case "$current_libdirs " in
4261 *" $libdir "*) ;;
4262 *) func_append current_libdirs " $libdir" ;;
4263 esac
4264 else
4265 # Note the libdir as a future libdir.
4266 case "$future_libdirs " in
4267 *" $libdir "*) ;;
4268 *) func_append future_libdirs " $libdir" ;;
4269 esac
4270 fi
4271
4272 func_dirname "$file" "/" ""
4273 dir=$func_dirname_result
4274 func_append dir "$objdir"
4275
4276 if test -n "$relink_command"; then
4277 # Determine the prefix the user has applied to our future dir.
4278 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
4279
4280 # Don't allow the user to place us outside of our expected
4281 # location b/c this prevents finding dependent libraries that
4282 # are installed to the same prefix.
4283 # At present, this check doesn't affect windows .dll's that
4284 # are installed into $libdir/../bin (currently, that works fine)
4285 # but it's something to keep an eye on.
4286 test "$inst_prefix_dir" = "$destdir" && \
4287 func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
4288
4289 if test -n "$inst_prefix_dir"; then
4290 # Stick the inst_prefix_dir data into the link command.
4291 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4292 else
4293 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4294 fi
4295
4296 func_warning "relinking '$file'"
4297 func_show_eval "$relink_command" \
4298 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
4299 fi
4300
4301 # See the names of the shared library.
4302 set dummy $library_names; shift
4303 if test -n "$1"; then
4304 realname=$1
4305 shift
4306
4307 srcname=$realname
4308 test -n "$relink_command" && srcname=${realname}T
4309
4310 # Install the shared library and build the symlinks.
4311 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
4312 'exit $?'
4313 tstripme=$stripme
4314 case $host_os in
4315 cygwin* | mingw* | pw32* | cegcc*)
4316 case $realname in
4317 *.dll.a)
4318 tstripme=
4319 ;;
4320 esac
4321 ;;
4322 os2*)
4323 case $realname in
4324 *_dll.a)
4325 tstripme=
4326 ;;
4327 esac
4328 ;;
4329 esac
4330 if test -n "$tstripme" && test -n "$striplib"; then
4331 func_show_eval "$striplib $destdir/$realname" 'exit $?'
4332 fi
4333
4334 if test "$#" -gt 0; then
4335 # Delete the old symlinks, and create new ones.
4336 # Try 'ln -sf' first, because the 'ln' binary might depend on
4337 # the symlink we replace! Solaris /bin/ln does not understand -f,
4338 # so we also need to try rm && ln -s.
4339 for linkname
4340 do
4341 test "$linkname" != "$realname" \
4342 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
4343 done
4344 fi
4345
4346 # Do each command in the postinstall commands.
4347 lib=$destdir/$realname
4348 func_execute_cmds "$postinstall_cmds" 'exit $?'
4349 fi
4350
4351 # Install the pseudo-library for information purposes.
4352 func_basename "$file"
4353 name=$func_basename_result
4354 instname=$dir/${name}i
4355 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
4356
4357 # Maybe install the static library, too.
4358 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
4359 ;;
4360
4361 *.lo)
4362 # Install (i.e. copy) a libtool object.
4363
4364 # Figure out destination file name, if it wasn't already specified.
4365 if test -n "$destname"; then
4366 destfile=$destdir/$destname
4367 else
4368 func_basename "$file"
4369 destfile=$func_basename_result
4370 destfile=$destdir/$destfile
4371 fi
4372
4373 # Deduce the name of the destination old-style object file.
4374 case $destfile in
4375 *.lo)
4376 func_lo2o "$destfile"
4377 staticdest=$func_lo2o_result
4378 ;;
4379 *.$objext)
4380 staticdest=$destfile
4381 destfile=
4382 ;;
4383 *)
4384 func_fatal_help "cannot copy a libtool object to '$destfile'"
4385 ;;
4386 esac
4387
4388 # Install the libtool object if requested.
4389 test -n "$destfile" && \
4390 func_show_eval "$install_prog $file $destfile" 'exit $?'
4391
4392 # Install the old object if enabled.
4393 if test yes = "$build_old_libs"; then
4394 # Deduce the name of the old-style object file.
4395 func_lo2o "$file"
4396 staticobj=$func_lo2o_result
4397 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
4398 fi
4399 exit $EXIT_SUCCESS
4400 ;;
4401
4402 *)
4403 # Figure out destination file name, if it wasn't already specified.
4404 if test -n "$destname"; then
4405 destfile=$destdir/$destname
4406 else
4407 func_basename "$file"
4408 destfile=$func_basename_result
4409 destfile=$destdir/$destfile
4410 fi
4411
4412 # If the file is missing, and there is a .exe on the end, strip it
4413 # because it is most likely a libtool script we actually want to
4414 # install
4415 stripped_ext=
4416 case $file in
4417 *.exe)
4418 if test ! -f "$file"; then
4419 func_stripname '' '.exe' "$file"
4420 file=$func_stripname_result
4421 stripped_ext=.exe
4422 fi
4423 ;;
4424 esac
4425
4426 # Do a test to see if this is really a libtool program.
4427 case $host in
4428 *cygwin* | *mingw*)
4429 if func_ltwrapper_executable_p "$file"; then
4430 func_ltwrapper_scriptname "$file"
4431 wrapper=$func_ltwrapper_scriptname_result
4432 else
4433 func_stripname '' '.exe' "$file"
4434 wrapper=$func_stripname_result
4435 fi
4436 ;;
4437 *)
4438 wrapper=$file
4439 ;;
4440 esac
4441 if func_ltwrapper_script_p "$wrapper"; then
4442 notinst_deplibs=
4443 relink_command=
4444
4445 func_source "$wrapper"
4446
4447 # Check the variables that should have been set.
4448 test -z "$generated_by_libtool_version" && \
4449 func_fatal_error "invalid libtool wrapper script '$wrapper'"
4450
4451 finalize=:
4452 for lib in $notinst_deplibs; do
4453 # Check to see that each library is installed.
4454 libdir=
4455 if test -f "$lib"; then
4456 func_source "$lib"
4457 fi
4458 libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
4459 if test -n "$libdir" && test ! -f "$libfile"; then
4460 func_warning "'$lib' has not been installed in '$libdir'"
4461 finalize=false
4462 fi
4463 done
4464
4465 relink_command=
4466 func_source "$wrapper"
4467
4468 outputname=
4469 if test no = "$fast_install" && test -n "$relink_command"; then
4470 $opt_dry_run || {
4471 if $finalize; then
4472 tmpdir=`func_mktempdir`
4473 func_basename "$file$stripped_ext"
4474 file=$func_basename_result
4475 outputname=$tmpdir/$file
4476 # Replace the output file specification.
4477 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
4478
4479 $opt_quiet || {
4480 func_quote_for_expand "$relink_command"
4481 eval "func_echo $func_quote_for_expand_result"
4482 }
4483 if eval "$relink_command"; then :
4484 else
4485 func_error "error: relink '$file' with the above command before installing it"
4486 $opt_dry_run || ${RM}r "$tmpdir"
4487 continue
4488 fi
4489 file=$outputname
4490 else
4491 func_warning "cannot relink '$file'"
4492 fi
4493 }
4494 else
4495 # Install the binary that we compiled earlier.
4496 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
4497 fi
4498 fi
4499
4500 # remove .exe since cygwin /usr/bin/install will append another
4501 # one anyway
4502 case $install_prog,$host in
4503 */usr/bin/install*,*cygwin*)
4504 case $file:$destfile in
4505 *.exe:*.exe)
4506 # this is ok
4507 ;;
4508 *.exe:*)
4509 destfile=$destfile.exe
4510 ;;
4511 *:*.exe)
4512 func_stripname '' '.exe' "$destfile"
4513 destfile=$func_stripname_result
4514 ;;
4515 esac
4516 ;;
4517 esac
4518 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
4519 $opt_dry_run || if test -n "$outputname"; then
4520 ${RM}r "$tmpdir"
4521 fi
4522 ;;
4523 esac
4524 done
4525
4526 for file in $staticlibs; do
4527 func_basename "$file"
4528 name=$func_basename_result
4529
4530 # Set up the ranlib parameters.
4531 oldlib=$destdir/$name
4532 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
4533 tool_oldlib=$func_to_tool_file_result
4534
4535 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
4536
4537 if test -n "$stripme" && test -n "$old_striplib"; then
4538 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
4539 fi
4540
4541 # Do each command in the postinstall commands.
4542 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
4543 done
4544
4545 test -n "$future_libdirs" && \
4546 func_warning "remember to run '$progname --finish$future_libdirs'"
4547
4548 if test -n "$current_libdirs"; then
4549 # Maybe just do a dry run.
4550 $opt_dry_run && current_libdirs=" -n$current_libdirs"
4551 exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
4552 else
4553 exit $EXIT_SUCCESS
4554 fi
4555 }
4556
4557 test install = "$opt_mode" && func_mode_install ${1+"$@"}
4558
4559
4560 # func_generate_dlsyms outputname originator pic_p
4561 # Extract symbols from dlprefiles and create ${outputname}S.o with
4562 # a dlpreopen symbol table.
4563 func_generate_dlsyms ()
4564 {
4565 $debug_cmd
4566
4567 my_outputname=$1
4568 my_originator=$2
4569 my_pic_p=${3-false}
4570 my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
4571 my_dlsyms=
4572
4573 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
4574 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4575 my_dlsyms=${my_outputname}S.c
4576 else
4577 func_error "not configured to extract global symbols from dlpreopened files"
4578 fi
4579 fi
4580
4581 if test -n "$my_dlsyms"; then
4582 case $my_dlsyms in
4583 "") ;;
4584 *.c)
4585 # Discover the nlist of each of the dlfiles.
4586 nlist=$output_objdir/$my_outputname.nm
4587
4588 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
4589
4590 # Parse the name list into a source file.
4591 func_verbose "creating $output_objdir/$my_dlsyms"
4592
4593 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
4594 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
4595 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
4596
4597 #ifdef __cplusplus
4598 extern \"C\" {
4599 #endif
4600
4601 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
4602 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
4603 #endif
4604
4605 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
4606 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4607 /* DATA imports from DLLs on WIN32 can't be const, because runtime
4608 relocations are performed -- see ld's documentation on pseudo-relocs. */
4609 # define LT_DLSYM_CONST
4610 #elif defined __osf__
4611 /* This system does not cope well with relocations in const data. */
4612 # define LT_DLSYM_CONST
4613 #else
4614 # define LT_DLSYM_CONST const
4615 #endif
4616
4617 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
4618
4619 /* External symbol declarations for the compiler. */\
4620 "
4621
4622 if test yes = "$dlself"; then
4623 func_verbose "generating symbol list for '$output'"
4624
4625 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
4626
4627 # Add our own program objects to the symbol list.
4628 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
4629 for progfile in $progfiles; do
4630 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
4631 func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
4632 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
4633 done
4634
4635 if test -n "$exclude_expsyms"; then
4636 $opt_dry_run || {
4637 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4638 eval '$MV "$nlist"T "$nlist"'
4639 }
4640 fi
4641
4642 if test -n "$export_symbols_regex"; then
4643 $opt_dry_run || {
4644 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4645 eval '$MV "$nlist"T "$nlist"'
4646 }
4647 fi
4648
4649 # Prepare the list of exported symbols
4650 if test -z "$export_symbols"; then
4651 export_symbols=$output_objdir/$outputname.exp
4652 $opt_dry_run || {
4653 $RM $export_symbols
4654 eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4655 case $host in
4656 *cygwin* | *mingw* | *cegcc* )
4657 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4658 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4659 ;;
4660 esac
4661 }
4662 else
4663 $opt_dry_run || {
4664 eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4665 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4666 eval '$MV "$nlist"T "$nlist"'
4667 case $host in
4668 *cygwin* | *mingw* | *cegcc* )
4669 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4670 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4671 ;;
4672 esac
4673 }
4674 fi
4675 fi
4676
4677 for dlprefile in $dlprefiles; do
4678 func_verbose "extracting global C symbols from '$dlprefile'"
4679 func_basename "$dlprefile"
4680 name=$func_basename_result
4681 case $host in
4682 *cygwin* | *mingw* | *cegcc* )
4683 # if an import library, we need to obtain dlname
4684 if func_win32_import_lib_p "$dlprefile"; then
4685 func_tr_sh "$dlprefile"
4686 eval "curr_lafile=\$libfile_$func_tr_sh_result"
4687 dlprefile_dlbasename=
4688 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
4689 # Use subshell, to avoid clobbering current variable values
4690 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
4691 if test -n "$dlprefile_dlname"; then
4692 func_basename "$dlprefile_dlname"
4693 dlprefile_dlbasename=$func_basename_result
4694 else
4695 # no lafile. user explicitly requested -dlpreopen <import library>.
4696 $sharedlib_from_linklib_cmd "$dlprefile"
4697 dlprefile_dlbasename=$sharedlib_from_linklib_result
4698 fi
4699 fi
4700 $opt_dry_run || {
4701 if test -n "$dlprefile_dlbasename"; then
4702 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
4703 else
4704 func_warning "Could not compute DLL name from $name"
4705 eval '$ECHO ": $name " >> "$nlist"'
4706 fi
4707 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4708 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
4709 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
4710 }
4711 else # not an import lib
4712 $opt_dry_run || {
4713 eval '$ECHO ": $name " >> "$nlist"'
4714 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4715 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4716 }
4717 fi
4718 ;;
4719 *)
4720 $opt_dry_run || {
4721 eval '$ECHO ": $name " >> "$nlist"'
4722 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
4723 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4724 }
4725 ;;
4726 esac
4727 done
4728
4729 $opt_dry_run || {
4730 # Make sure we have at least an empty file.
4731 test -f "$nlist" || : > "$nlist"
4732
4733 if test -n "$exclude_expsyms"; then
4734 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4735 $MV "$nlist"T "$nlist"
4736 fi
4737
4738 # Try sorting and uniquifying the output.
4739 if $GREP -v "^: " < "$nlist" |
4740 if sort -k 3 </dev/null >/dev/null 2>&1; then
4741 sort -k 3
4742 else
4743 sort +2
4744 fi |
4745 uniq > "$nlist"S; then
4746 :
4747 else
4748 $GREP -v "^: " < "$nlist" > "$nlist"S
4749 fi
4750
4751 if test -f "$nlist"S; then
4752 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
4753 else
4754 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
4755 fi
4756
4757 func_show_eval '$RM "${nlist}I"'
4758 if test -n "$global_symbol_to_import"; then
4759 eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
4760 fi
4761
4762 echo >> "$output_objdir/$my_dlsyms" "\
4763
4764 /* The mapping between symbol names and symbols. */
4765 typedef struct {
4766 const char *name;
4767 void *address;
4768 } lt_dlsymlist;
4769 extern LT_DLSYM_CONST lt_dlsymlist
4770 lt_${my_prefix}_LTX_preloaded_symbols[];\
4771 "
4772
4773 if test -s "$nlist"I; then
4774 echo >> "$output_objdir/$my_dlsyms" "\
4775 static void lt_syminit(void)
4776 {
4777 LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
4778 for (; symbol->name; ++symbol)
4779 {"
4780 $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
4781 echo >> "$output_objdir/$my_dlsyms" "\
4782 }
4783 }"
4784 fi
4785 echo >> "$output_objdir/$my_dlsyms" "\
4786 LT_DLSYM_CONST lt_dlsymlist
4787 lt_${my_prefix}_LTX_preloaded_symbols[] =
4788 { {\"$my_originator\", (void *) 0},"
4789
4790 if test -s "$nlist"I; then
4791 echo >> "$output_objdir/$my_dlsyms" "\
4792 {\"@INIT@\", (void *) &lt_syminit},"
4793 fi
4794
4795 case $need_lib_prefix in
4796 no)
4797 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
4798 ;;
4799 *)
4800 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
4801 ;;
4802 esac
4803 echo >> "$output_objdir/$my_dlsyms" "\
4804 {0, (void *) 0}
4805 };
4806
4807 /* This works around a problem in FreeBSD linker */
4808 #ifdef FREEBSD_WORKAROUND
4809 static const void *lt_preloaded_setup() {
4810 return lt_${my_prefix}_LTX_preloaded_symbols;
4811 }
4812 #endif
4813
4814 #ifdef __cplusplus
4815 }
4816 #endif\
4817 "
4818 } # !$opt_dry_run
4819
4820 pic_flag_for_symtable=
4821 case "$compile_command " in
4822 *" -static "*) ;;
4823 *)
4824 case $host in
4825 # compiling the symbol table file with pic_flag works around
4826 # a FreeBSD bug that causes programs to crash when -lm is
4827 # linked before any other PIC object. But we must not use
4828 # pic_flag when linking with -static. The problem exists in
4829 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4830 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4831 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
4832 *-*-hpux*)
4833 pic_flag_for_symtable=" $pic_flag" ;;
4834 *)
4835 $my_pic_p && pic_flag_for_symtable=" $pic_flag"
4836 ;;
4837 esac
4838 ;;
4839 esac
4840 symtab_cflags=
4841 for arg in $LTCFLAGS; do
4842 case $arg in
4843 -pie | -fpie | -fPIE) ;;
4844 *) func_append symtab_cflags " $arg" ;;
4845 esac
4846 done
4847
4848 # Now compile the dynamic symbol file.
4849 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
4850
4851 # Clean up the generated files.
4852 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
4853
4854 # Transform the symbol file into the correct name.
4855 symfileobj=$output_objdir/${my_outputname}S.$objext
4856 case $host in
4857 *cygwin* | *mingw* | *cegcc* )
4858 if test -f "$output_objdir/$my_outputname.def"; then
4859 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
4860 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
4861 else
4862 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
4863 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
4864 fi
4865 ;;
4866 *)
4867 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
4868 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
4869 ;;
4870 esac
4871 ;;
4872 *)
4873 func_fatal_error "unknown suffix for '$my_dlsyms'"
4874 ;;
4875 esac
4876 else
4877 # We keep going just in case the user didn't refer to
4878 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4879 # really was required.
4880
4881 # Nullify the symbol file.
4882 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
4883 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
4884 fi
4885 }
4886
4887 # func_cygming_gnu_implib_p ARG
4888 # This predicate returns with zero status (TRUE) if
4889 # ARG is a GNU/binutils-style import library. Returns
4890 # with nonzero status (FALSE) otherwise.
4891 func_cygming_gnu_implib_p ()
4892 {
4893 $debug_cmd
4894
4895 func_to_tool_file "$1" func_convert_file_msys_to_w32
4896 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
4897 test -n "$func_cygming_gnu_implib_tmp"
4898 }
4899
4900 # func_cygming_ms_implib_p ARG
4901 # This predicate returns with zero status (TRUE) if
4902 # ARG is an MS-style import library. Returns
4903 # with nonzero status (FALSE) otherwise.
4904 func_cygming_ms_implib_p ()
4905 {
4906 $debug_cmd
4907
4908 func_to_tool_file "$1" func_convert_file_msys_to_w32
4909 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4910 test -n "$func_cygming_ms_implib_tmp"
4911 }
4912
4913 # func_win32_libid arg
4914 # return the library type of file 'arg'
4915 #
4916 # Need a lot of goo to handle *both* DLLs and import libs
4917 # Has to be a shell function in order to 'eat' the argument
4918 # that is supplied when $file_magic_command is called.
4919 # Despite the name, also deal with 64 bit binaries.
4920 func_win32_libid ()
4921 {
4922 $debug_cmd
4923
4924 win32_libid_type=unknown
4925 win32_fileres=`file -L $1 2>/dev/null`
4926 case $win32_fileres in
4927 *ar\ archive\ import\ library*) # definitely import
4928 win32_libid_type="x86 archive import"
4929 ;;
4930 *ar\ archive*) # could be an import, or static
4931 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
4932 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
4933 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
4934 case $nm_interface in
4935 "MS dumpbin")
4936 if func_cygming_ms_implib_p "$1" ||
4937 func_cygming_gnu_implib_p "$1"
4938 then
4939 win32_nmres=import
4940 else
4941 win32_nmres=
4942 fi
4943 ;;
4944 *)
4945 func_to_tool_file "$1" func_convert_file_msys_to_w32
4946 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
4947 $SED -n -e '
4948 1,100{
4949 / I /{
4950 s|.*|import|
4951 p
4952 q
4953 }
4954 }'`
4955 ;;
4956 esac
4957 case $win32_nmres in
4958 import*) win32_libid_type="x86 archive import";;
4959 *) win32_libid_type="x86 archive static";;
4960 esac
4961 fi
4962 ;;
4963 *DLL*)
4964 win32_libid_type="x86 DLL"
4965 ;;
4966 *executable*) # but shell scripts are "executable" too...
4967 case $win32_fileres in
4968 *MS\ Windows\ PE\ Intel*)
4969 win32_libid_type="x86 DLL"
4970 ;;
4971 esac
4972 ;;
4973 esac
4974 $ECHO "$win32_libid_type"
4975 }
4976
4977 # func_cygming_dll_for_implib ARG
4978 #
4979 # Platform-specific function to extract the
4980 # name of the DLL associated with the specified
4981 # import library ARG.
4982 # Invoked by eval'ing the libtool variable
4983 # $sharedlib_from_linklib_cmd
4984 # Result is available in the variable
4985 # $sharedlib_from_linklib_result
4986 func_cygming_dll_for_implib ()
4987 {
4988 $debug_cmd
4989
4990 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
4991 }
4992
4993 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
4994 #
4995 # The is the core of a fallback implementation of a
4996 # platform-specific function to extract the name of the
4997 # DLL associated with the specified import library LIBNAME.
4998 #
4999 # SECTION_NAME is either .idata$6 or .idata$7, depending
5000 # on the platform and compiler that created the implib.
5001 #
5002 # Echos the name of the DLL associated with the
5003 # specified import library.
5004 func_cygming_dll_for_implib_fallback_core ()
5005 {
5006 $debug_cmd
5007
5008 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
5009 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
5010 $SED '/^Contents of section '"$match_literal"':/{
5011 # Place marker at beginning of archive member dllname section
5012 s/.*/====MARK====/
5013 p
5014 d
5015 }
5016 # These lines can sometimes be longer than 43 characters, but
5017 # are always uninteresting
5018 /:[ ]*file format pe[i]\{,1\}-/d
5019 /^In archive [^:]*:/d
5020 # Ensure marker is printed
5021 /^====MARK====/p
5022 # Remove all lines with less than 43 characters
5023 /^.\{43\}/!d
5024 # From remaining lines, remove first 43 characters
5025 s/^.\{43\}//' |
5026 $SED -n '
5027 # Join marker and all lines until next marker into a single line
5028 /^====MARK====/ b para
5029 H
5030 $ b para
5031 b
5032 :para
5033 x
5034 s/\n//g
5035 # Remove the marker
5036 s/^====MARK====//
5037 # Remove trailing dots and whitespace
5038 s/[\. \t]*$//
5039 # Print
5040 /./p' |
5041 # we now have a list, one entry per line, of the stringified
5042 # contents of the appropriate section of all members of the
5043 # archive that possess that section. Heuristic: eliminate
5044 # all those that have a first or second character that is
5045 # a '.' (that is, objdump's representation of an unprintable
5046 # character.) This should work for all archives with less than
5047 # 0x302f exports -- but will fail for DLLs whose name actually
5048 # begins with a literal '.' or a single character followed by
5049 # a '.'.
5050 #
5051 # Of those that remain, print the first one.
5052 $SED -e '/^\./d;/^.\./d;q'
5053 }
5054
5055 # func_cygming_dll_for_implib_fallback ARG
5056 # Platform-specific function to extract the
5057 # name of the DLL associated with the specified
5058 # import library ARG.
5059 #
5060 # This fallback implementation is for use when $DLLTOOL
5061 # does not support the --identify-strict option.
5062 # Invoked by eval'ing the libtool variable
5063 # $sharedlib_from_linklib_cmd
5064 # Result is available in the variable
5065 # $sharedlib_from_linklib_result
5066 func_cygming_dll_for_implib_fallback ()
5067 {
5068 $debug_cmd
5069
5070 if func_cygming_gnu_implib_p "$1"; then
5071 # binutils import library
5072 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
5073 elif func_cygming_ms_implib_p "$1"; then
5074 # ms-generated import library
5075 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
5076 else
5077 # unknown
5078 sharedlib_from_linklib_result=
5079 fi
5080 }
5081
5082
5083 # func_extract_an_archive dir oldlib
5084 func_extract_an_archive ()
5085 {
5086 $debug_cmd
5087
5088 f_ex_an_ar_dir=$1; shift
5089 f_ex_an_ar_oldlib=$1
5090 if test yes = "$lock_old_archive_extraction"; then
5091 lockfile=$f_ex_an_ar_oldlib.lock
5092 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
5093 func_echo "Waiting for $lockfile to be removed"
5094 sleep 2
5095 done
5096 fi
5097 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
5098 'stat=$?; rm -f "$lockfile"; exit $stat'
5099 if test yes = "$lock_old_archive_extraction"; then
5100 $opt_dry_run || rm -f "$lockfile"
5101 fi
5102 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
5103 :
5104 else
5105 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
5106 fi
5107 }
5108
5109
5110 # func_extract_archives gentop oldlib ...
5111 func_extract_archives ()
5112 {
5113 $debug_cmd
5114
5115 my_gentop=$1; shift
5116 my_oldlibs=${1+"$@"}
5117 my_oldobjs=
5118 my_xlib=
5119 my_xabs=
5120 my_xdir=
5121
5122 for my_xlib in $my_oldlibs; do
5123 # Extract the objects.
5124 case $my_xlib in
5125 [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
5126 *) my_xabs=`pwd`"/$my_xlib" ;;
5127 esac
5128 func_basename "$my_xlib"
5129 my_xlib=$func_basename_result
5130 my_xlib_u=$my_xlib
5131 while :; do
5132 case " $extracted_archives " in
5133 *" $my_xlib_u "*)
5134 func_arith $extracted_serial + 1
5135 extracted_serial=$func_arith_result
5136 my_xlib_u=lt$extracted_serial-$my_xlib ;;
5137 *) break ;;
5138 esac
5139 done
5140 extracted_archives="$extracted_archives $my_xlib_u"
5141 my_xdir=$my_gentop/$my_xlib_u
5142
5143 func_mkdir_p "$my_xdir"
5144
5145 case $host in
5146 *-darwin*)
5147 func_verbose "Extracting $my_xabs"
5148 # Do not bother doing anything if just a dry run
5149 $opt_dry_run || {
5150 darwin_orig_dir=`pwd`
5151 cd $my_xdir || exit $?
5152 darwin_archive=$my_xabs
5153 darwin_curdir=`pwd`
5154 func_basename "$darwin_archive"
5155 darwin_base_archive=$func_basename_result
5156 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
5157 if test -n "$darwin_arches"; then
5158 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
5159 darwin_arch=
5160 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5161 for darwin_arch in $darwin_arches; do
5162 func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
5163 $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
5164 cd "unfat-$$/$darwin_base_archive-$darwin_arch"
5165 func_extract_an_archive "`pwd`" "$darwin_base_archive"
5166 cd "$darwin_curdir"
5167 $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
5168 done # $darwin_arches
5169 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5170 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
5171 darwin_file=
5172 darwin_files=
5173 for darwin_file in $darwin_filelist; do
5174 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
5175 $LIPO -create -output "$darwin_file" $darwin_files
5176 done # $darwin_filelist
5177 $RM -rf unfat-$$
5178 cd "$darwin_orig_dir"
5179 else
5180 cd $darwin_orig_dir
5181 func_extract_an_archive "$my_xdir" "$my_xabs"
5182 fi # $darwin_arches
5183 } # !$opt_dry_run
5184 ;;
5185 *)
5186 func_extract_an_archive "$my_xdir" "$my_xabs"
5187 ;;
5188 esac
5189 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
5190 done
5191
5192 func_extract_archives_result=$my_oldobjs
5193 }
5194
5195
5196 # func_emit_wrapper [arg=no]
5197 #
5198 # Emit a libtool wrapper script on stdout.
5199 # Don't directly open a file because we may want to
5200 # incorporate the script contents within a cygwin/mingw
5201 # wrapper executable. Must ONLY be called from within
5202 # func_mode_link because it depends on a number of variables
5203 # set therein.
5204 #
5205 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
5206 # variable will take. If 'yes', then the emitted script
5207 # will assume that the directory where it is stored is
5208 # the $objdir directory. This is a cygwin/mingw-specific
5209 # behavior.
5210 func_emit_wrapper ()
5211 {
5212 func_emit_wrapper_arg1=${1-no}
5213
5214 $ECHO "\
5215 #! $SHELL
5216
5217 # $output - temporary wrapper script for $objdir/$outputname
5218 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5219 #
5220 # The $output program cannot be directly executed until all the libtool
5221 # libraries that it depends on are installed.
5222 #
5223 # This wrapper script should never be moved out of the build directory.
5224 # If it is, it will not operate correctly.
5225
5226 # Sed substitution that helps us do robust quoting. It backslashifies
5227 # metacharacters that are still active within double-quoted strings.
5228 sed_quote_subst='$sed_quote_subst'
5229
5230 # Be Bourne compatible
5231 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5232 emulate sh
5233 NULLCMD=:
5234 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5235 # is contrary to our usage. Disable this feature.
5236 alias -g '\${1+\"\$@\"}'='\"\$@\"'
5237 setopt NO_GLOB_SUBST
5238 else
5239 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5240 fi
5241 BIN_SH=xpg4; export BIN_SH # for Tru64
5242 DUALCASE=1; export DUALCASE # for MKS sh
5243
5244 # The HP-UX ksh and POSIX shell print the target directory to stdout
5245 # if CDPATH is set.
5246 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5247
5248 relink_command=\"$relink_command\"
5249
5250 # This environment variable determines our operation mode.
5251 if test \"\$libtool_install_magic\" = \"$magic\"; then
5252 # install mode needs the following variables:
5253 generated_by_libtool_version='$macro_version'
5254 notinst_deplibs='$notinst_deplibs'
5255 else
5256 # When we are sourced in execute mode, \$file and \$ECHO are already set.
5257 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5258 file=\"\$0\""
5259
5260 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
5261 $ECHO "\
5262
5263 # A function that is used when there is no print builtin or printf.
5264 func_fallback_echo ()
5265 {
5266 eval 'cat <<_LTECHO_EOF
5267 \$1
5268 _LTECHO_EOF'
5269 }
5270 ECHO=\"$qECHO\"
5271 fi
5272
5273 # Very basic option parsing. These options are (a) specific to
5274 # the libtool wrapper, (b) are identical between the wrapper
5275 # /script/ and the wrapper /executable/ that is used only on
5276 # windows platforms, and (c) all begin with the string "--lt-"
5277 # (application programs are unlikely to have options that match
5278 # this pattern).
5279 #
5280 # There are only two supported options: --lt-debug and
5281 # --lt-dump-script. There is, deliberately, no --lt-help.
5282 #
5283 # The first argument to this parsing function should be the
5284 # script's $0 value, followed by "$@".
5285 lt_option_debug=
5286 func_parse_lt_options ()
5287 {
5288 lt_script_arg0=\$0
5289 shift
5290 for lt_opt
5291 do
5292 case \"\$lt_opt\" in
5293 --lt-debug) lt_option_debug=1 ;;
5294 --lt-dump-script)
5295 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
5296 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
5297 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
5298 cat \"\$lt_dump_D/\$lt_dump_F\"
5299 exit 0
5300 ;;
5301 --lt-*)
5302 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
5303 exit 1
5304 ;;
5305 esac
5306 done
5307
5308 # Print the debug banner immediately:
5309 if test -n \"\$lt_option_debug\"; then
5310 echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
5311 fi
5312 }
5313
5314 # Used when --lt-debug. Prints its arguments to stdout
5315 # (redirection is the responsibility of the caller)
5316 func_lt_dump_args ()
5317 {
5318 lt_dump_args_N=1;
5319 for lt_arg
5320 do
5321 \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
5322 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
5323 done
5324 }
5325
5326 # Core function for launching the target application
5327 func_exec_program_core ()
5328 {
5329 "
5330 case $host in
5331 # Backslashes separate directories on plain windows
5332 *-*-mingw | *-*-os2* | *-cegcc*)
5333 $ECHO "\
5334 if test -n \"\$lt_option_debug\"; then
5335 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
5336 func_lt_dump_args \${1+\"\$@\"} 1>&2
5337 fi
5338 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5339 "
5340 ;;
5341
5342 *)
5343 $ECHO "\
5344 if test -n \"\$lt_option_debug\"; then
5345 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
5346 func_lt_dump_args \${1+\"\$@\"} 1>&2
5347 fi
5348 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5349 "
5350 ;;
5351 esac
5352 $ECHO "\
5353 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
5354 exit 1
5355 }
5356
5357 # A function to encapsulate launching the target application
5358 # Strips options in the --lt-* namespace from \$@ and
5359 # launches target application with the remaining arguments.
5360 func_exec_program ()
5361 {
5362 case \" \$* \" in
5363 *\\ --lt-*)
5364 for lt_wr_arg
5365 do
5366 case \$lt_wr_arg in
5367 --lt-*) ;;
5368 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
5369 esac
5370 shift
5371 done ;;
5372 esac
5373 func_exec_program_core \${1+\"\$@\"}
5374 }
5375
5376 # Parse options
5377 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
5378
5379 # Find the directory that this script lives in.
5380 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
5381 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5382
5383 # Follow symbolic links until we get to the real thisdir.
5384 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
5385 while test -n \"\$file\"; do
5386 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
5387
5388 # If there was a directory component, then change thisdir.
5389 if test \"x\$destdir\" != \"x\$file\"; then
5390 case \"\$destdir\" in
5391 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5392 *) thisdir=\"\$thisdir/\$destdir\" ;;
5393 esac
5394 fi
5395
5396 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
5397 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
5398 done
5399
5400 # Usually 'no', except on cygwin/mingw when embedded into
5401 # the cwrapper.
5402 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
5403 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
5404 # special case for '.'
5405 if test \"\$thisdir\" = \".\"; then
5406 thisdir=\`pwd\`
5407 fi
5408 # remove .libs from thisdir
5409 case \"\$thisdir\" in
5410 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
5411 $objdir ) thisdir=. ;;
5412 esac
5413 fi
5414
5415 # Try to get the absolute directory name.
5416 absdir=\`cd \"\$thisdir\" && pwd\`
5417 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5418 "
5419
5420 if test yes = "$fast_install"; then
5421 $ECHO "\
5422 program=lt-'$outputname'$exeext
5423 progdir=\"\$thisdir/$objdir\"
5424
5425 if test ! -f \"\$progdir/\$program\" ||
5426 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
5427 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5428
5429 file=\"\$\$-\$program\"
5430
5431 if test ! -d \"\$progdir\"; then
5432 $MKDIR \"\$progdir\"
5433 else
5434 $RM \"\$progdir/\$file\"
5435 fi"
5436
5437 $ECHO "\
5438
5439 # relink executable if necessary
5440 if test -n \"\$relink_command\"; then
5441 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5442 else
5443 \$ECHO \"\$relink_command_output\" >&2
5444 $RM \"\$progdir/\$file\"
5445 exit 1
5446 fi
5447 fi
5448
5449 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5450 { $RM \"\$progdir/\$program\";
5451 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5452 $RM \"\$progdir/\$file\"
5453 fi"
5454 else
5455 $ECHO "\
5456 program='$outputname'
5457 progdir=\"\$thisdir/$objdir\"
5458 "
5459 fi
5460
5461 $ECHO "\
5462
5463 if test -f \"\$progdir/\$program\"; then"
5464
5465 # fixup the dll searchpath if we need to.
5466 #
5467 # Fix the DLL searchpath if we need to. Do this before prepending
5468 # to shlibpath, because on Windows, both are PATH and uninstalled
5469 # libraries must come first.
5470 if test -n "$dllsearchpath"; then
5471 $ECHO "\
5472 # Add the dll search path components to the executable PATH
5473 PATH=$dllsearchpath:\$PATH
5474 "
5475 fi
5476
5477 # Export our shlibpath_var if we have one.
5478 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5479 $ECHO "\
5480 # Add our own library path to $shlibpath_var
5481 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5482
5483 # Some systems cannot cope with colon-terminated $shlibpath_var
5484 # The second colon is a workaround for a bug in BeOS R4 sed
5485 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
5486
5487 export $shlibpath_var
5488 "
5489 fi
5490
5491 $ECHO "\
5492 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5493 # Run the actual program with our arguments.
5494 func_exec_program \${1+\"\$@\"}
5495 fi
5496 else
5497 # The program doesn't exist.
5498 \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
5499 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
5500 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
5501 exit 1
5502 fi
5503 fi\
5504 "
5505 }
5506
5507
5508 # func_emit_cwrapperexe_src
5509 # emit the source code for a wrapper executable on stdout
5510 # Must ONLY be called from within func_mode_link because
5511 # it depends on a number of variable set therein.
5512 func_emit_cwrapperexe_src ()
5513 {
5514 cat <<EOF
5515
5516 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5517 Generated by $PROGRAM (GNU $PACKAGE) $VERSION
5518
5519 The $output program cannot be directly executed until all the libtool
5520 libraries that it depends on are installed.
5521
5522 This wrapper executable should never be moved out of the build directory.
5523 If it is, it will not operate correctly.
5524 */
5525 EOF
5526 cat <<"EOF"
5527 #ifdef _MSC_VER
5528 # define _CRT_SECURE_NO_DEPRECATE 1
5529 #endif
5530 #include <stdio.h>
5531 #include <stdlib.h>
5532 #ifdef _MSC_VER
5533 # include <direct.h>
5534 # include <process.h>
5535 # include <io.h>
5536 #else
5537 # include <unistd.h>
5538 # include <stdint.h>
5539 # ifdef __CYGWIN__
5540 # include <io.h>
5541 # endif
5542 #endif
5543 #include <malloc.h>
5544 #include <stdarg.h>
5545 #include <assert.h>
5546 #include <string.h>
5547 #include <ctype.h>
5548 #include <errno.h>
5549 #include <fcntl.h>
5550 #include <sys/stat.h>
5551
5552 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5553
5554 /* declarations of non-ANSI functions */
5555 #if defined __MINGW32__
5556 # ifdef __STRICT_ANSI__
5557 int _putenv (const char *);
5558 # endif
5559 #elif defined __CYGWIN__
5560 # ifdef __STRICT_ANSI__
5561 char *realpath (const char *, char *);
5562 int putenv (char *);
5563 int setenv (const char *, const char *, int);
5564 # endif
5565 /* #elif defined other_platform || defined ... */
5566 #endif
5567
5568 /* portability defines, excluding path handling macros */
5569 #if defined _MSC_VER
5570 # define setmode _setmode
5571 # define stat _stat
5572 # define chmod _chmod
5573 # define getcwd _getcwd
5574 # define putenv _putenv
5575 # define S_IXUSR _S_IEXEC
5576 #elif defined __MINGW32__
5577 # define setmode _setmode
5578 # define stat _stat
5579 # define chmod _chmod
5580 # define getcwd _getcwd
5581 # define putenv _putenv
5582 #elif defined __CYGWIN__
5583 # define HAVE_SETENV
5584 # define FOPEN_WB "wb"
5585 /* #elif defined other platforms ... */
5586 #endif
5587
5588 #if defined PATH_MAX
5589 # define LT_PATHMAX PATH_MAX
5590 #elif defined MAXPATHLEN
5591 # define LT_PATHMAX MAXPATHLEN
5592 #else
5593 # define LT_PATHMAX 1024
5594 #endif
5595
5596 #ifndef S_IXOTH
5597 # define S_IXOTH 0
5598 #endif
5599 #ifndef S_IXGRP
5600 # define S_IXGRP 0
5601 #endif
5602
5603 /* path handling portability macros */
5604 #ifndef DIR_SEPARATOR
5605 # define DIR_SEPARATOR '/'
5606 # define PATH_SEPARATOR ':'
5607 #endif
5608
5609 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
5610 defined __OS2__
5611 # define HAVE_DOS_BASED_FILE_SYSTEM
5612 # define FOPEN_WB "wb"
5613 # ifndef DIR_SEPARATOR_2
5614 # define DIR_SEPARATOR_2 '\\'
5615 # endif
5616 # ifndef PATH_SEPARATOR_2
5617 # define PATH_SEPARATOR_2 ';'
5618 # endif
5619 #endif
5620
5621 #ifndef DIR_SEPARATOR_2
5622 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5623 #else /* DIR_SEPARATOR_2 */
5624 # define IS_DIR_SEPARATOR(ch) \
5625 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5626 #endif /* DIR_SEPARATOR_2 */
5627
5628 #ifndef PATH_SEPARATOR_2
5629 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5630 #else /* PATH_SEPARATOR_2 */
5631 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5632 #endif /* PATH_SEPARATOR_2 */
5633
5634 #ifndef FOPEN_WB
5635 # define FOPEN_WB "w"
5636 #endif
5637 #ifndef _O_BINARY
5638 # define _O_BINARY 0
5639 #endif
5640
5641 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5642 #define XFREE(stale) do { \
5643 if (stale) { free (stale); stale = 0; } \
5644 } while (0)
5645
5646 #if defined LT_DEBUGWRAPPER
5647 static int lt_debug = 1;
5648 #else
5649 static int lt_debug = 0;
5650 #endif
5651
5652 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
5653
5654 void *xmalloc (size_t num);
5655 char *xstrdup (const char *string);
5656 const char *base_name (const char *name);
5657 char *find_executable (const char *wrapper);
5658 char *chase_symlinks (const char *pathspec);
5659 int make_executable (const char *path);
5660 int check_executable (const char *path);
5661 char *strendzap (char *str, const char *pat);
5662 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
5663 void lt_fatal (const char *file, int line, const char *message, ...);
5664 static const char *nonnull (const char *s);
5665 static const char *nonempty (const char *s);
5666 void lt_setenv (const char *name, const char *value);
5667 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
5668 void lt_update_exe_path (const char *name, const char *value);
5669 void lt_update_lib_path (const char *name, const char *value);
5670 char **prepare_spawn (char **argv);
5671 void lt_dump_script (FILE *f);
5672 EOF
5673
5674 cat <<EOF
5675 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
5676 # define externally_visible volatile
5677 #else
5678 # define externally_visible __attribute__((externally_visible)) volatile
5679 #endif
5680 externally_visible const char * MAGIC_EXE = "$magic_exe";
5681 const char * LIB_PATH_VARNAME = "$shlibpath_var";
5682 EOF
5683
5684 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5685 func_to_host_path "$temp_rpath"
5686 cat <<EOF
5687 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
5688 EOF
5689 else
5690 cat <<"EOF"
5691 const char * LIB_PATH_VALUE = "";
5692 EOF
5693 fi
5694
5695 if test -n "$dllsearchpath"; then
5696 func_to_host_path "$dllsearchpath:"
5697 cat <<EOF
5698 const char * EXE_PATH_VARNAME = "PATH";
5699 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
5700 EOF
5701 else
5702 cat <<"EOF"
5703 const char * EXE_PATH_VARNAME = "";
5704 const char * EXE_PATH_VALUE = "";
5705 EOF
5706 fi
5707
5708 if test yes = "$fast_install"; then
5709 cat <<EOF
5710 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
5711 EOF
5712 else
5713 cat <<EOF
5714 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
5715 EOF
5716 fi
5717
5718
5719 cat <<"EOF"
5720
5721 #define LTWRAPPER_OPTION_PREFIX "--lt-"
5722
5723 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
5724 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
5725 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
5726
5727 int
5728 main (int argc, char *argv[])
5729 {
5730 char **newargz;
5731 int newargc;
5732 char *tmp_pathspec;
5733 char *actual_cwrapper_path;
5734 char *actual_cwrapper_name;
5735 char *target_name;
5736 char *lt_argv_zero;
5737 int rval = 127;
5738
5739 int i;
5740
5741 program_name = (char *) xstrdup (base_name (argv[0]));
5742 newargz = XMALLOC (char *, (size_t) argc + 1);
5743
5744 /* very simple arg parsing; don't want to rely on getopt
5745 * also, copy all non cwrapper options to newargz, except
5746 * argz[0], which is handled differently
5747 */
5748 newargc=0;
5749 for (i = 1; i < argc; i++)
5750 {
5751 if (STREQ (argv[i], dumpscript_opt))
5752 {
5753 EOF
5754 case $host in
5755 *mingw* | *cygwin* )
5756 # make stdout use "unix" line endings
5757 echo " setmode(1,_O_BINARY);"
5758 ;;
5759 esac
5760
5761 cat <<"EOF"
5762 lt_dump_script (stdout);
5763 return 0;
5764 }
5765 if (STREQ (argv[i], debug_opt))
5766 {
5767 lt_debug = 1;
5768 continue;
5769 }
5770 if (STREQ (argv[i], ltwrapper_option_prefix))
5771 {
5772 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
5773 namespace, but it is not one of the ones we know about and
5774 have already dealt with, above (inluding dump-script), then
5775 report an error. Otherwise, targets might begin to believe
5776 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
5777 namespace. The first time any user complains about this, we'll
5778 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
5779 or a configure.ac-settable value.
5780 */
5781 lt_fatal (__FILE__, __LINE__,
5782 "unrecognized %s option: '%s'",
5783 ltwrapper_option_prefix, argv[i]);
5784 }
5785 /* otherwise ... */
5786 newargz[++newargc] = xstrdup (argv[i]);
5787 }
5788 newargz[++newargc] = NULL;
5789
5790 EOF
5791 cat <<EOF
5792 /* The GNU banner must be the first non-error debug message */
5793 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
5794 EOF
5795 cat <<"EOF"
5796 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
5797 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
5798
5799 tmp_pathspec = find_executable (argv[0]);
5800 if (tmp_pathspec == NULL)
5801 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
5802 lt_debugprintf (__FILE__, __LINE__,
5803 "(main) found exe (before symlink chase) at: %s\n",
5804 tmp_pathspec);
5805
5806 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
5807 lt_debugprintf (__FILE__, __LINE__,
5808 "(main) found exe (after symlink chase) at: %s\n",
5809 actual_cwrapper_path);
5810 XFREE (tmp_pathspec);
5811
5812 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
5813 strendzap (actual_cwrapper_path, actual_cwrapper_name);
5814
5815 /* wrapper name transforms */
5816 strendzap (actual_cwrapper_name, ".exe");
5817 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
5818 XFREE (actual_cwrapper_name);
5819 actual_cwrapper_name = tmp_pathspec;
5820 tmp_pathspec = 0;
5821
5822 /* target_name transforms -- use actual target program name; might have lt- prefix */
5823 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
5824 strendzap (target_name, ".exe");
5825 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
5826 XFREE (target_name);
5827 target_name = tmp_pathspec;
5828 tmp_pathspec = 0;
5829
5830 lt_debugprintf (__FILE__, __LINE__,
5831 "(main) libtool target name: %s\n",
5832 target_name);
5833 EOF
5834
5835 cat <<EOF
5836 newargz[0] =
5837 XMALLOC (char, (strlen (actual_cwrapper_path) +
5838 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
5839 strcpy (newargz[0], actual_cwrapper_path);
5840 strcat (newargz[0], "$objdir");
5841 strcat (newargz[0], "/");
5842 EOF
5843
5844 cat <<"EOF"
5845 /* stop here, and copy so we don't have to do this twice */
5846 tmp_pathspec = xstrdup (newargz[0]);
5847
5848 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
5849 strcat (newargz[0], actual_cwrapper_name);
5850
5851 /* DO want the lt- prefix here if it exists, so use target_name */
5852 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
5853 XFREE (tmp_pathspec);
5854 tmp_pathspec = NULL;
5855 EOF
5856
5857 case $host_os in
5858 mingw*)
5859 cat <<"EOF"
5860 {
5861 char* p;
5862 while ((p = strchr (newargz[0], '\\')) != NULL)
5863 {
5864 *p = '/';
5865 }
5866 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
5867 {
5868 *p = '/';
5869 }
5870 }
5871 EOF
5872 ;;
5873 esac
5874
5875 cat <<"EOF"
5876 XFREE (target_name);
5877 XFREE (actual_cwrapper_path);
5878 XFREE (actual_cwrapper_name);
5879
5880 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
5881 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
5882 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
5883 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
5884 because on Windows, both *_VARNAMEs are PATH but uninstalled
5885 libraries must come first. */
5886 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
5887 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
5888
5889 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
5890 nonnull (lt_argv_zero));
5891 for (i = 0; i < newargc; i++)
5892 {
5893 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
5894 i, nonnull (newargz[i]));
5895 }
5896
5897 EOF
5898
5899 case $host_os in
5900 mingw*)
5901 cat <<"EOF"
5902 /* execv doesn't actually work on mingw as expected on unix */
5903 newargz = prepare_spawn (newargz);
5904 rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
5905 if (rval == -1)
5906 {
5907 /* failed to start process */
5908 lt_debugprintf (__FILE__, __LINE__,
5909 "(main) failed to launch target \"%s\": %s\n",
5910 lt_argv_zero, nonnull (strerror (errno)));
5911 return 127;
5912 }
5913 return rval;
5914 EOF
5915 ;;
5916 *)
5917 cat <<"EOF"
5918 execv (lt_argv_zero, newargz);
5919 return rval; /* =127, but avoids unused variable warning */
5920 EOF
5921 ;;
5922 esac
5923
5924 cat <<"EOF"
5925 }
5926
5927 void *
5928 xmalloc (size_t num)
5929 {
5930 void *p = (void *) malloc (num);
5931 if (!p)
5932 lt_fatal (__FILE__, __LINE__, "memory exhausted");
5933
5934 return p;
5935 }
5936
5937 char *
5938 xstrdup (const char *string)
5939 {
5940 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
5941 string) : NULL;
5942 }
5943
5944 const char *
5945 base_name (const char *name)
5946 {
5947 const char *base;
5948
5949 #if defined HAVE_DOS_BASED_FILE_SYSTEM
5950 /* Skip over the disk name in MSDOS pathnames. */
5951 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
5952 name += 2;
5953 #endif
5954
5955 for (base = name; *name; name++)
5956 if (IS_DIR_SEPARATOR (*name))
5957 base = name + 1;
5958 return base;
5959 }
5960
5961 int
5962 check_executable (const char *path)
5963 {
5964 struct stat st;
5965
5966 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
5967 nonempty (path));
5968 if ((!path) || (!*path))
5969 return 0;
5970
5971 if ((stat (path, &st) >= 0)
5972 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
5973 return 1;
5974 else
5975 return 0;
5976 }
5977
5978 int
5979 make_executable (const char *path)
5980 {
5981 int rval = 0;
5982 struct stat st;
5983
5984 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
5985 nonempty (path));
5986 if ((!path) || (!*path))
5987 return 0;
5988
5989 if (stat (path, &st) >= 0)
5990 {
5991 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
5992 }
5993 return rval;
5994 }
5995
5996 /* Searches for the full path of the wrapper. Returns
5997 newly allocated full path name if found, NULL otherwise
5998 Does not chase symlinks, even on platforms that support them.
5999 */
6000 char *
6001 find_executable (const char *wrapper)
6002 {
6003 int has_slash = 0;
6004 const char *p;
6005 const char *p_next;
6006 /* static buffer for getcwd */
6007 char tmp[LT_PATHMAX + 1];
6008 size_t tmp_len;
6009 char *concat_name;
6010
6011 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
6012 nonempty (wrapper));
6013
6014 if ((wrapper == NULL) || (*wrapper == '\0'))
6015 return NULL;
6016
6017 /* Absolute path? */
6018 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6019 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
6020 {
6021 concat_name = xstrdup (wrapper);
6022 if (check_executable (concat_name))
6023 return concat_name;
6024 XFREE (concat_name);
6025 }
6026 else
6027 {
6028 #endif
6029 if (IS_DIR_SEPARATOR (wrapper[0]))
6030 {
6031 concat_name = xstrdup (wrapper);
6032 if (check_executable (concat_name))
6033 return concat_name;
6034 XFREE (concat_name);
6035 }
6036 #if defined HAVE_DOS_BASED_FILE_SYSTEM
6037 }
6038 #endif
6039
6040 for (p = wrapper; *p; p++)
6041 if (*p == '/')
6042 {
6043 has_slash = 1;
6044 break;
6045 }
6046 if (!has_slash)
6047 {
6048 /* no slashes; search PATH */
6049 const char *path = getenv ("PATH");
6050 if (path != NULL)
6051 {
6052 for (p = path; *p; p = p_next)
6053 {
6054 const char *q;
6055 size_t p_len;
6056 for (q = p; *q; q++)
6057 if (IS_PATH_SEPARATOR (*q))
6058 break;
6059 p_len = (size_t) (q - p);
6060 p_next = (*q == '\0' ? q : q + 1);
6061 if (p_len == 0)
6062 {
6063 /* empty path: current directory */
6064 if (getcwd (tmp, LT_PATHMAX) == NULL)
6065 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6066 nonnull (strerror (errno)));
6067 tmp_len = strlen (tmp);
6068 concat_name =
6069 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6070 memcpy (concat_name, tmp, tmp_len);
6071 concat_name[tmp_len] = '/';
6072 strcpy (concat_name + tmp_len + 1, wrapper);
6073 }
6074 else
6075 {
6076 concat_name =
6077 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
6078 memcpy (concat_name, p, p_len);
6079 concat_name[p_len] = '/';
6080 strcpy (concat_name + p_len + 1, wrapper);
6081 }
6082 if (check_executable (concat_name))
6083 return concat_name;
6084 XFREE (concat_name);
6085 }
6086 }
6087 /* not found in PATH; assume curdir */
6088 }
6089 /* Relative path | not found in path: prepend cwd */
6090 if (getcwd (tmp, LT_PATHMAX) == NULL)
6091 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
6092 nonnull (strerror (errno)));
6093 tmp_len = strlen (tmp);
6094 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6095 memcpy (concat_name, tmp, tmp_len);
6096 concat_name[tmp_len] = '/';
6097 strcpy (concat_name + tmp_len + 1, wrapper);
6098
6099 if (check_executable (concat_name))
6100 return concat_name;
6101 XFREE (concat_name);
6102 return NULL;
6103 }
6104
6105 char *
6106 chase_symlinks (const char *pathspec)
6107 {
6108 #ifndef S_ISLNK
6109 return xstrdup (pathspec);
6110 #else
6111 char buf[LT_PATHMAX];
6112 struct stat s;
6113 char *tmp_pathspec = xstrdup (pathspec);
6114 char *p;
6115 int has_symlinks = 0;
6116 while (strlen (tmp_pathspec) && !has_symlinks)
6117 {
6118 lt_debugprintf (__FILE__, __LINE__,
6119 "checking path component for symlinks: %s\n",
6120 tmp_pathspec);
6121 if (lstat (tmp_pathspec, &s) == 0)
6122 {
6123 if (S_ISLNK (s.st_mode) != 0)
6124 {
6125 has_symlinks = 1;
6126 break;
6127 }
6128
6129 /* search backwards for last DIR_SEPARATOR */
6130 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
6131 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6132 p--;
6133 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
6134 {
6135 /* no more DIR_SEPARATORS left */
6136 break;
6137 }
6138 *p = '\0';
6139 }
6140 else
6141 {
6142 lt_fatal (__FILE__, __LINE__,
6143 "error accessing file \"%s\": %s",
6144 tmp_pathspec, nonnull (strerror (errno)));
6145 }
6146 }
6147 XFREE (tmp_pathspec);
6148
6149 if (!has_symlinks)
6150 {
6151 return xstrdup (pathspec);
6152 }
6153
6154 tmp_pathspec = realpath (pathspec, buf);
6155 if (tmp_pathspec == 0)
6156 {
6157 lt_fatal (__FILE__, __LINE__,
6158 "could not follow symlinks for %s", pathspec);
6159 }
6160 return xstrdup (tmp_pathspec);
6161 #endif
6162 }
6163
6164 char *
6165 strendzap (char *str, const char *pat)
6166 {
6167 size_t len, patlen;
6168
6169 assert (str != NULL);
6170 assert (pat != NULL);
6171
6172 len = strlen (str);
6173 patlen = strlen (pat);
6174
6175 if (patlen <= len)
6176 {
6177 str += len - patlen;
6178 if (STREQ (str, pat))
6179 *str = '\0';
6180 }
6181 return str;
6182 }
6183
6184 void
6185 lt_debugprintf (const char *file, int line, const char *fmt, ...)
6186 {
6187 va_list args;
6188 if (lt_debug)
6189 {
6190 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
6191 va_start (args, fmt);
6192 (void) vfprintf (stderr, fmt, args);
6193 va_end (args);
6194 }
6195 }
6196
6197 static void
6198 lt_error_core (int exit_status, const char *file,
6199 int line, const char *mode,
6200 const char *message, va_list ap)
6201 {
6202 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
6203 vfprintf (stderr, message, ap);
6204 fprintf (stderr, ".\n");
6205
6206 if (exit_status >= 0)
6207 exit (exit_status);
6208 }
6209
6210 void
6211 lt_fatal (const char *file, int line, const char *message, ...)
6212 {
6213 va_list ap;
6214 va_start (ap, message);
6215 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
6216 va_end (ap);
6217 }
6218
6219 static const char *
6220 nonnull (const char *s)
6221 {
6222 return s ? s : "(null)";
6223 }
6224
6225 static const char *
6226 nonempty (const char *s)
6227 {
6228 return (s && !*s) ? "(empty)" : nonnull (s);
6229 }
6230
6231 void
6232 lt_setenv (const char *name, const char *value)
6233 {
6234 lt_debugprintf (__FILE__, __LINE__,
6235 "(lt_setenv) setting '%s' to '%s'\n",
6236 nonnull (name), nonnull (value));
6237 {
6238 #ifdef HAVE_SETENV
6239 /* always make a copy, for consistency with !HAVE_SETENV */
6240 char *str = xstrdup (value);
6241 setenv (name, str, 1);
6242 #else
6243 size_t len = strlen (name) + 1 + strlen (value) + 1;
6244 char *str = XMALLOC (char, len);
6245 sprintf (str, "%s=%s", name, value);
6246 if (putenv (str) != EXIT_SUCCESS)
6247 {
6248 XFREE (str);
6249 }
6250 #endif
6251 }
6252 }
6253
6254 char *
6255 lt_extend_str (const char *orig_value, const char *add, int to_end)
6256 {
6257 char *new_value;
6258 if (orig_value && *orig_value)
6259 {
6260 size_t orig_value_len = strlen (orig_value);
6261 size_t add_len = strlen (add);
6262 new_value = XMALLOC (char, add_len + orig_value_len + 1);
6263 if (to_end)
6264 {
6265 strcpy (new_value, orig_value);
6266 strcpy (new_value + orig_value_len, add);
6267 }
6268 else
6269 {
6270 strcpy (new_value, add);
6271 strcpy (new_value + add_len, orig_value);
6272 }
6273 }
6274 else
6275 {
6276 new_value = xstrdup (add);
6277 }
6278 return new_value;
6279 }
6280
6281 void
6282 lt_update_exe_path (const char *name, const char *value)
6283 {
6284 lt_debugprintf (__FILE__, __LINE__,
6285 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
6286 nonnull (name), nonnull (value));
6287
6288 if (name && *name && value && *value)
6289 {
6290 char *new_value = lt_extend_str (getenv (name), value, 0);
6291 /* some systems can't cope with a ':'-terminated path #' */
6292 size_t len = strlen (new_value);
6293 while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
6294 {
6295 new_value[--len] = '\0';
6296 }
6297 lt_setenv (name, new_value);
6298 XFREE (new_value);
6299 }
6300 }
6301
6302 void
6303 lt_update_lib_path (const char *name, const char *value)
6304 {
6305 lt_debugprintf (__FILE__, __LINE__,
6306 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
6307 nonnull (name), nonnull (value));
6308
6309 if (name && *name && value && *value)
6310 {
6311 char *new_value = lt_extend_str (getenv (name), value, 0);
6312 lt_setenv (name, new_value);
6313 XFREE (new_value);
6314 }
6315 }
6316
6317 EOF
6318 case $host_os in
6319 mingw*)
6320 cat <<"EOF"
6321
6322 /* Prepares an argument vector before calling spawn().
6323 Note that spawn() does not by itself call the command interpreter
6324 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
6325 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
6326 GetVersionEx(&v);
6327 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
6328 }) ? "cmd.exe" : "command.com").
6329 Instead it simply concatenates the arguments, separated by ' ', and calls
6330 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
6331 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
6332 special way:
6333 - Space and tab are interpreted as delimiters. They are not treated as
6334 delimiters if they are surrounded by double quotes: "...".
6335 - Unescaped double quotes are removed from the input. Their only effect is
6336 that within double quotes, space and tab are treated like normal
6337 characters.
6338 - Backslashes not followed by double quotes are not special.
6339 - But 2*n+1 backslashes followed by a double quote become
6340 n backslashes followed by a double quote (n >= 0):
6341 \" -> "
6342 \\\" -> \"
6343 \\\\\" -> \\"
6344 */
6345 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
6346 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
6347 char **
6348 prepare_spawn (char **argv)
6349 {
6350 size_t argc;
6351 char **new_argv;
6352 size_t i;
6353
6354 /* Count number of arguments. */
6355 for (argc = 0; argv[argc] != NULL; argc++)
6356 ;
6357
6358 /* Allocate new argument vector. */
6359 new_argv = XMALLOC (char *, argc + 1);
6360
6361 /* Put quoted arguments into the new argument vector. */
6362 for (i = 0; i < argc; i++)
6363 {
6364 const char *string = argv[i];
6365
6366 if (string[0] == '\0')
6367 new_argv[i] = xstrdup ("\"\"");
6368 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
6369 {
6370 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
6371 size_t length;
6372 unsigned int backslashes;
6373 const char *s;
6374 char *quoted_string;
6375 char *p;
6376
6377 length = 0;
6378 backslashes = 0;
6379 if (quote_around)
6380 length++;
6381 for (s = string; *s != '\0'; s++)
6382 {
6383 char c = *s;
6384 if (c == '"')
6385 length += backslashes + 1;
6386 length++;
6387 if (c == '\\')
6388 backslashes++;
6389 else
6390 backslashes = 0;
6391 }
6392 if (quote_around)
6393 length += backslashes + 1;
6394
6395 quoted_string = XMALLOC (char, length + 1);
6396
6397 p = quoted_string;
6398 backslashes = 0;
6399 if (quote_around)
6400 *p++ = '"';
6401 for (s = string; *s != '\0'; s++)
6402 {
6403 char c = *s;
6404 if (c == '"')
6405 {
6406 unsigned int j;
6407 for (j = backslashes + 1; j > 0; j--)
6408 *p++ = '\\';
6409 }
6410 *p++ = c;
6411 if (c == '\\')
6412 backslashes++;
6413 else
6414 backslashes = 0;
6415 }
6416 if (quote_around)
6417 {
6418 unsigned int j;
6419 for (j = backslashes; j > 0; j--)
6420 *p++ = '\\';
6421 *p++ = '"';
6422 }
6423 *p = '\0';
6424
6425 new_argv[i] = quoted_string;
6426 }
6427 else
6428 new_argv[i] = (char *) string;
6429 }
6430 new_argv[argc] = NULL;
6431
6432 return new_argv;
6433 }
6434 EOF
6435 ;;
6436 esac
6437
6438 cat <<"EOF"
6439 void lt_dump_script (FILE* f)
6440 {
6441 EOF
6442 func_emit_wrapper yes |
6443 $SED -n -e '
6444 s/^\(.\{79\}\)\(..*\)/\1\
6445 \2/
6446 h
6447 s/\([\\"]\)/\\\1/g
6448 s/$/\\n/
6449 s/\([^\n]*\).*/ fputs ("\1", f);/p
6450 g
6451 D'
6452 cat <<"EOF"
6453 }
6454 EOF
6455 }
6456 # end: func_emit_cwrapperexe_src
6457
6458 # func_win32_import_lib_p ARG
6459 # True if ARG is an import lib, as indicated by $file_magic_cmd
6460 func_win32_import_lib_p ()
6461 {
6462 $debug_cmd
6463
6464 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
6465 *import*) : ;;
6466 *) false ;;
6467 esac
6468 }
6469
6470 # func_suncc_cstd_abi
6471 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6472 # Several compiler flags select an ABI that is incompatible with the
6473 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
6474 func_suncc_cstd_abi ()
6475 {
6476 $debug_cmd
6477
6478 case " $compile_command " in
6479 *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
6480 suncc_use_cstd_abi=no
6481 ;;
6482 *)
6483 suncc_use_cstd_abi=yes
6484 ;;
6485 esac
6486 }
6487
6488 # func_mode_link arg...
6489 func_mode_link ()
6490 {
6491 $debug_cmd
6492
6493 case $host in
6494 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6495 # It is impossible to link a dll without this setting, and
6496 # we shouldn't force the makefile maintainer to figure out
6497 # what system we are compiling for in order to pass an extra
6498 # flag for every libtool invocation.
6499 # allow_undefined=no
6500
6501 # FIXME: Unfortunately, there are problems with the above when trying
6502 # to make a dll that has undefined symbols, in which case not
6503 # even a static library is built. For now, we need to specify
6504 # -no-undefined on the libtool link line when we can be certain
6505 # that all symbols are satisfied, otherwise we get a static library.
6506 allow_undefined=yes
6507 ;;
6508 *)
6509 allow_undefined=yes
6510 ;;
6511 esac
6512 libtool_args=$nonopt
6513 base_compile="$nonopt $@"
6514 compile_command=$nonopt
6515 finalize_command=$nonopt
6516
6517 compile_rpath=
6518 finalize_rpath=
6519 compile_shlibpath=
6520 finalize_shlibpath=
6521 convenience=
6522 old_convenience=
6523 deplibs=
6524 old_deplibs=
6525 compiler_flags=
6526 linker_flags=
6527 dllsearchpath=
6528 lib_search_path=`pwd`
6529 inst_prefix_dir=
6530 new_inherited_linker_flags=
6531
6532 avoid_version=no
6533 bindir=
6534 dlfiles=
6535 dlprefiles=
6536 dlself=no
6537 export_dynamic=no
6538 export_symbols=
6539 export_symbols_regex=
6540 generated=
6541 libobjs=
6542 ltlibs=
6543 module=no
6544 no_install=no
6545 objs=
6546 os2dllname=
6547 non_pic_objects=
6548 precious_files_regex=
6549 prefer_static_libs=no
6550 preload=false
6551 prev=
6552 prevarg=
6553 release=
6554 rpath=
6555 xrpath=
6556 perm_rpath=
6557 temp_rpath=
6558 thread_safe=no
6559 vinfo=
6560 vinfo_number=no
6561 weak_libs=
6562 single_module=$wl-single_module
6563 func_infer_tag $base_compile
6564
6565 # We need to know -static, to get the right output filenames.
6566 for arg
6567 do
6568 case $arg in
6569 -shared)
6570 test yes != "$build_libtool_libs" \
6571 && func_fatal_configuration "cannot build a shared library"
6572 build_old_libs=no
6573 break
6574 ;;
6575 -all-static | -static | -static-libtool-libs)
6576 case $arg in
6577 -all-static)
6578 if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
6579 func_warning "complete static linking is impossible in this configuration"
6580 fi
6581 if test -n "$link_static_flag"; then
6582 dlopen_self=$dlopen_self_static
6583 fi
6584 prefer_static_libs=yes
6585 ;;
6586 -static)
6587 if test -z "$pic_flag" && test -n "$link_static_flag"; then
6588 dlopen_self=$dlopen_self_static
6589 fi
6590 prefer_static_libs=built
6591 ;;
6592 -static-libtool-libs)
6593 if test -z "$pic_flag" && test -n "$link_static_flag"; then
6594 dlopen_self=$dlopen_self_static
6595 fi
6596 prefer_static_libs=yes
6597 ;;
6598 esac
6599 build_libtool_libs=no
6600 build_old_libs=yes
6601 break
6602 ;;
6603 esac
6604 done
6605
6606 # See if our shared archives depend on static archives.
6607 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
6608
6609 # Go through the arguments, transforming them on the way.
6610 while test "$#" -gt 0; do
6611 arg=$1
6612 shift
6613 func_quote_for_eval "$arg"
6614 qarg=$func_quote_for_eval_unquoted_result
6615 func_append libtool_args " $func_quote_for_eval_result"
6616
6617 # If the previous option needs an argument, assign it.
6618 if test -n "$prev"; then
6619 case $prev in
6620 output)
6621 func_append compile_command " @OUTPUT@"
6622 func_append finalize_command " @OUTPUT@"
6623 ;;
6624 esac
6625
6626 case $prev in
6627 bindir)
6628 bindir=$arg
6629 prev=
6630 continue
6631 ;;
6632 dlfiles|dlprefiles)
6633 $preload || {
6634 # Add the symbol object into the linking commands.
6635 func_append compile_command " @SYMFILE@"
6636 func_append finalize_command " @SYMFILE@"
6637 preload=:
6638 }
6639 case $arg in
6640 *.la | *.lo) ;; # We handle these cases below.
6641 force)
6642 if test no = "$dlself"; then
6643 dlself=needless
6644 export_dynamic=yes
6645 fi
6646 prev=
6647 continue
6648 ;;
6649 self)
6650 if test dlprefiles = "$prev"; then
6651 dlself=yes
6652 elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
6653 dlself=yes
6654 else
6655 dlself=needless
6656 export_dynamic=yes
6657 fi
6658 prev=
6659 continue
6660 ;;
6661 *)
6662 if test dlfiles = "$prev"; then
6663 func_append dlfiles " $arg"
6664 else
6665 func_append dlprefiles " $arg"
6666 fi
6667 prev=
6668 continue
6669 ;;
6670 esac
6671 ;;
6672 expsyms)
6673 export_symbols=$arg
6674 test -f "$arg" \
6675 || func_fatal_error "symbol file '$arg' does not exist"
6676 prev=
6677 continue
6678 ;;
6679 expsyms_regex)
6680 export_symbols_regex=$arg
6681 prev=
6682 continue
6683 ;;
6684 framework)
6685 case $host in
6686 *-*-darwin*)
6687 case "$deplibs " in
6688 *" $qarg.ltframework "*) ;;
6689 *) func_append deplibs " $qarg.ltframework" # this is fixed later
6690 ;;
6691 esac
6692 ;;
6693 esac
6694 prev=
6695 continue
6696 ;;
6697 inst_prefix)
6698 inst_prefix_dir=$arg
6699 prev=
6700 continue
6701 ;;
6702 mllvm)
6703 # Clang does not use LLVM to link, so we can simply discard any
6704 # '-mllvm $arg' options when doing the link step.
6705 prev=
6706 continue
6707 ;;
6708 objectlist)
6709 if test -f "$arg"; then
6710 save_arg=$arg
6711 moreargs=
6712 for fil in `cat "$save_arg"`
6713 do
6714 # func_append moreargs " $fil"
6715 arg=$fil
6716 # A libtool-controlled object.
6717
6718 # Check to see that this really is a libtool object.
6719 if func_lalib_unsafe_p "$arg"; then
6720 pic_object=
6721 non_pic_object=
6722
6723 # Read the .lo file
6724 func_source "$arg"
6725
6726 if test -z "$pic_object" ||
6727 test -z "$non_pic_object" ||
6728 test none = "$pic_object" &&
6729 test none = "$non_pic_object"; then
6730 func_fatal_error "cannot find name of object for '$arg'"
6731 fi
6732
6733 # Extract subdirectory from the argument.
6734 func_dirname "$arg" "/" ""
6735 xdir=$func_dirname_result
6736
6737 if test none != "$pic_object"; then
6738 # Prepend the subdirectory the object is found in.
6739 pic_object=$xdir$pic_object
6740
6741 if test dlfiles = "$prev"; then
6742 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
6743 func_append dlfiles " $pic_object"
6744 prev=
6745 continue
6746 else
6747 # If libtool objects are unsupported, then we need to preload.
6748 prev=dlprefiles
6749 fi
6750 fi
6751
6752 # CHECK ME: I think I busted this. -Ossama
6753 if test dlprefiles = "$prev"; then
6754 # Preload the old-style object.
6755 func_append dlprefiles " $pic_object"
6756 prev=
6757 fi
6758
6759 # A PIC object.
6760 func_append libobjs " $pic_object"
6761 arg=$pic_object
6762 fi
6763
6764 # Non-PIC object.
6765 if test none != "$non_pic_object"; then
6766 # Prepend the subdirectory the object is found in.
6767 non_pic_object=$xdir$non_pic_object
6768
6769 # A standard non-PIC object
6770 func_append non_pic_objects " $non_pic_object"
6771 if test -z "$pic_object" || test none = "$pic_object"; then
6772 arg=$non_pic_object
6773 fi
6774 else
6775 # If the PIC object exists, use it instead.
6776 # $xdir was prepended to $pic_object above.
6777 non_pic_object=$pic_object
6778 func_append non_pic_objects " $non_pic_object"
6779 fi
6780 else
6781 # Only an error if not doing a dry-run.
6782 if $opt_dry_run; then
6783 # Extract subdirectory from the argument.
6784 func_dirname "$arg" "/" ""
6785 xdir=$func_dirname_result
6786
6787 func_lo2o "$arg"
6788 pic_object=$xdir$objdir/$func_lo2o_result
6789 non_pic_object=$xdir$func_lo2o_result
6790 func_append libobjs " $pic_object"
6791 func_append non_pic_objects " $non_pic_object"
6792 else
6793 func_fatal_error "'$arg' is not a valid libtool object"
6794 fi
6795 fi
6796 done
6797 else
6798 func_fatal_error "link input file '$arg' does not exist"
6799 fi
6800 arg=$save_arg
6801 prev=
6802 continue
6803 ;;
6804 os2dllname)
6805 os2dllname=$arg
6806 prev=
6807 continue
6808 ;;
6809 precious_regex)
6810 precious_files_regex=$arg
6811 prev=
6812 continue
6813 ;;
6814 release)
6815 release=-$arg
6816 prev=
6817 continue
6818 ;;
6819 rpath | xrpath)
6820 # We need an absolute path.
6821 case $arg in
6822 [\\/]* | [A-Za-z]:[\\/]*) ;;
6823 *)
6824 func_fatal_error "only absolute run-paths are allowed"
6825 ;;
6826 esac
6827 if test rpath = "$prev"; then
6828 case "$rpath " in
6829 *" $arg "*) ;;
6830 *) func_append rpath " $arg" ;;
6831 esac
6832 else
6833 case "$xrpath " in
6834 *" $arg "*) ;;
6835 *) func_append xrpath " $arg" ;;
6836 esac
6837 fi
6838 prev=
6839 continue
6840 ;;
6841 shrext)
6842 shrext_cmds=$arg
6843 prev=
6844 continue
6845 ;;
6846 weak)
6847 func_append weak_libs " $arg"
6848 prev=
6849 continue
6850 ;;
6851 xcclinker)
6852 func_append linker_flags " $qarg"
6853 func_append compiler_flags " $qarg"
6854 prev=
6855 func_append compile_command " $qarg"
6856 func_append finalize_command " $qarg"
6857 continue
6858 ;;
6859 xcompiler)
6860 func_append compiler_flags " $qarg"
6861 prev=
6862 func_append compile_command " $qarg"
6863 func_append finalize_command " $qarg"
6864 continue
6865 ;;
6866 xlinker)
6867 func_append linker_flags " $qarg"
6868 func_append compiler_flags " $wl$qarg"
6869 prev=
6870 func_append compile_command " $wl$qarg"
6871 func_append finalize_command " $wl$qarg"
6872 continue
6873 ;;
6874 *)
6875 eval "$prev=\"\$arg\""
6876 prev=
6877 continue
6878 ;;
6879 esac
6880 fi # test -n "$prev"
6881
6882 prevarg=$arg
6883
6884 case $arg in
6885 -all-static)
6886 if test -n "$link_static_flag"; then
6887 # See comment for -static flag below, for more details.
6888 func_append compile_command " $link_static_flag"
6889 func_append finalize_command " $link_static_flag"
6890 fi
6891 continue
6892 ;;
6893
6894 -allow-undefined)
6895 # FIXME: remove this flag sometime in the future.
6896 func_fatal_error "'-allow-undefined' must not be used because it is the default"
6897 ;;
6898
6899 -avoid-version)
6900 avoid_version=yes
6901 continue
6902 ;;
6903
6904 -bindir)
6905 prev=bindir
6906 continue
6907 ;;
6908
6909 -dlopen)
6910 prev=dlfiles
6911 continue
6912 ;;
6913
6914 -dlpreopen)
6915 prev=dlprefiles
6916 continue
6917 ;;
6918
6919 -export-dynamic)
6920 export_dynamic=yes
6921 continue
6922 ;;
6923
6924 -export-symbols | -export-symbols-regex)
6925 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
6926 func_fatal_error "more than one -exported-symbols argument is not allowed"
6927 fi
6928 if test X-export-symbols = "X$arg"; then
6929 prev=expsyms
6930 else
6931 prev=expsyms_regex
6932 fi
6933 continue
6934 ;;
6935
6936 -framework)
6937 prev=framework
6938 continue
6939 ;;
6940
6941 -inst-prefix-dir)
6942 prev=inst_prefix
6943 continue
6944 ;;
6945
6946 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
6947 # so, if we see these flags be careful not to treat them like -L
6948 -L[A-Z][A-Z]*:*)
6949 case $with_gcc/$host in
6950 no/*-*-irix* | /*-*-irix*)
6951 func_append compile_command " $arg"
6952 func_append finalize_command " $arg"
6953 ;;
6954 esac
6955 continue
6956 ;;
6957
6958 -L*)
6959 func_stripname "-L" '' "$arg"
6960 if test -z "$func_stripname_result"; then
6961 if test "$#" -gt 0; then
6962 func_fatal_error "require no space between '-L' and '$1'"
6963 else
6964 func_fatal_error "need path for '-L' option"
6965 fi
6966 fi
6967 func_resolve_sysroot "$func_stripname_result"
6968 dir=$func_resolve_sysroot_result
6969 # We need an absolute path.
6970 case $dir in
6971 [\\/]* | [A-Za-z]:[\\/]*) ;;
6972 *)
6973 absdir=`cd "$dir" && pwd`
6974 test -z "$absdir" && \
6975 func_fatal_error "cannot determine absolute directory name of '$dir'"
6976 dir=$absdir
6977 ;;
6978 esac
6979 case "$deplibs " in
6980 *" -L$dir "* | *" $arg "*)
6981 # Will only happen for absolute or sysroot arguments
6982 ;;
6983 *)
6984 # Preserve sysroot, but never include relative directories
6985 case $dir in
6986 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
6987 *) func_append deplibs " -L$dir" ;;
6988 esac
6989 func_append lib_search_path " $dir"
6990 ;;
6991 esac
6992 case $host in
6993 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6994 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
6995 case :$dllsearchpath: in
6996 *":$dir:"*) ;;
6997 ::) dllsearchpath=$dir;;
6998 *) func_append dllsearchpath ":$dir";;
6999 esac
7000 case :$dllsearchpath: in
7001 *":$testbindir:"*) ;;
7002 ::) dllsearchpath=$testbindir;;
7003 *) func_append dllsearchpath ":$testbindir";;
7004 esac
7005 ;;
7006 esac
7007 continue
7008 ;;
7009
7010 -l*)
7011 if test X-lc = "X$arg" || test X-lm = "X$arg"; then
7012 case $host in
7013 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
7014 # These systems don't actually have a C or math library (as such)
7015 continue
7016 ;;
7017 *-*-os2*)
7018 # These systems don't actually have a C library (as such)
7019 test X-lc = "X$arg" && continue
7020 ;;
7021 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
7022 # Do not include libc due to us having libc/libc_r.
7023 test X-lc = "X$arg" && continue
7024 ;;
7025 *-*-rhapsody* | *-*-darwin1.[012])
7026 # Rhapsody C and math libraries are in the System framework
7027 func_append deplibs " System.ltframework"
7028 continue
7029 ;;
7030 *-*-sco3.2v5* | *-*-sco5v6*)
7031 # Causes problems with __ctype
7032 test X-lc = "X$arg" && continue
7033 ;;
7034 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7035 # Compiler inserts libc in the correct place for threads to work
7036 test X-lc = "X$arg" && continue
7037 ;;
7038 esac
7039 elif test X-lc_r = "X$arg"; then
7040 case $host in
7041 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
7042 # Do not include libc_r directly, use -pthread flag.
7043 continue
7044 ;;
7045 esac
7046 fi
7047 func_append deplibs " $arg"
7048 continue
7049 ;;
7050
7051 -mllvm)
7052 prev=mllvm
7053 continue
7054 ;;
7055
7056 -module)
7057 module=yes
7058 continue
7059 ;;
7060
7061 # Tru64 UNIX uses -model [arg] to determine the layout of C++
7062 # classes, name mangling, and exception handling.
7063 # Darwin uses the -arch flag to determine output architecture.
7064 -model|-arch|-isysroot|--sysroot)
7065 func_append compiler_flags " $arg"
7066 func_append compile_command " $arg"
7067 func_append finalize_command " $arg"
7068 prev=xcompiler
7069 continue
7070 ;;
7071
7072 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
7073 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7074 func_append compiler_flags " $arg"
7075 func_append compile_command " $arg"
7076 func_append finalize_command " $arg"
7077 case "$new_inherited_linker_flags " in
7078 *" $arg "*) ;;
7079 * ) func_append new_inherited_linker_flags " $arg" ;;
7080 esac
7081 continue
7082 ;;
7083
7084 -multi_module)
7085 single_module=$wl-multi_module
7086 continue
7087 ;;
7088
7089 -no-fast-install)
7090 fast_install=no
7091 continue
7092 ;;
7093
7094 -no-install)
7095 case $host in
7096 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
7097 # The PATH hackery in wrapper scripts is required on Windows
7098 # and Darwin in order for the loader to find any dlls it needs.
7099 func_warning "'-no-install' is ignored for $host"
7100 func_warning "assuming '-no-fast-install' instead"
7101 fast_install=no
7102 ;;
7103 *) no_install=yes ;;
7104 esac
7105 continue
7106 ;;
7107
7108 -no-undefined)
7109 allow_undefined=no
7110 continue
7111 ;;
7112
7113 -objectlist)
7114 prev=objectlist
7115 continue
7116 ;;
7117
7118 -os2dllname)
7119 prev=os2dllname
7120 continue
7121 ;;
7122
7123 -o) prev=output ;;
7124
7125 -precious-files-regex)
7126 prev=precious_regex
7127 continue
7128 ;;
7129
7130 -release)
7131 prev=release
7132 continue
7133 ;;
7134
7135 -rpath)
7136 prev=rpath
7137 continue
7138 ;;
7139
7140 -R)
7141 prev=xrpath
7142 continue
7143 ;;
7144
7145 -R*)
7146 func_stripname '-R' '' "$arg"
7147 dir=$func_stripname_result
7148 # We need an absolute path.
7149 case $dir in
7150 [\\/]* | [A-Za-z]:[\\/]*) ;;
7151 =*)
7152 func_stripname '=' '' "$dir"
7153 dir=$lt_sysroot$func_stripname_result
7154 ;;
7155 *)
7156 func_fatal_error "only absolute run-paths are allowed"
7157 ;;
7158 esac
7159 case "$xrpath " in
7160 *" $dir "*) ;;
7161 *) func_append xrpath " $dir" ;;
7162 esac
7163 continue
7164 ;;
7165
7166 -shared)
7167 # The effects of -shared are defined in a previous loop.
7168 continue
7169 ;;
7170
7171 -shrext)
7172 prev=shrext
7173 continue
7174 ;;
7175
7176 -static | -static-libtool-libs)
7177 # The effects of -static are defined in a previous loop.
7178 # We used to do the same as -all-static on platforms that
7179 # didn't have a PIC flag, but the assumption that the effects
7180 # would be equivalent was wrong. It would break on at least
7181 # Digital Unix and AIX.
7182 continue
7183 ;;
7184
7185 -thread-safe)
7186 thread_safe=yes
7187 continue
7188 ;;
7189
7190 -version-info)
7191 prev=vinfo
7192 continue
7193 ;;
7194
7195 -version-number)
7196 prev=vinfo
7197 vinfo_number=yes
7198 continue
7199 ;;
7200
7201 -weak)
7202 prev=weak
7203 continue
7204 ;;
7205
7206 -Wc,*)
7207 func_stripname '-Wc,' '' "$arg"
7208 args=$func_stripname_result
7209 arg=
7210 save_ifs=$IFS; IFS=,
7211 for flag in $args; do
7212 IFS=$save_ifs
7213 func_quote_for_eval "$flag"
7214 func_append arg " $func_quote_for_eval_result"
7215 func_append compiler_flags " $func_quote_for_eval_result"
7216 done
7217 IFS=$save_ifs
7218 func_stripname ' ' '' "$arg"
7219 arg=$func_stripname_result
7220 ;;
7221
7222 -Wl,*)
7223 func_stripname '-Wl,' '' "$arg"
7224 args=$func_stripname_result
7225 arg=
7226 save_ifs=$IFS; IFS=,
7227 for flag in $args; do
7228 IFS=$save_ifs
7229 func_quote_for_eval "$flag"
7230 func_append arg " $wl$func_quote_for_eval_result"
7231 func_append compiler_flags " $wl$func_quote_for_eval_result"
7232 func_append linker_flags " $func_quote_for_eval_result"
7233 done
7234 IFS=$save_ifs
7235 func_stripname ' ' '' "$arg"
7236 arg=$func_stripname_result
7237 ;;
7238
7239 -Xcompiler)
7240 prev=xcompiler
7241 continue
7242 ;;
7243
7244 -Xlinker)
7245 prev=xlinker
7246 continue
7247 ;;
7248
7249 -XCClinker)
7250 prev=xcclinker
7251 continue
7252 ;;
7253
7254 # -msg_* for osf cc
7255 -msg_*)
7256 func_quote_for_eval "$arg"
7257 arg=$func_quote_for_eval_result
7258 ;;
7259
7260 # Flags to be passed through unchanged, with rationale:
7261 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
7262 # -r[0-9][0-9]* specify processor for the SGI compiler
7263 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
7264 # +DA*, +DD* enable 64-bit mode for the HP compiler
7265 # -q* compiler args for the IBM compiler
7266 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
7267 # -F/path path to uninstalled frameworks, gcc on darwin
7268 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
7269 # -fstack-protector* stack protector flags for GCC
7270 # @file GCC response files
7271 # -tp=* Portland pgcc target processor selection
7272 # --sysroot=* for sysroot support
7273 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7274 # -fuse-ld=* Linker select flags for GCC
7275 # -stdlib=* select c++ std lib with clang
7276 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
7277 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7278 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
7279 -fuse-ld=*)
7280 func_quote_for_eval "$arg"
7281 arg=$func_quote_for_eval_result
7282 func_append compile_command " $arg"
7283 func_append finalize_command " $arg"
7284 func_append compiler_flags " $arg"
7285 continue
7286 ;;
7287
7288 -Z*)
7289 if test os2 = "`expr $host : '.*\(os2\)'`"; then
7290 # OS/2 uses -Zxxx to specify OS/2-specific options
7291 compiler_flags="$compiler_flags $arg"
7292 func_append compile_command " $arg"
7293 func_append finalize_command " $arg"
7294 case $arg in
7295 -Zlinker | -Zstack)
7296 prev=xcompiler
7297 ;;
7298 esac
7299 continue
7300 else
7301 # Otherwise treat like 'Some other compiler flag' below
7302 func_quote_for_eval "$arg"
7303 arg=$func_quote_for_eval_result
7304 fi
7305 ;;
7306
7307 # Some other compiler flag.
7308 -* | +*)
7309 func_quote_for_eval "$arg"
7310 arg=$func_quote_for_eval_result
7311 ;;
7312
7313 *.$objext)
7314 # A standard object.
7315 func_append objs " $arg"
7316 ;;
7317
7318 *.lo)
7319 # A libtool-controlled object.
7320
7321 # Check to see that this really is a libtool object.
7322 if func_lalib_unsafe_p "$arg"; then
7323 pic_object=
7324 non_pic_object=
7325
7326 # Read the .lo file
7327 func_source "$arg"
7328
7329 if test -z "$pic_object" ||
7330 test -z "$non_pic_object" ||
7331 test none = "$pic_object" &&
7332 test none = "$non_pic_object"; then
7333 func_fatal_error "cannot find name of object for '$arg'"
7334 fi
7335
7336 # Extract subdirectory from the argument.
7337 func_dirname "$arg" "/" ""
7338 xdir=$func_dirname_result
7339
7340 test none = "$pic_object" || {
7341 # Prepend the subdirectory the object is found in.
7342 pic_object=$xdir$pic_object
7343
7344 if test dlfiles = "$prev"; then
7345 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
7346 func_append dlfiles " $pic_object"
7347 prev=
7348 continue
7349 else
7350 # If libtool objects are unsupported, then we need to preload.
7351 prev=dlprefiles
7352 fi
7353 fi
7354
7355 # CHECK ME: I think I busted this. -Ossama
7356 if test dlprefiles = "$prev"; then
7357 # Preload the old-style object.
7358 func_append dlprefiles " $pic_object"
7359 prev=
7360 fi
7361
7362 # A PIC object.
7363 func_append libobjs " $pic_object"
7364 arg=$pic_object
7365 }
7366
7367 # Non-PIC object.
7368 if test none != "$non_pic_object"; then
7369 # Prepend the subdirectory the object is found in.
7370 non_pic_object=$xdir$non_pic_object
7371
7372 # A standard non-PIC object
7373 func_append non_pic_objects " $non_pic_object"
7374 if test -z "$pic_object" || test none = "$pic_object"; then
7375 arg=$non_pic_object
7376 fi
7377 else
7378 # If the PIC object exists, use it instead.
7379 # $xdir was prepended to $pic_object above.
7380 non_pic_object=$pic_object
7381 func_append non_pic_objects " $non_pic_object"
7382 fi
7383 else
7384 # Only an error if not doing a dry-run.
7385 if $opt_dry_run; then
7386 # Extract subdirectory from the argument.
7387 func_dirname "$arg" "/" ""
7388 xdir=$func_dirname_result
7389
7390 func_lo2o "$arg"
7391 pic_object=$xdir$objdir/$func_lo2o_result
7392 non_pic_object=$xdir$func_lo2o_result
7393 func_append libobjs " $pic_object"
7394 func_append non_pic_objects " $non_pic_object"
7395 else
7396 func_fatal_error "'$arg' is not a valid libtool object"
7397 fi
7398 fi
7399 ;;
7400
7401 *.$libext)
7402 # An archive.
7403 func_append deplibs " $arg"
7404 func_append old_deplibs " $arg"
7405 continue
7406 ;;
7407
7408 *.la)
7409 # A libtool-controlled library.
7410
7411 func_resolve_sysroot "$arg"
7412 if test dlfiles = "$prev"; then
7413 # This library was specified with -dlopen.
7414 func_append dlfiles " $func_resolve_sysroot_result"
7415 prev=
7416 elif test dlprefiles = "$prev"; then
7417 # The library was specified with -dlpreopen.
7418 func_append dlprefiles " $func_resolve_sysroot_result"
7419 prev=
7420 else
7421 func_append deplibs " $func_resolve_sysroot_result"
7422 fi
7423 continue
7424 ;;
7425
7426 # Some other compiler argument.
7427 *)
7428 # Unknown arguments in both finalize_command and compile_command need
7429 # to be aesthetically quoted because they are evaled later.
7430 func_quote_for_eval "$arg"
7431 arg=$func_quote_for_eval_result
7432 ;;
7433 esac # arg
7434
7435 # Now actually substitute the argument into the commands.
7436 if test -n "$arg"; then
7437 func_append compile_command " $arg"
7438 func_append finalize_command " $arg"
7439 fi
7440 done # argument parsing loop
7441
7442 test -n "$prev" && \
7443 func_fatal_help "the '$prevarg' option requires an argument"
7444
7445 if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
7446 eval arg=\"$export_dynamic_flag_spec\"
7447 func_append compile_command " $arg"
7448 func_append finalize_command " $arg"
7449 fi
7450
7451 oldlibs=
7452 # calculate the name of the file, without its directory
7453 func_basename "$output"
7454 outputname=$func_basename_result
7455 libobjs_save=$libobjs
7456
7457 if test -n "$shlibpath_var"; then
7458 # get the directories listed in $shlibpath_var
7459 eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
7460 else
7461 shlib_search_path=
7462 fi
7463 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
7464 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
7465
7466 # Definition is injected by LT_CONFIG during libtool generation.
7467 func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7468
7469 func_dirname "$output" "/" ""
7470 output_objdir=$func_dirname_result$objdir
7471 func_to_tool_file "$output_objdir/"
7472 tool_output_objdir=$func_to_tool_file_result
7473 # Create the object directory.
7474 func_mkdir_p "$output_objdir"
7475
7476 # Determine the type of output
7477 case $output in
7478 "")
7479 func_fatal_help "you must specify an output file"
7480 ;;
7481 *.$libext) linkmode=oldlib ;;
7482 *.lo | *.$objext) linkmode=obj ;;
7483 *.la) linkmode=lib ;;
7484 *) linkmode=prog ;; # Anything else should be a program.
7485 esac
7486
7487 specialdeplibs=
7488
7489 libs=
7490 # Find all interdependent deplibs by searching for libraries
7491 # that are linked more than once (e.g. -la -lb -la)
7492 for deplib in $deplibs; do
7493 if $opt_preserve_dup_deps; then
7494 case "$libs " in
7495 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7496 esac
7497 fi
7498 func_append libs " $deplib"
7499 done
7500
7501 if test lib = "$linkmode"; then
7502 libs="$predeps $libs $compiler_lib_search_path $postdeps"
7503
7504 # Compute libraries that are listed more than once in $predeps
7505 # $postdeps and mark them as special (i.e., whose duplicates are
7506 # not to be eliminated).
7507 pre_post_deps=
7508 if $opt_duplicate_compiler_generated_deps; then
7509 for pre_post_dep in $predeps $postdeps; do
7510 case "$pre_post_deps " in
7511 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
7512 esac
7513 func_append pre_post_deps " $pre_post_dep"
7514 done
7515 fi
7516 pre_post_deps=
7517 fi
7518
7519 deplibs=
7520 newdependency_libs=
7521 newlib_search_path=
7522 need_relink=no # whether we're linking any uninstalled libtool libraries
7523 notinst_deplibs= # not-installed libtool libraries
7524 notinst_path= # paths that contain not-installed libtool libraries
7525
7526 case $linkmode in
7527 lib)
7528 passes="conv dlpreopen link"
7529 for file in $dlfiles $dlprefiles; do
7530 case $file in
7531 *.la) ;;
7532 *)
7533 func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
7534 ;;
7535 esac
7536 done
7537 ;;
7538 prog)
7539 compile_deplibs=
7540 finalize_deplibs=
7541 alldeplibs=false
7542 newdlfiles=
7543 newdlprefiles=
7544 passes="conv scan dlopen dlpreopen link"
7545 ;;
7546 *) passes="conv"
7547 ;;
7548 esac
7549
7550 for pass in $passes; do
7551 # The preopen pass in lib mode reverses $deplibs; put it back here
7552 # so that -L comes before libs that need it for instance...
7553 if test lib,link = "$linkmode,$pass"; then
7554 ## FIXME: Find the place where the list is rebuilt in the wrong
7555 ## order, and fix it there properly
7556 tmp_deplibs=
7557 for deplib in $deplibs; do
7558 tmp_deplibs="$deplib $tmp_deplibs"
7559 done
7560 deplibs=$tmp_deplibs
7561 fi
7562
7563 if test lib,link = "$linkmode,$pass" ||
7564 test prog,scan = "$linkmode,$pass"; then
7565 libs=$deplibs
7566 deplibs=
7567 fi
7568 if test prog = "$linkmode"; then
7569 case $pass in
7570 dlopen) libs=$dlfiles ;;
7571 dlpreopen) libs=$dlprefiles ;;
7572 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
7573 esac
7574 fi
7575 if test lib,dlpreopen = "$linkmode,$pass"; then
7576 # Collect and forward deplibs of preopened libtool libs
7577 for lib in $dlprefiles; do
7578 # Ignore non-libtool-libs
7579 dependency_libs=
7580 func_resolve_sysroot "$lib"
7581 case $lib in
7582 *.la) func_source "$func_resolve_sysroot_result" ;;
7583 esac
7584
7585 # Collect preopened libtool deplibs, except any this library
7586 # has declared as weak libs
7587 for deplib in $dependency_libs; do
7588 func_basename "$deplib"
7589 deplib_base=$func_basename_result
7590 case " $weak_libs " in
7591 *" $deplib_base "*) ;;
7592 *) func_append deplibs " $deplib" ;;
7593 esac
7594 done
7595 done
7596 libs=$dlprefiles
7597 fi
7598 if test dlopen = "$pass"; then
7599 # Collect dlpreopened libraries
7600 save_deplibs=$deplibs
7601 deplibs=
7602 fi
7603
7604 for deplib in $libs; do
7605 lib=
7606 found=false
7607 case $deplib in
7608 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
7609 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7610 if test prog,link = "$linkmode,$pass"; then
7611 compile_deplibs="$deplib $compile_deplibs"
7612 finalize_deplibs="$deplib $finalize_deplibs"
7613 else
7614 func_append compiler_flags " $deplib"
7615 if test lib = "$linkmode"; then
7616 case "$new_inherited_linker_flags " in
7617 *" $deplib "*) ;;
7618 * ) func_append new_inherited_linker_flags " $deplib" ;;
7619 esac
7620 fi
7621 fi
7622 continue
7623 ;;
7624 -l*)
7625 if test lib != "$linkmode" && test prog != "$linkmode"; then
7626 func_warning "'-l' is ignored for archives/objects"
7627 continue
7628 fi
7629 func_stripname '-l' '' "$deplib"
7630 name=$func_stripname_result
7631 if test lib = "$linkmode"; then
7632 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
7633 else
7634 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
7635 fi
7636 for searchdir in $searchdirs; do
7637 for search_ext in .la $std_shrext .so .a; do
7638 # Search the libtool library
7639 lib=$searchdir/lib$name$search_ext
7640 if test -f "$lib"; then
7641 if test .la = "$search_ext"; then
7642 found=:
7643 else
7644 found=false
7645 fi
7646 break 2
7647 fi
7648 done
7649 done
7650 if $found; then
7651 # deplib is a libtool library
7652 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
7653 # We need to do some special things here, and not later.
7654 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7655 case " $predeps $postdeps " in
7656 *" $deplib "*)
7657 if func_lalib_p "$lib"; then
7658 library_names=
7659 old_library=
7660 func_source "$lib"
7661 for l in $old_library $library_names; do
7662 ll=$l
7663 done
7664 if test "X$ll" = "X$old_library"; then # only static version available
7665 found=false
7666 func_dirname "$lib" "" "."
7667 ladir=$func_dirname_result
7668 lib=$ladir/$old_library
7669 if test prog,link = "$linkmode,$pass"; then
7670 compile_deplibs="$deplib $compile_deplibs"
7671 finalize_deplibs="$deplib $finalize_deplibs"
7672 else
7673 deplibs="$deplib $deplibs"
7674 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7675 fi
7676 continue
7677 fi
7678 fi
7679 ;;
7680 *) ;;
7681 esac
7682 fi
7683 else
7684 # deplib doesn't seem to be a libtool library
7685 if test prog,link = "$linkmode,$pass"; then
7686 compile_deplibs="$deplib $compile_deplibs"
7687 finalize_deplibs="$deplib $finalize_deplibs"
7688 else
7689 deplibs="$deplib $deplibs"
7690 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7691 fi
7692 continue
7693 fi
7694 ;; # -l
7695 *.ltframework)
7696 if test prog,link = "$linkmode,$pass"; then
7697 compile_deplibs="$deplib $compile_deplibs"
7698 finalize_deplibs="$deplib $finalize_deplibs"
7699 else
7700 deplibs="$deplib $deplibs"
7701 if test lib = "$linkmode"; then
7702 case "$new_inherited_linker_flags " in
7703 *" $deplib "*) ;;
7704 * ) func_append new_inherited_linker_flags " $deplib" ;;
7705 esac
7706 fi
7707 fi
7708 continue
7709 ;;
7710 -L*)
7711 case $linkmode in
7712 lib)
7713 deplibs="$deplib $deplibs"
7714 test conv = "$pass" && continue
7715 newdependency_libs="$deplib $newdependency_libs"
7716 func_stripname '-L' '' "$deplib"
7717 func_resolve_sysroot "$func_stripname_result"
7718 func_append newlib_search_path " $func_resolve_sysroot_result"
7719 ;;
7720 prog)
7721 if test conv = "$pass"; then
7722 deplibs="$deplib $deplibs"
7723 continue
7724 fi
7725 if test scan = "$pass"; then
7726 deplibs="$deplib $deplibs"
7727 else
7728 compile_deplibs="$deplib $compile_deplibs"
7729 finalize_deplibs="$deplib $finalize_deplibs"
7730 fi
7731 func_stripname '-L' '' "$deplib"
7732 func_resolve_sysroot "$func_stripname_result"
7733 func_append newlib_search_path " $func_resolve_sysroot_result"
7734 ;;
7735 *)
7736 func_warning "'-L' is ignored for archives/objects"
7737 ;;
7738 esac # linkmode
7739 continue
7740 ;; # -L
7741 -R*)
7742 if test link = "$pass"; then
7743 func_stripname '-R' '' "$deplib"
7744 func_resolve_sysroot "$func_stripname_result"
7745 dir=$func_resolve_sysroot_result
7746 # Make sure the xrpath contains only unique directories.
7747 case "$xrpath " in
7748 *" $dir "*) ;;
7749 *) func_append xrpath " $dir" ;;
7750 esac
7751 fi
7752 deplibs="$deplib $deplibs"
7753 continue
7754 ;;
7755 *.la)
7756 func_resolve_sysroot "$deplib"
7757 lib=$func_resolve_sysroot_result
7758 ;;
7759 *.$libext)
7760 if test conv = "$pass"; then
7761 deplibs="$deplib $deplibs"
7762 continue
7763 fi
7764 case $linkmode in
7765 lib)
7766 # Linking convenience modules into shared libraries is allowed,
7767 # but linking other static libraries is non-portable.
7768 case " $dlpreconveniencelibs " in
7769 *" $deplib "*) ;;
7770 *)
7771 valid_a_lib=false
7772 case $deplibs_check_method in
7773 match_pattern*)
7774 set dummy $deplibs_check_method; shift
7775 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7776 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
7777 | $EGREP "$match_pattern_regex" > /dev/null; then
7778 valid_a_lib=:
7779 fi
7780 ;;
7781 pass_all)
7782 valid_a_lib=:
7783 ;;
7784 esac
7785 if $valid_a_lib; then
7786 echo
7787 $ECHO "*** Warning: Linking the shared library $output against the"
7788 $ECHO "*** static library $deplib is not portable!"
7789 deplibs="$deplib $deplibs"
7790 else
7791 echo
7792 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
7793 echo "*** I have the capability to make that library automatically link in when"
7794 echo "*** you link to this library. But I can only do this if you have a"
7795 echo "*** shared version of the library, which you do not appear to have"
7796 echo "*** because the file extensions .$libext of this argument makes me believe"
7797 echo "*** that it is just a static archive that I should not use here."
7798 fi
7799 ;;
7800 esac
7801 continue
7802 ;;
7803 prog)
7804 if test link != "$pass"; then
7805 deplibs="$deplib $deplibs"
7806 else
7807 compile_deplibs="$deplib $compile_deplibs"
7808 finalize_deplibs="$deplib $finalize_deplibs"
7809 fi
7810 continue
7811 ;;
7812 esac # linkmode
7813 ;; # *.$libext
7814 *.lo | *.$objext)
7815 if test conv = "$pass"; then
7816 deplibs="$deplib $deplibs"
7817 elif test prog = "$linkmode"; then
7818 if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
7819 # If there is no dlopen support or we're linking statically,
7820 # we need to preload.
7821 func_append newdlprefiles " $deplib"
7822 compile_deplibs="$deplib $compile_deplibs"
7823 finalize_deplibs="$deplib $finalize_deplibs"
7824 else
7825 func_append newdlfiles " $deplib"
7826 fi
7827 fi
7828 continue
7829 ;;
7830 %DEPLIBS%)
7831 alldeplibs=:
7832 continue
7833 ;;
7834 esac # case $deplib
7835
7836 $found || test -f "$lib" \
7837 || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
7838
7839 # Check to see that this really is a libtool archive.
7840 func_lalib_unsafe_p "$lib" \
7841 || func_fatal_error "'$lib' is not a valid libtool archive"
7842
7843 func_dirname "$lib" "" "."
7844 ladir=$func_dirname_result
7845
7846 dlname=
7847 dlopen=
7848 dlpreopen=
7849 libdir=
7850 library_names=
7851 old_library=
7852 inherited_linker_flags=
7853 # If the library was installed with an old release of libtool,
7854 # it will not redefine variables installed, or shouldnotlink
7855 installed=yes
7856 shouldnotlink=no
7857 avoidtemprpath=
7858
7859
7860 # Read the .la file
7861 func_source "$lib"
7862
7863 # Convert "-framework foo" to "foo.ltframework"
7864 if test -n "$inherited_linker_flags"; then
7865 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
7866 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
7867 case " $new_inherited_linker_flags " in
7868 *" $tmp_inherited_linker_flag "*) ;;
7869 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
7870 esac
7871 done
7872 fi
7873 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7874 if test lib,link = "$linkmode,$pass" ||
7875 test prog,scan = "$linkmode,$pass" ||
7876 { test prog != "$linkmode" && test lib != "$linkmode"; }; then
7877 test -n "$dlopen" && func_append dlfiles " $dlopen"
7878 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
7879 fi
7880
7881 if test conv = "$pass"; then
7882 # Only check for convenience libraries
7883 deplibs="$lib $deplibs"
7884 if test -z "$libdir"; then
7885 if test -z "$old_library"; then
7886 func_fatal_error "cannot find name of link library for '$lib'"
7887 fi
7888 # It is a libtool convenience library, so add in its objects.
7889 func_append convenience " $ladir/$objdir/$old_library"
7890 func_append old_convenience " $ladir/$objdir/$old_library"
7891 elif test prog != "$linkmode" && test lib != "$linkmode"; then
7892 func_fatal_error "'$lib' is not a convenience library"
7893 fi
7894 tmp_libs=
7895 for deplib in $dependency_libs; do
7896 deplibs="$deplib $deplibs"
7897 if $opt_preserve_dup_deps; then
7898 case "$tmp_libs " in
7899 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7900 esac
7901 fi
7902 func_append tmp_libs " $deplib"
7903 done
7904 continue
7905 fi # $pass = conv
7906
7907
7908 # Get the name of the library we link against.
7909 linklib=
7910 if test -n "$old_library" &&
7911 { test yes = "$prefer_static_libs" ||
7912 test built,no = "$prefer_static_libs,$installed"; }; then
7913 linklib=$old_library
7914 else
7915 for l in $old_library $library_names; do
7916 linklib=$l
7917 done
7918 fi
7919 if test -z "$linklib"; then
7920 func_fatal_error "cannot find name of link library for '$lib'"
7921 fi
7922
7923 # This library was specified with -dlopen.
7924 if test dlopen = "$pass"; then
7925 test -z "$libdir" \
7926 && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
7927 if test -z "$dlname" ||
7928 test yes != "$dlopen_support" ||
7929 test no = "$build_libtool_libs"
7930 then
7931 # If there is no dlname, no dlopen support or we're linking
7932 # statically, we need to preload. We also need to preload any
7933 # dependent libraries so libltdl's deplib preloader doesn't
7934 # bomb out in the load deplibs phase.
7935 func_append dlprefiles " $lib $dependency_libs"
7936 else
7937 func_append newdlfiles " $lib"
7938 fi
7939 continue
7940 fi # $pass = dlopen
7941
7942 # We need an absolute path.
7943 case $ladir in
7944 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
7945 *)
7946 abs_ladir=`cd "$ladir" && pwd`
7947 if test -z "$abs_ladir"; then
7948 func_warning "cannot determine absolute directory name of '$ladir'"
7949 func_warning "passing it literally to the linker, although it might fail"
7950 abs_ladir=$ladir
7951 fi
7952 ;;
7953 esac
7954 func_basename "$lib"
7955 laname=$func_basename_result
7956
7957 # Find the relevant object directory and library name.
7958 if test yes = "$installed"; then
7959 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7960 func_warning "library '$lib' was moved."
7961 dir=$ladir
7962 absdir=$abs_ladir
7963 libdir=$abs_ladir
7964 else
7965 dir=$lt_sysroot$libdir
7966 absdir=$lt_sysroot$libdir
7967 fi
7968 test yes = "$hardcode_automatic" && avoidtemprpath=yes
7969 else
7970 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7971 dir=$ladir
7972 absdir=$abs_ladir
7973 # Remove this search path later
7974 func_append notinst_path " $abs_ladir"
7975 else
7976 dir=$ladir/$objdir
7977 absdir=$abs_ladir/$objdir
7978 # Remove this search path later
7979 func_append notinst_path " $abs_ladir"
7980 fi
7981 fi # $installed = yes
7982 func_stripname 'lib' '.la' "$laname"
7983 name=$func_stripname_result
7984
7985 # This library was specified with -dlpreopen.
7986 if test dlpreopen = "$pass"; then
7987 if test -z "$libdir" && test prog = "$linkmode"; then
7988 func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
7989 fi
7990 case $host in
7991 # special handling for platforms with PE-DLLs.
7992 *cygwin* | *mingw* | *cegcc* )
7993 # Linker will automatically link against shared library if both
7994 # static and shared are present. Therefore, ensure we extract
7995 # symbols from the import library if a shared library is present
7996 # (otherwise, the dlopen module name will be incorrect). We do
7997 # this by putting the import library name into $newdlprefiles.
7998 # We recover the dlopen module name by 'saving' the la file
7999 # name in a special purpose variable, and (later) extracting the
8000 # dlname from the la file.
8001 if test -n "$dlname"; then
8002 func_tr_sh "$dir/$linklib"
8003 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
8004 func_append newdlprefiles " $dir/$linklib"
8005 else
8006 func_append newdlprefiles " $dir/$old_library"
8007 # Keep a list of preopened convenience libraries to check
8008 # that they are being used correctly in the link pass.
8009 test -z "$libdir" && \
8010 func_append dlpreconveniencelibs " $dir/$old_library"
8011 fi
8012 ;;
8013 * )
8014 # Prefer using a static library (so that no silly _DYNAMIC symbols
8015 # are required to link).
8016 if test -n "$old_library"; then
8017 func_append newdlprefiles " $dir/$old_library"
8018 # Keep a list of preopened convenience libraries to check
8019 # that they are being used correctly in the link pass.
8020 test -z "$libdir" && \
8021 func_append dlpreconveniencelibs " $dir/$old_library"
8022 # Otherwise, use the dlname, so that lt_dlopen finds it.
8023 elif test -n "$dlname"; then
8024 func_append newdlprefiles " $dir/$dlname"
8025 else
8026 func_append newdlprefiles " $dir/$linklib"
8027 fi
8028 ;;
8029 esac
8030 fi # $pass = dlpreopen
8031
8032 if test -z "$libdir"; then
8033 # Link the convenience library
8034 if test lib = "$linkmode"; then
8035 deplibs="$dir/$old_library $deplibs"
8036 elif test prog,link = "$linkmode,$pass"; then
8037 compile_deplibs="$dir/$old_library $compile_deplibs"
8038 finalize_deplibs="$dir/$old_library $finalize_deplibs"
8039 else
8040 deplibs="$lib $deplibs" # used for prog,scan pass
8041 fi
8042 continue
8043 fi
8044
8045
8046 if test prog = "$linkmode" && test link != "$pass"; then
8047 func_append newlib_search_path " $ladir"
8048 deplibs="$lib $deplibs"
8049
8050 linkalldeplibs=false
8051 if test no != "$link_all_deplibs" || test -z "$library_names" ||
8052 test no = "$build_libtool_libs"; then
8053 linkalldeplibs=:
8054 fi
8055
8056 tmp_libs=
8057 for deplib in $dependency_libs; do
8058 case $deplib in
8059 -L*) func_stripname '-L' '' "$deplib"
8060 func_resolve_sysroot "$func_stripname_result"
8061 func_append newlib_search_path " $func_resolve_sysroot_result"
8062 ;;
8063 esac
8064 # Need to link against all dependency_libs?
8065 if $linkalldeplibs; then
8066 deplibs="$deplib $deplibs"
8067 else
8068 # Need to hardcode shared library paths
8069 # or/and link against static libraries
8070 newdependency_libs="$deplib $newdependency_libs"
8071 fi
8072 if $opt_preserve_dup_deps; then
8073 case "$tmp_libs " in
8074 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8075 esac
8076 fi
8077 func_append tmp_libs " $deplib"
8078 done # for deplib
8079 continue
8080 fi # $linkmode = prog...
8081
8082 if test prog,link = "$linkmode,$pass"; then
8083 if test -n "$library_names" &&
8084 { { test no = "$prefer_static_libs" ||
8085 test built,yes = "$prefer_static_libs,$installed"; } ||
8086 test -z "$old_library"; }; then
8087 # We need to hardcode the library path
8088 if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
8089 # Make sure the rpath contains only unique directories.
8090 case $temp_rpath: in
8091 *"$absdir:"*) ;;
8092 *) func_append temp_rpath "$absdir:" ;;
8093 esac
8094 fi
8095
8096 # Hardcode the library path.
8097 # Skip directories that are in the system default run-time
8098 # search path.
8099 case " $sys_lib_dlsearch_path " in
8100 *" $absdir "*) ;;
8101 *)
8102 case "$compile_rpath " in
8103 *" $absdir "*) ;;
8104 *) func_append compile_rpath " $absdir" ;;
8105 esac
8106 ;;
8107 esac
8108 case " $sys_lib_dlsearch_path " in
8109 *" $libdir "*) ;;
8110 *)
8111 case "$finalize_rpath " in
8112 *" $libdir "*) ;;
8113 *) func_append finalize_rpath " $libdir" ;;
8114 esac
8115 ;;
8116 esac
8117 fi # $linkmode,$pass = prog,link...
8118
8119 if $alldeplibs &&
8120 { test pass_all = "$deplibs_check_method" ||
8121 { test yes = "$build_libtool_libs" &&
8122 test -n "$library_names"; }; }; then
8123 # We only need to search for static libraries
8124 continue
8125 fi
8126 fi
8127
8128 link_static=no # Whether the deplib will be linked statically
8129 use_static_libs=$prefer_static_libs
8130 if test built = "$use_static_libs" && test yes = "$installed"; then
8131 use_static_libs=no
8132 fi
8133 if test -n "$library_names" &&
8134 { test no = "$use_static_libs" || test -z "$old_library"; }; then
8135 case $host in
8136 *cygwin* | *mingw* | *cegcc* | *os2*)
8137 # No point in relinking DLLs because paths are not encoded
8138 func_append notinst_deplibs " $lib"
8139 need_relink=no
8140 ;;
8141 *)
8142 if test no = "$installed"; then
8143 func_append notinst_deplibs " $lib"
8144 need_relink=yes
8145 fi
8146 ;;
8147 esac
8148 # This is a shared library
8149
8150 # Warn about portability, can't link against -module's on some
8151 # systems (darwin). Don't bleat about dlopened modules though!
8152 dlopenmodule=
8153 for dlpremoduletest in $dlprefiles; do
8154 if test "X$dlpremoduletest" = "X$lib"; then
8155 dlopenmodule=$dlpremoduletest
8156 break
8157 fi
8158 done
8159 if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
8160 echo
8161 if test prog = "$linkmode"; then
8162 $ECHO "*** Warning: Linking the executable $output against the loadable module"
8163 else
8164 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
8165 fi
8166 $ECHO "*** $linklib is not portable!"
8167 fi
8168 if test lib = "$linkmode" &&
8169 test yes = "$hardcode_into_libs"; then
8170 # Hardcode the library path.
8171 # Skip directories that are in the system default run-time
8172 # search path.
8173 case " $sys_lib_dlsearch_path " in
8174 *" $absdir "*) ;;
8175 *)
8176 case "$compile_rpath " in
8177 *" $absdir "*) ;;
8178 *) func_append compile_rpath " $absdir" ;;
8179 esac
8180 ;;
8181 esac
8182 case " $sys_lib_dlsearch_path " in
8183 *" $libdir "*) ;;
8184 *)
8185 case "$finalize_rpath " in
8186 *" $libdir "*) ;;
8187 *) func_append finalize_rpath " $libdir" ;;
8188 esac
8189 ;;
8190 esac
8191 fi
8192
8193 if test -n "$old_archive_from_expsyms_cmds"; then
8194 # figure out the soname
8195 set dummy $library_names
8196 shift
8197 realname=$1
8198 shift
8199 libname=`eval "\\$ECHO \"$libname_spec\""`
8200 # use dlname if we got it. it's perfectly good, no?
8201 if test -n "$dlname"; then
8202 soname=$dlname
8203 elif test -n "$soname_spec"; then
8204 # bleh windows
8205 case $host in
8206 *cygwin* | mingw* | *cegcc* | *os2*)
8207 func_arith $current - $age
8208 major=$func_arith_result
8209 versuffix=-$major
8210 ;;
8211 esac
8212 eval soname=\"$soname_spec\"
8213 else
8214 soname=$realname
8215 fi
8216
8217 # Make a new name for the extract_expsyms_cmds to use
8218 soroot=$soname
8219 func_basename "$soroot"
8220 soname=$func_basename_result
8221 func_stripname 'lib' '.dll' "$soname"
8222 newlib=libimp-$func_stripname_result.a
8223
8224 # If the library has no export list, then create one now
8225 if test -f "$output_objdir/$soname-def"; then :
8226 else
8227 func_verbose "extracting exported symbol list from '$soname'"
8228 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
8229 fi
8230
8231 # Create $newlib
8232 if test -f "$output_objdir/$newlib"; then :; else
8233 func_verbose "generating import library for '$soname'"
8234 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
8235 fi
8236 # make sure the library variables are pointing to the new library
8237 dir=$output_objdir
8238 linklib=$newlib
8239 fi # test -n "$old_archive_from_expsyms_cmds"
8240
8241 if test prog = "$linkmode" || test relink != "$opt_mode"; then
8242 add_shlibpath=
8243 add_dir=
8244 add=
8245 lib_linked=yes
8246 case $hardcode_action in
8247 immediate | unsupported)
8248 if test no = "$hardcode_direct"; then
8249 add=$dir/$linklib
8250 case $host in
8251 *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
8252 *-*-sysv4*uw2*) add_dir=-L$dir ;;
8253 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8254 *-*-unixware7*) add_dir=-L$dir ;;
8255 *-*-darwin* )
8256 # if the lib is a (non-dlopened) module then we cannot
8257 # link against it, someone is ignoring the earlier warnings
8258 if /usr/bin/file -L $add 2> /dev/null |
8259 $GREP ": [^:]* bundle" >/dev/null; then
8260 if test "X$dlopenmodule" != "X$lib"; then
8261 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
8262 if test -z "$old_library"; then
8263 echo
8264 echo "*** And there doesn't seem to be a static archive available"
8265 echo "*** The link will probably fail, sorry"
8266 else
8267 add=$dir/$old_library
8268 fi
8269 elif test -n "$old_library"; then
8270 add=$dir/$old_library
8271 fi
8272 fi
8273 esac
8274 elif test no = "$hardcode_minus_L"; then
8275 case $host in
8276 *-*-sunos*) add_shlibpath=$dir ;;
8277 esac
8278 add_dir=-L$dir
8279 add=-l$name
8280 elif test no = "$hardcode_shlibpath_var"; then
8281 add_shlibpath=$dir
8282 add=-l$name
8283 else
8284 lib_linked=no
8285 fi
8286 ;;
8287 relink)
8288 if test yes = "$hardcode_direct" &&
8289 test no = "$hardcode_direct_absolute"; then
8290 add=$dir/$linklib
8291 elif test yes = "$hardcode_minus_L"; then
8292 add_dir=-L$absdir
8293 # Try looking first in the location we're being installed to.
8294 if test -n "$inst_prefix_dir"; then
8295 case $libdir in
8296 [\\/]*)
8297 func_append add_dir " -L$inst_prefix_dir$libdir"
8298 ;;
8299 esac
8300 fi
8301 add=-l$name
8302 elif test yes = "$hardcode_shlibpath_var"; then
8303 add_shlibpath=$dir
8304 add=-l$name
8305 else
8306 lib_linked=no
8307 fi
8308 ;;
8309 *) lib_linked=no ;;
8310 esac
8311
8312 if test yes != "$lib_linked"; then
8313 func_fatal_configuration "unsupported hardcode properties"
8314 fi
8315
8316 if test -n "$add_shlibpath"; then
8317 case :$compile_shlibpath: in
8318 *":$add_shlibpath:"*) ;;
8319 *) func_append compile_shlibpath "$add_shlibpath:" ;;
8320 esac
8321 fi
8322 if test prog = "$linkmode"; then
8323 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
8324 test -n "$add" && compile_deplibs="$add $compile_deplibs"
8325 else
8326 test -n "$add_dir" && deplibs="$add_dir $deplibs"
8327 test -n "$add" && deplibs="$add $deplibs"
8328 if test yes != "$hardcode_direct" &&
8329 test yes != "$hardcode_minus_L" &&
8330 test yes = "$hardcode_shlibpath_var"; then
8331 case :$finalize_shlibpath: in
8332 *":$libdir:"*) ;;
8333 *) func_append finalize_shlibpath "$libdir:" ;;
8334 esac
8335 fi
8336 fi
8337 fi
8338
8339 if test prog = "$linkmode" || test relink = "$opt_mode"; then
8340 add_shlibpath=
8341 add_dir=
8342 add=
8343 # Finalize command for both is simple: just hardcode it.
8344 if test yes = "$hardcode_direct" &&
8345 test no = "$hardcode_direct_absolute"; then
8346 add=$libdir/$linklib
8347 elif test yes = "$hardcode_minus_L"; then
8348 add_dir=-L$libdir
8349 add=-l$name
8350 elif test yes = "$hardcode_shlibpath_var"; then
8351 case :$finalize_shlibpath: in
8352 *":$libdir:"*) ;;
8353 *) func_append finalize_shlibpath "$libdir:" ;;
8354 esac
8355 add=-l$name
8356 elif test yes = "$hardcode_automatic"; then
8357 if test -n "$inst_prefix_dir" &&
8358 test -f "$inst_prefix_dir$libdir/$linklib"; then
8359 add=$inst_prefix_dir$libdir/$linklib
8360 else
8361 add=$libdir/$linklib
8362 fi
8363 else
8364 # We cannot seem to hardcode it, guess we'll fake it.
8365 add_dir=-L$libdir
8366 # Try looking first in the location we're being installed to.
8367 if test -n "$inst_prefix_dir"; then
8368 case $libdir in
8369 [\\/]*)
8370 func_append add_dir " -L$inst_prefix_dir$libdir"
8371 ;;
8372 esac
8373 fi
8374 add=-l$name
8375 fi
8376
8377 if test prog = "$linkmode"; then
8378 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
8379 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
8380 else
8381 test -n "$add_dir" && deplibs="$add_dir $deplibs"
8382 test -n "$add" && deplibs="$add $deplibs"
8383 fi
8384 fi
8385 elif test prog = "$linkmode"; then
8386 # Here we assume that one of hardcode_direct or hardcode_minus_L
8387 # is not unsupported. This is valid on all known static and
8388 # shared platforms.
8389 if test unsupported != "$hardcode_direct"; then
8390 test -n "$old_library" && linklib=$old_library
8391 compile_deplibs="$dir/$linklib $compile_deplibs"
8392 finalize_deplibs="$dir/$linklib $finalize_deplibs"
8393 else
8394 compile_deplibs="-l$name -L$dir $compile_deplibs"
8395 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
8396 fi
8397 elif test yes = "$build_libtool_libs"; then
8398 # Not a shared library
8399 if test pass_all != "$deplibs_check_method"; then
8400 # We're trying link a shared library against a static one
8401 # but the system doesn't support it.
8402
8403 # Just print a warning and add the library to dependency_libs so
8404 # that the program can be linked against the static library.
8405 echo
8406 $ECHO "*** Warning: This system cannot link to static lib archive $lib."
8407 echo "*** I have the capability to make that library automatically link in when"
8408 echo "*** you link to this library. But I can only do this if you have a"
8409 echo "*** shared version of the library, which you do not appear to have."
8410 if test yes = "$module"; then
8411 echo "*** But as you try to build a module library, libtool will still create "
8412 echo "*** a static module, that should work as long as the dlopening application"
8413 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
8414 if test -z "$global_symbol_pipe"; then
8415 echo
8416 echo "*** However, this would only work if libtool was able to extract symbol"
8417 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
8418 echo "*** not find such a program. So, this module is probably useless."
8419 echo "*** 'nm' from GNU binutils and a full rebuild may help."
8420 fi
8421 if test no = "$build_old_libs"; then
8422 build_libtool_libs=module
8423 build_old_libs=yes
8424 else
8425 build_libtool_libs=no
8426 fi
8427 fi
8428 else
8429 deplibs="$dir/$old_library $deplibs"
8430 link_static=yes
8431 fi
8432 fi # link shared/static library?
8433
8434 if test lib = "$linkmode"; then
8435 if test -n "$dependency_libs" &&
8436 { test yes != "$hardcode_into_libs" ||
8437 test yes = "$build_old_libs" ||
8438 test yes = "$link_static"; }; then
8439 # Extract -R from dependency_libs
8440 temp_deplibs=
8441 for libdir in $dependency_libs; do
8442 case $libdir in
8443 -R*) func_stripname '-R' '' "$libdir"
8444 temp_xrpath=$func_stripname_result
8445 case " $xrpath " in
8446 *" $temp_xrpath "*) ;;
8447 *) func_append xrpath " $temp_xrpath";;
8448 esac;;
8449 *) func_append temp_deplibs " $libdir";;
8450 esac
8451 done
8452 dependency_libs=$temp_deplibs
8453 fi
8454
8455 func_append newlib_search_path " $absdir"
8456 # Link against this library
8457 test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
8458 # ... and its dependency_libs
8459 tmp_libs=
8460 for deplib in $dependency_libs; do
8461 newdependency_libs="$deplib $newdependency_libs"
8462 case $deplib in
8463 -L*) func_stripname '-L' '' "$deplib"
8464 func_resolve_sysroot "$func_stripname_result";;
8465 *) func_resolve_sysroot "$deplib" ;;
8466 esac
8467 if $opt_preserve_dup_deps; then
8468 case "$tmp_libs " in
8469 *" $func_resolve_sysroot_result "*)
8470 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
8471 esac
8472 fi
8473 func_append tmp_libs " $func_resolve_sysroot_result"
8474 done
8475
8476 if test no != "$link_all_deplibs"; then
8477 # Add the search paths of all dependency libraries
8478 for deplib in $dependency_libs; do
8479 path=
8480 case $deplib in
8481 -L*) path=$deplib ;;
8482 *.la)
8483 func_resolve_sysroot "$deplib"
8484 deplib=$func_resolve_sysroot_result
8485 func_dirname "$deplib" "" "."
8486 dir=$func_dirname_result
8487 # We need an absolute path.
8488 case $dir in
8489 [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
8490 *)
8491 absdir=`cd "$dir" && pwd`
8492 if test -z "$absdir"; then
8493 func_warning "cannot determine absolute directory name of '$dir'"
8494 absdir=$dir
8495 fi
8496 ;;
8497 esac
8498 if $GREP "^installed=no" $deplib > /dev/null; then
8499 case $host in
8500 *-*-darwin*)
8501 depdepl=
8502 eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8503 if test -n "$deplibrary_names"; then
8504 for tmp in $deplibrary_names; do
8505 depdepl=$tmp
8506 done
8507 if test -f "$absdir/$objdir/$depdepl"; then
8508 depdepl=$absdir/$objdir/$depdepl
8509 darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8510 if test -z "$darwin_install_name"; then
8511 darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8512 fi
8513 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
8514 func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
8515 path=
8516 fi
8517 fi
8518 ;;
8519 *)
8520 path=-L$absdir/$objdir
8521 ;;
8522 esac
8523 else
8524 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8525 test -z "$libdir" && \
8526 func_fatal_error "'$deplib' is not a valid libtool archive"
8527 test "$absdir" != "$libdir" && \
8528 func_warning "'$deplib' seems to be moved"
8529
8530 path=-L$absdir
8531 fi
8532 ;;
8533 esac
8534 case " $deplibs " in
8535 *" $path "*) ;;
8536 *) deplibs="$path $deplibs" ;;
8537 esac
8538 done
8539 fi # link_all_deplibs != no
8540 fi # linkmode = lib
8541 done # for deplib in $libs
8542 if test link = "$pass"; then
8543 if test prog = "$linkmode"; then
8544 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
8545 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
8546 else
8547 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8548 fi
8549 fi
8550 dependency_libs=$newdependency_libs
8551 if test dlpreopen = "$pass"; then
8552 # Link the dlpreopened libraries before other libraries
8553 for deplib in $save_deplibs; do
8554 deplibs="$deplib $deplibs"
8555 done
8556 fi
8557 if test dlopen != "$pass"; then
8558 test conv = "$pass" || {
8559 # Make sure lib_search_path contains only unique directories.
8560 lib_search_path=
8561 for dir in $newlib_search_path; do
8562 case "$lib_search_path " in
8563 *" $dir "*) ;;
8564 *) func_append lib_search_path " $dir" ;;
8565 esac
8566 done
8567 newlib_search_path=
8568 }
8569
8570 if test prog,link = "$linkmode,$pass"; then
8571 vars="compile_deplibs finalize_deplibs"
8572 else
8573 vars=deplibs
8574 fi
8575 for var in $vars dependency_libs; do
8576 # Add libraries to $var in reverse order
8577 eval tmp_libs=\"\$$var\"
8578 new_libs=
8579 for deplib in $tmp_libs; do
8580 # FIXME: Pedantically, this is the right thing to do, so
8581 # that some nasty dependency loop isn't accidentally
8582 # broken:
8583 #new_libs="$deplib $new_libs"
8584 # Pragmatically, this seems to cause very few problems in
8585 # practice:
8586 case $deplib in
8587 -L*) new_libs="$deplib $new_libs" ;;
8588 -R*) ;;
8589 *)
8590 # And here is the reason: when a library appears more
8591 # than once as an explicit dependence of a library, or
8592 # is implicitly linked in more than once by the
8593 # compiler, it is considered special, and multiple
8594 # occurrences thereof are not removed. Compare this
8595 # with having the same library being listed as a
8596 # dependency of multiple other libraries: in this case,
8597 # we know (pedantically, we assume) the library does not
8598 # need to be listed more than once, so we keep only the
8599 # last copy. This is not always right, but it is rare
8600 # enough that we require users that really mean to play
8601 # such unportable linking tricks to link the library
8602 # using -Wl,-lname, so that libtool does not consider it
8603 # for duplicate removal.
8604 case " $specialdeplibs " in
8605 *" $deplib "*) new_libs="$deplib $new_libs" ;;
8606 *)
8607 case " $new_libs " in
8608 *" $deplib "*) ;;
8609 *) new_libs="$deplib $new_libs" ;;
8610 esac
8611 ;;
8612 esac
8613 ;;
8614 esac
8615 done
8616 tmp_libs=
8617 for deplib in $new_libs; do
8618 case $deplib in
8619 -L*)
8620 case " $tmp_libs " in
8621 *" $deplib "*) ;;
8622 *) func_append tmp_libs " $deplib" ;;
8623 esac
8624 ;;
8625 *) func_append tmp_libs " $deplib" ;;
8626 esac
8627 done
8628 eval $var=\"$tmp_libs\"
8629 done # for var
8630 fi
8631
8632 # Add Sun CC postdeps if required:
8633 test CXX = "$tagname" && {
8634 case $host_os in
8635 linux*)
8636 case `$CC -V 2>&1 | sed 5q` in
8637 *Sun\ C*) # Sun C++ 5.9
8638 func_suncc_cstd_abi
8639
8640 if test no != "$suncc_use_cstd_abi"; then
8641 func_append postdeps ' -library=Cstd -library=Crun'
8642 fi
8643 ;;
8644 esac
8645 ;;
8646
8647 solaris*)
8648 func_cc_basename "$CC"
8649 case $func_cc_basename_result in
8650 CC* | sunCC*)
8651 func_suncc_cstd_abi
8652
8653 if test no != "$suncc_use_cstd_abi"; then
8654 func_append postdeps ' -library=Cstd -library=Crun'
8655 fi
8656 ;;
8657 esac
8658 ;;
8659 esac
8660 }
8661
8662 # Last step: remove runtime libs from dependency_libs
8663 # (they stay in deplibs)
8664 tmp_libs=
8665 for i in $dependency_libs; do
8666 case " $predeps $postdeps $compiler_lib_search_path " in
8667 *" $i "*)
8668 i=
8669 ;;
8670 esac
8671 if test -n "$i"; then
8672 func_append tmp_libs " $i"
8673 fi
8674 done
8675 dependency_libs=$tmp_libs
8676 done # for pass
8677 if test prog = "$linkmode"; then
8678 dlfiles=$newdlfiles
8679 fi
8680 if test prog = "$linkmode" || test lib = "$linkmode"; then
8681 dlprefiles=$newdlprefiles
8682 fi
8683
8684 case $linkmode in
8685 oldlib)
8686 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
8687 func_warning "'-dlopen' is ignored for archives"
8688 fi
8689
8690 case " $deplibs" in
8691 *\ -l* | *\ -L*)
8692 func_warning "'-l' and '-L' are ignored for archives" ;;
8693 esac
8694
8695 test -n "$rpath" && \
8696 func_warning "'-rpath' is ignored for archives"
8697
8698 test -n "$xrpath" && \
8699 func_warning "'-R' is ignored for archives"
8700
8701 test -n "$vinfo" && \
8702 func_warning "'-version-info/-version-number' is ignored for archives"
8703
8704 test -n "$release" && \
8705 func_warning "'-release' is ignored for archives"
8706
8707 test -n "$export_symbols$export_symbols_regex" && \
8708 func_warning "'-export-symbols' is ignored for archives"
8709
8710 # Now set the variables for building old libraries.
8711 build_libtool_libs=no
8712 oldlibs=$output
8713 func_append objs "$old_deplibs"
8714 ;;
8715
8716 lib)
8717 # Make sure we only generate libraries of the form 'libNAME.la'.
8718 case $outputname in
8719 lib*)
8720 func_stripname 'lib' '.la' "$outputname"
8721 name=$func_stripname_result
8722 eval shared_ext=\"$shrext_cmds\"
8723 eval libname=\"$libname_spec\"
8724 ;;
8725 *)
8726 test no = "$module" \
8727 && func_fatal_help "libtool library '$output' must begin with 'lib'"
8728
8729 if test no != "$need_lib_prefix"; then
8730 # Add the "lib" prefix for modules if required
8731 func_stripname '' '.la' "$outputname"
8732 name=$func_stripname_result
8733 eval shared_ext=\"$shrext_cmds\"
8734 eval libname=\"$libname_spec\"
8735 else
8736 func_stripname '' '.la' "$outputname"
8737 libname=$func_stripname_result
8738 fi
8739 ;;
8740 esac
8741
8742 if test -n "$objs"; then
8743 if test pass_all != "$deplibs_check_method"; then
8744 func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
8745 else
8746 echo
8747 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
8748 $ECHO "*** objects $objs is not portable!"
8749 func_append libobjs " $objs"
8750 fi
8751 fi
8752
8753 test no = "$dlself" \
8754 || func_warning "'-dlopen self' is ignored for libtool libraries"
8755
8756 set dummy $rpath
8757 shift
8758 test 1 -lt "$#" \
8759 && func_warning "ignoring multiple '-rpath's for a libtool library"
8760
8761 install_libdir=$1
8762
8763 oldlibs=
8764 if test -z "$rpath"; then
8765 if test yes = "$build_libtool_libs"; then
8766 # Building a libtool convenience library.
8767 # Some compilers have problems with a '.al' extension so
8768 # convenience libraries should have the same extension an
8769 # archive normally would.
8770 oldlibs="$output_objdir/$libname.$libext $oldlibs"
8771 build_libtool_libs=convenience
8772 build_old_libs=yes
8773 fi
8774
8775 test -n "$vinfo" && \
8776 func_warning "'-version-info/-version-number' is ignored for convenience libraries"
8777
8778 test -n "$release" && \
8779 func_warning "'-release' is ignored for convenience libraries"
8780 else
8781
8782 # Parse the version information argument.
8783 save_ifs=$IFS; IFS=:
8784 set dummy $vinfo 0 0 0
8785 shift
8786 IFS=$save_ifs
8787
8788 test -n "$7" && \
8789 func_fatal_help "too many parameters to '-version-info'"
8790
8791 # convert absolute version numbers to libtool ages
8792 # this retains compatibility with .la files and attempts
8793 # to make the code below a bit more comprehensible
8794
8795 case $vinfo_number in
8796 yes)
8797 number_major=$1
8798 number_minor=$2
8799 number_revision=$3
8800 #
8801 # There are really only two kinds -- those that
8802 # use the current revision as the major version
8803 # and those that subtract age and use age as
8804 # a minor version. But, then there is irix
8805 # that has an extra 1 added just for fun
8806 #
8807 case $version_type in
8808 # correct linux to gnu/linux during the next big refactor
8809 darwin|freebsd-elf|linux|osf|windows|none)
8810 func_arith $number_major + $number_minor
8811 current=$func_arith_result
8812 age=$number_minor
8813 revision=$number_revision
8814 ;;
8815 freebsd-aout|qnx|sunos)
8816 current=$number_major
8817 revision=$number_minor
8818 age=0
8819 ;;
8820 irix|nonstopux)
8821 func_arith $number_major + $number_minor
8822 current=$func_arith_result
8823 age=$number_minor
8824 revision=$number_minor
8825 lt_irix_increment=no
8826 ;;
8827 esac
8828 ;;
8829 no)
8830 current=$1
8831 revision=$2
8832 age=$3
8833 ;;
8834 esac
8835
8836 # Check that each of the things are valid numbers.
8837 case $current in
8838 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8839 *)
8840 func_error "CURRENT '$current' must be a nonnegative integer"
8841 func_fatal_error "'$vinfo' is not valid version information"
8842 ;;
8843 esac
8844
8845 case $revision in
8846 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8847 *)
8848 func_error "REVISION '$revision' must be a nonnegative integer"
8849 func_fatal_error "'$vinfo' is not valid version information"
8850 ;;
8851 esac
8852
8853 case $age in
8854 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8855 *)
8856 func_error "AGE '$age' must be a nonnegative integer"
8857 func_fatal_error "'$vinfo' is not valid version information"
8858 ;;
8859 esac
8860
8861 if test "$age" -gt "$current"; then
8862 func_error "AGE '$age' is greater than the current interface number '$current'"
8863 func_fatal_error "'$vinfo' is not valid version information"
8864 fi
8865
8866 # Calculate the version variables.
8867 major=
8868 versuffix=
8869 verstring=
8870 case $version_type in
8871 none) ;;
8872
8873 darwin)
8874 # Like Linux, but with the current version available in
8875 # verstring for coding it into the library header
8876 func_arith $current - $age
8877 major=.$func_arith_result
8878 versuffix=$major.$age.$revision
8879 # Darwin ld doesn't like 0 for these options...
8880 func_arith $current + 1
8881 minor_current=$func_arith_result
8882 xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
8883 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8884 # On Darwin other compilers
8885 case $CC in
8886 nagfor*)
8887 verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
8888 ;;
8889 *)
8890 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8891 ;;
8892 esac
8893 ;;
8894
8895 freebsd-aout)
8896 major=.$current
8897 versuffix=.$current.$revision
8898 ;;
8899
8900 freebsd-elf)
8901 func_arith $current - $age
8902 major=.$func_arith_result
8903 versuffix=$major.$age.$revision
8904 ;;
8905
8906 irix | nonstopux)
8907 if test no = "$lt_irix_increment"; then
8908 func_arith $current - $age
8909 else
8910 func_arith $current - $age + 1
8911 fi
8912 major=$func_arith_result
8913
8914 case $version_type in
8915 nonstopux) verstring_prefix=nonstopux ;;
8916 *) verstring_prefix=sgi ;;
8917 esac
8918 verstring=$verstring_prefix$major.$revision
8919
8920 # Add in all the interfaces that we are compatible with.
8921 loop=$revision
8922 while test 0 -ne "$loop"; do
8923 func_arith $revision - $loop
8924 iface=$func_arith_result
8925 func_arith $loop - 1
8926 loop=$func_arith_result
8927 verstring=$verstring_prefix$major.$iface:$verstring
8928 done
8929
8930 # Before this point, $major must not contain '.'.
8931 major=.$major
8932 versuffix=$major.$revision
8933 ;;
8934
8935 linux) # correct to gnu/linux during the next big refactor
8936 func_arith $current - $age
8937 major=.$func_arith_result
8938 versuffix=$major.$age.$revision
8939 ;;
8940
8941 osf)
8942 func_arith $current - $age
8943 major=.$func_arith_result
8944 versuffix=.$current.$age.$revision
8945 verstring=$current.$age.$revision
8946
8947 # Add in all the interfaces that we are compatible with.
8948 loop=$age
8949 while test 0 -ne "$loop"; do
8950 func_arith $current - $loop
8951 iface=$func_arith_result
8952 func_arith $loop - 1
8953 loop=$func_arith_result
8954 verstring=$verstring:$iface.0
8955 done
8956
8957 # Make executables depend on our current version.
8958 func_append verstring ":$current.0"
8959 ;;
8960
8961 qnx)
8962 major=.$current
8963 versuffix=.$current
8964 ;;
8965
8966 sco)
8967 major=.$current
8968 versuffix=.$current
8969 ;;
8970
8971 sunos)
8972 major=.$current
8973 versuffix=.$current.$revision
8974 ;;
8975
8976 windows)
8977 # Use '-' rather than '.', since we only want one
8978 # extension on DOS 8.3 file systems.
8979 func_arith $current - $age
8980 major=$func_arith_result
8981 versuffix=-$major
8982 ;;
8983
8984 *)
8985 func_fatal_configuration "unknown library version type '$version_type'"
8986 ;;
8987 esac
8988
8989 # Clear the version info if we defaulted, and they specified a release.
8990 if test -z "$vinfo" && test -n "$release"; then
8991 major=
8992 case $version_type in
8993 darwin)
8994 # we can't check for "0.0" in archive_cmds due to quoting
8995 # problems, so we reset it completely
8996 verstring=
8997 ;;
8998 *)
8999 verstring=0.0
9000 ;;
9001 esac
9002 if test no = "$need_version"; then
9003 versuffix=
9004 else
9005 versuffix=.0.0
9006 fi
9007 fi
9008
9009 # Remove version info from name if versioning should be avoided
9010 if test yes,no = "$avoid_version,$need_version"; then
9011 major=
9012 versuffix=
9013 verstring=
9014 fi
9015
9016 # Check to see if the archive will have undefined symbols.
9017 if test yes = "$allow_undefined"; then
9018 if test unsupported = "$allow_undefined_flag"; then
9019 if test yes = "$build_old_libs"; then
9020 func_warning "undefined symbols not allowed in $host shared libraries; building static only"
9021 build_libtool_libs=no
9022 else
9023 func_fatal_error "can't build $host shared library unless -no-undefined is specified"
9024 fi
9025 fi
9026 else
9027 # Don't allow undefined symbols.
9028 allow_undefined_flag=$no_undefined_flag
9029 fi
9030
9031 fi
9032
9033 func_generate_dlsyms "$libname" "$libname" :
9034 func_append libobjs " $symfileobj"
9035 test " " = "$libobjs" && libobjs=
9036
9037 if test relink != "$opt_mode"; then
9038 # Remove our outputs, but don't remove object files since they
9039 # may have been created when compiling PIC objects.
9040 removelist=
9041 tempremovelist=`$ECHO "$output_objdir/*"`
9042 for p in $tempremovelist; do
9043 case $p in
9044 *.$objext | *.gcno)
9045 ;;
9046 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
9047 if test -n "$precious_files_regex"; then
9048 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
9049 then
9050 continue
9051 fi
9052 fi
9053 func_append removelist " $p"
9054 ;;
9055 *) ;;
9056 esac
9057 done
9058 test -n "$removelist" && \
9059 func_show_eval "${RM}r \$removelist"
9060 fi
9061
9062 # Now set the variables for building old libraries.
9063 if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
9064 func_append oldlibs " $output_objdir/$libname.$libext"
9065
9066 # Transform .lo files to .o files.
9067 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
9068 fi
9069
9070 # Eliminate all temporary directories.
9071 #for path in $notinst_path; do
9072 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
9073 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
9074 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
9075 #done
9076
9077 if test -n "$xrpath"; then
9078 # If the user specified any rpath flags, then add them.
9079 temp_xrpath=
9080 for libdir in $xrpath; do
9081 func_replace_sysroot "$libdir"
9082 func_append temp_xrpath " -R$func_replace_sysroot_result"
9083 case "$finalize_rpath " in
9084 *" $libdir "*) ;;
9085 *) func_append finalize_rpath " $libdir" ;;
9086 esac
9087 done
9088 if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
9089 dependency_libs="$temp_xrpath $dependency_libs"
9090 fi
9091 fi
9092
9093 # Make sure dlfiles contains only unique files that won't be dlpreopened
9094 old_dlfiles=$dlfiles
9095 dlfiles=
9096 for lib in $old_dlfiles; do
9097 case " $dlprefiles $dlfiles " in
9098 *" $lib "*) ;;
9099 *) func_append dlfiles " $lib" ;;
9100 esac
9101 done
9102
9103 # Make sure dlprefiles contains only unique files
9104 old_dlprefiles=$dlprefiles
9105 dlprefiles=
9106 for lib in $old_dlprefiles; do
9107 case "$dlprefiles " in
9108 *" $lib "*) ;;
9109 *) func_append dlprefiles " $lib" ;;
9110 esac
9111 done
9112
9113 if test yes = "$build_libtool_libs"; then
9114 if test -n "$rpath"; then
9115 case $host in
9116 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
9117 # these systems don't actually have a c library (as such)!
9118 ;;
9119 *-*-rhapsody* | *-*-darwin1.[012])
9120 # Rhapsody C library is in the System framework
9121 func_append deplibs " System.ltframework"
9122 ;;
9123 *-*-netbsd*)
9124 # Don't link with libc until the a.out ld.so is fixed.
9125 ;;
9126 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
9127 # Do not include libc due to us having libc/libc_r.
9128 ;;
9129 *-*-sco3.2v5* | *-*-sco5v6*)
9130 # Causes problems with __ctype
9131 ;;
9132 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
9133 # Compiler inserts libc in the correct place for threads to work
9134 ;;
9135 *)
9136 # Add libc to deplibs on all other systems if necessary.
9137 if test yes = "$build_libtool_need_lc"; then
9138 func_append deplibs " -lc"
9139 fi
9140 ;;
9141 esac
9142 fi
9143
9144 # Transform deplibs into only deplibs that can be linked in shared.
9145 name_save=$name
9146 libname_save=$libname
9147 release_save=$release
9148 versuffix_save=$versuffix
9149 major_save=$major
9150 # I'm not sure if I'm treating the release correctly. I think
9151 # release should show up in the -l (ie -lgmp5) so we don't want to
9152 # add it in twice. Is that correct?
9153 release=
9154 versuffix=
9155 major=
9156 newdeplibs=
9157 droppeddeps=no
9158 case $deplibs_check_method in
9159 pass_all)
9160 # Don't check for shared/static. Everything works.
9161 # This might be a little naive. We might want to check
9162 # whether the library exists or not. But this is on
9163 # osf3 & osf4 and I'm not really sure... Just
9164 # implementing what was already the behavior.
9165 newdeplibs=$deplibs
9166 ;;
9167 test_compile)
9168 # This code stresses the "libraries are programs" paradigm to its
9169 # limits. Maybe even breaks it. We compile a program, linking it
9170 # against the deplibs as a proxy for the library. Then we can check
9171 # whether they linked in statically or dynamically with ldd.
9172 $opt_dry_run || $RM conftest.c
9173 cat > conftest.c <<EOF
9174 int main() { return 0; }
9175 EOF
9176 $opt_dry_run || $RM conftest
9177 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
9178 ldd_output=`ldd conftest`
9179 for i in $deplibs; do
9180 case $i in
9181 -l*)
9182 func_stripname -l '' "$i"
9183 name=$func_stripname_result
9184 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9185 case " $predeps $postdeps " in
9186 *" $i "*)
9187 func_append newdeplibs " $i"
9188 i=
9189 ;;
9190 esac
9191 fi
9192 if test -n "$i"; then
9193 libname=`eval "\\$ECHO \"$libname_spec\""`
9194 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9195 set dummy $deplib_matches; shift
9196 deplib_match=$1
9197 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9198 func_append newdeplibs " $i"
9199 else
9200 droppeddeps=yes
9201 echo
9202 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9203 echo "*** I have the capability to make that library automatically link in when"
9204 echo "*** you link to this library. But I can only do this if you have a"
9205 echo "*** shared version of the library, which I believe you do not have"
9206 echo "*** because a test_compile did reveal that the linker did not use it for"
9207 echo "*** its dynamic dependency list that programs get resolved with at runtime."
9208 fi
9209 fi
9210 ;;
9211 *)
9212 func_append newdeplibs " $i"
9213 ;;
9214 esac
9215 done
9216 else
9217 # Error occurred in the first compile. Let's try to salvage
9218 # the situation: Compile a separate program for each library.
9219 for i in $deplibs; do
9220 case $i in
9221 -l*)
9222 func_stripname -l '' "$i"
9223 name=$func_stripname_result
9224 $opt_dry_run || $RM conftest
9225 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
9226 ldd_output=`ldd conftest`
9227 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9228 case " $predeps $postdeps " in
9229 *" $i "*)
9230 func_append newdeplibs " $i"
9231 i=
9232 ;;
9233 esac
9234 fi
9235 if test -n "$i"; then
9236 libname=`eval "\\$ECHO \"$libname_spec\""`
9237 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9238 set dummy $deplib_matches; shift
9239 deplib_match=$1
9240 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9241 func_append newdeplibs " $i"
9242 else
9243 droppeddeps=yes
9244 echo
9245 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9246 echo "*** I have the capability to make that library automatically link in when"
9247 echo "*** you link to this library. But I can only do this if you have a"
9248 echo "*** shared version of the library, which you do not appear to have"
9249 echo "*** because a test_compile did reveal that the linker did not use this one"
9250 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
9251 fi
9252 fi
9253 else
9254 droppeddeps=yes
9255 echo
9256 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
9257 echo "*** make it link in! You will probably need to install it or some"
9258 echo "*** library that it depends on before this library will be fully"
9259 echo "*** functional. Installing it before continuing would be even better."
9260 fi
9261 ;;
9262 *)
9263 func_append newdeplibs " $i"
9264 ;;
9265 esac
9266 done
9267 fi
9268 ;;
9269 file_magic*)
9270 set dummy $deplibs_check_method; shift
9271 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9272 for a_deplib in $deplibs; do
9273 case $a_deplib in
9274 -l*)
9275 func_stripname -l '' "$a_deplib"
9276 name=$func_stripname_result
9277 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9278 case " $predeps $postdeps " in
9279 *" $a_deplib "*)
9280 func_append newdeplibs " $a_deplib"
9281 a_deplib=
9282 ;;
9283 esac
9284 fi
9285 if test -n "$a_deplib"; then
9286 libname=`eval "\\$ECHO \"$libname_spec\""`
9287 if test -n "$file_magic_glob"; then
9288 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
9289 else
9290 libnameglob=$libname
9291 fi
9292 test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
9293 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9294 if test yes = "$want_nocaseglob"; then
9295 shopt -s nocaseglob
9296 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9297 $nocaseglob
9298 else
9299 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9300 fi
9301 for potent_lib in $potential_libs; do
9302 # Follow soft links.
9303 if ls -lLd "$potent_lib" 2>/dev/null |
9304 $GREP " -> " >/dev/null; then
9305 continue
9306 fi
9307 # The statement above tries to avoid entering an
9308 # endless loop below, in case of cyclic links.
9309 # We might still enter an endless loop, since a link
9310 # loop can be closed while we follow links,
9311 # but so what?
9312 potlib=$potent_lib
9313 while test -h "$potlib" 2>/dev/null; do
9314 potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
9315 case $potliblink in
9316 [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
9317 *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
9318 esac
9319 done
9320 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
9321 $SED -e 10q |
9322 $EGREP "$file_magic_regex" > /dev/null; then
9323 func_append newdeplibs " $a_deplib"
9324 a_deplib=
9325 break 2
9326 fi
9327 done
9328 done
9329 fi
9330 if test -n "$a_deplib"; then
9331 droppeddeps=yes
9332 echo
9333 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9334 echo "*** I have the capability to make that library automatically link in when"
9335 echo "*** you link to this library. But I can only do this if you have a"
9336 echo "*** shared version of the library, which you do not appear to have"
9337 echo "*** because I did check the linker path looking for a file starting"
9338 if test -z "$potlib"; then
9339 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
9340 else
9341 $ECHO "*** with $libname and none of the candidates passed a file format test"
9342 $ECHO "*** using a file magic. Last file checked: $potlib"
9343 fi
9344 fi
9345 ;;
9346 *)
9347 # Add a -L argument.
9348 func_append newdeplibs " $a_deplib"
9349 ;;
9350 esac
9351 done # Gone through all deplibs.
9352 ;;
9353 match_pattern*)
9354 set dummy $deplibs_check_method; shift
9355 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
9356 for a_deplib in $deplibs; do
9357 case $a_deplib in
9358 -l*)
9359 func_stripname -l '' "$a_deplib"
9360 name=$func_stripname_result
9361 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9362 case " $predeps $postdeps " in
9363 *" $a_deplib "*)
9364 func_append newdeplibs " $a_deplib"
9365 a_deplib=
9366 ;;
9367 esac
9368 fi
9369 if test -n "$a_deplib"; then
9370 libname=`eval "\\$ECHO \"$libname_spec\""`
9371 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9372 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
9373 for potent_lib in $potential_libs; do
9374 potlib=$potent_lib # see symlink-check above in file_magic test
9375 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
9376 $EGREP "$match_pattern_regex" > /dev/null; then
9377 func_append newdeplibs " $a_deplib"
9378 a_deplib=
9379 break 2
9380 fi
9381 done
9382 done
9383 fi
9384 if test -n "$a_deplib"; then
9385 droppeddeps=yes
9386 echo
9387 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9388 echo "*** I have the capability to make that library automatically link in when"
9389 echo "*** you link to this library. But I can only do this if you have a"
9390 echo "*** shared version of the library, which you do not appear to have"
9391 echo "*** because I did check the linker path looking for a file starting"
9392 if test -z "$potlib"; then
9393 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
9394 else
9395 $ECHO "*** with $libname and none of the candidates passed a file format test"
9396 $ECHO "*** using a regex pattern. Last file checked: $potlib"
9397 fi
9398 fi
9399 ;;
9400 *)
9401 # Add a -L argument.
9402 func_append newdeplibs " $a_deplib"
9403 ;;
9404 esac
9405 done # Gone through all deplibs.
9406 ;;
9407 none | unknown | *)
9408 newdeplibs=
9409 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
9410 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9411 for i in $predeps $postdeps; do
9412 # can't use Xsed below, because $i might contain '/'
9413 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
9414 done
9415 fi
9416 case $tmp_deplibs in
9417 *[!\ \ ]*)
9418 echo
9419 if test none = "$deplibs_check_method"; then
9420 echo "*** Warning: inter-library dependencies are not supported in this platform."
9421 else
9422 echo "*** Warning: inter-library dependencies are not known to be supported."
9423 fi
9424 echo "*** All declared inter-library dependencies are being dropped."
9425 droppeddeps=yes
9426 ;;
9427 esac
9428 ;;
9429 esac
9430 versuffix=$versuffix_save
9431 major=$major_save
9432 release=$release_save
9433 libname=$libname_save
9434 name=$name_save
9435
9436 case $host in
9437 *-*-rhapsody* | *-*-darwin1.[012])
9438 # On Rhapsody replace the C library with the System framework
9439 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
9440 ;;
9441 esac
9442
9443 if test yes = "$droppeddeps"; then
9444 if test yes = "$module"; then
9445 echo
9446 echo "*** Warning: libtool could not satisfy all declared inter-library"
9447 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
9448 echo "*** a static module, that should work as long as the dlopening"
9449 echo "*** application is linked with the -dlopen flag."
9450 if test -z "$global_symbol_pipe"; then
9451 echo
9452 echo "*** However, this would only work if libtool was able to extract symbol"
9453 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
9454 echo "*** not find such a program. So, this module is probably useless."
9455 echo "*** 'nm' from GNU binutils and a full rebuild may help."
9456 fi
9457 if test no = "$build_old_libs"; then
9458 oldlibs=$output_objdir/$libname.$libext
9459 build_libtool_libs=module
9460 build_old_libs=yes
9461 else
9462 build_libtool_libs=no
9463 fi
9464 else
9465 echo "*** The inter-library dependencies that have been dropped here will be"
9466 echo "*** automatically added whenever a program is linked with this library"
9467 echo "*** or is declared to -dlopen it."
9468
9469 if test no = "$allow_undefined"; then
9470 echo
9471 echo "*** Since this library must not contain undefined symbols,"
9472 echo "*** because either the platform does not support them or"
9473 echo "*** it was explicitly requested with -no-undefined,"
9474 echo "*** libtool will only create a static version of it."
9475 if test no = "$build_old_libs"; then
9476 oldlibs=$output_objdir/$libname.$libext
9477 build_libtool_libs=module
9478 build_old_libs=yes
9479 else
9480 build_libtool_libs=no
9481 fi
9482 fi
9483 fi
9484 fi
9485 # Done checking deplibs!
9486 deplibs=$newdeplibs
9487 fi
9488 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
9489 case $host in
9490 *-*-darwin*)
9491 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9492 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9493 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9494 ;;
9495 esac
9496
9497 # move library search paths that coincide with paths to not yet
9498 # installed libraries to the beginning of the library search list
9499 new_libs=
9500 for path in $notinst_path; do
9501 case " $new_libs " in
9502 *" -L$path/$objdir "*) ;;
9503 *)
9504 case " $deplibs " in
9505 *" -L$path/$objdir "*)
9506 func_append new_libs " -L$path/$objdir" ;;
9507 esac
9508 ;;
9509 esac
9510 done
9511 for deplib in $deplibs; do
9512 case $deplib in
9513 -L*)
9514 case " $new_libs " in
9515 *" $deplib "*) ;;
9516 *) func_append new_libs " $deplib" ;;
9517 esac
9518 ;;
9519 *) func_append new_libs " $deplib" ;;
9520 esac
9521 done
9522 deplibs=$new_libs
9523
9524 # All the library-specific variables (install_libdir is set above).
9525 library_names=
9526 old_library=
9527 dlname=
9528
9529 # Test again, we may have decided not to build it any more
9530 if test yes = "$build_libtool_libs"; then
9531 # Remove $wl instances when linking with ld.
9532 # FIXME: should test the right _cmds variable.
9533 case $archive_cmds in
9534 *\$LD\ *) wl= ;;
9535 esac
9536 if test yes = "$hardcode_into_libs"; then
9537 # Hardcode the library paths
9538 hardcode_libdirs=
9539 dep_rpath=
9540 rpath=$finalize_rpath
9541 test relink = "$opt_mode" || rpath=$compile_rpath$rpath
9542 for libdir in $rpath; do
9543 if test -n "$hardcode_libdir_flag_spec"; then
9544 if test -n "$hardcode_libdir_separator"; then
9545 func_replace_sysroot "$libdir"
9546 libdir=$func_replace_sysroot_result
9547 if test -z "$hardcode_libdirs"; then
9548 hardcode_libdirs=$libdir
9549 else
9550 # Just accumulate the unique libdirs.
9551 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9552 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9553 ;;
9554 *)
9555 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
9556 ;;
9557 esac
9558 fi
9559 else
9560 eval flag=\"$hardcode_libdir_flag_spec\"
9561 func_append dep_rpath " $flag"
9562 fi
9563 elif test -n "$runpath_var"; then
9564 case "$perm_rpath " in
9565 *" $libdir "*) ;;
9566 *) func_append perm_rpath " $libdir" ;;
9567 esac
9568 fi
9569 done
9570 # Substitute the hardcoded libdirs into the rpath.
9571 if test -n "$hardcode_libdir_separator" &&
9572 test -n "$hardcode_libdirs"; then
9573 libdir=$hardcode_libdirs
9574 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
9575 fi
9576 if test -n "$runpath_var" && test -n "$perm_rpath"; then
9577 # We should set the runpath_var.
9578 rpath=
9579 for dir in $perm_rpath; do
9580 func_append rpath "$dir:"
9581 done
9582 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
9583 fi
9584 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
9585 fi
9586
9587 shlibpath=$finalize_shlibpath
9588 test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
9589 if test -n "$shlibpath"; then
9590 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
9591 fi
9592
9593 # Get the real and link names of the library.
9594 eval shared_ext=\"$shrext_cmds\"
9595 eval library_names=\"$library_names_spec\"
9596 set dummy $library_names
9597 shift
9598 realname=$1
9599 shift
9600
9601 if test -n "$soname_spec"; then
9602 eval soname=\"$soname_spec\"
9603 else
9604 soname=$realname
9605 fi
9606 if test -z "$dlname"; then
9607 dlname=$soname
9608 fi
9609
9610 lib=$output_objdir/$realname
9611 linknames=
9612 for link
9613 do
9614 func_append linknames " $link"
9615 done
9616
9617 # Use standard objects if they are pic
9618 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
9619 test "X$libobjs" = "X " && libobjs=
9620
9621 delfiles=
9622 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9623 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
9624 export_symbols=$output_objdir/$libname.uexp
9625 func_append delfiles " $export_symbols"
9626 fi
9627
9628 orig_export_symbols=
9629 case $host_os in
9630 cygwin* | mingw* | cegcc*)
9631 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
9632 # exporting using user supplied symfile
9633 func_dll_def_p "$export_symbols" || {
9634 # and it's NOT already a .def file. Must figure out
9635 # which of the given symbols are data symbols and tag
9636 # them as such. So, trigger use of export_symbols_cmds.
9637 # export_symbols gets reassigned inside the "prepare
9638 # the list of exported symbols" if statement, so the
9639 # include_expsyms logic still works.
9640 orig_export_symbols=$export_symbols
9641 export_symbols=
9642 always_export_symbols=yes
9643 }
9644 fi
9645 ;;
9646 esac
9647
9648 # Prepare the list of exported symbols
9649 if test -z "$export_symbols"; then
9650 if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
9651 func_verbose "generating symbol list for '$libname.la'"
9652 export_symbols=$output_objdir/$libname.exp
9653 $opt_dry_run || $RM $export_symbols
9654 cmds=$export_symbols_cmds
9655 save_ifs=$IFS; IFS='~'
9656 for cmd1 in $cmds; do
9657 IFS=$save_ifs
9658 # Take the normal branch if the nm_file_list_spec branch
9659 # doesn't work or if tool conversion is not needed.
9660 case $nm_file_list_spec~$to_tool_file_cmd in
9661 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
9662 try_normal_branch=yes
9663 eval cmd=\"$cmd1\"
9664 func_len " $cmd"
9665 len=$func_len_result
9666 ;;
9667 *)
9668 try_normal_branch=no
9669 ;;
9670 esac
9671 if test yes = "$try_normal_branch" \
9672 && { test "$len" -lt "$max_cmd_len" \
9673 || test "$max_cmd_len" -le -1; }
9674 then
9675 func_show_eval "$cmd" 'exit $?'
9676 skipped_export=false
9677 elif test -n "$nm_file_list_spec"; then
9678 func_basename "$output"
9679 output_la=$func_basename_result
9680 save_libobjs=$libobjs
9681 save_output=$output
9682 output=$output_objdir/$output_la.nm
9683 func_to_tool_file "$output"
9684 libobjs=$nm_file_list_spec$func_to_tool_file_result
9685 func_append delfiles " $output"
9686 func_verbose "creating $NM input file list: $output"
9687 for obj in $save_libobjs; do
9688 func_to_tool_file "$obj"
9689 $ECHO "$func_to_tool_file_result"
9690 done > "$output"
9691 eval cmd=\"$cmd1\"
9692 func_show_eval "$cmd" 'exit $?'
9693 output=$save_output
9694 libobjs=$save_libobjs
9695 skipped_export=false
9696 else
9697 # The command line is too long to execute in one step.
9698 func_verbose "using reloadable object file for export list..."
9699 skipped_export=:
9700 # Break out early, otherwise skipped_export may be
9701 # set to false by a later but shorter cmd.
9702 break
9703 fi
9704 done
9705 IFS=$save_ifs
9706 if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
9707 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9708 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9709 fi
9710 fi
9711 fi
9712
9713 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9714 tmp_export_symbols=$export_symbols
9715 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
9716 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
9717 fi
9718
9719 if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
9720 # The given exports_symbols file has to be filtered, so filter it.
9721 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
9722 # FIXME: $output_objdir/$libname.filter potentially contains lots of
9723 # 's' commands, which not all seds can handle. GNU sed should be fine
9724 # though. Also, the filter scales superlinearly with the number of
9725 # global variables. join(1) would be nice here, but unfortunately
9726 # isn't a blessed tool.
9727 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
9728 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
9729 export_symbols=$output_objdir/$libname.def
9730 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
9731 fi
9732
9733 tmp_deplibs=
9734 for test_deplib in $deplibs; do
9735 case " $convenience " in
9736 *" $test_deplib "*) ;;
9737 *)
9738 func_append tmp_deplibs " $test_deplib"
9739 ;;
9740 esac
9741 done
9742 deplibs=$tmp_deplibs
9743
9744 if test -n "$convenience"; then
9745 if test -n "$whole_archive_flag_spec" &&
9746 test yes = "$compiler_needs_object" &&
9747 test -z "$libobjs"; then
9748 # extract the archives, so we have objects to list.
9749 # TODO: could optimize this to just extract one archive.
9750 whole_archive_flag_spec=
9751 fi
9752 if test -n "$whole_archive_flag_spec"; then
9753 save_libobjs=$libobjs
9754 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
9755 test "X$libobjs" = "X " && libobjs=
9756 else
9757 gentop=$output_objdir/${outputname}x
9758 func_append generated " $gentop"
9759
9760 func_extract_archives $gentop $convenience
9761 func_append libobjs " $func_extract_archives_result"
9762 test "X$libobjs" = "X " && libobjs=
9763 fi
9764 fi
9765
9766 if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
9767 eval flag=\"$thread_safe_flag_spec\"
9768 func_append linker_flags " $flag"
9769 fi
9770
9771 # Make a backup of the uninstalled library when relinking
9772 if test relink = "$opt_mode"; then
9773 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
9774 fi
9775
9776 # Do each of the archive commands.
9777 if test yes = "$module" && test -n "$module_cmds"; then
9778 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
9779 eval test_cmds=\"$module_expsym_cmds\"
9780 cmds=$module_expsym_cmds
9781 else
9782 eval test_cmds=\"$module_cmds\"
9783 cmds=$module_cmds
9784 fi
9785 else
9786 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
9787 eval test_cmds=\"$archive_expsym_cmds\"
9788 cmds=$archive_expsym_cmds
9789 else
9790 eval test_cmds=\"$archive_cmds\"
9791 cmds=$archive_cmds
9792 fi
9793 fi
9794
9795 if test : != "$skipped_export" &&
9796 func_len " $test_cmds" &&
9797 len=$func_len_result &&
9798 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9799 :
9800 else
9801 # The command line is too long to link in one step, link piecewise
9802 # or, if using GNU ld and skipped_export is not :, use a linker
9803 # script.
9804
9805 # Save the value of $output and $libobjs because we want to
9806 # use them later. If we have whole_archive_flag_spec, we
9807 # want to use save_libobjs as it was before
9808 # whole_archive_flag_spec was expanded, because we can't
9809 # assume the linker understands whole_archive_flag_spec.
9810 # This may have to be revisited, in case too many
9811 # convenience libraries get linked in and end up exceeding
9812 # the spec.
9813 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
9814 save_libobjs=$libobjs
9815 fi
9816 save_output=$output
9817 func_basename "$output"
9818 output_la=$func_basename_result
9819
9820 # Clear the reloadable object creation command queue and
9821 # initialize k to one.
9822 test_cmds=
9823 concat_cmds=
9824 objlist=
9825 last_robj=
9826 k=1
9827
9828 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
9829 output=$output_objdir/$output_la.lnkscript
9830 func_verbose "creating GNU ld script: $output"
9831 echo 'INPUT (' > $output
9832 for obj in $save_libobjs
9833 do
9834 func_to_tool_file "$obj"
9835 $ECHO "$func_to_tool_file_result" >> $output
9836 done
9837 echo ')' >> $output
9838 func_append delfiles " $output"
9839 func_to_tool_file "$output"
9840 output=$func_to_tool_file_result
9841 elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
9842 output=$output_objdir/$output_la.lnk
9843 func_verbose "creating linker input file list: $output"
9844 : > $output
9845 set x $save_libobjs
9846 shift
9847 firstobj=
9848 if test yes = "$compiler_needs_object"; then
9849 firstobj="$1 "
9850 shift
9851 fi
9852 for obj
9853 do
9854 func_to_tool_file "$obj"
9855 $ECHO "$func_to_tool_file_result" >> $output
9856 done
9857 func_append delfiles " $output"
9858 func_to_tool_file "$output"
9859 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
9860 else
9861 if test -n "$save_libobjs"; then
9862 func_verbose "creating reloadable object files..."
9863 output=$output_objdir/$output_la-$k.$objext
9864 eval test_cmds=\"$reload_cmds\"
9865 func_len " $test_cmds"
9866 len0=$func_len_result
9867 len=$len0
9868
9869 # Loop over the list of objects to be linked.
9870 for obj in $save_libobjs
9871 do
9872 func_len " $obj"
9873 func_arith $len + $func_len_result
9874 len=$func_arith_result
9875 if test -z "$objlist" ||
9876 test "$len" -lt "$max_cmd_len"; then
9877 func_append objlist " $obj"
9878 else
9879 # The command $test_cmds is almost too long, add a
9880 # command to the queue.
9881 if test 1 -eq "$k"; then
9882 # The first file doesn't have a previous command to add.
9883 reload_objs=$objlist
9884 eval concat_cmds=\"$reload_cmds\"
9885 else
9886 # All subsequent reloadable object files will link in
9887 # the last one created.
9888 reload_objs="$objlist $last_robj"
9889 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
9890 fi
9891 last_robj=$output_objdir/$output_la-$k.$objext
9892 func_arith $k + 1
9893 k=$func_arith_result
9894 output=$output_objdir/$output_la-$k.$objext
9895 objlist=" $obj"
9896 func_len " $last_robj"
9897 func_arith $len0 + $func_len_result
9898 len=$func_arith_result
9899 fi
9900 done
9901 # Handle the remaining objects by creating one last
9902 # reloadable object file. All subsequent reloadable object
9903 # files will link in the last one created.
9904 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9905 reload_objs="$objlist $last_robj"
9906 eval concat_cmds=\"\$concat_cmds$reload_cmds\"
9907 if test -n "$last_robj"; then
9908 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
9909 fi
9910 func_append delfiles " $output"
9911
9912 else
9913 output=
9914 fi
9915
9916 ${skipped_export-false} && {
9917 func_verbose "generating symbol list for '$libname.la'"
9918 export_symbols=$output_objdir/$libname.exp
9919 $opt_dry_run || $RM $export_symbols
9920 libobjs=$output
9921 # Append the command to create the export file.
9922 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9923 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
9924 if test -n "$last_robj"; then
9925 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
9926 fi
9927 }
9928
9929 test -n "$save_libobjs" &&
9930 func_verbose "creating a temporary reloadable object file: $output"
9931
9932 # Loop through the commands generated above and execute them.
9933 save_ifs=$IFS; IFS='~'
9934 for cmd in $concat_cmds; do
9935 IFS=$save_ifs
9936 $opt_quiet || {
9937 func_quote_for_expand "$cmd"
9938 eval "func_echo $func_quote_for_expand_result"
9939 }
9940 $opt_dry_run || eval "$cmd" || {
9941 lt_exit=$?
9942
9943 # Restore the uninstalled library and exit
9944 if test relink = "$opt_mode"; then
9945 ( cd "$output_objdir" && \
9946 $RM "${realname}T" && \
9947 $MV "${realname}U" "$realname" )
9948 fi
9949
9950 exit $lt_exit
9951 }
9952 done
9953 IFS=$save_ifs
9954
9955 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
9956 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9957 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9958 fi
9959 fi
9960
9961 ${skipped_export-false} && {
9962 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9963 tmp_export_symbols=$export_symbols
9964 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
9965 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
9966 fi
9967
9968 if test -n "$orig_export_symbols"; then
9969 # The given exports_symbols file has to be filtered, so filter it.
9970 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
9971 # FIXME: $output_objdir/$libname.filter potentially contains lots of
9972 # 's' commands, which not all seds can handle. GNU sed should be fine
9973 # though. Also, the filter scales superlinearly with the number of
9974 # global variables. join(1) would be nice here, but unfortunately
9975 # isn't a blessed tool.
9976 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
9977 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
9978 export_symbols=$output_objdir/$libname.def
9979 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
9980 fi
9981 }
9982
9983 libobjs=$output
9984 # Restore the value of output.
9985 output=$save_output
9986
9987 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
9988 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
9989 test "X$libobjs" = "X " && libobjs=
9990 fi
9991 # Expand the library linking commands again to reset the
9992 # value of $libobjs for piecewise linking.
9993
9994 # Do each of the archive commands.
9995 if test yes = "$module" && test -n "$module_cmds"; then
9996 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
9997 cmds=$module_expsym_cmds
9998 else
9999 cmds=$module_cmds
10000 fi
10001 else
10002 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
10003 cmds=$archive_expsym_cmds
10004 else
10005 cmds=$archive_cmds
10006 fi
10007 fi
10008 fi
10009
10010 if test -n "$delfiles"; then
10011 # Append the command to remove temporary files to $cmds.
10012 eval cmds=\"\$cmds~\$RM $delfiles\"
10013 fi
10014
10015 # Add any objects from preloaded convenience libraries
10016 if test -n "$dlprefiles"; then
10017 gentop=$output_objdir/${outputname}x
10018 func_append generated " $gentop"
10019
10020 func_extract_archives $gentop $dlprefiles
10021 func_append libobjs " $func_extract_archives_result"
10022 test "X$libobjs" = "X " && libobjs=
10023 fi
10024
10025 save_ifs=$IFS; IFS='~'
10026 for cmd in $cmds; do
10027 IFS=$sp$nl
10028 eval cmd=\"$cmd\"
10029 IFS=$save_ifs
10030 $opt_quiet || {
10031 func_quote_for_expand "$cmd"
10032 eval "func_echo $func_quote_for_expand_result"
10033 }
10034 $opt_dry_run || eval "$cmd" || {
10035 lt_exit=$?
10036
10037 # Restore the uninstalled library and exit
10038 if test relink = "$opt_mode"; then
10039 ( cd "$output_objdir" && \
10040 $RM "${realname}T" && \
10041 $MV "${realname}U" "$realname" )
10042 fi
10043
10044 exit $lt_exit
10045 }
10046 done
10047 IFS=$save_ifs
10048
10049 # Restore the uninstalled library and exit
10050 if test relink = "$opt_mode"; then
10051 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
10052
10053 if test -n "$convenience"; then
10054 if test -z "$whole_archive_flag_spec"; then
10055 func_show_eval '${RM}r "$gentop"'
10056 fi
10057 fi
10058
10059 exit $EXIT_SUCCESS
10060 fi
10061
10062 # Create links to the real library.
10063 for linkname in $linknames; do
10064 if test "$realname" != "$linkname"; then
10065 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
10066 fi
10067 done
10068
10069 # If -module or -export-dynamic was specified, set the dlname.
10070 if test yes = "$module" || test yes = "$export_dynamic"; then
10071 # On all known operating systems, these are identical.
10072 dlname=$soname
10073 fi
10074 fi
10075 ;;
10076
10077 obj)
10078 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
10079 func_warning "'-dlopen' is ignored for objects"
10080 fi
10081
10082 case " $deplibs" in
10083 *\ -l* | *\ -L*)
10084 func_warning "'-l' and '-L' are ignored for objects" ;;
10085 esac
10086
10087 test -n "$rpath" && \
10088 func_warning "'-rpath' is ignored for objects"
10089
10090 test -n "$xrpath" && \
10091 func_warning "'-R' is ignored for objects"
10092
10093 test -n "$vinfo" && \
10094 func_warning "'-version-info' is ignored for objects"
10095
10096 test -n "$release" && \
10097 func_warning "'-release' is ignored for objects"
10098
10099 case $output in
10100 *.lo)
10101 test -n "$objs$old_deplibs" && \
10102 func_fatal_error "cannot build library object '$output' from non-libtool objects"
10103
10104 libobj=$output
10105 func_lo2o "$libobj"
10106 obj=$func_lo2o_result
10107 ;;
10108 *)
10109 libobj=
10110 obj=$output
10111 ;;
10112 esac
10113
10114 # Delete the old objects.
10115 $opt_dry_run || $RM $obj $libobj
10116
10117 # Objects from convenience libraries. This assumes
10118 # single-version convenience libraries. Whenever we create
10119 # different ones for PIC/non-PIC, this we'll have to duplicate
10120 # the extraction.
10121 reload_conv_objs=
10122 gentop=
10123 # if reload_cmds runs $LD directly, get rid of -Wl from
10124 # whole_archive_flag_spec and hope we can get by with turning comma
10125 # into space.
10126 case $reload_cmds in
10127 *\$LD[\ \$]*) wl= ;;
10128 esac
10129 if test -n "$convenience"; then
10130 if test -n "$whole_archive_flag_spec"; then
10131 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10132 test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10133 reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
10134 else
10135 gentop=$output_objdir/${obj}x
10136 func_append generated " $gentop"
10137
10138 func_extract_archives $gentop $convenience
10139 reload_conv_objs="$reload_objs $func_extract_archives_result"
10140 fi
10141 fi
10142
10143 # If we're not building shared, we need to use non_pic_objs
10144 test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
10145
10146 # Create the old-style object.
10147 reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
10148
10149 output=$obj
10150 func_execute_cmds "$reload_cmds" 'exit $?'
10151
10152 # Exit if we aren't doing a library object file.
10153 if test -z "$libobj"; then
10154 if test -n "$gentop"; then
10155 func_show_eval '${RM}r "$gentop"'
10156 fi
10157
10158 exit $EXIT_SUCCESS
10159 fi
10160
10161 test yes = "$build_libtool_libs" || {
10162 if test -n "$gentop"; then
10163 func_show_eval '${RM}r "$gentop"'
10164 fi
10165
10166 # Create an invalid libtool object if no PIC, so that we don't
10167 # accidentally link it into a program.
10168 # $show "echo timestamp > $libobj"
10169 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
10170 exit $EXIT_SUCCESS
10171 }
10172
10173 if test -n "$pic_flag" || test default != "$pic_mode"; then
10174 # Only do commands if we really have different PIC objects.
10175 reload_objs="$libobjs $reload_conv_objs"
10176 output=$libobj
10177 func_execute_cmds "$reload_cmds" 'exit $?'
10178 fi
10179
10180 if test -n "$gentop"; then
10181 func_show_eval '${RM}r "$gentop"'
10182 fi
10183
10184 exit $EXIT_SUCCESS
10185 ;;
10186
10187 prog)
10188 case $host in
10189 *cygwin*) func_stripname '' '.exe' "$output"
10190 output=$func_stripname_result.exe;;
10191 esac
10192 test -n "$vinfo" && \
10193 func_warning "'-version-info' is ignored for programs"
10194
10195 test -n "$release" && \
10196 func_warning "'-release' is ignored for programs"
10197
10198 $preload \
10199 && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
10200 && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
10201
10202 case $host in
10203 *-*-rhapsody* | *-*-darwin1.[012])
10204 # On Rhapsody replace the C library is the System framework
10205 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
10206 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
10207 ;;
10208 esac
10209
10210 case $host in
10211 *-*-darwin*)
10212 # Don't allow lazy linking, it breaks C++ global constructors
10213 # But is supposedly fixed on 10.4 or later (yay!).
10214 if test CXX = "$tagname"; then
10215 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10216 10.[0123])
10217 func_append compile_command " $wl-bind_at_load"
10218 func_append finalize_command " $wl-bind_at_load"
10219 ;;
10220 esac
10221 fi
10222 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
10223 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10224 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
10225 ;;
10226 esac
10227
10228
10229 # move library search paths that coincide with paths to not yet
10230 # installed libraries to the beginning of the library search list
10231 new_libs=
10232 for path in $notinst_path; do
10233 case " $new_libs " in
10234 *" -L$path/$objdir "*) ;;
10235 *)
10236 case " $compile_deplibs " in
10237 *" -L$path/$objdir "*)
10238 func_append new_libs " -L$path/$objdir" ;;
10239 esac
10240 ;;
10241 esac
10242 done
10243 for deplib in $compile_deplibs; do
10244 case $deplib in
10245 -L*)
10246 case " $new_libs " in
10247 *" $deplib "*) ;;
10248 *) func_append new_libs " $deplib" ;;
10249 esac
10250 ;;
10251 *) func_append new_libs " $deplib" ;;
10252 esac
10253 done
10254 compile_deplibs=$new_libs
10255
10256
10257 func_append compile_command " $compile_deplibs"
10258 func_append finalize_command " $finalize_deplibs"
10259
10260 if test -n "$rpath$xrpath"; then
10261 # If the user specified any rpath flags, then add them.
10262 for libdir in $rpath $xrpath; do
10263 # This is the magic to use -rpath.
10264 case "$finalize_rpath " in
10265 *" $libdir "*) ;;
10266 *) func_append finalize_rpath " $libdir" ;;
10267 esac
10268 done
10269 fi
10270
10271 # Now hardcode the library paths
10272 rpath=
10273 hardcode_libdirs=
10274 for libdir in $compile_rpath $finalize_rpath; do
10275 if test -n "$hardcode_libdir_flag_spec"; then
10276 if test -n "$hardcode_libdir_separator"; then
10277 if test -z "$hardcode_libdirs"; then
10278 hardcode_libdirs=$libdir
10279 else
10280 # Just accumulate the unique libdirs.
10281 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10282 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10283 ;;
10284 *)
10285 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10286 ;;
10287 esac
10288 fi
10289 else
10290 eval flag=\"$hardcode_libdir_flag_spec\"
10291 func_append rpath " $flag"
10292 fi
10293 elif test -n "$runpath_var"; then
10294 case "$perm_rpath " in
10295 *" $libdir "*) ;;
10296 *) func_append perm_rpath " $libdir" ;;
10297 esac
10298 fi
10299 case $host in
10300 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10301 testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
10302 case :$dllsearchpath: in
10303 *":$libdir:"*) ;;
10304 ::) dllsearchpath=$libdir;;
10305 *) func_append dllsearchpath ":$libdir";;
10306 esac
10307 case :$dllsearchpath: in
10308 *":$testbindir:"*) ;;
10309 ::) dllsearchpath=$testbindir;;
10310 *) func_append dllsearchpath ":$testbindir";;
10311 esac
10312 ;;
10313 esac
10314 done
10315 # Substitute the hardcoded libdirs into the rpath.
10316 if test -n "$hardcode_libdir_separator" &&
10317 test -n "$hardcode_libdirs"; then
10318 libdir=$hardcode_libdirs
10319 eval rpath=\" $hardcode_libdir_flag_spec\"
10320 fi
10321 compile_rpath=$rpath
10322
10323 rpath=
10324 hardcode_libdirs=
10325 for libdir in $finalize_rpath; do
10326 if test -n "$hardcode_libdir_flag_spec"; then
10327 if test -n "$hardcode_libdir_separator"; then
10328 if test -z "$hardcode_libdirs"; then
10329 hardcode_libdirs=$libdir
10330 else
10331 # Just accumulate the unique libdirs.
10332 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10333 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10334 ;;
10335 *)
10336 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
10337 ;;
10338 esac
10339 fi
10340 else
10341 eval flag=\"$hardcode_libdir_flag_spec\"
10342 func_append rpath " $flag"
10343 fi
10344 elif test -n "$runpath_var"; then
10345 case "$finalize_perm_rpath " in
10346 *" $libdir "*) ;;
10347 *) func_append finalize_perm_rpath " $libdir" ;;
10348 esac
10349 fi
10350 done
10351 # Substitute the hardcoded libdirs into the rpath.
10352 if test -n "$hardcode_libdir_separator" &&
10353 test -n "$hardcode_libdirs"; then
10354 libdir=$hardcode_libdirs
10355 eval rpath=\" $hardcode_libdir_flag_spec\"
10356 fi
10357 finalize_rpath=$rpath
10358
10359 if test -n "$libobjs" && test yes = "$build_old_libs"; then
10360 # Transform all the library objects into standard objects.
10361 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10362 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10363 fi
10364
10365 func_generate_dlsyms "$outputname" "@PROGRAM@" false
10366
10367 # template prelinking step
10368 if test -n "$prelink_cmds"; then
10369 func_execute_cmds "$prelink_cmds" 'exit $?'
10370 fi
10371
10372 wrappers_required=:
10373 case $host in
10374 *cegcc* | *mingw32ce*)
10375 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
10376 wrappers_required=false
10377 ;;
10378 *cygwin* | *mingw* )
10379 test yes = "$build_libtool_libs" || wrappers_required=false
10380 ;;
10381 *)
10382 if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
10383 wrappers_required=false
10384 fi
10385 ;;
10386 esac
10387 $wrappers_required || {
10388 # Replace the output file specification.
10389 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10390 link_command=$compile_command$compile_rpath
10391
10392 # We have no uninstalled library dependencies, so finalize right now.
10393 exit_status=0
10394 func_show_eval "$link_command" 'exit_status=$?'
10395
10396 if test -n "$postlink_cmds"; then
10397 func_to_tool_file "$output"
10398 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10399 func_execute_cmds "$postlink_cmds" 'exit $?'
10400 fi
10401
10402 # Delete the generated files.
10403 if test -f "$output_objdir/${outputname}S.$objext"; then
10404 func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
10405 fi
10406
10407 exit $exit_status
10408 }
10409
10410 if test -n "$compile_shlibpath$finalize_shlibpath"; then
10411 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
10412 fi
10413 if test -n "$finalize_shlibpath"; then
10414 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
10415 fi
10416
10417 compile_var=
10418 finalize_var=
10419 if test -n "$runpath_var"; then
10420 if test -n "$perm_rpath"; then
10421 # We should set the runpath_var.
10422 rpath=
10423 for dir in $perm_rpath; do
10424 func_append rpath "$dir:"
10425 done
10426 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
10427 fi
10428 if test -n "$finalize_perm_rpath"; then
10429 # We should set the runpath_var.
10430 rpath=
10431 for dir in $finalize_perm_rpath; do
10432 func_append rpath "$dir:"
10433 done
10434 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
10435 fi
10436 fi
10437
10438 if test yes = "$no_install"; then
10439 # We don't need to create a wrapper script.
10440 link_command=$compile_var$compile_command$compile_rpath
10441 # Replace the output file specification.
10442 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10443 # Delete the old output file.
10444 $opt_dry_run || $RM $output
10445 # Link the executable and exit
10446 func_show_eval "$link_command" 'exit $?'
10447
10448 if test -n "$postlink_cmds"; then
10449 func_to_tool_file "$output"
10450 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10451 func_execute_cmds "$postlink_cmds" 'exit $?'
10452 fi
10453
10454 exit $EXIT_SUCCESS
10455 fi
10456
10457 case $hardcode_action,$fast_install in
10458 relink,*)
10459 # Fast installation is not supported
10460 link_command=$compile_var$compile_command$compile_rpath
10461 relink_command=$finalize_var$finalize_command$finalize_rpath
10462
10463 func_warning "this platform does not like uninstalled shared libraries"
10464 func_warning "'$output' will be relinked during installation"
10465 ;;
10466 *,yes)
10467 link_command=$finalize_var$compile_command$finalize_rpath
10468 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
10469 ;;
10470 *,no)
10471 link_command=$compile_var$compile_command$compile_rpath
10472 relink_command=$finalize_var$finalize_command$finalize_rpath
10473 ;;
10474 *,needless)
10475 link_command=$finalize_var$compile_command$finalize_rpath
10476 relink_command=
10477 ;;
10478 esac
10479
10480 # Replace the output file specification.
10481 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
10482
10483 # Delete the old output files.
10484 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
10485
10486 func_show_eval "$link_command" 'exit $?'
10487
10488 if test -n "$postlink_cmds"; then
10489 func_to_tool_file "$output_objdir/$outputname"
10490 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
10491 func_execute_cmds "$postlink_cmds" 'exit $?'
10492 fi
10493
10494 # Now create the wrapper script.
10495 func_verbose "creating $output"
10496
10497 # Quote the relink command for shipping.
10498 if test -n "$relink_command"; then
10499 # Preserve any variables that may affect compiler behavior
10500 for var in $variables_saved_for_relink; do
10501 if eval test -z \"\${$var+set}\"; then
10502 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
10503 elif eval var_value=\$$var; test -z "$var_value"; then
10504 relink_command="$var=; export $var; $relink_command"
10505 else
10506 func_quote_for_eval "$var_value"
10507 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
10508 fi
10509 done
10510 relink_command="(cd `pwd`; $relink_command)"
10511 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
10512 fi
10513
10514 # Only actually do things if not in dry run mode.
10515 $opt_dry_run || {
10516 # win32 will think the script is a binary if it has
10517 # a .exe suffix, so we strip it off here.
10518 case $output in
10519 *.exe) func_stripname '' '.exe' "$output"
10520 output=$func_stripname_result ;;
10521 esac
10522 # test for cygwin because mv fails w/o .exe extensions
10523 case $host in
10524 *cygwin*)
10525 exeext=.exe
10526 func_stripname '' '.exe' "$outputname"
10527 outputname=$func_stripname_result ;;
10528 *) exeext= ;;
10529 esac
10530 case $host in
10531 *cygwin* | *mingw* )
10532 func_dirname_and_basename "$output" "" "."
10533 output_name=$func_basename_result
10534 output_path=$func_dirname_result
10535 cwrappersource=$output_path/$objdir/lt-$output_name.c
10536 cwrapper=$output_path/$output_name.exe
10537 $RM $cwrappersource $cwrapper
10538 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
10539
10540 func_emit_cwrapperexe_src > $cwrappersource
10541
10542 # The wrapper executable is built using the $host compiler,
10543 # because it contains $host paths and files. If cross-
10544 # compiling, it, like the target executable, must be
10545 # executed on the $host or under an emulation environment.
10546 $opt_dry_run || {
10547 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
10548 $STRIP $cwrapper
10549 }
10550
10551 # Now, create the wrapper script for func_source use:
10552 func_ltwrapper_scriptname $cwrapper
10553 $RM $func_ltwrapper_scriptname_result
10554 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
10555 $opt_dry_run || {
10556 # note: this script will not be executed, so do not chmod.
10557 if test "x$build" = "x$host"; then
10558 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
10559 else
10560 func_emit_wrapper no > $func_ltwrapper_scriptname_result
10561 fi
10562 }
10563 ;;
10564 * )
10565 $RM $output
10566 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
10567
10568 func_emit_wrapper no > $output
10569 chmod +x $output
10570 ;;
10571 esac
10572 }
10573 exit $EXIT_SUCCESS
10574 ;;
10575 esac
10576
10577 # See if we need to build an old-fashioned archive.
10578 for oldlib in $oldlibs; do
10579
10580 case $build_libtool_libs in
10581 convenience)
10582 oldobjs="$libobjs_save $symfileobj"
10583 addlibs=$convenience
10584 build_libtool_libs=no
10585 ;;
10586 module)
10587 oldobjs=$libobjs_save
10588 addlibs=$old_convenience
10589 build_libtool_libs=no
10590 ;;
10591 *)
10592 oldobjs="$old_deplibs $non_pic_objects"
10593 $preload && test -f "$symfileobj" \
10594 && func_append oldobjs " $symfileobj"
10595 addlibs=$old_convenience
10596 ;;
10597 esac
10598
10599 if test -n "$addlibs"; then
10600 gentop=$output_objdir/${outputname}x
10601 func_append generated " $gentop"
10602
10603 func_extract_archives $gentop $addlibs
10604 func_append oldobjs " $func_extract_archives_result"
10605 fi
10606
10607 # Do each command in the archive commands.
10608 if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
10609 cmds=$old_archive_from_new_cmds
10610 else
10611
10612 # Add any objects from preloaded convenience libraries
10613 if test -n "$dlprefiles"; then
10614 gentop=$output_objdir/${outputname}x
10615 func_append generated " $gentop"
10616
10617 func_extract_archives $gentop $dlprefiles
10618 func_append oldobjs " $func_extract_archives_result"
10619 fi
10620
10621 # POSIX demands no paths to be encoded in archives. We have
10622 # to avoid creating archives with duplicate basenames if we
10623 # might have to extract them afterwards, e.g., when creating a
10624 # static archive out of a convenience library, or when linking
10625 # the entirety of a libtool archive into another (currently
10626 # not supported by libtool).
10627 if (for obj in $oldobjs
10628 do
10629 func_basename "$obj"
10630 $ECHO "$func_basename_result"
10631 done | sort | sort -uc >/dev/null 2>&1); then
10632 :
10633 else
10634 echo "copying selected object files to avoid basename conflicts..."
10635 gentop=$output_objdir/${outputname}x
10636 func_append generated " $gentop"
10637 func_mkdir_p "$gentop"
10638 save_oldobjs=$oldobjs
10639 oldobjs=
10640 counter=1
10641 for obj in $save_oldobjs
10642 do
10643 func_basename "$obj"
10644 objbase=$func_basename_result
10645 case " $oldobjs " in
10646 " ") oldobjs=$obj ;;
10647 *[\ /]"$objbase "*)
10648 while :; do
10649 # Make sure we don't pick an alternate name that also
10650 # overlaps.
10651 newobj=lt$counter-$objbase
10652 func_arith $counter + 1
10653 counter=$func_arith_result
10654 case " $oldobjs " in
10655 *[\ /]"$newobj "*) ;;
10656 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
10657 esac
10658 done
10659 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
10660 func_append oldobjs " $gentop/$newobj"
10661 ;;
10662 *) func_append oldobjs " $obj" ;;
10663 esac
10664 done
10665 fi
10666 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
10667 tool_oldlib=$func_to_tool_file_result
10668 eval cmds=\"$old_archive_cmds\"
10669
10670 func_len " $cmds"
10671 len=$func_len_result
10672 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
10673 cmds=$old_archive_cmds
10674 elif test -n "$archiver_list_spec"; then
10675 func_verbose "using command file archive linking..."
10676 for obj in $oldobjs
10677 do
10678 func_to_tool_file "$obj"
10679 $ECHO "$func_to_tool_file_result"
10680 done > $output_objdir/$libname.libcmd
10681 func_to_tool_file "$output_objdir/$libname.libcmd"
10682 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
10683 cmds=$old_archive_cmds
10684 else
10685 # the command line is too long to link in one step, link in parts
10686 func_verbose "using piecewise archive linking..."
10687 save_RANLIB=$RANLIB
10688 RANLIB=:
10689 objlist=
10690 concat_cmds=
10691 save_oldobjs=$oldobjs
10692 oldobjs=
10693 # Is there a better way of finding the last object in the list?
10694 for obj in $save_oldobjs
10695 do
10696 last_oldobj=$obj
10697 done
10698 eval test_cmds=\"$old_archive_cmds\"
10699 func_len " $test_cmds"
10700 len0=$func_len_result
10701 len=$len0
10702 for obj in $save_oldobjs
10703 do
10704 func_len " $obj"
10705 func_arith $len + $func_len_result
10706 len=$func_arith_result
10707 func_append objlist " $obj"
10708 if test "$len" -lt "$max_cmd_len"; then
10709 :
10710 else
10711 # the above command should be used before it gets too long
10712 oldobjs=$objlist
10713 if test "$obj" = "$last_oldobj"; then
10714 RANLIB=$save_RANLIB
10715 fi
10716 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10717 eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
10718 objlist=
10719 len=$len0
10720 fi
10721 done
10722 RANLIB=$save_RANLIB
10723 oldobjs=$objlist
10724 if test -z "$oldobjs"; then
10725 eval cmds=\"\$concat_cmds\"
10726 else
10727 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
10728 fi
10729 fi
10730 fi
10731 func_execute_cmds "$cmds" 'exit $?'
10732 done
10733
10734 test -n "$generated" && \
10735 func_show_eval "${RM}r$generated"
10736
10737 # Now create the libtool archive.
10738 case $output in
10739 *.la)
10740 old_library=
10741 test yes = "$build_old_libs" && old_library=$libname.$libext
10742 func_verbose "creating $output"
10743
10744 # Preserve any variables that may affect compiler behavior
10745 for var in $variables_saved_for_relink; do
10746 if eval test -z \"\${$var+set}\"; then
10747 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
10748 elif eval var_value=\$$var; test -z "$var_value"; then
10749 relink_command="$var=; export $var; $relink_command"
10750 else
10751 func_quote_for_eval "$var_value"
10752 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
10753 fi
10754 done
10755 # Quote the link command for shipping.
10756 relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
10757 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
10758 if test yes = "$hardcode_automatic"; then
10759 relink_command=
10760 fi
10761
10762 # Only create the output if not a dry run.
10763 $opt_dry_run || {
10764 for installed in no yes; do
10765 if test yes = "$installed"; then
10766 if test -z "$install_libdir"; then
10767 break
10768 fi
10769 output=$output_objdir/${outputname}i
10770 # Replace all uninstalled libtool libraries with the installed ones
10771 newdependency_libs=
10772 for deplib in $dependency_libs; do
10773 case $deplib in
10774 *.la)
10775 func_basename "$deplib"
10776 name=$func_basename_result
10777 func_resolve_sysroot "$deplib"
10778 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
10779 test -z "$libdir" && \
10780 func_fatal_error "'$deplib' is not a valid libtool archive"
10781 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
10782 ;;
10783 -L*)
10784 func_stripname -L '' "$deplib"
10785 func_replace_sysroot "$func_stripname_result"
10786 func_append newdependency_libs " -L$func_replace_sysroot_result"
10787 ;;
10788 -R*)
10789 func_stripname -R '' "$deplib"
10790 func_replace_sysroot "$func_stripname_result"
10791 func_append newdependency_libs " -R$func_replace_sysroot_result"
10792 ;;
10793 *) func_append newdependency_libs " $deplib" ;;
10794 esac
10795 done
10796 dependency_libs=$newdependency_libs
10797 newdlfiles=
10798
10799 for lib in $dlfiles; do
10800 case $lib in
10801 *.la)
10802 func_basename "$lib"
10803 name=$func_basename_result
10804 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
10805 test -z "$libdir" && \
10806 func_fatal_error "'$lib' is not a valid libtool archive"
10807 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
10808 ;;
10809 *) func_append newdlfiles " $lib" ;;
10810 esac
10811 done
10812 dlfiles=$newdlfiles
10813 newdlprefiles=
10814 for lib in $dlprefiles; do
10815 case $lib in
10816 *.la)
10817 # Only pass preopened files to the pseudo-archive (for
10818 # eventual linking with the app. that links it) if we
10819 # didn't already link the preopened objects directly into
10820 # the library:
10821 func_basename "$lib"
10822 name=$func_basename_result
10823 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
10824 test -z "$libdir" && \
10825 func_fatal_error "'$lib' is not a valid libtool archive"
10826 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
10827 ;;
10828 esac
10829 done
10830 dlprefiles=$newdlprefiles
10831 else
10832 newdlfiles=
10833 for lib in $dlfiles; do
10834 case $lib in
10835 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
10836 *) abs=`pwd`"/$lib" ;;
10837 esac
10838 func_append newdlfiles " $abs"
10839 done
10840 dlfiles=$newdlfiles
10841 newdlprefiles=
10842 for lib in $dlprefiles; do
10843 case $lib in
10844 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
10845 *) abs=`pwd`"/$lib" ;;
10846 esac
10847 func_append newdlprefiles " $abs"
10848 done
10849 dlprefiles=$newdlprefiles
10850 fi
10851 $RM $output
10852 # place dlname in correct position for cygwin
10853 # In fact, it would be nice if we could use this code for all target
10854 # systems that can't hard-code library paths into their executables
10855 # and that have no shared library path variable independent of PATH,
10856 # but it turns out we can't easily determine that from inspecting
10857 # libtool variables, so we have to hard-code the OSs to which it
10858 # applies here; at the moment, that means platforms that use the PE
10859 # object format with DLL files. See the long comment at the top of
10860 # tests/bindir.at for full details.
10861 tdlname=$dlname
10862 case $host,$output,$installed,$module,$dlname in
10863 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
10864 # If a -bindir argument was supplied, place the dll there.
10865 if test -n "$bindir"; then
10866 func_relative_path "$install_libdir" "$bindir"
10867 tdlname=$func_relative_path_result/$dlname
10868 else
10869 # Otherwise fall back on heuristic.
10870 tdlname=../bin/$dlname
10871 fi
10872 ;;
10873 esac
10874 $ECHO > $output "\
10875 # $outputname - a libtool library file
10876 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
10877 #
10878 # Please DO NOT delete this file!
10879 # It is necessary for linking the library.
10880
10881 # The name that we can dlopen(3).
10882 dlname='$tdlname'
10883
10884 # Names of this library.
10885 library_names='$library_names'
10886
10887 # The name of the static archive.
10888 old_library='$old_library'
10889
10890 # Linker flags that cannot go in dependency_libs.
10891 inherited_linker_flags='$new_inherited_linker_flags'
10892
10893 # Libraries that this one depends upon.
10894 dependency_libs='$dependency_libs'
10895
10896 # Names of additional weak libraries provided by this library
10897 weak_library_names='$weak_libs'
10898
10899 # Version information for $libname.
10900 current=$current
10901 age=$age
10902 revision=$revision
10903
10904 # Is this an already installed library?
10905 installed=$installed
10906
10907 # Should we warn about portability when linking against -modules?
10908 shouldnotlink=$module
10909
10910 # Files to dlopen/dlpreopen
10911 dlopen='$dlfiles'
10912 dlpreopen='$dlprefiles'
10913
10914 # Directory that this library needs to be installed in:
10915 libdir='$install_libdir'"
10916 if test no,yes = "$installed,$need_relink"; then
10917 $ECHO >> $output "\
10918 relink_command=\"$relink_command\""
10919 fi
10920 done
10921 }
10922
10923 # Do a symbolic link so that the libtool archive can be found in
10924 # LD_LIBRARY_PATH before the program is installed.
10925 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
10926 ;;
10927 esac
10928 exit $EXIT_SUCCESS
10929 }
10930
10931 if test link = "$opt_mode" || test relink = "$opt_mode"; then
10932 func_mode_link ${1+"$@"}
10933 fi
10934
10935
10936 # func_mode_uninstall arg...
10937 func_mode_uninstall ()
10938 {
10939 $debug_cmd
10940
10941 RM=$nonopt
10942 files=
10943 rmforce=false
10944 exit_status=0
10945
10946 # This variable tells wrapper scripts just to set variables rather
10947 # than running their programs.
10948 libtool_install_magic=$magic
10949
10950 for arg
10951 do
10952 case $arg in
10953 -f) func_append RM " $arg"; rmforce=: ;;
10954 -*) func_append RM " $arg" ;;
10955 *) func_append files " $arg" ;;
10956 esac
10957 done
10958
10959 test -z "$RM" && \
10960 func_fatal_help "you must specify an RM program"
10961
10962 rmdirs=
10963
10964 for file in $files; do
10965 func_dirname "$file" "" "."
10966 dir=$func_dirname_result
10967 if test . = "$dir"; then
10968 odir=$objdir
10969 else
10970 odir=$dir/$objdir
10971 fi
10972 func_basename "$file"
10973 name=$func_basename_result
10974 test uninstall = "$opt_mode" && odir=$dir
10975
10976 # Remember odir for removal later, being careful to avoid duplicates
10977 if test clean = "$opt_mode"; then
10978 case " $rmdirs " in
10979 *" $odir "*) ;;
10980 *) func_append rmdirs " $odir" ;;
10981 esac
10982 fi
10983
10984 # Don't error if the file doesn't exist and rm -f was used.
10985 if { test -L "$file"; } >/dev/null 2>&1 ||
10986 { test -h "$file"; } >/dev/null 2>&1 ||
10987 test -f "$file"; then
10988 :
10989 elif test -d "$file"; then
10990 exit_status=1
10991 continue
10992 elif $rmforce; then
10993 continue
10994 fi
10995
10996 rmfiles=$file
10997
10998 case $name in
10999 *.la)
11000 # Possibly a libtool archive, so verify it.
11001 if func_lalib_p "$file"; then
11002 func_source $dir/$name
11003
11004 # Delete the libtool libraries and symlinks.
11005 for n in $library_names; do
11006 func_append rmfiles " $odir/$n"
11007 done
11008 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
11009
11010 case $opt_mode in
11011 clean)
11012 case " $library_names " in
11013 *" $dlname "*) ;;
11014 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
11015 esac
11016 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
11017 ;;
11018 uninstall)
11019 if test -n "$library_names"; then
11020 # Do each command in the postuninstall commands.
11021 func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
11022 fi
11023
11024 if test -n "$old_library"; then
11025 # Do each command in the old_postuninstall commands.
11026 func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
11027 fi
11028 # FIXME: should reinstall the best remaining shared library.
11029 ;;
11030 esac
11031 fi
11032 ;;
11033
11034 *.lo)
11035 # Possibly a libtool object, so verify it.
11036 if func_lalib_p "$file"; then
11037
11038 # Read the .lo file
11039 func_source $dir/$name
11040
11041 # Add PIC object to the list of files to remove.
11042 if test -n "$pic_object" && test none != "$pic_object"; then
11043 func_append rmfiles " $dir/$pic_object"
11044 fi
11045
11046 # Add non-PIC object to the list of files to remove.
11047 if test -n "$non_pic_object" && test none != "$non_pic_object"; then
11048 func_append rmfiles " $dir/$non_pic_object"
11049 fi
11050 fi
11051 ;;
11052
11053 *)
11054 if test clean = "$opt_mode"; then
11055 noexename=$name
11056 case $file in
11057 *.exe)
11058 func_stripname '' '.exe' "$file"
11059 file=$func_stripname_result
11060 func_stripname '' '.exe' "$name"
11061 noexename=$func_stripname_result
11062 # $file with .exe has already been added to rmfiles,
11063 # add $file without .exe
11064 func_append rmfiles " $file"
11065 ;;
11066 esac
11067 # Do a test to see if this is a libtool program.
11068 if func_ltwrapper_p "$file"; then
11069 if func_ltwrapper_executable_p "$file"; then
11070 func_ltwrapper_scriptname "$file"
11071 relink_command=
11072 func_source $func_ltwrapper_scriptname_result
11073 func_append rmfiles " $func_ltwrapper_scriptname_result"
11074 else
11075 relink_command=
11076 func_source $dir/$noexename
11077 fi
11078
11079 # note $name still contains .exe if it was in $file originally
11080 # as does the version of $file that was added into $rmfiles
11081 func_append rmfiles " $odir/$name $odir/${name}S.$objext"
11082 if test yes = "$fast_install" && test -n "$relink_command"; then
11083 func_append rmfiles " $odir/lt-$name"
11084 fi
11085 if test "X$noexename" != "X$name"; then
11086 func_append rmfiles " $odir/lt-$noexename.c"
11087 fi
11088 fi
11089 fi
11090 ;;
11091 esac
11092 func_show_eval "$RM $rmfiles" 'exit_status=1'
11093 done
11094
11095 # Try to remove the $objdir's in the directories where we deleted files
11096 for dir in $rmdirs; do
11097 if test -d "$dir"; then
11098 func_show_eval "rmdir $dir >/dev/null 2>&1"
11099 fi
11100 done
11101
11102 exit $exit_status
11103 }
11104
11105 if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
11106 func_mode_uninstall ${1+"$@"}
11107 fi
11108
11109 test -z "$opt_mode" && {
11110 help=$generic_help
11111 func_fatal_help "you must specify a MODE"
11112 }
11113
11114 test -z "$exec_cmd" && \
11115 func_fatal_help "invalid operation mode '$opt_mode'"
11116
11117 if test -n "$exec_cmd"; then
11118 eval exec "$exec_cmd"
11119 exit $EXIT_FAILURE
11120 fi
11121
11122 exit $exit_status
11123
11124
11125 # The TAGs below are defined such that we never get into a situation
11126 # where we disable both kinds of libraries. Given conflicting
11127 # choices, we go for a static library, that is the most portable,
11128 # since we can't tell whether shared libraries were disabled because
11129 # the user asked for that or because the platform doesn't support
11130 # them. This is particularly important on AIX, because we don't
11131 # support having both static and shared libraries enabled at the same
11132 # time on that platform, so we default to a shared-only configuration.
11133 # If a disable-shared tag is given, we'll fallback to a static-only
11134 # configuration. But we'll never go from static-only to shared-only.
11135
11136 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
11137 build_libtool_libs=no
11138 build_old_libs=yes
11139 # ### END LIBTOOL TAG CONFIG: disable-shared
11140
11141 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
11142 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
11143 # ### END LIBTOOL TAG CONFIG: disable-static
11144
11145 # Local Variables:
11146 # mode:shell-script
11147 # sh-indentation:2
11148 # End:
0 #! /bin/sh
1 # Common wrapper for a few potentially missing GNU programs.
2
3 scriptversion=2013-10-28.13; # UTC
4
5 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
6 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26 if test $# -eq 0; then
27 echo 1>&2 "Try '$0 --help' for more information"
28 exit 1
29 fi
30
31 case $1 in
32
33 --is-lightweight)
34 # Used by our autoconf macros to check whether the available missing
35 # script is modern enough.
36 exit 0
37 ;;
38
39 --run)
40 # Back-compat with the calling convention used by older automake.
41 shift
42 ;;
43
44 -h|--h|--he|--hel|--help)
45 echo "\
46 $0 [OPTION]... PROGRAM [ARGUMENT]...
47
48 Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
49 to PROGRAM being missing or too old.
50
51 Options:
52 -h, --help display this help and exit
53 -v, --version output version information and exit
54
55 Supported PROGRAM values:
56 aclocal autoconf autoheader autom4te automake makeinfo
57 bison yacc flex lex help2man
58
59 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
60 'g' are ignored when checking the name.
61
62 Send bug reports to <bug-automake@gnu.org>."
63 exit $?
64 ;;
65
66 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
67 echo "missing $scriptversion (GNU Automake)"
68 exit $?
69 ;;
70
71 -*)
72 echo 1>&2 "$0: unknown '$1' option"
73 echo 1>&2 "Try '$0 --help' for more information"
74 exit 1
75 ;;
76
77 esac
78
79 # Run the given program, remember its exit status.
80 "$@"; st=$?
81
82 # If it succeeded, we are done.
83 test $st -eq 0 && exit 0
84
85 # Also exit now if we it failed (or wasn't found), and '--version' was
86 # passed; such an option is passed most likely to detect whether the
87 # program is present and works.
88 case $2 in --version|--help) exit $st;; esac
89
90 # Exit code 63 means version mismatch. This often happens when the user
91 # tries to use an ancient version of a tool on a file that requires a
92 # minimum version.
93 if test $st -eq 63; then
94 msg="probably too old"
95 elif test $st -eq 127; then
96 # Program was missing.
97 msg="missing on your system"
98 else
99 # Program was found and executed, but failed. Give up.
100 exit $st
101 fi
102
103 perl_URL=http://www.perl.org/
104 flex_URL=http://flex.sourceforge.net/
105 gnu_software_URL=http://www.gnu.org/software
106
107 program_details ()
108 {
109 case $1 in
110 aclocal|automake)
111 echo "The '$1' program is part of the GNU Automake package:"
112 echo "<$gnu_software_URL/automake>"
113 echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
114 echo "<$gnu_software_URL/autoconf>"
115 echo "<$gnu_software_URL/m4/>"
116 echo "<$perl_URL>"
117 ;;
118 autoconf|autom4te|autoheader)
119 echo "The '$1' program is part of the GNU Autoconf package:"
120 echo "<$gnu_software_URL/autoconf/>"
121 echo "It also requires GNU m4 and Perl in order to run:"
122 echo "<$gnu_software_URL/m4/>"
123 echo "<$perl_URL>"
124 ;;
125 esac
126 }
127
128 give_advice ()
129 {
130 # Normalize program name to check for.
131 normalized_program=`echo "$1" | sed '
132 s/^gnu-//; t
133 s/^gnu//; t
134 s/^g//; t'`
135
136 printf '%s\n' "'$1' is $msg."
137
138 configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
139 case $normalized_program in
140 autoconf*)
141 echo "You should only need it if you modified 'configure.ac',"
142 echo "or m4 files included by it."
143 program_details 'autoconf'
144 ;;
145 autoheader*)
146 echo "You should only need it if you modified 'acconfig.h' or"
147 echo "$configure_deps."
148 program_details 'autoheader'
149 ;;
150 automake*)
151 echo "You should only need it if you modified 'Makefile.am' or"
152 echo "$configure_deps."
153 program_details 'automake'
154 ;;
155 aclocal*)
156 echo "You should only need it if you modified 'acinclude.m4' or"
157 echo "$configure_deps."
158 program_details 'aclocal'
159 ;;
160 autom4te*)
161 echo "You might have modified some maintainer files that require"
162 echo "the 'autom4te' program to be rebuilt."
163 program_details 'autom4te'
164 ;;
165 bison*|yacc*)
166 echo "You should only need it if you modified a '.y' file."
167 echo "You may want to install the GNU Bison package:"
168 echo "<$gnu_software_URL/bison/>"
169 ;;
170 lex*|flex*)
171 echo "You should only need it if you modified a '.l' file."
172 echo "You may want to install the Fast Lexical Analyzer package:"
173 echo "<$flex_URL>"
174 ;;
175 help2man*)
176 echo "You should only need it if you modified a dependency" \
177 "of a man page."
178 echo "You may want to install the GNU Help2man package:"
179 echo "<$gnu_software_URL/help2man/>"
180 ;;
181 makeinfo*)
182 echo "You should only need it if you modified a '.texi' file, or"
183 echo "any other file indirectly affecting the aspect of the manual."
184 echo "You might want to install the Texinfo package:"
185 echo "<$gnu_software_URL/texinfo/>"
186 echo "The spurious makeinfo call might also be the consequence of"
187 echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
188 echo "want to install GNU make:"
189 echo "<$gnu_software_URL/make/>"
190 ;;
191 *)
192 echo "You might have modified some files without having the proper"
193 echo "tools for further handling them. Check the 'README' file, it"
194 echo "often tells you about the needed prerequisites for installing"
195 echo "this package. You may also peek at any GNU archive site, in"
196 echo "case some other package contains this missing '$1' program."
197 ;;
198 esac
199 }
200
201 give_advice "$1" | sed -e '1s/^/WARNING: /' \
202 -e '2,$s/^/ /' >&2
203
204 # Propagate the correct exit status (expected to be 127 for a program
205 # not found, 63 for a program that failed due to version mismatch).
206 exit $st
207
208 # Local variables:
209 # eval: (add-hook 'write-file-hooks 'time-stamp)
210 # time-stamp-start: "scriptversion="
211 # time-stamp-format: "%:y-%02m-%02d.%02H"
212 # time-stamp-time-zone: "UTC"
213 # time-stamp-end: "; # UTC"
214 # End:
+14597
-243
configure less more
0 #!/bin/bash
1
0 #! /bin/sh
1 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for libseccomp 2.2.3.
23 #
3 # Enhanced Seccomp Library Configure Script
44 #
5 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
6 # Author: Paul Moore <pmoore@redhat.com>
5 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
76 #
8
97 #
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.
8 # This configure script is free software; the Free Software Foundation
9 # gives unlimited permission to copy, distribute and modify it.
10 ## -------------------- ##
11 ## M4sh Initialization. ##
12 ## -------------------- ##
13
14 # Be more Bourne compatible
15 DUALCASE=1; export DUALCASE # for MKS sh
16 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
17 emulate sh
18 NULLCMD=:
19 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
20 # is contrary to our usage. Disable this feature.
21 alias -g '${1+"$@"}'='"$@"'
22 setopt NO_GLOB_SUBST
23 else
24 case `(set -o) 2>/dev/null` in #(
25 *posix*) :
26 set -o posix ;; #(
27 *) :
28 ;;
29 esac
30 fi
31
32
33 as_nl='
34 '
35 export as_nl
36 # Printing a long string crashes Solaris 7 /usr/bin/printf.
37 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
38 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
39 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
40 # Prefer a ksh shell builtin over an external printf program on Solaris,
41 # but without wasting forks for bash or zsh.
42 if test -z "$BASH_VERSION$ZSH_VERSION" \
43 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
44 as_echo='print -r --'
45 as_echo_n='print -rn --'
46 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
47 as_echo='printf %s\n'
48 as_echo_n='printf %s'
49 else
50 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
51 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
52 as_echo_n='/usr/ucb/echo -n'
53 else
54 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
55 as_echo_n_body='eval
56 arg=$1;
57 case $arg in #(
58 *"$as_nl"*)
59 expr "X$arg" : "X\\(.*\\)$as_nl";
60 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
61 esac;
62 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
63 '
64 export as_echo_n_body
65 as_echo_n='sh -c $as_echo_n_body as_echo'
66 fi
67 export as_echo_body
68 as_echo='sh -c $as_echo_body as_echo'
69 fi
70
71 # The user is always right.
72 if test "${PATH_SEPARATOR+set}" != set; then
73 PATH_SEPARATOR=:
74 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
75 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
76 PATH_SEPARATOR=';'
77 }
78 fi
79
80
81 # IFS
82 # We need space, tab and new line, in precisely that order. Quoting is
83 # there to prevent editors from complaining about space-tab.
84 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
85 # splitting by setting IFS to empty value.)
86 IFS=" "" $as_nl"
87
88 # Find who we are. Look in the path if we contain no directory separator.
89 as_myself=
90 case $0 in #((
91 *[\\/]* ) as_myself=$0 ;;
92 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
93 for as_dir in $PATH
94 do
95 IFS=$as_save_IFS
96 test -z "$as_dir" && as_dir=.
97 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
98 done
99 IFS=$as_save_IFS
100
101 ;;
102 esac
103 # We did not find ourselves, most probably we were run as `sh COMMAND'
104 # in which case we are not to be found in the path.
105 if test "x$as_myself" = x; then
106 as_myself=$0
107 fi
108 if test ! -f "$as_myself"; then
109 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
110 exit 1
111 fi
112
113 # Unset variables that we do not need and which cause bugs (e.g. in
114 # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
115 # suppresses any "Segmentation fault" message there. '((' could
116 # trigger a bug in pdksh 5.2.14.
117 for as_var in BASH_ENV ENV MAIL MAILPATH
118 do eval test x\${$as_var+set} = xset \
119 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
120 done
121 PS1='$ '
122 PS2='> '
123 PS4='+ '
124
125 # NLS nuisances.
126 LC_ALL=C
127 export LC_ALL
128 LANGUAGE=C
129 export LANGUAGE
130
131 # CDPATH.
132 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
133
134 # Use a proper internal environment variable to ensure we don't fall
135 # into an infinite loop, continuously re-executing ourselves.
136 if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
137 _as_can_reexec=no; export _as_can_reexec;
138 # We cannot yet assume a decent shell, so we have to provide a
139 # neutralization value for shells without unset; and this also
140 # works around shells that cannot unset nonexistent variables.
141 # Preserve -v and -x to the replacement shell.
142 BASH_ENV=/dev/null
143 ENV=/dev/null
144 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
145 case $- in # ((((
146 *v*x* | *x*v* ) as_opts=-vx ;;
147 *v* ) as_opts=-v ;;
148 *x* ) as_opts=-x ;;
149 * ) as_opts= ;;
150 esac
151 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
152 # Admittedly, this is quite paranoid, since all the known shells bail
153 # out after a failed `exec'.
154 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
155 as_fn_exit 255
156 fi
157 # We don't want this to propagate to other subprocesses.
158 { _as_can_reexec=; unset _as_can_reexec;}
159 if test "x$CONFIG_SHELL" = x; then
160 as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
161 emulate sh
162 NULLCMD=:
163 # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
164 # is contrary to our usage. Disable this feature.
165 alias -g '\${1+\"\$@\"}'='\"\$@\"'
166 setopt NO_GLOB_SUBST
167 else
168 case \`(set -o) 2>/dev/null\` in #(
169 *posix*) :
170 set -o posix ;; #(
171 *) :
172 ;;
173 esac
174 fi
175 "
176 as_required="as_fn_return () { (exit \$1); }
177 as_fn_success () { as_fn_return 0; }
178 as_fn_failure () { as_fn_return 1; }
179 as_fn_ret_success () { return 0; }
180 as_fn_ret_failure () { return 1; }
181
182 exitcode=0
183 as_fn_success || { exitcode=1; echo as_fn_success failed.; }
184 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
185 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
186 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
187 if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
188
189 else
190 exitcode=1; echo positional parameters were not saved.
191 fi
192 test x\$exitcode = x0 || exit 1
193 test -x / || exit 1"
194 as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
195 as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
196 eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
197 test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
198
199 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
200 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
201 ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
202 ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
203 PATH=/empty FPATH=/empty; export PATH FPATH
204 test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
205 || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
206 test \$(( 1 + 1 )) = 2 || exit 1"
207 if (eval "$as_required") 2>/dev/null; then :
208 as_have_required=yes
209 else
210 as_have_required=no
211 fi
212 if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
213
214 else
215 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
216 as_found=false
217 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
218 do
219 IFS=$as_save_IFS
220 test -z "$as_dir" && as_dir=.
221 as_found=:
222 case $as_dir in #(
223 /*)
224 for as_base in sh bash ksh sh5; do
225 # Try only shells that exist, to save several forks.
226 as_shell=$as_dir/$as_base
227 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
228 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
229 CONFIG_SHELL=$as_shell as_have_required=yes
230 if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
231 break 2
232 fi
233 fi
234 done;;
235 esac
236 as_found=false
237 done
238 $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
239 { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
240 CONFIG_SHELL=$SHELL as_have_required=yes
241 fi; }
242 IFS=$as_save_IFS
243
244
245 if test "x$CONFIG_SHELL" != x; then :
246 export CONFIG_SHELL
247 # We cannot yet assume a decent shell, so we have to provide a
248 # neutralization value for shells without unset; and this also
249 # works around shells that cannot unset nonexistent variables.
250 # Preserve -v and -x to the replacement shell.
251 BASH_ENV=/dev/null
252 ENV=/dev/null
253 (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
254 case $- in # ((((
255 *v*x* | *x*v* ) as_opts=-vx ;;
256 *v* ) as_opts=-v ;;
257 *x* ) as_opts=-x ;;
258 * ) as_opts= ;;
259 esac
260 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
261 # Admittedly, this is quite paranoid, since all the known shells bail
262 # out after a failed `exec'.
263 $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
264 exit 255
265 fi
266
267 if test x$as_have_required = xno; then :
268 $as_echo "$0: This script requires a shell more modern than all"
269 $as_echo "$0: the shells that I found on your system."
270 if test x${ZSH_VERSION+set} = xset ; then
271 $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
272 $as_echo "$0: be upgraded to zsh 4.3.4 or later."
273 else
274 $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
275 $0: including any error possibly output before this
276 $0: message. Then install a modern shell, or manually run
277 $0: the script under such a shell if you do have one."
278 fi
279 exit 1
280 fi
281 fi
282 fi
283 SHELL=${CONFIG_SHELL-/bin/sh}
284 export SHELL
285 # Unset more variables known to interfere with behavior of common tools.
286 CLICOLOR_FORCE= GREP_OPTIONS=
287 unset CLICOLOR_FORCE GREP_OPTIONS
288
289 ## --------------------- ##
290 ## M4sh Shell Functions. ##
291 ## --------------------- ##
292 # as_fn_unset VAR
293 # ---------------
294 # Portably unset VAR.
295 as_fn_unset ()
296 {
297 { eval $1=; unset $1;}
298 }
299 as_unset=as_fn_unset
300
301 # as_fn_set_status STATUS
302 # -----------------------
303 # Set $? to STATUS, without forking.
304 as_fn_set_status ()
305 {
306 return $1
307 } # as_fn_set_status
308
309 # as_fn_exit STATUS
310 # -----------------
311 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
312 as_fn_exit ()
313 {
314 set +e
315 as_fn_set_status $1
316 exit $1
317 } # as_fn_exit
318
319 # as_fn_mkdir_p
320 # -------------
321 # Create "$as_dir" as a directory, including parents if necessary.
322 as_fn_mkdir_p ()
323 {
324
325 case $as_dir in #(
326 -*) as_dir=./$as_dir;;
327 esac
328 test -d "$as_dir" || eval $as_mkdir_p || {
329 as_dirs=
330 while :; do
331 case $as_dir in #(
332 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
333 *) as_qdir=$as_dir;;
334 esac
335 as_dirs="'$as_qdir' $as_dirs"
336 as_dir=`$as_dirname -- "$as_dir" ||
337 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
338 X"$as_dir" : 'X\(//\)[^/]' \| \
339 X"$as_dir" : 'X\(//\)$' \| \
340 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
341 $as_echo X"$as_dir" |
342 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
343 s//\1/
344 q
345 }
346 /^X\(\/\/\)[^/].*/{
347 s//\1/
348 q
349 }
350 /^X\(\/\/\)$/{
351 s//\1/
352 q
353 }
354 /^X\(\/\).*/{
355 s//\1/
356 q
357 }
358 s/.*/./; q'`
359 test -d "$as_dir" && break
360 done
361 test -z "$as_dirs" || eval "mkdir $as_dirs"
362 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
363
364
365 } # as_fn_mkdir_p
366
367 # as_fn_executable_p FILE
368 # -----------------------
369 # Test if FILE is an executable regular file.
370 as_fn_executable_p ()
371 {
372 test -f "$1" && test -x "$1"
373 } # as_fn_executable_p
374 # as_fn_append VAR VALUE
375 # ----------------------
376 # Append the text in VALUE to the end of the definition contained in VAR. Take
377 # advantage of any shell optimizations that allow amortized linear growth over
378 # repeated appends, instead of the typical quadratic growth present in naive
379 # implementations.
380 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
381 eval 'as_fn_append ()
382 {
383 eval $1+=\$2
384 }'
385 else
386 as_fn_append ()
387 {
388 eval $1=\$$1\$2
389 }
390 fi # as_fn_append
391
392 # as_fn_arith ARG...
393 # ------------------
394 # Perform arithmetic evaluation on the ARGs, and store the result in the
395 # global $as_val. Take advantage of shells that can avoid forks. The arguments
396 # must be portable across $(()) and expr.
397 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
398 eval 'as_fn_arith ()
399 {
400 as_val=$(( $* ))
401 }'
402 else
403 as_fn_arith ()
404 {
405 as_val=`expr "$@" || test $? -eq 1`
406 }
407 fi # as_fn_arith
408
409
410 # as_fn_error STATUS ERROR [LINENO LOG_FD]
411 # ----------------------------------------
412 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
413 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
414 # script with STATUS, using 1 if that was 0.
415 as_fn_error ()
416 {
417 as_status=$1; test $as_status -eq 0 && as_status=1
418 if test "$4"; then
419 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
420 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
421 fi
422 $as_echo "$as_me: error: $2" >&2
423 as_fn_exit $as_status
424 } # as_fn_error
425
426 if expr a : '\(a\)' >/dev/null 2>&1 &&
427 test "X`expr 00001 : '.*\(...\)'`" = X001; then
428 as_expr=expr
429 else
430 as_expr=false
431 fi
432
433 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
434 as_basename=basename
435 else
436 as_basename=false
437 fi
438
439 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
440 as_dirname=dirname
441 else
442 as_dirname=false
443 fi
444
445 as_me=`$as_basename -- "$0" ||
446 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
447 X"$0" : 'X\(//\)$' \| \
448 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
449 $as_echo X/"$0" |
450 sed '/^.*\/\([^/][^/]*\)\/*$/{
451 s//\1/
452 q
453 }
454 /^X\/\(\/\/\)$/{
455 s//\1/
456 q
457 }
458 /^X\/\(\/\).*/{
459 s//\1/
460 q
461 }
462 s/.*/./; q'`
463
464 # Avoid depending upon Character Ranges.
465 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
466 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
467 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
468 as_cr_digits='0123456789'
469 as_cr_alnum=$as_cr_Letters$as_cr_digits
470
471
472 as_lineno_1=$LINENO as_lineno_1a=$LINENO
473 as_lineno_2=$LINENO as_lineno_2a=$LINENO
474 eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
475 test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
476 # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
477 sed -n '
478 p
479 /[$]LINENO/=
480 ' <$as_myself |
481 sed '
482 s/[$]LINENO.*/&-/
483 t lineno
484 b
485 :lineno
486 N
487 :loop
488 s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
489 t loop
490 s/-\n.*//
491 ' >$as_me.lineno &&
492 chmod +x "$as_me.lineno" ||
493 { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
494
495 # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
496 # already done that, so ensure we don't try to do so again and fall
497 # in an infinite loop. This has already happened in practice.
498 _as_can_reexec=no; export _as_can_reexec
499 # Don't try to exec as it changes $[0], causing all sort of problems
500 # (the dirname of $[0] is not the place where we might find the
501 # original and so on. Autoconf is especially sensitive to this).
502 . "./$as_me.lineno"
503 # Exit status is that of the last command.
504 exit
505 }
506
507 ECHO_C= ECHO_N= ECHO_T=
508 case `echo -n x` in #(((((
509 -n*)
510 case `echo 'xy\c'` in
511 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
512 xy) ECHO_C='\c';;
513 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
514 ECHO_T=' ';;
515 esac;;
516 *)
517 ECHO_N='-n';;
518 esac
519
520 rm -f conf$$ conf$$.exe conf$$.file
521 if test -d conf$$.dir; then
522 rm -f conf$$.dir/conf$$.file
523 else
524 rm -f conf$$.dir
525 mkdir conf$$.dir 2>/dev/null
526 fi
527 if (echo >conf$$.file) 2>/dev/null; then
528 if ln -s conf$$.file conf$$ 2>/dev/null; then
529 as_ln_s='ln -s'
530 # ... but there are two gotchas:
531 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
532 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
533 # In both cases, we have to default to `cp -pR'.
534 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
535 as_ln_s='cp -pR'
536 elif ln conf$$.file conf$$ 2>/dev/null; then
537 as_ln_s=ln
538 else
539 as_ln_s='cp -pR'
540 fi
541 else
542 as_ln_s='cp -pR'
543 fi
544 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
545 rmdir conf$$.dir 2>/dev/null
546
547 if mkdir -p . 2>/dev/null; then
548 as_mkdir_p='mkdir -p "$as_dir"'
549 else
550 test -d ./-p && rmdir ./-p
551 as_mkdir_p=false
552 fi
553
554 as_test_x='test -x'
555 as_executable_p=as_fn_executable_p
556
557 # Sed expression to map a string onto a valid CPP name.
558 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
559
560 # Sed expression to map a string onto a valid variable name.
561 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
562
563 SHELL=${CONFIG_SHELL-/bin/sh}
564
565
566 test -n "$DJDIR" || exec 7<&0 </dev/null
567 exec 6>&1
568
569 # Name of the host.
570 # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
571 # so uname gets run too.
572 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
573
13574 #
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.
575 # Initializations.
18576 #
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>.
577 ac_default_prefix=/usr/local
578 ac_clean_files=
579 ac_config_libobj_dir=.
580 LIBOBJS=
581 cross_compiling=no
582 subdirs=
583 MFLAGS=
584 MAKEFLAGS=
585
586 # Identity of this package.
587 PACKAGE_NAME='libseccomp'
588 PACKAGE_TARNAME='libseccomp'
589 PACKAGE_VERSION='2.2.3'
590 PACKAGE_STRING='libseccomp 2.2.3'
591 PACKAGE_BUGREPORT=''
592 PACKAGE_URL=''
593
594 # Factoring default headers for most tests.
595 ac_includes_default="\
596 #include <stdio.h>
597 #ifdef HAVE_SYS_TYPES_H
598 # include <sys/types.h>
599 #endif
600 #ifdef HAVE_SYS_STAT_H
601 # include <sys/stat.h>
602 #endif
603 #ifdef STDC_HEADERS
604 # include <stdlib.h>
605 # include <stddef.h>
606 #else
607 # ifdef HAVE_STDLIB_H
608 # include <stdlib.h>
609 # endif
610 #endif
611 #ifdef HAVE_STRING_H
612 # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
613 # include <memory.h>
614 # endif
615 # include <string.h>
616 #endif
617 #ifdef HAVE_STRINGS_H
618 # include <strings.h>
619 #endif
620 #ifdef HAVE_INTTYPES_H
621 # include <inttypes.h>
622 #endif
623 #ifdef HAVE_STDINT_H
624 # include <stdint.h>
625 #endif
626 #ifdef HAVE_UNISTD_H
627 # include <unistd.h>
628 #endif"
629
630 ac_header_list=
631 ac_subst_vars='am__EXEEXT_FALSE
632 am__EXEEXT_TRUE
633 LTLIBOBJS
634 LIBOBJS
635 COVERITY_FALSE
636 COVERITY_TRUE
637 have_coverity
638 ENABLE_PYTHON_FALSE
639 ENABLE_PYTHON_TRUE
640 have_cython
641 VERSION_MICRO
642 VERSION_MINOR
643 VERSION_MAJOR
644 AM_LDFLAGS
645 AM_CFLAGS
646 AM_CPPFLAGS
647 CPP
648 LT_SYS_LIBRARY_PATH
649 OTOOL64
650 OTOOL
651 LIPO
652 NMEDIT
653 DSYMUTIL
654 MANIFEST_TOOL
655 RANLIB
656 DLLTOOL
657 OBJDUMP
658 LN_S
659 NM
660 ac_ct_DUMPBIN
661 DUMPBIN
662 LD
663 FGREP
664 EGREP
665 GREP
666 SED
667 host_os
668 host_vendor
669 host_cpu
670 host
671 build_os
672 build_vendor
673 build_cpu
674 build
675 LIBTOOL
676 ac_ct_AR
677 AR
678 am__fastdepCC_FALSE
679 am__fastdepCC_TRUE
680 CCDEPMODE
681 am__nodep
682 AMDEPBACKSLASH
683 AMDEP_FALSE
684 AMDEP_TRUE
685 am__quote
686 am__include
687 DEPDIR
688 OBJEXT
689 EXEEXT
690 ac_ct_CC
691 CPPFLAGS
692 LDFLAGS
693 CFLAGS
694 CC
695 AM_BACKSLASH
696 AM_DEFAULT_VERBOSITY
697 AM_DEFAULT_V
698 AM_V
699 am__untar
700 am__tar
701 AMTAR
702 am__leading_dot
703 SET_MAKE
704 AWK
705 mkdir_p
706 MKDIR_P
707 INSTALL_STRIP_PROGRAM
708 STRIP
709 install_sh
710 MAKEINFO
711 AUTOHEADER
712 AUTOMAKE
713 AUTOCONF
714 ACLOCAL
715 VERSION
716 PACKAGE
717 CYGPATH_W
718 am__isrc
719 INSTALL_DATA
720 INSTALL_SCRIPT
721 INSTALL_PROGRAM
722 target_alias
723 host_alias
724 build_alias
725 LIBS
726 ECHO_T
727 ECHO_N
728 ECHO_C
729 DEFS
730 mandir
731 localedir
732 libdir
733 psdir
734 pdfdir
735 dvidir
736 htmldir
737 infodir
738 docdir
739 oldincludedir
740 includedir
741 localstatedir
742 sharedstatedir
743 sysconfdir
744 datadir
745 datarootdir
746 libexecdir
747 sbindir
748 bindir
749 program_transform_name
750 prefix
751 exec_prefix
752 PACKAGE_URL
753 PACKAGE_BUGREPORT
754 PACKAGE_STRING
755 PACKAGE_VERSION
756 PACKAGE_TARNAME
757 PACKAGE_NAME
758 PATH_SEPARATOR
759 SHELL'
760 ac_subst_files=''
761 ac_user_opts='
762 enable_option_checking
763 enable_silent_rules
764 enable_dependency_tracking
765 enable_shared
766 with_pic
767 enable_static
768 enable_fast_install
769 with_aix_soname
770 with_gnu_ld
771 with_sysroot
772 enable_libtool_lock
773 enable_python
774 '
775 ac_precious_vars='build_alias
776 host_alias
777 target_alias
778 CC
779 CFLAGS
780 LDFLAGS
781 LIBS
782 CPPFLAGS
783 LT_SYS_LIBRARY_PATH
784 CPP'
785
786
787 # Initialize some variables set by options.
788 ac_init_help=
789 ac_init_version=false
790 ac_unrecognized_opts=
791 ac_unrecognized_sep=
792 # The variables have the same names as the options, with
793 # dashes changed to underlines.
794 cache_file=/dev/null
795 exec_prefix=NONE
796 no_create=
797 no_recursion=
798 prefix=NONE
799 program_prefix=NONE
800 program_suffix=NONE
801 program_transform_name=s,x,x,
802 silent=
803 site=
804 srcdir=
805 verbose=
806 x_includes=NONE
807 x_libraries=NONE
808
809 # Installation directory options.
810 # These are left unexpanded so users can "make install exec_prefix=/foo"
811 # and all the variables that are supposed to be based on exec_prefix
812 # by default will actually change.
813 # Use braces instead of parens because sh, perl, etc. also accept them.
814 # (The list follows the same order as the GNU Coding Standards.)
815 bindir='${exec_prefix}/bin'
816 sbindir='${exec_prefix}/sbin'
817 libexecdir='${exec_prefix}/libexec'
818 datarootdir='${prefix}/share'
819 datadir='${datarootdir}'
820 sysconfdir='${prefix}/etc'
821 sharedstatedir='${prefix}/com'
822 localstatedir='${prefix}/var'
823 includedir='${prefix}/include'
824 oldincludedir='/usr/include'
825 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
826 infodir='${datarootdir}/info'
827 htmldir='${docdir}'
828 dvidir='${docdir}'
829 pdfdir='${docdir}'
830 psdir='${docdir}'
831 libdir='${exec_prefix}/lib'
832 localedir='${datarootdir}/locale'
833 mandir='${datarootdir}/man'
834
835 ac_prev=
836 ac_dashdash=
837 for ac_option
838 do
839 # If the previous option needs an argument, assign it.
840 if test -n "$ac_prev"; then
841 eval $ac_prev=\$ac_option
842 ac_prev=
843 continue
844 fi
845
846 case $ac_option in
847 *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
848 *=) ac_optarg= ;;
849 *) ac_optarg=yes ;;
850 esac
851
852 # Accept the important Cygnus configure options, so we can diagnose typos.
853
854 case $ac_dashdash$ac_option in
855 --)
856 ac_dashdash=yes ;;
857
858 -bindir | --bindir | --bindi | --bind | --bin | --bi)
859 ac_prev=bindir ;;
860 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
861 bindir=$ac_optarg ;;
862
863 -build | --build | --buil | --bui | --bu)
864 ac_prev=build_alias ;;
865 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
866 build_alias=$ac_optarg ;;
867
868 -cache-file | --cache-file | --cache-fil | --cache-fi \
869 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
870 ac_prev=cache_file ;;
871 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
872 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
873 cache_file=$ac_optarg ;;
874
875 --config-cache | -C)
876 cache_file=config.cache ;;
877
878 -datadir | --datadir | --datadi | --datad)
879 ac_prev=datadir ;;
880 -datadir=* | --datadir=* | --datadi=* | --datad=*)
881 datadir=$ac_optarg ;;
882
883 -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
884 | --dataroo | --dataro | --datar)
885 ac_prev=datarootdir ;;
886 -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
887 | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
888 datarootdir=$ac_optarg ;;
889
890 -disable-* | --disable-*)
891 ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
892 # Reject names that are not valid shell variable names.
893 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
894 as_fn_error $? "invalid feature name: $ac_useropt"
895 ac_useropt_orig=$ac_useropt
896 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
897 case $ac_user_opts in
898 *"
899 "enable_$ac_useropt"
900 "*) ;;
901 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
902 ac_unrecognized_sep=', ';;
903 esac
904 eval enable_$ac_useropt=no ;;
905
906 -docdir | --docdir | --docdi | --doc | --do)
907 ac_prev=docdir ;;
908 -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
909 docdir=$ac_optarg ;;
910
911 -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
912 ac_prev=dvidir ;;
913 -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
914 dvidir=$ac_optarg ;;
915
916 -enable-* | --enable-*)
917 ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
918 # Reject names that are not valid shell variable names.
919 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
920 as_fn_error $? "invalid feature name: $ac_useropt"
921 ac_useropt_orig=$ac_useropt
922 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
923 case $ac_user_opts in
924 *"
925 "enable_$ac_useropt"
926 "*) ;;
927 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
928 ac_unrecognized_sep=', ';;
929 esac
930 eval enable_$ac_useropt=\$ac_optarg ;;
931
932 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
933 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
934 | --exec | --exe | --ex)
935 ac_prev=exec_prefix ;;
936 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
937 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
938 | --exec=* | --exe=* | --ex=*)
939 exec_prefix=$ac_optarg ;;
940
941 -gas | --gas | --ga | --g)
942 # Obsolete; use --with-gas.
943 with_gas=yes ;;
944
945 -help | --help | --hel | --he | -h)
946 ac_init_help=long ;;
947 -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
948 ac_init_help=recursive ;;
949 -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
950 ac_init_help=short ;;
951
952 -host | --host | --hos | --ho)
953 ac_prev=host_alias ;;
954 -host=* | --host=* | --hos=* | --ho=*)
955 host_alias=$ac_optarg ;;
956
957 -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
958 ac_prev=htmldir ;;
959 -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
960 | --ht=*)
961 htmldir=$ac_optarg ;;
962
963 -includedir | --includedir | --includedi | --included | --include \
964 | --includ | --inclu | --incl | --inc)
965 ac_prev=includedir ;;
966 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
967 | --includ=* | --inclu=* | --incl=* | --inc=*)
968 includedir=$ac_optarg ;;
969
970 -infodir | --infodir | --infodi | --infod | --info | --inf)
971 ac_prev=infodir ;;
972 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
973 infodir=$ac_optarg ;;
974
975 -libdir | --libdir | --libdi | --libd)
976 ac_prev=libdir ;;
977 -libdir=* | --libdir=* | --libdi=* | --libd=*)
978 libdir=$ac_optarg ;;
979
980 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
981 | --libexe | --libex | --libe)
982 ac_prev=libexecdir ;;
983 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
984 | --libexe=* | --libex=* | --libe=*)
985 libexecdir=$ac_optarg ;;
986
987 -localedir | --localedir | --localedi | --localed | --locale)
988 ac_prev=localedir ;;
989 -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
990 localedir=$ac_optarg ;;
991
992 -localstatedir | --localstatedir | --localstatedi | --localstated \
993 | --localstate | --localstat | --localsta | --localst | --locals)
994 ac_prev=localstatedir ;;
995 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
996 | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
997 localstatedir=$ac_optarg ;;
998
999 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1000 ac_prev=mandir ;;
1001 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1002 mandir=$ac_optarg ;;
1003
1004 -nfp | --nfp | --nf)
1005 # Obsolete; use --without-fp.
1006 with_fp=no ;;
1007
1008 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1009 | --no-cr | --no-c | -n)
1010 no_create=yes ;;
1011
1012 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1013 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1014 no_recursion=yes ;;
1015
1016 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1017 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1018 | --oldin | --oldi | --old | --ol | --o)
1019 ac_prev=oldincludedir ;;
1020 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1021 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1022 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1023 oldincludedir=$ac_optarg ;;
1024
1025 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1026 ac_prev=prefix ;;
1027 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1028 prefix=$ac_optarg ;;
1029
1030 -program-prefix | --program-prefix | --program-prefi | --program-pref \
1031 | --program-pre | --program-pr | --program-p)
1032 ac_prev=program_prefix ;;
1033 -program-prefix=* | --program-prefix=* | --program-prefi=* \
1034 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1035 program_prefix=$ac_optarg ;;
1036
1037 -program-suffix | --program-suffix | --program-suffi | --program-suff \
1038 | --program-suf | --program-su | --program-s)
1039 ac_prev=program_suffix ;;
1040 -program-suffix=* | --program-suffix=* | --program-suffi=* \
1041 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1042 program_suffix=$ac_optarg ;;
1043
1044 -program-transform-name | --program-transform-name \
1045 | --program-transform-nam | --program-transform-na \
1046 | --program-transform-n | --program-transform- \
1047 | --program-transform | --program-transfor \
1048 | --program-transfo | --program-transf \
1049 | --program-trans | --program-tran \
1050 | --progr-tra | --program-tr | --program-t)
1051 ac_prev=program_transform_name ;;
1052 -program-transform-name=* | --program-transform-name=* \
1053 | --program-transform-nam=* | --program-transform-na=* \
1054 | --program-transform-n=* | --program-transform-=* \
1055 | --program-transform=* | --program-transfor=* \
1056 | --program-transfo=* | --program-transf=* \
1057 | --program-trans=* | --program-tran=* \
1058 | --progr-tra=* | --program-tr=* | --program-t=*)
1059 program_transform_name=$ac_optarg ;;
1060
1061 -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1062 ac_prev=pdfdir ;;
1063 -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1064 pdfdir=$ac_optarg ;;
1065
1066 -psdir | --psdir | --psdi | --psd | --ps)
1067 ac_prev=psdir ;;
1068 -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1069 psdir=$ac_optarg ;;
1070
1071 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1072 | -silent | --silent | --silen | --sile | --sil)
1073 silent=yes ;;
1074
1075 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1076 ac_prev=sbindir ;;
1077 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1078 | --sbi=* | --sb=*)
1079 sbindir=$ac_optarg ;;
1080
1081 -sharedstatedir | --sharedstatedir | --sharedstatedi \
1082 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1083 | --sharedst | --shareds | --shared | --share | --shar \
1084 | --sha | --sh)
1085 ac_prev=sharedstatedir ;;
1086 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1087 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1088 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1089 | --sha=* | --sh=*)
1090 sharedstatedir=$ac_optarg ;;
1091
1092 -site | --site | --sit)
1093 ac_prev=site ;;
1094 -site=* | --site=* | --sit=*)
1095 site=$ac_optarg ;;
1096
1097 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1098 ac_prev=srcdir ;;
1099 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1100 srcdir=$ac_optarg ;;
1101
1102 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1103 | --syscon | --sysco | --sysc | --sys | --sy)
1104 ac_prev=sysconfdir ;;
1105 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1106 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1107 sysconfdir=$ac_optarg ;;
1108
1109 -target | --target | --targe | --targ | --tar | --ta | --t)
1110 ac_prev=target_alias ;;
1111 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1112 target_alias=$ac_optarg ;;
1113
1114 -v | -verbose | --verbose | --verbos | --verbo | --verb)
1115 verbose=yes ;;
1116
1117 -version | --version | --versio | --versi | --vers | -V)
1118 ac_init_version=: ;;
1119
1120 -with-* | --with-*)
1121 ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1122 # Reject names that are not valid shell variable names.
1123 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1124 as_fn_error $? "invalid package name: $ac_useropt"
1125 ac_useropt_orig=$ac_useropt
1126 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1127 case $ac_user_opts in
1128 *"
1129 "with_$ac_useropt"
1130 "*) ;;
1131 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1132 ac_unrecognized_sep=', ';;
1133 esac
1134 eval with_$ac_useropt=\$ac_optarg ;;
1135
1136 -without-* | --without-*)
1137 ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1138 # Reject names that are not valid shell variable names.
1139 expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1140 as_fn_error $? "invalid package name: $ac_useropt"
1141 ac_useropt_orig=$ac_useropt
1142 ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1143 case $ac_user_opts in
1144 *"
1145 "with_$ac_useropt"
1146 "*) ;;
1147 *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1148 ac_unrecognized_sep=', ';;
1149 esac
1150 eval with_$ac_useropt=no ;;
1151
1152 --x)
1153 # Obsolete; use --with-x.
1154 with_x=yes ;;
1155
1156 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1157 | --x-incl | --x-inc | --x-in | --x-i)
1158 ac_prev=x_includes ;;
1159 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1160 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1161 x_includes=$ac_optarg ;;
1162
1163 -x-libraries | --x-libraries | --x-librarie | --x-librari \
1164 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1165 ac_prev=x_libraries ;;
1166 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1167 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1168 x_libraries=$ac_optarg ;;
1169
1170 -*) as_fn_error $? "unrecognized option: \`$ac_option'
1171 Try \`$0 --help' for more information"
1172 ;;
1173
1174 *=*)
1175 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1176 # Reject names that are not valid shell variable names.
1177 case $ac_envvar in #(
1178 '' | [0-9]* | *[!_$as_cr_alnum]* )
1179 as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1180 esac
1181 eval $ac_envvar=\$ac_optarg
1182 export $ac_envvar ;;
1183
1184 *)
1185 # FIXME: should be removed in autoconf 3.0.
1186 $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1187 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1188 $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1189 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1190 ;;
1191
1192 esac
1193 done
1194
1195 if test -n "$ac_prev"; then
1196 ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1197 as_fn_error $? "missing argument to $ac_option"
1198 fi
1199
1200 if test -n "$ac_unrecognized_opts"; then
1201 case $enable_option_checking in
1202 no) ;;
1203 fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1204 *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1205 esac
1206 fi
1207
1208 # Check all directory arguments for consistency.
1209 for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
1210 datadir sysconfdir sharedstatedir localstatedir includedir \
1211 oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1212 libdir localedir mandir
1213 do
1214 eval ac_val=\$$ac_var
1215 # Remove trailing slashes.
1216 case $ac_val in
1217 */ )
1218 ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1219 eval $ac_var=\$ac_val;;
1220 esac
1221 # Be sure to have absolute directory names.
1222 case $ac_val in
1223 [\\/$]* | ?:[\\/]* ) continue;;
1224 NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1225 esac
1226 as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1227 done
1228
1229 # There might be people who depend on the old broken behavior: `$host'
1230 # used to hold the argument of --host etc.
1231 # FIXME: To remove some day.
1232 build=$build_alias
1233 host=$host_alias
1234 target=$target_alias
1235
1236 # FIXME: To remove some day.
1237 if test "x$host_alias" != x; then
1238 if test "x$build_alias" = x; then
1239 cross_compiling=maybe
1240 elif test "x$build_alias" != "x$host_alias"; then
1241 cross_compiling=yes
1242 fi
1243 fi
1244
1245 ac_tool_prefix=
1246 test -n "$host_alias" && ac_tool_prefix=$host_alias-
1247
1248 test "$silent" = yes && exec 6>/dev/null
1249
1250
1251 ac_pwd=`pwd` && test -n "$ac_pwd" &&
1252 ac_ls_di=`ls -di .` &&
1253 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1254 as_fn_error $? "working directory cannot be determined"
1255 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1256 as_fn_error $? "pwd does not report name of working directory"
1257
1258
1259 # Find the source files, if location was not specified.
1260 if test -z "$srcdir"; then
1261 ac_srcdir_defaulted=yes
1262 # Try the directory containing this script, then the parent directory.
1263 ac_confdir=`$as_dirname -- "$as_myself" ||
1264 $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1265 X"$as_myself" : 'X\(//\)[^/]' \| \
1266 X"$as_myself" : 'X\(//\)$' \| \
1267 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1268 $as_echo X"$as_myself" |
1269 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1270 s//\1/
1271 q
1272 }
1273 /^X\(\/\/\)[^/].*/{
1274 s//\1/
1275 q
1276 }
1277 /^X\(\/\/\)$/{
1278 s//\1/
1279 q
1280 }
1281 /^X\(\/\).*/{
1282 s//\1/
1283 q
1284 }
1285 s/.*/./; q'`
1286 srcdir=$ac_confdir
1287 if test ! -r "$srcdir/$ac_unique_file"; then
1288 srcdir=..
1289 fi
1290 else
1291 ac_srcdir_defaulted=no
1292 fi
1293 if test ! -r "$srcdir/$ac_unique_file"; then
1294 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1295 as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1296 fi
1297 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1298 ac_abs_confdir=`(
1299 cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1300 pwd)`
1301 # When building in place, set srcdir=.
1302 if test "$ac_abs_confdir" = "$ac_pwd"; then
1303 srcdir=.
1304 fi
1305 # Remove unnecessary trailing slashes from srcdir.
1306 # Double slashes in file names in object file debugging info
1307 # mess up M-x gdb in Emacs.
1308 case $srcdir in
1309 */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1310 esac
1311 for ac_var in $ac_precious_vars; do
1312 eval ac_env_${ac_var}_set=\${${ac_var}+set}
1313 eval ac_env_${ac_var}_value=\$${ac_var}
1314 eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1315 eval ac_cv_env_${ac_var}_value=\$${ac_var}
1316 done
1317
211318 #
22
23 # configuration defaults
24 opt_prefix="/usr/local"
25 opt_libdir=""
26 opt_sysinc_seccomp="yes"
27 opt_bindings_python="no"
28
29 # output files
30 cnf_mk_file="configure.mk"
31 cnf_h_file="configure.h"
32
33 ####
34 # functions
35
36 function test_deps() {
37 [[ -z "$1" ]] && return 0
38 which "$1" >& /dev/null && return 0
39 return 1
1319 # Report the --help message.
1320 #
1321 if test "$ac_init_help" = "long"; then
1322 # Omit some internal or obsolete options to make the list less imposing.
1323 # This message is too long to be a string in the A/UX 3.1 sh.
1324 cat <<_ACEOF
1325 \`configure' configures libseccomp 2.2.3 to adapt to many kinds of systems.
1326
1327 Usage: $0 [OPTION]... [VAR=VALUE]...
1328
1329 To assign environment variables (e.g., CC, CFLAGS...), specify them as
1330 VAR=VALUE. See below for descriptions of some of the useful variables.
1331
1332 Defaults for the options are specified in brackets.
1333
1334 Configuration:
1335 -h, --help display this help and exit
1336 --help=short display options specific to this package
1337 --help=recursive display the short help of all the included packages
1338 -V, --version display version information and exit
1339 -q, --quiet, --silent do not print \`checking ...' messages
1340 --cache-file=FILE cache test results in FILE [disabled]
1341 -C, --config-cache alias for \`--cache-file=config.cache'
1342 -n, --no-create do not create output files
1343 --srcdir=DIR find the sources in DIR [configure dir or \`..']
1344
1345 Installation directories:
1346 --prefix=PREFIX install architecture-independent files in PREFIX
1347 [$ac_default_prefix]
1348 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
1349 [PREFIX]
1350
1351 By default, \`make install' will install all the files in
1352 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
1353 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1354 for instance \`--prefix=\$HOME'.
1355
1356 For better control, use the options below.
1357
1358 Fine tuning of the installation directories:
1359 --bindir=DIR user executables [EPREFIX/bin]
1360 --sbindir=DIR system admin executables [EPREFIX/sbin]
1361 --libexecdir=DIR program executables [EPREFIX/libexec]
1362 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
1363 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
1364 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
1365 --libdir=DIR object code libraries [EPREFIX/lib]
1366 --includedir=DIR C header files [PREFIX/include]
1367 --oldincludedir=DIR C header files for non-gcc [/usr/include]
1368 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
1369 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
1370 --infodir=DIR info documentation [DATAROOTDIR/info]
1371 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
1372 --mandir=DIR man documentation [DATAROOTDIR/man]
1373 --docdir=DIR documentation root [DATAROOTDIR/doc/libseccomp]
1374 --htmldir=DIR html documentation [DOCDIR]
1375 --dvidir=DIR dvi documentation [DOCDIR]
1376 --pdfdir=DIR pdf documentation [DOCDIR]
1377 --psdir=DIR ps documentation [DOCDIR]
1378 _ACEOF
1379
1380 cat <<\_ACEOF
1381
1382 Program names:
1383 --program-prefix=PREFIX prepend PREFIX to installed program names
1384 --program-suffix=SUFFIX append SUFFIX to installed program names
1385 --program-transform-name=PROGRAM run sed PROGRAM on installed program names
1386
1387 System types:
1388 --build=BUILD configure for building on BUILD [guessed]
1389 --host=HOST cross-compile to build programs to run on HOST [BUILD]
1390 _ACEOF
1391 fi
1392
1393 if test -n "$ac_init_help"; then
1394 case $ac_init_help in
1395 short | recursive ) echo "Configuration of libseccomp 2.2.3:";;
1396 esac
1397 cat <<\_ACEOF
1398
1399 Optional Features:
1400 --disable-option-checking ignore unrecognized --enable/--with options
1401 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
1402 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1403 --enable-silent-rules less verbose build output (undo: "make V=1")
1404 --disable-silent-rules verbose build output (undo: "make V=0")
1405 --enable-dependency-tracking
1406 do not reject slow dependency extractors
1407 --disable-dependency-tracking
1408 speeds up one-time build
1409 --enable-shared[=PKGS] build shared libraries [default=yes]
1410 --enable-static[=PKGS] build static libraries [default=yes]
1411 --enable-fast-install[=PKGS]
1412 optimize for fast installation [default=yes]
1413 --disable-libtool-lock avoid locking (might break parallel builds)
1414 --enable-python build the python bindings, requires cython
1415
1416 Optional Packages:
1417 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1418 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1419 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
1420 both]
1421 --with-aix-soname=aix|svr4|both
1422 shared library versioning (aka "SONAME") variant to
1423 provide on AIX, [default=aix].
1424 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1425 --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
1426 compiler's sysroot if not specified).
1427
1428 Some influential environment variables:
1429 CC C compiler command
1430 CFLAGS C compiler flags
1431 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
1432 nonstandard directory <lib dir>
1433 LIBS libraries to pass to the linker, e.g. -l<library>
1434 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1435 you have headers in a nonstandard directory <include dir>
1436 LT_SYS_LIBRARY_PATH
1437 User-defined run-time library search path.
1438 CPP C preprocessor
1439
1440 Use these variables to override the choices made by `configure' or to help
1441 it to find libraries and programs with nonstandard names/locations.
1442
1443 Report bugs to the package provider.
1444 _ACEOF
1445 ac_status=$?
1446 fi
1447
1448 if test "$ac_init_help" = "recursive"; then
1449 # If there are subdirs, report their specific --help.
1450 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1451 test -d "$ac_dir" ||
1452 { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1453 continue
1454 ac_builddir=.
1455
1456 case "$ac_dir" in
1457 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1458 *)
1459 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1460 # A ".." for each directory in $ac_dir_suffix.
1461 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1462 case $ac_top_builddir_sub in
1463 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1464 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1465 esac ;;
1466 esac
1467 ac_abs_top_builddir=$ac_pwd
1468 ac_abs_builddir=$ac_pwd$ac_dir_suffix
1469 # for backward compatibility:
1470 ac_top_builddir=$ac_top_build_prefix
1471
1472 case $srcdir in
1473 .) # We are building in place.
1474 ac_srcdir=.
1475 ac_top_srcdir=$ac_top_builddir_sub
1476 ac_abs_top_srcdir=$ac_pwd ;;
1477 [\\/]* | ?:[\\/]* ) # Absolute name.
1478 ac_srcdir=$srcdir$ac_dir_suffix;
1479 ac_top_srcdir=$srcdir
1480 ac_abs_top_srcdir=$srcdir ;;
1481 *) # Relative name.
1482 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1483 ac_top_srcdir=$ac_top_build_prefix$srcdir
1484 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1485 esac
1486 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1487
1488 cd "$ac_dir" || { ac_status=$?; continue; }
1489 # Check for guested configure.
1490 if test -f "$ac_srcdir/configure.gnu"; then
1491 echo &&
1492 $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1493 elif test -f "$ac_srcdir/configure"; then
1494 echo &&
1495 $SHELL "$ac_srcdir/configure" --help=recursive
1496 else
1497 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1498 fi || ac_status=$?
1499 cd "$ac_pwd" || { ac_status=$?; break; }
1500 done
1501 fi
1502
1503 test -n "$ac_init_help" && exit $ac_status
1504 if $ac_init_version; then
1505 cat <<\_ACEOF
1506 libseccomp configure 2.2.3
1507 generated by GNU Autoconf 2.69
1508
1509 Copyright (C) 2012 Free Software Foundation, Inc.
1510 This configure script is free software; the Free Software Foundation
1511 gives unlimited permission to copy, distribute and modify it.
1512 _ACEOF
1513 exit
1514 fi
1515
1516 ## ------------------------ ##
1517 ## Autoconf initialization. ##
1518 ## ------------------------ ##
1519
1520 # ac_fn_c_try_compile LINENO
1521 # --------------------------
1522 # Try to compile conftest.$ac_ext, and return whether this succeeded.
1523 ac_fn_c_try_compile ()
1524 {
1525 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1526 rm -f conftest.$ac_objext
1527 if { { ac_try="$ac_compile"
1528 case "(($ac_try" in
1529 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1530 *) ac_try_echo=$ac_try;;
1531 esac
1532 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1533 $as_echo "$ac_try_echo"; } >&5
1534 (eval "$ac_compile") 2>conftest.err
1535 ac_status=$?
1536 if test -s conftest.err; then
1537 grep -v '^ *+' conftest.err >conftest.er1
1538 cat conftest.er1 >&5
1539 mv -f conftest.er1 conftest.err
1540 fi
1541 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1542 test $ac_status = 0; } && {
1543 test -z "$ac_c_werror_flag" ||
1544 test ! -s conftest.err
1545 } && test -s conftest.$ac_objext; then :
1546 ac_retval=0
1547 else
1548 $as_echo "$as_me: failed program was:" >&5
1549 sed 's/^/| /' conftest.$ac_ext >&5
1550
1551 ac_retval=1
1552 fi
1553 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1554 as_fn_set_status $ac_retval
1555
1556 } # ac_fn_c_try_compile
1557
1558 # ac_fn_c_try_link LINENO
1559 # -----------------------
1560 # Try to link conftest.$ac_ext, and return whether this succeeded.
1561 ac_fn_c_try_link ()
1562 {
1563 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1564 rm -f conftest.$ac_objext conftest$ac_exeext
1565 if { { ac_try="$ac_link"
1566 case "(($ac_try" in
1567 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1568 *) ac_try_echo=$ac_try;;
1569 esac
1570 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1571 $as_echo "$ac_try_echo"; } >&5
1572 (eval "$ac_link") 2>conftest.err
1573 ac_status=$?
1574 if test -s conftest.err; then
1575 grep -v '^ *+' conftest.err >conftest.er1
1576 cat conftest.er1 >&5
1577 mv -f conftest.er1 conftest.err
1578 fi
1579 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1580 test $ac_status = 0; } && {
1581 test -z "$ac_c_werror_flag" ||
1582 test ! -s conftest.err
1583 } && test -s conftest$ac_exeext && {
1584 test "$cross_compiling" = yes ||
1585 test -x conftest$ac_exeext
1586 }; then :
1587 ac_retval=0
1588 else
1589 $as_echo "$as_me: failed program was:" >&5
1590 sed 's/^/| /' conftest.$ac_ext >&5
1591
1592 ac_retval=1
1593 fi
1594 # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1595 # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1596 # interfere with the next link command; also delete a directory that is
1597 # left behind by Apple's compiler. We do this before executing the actions.
1598 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1599 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1600 as_fn_set_status $ac_retval
1601
1602 } # ac_fn_c_try_link
1603
1604 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1605 # -------------------------------------------------------
1606 # Tests whether HEADER exists and can be compiled using the include files in
1607 # INCLUDES, setting the cache variable VAR accordingly.
1608 ac_fn_c_check_header_compile ()
1609 {
1610 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1611 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1612 $as_echo_n "checking for $2... " >&6; }
1613 if eval \${$3+:} false; then :
1614 $as_echo_n "(cached) " >&6
1615 else
1616 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1617 /* end confdefs.h. */
1618 $4
1619 #include <$2>
1620 _ACEOF
1621 if ac_fn_c_try_compile "$LINENO"; then :
1622 eval "$3=yes"
1623 else
1624 eval "$3=no"
1625 fi
1626 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1627 fi
1628 eval ac_res=\$$3
1629 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1630 $as_echo "$ac_res" >&6; }
1631 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1632
1633 } # ac_fn_c_check_header_compile
1634
1635 # ac_fn_c_try_cpp LINENO
1636 # ----------------------
1637 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1638 ac_fn_c_try_cpp ()
1639 {
1640 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1641 if { { ac_try="$ac_cpp conftest.$ac_ext"
1642 case "(($ac_try" in
1643 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1644 *) ac_try_echo=$ac_try;;
1645 esac
1646 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1647 $as_echo "$ac_try_echo"; } >&5
1648 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1649 ac_status=$?
1650 if test -s conftest.err; then
1651 grep -v '^ *+' conftest.err >conftest.er1
1652 cat conftest.er1 >&5
1653 mv -f conftest.er1 conftest.err
1654 fi
1655 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1656 test $ac_status = 0; } > conftest.i && {
1657 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1658 test ! -s conftest.err
1659 }; then :
1660 ac_retval=0
1661 else
1662 $as_echo "$as_me: failed program was:" >&5
1663 sed 's/^/| /' conftest.$ac_ext >&5
1664
1665 ac_retval=1
1666 fi
1667 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1668 as_fn_set_status $ac_retval
1669
1670 } # ac_fn_c_try_cpp
1671
1672 # ac_fn_c_try_run LINENO
1673 # ----------------------
1674 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1675 # that executables *can* be run.
1676 ac_fn_c_try_run ()
1677 {
1678 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1679 if { { ac_try="$ac_link"
1680 case "(($ac_try" in
1681 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1682 *) ac_try_echo=$ac_try;;
1683 esac
1684 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1685 $as_echo "$ac_try_echo"; } >&5
1686 (eval "$ac_link") 2>&5
1687 ac_status=$?
1688 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1689 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1690 { { case "(($ac_try" in
1691 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1692 *) ac_try_echo=$ac_try;;
1693 esac
1694 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1695 $as_echo "$ac_try_echo"; } >&5
1696 (eval "$ac_try") 2>&5
1697 ac_status=$?
1698 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1699 test $ac_status = 0; }; }; then :
1700 ac_retval=0
1701 else
1702 $as_echo "$as_me: program exited with status $ac_status" >&5
1703 $as_echo "$as_me: failed program was:" >&5
1704 sed 's/^/| /' conftest.$ac_ext >&5
1705
1706 ac_retval=$ac_status
1707 fi
1708 rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1709 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1710 as_fn_set_status $ac_retval
1711
1712 } # ac_fn_c_try_run
1713
1714 # ac_fn_c_check_func LINENO FUNC VAR
1715 # ----------------------------------
1716 # Tests whether FUNC exists, setting the cache variable VAR accordingly
1717 ac_fn_c_check_func ()
1718 {
1719 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1720 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1721 $as_echo_n "checking for $2... " >&6; }
1722 if eval \${$3+:} false; then :
1723 $as_echo_n "(cached) " >&6
1724 else
1725 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1726 /* end confdefs.h. */
1727 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1728 For example, HP-UX 11i <limits.h> declares gettimeofday. */
1729 #define $2 innocuous_$2
1730
1731 /* System header to define __stub macros and hopefully few prototypes,
1732 which can conflict with char $2 (); below.
1733 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1734 <limits.h> exists even on freestanding compilers. */
1735
1736 #ifdef __STDC__
1737 # include <limits.h>
1738 #else
1739 # include <assert.h>
1740 #endif
1741
1742 #undef $2
1743
1744 /* Override any GCC internal prototype to avoid an error.
1745 Use char because int might match the return type of a GCC
1746 builtin and then its argument prototype would still apply. */
1747 #ifdef __cplusplus
1748 extern "C"
1749 #endif
1750 char $2 ();
1751 /* The GNU C library defines this for functions which it implements
1752 to always fail with ENOSYS. Some functions are actually named
1753 something starting with __ and the normal name is an alias. */
1754 #if defined __stub_$2 || defined __stub___$2
1755 choke me
1756 #endif
1757
1758 int
1759 main ()
1760 {
1761 return $2 ();
1762 ;
1763 return 0;
401764 }
41
42 function verify_deps() {
43 [[ -z "$1" ]] && return
44 if ! test_deps "$1"; then
45 echo "error: install \"$1\" and include it in your \$PATH"
46 exit 1
1765 _ACEOF
1766 if ac_fn_c_try_link "$LINENO"; then :
1767 eval "$3=yes"
1768 else
1769 eval "$3=no"
1770 fi
1771 rm -f core conftest.err conftest.$ac_objext \
1772 conftest$ac_exeext conftest.$ac_ext
1773 fi
1774 eval ac_res=\$$3
1775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1776 $as_echo "$ac_res" >&6; }
1777 eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1778
1779 } # ac_fn_c_check_func
1780 cat >config.log <<_ACEOF
1781 This file contains any messages produced by compilers while
1782 running configure, to aid debugging if configure makes a mistake.
1783
1784 It was created by libseccomp $as_me 2.2.3, which was
1785 generated by GNU Autoconf 2.69. Invocation command line was
1786
1787 $ $0 $@
1788
1789 _ACEOF
1790 exec 5>>config.log
1791 {
1792 cat <<_ASUNAME
1793 ## --------- ##
1794 ## Platform. ##
1795 ## --------- ##
1796
1797 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
1798 uname -m = `(uname -m) 2>/dev/null || echo unknown`
1799 uname -r = `(uname -r) 2>/dev/null || echo unknown`
1800 uname -s = `(uname -s) 2>/dev/null || echo unknown`
1801 uname -v = `(uname -v) 2>/dev/null || echo unknown`
1802
1803 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
1804 /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
1805
1806 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
1807 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
1808 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
1809 /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
1810 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
1811 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
1812 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
1813
1814 _ASUNAME
1815
1816 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1817 for as_dir in $PATH
1818 do
1819 IFS=$as_save_IFS
1820 test -z "$as_dir" && as_dir=.
1821 $as_echo "PATH: $as_dir"
1822 done
1823 IFS=$as_save_IFS
1824
1825 } >&5
1826
1827 cat >&5 <<_ACEOF
1828
1829
1830 ## ----------- ##
1831 ## Core tests. ##
1832 ## ----------- ##
1833
1834 _ACEOF
1835
1836
1837 # Keep a trace of the command line.
1838 # Strip out --no-create and --no-recursion so they do not pile up.
1839 # Strip out --silent because we don't want to record it for future runs.
1840 # Also quote any args containing shell meta-characters.
1841 # Make two passes to allow for proper duplicate-argument suppression.
1842 ac_configure_args=
1843 ac_configure_args0=
1844 ac_configure_args1=
1845 ac_must_keep_next=false
1846 for ac_pass in 1 2
1847 do
1848 for ac_arg
1849 do
1850 case $ac_arg in
1851 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
1852 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1853 | -silent | --silent | --silen | --sile | --sil)
1854 continue ;;
1855 *\'*)
1856 ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
1857 esac
1858 case $ac_pass in
1859 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
1860 2)
1861 as_fn_append ac_configure_args1 " '$ac_arg'"
1862 if test $ac_must_keep_next = true; then
1863 ac_must_keep_next=false # Got value, back to normal.
1864 else
1865 case $ac_arg in
1866 *=* | --config-cache | -C | -disable-* | --disable-* \
1867 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1868 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1869 | -with-* | --with-* | -without-* | --without-* | --x)
1870 case "$ac_configure_args0 " in
1871 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1872 esac
1873 ;;
1874 -* ) ac_must_keep_next=true ;;
1875 esac
1876 fi
1877 as_fn_append ac_configure_args " '$ac_arg'"
1878 ;;
1879 esac
1880 done
1881 done
1882 { ac_configure_args0=; unset ac_configure_args0;}
1883 { ac_configure_args1=; unset ac_configure_args1;}
1884
1885 # When interrupted or exit'd, cleanup temporary files, and complete
1886 # config.log. We remove comments because anyway the quotes in there
1887 # would cause problems or look ugly.
1888 # WARNING: Use '\'' to represent an apostrophe within the trap.
1889 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
1890 trap 'exit_status=$?
1891 # Save into config.log some information that might help in debugging.
1892 {
1893 echo
1894
1895 $as_echo "## ---------------- ##
1896 ## Cache variables. ##
1897 ## ---------------- ##"
1898 echo
1899 # The following way of writing the cache mishandles newlines in values,
1900 (
1901 for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
1902 eval ac_val=\$$ac_var
1903 case $ac_val in #(
1904 *${as_nl}*)
1905 case $ac_var in #(
1906 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
1907 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
1908 esac
1909 case $ac_var in #(
1910 _ | IFS | as_nl) ;; #(
1911 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
1912 *) { eval $ac_var=; unset $ac_var;} ;;
1913 esac ;;
1914 esac
1915 done
1916 (set) 2>&1 |
1917 case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
1918 *${as_nl}ac_space=\ *)
1919 sed -n \
1920 "s/'\''/'\''\\\\'\'''\''/g;
1921 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
1922 ;; #(
1923 *)
1924 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
1925 ;;
1926 esac |
1927 sort
1928 )
1929 echo
1930
1931 $as_echo "## ----------------- ##
1932 ## Output variables. ##
1933 ## ----------------- ##"
1934 echo
1935 for ac_var in $ac_subst_vars
1936 do
1937 eval ac_val=\$$ac_var
1938 case $ac_val in
1939 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1940 esac
1941 $as_echo "$ac_var='\''$ac_val'\''"
1942 done | sort
1943 echo
1944
1945 if test -n "$ac_subst_files"; then
1946 $as_echo "## ------------------- ##
1947 ## File substitutions. ##
1948 ## ------------------- ##"
1949 echo
1950 for ac_var in $ac_subst_files
1951 do
1952 eval ac_val=\$$ac_var
1953 case $ac_val in
1954 *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
1955 esac
1956 $as_echo "$ac_var='\''$ac_val'\''"
1957 done | sort
1958 echo
1959 fi
1960
1961 if test -s confdefs.h; then
1962 $as_echo "## ----------- ##
1963 ## confdefs.h. ##
1964 ## ----------- ##"
1965 echo
1966 cat confdefs.h
1967 echo
1968 fi
1969 test "$ac_signal" != 0 &&
1970 $as_echo "$as_me: caught signal $ac_signal"
1971 $as_echo "$as_me: exit $exit_status"
1972 } >&5
1973 rm -f core *.core core.conftest.* &&
1974 rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
1975 exit $exit_status
1976 ' 0
1977 for ac_signal in 1 2 13 15; do
1978 trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
1979 done
1980 ac_signal=0
1981
1982 # confdefs.h avoids OS command line length limits that DEFS can exceed.
1983 rm -f -r conftest* confdefs.h
1984
1985 $as_echo "/* confdefs.h */" > confdefs.h
1986
1987 # Predefined preprocessor variables.
1988
1989 cat >>confdefs.h <<_ACEOF
1990 #define PACKAGE_NAME "$PACKAGE_NAME"
1991 _ACEOF
1992
1993 cat >>confdefs.h <<_ACEOF
1994 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
1995 _ACEOF
1996
1997 cat >>confdefs.h <<_ACEOF
1998 #define PACKAGE_VERSION "$PACKAGE_VERSION"
1999 _ACEOF
2000
2001 cat >>confdefs.h <<_ACEOF
2002 #define PACKAGE_STRING "$PACKAGE_STRING"
2003 _ACEOF
2004
2005 cat >>confdefs.h <<_ACEOF
2006 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2007 _ACEOF
2008
2009 cat >>confdefs.h <<_ACEOF
2010 #define PACKAGE_URL "$PACKAGE_URL"
2011 _ACEOF
2012
2013
2014 # Let the site file select an alternate cache file if it wants to.
2015 # Prefer an explicitly selected file to automatically selected ones.
2016 ac_site_file1=NONE
2017 ac_site_file2=NONE
2018 if test -n "$CONFIG_SITE"; then
2019 # We do not want a PATH search for config.site.
2020 case $CONFIG_SITE in #((
2021 -*) ac_site_file1=./$CONFIG_SITE;;
2022 */*) ac_site_file1=$CONFIG_SITE;;
2023 *) ac_site_file1=./$CONFIG_SITE;;
2024 esac
2025 elif test "x$prefix" != xNONE; then
2026 ac_site_file1=$prefix/share/config.site
2027 ac_site_file2=$prefix/etc/config.site
2028 else
2029 ac_site_file1=$ac_default_prefix/share/config.site
2030 ac_site_file2=$ac_default_prefix/etc/config.site
2031 fi
2032 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2033 do
2034 test "x$ac_site_file" = xNONE && continue
2035 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2036 { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2037 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
2038 sed 's/^/| /' "$ac_site_file" >&5
2039 . "$ac_site_file" \
2040 || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2041 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2042 as_fn_error $? "failed to load site script $ac_site_file
2043 See \`config.log' for more details" "$LINENO" 5; }
2044 fi
2045 done
2046
2047 if test -r "$cache_file"; then
2048 # Some versions of bash will fail to source /dev/null (special files
2049 # actually), so we avoid doing that. DJGPP emulates it as a regular file.
2050 if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2051 { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2052 $as_echo "$as_me: loading cache $cache_file" >&6;}
2053 case $cache_file in
2054 [\\/]* | ?:[\\/]* ) . "$cache_file";;
2055 *) . "./$cache_file";;
2056 esac
2057 fi
2058 else
2059 { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2060 $as_echo "$as_me: creating cache $cache_file" >&6;}
2061 >$cache_file
2062 fi
2063
2064 as_fn_append ac_header_list " linux/seccomp.h"
2065 # Check that the precious variables saved in the cache have kept the same
2066 # value.
2067 ac_cache_corrupted=false
2068 for ac_var in $ac_precious_vars; do
2069 eval ac_old_set=\$ac_cv_env_${ac_var}_set
2070 eval ac_new_set=\$ac_env_${ac_var}_set
2071 eval ac_old_val=\$ac_cv_env_${ac_var}_value
2072 eval ac_new_val=\$ac_env_${ac_var}_value
2073 case $ac_old_set,$ac_new_set in
2074 set,)
2075 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2076 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2077 ac_cache_corrupted=: ;;
2078 ,set)
2079 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2080 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2081 ac_cache_corrupted=: ;;
2082 ,);;
2083 *)
2084 if test "x$ac_old_val" != "x$ac_new_val"; then
2085 # differences in whitespace do not lead to failure.
2086 ac_old_val_w=`echo x $ac_old_val`
2087 ac_new_val_w=`echo x $ac_new_val`
2088 if test "$ac_old_val_w" != "$ac_new_val_w"; then
2089 { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2090 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2091 ac_cache_corrupted=:
2092 else
2093 { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2094 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2095 eval $ac_var=\$ac_old_val
472096 fi
2097 { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
2098 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
2099 { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
2100 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
2101 fi;;
2102 esac
2103 # Pass precious variables to config.status.
2104 if test "$ac_new_set" = set; then
2105 case $ac_new_val in
2106 *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2107 *) ac_arg=$ac_var=$ac_new_val ;;
2108 esac
2109 case " $ac_configure_args " in
2110 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
2111 *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2112 esac
2113 fi
2114 done
2115 if $ac_cache_corrupted; then
2116 { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2117 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2118 { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2119 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2120 as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2121 fi
2122 ## -------------------- ##
2123 ## Main body of script. ##
2124 ## -------------------- ##
2125
2126 ac_ext=c
2127 ac_cpp='$CPP $CPPFLAGS'
2128 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2129 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2130 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2131
2132
2133
2134 ac_aux_dir=
2135 for ac_dir in build-aux "$srcdir"/build-aux; do
2136 if test -f "$ac_dir/install-sh"; then
2137 ac_aux_dir=$ac_dir
2138 ac_install_sh="$ac_aux_dir/install-sh -c"
2139 break
2140 elif test -f "$ac_dir/install.sh"; then
2141 ac_aux_dir=$ac_dir
2142 ac_install_sh="$ac_aux_dir/install.sh -c"
2143 break
2144 elif test -f "$ac_dir/shtool"; then
2145 ac_aux_dir=$ac_dir
2146 ac_install_sh="$ac_aux_dir/shtool install -c"
2147 break
2148 fi
2149 done
2150 if test -z "$ac_aux_dir"; then
2151 as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
2152 fi
2153
2154 # These three variables are undocumented and unsupported,
2155 # and are intended to be withdrawn in a future Autoconf release.
2156 # They can cause serious problems if a builder's source tree is in a directory
2157 # whose full name contains unusual characters.
2158 ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
2159 ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
2160 ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
2161
2162
2163 ac_config_headers="$ac_config_headers configure.h"
2164
2165
2166
2167
2168 am__api_version='1.14'
2169
2170 # Find a good install program. We prefer a C program (faster),
2171 # so one script is as good as another. But avoid the broken or
2172 # incompatible versions:
2173 # SysV /etc/install, /usr/sbin/install
2174 # SunOS /usr/etc/install
2175 # IRIX /sbin/install
2176 # AIX /bin/install
2177 # AmigaOS /C/install, which installs bootblocks on floppy discs
2178 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2179 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2180 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2181 # OS/2's system install, which has a completely different semantic
2182 # ./install, which can be erroneously created by make from ./install.sh.
2183 # Reject install programs that cannot install multiple files.
2184 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
2185 $as_echo_n "checking for a BSD-compatible install... " >&6; }
2186 if test -z "$INSTALL"; then
2187 if ${ac_cv_path_install+:} false; then :
2188 $as_echo_n "(cached) " >&6
2189 else
2190 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2191 for as_dir in $PATH
2192 do
2193 IFS=$as_save_IFS
2194 test -z "$as_dir" && as_dir=.
2195 # Account for people who put trailing slashes in PATH elements.
2196 case $as_dir/ in #((
2197 ./ | .// | /[cC]/* | \
2198 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
2199 ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
2200 /usr/ucb/* ) ;;
2201 *)
2202 # OSF1 and SCO ODT 3.0 have their own names for install.
2203 # Don't use installbsd from OSF since it installs stuff as root
2204 # by default.
2205 for ac_prog in ginstall scoinst install; do
2206 for ac_exec_ext in '' $ac_executable_extensions; do
2207 if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
2208 if test $ac_prog = install &&
2209 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2210 # AIX install. It has an incompatible calling convention.
2211 :
2212 elif test $ac_prog = install &&
2213 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2214 # program-specific install script used by HP pwplus--don't use.
2215 :
2216 else
2217 rm -rf conftest.one conftest.two conftest.dir
2218 echo one > conftest.one
2219 echo two > conftest.two
2220 mkdir conftest.dir
2221 if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
2222 test -s conftest.one && test -s conftest.two &&
2223 test -s conftest.dir/conftest.one &&
2224 test -s conftest.dir/conftest.two
2225 then
2226 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
2227 break 3
2228 fi
2229 fi
2230 fi
2231 done
2232 done
2233 ;;
2234 esac
2235
2236 done
2237 IFS=$as_save_IFS
2238
2239 rm -rf conftest.one conftest.two conftest.dir
2240
2241 fi
2242 if test "${ac_cv_path_install+set}" = set; then
2243 INSTALL=$ac_cv_path_install
2244 else
2245 # As a last resort, use the slow shell script. Don't cache a
2246 # value for INSTALL within a source directory, because that will
2247 # break other packages using the cache if that directory is
2248 # removed, or if the value is a relative name.
2249 INSTALL=$ac_install_sh
2250 fi
2251 fi
2252 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
2253 $as_echo "$INSTALL" >&6; }
2254
2255 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2256 # It thinks the first close brace ends the variable substitution.
2257 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2258
2259 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2260
2261 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2262
2263 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
2264 $as_echo_n "checking whether build environment is sane... " >&6; }
2265 # Reject unsafe characters in $srcdir or the absolute working directory
2266 # name. Accept space and tab only in the latter.
2267 am_lf='
2268 '
2269 case `pwd` in
2270 *[\\\"\#\$\&\'\`$am_lf]*)
2271 as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
2272 esac
2273 case $srcdir in
2274 *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
2275 as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
2276 esac
2277
2278 # Do 'set' in a subshell so we don't clobber the current shell's
2279 # arguments. Must try -L first in case configure is actually a
2280 # symlink; some systems play weird games with the mod time of symlinks
2281 # (eg FreeBSD returns the mod time of the symlink's containing
2282 # directory).
2283 if (
2284 am_has_slept=no
2285 for am_try in 1 2; do
2286 echo "timestamp, slept: $am_has_slept" > conftest.file
2287 set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2288 if test "$*" = "X"; then
2289 # -L didn't work.
2290 set X `ls -t "$srcdir/configure" conftest.file`
2291 fi
2292 if test "$*" != "X $srcdir/configure conftest.file" \
2293 && test "$*" != "X conftest.file $srcdir/configure"; then
2294
2295 # If neither matched, then we have a broken ls. This can happen
2296 # if, for instance, CONFIG_SHELL is bash and it inherits a
2297 # broken ls alias from the environment. This has actually
2298 # happened. Such a system could not be considered "sane".
2299 as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
2300 alias in your environment" "$LINENO" 5
2301 fi
2302 if test "$2" = conftest.file || test $am_try -eq 2; then
2303 break
2304 fi
2305 # Just in case.
2306 sleep 1
2307 am_has_slept=yes
2308 done
2309 test "$2" = conftest.file
2310 )
2311 then
2312 # Ok.
2313 :
2314 else
2315 as_fn_error $? "newly created file is older than distributed files!
2316 Check your system clock" "$LINENO" 5
2317 fi
2318 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2319 $as_echo "yes" >&6; }
2320 # If we didn't sleep, we still need to ensure time stamps of config.status and
2321 # generated files are strictly newer.
2322 am_sleep_pid=
2323 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
2324 ( sleep 1 ) &
2325 am_sleep_pid=$!
2326 fi
2327
2328 rm -f conftest.file
2329
2330 test "$program_prefix" != NONE &&
2331 program_transform_name="s&^&$program_prefix&;$program_transform_name"
2332 # Use a double $ so make ignores it.
2333 test "$program_suffix" != NONE &&
2334 program_transform_name="s&\$&$program_suffix&;$program_transform_name"
2335 # Double any \ or $.
2336 # By default was `s,x,x', remove it if useless.
2337 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
2338 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
2339
2340 # expand $ac_aux_dir to an absolute path
2341 am_aux_dir=`cd $ac_aux_dir && pwd`
2342
2343 if test x"${MISSING+set}" != xset; then
2344 case $am_aux_dir in
2345 *\ * | *\ *)
2346 MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2347 *)
2348 MISSING="\${SHELL} $am_aux_dir/missing" ;;
2349 esac
2350 fi
2351 # Use eval to expand $SHELL
2352 if eval "$MISSING --is-lightweight"; then
2353 am_missing_run="$MISSING "
2354 else
2355 am_missing_run=
2356 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
2357 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
2358 fi
2359
2360 if test x"${install_sh}" != xset; then
2361 case $am_aux_dir in
2362 *\ * | *\ *)
2363 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2364 *)
2365 install_sh="\${SHELL} $am_aux_dir/install-sh"
2366 esac
2367 fi
2368
2369 # Installed binaries are usually stripped using 'strip' when the user
2370 # run "make install-strip". However 'strip' might not be the right
2371 # tool to use in cross-compilation environments, therefore Automake
2372 # will honor the 'STRIP' environment variable to overrule this program.
2373 if test "$cross_compiling" != no; then
2374 if test -n "$ac_tool_prefix"; then
2375 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
2376 set dummy ${ac_tool_prefix}strip; ac_word=$2
2377 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2378 $as_echo_n "checking for $ac_word... " >&6; }
2379 if ${ac_cv_prog_STRIP+:} false; then :
2380 $as_echo_n "(cached) " >&6
2381 else
2382 if test -n "$STRIP"; then
2383 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
2384 else
2385 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2386 for as_dir in $PATH
2387 do
2388 IFS=$as_save_IFS
2389 test -z "$as_dir" && as_dir=.
2390 for ac_exec_ext in '' $ac_executable_extensions; do
2391 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2392 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
2393 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2394 break 2
2395 fi
2396 done
2397 done
2398 IFS=$as_save_IFS
2399
2400 fi
2401 fi
2402 STRIP=$ac_cv_prog_STRIP
2403 if test -n "$STRIP"; then
2404 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
2405 $as_echo "$STRIP" >&6; }
2406 else
2407 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2408 $as_echo "no" >&6; }
2409 fi
2410
2411
2412 fi
2413 if test -z "$ac_cv_prog_STRIP"; then
2414 ac_ct_STRIP=$STRIP
2415 # Extract the first word of "strip", so it can be a program name with args.
2416 set dummy strip; ac_word=$2
2417 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2418 $as_echo_n "checking for $ac_word... " >&6; }
2419 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
2420 $as_echo_n "(cached) " >&6
2421 else
2422 if test -n "$ac_ct_STRIP"; then
2423 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
2424 else
2425 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2426 for as_dir in $PATH
2427 do
2428 IFS=$as_save_IFS
2429 test -z "$as_dir" && as_dir=.
2430 for ac_exec_ext in '' $ac_executable_extensions; do
2431 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2432 ac_cv_prog_ac_ct_STRIP="strip"
2433 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2434 break 2
2435 fi
2436 done
2437 done
2438 IFS=$as_save_IFS
2439
2440 fi
2441 fi
2442 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
2443 if test -n "$ac_ct_STRIP"; then
2444 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
2445 $as_echo "$ac_ct_STRIP" >&6; }
2446 else
2447 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2448 $as_echo "no" >&6; }
2449 fi
2450
2451 if test "x$ac_ct_STRIP" = x; then
2452 STRIP=":"
2453 else
2454 case $cross_compiling:$ac_tool_warned in
2455 yes:)
2456 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2457 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2458 ac_tool_warned=yes ;;
2459 esac
2460 STRIP=$ac_ct_STRIP
2461 fi
2462 else
2463 STRIP="$ac_cv_prog_STRIP"
2464 fi
2465
2466 fi
2467 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2468
2469 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
2470 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
2471 if test -z "$MKDIR_P"; then
2472 if ${ac_cv_path_mkdir+:} false; then :
2473 $as_echo_n "(cached) " >&6
2474 else
2475 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2476 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
2477 do
2478 IFS=$as_save_IFS
2479 test -z "$as_dir" && as_dir=.
2480 for ac_prog in mkdir gmkdir; do
2481 for ac_exec_ext in '' $ac_executable_extensions; do
2482 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
2483 case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
2484 'mkdir (GNU coreutils) '* | \
2485 'mkdir (coreutils) '* | \
2486 'mkdir (fileutils) '4.1*)
2487 ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
2488 break 3;;
2489 esac
2490 done
2491 done
2492 done
2493 IFS=$as_save_IFS
2494
2495 fi
2496
2497 test -d ./--version && rmdir ./--version
2498 if test "${ac_cv_path_mkdir+set}" = set; then
2499 MKDIR_P="$ac_cv_path_mkdir -p"
2500 else
2501 # As a last resort, use the slow shell script. Don't cache a
2502 # value for MKDIR_P within a source directory, because that will
2503 # break other packages using the cache if that directory is
2504 # removed, or if the value is a relative name.
2505 MKDIR_P="$ac_install_sh -d"
2506 fi
2507 fi
2508 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
2509 $as_echo "$MKDIR_P" >&6; }
2510
2511 for ac_prog in gawk mawk nawk awk
2512 do
2513 # Extract the first word of "$ac_prog", so it can be a program name with args.
2514 set dummy $ac_prog; ac_word=$2
2515 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2516 $as_echo_n "checking for $ac_word... " >&6; }
2517 if ${ac_cv_prog_AWK+:} false; then :
2518 $as_echo_n "(cached) " >&6
2519 else
2520 if test -n "$AWK"; then
2521 ac_cv_prog_AWK="$AWK" # Let the user override the test.
2522 else
2523 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2524 for as_dir in $PATH
2525 do
2526 IFS=$as_save_IFS
2527 test -z "$as_dir" && as_dir=.
2528 for ac_exec_ext in '' $ac_executable_extensions; do
2529 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2530 ac_cv_prog_AWK="$ac_prog"
2531 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2532 break 2
2533 fi
2534 done
2535 done
2536 IFS=$as_save_IFS
2537
2538 fi
2539 fi
2540 AWK=$ac_cv_prog_AWK
2541 if test -n "$AWK"; then
2542 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
2543 $as_echo "$AWK" >&6; }
2544 else
2545 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2546 $as_echo "no" >&6; }
2547 fi
2548
2549
2550 test -n "$AWK" && break
2551 done
2552
2553 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
2554 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
2555 set x ${MAKE-make}
2556 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
2557 if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
2558 $as_echo_n "(cached) " >&6
2559 else
2560 cat >conftest.make <<\_ACEOF
2561 SHELL = /bin/sh
2562 all:
2563 @echo '@@@%%%=$(MAKE)=@@@%%%'
2564 _ACEOF
2565 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
2566 case `${MAKE-make} -f conftest.make 2>/dev/null` in
2567 *@@@%%%=?*=@@@%%%*)
2568 eval ac_cv_prog_make_${ac_make}_set=yes;;
2569 *)
2570 eval ac_cv_prog_make_${ac_make}_set=no;;
2571 esac
2572 rm -f conftest.make
2573 fi
2574 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
2575 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2576 $as_echo "yes" >&6; }
2577 SET_MAKE=
2578 else
2579 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2580 $as_echo "no" >&6; }
2581 SET_MAKE="MAKE=${MAKE-make}"
2582 fi
2583
2584 rm -rf .tst 2>/dev/null
2585 mkdir .tst 2>/dev/null
2586 if test -d .tst; then
2587 am__leading_dot=.
2588 else
2589 am__leading_dot=_
2590 fi
2591 rmdir .tst 2>/dev/null
2592
2593 # Check whether --enable-silent-rules was given.
2594 if test "${enable_silent_rules+set}" = set; then :
2595 enableval=$enable_silent_rules;
2596 fi
2597
2598 case $enable_silent_rules in # (((
2599 yes) AM_DEFAULT_VERBOSITY=0;;
2600 no) AM_DEFAULT_VERBOSITY=1;;
2601 *) AM_DEFAULT_VERBOSITY=1;;
2602 esac
2603 am_make=${MAKE-make}
2604 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
2605 $as_echo_n "checking whether $am_make supports nested variables... " >&6; }
2606 if ${am_cv_make_support_nested_variables+:} false; then :
2607 $as_echo_n "(cached) " >&6
2608 else
2609 if $as_echo 'TRUE=$(BAR$(V))
2610 BAR0=false
2611 BAR1=true
2612 V=1
2613 am__doit:
2614 @$(TRUE)
2615 .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
2616 am_cv_make_support_nested_variables=yes
2617 else
2618 am_cv_make_support_nested_variables=no
2619 fi
2620 fi
2621 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
2622 $as_echo "$am_cv_make_support_nested_variables" >&6; }
2623 if test $am_cv_make_support_nested_variables = yes; then
2624 AM_V='$(V)'
2625 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
2626 else
2627 AM_V=$AM_DEFAULT_VERBOSITY
2628 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
2629 fi
2630 AM_BACKSLASH='\'
2631
2632 if test "`cd $srcdir && pwd`" != "`pwd`"; then
2633 # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
2634 # is not polluted with repeated "-I."
2635 am__isrc=' -I$(srcdir)'
2636 # test to see if srcdir already configured
2637 if test -f $srcdir/config.status; then
2638 as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
2639 fi
2640 fi
2641
2642 # test whether we have cygpath
2643 if test -z "$CYGPATH_W"; then
2644 if (cygpath --version) >/dev/null 2>/dev/null; then
2645 CYGPATH_W='cygpath -w'
2646 else
2647 CYGPATH_W=echo
2648 fi
2649 fi
2650
2651
2652 # Define the identity of the package.
2653 PACKAGE='libseccomp'
2654 VERSION='2.2.3'
2655
2656
2657 cat >>confdefs.h <<_ACEOF
2658 #define PACKAGE "$PACKAGE"
2659 _ACEOF
2660
2661
2662 cat >>confdefs.h <<_ACEOF
2663 #define VERSION "$VERSION"
2664 _ACEOF
2665
2666 # Some tools Automake needs.
2667
2668 ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
2669
2670
2671 AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
2672
2673
2674 AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
2675
2676
2677 AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
2678
2679
2680 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
2681
2682 # For better backward compatibility. To be removed once Automake 1.9.x
2683 # dies out for good. For more background, see:
2684 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2685 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2686 mkdir_p='$(MKDIR_P)'
2687
2688 # We need awk for the "check" target. The system "awk" is bad on
2689 # some platforms.
2690 # Always define AMTAR for backward compatibility. Yes, it's still used
2691 # in the wild :-( We should find a proper way to deprecate it ...
2692 AMTAR='$${TAR-tar}'
2693
2694
2695 # We'll loop over all known methods to create a tar archive until one works.
2696 _am_tools='gnutar pax cpio none'
2697
2698
2699
2700 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a pax tar archive" >&5
2701 $as_echo_n "checking how to create a pax tar archive... " >&6; }
2702
2703 # Go ahead even if we have the value already cached. We do so because we
2704 # need to set the values for the 'am__tar' and 'am__untar' variables.
2705 _am_tools=${am_cv_prog_tar_pax-$_am_tools}
2706
2707 for _am_tool in $_am_tools; do
2708 case $_am_tool in
2709 gnutar)
2710 for _am_tar in tar gnutar gtar; do
2711 { echo "$as_me:$LINENO: $_am_tar --version" >&5
2712 ($_am_tar --version) >&5 2>&5
2713 ac_status=$?
2714 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2715 (exit $ac_status); } && break
2716 done
2717 am__tar="$_am_tar --format=posix -chf - "'"$$tardir"'
2718 am__tar_="$_am_tar --format=posix -chf - "'"$tardir"'
2719 am__untar="$_am_tar -xf -"
2720 ;;
2721 plaintar)
2722 # Must skip GNU tar: if it does not support --format= it doesn't create
2723 # ustar tarball either.
2724 (tar --version) >/dev/null 2>&1 && continue
2725 am__tar='tar chf - "$$tardir"'
2726 am__tar_='tar chf - "$tardir"'
2727 am__untar='tar xf -'
2728 ;;
2729 pax)
2730 am__tar='pax -L -x pax -w "$$tardir"'
2731 am__tar_='pax -L -x pax -w "$tardir"'
2732 am__untar='pax -r'
2733 ;;
2734 cpio)
2735 am__tar='find "$$tardir" -print | cpio -o -H pax -L'
2736 am__tar_='find "$tardir" -print | cpio -o -H pax -L'
2737 am__untar='cpio -i -H pax -d'
2738 ;;
2739 none)
2740 am__tar=false
2741 am__tar_=false
2742 am__untar=false
2743 ;;
2744 esac
2745
2746 # If the value was cached, stop now. We just wanted to have am__tar
2747 # and am__untar set.
2748 test -n "${am_cv_prog_tar_pax}" && break
2749
2750 # tar/untar a dummy directory, and stop if the command works.
2751 rm -rf conftest.dir
2752 mkdir conftest.dir
2753 echo GrepMe > conftest.dir/file
2754 { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
2755 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
2756 ac_status=$?
2757 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2758 (exit $ac_status); }
2759 rm -rf conftest.dir
2760 if test -s conftest.tar; then
2761 { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
2762 ($am__untar <conftest.tar) >&5 2>&5
2763 ac_status=$?
2764 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2765 (exit $ac_status); }
2766 { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
2767 (cat conftest.dir/file) >&5 2>&5
2768 ac_status=$?
2769 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2770 (exit $ac_status); }
2771 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2772 fi
2773 done
2774 rm -rf conftest.dir
2775
2776 if ${am_cv_prog_tar_pax+:} false; then :
2777 $as_echo_n "(cached) " >&6
2778 else
2779 am_cv_prog_tar_pax=$_am_tool
2780 fi
2781
2782 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_pax" >&5
2783 $as_echo "$am_cv_prog_tar_pax" >&6; }
2784
2785
2786
2787
2788
2789
2790 # POSIX will say in a future version that running "rm -f" with no argument
2791 # is OK; and we want to be able to make that assumption in our Makefile
2792 # recipes. So use an aggressive probe to check that the usage we want is
2793 # actually supported "in the wild" to an acceptable degree.
2794 # See automake bug#10828.
2795 # To make any issue more visible, cause the running configure to be aborted
2796 # by default if the 'rm' program in use doesn't match our expectations; the
2797 # user can still override this though.
2798 if rm -f && rm -fr && rm -rf; then : OK; else
2799 cat >&2 <<'END'
2800 Oops!
2801
2802 Your 'rm' program seems unable to run without file operands specified
2803 on the command line, even when the '-f' option is present. This is contrary
2804 to the behaviour of most rm programs out there, and not conforming with
2805 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
2806
2807 Please tell bug-automake@gnu.org about your system, including the value
2808 of your $PATH and any error possibly output before this message. This
2809 can help us improve future automake versions.
2810
2811 END
2812 if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
2813 echo 'Configuration will proceed anyway, since you have set the' >&2
2814 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
2815 echo >&2
2816 else
2817 cat >&2 <<'END'
2818 Aborting the configuration process, to ensure you take notice of the issue.
2819
2820 You can download and install GNU coreutils to get an 'rm' implementation
2821 that behaves properly: <http://www.gnu.org/software/coreutils/>.
2822
2823 If you want to complete the configuration process using your problematic
2824 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
2825 to "yes", and re-run configure.
2826
2827 END
2828 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
2829 fi
2830 fi
2831
2832 ac_ext=c
2833 ac_cpp='$CPP $CPPFLAGS'
2834 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2835 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2836 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2837 if test -n "$ac_tool_prefix"; then
2838 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
2839 set dummy ${ac_tool_prefix}gcc; ac_word=$2
2840 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2841 $as_echo_n "checking for $ac_word... " >&6; }
2842 if ${ac_cv_prog_CC+:} false; then :
2843 $as_echo_n "(cached) " >&6
2844 else
2845 if test -n "$CC"; then
2846 ac_cv_prog_CC="$CC" # Let the user override the test.
2847 else
2848 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2849 for as_dir in $PATH
2850 do
2851 IFS=$as_save_IFS
2852 test -z "$as_dir" && as_dir=.
2853 for ac_exec_ext in '' $ac_executable_extensions; do
2854 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2855 ac_cv_prog_CC="${ac_tool_prefix}gcc"
2856 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2857 break 2
2858 fi
2859 done
2860 done
2861 IFS=$as_save_IFS
2862
2863 fi
2864 fi
2865 CC=$ac_cv_prog_CC
2866 if test -n "$CC"; then
2867 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2868 $as_echo "$CC" >&6; }
2869 else
2870 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2871 $as_echo "no" >&6; }
2872 fi
2873
2874
2875 fi
2876 if test -z "$ac_cv_prog_CC"; then
2877 ac_ct_CC=$CC
2878 # Extract the first word of "gcc", so it can be a program name with args.
2879 set dummy gcc; ac_word=$2
2880 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2881 $as_echo_n "checking for $ac_word... " >&6; }
2882 if ${ac_cv_prog_ac_ct_CC+:} false; then :
2883 $as_echo_n "(cached) " >&6
2884 else
2885 if test -n "$ac_ct_CC"; then
2886 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
2887 else
2888 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2889 for as_dir in $PATH
2890 do
2891 IFS=$as_save_IFS
2892 test -z "$as_dir" && as_dir=.
2893 for ac_exec_ext in '' $ac_executable_extensions; do
2894 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2895 ac_cv_prog_ac_ct_CC="gcc"
2896 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2897 break 2
2898 fi
2899 done
2900 done
2901 IFS=$as_save_IFS
2902
2903 fi
2904 fi
2905 ac_ct_CC=$ac_cv_prog_ac_ct_CC
2906 if test -n "$ac_ct_CC"; then
2907 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
2908 $as_echo "$ac_ct_CC" >&6; }
2909 else
2910 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2911 $as_echo "no" >&6; }
2912 fi
2913
2914 if test "x$ac_ct_CC" = x; then
2915 CC=""
2916 else
2917 case $cross_compiling:$ac_tool_warned in
2918 yes:)
2919 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
2920 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
2921 ac_tool_warned=yes ;;
2922 esac
2923 CC=$ac_ct_CC
2924 fi
2925 else
2926 CC="$ac_cv_prog_CC"
2927 fi
2928
2929 if test -z "$CC"; then
2930 if test -n "$ac_tool_prefix"; then
2931 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
2932 set dummy ${ac_tool_prefix}cc; ac_word=$2
2933 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2934 $as_echo_n "checking for $ac_word... " >&6; }
2935 if ${ac_cv_prog_CC+:} false; then :
2936 $as_echo_n "(cached) " >&6
2937 else
2938 if test -n "$CC"; then
2939 ac_cv_prog_CC="$CC" # Let the user override the test.
2940 else
2941 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2942 for as_dir in $PATH
2943 do
2944 IFS=$as_save_IFS
2945 test -z "$as_dir" && as_dir=.
2946 for ac_exec_ext in '' $ac_executable_extensions; do
2947 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2948 ac_cv_prog_CC="${ac_tool_prefix}cc"
2949 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2950 break 2
2951 fi
2952 done
2953 done
2954 IFS=$as_save_IFS
2955
2956 fi
2957 fi
2958 CC=$ac_cv_prog_CC
2959 if test -n "$CC"; then
2960 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
2961 $as_echo "$CC" >&6; }
2962 else
2963 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
2964 $as_echo "no" >&6; }
2965 fi
2966
2967
2968 fi
2969 fi
2970 if test -z "$CC"; then
2971 # Extract the first word of "cc", so it can be a program name with args.
2972 set dummy cc; ac_word=$2
2973 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2974 $as_echo_n "checking for $ac_word... " >&6; }
2975 if ${ac_cv_prog_CC+:} false; then :
2976 $as_echo_n "(cached) " >&6
2977 else
2978 if test -n "$CC"; then
2979 ac_cv_prog_CC="$CC" # Let the user override the test.
2980 else
2981 ac_prog_rejected=no
2982 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2983 for as_dir in $PATH
2984 do
2985 IFS=$as_save_IFS
2986 test -z "$as_dir" && as_dir=.
2987 for ac_exec_ext in '' $ac_executable_extensions; do
2988 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2989 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
2990 ac_prog_rejected=yes
2991 continue
2992 fi
2993 ac_cv_prog_CC="cc"
2994 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2995 break 2
2996 fi
2997 done
2998 done
2999 IFS=$as_save_IFS
3000
3001 if test $ac_prog_rejected = yes; then
3002 # We found a bogon in the path, so make sure we never use it.
3003 set dummy $ac_cv_prog_CC
3004 shift
3005 if test $# != 0; then
3006 # We chose a different compiler from the bogus one.
3007 # However, it has the same basename, so the bogon will be chosen
3008 # first if we set CC to just the basename; use the full file name.
3009 shift
3010 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
3011 fi
3012 fi
3013 fi
3014 fi
3015 CC=$ac_cv_prog_CC
3016 if test -n "$CC"; then
3017 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3018 $as_echo "$CC" >&6; }
3019 else
3020 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3021 $as_echo "no" >&6; }
3022 fi
3023
3024
3025 fi
3026 if test -z "$CC"; then
3027 if test -n "$ac_tool_prefix"; then
3028 for ac_prog in cl.exe
3029 do
3030 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3031 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3032 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3033 $as_echo_n "checking for $ac_word... " >&6; }
3034 if ${ac_cv_prog_CC+:} false; then :
3035 $as_echo_n "(cached) " >&6
3036 else
3037 if test -n "$CC"; then
3038 ac_cv_prog_CC="$CC" # Let the user override the test.
3039 else
3040 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3041 for as_dir in $PATH
3042 do
3043 IFS=$as_save_IFS
3044 test -z "$as_dir" && as_dir=.
3045 for ac_exec_ext in '' $ac_executable_extensions; do
3046 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3047 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3048 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3049 break 2
3050 fi
3051 done
3052 done
3053 IFS=$as_save_IFS
3054
3055 fi
3056 fi
3057 CC=$ac_cv_prog_CC
3058 if test -n "$CC"; then
3059 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3060 $as_echo "$CC" >&6; }
3061 else
3062 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3063 $as_echo "no" >&6; }
3064 fi
3065
3066
3067 test -n "$CC" && break
3068 done
3069 fi
3070 if test -z "$CC"; then
3071 ac_ct_CC=$CC
3072 for ac_prog in cl.exe
3073 do
3074 # Extract the first word of "$ac_prog", so it can be a program name with args.
3075 set dummy $ac_prog; ac_word=$2
3076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3077 $as_echo_n "checking for $ac_word... " >&6; }
3078 if ${ac_cv_prog_ac_ct_CC+:} false; then :
3079 $as_echo_n "(cached) " >&6
3080 else
3081 if test -n "$ac_ct_CC"; then
3082 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3083 else
3084 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3085 for as_dir in $PATH
3086 do
3087 IFS=$as_save_IFS
3088 test -z "$as_dir" && as_dir=.
3089 for ac_exec_ext in '' $ac_executable_extensions; do
3090 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3091 ac_cv_prog_ac_ct_CC="$ac_prog"
3092 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3093 break 2
3094 fi
3095 done
3096 done
3097 IFS=$as_save_IFS
3098
3099 fi
3100 fi
3101 ac_ct_CC=$ac_cv_prog_ac_ct_CC
3102 if test -n "$ac_ct_CC"; then
3103 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3104 $as_echo "$ac_ct_CC" >&6; }
3105 else
3106 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3107 $as_echo "no" >&6; }
3108 fi
3109
3110
3111 test -n "$ac_ct_CC" && break
3112 done
3113
3114 if test "x$ac_ct_CC" = x; then
3115 CC=""
3116 else
3117 case $cross_compiling:$ac_tool_warned in
3118 yes:)
3119 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3120 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3121 ac_tool_warned=yes ;;
3122 esac
3123 CC=$ac_ct_CC
3124 fi
3125 fi
3126
3127 fi
3128
3129
3130 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3131 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3132 as_fn_error $? "no acceptable C compiler found in \$PATH
3133 See \`config.log' for more details" "$LINENO" 5; }
3134
3135 # Provide some information about the compiler.
3136 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3137 set X $ac_compile
3138 ac_compiler=$2
3139 for ac_option in --version -v -V -qversion; do
3140 { { ac_try="$ac_compiler $ac_option >&5"
3141 case "(($ac_try" in
3142 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3143 *) ac_try_echo=$ac_try;;
3144 esac
3145 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3146 $as_echo "$ac_try_echo"; } >&5
3147 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3148 ac_status=$?
3149 if test -s conftest.err; then
3150 sed '10a\
3151 ... rest of stderr output deleted ...
3152 10q' conftest.err >conftest.er1
3153 cat conftest.er1 >&5
3154 fi
3155 rm -f conftest.er1 conftest.err
3156 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3157 test $ac_status = 0; }
3158 done
3159
3160 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3161 /* end confdefs.h. */
3162
3163 int
3164 main ()
3165 {
3166
3167 ;
3168 return 0;
483169 }
49
50 function msg_usage() {
51 cat << EOF
52 Configure the enhanced seccomp library, libseccomp, for this system.
53
54 Usage:
55 ./configure <options>
56
57 Options:
58 * general configuration
59 -h, --help display this help and exit
60 * installation configuration
61 --prefix=PREFIX installation base [/usr/local]
62 --libdir=DIR library directory [/usr/local/lib]
63 EOF
3170 _ACEOF
3171 ac_clean_files_save=$ac_clean_files
3172 ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3173 # Try to create an executable without -o first, disregard a.out.
3174 # It will help us diagnose broken compilers, and finding out an intuition
3175 # of exeext.
3176 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3177 $as_echo_n "checking whether the C compiler works... " >&6; }
3178 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3179
3180 # The possible output files:
3181 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3182
3183 ac_rmfiles=
3184 for ac_file in $ac_files
3185 do
3186 case $ac_file in
3187 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3188 * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3189 esac
3190 done
3191 rm -f $ac_rmfiles
3192
3193 if { { ac_try="$ac_link_default"
3194 case "(($ac_try" in
3195 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3196 *) ac_try_echo=$ac_try;;
3197 esac
3198 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3199 $as_echo "$ac_try_echo"; } >&5
3200 (eval "$ac_link_default") 2>&5
3201 ac_status=$?
3202 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3203 test $ac_status = 0; }; then :
3204 # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3205 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3206 # in a Makefile. We should not override ac_cv_exeext if it was cached,
3207 # so that the user can short-circuit this test for compilers unknown to
3208 # Autoconf.
3209 for ac_file in $ac_files ''
3210 do
3211 test -f "$ac_file" || continue
3212 case $ac_file in
3213 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3214 ;;
3215 [ab].out )
3216 # We found the default executable, but exeext='' is most
3217 # certainly right.
3218 break;;
3219 *.* )
3220 if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3221 then :; else
3222 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3223 fi
3224 # We set ac_cv_exeext here because the later test for it is not
3225 # safe: cross compilers may not add the suffix if given an `-o'
3226 # argument, so we may need to know it at that point already.
3227 # Even if this section looks crufty: it has the advantage of
3228 # actually working.
3229 break;;
3230 * )
3231 break;;
3232 esac
3233 done
3234 test "$ac_cv_exeext" = no && ac_cv_exeext=
3235
3236 else
3237 ac_file=''
3238 fi
3239 if test -z "$ac_file"; then :
3240 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3241 $as_echo "no" >&6; }
3242 $as_echo "$as_me: failed program was:" >&5
3243 sed 's/^/| /' conftest.$ac_ext >&5
3244
3245 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3246 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3247 as_fn_error 77 "C compiler cannot create executables
3248 See \`config.log' for more details" "$LINENO" 5; }
3249 else
3250 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3251 $as_echo "yes" >&6; }
3252 fi
3253 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3254 $as_echo_n "checking for C compiler default output file name... " >&6; }
3255 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3256 $as_echo "$ac_file" >&6; }
3257 ac_exeext=$ac_cv_exeext
3258
3259 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3260 ac_clean_files=$ac_clean_files_save
3261 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3262 $as_echo_n "checking for suffix of executables... " >&6; }
3263 if { { ac_try="$ac_link"
3264 case "(($ac_try" in
3265 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3266 *) ac_try_echo=$ac_try;;
3267 esac
3268 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3269 $as_echo "$ac_try_echo"; } >&5
3270 (eval "$ac_link") 2>&5
3271 ac_status=$?
3272 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3273 test $ac_status = 0; }; then :
3274 # If both `conftest.exe' and `conftest' are `present' (well, observable)
3275 # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
3276 # work properly (i.e., refer to `conftest.exe'), while it won't with
3277 # `rm'.
3278 for ac_file in conftest.exe conftest conftest.*; do
3279 test -f "$ac_file" || continue
3280 case $ac_file in
3281 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3282 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3283 break;;
3284 * ) break;;
3285 esac
3286 done
3287 else
3288 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3289 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3290 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
3291 See \`config.log' for more details" "$LINENO" 5; }
3292 fi
3293 rm -f conftest conftest$ac_cv_exeext
3294 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
3295 $as_echo "$ac_cv_exeext" >&6; }
3296
3297 rm -f conftest.$ac_ext
3298 EXEEXT=$ac_cv_exeext
3299 ac_exeext=$EXEEXT
3300 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3301 /* end confdefs.h. */
3302 #include <stdio.h>
3303 int
3304 main ()
3305 {
3306 FILE *f = fopen ("conftest.out", "w");
3307 return ferror (f) || fclose (f) != 0;
3308
3309 ;
3310 return 0;
643311 }
65
66 function msg_summary() {
67 cat << EOF
68 CONFIGURATION SUMMARY
69 libseccomp version: ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}
70 installation base: $opt_prefix
71 library directory: $opt_libdir
72 use system includes: $opt_sysinc_seccomp
73 EOF
3312 _ACEOF
3313 ac_clean_files="$ac_clean_files conftest.out"
3314 # Check that the compiler produces executables we can run. If not, either
3315 # the compiler is broken, or we cross compile.
3316 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
3317 $as_echo_n "checking whether we are cross compiling... " >&6; }
3318 if test "$cross_compiling" != yes; then
3319 { { ac_try="$ac_link"
3320 case "(($ac_try" in
3321 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3322 *) ac_try_echo=$ac_try;;
3323 esac
3324 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3325 $as_echo "$ac_try_echo"; } >&5
3326 (eval "$ac_link") 2>&5
3327 ac_status=$?
3328 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3329 test $ac_status = 0; }
3330 if { ac_try='./conftest$ac_cv_exeext'
3331 { { case "(($ac_try" in
3332 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3333 *) ac_try_echo=$ac_try;;
3334 esac
3335 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3336 $as_echo "$ac_try_echo"; } >&5
3337 (eval "$ac_try") 2>&5
3338 ac_status=$?
3339 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3340 test $ac_status = 0; }; }; then
3341 cross_compiling=no
3342 else
3343 if test "$cross_compiling" = maybe; then
3344 cross_compiling=yes
3345 else
3346 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3347 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3348 as_fn_error $? "cannot run C compiled programs.
3349 If you meant to cross compile, use \`--host'.
3350 See \`config.log' for more details" "$LINENO" 5; }
3351 fi
3352 fi
3353 fi
3354 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
3355 $as_echo "$cross_compiling" >&6; }
3356
3357 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
3358 ac_clean_files=$ac_clean_files_save
3359 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
3360 $as_echo_n "checking for suffix of object files... " >&6; }
3361 if ${ac_cv_objext+:} false; then :
3362 $as_echo_n "(cached) " >&6
3363 else
3364 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3365 /* end confdefs.h. */
3366
3367 int
3368 main ()
3369 {
3370
3371 ;
3372 return 0;
743373 }
75
76 function msg_error() {
77 echo "error: $@"
3374 _ACEOF
3375 rm -f conftest.o conftest.obj
3376 if { { ac_try="$ac_compile"
3377 case "(($ac_try" in
3378 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3379 *) ac_try_echo=$ac_try;;
3380 esac
3381 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3382 $as_echo "$ac_try_echo"; } >&5
3383 (eval "$ac_compile") 2>&5
3384 ac_status=$?
3385 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3386 test $ac_status = 0; }; then :
3387 for ac_file in conftest.o conftest.obj conftest.*; do
3388 test -f "$ac_file" || continue;
3389 case $ac_file in
3390 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
3391 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
3392 break;;
3393 esac
3394 done
3395 else
3396 $as_echo "$as_me: failed program was:" >&5
3397 sed 's/^/| /' conftest.$ac_ext >&5
3398
3399 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3400 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3401 as_fn_error $? "cannot compute suffix of object files: cannot compile
3402 See \`config.log' for more details" "$LINENO" 5; }
3403 fi
3404 rm -f conftest.$ac_cv_objext conftest.$ac_ext
3405 fi
3406 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
3407 $as_echo "$ac_cv_objext" >&6; }
3408 OBJEXT=$ac_cv_objext
3409 ac_objext=$OBJEXT
3410 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
3411 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
3412 if ${ac_cv_c_compiler_gnu+:} false; then :
3413 $as_echo_n "(cached) " >&6
3414 else
3415 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3416 /* end confdefs.h. */
3417
3418 int
3419 main ()
3420 {
3421 #ifndef __GNUC__
3422 choke me
3423 #endif
3424
3425 ;
3426 return 0;
783427 }
79
80 function cnf_mk_header() {
81 echo "# generated by configure on $(date -R)" >> $cnf_mk_file
82 echo "# options: \"$opt_str\"" >> $cnf_mk_file
83 echo "" >> $cnf_mk_file
3428 _ACEOF
3429 if ac_fn_c_try_compile "$LINENO"; then :
3430 ac_compiler_gnu=yes
3431 else
3432 ac_compiler_gnu=no
3433 fi
3434 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3435 ac_cv_c_compiler_gnu=$ac_compiler_gnu
3436
3437 fi
3438 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
3439 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
3440 if test $ac_compiler_gnu = yes; then
3441 GCC=yes
3442 else
3443 GCC=
3444 fi
3445 ac_test_CFLAGS=${CFLAGS+set}
3446 ac_save_CFLAGS=$CFLAGS
3447 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
3448 $as_echo_n "checking whether $CC accepts -g... " >&6; }
3449 if ${ac_cv_prog_cc_g+:} false; then :
3450 $as_echo_n "(cached) " >&6
3451 else
3452 ac_save_c_werror_flag=$ac_c_werror_flag
3453 ac_c_werror_flag=yes
3454 ac_cv_prog_cc_g=no
3455 CFLAGS="-g"
3456 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3457 /* end confdefs.h. */
3458
3459 int
3460 main ()
3461 {
3462
3463 ;
3464 return 0;
843465 }
85
86 function cnf_mk_footer() {
87 echo "" >> $cnf_mk_file
3466 _ACEOF
3467 if ac_fn_c_try_compile "$LINENO"; then :
3468 ac_cv_prog_cc_g=yes
3469 else
3470 CFLAGS=""
3471 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3472 /* end confdefs.h. */
3473
3474 int
3475 main ()
3476 {
3477
3478 ;
3479 return 0;
883480 }
89
90 function cnf_mk_entry() {
91 [[ $# -ne 2 ]] && return
92 case "$2" in
93 no)
94 echo "$1 = 0" >> $cnf_mk_file
3481 _ACEOF
3482 if ac_fn_c_try_compile "$LINENO"; then :
3483
3484 else
3485 ac_c_werror_flag=$ac_save_c_werror_flag
3486 CFLAGS="-g"
3487 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3488 /* end confdefs.h. */
3489
3490 int
3491 main ()
3492 {
3493
3494 ;
3495 return 0;
3496 }
3497 _ACEOF
3498 if ac_fn_c_try_compile "$LINENO"; then :
3499 ac_cv_prog_cc_g=yes
3500 fi
3501 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3502 fi
3503 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3504 fi
3505 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
3506 ac_c_werror_flag=$ac_save_c_werror_flag
3507 fi
3508 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
3509 $as_echo "$ac_cv_prog_cc_g" >&6; }
3510 if test "$ac_test_CFLAGS" = set; then
3511 CFLAGS=$ac_save_CFLAGS
3512 elif test $ac_cv_prog_cc_g = yes; then
3513 if test "$GCC" = yes; then
3514 CFLAGS="-g -O2"
3515 else
3516 CFLAGS="-g"
3517 fi
3518 else
3519 if test "$GCC" = yes; then
3520 CFLAGS="-O2"
3521 else
3522 CFLAGS=
3523 fi
3524 fi
3525 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
3526 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
3527 if ${ac_cv_prog_cc_c89+:} false; then :
3528 $as_echo_n "(cached) " >&6
3529 else
3530 ac_cv_prog_cc_c89=no
3531 ac_save_CC=$CC
3532 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3533 /* end confdefs.h. */
3534 #include <stdarg.h>
3535 #include <stdio.h>
3536 struct stat;
3537 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
3538 struct buf { int x; };
3539 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3540 static char *e (p, i)
3541 char **p;
3542 int i;
3543 {
3544 return p[i];
3545 }
3546 static char *f (char * (*g) (char **, int), char **p, ...)
3547 {
3548 char *s;
3549 va_list v;
3550 va_start (v,p);
3551 s = g (p, va_arg (v,int));
3552 va_end (v);
3553 return s;
3554 }
3555
3556 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
3557 function prototypes and stuff, but not '\xHH' hex character constants.
3558 These don't provoke an error unfortunately, instead are silently treated
3559 as 'x'. The following induces an error, until -std is added to get
3560 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
3561 array size at least. It's necessary to write '\x00'==0 to get something
3562 that's true only with -std. */
3563 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
3564
3565 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
3566 inside strings and character constants. */
3567 #define FOO(x) 'x'
3568 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
3569
3570 int test (int i, double x);
3571 struct s1 {int (*f) (int a);};
3572 struct s2 {int (*f) (double a);};
3573 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3574 int argc;
3575 char **argv;
3576 int
3577 main ()
3578 {
3579 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
3580 ;
3581 return 0;
3582 }
3583 _ACEOF
3584 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
3585 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3586 do
3587 CC="$ac_save_CC $ac_arg"
3588 if ac_fn_c_try_compile "$LINENO"; then :
3589 ac_cv_prog_cc_c89=$ac_arg
3590 fi
3591 rm -f core conftest.err conftest.$ac_objext
3592 test "x$ac_cv_prog_cc_c89" != "xno" && break
3593 done
3594 rm -f conftest.$ac_ext
3595 CC=$ac_save_CC
3596
3597 fi
3598 # AC_CACHE_VAL
3599 case "x$ac_cv_prog_cc_c89" in
3600 x)
3601 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
3602 $as_echo "none needed" >&6; } ;;
3603 xno)
3604 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
3605 $as_echo "unsupported" >&6; } ;;
3606 *)
3607 CC="$CC $ac_cv_prog_cc_c89"
3608 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
3609 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
3610 esac
3611 if test "x$ac_cv_prog_cc_c89" != xno; then :
3612
3613 fi
3614
3615 ac_ext=c
3616 ac_cpp='$CPP $CPPFLAGS'
3617 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3618 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3619 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3620
3621 ac_ext=c
3622 ac_cpp='$CPP $CPPFLAGS'
3623 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3624 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3625 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3626 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
3627 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
3628 if ${am_cv_prog_cc_c_o+:} false; then :
3629 $as_echo_n "(cached) " >&6
3630 else
3631 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3632 /* end confdefs.h. */
3633
3634 int
3635 main ()
3636 {
3637
3638 ;
3639 return 0;
3640 }
3641 _ACEOF
3642 # Make sure it works both with $CC and with simple cc.
3643 # Following AC_PROG_CC_C_O, we do the test twice because some
3644 # compilers refuse to overwrite an existing .o file with -o,
3645 # though they will create one.
3646 am_cv_prog_cc_c_o=yes
3647 for am_i in 1 2; do
3648 if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
3649 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
3650 ac_status=$?
3651 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3652 (exit $ac_status); } \
3653 && test -f conftest2.$ac_objext; then
3654 : OK
3655 else
3656 am_cv_prog_cc_c_o=no
3657 break
3658 fi
3659 done
3660 rm -f core conftest*
3661 unset am_i
3662 fi
3663 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
3664 $as_echo "$am_cv_prog_cc_c_o" >&6; }
3665 if test "$am_cv_prog_cc_c_o" != yes; then
3666 # Losing compiler, so override with the script.
3667 # FIXME: It is wrong to rewrite CC.
3668 # But if we don't then we get into trouble of one sort or another.
3669 # A longer-term fix would be to have automake use am__CC in this case,
3670 # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
3671 CC="$am_aux_dir/compile $CC"
3672 fi
3673 ac_ext=c
3674 ac_cpp='$CPP $CPPFLAGS'
3675 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3676 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3677 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3678
3679 DEPDIR="${am__leading_dot}deps"
3680
3681 ac_config_commands="$ac_config_commands depfiles"
3682
3683
3684 am_make=${MAKE-make}
3685 cat > confinc << 'END'
3686 am__doit:
3687 @echo this is the am__doit target
3688 .PHONY: am__doit
3689 END
3690 # If we don't find an include directive, just comment out the code.
3691 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3692 $as_echo_n "checking for style of include used by $am_make... " >&6; }
3693 am__include="#"
3694 am__quote=
3695 _am_result=none
3696 # First try GNU make style include.
3697 echo "include confinc" > confmf
3698 # Ignore all kinds of additional output from 'make'.
3699 case `$am_make -s -f confmf 2> /dev/null` in #(
3700 *the\ am__doit\ target*)
3701 am__include=include
3702 am__quote=
3703 _am_result=GNU
3704 ;;
3705 esac
3706 # Now try BSD make style include.
3707 if test "$am__include" = "#"; then
3708 echo '.include "confinc"' > confmf
3709 case `$am_make -s -f confmf 2> /dev/null` in #(
3710 *the\ am__doit\ target*)
3711 am__include=.include
3712 am__quote="\""
3713 _am_result=BSD
3714 ;;
3715 esac
3716 fi
3717
3718
3719 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
3720 $as_echo "$_am_result" >&6; }
3721 rm -f confinc confmf
3722
3723 # Check whether --enable-dependency-tracking was given.
3724 if test "${enable_dependency_tracking+set}" = set; then :
3725 enableval=$enable_dependency_tracking;
3726 fi
3727
3728 if test "x$enable_dependency_tracking" != xno; then
3729 am_depcomp="$ac_aux_dir/depcomp"
3730 AMDEPBACKSLASH='\'
3731 am__nodep='_no'
3732 fi
3733 if test "x$enable_dependency_tracking" != xno; then
3734 AMDEP_TRUE=
3735 AMDEP_FALSE='#'
3736 else
3737 AMDEP_TRUE='#'
3738 AMDEP_FALSE=
3739 fi
3740
3741
3742
3743 depcc="$CC" am_compiler_list=
3744
3745 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
3746 $as_echo_n "checking dependency style of $depcc... " >&6; }
3747 if ${am_cv_CC_dependencies_compiler_type+:} false; then :
3748 $as_echo_n "(cached) " >&6
3749 else
3750 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3751 # We make a subdir and do the tests there. Otherwise we can end up
3752 # making bogus files that we don't know about and never remove. For
3753 # instance it was reported that on HP-UX the gcc test will end up
3754 # making a dummy file named 'D' -- because '-MD' means "put the output
3755 # in D".
3756 rm -rf conftest.dir
3757 mkdir conftest.dir
3758 # Copy depcomp to subdir because otherwise we won't find it if we're
3759 # using a relative directory.
3760 cp "$am_depcomp" conftest.dir
3761 cd conftest.dir
3762 # We will build objects and dependencies in a subdirectory because
3763 # it helps to detect inapplicable dependency modes. For instance
3764 # both Tru64's cc and ICC support -MD to output dependencies as a
3765 # side effect of compilation, but ICC will put the dependencies in
3766 # the current directory while Tru64 will put them in the object
3767 # directory.
3768 mkdir sub
3769
3770 am_cv_CC_dependencies_compiler_type=none
3771 if test "$am_compiler_list" = ""; then
3772 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
3773 fi
3774 am__universal=false
3775 case " $depcc " in #(
3776 *\ -arch\ *\ -arch\ *) am__universal=true ;;
3777 esac
3778
3779 for depmode in $am_compiler_list; do
3780 # Setup a source with many dependencies, because some compilers
3781 # like to wrap large dependency lists on column 80 (with \), and
3782 # we should not choose a depcomp mode which is confused by this.
3783 #
3784 # We need to recreate these files for each test, as the compiler may
3785 # overwrite some of them when testing with obscure command lines.
3786 # This happens at least with the AIX C compiler.
3787 : > sub/conftest.c
3788 for i in 1 2 3 4 5 6; do
3789 echo '#include "conftst'$i'.h"' >> sub/conftest.c
3790 # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
3791 # Solaris 10 /bin/sh.
3792 echo '/* dummy */' > sub/conftst$i.h
3793 done
3794 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
3795
3796 # We check with '-c' and '-o' for the sake of the "dashmstdout"
3797 # mode. It turns out that the SunPro C++ compiler does not properly
3798 # handle '-M -o', and we need to detect this. Also, some Intel
3799 # versions had trouble with output in subdirs.
3800 am__obj=sub/conftest.${OBJEXT-o}
3801 am__minus_obj="-o $am__obj"
3802 case $depmode in
3803 gcc)
3804 # This depmode causes a compiler race in universal mode.
3805 test "$am__universal" = false || continue
3806 ;;
3807 nosideeffect)
3808 # After this tag, mechanisms are not by side-effect, so they'll
3809 # only be used when explicitly requested.
3810 if test "x$enable_dependency_tracking" = xyes; then
3811 continue
3812 else
3813 break
3814 fi
3815 ;;
3816 msvc7 | msvc7msys | msvisualcpp | msvcmsys)
3817 # This compiler won't grok '-c -o', but also, the minuso test has
3818 # not run yet. These depmodes are late enough in the game, and
3819 # so weak that their functioning should not be impacted.
3820 am__obj=conftest.${OBJEXT-o}
3821 am__minus_obj=
3822 ;;
3823 none) break ;;
3824 esac
3825 if depmode=$depmode \
3826 source=sub/conftest.c object=$am__obj \
3827 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
3828 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
3829 >/dev/null 2>conftest.err &&
3830 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
3831 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
3832 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
3833 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
3834 # icc doesn't choke on unknown options, it will just issue warnings
3835 # or remarks (even with -Werror). So we grep stderr for any message
3836 # that says an option was ignored or not supported.
3837 # When given -MP, icc 7.0 and 7.1 complain thusly:
3838 # icc: Command line warning: ignoring option '-M'; no argument required
3839 # The diagnosis changed in icc 8.0:
3840 # icc: Command line remark: option '-MP' not supported
3841 if (grep 'ignoring option' conftest.err ||
3842 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
3843 am_cv_CC_dependencies_compiler_type=$depmode
3844 break
3845 fi
3846 fi
3847 done
3848
3849 cd ..
3850 rm -rf conftest.dir
3851 else
3852 am_cv_CC_dependencies_compiler_type=none
3853 fi
3854
3855 fi
3856 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
3857 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
3858 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
3859
3860 if
3861 test "x$enable_dependency_tracking" != xno \
3862 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
3863 am__fastdepCC_TRUE=
3864 am__fastdepCC_FALSE='#'
3865 else
3866 am__fastdepCC_TRUE='#'
3867 am__fastdepCC_FALSE=
3868 fi
3869
3870
3871
3872
3873 if test -n "$ac_tool_prefix"; then
3874 for ac_prog in ar lib "link -lib"
3875 do
3876 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3877 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3878 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3879 $as_echo_n "checking for $ac_word... " >&6; }
3880 if ${ac_cv_prog_AR+:} false; then :
3881 $as_echo_n "(cached) " >&6
3882 else
3883 if test -n "$AR"; then
3884 ac_cv_prog_AR="$AR" # Let the user override the test.
3885 else
3886 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3887 for as_dir in $PATH
3888 do
3889 IFS=$as_save_IFS
3890 test -z "$as_dir" && as_dir=.
3891 for ac_exec_ext in '' $ac_executable_extensions; do
3892 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3893 ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
3894 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3895 break 2
3896 fi
3897 done
3898 done
3899 IFS=$as_save_IFS
3900
3901 fi
3902 fi
3903 AR=$ac_cv_prog_AR
3904 if test -n "$AR"; then
3905 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
3906 $as_echo "$AR" >&6; }
3907 else
3908 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3909 $as_echo "no" >&6; }
3910 fi
3911
3912
3913 test -n "$AR" && break
3914 done
3915 fi
3916 if test -z "$AR"; then
3917 ac_ct_AR=$AR
3918 for ac_prog in ar lib "link -lib"
3919 do
3920 # Extract the first word of "$ac_prog", so it can be a program name with args.
3921 set dummy $ac_prog; ac_word=$2
3922 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3923 $as_echo_n "checking for $ac_word... " >&6; }
3924 if ${ac_cv_prog_ac_ct_AR+:} false; then :
3925 $as_echo_n "(cached) " >&6
3926 else
3927 if test -n "$ac_ct_AR"; then
3928 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
3929 else
3930 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3931 for as_dir in $PATH
3932 do
3933 IFS=$as_save_IFS
3934 test -z "$as_dir" && as_dir=.
3935 for ac_exec_ext in '' $ac_executable_extensions; do
3936 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3937 ac_cv_prog_ac_ct_AR="$ac_prog"
3938 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3939 break 2
3940 fi
3941 done
3942 done
3943 IFS=$as_save_IFS
3944
3945 fi
3946 fi
3947 ac_ct_AR=$ac_cv_prog_ac_ct_AR
3948 if test -n "$ac_ct_AR"; then
3949 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
3950 $as_echo "$ac_ct_AR" >&6; }
3951 else
3952 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3953 $as_echo "no" >&6; }
3954 fi
3955
3956
3957 test -n "$ac_ct_AR" && break
3958 done
3959
3960 if test "x$ac_ct_AR" = x; then
3961 AR="false"
3962 else
3963 case $cross_compiling:$ac_tool_warned in
3964 yes:)
3965 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3966 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3967 ac_tool_warned=yes ;;
3968 esac
3969 AR=$ac_ct_AR
3970 fi
3971 fi
3972
3973 : ${AR=ar}
3974
3975 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
3976 $as_echo_n "checking the archiver ($AR) interface... " >&6; }
3977 if ${am_cv_ar_interface+:} false; then :
3978 $as_echo_n "(cached) " >&6
3979 else
3980 ac_ext=c
3981 ac_cpp='$CPP $CPPFLAGS'
3982 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3983 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3984 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3985
3986 am_cv_ar_interface=ar
3987 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3988 /* end confdefs.h. */
3989 int some_variable = 0;
3990 _ACEOF
3991 if ac_fn_c_try_compile "$LINENO"; then :
3992 am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
3993 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
3994 (eval $am_ar_try) 2>&5
3995 ac_status=$?
3996 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3997 test $ac_status = 0; }
3998 if test "$ac_status" -eq 0; then
3999 am_cv_ar_interface=ar
4000 else
4001 am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
4002 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
4003 (eval $am_ar_try) 2>&5
4004 ac_status=$?
4005 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4006 test $ac_status = 0; }
4007 if test "$ac_status" -eq 0; then
4008 am_cv_ar_interface=lib
4009 else
4010 am_cv_ar_interface=unknown
4011 fi
4012 fi
4013 rm -f conftest.lib libconftest.a
4014
4015 fi
4016 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4017 ac_ext=c
4018 ac_cpp='$CPP $CPPFLAGS'
4019 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4020 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4021 ac_compiler_gnu=$ac_cv_c_compiler_gnu
4022
4023 fi
4024 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
4025 $as_echo "$am_cv_ar_interface" >&6; }
4026
4027 case $am_cv_ar_interface in
4028 ar)
4029 ;;
4030 lib)
4031 # Microsoft lib, so override with the ar-lib wrapper script.
4032 # FIXME: It is wrong to rewrite AR.
4033 # But if we don't then we get into trouble of one sort or another.
4034 # A longer-term fix would be to have automake use am__AR in this case,
4035 # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
4036 # similar.
4037 AR="$am_aux_dir/ar-lib $AR"
4038 ;;
4039 unknown)
4040 as_fn_error $? "could not determine $AR interface" "$LINENO" 5
4041 ;;
4042 esac
4043
4044
4045 case `pwd` in
4046 *\ * | *\ *)
4047 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
4048 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
4049 esac
4050
4051
4052
4053 macro_version='2.4.6'
4054 macro_revision='2.4.6'
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068 ltmain=$ac_aux_dir/ltmain.sh
4069
4070 # Make sure we can run config.sub.
4071 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
4072 as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
4073
4074 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
4075 $as_echo_n "checking build system type... " >&6; }
4076 if ${ac_cv_build+:} false; then :
4077 $as_echo_n "(cached) " >&6
4078 else
4079 ac_build_alias=$build_alias
4080 test "x$ac_build_alias" = x &&
4081 ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
4082 test "x$ac_build_alias" = x &&
4083 as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
4084 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
4085 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
4086
4087 fi
4088 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
4089 $as_echo "$ac_cv_build" >&6; }
4090 case $ac_cv_build in
4091 *-*-*) ;;
4092 *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
4093 esac
4094 build=$ac_cv_build
4095 ac_save_IFS=$IFS; IFS='-'
4096 set x $ac_cv_build
4097 shift
4098 build_cpu=$1
4099 build_vendor=$2
4100 shift; shift
4101 # Remember, the first character of IFS is used to create $*,
4102 # except with old shells:
4103 build_os=$*
4104 IFS=$ac_save_IFS
4105 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
4106
4107
4108 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
4109 $as_echo_n "checking host system type... " >&6; }
4110 if ${ac_cv_host+:} false; then :
4111 $as_echo_n "(cached) " >&6
4112 else
4113 if test "x$host_alias" = x; then
4114 ac_cv_host=$ac_cv_build
4115 else
4116 ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
4117 as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
4118 fi
4119
4120 fi
4121 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
4122 $as_echo "$ac_cv_host" >&6; }
4123 case $ac_cv_host in
4124 *-*-*) ;;
4125 *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
4126 esac
4127 host=$ac_cv_host
4128 ac_save_IFS=$IFS; IFS='-'
4129 set x $ac_cv_host
4130 shift
4131 host_cpu=$1
4132 host_vendor=$2
4133 shift; shift
4134 # Remember, the first character of IFS is used to create $*,
4135 # except with old shells:
4136 host_os=$*
4137 IFS=$ac_save_IFS
4138 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
4139
4140
4141 # Backslashify metacharacters that are still active within
4142 # double-quoted strings.
4143 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
4144
4145 # Same as above, but do not quote variable references.
4146 double_quote_subst='s/\(["`\\]\)/\\\1/g'
4147
4148 # Sed substitution to delay expansion of an escaped shell variable in a
4149 # double_quote_subst'ed string.
4150 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
4151
4152 # Sed substitution to delay expansion of an escaped single quote.
4153 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
4154
4155 # Sed substitution to avoid accidental globbing in evaled expressions
4156 no_glob_subst='s/\*/\\\*/g'
4157
4158 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
4159 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
4160 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
4161
4162 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
4163 $as_echo_n "checking how to print strings... " >&6; }
4164 # Test print first, because it will be a builtin if present.
4165 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
4166 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
4167 ECHO='print -r --'
4168 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
4169 ECHO='printf %s\n'
4170 else
4171 # Use this function as a fallback that always works.
4172 func_fallback_echo ()
4173 {
4174 eval 'cat <<_LTECHO_EOF
4175 $1
4176 _LTECHO_EOF'
4177 }
4178 ECHO='func_fallback_echo'
4179 fi
4180
4181 # func_echo_all arg...
4182 # Invoke $ECHO with all args, space-separated.
4183 func_echo_all ()
4184 {
4185 $ECHO ""
4186 }
4187
4188 case $ECHO in
4189 printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
4190 $as_echo "printf" >&6; } ;;
4191 print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
4192 $as_echo "print -r" >&6; } ;;
4193 *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
4194 $as_echo "cat" >&6; } ;;
4195 esac
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
4211 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
4212 if ${ac_cv_path_SED+:} false; then :
4213 $as_echo_n "(cached) " >&6
4214 else
4215 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
4216 for ac_i in 1 2 3 4 5 6 7; do
4217 ac_script="$ac_script$as_nl$ac_script"
4218 done
4219 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
4220 { ac_script=; unset ac_script;}
4221 if test -z "$SED"; then
4222 ac_path_SED_found=false
4223 # Loop through the user's path and test for each of PROGNAME-LIST
4224 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4225 for as_dir in $PATH
4226 do
4227 IFS=$as_save_IFS
4228 test -z "$as_dir" && as_dir=.
4229 for ac_prog in sed gsed; do
4230 for ac_exec_ext in '' $ac_executable_extensions; do
4231 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
4232 as_fn_executable_p "$ac_path_SED" || continue
4233 # Check for GNU ac_path_SED and select it if it is found.
4234 # Check for GNU $ac_path_SED
4235 case `"$ac_path_SED" --version 2>&1` in
4236 *GNU*)
4237 ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
4238 *)
4239 ac_count=0
4240 $as_echo_n 0123456789 >"conftest.in"
4241 while :
4242 do
4243 cat "conftest.in" "conftest.in" >"conftest.tmp"
4244 mv "conftest.tmp" "conftest.in"
4245 cp "conftest.in" "conftest.nl"
4246 $as_echo '' >> "conftest.nl"
4247 "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
4248 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4249 as_fn_arith $ac_count + 1 && ac_count=$as_val
4250 if test $ac_count -gt ${ac_path_SED_max-0}; then
4251 # Best one so far, save it but keep looking for a better one
4252 ac_cv_path_SED="$ac_path_SED"
4253 ac_path_SED_max=$ac_count
4254 fi
4255 # 10*(2^10) chars as input seems more than enough
4256 test $ac_count -gt 10 && break
4257 done
4258 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4259 esac
4260
4261 $ac_path_SED_found && break 3
4262 done
4263 done
4264 done
4265 IFS=$as_save_IFS
4266 if test -z "$ac_cv_path_SED"; then
4267 as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
4268 fi
4269 else
4270 ac_cv_path_SED=$SED
4271 fi
4272
4273 fi
4274 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
4275 $as_echo "$ac_cv_path_SED" >&6; }
4276 SED="$ac_cv_path_SED"
4277 rm -f conftest.sed
4278
4279 test -z "$SED" && SED=sed
4280 Xsed="$SED -e 1s/^X//"
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4293 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4294 if ${ac_cv_path_GREP+:} false; then :
4295 $as_echo_n "(cached) " >&6
4296 else
4297 if test -z "$GREP"; then
4298 ac_path_GREP_found=false
4299 # Loop through the user's path and test for each of PROGNAME-LIST
4300 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4301 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4302 do
4303 IFS=$as_save_IFS
4304 test -z "$as_dir" && as_dir=.
4305 for ac_prog in grep ggrep; do
4306 for ac_exec_ext in '' $ac_executable_extensions; do
4307 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4308 as_fn_executable_p "$ac_path_GREP" || continue
4309 # Check for GNU ac_path_GREP and select it if it is found.
4310 # Check for GNU $ac_path_GREP
4311 case `"$ac_path_GREP" --version 2>&1` in
4312 *GNU*)
4313 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4314 *)
4315 ac_count=0
4316 $as_echo_n 0123456789 >"conftest.in"
4317 while :
4318 do
4319 cat "conftest.in" "conftest.in" >"conftest.tmp"
4320 mv "conftest.tmp" "conftest.in"
4321 cp "conftest.in" "conftest.nl"
4322 $as_echo 'GREP' >> "conftest.nl"
4323 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4324 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4325 as_fn_arith $ac_count + 1 && ac_count=$as_val
4326 if test $ac_count -gt ${ac_path_GREP_max-0}; then
4327 # Best one so far, save it but keep looking for a better one
4328 ac_cv_path_GREP="$ac_path_GREP"
4329 ac_path_GREP_max=$ac_count
4330 fi
4331 # 10*(2^10) chars as input seems more than enough
4332 test $ac_count -gt 10 && break
4333 done
4334 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4335 esac
4336
4337 $ac_path_GREP_found && break 3
4338 done
4339 done
4340 done
4341 IFS=$as_save_IFS
4342 if test -z "$ac_cv_path_GREP"; then
4343 as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4344 fi
4345 else
4346 ac_cv_path_GREP=$GREP
4347 fi
4348
4349 fi
4350 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4351 $as_echo "$ac_cv_path_GREP" >&6; }
4352 GREP="$ac_cv_path_GREP"
4353
4354
4355 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4356 $as_echo_n "checking for egrep... " >&6; }
4357 if ${ac_cv_path_EGREP+:} false; then :
4358 $as_echo_n "(cached) " >&6
4359 else
4360 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4361 then ac_cv_path_EGREP="$GREP -E"
4362 else
4363 if test -z "$EGREP"; then
4364 ac_path_EGREP_found=false
4365 # Loop through the user's path and test for each of PROGNAME-LIST
4366 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4367 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4368 do
4369 IFS=$as_save_IFS
4370 test -z "$as_dir" && as_dir=.
4371 for ac_prog in egrep; do
4372 for ac_exec_ext in '' $ac_executable_extensions; do
4373 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4374 as_fn_executable_p "$ac_path_EGREP" || continue
4375 # Check for GNU ac_path_EGREP and select it if it is found.
4376 # Check for GNU $ac_path_EGREP
4377 case `"$ac_path_EGREP" --version 2>&1` in
4378 *GNU*)
4379 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4380 *)
4381 ac_count=0
4382 $as_echo_n 0123456789 >"conftest.in"
4383 while :
4384 do
4385 cat "conftest.in" "conftest.in" >"conftest.tmp"
4386 mv "conftest.tmp" "conftest.in"
4387 cp "conftest.in" "conftest.nl"
4388 $as_echo 'EGREP' >> "conftest.nl"
4389 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4390 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4391 as_fn_arith $ac_count + 1 && ac_count=$as_val
4392 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4393 # Best one so far, save it but keep looking for a better one
4394 ac_cv_path_EGREP="$ac_path_EGREP"
4395 ac_path_EGREP_max=$ac_count
4396 fi
4397 # 10*(2^10) chars as input seems more than enough
4398 test $ac_count -gt 10 && break
4399 done
4400 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4401 esac
4402
4403 $ac_path_EGREP_found && break 3
4404 done
4405 done
4406 done
4407 IFS=$as_save_IFS
4408 if test -z "$ac_cv_path_EGREP"; then
4409 as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4410 fi
4411 else
4412 ac_cv_path_EGREP=$EGREP
4413 fi
4414
4415 fi
4416 fi
4417 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
4418 $as_echo "$ac_cv_path_EGREP" >&6; }
4419 EGREP="$ac_cv_path_EGREP"
4420
4421
4422 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
4423 $as_echo_n "checking for fgrep... " >&6; }
4424 if ${ac_cv_path_FGREP+:} false; then :
4425 $as_echo_n "(cached) " >&6
4426 else
4427 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
4428 then ac_cv_path_FGREP="$GREP -F"
4429 else
4430 if test -z "$FGREP"; then
4431 ac_path_FGREP_found=false
4432 # Loop through the user's path and test for each of PROGNAME-LIST
4433 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4434 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4435 do
4436 IFS=$as_save_IFS
4437 test -z "$as_dir" && as_dir=.
4438 for ac_prog in fgrep; do
4439 for ac_exec_ext in '' $ac_executable_extensions; do
4440 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
4441 as_fn_executable_p "$ac_path_FGREP" || continue
4442 # Check for GNU ac_path_FGREP and select it if it is found.
4443 # Check for GNU $ac_path_FGREP
4444 case `"$ac_path_FGREP" --version 2>&1` in
4445 *GNU*)
4446 ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
4447 *)
4448 ac_count=0
4449 $as_echo_n 0123456789 >"conftest.in"
4450 while :
4451 do
4452 cat "conftest.in" "conftest.in" >"conftest.tmp"
4453 mv "conftest.tmp" "conftest.in"
4454 cp "conftest.in" "conftest.nl"
4455 $as_echo 'FGREP' >> "conftest.nl"
4456 "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
4457 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4458 as_fn_arith $ac_count + 1 && ac_count=$as_val
4459 if test $ac_count -gt ${ac_path_FGREP_max-0}; then
4460 # Best one so far, save it but keep looking for a better one
4461 ac_cv_path_FGREP="$ac_path_FGREP"
4462 ac_path_FGREP_max=$ac_count
4463 fi
4464 # 10*(2^10) chars as input seems more than enough
4465 test $ac_count -gt 10 && break
4466 done
4467 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4468 esac
4469
4470 $ac_path_FGREP_found && break 3
4471 done
4472 done
4473 done
4474 IFS=$as_save_IFS
4475 if test -z "$ac_cv_path_FGREP"; then
4476 as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4477 fi
4478 else
4479 ac_cv_path_FGREP=$FGREP
4480 fi
4481
4482 fi
4483 fi
4484 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
4485 $as_echo "$ac_cv_path_FGREP" >&6; }
4486 FGREP="$ac_cv_path_FGREP"
4487
4488
4489 test -z "$GREP" && GREP=grep
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509 # Check whether --with-gnu-ld was given.
4510 if test "${with_gnu_ld+set}" = set; then :
4511 withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
4512 else
4513 with_gnu_ld=no
4514 fi
4515
4516 ac_prog=ld
4517 if test yes = "$GCC"; then
4518 # Check if gcc -print-prog-name=ld gives a path.
4519 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
4520 $as_echo_n "checking for ld used by $CC... " >&6; }
4521 case $host in
4522 *-*-mingw*)
4523 # gcc leaves a trailing carriage return, which upsets mingw
4524 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4525 *)
4526 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4527 esac
4528 case $ac_prog in
4529 # Accept absolute paths.
4530 [\\/]* | ?:[\\/]*)
4531 re_direlt='/[^/][^/]*/\.\./'
4532 # Canonicalize the pathname of ld
4533 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4534 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4535 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4536 done
4537 test -z "$LD" && LD=$ac_prog
4538 ;;
4539 "")
4540 # If it fails, then pretend we aren't using GCC.
4541 ac_prog=ld
4542 ;;
4543 *)
4544 # If it is relative, then search for the first ld in PATH.
4545 with_gnu_ld=unknown
4546 ;;
4547 esac
4548 elif test yes = "$with_gnu_ld"; then
4549 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
4550 $as_echo_n "checking for GNU ld... " >&6; }
4551 else
4552 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
4553 $as_echo_n "checking for non-GNU ld... " >&6; }
4554 fi
4555 if ${lt_cv_path_LD+:} false; then :
4556 $as_echo_n "(cached) " >&6
4557 else
4558 if test -z "$LD"; then
4559 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
4560 for ac_dir in $PATH; do
4561 IFS=$lt_save_ifs
4562 test -z "$ac_dir" && ac_dir=.
4563 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4564 lt_cv_path_LD=$ac_dir/$ac_prog
4565 # Check to see if the program is GNU ld. I'd rather use --version,
4566 # but apparently some variants of GNU ld only accept -v.
4567 # Break only if it was the GNU/non-GNU ld that we prefer.
4568 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4569 *GNU* | *'with BFD'*)
4570 test no != "$with_gnu_ld" && break
4571 ;;
4572 *)
4573 test yes != "$with_gnu_ld" && break
4574 ;;
4575 esac
4576 fi
4577 done
4578 IFS=$lt_save_ifs
4579 else
4580 lt_cv_path_LD=$LD # Let the user override the test with a path.
4581 fi
4582 fi
4583
4584 LD=$lt_cv_path_LD
4585 if test -n "$LD"; then
4586 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
4587 $as_echo "$LD" >&6; }
4588 else
4589 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4590 $as_echo "no" >&6; }
4591 fi
4592 test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
4593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
4594 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
4595 if ${lt_cv_prog_gnu_ld+:} false; then :
4596 $as_echo_n "(cached) " >&6
4597 else
4598 # I'd rather use --version here, but apparently some GNU lds only accept -v.
4599 case `$LD -v 2>&1 </dev/null` in
4600 *GNU* | *'with BFD'*)
4601 lt_cv_prog_gnu_ld=yes
4602 ;;
4603 *)
4604 lt_cv_prog_gnu_ld=no
4605 ;;
4606 esac
4607 fi
4608 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
4609 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
4610 with_gnu_ld=$lt_cv_prog_gnu_ld
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
4621 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
4622 if ${lt_cv_path_NM+:} false; then :
4623 $as_echo_n "(cached) " >&6
4624 else
4625 if test -n "$NM"; then
4626 # Let the user override the test.
4627 lt_cv_path_NM=$NM
4628 else
4629 lt_nm_to_check=${ac_tool_prefix}nm
4630 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4631 lt_nm_to_check="$lt_nm_to_check nm"
4632 fi
4633 for lt_tmp_nm in $lt_nm_to_check; do
4634 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
4635 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4636 IFS=$lt_save_ifs
4637 test -z "$ac_dir" && ac_dir=.
4638 tmp_nm=$ac_dir/$lt_tmp_nm
4639 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
4640 # Check to see if the nm accepts a BSD-compat flag.
4641 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
4642 # nm: unknown option "B" ignored
4643 # Tru64's nm complains that /dev/null is an invalid object file
4644 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
4645 case $build_os in
4646 mingw*) lt_bad_file=conftest.nm/nofile ;;
4647 *) lt_bad_file=/dev/null ;;
4648 esac
4649 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
4650 *$lt_bad_file* | *'Invalid file or object type'*)
4651 lt_cv_path_NM="$tmp_nm -B"
4652 break 2
4653 ;;
4654 *)
4655 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4656 */dev/null*)
4657 lt_cv_path_NM="$tmp_nm -p"
4658 break 2
4659 ;;
4660 *)
4661 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4662 continue # so that we can try to find one that supports BSD flags
4663 ;;
4664 esac
4665 ;;
4666 esac
4667 fi
4668 done
4669 IFS=$lt_save_ifs
4670 done
4671 : ${lt_cv_path_NM=no}
4672 fi
4673 fi
4674 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
4675 $as_echo "$lt_cv_path_NM" >&6; }
4676 if test no != "$lt_cv_path_NM"; then
4677 NM=$lt_cv_path_NM
4678 else
4679 # Didn't find any BSD compatible name lister, look for dumpbin.
4680 if test -n "$DUMPBIN"; then :
4681 # Let the user override the test.
4682 else
4683 if test -n "$ac_tool_prefix"; then
4684 for ac_prog in dumpbin "link -dump"
4685 do
4686 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4687 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4688 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4689 $as_echo_n "checking for $ac_word... " >&6; }
4690 if ${ac_cv_prog_DUMPBIN+:} false; then :
4691 $as_echo_n "(cached) " >&6
4692 else
4693 if test -n "$DUMPBIN"; then
4694 ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
4695 else
4696 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4697 for as_dir in $PATH
4698 do
4699 IFS=$as_save_IFS
4700 test -z "$as_dir" && as_dir=.
4701 for ac_exec_ext in '' $ac_executable_extensions; do
4702 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4703 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
4704 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4705 break 2
4706 fi
4707 done
4708 done
4709 IFS=$as_save_IFS
4710
4711 fi
4712 fi
4713 DUMPBIN=$ac_cv_prog_DUMPBIN
4714 if test -n "$DUMPBIN"; then
4715 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
4716 $as_echo "$DUMPBIN" >&6; }
4717 else
4718 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4719 $as_echo "no" >&6; }
4720 fi
4721
4722
4723 test -n "$DUMPBIN" && break
4724 done
4725 fi
4726 if test -z "$DUMPBIN"; then
4727 ac_ct_DUMPBIN=$DUMPBIN
4728 for ac_prog in dumpbin "link -dump"
4729 do
4730 # Extract the first word of "$ac_prog", so it can be a program name with args.
4731 set dummy $ac_prog; ac_word=$2
4732 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4733 $as_echo_n "checking for $ac_word... " >&6; }
4734 if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
4735 $as_echo_n "(cached) " >&6
4736 else
4737 if test -n "$ac_ct_DUMPBIN"; then
4738 ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
4739 else
4740 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4741 for as_dir in $PATH
4742 do
4743 IFS=$as_save_IFS
4744 test -z "$as_dir" && as_dir=.
4745 for ac_exec_ext in '' $ac_executable_extensions; do
4746 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4747 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
4748 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4749 break 2
4750 fi
4751 done
4752 done
4753 IFS=$as_save_IFS
4754
4755 fi
4756 fi
4757 ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
4758 if test -n "$ac_ct_DUMPBIN"; then
4759 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
4760 $as_echo "$ac_ct_DUMPBIN" >&6; }
4761 else
4762 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4763 $as_echo "no" >&6; }
4764 fi
4765
4766
4767 test -n "$ac_ct_DUMPBIN" && break
4768 done
4769
4770 if test "x$ac_ct_DUMPBIN" = x; then
4771 DUMPBIN=":"
4772 else
4773 case $cross_compiling:$ac_tool_warned in
4774 yes:)
4775 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4776 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4777 ac_tool_warned=yes ;;
4778 esac
4779 DUMPBIN=$ac_ct_DUMPBIN
4780 fi
4781 fi
4782
4783 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
4784 *COFF*)
4785 DUMPBIN="$DUMPBIN -symbols -headers"
4786 ;;
4787 *)
4788 DUMPBIN=:
4789 ;;
4790 esac
4791 fi
4792
4793 if test : != "$DUMPBIN"; then
4794 NM=$DUMPBIN
4795 fi
4796 fi
4797 test -z "$NM" && NM=nm
4798
4799
4800
4801
4802
4803
4804 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
4805 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
4806 if ${lt_cv_nm_interface+:} false; then :
4807 $as_echo_n "(cached) " >&6
4808 else
4809 lt_cv_nm_interface="BSD nm"
4810 echo "int some_variable = 0;" > conftest.$ac_ext
4811 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
4812 (eval "$ac_compile" 2>conftest.err)
4813 cat conftest.err >&5
4814 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4815 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4816 cat conftest.err >&5
4817 (eval echo "\"\$as_me:$LINENO: output\"" >&5)
4818 cat conftest.out >&5
4819 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4820 lt_cv_nm_interface="MS dumpbin"
4821 fi
4822 rm -f conftest*
4823 fi
4824 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
4825 $as_echo "$lt_cv_nm_interface" >&6; }
4826
4827 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
4828 $as_echo_n "checking whether ln -s works... " >&6; }
4829 LN_S=$as_ln_s
4830 if test "$LN_S" = "ln -s"; then
4831 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4832 $as_echo "yes" >&6; }
4833 else
4834 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
4835 $as_echo "no, using $LN_S" >&6; }
4836 fi
4837
4838 # find the maximum length of command line arguments
4839 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
4840 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
4841 if ${lt_cv_sys_max_cmd_len+:} false; then :
4842 $as_echo_n "(cached) " >&6
4843 else
4844 i=0
4845 teststring=ABCD
4846
4847 case $build_os in
4848 msdosdjgpp*)
4849 # On DJGPP, this test can blow up pretty badly due to problems in libc
4850 # (any single argument exceeding 2000 bytes causes a buffer overrun
4851 # during glob expansion). Even if it were fixed, the result of this
4852 # check would be larger than it should be.
4853 lt_cv_sys_max_cmd_len=12288; # 12K is about right
4854 ;;
4855
4856 gnu*)
4857 # Under GNU Hurd, this test is not required because there is
4858 # no limit to the length of command line arguments.
4859 # Libtool will interpret -1 as no limit whatsoever
4860 lt_cv_sys_max_cmd_len=-1;
4861 ;;
4862
4863 cygwin* | mingw* | cegcc*)
4864 # On Win9x/ME, this test blows up -- it succeeds, but takes
4865 # about 5 minutes as the teststring grows exponentially.
4866 # Worse, since 9x/ME are not pre-emptively multitasking,
4867 # you end up with a "frozen" computer, even though with patience
4868 # the test eventually succeeds (with a max line length of 256k).
4869 # Instead, let's just punt: use the minimum linelength reported by
4870 # all of the supported platforms: 8192 (on NT/2K/XP).
4871 lt_cv_sys_max_cmd_len=8192;
4872 ;;
4873
4874 mint*)
4875 # On MiNT this can take a long time and run out of memory.
4876 lt_cv_sys_max_cmd_len=8192;
4877 ;;
4878
4879 amigaos*)
4880 # On AmigaOS with pdksh, this test takes hours, literally.
4881 # So we just punt and use a minimum line length of 8192.
4882 lt_cv_sys_max_cmd_len=8192;
4883 ;;
4884
4885 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
4886 # This has been around since 386BSD, at least. Likely further.
4887 if test -x /sbin/sysctl; then
4888 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
4889 elif test -x /usr/sbin/sysctl; then
4890 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
4891 else
4892 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
4893 fi
4894 # And add a safety zone
4895 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4896 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4897 ;;
4898
4899 interix*)
4900 # We know the value 262144 and hardcode it with a safety zone (like BSD)
4901 lt_cv_sys_max_cmd_len=196608
4902 ;;
4903
4904 os2*)
4905 # The test takes a long time on OS/2.
4906 lt_cv_sys_max_cmd_len=8192
4907 ;;
4908
4909 osf*)
4910 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
4911 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
4912 # nice to cause kernel panics so lets avoid the loop below.
4913 # First set a reasonable default.
4914 lt_cv_sys_max_cmd_len=16384
4915 #
4916 if test -x /sbin/sysconfig; then
4917 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
4918 *1*) lt_cv_sys_max_cmd_len=-1 ;;
4919 esac
4920 fi
4921 ;;
4922 sco3.2v5*)
4923 lt_cv_sys_max_cmd_len=102400
4924 ;;
4925 sysv5* | sco5v6* | sysv4.2uw2*)
4926 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
4927 if test -n "$kargmax"; then
4928 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
4929 else
4930 lt_cv_sys_max_cmd_len=32768
4931 fi
4932 ;;
4933 *)
4934 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
4935 if test -n "$lt_cv_sys_max_cmd_len" && \
4936 test undefined != "$lt_cv_sys_max_cmd_len"; then
4937 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4938 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4939 else
4940 # Make teststring a little bigger before we do anything with it.
4941 # a 1K string should be a reasonable start.
4942 for i in 1 2 3 4 5 6 7 8; do
4943 teststring=$teststring$teststring
4944 done
4945 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
4946 # If test is not a shell built-in, we'll probably end up computing a
4947 # maximum length that is only half of the actual maximum length, but
4948 # we can't tell.
4949 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
4950 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
4951 test 17 != "$i" # 1/2 MB should be enough
4952 do
4953 i=`expr $i + 1`
4954 teststring=$teststring$teststring
4955 done
4956 # Only check the string length outside the loop.
4957 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
4958 teststring=
4959 # Add a significant safety factor because C++ compilers can tack on
4960 # massive amounts of additional arguments before passing them to the
4961 # linker. It appears as though 1/2 is a usable value.
4962 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
4963 fi
4964 ;;
4965 esac
4966
4967 fi
4968
4969 if test -n "$lt_cv_sys_max_cmd_len"; then
4970 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
4971 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
4972 else
4973 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
4974 $as_echo "none" >&6; }
4975 fi
4976 max_cmd_len=$lt_cv_sys_max_cmd_len
4977
4978
4979
4980
4981
4982
4983 : ${CP="cp -f"}
4984 : ${MV="mv -f"}
4985 : ${RM="rm -f"}
4986
4987 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
4988 lt_unset=unset
4989 else
4990 lt_unset=false
4991 fi
4992
4993
4994
4995
4996
4997 # test EBCDIC or ASCII
4998 case `echo X|tr X '\101'` in
4999 A) # ASCII based system
5000 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
5001 lt_SP2NL='tr \040 \012'
5002 lt_NL2SP='tr \015\012 \040\040'
5003 ;;
5004 *) # EBCDIC based system
5005 lt_SP2NL='tr \100 \n'
5006 lt_NL2SP='tr \r\n \100\100'
5007 ;;
5008 esac
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
5019 $as_echo_n "checking how to convert $build file names to $host format... " >&6; }
5020 if ${lt_cv_to_host_file_cmd+:} false; then :
5021 $as_echo_n "(cached) " >&6
5022 else
5023 case $host in
5024 *-*-mingw* )
5025 case $build in
5026 *-*-mingw* ) # actually msys
5027 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
5028 ;;
5029 *-*-cygwin* )
5030 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
5031 ;;
5032 * ) # otherwise, assume *nix
5033 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
5034 ;;
5035 esac
5036 ;;
5037 *-*-cygwin* )
5038 case $build in
5039 *-*-mingw* ) # actually msys
5040 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
5041 ;;
5042 *-*-cygwin* )
5043 lt_cv_to_host_file_cmd=func_convert_file_noop
5044 ;;
5045 * ) # otherwise, assume *nix
5046 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
5047 ;;
5048 esac
5049 ;;
5050 * ) # unhandled hosts (and "normal" native builds)
5051 lt_cv_to_host_file_cmd=func_convert_file_noop
5052 ;;
5053 esac
5054
5055 fi
5056
5057 to_host_file_cmd=$lt_cv_to_host_file_cmd
5058 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
5059 $as_echo "$lt_cv_to_host_file_cmd" >&6; }
5060
5061
5062
5063
5064
5065 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
5066 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
5067 if ${lt_cv_to_tool_file_cmd+:} false; then :
5068 $as_echo_n "(cached) " >&6
5069 else
5070 #assume ordinary cross tools, or native build.
5071 lt_cv_to_tool_file_cmd=func_convert_file_noop
5072 case $host in
5073 *-*-mingw* )
5074 case $build in
5075 *-*-mingw* ) # actually msys
5076 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
5077 ;;
5078 esac
5079 ;;
5080 esac
5081
5082 fi
5083
5084 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
5085 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
5086 $as_echo "$lt_cv_to_tool_file_cmd" >&6; }
5087
5088
5089
5090
5091
5092 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
5093 $as_echo_n "checking for $LD option to reload object files... " >&6; }
5094 if ${lt_cv_ld_reload_flag+:} false; then :
5095 $as_echo_n "(cached) " >&6
5096 else
5097 lt_cv_ld_reload_flag='-r'
5098 fi
5099 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
5100 $as_echo "$lt_cv_ld_reload_flag" >&6; }
5101 reload_flag=$lt_cv_ld_reload_flag
5102 case $reload_flag in
5103 "" | " "*) ;;
5104 *) reload_flag=" $reload_flag" ;;
5105 esac
5106 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5107 case $host_os in
5108 cygwin* | mingw* | pw32* | cegcc*)
5109 if test yes != "$GCC"; then
5110 reload_cmds=false
5111 fi
5112 ;;
5113 darwin*)
5114 if test yes = "$GCC"; then
5115 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
5116 else
5117 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5118 fi
5119 ;;
5120 esac
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130 if test -n "$ac_tool_prefix"; then
5131 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
5132 set dummy ${ac_tool_prefix}objdump; ac_word=$2
5133 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5134 $as_echo_n "checking for $ac_word... " >&6; }
5135 if ${ac_cv_prog_OBJDUMP+:} false; then :
5136 $as_echo_n "(cached) " >&6
5137 else
5138 if test -n "$OBJDUMP"; then
5139 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
5140 else
5141 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5142 for as_dir in $PATH
5143 do
5144 IFS=$as_save_IFS
5145 test -z "$as_dir" && as_dir=.
5146 for ac_exec_ext in '' $ac_executable_extensions; do
5147 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5148 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
5149 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5150 break 2
5151 fi
5152 done
5153 done
5154 IFS=$as_save_IFS
5155
5156 fi
5157 fi
5158 OBJDUMP=$ac_cv_prog_OBJDUMP
5159 if test -n "$OBJDUMP"; then
5160 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
5161 $as_echo "$OBJDUMP" >&6; }
5162 else
5163 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5164 $as_echo "no" >&6; }
5165 fi
5166
5167
5168 fi
5169 if test -z "$ac_cv_prog_OBJDUMP"; then
5170 ac_ct_OBJDUMP=$OBJDUMP
5171 # Extract the first word of "objdump", so it can be a program name with args.
5172 set dummy objdump; ac_word=$2
5173 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5174 $as_echo_n "checking for $ac_word... " >&6; }
5175 if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
5176 $as_echo_n "(cached) " >&6
5177 else
5178 if test -n "$ac_ct_OBJDUMP"; then
5179 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
5180 else
5181 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5182 for as_dir in $PATH
5183 do
5184 IFS=$as_save_IFS
5185 test -z "$as_dir" && as_dir=.
5186 for ac_exec_ext in '' $ac_executable_extensions; do
5187 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5188 ac_cv_prog_ac_ct_OBJDUMP="objdump"
5189 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5190 break 2
5191 fi
5192 done
5193 done
5194 IFS=$as_save_IFS
5195
5196 fi
5197 fi
5198 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
5199 if test -n "$ac_ct_OBJDUMP"; then
5200 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
5201 $as_echo "$ac_ct_OBJDUMP" >&6; }
5202 else
5203 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5204 $as_echo "no" >&6; }
5205 fi
5206
5207 if test "x$ac_ct_OBJDUMP" = x; then
5208 OBJDUMP="false"
5209 else
5210 case $cross_compiling:$ac_tool_warned in
5211 yes:)
5212 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5213 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5214 ac_tool_warned=yes ;;
5215 esac
5216 OBJDUMP=$ac_ct_OBJDUMP
5217 fi
5218 else
5219 OBJDUMP="$ac_cv_prog_OBJDUMP"
5220 fi
5221
5222 test -z "$OBJDUMP" && OBJDUMP=objdump
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
5233 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
5234 if ${lt_cv_deplibs_check_method+:} false; then :
5235 $as_echo_n "(cached) " >&6
5236 else
5237 lt_cv_file_magic_cmd='$MAGIC_CMD'
5238 lt_cv_file_magic_test_file=
5239 lt_cv_deplibs_check_method='unknown'
5240 # Need to set the preceding variable on all platforms that support
5241 # interlibrary dependencies.
5242 # 'none' -- dependencies not supported.
5243 # 'unknown' -- same as none, but documents that we really don't know.
5244 # 'pass_all' -- all dependencies passed with no checks.
5245 # 'test_compile' -- check by making test program.
5246 # 'file_magic [[regex]]' -- check by looking for files in library path
5247 # that responds to the $file_magic_cmd with a given extended regex.
5248 # If you have 'file' or equivalent on your system and you're not sure
5249 # whether 'pass_all' will *always* work, you probably want this one.
5250
5251 case $host_os in
5252 aix[4-9]*)
5253 lt_cv_deplibs_check_method=pass_all
5254 ;;
5255
5256 beos*)
5257 lt_cv_deplibs_check_method=pass_all
5258 ;;
5259
5260 bsdi[45]*)
5261 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
5262 lt_cv_file_magic_cmd='/usr/bin/file -L'
5263 lt_cv_file_magic_test_file=/shlib/libc.so
5264 ;;
5265
5266 cygwin*)
5267 # func_win32_libid is a shell function defined in ltmain.sh
5268 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5269 lt_cv_file_magic_cmd='func_win32_libid'
5270 ;;
5271
5272 mingw* | pw32*)
5273 # Base MSYS/MinGW do not provide the 'file' command needed by
5274 # func_win32_libid shell function, so use a weaker test based on 'objdump',
5275 # unless we find 'file', for example because we are cross-compiling.
5276 if ( file / ) >/dev/null 2>&1; then
5277 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5278 lt_cv_file_magic_cmd='func_win32_libid'
5279 else
5280 # Keep this pattern in sync with the one in func_win32_libid.
5281 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
5282 lt_cv_file_magic_cmd='$OBJDUMP -f'
5283 fi
5284 ;;
5285
5286 cegcc*)
5287 # use the weaker test based on 'objdump'. See mingw*.
5288 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5289 lt_cv_file_magic_cmd='$OBJDUMP -f'
5290 ;;
5291
5292 darwin* | rhapsody*)
5293 lt_cv_deplibs_check_method=pass_all
5294 ;;
5295
5296 freebsd* | dragonfly*)
5297 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5298 case $host_cpu in
5299 i*86 )
5300 # Not sure whether the presence of OpenBSD here was a mistake.
5301 # Let's accept both of them until this is cleared up.
5302 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
5303 lt_cv_file_magic_cmd=/usr/bin/file
5304 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5305 ;;
5306 esac
5307 else
5308 lt_cv_deplibs_check_method=pass_all
5309 fi
5310 ;;
5311
5312 haiku*)
5313 lt_cv_deplibs_check_method=pass_all
5314 ;;
5315
5316 hpux10.20* | hpux11*)
5317 lt_cv_file_magic_cmd=/usr/bin/file
5318 case $host_cpu in
5319 ia64*)
5320 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
5321 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5322 ;;
5323 hppa*64*)
5324 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
5325 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5326 ;;
5327 *)
5328 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
5329 lt_cv_file_magic_test_file=/usr/lib/libc.sl
5330 ;;
5331 esac
5332 ;;
5333
5334 interix[3-9]*)
5335 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5336 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
5337 ;;
5338
5339 irix5* | irix6* | nonstopux*)
5340 case $LD in
5341 *-32|*"-32 ") libmagic=32-bit;;
5342 *-n32|*"-n32 ") libmagic=N32;;
5343 *-64|*"-64 ") libmagic=64-bit;;
5344 *) libmagic=never-match;;
5345 esac
5346 lt_cv_deplibs_check_method=pass_all
5347 ;;
5348
5349 # This must be glibc/ELF.
5350 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
5351 lt_cv_deplibs_check_method=pass_all
5352 ;;
5353
5354 netbsd*)
5355 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5356 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5357 else
5358 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
5359 fi
5360 ;;
5361
5362 newos6*)
5363 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
5364 lt_cv_file_magic_cmd=/usr/bin/file
5365 lt_cv_file_magic_test_file=/usr/lib/libnls.so
5366 ;;
5367
5368 *nto* | *qnx*)
5369 lt_cv_deplibs_check_method=pass_all
5370 ;;
5371
5372 openbsd* | bitrig*)
5373 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5374 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
5375 else
5376 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5377 fi
5378 ;;
5379
5380 osf3* | osf4* | osf5*)
5381 lt_cv_deplibs_check_method=pass_all
5382 ;;
5383
5384 rdos*)
5385 lt_cv_deplibs_check_method=pass_all
5386 ;;
5387
5388 solaris*)
5389 lt_cv_deplibs_check_method=pass_all
5390 ;;
5391
5392 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5393 lt_cv_deplibs_check_method=pass_all
5394 ;;
5395
5396 sysv4 | sysv4.3*)
5397 case $host_vendor in
5398 motorola)
5399 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
5400 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5401 ;;
5402 ncr)
5403 lt_cv_deplibs_check_method=pass_all
5404 ;;
5405 sequent)
5406 lt_cv_file_magic_cmd='/bin/file'
5407 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
5408 ;;
5409 sni)
5410 lt_cv_file_magic_cmd='/bin/file'
5411 lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
5412 lt_cv_file_magic_test_file=/lib/libc.so
5413 ;;
5414 siemens)
5415 lt_cv_deplibs_check_method=pass_all
5416 ;;
5417 pc)
5418 lt_cv_deplibs_check_method=pass_all
5419 ;;
5420 esac
5421 ;;
5422
5423 tpf*)
5424 lt_cv_deplibs_check_method=pass_all
5425 ;;
5426 os2*)
5427 lt_cv_deplibs_check_method=pass_all
5428 ;;
5429 esac
5430
5431 fi
5432 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
5433 $as_echo "$lt_cv_deplibs_check_method" >&6; }
5434
5435 file_magic_glob=
5436 want_nocaseglob=no
5437 if test "$build" = "$host"; then
5438 case $host_os in
5439 mingw* | pw32*)
5440 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
5441 want_nocaseglob=yes
5442 else
5443 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
5444 fi
5445 ;;
5446 esac
5447 fi
5448
5449 file_magic_cmd=$lt_cv_file_magic_cmd
5450 deplibs_check_method=$lt_cv_deplibs_check_method
5451 test -z "$deplibs_check_method" && deplibs_check_method=unknown
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474 if test -n "$ac_tool_prefix"; then
5475 # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
5476 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
5477 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5478 $as_echo_n "checking for $ac_word... " >&6; }
5479 if ${ac_cv_prog_DLLTOOL+:} false; then :
5480 $as_echo_n "(cached) " >&6
5481 else
5482 if test -n "$DLLTOOL"; then
5483 ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
5484 else
5485 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5486 for as_dir in $PATH
5487 do
5488 IFS=$as_save_IFS
5489 test -z "$as_dir" && as_dir=.
5490 for ac_exec_ext in '' $ac_executable_extensions; do
5491 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5492 ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
5493 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5494 break 2
5495 fi
5496 done
5497 done
5498 IFS=$as_save_IFS
5499
5500 fi
5501 fi
5502 DLLTOOL=$ac_cv_prog_DLLTOOL
5503 if test -n "$DLLTOOL"; then
5504 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
5505 $as_echo "$DLLTOOL" >&6; }
5506 else
5507 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5508 $as_echo "no" >&6; }
5509 fi
5510
5511
5512 fi
5513 if test -z "$ac_cv_prog_DLLTOOL"; then
5514 ac_ct_DLLTOOL=$DLLTOOL
5515 # Extract the first word of "dlltool", so it can be a program name with args.
5516 set dummy dlltool; ac_word=$2
5517 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5518 $as_echo_n "checking for $ac_word... " >&6; }
5519 if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
5520 $as_echo_n "(cached) " >&6
5521 else
5522 if test -n "$ac_ct_DLLTOOL"; then
5523 ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
5524 else
5525 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5526 for as_dir in $PATH
5527 do
5528 IFS=$as_save_IFS
5529 test -z "$as_dir" && as_dir=.
5530 for ac_exec_ext in '' $ac_executable_extensions; do
5531 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5532 ac_cv_prog_ac_ct_DLLTOOL="dlltool"
5533 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5534 break 2
5535 fi
5536 done
5537 done
5538 IFS=$as_save_IFS
5539
5540 fi
5541 fi
5542 ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
5543 if test -n "$ac_ct_DLLTOOL"; then
5544 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
5545 $as_echo "$ac_ct_DLLTOOL" >&6; }
5546 else
5547 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5548 $as_echo "no" >&6; }
5549 fi
5550
5551 if test "x$ac_ct_DLLTOOL" = x; then
5552 DLLTOOL="false"
5553 else
5554 case $cross_compiling:$ac_tool_warned in
5555 yes:)
5556 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5557 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5558 ac_tool_warned=yes ;;
5559 esac
5560 DLLTOOL=$ac_ct_DLLTOOL
5561 fi
5562 else
5563 DLLTOOL="$ac_cv_prog_DLLTOOL"
5564 fi
5565
5566 test -z "$DLLTOOL" && DLLTOOL=dlltool
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
5578 $as_echo_n "checking how to associate runtime and link libraries... " >&6; }
5579 if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
5580 $as_echo_n "(cached) " >&6
5581 else
5582 lt_cv_sharedlib_from_linklib_cmd='unknown'
5583
5584 case $host_os in
5585 cygwin* | mingw* | pw32* | cegcc*)
5586 # two different shell functions defined in ltmain.sh;
5587 # decide which one to use based on capabilities of $DLLTOOL
5588 case `$DLLTOOL --help 2>&1` in
5589 *--identify-strict*)
5590 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
5591 ;;
5592 *)
5593 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
5594 ;;
5595 esac
5596 ;;
5597 *)
5598 # fallback: assume linklib IS sharedlib
5599 lt_cv_sharedlib_from_linklib_cmd=$ECHO
5600 ;;
5601 esac
5602
5603 fi
5604 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
5605 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
5606 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
5607 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
5608
5609
5610
5611
5612
5613
5614
5615 if test -n "$ac_tool_prefix"; then
5616 for ac_prog in ar
5617 do
5618 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5619 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5620 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5621 $as_echo_n "checking for $ac_word... " >&6; }
5622 if ${ac_cv_prog_AR+:} false; then :
5623 $as_echo_n "(cached) " >&6
5624 else
5625 if test -n "$AR"; then
5626 ac_cv_prog_AR="$AR" # Let the user override the test.
5627 else
5628 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5629 for as_dir in $PATH
5630 do
5631 IFS=$as_save_IFS
5632 test -z "$as_dir" && as_dir=.
5633 for ac_exec_ext in '' $ac_executable_extensions; do
5634 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5635 ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
5636 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5637 break 2
5638 fi
5639 done
5640 done
5641 IFS=$as_save_IFS
5642
5643 fi
5644 fi
5645 AR=$ac_cv_prog_AR
5646 if test -n "$AR"; then
5647 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5648 $as_echo "$AR" >&6; }
5649 else
5650 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5651 $as_echo "no" >&6; }
5652 fi
5653
5654
5655 test -n "$AR" && break
5656 done
5657 fi
5658 if test -z "$AR"; then
5659 ac_ct_AR=$AR
5660 for ac_prog in ar
5661 do
5662 # Extract the first word of "$ac_prog", so it can be a program name with args.
5663 set dummy $ac_prog; ac_word=$2
5664 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5665 $as_echo_n "checking for $ac_word... " >&6; }
5666 if ${ac_cv_prog_ac_ct_AR+:} false; then :
5667 $as_echo_n "(cached) " >&6
5668 else
5669 if test -n "$ac_ct_AR"; then
5670 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5671 else
5672 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5673 for as_dir in $PATH
5674 do
5675 IFS=$as_save_IFS
5676 test -z "$as_dir" && as_dir=.
5677 for ac_exec_ext in '' $ac_executable_extensions; do
5678 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5679 ac_cv_prog_ac_ct_AR="$ac_prog"
5680 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5681 break 2
5682 fi
5683 done
5684 done
5685 IFS=$as_save_IFS
5686
5687 fi
5688 fi
5689 ac_ct_AR=$ac_cv_prog_ac_ct_AR
5690 if test -n "$ac_ct_AR"; then
5691 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5692 $as_echo "$ac_ct_AR" >&6; }
5693 else
5694 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5695 $as_echo "no" >&6; }
5696 fi
5697
5698
5699 test -n "$ac_ct_AR" && break
5700 done
5701
5702 if test "x$ac_ct_AR" = x; then
5703 AR="false"
5704 else
5705 case $cross_compiling:$ac_tool_warned in
5706 yes:)
5707 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5708 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5709 ac_tool_warned=yes ;;
5710 esac
5711 AR=$ac_ct_AR
5712 fi
5713 fi
5714
5715 : ${AR=ar}
5716 : ${AR_FLAGS=cru}
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
5729 $as_echo_n "checking for archiver @FILE support... " >&6; }
5730 if ${lt_cv_ar_at_file+:} false; then :
5731 $as_echo_n "(cached) " >&6
5732 else
5733 lt_cv_ar_at_file=no
5734 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5735 /* end confdefs.h. */
5736
5737 int
5738 main ()
5739 {
5740
5741 ;
5742 return 0;
5743 }
5744 _ACEOF
5745 if ac_fn_c_try_compile "$LINENO"; then :
5746 echo conftest.$ac_objext > conftest.lst
5747 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
5748 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
5749 (eval $lt_ar_try) 2>&5
5750 ac_status=$?
5751 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5752 test $ac_status = 0; }
5753 if test 0 -eq "$ac_status"; then
5754 # Ensure the archiver fails upon bogus file names.
5755 rm -f conftest.$ac_objext libconftest.a
5756 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
5757 (eval $lt_ar_try) 2>&5
5758 ac_status=$?
5759 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5760 test $ac_status = 0; }
5761 if test 0 -ne "$ac_status"; then
5762 lt_cv_ar_at_file=@
5763 fi
5764 fi
5765 rm -f conftest.* libconftest.a
5766
5767 fi
5768 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
5769
5770 fi
5771 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
5772 $as_echo "$lt_cv_ar_at_file" >&6; }
5773
5774 if test no = "$lt_cv_ar_at_file"; then
5775 archiver_list_spec=
5776 else
5777 archiver_list_spec=$lt_cv_ar_at_file
5778 fi
5779
5780
5781
5782
5783
5784
5785
5786 if test -n "$ac_tool_prefix"; then
5787 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
5788 set dummy ${ac_tool_prefix}strip; ac_word=$2
5789 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5790 $as_echo_n "checking for $ac_word... " >&6; }
5791 if ${ac_cv_prog_STRIP+:} false; then :
5792 $as_echo_n "(cached) " >&6
5793 else
5794 if test -n "$STRIP"; then
5795 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
5796 else
5797 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5798 for as_dir in $PATH
5799 do
5800 IFS=$as_save_IFS
5801 test -z "$as_dir" && as_dir=.
5802 for ac_exec_ext in '' $ac_executable_extensions; do
5803 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5804 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
5805 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5806 break 2
5807 fi
5808 done
5809 done
5810 IFS=$as_save_IFS
5811
5812 fi
5813 fi
5814 STRIP=$ac_cv_prog_STRIP
5815 if test -n "$STRIP"; then
5816 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
5817 $as_echo "$STRIP" >&6; }
5818 else
5819 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5820 $as_echo "no" >&6; }
5821 fi
5822
5823
5824 fi
5825 if test -z "$ac_cv_prog_STRIP"; then
5826 ac_ct_STRIP=$STRIP
5827 # Extract the first word of "strip", so it can be a program name with args.
5828 set dummy strip; ac_word=$2
5829 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5830 $as_echo_n "checking for $ac_word... " >&6; }
5831 if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
5832 $as_echo_n "(cached) " >&6
5833 else
5834 if test -n "$ac_ct_STRIP"; then
5835 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
5836 else
5837 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5838 for as_dir in $PATH
5839 do
5840 IFS=$as_save_IFS
5841 test -z "$as_dir" && as_dir=.
5842 for ac_exec_ext in '' $ac_executable_extensions; do
5843 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5844 ac_cv_prog_ac_ct_STRIP="strip"
5845 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5846 break 2
5847 fi
5848 done
5849 done
5850 IFS=$as_save_IFS
5851
5852 fi
5853 fi
5854 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
5855 if test -n "$ac_ct_STRIP"; then
5856 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
5857 $as_echo "$ac_ct_STRIP" >&6; }
5858 else
5859 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5860 $as_echo "no" >&6; }
5861 fi
5862
5863 if test "x$ac_ct_STRIP" = x; then
5864 STRIP=":"
5865 else
5866 case $cross_compiling:$ac_tool_warned in
5867 yes:)
5868 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5869 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5870 ac_tool_warned=yes ;;
5871 esac
5872 STRIP=$ac_ct_STRIP
5873 fi
5874 else
5875 STRIP="$ac_cv_prog_STRIP"
5876 fi
5877
5878 test -z "$STRIP" && STRIP=:
5879
5880
5881
5882
5883
5884
5885 if test -n "$ac_tool_prefix"; then
5886 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5887 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5888 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5889 $as_echo_n "checking for $ac_word... " >&6; }
5890 if ${ac_cv_prog_RANLIB+:} false; then :
5891 $as_echo_n "(cached) " >&6
5892 else
5893 if test -n "$RANLIB"; then
5894 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5895 else
5896 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5897 for as_dir in $PATH
5898 do
5899 IFS=$as_save_IFS
5900 test -z "$as_dir" && as_dir=.
5901 for ac_exec_ext in '' $ac_executable_extensions; do
5902 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5903 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5904 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5905 break 2
5906 fi
5907 done
5908 done
5909 IFS=$as_save_IFS
5910
5911 fi
5912 fi
5913 RANLIB=$ac_cv_prog_RANLIB
5914 if test -n "$RANLIB"; then
5915 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5916 $as_echo "$RANLIB" >&6; }
5917 else
5918 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5919 $as_echo "no" >&6; }
5920 fi
5921
5922
5923 fi
5924 if test -z "$ac_cv_prog_RANLIB"; then
5925 ac_ct_RANLIB=$RANLIB
5926 # Extract the first word of "ranlib", so it can be a program name with args.
5927 set dummy ranlib; ac_word=$2
5928 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5929 $as_echo_n "checking for $ac_word... " >&6; }
5930 if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
5931 $as_echo_n "(cached) " >&6
5932 else
5933 if test -n "$ac_ct_RANLIB"; then
5934 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
5935 else
5936 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5937 for as_dir in $PATH
5938 do
5939 IFS=$as_save_IFS
5940 test -z "$as_dir" && as_dir=.
5941 for ac_exec_ext in '' $ac_executable_extensions; do
5942 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5943 ac_cv_prog_ac_ct_RANLIB="ranlib"
5944 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5945 break 2
5946 fi
5947 done
5948 done
5949 IFS=$as_save_IFS
5950
5951 fi
5952 fi
5953 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5954 if test -n "$ac_ct_RANLIB"; then
5955 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5956 $as_echo "$ac_ct_RANLIB" >&6; }
5957 else
5958 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5959 $as_echo "no" >&6; }
5960 fi
5961
5962 if test "x$ac_ct_RANLIB" = x; then
5963 RANLIB=":"
5964 else
5965 case $cross_compiling:$ac_tool_warned in
5966 yes:)
5967 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5968 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5969 ac_tool_warned=yes ;;
5970 esac
5971 RANLIB=$ac_ct_RANLIB
5972 fi
5973 else
5974 RANLIB="$ac_cv_prog_RANLIB"
5975 fi
5976
5977 test -z "$RANLIB" && RANLIB=:
5978
5979
5980
5981
5982
5983
5984 # Determine commands to create old-style static archives.
5985 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
5986 old_postinstall_cmds='chmod 644 $oldlib'
5987 old_postuninstall_cmds=
5988
5989 if test -n "$RANLIB"; then
5990 case $host_os in
5991 bitrig* | openbsd*)
5992 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
5993 ;;
5994 *)
5995 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
5996 ;;
5997 esac
5998 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
5999 fi
6000
6001 case $host_os in
6002 darwin*)
6003 lock_old_archive_extraction=yes ;;
6004 *)
6005 lock_old_archive_extraction=no ;;
6006 esac
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046 # If no C compiler was specified, use CC.
6047 LTCC=${LTCC-"$CC"}
6048
6049 # If no C compiler flags were specified, use CFLAGS.
6050 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
6051
6052 # Allow CC to be a program name with arguments.
6053 compiler=$CC
6054
6055
6056 # Check for command to grab the raw symbol name followed by C symbol from nm.
6057 { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
6058 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
6059 if ${lt_cv_sys_global_symbol_pipe+:} false; then :
6060 $as_echo_n "(cached) " >&6
6061 else
6062
6063 # These are sane defaults that work on at least a few old systems.
6064 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
6065
6066 # Character class describing NM global symbol codes.
6067 symcode='[BCDEGRST]'
6068
6069 # Regexp to match symbols that can be accessed directly from C.
6070 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
6071
6072 # Define system-specific variables.
6073 case $host_os in
6074 aix*)
6075 symcode='[BCDT]'
6076 ;;
6077 cygwin* | mingw* | pw32* | cegcc*)
6078 symcode='[ABCDGISTW]'
6079 ;;
6080 hpux*)
6081 if test ia64 = "$host_cpu"; then
6082 symcode='[ABCDEGRST]'
6083 fi
6084 ;;
6085 irix* | nonstopux*)
6086 symcode='[BCDEGRST]'
6087 ;;
6088 osf*)
6089 symcode='[BCDEGQRST]'
6090 ;;
6091 solaris*)
6092 symcode='[BDRT]'
6093 ;;
6094 sco3.2v5*)
6095 symcode='[DT]'
6096 ;;
6097 sysv4.2uw2*)
6098 symcode='[DT]'
6099 ;;
6100 sysv5* | sco5v6* | unixware* | OpenUNIX*)
6101 symcode='[ABDT]'
6102 ;;
6103 sysv4)
6104 symcode='[DFNSTU]'
6105 ;;
6106 esac
6107
6108 # If we're using GNU nm, then use its standard symbol codes.
6109 case `$NM -V 2>&1` in
6110 *GNU* | *'with BFD'*)
6111 symcode='[ABCDGIRSTW]' ;;
6112 esac
6113
6114 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6115 # Gets list of data symbols to import.
6116 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
6117 # Adjust the below global symbol transforms to fixup imported variables.
6118 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
6119 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
6120 lt_c_name_lib_hook="\
6121 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
6122 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
6123 else
6124 # Disable hooks by default.
6125 lt_cv_sys_global_symbol_to_import=
6126 lt_cdecl_hook=
6127 lt_c_name_hook=
6128 lt_c_name_lib_hook=
6129 fi
6130
6131 # Transform an extracted symbol line into a proper C declaration.
6132 # Some systems (esp. on ia64) link data and code symbols differently,
6133 # so use this general approach.
6134 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
6135 $lt_cdecl_hook\
6136 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
6137 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
6138
6139 # Transform an extracted symbol line into symbol name and symbol address
6140 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
6141 $lt_c_name_hook\
6142 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
6143 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
6144
6145 # Transform an extracted symbol line into symbol name with lib prefix and
6146 # symbol address.
6147 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
6148 $lt_c_name_lib_hook\
6149 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
6150 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
6151 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
6152
6153 # Handle CRLF in mingw tool chain
6154 opt_cr=
6155 case $build_os in
6156 mingw*)
6157 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
6158 ;;
6159 esac
6160
6161 # Try without a prefix underscore, then with it.
6162 for ac_symprfx in "" "_"; do
6163
6164 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
6165 symxfrm="\\1 $ac_symprfx\\2 \\2"
6166
6167 # Write the raw and C identifiers.
6168 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6169 # Fake it for dumpbin and say T for any non-static function,
6170 # D for any global variable and I for any imported variable.
6171 # Also find C++ and __fastcall symbols from MSVC++,
6172 # which start with @ or ?.
6173 lt_cv_sys_global_symbol_pipe="$AWK '"\
6174 " {last_section=section; section=\$ 3};"\
6175 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
6176 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
6177 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
6178 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
6179 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
6180 " \$ 0!~/External *\|/{next};"\
6181 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
6182 " {if(hide[section]) next};"\
6183 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
6184 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
6185 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
6186 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
6187 " ' prfx=^$ac_symprfx"
6188 else
6189 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
6190 fi
6191 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
6192
6193 # Check to see that the pipe works correctly.
6194 pipe_works=no
6195
6196 rm -f conftest*
6197 cat > conftest.$ac_ext <<_LT_EOF
6198 #ifdef __cplusplus
6199 extern "C" {
6200 #endif
6201 char nm_test_var;
6202 void nm_test_func(void);
6203 void nm_test_func(void){}
6204 #ifdef __cplusplus
6205 }
6206 #endif
6207 int main(){nm_test_var='a';nm_test_func();return(0);}
6208 _LT_EOF
6209
6210 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6211 (eval $ac_compile) 2>&5
6212 ac_status=$?
6213 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6214 test $ac_status = 0; }; then
6215 # Now try to grab the symbols.
6216 nlist=conftest.nm
6217 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
6218 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
6219 ac_status=$?
6220 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6221 test $ac_status = 0; } && test -s "$nlist"; then
6222 # Try sorting and uniquifying the output.
6223 if sort "$nlist" | uniq > "$nlist"T; then
6224 mv -f "$nlist"T "$nlist"
6225 else
6226 rm -f "$nlist"T
6227 fi
6228
6229 # Make sure that we snagged all the symbols we need.
6230 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
6231 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
6232 cat <<_LT_EOF > conftest.$ac_ext
6233 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
6234 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
6235 /* DATA imports from DLLs on WIN32 can't be const, because runtime
6236 relocations are performed -- see ld's documentation on pseudo-relocs. */
6237 # define LT_DLSYM_CONST
6238 #elif defined __osf__
6239 /* This system does not cope well with relocations in const data. */
6240 # define LT_DLSYM_CONST
6241 #else
6242 # define LT_DLSYM_CONST const
6243 #endif
6244
6245 #ifdef __cplusplus
6246 extern "C" {
6247 #endif
6248
6249 _LT_EOF
6250 # Now generate the symbol file.
6251 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
6252
6253 cat <<_LT_EOF >> conftest.$ac_ext
6254
6255 /* The mapping between symbol names and symbols. */
6256 LT_DLSYM_CONST struct {
6257 const char *name;
6258 void *address;
6259 }
6260 lt__PROGRAM__LTX_preloaded_symbols[] =
6261 {
6262 { "@PROGRAM@", (void *) 0 },
6263 _LT_EOF
6264 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
6265 cat <<\_LT_EOF >> conftest.$ac_ext
6266 {0, (void *) 0}
6267 };
6268
6269 /* This works around a problem in FreeBSD linker */
6270 #ifdef FREEBSD_WORKAROUND
6271 static const void *lt_preloaded_setup() {
6272 return lt__PROGRAM__LTX_preloaded_symbols;
6273 }
6274 #endif
6275
6276 #ifdef __cplusplus
6277 }
6278 #endif
6279 _LT_EOF
6280 # Now try linking the two files.
6281 mv conftest.$ac_objext conftstm.$ac_objext
6282 lt_globsym_save_LIBS=$LIBS
6283 lt_globsym_save_CFLAGS=$CFLAGS
6284 LIBS=conftstm.$ac_objext
6285 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
6286 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
6287 (eval $ac_link) 2>&5
6288 ac_status=$?
6289 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6290 test $ac_status = 0; } && test -s conftest$ac_exeext; then
6291 pipe_works=yes
6292 fi
6293 LIBS=$lt_globsym_save_LIBS
6294 CFLAGS=$lt_globsym_save_CFLAGS
6295 else
6296 echo "cannot find nm_test_func in $nlist" >&5
6297 fi
6298 else
6299 echo "cannot find nm_test_var in $nlist" >&5
6300 fi
6301 else
6302 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
6303 fi
6304 else
6305 echo "$progname: failed program was:" >&5
6306 cat conftest.$ac_ext >&5
6307 fi
6308 rm -rf conftest* conftst*
6309
6310 # Do not use the global_symbol_pipe unless it works.
6311 if test yes = "$pipe_works"; then
6312 break
6313 else
6314 lt_cv_sys_global_symbol_pipe=
6315 fi
6316 done
6317
6318 fi
6319
6320 if test -z "$lt_cv_sys_global_symbol_pipe"; then
6321 lt_cv_sys_global_symbol_to_cdecl=
6322 fi
6323 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
6324 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
6325 $as_echo "failed" >&6; }
6326 else
6327 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
6328 $as_echo "ok" >&6; }
6329 fi
6330
6331 # Response file support.
6332 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6333 nm_file_list_spec='@'
6334 elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
6335 nm_file_list_spec='@'
6336 fi
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
6375 $as_echo_n "checking for sysroot... " >&6; }
6376
6377 # Check whether --with-sysroot was given.
6378 if test "${with_sysroot+set}" = set; then :
6379 withval=$with_sysroot;
6380 else
6381 with_sysroot=no
6382 fi
6383
6384
6385 lt_sysroot=
6386 case $with_sysroot in #(
6387 yes)
6388 if test yes = "$GCC"; then
6389 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
6390 fi
6391 ;; #(
6392 /*)
6393 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
6394 ;; #(
6395 no|'')
6396 ;; #(
6397 *)
6398 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
6399 $as_echo "$with_sysroot" >&6; }
6400 as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
6401 ;;
6402 esac
6403
6404 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
6405 $as_echo "${lt_sysroot:-no}" >&6; }
6406
6407
6408
6409
6410
6411 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
6412 $as_echo_n "checking for a working dd... " >&6; }
6413 if ${ac_cv_path_lt_DD+:} false; then :
6414 $as_echo_n "(cached) " >&6
6415 else
6416 printf 0123456789abcdef0123456789abcdef >conftest.i
6417 cat conftest.i conftest.i >conftest2.i
6418 : ${lt_DD:=$DD}
6419 if test -z "$lt_DD"; then
6420 ac_path_lt_DD_found=false
6421 # Loop through the user's path and test for each of PROGNAME-LIST
6422 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6423 for as_dir in $PATH
6424 do
6425 IFS=$as_save_IFS
6426 test -z "$as_dir" && as_dir=.
6427 for ac_prog in dd; do
6428 for ac_exec_ext in '' $ac_executable_extensions; do
6429 ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
6430 as_fn_executable_p "$ac_path_lt_DD" || continue
6431 if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6432 cmp -s conftest.i conftest.out \
6433 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6434 fi
6435 $ac_path_lt_DD_found && break 3
6436 done
6437 done
6438 done
6439 IFS=$as_save_IFS
6440 if test -z "$ac_cv_path_lt_DD"; then
6441 :
6442 fi
6443 else
6444 ac_cv_path_lt_DD=$lt_DD
6445 fi
6446
6447 rm -f conftest.i conftest2.i conftest.out
6448 fi
6449 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
6450 $as_echo "$ac_cv_path_lt_DD" >&6; }
6451
6452
6453 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
6454 $as_echo_n "checking how to truncate binary pipes... " >&6; }
6455 if ${lt_cv_truncate_bin+:} false; then :
6456 $as_echo_n "(cached) " >&6
6457 else
6458 printf 0123456789abcdef0123456789abcdef >conftest.i
6459 cat conftest.i conftest.i >conftest2.i
6460 lt_cv_truncate_bin=
6461 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6462 cmp -s conftest.i conftest.out \
6463 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6464 fi
6465 rm -f conftest.i conftest2.i conftest.out
6466 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
6467 fi
6468 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
6469 $as_echo "$lt_cv_truncate_bin" >&6; }
6470
6471
6472
6473
6474
6475
6476
6477 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
6478 func_cc_basename ()
6479 {
6480 for cc_temp in $*""; do
6481 case $cc_temp in
6482 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
6483 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
6484 \-*) ;;
6485 *) break;;
6486 esac
6487 done
6488 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
6489 }
6490
6491 # Check whether --enable-libtool-lock was given.
6492 if test "${enable_libtool_lock+set}" = set; then :
6493 enableval=$enable_libtool_lock;
6494 fi
6495
6496 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
6497
6498 # Some flags need to be propagated to the compiler or linker for good
6499 # libtool support.
6500 case $host in
6501 ia64-*-hpux*)
6502 # Find out what ABI is being produced by ac_compile, and set mode
6503 # options accordingly.
6504 echo 'int i;' > conftest.$ac_ext
6505 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6506 (eval $ac_compile) 2>&5
6507 ac_status=$?
6508 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6509 test $ac_status = 0; }; then
6510 case `/usr/bin/file conftest.$ac_objext` in
6511 *ELF-32*)
6512 HPUX_IA64_MODE=32
6513 ;;
6514 *ELF-64*)
6515 HPUX_IA64_MODE=64
6516 ;;
6517 esac
6518 fi
6519 rm -rf conftest*
6520 ;;
6521 *-*-irix6*)
6522 # Find out what ABI is being produced by ac_compile, and set linker
6523 # options accordingly.
6524 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
6525 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6526 (eval $ac_compile) 2>&5
6527 ac_status=$?
6528 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6529 test $ac_status = 0; }; then
6530 if test yes = "$lt_cv_prog_gnu_ld"; then
6531 case `/usr/bin/file conftest.$ac_objext` in
6532 *32-bit*)
6533 LD="${LD-ld} -melf32bsmip"
6534 ;;
6535 *N32*)
6536 LD="${LD-ld} -melf32bmipn32"
6537 ;;
6538 *64-bit*)
6539 LD="${LD-ld} -melf64bmip"
6540 ;;
6541 esac
6542 else
6543 case `/usr/bin/file conftest.$ac_objext` in
6544 *32-bit*)
6545 LD="${LD-ld} -32"
6546 ;;
6547 *N32*)
6548 LD="${LD-ld} -n32"
6549 ;;
6550 *64-bit*)
6551 LD="${LD-ld} -64"
6552 ;;
6553 esac
6554 fi
6555 fi
6556 rm -rf conftest*
6557 ;;
6558
6559 mips64*-*linux*)
6560 # Find out what ABI is being produced by ac_compile, and set linker
6561 # options accordingly.
6562 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
6563 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6564 (eval $ac_compile) 2>&5
6565 ac_status=$?
6566 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6567 test $ac_status = 0; }; then
6568 emul=elf
6569 case `/usr/bin/file conftest.$ac_objext` in
6570 *32-bit*)
6571 emul="${emul}32"
6572 ;;
6573 *64-bit*)
6574 emul="${emul}64"
6575 ;;
6576 esac
6577 case `/usr/bin/file conftest.$ac_objext` in
6578 *MSB*)
6579 emul="${emul}btsmip"
6580 ;;
6581 *LSB*)
6582 emul="${emul}ltsmip"
6583 ;;
6584 esac
6585 case `/usr/bin/file conftest.$ac_objext` in
6586 *N32*)
6587 emul="${emul}n32"
6588 ;;
6589 esac
6590 LD="${LD-ld} -m $emul"
6591 fi
6592 rm -rf conftest*
6593 ;;
6594
6595 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
6596 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6597 # Find out what ABI is being produced by ac_compile, and set linker
6598 # options accordingly. Note that the listed cases only cover the
6599 # situations where additional linker options are needed (such as when
6600 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
6601 # vice versa); the common cases where no linker options are needed do
6602 # not appear in the list.
6603 echo 'int i;' > conftest.$ac_ext
6604 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6605 (eval $ac_compile) 2>&5
6606 ac_status=$?
6607 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6608 test $ac_status = 0; }; then
6609 case `/usr/bin/file conftest.o` in
6610 *32-bit*)
6611 case $host in
6612 x86_64-*kfreebsd*-gnu)
6613 LD="${LD-ld} -m elf_i386_fbsd"
6614 ;;
6615 x86_64-*linux*)
6616 case `/usr/bin/file conftest.o` in
6617 *x86-64*)
6618 LD="${LD-ld} -m elf32_x86_64"
956619 ;;
96 yes)
97 echo "$1 = 1" >> $cnf_mk_file
6620 *)
6621 LD="${LD-ld} -m elf_i386"
986622 ;;
6623 esac
6624 ;;
6625 powerpc64le-*linux*)
6626 LD="${LD-ld} -m elf32lppclinux"
6627 ;;
6628 powerpc64-*linux*)
6629 LD="${LD-ld} -m elf32ppclinux"
6630 ;;
6631 s390x-*linux*)
6632 LD="${LD-ld} -m elf_s390"
6633 ;;
6634 sparc64-*linux*)
6635 LD="${LD-ld} -m elf32_sparc"
6636 ;;
6637 esac
6638 ;;
6639 *64-bit*)
6640 case $host in
6641 x86_64-*kfreebsd*-gnu)
6642 LD="${LD-ld} -m elf_x86_64_fbsd"
6643 ;;
6644 x86_64-*linux*)
6645 LD="${LD-ld} -m elf_x86_64"
6646 ;;
6647 powerpcle-*linux*)
6648 LD="${LD-ld} -m elf64lppc"
6649 ;;
6650 powerpc-*linux*)
6651 LD="${LD-ld} -m elf64ppc"
6652 ;;
6653 s390*-*linux*|s390*-*tpf*)
6654 LD="${LD-ld} -m elf64_s390"
6655 ;;
6656 sparc*-*linux*)
6657 LD="${LD-ld} -m elf64_sparc"
6658 ;;
6659 esac
6660 ;;
6661 esac
6662 fi
6663 rm -rf conftest*
6664 ;;
6665
6666 *-*-sco3.2v5*)
6667 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6668 SAVE_CFLAGS=$CFLAGS
6669 CFLAGS="$CFLAGS -belf"
6670 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
6671 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
6672 if ${lt_cv_cc_needs_belf+:} false; then :
6673 $as_echo_n "(cached) " >&6
6674 else
6675 ac_ext=c
6676 ac_cpp='$CPP $CPPFLAGS'
6677 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6678 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6679 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6680
6681 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6682 /* end confdefs.h. */
6683
6684 int
6685 main ()
6686 {
6687
6688 ;
6689 return 0;
6690 }
6691 _ACEOF
6692 if ac_fn_c_try_link "$LINENO"; then :
6693 lt_cv_cc_needs_belf=yes
6694 else
6695 lt_cv_cc_needs_belf=no
6696 fi
6697 rm -f core conftest.err conftest.$ac_objext \
6698 conftest$ac_exeext conftest.$ac_ext
6699 ac_ext=c
6700 ac_cpp='$CPP $CPPFLAGS'
6701 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6702 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6703 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6704
6705 fi
6706 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
6707 $as_echo "$lt_cv_cc_needs_belf" >&6; }
6708 if test yes != "$lt_cv_cc_needs_belf"; then
6709 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6710 CFLAGS=$SAVE_CFLAGS
6711 fi
6712 ;;
6713 *-*solaris*)
6714 # Find out what ABI is being produced by ac_compile, and set linker
6715 # options accordingly.
6716 echo 'int i;' > conftest.$ac_ext
6717 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6718 (eval $ac_compile) 2>&5
6719 ac_status=$?
6720 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6721 test $ac_status = 0; }; then
6722 case `/usr/bin/file conftest.o` in
6723 *64-bit*)
6724 case $lt_cv_prog_gnu_ld in
6725 yes*)
6726 case $host in
6727 i?86-*-solaris*|x86_64-*-solaris*)
6728 LD="${LD-ld} -m elf_x86_64"
6729 ;;
6730 sparc*-*-solaris*)
6731 LD="${LD-ld} -m elf64_sparc"
6732 ;;
6733 esac
6734 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
6735 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
6736 LD=${LD-ld}_sol2
6737 fi
6738 ;;
6739 *)
6740 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
6741 LD="${LD-ld} -64"
6742 fi
6743 ;;
6744 esac
6745 ;;
6746 esac
6747 fi
6748 rm -rf conftest*
6749 ;;
6750 esac
6751
6752 need_locks=$enable_libtool_lock
6753
6754 if test -n "$ac_tool_prefix"; then
6755 # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
6756 set dummy ${ac_tool_prefix}mt; ac_word=$2
6757 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6758 $as_echo_n "checking for $ac_word... " >&6; }
6759 if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
6760 $as_echo_n "(cached) " >&6
6761 else
6762 if test -n "$MANIFEST_TOOL"; then
6763 ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
6764 else
6765 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6766 for as_dir in $PATH
6767 do
6768 IFS=$as_save_IFS
6769 test -z "$as_dir" && as_dir=.
6770 for ac_exec_ext in '' $ac_executable_extensions; do
6771 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6772 ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
6773 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6774 break 2
6775 fi
6776 done
6777 done
6778 IFS=$as_save_IFS
6779
6780 fi
6781 fi
6782 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
6783 if test -n "$MANIFEST_TOOL"; then
6784 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
6785 $as_echo "$MANIFEST_TOOL" >&6; }
6786 else
6787 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6788 $as_echo "no" >&6; }
6789 fi
6790
6791
6792 fi
6793 if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
6794 ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
6795 # Extract the first word of "mt", so it can be a program name with args.
6796 set dummy mt; ac_word=$2
6797 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6798 $as_echo_n "checking for $ac_word... " >&6; }
6799 if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
6800 $as_echo_n "(cached) " >&6
6801 else
6802 if test -n "$ac_ct_MANIFEST_TOOL"; then
6803 ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
6804 else
6805 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6806 for as_dir in $PATH
6807 do
6808 IFS=$as_save_IFS
6809 test -z "$as_dir" && as_dir=.
6810 for ac_exec_ext in '' $ac_executable_extensions; do
6811 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6812 ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
6813 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6814 break 2
6815 fi
6816 done
6817 done
6818 IFS=$as_save_IFS
6819
6820 fi
6821 fi
6822 ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
6823 if test -n "$ac_ct_MANIFEST_TOOL"; then
6824 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
6825 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
6826 else
6827 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6828 $as_echo "no" >&6; }
6829 fi
6830
6831 if test "x$ac_ct_MANIFEST_TOOL" = x; then
6832 MANIFEST_TOOL=":"
6833 else
6834 case $cross_compiling:$ac_tool_warned in
6835 yes:)
6836 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6837 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6838 ac_tool_warned=yes ;;
6839 esac
6840 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
6841 fi
6842 else
6843 MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
6844 fi
6845
6846 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
6847 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
6848 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
6849 if ${lt_cv_path_mainfest_tool+:} false; then :
6850 $as_echo_n "(cached) " >&6
6851 else
6852 lt_cv_path_mainfest_tool=no
6853 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
6854 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
6855 cat conftest.err >&5
6856 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
6857 lt_cv_path_mainfest_tool=yes
6858 fi
6859 rm -f conftest*
6860 fi
6861 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
6862 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
6863 if test yes != "$lt_cv_path_mainfest_tool"; then
6864 MANIFEST_TOOL=:
6865 fi
6866
6867
6868
6869
6870
6871
6872 case $host_os in
6873 rhapsody* | darwin*)
6874 if test -n "$ac_tool_prefix"; then
6875 # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
6876 set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
6877 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6878 $as_echo_n "checking for $ac_word... " >&6; }
6879 if ${ac_cv_prog_DSYMUTIL+:} false; then :
6880 $as_echo_n "(cached) " >&6
6881 else
6882 if test -n "$DSYMUTIL"; then
6883 ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
6884 else
6885 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6886 for as_dir in $PATH
6887 do
6888 IFS=$as_save_IFS
6889 test -z "$as_dir" && as_dir=.
6890 for ac_exec_ext in '' $ac_executable_extensions; do
6891 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6892 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
6893 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6894 break 2
6895 fi
6896 done
6897 done
6898 IFS=$as_save_IFS
6899
6900 fi
6901 fi
6902 DSYMUTIL=$ac_cv_prog_DSYMUTIL
6903 if test -n "$DSYMUTIL"; then
6904 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
6905 $as_echo "$DSYMUTIL" >&6; }
6906 else
6907 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6908 $as_echo "no" >&6; }
6909 fi
6910
6911
6912 fi
6913 if test -z "$ac_cv_prog_DSYMUTIL"; then
6914 ac_ct_DSYMUTIL=$DSYMUTIL
6915 # Extract the first word of "dsymutil", so it can be a program name with args.
6916 set dummy dsymutil; ac_word=$2
6917 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6918 $as_echo_n "checking for $ac_word... " >&6; }
6919 if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
6920 $as_echo_n "(cached) " >&6
6921 else
6922 if test -n "$ac_ct_DSYMUTIL"; then
6923 ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
6924 else
6925 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6926 for as_dir in $PATH
6927 do
6928 IFS=$as_save_IFS
6929 test -z "$as_dir" && as_dir=.
6930 for ac_exec_ext in '' $ac_executable_extensions; do
6931 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6932 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
6933 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6934 break 2
6935 fi
6936 done
6937 done
6938 IFS=$as_save_IFS
6939
6940 fi
6941 fi
6942 ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
6943 if test -n "$ac_ct_DSYMUTIL"; then
6944 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
6945 $as_echo "$ac_ct_DSYMUTIL" >&6; }
6946 else
6947 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6948 $as_echo "no" >&6; }
6949 fi
6950
6951 if test "x$ac_ct_DSYMUTIL" = x; then
6952 DSYMUTIL=":"
6953 else
6954 case $cross_compiling:$ac_tool_warned in
6955 yes:)
6956 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6957 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6958 ac_tool_warned=yes ;;
6959 esac
6960 DSYMUTIL=$ac_ct_DSYMUTIL
6961 fi
6962 else
6963 DSYMUTIL="$ac_cv_prog_DSYMUTIL"
6964 fi
6965
6966 if test -n "$ac_tool_prefix"; then
6967 # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
6968 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
6969 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6970 $as_echo_n "checking for $ac_word... " >&6; }
6971 if ${ac_cv_prog_NMEDIT+:} false; then :
6972 $as_echo_n "(cached) " >&6
6973 else
6974 if test -n "$NMEDIT"; then
6975 ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
6976 else
6977 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6978 for as_dir in $PATH
6979 do
6980 IFS=$as_save_IFS
6981 test -z "$as_dir" && as_dir=.
6982 for ac_exec_ext in '' $ac_executable_extensions; do
6983 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6984 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
6985 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6986 break 2
6987 fi
6988 done
6989 done
6990 IFS=$as_save_IFS
6991
6992 fi
6993 fi
6994 NMEDIT=$ac_cv_prog_NMEDIT
6995 if test -n "$NMEDIT"; then
6996 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
6997 $as_echo "$NMEDIT" >&6; }
6998 else
6999 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7000 $as_echo "no" >&6; }
7001 fi
7002
7003
7004 fi
7005 if test -z "$ac_cv_prog_NMEDIT"; then
7006 ac_ct_NMEDIT=$NMEDIT
7007 # Extract the first word of "nmedit", so it can be a program name with args.
7008 set dummy nmedit; ac_word=$2
7009 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7010 $as_echo_n "checking for $ac_word... " >&6; }
7011 if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
7012 $as_echo_n "(cached) " >&6
7013 else
7014 if test -n "$ac_ct_NMEDIT"; then
7015 ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
7016 else
7017 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7018 for as_dir in $PATH
7019 do
7020 IFS=$as_save_IFS
7021 test -z "$as_dir" && as_dir=.
7022 for ac_exec_ext in '' $ac_executable_extensions; do
7023 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7024 ac_cv_prog_ac_ct_NMEDIT="nmedit"
7025 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7026 break 2
7027 fi
7028 done
7029 done
7030 IFS=$as_save_IFS
7031
7032 fi
7033 fi
7034 ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
7035 if test -n "$ac_ct_NMEDIT"; then
7036 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
7037 $as_echo "$ac_ct_NMEDIT" >&6; }
7038 else
7039 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7040 $as_echo "no" >&6; }
7041 fi
7042
7043 if test "x$ac_ct_NMEDIT" = x; then
7044 NMEDIT=":"
7045 else
7046 case $cross_compiling:$ac_tool_warned in
7047 yes:)
7048 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7049 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7050 ac_tool_warned=yes ;;
7051 esac
7052 NMEDIT=$ac_ct_NMEDIT
7053 fi
7054 else
7055 NMEDIT="$ac_cv_prog_NMEDIT"
7056 fi
7057
7058 if test -n "$ac_tool_prefix"; then
7059 # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
7060 set dummy ${ac_tool_prefix}lipo; ac_word=$2
7061 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7062 $as_echo_n "checking for $ac_word... " >&6; }
7063 if ${ac_cv_prog_LIPO+:} false; then :
7064 $as_echo_n "(cached) " >&6
7065 else
7066 if test -n "$LIPO"; then
7067 ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
7068 else
7069 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7070 for as_dir in $PATH
7071 do
7072 IFS=$as_save_IFS
7073 test -z "$as_dir" && as_dir=.
7074 for ac_exec_ext in '' $ac_executable_extensions; do
7075 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7076 ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
7077 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7078 break 2
7079 fi
7080 done
7081 done
7082 IFS=$as_save_IFS
7083
7084 fi
7085 fi
7086 LIPO=$ac_cv_prog_LIPO
7087 if test -n "$LIPO"; then
7088 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
7089 $as_echo "$LIPO" >&6; }
7090 else
7091 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7092 $as_echo "no" >&6; }
7093 fi
7094
7095
7096 fi
7097 if test -z "$ac_cv_prog_LIPO"; then
7098 ac_ct_LIPO=$LIPO
7099 # Extract the first word of "lipo", so it can be a program name with args.
7100 set dummy lipo; ac_word=$2
7101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7102 $as_echo_n "checking for $ac_word... " >&6; }
7103 if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
7104 $as_echo_n "(cached) " >&6
7105 else
7106 if test -n "$ac_ct_LIPO"; then
7107 ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
7108 else
7109 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7110 for as_dir in $PATH
7111 do
7112 IFS=$as_save_IFS
7113 test -z "$as_dir" && as_dir=.
7114 for ac_exec_ext in '' $ac_executable_extensions; do
7115 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7116 ac_cv_prog_ac_ct_LIPO="lipo"
7117 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7118 break 2
7119 fi
7120 done
7121 done
7122 IFS=$as_save_IFS
7123
7124 fi
7125 fi
7126 ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
7127 if test -n "$ac_ct_LIPO"; then
7128 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
7129 $as_echo "$ac_ct_LIPO" >&6; }
7130 else
7131 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7132 $as_echo "no" >&6; }
7133 fi
7134
7135 if test "x$ac_ct_LIPO" = x; then
7136 LIPO=":"
7137 else
7138 case $cross_compiling:$ac_tool_warned in
7139 yes:)
7140 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7141 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7142 ac_tool_warned=yes ;;
7143 esac
7144 LIPO=$ac_ct_LIPO
7145 fi
7146 else
7147 LIPO="$ac_cv_prog_LIPO"
7148 fi
7149
7150 if test -n "$ac_tool_prefix"; then
7151 # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
7152 set dummy ${ac_tool_prefix}otool; ac_word=$2
7153 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7154 $as_echo_n "checking for $ac_word... " >&6; }
7155 if ${ac_cv_prog_OTOOL+:} false; then :
7156 $as_echo_n "(cached) " >&6
7157 else
7158 if test -n "$OTOOL"; then
7159 ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
7160 else
7161 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7162 for as_dir in $PATH
7163 do
7164 IFS=$as_save_IFS
7165 test -z "$as_dir" && as_dir=.
7166 for ac_exec_ext in '' $ac_executable_extensions; do
7167 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7168 ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
7169 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7170 break 2
7171 fi
7172 done
7173 done
7174 IFS=$as_save_IFS
7175
7176 fi
7177 fi
7178 OTOOL=$ac_cv_prog_OTOOL
7179 if test -n "$OTOOL"; then
7180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
7181 $as_echo "$OTOOL" >&6; }
7182 else
7183 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7184 $as_echo "no" >&6; }
7185 fi
7186
7187
7188 fi
7189 if test -z "$ac_cv_prog_OTOOL"; then
7190 ac_ct_OTOOL=$OTOOL
7191 # Extract the first word of "otool", so it can be a program name with args.
7192 set dummy otool; ac_word=$2
7193 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7194 $as_echo_n "checking for $ac_word... " >&6; }
7195 if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
7196 $as_echo_n "(cached) " >&6
7197 else
7198 if test -n "$ac_ct_OTOOL"; then
7199 ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
7200 else
7201 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7202 for as_dir in $PATH
7203 do
7204 IFS=$as_save_IFS
7205 test -z "$as_dir" && as_dir=.
7206 for ac_exec_ext in '' $ac_executable_extensions; do
7207 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7208 ac_cv_prog_ac_ct_OTOOL="otool"
7209 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7210 break 2
7211 fi
7212 done
7213 done
7214 IFS=$as_save_IFS
7215
7216 fi
7217 fi
7218 ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
7219 if test -n "$ac_ct_OTOOL"; then
7220 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
7221 $as_echo "$ac_ct_OTOOL" >&6; }
7222 else
7223 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7224 $as_echo "no" >&6; }
7225 fi
7226
7227 if test "x$ac_ct_OTOOL" = x; then
7228 OTOOL=":"
7229 else
7230 case $cross_compiling:$ac_tool_warned in
7231 yes:)
7232 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7233 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7234 ac_tool_warned=yes ;;
7235 esac
7236 OTOOL=$ac_ct_OTOOL
7237 fi
7238 else
7239 OTOOL="$ac_cv_prog_OTOOL"
7240 fi
7241
7242 if test -n "$ac_tool_prefix"; then
7243 # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
7244 set dummy ${ac_tool_prefix}otool64; ac_word=$2
7245 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7246 $as_echo_n "checking for $ac_word... " >&6; }
7247 if ${ac_cv_prog_OTOOL64+:} false; then :
7248 $as_echo_n "(cached) " >&6
7249 else
7250 if test -n "$OTOOL64"; then
7251 ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
7252 else
7253 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7254 for as_dir in $PATH
7255 do
7256 IFS=$as_save_IFS
7257 test -z "$as_dir" && as_dir=.
7258 for ac_exec_ext in '' $ac_executable_extensions; do
7259 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7260 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
7261 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7262 break 2
7263 fi
7264 done
7265 done
7266 IFS=$as_save_IFS
7267
7268 fi
7269 fi
7270 OTOOL64=$ac_cv_prog_OTOOL64
7271 if test -n "$OTOOL64"; then
7272 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
7273 $as_echo "$OTOOL64" >&6; }
7274 else
7275 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7276 $as_echo "no" >&6; }
7277 fi
7278
7279
7280 fi
7281 if test -z "$ac_cv_prog_OTOOL64"; then
7282 ac_ct_OTOOL64=$OTOOL64
7283 # Extract the first word of "otool64", so it can be a program name with args.
7284 set dummy otool64; ac_word=$2
7285 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7286 $as_echo_n "checking for $ac_word... " >&6; }
7287 if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
7288 $as_echo_n "(cached) " >&6
7289 else
7290 if test -n "$ac_ct_OTOOL64"; then
7291 ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
7292 else
7293 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7294 for as_dir in $PATH
7295 do
7296 IFS=$as_save_IFS
7297 test -z "$as_dir" && as_dir=.
7298 for ac_exec_ext in '' $ac_executable_extensions; do
7299 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7300 ac_cv_prog_ac_ct_OTOOL64="otool64"
7301 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7302 break 2
7303 fi
7304 done
7305 done
7306 IFS=$as_save_IFS
7307
7308 fi
7309 fi
7310 ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
7311 if test -n "$ac_ct_OTOOL64"; then
7312 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
7313 $as_echo "$ac_ct_OTOOL64" >&6; }
7314 else
7315 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7316 $as_echo "no" >&6; }
7317 fi
7318
7319 if test "x$ac_ct_OTOOL64" = x; then
7320 OTOOL64=":"
7321 else
7322 case $cross_compiling:$ac_tool_warned in
7323 yes:)
7324 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7325 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7326 ac_tool_warned=yes ;;
7327 esac
7328 OTOOL64=$ac_ct_OTOOL64
7329 fi
7330 else
7331 OTOOL64="$ac_cv_prog_OTOOL64"
7332 fi
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
7361 $as_echo_n "checking for -single_module linker flag... " >&6; }
7362 if ${lt_cv_apple_cc_single_mod+:} false; then :
7363 $as_echo_n "(cached) " >&6
7364 else
7365 lt_cv_apple_cc_single_mod=no
7366 if test -z "$LT_MULTI_MODULE"; then
7367 # By default we will add the -single_module flag. You can override
7368 # by either setting the environment variable LT_MULTI_MODULE
7369 # non-empty at configure time, or by adding -multi_module to the
7370 # link flags.
7371 rm -rf libconftest.dylib*
7372 echo "int foo(void){return 1;}" > conftest.c
7373 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
7374 -dynamiclib -Wl,-single_module conftest.c" >&5
7375 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
7376 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
7377 _lt_result=$?
7378 # If there is a non-empty error log, and "single_module"
7379 # appears in it, assume the flag caused a linker warning
7380 if test -s conftest.err && $GREP single_module conftest.err; then
7381 cat conftest.err >&5
7382 # Otherwise, if the output was created with a 0 exit code from
7383 # the compiler, it worked.
7384 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
7385 lt_cv_apple_cc_single_mod=yes
7386 else
7387 cat conftest.err >&5
7388 fi
7389 rm -rf libconftest.dylib*
7390 rm -f conftest.*
7391 fi
7392 fi
7393 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
7394 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
7395
7396 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
7397 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
7398 if ${lt_cv_ld_exported_symbols_list+:} false; then :
7399 $as_echo_n "(cached) " >&6
7400 else
7401 lt_cv_ld_exported_symbols_list=no
7402 save_LDFLAGS=$LDFLAGS
7403 echo "_main" > conftest.sym
7404 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
7405 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7406 /* end confdefs.h. */
7407
7408 int
7409 main ()
7410 {
7411
7412 ;
7413 return 0;
7414 }
7415 _ACEOF
7416 if ac_fn_c_try_link "$LINENO"; then :
7417 lt_cv_ld_exported_symbols_list=yes
7418 else
7419 lt_cv_ld_exported_symbols_list=no
7420 fi
7421 rm -f core conftest.err conftest.$ac_objext \
7422 conftest$ac_exeext conftest.$ac_ext
7423 LDFLAGS=$save_LDFLAGS
7424
7425 fi
7426 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
7427 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
7428
7429 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
7430 $as_echo_n "checking for -force_load linker flag... " >&6; }
7431 if ${lt_cv_ld_force_load+:} false; then :
7432 $as_echo_n "(cached) " >&6
7433 else
7434 lt_cv_ld_force_load=no
7435 cat > conftest.c << _LT_EOF
7436 int forced_loaded() { return 2;}
7437 _LT_EOF
7438 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
7439 $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
7442 echo "$RANLIB libconftest.a" >&5
7443 $RANLIB libconftest.a 2>&5
7444 cat > conftest.c << _LT_EOF
7445 int main() { return 0;}
7446 _LT_EOF
7447 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
7448 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
7449 _lt_result=$?
7450 if test -s conftest.err && $GREP force_load conftest.err; then
7451 cat conftest.err >&5
7452 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
7453 lt_cv_ld_force_load=yes
7454 else
7455 cat conftest.err >&5
7456 fi
7457 rm -f conftest.err libconftest.a conftest conftest.c
7458 rm -rf conftest.dSYM
7459
7460 fi
7461 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
7462 $as_echo "$lt_cv_ld_force_load" >&6; }
7463 case $host_os in
7464 rhapsody* | darwin1.[012])
7465 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
7466 darwin1.*)
7467 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
7468 darwin*) # darwin 5.x on
7469 # if running on 10.5 or later, the deployment target defaults
7470 # to the OS version, if on x86, and 10.4, the deployment
7471 # target defaults to 10.4. Don't you love it?
7472 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
7473 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
7474 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
7475 10.[012][,.]*)
7476 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
7477 10.*)
7478 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
7479 esac
7480 ;;
7481 esac
7482 if test yes = "$lt_cv_apple_cc_single_mod"; then
7483 _lt_dar_single_mod='$single_module'
7484 fi
7485 if test yes = "$lt_cv_ld_exported_symbols_list"; then
7486 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
7487 else
7488 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
7489 fi
7490 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
7491 _lt_dsymutil='~$DSYMUTIL $lib || :'
7492 else
7493 _lt_dsymutil=
7494 fi
7495 ;;
7496 esac
7497
7498 # func_munge_path_list VARIABLE PATH
7499 # -----------------------------------
7500 # VARIABLE is name of variable containing _space_ separated list of
7501 # directories to be munged by the contents of PATH, which is string
7502 # having a format:
7503 # "DIR[:DIR]:"
7504 # string "DIR[ DIR]" will be prepended to VARIABLE
7505 # ":DIR[:DIR]"
7506 # string "DIR[ DIR]" will be appended to VARIABLE
7507 # "DIRP[:DIRP]::[DIRA:]DIRA"
7508 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
7509 # "DIRA[ DIRA]" will be appended to VARIABLE
7510 # "DIR[:DIR]"
7511 # VARIABLE will be replaced by "DIR[ DIR]"
7512 func_munge_path_list ()
7513 {
7514 case x$2 in
7515 x)
7516 ;;
7517 *:)
7518 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
7519 ;;
7520 x:*)
7521 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
7522 ;;
7523 *::*)
7524 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
7525 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
7526 ;;
7527 *)
7528 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
7529 ;;
7530 esac
7531 }
7532
7533 ac_ext=c
7534 ac_cpp='$CPP $CPPFLAGS'
7535 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7536 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7537 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7538 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
7539 $as_echo_n "checking how to run the C preprocessor... " >&6; }
7540 # On Suns, sometimes $CPP names a directory.
7541 if test -n "$CPP" && test -d "$CPP"; then
7542 CPP=
7543 fi
7544 if test -z "$CPP"; then
7545 if ${ac_cv_prog_CPP+:} false; then :
7546 $as_echo_n "(cached) " >&6
7547 else
7548 # Double quotes because CPP needs to be expanded
7549 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
7550 do
7551 ac_preproc_ok=false
7552 for ac_c_preproc_warn_flag in '' yes
7553 do
7554 # Use a header file that comes with gcc, so configuring glibc
7555 # with a fresh cross-compiler works.
7556 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
7557 # <limits.h> exists even on freestanding compilers.
7558 # On the NeXT, cc -E runs the code through the compiler's parser,
7559 # not just through cpp. "Syntax error" is here to catch this case.
7560 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7561 /* end confdefs.h. */
7562 #ifdef __STDC__
7563 # include <limits.h>
7564 #else
7565 # include <assert.h>
7566 #endif
7567 Syntax error
7568 _ACEOF
7569 if ac_fn_c_try_cpp "$LINENO"; then :
7570
7571 else
7572 # Broken: fails on valid input.
7573 continue
7574 fi
7575 rm -f conftest.err conftest.i conftest.$ac_ext
7576
7577 # OK, works on sane cases. Now check whether nonexistent headers
7578 # can be detected and how.
7579 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7580 /* end confdefs.h. */
7581 #include <ac_nonexistent.h>
7582 _ACEOF
7583 if ac_fn_c_try_cpp "$LINENO"; then :
7584 # Broken: success on invalid input.
7585 continue
7586 else
7587 # Passes both tests.
7588 ac_preproc_ok=:
7589 break
7590 fi
7591 rm -f conftest.err conftest.i conftest.$ac_ext
7592
7593 done
7594 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
7595 rm -f conftest.i conftest.err conftest.$ac_ext
7596 if $ac_preproc_ok; then :
7597 break
7598 fi
7599
7600 done
7601 ac_cv_prog_CPP=$CPP
7602
7603 fi
7604 CPP=$ac_cv_prog_CPP
7605 else
7606 ac_cv_prog_CPP=$CPP
7607 fi
7608 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
7609 $as_echo "$CPP" >&6; }
7610 ac_preproc_ok=false
7611 for ac_c_preproc_warn_flag in '' yes
7612 do
7613 # Use a header file that comes with gcc, so configuring glibc
7614 # with a fresh cross-compiler works.
7615 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
7616 # <limits.h> exists even on freestanding compilers.
7617 # On the NeXT, cc -E runs the code through the compiler's parser,
7618 # not just through cpp. "Syntax error" is here to catch this case.
7619 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7620 /* end confdefs.h. */
7621 #ifdef __STDC__
7622 # include <limits.h>
7623 #else
7624 # include <assert.h>
7625 #endif
7626 Syntax error
7627 _ACEOF
7628 if ac_fn_c_try_cpp "$LINENO"; then :
7629
7630 else
7631 # Broken: fails on valid input.
7632 continue
7633 fi
7634 rm -f conftest.err conftest.i conftest.$ac_ext
7635
7636 # OK, works on sane cases. Now check whether nonexistent headers
7637 # can be detected and how.
7638 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7639 /* end confdefs.h. */
7640 #include <ac_nonexistent.h>
7641 _ACEOF
7642 if ac_fn_c_try_cpp "$LINENO"; then :
7643 # Broken: success on invalid input.
7644 continue
7645 else
7646 # Passes both tests.
7647 ac_preproc_ok=:
7648 break
7649 fi
7650 rm -f conftest.err conftest.i conftest.$ac_ext
7651
7652 done
7653 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
7654 rm -f conftest.i conftest.err conftest.$ac_ext
7655 if $ac_preproc_ok; then :
7656
7657 else
7658 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
7659 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
7660 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
7661 See \`config.log' for more details" "$LINENO" 5; }
7662 fi
7663
7664 ac_ext=c
7665 ac_cpp='$CPP $CPPFLAGS'
7666 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7667 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7668 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7669
7670
7671 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
7672 $as_echo_n "checking for ANSI C header files... " >&6; }
7673 if ${ac_cv_header_stdc+:} false; then :
7674 $as_echo_n "(cached) " >&6
7675 else
7676 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7677 /* end confdefs.h. */
7678 #include <stdlib.h>
7679 #include <stdarg.h>
7680 #include <string.h>
7681 #include <float.h>
7682
7683 int
7684 main ()
7685 {
7686
7687 ;
7688 return 0;
7689 }
7690 _ACEOF
7691 if ac_fn_c_try_compile "$LINENO"; then :
7692 ac_cv_header_stdc=yes
7693 else
7694 ac_cv_header_stdc=no
7695 fi
7696 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7697
7698 if test $ac_cv_header_stdc = yes; then
7699 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7700 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7701 /* end confdefs.h. */
7702 #include <string.h>
7703
7704 _ACEOF
7705 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7706 $EGREP "memchr" >/dev/null 2>&1; then :
7707
7708 else
7709 ac_cv_header_stdc=no
7710 fi
7711 rm -f conftest*
7712
7713 fi
7714
7715 if test $ac_cv_header_stdc = yes; then
7716 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
7717 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7718 /* end confdefs.h. */
7719 #include <stdlib.h>
7720
7721 _ACEOF
7722 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7723 $EGREP "free" >/dev/null 2>&1; then :
7724
7725 else
7726 ac_cv_header_stdc=no
7727 fi
7728 rm -f conftest*
7729
7730 fi
7731
7732 if test $ac_cv_header_stdc = yes; then
7733 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7734 if test "$cross_compiling" = yes; then :
7735 :
7736 else
7737 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7738 /* end confdefs.h. */
7739 #include <ctype.h>
7740 #include <stdlib.h>
7741 #if ((' ' & 0x0FF) == 0x020)
7742 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7743 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7744 #else
7745 # define ISLOWER(c) \
7746 (('a' <= (c) && (c) <= 'i') \
7747 || ('j' <= (c) && (c) <= 'r') \
7748 || ('s' <= (c) && (c) <= 'z'))
7749 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7750 #endif
7751
7752 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7753 int
7754 main ()
7755 {
7756 int i;
7757 for (i = 0; i < 256; i++)
7758 if (XOR (islower (i), ISLOWER (i))
7759 || toupper (i) != TOUPPER (i))
7760 return 2;
7761 return 0;
7762 }
7763 _ACEOF
7764 if ac_fn_c_try_run "$LINENO"; then :
7765
7766 else
7767 ac_cv_header_stdc=no
7768 fi
7769 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7770 conftest.$ac_objext conftest.beam conftest.$ac_ext
7771 fi
7772
7773 fi
7774 fi
7775 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
7776 $as_echo "$ac_cv_header_stdc" >&6; }
7777 if test $ac_cv_header_stdc = yes; then
7778
7779 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
7780
7781 fi
7782
7783 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
7784 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7785 inttypes.h stdint.h unistd.h
7786 do :
7787 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7788 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7789 "
7790 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7791 cat >>confdefs.h <<_ACEOF
7792 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7793 _ACEOF
7794
7795 fi
7796
7797 done
7798
7799
7800 for ac_header in dlfcn.h
7801 do :
7802 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
7803 "
7804 if test "x$ac_cv_header_dlfcn_h" = xyes; then :
7805 cat >>confdefs.h <<_ACEOF
7806 #define HAVE_DLFCN_H 1
7807 _ACEOF
7808
7809 fi
7810
7811 done
7812
7813
7814
7815
7816
7817 # Set options
7818 # Check whether --enable-shared was given.
7819 if test "${enable_shared+set}" = set; then :
7820 enableval=$enable_shared; p=${PACKAGE-default}
7821 case $enableval in
7822 yes) enable_shared=yes ;;
7823 no) enable_shared=no ;;
7824 *)
7825 enable_shared=no
7826 # Look at the argument we got. We use all the common list separators.
7827 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7828 for pkg in $enableval; do
7829 IFS=$lt_save_ifs
7830 if test "X$pkg" = "X$p"; then
7831 enable_shared=yes
7832 fi
7833 done
7834 IFS=$lt_save_ifs
7835 ;;
7836 esac
7837 else
7838 enable_shared=yes
7839 fi
7840
7841
7842
7843
7844
7845
7846
7847
7848 # Check whether --with-pic was given.
7849 if test "${with_pic+set}" = set; then :
7850 withval=$with_pic; lt_p=${PACKAGE-default}
7851 case $withval in
7852 yes|no) pic_mode=$withval ;;
7853 *)
7854 pic_mode=default
7855 # Look at the argument we got. We use all the common list separators.
7856 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7857 for lt_pkg in $withval; do
7858 IFS=$lt_save_ifs
7859 if test "X$lt_pkg" = "X$lt_p"; then
7860 pic_mode=yes
7861 fi
7862 done
7863 IFS=$lt_save_ifs
7864 ;;
7865 esac
7866 else
7867 pic_mode=yes
7868 fi
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878 enable_dlopen=no
7879
7880
7881 enable_win32_dll=no
7882
7883
7884
7885 # Check whether --enable-static was given.
7886 if test "${enable_static+set}" = set; then :
7887 enableval=$enable_static; p=${PACKAGE-default}
7888 case $enableval in
7889 yes) enable_static=yes ;;
7890 no) enable_static=no ;;
7891 *)
7892 enable_static=no
7893 # Look at the argument we got. We use all the common list separators.
7894 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7895 for pkg in $enableval; do
7896 IFS=$lt_save_ifs
7897 if test "X$pkg" = "X$p"; then
7898 enable_static=yes
7899 fi
7900 done
7901 IFS=$lt_save_ifs
7902 ;;
7903 esac
7904 else
7905 enable_static=yes
7906 fi
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917 # Check whether --enable-fast-install was given.
7918 if test "${enable_fast_install+set}" = set; then :
7919 enableval=$enable_fast_install; p=${PACKAGE-default}
7920 case $enableval in
7921 yes) enable_fast_install=yes ;;
7922 no) enable_fast_install=no ;;
7923 *)
7924 enable_fast_install=no
7925 # Look at the argument we got. We use all the common list separators.
7926 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7927 for pkg in $enableval; do
7928 IFS=$lt_save_ifs
7929 if test "X$pkg" = "X$p"; then
7930 enable_fast_install=yes
7931 fi
7932 done
7933 IFS=$lt_save_ifs
7934 ;;
7935 esac
7936 else
7937 enable_fast_install=yes
7938 fi
7939
7940
7941
7942
7943
7944
7945
7946
7947 shared_archive_member_spec=
7948 case $host,$enable_shared in
7949 power*-*-aix[5-9]*,yes)
7950 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
7951 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
7952
7953 # Check whether --with-aix-soname was given.
7954 if test "${with_aix_soname+set}" = set; then :
7955 withval=$with_aix_soname; case $withval in
7956 aix|svr4|both)
7957 ;;
7958 *)
7959 as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
7960 ;;
7961 esac
7962 lt_cv_with_aix_soname=$with_aix_soname
7963 else
7964 if ${lt_cv_with_aix_soname+:} false; then :
7965 $as_echo_n "(cached) " >&6
7966 else
7967 lt_cv_with_aix_soname=aix
7968 fi
7969
7970 with_aix_soname=$lt_cv_with_aix_soname
7971 fi
7972
7973 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
7974 $as_echo "$with_aix_soname" >&6; }
7975 if test aix != "$with_aix_soname"; then
7976 # For the AIX way of multilib, we name the shared archive member
7977 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
7978 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
7979 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
7980 # the AIX toolchain works better with OBJECT_MODE set (default 32).
7981 if test 64 = "${OBJECT_MODE-32}"; then
7982 shared_archive_member_spec=shr_64
7983 else
7984 shared_archive_member_spec=shr
7985 fi
7986 fi
7987 ;;
7988 *)
7989 with_aix_soname=aix
7990 ;;
7991 esac
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002 # This can be used to rebuild libtool when needed
8003 LIBTOOL_DEPS=$ltmain
8004
8005 # Always use our own libtool.
8006 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037 test -z "$LN_S" && LN_S="ln -s"
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052 if test -n "${ZSH_VERSION+set}"; then
8053 setopt NO_GLOB_SUBST
8054 fi
8055
8056 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
8057 $as_echo_n "checking for objdir... " >&6; }
8058 if ${lt_cv_objdir+:} false; then :
8059 $as_echo_n "(cached) " >&6
8060 else
8061 rm -f .libs 2>/dev/null
8062 mkdir .libs 2>/dev/null
8063 if test -d .libs; then
8064 lt_cv_objdir=.libs
8065 else
8066 # MS-DOS does not allow filenames that begin with a dot.
8067 lt_cv_objdir=_libs
8068 fi
8069 rmdir .libs 2>/dev/null
8070 fi
8071 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
8072 $as_echo "$lt_cv_objdir" >&6; }
8073 objdir=$lt_cv_objdir
8074
8075
8076
8077
8078
8079 cat >>confdefs.h <<_ACEOF
8080 #define LT_OBJDIR "$lt_cv_objdir/"
8081 _ACEOF
8082
8083
8084
8085
8086 case $host_os in
8087 aix3*)
8088 # AIX sometimes has problems with the GCC collect2 program. For some
8089 # reason, if we set the COLLECT_NAMES environment variable, the problems
8090 # vanish in a puff of smoke.
8091 if test set != "${COLLECT_NAMES+set}"; then
8092 COLLECT_NAMES=
8093 export COLLECT_NAMES
8094 fi
8095 ;;
8096 esac
8097
8098 # Global variables:
8099 ofile=libtool
8100 can_build_shared=yes
8101
8102 # All known linkers require a '.a' archive for static linking (except MSVC,
8103 # which needs '.lib').
8104 libext=a
8105
8106 with_gnu_ld=$lt_cv_prog_gnu_ld
8107
8108 old_CC=$CC
8109 old_CFLAGS=$CFLAGS
8110
8111 # Set sane defaults for various variables
8112 test -z "$CC" && CC=cc
8113 test -z "$LTCC" && LTCC=$CC
8114 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
8115 test -z "$LD" && LD=ld
8116 test -z "$ac_objext" && ac_objext=o
8117
8118 func_cc_basename $compiler
8119 cc_basename=$func_cc_basename_result
8120
8121
8122 # Only perform the check for file, if the check method requires it
8123 test -z "$MAGIC_CMD" && MAGIC_CMD=file
8124 case $deplibs_check_method in
8125 file_magic*)
8126 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
8127 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
8128 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
8129 if ${lt_cv_path_MAGIC_CMD+:} false; then :
8130 $as_echo_n "(cached) " >&6
8131 else
8132 case $MAGIC_CMD in
8133 [\\/*] | ?:[\\/]*)
8134 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
8135 ;;
8136 *)
8137 lt_save_MAGIC_CMD=$MAGIC_CMD
8138 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
8139 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
8140 for ac_dir in $ac_dummy; do
8141 IFS=$lt_save_ifs
8142 test -z "$ac_dir" && ac_dir=.
8143 if test -f "$ac_dir/${ac_tool_prefix}file"; then
8144 lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
8145 if test -n "$file_magic_test_file"; then
8146 case $deplibs_check_method in
8147 "file_magic "*)
8148 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8149 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
8150 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8151 $EGREP "$file_magic_regex" > /dev/null; then
8152 :
8153 else
8154 cat <<_LT_EOF 1>&2
8155
8156 *** Warning: the command libtool uses to detect shared libraries,
8157 *** $file_magic_cmd, produces output that libtool cannot recognize.
8158 *** The result is that libtool may fail to recognize shared libraries
8159 *** as such. This will affect the creation of libtool libraries that
8160 *** depend on shared libraries, but programs linked with such libtool
8161 *** libraries will work regardless of this problem. Nevertheless, you
8162 *** may want to report the problem to your system manager and/or to
8163 *** bug-libtool@gnu.org
8164
8165 _LT_EOF
8166 fi ;;
8167 esac
8168 fi
8169 break
8170 fi
8171 done
8172 IFS=$lt_save_ifs
8173 MAGIC_CMD=$lt_save_MAGIC_CMD
8174 ;;
8175 esac
8176 fi
8177
8178 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
8179 if test -n "$MAGIC_CMD"; then
8180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
8181 $as_echo "$MAGIC_CMD" >&6; }
8182 else
8183 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8184 $as_echo "no" >&6; }
8185 fi
8186
8187
8188
8189
8190
8191 if test -z "$lt_cv_path_MAGIC_CMD"; then
8192 if test -n "$ac_tool_prefix"; then
8193 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
8194 $as_echo_n "checking for file... " >&6; }
8195 if ${lt_cv_path_MAGIC_CMD+:} false; then :
8196 $as_echo_n "(cached) " >&6
8197 else
8198 case $MAGIC_CMD in
8199 [\\/*] | ?:[\\/]*)
8200 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
8201 ;;
8202 *)
8203 lt_save_MAGIC_CMD=$MAGIC_CMD
8204 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
8205 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
8206 for ac_dir in $ac_dummy; do
8207 IFS=$lt_save_ifs
8208 test -z "$ac_dir" && ac_dir=.
8209 if test -f "$ac_dir/file"; then
8210 lt_cv_path_MAGIC_CMD=$ac_dir/"file"
8211 if test -n "$file_magic_test_file"; then
8212 case $deplibs_check_method in
8213 "file_magic "*)
8214 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8215 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
8216 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8217 $EGREP "$file_magic_regex" > /dev/null; then
8218 :
8219 else
8220 cat <<_LT_EOF 1>&2
8221
8222 *** Warning: the command libtool uses to detect shared libraries,
8223 *** $file_magic_cmd, produces output that libtool cannot recognize.
8224 *** The result is that libtool may fail to recognize shared libraries
8225 *** as such. This will affect the creation of libtool libraries that
8226 *** depend on shared libraries, but programs linked with such libtool
8227 *** libraries will work regardless of this problem. Nevertheless, you
8228 *** may want to report the problem to your system manager and/or to
8229 *** bug-libtool@gnu.org
8230
8231 _LT_EOF
8232 fi ;;
8233 esac
8234 fi
8235 break
8236 fi
8237 done
8238 IFS=$lt_save_ifs
8239 MAGIC_CMD=$lt_save_MAGIC_CMD
8240 ;;
8241 esac
8242 fi
8243
8244 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
8245 if test -n "$MAGIC_CMD"; then
8246 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
8247 $as_echo "$MAGIC_CMD" >&6; }
8248 else
8249 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8250 $as_echo "no" >&6; }
8251 fi
8252
8253
8254 else
8255 MAGIC_CMD=:
8256 fi
8257 fi
8258
8259 fi
8260 ;;
8261 esac
8262
8263 # Use C for the default configuration in the libtool script
8264
8265 lt_save_CC=$CC
8266 ac_ext=c
8267 ac_cpp='$CPP $CPPFLAGS'
8268 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8269 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8270 ac_compiler_gnu=$ac_cv_c_compiler_gnu
8271
8272
8273 # Source file extension for C test sources.
8274 ac_ext=c
8275
8276 # Object file extension for compiled C test sources.
8277 objext=o
8278 objext=$objext
8279
8280 # Code to be used in simple compile tests
8281 lt_simple_compile_test_code="int some_variable = 0;"
8282
8283 # Code to be used in simple link tests
8284 lt_simple_link_test_code='int main(){return(0);}'
8285
8286
8287
8288
8289
8290
8291
8292 # If no C compiler was specified, use CC.
8293 LTCC=${LTCC-"$CC"}
8294
8295 # If no C compiler flags were specified, use CFLAGS.
8296 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
8297
8298 # Allow CC to be a program name with arguments.
8299 compiler=$CC
8300
8301 # Save the default compiler, since it gets overwritten when the other
8302 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
8303 compiler_DEFAULT=$CC
8304
8305 # save warnings/boilerplate of simple test code
8306 ac_outfile=conftest.$ac_objext
8307 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
8308 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8309 _lt_compiler_boilerplate=`cat conftest.err`
8310 $RM conftest*
8311
8312 ac_outfile=conftest.$ac_objext
8313 echo "$lt_simple_link_test_code" >conftest.$ac_ext
8314 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8315 _lt_linker_boilerplate=`cat conftest.err`
8316 $RM -r conftest*
8317
8318
8319 ## CAVEAT EMPTOR:
8320 ## There is no encapsulation within the following macros, do not change
8321 ## the running order or otherwise move them around unless you know exactly
8322 ## what you are doing...
8323 if test -n "$compiler"; then
8324
8325 lt_prog_compiler_no_builtin_flag=
8326
8327 if test yes = "$GCC"; then
8328 case $cc_basename in
8329 nvcc*)
8330 lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
8331 *)
8332 lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
8333 esac
8334
8335 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
8336 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
8337 if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
8338 $as_echo_n "(cached) " >&6
8339 else
8340 lt_cv_prog_compiler_rtti_exceptions=no
8341 ac_outfile=conftest.$ac_objext
8342 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8343 lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
8344 # Insert the option either (1) after the last *FLAGS variable, or
8345 # (2) before a word containing "conftest.", or (3) at the end.
8346 # Note that $ac_compile itself does not contain backslashes and begins
8347 # with a dollar sign (not a hyphen), so the echo should work correctly.
8348 # The option is referenced via a variable to avoid confusing sed.
8349 lt_compile=`echo "$ac_compile" | $SED \
8350 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8351 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8352 -e 's:$: $lt_compiler_flag:'`
8353 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8354 (eval "$lt_compile" 2>conftest.err)
8355 ac_status=$?
8356 cat conftest.err >&5
8357 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8358 if (exit $ac_status) && test -s "$ac_outfile"; then
8359 # The compiler can only warn and ignore the option if not recognized
8360 # So say no if there are warnings other than the usual output.
8361 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
8362 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8363 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
8364 lt_cv_prog_compiler_rtti_exceptions=yes
8365 fi
8366 fi
8367 $RM conftest*
8368
8369 fi
8370 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
8371 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
8372
8373 if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
8374 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
8375 else
8376 :
8377 fi
8378
8379 fi
8380
8381
8382
8383
8384
8385
8386 lt_prog_compiler_wl=
8387 lt_prog_compiler_pic=
8388 lt_prog_compiler_static=
8389
8390
8391 if test yes = "$GCC"; then
8392 lt_prog_compiler_wl='-Wl,'
8393 lt_prog_compiler_static='-static'
8394
8395 case $host_os in
8396 aix*)
8397 # All AIX code is PIC.
8398 if test ia64 = "$host_cpu"; then
8399 # AIX 5 now supports IA64 processor
8400 lt_prog_compiler_static='-Bstatic'
8401 fi
8402 lt_prog_compiler_pic='-fPIC'
8403 ;;
8404
8405 amigaos*)
8406 case $host_cpu in
8407 powerpc)
8408 # see comment about AmigaOS4 .so support
8409 lt_prog_compiler_pic='-fPIC'
8410 ;;
8411 m68k)
8412 # FIXME: we need at least 68020 code to build shared libraries, but
8413 # adding the '-m68020' flag to GCC prevents building anything better,
8414 # like '-m68040'.
8415 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
8416 ;;
8417 esac
8418 ;;
8419
8420 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
8421 # PIC is the default for these OSes.
8422 ;;
8423
8424 mingw* | cygwin* | pw32* | os2* | cegcc*)
8425 # This hack is so that the source file can tell whether it is being
8426 # built for inclusion in a dll (and should export symbols for example).
8427 # Although the cygwin gcc ignores -fPIC, still need this for old-style
8428 # (--disable-auto-import) libraries
8429 lt_prog_compiler_pic='-DDLL_EXPORT'
8430 case $host_os in
8431 os2*)
8432 lt_prog_compiler_static='$wl-static'
8433 ;;
8434 esac
8435 ;;
8436
8437 darwin* | rhapsody*)
8438 # PIC is the default on this platform
8439 # Common symbols not allowed in MH_DYLIB files
8440 lt_prog_compiler_pic='-fno-common'
8441 ;;
8442
8443 haiku*)
8444 # PIC is the default for Haiku.
8445 # The "-static" flag exists, but is broken.
8446 lt_prog_compiler_static=
8447 ;;
8448
8449 hpux*)
8450 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
8451 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
8452 # sets the default TLS model and affects inlining.
8453 case $host_cpu in
8454 hppa*64*)
8455 # +Z the default
8456 ;;
8457 *)
8458 lt_prog_compiler_pic='-fPIC'
8459 ;;
8460 esac
8461 ;;
8462
8463 interix[3-9]*)
8464 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8465 # Instead, we relocate shared libraries at runtime.
8466 ;;
8467
8468 msdosdjgpp*)
8469 # Just because we use GCC doesn't mean we suddenly get shared libraries
8470 # on systems that don't support them.
8471 lt_prog_compiler_can_build_shared=no
8472 enable_shared=no
8473 ;;
8474
8475 *nto* | *qnx*)
8476 # QNX uses GNU C++, but need to define -shared option too, otherwise
8477 # it will coredump.
8478 lt_prog_compiler_pic='-fPIC -shared'
8479 ;;
8480
8481 sysv4*MP*)
8482 if test -d /usr/nec; then
8483 lt_prog_compiler_pic=-Kconform_pic
8484 fi
8485 ;;
8486
8487 *)
8488 lt_prog_compiler_pic='-fPIC'
8489 ;;
8490 esac
8491
8492 case $cc_basename in
8493 nvcc*) # Cuda Compiler Driver 2.2
8494 lt_prog_compiler_wl='-Xlinker '
8495 if test -n "$lt_prog_compiler_pic"; then
8496 lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
8497 fi
8498 ;;
8499 esac
8500 else
8501 # PORTME Check for flag to pass linker flags through the system compiler.
8502 case $host_os in
8503 aix*)
8504 lt_prog_compiler_wl='-Wl,'
8505 if test ia64 = "$host_cpu"; then
8506 # AIX 5 now supports IA64 processor
8507 lt_prog_compiler_static='-Bstatic'
8508 else
8509 lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
8510 fi
8511 ;;
8512
8513 darwin* | rhapsody*)
8514 # PIC is the default on this platform
8515 # Common symbols not allowed in MH_DYLIB files
8516 lt_prog_compiler_pic='-fno-common'
8517 case $cc_basename in
8518 nagfor*)
8519 # NAG Fortran compiler
8520 lt_prog_compiler_wl='-Wl,-Wl,,'
8521 lt_prog_compiler_pic='-PIC'
8522 lt_prog_compiler_static='-Bstatic'
8523 ;;
8524 esac
8525 ;;
8526
8527 mingw* | cygwin* | pw32* | os2* | cegcc*)
8528 # This hack is so that the source file can tell whether it is being
8529 # built for inclusion in a dll (and should export symbols for example).
8530 lt_prog_compiler_pic='-DDLL_EXPORT'
8531 case $host_os in
8532 os2*)
8533 lt_prog_compiler_static='$wl-static'
8534 ;;
8535 esac
8536 ;;
8537
8538 hpux9* | hpux10* | hpux11*)
8539 lt_prog_compiler_wl='-Wl,'
8540 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8541 # not for PA HP-UX.
8542 case $host_cpu in
8543 hppa*64*|ia64*)
8544 # +Z the default
8545 ;;
8546 *)
8547 lt_prog_compiler_pic='+Z'
8548 ;;
8549 esac
8550 # Is there a better lt_prog_compiler_static that works with the bundled CC?
8551 lt_prog_compiler_static='$wl-a ${wl}archive'
8552 ;;
8553
8554 irix5* | irix6* | nonstopux*)
8555 lt_prog_compiler_wl='-Wl,'
8556 # PIC (with -KPIC) is the default.
8557 lt_prog_compiler_static='-non_shared'
8558 ;;
8559
8560 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
8561 case $cc_basename in
8562 # old Intel for x86_64, which still supported -KPIC.
8563 ecc*)
8564 lt_prog_compiler_wl='-Wl,'
8565 lt_prog_compiler_pic='-KPIC'
8566 lt_prog_compiler_static='-static'
8567 ;;
8568 # icc used to be incompatible with GCC.
8569 # ICC 10 doesn't accept -KPIC any more.
8570 icc* | ifort*)
8571 lt_prog_compiler_wl='-Wl,'
8572 lt_prog_compiler_pic='-fPIC'
8573 lt_prog_compiler_static='-static'
8574 ;;
8575 # Lahey Fortran 8.1.
8576 lf95*)
8577 lt_prog_compiler_wl='-Wl,'
8578 lt_prog_compiler_pic='--shared'
8579 lt_prog_compiler_static='--static'
8580 ;;
8581 nagfor*)
8582 # NAG Fortran compiler
8583 lt_prog_compiler_wl='-Wl,-Wl,,'
8584 lt_prog_compiler_pic='-PIC'
8585 lt_prog_compiler_static='-Bstatic'
8586 ;;
8587 tcc*)
8588 # Fabrice Bellard et al's Tiny C Compiler
8589 lt_prog_compiler_wl='-Wl,'
8590 lt_prog_compiler_pic='-fPIC'
8591 lt_prog_compiler_static='-static'
8592 ;;
8593 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
8594 # Portland Group compilers (*not* the Pentium gcc compiler,
8595 # which looks to be a dead project)
8596 lt_prog_compiler_wl='-Wl,'
8597 lt_prog_compiler_pic='-fpic'
8598 lt_prog_compiler_static='-Bstatic'
8599 ;;
8600 ccc*)
8601 lt_prog_compiler_wl='-Wl,'
8602 # All Alpha code is PIC.
8603 lt_prog_compiler_static='-non_shared'
8604 ;;
8605 xl* | bgxl* | bgf* | mpixl*)
8606 # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
8607 lt_prog_compiler_wl='-Wl,'
8608 lt_prog_compiler_pic='-qpic'
8609 lt_prog_compiler_static='-qstaticlink'
8610 ;;
8611 *)
8612 case `$CC -V 2>&1 | sed 5q` in
8613 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
8614 # Sun Fortran 8.3 passes all unrecognized flags to the linker
8615 lt_prog_compiler_pic='-KPIC'
8616 lt_prog_compiler_static='-Bstatic'
8617 lt_prog_compiler_wl=''
8618 ;;
8619 *Sun\ F* | *Sun*Fortran*)
8620 lt_prog_compiler_pic='-KPIC'
8621 lt_prog_compiler_static='-Bstatic'
8622 lt_prog_compiler_wl='-Qoption ld '
8623 ;;
8624 *Sun\ C*)
8625 # Sun C 5.9
8626 lt_prog_compiler_pic='-KPIC'
8627 lt_prog_compiler_static='-Bstatic'
8628 lt_prog_compiler_wl='-Wl,'
8629 ;;
8630 *Intel*\ [CF]*Compiler*)
8631 lt_prog_compiler_wl='-Wl,'
8632 lt_prog_compiler_pic='-fPIC'
8633 lt_prog_compiler_static='-static'
8634 ;;
8635 *Portland\ Group*)
8636 lt_prog_compiler_wl='-Wl,'
8637 lt_prog_compiler_pic='-fpic'
8638 lt_prog_compiler_static='-Bstatic'
8639 ;;
8640 esac
8641 ;;
8642 esac
8643 ;;
8644
8645 newsos6)
8646 lt_prog_compiler_pic='-KPIC'
8647 lt_prog_compiler_static='-Bstatic'
8648 ;;
8649
8650 *nto* | *qnx*)
8651 # QNX uses GNU C++, but need to define -shared option too, otherwise
8652 # it will coredump.
8653 lt_prog_compiler_pic='-fPIC -shared'
8654 ;;
8655
8656 osf3* | osf4* | osf5*)
8657 lt_prog_compiler_wl='-Wl,'
8658 # All OSF/1 code is PIC.
8659 lt_prog_compiler_static='-non_shared'
8660 ;;
8661
8662 rdos*)
8663 lt_prog_compiler_static='-non_shared'
8664 ;;
8665
8666 solaris*)
8667 lt_prog_compiler_pic='-KPIC'
8668 lt_prog_compiler_static='-Bstatic'
8669 case $cc_basename in
8670 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
8671 lt_prog_compiler_wl='-Qoption ld ';;
8672 *)
8673 lt_prog_compiler_wl='-Wl,';;
8674 esac
8675 ;;
8676
8677 sunos4*)
8678 lt_prog_compiler_wl='-Qoption ld '
8679 lt_prog_compiler_pic='-PIC'
8680 lt_prog_compiler_static='-Bstatic'
8681 ;;
8682
8683 sysv4 | sysv4.2uw2* | sysv4.3*)
8684 lt_prog_compiler_wl='-Wl,'
8685 lt_prog_compiler_pic='-KPIC'
8686 lt_prog_compiler_static='-Bstatic'
8687 ;;
8688
8689 sysv4*MP*)
8690 if test -d /usr/nec; then
8691 lt_prog_compiler_pic='-Kconform_pic'
8692 lt_prog_compiler_static='-Bstatic'
8693 fi
8694 ;;
8695
8696 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8697 lt_prog_compiler_wl='-Wl,'
8698 lt_prog_compiler_pic='-KPIC'
8699 lt_prog_compiler_static='-Bstatic'
8700 ;;
8701
8702 unicos*)
8703 lt_prog_compiler_wl='-Wl,'
8704 lt_prog_compiler_can_build_shared=no
8705 ;;
8706
8707 uts4*)
8708 lt_prog_compiler_pic='-pic'
8709 lt_prog_compiler_static='-Bstatic'
8710 ;;
8711
8712 *)
8713 lt_prog_compiler_can_build_shared=no
8714 ;;
8715 esac
8716 fi
8717
8718 case $host_os in
8719 # For platforms that do not support PIC, -DPIC is meaningless:
8720 *djgpp*)
8721 lt_prog_compiler_pic=
8722 ;;
8723 *)
8724 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
8725 ;;
8726 esac
8727
8728 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
8729 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
8730 if ${lt_cv_prog_compiler_pic+:} false; then :
8731 $as_echo_n "(cached) " >&6
8732 else
8733 lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
8734 fi
8735 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
8736 $as_echo "$lt_cv_prog_compiler_pic" >&6; }
8737 lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
8738
8739 #
8740 # Check to make sure the PIC flag actually works.
8741 #
8742 if test -n "$lt_prog_compiler_pic"; then
8743 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
8744 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
8745 if ${lt_cv_prog_compiler_pic_works+:} false; then :
8746 $as_echo_n "(cached) " >&6
8747 else
8748 lt_cv_prog_compiler_pic_works=no
8749 ac_outfile=conftest.$ac_objext
8750 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8751 lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
8752 # Insert the option either (1) after the last *FLAGS variable, or
8753 # (2) before a word containing "conftest.", or (3) at the end.
8754 # Note that $ac_compile itself does not contain backslashes and begins
8755 # with a dollar sign (not a hyphen), so the echo should work correctly.
8756 # The option is referenced via a variable to avoid confusing sed.
8757 lt_compile=`echo "$ac_compile" | $SED \
8758 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8759 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8760 -e 's:$: $lt_compiler_flag:'`
8761 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8762 (eval "$lt_compile" 2>conftest.err)
8763 ac_status=$?
8764 cat conftest.err >&5
8765 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8766 if (exit $ac_status) && test -s "$ac_outfile"; then
8767 # The compiler can only warn and ignore the option if not recognized
8768 # So say no if there are warnings other than the usual output.
8769 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
8770 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8771 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
8772 lt_cv_prog_compiler_pic_works=yes
8773 fi
8774 fi
8775 $RM conftest*
8776
8777 fi
8778 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
8779 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
8780
8781 if test yes = "$lt_cv_prog_compiler_pic_works"; then
8782 case $lt_prog_compiler_pic in
8783 "" | " "*) ;;
8784 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
8785 esac
8786 else
8787 lt_prog_compiler_pic=
8788 lt_prog_compiler_can_build_shared=no
8789 fi
8790
8791 fi
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803 #
8804 # Check to make sure the static flag actually works.
8805 #
8806 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
8807 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
8808 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
8809 if ${lt_cv_prog_compiler_static_works+:} false; then :
8810 $as_echo_n "(cached) " >&6
8811 else
8812 lt_cv_prog_compiler_static_works=no
8813 save_LDFLAGS=$LDFLAGS
8814 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
8815 echo "$lt_simple_link_test_code" > conftest.$ac_ext
8816 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
8817 # The linker can only warn and ignore the option if not recognized
8818 # So say no if there are warnings
8819 if test -s conftest.err; then
8820 # Append any errors to the config.log.
8821 cat conftest.err 1>&5
8822 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
8823 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8824 if diff conftest.exp conftest.er2 >/dev/null; then
8825 lt_cv_prog_compiler_static_works=yes
8826 fi
8827 else
8828 lt_cv_prog_compiler_static_works=yes
8829 fi
8830 fi
8831 $RM -r conftest*
8832 LDFLAGS=$save_LDFLAGS
8833
8834 fi
8835 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
8836 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
8837
8838 if test yes = "$lt_cv_prog_compiler_static_works"; then
8839 :
8840 else
8841 lt_prog_compiler_static=
8842 fi
8843
8844
8845
8846
8847
8848
8849
8850 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8851 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8852 if ${lt_cv_prog_compiler_c_o+:} false; then :
8853 $as_echo_n "(cached) " >&6
8854 else
8855 lt_cv_prog_compiler_c_o=no
8856 $RM -r conftest 2>/dev/null
8857 mkdir conftest
8858 cd conftest
8859 mkdir out
8860 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8861
8862 lt_compiler_flag="-o out/conftest2.$ac_objext"
8863 # Insert the option either (1) after the last *FLAGS variable, or
8864 # (2) before a word containing "conftest.", or (3) at the end.
8865 # Note that $ac_compile itself does not contain backslashes and begins
8866 # with a dollar sign (not a hyphen), so the echo should work correctly.
8867 lt_compile=`echo "$ac_compile" | $SED \
8868 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8869 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8870 -e 's:$: $lt_compiler_flag:'`
8871 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8872 (eval "$lt_compile" 2>out/conftest.err)
8873 ac_status=$?
8874 cat out/conftest.err >&5
8875 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8876 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8877 then
8878 # The compiler can only warn and ignore the option if not recognized
8879 # So say no if there are warnings
8880 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
8881 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8882 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8883 lt_cv_prog_compiler_c_o=yes
8884 fi
8885 fi
8886 chmod u+w . 2>&5
8887 $RM conftest*
8888 # SGI C++ compiler will create directory out/ii_files/ for
8889 # template instantiation
8890 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8891 $RM out/* && rmdir out
8892 cd ..
8893 $RM -r conftest
8894 $RM conftest*
8895
8896 fi
8897 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8898 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8899
8900
8901
8902
8903
8904
8905 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8906 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8907 if ${lt_cv_prog_compiler_c_o+:} false; then :
8908 $as_echo_n "(cached) " >&6
8909 else
8910 lt_cv_prog_compiler_c_o=no
8911 $RM -r conftest 2>/dev/null
8912 mkdir conftest
8913 cd conftest
8914 mkdir out
8915 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8916
8917 lt_compiler_flag="-o out/conftest2.$ac_objext"
8918 # Insert the option either (1) after the last *FLAGS variable, or
8919 # (2) before a word containing "conftest.", or (3) at the end.
8920 # Note that $ac_compile itself does not contain backslashes and begins
8921 # with a dollar sign (not a hyphen), so the echo should work correctly.
8922 lt_compile=`echo "$ac_compile" | $SED \
8923 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8924 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8925 -e 's:$: $lt_compiler_flag:'`
8926 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8927 (eval "$lt_compile" 2>out/conftest.err)
8928 ac_status=$?
8929 cat out/conftest.err >&5
8930 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8931 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8932 then
8933 # The compiler can only warn and ignore the option if not recognized
8934 # So say no if there are warnings
8935 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
8936 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8937 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8938 lt_cv_prog_compiler_c_o=yes
8939 fi
8940 fi
8941 chmod u+w . 2>&5
8942 $RM conftest*
8943 # SGI C++ compiler will create directory out/ii_files/ for
8944 # template instantiation
8945 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8946 $RM out/* && rmdir out
8947 cd ..
8948 $RM -r conftest
8949 $RM conftest*
8950
8951 fi
8952 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8953 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8954
8955
8956
8957
8958 hard_links=nottested
8959 if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
8960 # do not overwrite the value of need_locks provided by the user
8961 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
8962 $as_echo_n "checking if we can lock with hard links... " >&6; }
8963 hard_links=yes
8964 $RM conftest*
8965 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8966 touch conftest.a
8967 ln conftest.a conftest.b 2>&5 || hard_links=no
8968 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8969 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
8970 $as_echo "$hard_links" >&6; }
8971 if test no = "$hard_links"; then
8972 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
8973 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
8974 need_locks=warn
8975 fi
8976 else
8977 need_locks=no
8978 fi
8979
8980
8981
8982
8983
8984
8985 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
8986 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
8987
8988 runpath_var=
8989 allow_undefined_flag=
8990 always_export_symbols=no
8991 archive_cmds=
8992 archive_expsym_cmds=
8993 compiler_needs_object=no
8994 enable_shared_with_static_runtimes=no
8995 export_dynamic_flag_spec=
8996 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8997 hardcode_automatic=no
8998 hardcode_direct=no
8999 hardcode_direct_absolute=no
9000 hardcode_libdir_flag_spec=
9001 hardcode_libdir_separator=
9002 hardcode_minus_L=no
9003 hardcode_shlibpath_var=unsupported
9004 inherit_rpath=no
9005 link_all_deplibs=unknown
9006 module_cmds=
9007 module_expsym_cmds=
9008 old_archive_from_new_cmds=
9009 old_archive_from_expsyms_cmds=
9010 thread_safe_flag_spec=
9011 whole_archive_flag_spec=
9012 # include_expsyms should be a list of space-separated symbols to be *always*
9013 # included in the symbol list
9014 include_expsyms=
9015 # exclude_expsyms can be an extended regexp of symbols to exclude
9016 # it will be wrapped by ' (' and ')$', so one must not match beginning or
9017 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
9018 # as well as any symbol that contains 'd'.
9019 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
9020 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
9021 # platforms (ab)use it in PIC code, but their linkers get confused if
9022 # the symbol is explicitly referenced. Since portable code cannot
9023 # rely on this symbol name, it's probably fine to never include it in
9024 # preloaded symbol tables.
9025 # Exclude shared library initialization/finalization symbols.
9026 extract_expsyms_cmds=
9027
9028 case $host_os in
9029 cygwin* | mingw* | pw32* | cegcc*)
9030 # FIXME: the MSVC++ port hasn't been tested in a loooong time
9031 # When not using gcc, we currently assume that we are using
9032 # Microsoft Visual C++.
9033 if test yes != "$GCC"; then
9034 with_gnu_ld=no
9035 fi
9036 ;;
9037 interix*)
9038 # we just hope/assume this is gcc and not c89 (= MSVC++)
9039 with_gnu_ld=yes
9040 ;;
9041 openbsd* | bitrig*)
9042 with_gnu_ld=no
9043 ;;
9044 esac
9045
9046 ld_shlibs=yes
9047
9048 # On some targets, GNU ld is compatible enough with the native linker
9049 # that we're better off using the native interface for both.
9050 lt_use_gnu_ld_interface=no
9051 if test yes = "$with_gnu_ld"; then
9052 case $host_os in
9053 aix*)
9054 # The AIX port of GNU ld has always aspired to compatibility
9055 # with the native linker. However, as the warning in the GNU ld
9056 # block says, versions before 2.19.5* couldn't really create working
9057 # shared libraries, regardless of the interface used.
9058 case `$LD -v 2>&1` in
9059 *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
9060 *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
9061 *\ \(GNU\ Binutils\)\ [3-9]*) ;;
9062 *)
9063 lt_use_gnu_ld_interface=yes
9064 ;;
9065 esac
9066 ;;
9067 *)
9068 lt_use_gnu_ld_interface=yes
9069 ;;
9070 esac
9071 fi
9072
9073 if test yes = "$lt_use_gnu_ld_interface"; then
9074 # If archive_cmds runs LD, not CC, wlarc should be empty
9075 wlarc='$wl'
9076
9077 # Set some defaults for GNU ld with shared library support. These
9078 # are reset later if shared libraries are not supported. Putting them
9079 # here allows them to be overridden if necessary.
9080 runpath_var=LD_RUN_PATH
9081 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9082 export_dynamic_flag_spec='$wl--export-dynamic'
9083 # ancient GNU ld didn't support --whole-archive et. al.
9084 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
9085 whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
9086 else
9087 whole_archive_flag_spec=
9088 fi
9089 supports_anon_versioning=no
9090 case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
9091 *GNU\ gold*) supports_anon_versioning=yes ;;
9092 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
9093 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
9094 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
9095 *\ 2.11.*) ;; # other 2.11 versions
9096 *) supports_anon_versioning=yes ;;
9097 esac
9098
9099 # See if GNU ld supports shared libraries.
9100 case $host_os in
9101 aix[3-9]*)
9102 # On AIX/PPC, the GNU linker is very broken
9103 if test ia64 != "$host_cpu"; then
9104 ld_shlibs=no
9105 cat <<_LT_EOF 1>&2
9106
9107 *** Warning: the GNU linker, at least up to release 2.19, is reported
9108 *** to be unable to reliably create shared libraries on AIX.
9109 *** Therefore, libtool is disabling shared libraries support. If you
9110 *** really care for shared libraries, you may want to install binutils
9111 *** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
9112 *** You will then need to restart the configuration process.
9113
9114 _LT_EOF
9115 fi
9116 ;;
9117
9118 amigaos*)
9119 case $host_cpu in
9120 powerpc)
9121 # see comment about AmigaOS4 .so support
9122 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9123 archive_expsym_cmds=''
9124 ;;
9125 m68k)
9126 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
9127 hardcode_libdir_flag_spec='-L$libdir'
9128 hardcode_minus_L=yes
9129 ;;
9130 esac
9131 ;;
9132
9133 beos*)
9134 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9135 allow_undefined_flag=unsupported
9136 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9137 # support --undefined. This deserves some investigation. FIXME
9138 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9139 else
9140 ld_shlibs=no
9141 fi
9142 ;;
9143
9144 cygwin* | mingw* | pw32* | cegcc*)
9145 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
9146 # as there is no search path for DLLs.
9147 hardcode_libdir_flag_spec='-L$libdir'
9148 export_dynamic_flag_spec='$wl--export-all-symbols'
9149 allow_undefined_flag=unsupported
9150 always_export_symbols=no
9151 enable_shared_with_static_runtimes=yes
9152 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
9153 exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
9154
9155 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
9156 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9157 # If the export-symbols file already is a .def file, use it as
9158 # is; otherwise, prepend EXPORTS...
9159 archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
9160 cp $export_symbols $output_objdir/$soname.def;
9161 else
9162 echo EXPORTS > $output_objdir/$soname.def;
9163 cat $export_symbols >> $output_objdir/$soname.def;
9164 fi~
9165 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9166 else
9167 ld_shlibs=no
9168 fi
9169 ;;
9170
9171 haiku*)
9172 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9173 link_all_deplibs=yes
9174 ;;
9175
9176 os2*)
9177 hardcode_libdir_flag_spec='-L$libdir'
9178 hardcode_minus_L=yes
9179 allow_undefined_flag=unsupported
9180 shrext_cmds=.dll
9181 archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9182 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9183 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9184 $ECHO EXPORTS >> $output_objdir/$libname.def~
9185 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9186 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9187 emximp -o $lib $output_objdir/$libname.def'
9188 archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9189 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9190 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9191 $ECHO EXPORTS >> $output_objdir/$libname.def~
9192 prefix_cmds="$SED"~
9193 if test EXPORTS = "`$SED 1q $export_symbols`"; then
9194 prefix_cmds="$prefix_cmds -e 1d";
9195 fi~
9196 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9197 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9198 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9199 emximp -o $lib $output_objdir/$libname.def'
9200 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9201 enable_shared_with_static_runtimes=yes
9202 ;;
9203
9204 interix[3-9]*)
9205 hardcode_direct=no
9206 hardcode_shlibpath_var=no
9207 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
9208 export_dynamic_flag_spec='$wl-E'
9209 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
9210 # Instead, shared libraries are loaded at an image base (0x10000000 by
9211 # default) and relocated if they conflict, which is a slow very memory
9212 # consuming and fragmenting process. To avoid this, we pick a random,
9213 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
9214 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
9215 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9216 archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9217 ;;
9218
9219 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
9220 tmp_diet=no
9221 if test linux-dietlibc = "$host_os"; then
9222 case $cc_basename in
9223 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
9224 esac
9225 fi
9226 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
9227 && test no = "$tmp_diet"
9228 then
9229 tmp_addflag=' $pic_flag'
9230 tmp_sharedflag='-shared'
9231 case $cc_basename,$host_cpu in
9232 pgcc*) # Portland Group C compiler
9233 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9234 tmp_addflag=' $pic_flag'
9235 ;;
9236 pgf77* | pgf90* | pgf95* | pgfortran*)
9237 # Portland Group f77 and f90 compilers
9238 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9239 tmp_addflag=' $pic_flag -Mnomain' ;;
9240 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
9241 tmp_addflag=' -i_dynamic' ;;
9242 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
9243 tmp_addflag=' -i_dynamic -nofor_main' ;;
9244 ifc* | ifort*) # Intel Fortran compiler
9245 tmp_addflag=' -nofor_main' ;;
9246 lf95*) # Lahey Fortran 8.1
9247 whole_archive_flag_spec=
9248 tmp_sharedflag='--shared' ;;
9249 nagfor*) # NAGFOR 5.3
9250 tmp_sharedflag='-Wl,-shared' ;;
9251 xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
9252 tmp_sharedflag='-qmkshrobj'
9253 tmp_addflag= ;;
9254 nvcc*) # Cuda Compiler Driver 2.2
9255 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9256 compiler_needs_object=yes
9257 ;;
9258 esac
9259 case `$CC -V 2>&1 | sed 5q` in
9260 *Sun\ C*) # Sun C 5.9
9261 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
9262 compiler_needs_object=yes
9263 tmp_sharedflag='-G' ;;
9264 *Sun\ F*) # Sun Fortran 8.3
9265 tmp_sharedflag='-G' ;;
9266 esac
9267 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9268
9269 if test yes = "$supports_anon_versioning"; then
9270 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9271 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9272 echo "local: *; };" >> $output_objdir/$libname.ver~
9273 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
9274 fi
9275
9276 case $cc_basename in
9277 tcc*)
9278 export_dynamic_flag_spec='-rdynamic'
9279 ;;
9280 xlf* | bgf* | bgxlf* | mpixlf*)
9281 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
9282 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
9283 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9284 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
9285 if test yes = "$supports_anon_versioning"; then
9286 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9287 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9288 echo "local: *; };" >> $output_objdir/$libname.ver~
9289 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
9290 fi
9291 ;;
9292 esac
9293 else
9294 ld_shlibs=no
9295 fi
9296 ;;
9297
9298 netbsd*)
9299 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9300 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
9301 wlarc=
9302 else
9303 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9304 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9305 fi
9306 ;;
9307
9308 solaris*)
9309 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
9310 ld_shlibs=no
9311 cat <<_LT_EOF 1>&2
9312
9313 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
9314 *** create shared libraries on Solaris systems. Therefore, libtool
9315 *** is disabling shared libraries support. We urge you to upgrade GNU
9316 *** binutils to release 2.9.1 or newer. Another option is to modify
9317 *** your PATH or compiler configuration so that the native linker is
9318 *** used, and then restart.
9319
9320 _LT_EOF
9321 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9322 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9323 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9324 else
9325 ld_shlibs=no
9326 fi
9327 ;;
9328
9329 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
9330 case `$LD -v 2>&1` in
9331 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
9332 ld_shlibs=no
9333 cat <<_LT_EOF 1>&2
9334
9335 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
9336 *** reliably create shared libraries on SCO systems. Therefore, libtool
9337 *** is disabling shared libraries support. We urge you to upgrade GNU
9338 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
9339 *** your PATH or compiler configuration so that the native linker is
9340 *** used, and then restart.
9341
9342 _LT_EOF
9343 ;;
999344 *)
100 echo "$1 = \"$2\"" >> $cnf_mk_file
9345 # For security reasons, it is highly recommended that you always
9346 # use absolute paths for naming shared libraries, and exclude the
9347 # DT_RUNPATH tag from executables and libraries. But doing so
9348 # requires that you compile everything twice, which is a pain.
9349 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9350 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9351 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9352 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9353 else
9354 ld_shlibs=no
9355 fi
9356 ;;
9357 esac
9358 ;;
9359
9360 sunos4*)
9361 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9362 wlarc=
9363 hardcode_direct=yes
9364 hardcode_shlibpath_var=no
9365 ;;
9366
9367 *)
9368 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9369 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9370 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
9371 else
9372 ld_shlibs=no
9373 fi
9374 ;;
9375 esac
9376
9377 if test no = "$ld_shlibs"; then
9378 runpath_var=
9379 hardcode_libdir_flag_spec=
9380 export_dynamic_flag_spec=
9381 whole_archive_flag_spec=
9382 fi
9383 else
9384 # PORTME fill in a description of your system's linker (not GNU ld)
9385 case $host_os in
9386 aix3*)
9387 allow_undefined_flag=unsupported
9388 always_export_symbols=yes
9389 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
9390 # Note: this linker hardcodes the directories in LIBPATH if there
9391 # are no directories specified by -L.
9392 hardcode_minus_L=yes
9393 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
9394 # Neither direct hardcoding nor static linking is supported with a
9395 # broken collect2.
9396 hardcode_direct=unsupported
9397 fi
9398 ;;
9399
9400 aix[4-9]*)
9401 if test ia64 = "$host_cpu"; then
9402 # On IA64, the linker does run time linking by default, so we don't
9403 # have to do anything special.
9404 aix_use_runtimelinking=no
9405 exp_sym_flag='-Bexport'
9406 no_entry_flag=
9407 else
9408 # If we're using GNU nm, then we don't want the "-C" option.
9409 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
9410 # Without the "-l" option, or with the "-B" option, AIX nm treats
9411 # weak defined symbols like other global defined symbols, whereas
9412 # GNU nm marks them as "W".
9413 # While the 'weak' keyword is ignored in the Export File, we need
9414 # it in the Import File for the 'aix-soname' feature, so we have
9415 # to replace the "-B" option with "-P" for AIX nm.
9416 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
9417 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'
9418 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'
9420 fi
9421 aix_use_runtimelinking=no
9422
9423 # Test if we are trying to use run time linking or normal
9424 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
9425 # have runtime linking enabled, and use it for executables.
9426 # For shared libraries, we enable/disable runtime linking
9427 # depending on the kind of the shared library created -
9428 # when "with_aix_soname,aix_use_runtimelinking" is:
9429 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
9430 # "aix,yes" lib.so shared, rtl:yes, for executables
9431 # lib.a static archive
9432 # "both,no" lib.so.V(shr.o) shared, rtl:yes
9433 # lib.a(lib.so.V) shared, rtl:no, for executables
9434 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
9435 # lib.a(lib.so.V) shared, rtl:no
9436 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
9437 # lib.a static archive
9438 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
9439 for ld_flag in $LDFLAGS; do
9440 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
9441 aix_use_runtimelinking=yes
9442 break
9443 fi
9444 done
9445 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
9446 # With aix-soname=svr4, we create the lib.so.V shared archives only,
9447 # so we don't have lib.a shared libs to link our executables.
9448 # We have to force runtime linking in this case.
9449 aix_use_runtimelinking=yes
9450 LDFLAGS="$LDFLAGS -Wl,-brtl"
9451 fi
9452 ;;
1019453 esac
9454
9455 exp_sym_flag='-bexport'
9456 no_entry_flag='-bnoentry'
9457 fi
9458
9459 # When large executables or shared objects are built, AIX ld can
9460 # have problems creating the table of contents. If linking a library
9461 # or program results in "error TOC overflow" add -mminimal-toc to
9462 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
9463 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9464
9465 archive_cmds=''
9466 hardcode_direct=yes
9467 hardcode_direct_absolute=yes
9468 hardcode_libdir_separator=':'
9469 link_all_deplibs=yes
9470 file_list_spec='$wl-f,'
9471 case $with_aix_soname,$aix_use_runtimelinking in
9472 aix,*) ;; # traditional, no import file
9473 svr4,* | *,yes) # use import file
9474 # The Import File defines what to hardcode.
9475 hardcode_direct=no
9476 hardcode_direct_absolute=no
9477 ;;
9478 esac
9479
9480 if test yes = "$GCC"; then
9481 case $host_os in aix4.[012]|aix4.[012].*)
9482 # We only want to do this on AIX 4.2 and lower, the check
9483 # below for broken collect2 doesn't work under 4.3+
9484 collect2name=`$CC -print-prog-name=collect2`
9485 if test -f "$collect2name" &&
9486 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
9487 then
9488 # We have reworked collect2
9489 :
9490 else
9491 # We have old collect2
9492 hardcode_direct=unsupported
9493 # It fails to find uninstalled libraries when the uninstalled
9494 # path is not listed in the libpath. Setting hardcode_minus_L
9495 # to unsupported forces relinking
9496 hardcode_minus_L=yes
9497 hardcode_libdir_flag_spec='-L$libdir'
9498 hardcode_libdir_separator=
9499 fi
9500 ;;
9501 esac
9502 shared_flag='-shared'
9503 if test yes = "$aix_use_runtimelinking"; then
9504 shared_flag="$shared_flag "'$wl-G'
9505 fi
9506 # Need to ensure runtime linking is disabled for the traditional
9507 # shared library, or the linker may eventually find shared libraries
9508 # /with/ Import File - we do not want to mix them.
9509 shared_flag_aix='-shared'
9510 shared_flag_svr4='-shared $wl-G'
9511 else
9512 # not using gcc
9513 if test ia64 = "$host_cpu"; then
9514 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9515 # chokes on -Wl,-G. The following line is correct:
9516 shared_flag='-G'
9517 else
9518 if test yes = "$aix_use_runtimelinking"; then
9519 shared_flag='$wl-G'
9520 else
9521 shared_flag='$wl-bM:SRE'
9522 fi
9523 shared_flag_aix='$wl-bM:SRE'
9524 shared_flag_svr4='$wl-G'
9525 fi
9526 fi
9527
9528 export_dynamic_flag_spec='$wl-bexpall'
9529 # It seems that -bexpall does not export symbols beginning with
9530 # underscore (_), so it is better to generate a list of symbols to export.
9531 always_export_symbols=yes
9532 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
9533 # Warning - without using the other runtime loading flags (-brtl),
9534 # -berok will link without error, but may produce a broken library.
9535 allow_undefined_flag='-berok'
9536 # Determine the default libpath from the value encoded in an
9537 # empty executable.
9538 if test set = "${lt_cv_aix_libpath+set}"; then
9539 aix_libpath=$lt_cv_aix_libpath
9540 else
9541 if ${lt_cv_aix_libpath_+:} false; then :
9542 $as_echo_n "(cached) " >&6
9543 else
9544 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9545 /* end confdefs.h. */
9546
9547 int
9548 main ()
9549 {
9550
9551 ;
9552 return 0;
1029553 }
103
104 function cnf_h_header() {
105 echo "/* generated by configure on $(date -R) */" >> $cnf_h_file
106 echo "/* options: \"$opt_str\" */" >> $cnf_h_file
107 echo "" >> $cnf_h_file
108 echo "#ifndef _CONFIGURE_H" >> $cnf_h_file
109 echo "#define _CONFIGURE_H" >> $cnf_h_file
110 echo "" >> $cnf_h_file
9554 _ACEOF
9555 if ac_fn_c_try_link "$LINENO"; then :
9556
9557 lt_aix_libpath_sed='
9558 /Import File Strings/,/^$/ {
9559 /^0/ {
9560 s/^0 *\([^ ]*\) *$/\1/
9561 p
9562 }
9563 }'
9564 lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9565 # Check for a 64-bit object if we didn't find anything.
9566 if test -z "$lt_cv_aix_libpath_"; then
9567 lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9568 fi
9569 fi
9570 rm -f core conftest.err conftest.$ac_objext \
9571 conftest$ac_exeext conftest.$ac_ext
9572 if test -z "$lt_cv_aix_libpath_"; then
9573 lt_cv_aix_libpath_=/usr/lib:/lib
9574 fi
9575
9576 fi
9577
9578 aix_libpath=$lt_cv_aix_libpath_
9579 fi
9580
9581 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
9582 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
9583 else
9584 if test ia64 = "$host_cpu"; then
9585 hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
9586 allow_undefined_flag="-z nodefs"
9587 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
9588 else
9589 # Determine the default libpath from the value encoded in an
9590 # empty executable.
9591 if test set = "${lt_cv_aix_libpath+set}"; then
9592 aix_libpath=$lt_cv_aix_libpath
9593 else
9594 if ${lt_cv_aix_libpath_+:} false; then :
9595 $as_echo_n "(cached) " >&6
9596 else
9597 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9598 /* end confdefs.h. */
9599
9600 int
9601 main ()
9602 {
9603
9604 ;
9605 return 0;
1119606 }
112
113 function cnf_h_footer() {
114 echo "" >> $cnf_h_file
115 echo "#endif" >> $cnf_h_file
116 echo "" >> $cnf_h_file
9607 _ACEOF
9608 if ac_fn_c_try_link "$LINENO"; then :
9609
9610 lt_aix_libpath_sed='
9611 /Import File Strings/,/^$/ {
9612 /^0/ {
9613 s/^0 *\([^ ]*\) *$/\1/
9614 p
9615 }
9616 }'
9617 lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9618 # Check for a 64-bit object if we didn't find anything.
9619 if test -z "$lt_cv_aix_libpath_"; then
9620 lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9621 fi
9622 fi
9623 rm -f core conftest.err conftest.$ac_objext \
9624 conftest$ac_exeext conftest.$ac_ext
9625 if test -z "$lt_cv_aix_libpath_"; then
9626 lt_cv_aix_libpath_=/usr/lib:/lib
9627 fi
9628
9629 fi
9630
9631 aix_libpath=$lt_cv_aix_libpath_
9632 fi
9633
9634 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
9635 # Warning - without using the other run time loading flags,
9636 # -berok will link without error, but may produce a broken library.
9637 no_undefined_flag=' $wl-bernotok'
9638 allow_undefined_flag=' $wl-berok'
9639 if test yes = "$with_gnu_ld"; then
9640 # We only use this code for GNU lds that support --whole-archive.
9641 whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
9642 else
9643 # Exported symbols can be pulled into shared objects from archives
9644 whole_archive_flag_spec='$convenience'
9645 fi
9646 archive_cmds_need_lc=yes
9647 archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
9648 # -brtl affects multiple linker settings, -berok does not and is overridden later
9649 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
9650 if test svr4 != "$with_aix_soname"; then
9651 # This is similar to how AIX traditionally builds its shared libraries.
9652 archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
9653 fi
9654 if test aix != "$with_aix_soname"; then
9655 archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
9656 else
9657 # used by -dlpreopen to get the symbols
9658 archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
9659 fi
9660 archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
9661 fi
9662 fi
9663 ;;
9664
9665 amigaos*)
9666 case $host_cpu in
9667 powerpc)
9668 # see comment about AmigaOS4 .so support
9669 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
9670 archive_expsym_cmds=''
9671 ;;
9672 m68k)
9673 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
9674 hardcode_libdir_flag_spec='-L$libdir'
9675 hardcode_minus_L=yes
9676 ;;
9677 esac
9678 ;;
9679
9680 bsdi[45]*)
9681 export_dynamic_flag_spec=-rdynamic
9682 ;;
9683
9684 cygwin* | mingw* | pw32* | cegcc*)
9685 # When not using gcc, we currently assume that we are using
9686 # Microsoft Visual C++.
9687 # hardcode_libdir_flag_spec is actually meaningless, as there is
9688 # no search path for DLLs.
9689 case $cc_basename in
9690 cl*)
9691 # Native MSVC
9692 hardcode_libdir_flag_spec=' '
9693 allow_undefined_flag=unsupported
9694 always_export_symbols=yes
9695 file_list_spec='@'
9696 # Tell ltmain to make .lib files, not .a files.
9697 libext=lib
9698 # Tell ltmain to make .dll files, not .so files.
9699 shrext_cmds=.dll
9700 # FIXME: Setting linknames here is a bad hack.
9701 archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
9702 archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
9703 cp "$export_symbols" "$output_objdir/$soname.def";
9704 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
9705 else
9706 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
9707 fi~
9708 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9709 linknames='
9710 # The linker will not automatically build a static lib if we build a DLL.
9711 # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
9712 enable_shared_with_static_runtimes=yes
9713 exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
9714 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
9715 # Don't use ranlib
9716 old_postinstall_cmds='chmod 644 $oldlib'
9717 postlink_cmds='lt_outputfile="@OUTPUT@"~
9718 lt_tool_outputfile="@TOOL_OUTPUT@"~
9719 case $lt_outputfile in
9720 *.exe|*.EXE) ;;
9721 *)
9722 lt_outputfile=$lt_outputfile.exe
9723 lt_tool_outputfile=$lt_tool_outputfile.exe
9724 ;;
9725 esac~
9726 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
9727 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9728 $RM "$lt_outputfile.manifest";
9729 fi'
9730 ;;
9731 *)
9732 # Assume MSVC wrapper
9733 hardcode_libdir_flag_spec=' '
9734 allow_undefined_flag=unsupported
9735 # Tell ltmain to make .lib files, not .a files.
9736 libext=lib
9737 # Tell ltmain to make .dll files, not .so files.
9738 shrext_cmds=.dll
9739 # FIXME: Setting linknames here is a bad hack.
9740 archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
9741 # The linker will automatically build a .lib file if we build a DLL.
9742 old_archive_from_new_cmds='true'
9743 # FIXME: Should let the user specify the lib program.
9744 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
9745 enable_shared_with_static_runtimes=yes
9746 ;;
9747 esac
9748 ;;
9749
9750 darwin* | rhapsody*)
9751
9752
9753 archive_cmds_need_lc=no
9754 hardcode_direct=no
9755 hardcode_automatic=yes
9756 hardcode_shlibpath_var=unsupported
9757 if test yes = "$lt_cv_ld_force_load"; then
9758 whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
9759
9760 else
9761 whole_archive_flag_spec=''
9762 fi
9763 link_all_deplibs=yes
9764 allow_undefined_flag=$_lt_dar_allow_undefined
9765 case $cc_basename in
9766 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
9767 *) _lt_dar_can_shared=$GCC ;;
9768 esac
9769 if test yes = "$_lt_dar_can_shared"; then
9770 output_verbose_link_cmd=func_echo_all
9771 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
9772 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
9773 archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
9774 module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
9775
9776 else
9777 ld_shlibs=no
9778 fi
9779
9780 ;;
9781
9782 dgux*)
9783 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9784 hardcode_libdir_flag_spec='-L$libdir'
9785 hardcode_shlibpath_var=no
9786 ;;
9787
9788 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
9789 # support. Future versions do this automatically, but an explicit c++rt0.o
9790 # does not break anything, and helps significantly (at the cost of a little
9791 # extra space).
9792 freebsd2.2*)
9793 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
9794 hardcode_libdir_flag_spec='-R$libdir'
9795 hardcode_direct=yes
9796 hardcode_shlibpath_var=no
9797 ;;
9798
9799 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9800 freebsd2.*)
9801 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9802 hardcode_direct=yes
9803 hardcode_minus_L=yes
9804 hardcode_shlibpath_var=no
9805 ;;
9806
9807 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9808 freebsd* | dragonfly*)
9809 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9810 hardcode_libdir_flag_spec='-R$libdir'
9811 hardcode_direct=yes
9812 hardcode_shlibpath_var=no
9813 ;;
9814
9815 hpux9*)
9816 if test yes = "$GCC"; then
9817 archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9818 else
9819 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
9820 fi
9821 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
9822 hardcode_libdir_separator=:
9823 hardcode_direct=yes
9824
9825 # hardcode_minus_L: Not really in the search PATH,
9826 # but as the default location of the library.
9827 hardcode_minus_L=yes
9828 export_dynamic_flag_spec='$wl-E'
9829 ;;
9830
9831 hpux10*)
9832 if test yes,no = "$GCC,$with_gnu_ld"; then
9833 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9834 else
9835 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9836 fi
9837 if test no = "$with_gnu_ld"; then
9838 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
9839 hardcode_libdir_separator=:
9840 hardcode_direct=yes
9841 hardcode_direct_absolute=yes
9842 export_dynamic_flag_spec='$wl-E'
9843 # hardcode_minus_L: Not really in the search PATH,
9844 # but as the default location of the library.
9845 hardcode_minus_L=yes
9846 fi
9847 ;;
9848
9849 hpux11*)
9850 if test yes,no = "$GCC,$with_gnu_ld"; then
9851 case $host_cpu in
9852 hppa*64*)
9853 archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9854 ;;
9855 ia64*)
9856 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9857 ;;
9858 *)
9859 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9860 ;;
9861 esac
9862 else
9863 case $host_cpu in
9864 hppa*64*)
9865 archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9866 ;;
9867 ia64*)
9868 archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9869 ;;
9870 *)
9871
9872 # Older versions of the 11.00 compiler do not understand -b yet
9873 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
9874 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
9875 $as_echo_n "checking if $CC understands -b... " >&6; }
9876 if ${lt_cv_prog_compiler__b+:} false; then :
9877 $as_echo_n "(cached) " >&6
9878 else
9879 lt_cv_prog_compiler__b=no
9880 save_LDFLAGS=$LDFLAGS
9881 LDFLAGS="$LDFLAGS -b"
9882 echo "$lt_simple_link_test_code" > conftest.$ac_ext
9883 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
9884 # The linker can only warn and ignore the option if not recognized
9885 # So say no if there are warnings
9886 if test -s conftest.err; then
9887 # Append any errors to the config.log.
9888 cat conftest.err 1>&5
9889 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
9890 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
9891 if diff conftest.exp conftest.er2 >/dev/null; then
9892 lt_cv_prog_compiler__b=yes
9893 fi
9894 else
9895 lt_cv_prog_compiler__b=yes
9896 fi
9897 fi
9898 $RM -r conftest*
9899 LDFLAGS=$save_LDFLAGS
9900
9901 fi
9902 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
9903 $as_echo "$lt_cv_prog_compiler__b" >&6; }
9904
9905 if test yes = "$lt_cv_prog_compiler__b"; then
9906 archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9907 else
9908 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9909 fi
9910
9911 ;;
9912 esac
9913 fi
9914 if test no = "$with_gnu_ld"; then
9915 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
9916 hardcode_libdir_separator=:
9917
9918 case $host_cpu in
9919 hppa*64*|ia64*)
9920 hardcode_direct=no
9921 hardcode_shlibpath_var=no
9922 ;;
9923 *)
9924 hardcode_direct=yes
9925 hardcode_direct_absolute=yes
9926 export_dynamic_flag_spec='$wl-E'
9927
9928 # hardcode_minus_L: Not really in the search PATH,
9929 # but as the default location of the library.
9930 hardcode_minus_L=yes
9931 ;;
9932 esac
9933 fi
9934 ;;
9935
9936 irix5* | irix6* | nonstopux*)
9937 if test yes = "$GCC"; then
9938 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9939 # Try to use the -exported_symbol ld option, if it does not
9940 # work, assume that -exports_file does not work either and
9941 # implicitly export all symbols.
9942 # This should be the same for all languages, so no per-tag cache variable.
9943 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
9944 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
9945 if ${lt_cv_irix_exported_symbol+:} false; then :
9946 $as_echo_n "(cached) " >&6
9947 else
9948 save_LDFLAGS=$LDFLAGS
9949 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
9950 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9951 /* end confdefs.h. */
9952 int foo (void) { return 0; }
9953 _ACEOF
9954 if ac_fn_c_try_link "$LINENO"; then :
9955 lt_cv_irix_exported_symbol=yes
9956 else
9957 lt_cv_irix_exported_symbol=no
9958 fi
9959 rm -f core conftest.err conftest.$ac_objext \
9960 conftest$ac_exeext conftest.$ac_ext
9961 LDFLAGS=$save_LDFLAGS
9962 fi
9963 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
9964 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
9965 if test yes = "$lt_cv_irix_exported_symbol"; then
9966 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
9967 fi
9968 else
9969 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9970 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
9971 fi
9972 archive_cmds_need_lc='no'
9973 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9974 hardcode_libdir_separator=:
9975 inherit_rpath=yes
9976 link_all_deplibs=yes
9977 ;;
9978
9979 linux*)
9980 case $cc_basename in
9981 tcc*)
9982 # Fabrice Bellard et al's Tiny C Compiler
9983 ld_shlibs=yes
9984 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9985 ;;
9986 esac
9987 ;;
9988
9989 netbsd*)
9990 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9991 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
9992 else
9993 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
9994 fi
9995 hardcode_libdir_flag_spec='-R$libdir'
9996 hardcode_direct=yes
9997 hardcode_shlibpath_var=no
9998 ;;
9999
10000 newsos6)
10001 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10002 hardcode_direct=yes
10003 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
10004 hardcode_libdir_separator=:
10005 hardcode_shlibpath_var=no
10006 ;;
10007
10008 *nto* | *qnx*)
10009 ;;
10010
10011 openbsd* | bitrig*)
10012 if test -f /usr/libexec/ld.so; then
10013 hardcode_direct=yes
10014 hardcode_shlibpath_var=no
10015 hardcode_direct_absolute=yes
10016 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
10017 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10018 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
10019 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
10020 export_dynamic_flag_spec='$wl-E'
10021 else
10022 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
10023 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
10024 fi
10025 else
10026 ld_shlibs=no
10027 fi
10028 ;;
10029
10030 os2*)
10031 hardcode_libdir_flag_spec='-L$libdir'
10032 hardcode_minus_L=yes
10033 allow_undefined_flag=unsupported
10034 shrext_cmds=.dll
10035 archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10036 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10037 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10038 $ECHO EXPORTS >> $output_objdir/$libname.def~
10039 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
10040 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10041 emximp -o $lib $output_objdir/$libname.def'
10042 archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
10043 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
10044 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
10045 $ECHO EXPORTS >> $output_objdir/$libname.def~
10046 prefix_cmds="$SED"~
10047 if test EXPORTS = "`$SED 1q $export_symbols`"; then
10048 prefix_cmds="$prefix_cmds -e 1d";
10049 fi~
10050 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
10051 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
10052 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
10053 emximp -o $lib $output_objdir/$libname.def'
10054 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
10055 enable_shared_with_static_runtimes=yes
10056 ;;
10057
10058 osf3*)
10059 if test yes = "$GCC"; then
10060 allow_undefined_flag=' $wl-expect_unresolved $wl\*'
10061 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
10062 else
10063 allow_undefined_flag=' -expect_unresolved \*'
10064 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
10065 fi
10066 archive_cmds_need_lc='no'
10067 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
10068 hardcode_libdir_separator=:
10069 ;;
10070
10071 osf4* | osf5*) # as osf3* with the addition of -msym flag
10072 if test yes = "$GCC"; then
10073 allow_undefined_flag=' $wl-expect_unresolved $wl\*'
10074 archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
10075 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
10076 else
10077 allow_undefined_flag=' -expect_unresolved \*'
10078 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
10079 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
10080 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
10081
10082 # Both c and cxx compiler support -rpath directly
10083 hardcode_libdir_flag_spec='-rpath $libdir'
10084 fi
10085 archive_cmds_need_lc='no'
10086 hardcode_libdir_separator=:
10087 ;;
10088
10089 solaris*)
10090 no_undefined_flag=' -z defs'
10091 if test yes = "$GCC"; then
10092 wlarc='$wl'
10093 archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
10094 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10095 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10096 else
10097 case `$CC -V 2>&1` in
10098 *"Compilers 5.0"*)
10099 wlarc=''
10100 archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
10101 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10102 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
10103 ;;
10104 *)
10105 wlarc='$wl'
10106 archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
10107 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
10108 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
10109 ;;
10110 esac
10111 fi
10112 hardcode_libdir_flag_spec='-R$libdir'
10113 hardcode_shlibpath_var=no
10114 case $host_os in
10115 solaris2.[0-5] | solaris2.[0-5].*) ;;
10116 *)
10117 # The compiler driver will combine and reorder linker options,
10118 # but understands '-z linker_flag'. GCC discards it without '$wl',
10119 # but is careful enough not to reorder.
10120 # Supported since Solaris 2.6 (maybe 2.5.1?)
10121 if test yes = "$GCC"; then
10122 whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
10123 else
10124 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
10125 fi
10126 ;;
10127 esac
10128 link_all_deplibs=yes
10129 ;;
10130
10131 sunos4*)
10132 if test sequent = "$host_vendor"; then
10133 # Use $CC to link under sequent, because it throws in some extra .o
10134 # files that make .init and .fini sections work.
10135 archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10136 else
10137 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
10138 fi
10139 hardcode_libdir_flag_spec='-L$libdir'
10140 hardcode_direct=yes
10141 hardcode_minus_L=yes
10142 hardcode_shlibpath_var=no
10143 ;;
10144
10145 sysv4)
10146 case $host_vendor in
10147 sni)
10148 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10149 hardcode_direct=yes # is this really true???
10150 ;;
10151 siemens)
10152 ## LD is ld it makes a PLAMLIB
10153 ## CC just makes a GrossModule.
10154 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
10155 reload_cmds='$CC -r -o $output$reload_objs'
10156 hardcode_direct=no
10157 ;;
10158 motorola)
10159 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10160 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
10161 ;;
10162 esac
10163 runpath_var='LD_RUN_PATH'
10164 hardcode_shlibpath_var=no
10165 ;;
10166
10167 sysv4.3*)
10168 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10169 hardcode_shlibpath_var=no
10170 export_dynamic_flag_spec='-Bexport'
10171 ;;
10172
10173 sysv4*MP*)
10174 if test -d /usr/nec; then
10175 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10176 hardcode_shlibpath_var=no
10177 runpath_var=LD_RUN_PATH
10178 hardcode_runpath_var=yes
10179 ld_shlibs=yes
10180 fi
10181 ;;
10182
10183 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
10184 no_undefined_flag='$wl-z,text'
10185 archive_cmds_need_lc=no
10186 hardcode_shlibpath_var=no
10187 runpath_var='LD_RUN_PATH'
10188
10189 if test yes = "$GCC"; then
10190 archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10191 archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10192 else
10193 archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10194 archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10195 fi
10196 ;;
10197
10198 sysv5* | sco3.2v5* | sco5v6*)
10199 # Note: We CANNOT use -z defs as we might desire, because we do not
10200 # link with -lc, and that would cause any symbols used from libc to
10201 # always be unresolved, which means just about no library would
10202 # ever link correctly. If we're not using GNU ld we use -z text
10203 # though, which does catch some bad symbols but isn't as heavy-handed
10204 # as -z defs.
10205 no_undefined_flag='$wl-z,text'
10206 allow_undefined_flag='$wl-z,nodefs'
10207 archive_cmds_need_lc=no
10208 hardcode_shlibpath_var=no
10209 hardcode_libdir_flag_spec='$wl-R,$libdir'
10210 hardcode_libdir_separator=':'
10211 link_all_deplibs=yes
10212 export_dynamic_flag_spec='$wl-Bexport'
10213 runpath_var='LD_RUN_PATH'
10214
10215 if test yes = "$GCC"; then
10216 archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10217 archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10218 else
10219 archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10220 archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10221 fi
10222 ;;
10223
10224 uts4*)
10225 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10226 hardcode_libdir_flag_spec='-L$libdir'
10227 hardcode_shlibpath_var=no
10228 ;;
10229
10230 *)
10231 ld_shlibs=no
10232 ;;
10233 esac
10234
10235 if test sni = "$host_vendor"; then
10236 case $host in
10237 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10238 export_dynamic_flag_spec='$wl-Blargedynsym'
10239 ;;
10240 esac
10241 fi
10242 fi
10243
10244 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
10245 $as_echo "$ld_shlibs" >&6; }
10246 test no = "$ld_shlibs" && can_build_shared=no
10247
10248 with_gnu_ld=$with_gnu_ld
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264 #
10265 # Do we need to explicitly link libc?
10266 #
10267 case "x$archive_cmds_need_lc" in
10268 x|xyes)
10269 # Assume -lc should be added
10270 archive_cmds_need_lc=yes
10271
10272 if test yes,yes = "$GCC,$enable_shared"; then
10273 case $archive_cmds in
10274 *'~'*)
10275 # FIXME: we may have to deal with multi-command sequences.
10276 ;;
10277 '$CC '*)
10278 # Test whether the compiler implicitly links with -lc since on some
10279 # systems, -lgcc has to come before -lc. If gcc already passes -lc
10280 # to ld, don't add -lc before -lgcc.
10281 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
10282 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
10283 if ${lt_cv_archive_cmds_need_lc+:} false; then :
10284 $as_echo_n "(cached) " >&6
10285 else
10286 $RM conftest*
10287 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10288
10289 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
10290 (eval $ac_compile) 2>&5
10291 ac_status=$?
10292 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10293 test $ac_status = 0; } 2>conftest.err; then
10294 soname=conftest
10295 lib=conftest
10296 libobjs=conftest.$ac_objext
10297 deplibs=
10298 wl=$lt_prog_compiler_wl
10299 pic_flag=$lt_prog_compiler_pic
10300 compiler_flags=-v
10301 linker_flags=-v
10302 verstring=
10303 output_objdir=.
10304 libname=conftest
10305 lt_save_allow_undefined_flag=$allow_undefined_flag
10306 allow_undefined_flag=
10307 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
10308 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
10309 ac_status=$?
10310 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10311 test $ac_status = 0; }
10312 then
10313 lt_cv_archive_cmds_need_lc=no
10314 else
10315 lt_cv_archive_cmds_need_lc=yes
10316 fi
10317 allow_undefined_flag=$lt_save_allow_undefined_flag
10318 else
10319 cat conftest.err 1>&5
10320 fi
10321 $RM conftest*
10322
10323 fi
10324 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
10325 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
10326 archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
10327 ;;
10328 esac
10329 fi
10330 ;;
10331 esac
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
10485 $as_echo_n "checking dynamic linker characteristics... " >&6; }
10486
10487 if test yes = "$GCC"; then
10488 case $host_os in
10489 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
10490 *) lt_awk_arg='/^libraries:/' ;;
10491 esac
10492 case $host_os in
10493 mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
10494 *) lt_sed_strip_eq='s|=/|/|g' ;;
10495 esac
10496 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
10497 case $lt_search_path_spec in
10498 *\;*)
10499 # if the path contains ";" then we assume it to be the separator
10500 # otherwise default to the standard path separator (i.e. ":") - it is
10501 # assumed that no part of a normal pathname contains ";" but that should
10502 # okay in the real world where ";" in dirpaths is itself problematic.
10503 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
10504 ;;
10505 *)
10506 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
10507 ;;
10508 esac
10509 # Ok, now we have the path, separated by spaces, we can step through it
10510 # and add multilib dir if necessary...
10511 lt_tmp_lt_search_path_spec=
10512 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
10513 # ...but if some path component already ends with the multilib dir we assume
10514 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
10515 case "$lt_multi_os_dir; $lt_search_path_spec " in
10516 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
10517 lt_multi_os_dir=
10518 ;;
10519 esac
10520 for lt_sys_path in $lt_search_path_spec; do
10521 if test -d "$lt_sys_path$lt_multi_os_dir"; then
10522 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
10523 elif test -n "$lt_multi_os_dir"; then
10524 test -d "$lt_sys_path" && \
10525 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
10526 fi
10527 done
10528 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
10529 BEGIN {RS = " "; FS = "/|\n";} {
10530 lt_foo = "";
10531 lt_count = 0;
10532 for (lt_i = NF; lt_i > 0; lt_i--) {
10533 if ($lt_i != "" && $lt_i != ".") {
10534 if ($lt_i == "..") {
10535 lt_count++;
10536 } else {
10537 if (lt_count == 0) {
10538 lt_foo = "/" $lt_i lt_foo;
10539 } else {
10540 lt_count--;
10541 }
10542 }
10543 }
10544 }
10545 if (lt_foo != "") { lt_freq[lt_foo]++; }
10546 if (lt_freq[lt_foo] == 1) { print lt_foo; }
10547 }'`
10548 # AWK program above erroneously prepends '/' to C:/dos/paths
10549 # for these hosts.
10550 case $host_os in
10551 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
10552 $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
10553 esac
10554 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
10555 else
10556 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
10557 fi
10558 library_names_spec=
10559 libname_spec='lib$name'
10560 soname_spec=
10561 shrext_cmds=.so
10562 postinstall_cmds=
10563 postuninstall_cmds=
10564 finish_cmds=
10565 finish_eval=
10566 shlibpath_var=
10567 shlibpath_overrides_runpath=unknown
10568 version_type=none
10569 dynamic_linker="$host_os ld.so"
10570 sys_lib_dlsearch_path_spec="/lib /usr/lib"
10571 need_lib_prefix=unknown
10572 hardcode_into_libs=no
10573
10574 # when you set need_version to no, make sure it does not cause -set_version
10575 # flags to be left without arguments
10576 need_version=unknown
10577
10578
10579
10580 case $host_os in
10581 aix3*)
10582 version_type=linux # correct to gnu/linux during the next big refactor
10583 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
10584 shlibpath_var=LIBPATH
10585
10586 # AIX 3 has no versioning support, so we append a major version to the name.
10587 soname_spec='$libname$release$shared_ext$major'
10588 ;;
10589
10590 aix[4-9]*)
10591 version_type=linux # correct to gnu/linux during the next big refactor
10592 need_lib_prefix=no
10593 need_version=no
10594 hardcode_into_libs=yes
10595 if test ia64 = "$host_cpu"; then
10596 # AIX 5 supports IA64
10597 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
10598 shlibpath_var=LD_LIBRARY_PATH
10599 else
10600 # With GCC up to 2.95.x, collect2 would create an import file
10601 # for dependence libraries. The import file would start with
10602 # the line '#! .'. This would cause the generated library to
10603 # depend on '.', always an invalid library. This was fixed in
10604 # development snapshots of GCC prior to 3.0.
10605 case $host_os in
10606 aix4 | aix4.[01] | aix4.[01].*)
10607 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
10608 echo ' yes '
10609 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
10610 :
10611 else
10612 can_build_shared=no
10613 fi
10614 ;;
10615 esac
10616 # Using Import Files as archive members, it is possible to support
10617 # filename-based versioning of shared library archives on AIX. While
10618 # this would work for both with and without runtime linking, it will
10619 # prevent static linking of such archives. So we do filename-based
10620 # shared library versioning with .so extension only, which is used
10621 # when both runtime linking and shared linking is enabled.
10622 # Unfortunately, runtime linking may impact performance, so we do
10623 # not want this to be the default eventually. Also, we use the
10624 # versioned .so libs for executables only if there is the -brtl
10625 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
10626 # To allow for filename-based versioning support, we need to create
10627 # libNAME.so.V as an archive file, containing:
10628 # *) an Import File, referring to the versioned filename of the
10629 # archive as well as the shared archive member, telling the
10630 # bitwidth (32 or 64) of that shared object, and providing the
10631 # list of exported symbols of that shared object, eventually
10632 # decorated with the 'weak' keyword
10633 # *) the shared object with the F_LOADONLY flag set, to really avoid
10634 # it being seen by the linker.
10635 # At run time we better use the real file rather than another symlink,
10636 # but for link time we create the symlink libNAME.so -> libNAME.so.V
10637
10638 case $with_aix_soname,$aix_use_runtimelinking in
10639 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
10640 # soname into executable. Probably we can add versioning support to
10641 # collect2, so additional links can be useful in future.
10642 aix,yes) # traditional libtool
10643 dynamic_linker='AIX unversionable lib.so'
10644 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
10645 # instead of lib<name>.a to let people know that these are not
10646 # typical AIX shared libraries.
10647 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10648 ;;
10649 aix,no) # traditional AIX only
10650 dynamic_linker='AIX lib.a(lib.so.V)'
10651 # We preserve .a as extension for shared libraries through AIX4.2
10652 # and later when we are not doing run time linking.
10653 library_names_spec='$libname$release.a $libname.a'
10654 soname_spec='$libname$release$shared_ext$major'
10655 ;;
10656 svr4,*) # full svr4 only
10657 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
10658 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
10659 # We do not specify a path in Import Files, so LIBPATH fires.
10660 shlibpath_overrides_runpath=yes
10661 ;;
10662 *,yes) # both, prefer svr4
10663 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
10664 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
10665 # unpreferred sharedlib libNAME.a needs extra handling
10666 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
10667 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
10668 # We do not specify a path in Import Files, so LIBPATH fires.
10669 shlibpath_overrides_runpath=yes
10670 ;;
10671 *,no) # both, prefer aix
10672 dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
10673 library_names_spec='$libname$release.a $libname.a'
10674 soname_spec='$libname$release$shared_ext$major'
10675 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
10676 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
10677 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
10678 ;;
10679 esac
10680 shlibpath_var=LIBPATH
10681 fi
10682 ;;
10683
10684 amigaos*)
10685 case $host_cpu in
10686 powerpc)
10687 # Since July 2007 AmigaOS4 officially supports .so libraries.
10688 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
10689 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10690 ;;
10691 m68k)
10692 library_names_spec='$libname.ixlibrary $libname.a'
10693 # Create ${libname}_ixlibrary.a entries in /sys/libs.
10694 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
10695 ;;
10696 esac
10697 ;;
10698
10699 beos*)
10700 library_names_spec='$libname$shared_ext'
10701 dynamic_linker="$host_os ld.so"
10702 shlibpath_var=LIBRARY_PATH
10703 ;;
10704
10705 bsdi[45]*)
10706 version_type=linux # correct to gnu/linux during the next big refactor
10707 need_version=no
10708 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10709 soname_spec='$libname$release$shared_ext$major'
10710 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
10711 shlibpath_var=LD_LIBRARY_PATH
10712 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
10713 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
10714 # the default ld.so.conf also contains /usr/contrib/lib and
10715 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
10716 # libtool to hard-code these into programs
10717 ;;
10718
10719 cygwin* | mingw* | pw32* | cegcc*)
10720 version_type=windows
10721 shrext_cmds=.dll
10722 need_version=no
10723 need_lib_prefix=no
10724
10725 case $GCC,$cc_basename in
10726 yes,*)
10727 # gcc
10728 library_names_spec='$libname.dll.a'
10729 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10730 postinstall_cmds='base_file=`basename \$file`~
10731 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
10732 dldir=$destdir/`dirname \$dlpath`~
10733 test -d \$dldir || mkdir -p \$dldir~
10734 $install_prog $dir/$dlname \$dldir/$dlname~
10735 chmod a+x \$dldir/$dlname~
10736 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
10737 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
10738 fi'
10739 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
10740 dlpath=$dir/\$dldll~
10741 $RM \$dlpath'
10742 shlibpath_overrides_runpath=yes
10743
10744 case $host_os in
10745 cygwin*)
10746 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
10747 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10748
10749 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
10750 ;;
10751 mingw* | cegcc*)
10752 # MinGW DLLs use traditional 'lib' prefix
10753 soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10754 ;;
10755 pw32*)
10756 # pw32 DLLs use 'pw' prefix rather than 'lib'
10757 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10758 ;;
10759 esac
10760 dynamic_linker='Win32 ld.exe'
10761 ;;
10762
10763 *,cl*)
10764 # Native MSVC
10765 libname_spec='$name'
10766 soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10767 library_names_spec='$libname.dll.lib'
10768
10769 case $build_os in
10770 mingw*)
10771 sys_lib_search_path_spec=
10772 lt_save_ifs=$IFS
10773 IFS=';'
10774 for lt_path in $LIB
10775 do
10776 IFS=$lt_save_ifs
10777 # Let DOS variable expansion print the short 8.3 style file name.
10778 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
10779 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
10780 done
10781 IFS=$lt_save_ifs
10782 # Convert to MSYS style.
10783 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
10784 ;;
10785 cygwin*)
10786 # Convert to unix form, then to dos form, then back to unix form
10787 # but this time dos style (no spaces!) so that the unix form looks
10788 # like /cygdrive/c/PROGRA~1:/cygdr...
10789 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
10790 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
10791 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10792 ;;
10793 *)
10794 sys_lib_search_path_spec=$LIB
10795 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
10796 # It is most probably a Windows format PATH.
10797 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
10798 else
10799 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10800 fi
10801 # FIXME: find the short name or the path components, as spaces are
10802 # common. (e.g. "Program Files" -> "PROGRA~1")
10803 ;;
10804 esac
10805
10806 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10807 postinstall_cmds='base_file=`basename \$file`~
10808 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
10809 dldir=$destdir/`dirname \$dlpath`~
10810 test -d \$dldir || mkdir -p \$dldir~
10811 $install_prog $dir/$dlname \$dldir/$dlname'
10812 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
10813 dlpath=$dir/\$dldll~
10814 $RM \$dlpath'
10815 shlibpath_overrides_runpath=yes
10816 dynamic_linker='Win32 link.exe'
10817 ;;
10818
10819 *)
10820 # Assume MSVC wrapper
10821 library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
10822 dynamic_linker='Win32 ld.exe'
10823 ;;
10824 esac
10825 # FIXME: first we should search . and the directory the executable is in
10826 shlibpath_var=PATH
10827 ;;
10828
10829 darwin* | rhapsody*)
10830 dynamic_linker="$host_os dyld"
10831 version_type=darwin
10832 need_lib_prefix=no
10833 need_version=no
10834 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
10835 soname_spec='$libname$release$major$shared_ext'
10836 shlibpath_overrides_runpath=yes
10837 shlibpath_var=DYLD_LIBRARY_PATH
10838 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
10839
10840 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
10841 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
10842 ;;
10843
10844 dgux*)
10845 version_type=linux # correct to gnu/linux during the next big refactor
10846 need_lib_prefix=no
10847 need_version=no
10848 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10849 soname_spec='$libname$release$shared_ext$major'
10850 shlibpath_var=LD_LIBRARY_PATH
10851 ;;
10852
10853 freebsd* | dragonfly*)
10854 # DragonFly does not have aout. When/if they implement a new
10855 # versioning mechanism, adjust this.
10856 if test -x /usr/bin/objformat; then
10857 objformat=`/usr/bin/objformat`
10858 else
10859 case $host_os in
10860 freebsd[23].*) objformat=aout ;;
10861 *) objformat=elf ;;
10862 esac
10863 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
10872 case $version_type in
10873 freebsd-elf*)
10874 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10875 soname_spec='$libname$release$shared_ext$major'
10876 need_version=no
10877 need_lib_prefix=no
10878 ;;
10879 freebsd-*)
10880 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
10881 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
10888 ;;
10889 esac
10890 shlibpath_var=LD_LIBRARY_PATH
10891 case $host_os in
10892 freebsd2.*)
10893 shlibpath_overrides_runpath=yes
10894 ;;
10895 freebsd3.[01]* | freebsdelf3.[01]*)
10896 shlibpath_overrides_runpath=yes
10897 hardcode_into_libs=yes
10898 ;;
10899 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
10900 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
10901 shlibpath_overrides_runpath=no
10902 hardcode_into_libs=yes
10903 ;;
10904 *) # from 4.6 on, and DragonFly
10905 shlibpath_overrides_runpath=yes
10906 hardcode_into_libs=yes
10907 ;;
10908 esac
10909 ;;
10910
10911 haiku*)
10912 version_type=linux # correct to gnu/linux during the next big refactor
10913 need_lib_prefix=no
10914 need_version=no
10915 dynamic_linker="$host_os runtime_loader"
10916 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10917 soname_spec='$libname$release$shared_ext$major'
10918 shlibpath_var=LIBRARY_PATH
10919 shlibpath_overrides_runpath=no
10920 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
10921 hardcode_into_libs=yes
10922 ;;
10923
10924 hpux9* | hpux10* | hpux11*)
10925 # Give a soname corresponding to the major version so that dld.sl refuses to
10926 # link against other versions.
10927 version_type=sunos
10928 need_lib_prefix=no
10929 need_version=no
10930 case $host_cpu in
10931 ia64*)
10932 shrext_cmds='.so'
10933 hardcode_into_libs=yes
10934 dynamic_linker="$host_os dld.so"
10935 shlibpath_var=LD_LIBRARY_PATH
10936 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
10937 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10938 soname_spec='$libname$release$shared_ext$major'
10939 if test 32 = "$HPUX_IA64_MODE"; then
10940 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
10941 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
10942 else
10943 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
10944 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
10945 fi
10946 ;;
10947 hppa*64*)
10948 shrext_cmds='.sl'
10949 hardcode_into_libs=yes
10950 dynamic_linker="$host_os dld.sl"
10951 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
10952 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
10953 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10954 soname_spec='$libname$release$shared_ext$major'
10955 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
10956 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
10957 ;;
10958 *)
10959 shrext_cmds='.sl'
10960 dynamic_linker="$host_os dld.sl"
10961 shlibpath_var=SHLIB_PATH
10962 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
10963 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10964 soname_spec='$libname$release$shared_ext$major'
10965 ;;
10966 esac
10967 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
10968 postinstall_cmds='chmod 555 $lib'
10969 # or fails outright, so override atomically:
10970 install_override_mode=555
10971 ;;
10972
10973 interix[3-9]*)
10974 version_type=linux # correct to gnu/linux during the next big refactor
10975 need_lib_prefix=no
10976 need_version=no
10977 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10978 soname_spec='$libname$release$shared_ext$major'
10979 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
10980 shlibpath_var=LD_LIBRARY_PATH
10981 shlibpath_overrides_runpath=no
10982 hardcode_into_libs=yes
10983 ;;
10984
10985 irix5* | irix6* | nonstopux*)
10986 case $host_os in
10987 nonstopux*) version_type=nonstopux ;;
10988 *)
10989 if test yes = "$lt_cv_prog_gnu_ld"; then
10990 version_type=linux # correct to gnu/linux during the next big refactor
10991 else
10992 version_type=irix
10993 fi ;;
10994 esac
10995 need_lib_prefix=no
10996 need_version=no
10997 soname_spec='$libname$release$shared_ext$major'
10998 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
10999 case $host_os in
11000 irix5* | nonstopux*)
11001 libsuff= shlibsuff=
11002 ;;
11003 *)
11004 case $LD in # libtool.m4 will add one of these switches to LD
11005 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
11006 libsuff= shlibsuff= libmagic=32-bit;;
11007 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
11008 libsuff=32 shlibsuff=N32 libmagic=N32;;
11009 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
11010 libsuff=64 shlibsuff=64 libmagic=64-bit;;
11011 *) libsuff= shlibsuff= libmagic=never-match;;
11012 esac
11013 ;;
11014 esac
11015 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
11016 shlibpath_overrides_runpath=no
11017 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
11018 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
11019 hardcode_into_libs=yes
11020 ;;
11021
11022 # No shared lib support for Linux oldld, aout, or coff.
11023 linux*oldld* | linux*aout* | linux*coff*)
11024 dynamic_linker=no
11025 ;;
11026
11027 linux*android*)
11028 version_type=none # Android doesn't support versioned libraries.
11029 need_lib_prefix=no
11030 need_version=no
11031 library_names_spec='$libname$release$shared_ext'
11032 soname_spec='$libname$release$shared_ext'
11033 finish_cmds=
11034 shlibpath_var=LD_LIBRARY_PATH
11035 shlibpath_overrides_runpath=yes
11036
11037 # This implies no fast_install, which is unacceptable.
11038 # Some rework will be needed to allow for fast_install
11039 # before this can be enabled.
11040 hardcode_into_libs=yes
11041
11042 dynamic_linker='Android linker'
11043 # Don't embed -rpath directories since the linker doesn't support them.
11044 hardcode_libdir_flag_spec='-L$libdir'
11045 ;;
11046
11047 # This must be glibc/ELF.
11048 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
11049 version_type=linux # correct to gnu/linux during the next big refactor
11050 need_lib_prefix=no
11051 need_version=no
11052 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11053 soname_spec='$libname$release$shared_ext$major'
11054 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
11055 shlibpath_var=LD_LIBRARY_PATH
11056 shlibpath_overrides_runpath=no
11057
11058 # Some binutils ld are patched to set DT_RUNPATH
11059 if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
11060 $as_echo_n "(cached) " >&6
11061 else
11062 lt_cv_shlibpath_overrides_runpath=no
11063 save_LDFLAGS=$LDFLAGS
11064 save_libdir=$libdir
11065 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
11066 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
11067 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11068 /* end confdefs.h. */
11069
11070 int
11071 main ()
11072 {
11073
11074 ;
11075 return 0;
11711076 }
118
119 function cnf_h_entry() {
120 [[ $# -ne 2 ]] && return
121 case "$2" in
122 no)
123 echo "#undef $1" >> $cnf_h_file
124 ;;
125 yes)
126 echo "#define $1 1" >> $cnf_h_file
127 ;;
128 *)
129 echo "#define $1 $2" >> $cnf_h_file
11077 _ACEOF
11078 if ac_fn_c_try_link "$LINENO"; then :
11079 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
11080 lt_cv_shlibpath_overrides_runpath=yes
11081 fi
11082 fi
11083 rm -f core conftest.err conftest.$ac_objext \
11084 conftest$ac_exeext conftest.$ac_ext
11085 LDFLAGS=$save_LDFLAGS
11086 libdir=$save_libdir
11087
11088 fi
11089
11090 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
11091
11092 # This implies no fast_install, which is unacceptable.
11093 # Some rework will be needed to allow for fast_install
11094 # before this can be enabled.
11095 hardcode_into_libs=yes
11096
11097 # Ideally, we could use ldconfig to report *all* directores which are
11098 # searched for libraries, however this is still not possible. Aside from not
11099 # being certain /sbin/ldconfig is available, command
11100 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
11101 # even though it is searched at run-time. Try to do the best guess by
11102 # appending ld.so.conf contents (and includes) to the search path.
11103 if test -f /etc/ld.so.conf; then
11104 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
11105 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
11106 fi
11107
11108 # We used to test for /lib/ld.so.1 and disable shared libraries on
11109 # powerpc, because MkLinux only supported shared libraries with the
11110 # GNU dynamic linker. Since this was broken with cross compilers,
11111 # most powerpc-linux boxes support dynamic linking these days and
11112 # people can always --disable-shared, the test was removed, and we
11113 # assume the GNU/Linux dynamic linker is in use.
11114 dynamic_linker='GNU/Linux ld.so'
11115 ;;
11116
11117 netbsd*)
11118 version_type=sunos
11119 need_lib_prefix=no
11120 need_version=no
11121 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
11122 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
11123 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
11124 dynamic_linker='NetBSD (a.out) ld.so'
11125 else
11126 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11127 soname_spec='$libname$release$shared_ext$major'
11128 dynamic_linker='NetBSD ld.elf_so'
11129 fi
11130 shlibpath_var=LD_LIBRARY_PATH
11131 shlibpath_overrides_runpath=yes
11132 hardcode_into_libs=yes
11133 ;;
11134
11135 newsos6)
11136 version_type=linux # correct to gnu/linux during the next big refactor
11137 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11138 shlibpath_var=LD_LIBRARY_PATH
11139 shlibpath_overrides_runpath=yes
11140 ;;
11141
11142 *nto* | *qnx*)
11143 version_type=qnx
11144 need_lib_prefix=no
11145 need_version=no
11146 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11147 soname_spec='$libname$release$shared_ext$major'
11148 shlibpath_var=LD_LIBRARY_PATH
11149 shlibpath_overrides_runpath=no
11150 hardcode_into_libs=yes
11151 dynamic_linker='ldqnx.so'
11152 ;;
11153
11154 openbsd* | bitrig*)
11155 version_type=sunos
11156 sys_lib_dlsearch_path_spec=/usr/lib
11157 need_lib_prefix=no
11158 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
11159 need_version=no
11160 else
11161 need_version=yes
11162 fi
11163 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
11164 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
11165 shlibpath_var=LD_LIBRARY_PATH
11166 shlibpath_overrides_runpath=yes
11167 ;;
11168
11169 os2*)
11170 libname_spec='$name'
11171 version_type=windows
11172 shrext_cmds=.dll
11173 need_version=no
11174 need_lib_prefix=no
11175 # OS/2 can only load a DLL with a base name of 8 characters or less.
11176 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
11177 v=$($ECHO $release$versuffix | tr -d .-);
11178 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
11179 $ECHO $n$v`$shared_ext'
11180 library_names_spec='${libname}_dll.$libext'
11181 dynamic_linker='OS/2 ld.exe'
11182 shlibpath_var=BEGINLIBPATH
11183 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
11184 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
11185 postinstall_cmds='base_file=`basename \$file`~
11186 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
11187 dldir=$destdir/`dirname \$dlpath`~
11188 test -d \$dldir || mkdir -p \$dldir~
11189 $install_prog $dir/$dlname \$dldir/$dlname~
11190 chmod a+x \$dldir/$dlname~
11191 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
11192 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
11193 fi'
11194 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
11195 dlpath=$dir/\$dldll~
11196 $RM \$dlpath'
11197 ;;
11198
11199 osf3* | osf4* | osf5*)
11200 version_type=osf
11201 need_lib_prefix=no
11202 need_version=no
11203 soname_spec='$libname$release$shared_ext$major'
11204 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11205 shlibpath_var=LD_LIBRARY_PATH
11206 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
11207 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
11208 ;;
11209
11210 rdos*)
11211 dynamic_linker=no
11212 ;;
11213
11214 solaris*)
11215 version_type=linux # correct to gnu/linux during the next big refactor
11216 need_lib_prefix=no
11217 need_version=no
11218 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11219 soname_spec='$libname$release$shared_ext$major'
11220 shlibpath_var=LD_LIBRARY_PATH
11221 shlibpath_overrides_runpath=yes
11222 hardcode_into_libs=yes
11223 # ldd complains unless libraries are executable
11224 postinstall_cmds='chmod +x $lib'
11225 ;;
11226
11227 sunos4*)
11228 version_type=sunos
11229 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
11230 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
11231 shlibpath_var=LD_LIBRARY_PATH
11232 shlibpath_overrides_runpath=yes
11233 if test yes = "$with_gnu_ld"; then
11234 need_lib_prefix=no
11235 fi
11236 need_version=yes
11237 ;;
11238
11239 sysv4 | sysv4.3*)
11240 version_type=linux # correct to gnu/linux during the next big refactor
11241 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11242 soname_spec='$libname$release$shared_ext$major'
11243 shlibpath_var=LD_LIBRARY_PATH
11244 case $host_vendor in
11245 sni)
11246 shlibpath_overrides_runpath=no
11247 need_lib_prefix=no
11248 runpath_var=LD_RUN_PATH
11249 ;;
11250 siemens)
11251 need_lib_prefix=no
11252 ;;
11253 motorola)
11254 need_lib_prefix=no
11255 need_version=no
11256 shlibpath_overrides_runpath=no
11257 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
11258 ;;
11259 esac
11260 ;;
11261
11262 sysv4*MP*)
11263 if test -d /usr/nec; then
11264 version_type=linux # correct to gnu/linux during the next big refactor
11265 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
11266 soname_spec='$libname$shared_ext.$major'
11267 shlibpath_var=LD_LIBRARY_PATH
11268 fi
11269 ;;
11270
11271 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
11272 version_type=sco
11273 need_lib_prefix=no
11274 need_version=no
11275 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
11276 soname_spec='$libname$release$shared_ext$major'
11277 shlibpath_var=LD_LIBRARY_PATH
11278 shlibpath_overrides_runpath=yes
11279 hardcode_into_libs=yes
11280 if test yes = "$with_gnu_ld"; then
11281 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
11282 else
11283 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
11284 case $host_os in
11285 sco3.2v5*)
11286 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
11287 ;;
11288 esac
11289 fi
11290 sys_lib_dlsearch_path_spec='/usr/lib'
11291 ;;
11292
11293 tpf*)
11294 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
11295 version_type=linux # correct to gnu/linux during the next big refactor
11296 need_lib_prefix=no
11297 need_version=no
11298 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11299 shlibpath_var=LD_LIBRARY_PATH
11300 shlibpath_overrides_runpath=no
11301 hardcode_into_libs=yes
11302 ;;
11303
11304 uts4*)
11305 version_type=linux # correct to gnu/linux during the next big refactor
11306 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
11307 soname_spec='$libname$release$shared_ext$major'
11308 shlibpath_var=LD_LIBRARY_PATH
11309 ;;
11310
11311 *)
11312 dynamic_linker=no
11313 ;;
11314 esac
11315 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
11316 $as_echo "$dynamic_linker" >&6; }
11317 test no = "$dynamic_linker" && can_build_shared=no
11318
11319 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
11320 if test yes = "$GCC"; then
11321 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
11322 fi
11323
11324 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
11325 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
11326 fi
11327
11328 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
11329 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
11330 fi
11331
11332 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
11333 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
11334
11335 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
11336 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
11337
11338 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
11339 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
11438 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
11439 hardcode_action=
11440 if test -n "$hardcode_libdir_flag_spec" ||
11441 test -n "$runpath_var" ||
11442 test yes = "$hardcode_automatic"; then
11443
11444 # We can hardcode non-existent directories.
11445 if test no != "$hardcode_direct" &&
11446 # If the only mechanism to avoid hardcoding is shlibpath_var, we
11447 # have to relink, otherwise we might link with an installed library
11448 # when we should be linking with a yet-to-be-installed one
11449 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
11450 test no != "$hardcode_minus_L"; then
11451 # Linking always hardcodes the temporary library directory.
11452 hardcode_action=relink
11453 else
11454 # We can link without hardcoding, and we can hardcode nonexisting dirs.
11455 hardcode_action=immediate
11456 fi
11457 else
11458 # We cannot hardcode anything, or else we can only hardcode existing
11459 # directories.
11460 hardcode_action=unsupported
11461 fi
11462 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
11463 $as_echo "$hardcode_action" >&6; }
11464
11465 if test relink = "$hardcode_action" ||
11466 test yes = "$inherit_rpath"; then
11467 # Fast installation is not supported
11468 enable_fast_install=no
11469 elif test yes = "$shlibpath_overrides_runpath" ||
11470 test no = "$enable_shared"; then
11471 # Fast installation is not necessary
11472 enable_fast_install=needless
11473 fi
11474
11475
11476
11477
11478
11479
11480 if test yes != "$enable_dlopen"; then
11481 enable_dlopen=unknown
11482 enable_dlopen_self=unknown
11483 enable_dlopen_self_static=unknown
11484 else
11485 lt_cv_dlopen=no
11486 lt_cv_dlopen_libs=
11487
11488 case $host_os in
11489 beos*)
11490 lt_cv_dlopen=load_add_on
11491 lt_cv_dlopen_libs=
11492 lt_cv_dlopen_self=yes
11493 ;;
11494
11495 mingw* | pw32* | cegcc*)
11496 lt_cv_dlopen=LoadLibrary
11497 lt_cv_dlopen_libs=
11498 ;;
11499
11500 cygwin*)
11501 lt_cv_dlopen=dlopen
11502 lt_cv_dlopen_libs=
11503 ;;
11504
11505 darwin*)
11506 # if libdl is installed we need to link against it
11507 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
11508 $as_echo_n "checking for dlopen in -ldl... " >&6; }
11509 if ${ac_cv_lib_dl_dlopen+:} false; then :
11510 $as_echo_n "(cached) " >&6
11511 else
11512 ac_check_lib_save_LIBS=$LIBS
11513 LIBS="-ldl $LIBS"
11514 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11515 /* end confdefs.h. */
11516
11517 /* Override any GCC internal prototype to avoid an error.
11518 Use char because int might match the return type of a GCC
11519 builtin and then its argument prototype would still apply. */
11520 #ifdef __cplusplus
11521 extern "C"
11522 #endif
11523 char dlopen ();
11524 int
11525 main ()
11526 {
11527 return dlopen ();
11528 ;
11529 return 0;
11530 }
11531 _ACEOF
11532 if ac_fn_c_try_link "$LINENO"; then :
11533 ac_cv_lib_dl_dlopen=yes
11534 else
11535 ac_cv_lib_dl_dlopen=no
11536 fi
11537 rm -f core conftest.err conftest.$ac_objext \
11538 conftest$ac_exeext conftest.$ac_ext
11539 LIBS=$ac_check_lib_save_LIBS
11540 fi
11541 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
11542 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
11543 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11544 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
11545 else
11546
11547 lt_cv_dlopen=dyld
11548 lt_cv_dlopen_libs=
11549 lt_cv_dlopen_self=yes
11550
11551 fi
11552
11553 ;;
11554
11555 tpf*)
11556 # Don't try to run any link tests for TPF. We know it's impossible
11557 # because TPF is a cross-compiler, and we know how we open DSOs.
11558 lt_cv_dlopen=dlopen
11559 lt_cv_dlopen_libs=
11560 lt_cv_dlopen_self=no
11561 ;;
11562
11563 *)
11564 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
11565 if test "x$ac_cv_func_shl_load" = xyes; then :
11566 lt_cv_dlopen=shl_load
11567 else
11568 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
11569 $as_echo_n "checking for shl_load in -ldld... " >&6; }
11570 if ${ac_cv_lib_dld_shl_load+:} false; then :
11571 $as_echo_n "(cached) " >&6
11572 else
11573 ac_check_lib_save_LIBS=$LIBS
11574 LIBS="-ldld $LIBS"
11575 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11576 /* end confdefs.h. */
11577
11578 /* Override any GCC internal prototype to avoid an error.
11579 Use char because int might match the return type of a GCC
11580 builtin and then its argument prototype would still apply. */
11581 #ifdef __cplusplus
11582 extern "C"
11583 #endif
11584 char shl_load ();
11585 int
11586 main ()
11587 {
11588 return shl_load ();
11589 ;
11590 return 0;
11591 }
11592 _ACEOF
11593 if ac_fn_c_try_link "$LINENO"; then :
11594 ac_cv_lib_dld_shl_load=yes
11595 else
11596 ac_cv_lib_dld_shl_load=no
11597 fi
11598 rm -f core conftest.err conftest.$ac_objext \
11599 conftest$ac_exeext conftest.$ac_ext
11600 LIBS=$ac_check_lib_save_LIBS
11601 fi
11602 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
11603 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
11604 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
11605 lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
11606 else
11607 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
11608 if test "x$ac_cv_func_dlopen" = xyes; then :
11609 lt_cv_dlopen=dlopen
11610 else
11611 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
11612 $as_echo_n "checking for dlopen in -ldl... " >&6; }
11613 if ${ac_cv_lib_dl_dlopen+:} false; then :
11614 $as_echo_n "(cached) " >&6
11615 else
11616 ac_check_lib_save_LIBS=$LIBS
11617 LIBS="-ldl $LIBS"
11618 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11619 /* end confdefs.h. */
11620
11621 /* Override any GCC internal prototype to avoid an error.
11622 Use char because int might match the return type of a GCC
11623 builtin and then its argument prototype would still apply. */
11624 #ifdef __cplusplus
11625 extern "C"
11626 #endif
11627 char dlopen ();
11628 int
11629 main ()
11630 {
11631 return dlopen ();
11632 ;
11633 return 0;
11634 }
11635 _ACEOF
11636 if ac_fn_c_try_link "$LINENO"; then :
11637 ac_cv_lib_dl_dlopen=yes
11638 else
11639 ac_cv_lib_dl_dlopen=no
11640 fi
11641 rm -f core conftest.err conftest.$ac_objext \
11642 conftest$ac_exeext conftest.$ac_ext
11643 LIBS=$ac_check_lib_save_LIBS
11644 fi
11645 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
11646 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
11647 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11648 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
11649 else
11650 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
11651 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
11652 if ${ac_cv_lib_svld_dlopen+:} false; then :
11653 $as_echo_n "(cached) " >&6
11654 else
11655 ac_check_lib_save_LIBS=$LIBS
11656 LIBS="-lsvld $LIBS"
11657 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11658 /* end confdefs.h. */
11659
11660 /* Override any GCC internal prototype to avoid an error.
11661 Use char because int might match the return type of a GCC
11662 builtin and then its argument prototype would still apply. */
11663 #ifdef __cplusplus
11664 extern "C"
11665 #endif
11666 char dlopen ();
11667 int
11668 main ()
11669 {
11670 return dlopen ();
11671 ;
11672 return 0;
11673 }
11674 _ACEOF
11675 if ac_fn_c_try_link "$LINENO"; then :
11676 ac_cv_lib_svld_dlopen=yes
11677 else
11678 ac_cv_lib_svld_dlopen=no
11679 fi
11680 rm -f core conftest.err conftest.$ac_objext \
11681 conftest$ac_exeext conftest.$ac_ext
11682 LIBS=$ac_check_lib_save_LIBS
11683 fi
11684 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
11685 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
11686 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
11687 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
11688 else
11689 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
11690 $as_echo_n "checking for dld_link in -ldld... " >&6; }
11691 if ${ac_cv_lib_dld_dld_link+:} false; then :
11692 $as_echo_n "(cached) " >&6
11693 else
11694 ac_check_lib_save_LIBS=$LIBS
11695 LIBS="-ldld $LIBS"
11696 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11697 /* end confdefs.h. */
11698
11699 /* Override any GCC internal prototype to avoid an error.
11700 Use char because int might match the return type of a GCC
11701 builtin and then its argument prototype would still apply. */
11702 #ifdef __cplusplus
11703 extern "C"
11704 #endif
11705 char dld_link ();
11706 int
11707 main ()
11708 {
11709 return dld_link ();
11710 ;
11711 return 0;
11712 }
11713 _ACEOF
11714 if ac_fn_c_try_link "$LINENO"; then :
11715 ac_cv_lib_dld_dld_link=yes
11716 else
11717 ac_cv_lib_dld_dld_link=no
11718 fi
11719 rm -f core conftest.err conftest.$ac_objext \
11720 conftest$ac_exeext conftest.$ac_ext
11721 LIBS=$ac_check_lib_save_LIBS
11722 fi
11723 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
11724 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
11725 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
11726 lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
11727 fi
11728
11729
11730 fi
11731
11732
11733 fi
11734
11735
11736 fi
11737
11738
11739 fi
11740
11741
11742 fi
11743
11744 ;;
11745 esac
11746
11747 if test no = "$lt_cv_dlopen"; then
11748 enable_dlopen=no
11749 else
11750 enable_dlopen=yes
11751 fi
11752
11753 case $lt_cv_dlopen in
11754 dlopen)
11755 save_CPPFLAGS=$CPPFLAGS
11756 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
11757
11758 save_LDFLAGS=$LDFLAGS
11759 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
11760
11761 save_LIBS=$LIBS
11762 LIBS="$lt_cv_dlopen_libs $LIBS"
11763
11764 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
11765 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
11766 if ${lt_cv_dlopen_self+:} false; then :
11767 $as_echo_n "(cached) " >&6
11768 else
11769 if test yes = "$cross_compiling"; then :
11770 lt_cv_dlopen_self=cross
11771 else
11772 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11773 lt_status=$lt_dlunknown
11774 cat > conftest.$ac_ext <<_LT_EOF
11775 #line $LINENO "configure"
11776 #include "confdefs.h"
11777
11778 #if HAVE_DLFCN_H
11779 #include <dlfcn.h>
11780 #endif
11781
11782 #include <stdio.h>
11783
11784 #ifdef RTLD_GLOBAL
11785 # define LT_DLGLOBAL RTLD_GLOBAL
11786 #else
11787 # ifdef DL_GLOBAL
11788 # define LT_DLGLOBAL DL_GLOBAL
11789 # else
11790 # define LT_DLGLOBAL 0
11791 # endif
11792 #endif
11793
11794 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
11795 find out it does not work in some platform. */
11796 #ifndef LT_DLLAZY_OR_NOW
11797 # ifdef RTLD_LAZY
11798 # define LT_DLLAZY_OR_NOW RTLD_LAZY
11799 # else
11800 # ifdef DL_LAZY
11801 # define LT_DLLAZY_OR_NOW DL_LAZY
11802 # else
11803 # ifdef RTLD_NOW
11804 # define LT_DLLAZY_OR_NOW RTLD_NOW
11805 # else
11806 # ifdef DL_NOW
11807 # define LT_DLLAZY_OR_NOW DL_NOW
11808 # else
11809 # define LT_DLLAZY_OR_NOW 0
11810 # endif
11811 # endif
11812 # endif
11813 # endif
11814 #endif
11815
11816 /* When -fvisibility=hidden is used, assume the code has been annotated
11817 correspondingly for the symbols needed. */
11818 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
11819 int fnord () __attribute__((visibility("default")));
11820 #endif
11821
11822 int fnord () { return 42; }
11823 int main ()
11824 {
11825 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
11826 int status = $lt_dlunknown;
11827
11828 if (self)
11829 {
11830 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
11831 else
11832 {
11833 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
11834 else puts (dlerror ());
11835 }
11836 /* dlclose (self); */
11837 }
11838 else
11839 puts (dlerror ());
11840
11841 return status;
11842 }
11843 _LT_EOF
11844 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
11845 (eval $ac_link) 2>&5
11846 ac_status=$?
11847 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11848 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
11849 (./conftest; exit; ) >&5 2>/dev/null
11850 lt_status=$?
11851 case x$lt_status in
11852 x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
11853 x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
11854 x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
11855 esac
11856 else :
11857 # compilation failed
11858 lt_cv_dlopen_self=no
11859 fi
11860 fi
11861 rm -fr conftest*
11862
11863
11864 fi
11865 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
11866 $as_echo "$lt_cv_dlopen_self" >&6; }
11867
11868 if test yes = "$lt_cv_dlopen_self"; then
11869 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
11870 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
11871 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
11872 if ${lt_cv_dlopen_self_static+:} false; then :
11873 $as_echo_n "(cached) " >&6
11874 else
11875 if test yes = "$cross_compiling"; then :
11876 lt_cv_dlopen_self_static=cross
11877 else
11878 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11879 lt_status=$lt_dlunknown
11880 cat > conftest.$ac_ext <<_LT_EOF
11881 #line $LINENO "configure"
11882 #include "confdefs.h"
11883
11884 #if HAVE_DLFCN_H
11885 #include <dlfcn.h>
11886 #endif
11887
11888 #include <stdio.h>
11889
11890 #ifdef RTLD_GLOBAL
11891 # define LT_DLGLOBAL RTLD_GLOBAL
11892 #else
11893 # ifdef DL_GLOBAL
11894 # define LT_DLGLOBAL DL_GLOBAL
11895 # else
11896 # define LT_DLGLOBAL 0
11897 # endif
11898 #endif
11899
11900 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
11901 find out it does not work in some platform. */
11902 #ifndef LT_DLLAZY_OR_NOW
11903 # ifdef RTLD_LAZY
11904 # define LT_DLLAZY_OR_NOW RTLD_LAZY
11905 # else
11906 # ifdef DL_LAZY
11907 # define LT_DLLAZY_OR_NOW DL_LAZY
11908 # else
11909 # ifdef RTLD_NOW
11910 # define LT_DLLAZY_OR_NOW RTLD_NOW
11911 # else
11912 # ifdef DL_NOW
11913 # define LT_DLLAZY_OR_NOW DL_NOW
11914 # else
11915 # define LT_DLLAZY_OR_NOW 0
11916 # endif
11917 # endif
11918 # endif
11919 # endif
11920 #endif
11921
11922 /* When -fvisibility=hidden is used, assume the code has been annotated
11923 correspondingly for the symbols needed. */
11924 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
11925 int fnord () __attribute__((visibility("default")));
11926 #endif
11927
11928 int fnord () { return 42; }
11929 int main ()
11930 {
11931 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
11932 int status = $lt_dlunknown;
11933
11934 if (self)
11935 {
11936 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
11937 else
11938 {
11939 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
11940 else puts (dlerror ());
11941 }
11942 /* dlclose (self); */
11943 }
11944 else
11945 puts (dlerror ());
11946
11947 return status;
11948 }
11949 _LT_EOF
11950 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
11951 (eval $ac_link) 2>&5
11952 ac_status=$?
11953 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11954 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
11955 (./conftest; exit; ) >&5 2>/dev/null
11956 lt_status=$?
11957 case x$lt_status in
11958 x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
11959 x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
11960 x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
11961 esac
11962 else :
11963 # compilation failed
11964 lt_cv_dlopen_self_static=no
11965 fi
11966 fi
11967 rm -fr conftest*
11968
11969
11970 fi
11971 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
11972 $as_echo "$lt_cv_dlopen_self_static" >&6; }
11973 fi
11974
11975 CPPFLAGS=$save_CPPFLAGS
11976 LDFLAGS=$save_LDFLAGS
11977 LIBS=$save_LIBS
11978 ;;
11979 esac
11980
11981 case $lt_cv_dlopen_self in
11982 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
11983 *) enable_dlopen_self=unknown ;;
11984 esac
11985
11986 case $lt_cv_dlopen_self_static in
11987 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
11988 *) enable_dlopen_self_static=unknown ;;
11989 esac
11990 fi
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008 striplib=
12009 old_striplib=
12010 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
12011 $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
12016 $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
12022 striplib="$STRIP -x"
12023 old_striplib="$STRIP -S"
12024 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12025 $as_echo "yes" >&6; }
12026 else
12027 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12028 $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
12036 fi
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049 # Report what library types will actually be built
12050 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
12051 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
12052 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
12053 $as_echo "$can_build_shared" >&6; }
12054
12055 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
12056 $as_echo_n "checking whether to build shared libraries... " >&6; }
12057 test no = "$can_build_shared" && enable_shared=no
12058
12059 # On AIX, shared libraries and static libraries use the same namespace, and
12060 # are all built from PIC.
12061 case $host_os in
12062 aix3*)
12063 test yes = "$enable_shared" && enable_static=no
12064 if test -n "$RANLIB"; then
12065 archive_cmds="$archive_cmds~\$RANLIB \$lib"
12066 postinstall_cmds='$RANLIB $lib'
12067 fi
12068 ;;
12069
12070 aix[4-9]*)
12071 if test ia64 != "$host_cpu"; then
12072 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
12073 yes,aix,yes) ;; # shared object as lib.so file only
12074 yes,svr4,*) ;; # shared object as lib.so archive member only
12075 yes,*) enable_static=no ;; # shared object in lib.a archive as well
12076 esac
12077 fi
12078 ;;
12079 esac
12080 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
12081 $as_echo "$enable_shared" >&6; }
12082
12083 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
12084 $as_echo_n "checking whether to build static libraries... " >&6; }
12085 # Make sure either enable_shared or enable_static is yes.
12086 test yes = "$enable_shared" || enable_static=yes
12087 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
12088 $as_echo "$enable_static" >&6; }
12089
12090
12091
12092
12093 fi
12094 ac_ext=c
12095 ac_cpp='$CPP $CPPFLAGS'
12096 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12097 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12098 ac_compiler_gnu=$ac_cv_c_compiler_gnu
12099
12100 CC=$lt_save_CC
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116 ac_config_commands="$ac_config_commands libtool"
12117
12118
12119
12120
12121 # Only expand once:
12122
12123
12124
12125 # Check whether --enable-silent-rules was given.
12126 if test "${enable_silent_rules+set}" = set; then :
12127 enableval=$enable_silent_rules;
12128 fi
12129
12130 case $enable_silent_rules in # (((
12131 yes) AM_DEFAULT_VERBOSITY=0;;
12132 no) AM_DEFAULT_VERBOSITY=1;;
12133 *) AM_DEFAULT_VERBOSITY=0;;
12134 esac
12135 am_make=${MAKE-make}
12136 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
12137 $as_echo_n "checking whether $am_make supports nested variables... " >&6; }
12138 if ${am_cv_make_support_nested_variables+:} false; then :
12139 $as_echo_n "(cached) " >&6
12140 else
12141 if $as_echo 'TRUE=$(BAR$(V))
12142 BAR0=false
12143 BAR1=true
12144 V=1
12145 am__doit:
12146 @$(TRUE)
12147 .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
12148 am_cv_make_support_nested_variables=yes
12149 else
12150 am_cv_make_support_nested_variables=no
12151 fi
12152 fi
12153 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
12154 $as_echo "$am_cv_make_support_nested_variables" >&6; }
12155 if test $am_cv_make_support_nested_variables = yes; then
12156 AM_V='$(V)'
12157 AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
12158 else
12159 AM_V=$AM_DEFAULT_VERBOSITY
12160 AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
12161 fi
12162 AM_BACKSLASH='\'
12163
12164
12165 AM_CPPFLAGS="-I\${top_srcdir}/include"
12166 AM_CFLAGS="-Wall"
12167 AM_LDFLAGS="-Wl,-z -Wl,relro"
12168
12169
12170
12171
12172
12173
12174
12175 for ac_header in $ac_header_list
12176 do :
12177 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
12178 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
12179 "
12180 if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
12181 cat >>confdefs.h <<_ACEOF
12182 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
12183 _ACEOF
12184
12185 fi
12186
12187 done
12188
12189
12190
12191
12192
12193 VERSION_MAJOR=$(echo ${VERSION} | cut -d'.' -f 1)
12194 VERSION_MINOR=$(echo ${VERSION} | cut -d'.' -f 2)
12195 VERSION_MICRO=$(echo ${VERSION} | cut -d'.' -f 3)
12196
12197
12198
12199
12200
12201 # Extract the first word of "cython", so it can be a program name with args.
12202 set dummy cython; ac_word=$2
12203 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12204 $as_echo_n "checking for $ac_word... " >&6; }
12205 if ${ac_cv_prog_have_cython+:} false; then :
12206 $as_echo_n "(cached) " >&6
12207 else
12208 if test -n "$have_cython"; then
12209 ac_cv_prog_have_cython="$have_cython" # Let the user override the test.
12210 else
12211 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12212 for as_dir in $PATH
12213 do
12214 IFS=$as_save_IFS
12215 test -z "$as_dir" && as_dir=.
12216 for ac_exec_ext in '' $ac_executable_extensions; do
12217 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12218 ac_cv_prog_have_cython=""yes""
12219 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12220 break 2
12221 fi
12222 done
12223 done
12224 IFS=$as_save_IFS
12225
12226 test -z "$ac_cv_prog_have_cython" && ac_cv_prog_have_cython=""no""
12227 fi
12228 fi
12229 have_cython=$ac_cv_prog_have_cython
12230 if test -n "$have_cython"; then
12231 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_cython" >&5
12232 $as_echo "$have_cython" >&6; }
12233 else
12234 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12235 $as_echo "no" >&6; }
12236 fi
12237
12238
12239 if test "$have_cython" = yes; then :
12240
12241 $as_echo "checking cython version... $(cython -V 2>&1 | cut -d' ' -f 3)"
12242 CYTHON_VER_MAJ=$(cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 1);
12243 CYTHON_VER_MIN=$(cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 2);
12244
12245 else
12246
12247 CYTHON_VER_MAJ=0
12248 CYTHON_VER_MIN=0
12249
12250 fi
12251
12252 # Check whether --enable-python was given.
12253 if test "${enable_python+set}" = set; then :
12254 enableval=$enable_python;
12255 fi
12256
12257 if test "$enable_python" = yes; then :
12258
12259 # cython version check
12260 if test "$CYTHON_VER_MAJ" -eq 0 -a "$CYTHON_VER_MIN" -lt 16; then :
12261
12262 as_fn_error $? "python bindings require cython 0.16 or higher" "$LINENO" 5
12263
12264 fi
12265
12266 fi
12267 if test "$enable_python" = yes; then
12268 ENABLE_PYTHON_TRUE=
12269 ENABLE_PYTHON_FALSE='#'
12270 else
12271 ENABLE_PYTHON_TRUE='#'
12272 ENABLE_PYTHON_FALSE=
12273 fi
12274
12275
12276 cat >>confdefs.h <<_ACEOF
12277 #define ENABLE_PYTHON $(test "$enable_python" == yes && echo 1 || echo 0)
12278 _ACEOF
12279
12280
12281 # Extract the first word of "cov-build", so it can be a program name with args.
12282 set dummy cov-build; ac_word=$2
12283 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12284 $as_echo_n "checking for $ac_word... " >&6; }
12285 if ${ac_cv_prog_have_coverity+:} false; then :
12286 $as_echo_n "(cached) " >&6
12287 else
12288 if test -n "$have_coverity"; then
12289 ac_cv_prog_have_coverity="$have_coverity" # Let the user override the test.
12290 else
12291 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12292 for as_dir in $PATH
12293 do
12294 IFS=$as_save_IFS
12295 test -z "$as_dir" && as_dir=.
12296 for ac_exec_ext in '' $ac_executable_extensions; do
12297 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12298 ac_cv_prog_have_coverity=""yes""
12299 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12300 break 2
12301 fi
12302 done
12303 done
12304 IFS=$as_save_IFS
12305
12306 test -z "$ac_cv_prog_have_coverity" && ac_cv_prog_have_coverity=""no""
12307 fi
12308 fi
12309 have_coverity=$ac_cv_prog_have_coverity
12310 if test -n "$have_coverity"; then
12311 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_coverity" >&5
12312 $as_echo "$have_coverity" >&6; }
12313 else
12314 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12315 $as_echo "no" >&6; }
12316 fi
12317
12318
12319 if test "$have_coverity" = yes; then
12320 COVERITY_TRUE=
12321 COVERITY_FALSE='#'
12322 else
12323 COVERITY_TRUE='#'
12324 COVERITY_FALSE=
12325 fi
12326
12327
12328 ac_config_files="$ac_config_files libseccomp.pc include/seccomp.h"
12329
12330
12331 ac_config_files="$ac_config_files Makefile include/Makefile src/Makefile src/python/Makefile tools/Makefile tests/Makefile doc/Makefile"
12332
12333
12334 cat >confcache <<\_ACEOF
12335 # This file is a shell script that caches the results of configure
12336 # tests run on this system so they can be shared between configure
12337 # scripts and configure runs, see configure's option --config-cache.
12338 # It is not useful on other systems. If it contains results you don't
12339 # want to keep, you may remove or edit it.
12340 #
12341 # config.status only pays attention to the cache file if you give it
12342 # the --recheck option to rerun configure.
12343 #
12344 # `ac_cv_env_foo' variables (set or unset) will be overridden when
12345 # loading this file, other *unset* `ac_cv_foo' will be assigned the
12346 # following values.
12347
12348 _ACEOF
12349
12350 # The following way of writing the cache mishandles newlines in values,
12351 # but we know of no workaround that is simple, portable, and efficient.
12352 # So, we kill variables containing newlines.
12353 # Ultrix sh set writes to stderr and can't be redirected directly,
12354 # and sets the high bit in the cache file unless we assign to the vars.
12355 (
12356 for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
12357 eval ac_val=\$$ac_var
12358 case $ac_val in #(
12359 *${as_nl}*)
12360 case $ac_var in #(
12361 *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
12362 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
12363 esac
12364 case $ac_var in #(
12365 _ | IFS | as_nl) ;; #(
12366 BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
12367 *) { eval $ac_var=; unset $ac_var;} ;;
12368 esac ;;
12369 esac
12370 done
12371
12372 (set) 2>&1 |
12373 case $as_nl`(ac_space=' '; set) 2>&1` in #(
12374 *${as_nl}ac_space=\ *)
12375 # `set' does not quote correctly, so add quotes: double-quote
12376 # substitution turns \\\\ into \\, and sed turns \\ into \.
12377 sed -n \
12378 "s/'/'\\\\''/g;
12379 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
12380 ;; #(
12381 *)
12382 # `set' quotes correctly as required by POSIX, so do not add quotes.
12383 sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
12384 ;;
12385 esac |
12386 sort
12387 ) |
12388 sed '
12389 /^ac_cv_env_/b end
12390 t clear
12391 :clear
12392 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
12393 t end
12394 s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
12395 :end' >>confcache
12396 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
12397 if test -w "$cache_file"; then
12398 if test "x$cache_file" != "x/dev/null"; then
12399 { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
12400 $as_echo "$as_me: updating cache $cache_file" >&6;}
12401 if test ! -f "$cache_file" || test -h "$cache_file"; then
12402 cat confcache >"$cache_file"
12403 else
12404 case $cache_file in #(
12405 */* | ?:*)
12406 mv -f confcache "$cache_file"$$ &&
12407 mv -f "$cache_file"$$ "$cache_file" ;; #(
12408 *)
12409 mv -f confcache "$cache_file" ;;
13012410 esac
12411 fi
12412 fi
12413 else
12414 { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
12415 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
12416 fi
12417 fi
12418 rm -f confcache
12419
12420 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12421 # Let make expand exec_prefix.
12422 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12423
12424 DEFS=-DHAVE_CONFIG_H
12425
12426 ac_libobjs=
12427 ac_ltlibobjs=
12428 U=
12429 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
12430 # 1. Remove the extension, and $U if already installed.
12431 ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
12432 ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
12433 # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
12434 # will be set to the directory where LIBOBJS objects are built.
12435 as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
12436 as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
12437 done
12438 LIBOBJS=$ac_libobjs
12439
12440 LTLIBOBJS=$ac_ltlibobjs
12441
12442
12443 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
12444 $as_echo_n "checking that generated files are newer than configure... " >&6; }
12445 if test -n "$am_sleep_pid"; then
12446 # Hide warnings about reused PIDs.
12447 wait $am_sleep_pid 2>/dev/null
12448 fi
12449 { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
12450 $as_echo "done" >&6; }
12451 if test -n "$EXEEXT"; then
12452 am__EXEEXT_TRUE=
12453 am__EXEEXT_FALSE='#'
12454 else
12455 am__EXEEXT_TRUE='#'
12456 am__EXEEXT_FALSE=
12457 fi
12458
12459 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
12460 as_fn_error $? "conditional \"AMDEP\" was never defined.
12461 Usually this means the macro was only invoked conditionally." "$LINENO" 5
12462 fi
12463 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
12464 as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
12465 Usually this means the macro was only invoked conditionally." "$LINENO" 5
12466 fi
12467 if test -z "${ENABLE_PYTHON_TRUE}" && test -z "${ENABLE_PYTHON_FALSE}"; then
12468 as_fn_error $? "conditional \"ENABLE_PYTHON\" was never defined.
12469 Usually this means the macro was only invoked conditionally." "$LINENO" 5
12470 fi
12471 if test -z "${COVERITY_TRUE}" && test -z "${COVERITY_FALSE}"; then
12472 as_fn_error $? "conditional \"COVERITY\" was never defined.
12473 Usually this means the macro was only invoked conditionally." "$LINENO" 5
12474 fi
12475
12476 : "${CONFIG_STATUS=./config.status}"
12477 ac_write_fail=0
12478 ac_clean_files_save=$ac_clean_files
12479 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
12480 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
12481 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
12482 as_write_fail=0
12483 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
12484 #! $SHELL
12485 # Generated by $as_me.
12486 # Run this file to recreate the current configuration.
12487 # Compiler output produced by configure, useful for debugging
12488 # configure, is in config.log if it exists.
12489
12490 debug=false
12491 ac_cs_recheck=false
12492 ac_cs_silent=false
12493
12494 SHELL=\${CONFIG_SHELL-$SHELL}
12495 export SHELL
12496 _ASEOF
12497 cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
12498 ## -------------------- ##
12499 ## M4sh Initialization. ##
12500 ## -------------------- ##
12501
12502 # Be more Bourne compatible
12503 DUALCASE=1; export DUALCASE # for MKS sh
12504 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
12505 emulate sh
12506 NULLCMD=:
12507 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
12508 # is contrary to our usage. Disable this feature.
12509 alias -g '${1+"$@"}'='"$@"'
12510 setopt NO_GLOB_SUBST
12511 else
12512 case `(set -o) 2>/dev/null` in #(
12513 *posix*) :
12514 set -o posix ;; #(
12515 *) :
12516 ;;
12517 esac
12518 fi
12519
12520
12521 as_nl='
12522 '
12523 export as_nl
12524 # Printing a long string crashes Solaris 7 /usr/bin/printf.
12525 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12526 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
12527 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
12528 # Prefer a ksh shell builtin over an external printf program on Solaris,
12529 # but without wasting forks for bash or zsh.
12530 if test -z "$BASH_VERSION$ZSH_VERSION" \
12531 && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
12532 as_echo='print -r --'
12533 as_echo_n='print -rn --'
12534 elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
12535 as_echo='printf %s\n'
12536 as_echo_n='printf %s'
12537 else
12538 if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
12539 as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
12540 as_echo_n='/usr/ucb/echo -n'
12541 else
12542 as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
12543 as_echo_n_body='eval
12544 arg=$1;
12545 case $arg in #(
12546 *"$as_nl"*)
12547 expr "X$arg" : "X\\(.*\\)$as_nl";
12548 arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
12549 esac;
12550 expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
12551 '
12552 export as_echo_n_body
12553 as_echo_n='sh -c $as_echo_n_body as_echo'
12554 fi
12555 export as_echo_body
12556 as_echo='sh -c $as_echo_body as_echo'
12557 fi
12558
12559 # The user is always right.
12560 if test "${PATH_SEPARATOR+set}" != set; then
12561 PATH_SEPARATOR=:
12562 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
12563 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
12564 PATH_SEPARATOR=';'
12565 }
12566 fi
12567
12568
12569 # IFS
12570 # We need space, tab and new line, in precisely that order. Quoting is
12571 # there to prevent editors from complaining about space-tab.
12572 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
12573 # splitting by setting IFS to empty value.)
12574 IFS=" "" $as_nl"
12575
12576 # Find who we are. Look in the path if we contain no directory separator.
12577 as_myself=
12578 case $0 in #((
12579 *[\\/]* ) as_myself=$0 ;;
12580 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12581 for as_dir in $PATH
12582 do
12583 IFS=$as_save_IFS
12584 test -z "$as_dir" && as_dir=.
12585 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
12586 done
12587 IFS=$as_save_IFS
12588
12589 ;;
12590 esac
12591 # We did not find ourselves, most probably we were run as `sh COMMAND'
12592 # in which case we are not to be found in the path.
12593 if test "x$as_myself" = x; then
12594 as_myself=$0
12595 fi
12596 if test ! -f "$as_myself"; then
12597 $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
12598 exit 1
12599 fi
12600
12601 # Unset variables that we do not need and which cause bugs (e.g. in
12602 # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
12603 # suppresses any "Segmentation fault" message there. '((' could
12604 # trigger a bug in pdksh 5.2.14.
12605 for as_var in BASH_ENV ENV MAIL MAILPATH
12606 do eval test x\${$as_var+set} = xset \
12607 && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
12608 done
12609 PS1='$ '
12610 PS2='> '
12611 PS4='+ '
12612
12613 # NLS nuisances.
12614 LC_ALL=C
12615 export LC_ALL
12616 LANGUAGE=C
12617 export LANGUAGE
12618
12619 # CDPATH.
12620 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
12621
12622
12623 # as_fn_error STATUS ERROR [LINENO LOG_FD]
12624 # ----------------------------------------
12625 # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
12626 # provided, also output the error to LOG_FD, referencing LINENO. Then exit the
12627 # script with STATUS, using 1 if that was 0.
12628 as_fn_error ()
12629 {
12630 as_status=$1; test $as_status -eq 0 && as_status=1
12631 if test "$4"; then
12632 as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
12633 $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
12634 fi
12635 $as_echo "$as_me: error: $2" >&2
12636 as_fn_exit $as_status
12637 } # as_fn_error
12638
12639
12640 # as_fn_set_status STATUS
12641 # -----------------------
12642 # Set $? to STATUS, without forking.
12643 as_fn_set_status ()
12644 {
12645 return $1
12646 } # as_fn_set_status
12647
12648 # as_fn_exit STATUS
12649 # -----------------
12650 # Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
12651 as_fn_exit ()
12652 {
12653 set +e
12654 as_fn_set_status $1
12655 exit $1
12656 } # as_fn_exit
12657
12658 # as_fn_unset VAR
12659 # ---------------
12660 # Portably unset VAR.
12661 as_fn_unset ()
12662 {
12663 { eval $1=; unset $1;}
13112664 }
132
133 function cnf_reset() {
134 cat /dev/null > $cnf_mk_file
135 cat /dev/null > $cnf_h_file
12665 as_unset=as_fn_unset
12666 # as_fn_append VAR VALUE
12667 # ----------------------
12668 # Append the text in VALUE to the end of the definition contained in VAR. Take
12669 # advantage of any shell optimizations that allow amortized linear growth over
12670 # repeated appends, instead of the typical quadratic growth present in naive
12671 # implementations.
12672 if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
12673 eval 'as_fn_append ()
12674 {
12675 eval $1+=\$2
12676 }'
12677 else
12678 as_fn_append ()
12679 {
12680 eval $1=\$$1\$2
12681 }
12682 fi # as_fn_append
12683
12684 # as_fn_arith ARG...
12685 # ------------------
12686 # Perform arithmetic evaluation on the ARGs, and store the result in the
12687 # global $as_val. Take advantage of shells that can avoid forks. The arguments
12688 # must be portable across $(()) and expr.
12689 if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
12690 eval 'as_fn_arith ()
12691 {
12692 as_val=$(( $* ))
12693 }'
12694 else
12695 as_fn_arith ()
12696 {
12697 as_val=`expr "$@" || test $? -eq 1`
12698 }
12699 fi # as_fn_arith
12700
12701
12702 if expr a : '\(a\)' >/dev/null 2>&1 &&
12703 test "X`expr 00001 : '.*\(...\)'`" = X001; then
12704 as_expr=expr
12705 else
12706 as_expr=false
12707 fi
12708
12709 if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
12710 as_basename=basename
12711 else
12712 as_basename=false
12713 fi
12714
12715 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
12716 as_dirname=dirname
12717 else
12718 as_dirname=false
12719 fi
12720
12721 as_me=`$as_basename -- "$0" ||
12722 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
12723 X"$0" : 'X\(//\)$' \| \
12724 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
12725 $as_echo X/"$0" |
12726 sed '/^.*\/\([^/][^/]*\)\/*$/{
12727 s//\1/
12728 q
12729 }
12730 /^X\/\(\/\/\)$/{
12731 s//\1/
12732 q
12733 }
12734 /^X\/\(\/\).*/{
12735 s//\1/
12736 q
12737 }
12738 s/.*/./; q'`
12739
12740 # Avoid depending upon Character Ranges.
12741 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12742 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
12743 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
12744 as_cr_digits='0123456789'
12745 as_cr_alnum=$as_cr_Letters$as_cr_digits
12746
12747 ECHO_C= ECHO_N= ECHO_T=
12748 case `echo -n x` in #(((((
12749 -n*)
12750 case `echo 'xy\c'` in
12751 *c*) ECHO_T=' ';; # ECHO_T is single tab character.
12752 xy) ECHO_C='\c';;
12753 *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
12754 ECHO_T=' ';;
12755 esac;;
12756 *)
12757 ECHO_N='-n';;
12758 esac
12759
12760 rm -f conf$$ conf$$.exe conf$$.file
12761 if test -d conf$$.dir; then
12762 rm -f conf$$.dir/conf$$.file
12763 else
12764 rm -f conf$$.dir
12765 mkdir conf$$.dir 2>/dev/null
12766 fi
12767 if (echo >conf$$.file) 2>/dev/null; then
12768 if ln -s conf$$.file conf$$ 2>/dev/null; then
12769 as_ln_s='ln -s'
12770 # ... but there are two gotchas:
12771 # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
12772 # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
12773 # In both cases, we have to default to `cp -pR'.
12774 ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
12775 as_ln_s='cp -pR'
12776 elif ln conf$$.file conf$$ 2>/dev/null; then
12777 as_ln_s=ln
12778 else
12779 as_ln_s='cp -pR'
12780 fi
12781 else
12782 as_ln_s='cp -pR'
12783 fi
12784 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
12785 rmdir conf$$.dir 2>/dev/null
12786
12787
12788 # as_fn_mkdir_p
12789 # -------------
12790 # Create "$as_dir" as a directory, including parents if necessary.
12791 as_fn_mkdir_p ()
12792 {
12793
12794 case $as_dir in #(
12795 -*) as_dir=./$as_dir;;
12796 esac
12797 test -d "$as_dir" || eval $as_mkdir_p || {
12798 as_dirs=
12799 while :; do
12800 case $as_dir in #(
12801 *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
12802 *) as_qdir=$as_dir;;
12803 esac
12804 as_dirs="'$as_qdir' $as_dirs"
12805 as_dir=`$as_dirname -- "$as_dir" ||
12806 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12807 X"$as_dir" : 'X\(//\)[^/]' \| \
12808 X"$as_dir" : 'X\(//\)$' \| \
12809 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
12810 $as_echo X"$as_dir" |
12811 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
12812 s//\1/
12813 q
12814 }
12815 /^X\(\/\/\)[^/].*/{
12816 s//\1/
12817 q
12818 }
12819 /^X\(\/\/\)$/{
12820 s//\1/
12821 q
12822 }
12823 /^X\(\/\).*/{
12824 s//\1/
12825 q
12826 }
12827 s/.*/./; q'`
12828 test -d "$as_dir" && break
12829 done
12830 test -z "$as_dirs" || eval "mkdir $as_dirs"
12831 } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
12832
12833
12834 } # as_fn_mkdir_p
12835 if mkdir -p . 2>/dev/null; then
12836 as_mkdir_p='mkdir -p "$as_dir"'
12837 else
12838 test -d ./-p && rmdir ./-p
12839 as_mkdir_p=false
12840 fi
12841
12842
12843 # as_fn_executable_p FILE
12844 # -----------------------
12845 # Test if FILE is an executable regular file.
12846 as_fn_executable_p ()
12847 {
12848 test -f "$1" && test -x "$1"
12849 } # as_fn_executable_p
12850 as_test_x='test -x'
12851 as_executable_p=as_fn_executable_p
12852
12853 # Sed expression to map a string onto a valid CPP name.
12854 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
12855
12856 # Sed expression to map a string onto a valid variable name.
12857 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
12858
12859
12860 exec 6>&1
12861 ## ----------------------------------- ##
12862 ## Main body of $CONFIG_STATUS script. ##
12863 ## ----------------------------------- ##
12864 _ASEOF
12865 test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
12866
12867 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
12868 # Save the log message, to keep $0 and so on meaningful, and to
12869 # report actual input values of CONFIG_FILES etc. instead of their
12870 # values after options handling.
12871 ac_log="
12872 This file was extended by libseccomp $as_me 2.2.3, which was
12873 generated by GNU Autoconf 2.69. Invocation command line was
12874
12875 CONFIG_FILES = $CONFIG_FILES
12876 CONFIG_HEADERS = $CONFIG_HEADERS
12877 CONFIG_LINKS = $CONFIG_LINKS
12878 CONFIG_COMMANDS = $CONFIG_COMMANDS
12879 $ $0 $@
12880
12881 on `(hostname || uname -n) 2>/dev/null | sed 1q`
12882 "
12883
12884 _ACEOF
12885
12886 case $ac_config_files in *"
12887 "*) set x $ac_config_files; shift; ac_config_files=$*;;
12888 esac
12889
12890 case $ac_config_headers in *"
12891 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
12892 esac
12893
12894
12895 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
12896 # Files that config.status was made for.
12897 config_files="$ac_config_files"
12898 config_headers="$ac_config_headers"
12899 config_commands="$ac_config_commands"
12900
12901 _ACEOF
12902
12903 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
12904 ac_cs_usage="\
12905 \`$as_me' instantiates files and other configuration actions
12906 from templates according to the current configuration. Unless the files
12907 and actions are specified as TAGs, all are instantiated by default.
12908
12909 Usage: $0 [OPTION]... [TAG]...
12910
12911 -h, --help print this help, then exit
12912 -V, --version print version number and configuration settings, then exit
12913 --config print configuration, then exit
12914 -q, --quiet, --silent
12915 do not print progress messages
12916 -d, --debug don't remove temporary files
12917 --recheck update $as_me by reconfiguring in the same conditions
12918 --file=FILE[:TEMPLATE]
12919 instantiate the configuration file FILE
12920 --header=FILE[:TEMPLATE]
12921 instantiate the configuration header FILE
12922
12923 Configuration files:
12924 $config_files
12925
12926 Configuration headers:
12927 $config_headers
12928
12929 Configuration commands:
12930 $config_commands
12931
12932 Report bugs to the package provider."
12933
12934 _ACEOF
12935 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
12936 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
12937 ac_cs_version="\\
12938 libseccomp config.status 2.2.3
12939 configured by $0, generated by GNU Autoconf 2.69,
12940 with options \\"\$ac_cs_config\\"
12941
12942 Copyright (C) 2012 Free Software Foundation, Inc.
12943 This config.status script is free software; the Free Software Foundation
12944 gives unlimited permission to copy, distribute and modify it."
12945
12946 ac_pwd='$ac_pwd'
12947 srcdir='$srcdir'
12948 INSTALL='$INSTALL'
12949 MKDIR_P='$MKDIR_P'
12950 AWK='$AWK'
12951 test -n "\$AWK" || AWK=awk
12952 _ACEOF
12953
12954 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
12955 # The default lists apply if the user does not specify any file.
12956 ac_need_defaults=:
12957 while test $# != 0
12958 do
12959 case $1 in
12960 --*=?*)
12961 ac_option=`expr "X$1" : 'X\([^=]*\)='`
12962 ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
12963 ac_shift=:
12964 ;;
12965 --*=)
12966 ac_option=`expr "X$1" : 'X\([^=]*\)='`
12967 ac_optarg=
12968 ac_shift=:
12969 ;;
12970 *)
12971 ac_option=$1
12972 ac_optarg=$2
12973 ac_shift=shift
12974 ;;
12975 esac
12976
12977 case $ac_option in
12978 # Handling of the options.
12979 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12980 ac_cs_recheck=: ;;
12981 --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
12982 $as_echo "$ac_cs_version"; exit ;;
12983 --config | --confi | --conf | --con | --co | --c )
12984 $as_echo "$ac_cs_config"; exit ;;
12985 --debug | --debu | --deb | --de | --d | -d )
12986 debug=: ;;
12987 --file | --fil | --fi | --f )
12988 $ac_shift
12989 case $ac_optarg in
12990 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
12991 '') as_fn_error $? "missing file argument" ;;
12992 esac
12993 as_fn_append CONFIG_FILES " '$ac_optarg'"
12994 ac_need_defaults=false;;
12995 --header | --heade | --head | --hea )
12996 $ac_shift
12997 case $ac_optarg in
12998 *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
12999 esac
13000 as_fn_append CONFIG_HEADERS " '$ac_optarg'"
13001 ac_need_defaults=false;;
13002 --he | --h)
13003 # Conflict between --help and --header
13004 as_fn_error $? "ambiguous option: \`$1'
13005 Try \`$0 --help' for more information.";;
13006 --help | --hel | -h )
13007 $as_echo "$ac_cs_usage"; exit ;;
13008 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
13009 | -silent | --silent | --silen | --sile | --sil | --si | --s)
13010 ac_cs_silent=: ;;
13011
13012 # This is an error.
13013 -*) as_fn_error $? "unrecognized option: \`$1'
13014 Try \`$0 --help' for more information." ;;
13015
13016 *) as_fn_append ac_config_targets " $1"
13017 ac_need_defaults=false ;;
13018
13019 esac
13020 shift
13021 done
13022
13023 ac_configure_extra_args=
13024
13025 if $ac_cs_silent; then
13026 exec 6>/dev/null
13027 ac_configure_extra_args="$ac_configure_extra_args --silent"
13028 fi
13029
13030 _ACEOF
13031 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13032 if \$ac_cs_recheck; then
13033 set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
13034 shift
13035 \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
13036 CONFIG_SHELL='$SHELL'
13037 export CONFIG_SHELL
13038 exec "\$@"
13039 fi
13040
13041 _ACEOF
13042 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13043 exec 5>>config.log
13044 {
13045 echo
13046 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
13047 ## Running $as_me. ##
13048 _ASBOX
13049 $as_echo "$ac_log"
13050 } >&5
13051
13052 _ACEOF
13053 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13054 #
13055 # INIT-COMMANDS
13056 #
13057 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
13058
13059
13060 # The HP-UX ksh and POSIX shell print the target directory to stdout
13061 # if CDPATH is set.
13062 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
13063
13064 sed_quote_subst='$sed_quote_subst'
13065 double_quote_subst='$double_quote_subst'
13066 delay_variable_subst='$delay_variable_subst'
13067 macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
13068 macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
13069 enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
13070 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
13071 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
13072 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
13073 shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
13074 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
13075 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
13076 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
13077 host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
13078 host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
13079 host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
13080 build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
13081 build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
13082 build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
13083 SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
13084 Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
13085 GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
13086 EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
13087 FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
13088 LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
13089 NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
13090 LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
13091 max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
13092 ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
13093 exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
13094 lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
13095 lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
13096 lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
13097 lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
13098 lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
13099 reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
13100 reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
13101 OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
13102 deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
13103 file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
13104 file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
13105 want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
13106 DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
13107 sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
13108 AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
13109 AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
13110 archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
13111 STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
13112 RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
13113 old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
13114 old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
13115 old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
13116 lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
13117 CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
13118 CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
13119 compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
13120 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
13121 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
13122 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
13123 lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
13124 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
13125 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
13126 lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
13127 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
13128 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
13129 lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
13130 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
13131 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
13132 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
13133 lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
13134 lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
13135 lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
13136 lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
13137 need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
13138 MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
13139 DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
13140 NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
13141 LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
13142 OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
13143 OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
13144 libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
13145 shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
13146 extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
13147 archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
13148 enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
13149 export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
13150 whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
13151 compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
13152 old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
13153 old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
13154 archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
13155 archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
13156 module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
13157 module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
13158 with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
13159 allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
13160 no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
13161 hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
13162 hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
13163 hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
13164 hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
13165 hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
13166 hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
13167 hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
13168 inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
13169 link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
13170 always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
13171 export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
13172 exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
13173 include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
13174 prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
13175 postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
13176 file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
13177 variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
13178 need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
13179 need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
13180 version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
13181 runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
13182 shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
13183 shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
13184 libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
13185 library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
13186 soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
13187 install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
13188 postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
13189 postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
13190 finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
13191 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
13192 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
13193 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
13194 configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
13195 configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
13196 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
13197 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
13198 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
13199 enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
13200 old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
13201 striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
13202
13203 LTCC='$LTCC'
13204 LTCFLAGS='$LTCFLAGS'
13205 compiler='$compiler_DEFAULT'
13206
13207 # A function that is used when there is no print builtin or printf.
13208 func_fallback_echo ()
13209 {
13210 eval 'cat <<_LTECHO_EOF
13211 \$1
13212 _LTECHO_EOF'
13613213 }
13713214
138 function cnf_header() {
139 cnf_mk_header
140 cnf_h_header
13215 # Quote evaled strings.
13216 for var in SHELL \
13217 ECHO \
13218 PATH_SEPARATOR \
13219 SED \
13220 GREP \
13221 EGREP \
13222 FGREP \
13223 LD \
13224 NM \
13225 LN_S \
13226 lt_SP2NL \
13227 lt_NL2SP \
13228 reload_flag \
13229 OBJDUMP \
13230 deplibs_check_method \
13231 file_magic_cmd \
13232 file_magic_glob \
13233 want_nocaseglob \
13234 DLLTOOL \
13235 sharedlib_from_linklib_cmd \
13236 AR \
13237 AR_FLAGS \
13238 archiver_list_spec \
13239 STRIP \
13240 RANLIB \
13241 CC \
13242 CFLAGS \
13243 compiler \
13244 lt_cv_sys_global_symbol_pipe \
13245 lt_cv_sys_global_symbol_to_cdecl \
13246 lt_cv_sys_global_symbol_to_import \
13247 lt_cv_sys_global_symbol_to_c_name_address \
13248 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
13249 lt_cv_nm_interface \
13250 nm_file_list_spec \
13251 lt_cv_truncate_bin \
13252 lt_prog_compiler_no_builtin_flag \
13253 lt_prog_compiler_pic \
13254 lt_prog_compiler_wl \
13255 lt_prog_compiler_static \
13256 lt_cv_prog_compiler_c_o \
13257 need_locks \
13258 MANIFEST_TOOL \
13259 DSYMUTIL \
13260 NMEDIT \
13261 LIPO \
13262 OTOOL \
13263 OTOOL64 \
13264 shrext_cmds \
13265 export_dynamic_flag_spec \
13266 whole_archive_flag_spec \
13267 compiler_needs_object \
13268 with_gnu_ld \
13269 allow_undefined_flag \
13270 no_undefined_flag \
13271 hardcode_libdir_flag_spec \
13272 hardcode_libdir_separator \
13273 exclude_expsyms \
13274 include_expsyms \
13275 file_list_spec \
13276 variables_saved_for_relink \
13277 libname_spec \
13278 library_names_spec \
13279 soname_spec \
13280 install_override_mode \
13281 finish_eval \
13282 old_striplib \
13283 striplib; do
13284 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
13285 *[\\\\\\\`\\"\\\$]*)
13286 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
13287 ;;
13288 *)
13289 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
13290 ;;
13291 esac
13292 done
13293
13294 # Double-quote double-evaled strings.
13295 for var in reload_cmds \
13296 old_postinstall_cmds \
13297 old_postuninstall_cmds \
13298 old_archive_cmds \
13299 extract_expsyms_cmds \
13300 old_archive_from_new_cmds \
13301 old_archive_from_expsyms_cmds \
13302 archive_cmds \
13303 archive_expsym_cmds \
13304 module_cmds \
13305 module_expsym_cmds \
13306 export_symbols_cmds \
13307 prelink_cmds \
13308 postlink_cmds \
13309 postinstall_cmds \
13310 postuninstall_cmds \
13311 finish_cmds \
13312 sys_lib_search_path_spec \
13313 configure_time_dlsearch_path \
13314 configure_time_lt_sys_library_path; do
13315 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
13316 *[\\\\\\\`\\"\\\$]*)
13317 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
13318 ;;
13319 *)
13320 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
13321 ;;
13322 esac
13323 done
13324
13325 ac_aux_dir='$ac_aux_dir'
13326
13327 # See if we are running on zsh, and set the options that allow our
13328 # commands through without removal of \ escapes INIT.
13329 if test -n "\${ZSH_VERSION+set}"; then
13330 setopt NO_GLOB_SUBST
13331 fi
13332
13333
13334 PACKAGE='$PACKAGE'
13335 VERSION='$VERSION'
13336 RM='$RM'
13337 ofile='$ofile'
13338
13339
13340
13341
13342 _ACEOF
13343
13344 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13345
13346 # Handling of arguments.
13347 for ac_config_target in $ac_config_targets
13348 do
13349 case $ac_config_target in
13350 "configure.h") CONFIG_HEADERS="$CONFIG_HEADERS configure.h" ;;
13351 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
13352 "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
13353 "libseccomp.pc") CONFIG_FILES="$CONFIG_FILES libseccomp.pc" ;;
13354 "include/seccomp.h") CONFIG_FILES="$CONFIG_FILES include/seccomp.h" ;;
13355 "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
13356 "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
13357 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
13358 "src/python/Makefile") CONFIG_FILES="$CONFIG_FILES src/python/Makefile" ;;
13359 "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
13360 "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
13361 "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
13362
13363 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
13364 esac
13365 done
13366
13367
13368 # If the user did not use the arguments to specify the items to instantiate,
13369 # then the envvar interface is used. Set only those that are not.
13370 # We use the long form for the default assignment because of an extremely
13371 # bizarre bug on SunOS 4.1.3.
13372 if $ac_need_defaults; then
13373 test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
13374 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
13375 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
13376 fi
13377
13378 # Have a temporary directory for convenience. Make it in the build tree
13379 # simply because there is no reason against having it here, and in addition,
13380 # creating and moving files from /tmp can sometimes cause problems.
13381 # Hook for its removal unless debugging.
13382 # Note that there is a small window in which the directory will not be cleaned:
13383 # after its creation but before its name has been assigned to `$tmp'.
13384 $debug ||
13385 {
13386 tmp= ac_tmp=
13387 trap 'exit_status=$?
13388 : "${ac_tmp:=$tmp}"
13389 { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
13390 ' 0
13391 trap 'as_fn_exit 1' 1 2 13 15
14113392 }
142
143 function cnf_entry() {
144 cnf_mk_entry "$1" "$2"
145 cnf_h_entry "$1" "$2"
13393 # Create a (secure) tmp directory for tmp files.
13394
13395 {
13396 tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
13397 test -d "$tmp"
13398 } ||
13399 {
13400 tmp=./conf$$-$RANDOM
13401 (umask 077 && mkdir "$tmp")
13402 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
13403 ac_tmp=$tmp
13404
13405 # Set up the scripts for CONFIG_FILES section.
13406 # No need to generate them if there are no CONFIG_FILES.
13407 # This happens for instance with `./config.status config.h'.
13408 if test -n "$CONFIG_FILES"; then
13409
13410
13411 ac_cr=`echo X | tr X '\015'`
13412 # On cygwin, bash can eat \r inside `` if the user requested igncr.
13413 # But we know of no other shell where ac_cr would be empty at this
13414 # point, so we can use a bashism as a fallback.
13415 if test "x$ac_cr" = x; then
13416 eval ac_cr=\$\'\\r\'
13417 fi
13418 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
13419 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
13420 ac_cs_awk_cr='\\r'
13421 else
13422 ac_cs_awk_cr=$ac_cr
13423 fi
13424
13425 echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
13426 _ACEOF
13427
13428
13429 {
13430 echo "cat >conf$$subs.awk <<_ACEOF" &&
13431 echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
13432 echo "_ACEOF"
13433 } >conf$$subs.sh ||
13434 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
13435 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
13436 ac_delim='%!_!# '
13437 for ac_last_try in false false false false false :; do
13438 . ./conf$$subs.sh ||
13439 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
13440
13441 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
13442 if test $ac_delim_n = $ac_delim_num; then
13443 break
13444 elif $ac_last_try; then
13445 as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
13446 else
13447 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
13448 fi
13449 done
13450 rm -f conf$$subs.sh
13451
13452 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13453 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
13454 _ACEOF
13455 sed -n '
13456 h
13457 s/^/S["/; s/!.*/"]=/
13458 p
13459 g
13460 s/^[^!]*!//
13461 :repl
13462 t repl
13463 s/'"$ac_delim"'$//
13464 t delim
13465 :nl
13466 h
13467 s/\(.\{148\}\)..*/\1/
13468 t more1
13469 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
13470 p
13471 n
13472 b repl
13473 :more1
13474 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
13475 p
13476 g
13477 s/.\{148\}//
13478 t nl
13479 :delim
13480 h
13481 s/\(.\{148\}\)..*/\1/
13482 t more2
13483 s/["\\]/\\&/g; s/^/"/; s/$/"/
13484 p
13485 b
13486 :more2
13487 s/["\\]/\\&/g; s/^/"/; s/$/"\\/
13488 p
13489 g
13490 s/.\{148\}//
13491 t delim
13492 ' <conf$$subs.awk | sed '
13493 /^[^""]/{
13494 N
13495 s/\n//
14613496 }
147
148 function cnf_footer() {
149 cnf_mk_footer
150 cnf_h_footer
13497 ' >>$CONFIG_STATUS || ac_write_fail=1
13498 rm -f conf$$subs.awk
13499 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13500 _ACAWK
13501 cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
13502 for (key in S) S_is_set[key] = 1
13503 FS = ""
13504
15113505 }
152
153 function tmpl_filter() {
154 name="echo \$$1"
155 val="$(eval $name)"
156 cat - | sed -e 's/%%'"$1"'%%/'"${val//\//\\/}"'/g;'
13506 {
13507 line = $ 0
13508 nfields = split(line, field, "@")
13509 substed = 0
13510 len = length(field[1])
13511 for (i = 2; i < nfields; i++) {
13512 key = field[i]
13513 keylen = length(key)
13514 if (S_is_set[key]) {
13515 value = S[key]
13516 line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
13517 len += length(value) + length(field[++i])
13518 substed = 1
13519 } else
13520 len += 1 + keylen
13521 }
13522
13523 print line
15713524 }
15813525
159 ####
160 # main
161
13526 _ACAWK
13527 _ACEOF
13528 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13529 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
13530 sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
13531 else
13532 cat
13533 fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
13534 || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
13535 _ACEOF
13536
13537 # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
13538 # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
13539 # trailing colons and then remove the whole line if VPATH becomes empty
13540 # (actually we leave an empty line to preserve line numbers).
13541 if test "x$srcdir" = x.; then
13542 ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
13543 h
13544 s///
13545 s/^/:/
13546 s/[ ]*$/:/
13547 s/:\$(srcdir):/:/g
13548 s/:\${srcdir}:/:/g
13549 s/:@srcdir@:/:/g
13550 s/^:*//
13551 s/:*$//
13552 x
13553 s/\(=[ ]*\).*/\1/
13554 G
13555 s/\n//
13556 s/^[^=]*=[ ]*$//
13557 }'
13558 fi
13559
13560 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13561 fi # test -n "$CONFIG_FILES"
13562
13563 # Set up the scripts for CONFIG_HEADERS section.
13564 # No need to generate them if there are no CONFIG_HEADERS.
13565 # This happens for instance with `./config.status Makefile'.
13566 if test -n "$CONFIG_HEADERS"; then
13567 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
13568 BEGIN {
13569 _ACEOF
13570
13571 # Transform confdefs.h into an awk script `defines.awk', embedded as
13572 # here-document in config.status, that substitutes the proper values into
13573 # config.h.in to produce config.h.
13574
13575 # Create a delimiter string that does not exist in confdefs.h, to ease
13576 # handling of long lines.
13577 ac_delim='%!_!# '
13578 for ac_last_try in false false :; do
13579 ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
13580 if test -z "$ac_tt"; then
13581 break
13582 elif $ac_last_try; then
13583 as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
13584 else
13585 ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
13586 fi
13587 done
13588
13589 # For the awk script, D is an array of macro values keyed by name,
13590 # likewise P contains macro parameters if any. Preserve backslash
13591 # newline sequences.
13592
13593 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
13594 sed -n '
13595 s/.\{148\}/&'"$ac_delim"'/g
13596 t rset
13597 :rset
13598 s/^[ ]*#[ ]*define[ ][ ]*/ /
13599 t def
13600 d
13601 :def
13602 s/\\$//
13603 t bsnl
13604 s/["\\]/\\&/g
13605 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
13606 D["\1"]=" \3"/p
13607 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
13608 d
13609 :bsnl
13610 s/["\\]/\\&/g
13611 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
13612 D["\1"]=" \3\\\\\\n"\\/p
13613 t cont
13614 s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
13615 t cont
13616 d
13617 :cont
13618 n
13619 s/.\{148\}/&'"$ac_delim"'/g
13620 t clear
13621 :clear
13622 s/\\$//
13623 t bsnlc
13624 s/["\\]/\\&/g; s/^/"/; s/$/"/p
13625 d
13626 :bsnlc
13627 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
13628 b cont
13629 ' <confdefs.h | sed '
13630 s/'"$ac_delim"'/"\\\
13631 "/g' >>$CONFIG_STATUS || ac_write_fail=1
13632
13633 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13634 for (key in D) D_is_set[key] = 1
13635 FS = ""
13636 }
13637 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
13638 line = \$ 0
13639 split(line, arg, " ")
13640 if (arg[1] == "#") {
13641 defundef = arg[2]
13642 mac1 = arg[3]
13643 } else {
13644 defundef = substr(arg[1], 2)
13645 mac1 = arg[2]
13646 }
13647 split(mac1, mac2, "(") #)
13648 macro = mac2[1]
13649 prefix = substr(line, 1, index(line, defundef) - 1)
13650 if (D_is_set[macro]) {
13651 # Preserve the white space surrounding the "#".
13652 print prefix "define", macro P[macro] D[macro]
13653 next
13654 } else {
13655 # Replace #undef with comments. This is necessary, for example,
13656 # in the case of _POSIX_SOURCE, which is predefined and required
13657 # on some systems where configure will not decide to define it.
13658 if (defundef == "undef") {
13659 print "/*", prefix defundef, macro, "*/"
13660 next
13661 }
13662 }
13663 }
13664 { print }
13665 _ACAWK
13666 _ACEOF
13667 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13668 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
13669 fi # test -n "$CONFIG_HEADERS"
13670
13671
13672 eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
13673 shift
13674 for ac_tag
13675 do
13676 case $ac_tag in
13677 :[FHLC]) ac_mode=$ac_tag; continue;;
13678 esac
13679 case $ac_mode$ac_tag in
13680 :[FHL]*:*);;
13681 :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
13682 :[FH]-) ac_tag=-:-;;
13683 :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
13684 esac
13685 ac_save_IFS=$IFS
13686 IFS=:
13687 set x $ac_tag
13688 IFS=$ac_save_IFS
13689 shift
13690 ac_file=$1
13691 shift
13692
13693 case $ac_mode in
13694 :L) ac_source=$1;;
13695 :[FH])
13696 ac_file_inputs=
13697 for ac_f
13698 do
13699 case $ac_f in
13700 -) ac_f="$ac_tmp/stdin";;
13701 *) # Look for the file first in the build tree, then in the source tree
13702 # (if the path is not absolute). The absolute path cannot be DOS-style,
13703 # because $ac_f cannot contain `:'.
13704 test -f "$ac_f" ||
13705 case $ac_f in
13706 [\\/$]*) false;;
13707 *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
13708 esac ||
13709 as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
13710 esac
13711 case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
13712 as_fn_append ac_file_inputs " '$ac_f'"
13713 done
13714
13715 # Let's still pretend it is `configure' which instantiates (i.e., don't
13716 # use $as_me), people would be surprised to read:
13717 # /* config.h. Generated by config.status. */
13718 configure_input='Generated from '`
13719 $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
13720 `' by configure.'
13721 if test x"$ac_file" != x-; then
13722 configure_input="$ac_file. $configure_input"
13723 { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
13724 $as_echo "$as_me: creating $ac_file" >&6;}
13725 fi
13726 # Neutralize special characters interpreted by sed in replacement strings.
13727 case $configure_input in #(
13728 *\&* | *\|* | *\\* )
13729 ac_sed_conf_input=`$as_echo "$configure_input" |
13730 sed 's/[\\\\&|]/\\\\&/g'`;; #(
13731 *) ac_sed_conf_input=$configure_input;;
13732 esac
13733
13734 case $ac_tag in
13735 *:-:* | *:-) cat >"$ac_tmp/stdin" \
13736 || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
13737 esac
13738 ;;
13739 esac
13740
13741 ac_dir=`$as_dirname -- "$ac_file" ||
13742 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13743 X"$ac_file" : 'X\(//\)[^/]' \| \
13744 X"$ac_file" : 'X\(//\)$' \| \
13745 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
13746 $as_echo X"$ac_file" |
13747 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13748 s//\1/
13749 q
13750 }
13751 /^X\(\/\/\)[^/].*/{
13752 s//\1/
13753 q
13754 }
13755 /^X\(\/\/\)$/{
13756 s//\1/
13757 q
13758 }
13759 /^X\(\/\).*/{
13760 s//\1/
13761 q
13762 }
13763 s/.*/./; q'`
13764 as_dir="$ac_dir"; as_fn_mkdir_p
13765 ac_builddir=.
13766
13767 case "$ac_dir" in
13768 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
13769 *)
13770 ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
13771 # A ".." for each directory in $ac_dir_suffix.
13772 ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
13773 case $ac_top_builddir_sub in
13774 "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
13775 *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
13776 esac ;;
13777 esac
13778 ac_abs_top_builddir=$ac_pwd
13779 ac_abs_builddir=$ac_pwd$ac_dir_suffix
13780 # for backward compatibility:
13781 ac_top_builddir=$ac_top_build_prefix
13782
13783 case $srcdir in
13784 .) # We are building in place.
13785 ac_srcdir=.
13786 ac_top_srcdir=$ac_top_builddir_sub
13787 ac_abs_top_srcdir=$ac_pwd ;;
13788 [\\/]* | ?:[\\/]* ) # Absolute name.
13789 ac_srcdir=$srcdir$ac_dir_suffix;
13790 ac_top_srcdir=$srcdir
13791 ac_abs_top_srcdir=$srcdir ;;
13792 *) # Relative name.
13793 ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
13794 ac_top_srcdir=$ac_top_build_prefix$srcdir
13795 ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
13796 esac
13797 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
13798
13799
13800 case $ac_mode in
13801 :F)
13802 #
13803 # CONFIG_FILE
13804 #
13805
13806 case $INSTALL in
13807 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
13808 *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
13809 esac
13810 ac_MKDIR_P=$MKDIR_P
13811 case $MKDIR_P in
13812 [\\/$]* | ?:[\\/]* ) ;;
13813 */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
13814 esac
13815 _ACEOF
13816
13817 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13818 # If the template does not know about datarootdir, expand it.
13819 # FIXME: This hack should be removed a few years after 2.60.
13820 ac_datarootdir_hack=; ac_datarootdir_seen=
13821 ac_sed_dataroot='
13822 /datarootdir/ {
13823 p
13824 q
13825 }
13826 /@datadir@/p
13827 /@docdir@/p
13828 /@infodir@/p
13829 /@localedir@/p
13830 /@mandir@/p'
13831 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
13832 *datarootdir*) ac_datarootdir_seen=yes;;
13833 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
13834 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
13835 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
13836 _ACEOF
13837 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13838 ac_datarootdir_hack='
13839 s&@datadir@&$datadir&g
13840 s&@docdir@&$docdir&g
13841 s&@infodir@&$infodir&g
13842 s&@localedir@&$localedir&g
13843 s&@mandir@&$mandir&g
13844 s&\\\${datarootdir}&$datarootdir&g' ;;
13845 esac
13846 _ACEOF
13847
13848 # Neutralize VPATH when `$srcdir' = `.'.
13849 # Shell code in configure.ac might set extrasub.
13850 # FIXME: do we really want to maintain this feature?
13851 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13852 ac_sed_extra="$ac_vpsub
13853 $extrasub
13854 _ACEOF
13855 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13856 :t
13857 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
13858 s|@configure_input@|$ac_sed_conf_input|;t t
13859 s&@top_builddir@&$ac_top_builddir_sub&;t t
13860 s&@top_build_prefix@&$ac_top_build_prefix&;t t
13861 s&@srcdir@&$ac_srcdir&;t t
13862 s&@abs_srcdir@&$ac_abs_srcdir&;t t
13863 s&@top_srcdir@&$ac_top_srcdir&;t t
13864 s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
13865 s&@builddir@&$ac_builddir&;t t
13866 s&@abs_builddir@&$ac_abs_builddir&;t t
13867 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
13868 s&@INSTALL@&$ac_INSTALL&;t t
13869 s&@MKDIR_P@&$ac_MKDIR_P&;t t
13870 $ac_datarootdir_hack
13871 "
13872 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
13873 >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
13874
13875 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
13876 { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
13877 { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
13878 "$ac_tmp/out"`; test -z "$ac_out"; } &&
13879 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
13880 which seems to be undefined. Please make sure it is defined" >&5
13881 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
13882 which seems to be undefined. Please make sure it is defined" >&2;}
13883
13884 rm -f "$ac_tmp/stdin"
13885 case $ac_file in
13886 -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
13887 *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
13888 esac \
13889 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
13890 ;;
13891 :H)
13892 #
13893 # CONFIG_HEADER
13894 #
13895 if test x"$ac_file" != x-; then
13896 {
13897 $as_echo "/* $configure_input */" \
13898 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
13899 } >"$ac_tmp/config.h" \
13900 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
13901 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
13902 { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
13903 $as_echo "$as_me: $ac_file is unchanged" >&6;}
13904 else
13905 rm -f "$ac_file"
13906 mv "$ac_tmp/config.h" "$ac_file" \
13907 || as_fn_error $? "could not create $ac_file" "$LINENO" 5
13908 fi
13909 else
13910 $as_echo "/* $configure_input */" \
13911 && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
13912 || as_fn_error $? "could not create -" "$LINENO" 5
13913 fi
13914 # Compute "$ac_file"'s index in $config_headers.
13915 _am_arg="$ac_file"
13916 _am_stamp_count=1
13917 for _am_header in $config_headers :; do
13918 case $_am_header in
13919 $_am_arg | $_am_arg:* )
13920 break ;;
13921 * )
13922 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
13923 esac
13924 done
13925 echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
13926 $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13927 X"$_am_arg" : 'X\(//\)[^/]' \| \
13928 X"$_am_arg" : 'X\(//\)$' \| \
13929 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
13930 $as_echo X"$_am_arg" |
13931 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13932 s//\1/
13933 q
13934 }
13935 /^X\(\/\/\)[^/].*/{
13936 s//\1/
13937 q
13938 }
13939 /^X\(\/\/\)$/{
13940 s//\1/
13941 q
13942 }
13943 /^X\(\/\).*/{
13944 s//\1/
13945 q
13946 }
13947 s/.*/./; q'`/stamp-h$_am_stamp_count
13948 ;;
13949
13950 :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
13951 $as_echo "$as_me: executing $ac_file commands" >&6;}
13952 ;;
13953 esac
13954
13955
13956 case $ac_file$ac_mode in
13957 "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
13958 # Older Autoconf quotes --file arguments for eval, but not when files
13959 # are listed without --file. Let's play safe and only enable the eval
13960 # if we detect the quoting.
13961 case $CONFIG_FILES in
13962 *\'*) eval set x "$CONFIG_FILES" ;;
13963 *) set x $CONFIG_FILES ;;
13964 esac
13965 shift
13966 for mf
13967 do
13968 # Strip MF so we end up with the name of the file.
13969 mf=`echo "$mf" | sed -e 's/:.*$//'`
13970 # Check whether this is an Automake generated Makefile or not.
13971 # We used to match only the files named 'Makefile.in', but
13972 # some people rename them; so instead we look at the file content.
13973 # Grep'ing the first line is not enough: some people post-process
13974 # each Makefile.in and add a new line on top of each file to say so.
13975 # Grep'ing the whole file is not good either: AIX grep has a line
13976 # limit of 2048, but all sed's we know have understand at least 4000.
13977 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
13978 dirpart=`$as_dirname -- "$mf" ||
13979 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13980 X"$mf" : 'X\(//\)[^/]' \| \
13981 X"$mf" : 'X\(//\)$' \| \
13982 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
13983 $as_echo X"$mf" |
13984 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13985 s//\1/
13986 q
13987 }
13988 /^X\(\/\/\)[^/].*/{
13989 s//\1/
13990 q
13991 }
13992 /^X\(\/\/\)$/{
13993 s//\1/
13994 q
13995 }
13996 /^X\(\/\).*/{
13997 s//\1/
13998 q
13999 }
14000 s/.*/./; q'`
14001 else
14002 continue
14003 fi
14004 # Extract the definition of DEPDIR, am__include, and am__quote
14005 # from the Makefile without running 'make'.
14006 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
14007 test -z "$DEPDIR" && continue
14008 am__include=`sed -n 's/^am__include = //p' < "$mf"`
14009 test -z "$am__include" && continue
14010 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
14011 # Find all dependency output files, they are included files with
14012 # $(DEPDIR) in their names. We invoke sed twice because it is the
14013 # simplest approach to changing $(DEPDIR) to its actual value in the
14014 # expansion.
14015 for file in `sed -n "
14016 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
14017 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
14018 # Make sure the directory exists.
14019 test -f "$dirpart/$file" && continue
14020 fdir=`$as_dirname -- "$file" ||
14021 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14022 X"$file" : 'X\(//\)[^/]' \| \
14023 X"$file" : 'X\(//\)$' \| \
14024 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
14025 $as_echo X"$file" |
14026 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
14027 s//\1/
14028 q
14029 }
14030 /^X\(\/\/\)[^/].*/{
14031 s//\1/
14032 q
14033 }
14034 /^X\(\/\/\)$/{
14035 s//\1/
14036 q
14037 }
14038 /^X\(\/\).*/{
14039 s//\1/
14040 q
14041 }
14042 s/.*/./; q'`
14043 as_dir=$dirpart/$fdir; as_fn_mkdir_p
14044 # echo "creating $dirpart/$file"
14045 echo '# dummy' > "$dirpart/$file"
14046 done
14047 done
14048 }
14049 ;;
14050 "libtool":C)
14051
14052 # See if we are running on zsh, and set the options that allow our
14053 # commands through without removal of \ escapes.
14054 if test -n "${ZSH_VERSION+set}"; then
14055 setopt NO_GLOB_SUBST
14056 fi
14057
14058 cfgfile=${ofile}T
14059 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
14060 $RM "$cfgfile"
14061
14062 cat <<_LT_EOF >> "$cfgfile"
14063 #! $SHELL
14064 # Generated automatically by $as_me ($PACKAGE) $VERSION
14065 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
14066 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
14067
14068 # Provide generalized library-building support services.
14069 # Written by Gordon Matzigkeit, 1996
14070
14071 # Copyright (C) 2014 Free Software Foundation, Inc.
14072 # This is free software; see the source for copying conditions. There is NO
14073 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14074
14075 # GNU Libtool is free software; you can redistribute it and/or modify
14076 # it under the terms of the GNU General Public License as published by
14077 # the Free Software Foundation; either version 2 of of the License, or
14078 # (at your option) any later version.
16214079 #
163 # setup
14080 # As a special exception to the GNU General Public License, if you
14081 # distribute this file as part of a program or library that is built
14082 # using GNU Libtool, you may include this file under the same
14083 # distribution terms that you use for the rest of that program.
16414084 #
165
166 # verify script dependencies
167 verify_deps getopt
168
169 # parse the command line options
170 opt_str="$@"
171 opt=$(getopt -n "$0" --options "h" --longoptions "help,prefix:,libdir:" -- "$@")
172 eval set -- "$opt"
173 while [[ $# -gt 0 ]]; do
174 case "$1" in
175 --prefix)
176 opt_prefix="$2"
177 shift 2
178 ;;
179 --libdir)
180 opt_libdir="$2"
181 shift 2
182 ;;
183 -h|--help)
184 msg_usage
185 exit 0
186 ;;
187 --)
188 shift
189 ;;
190 *)
191 msg_usage
192 exit 1
193 esac
194 done
195
14085 # GNU Libtool is distributed in the hope that it will be useful, but
14086 # WITHOUT ANY WARRANTY; without even the implied warranty of
14087 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14088 # GNU General Public License for more details.
19614089 #
197 # validate the command line options
198 #
199
200 if [[ -e "$opt_prefix" && ! -d "$opt_prefix" ]]; then
201 msg_error "install prefix ($opt_prefix) is not a directory"
202 exit 1
203 fi
204
205 if [[ -z $opt_libdir ]]; then
206 opt_libdir="$opt_prefix/lib"
207 fi
208 if [[ -e "$opt_libdir" && ! -d "$opt_libdir" ]]; then
209 msg_error "libdir ($opt_libdir) is not a directory"
210 exit 1
211 fi
212
213 if [[ "$opt_bindings_python" = "yes" ]]; then
214 if ! test_deps cython; then
215 msg_error "python bindings require the cython package"
216 exit 1
217 fi
218 cython_ver=$(cython -V 2>&1 | cut -d' ' -f 3)
219 if [[ $(echo $cython_ver | cut -d'.' -f 1) -lt 1 &&
220 $(echo $cython_ver | cut -d'.' -f 2) -lt 16 ]]; then
221 msg_error "python bindings require cython 0.16 or higher"
222 exit 1
223 fi
224 fi
225
226 #
227 # automatic configuration
228 #
229
230 # system seccomp includes
231 if [[ -r "/usr/include/linux/seccomp.h" ]]; then
232 opt_sysinc_seccomp="yes"
233 else
234 opt_sysinc_seccomp="no"
235 fi
236
237 # generate the version files
238 . ./version_info
239 VERSION_RELEASE="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}"
240 rm -f ./version_info.mk
241 echo "# generated by configure on $(date -R)" >> ./version_info.mk
242 echo "VERSION_MAJOR=$VERSION_MAJOR" >> ./version_info.mk
243 echo "VERSION_MINOR=$VERSION_MINOR" >> ./version_info.mk
244 echo "VERSION_MICRO=$VERSION_MICRO" >> ./version_info.mk
245 echo "VERSION_RELEASE=$VERSION_RELEASE" >> ./version_info.mk
246
247 # generate the pkg-config metadata
248 INSTALL_PREFIX="$opt_prefix"
249 INSTALL_LIBDIR="$opt_libdir"
250 rm -f ./libseccomp.pc
251 cat ./libseccomp.pc.in | \
252 tmpl_filter INSTALL_PREFIX | \
253 tmpl_filter INSTALL_LIBDIR | \
254 tmpl_filter VERSION_RELEASE \
255 >> ./libseccomp.pc
256
257 #
258 # finish
259 #
260
261 # reset the configuration files
262 cnf_reset
263 cnf_header
264
265 # output the configuration files
266 cnf_mk_entry "CONF_INSTALL_PREFIX" "$opt_prefix"
267 cnf_mk_entry "CONF_INSTALL_LIBDIR" "$opt_libdir"
268 cnf_entry "CONF_SYSINC_SECCOMP" "$opt_sysinc_seccomp"
269 cnf_entry "CONF_BINDINGS_PYTHON" "$opt_bindings_python"
270
271 # configuration footer
272 cnf_footer
273
274 # display a summary and exit
275 msg_summary
276 exit 0
14090 # You should have received a copy of the GNU General Public License
14091 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14092
14093
14094 # The names of the tagged configurations supported by this script.
14095 available_tags=''
14096
14097 # Configured defaults for sys_lib_dlsearch_path munging.
14098 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
14099
14100 # ### BEGIN LIBTOOL CONFIG
14101
14102 # Which release of libtool.m4 was used?
14103 macro_version=$macro_version
14104 macro_revision=$macro_revision
14105
14106 # Whether or not to build shared libraries.
14107 build_libtool_libs=$enable_shared
14108
14109 # What type of objects to build.
14110 pic_mode=$pic_mode
14111
14112 # Whether or not to build static libraries.
14113 build_old_libs=$enable_static
14114
14115 # Whether or not to optimize for fast installation.
14116 fast_install=$enable_fast_install
14117
14118 # Shared archive member basename,for filename based shared library versioning on AIX.
14119 shared_archive_member_spec=$shared_archive_member_spec
14120
14121 # Shell to use when invoking shell scripts.
14122 SHELL=$lt_SHELL
14123
14124 # An echo program that protects backslashes.
14125 ECHO=$lt_ECHO
14126
14127 # The PATH separator for the build system.
14128 PATH_SEPARATOR=$lt_PATH_SEPARATOR
14129
14130 # The host system.
14131 host_alias=$host_alias
14132 host=$host
14133 host_os=$host_os
14134
14135 # The build system.
14136 build_alias=$build_alias
14137 build=$build
14138 build_os=$build_os
14139
14140 # A sed program that does not truncate output.
14141 SED=$lt_SED
14142
14143 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
14144 Xsed="\$SED -e 1s/^X//"
14145
14146 # A grep program that handles long lines.
14147 GREP=$lt_GREP
14148
14149 # An ERE matcher.
14150 EGREP=$lt_EGREP
14151
14152 # A literal string matcher.
14153 FGREP=$lt_FGREP
14154
14155 # A BSD- or MS-compatible name lister.
14156 NM=$lt_NM
14157
14158 # Whether we need soft or hard links.
14159 LN_S=$lt_LN_S
14160
14161 # What is the maximum length of a command?
14162 max_cmd_len=$max_cmd_len
14163
14164 # Object file suffix (normally "o").
14165 objext=$ac_objext
14166
14167 # Executable file suffix (normally "").
14168 exeext=$exeext
14169
14170 # whether the shell understands "unset".
14171 lt_unset=$lt_unset
14172
14173 # turn spaces into newlines.
14174 SP2NL=$lt_lt_SP2NL
14175
14176 # turn newlines into spaces.
14177 NL2SP=$lt_lt_NL2SP
14178
14179 # convert \$build file names to \$host format.
14180 to_host_file_cmd=$lt_cv_to_host_file_cmd
14181
14182 # convert \$build files to toolchain format.
14183 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
14184
14185 # An object symbol dumper.
14186 OBJDUMP=$lt_OBJDUMP
14187
14188 # Method to check whether dependent libraries are shared objects.
14189 deplibs_check_method=$lt_deplibs_check_method
14190
14191 # Command to use when deplibs_check_method = "file_magic".
14192 file_magic_cmd=$lt_file_magic_cmd
14193
14194 # How to find potential files when deplibs_check_method = "file_magic".
14195 file_magic_glob=$lt_file_magic_glob
14196
14197 # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
14198 want_nocaseglob=$lt_want_nocaseglob
14199
14200 # DLL creation program.
14201 DLLTOOL=$lt_DLLTOOL
14202
14203 # Command to associate shared and link libraries.
14204 sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
14205
14206 # The archiver.
14207 AR=$lt_AR
14208
14209 # Flags to create an archive.
14210 AR_FLAGS=$lt_AR_FLAGS
14211
14212 # How to feed a file listing to the archiver.
14213 archiver_list_spec=$lt_archiver_list_spec
14214
14215 # A symbol stripping program.
14216 STRIP=$lt_STRIP
14217
14218 # Commands used to install an old-style archive.
14219 RANLIB=$lt_RANLIB
14220 old_postinstall_cmds=$lt_old_postinstall_cmds
14221 old_postuninstall_cmds=$lt_old_postuninstall_cmds
14222
14223 # Whether to use a lock for old archive extraction.
14224 lock_old_archive_extraction=$lock_old_archive_extraction
14225
14226 # A C compiler.
14227 LTCC=$lt_CC
14228
14229 # LTCC compiler flags.
14230 LTCFLAGS=$lt_CFLAGS
14231
14232 # Take the output of nm and produce a listing of raw symbols and C names.
14233 global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
14234
14235 # Transform the output of nm in a proper C declaration.
14236 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
14237
14238 # Transform the output of nm into a list of symbols to manually relocate.
14239 global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
14240
14241 # Transform the output of nm in a C name address pair.
14242 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
14243
14244 # Transform the output of nm in a C name address pair when lib prefix is needed.
14245 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
14246
14247 # The name lister interface.
14248 nm_interface=$lt_lt_cv_nm_interface
14249
14250 # Specify filename containing input files for \$NM.
14251 nm_file_list_spec=$lt_nm_file_list_spec
14252
14253 # The root where to search for dependent libraries,and where our libraries should be installed.
14254 lt_sysroot=$lt_sysroot
14255
14256 # Command to truncate a binary pipe.
14257 lt_truncate_bin=$lt_lt_cv_truncate_bin
14258
14259 # The name of the directory that contains temporary libtool files.
14260 objdir=$objdir
14261
14262 # Used to examine libraries when file_magic_cmd begins with "file".
14263 MAGIC_CMD=$MAGIC_CMD
14264
14265 # Must we lock files when doing compilation?
14266 need_locks=$lt_need_locks
14267
14268 # Manifest tool.
14269 MANIFEST_TOOL=$lt_MANIFEST_TOOL
14270
14271 # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
14272 DSYMUTIL=$lt_DSYMUTIL
14273
14274 # Tool to change global to local symbols on Mac OS X.
14275 NMEDIT=$lt_NMEDIT
14276
14277 # Tool to manipulate fat objects and archives on Mac OS X.
14278 LIPO=$lt_LIPO
14279
14280 # ldd/readelf like tool for Mach-O binaries on Mac OS X.
14281 OTOOL=$lt_OTOOL
14282
14283 # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
14284 OTOOL64=$lt_OTOOL64
14285
14286 # Old archive suffix (normally "a").
14287 libext=$libext
14288
14289 # Shared library suffix (normally ".so").
14290 shrext_cmds=$lt_shrext_cmds
14291
14292 # The commands to extract the exported symbol list from a shared archive.
14293 extract_expsyms_cmds=$lt_extract_expsyms_cmds
14294
14295 # Variables whose values should be saved in libtool wrapper scripts and
14296 # restored at link time.
14297 variables_saved_for_relink=$lt_variables_saved_for_relink
14298
14299 # Do we need the "lib" prefix for modules?
14300 need_lib_prefix=$need_lib_prefix
14301
14302 # Do we need a version for libraries?
14303 need_version=$need_version
14304
14305 # Library versioning type.
14306 version_type=$version_type
14307
14308 # Shared library runtime path variable.
14309 runpath_var=$runpath_var
14310
14311 # Shared library path variable.
14312 shlibpath_var=$shlibpath_var
14313
14314 # Is shlibpath searched before the hard-coded library search path?
14315 shlibpath_overrides_runpath=$shlibpath_overrides_runpath
14316
14317 # Format of library name prefix.
14318 libname_spec=$lt_libname_spec
14319
14320 # List of archive names. First name is the real one, the rest are links.
14321 # The last name is the one that the linker finds with -lNAME
14322 library_names_spec=$lt_library_names_spec
14323
14324 # The coded name of the library, if different from the real name.
14325 soname_spec=$lt_soname_spec
14326
14327 # Permission mode override for installation of shared libraries.
14328 install_override_mode=$lt_install_override_mode
14329
14330 # Command to use after installation of a shared archive.
14331 postinstall_cmds=$lt_postinstall_cmds
14332
14333 # Command to use after uninstallation of a shared archive.
14334 postuninstall_cmds=$lt_postuninstall_cmds
14335
14336 # Commands used to finish a libtool library installation in a directory.
14337 finish_cmds=$lt_finish_cmds
14338
14339 # As "finish_cmds", except a single script fragment to be evaled but
14340 # not shown.
14341 finish_eval=$lt_finish_eval
14342
14343 # Whether we should hardcode library paths into libraries.
14344 hardcode_into_libs=$hardcode_into_libs
14345
14346 # Compile-time system search path for libraries.
14347 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
14348
14349 # Detected run-time system search path for libraries.
14350 sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
14351
14352 # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
14353 configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
14354
14355 # Whether dlopen is supported.
14356 dlopen_support=$enable_dlopen
14357
14358 # Whether dlopen of programs is supported.
14359 dlopen_self=$enable_dlopen_self
14360
14361 # Whether dlopen of statically linked programs is supported.
14362 dlopen_self_static=$enable_dlopen_self_static
14363
14364 # Commands to strip libraries.
14365 old_striplib=$lt_old_striplib
14366 striplib=$lt_striplib
14367
14368
14369 # The linker used to build libraries.
14370 LD=$lt_LD
14371
14372 # How to create reloadable object files.
14373 reload_flag=$lt_reload_flag
14374 reload_cmds=$lt_reload_cmds
14375
14376 # Commands used to build an old-style archive.
14377 old_archive_cmds=$lt_old_archive_cmds
14378
14379 # A language specific compiler.
14380 CC=$lt_compiler
14381
14382 # Is the compiler the GNU compiler?
14383 with_gcc=$GCC
14384
14385 # Compiler flag to turn off builtin functions.
14386 no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
14387
14388 # Additional compiler flags for building library objects.
14389 pic_flag=$lt_lt_prog_compiler_pic
14390
14391 # How to pass a linker flag through the compiler.
14392 wl=$lt_lt_prog_compiler_wl
14393
14394 # Compiler flag to prevent dynamic linking.
14395 link_static_flag=$lt_lt_prog_compiler_static
14396
14397 # Does compiler simultaneously support -c and -o options?
14398 compiler_c_o=$lt_lt_cv_prog_compiler_c_o
14399
14400 # Whether or not to add -lc for building shared libraries.
14401 build_libtool_need_lc=$archive_cmds_need_lc
14402
14403 # Whether or not to disallow shared libs when runtime libs are static.
14404 allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
14405
14406 # Compiler flag to allow reflexive dlopens.
14407 export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
14408
14409 # Compiler flag to generate shared objects directly from archives.
14410 whole_archive_flag_spec=$lt_whole_archive_flag_spec
14411
14412 # Whether the compiler copes with passing no objects directly.
14413 compiler_needs_object=$lt_compiler_needs_object
14414
14415 # Create an old-style archive from a shared archive.
14416 old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
14417
14418 # Create a temporary old-style archive to link instead of a shared archive.
14419 old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
14420
14421 # Commands used to build a shared archive.
14422 archive_cmds=$lt_archive_cmds
14423 archive_expsym_cmds=$lt_archive_expsym_cmds
14424
14425 # Commands used to build a loadable module if different from building
14426 # a shared archive.
14427 module_cmds=$lt_module_cmds
14428 module_expsym_cmds=$lt_module_expsym_cmds
14429
14430 # Whether we are building with GNU ld or not.
14431 with_gnu_ld=$lt_with_gnu_ld
14432
14433 # Flag that allows shared libraries with undefined symbols to be built.
14434 allow_undefined_flag=$lt_allow_undefined_flag
14435
14436 # Flag that enforces no undefined symbols.
14437 no_undefined_flag=$lt_no_undefined_flag
14438
14439 # Flag to hardcode \$libdir into a binary during linking.
14440 # This must work even if \$libdir does not exist
14441 hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
14442
14443 # Whether we need a single "-rpath" flag with a separated argument.
14444 hardcode_libdir_separator=$lt_hardcode_libdir_separator
14445
14446 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
14447 # DIR into the resulting binary.
14448 hardcode_direct=$hardcode_direct
14449
14450 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
14451 # DIR into the resulting binary and the resulting library dependency is
14452 # "absolute",i.e impossible to change by setting \$shlibpath_var if the
14453 # library is relocated.
14454 hardcode_direct_absolute=$hardcode_direct_absolute
14455
14456 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
14457 # into the resulting binary.
14458 hardcode_minus_L=$hardcode_minus_L
14459
14460 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
14461 # into the resulting binary.
14462 hardcode_shlibpath_var=$hardcode_shlibpath_var
14463
14464 # Set to "yes" if building a shared library automatically hardcodes DIR
14465 # into the library and all subsequent libraries and executables linked
14466 # against it.
14467 hardcode_automatic=$hardcode_automatic
14468
14469 # Set to yes if linker adds runtime paths of dependent libraries
14470 # to runtime path list.
14471 inherit_rpath=$inherit_rpath
14472
14473 # Whether libtool must link a program against all its dependency libraries.
14474 link_all_deplibs=$link_all_deplibs
14475
14476 # Set to "yes" if exported symbols are required.
14477 always_export_symbols=$always_export_symbols
14478
14479 # The commands to list exported symbols.
14480 export_symbols_cmds=$lt_export_symbols_cmds
14481
14482 # Symbols that should not be listed in the preloaded symbols.
14483 exclude_expsyms=$lt_exclude_expsyms
14484
14485 # Symbols that must always be exported.
14486 include_expsyms=$lt_include_expsyms
14487
14488 # Commands necessary for linking programs (against libraries) with templates.
14489 prelink_cmds=$lt_prelink_cmds
14490
14491 # Commands necessary for finishing linking programs.
14492 postlink_cmds=$lt_postlink_cmds
14493
14494 # Specify filename containing input files.
14495 file_list_spec=$lt_file_list_spec
14496
14497 # How to hardcode a shared library path into an executable.
14498 hardcode_action=$hardcode_action
14499
14500 # ### END LIBTOOL CONFIG
14501
14502 _LT_EOF
14503
14504 cat <<'_LT_EOF' >> "$cfgfile"
14505
14506 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
14507
14508 # func_munge_path_list VARIABLE PATH
14509 # -----------------------------------
14510 # VARIABLE is name of variable containing _space_ separated list of
14511 # directories to be munged by the contents of PATH, which is string
14512 # having a format:
14513 # "DIR[:DIR]:"
14514 # string "DIR[ DIR]" will be prepended to VARIABLE
14515 # ":DIR[:DIR]"
14516 # string "DIR[ DIR]" will be appended to VARIABLE
14517 # "DIRP[:DIRP]::[DIRA:]DIRA"
14518 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
14519 # "DIRA[ DIRA]" will be appended to VARIABLE
14520 # "DIR[:DIR]"
14521 # VARIABLE will be replaced by "DIR[ DIR]"
14522 func_munge_path_list ()
14523 {
14524 case x$2 in
14525 x)
14526 ;;
14527 *:)
14528 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
14529 ;;
14530 x:*)
14531 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
14532 ;;
14533 *::*)
14534 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
14535 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
14536 ;;
14537 *)
14538 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
14539 ;;
14540 esac
14541 }
14542
14543
14544 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
14545 func_cc_basename ()
14546 {
14547 for cc_temp in $*""; do
14548 case $cc_temp in
14549 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
14550 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
14551 \-*) ;;
14552 *) break;;
14553 esac
14554 done
14555 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14556 }
14557
14558
14559 # ### END FUNCTIONS SHARED WITH CONFIGURE
14560
14561 _LT_EOF
14562
14563 case $host_os in
14564 aix3*)
14565 cat <<\_LT_EOF >> "$cfgfile"
14566 # AIX sometimes has problems with the GCC collect2 program. For some
14567 # reason, if we set the COLLECT_NAMES environment variable, the problems
14568 # vanish in a puff of smoke.
14569 if test set != "${COLLECT_NAMES+set}"; then
14570 COLLECT_NAMES=
14571 export COLLECT_NAMES
14572 fi
14573 _LT_EOF
14574 ;;
14575 esac
14576
14577
14578 ltmain=$ac_aux_dir/ltmain.sh
14579
14580
14581 # We use sed instead of cat because bash on DJGPP gets confused if
14582 # if finds mixed CR/LF and LF-only lines. Since sed operates in
14583 # text mode, it properly converts lines to CR/LF. This bash problem
14584 # is reportedly fixed, but why not run on old versions too?
14585 sed '$q' "$ltmain" >> "$cfgfile" \
14586 || (rm -f "$cfgfile"; exit 1)
14587
14588 mv -f "$cfgfile" "$ofile" ||
14589 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
14590 chmod +x "$ofile"
14591
14592 ;;
14593
14594 esac
14595 done # for ac_tag
14596
14597
14598 as_fn_exit 0
14599 _ACEOF
14600 ac_clean_files=$ac_clean_files_save
14601
14602 test $ac_write_fail = 0 ||
14603 as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
14604
14605
14606 # configure is writing to config.log, and then calls config.status.
14607 # config.status does its own redirection, appending to config.log.
14608 # Unfortunately, on DOS this fails, as config.log is still kept open
14609 # by configure, so config.status won't be able to write to it; its
14610 # output is simply discarded. So we exec the FD to /dev/null,
14611 # effectively closing config.log, so it can be properly (re)opened and
14612 # appended to by config.status. When coming back to configure, we
14613 # need to make the FD available again.
14614 if test "$no_create" != yes; then
14615 ac_cs_success=:
14616 ac_config_status_args=
14617 test "$silent" = yes &&
14618 ac_config_status_args="$ac_config_status_args --quiet"
14619 exec 5>/dev/null
14620 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
14621 exec 5>>config.log
14622 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
14623 # would make configure fail if this is the last instruction.
14624 $ac_cs_success || as_fn_exit 1
14625 fi
14626 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
14627 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
14628 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
14629 fi
14630
0 dnl ####
1 dnl # Seccomp Library
2 dnl #
3
4 dnl #
5 dnl # This library is free software; you can redistribute it and/or modify it
6 dnl # under the terms of version 2.1 of the GNU Lesser General Public License
7 dnl # as published by the Free Software Foundation.
8 dnl #
9 dnl # This library is distributed in the hope that it will be useful, but
10 dnl # WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
12 dnl # General Public License for more details.
13 dnl #
14 dnl # You should have received a copy of the GNU Lesser General Public License
15 dnl # along with this library; if not, see <http://www.gnu.org/licenses>.
16 dnl #
17
18 dnl ####
19 dnl libseccomp defines
20 dnl ####
21 AC_INIT([libseccomp], [2.2.3])
22
23 dnl ####
24 dnl autoconf configuration
25 dnl ####
26 AC_CONFIG_AUX_DIR([build-aux])
27 AC_CONFIG_HEADERS([configure.h])
28 AC_CONFIG_MACRO_DIR([m4])
29
30 dnl ####
31 dnl automake configuration
32 dnl ####
33 dnl NOTE: Automake < 1.12 didn't have serial-tests and gives an error if it
34 dnl sees this, but for automake >= 1.13 serial-tests is required so we have to
35 dnl include it. Solution is to test for the version of automake (by running
36 dnl an external command) and provide it if necessary. Note we have to do this
37 dnl entirely using m4 macros since automake queries this macro by running
38 dnl 'autoconf --trace ...'.
39 m4_define([serial_tests], [
40 m4_esyscmd([automake --version |
41 head -1 |
42 awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'
43 ])
44 ])
45 dnl # NOTE: do not [quote] this parameter
46 AM_INIT_AUTOMAKE(-Wall foreign subdir-objects tar-pax serial_tests)
47
48 dnl ####
49 dnl build tools
50 dnl ####
51 AC_PROG_CC
52 AM_PROG_CC_C_O
53 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
54
55 dnl ####
56 dnl libtool configuration
57 dnl ####
58 LT_INIT([shared pic-only])
59
60 dnl ####
61 dnl enable silent builds by default
62 dnl ####
63 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
64
65 dnl ####
66 dnl build flags
67 dnl ####
68 AM_CPPFLAGS="-I\${top_srcdir}/include"
69 AM_CFLAGS="-Wall"
70 AM_LDFLAGS="-Wl,-z -Wl,relro"
71 AC_SUBST([AM_CPPFLAGS])
72 AC_SUBST([AM_CFLAGS])
73 AC_SUBST([AM_LDFLAGS])
74
75 dnl ####
76 dnl check build system seccomp awareness
77 dnl ####
78 AC_CHECK_HEADERS_ONCE([linux/seccomp.h])
79
80 dnl ####
81 dnl version information
82 dnl ####
83 VERSION_MAJOR=$(echo ${VERSION} | cut -d'.' -f 1)
84 VERSION_MINOR=$(echo ${VERSION} | cut -d'.' -f 2)
85 VERSION_MICRO=$(echo ${VERSION} | cut -d'.' -f 3)
86 AC_SUBST([VERSION_MAJOR])
87 AC_SUBST([VERSION_MINOR])
88 AC_SUBST([VERSION_MICRO])
89
90 dnl ####
91 dnl function checks
92 dnl ####
93 dnl # NOTE: keep this disabled until we can test on a released 3.17 kernel
94 dnl AC_CHECK_FUNCS(seccomp)
95
96 dnl ####
97 dnl cython checks
98 dnl ####
99 AC_CHECK_PROG(have_cython, cython, "yes", "no")
100 AS_IF([test "$have_cython" = yes], [
101 AS_ECHO("checking cython version... $(cython -V 2>&1 | cut -d' ' -f 3)")
102 CYTHON_VER_MAJ=$(cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 1);
103 CYTHON_VER_MIN=$(cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 2);
104 ],[
105 CYTHON_VER_MAJ=0
106 CYTHON_VER_MIN=0
107 ])
108
109 dnl ####
110 dnl python binding checks
111 dnl ####
112 AC_ARG_ENABLE([python],
113 [AS_HELP_STRING([--enable-python],
114 [build the python bindings, requires cython])])
115 AS_IF([test "$enable_python" = yes], [
116 # cython version check
117 AS_IF([test "$CYTHON_VER_MAJ" -eq 0 -a "$CYTHON_VER_MIN" -lt 16], [
118 AC_MSG_ERROR([python bindings require cython 0.16 or higher])
119 ])
120 ])
121 AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes])
122 AC_DEFINE_UNQUOTED([ENABLE_PYTHON],
123 [$(test "$enable_python" == yes && echo 1 || echo 0)],
124 [Python bindings build flag.])
125
126 dnl ####
127 dnl coverity checks
128 dnl ####
129 AC_CHECK_PROG(have_coverity, cov-build, "yes", "no")
130 AM_CONDITIONAL(COVERITY, test "$have_coverity" = yes)
131
132 dnl ####
133 dnl version dependent files
134 dnl ####
135 AC_CONFIG_FILES([
136 libseccomp.pc
137 include/seccomp.h
138 ])
139
140 dnl ####
141 dnl makefiles
142 dnl ####
143 AC_CONFIG_FILES([
144 Makefile
145 include/Makefile
146 src/Makefile
147 src/python/Makefile
148 tools/Makefile
149 tests/Makefile
150 doc/Makefile
151 ])
152
153 dnl ####
154 dnl done
155 dnl ####
156 AC_OUTPUT
0 /* configure.h.in. Generated from configure.ac by autoheader. */
1
2 /* Python bindings build flag. */
3 #undef ENABLE_PYTHON
4
5 /* Define to 1 if you have the <dlfcn.h> header file. */
6 #undef HAVE_DLFCN_H
7
8 /* Define to 1 if you have the <inttypes.h> header file. */
9 #undef HAVE_INTTYPES_H
10
11 /* Define to 1 if you have the <linux/seccomp.h> header file. */
12 #undef HAVE_LINUX_SECCOMP_H
13
14 /* Define to 1 if you have the <memory.h> header file. */
15 #undef HAVE_MEMORY_H
16
17 /* Define to 1 if you have the <stdint.h> header file. */
18 #undef HAVE_STDINT_H
19
20 /* Define to 1 if you have the <stdlib.h> header file. */
21 #undef HAVE_STDLIB_H
22
23 /* Define to 1 if you have the <strings.h> header file. */
24 #undef HAVE_STRINGS_H
25
26 /* Define to 1 if you have the <string.h> header file. */
27 #undef HAVE_STRING_H
28
29 /* Define to 1 if you have the <sys/stat.h> header file. */
30 #undef HAVE_SYS_STAT_H
31
32 /* Define to 1 if you have the <sys/types.h> header file. */
33 #undef HAVE_SYS_TYPES_H
34
35 /* Define to 1 if you have the <unistd.h> header file. */
36 #undef HAVE_UNISTD_H
37
38 /* Define to the sub-directory where libtool stores uninstalled libraries. */
39 #undef LT_OBJDIR
40
41 /* Name of package */
42 #undef PACKAGE
43
44 /* Define to the address where bug reports for this package should be sent. */
45 #undef PACKAGE_BUGREPORT
46
47 /* Define to the full name of this package. */
48 #undef PACKAGE_NAME
49
50 /* Define to the full name and version of this package. */
51 #undef PACKAGE_STRING
52
53 /* Define to the one symbol short name of this package. */
54 #undef PACKAGE_TARNAME
55
56 /* Define to the home page for this package. */
57 #undef PACKAGE_URL
58
59 /* Define to the version of this package. */
60 #undef PACKAGE_VERSION
61
62 /* Define to 1 if you have the ANSI C header files. */
63 #undef STDC_HEADERS
64
65 /* Version number of package */
66 #undef VERSION
0 libseccomp (2.2.3-3) unstable; urgency=medium
1
2 [ Martin Pitt ]
3 * debian/patches/add-x86-32bit-socket-calls.patch: add the newly
4 connected direct socket calls. (Closes: #809556)
5 * debian/add-membarrier.patch: add membarrier syscall.
6 * Backport patches for ppc/ppc64 and s390x. (Closes: #800818)
7
8 -- Kees Cook <kees@debian.org> Tue, 01 Sep 2015 15:37:31 -0700
9
10 libseccomp (2.2.3-2) unstable; urgency=medium
11
12 * debian/control: enable mips64, mips64el, and x32 architectures,
13 thanks to Helmut Grohne (Closes: 797383).
14
15 -- Kees Cook <kees@debian.org> Tue, 01 Sep 2015 15:37:31 -0700
16
17 libseccomp (2.2.3-1) unstable; urgency=medium
18
19 * New upstream release (Closes: 793032).
20 * debian/control: update Homepage (Closes: 793033).
21
22 -- Kees Cook <kees@debian.org> Mon, 03 Aug 2015 15:06:08 -0700
23
24 libseccomp (2.2.1-2) unstable; urgency=medium
25
26 * debian/{rules,*.install}: move to /lib, thanks to Michael Biebl
27 (Closes: 788923).
28
29 -- Kees Cook <kees@debian.org> Tue, 16 Jun 2015 12:45:08 -0700
30
31 libseccomp (2.2.1-1) unstable; urgency=medium
32
33 * New upstream release (Closes: 785428).
34 - debian/patches dropped: incorporated upstream.
35 * debian/libseccomp2.symbols: include only documented symbols.
36 * debian/libseccomp-dev.install: include static library (Closes: 698508).
37 * debian/control:
38 - add newly supported arm64, mips, and mipsel.
39 - bump standards version, no changes needed.
40
41 -- Kees Cook <kees@debian.org> Sat, 16 May 2015 08:15:26 -0700
42
043 libseccomp (2.1.1-1) unstable; urgency=low
144
245 * New upstream release (Closes: 733293).
11 Section: libs
22 Priority: optional
33 Maintainer: Kees Cook <kees@debian.org>
4 Build-Depends: debhelper (>= 9), linux-libc-dev
5 Standards-Version: 3.9.5
6 Homepage: https://sourceforge.net/projects/libseccomp/
4 Build-Depends: debhelper (>= 9), dh-autoreconf, linux-libc-dev
5 Standards-Version: 3.9.6
6 Homepage: https://github.com/seccomp/libseccomp
77
88 Package: libseccomp-dev
99 Section: libdevel
10 Architecture: i386 amd64 armhf armel
10 Architecture: linux-any
1111 Multi-Arch: same
1212 Pre-Depends: ${misc:Pre-Depends}
1313 Depends: libseccomp2 (= ${binary:Version}), ${misc:Depends}
2020 This package contains the development files.
2121
2222 Package: libseccomp2
23 Architecture: i386 amd64 armhf armel
23 Architecture: linux-any
2424 Multi-Arch: same
2525 Pre-Depends: ${misc:Pre-Depends}
2626 Depends: ${shlibs:Depends}, ${misc:Depends}
3131
3232 Package: seccomp
3333 Section: utils
34 Architecture: i386 amd64 armhf armel
34 Architecture: linux-any
3535 Depends: ${shlibs:Depends}, ${misc:Depends}
3636 Suggests: libseccomp-dev
3737 Description: helper tools for high level interface to Linux seccomp filter
00 usr/include/*
11 usr/lib/*/lib*.so
2 usr/lib/*/lib*.a
23 usr/lib/*/pkgconfig/*
+0
-1
debian/libseccomp2.install less more
0 usr/lib/*/lib*.so.*
00 libseccomp.so.2 libseccomp2 #MINVER#
1 arch_arg_count_max@Base 0.0.0~20120605
2 arch_arg_offset_hi@Base 0.0.0~20120605
3 arch_arg_offset_lo@Base 0.0.0~20120605
4 arch_def_native@Base 0.0.0~20120605
5 arch_filter_rewrite@Base 0.0.0~20120605
6 arch_syscall_rewrite@Base 0.0.0~20120605
7 db_action_valid@Base 0.0.0~20120605
8 db_init@Base 0.0.0~20120605
9 db_release@Base 0.0.0~20120605
10 db_reset@Base 1.0.0
11 db_rule_add@Base 0.0.0~20120605
12 db_syscall_priority@Base 0.0.0~20120605
13 gen_bpf_generate@Base 0.0.0~20120605
14 gen_bpf_release@Base 0.0.0~20120605
15 gen_pfc_generate@Base 0.0.0~20120605
16 jhash@Base 0.0.0~20120605
171 seccomp_attr_get@Base 0.0.0~20120605
182 seccomp_attr_set@Base 0.0.0~20120605
193 seccomp_export_bpf@Base 0.0.0~20120605
2610 seccomp_rule_add_exact@Base 0.0.0~20120605
2711 seccomp_syscall_priority@Base 0.0.0~20120605
2812 seccomp_syscall_resolve_name@Base 1.0.1
29 x86_64_syscall_table@Base 1.0.1
3013 seccomp_merge@Base 1.0.1
3114 seccomp_arch_add@Base 1.0.1
3215 seccomp_arch_exist@Base 1.0.1
3316 seccomp_arch_remove@Base 1.0.1
34 arch_def_lookup@Base 1.0.1
35 arch_def_x86_64@Base 1.0.1
36 arch_syscall_resolve_name@Base 1.0.1
37 arch_syscall_resolve_num@Base 1.0.1
38 arch_syscall_translate@Base 1.0.1
39 arch_valid@Base 1.0.1
40 db_col_arch_exist@Base 1.0.1
41 db_col_attr_get@Base 1.0.1
42 db_col_attr_set@Base 1.0.1
43 db_col_db_add@Base 1.0.1
44 db_col_db_remove@Base 1.0.1
45 db_col_init@Base 1.0.1
46 db_col_merge@Base 1.0.1
47 db_col_release@Base 1.0.1
48 db_col_reset@Base 1.0.1
49 db_col_valid@Base 1.0.1
50 arch_def_arm@Base 2.1.0
51 arch_def_x32@Base 2.1.0
52 arch_def_x86@Base 2.1.0
53 arm_syscall_resolve_name@Base 2.1.0
54 arm_syscall_resolve_num@Base 2.1.0
55 arm_syscall_table@Base 2.1.0
5617 seccomp_arch_native@Base 2.1.0
5718 seccomp_rule_add_array@Base 2.1.0
5819 seccomp_rule_add_exact_array@Base 2.1.0
5920 seccomp_syscall_resolve_name_arch@Base 2.1.0
6021 seccomp_syscall_resolve_num_arch@Base 2.1.0
61 x32_syscall_resolve_name@Base 2.1.0
62 x32_syscall_resolve_num@Base 2.1.0
63 x86_64_syscall_resolve_name@Base 2.1.0
64 x86_64_syscall_resolve_num@Base 2.1.0
65 x86_filter_rewrite@Base 2.1.0
66 x86_syscall_resolve_name@Base 2.1.0
67 x86_syscall_resolve_num@Base 2.1.0
68 x86_syscall_rewrite@Base 2.1.0
22 seccomp_arch_resolve_name@Base 2.2.1
23 seccomp_syscall_resolve_name_rewrite@Base 2.2.1
0 Author: Jamie Strandboge <jamie@canonical.com>
1 Description: add membarrier syscall. This can be dropped once libseccomp is
2 synced with 4.3 or higher
3 Forwarded: no
4
5 Index: libseccomp-2.2.3/src/arch-aarch64-syscalls.c
6 ===================================================================
7 --- libseccomp-2.2.3.orig/src/arch-aarch64-syscalls.c
8 +++ libseccomp-2.2.3/src/arch-aarch64-syscalls.c
9 @@ -195,6 +195,7 @@ const struct arch_syscall_def aarch64_sy
10 { "lstat", __PNR_lstat },
11 { "lstat64", __PNR_lstat64 },
12 { "madvise", 233 },
13 + { "mbarrier", 283 },
14 { "mbind", 235 },
15 { "memfd_create", 279 },
16 { "migrate_pages", 238 },
17 Index: libseccomp-2.2.3/src/arch-arm-syscalls.c
18 ===================================================================
19 --- libseccomp-2.2.3.orig/src/arch-arm-syscalls.c
20 +++ libseccomp-2.2.3/src/arch-arm-syscalls.c
21 @@ -207,6 +207,7 @@ const struct arch_syscall_def arm_syscal
22 { "lstat", (__NR_SYSCALL_BASE + 107) },
23 { "lstat64", (__NR_SYSCALL_BASE + 196) },
24 { "madvise", (__NR_SYSCALL_BASE + 220) },
25 + { "mbarrier", (__NR_SYSCALL_BASE + 389) },
26 { "mbind", (__NR_SYSCALL_BASE + 319) },
27 { "memfd_create", (__NR_SYSCALL_BASE + 385) },
28 { "migrate_pages", __PNR_migrate_pages },
29 Index: libseccomp-2.2.3/src/arch-mips64n32-syscalls.c
30 ===================================================================
31 --- libseccomp-2.2.3.orig/src/arch-mips64n32-syscalls.c
32 +++ libseccomp-2.2.3/src/arch-mips64n32-syscalls.c
33 @@ -199,6 +199,7 @@ const struct arch_syscall_def mips64n32_
34 { "lstat", (__NR_SYSCALL_BASE + 6) },
35 { "lstat64", __PNR_lstat64 },
36 { "madvise", (__NR_SYSCALL_BASE + 27) },
37 + { "mbarrier", __PNR_mbarrier },
38 { "mbind", (__NR_SYSCALL_BASE + 231) },
39 { "memfd_create", (__NR_SYSCALL_BASE + 318) },
40 { "migrate_pages", (__NR_SYSCALL_BASE + 250) },
41 Index: libseccomp-2.2.3/src/arch-mips64-syscalls.c
42 ===================================================================
43 --- libseccomp-2.2.3.orig/src/arch-mips64-syscalls.c
44 +++ libseccomp-2.2.3/src/arch-mips64-syscalls.c
45 @@ -199,6 +199,7 @@ const struct arch_syscall_def mips64_sys
46 { "lstat", (__NR_SYSCALL_BASE + 6) },
47 { "lstat64", __PNR_lstat64 },
48 { "madvise", (__NR_SYSCALL_BASE + 27) },
49 + { "mbarrier", __PNR_mbarrier },
50 { "mbind", (__NR_SYSCALL_BASE + 227) },
51 { "memfd_create", (__NR_SYSCALL_BASE + 314) },
52 { "migrate_pages", (__NR_SYSCALL_BASE + 246) },
53 Index: libseccomp-2.2.3/src/arch-mips-syscalls.c
54 ===================================================================
55 --- libseccomp-2.2.3.orig/src/arch-mips-syscalls.c
56 +++ libseccomp-2.2.3/src/arch-mips-syscalls.c
57 @@ -199,6 +199,7 @@ const struct arch_syscall_def mips_sysca
58 { "lstat", (__NR_SYSCALL_BASE + 107) },
59 { "lstat64", (__NR_SYSCALL_BASE + 214) },
60 { "madvise", (__NR_SYSCALL_BASE + 218) },
61 + { "mbarrier", __PNR_mbarrier },
62 { "mbind", (__NR_SYSCALL_BASE + 268) },
63 { "memfd_create", (__NR_SYSCALL_BASE + 354) },
64 { "migrate_pages", (__NR_SYSCALL_BASE + 287) },
65 Index: libseccomp-2.2.3/src/arch-ppc64-syscalls.c
66 ===================================================================
67 --- libseccomp-2.2.3.orig/src/arch-ppc64-syscalls.c
68 +++ libseccomp-2.2.3/src/arch-ppc64-syscalls.c
69 @@ -196,6 +196,7 @@ const struct arch_syscall_def ppc64_sysc
70 { "lstat", 107 },
71 { "lstat64", __PNR_lstat64 },
72 { "madvise", 205 },
73 + { "mbarrier", 365 },
74 { "mbind", 259 },
75 { "memfd_create", 360 },
76 { "migrate_pages", 258 },
77 Index: libseccomp-2.2.3/src/arch-ppc-syscalls.c
78 ===================================================================
79 --- libseccomp-2.2.3.orig/src/arch-ppc-syscalls.c
80 +++ libseccomp-2.2.3/src/arch-ppc-syscalls.c
81 @@ -196,6 +196,7 @@ const struct arch_syscall_def ppc_syscal
82 { "lstat", 107 },
83 { "lstat64", 196 },
84 { "madvise", 205 },
85 + { "mbarrier", 365 },
86 { "mbind", 259 },
87 { "memfd_create", 360 },
88 { "migrate_pages", 258 },
89 Index: libseccomp-2.2.3/src/arch-s390-syscalls.c
90 ===================================================================
91 --- libseccomp-2.2.3.orig/src/arch-s390-syscalls.c
92 +++ libseccomp-2.2.3/src/arch-s390-syscalls.c
93 @@ -179,6 +179,7 @@ const struct arch_syscall_def s390_sysca
94 { "lstat", 107 },
95 { "lstat64", 196 },
96 { "madvise", 219 },
97 + { "mbarrier", __PNR_mbarrier },
98 { "mbind", __PNR_mbind },
99 { "memfd_create", 350 },
100 { "migrate_pages", __PNR_migrate_pages},
101 Index: libseccomp-2.2.3/src/arch-s390x-syscalls.c
102 ===================================================================
103 --- libseccomp-2.2.3.orig/src/arch-s390x-syscalls.c
104 +++ libseccomp-2.2.3/src/arch-s390x-syscalls.c
105 @@ -179,6 +179,7 @@ const struct arch_syscall_def s390x_sysc
106 { "lstat", 107 },
107 { "lstat64", __PNR_lstat64 },
108 { "madvise", 219 },
109 + { "mbarrier", 356 },
110 { "mbind", __PNR_mbind },
111 { "memfd_create", 350 },
112 { "migrate_pages", __PNR_migrate_pages },
113 Index: libseccomp-2.2.3/src/arch-x32-syscalls.c
114 ===================================================================
115 --- libseccomp-2.2.3.orig/src/arch-x32-syscalls.c
116 +++ libseccomp-2.2.3/src/arch-x32-syscalls.c
117 @@ -195,6 +195,7 @@ const struct arch_syscall_def x32_syscal
118 { "lstat", (X32_SYSCALL_BIT + 6) },
119 { "lstat64", __PNR_lstat64 },
120 { "madvise", (X32_SYSCALL_BIT + 28) },
121 + { "mbarrier", (X32_SYSCALL_BIT + 324) },
122 { "mbind", (X32_SYSCALL_BIT + 237) },
123 { "memfd_create", (X32_SYSCALL_BIT + 319) },
124 { "migrate_pages", (X32_SYSCALL_BIT + 256) },
125 Index: libseccomp-2.2.3/src/arch-x86_64-syscalls.c
126 ===================================================================
127 --- libseccomp-2.2.3.orig/src/arch-x86_64-syscalls.c
128 +++ libseccomp-2.2.3/src/arch-x86_64-syscalls.c
129 @@ -195,6 +195,7 @@ const struct arch_syscall_def x86_64_sys
130 { "lstat", 6 },
131 { "lstat64", __PNR_lstat64 },
132 { "madvise", 28 },
133 + { "mbarrier", 324 },
134 { "mbind", 237 },
135 { "memfd_create", 319 },
136 { "migrate_pages", 256 },
137 Index: libseccomp-2.2.3/src/arch-x86-syscalls.c
138 ===================================================================
139 --- libseccomp-2.2.3.orig/src/arch-x86-syscalls.c
140 +++ libseccomp-2.2.3/src/arch-x86-syscalls.c
141 @@ -195,6 +195,7 @@ const struct arch_syscall_def x86_syscal
142 { "lstat", 107 },
143 { "lstat64", 196 },
144 { "madvise", 219 },
145 + { "mbarrier", 375 },
146 { "mbind", 274 },
147 { "memfd_create", 356 },
148 { "migrate_pages", 294 },
149 Index: libseccomp-2.2.3/include/seccomp.h.in
150 ===================================================================
151 --- libseccomp-2.2.3.orig/include/seccomp.h.in
152 +++ libseccomp-2.2.3/include/seccomp.h.in
153 @@ -1557,6 +1557,11 @@ int seccomp_export_bpf(const scmp_filter
154 #define __NR_s390_runtime_instr __PNR_s390_runtime_instr
155 #endif /* __NR_s390_runtime_instr */
156
157 +#define __PNR_mbarrier -10197
158 +#ifndef __NR_mbarrier
159 +#define __NR_mbarrier __PNR_mbarrier
160 +#endif /* __NR_mbarrier */
161 +
162 #ifdef __cplusplus
163 }
164 #endif
0 Description: add newly connected x86 32bit direct socket calls
1 x86 recently connected up the direct socket calls to allow simpler
2 seccomp mitigation for them. Add these to the 32bit x86 syscalls table
3 to match.
4 Author: Andy Whitcroft <apw@ubuntu.com>
5 Bug-Ubuntu: https://bugs.launchpad.net/bugs/1526358
6
7 --- libseccomp-2.2.3.orig/src/arch-x86-syscalls.c
8 +++ libseccomp-2.2.3/src/arch-x86-syscalls.c
9 @@ -32,7 +32,7 @@ const struct arch_syscall_def x86_syscal
10 { "_newselect", 142 },
11 { "_sysctl", 149 },
12 { "accept", __PNR_accept },
13 - { "accept4", __PNR_accept4 },
14 + { "accept4", 364 },
15 { "access", 33 },
16 { "acct", 51 },
17 { "add_key", 286 },
18 @@ -43,7 +43,7 @@ const struct arch_syscall_def x86_syscal
19 { "arm_sync_file_range", __PNR_arm_sync_file_range },
20 { "arch_prctl", __PNR_arch_prctl },
21 { "bdflush", 134 },
22 - { "bind", __PNR_bind },
23 + { "bind", 361 },
24 { "bpf", 357 },
25 { "break", 17 },
26 { "breakpoint", __PNR_breakpoint },
27 @@ -64,7 +64,7 @@ const struct arch_syscall_def x86_syscal
28 { "clock_settime", 264 },
29 { "clone", 120 },
30 { "close", 6 },
31 - { "connect", __PNR_connect },
32 + { "connect", 362 },
33 { "creat", 8 },
34 { "create_module", 127 },
35 { "delete_module", 129 },
36 @@ -134,7 +134,7 @@ const struct arch_syscall_def x86_syscal
37 { "getgroups", 80 },
38 { "getgroups32", 205 },
39 { "getitimer", 105 },
40 - { "getpeername", __PNR_getpeername },
41 + { "getpeername", 368 },
42 { "getpgid", 132 },
43 { "getpgrp", 65 },
44 { "getpid", 20 },
45 @@ -149,8 +149,8 @@ const struct arch_syscall_def x86_syscal
46 { "getrlimit", 76 },
47 { "getrusage", 77 },
48 { "getsid", 147 },
49 - { "getsockname", __PNR_getsockname },
50 - { "getsockopt", __PNR_getsockopt },
51 + { "getsockname", 367 },
52 + { "getsockopt", 365 },
53 { "gettid", 224 },
54 { "gettimeofday", 78 },
55 { "getuid", 24 },
56 @@ -184,7 +184,7 @@ const struct arch_syscall_def x86_syscal
57 { "lgetxattr", 230 },
58 { "link", 9 },
59 { "linkat", 303 },
60 - { "listen", __PNR_listen },
61 + { "listen", 363 },
62 { "listxattr", 232 },
63 { "llistxattr", 233 },
64 { "lock", 53 },
65 @@ -277,9 +277,9 @@ const struct arch_syscall_def x86_syscal
66 { "readv", 145 },
67 { "reboot", 88 },
68 { "recv", __PNR_recv },
69 - { "recvfrom", __PNR_recvfrom },
70 + { "recvfrom", 371 },
71 { "recvmmsg", 337 },
72 - { "recvmsg", __PNR_recvmsg },
73 + { "recvmsg", 372 },
74 { "remap_file_pages", 257 },
75 { "removexattr", 235 },
76 { "rename", 38 },
77 @@ -321,8 +321,8 @@ const struct arch_syscall_def x86_syscal
78 { "sendfile", 187 },
79 { "sendfile64", 239 },
80 { "sendmmsg", 345 },
81 - { "sendmsg", __PNR_sendmsg },
82 - { "sendto", __PNR_sendto },
83 + { "sendmsg", 370 },
84 + { "sendto", 369 },
85 { "set_mempolicy", 276 },
86 { "set_robust_list", 311 },
87 { "set_thread_area", 243 },
88 @@ -352,7 +352,7 @@ const struct arch_syscall_def x86_syscal
89 { "setreuid32", 203 },
90 { "setrlimit", 75 },
91 { "setsid", 66 },
92 - { "setsockopt", __PNR_setsockopt },
93 + { "setsockopt", 366 },
94 { "settimeofday", 79 },
95 { "setuid", 23 },
96 { "setuid32", 213 },
97 @@ -362,7 +362,7 @@ const struct arch_syscall_def x86_syscal
98 { "shmctl", __PNR_shmctl },
99 { "shmdt", __PNR_shmdt },
100 { "shmget", __PNR_shmget },
101 - { "shutdown", __PNR_shutdown },
102 + { "shutdown", 373 },
103 { "sigaction", 67 },
104 { "sigaltstack", 186 },
105 { "signal", 48 },
106 @@ -372,9 +372,9 @@ const struct arch_syscall_def x86_syscal
107 { "sigprocmask", 126 },
108 { "sigreturn", 119 },
109 { "sigsuspend", 72 },
110 - { "socket", __PNR_socket },
111 + { "socket", 359 },
112 { "socketcall", 102 },
113 - { "socketpair", __PNR_socketpair },
114 + { "socketpair", 360 },
115 { "splice", 313 },
116 { "spu_create", __PNR_spu_create },
117 { "spu_run", __PNR_spu_run },
+0
-42
debian/patches/build-ldflags.patch less more
0 Description: LIBFLAGS are for libraries, LDFLAGS are for linker arguments.
1 Author: Kees Cook <kees@debian.org>
2
3 Index: libseccomp-2.1.0/macros.mk
4 ===================================================================
5 --- libseccomp-2.1.0.orig/macros.mk 2013-08-13 00:55:29.615739819 -0700
6 +++ libseccomp-2.1.0/macros.mk 2013-08-13 01:00:12.123634186 -0700
7 @@ -136,7 +136,7 @@
8 ifeq ($(V),0)
9 COMPILE_EXEC = @echo " CC $@";
10 endif
11 -COMPILE_EXEC += $(GCC) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LDFLAGS);
12 +COMPILE_EXEC += $(GCC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBFLAGS);
13
14 ifeq ($(V),0)
15 ARCHIVE = @echo " AR $@";
16 Index: libseccomp-2.1.0/tools/Makefile
17 ===================================================================
18 --- libseccomp-2.1.0.orig/tools/Makefile 2013-05-29 11:46:02.000000000 -0700
19 +++ libseccomp-2.1.0/tools/Makefile 2013-08-13 00:58:11.025965101 -0700
20 @@ -32,7 +32,7 @@
21 include $(TOPDIR)/configure.mk
22 include $(TOPDIR)/install.mk
23
24 -LDFLAGS := ../src/libseccomp.a
25 +LIBFLAGS := ../src/libseccomp.a
26
27 TOOLS = scmp_bpf_disasm \
28 scmp_bpf_sim \
29 Index: libseccomp-2.1.0/tests/Makefile
30 ===================================================================
31 --- libseccomp-2.1.0.orig/tests/Makefile 2013-05-23 13:53:11.000000000 -0700
32 +++ libseccomp-2.1.0/tests/Makefile 2013-08-13 00:59:44.707256337 -0700
33 @@ -34,7 +34,7 @@
34
35 OBJS = util.o
36
37 -LDFLAGS := ../src/libseccomp.a $(OBJS)
38 +LIBFLAGS := ../src/libseccomp.a $(OBJS)
39
40 TEST_PRIVATE = 00-test
41
0 commit 13386c1fd34834b6c9d46d36c43616b623736a93
1 Author: Paul Moore <pmoore@redhat.com>
2 Date: Sat Aug 29 21:13:21 2015 -0400
3
4 tools: add the missing s390/s390x support to scmp_bpf_disasm
5
6 Signed-off-by: Paul Moore <pmoore@redhat.com>
7 diff --git a/tools/scmp_bpf_disasm.c b/tools/scmp_bpf_disasm.c
8 index d0fb16d..a081ad0 100644
9 --- a/tools/scmp_bpf_disasm.c
10 +++ b/tools/scmp_bpf_disasm.c
11 @@ -492,6 +492,10 @@ int main(int argc, char *argv[])
12 arch = AUDIT_ARCH_PPC64LE;
13 else if (strcmp(optarg, "ppc") == 0)
14 arch = AUDIT_ARCH_PPC;
15 + else if (strcmp(optarg, "s390") == 0)
16 + arch = AUDIT_ARCH_S390;
17 + else if (strcmp(optarg, "s390x") == 0)
18 + arch = AUDIT_ARCH_S390X;
19 else
20 exit_usage(argv[0]);
21 break;
0 commit 18c7d1176fb236d98656eb4f4cd0343ebcfe5cc0
1 Author: Paul Moore <pmoore@redhat.com>
2 Date: Wed Aug 5 12:04:11 2015 -0400
3
4 arch: update the syscall tables for 4.2-rc5
5
6 The only update this time around is "switch_endian" for ppc.
7
8 Signed-off-by: Paul Moore <pmoore@redhat.com>
9 diff --git a/include/seccomp.h.in b/include/seccomp.h.in
10 index d100dc8..08eae61 100644
11 --- a/include/seccomp.h.in
12 +++ b/include/seccomp.h.in
13 @@ -1521,6 +1521,11 @@ int seccomp_export_bpf(const scmp_filter_ctx ctx, int fd);
14 #define __NR_sys_debug_setcontext __PNR_sys_debug_setcontext
15 #endif /* __NR_sys_debug_setcontext */
16
17 +#define __PNR_switch_endian -10191
18 +#ifndef __NR_switch_endian
19 +#define __NR_switch_endian __PNR_switch_endian
20 +#endif /* __NR_switch_endian */
21 +
22 #ifdef __cplusplus
23 }
24 #endif
25 diff --git a/src/arch-aarch64-syscalls.c b/src/arch-aarch64-syscalls.c
26 index 315be10..43d77ad 100644
27 --- a/src/arch-aarch64-syscalls.c
28 +++ b/src/arch-aarch64-syscalls.c
29 @@ -26,7 +26,7 @@
30 #include "arch.h"
31 #include "arch-aarch64.h"
32
33 -/* NOTE: based on Linux 3.19 */
34 +/* NOTE: based on Linux 4.2-rc5 */
35 const struct arch_syscall_def aarch64_syscall_table[] = { \
36 { "_llseek", __PNR__llseek },
37 { "_newselect", __PNR__newselect },
38 @@ -387,6 +387,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
39 { "swapcontext", __PNR_swapcontext },
40 { "swapoff", 225 },
41 { "swapon", 224 },
42 + { "switch_endian", __PNR_switch_endian },
43 { "symlink", __PNR_symlink },
44 { "symlinkat", 36 },
45 { "sync", 81 },
46 diff --git a/src/arch-arm-syscalls.c b/src/arch-arm-syscalls.c
47 index 3d75062..211bbec 100644
48 --- a/src/arch-arm-syscalls.c
49 +++ b/src/arch-arm-syscalls.c
50 @@ -37,7 +37,7 @@
51 #define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
52 #endif
53
54 -/* NOTE: based on Linux 3.19 */
55 +/* NOTE: based on Linux 4.2-rc5 */
56 const struct arch_syscall_def arm_syscall_table[] = { \
57 /* NOTE: arm_sync_file_range() and sync_file_range2() share values */
58 { "_llseek", (__NR_SYSCALL_BASE + 140) },
59 @@ -399,13 +399,14 @@ const struct arch_syscall_def arm_syscall_table[] = { \
60 { "swapcontext", __PNR_swapcontext },
61 { "swapoff", (__NR_SYSCALL_BASE + 115) },
62 { "swapon", (__NR_SYSCALL_BASE + 87) },
63 + { "switch_endian", __PNR_switch_endian },
64 { "symlink", (__NR_SYSCALL_BASE + 83) },
65 { "symlinkat", (__NR_SYSCALL_BASE + 331) },
66 { "sync", (__NR_SYSCALL_BASE + 36) },
67 { "sync_file_range", __PNR_sync_file_range },
68 { "sync_file_range2", (__NR_SYSCALL_BASE + 341) },
69 { "syncfs", (__NR_SYSCALL_BASE + 373) },
70 - { "syscall", (__NR_SYSCALL_BASE + 113) },
71 + { "syscall", (__PNR_syscall) },
72 { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
73 { "sysfs", (__NR_SYSCALL_BASE + 135) },
74 { "sysinfo", (__NR_SYSCALL_BASE + 116) },
75 diff --git a/src/arch-mips-syscalls.c b/src/arch-mips-syscalls.c
76 index f02988e..1fe9315 100644
77 --- a/src/arch-mips-syscalls.c
78 +++ b/src/arch-mips-syscalls.c
79 @@ -30,7 +30,7 @@
80 /* O32 ABI */
81 #define __NR_SYSCALL_BASE 4000
82
83 -/* NOTE: based on Linux 3.19 */
84 +/* NOTE: based on Linux 4.2-rc5 */
85 const struct arch_syscall_def mips_syscall_table[] = { \
86 { "_llseek", (__NR_SYSCALL_BASE + 140) },
87 { "_newselect", (__NR_SYSCALL_BASE + 142) },
88 @@ -391,6 +391,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
89 { "swapcontext", __PNR_swapcontext },
90 { "swapoff", (__NR_SYSCALL_BASE + 115) },
91 { "swapon", (__NR_SYSCALL_BASE + 87) },
92 + { "switch_endian", __PNR_switch_endian },
93 { "symlink", (__NR_SYSCALL_BASE + 83) },
94 { "symlinkat", (__NR_SYSCALL_BASE + 297) },
95 { "sync", (__NR_SYSCALL_BASE + 36) },
96 diff --git a/src/arch-mips64-syscalls.c b/src/arch-mips64-syscalls.c
97 index 7faea23..493fe87 100644
98 --- a/src/arch-mips64-syscalls.c
99 +++ b/src/arch-mips64-syscalls.c
100 @@ -30,7 +30,7 @@
101 /* 64 ABI */
102 #define __NR_SYSCALL_BASE 5000
103
104 -/* NOTE: based on Linux 3.19 */
105 +/* NOTE: based on Linux 4.2-rc5 */
106 const struct arch_syscall_def mips64_syscall_table[] = { \
107 { "_llseek", __PNR__llseek },
108 { "_newselect", (__NR_SYSCALL_BASE + 22) },
109 @@ -391,6 +391,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
110 { "swapcontext", __PNR_swapcontext },
111 { "swapoff", (__NR_SYSCALL_BASE + 163) },
112 { "swapon", (__NR_SYSCALL_BASE + 162) },
113 + { "switch_endian", __PNR_switch_endian },
114 { "symlink", (__NR_SYSCALL_BASE + 86) },
115 { "symlinkat", (__NR_SYSCALL_BASE + 256) },
116 { "sync", (__NR_SYSCALL_BASE + 157) },
117 diff --git a/src/arch-mips64n32-syscalls.c b/src/arch-mips64n32-syscalls.c
118 index 18ee476..e1cbf5c 100644
119 --- a/src/arch-mips64n32-syscalls.c
120 +++ b/src/arch-mips64n32-syscalls.c
121 @@ -30,7 +30,7 @@
122 /* N32 ABI */
123 #define __NR_SYSCALL_BASE 6000
124
125 -/* NOTE: based on Linux 3.19 */
126 +/* NOTE: based on Linux 4.2-rc5 */
127 const struct arch_syscall_def mips64n32_syscall_table[] = { \
128 { "_llseek", __PNR__llseek },
129 { "_newselect", (__NR_SYSCALL_BASE + 22) },
130 @@ -391,6 +391,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
131 { "swapcontext", __PNR_swapcontext },
132 { "swapoff", (__NR_SYSCALL_BASE + 163) },
133 { "swapon", (__NR_SYSCALL_BASE + 162) },
134 + { "switch_endian", __PNR_switch_endian },
135 { "symlink", (__NR_SYSCALL_BASE + 86) },
136 { "symlinkat", (__NR_SYSCALL_BASE + 260) },
137 { "sync", (__NR_SYSCALL_BASE + 157) },
138 diff --git a/src/arch-ppc-syscalls.c b/src/arch-ppc-syscalls.c
139 index 32fc05a..92fa1c3 100644
140 --- a/src/arch-ppc-syscalls.c
141 +++ b/src/arch-ppc-syscalls.c
142 @@ -27,7 +27,7 @@
143 #include "arch.h"
144 #include "arch-ppc.h"
145
146 -/* NOTE: based on Linux 3.19 */
147 +/* NOTE: based on Linux 4.2-rc5 */
148 const struct arch_syscall_def ppc_syscall_table[] = { \
149 { "_llseek", 140 },
150 { "_newselect", 142 },
151 @@ -47,6 +47,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \
152 { "bind", 327 },
153 { "bpf", 361 },
154 { "break", 17 },
155 + { "breakpoint", __PNR_breakpoint },
156 { "brk", 45 },
157 { "cachectl", __PNR_cachectl },
158 { "cacheflush", __PNR_cacheflush },
159 @@ -325,6 +326,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \
160 { "set_robust_list", 300 },
161 { "set_thread_area", __PNR_set_thread_area },
162 { "set_tid_address", 232 },
163 + { "set_tls", __PNR_set_tls },
164 { "setdomainname", 121 },
165 { "setfsgid", 139 },
166 { "setfsgid32", __PNR_setfsgid32 },
167 @@ -386,6 +388,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \
168 { "swapcontext", 249 },
169 { "swapoff", 115 },
170 { "swapon", 87 },
171 + { "switch_endian", 363 },
172 { "symlink", 83 },
173 { "symlinkat", 295 },
174 { "sync", 36 },
175 @@ -425,6 +428,8 @@ const struct arch_syscall_def ppc_syscall_table[] = { \
176 { "unlinkat", 292 },
177 { "unshare", 282 },
178 { "uselib", 86 },
179 + { "usr26", __PNR_usr26 },
180 + { "usr32", __PNR_usr32 },
181 { "ustat", 62 },
182 { "utime", 30 },
183 { "utimensat", 304 },
184 diff --git a/src/arch-ppc64-syscalls.c b/src/arch-ppc64-syscalls.c
185 index 1c2a1df..b23d743 100644
186 --- a/src/arch-ppc64-syscalls.c
187 +++ b/src/arch-ppc64-syscalls.c
188 @@ -27,7 +27,7 @@
189 #include "arch.h"
190 #include "arch-ppc64.h"
191
192 -/* NOTE: based on Linux 3.19 */
193 +/* NOTE: based on Linux 4.2-rc5 */
194 const struct arch_syscall_def ppc64_syscall_table[] = { \
195 { "_llseek", 140 },
196 { "_newselect", 142 },
197 @@ -47,6 +47,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \
198 { "bind", 327 },
199 { "bpf", 361 },
200 { "break", 17 },
201 + { "breakpoint", __PNR_breakpoint },
202 { "brk", 45 },
203 { "cachectl", __PNR_cachectl },
204 { "cacheflush", __PNR_cacheflush },
205 @@ -325,6 +326,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \
206 { "set_robust_list", 300 },
207 { "set_thread_area", __PNR_set_thread_area },
208 { "set_tid_address", 232 },
209 + { "set_tls", __PNR_set_tls },
210 { "setdomainname", 121 },
211 { "setfsgid", 139 },
212 { "setfsgid32", __PNR_setfsgid32 },
213 @@ -386,6 +388,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \
214 { "swapcontext", 249 },
215 { "swapoff", 115 },
216 { "swapon", 87 },
217 + { "switch_endian", __PNR_switch_endian },
218 { "symlink", 83 },
219 { "symlinkat", 295 },
220 { "sync", 36 },
221 @@ -425,6 +428,8 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \
222 { "unlinkat", 292 },
223 { "unshare", 282 },
224 { "uselib", 86 },
225 + { "usr26", __PNR_usr26 },
226 + { "usr32", __PNR_usr32 },
227 { "ustat", 62 },
228 { "utime", 30 },
229 { "utimensat", 304 },
230 diff --git a/src/arch-x32-syscalls.c b/src/arch-x32-syscalls.c
231 index a0b4247..66a58a1 100644
232 --- a/src/arch-x32-syscalls.c
233 +++ b/src/arch-x32-syscalls.c
234 @@ -26,7 +26,7 @@
235 #include "arch.h"
236 #include "arch-x32.h"
237
238 -/* NOTE: based on Linux 3.19 */
239 +/* NOTE: based on Linux 4.2-rc5 */
240 const struct arch_syscall_def x32_syscall_table[] = { \
241 { "_llseek", __PNR__llseek },
242 { "_newselect", __PNR__newselect },
243 @@ -387,6 +387,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
244 { "swapcontext", __PNR_swapcontext },
245 { "swapoff", (X32_SYSCALL_BIT + 168) },
246 { "swapon", (X32_SYSCALL_BIT + 167) },
247 + { "switch_endian", __PNR_switch_endian },
248 { "symlink", (X32_SYSCALL_BIT + 88) },
249 { "symlinkat", (X32_SYSCALL_BIT + 266) },
250 { "sync", (X32_SYSCALL_BIT + 162) },
251 diff --git a/src/arch-x86-syscalls.c b/src/arch-x86-syscalls.c
252 index d27a4d1..53f7cfa 100644
253 --- a/src/arch-x86-syscalls.c
254 +++ b/src/arch-x86-syscalls.c
255 @@ -26,7 +26,7 @@
256 #include "arch.h"
257 #include "arch-x86.h"
258
259 -/* NOTE: based on Linux 3.19 */
260 +/* NOTE: based on Linux 4.2-rc5 */
261 const struct arch_syscall_def x86_syscall_table[] = { \
262 { "_llseek", 140 },
263 { "_newselect", 142 },
264 @@ -387,6 +387,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
265 { "swapcontext", __PNR_swapcontext },
266 { "swapoff", 115 },
267 { "swapon", 87 },
268 + { "switch_endian", __PNR_switch_endian },
269 { "symlink", 83 },
270 { "symlinkat", 304 },
271 { "sync", 36 },
272 diff --git a/src/arch-x86_64-syscalls.c b/src/arch-x86_64-syscalls.c
273 index cd9eb6d..b50ec23 100644
274 --- a/src/arch-x86_64-syscalls.c
275 +++ b/src/arch-x86_64-syscalls.c
276 @@ -26,7 +26,7 @@
277 #include "arch.h"
278 #include "arch-x86_64.h"
279
280 -/* NOTE: based on Linux 3.19 */
281 +/* NOTE: based on Linux 4.2-rc5 */
282 const struct arch_syscall_def x86_64_syscall_table[] = { \
283 { "_llseek", __PNR__llseek },
284 { "_newselect", __PNR__newselect },
285 @@ -387,6 +387,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
286 { "swapcontext", __PNR_swapcontext },
287 { "swapoff", 168 },
288 { "swapon", 167 },
289 + { "switch_endian", __PNR_switch_endian },
290 { "symlink", 88 },
291 { "symlinkat", 266 },
292 { "sync", 162 },
0 commit 29753076fddfed772511c67887bed1f0621b32cf
1 Merge: 62c59aa 0843a46
2 Author: Paul Moore <pmoore@redhat.com>
3 Date: Wed Aug 5 12:00:34 2015 -0400
4
5 Merge branch 'working-ppc64'
6
7 Mike Strosaker <strosake@linux.vnet.ibm.com> reports that the
8 working-ppc64 branch is working for both 'make check' and './regression
9 -T live'.
10 diff --git a/include/seccomp.h.in b/include/seccomp.h.in
11 index 4cfc17c..d100dc8 100644
12 --- a/include/seccomp.h.in
13 +++ b/include/seccomp.h.in
14 @@ -163,6 +163,16 @@ struct scmp_arg_cmp {
15 #define SCMP_ARCH_MIPSEL64N32 AUDIT_ARCH_MIPSEL64N32
16
17 /**
18 + * The PowerPC architecture tokens
19 + */
20 +#define SCMP_ARCH_PPC AUDIT_ARCH_PPC
21 +#define SCMP_ARCH_PPC64 AUDIT_ARCH_PPC64
22 +#ifndef AUDIT_ARCH_PPC64LE
23 +#define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
24 +#endif
25 +#define SCMP_ARCH_PPC64LE AUDIT_ARCH_PPC64LE
26 +
27 +/**
28 * Convert a syscall name into the associated syscall number
29 * @param x the syscall name
30 */
31 @@ -1476,6 +1486,41 @@ int seccomp_export_bpf(const scmp_filter_ctx ctx, int fd);
32 #define __NR_usr32 __PNR_usr32
33 #endif /* __ARM_NR_usr32 */
34
35 +#define __PNR_multiplexer -10186
36 +#ifndef __NR_multiplexer
37 +#define __NR_multiplexer __PNR_multiplexer
38 +#endif /* __NR_multiplexer */
39 +
40 +#define __PNR_rtas -10187
41 +#ifndef __NR_rtas
42 +#define __NR_rtas __PNR_rtas
43 +#endif /* __NR_rtas */
44 +
45 +#define __PNR_spu_create -10188
46 +#ifndef __NR_spu_create
47 +#define __NR_spu_create __PNR_spu_create
48 +#endif /* __NR_spu_create */
49 +
50 +#define __PNR_spu_run -10189
51 +#ifndef __NR_spu_run
52 +#define __NR_spu_run __PNR_spu_run
53 +#endif /* __NR_spu_run */
54 +
55 +#define __PNR_subpage_prot -10189
56 +#ifndef __NR_subpage_prot
57 +#define __NR_subpage_prot __PNR_subpage_prot
58 +#endif /* __NR_subpage_prot */
59 +
60 +#define __PNR_swapcontext -10190
61 +#ifndef __NR_swapcontext
62 +#define __NR_swapcontext __PNR_swapcontext
63 +#endif /* __NR_swapcontext */
64 +
65 +#define __PNR_sys_debug_setcontext -10191
66 +#ifndef __NR_sys_debug_setcontext
67 +#define __NR_sys_debug_setcontext __PNR_sys_debug_setcontext
68 +#endif /* __NR_sys_debug_setcontext */
69 +
70 #ifdef __cplusplus
71 }
72 #endif
73 diff --git a/src/Makefile.am b/src/Makefile.am
74 index a14cefb..23d9a91 100644
75 --- a/src/Makefile.am
76 +++ b/src/Makefile.am
77 @@ -30,7 +30,9 @@ SOURCES_ARCH = \
78 arch-aarch64.h arch-aarch64.c arch-aarch64-syscalls.c \
79 arch-mips.h arch-mips.c arch-mips-syscalls.c \
80 arch-mips64.h arch-mips64.c arch-mips64-syscalls.c \
81 - arch-mips64n32.h arch-mips64n32.c arch-mips64n32-syscalls.c
82 + arch-mips64n32.h arch-mips64n32.c arch-mips64n32-syscalls.c \
83 + arch-ppc.h arch-ppc.c arch-ppc-syscalls.c \
84 + arch-ppc64.h arch-ppc64.c arch-ppc64-syscalls.c
85
86 SOURCES_GEN = \
87 api.c system.h system.c \
88 diff --git a/src/arch-aarch64-syscalls.c b/src/arch-aarch64-syscalls.c
89 index 27f226c..315be10 100644
90 --- a/src/arch-aarch64-syscalls.c
91 +++ b/src/arch-aarch64-syscalls.c
92 @@ -224,6 +224,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
93 { "msgrcv", 188 },
94 { "msgsnd", 189 },
95 { "msync", 227 },
96 + { "multiplexer", __PNR_multiplexer },
97 { "munlock", 229 },
98 { "munlockall", 231 },
99 { "munmap", 215 },
100 @@ -294,6 +295,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
101 { "rt_sigsuspend", 133 },
102 { "rt_sigtimedwait", 137 },
103 { "rt_tgsigqueueinfo", 240 },
104 + { "rtas", __PNR_rtas },
105 { "sched_get_priority_max", 125 },
106 { "sched_get_priority_min", 126 },
107 { "sched_getaffinity", 123 },
108 @@ -372,6 +374,8 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
109 { "socketcall", __PNR_socketcall },
110 { "socketpair", 199 },
111 { "splice", 76 },
112 + { "spu_create", __PNR_spu_create },
113 + { "spu_run", __PNR_spu_run },
114 { "ssetmask", __PNR_ssetmask },
115 { "stat", __PNR_stat },
116 { "stat64", __PNR_stat64 },
117 @@ -379,6 +383,8 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
118 { "statfs64", __PNR_statfs64 },
119 { "stime", __PNR_stime },
120 { "stty", __PNR_stty },
121 + { "subpage_prot", __PNR_subpage_prot },
122 + { "swapcontext", __PNR_swapcontext },
123 { "swapoff", 225 },
124 { "swapon", 224 },
125 { "symlink", __PNR_symlink },
126 @@ -388,6 +394,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
127 { "sync_file_range2", __PNR_sync_file_range2 },
128 { "syncfs", 267 },
129 { "syscall", __PNR_syscall },
130 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
131 { "sysfs", __PNR_sysfs },
132 { "sysinfo", 179 },
133 { "syslog", 116 },
134 diff --git a/src/arch-arm-syscalls.c b/src/arch-arm-syscalls.c
135 index c478256..3d75062 100644
136 --- a/src/arch-arm-syscalls.c
137 +++ b/src/arch-arm-syscalls.c
138 @@ -236,6 +236,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \
139 { "msgrcv", (__NR_SYSCALL_BASE + 302) },
140 { "msgsnd", (__NR_SYSCALL_BASE + 301) },
141 { "msync", (__NR_SYSCALL_BASE + 144) },
142 + { "multiplexer", __PNR_multiplexer },
143 { "munlock", (__NR_SYSCALL_BASE + 151) },
144 { "munlockall", (__NR_SYSCALL_BASE + 153) },
145 { "munmap", (__NR_SYSCALL_BASE + 91) },
146 @@ -306,6 +307,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \
147 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 179) },
148 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 177) },
149 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 363) },
150 + { "rtas", __PNR_rtas },
151 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 159) },
152 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 160) },
153 { "sched_getaffinity", (__NR_SYSCALL_BASE + 242) },
154 @@ -384,6 +386,8 @@ const struct arch_syscall_def arm_syscall_table[] = { \
155 { "socketcall", __PNR_socketcall },
156 { "socketpair", (__NR_SYSCALL_BASE + 288) },
157 { "splice", (__NR_SYSCALL_BASE + 340) },
158 + { "spu_create", __PNR_spu_create },
159 + { "spu_run", __PNR_spu_run },
160 { "ssetmask", __PNR_ssetmask },
161 { "stat", (__NR_SYSCALL_BASE + 106) },
162 { "stat64", (__NR_SYSCALL_BASE + 195) },
163 @@ -391,6 +395,8 @@ const struct arch_syscall_def arm_syscall_table[] = { \
164 { "statfs64", (__NR_SYSCALL_BASE + 266) },
165 { "stime", __PNR_stime },
166 { "stty", __PNR_stty },
167 + { "subpage_prot", __PNR_subpage_prot },
168 + { "swapcontext", __PNR_swapcontext },
169 { "swapoff", (__NR_SYSCALL_BASE + 115) },
170 { "swapon", (__NR_SYSCALL_BASE + 87) },
171 { "symlink", (__NR_SYSCALL_BASE + 83) },
172 @@ -399,7 +405,8 @@ const struct arch_syscall_def arm_syscall_table[] = { \
173 { "sync_file_range", __PNR_sync_file_range },
174 { "sync_file_range2", (__NR_SYSCALL_BASE + 341) },
175 { "syncfs", (__NR_SYSCALL_BASE + 373) },
176 - { "syscall", __PNR_syscall },
177 + { "syscall", (__NR_SYSCALL_BASE + 113) },
178 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
179 { "sysfs", (__NR_SYSCALL_BASE + 135) },
180 { "sysinfo", (__NR_SYSCALL_BASE + 116) },
181 { "syslog", (__NR_SYSCALL_BASE + 103) },
182 diff --git a/src/arch-mips-syscalls.c b/src/arch-mips-syscalls.c
183 index 7ba77e9..f02988e 100644
184 --- a/src/arch-mips-syscalls.c
185 +++ b/src/arch-mips-syscalls.c
186 @@ -228,6 +228,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
187 { "msgrcv", __PNR_msgrcv },
188 { "msgsnd", __PNR_msgsnd },
189 { "msync", (__NR_SYSCALL_BASE + 144) },
190 + { "multiplexer", __PNR_multiplexer },
191 { "munlock", (__NR_SYSCALL_BASE + 155) },
192 { "munlockall", (__NR_SYSCALL_BASE + 157) },
193 { "munmap", (__NR_SYSCALL_BASE + 91) },
194 @@ -298,6 +299,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
195 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 199) },
196 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 197) },
197 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 332) },
198 + { "rtas", __PNR_rtas },
199 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 163) },
200 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 164) },
201 { "sched_getaffinity", (__NR_SYSCALL_BASE + 240) },
202 @@ -376,6 +378,8 @@ const struct arch_syscall_def mips_syscall_table[] = { \
203 { "socketcall", (__NR_SYSCALL_BASE + 102) },
204 { "socketpair", (__NR_SYSCALL_BASE + 184) },
205 { "splice", (__NR_SYSCALL_BASE + 304) },
206 + { "spu_create", __PNR_spu_create },
207 + { "spu_run", __PNR_spu_run },
208 { "ssetmask", (__NR_SYSCALL_BASE + 69) },
209 { "stat", (__NR_SYSCALL_BASE + 106) },
210 { "stat64", (__NR_SYSCALL_BASE + 213) },
211 @@ -383,6 +387,8 @@ const struct arch_syscall_def mips_syscall_table[] = { \
212 { "statfs64", (__NR_SYSCALL_BASE + 255) },
213 { "stime", (__NR_SYSCALL_BASE + 25) },
214 { "stty", (__NR_SYSCALL_BASE + 31) },
215 + { "subpage_prot", __PNR_subpage_prot },
216 + { "swapcontext", __PNR_swapcontext },
217 { "swapoff", (__NR_SYSCALL_BASE + 115) },
218 { "swapon", (__NR_SYSCALL_BASE + 87) },
219 { "symlink", (__NR_SYSCALL_BASE + 83) },
220 @@ -392,6 +398,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
221 { "sync_file_range2", __PNR_sync_file_range2 },
222 { "syncfs", (__NR_SYSCALL_BASE + 342) },
223 { "syscall", (__NR_SYSCALL_BASE + 0) },
224 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
225 { "sysfs", (__NR_SYSCALL_BASE + 135) },
226 { "sysinfo", (__NR_SYSCALL_BASE + 116) },
227 { "syslog", (__NR_SYSCALL_BASE + 103) },
228 diff --git a/src/arch-mips64-syscalls.c b/src/arch-mips64-syscalls.c
229 index 6bed000..7faea23 100644
230 --- a/src/arch-mips64-syscalls.c
231 +++ b/src/arch-mips64-syscalls.c
232 @@ -228,6 +228,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
233 { "msgrcv", (__NR_SYSCALL_BASE + 68) },
234 { "msgsnd", (__NR_SYSCALL_BASE + 67) },
235 { "msync", (__NR_SYSCALL_BASE + 25) },
236 + { "multiplexer", __PNR_multiplexer },
237 { "munlock", (__NR_SYSCALL_BASE + 147) },
238 { "munlockall", (__NR_SYSCALL_BASE + 149) },
239 { "munmap", (__NR_SYSCALL_BASE + 11) },
240 @@ -298,6 +299,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
241 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 128) },
242 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 126) },
243 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 291) },
244 + { "rtas", __PNR_rtas },
245 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 143) },
246 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 144) },
247 { "sched_getaffinity", (__NR_SYSCALL_BASE + 196) },
248 @@ -376,6 +378,8 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
249 { "socketcall", __PNR_socketcall },
250 { "socketpair", (__NR_SYSCALL_BASE + 52) },
251 { "splice", (__NR_SYSCALL_BASE + 263) },
252 + { "spu_create", __PNR_spu_create },
253 + { "spu_run", __PNR_spu_run },
254 { "ssetmask", __PNR_ssetmask },
255 { "stat", (__NR_SYSCALL_BASE + 4) },
256 { "stat64", __PNR_stat64 },
257 @@ -383,6 +387,8 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
258 { "statfs64", __PNR_statfs64 },
259 { "stime", __PNR_stime },
260 { "stty", __PNR_stty },
261 + { "subpage_prot", __PNR_subpage_prot },
262 + { "swapcontext", __PNR_swapcontext },
263 { "swapoff", (__NR_SYSCALL_BASE + 163) },
264 { "swapon", (__NR_SYSCALL_BASE + 162) },
265 { "symlink", (__NR_SYSCALL_BASE + 86) },
266 @@ -392,6 +398,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
267 { "sync_file_range2", __PNR_sync_file_range2 },
268 { "syncfs", (__NR_SYSCALL_BASE + 301) },
269 { "syscall", __PNR_syscall },
270 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
271 { "sysfs", (__NR_SYSCALL_BASE + 136) },
272 { "sysinfo", (__NR_SYSCALL_BASE + 97) },
273 { "syslog", (__NR_SYSCALL_BASE + 101) },
274 diff --git a/src/arch-mips64n32-syscalls.c b/src/arch-mips64n32-syscalls.c
275 index 389784b..18ee476 100644
276 --- a/src/arch-mips64n32-syscalls.c
277 +++ b/src/arch-mips64n32-syscalls.c
278 @@ -228,6 +228,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
279 { "msgrcv", (__NR_SYSCALL_BASE + 68) },
280 { "msgsnd", (__NR_SYSCALL_BASE + 67) },
281 { "msync", (__NR_SYSCALL_BASE + 25) },
282 + { "multiplexer", __PNR_multiplexer },
283 { "munlock", (__NR_SYSCALL_BASE + 147) },
284 { "munlockall", (__NR_SYSCALL_BASE + 149) },
285 { "munmap", (__NR_SYSCALL_BASE + 11) },
286 @@ -298,6 +299,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
287 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 128) },
288 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 126) },
289 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 295) },
290 + { "rtas", __PNR_rtas },
291 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 143) },
292 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 144) },
293 { "sched_getaffinity", (__NR_SYSCALL_BASE + 196) },
294 @@ -376,6 +378,8 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
295 { "socketcall", __PNR_socketcall },
296 { "socketpair", (__NR_SYSCALL_BASE + 52) },
297 { "splice", (__NR_SYSCALL_BASE + 267) },
298 + { "spu_create", __PNR_spu_create },
299 + { "spu_run", __PNR_spu_run },
300 { "ssetmask", __PNR_ssetmask },
301 { "stat", (__NR_SYSCALL_BASE + 4) },
302 { "stat64", __PNR_stat64 },
303 @@ -383,6 +387,8 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
304 { "statfs64", (__NR_SYSCALL_BASE + 217) },
305 { "stime", __PNR_stime },
306 { "stty", __PNR_stty },
307 + { "subpage_prot", __PNR_subpage_prot },
308 + { "swapcontext", __PNR_swapcontext },
309 { "swapoff", (__NR_SYSCALL_BASE + 163) },
310 { "swapon", (__NR_SYSCALL_BASE + 162) },
311 { "symlink", (__NR_SYSCALL_BASE + 86) },
312 @@ -392,6 +398,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
313 { "sync_file_range2", __PNR_sync_file_range2 },
314 { "syncfs", (__NR_SYSCALL_BASE + 306) },
315 { "syscall", __PNR_syscall },
316 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
317 { "sysfs", (__NR_SYSCALL_BASE + 136) },
318 { "sysinfo", (__NR_SYSCALL_BASE + 97) },
319 { "syslog", (__NR_SYSCALL_BASE + 101) },
320 diff --git a/src/arch-ppc-syscalls.c b/src/arch-ppc-syscalls.c
321 new file mode 100644
322 index 0000000..32fc05a
323 --- /dev/null
324 +++ b/src/arch-ppc-syscalls.c
325 @@ -0,0 +1,504 @@
326 +/**
327 + * Enhanced Seccomp PPC Specific Code
328 + *
329 + * Copyright (c) 2015 Freescale <bogdan.purcareata@freescale.com>
330 + * Author: Bogdan Purcareata <bogdan.purcareata@freescale.com>
331 + *
332 + */
333 +
334 +/*
335 + * This library is free software; you can redistribute it and/or modify it
336 + * under the terms of version 2.1 of the GNU Lesser General Public License as
337 + * published by the Free Software Foundation.
338 + *
339 + * This library is distributed in the hope that it will be useful, but WITHOUT
340 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
341 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
342 + * for more details.
343 + *
344 + * You should have received a copy of the GNU Lesser General Public License
345 + * along with this library; if not, see <http://www.gnu.org/licenses>.
346 + */
347 +
348 +#include <string.h>
349 +
350 +#include <seccomp.h>
351 +
352 +#include "arch.h"
353 +#include "arch-ppc.h"
354 +
355 +/* NOTE: based on Linux 3.19 */
356 +const struct arch_syscall_def ppc_syscall_table[] = { \
357 + { "_llseek", 140 },
358 + { "_newselect", 142 },
359 + { "_sysctl", 149 },
360 + { "accept", 330 },
361 + { "accept4", 344 },
362 + { "access", 33 },
363 + { "acct", 51 },
364 + { "add_key", 269 },
365 + { "adjtimex", 124 },
366 + { "afs_syscall", 137 },
367 + { "alarm", 27 },
368 + { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
369 + { "arm_sync_file_range", __PNR_arm_sync_file_range },
370 + { "arch_prctl", __PNR_arch_prctl },
371 + { "bdflush", 134 },
372 + { "bind", 327 },
373 + { "bpf", 361 },
374 + { "break", 17 },
375 + { "brk", 45 },
376 + { "cachectl", __PNR_cachectl },
377 + { "cacheflush", __PNR_cacheflush },
378 + { "capget", 183 },
379 + { "capset", 184 },
380 + { "chdir", 12 },
381 + { "chmod", 15 },
382 + { "chown", 181 },
383 + { "chown32", __PNR_chown32 },
384 + { "chroot", 61 },
385 + { "clock_adjtime", 347 },
386 + { "clock_getres", 247 },
387 + { "clock_gettime", 246 },
388 + { "clock_nanosleep", 248 },
389 + { "clock_settime", 245 },
390 + { "clone", 120 },
391 + { "close", 6 },
392 + { "connect", 328 },
393 + { "creat", 8 },
394 + { "create_module", 127 },
395 + { "delete_module", 129 },
396 + { "dup", 41 },
397 + { "dup2", 63 },
398 + { "dup3", 316 },
399 + { "epoll_create", 236 },
400 + { "epoll_create1", 315 },
401 + { "epoll_ctl", 237 },
402 + { "epoll_ctl_old", __PNR_epoll_ctl_old },
403 + { "epoll_pwait", 303 },
404 + { "epoll_wait", 238 },
405 + { "epoll_wait_old", __PNR_epoll_wait_old },
406 + { "eventfd", 307 },
407 + { "eventfd2", 314 },
408 + { "execve", 11 },
409 + { "execveat", 362 },
410 + { "exit", 1 },
411 + { "exit_group", 234 },
412 + { "faccessat", 298 },
413 + { "fadvise64", 233 },
414 + { "fadvise64_64", 254 },
415 + { "fallocate", 309 },
416 + { "fanotify_init", 323 },
417 + { "fanotify_mark", 324 },
418 + { "fchdir", 133 },
419 + { "fchmod", 94 },
420 + { "fchmodat", 297 },
421 + { "fchown", 95 },
422 + { "fchown32", __PNR_fchown32 },
423 + { "fchownat", 289 },
424 + { "fcntl", 55 },
425 + { "fcntl64", 204 },
426 + { "fdatasync", 148 },
427 + { "fgetxattr", 214 },
428 + { "finit_module", 353 },
429 + { "flistxattr", 217 },
430 + { "flock", 143 },
431 + { "fork", 2 },
432 + { "fremovexattr", 220 },
433 + { "fsetxattr", 211 },
434 + { "fstat", 108 },
435 + { "fstat64", 197 },
436 + { "fstatat64", 291 },
437 + { "fstatfs", 100 },
438 + { "fstatfs64", 253 },
439 + { "fsync", 118 },
440 + { "ftime", 35 },
441 + { "ftruncate", 93 },
442 + { "ftruncate64", 194 },
443 + { "futex", 221 },
444 + { "futimesat", 290 },
445 + { "get_kernel_syms", 130 },
446 + { "get_mempolicy", 260 },
447 + { "get_robust_list", 299 },
448 + { "get_thread_area", __PNR_get_thread_area },
449 + { "getcpu", 302 },
450 + { "getcwd", 182 },
451 + { "getdents", 141 },
452 + { "getdents64", 202 },
453 + { "getegid", 50 },
454 + { "getegid32", __PNR_getegid32 },
455 + { "geteuid", 49 },
456 + { "geteuid32", __PNR_geteuid32 },
457 + { "getgid", 47 },
458 + { "getgid32", __PNR_getgid32 },
459 + { "getgroups", 80 },
460 + { "getgroups32", __PNR_getgroups32 },
461 + { "getitimer", 105 },
462 + { "getpeername", 332 },
463 + { "getpgid", 132 },
464 + { "getpgrp", 65 },
465 + { "getpid", 20 },
466 + { "getpmsg", 187 },
467 + { "getppid", 64 },
468 + { "getpriority", 96 },
469 + { "getrandom", 359 },
470 + { "getresgid", 170 },
471 + { "getresgid32", __PNR_getresgid32 },
472 + { "getresuid", 165 },
473 + { "getresuid32", __PNR_getresuid32 },
474 + { "getrlimit", 76 },
475 + { "getrusage", 77 },
476 + { "getsid", 147 },
477 + { "getsockname", 331 },
478 + { "getsockopt", 340 },
479 + { "gettid", 207 },
480 + { "gettimeofday", 78 },
481 + { "getuid", 24 },
482 + { "getuid32", __PNR_getuid32 },
483 + { "getxattr", 212 },
484 + { "gtty", 32 },
485 + { "idle", 112 },
486 + { "init_module", 128 },
487 + { "inotify_add_watch", 276 },
488 + { "inotify_init", 275 },
489 + { "inotify_init1", 318 },
490 + { "inotify_rm_watch", 277 },
491 + { "io_cancel", 231 },
492 + { "io_destroy", 228 },
493 + { "io_getevents", 229 },
494 + { "io_setup", 227 },
495 + { "io_submit", 230 },
496 + { "ioctl", 54 },
497 + { "ioperm", 101 },
498 + { "iopl", 110 },
499 + { "ioprio_get", 274 },
500 + { "ioprio_set", 273 },
501 + { "ipc", 117 },
502 + { "kcmp", 354 },
503 + { "kexec_file_load", __PNR_kexec_file_load },
504 + { "kexec_load", 268 },
505 + { "keyctl", 271 },
506 + { "kill", 37 },
507 + { "lchown", 16 },
508 + { "lchown32", __PNR_lchown32 },
509 + { "lgetxattr", 213 },
510 + { "link", 9 },
511 + { "linkat", 294 },
512 + { "listen", 329 },
513 + { "listxattr", 215 },
514 + { "llistxattr", 216 },
515 + { "lock", 53 },
516 + { "lookup_dcookie", 235 },
517 + { "lremovexattr", 219 },
518 + { "lseek", 19 },
519 + { "lsetxattr", 210 },
520 + { "lstat", 107 },
521 + { "lstat64", 196 },
522 + { "madvise", 205 },
523 + { "mbind", 259 },
524 + { "memfd_create", 360 },
525 + { "migrate_pages", 258 },
526 + { "mincore", 206 },
527 + { "mkdir", 39 },
528 + { "mkdirat", 287 },
529 + { "mknod", 14 },
530 + { "mknodat", 288 },
531 + { "mlock", 150 },
532 + { "mlockall", 152 },
533 + { "mmap", 90 },
534 + { "mmap2", 192 },
535 + { "modify_ldt", 123 },
536 + { "mount", 21 },
537 + { "move_pages", 301 },
538 + { "mprotect", 125 },
539 + { "mpx", 56 },
540 + { "mq_getsetattr", 267 },
541 + { "mq_notify", 266 },
542 + { "mq_open", 262 },
543 + { "mq_timedreceive", 265 },
544 + { "mq_timedsend", 264 },
545 + { "mq_unlink", 263 },
546 + { "mremap", 163 },
547 + { "msgctl", __PNR_msgctl },
548 + { "msgget", __PNR_msgget },
549 + { "msgrcv", __PNR_msgrcv },
550 + { "msgsnd", __PNR_msgsnd },
551 + { "msync", 144 },
552 + { "multiplexer", 201 },
553 + { "munlock", 151 },
554 + { "munlockall", 153 },
555 + { "munmap", 91 },
556 + { "name_to_handle_at", 345 },
557 + { "nanosleep", 162 },
558 + { "newfstatat", __PNR_newfstatat },
559 + { "nfsservctl", 168 },
560 + { "nice", 34 },
561 + { "oldfstat", 28 },
562 + { "oldlstat", 84 },
563 + { "oldolduname", 59 },
564 + { "oldstat", 18 },
565 + { "olduname", 109 },
566 + { "oldwait4", __PNR_oldwait4 },
567 + { "open", 5 },
568 + { "open_by_handle_at", 346 },
569 + { "openat", 286 },
570 + { "pause", 29 },
571 + { "pciconfig_iobase", 200 },
572 + { "pciconfig_read", 198 },
573 + { "pciconfig_write", 199 },
574 + { "perf_event_open", 319 },
575 + { "personality", 136 },
576 + { "pipe", 42 },
577 + { "pipe2", 317 },
578 + { "pivot_root", 203 },
579 + { "poll", 167 },
580 + { "ppoll", 281 },
581 + { "prctl", 171 },
582 + { "pread64", 179 },
583 + { "preadv", 320 },
584 + { "prlimit64", 325 },
585 + { "process_vm_readv", 351 },
586 + { "process_vm_writev", 352 },
587 + { "prof", 44 },
588 + { "profil", 98 },
589 + { "pselect6", 280 },
590 + { "ptrace", 26 },
591 + { "putpmsg", 188 },
592 + { "pwrite64", 180 },
593 + { "pwritev", 321 },
594 + { "query_module", 166 },
595 + { "quotactl", 131 },
596 + { "read", 3 },
597 + { "readahead", 191 },
598 + { "readdir", 89 },
599 + { "readlink", 85 },
600 + { "readlinkat", 296 },
601 + { "readv", 145 },
602 + { "reboot", 88 },
603 + { "recv", 336 },
604 + { "recvfrom", 337 },
605 + { "recvmmsg", 343 },
606 + { "recvmsg", 342 },
607 + { "remap_file_pages", 239 },
608 + { "removexattr", 218 },
609 + { "rename", 38 },
610 + { "renameat", 293 },
611 + { "renameat2", 357 },
612 + { "request_key", 270 },
613 + { "restart_syscall", 0 },
614 + { "rmdir", 40 },
615 + { "rt_sigaction", 173 },
616 + { "rt_sigpending", 175 },
617 + { "rt_sigprocmask", 174 },
618 + { "rt_sigqueueinfo", 177 },
619 + { "rt_sigreturn", 172 },
620 + { "rt_sigsuspend", 178 },
621 + { "rt_sigtimedwait", 176 },
622 + { "rt_tgsigqueueinfo", 322 },
623 + { "rtas", 255 },
624 + { "sched_get_priority_max", 159 },
625 + { "sched_get_priority_min", 160 },
626 + { "sched_getaffinity", 223 },
627 + { "sched_getattr", 356 },
628 + { "sched_getparam", 155 },
629 + { "sched_getscheduler", 157 },
630 + { "sched_rr_get_interval", 161 },
631 + { "sched_setaffinity", 222 },
632 + { "sched_setattr", 355 },
633 + { "sched_setparam", 154 },
634 + { "sched_setscheduler", 156 },
635 + { "sched_yield", 158 },
636 + { "seccomp", 358 },
637 + { "security", __PNR_security },
638 + { "select", 82 },
639 + { "semctl", __PNR_semctl },
640 + { "semget", __PNR_semget },
641 + { "semop", __PNR_semop },
642 + { "semtimedop", __PNR_semtimedop },
643 + { "send", 334 },
644 + { "sendfile", 186 },
645 + { "sendfile64", 226 },
646 + { "sendmmsg", 349 },
647 + { "sendmsg", 341 },
648 + { "sendto", 335 },
649 + { "set_mempolicy", 261 },
650 + { "set_robust_list", 300 },
651 + { "set_thread_area", __PNR_set_thread_area },
652 + { "set_tid_address", 232 },
653 + { "setdomainname", 121 },
654 + { "setfsgid", 139 },
655 + { "setfsgid32", __PNR_setfsgid32 },
656 + { "setfsuid", 138 },
657 + { "setfsuid32", __PNR_setfsuid32 },
658 + { "setgid", 46 },
659 + { "setgid32", __PNR_setgid32 },
660 + { "setgroups", 81 },
661 + { "setgroups32", __PNR_setgroups32 },
662 + { "sethostname", 74 },
663 + { "setitimer", 104 },
664 + { "setns", 350 },
665 + { "setpgid", 57 },
666 + { "setpriority", 97 },
667 + { "setregid", 71 },
668 + { "setregid32", __PNR_setregid32 },
669 + { "setresgid", 169 },
670 + { "setresgid32", __PNR_setresgid32 },
671 + { "setresuid", 164 },
672 + { "setresuid32", __PNR_setresuid32 },
673 + { "setreuid", 70 },
674 + { "setreuid32", __PNR_setreuid32 },
675 + { "setrlimit", 75 },
676 + { "setsid", 66 },
677 + { "setsockopt", 339 },
678 + { "settimeofday", 79 },
679 + { "setuid", 23 },
680 + { "setuid32", __PNR_setuid32 },
681 + { "setxattr", 209 },
682 + { "sgetmask", 68 },
683 + { "shmat", __PNR_shmat },
684 + { "shmctl", __PNR_shmctl },
685 + { "shmdt", __PNR_shmdt },
686 + { "shmget", __PNR_shmget },
687 + { "shutdown", 338 },
688 + { "sigaction", 67 },
689 + { "sigaltstack", 185 },
690 + { "signal", 48 },
691 + { "signalfd", 305 },
692 + { "signalfd4", 313 },
693 + { "sigpending", 73 },
694 + { "sigprocmask", 126 },
695 + { "sigreturn", 119 },
696 + { "sigsuspend", 72 },
697 + { "socket", 326 },
698 + { "socketcall", 102 },
699 + { "socketpair", 333 },
700 + { "splice", 283 },
701 + { "spu_create", 279 },
702 + { "spu_run", 278 },
703 + { "ssetmask", 69 },
704 + { "stat", 106 },
705 + { "stat64", 195 },
706 + { "statfs", 99 },
707 + { "statfs64", 252 },
708 + { "stime", 25 },
709 + { "stty", 31 },
710 + { "subpage_prot", 310 },
711 + { "swapcontext", 249 },
712 + { "swapoff", 115 },
713 + { "swapon", 87 },
714 + { "symlink", 83 },
715 + { "symlinkat", 295 },
716 + { "sync", 36 },
717 + { "sync_file_range", __PNR_sync_file_range },
718 + { "sync_file_range2", 308 },
719 + { "syncfs", 348 },
720 + { "syscall", __PNR_syscall },
721 + { "sys_debug_setcontext", 256 },
722 + { "sysfs", 135 },
723 + { "sysinfo", 116 },
724 + { "syslog", 103 },
725 + { "sysmips", __PNR_sysmips },
726 + { "tee", 284 },
727 + { "tgkill", 250 },
728 + { "time", 13 },
729 + { "timer_create", 240 },
730 + { "timer_delete", 244 },
731 + { "timer_getoverrun", 243 },
732 + { "timer_gettime", 242 },
733 + { "timer_settime", 241 },
734 + { "timerfd", __PNR_timerfd },
735 + { "timerfd_create", 306 },
736 + { "timerfd_gettime", 312 },
737 + { "timerfd_settime", 311 },
738 + { "times", 43 },
739 + { "tkill", 208 },
740 + { "truncate", 92 },
741 + { "truncate64", 193 },
742 + { "tuxcall", 225 },
743 + { "ugetrlimit", 190 },
744 + { "ulimit", 58 },
745 + { "umask", 60 },
746 + { "umount", 22 },
747 + { "umount2", 52 },
748 + { "uname", 122 },
749 + { "unlink", 10 },
750 + { "unlinkat", 292 },
751 + { "unshare", 282 },
752 + { "uselib", 86 },
753 + { "ustat", 62 },
754 + { "utime", 30 },
755 + { "utimensat", 304 },
756 + { "utimes", 251 },
757 + { "vfork", 189 },
758 + { "vhangup", 111 },
759 + { "vm86", 113 },
760 + { "vm86old", __PNR_vm86old },
761 + { "vmsplice", 285 },
762 + { "vserver", __PNR_vserver },
763 + { "wait4", 114 },
764 + { "waitid", 272 },
765 + { "waitpid", 7 },
766 + { "write", 4 },
767 + { "writev", 146 },
768 + { NULL, __NR_SCMP_ERROR },
769 +};
770 +
771 +/**
772 + * Resolve a syscall name to a number
773 + * @param name the syscall name
774 + *
775 + * Resolve the given syscall name to the syscall number using the syscall table.
776 + * Returns the syscall number on success, including negative pseudo syscall
777 + * numbers; returns __NR_SCMP_ERROR on failure.
778 + *
779 + */
780 +int ppc_syscall_resolve_name(const char *name)
781 +{
782 + unsigned int iter;
783 + const struct arch_syscall_def *table = ppc_syscall_table;
784 +
785 + /* XXX - plenty of room for future improvement here */
786 + for (iter = 0; table[iter].name != NULL; iter++) {
787 + if (strcmp(name, table[iter].name) == 0)
788 + return table[iter].num;
789 + }
790 +
791 + return __NR_SCMP_ERROR;
792 +}
793 +
794 +/**
795 + * Resolve a syscall number to a name
796 + * @param num the syscall number
797 + *
798 + * Resolve the given syscall number to the syscall name using the syscall table.
799 + * Returns a pointer to the syscall name string on success, including pseudo
800 + * syscall names; returns NULL on failure.
801 + *
802 + */
803 +const char *ppc_syscall_resolve_num(int num)
804 +{
805 + unsigned int iter;
806 + const struct arch_syscall_def *table = ppc_syscall_table;
807 +
808 + /* XXX - plenty of room for future improvement here */
809 + for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
810 + if (num == table[iter].num)
811 + return table[iter].name;
812 + }
813 +
814 + return NULL;
815 +}
816 +
817 +/**
818 + * Iterate through the syscall table and return the syscall name
819 + * @param spot the offset into the syscall table
820 + *
821 + * Return the syscall name at position @spot or NULL on failure. This function
822 + * should only ever be used internally by libseccomp.
823 + *
824 + */
825 +const char *ppc_syscall_iterate_name(unsigned int spot)
826 +{
827 + /* XXX - no safety checks here */
828 + return ppc_syscall_table[spot].name;
829 +}
830 diff --git a/src/arch-ppc.c b/src/arch-ppc.c
831 new file mode 100644
832 index 0000000..56dbdb4
833 --- /dev/null
834 +++ b/src/arch-ppc.c
835 @@ -0,0 +1,33 @@
836 +/**
837 + * Enhanced Seccomp PPC Specific Code
838 + *
839 + * Copyright (c) 2015 Freescale <bogdan.purcareata@freescale.com>
840 + * Author: Bogdan Purcareata <bogdan.purcareata@freescale.com>
841 + *
842 + */
843 +
844 +/*
845 + * This library is free software; you can redistribute it and/or modify it
846 + * under the terms of version 2.1 of the GNU Lesser General Public License as
847 + * published by the Free Software Foundation.
848 + *
849 + * This library is distributed in the hope that it will be useful, but WITHOUT
850 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
851 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
852 + * for more details.
853 + *
854 + * You should have received a copy of the GNU Lesser General Public License
855 + * along with this library; if not, see <http://www.gnu.org/licenses>.
856 + */
857 +
858 +#include <linux/audit.h>
859 +
860 +#include "arch.h"
861 +#include "arch-ppc.h"
862 +
863 +const struct arch_def arch_def_ppc = {
864 + .token = SCMP_ARCH_PPC,
865 + .token_bpf = AUDIT_ARCH_PPC,
866 + .size = ARCH_SIZE_32,
867 + .endian = ARCH_ENDIAN_BIG,
868 +};
869 diff --git a/src/arch-ppc.h b/src/arch-ppc.h
870 new file mode 100644
871 index 0000000..627a168
872 --- /dev/null
873 +++ b/src/arch-ppc.h
874 @@ -0,0 +1,38 @@
875 +/**
876 + * Enhanced Seccomp PPC Specific Code
877 + *
878 + * Copyright (c) 2015 Freescale <bogdan.purcareata@freescale.com>
879 + * Author: Bogdan Purcareata <bogdan.purcareata@freescale.com>
880 + *
881 + */
882 +
883 +/*
884 + * This library is free software; you can redistribute it and/or modify it
885 + * under the terms of version 2.1 of the GNU Lesser General Public License as
886 + * published by the Free Software Foundation.
887 + *
888 + * This library is distributed in the hope that it will be useful, but WITHOUT
889 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
890 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
891 + * for more details.
892 + *
893 + * You should have received a copy of the GNU Lesser General Public License
894 + * along with this library; if not, see <http://www.gnu.org/licenses>.
895 + */
896 +
897 +#ifndef _ARCH_PPC_H
898 +#define _ARCH_PPC_H
899 +
900 +#include <inttypes.h>
901 +
902 +#include "arch.h"
903 +#include "system.h"
904 +
905 +extern const struct arch_def arch_def_ppc;
906 +
907 +int ppc_syscall_resolve_name(const char *name);
908 +const char *ppc_syscall_resolve_num(int num);
909 +
910 +const char *ppc_syscall_iterate_name(unsigned int spot);
911 +
912 +#endif
913 diff --git a/src/arch-ppc64-syscalls.c b/src/arch-ppc64-syscalls.c
914 new file mode 100644
915 index 0000000..1c2a1df
916 --- /dev/null
917 +++ b/src/arch-ppc64-syscalls.c
918 @@ -0,0 +1,504 @@
919 +/**
920 + * Enhanced Seccomp PPC64 Specific Code
921 + *
922 + * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
923 + * Author: Paul Moore <pmoore@redhat.com>
924 + *
925 + */
926 +
927 +/*
928 + * This library is free software; you can redistribute it and/or modify it
929 + * under the terms of version 2.1 of the GNU Lesser General Public License as
930 + * published by the Free Software Foundation.
931 + *
932 + * This library is distributed in the hope that it will be useful, but WITHOUT
933 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
934 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
935 + * for more details.
936 + *
937 + * You should have received a copy of the GNU Lesser General Public License
938 + * along with this library; if not, see <http://www.gnu.org/licenses>.
939 + */
940 +
941 +#include <string.h>
942 +
943 +#include <seccomp.h>
944 +
945 +#include "arch.h"
946 +#include "arch-ppc64.h"
947 +
948 +/* NOTE: based on Linux 3.19 */
949 +const struct arch_syscall_def ppc64_syscall_table[] = { \
950 + { "_llseek", 140 },
951 + { "_newselect", 142 },
952 + { "_sysctl", 149 },
953 + { "accept", 330 },
954 + { "accept4", 344 },
955 + { "access", 33 },
956 + { "acct", 51 },
957 + { "add_key", 269 },
958 + { "adjtimex", 124 },
959 + { "afs_syscall", 137 },
960 + { "alarm", 27 },
961 + { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
962 + { "arm_sync_file_range", __PNR_arm_sync_file_range },
963 + { "arch_prctl", __PNR_arch_prctl },
964 + { "bdflush", 134 },
965 + { "bind", 327 },
966 + { "bpf", 361 },
967 + { "break", 17 },
968 + { "brk", 45 },
969 + { "cachectl", __PNR_cachectl },
970 + { "cacheflush", __PNR_cacheflush },
971 + { "capget", 183 },
972 + { "capset", 184 },
973 + { "chdir", 12 },
974 + { "chmod", 15 },
975 + { "chown", 181 },
976 + { "chown32", __PNR_chown32 },
977 + { "chroot", 61 },
978 + { "clock_adjtime", 347 },
979 + { "clock_getres", 247 },
980 + { "clock_gettime", 246 },
981 + { "clock_nanosleep", 248 },
982 + { "clock_settime", 245 },
983 + { "clone", 120 },
984 + { "close", 6 },
985 + { "connect", 328 },
986 + { "creat", 8 },
987 + { "create_module", 127 },
988 + { "delete_module", 129 },
989 + { "dup", 41 },
990 + { "dup2", 63 },
991 + { "dup3", 316 },
992 + { "epoll_create", 236 },
993 + { "epoll_create1", 315 },
994 + { "epoll_ctl", 237 },
995 + { "epoll_ctl_old", __PNR_epoll_ctl_old },
996 + { "epoll_pwait", 303 },
997 + { "epoll_wait", 238 },
998 + { "epoll_wait_old", __PNR_epoll_wait_old },
999 + { "eventfd", 307 },
1000 + { "eventfd2", 314 },
1001 + { "execve", 11 },
1002 + { "execveat", 362 },
1003 + { "exit", 1 },
1004 + { "exit_group", 234 },
1005 + { "faccessat", 298 },
1006 + { "fadvise64", 233 },
1007 + { "fadvise64_64", __PNR_fadvise64_64 },
1008 + { "fallocate", 309 },
1009 + { "fanotify_init", 323 },
1010 + { "fanotify_mark", 324 },
1011 + { "fchdir", 133 },
1012 + { "fchmod", 94 },
1013 + { "fchmodat", 297 },
1014 + { "fchown", 95 },
1015 + { "fchown32", __PNR_fchown32 },
1016 + { "fchownat", 289 },
1017 + { "fcntl", 55 },
1018 + { "fcntl64", __PNR_fcntl64 },
1019 + { "fdatasync", 148 },
1020 + { "fgetxattr", 214 },
1021 + { "finit_module", 353 },
1022 + { "flistxattr", 217 },
1023 + { "flock", 143 },
1024 + { "fork", 2 },
1025 + { "fremovexattr", 220 },
1026 + { "fsetxattr", 211 },
1027 + { "fstat", 108 },
1028 + { "fstat64", __PNR_fstat64 },
1029 + { "fstatat64", __PNR_fstatat64 },
1030 + { "fstatfs", 100 },
1031 + { "fstatfs64", 253 },
1032 + { "fsync", 118 },
1033 + { "ftime", 35 },
1034 + { "ftruncate", 93 },
1035 + { "ftruncate64", __PNR_ftruncate64 },
1036 + { "futex", 221 },
1037 + { "futimesat", 290 },
1038 + { "get_kernel_syms", 130 },
1039 + { "get_mempolicy", 260 },
1040 + { "get_robust_list", 299 },
1041 + { "get_thread_area", __PNR_get_thread_area },
1042 + { "getcpu", 302 },
1043 + { "getcwd", 182 },
1044 + { "getdents", 141 },
1045 + { "getdents64", 202 },
1046 + { "getegid", 50 },
1047 + { "getegid32", __PNR_getegid32 },
1048 + { "geteuid", 49 },
1049 + { "geteuid32", __PNR_geteuid32 },
1050 + { "getgid", 47 },
1051 + { "getgid32", __PNR_getgid32 },
1052 + { "getgroups", 80 },
1053 + { "getgroups32", __PNR_getgroups32 },
1054 + { "getitimer", 105 },
1055 + { "getpeername", 332 },
1056 + { "getpgid", 132 },
1057 + { "getpgrp", 65 },
1058 + { "getpid", 20 },
1059 + { "getpmsg", 187 },
1060 + { "getppid", 64 },
1061 + { "getpriority", 96 },
1062 + { "getrandom", 359 },
1063 + { "getresgid", 170 },
1064 + { "getresgid32", __PNR_getresgid32 },
1065 + { "getresuid", 165 },
1066 + { "getresuid32", __PNR_getresuid32 },
1067 + { "getrlimit", 76 },
1068 + { "getrusage", 77 },
1069 + { "getsid", 147 },
1070 + { "getsockname", 331 },
1071 + { "getsockopt", 340 },
1072 + { "gettid", 207 },
1073 + { "gettimeofday", 78 },
1074 + { "getuid", 24 },
1075 + { "getuid32", __PNR_getuid32 },
1076 + { "getxattr", 212 },
1077 + { "gtty", 32 },
1078 + { "idle", 112 },
1079 + { "init_module", 128 },
1080 + { "inotify_add_watch", 276 },
1081 + { "inotify_init", 275 },
1082 + { "inotify_init1", 318 },
1083 + { "inotify_rm_watch", 277 },
1084 + { "io_cancel", 231 },
1085 + { "io_destroy", 228 },
1086 + { "io_getevents", 229 },
1087 + { "io_setup", 227 },
1088 + { "io_submit", 230 },
1089 + { "ioctl", 54 },
1090 + { "ioperm", 101 },
1091 + { "iopl", 110 },
1092 + { "ioprio_get", 274 },
1093 + { "ioprio_set", 273 },
1094 + { "ipc", 117 },
1095 + { "kcmp", 354 },
1096 + { "kexec_file_load", __PNR_kexec_file_load },
1097 + { "kexec_load", 268 },
1098 + { "keyctl", 271 },
1099 + { "kill", 37 },
1100 + { "lchown", 16 },
1101 + { "lchown32", __PNR_lchown32 },
1102 + { "lgetxattr", 213 },
1103 + { "link", 9 },
1104 + { "linkat", 294 },
1105 + { "listen", 329 },
1106 + { "listxattr", 215 },
1107 + { "llistxattr", 216 },
1108 + { "lock", 53 },
1109 + { "lookup_dcookie", 235 },
1110 + { "lremovexattr", 219 },
1111 + { "lseek", 19 },
1112 + { "lsetxattr", 210 },
1113 + { "lstat", 107 },
1114 + { "lstat64", __PNR_lstat64 },
1115 + { "madvise", 205 },
1116 + { "mbind", 259 },
1117 + { "memfd_create", 360 },
1118 + { "migrate_pages", 258 },
1119 + { "mincore", 206 },
1120 + { "mkdir", 39 },
1121 + { "mkdirat", 287 },
1122 + { "mknod", 14 },
1123 + { "mknodat", 288 },
1124 + { "mlock", 150 },
1125 + { "mlockall", 152 },
1126 + { "mmap", 90 },
1127 + { "mmap2", __PNR_mmap2 },
1128 + { "modify_ldt", 123 },
1129 + { "mount", 21 },
1130 + { "move_pages", 301 },
1131 + { "mprotect", 125 },
1132 + { "mpx", 56 },
1133 + { "mq_getsetattr", 267 },
1134 + { "mq_notify", 266 },
1135 + { "mq_open", 262 },
1136 + { "mq_timedreceive", 265 },
1137 + { "mq_timedsend", 264 },
1138 + { "mq_unlink", 263 },
1139 + { "mremap", 163 },
1140 + { "msgctl", __PNR_msgctl },
1141 + { "msgget", __PNR_msgget },
1142 + { "msgrcv", __PNR_msgrcv },
1143 + { "msgsnd", __PNR_msgsnd },
1144 + { "msync", 144 },
1145 + { "multiplexer", 201 },
1146 + { "munlock", 151 },
1147 + { "munlockall", 153 },
1148 + { "munmap", 91 },
1149 + { "name_to_handle_at", 345 },
1150 + { "nanosleep", 162 },
1151 + { "newfstatat", 291 },
1152 + { "nfsservctl", 168 },
1153 + { "nice", 34 },
1154 + { "oldfstat", 28 },
1155 + { "oldlstat", 84 },
1156 + { "oldolduname", 59 },
1157 + { "oldstat", 18 },
1158 + { "olduname", 109 },
1159 + { "oldwait4", __PNR_oldwait4 },
1160 + { "open", 5 },
1161 + { "open_by_handle_at", 346 },
1162 + { "openat", 286 },
1163 + { "pause", 29 },
1164 + { "pciconfig_iobase", 200 },
1165 + { "pciconfig_read", 198 },
1166 + { "pciconfig_write", 199 },
1167 + { "perf_event_open", 319 },
1168 + { "personality", 136 },
1169 + { "pipe", 42 },
1170 + { "pipe2", 317 },
1171 + { "pivot_root", 203 },
1172 + { "poll", 167 },
1173 + { "ppoll", 281 },
1174 + { "prctl", 171 },
1175 + { "pread64", 179 },
1176 + { "preadv", 320 },
1177 + { "prlimit64", 325 },
1178 + { "process_vm_readv", 351 },
1179 + { "process_vm_writev", 352 },
1180 + { "prof", 44 },
1181 + { "profil", 98 },
1182 + { "pselect6", 280 },
1183 + { "ptrace", 26 },
1184 + { "putpmsg", 188 },
1185 + { "pwrite64", 180 },
1186 + { "pwritev", 321 },
1187 + { "query_module", 166 },
1188 + { "quotactl", 131 },
1189 + { "read", 3 },
1190 + { "readahead", 191 },
1191 + { "readdir", 89 },
1192 + { "readlink", 85 },
1193 + { "readlinkat", 296 },
1194 + { "readv", 145 },
1195 + { "reboot", 88 },
1196 + { "recv", 336 },
1197 + { "recvfrom", 337 },
1198 + { "recvmmsg", 343 },
1199 + { "recvmsg", 342 },
1200 + { "remap_file_pages", 239 },
1201 + { "removexattr", 218 },
1202 + { "rename", 38 },
1203 + { "renameat", 293 },
1204 + { "renameat2", 357 },
1205 + { "request_key", 270 },
1206 + { "restart_syscall", 0 },
1207 + { "rmdir", 40 },
1208 + { "rt_sigaction", 173 },
1209 + { "rt_sigpending", 175 },
1210 + { "rt_sigprocmask", 174 },
1211 + { "rt_sigqueueinfo", 177 },
1212 + { "rt_sigreturn", 172 },
1213 + { "rt_sigsuspend", 178 },
1214 + { "rt_sigtimedwait", 176 },
1215 + { "rt_tgsigqueueinfo", 322 },
1216 + { "rtas", 255 },
1217 + { "sched_get_priority_max", 159 },
1218 + { "sched_get_priority_min", 160 },
1219 + { "sched_getaffinity", 223 },
1220 + { "sched_getattr", 356 },
1221 + { "sched_getparam", 155 },
1222 + { "sched_getscheduler", 157 },
1223 + { "sched_rr_get_interval", 161 },
1224 + { "sched_setaffinity", 222 },
1225 + { "sched_setattr", 355 },
1226 + { "sched_setparam", 154 },
1227 + { "sched_setscheduler", 156 },
1228 + { "sched_yield", 158 },
1229 + { "seccomp", 358 },
1230 + { "security", __PNR_security },
1231 + { "select", 82 },
1232 + { "semctl", __PNR_semctl },
1233 + { "semget", __PNR_semget },
1234 + { "semop", __PNR_semop },
1235 + { "semtimedop", __PNR_semtimedop },
1236 + { "send", 334 },
1237 + { "sendfile", 186 },
1238 + { "sendfile64", __PNR_sendfile64 },
1239 + { "sendmmsg", 349 },
1240 + { "sendmsg", 341 },
1241 + { "sendto", 335 },
1242 + { "set_mempolicy", 261 },
1243 + { "set_robust_list", 300 },
1244 + { "set_thread_area", __PNR_set_thread_area },
1245 + { "set_tid_address", 232 },
1246 + { "setdomainname", 121 },
1247 + { "setfsgid", 139 },
1248 + { "setfsgid32", __PNR_setfsgid32 },
1249 + { "setfsuid", 138 },
1250 + { "setfsuid32", __PNR_setfsuid32 },
1251 + { "setgid", 46 },
1252 + { "setgid32", __PNR_setgid32 },
1253 + { "setgroups", 81 },
1254 + { "setgroups32", __PNR_setgroups32 },
1255 + { "sethostname", 74 },
1256 + { "setitimer", 104 },
1257 + { "setns", 350 },
1258 + { "setpgid", 57 },
1259 + { "setpriority", 97 },
1260 + { "setregid", 71 },
1261 + { "setregid32", __PNR_setregid32 },
1262 + { "setresgid", 169 },
1263 + { "setresgid32", __PNR_setresgid32 },
1264 + { "setresuid", 164 },
1265 + { "setresuid32", __PNR_setresuid32 },
1266 + { "setreuid", 70 },
1267 + { "setreuid32", __PNR_setreuid32 },
1268 + { "setrlimit", 75 },
1269 + { "setsid", 66 },
1270 + { "setsockopt", 339 },
1271 + { "settimeofday", 79 },
1272 + { "setuid", 23 },
1273 + { "setuid32", __PNR_setuid32 },
1274 + { "setxattr", 209 },
1275 + { "sgetmask", 68 },
1276 + { "shmat", __PNR_shmat },
1277 + { "shmctl", __PNR_shmctl },
1278 + { "shmdt", __PNR_shmdt },
1279 + { "shmget", __PNR_shmget },
1280 + { "shutdown", 338 },
1281 + { "sigaction", 67 },
1282 + { "sigaltstack", 185 },
1283 + { "signal", 48 },
1284 + { "signalfd", 305 },
1285 + { "signalfd4", 313 },
1286 + { "sigpending", 73 },
1287 + { "sigprocmask", 126 },
1288 + { "sigreturn", 119 },
1289 + { "sigsuspend", 72 },
1290 + { "socket", 326 },
1291 + { "socketcall", 102 },
1292 + { "socketpair", 333 },
1293 + { "splice", 283 },
1294 + { "spu_create", 279 },
1295 + { "spu_run", 278 },
1296 + { "ssetmask", 69 },
1297 + { "stat", 106 },
1298 + { "stat64", __PNR_stat64 },
1299 + { "statfs", 99 },
1300 + { "statfs64", 252 },
1301 + { "stime", 25 },
1302 + { "stty", 31 },
1303 + { "subpage_prot", 310 },
1304 + { "swapcontext", 249 },
1305 + { "swapoff", 115 },
1306 + { "swapon", 87 },
1307 + { "symlink", 83 },
1308 + { "symlinkat", 295 },
1309 + { "sync", 36 },
1310 + { "sync_file_range", __PNR_sync_file_range },
1311 + { "sync_file_range2", 308 },
1312 + { "syncfs", 348 },
1313 + { "syscall", __PNR_syscall },
1314 + { "sys_debug_setcontext", 256 },
1315 + { "sysfs", 135 },
1316 + { "sysinfo", 116 },
1317 + { "syslog", 103 },
1318 + { "sysmips", __PNR_sysmips },
1319 + { "tee", 284 },
1320 + { "tgkill", 250 },
1321 + { "time", 13 },
1322 + { "timer_create", 240 },
1323 + { "timer_delete", 244 },
1324 + { "timer_getoverrun", 243 },
1325 + { "timer_gettime", 242 },
1326 + { "timer_settime", 241 },
1327 + { "timerfd", __PNR_timerfd },
1328 + { "timerfd_create", 306 },
1329 + { "timerfd_gettime", 312 },
1330 + { "timerfd_settime", 311 },
1331 + { "times", 43 },
1332 + { "tkill", 208 },
1333 + { "truncate", 92 },
1334 + { "truncate64", __PNR_truncate64 },
1335 + { "tuxcall", 225 },
1336 + { "ugetrlimit", 190 },
1337 + { "ulimit", 58 },
1338 + { "umask", 60 },
1339 + { "umount", 22 },
1340 + { "umount2", 52 },
1341 + { "uname", 122 },
1342 + { "unlink", 10 },
1343 + { "unlinkat", 292 },
1344 + { "unshare", 282 },
1345 + { "uselib", 86 },
1346 + { "ustat", 62 },
1347 + { "utime", 30 },
1348 + { "utimensat", 304 },
1349 + { "utimes", 251 },
1350 + { "vfork", 189 },
1351 + { "vhangup", 111 },
1352 + { "vm86", 113 },
1353 + { "vm86old", __PNR_vm86old },
1354 + { "vmsplice", 285 },
1355 + { "vserver", __PNR_vserver },
1356 + { "wait4", 114 },
1357 + { "waitid", 272 },
1358 + { "waitpid", 7 },
1359 + { "write", 4 },
1360 + { "writev", 146 },
1361 + { NULL, __NR_SCMP_ERROR },
1362 +};
1363 +
1364 +/**
1365 + * Resolve a syscall name to a number
1366 + * @param name the syscall name
1367 + *
1368 + * Resolve the given syscall name to the syscall number using the syscall table.
1369 + * Returns the syscall number on success, including negative pseudo syscall
1370 + * numbers; returns __NR_SCMP_ERROR on failure.
1371 + *
1372 + */
1373 +int ppc64_syscall_resolve_name(const char *name)
1374 +{
1375 + unsigned int iter;
1376 + const struct arch_syscall_def *table = ppc64_syscall_table;
1377 +
1378 + /* XXX - plenty of room for future improvement here */
1379 + for (iter = 0; table[iter].name != NULL; iter++) {
1380 + if (strcmp(name, table[iter].name) == 0)
1381 + return table[iter].num;
1382 + }
1383 +
1384 + return __NR_SCMP_ERROR;
1385 +}
1386 +
1387 +/**
1388 + * Resolve a syscall number to a name
1389 + * @param num the syscall number
1390 + *
1391 + * Resolve the given syscall number to the syscall name using the syscall table.
1392 + * Returns a pointer to the syscall name string on success, including pseudo
1393 + * syscall names; returns NULL on failure.
1394 + *
1395 + */
1396 +const char *ppc64_syscall_resolve_num(int num)
1397 +{
1398 + unsigned int iter;
1399 + const struct arch_syscall_def *table = ppc64_syscall_table;
1400 +
1401 + /* XXX - plenty of room for future improvement here */
1402 + for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
1403 + if (num == table[iter].num)
1404 + return table[iter].name;
1405 + }
1406 +
1407 + return NULL;
1408 +}
1409 +
1410 +/**
1411 + * Iterate through the syscall table and return the syscall name
1412 + * @param spot the offset into the syscall table
1413 + *
1414 + * Return the syscall name at position @spot or NULL on failure. This function
1415 + * should only ever be used internally by libseccomp.
1416 + *
1417 + */
1418 +const char *ppc64_syscall_iterate_name(unsigned int spot)
1419 +{
1420 + /* XXX - no safety checks here */
1421 + return ppc64_syscall_table[spot].name;
1422 +}
1423 diff --git a/src/arch-ppc64.c b/src/arch-ppc64.c
1424 new file mode 100644
1425 index 0000000..5f461cb
1426 --- /dev/null
1427 +++ b/src/arch-ppc64.c
1428 @@ -0,0 +1,40 @@
1429 +/**
1430 + * Enhanced Seccomp PPC64 Specific Code
1431 + *
1432 + * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
1433 + * Author: Paul Moore <pmoore@redhat.com>
1434 + *
1435 + */
1436 +
1437 +/*
1438 + * This library is free software; you can redistribute it and/or modify it
1439 + * under the terms of version 2.1 of the GNU Lesser General Public License as
1440 + * published by the Free Software Foundation.
1441 + *
1442 + * This library is distributed in the hope that it will be useful, but WITHOUT
1443 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1444 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
1445 + * for more details.
1446 + *
1447 + * You should have received a copy of the GNU Lesser General Public License
1448 + * along with this library; if not, see <http://www.gnu.org/licenses>.
1449 + */
1450 +
1451 +#include <linux/audit.h>
1452 +
1453 +#include "arch.h"
1454 +#include "arch-ppc64.h"
1455 +
1456 +const struct arch_def arch_def_ppc64 = {
1457 + .token = SCMP_ARCH_PPC64,
1458 + .token_bpf = AUDIT_ARCH_PPC64,
1459 + .size = ARCH_SIZE_64,
1460 + .endian = ARCH_ENDIAN_BIG,
1461 +};
1462 +
1463 +const struct arch_def arch_def_ppc64le = {
1464 + .token = SCMP_ARCH_PPC64LE,
1465 + .token_bpf = AUDIT_ARCH_PPC64LE,
1466 + .size = ARCH_SIZE_64,
1467 + .endian = ARCH_ENDIAN_LITTLE,
1468 +};
1469 diff --git a/src/arch-ppc64.h b/src/arch-ppc64.h
1470 new file mode 100644
1471 index 0000000..1aec743
1472 --- /dev/null
1473 +++ b/src/arch-ppc64.h
1474 @@ -0,0 +1,39 @@
1475 +/**
1476 + * Enhanced Seccomp PPC64 Specific Code
1477 + *
1478 + * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
1479 + * Author: Paul Moore <pmoore@redhat.com>
1480 + *
1481 + */
1482 +
1483 +/*
1484 + * This library is free software; you can redistribute it and/or modify it
1485 + * under the terms of version 2.1 of the GNU Lesser General Public License as
1486 + * published by the Free Software Foundation.
1487 + *
1488 + * This library is distributed in the hope that it will be useful, but WITHOUT
1489 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1490 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
1491 + * for more details.
1492 + *
1493 + * You should have received a copy of the GNU Lesser General Public License
1494 + * along with this library; if not, see <http://www.gnu.org/licenses>.
1495 + */
1496 +
1497 +#ifndef _ARCH_PPC64_H
1498 +#define _ARCH_PPC64_H
1499 +
1500 +#include <inttypes.h>
1501 +
1502 +#include "arch.h"
1503 +#include "system.h"
1504 +
1505 +extern const struct arch_def arch_def_ppc64;
1506 +extern const struct arch_def arch_def_ppc64le;
1507 +
1508 +int ppc64_syscall_resolve_name(const char *name);
1509 +const char *ppc64_syscall_resolve_num(int num);
1510 +
1511 +const char *ppc64_syscall_iterate_name(unsigned int spot);
1512 +
1513 +#endif
1514 diff --git a/src/arch-syscall-check.c b/src/arch-syscall-check.c
1515 index a074c9d..8682483 100644
1516 --- a/src/arch-syscall-check.c
1517 +++ b/src/arch-syscall-check.c
1518 @@ -33,6 +33,8 @@
1519 #include "arch-mips.h"
1520 #include "arch-mips64.h"
1521 #include "arch-mips64n32.h"
1522 +#include "arch-ppc64.h"
1523 +#include "arch-ppc.h"
1524
1525 /**
1526 * compare the syscall values
1527 @@ -67,6 +69,8 @@ int main(int argc, char *argv[])
1528 int i_mips = 0;
1529 int i_mips64 = 0;
1530 int i_mips64n32 = 0;
1531 + int i_ppc64 = 0;
1532 + int i_ppc = 0;
1533 const char *sys_name;
1534 char str_miss[256];
1535
1536 @@ -93,6 +97,10 @@ int main(int argc, char *argv[])
1537 mips64_syscall_iterate_name(i_mips64));
1538 syscall_check(str_miss, sys_name, "mips64n32",
1539 mips64n32_syscall_iterate_name(i_mips64n32));
1540 + syscall_check(str_miss, sys_name, "ppc64",
1541 + ppc64_syscall_iterate_name(i_ppc64));
1542 + syscall_check(str_miss, sys_name, "ppc",
1543 + ppc_syscall_iterate_name(i_ppc));
1544
1545 /* output the results */
1546 printf("%s: ", sys_name);
1547 @@ -111,17 +119,22 @@ int main(int argc, char *argv[])
1548 i_x32 = -1;
1549 if (!arm_syscall_iterate_name(++i_arm))
1550 i_arm = -1;
1551 + if (!aarch64_syscall_iterate_name(++i_aarch64))
1552 + i_aarch64 = -1;
1553 if (!mips_syscall_iterate_name(++i_mips))
1554 i_mips = -1;
1555 if (!mips64_syscall_iterate_name(++i_mips64))
1556 i_mips64 = -1;
1557 if (!mips64n32_syscall_iterate_name(++i_mips64n32))
1558 i_mips64n32 = -1;
1559 - if (!aarch64_syscall_iterate_name(++i_aarch64))
1560 - i_aarch64 = -1;
1561 + if (!ppc64_syscall_iterate_name(++i_ppc64))
1562 + i_ppc64 = -1;
1563 + if (!ppc_syscall_iterate_name(++i_ppc))
1564 + i_ppc = -1;
1565 } while (i_x86_64 >= 0 && i_x32 >= 0 &&
1566 i_arm >= 0 && i_aarch64 >= 0 &&
1567 - i_mips >= 0 && i_mips64 >= 0 && i_mips64n32 >= 0);
1568 + i_mips >= 0 && i_mips64 >= 0 && i_mips64n32 >= 0 &&
1569 + i_ppc64 >= 0 && i_ppc >= 0);
1570
1571 /* check for any leftovers */
1572 sys_name = x86_syscall_iterate_name(i_x86 + 1);
1573 @@ -164,6 +177,16 @@ int main(int argc, char *argv[])
1574 mips64n32_syscall_iterate_name(i_mips64n32));
1575 return 1;
1576 }
1577 + if (i_ppc64 >= 0) {
1578 + printf("%s: ERROR, ppc64 has additional syscalls\n",
1579 + ppc64_syscall_iterate_name(i_ppc64));
1580 + return 1;
1581 + }
1582 + if (i_ppc >= 0) {
1583 + printf("%s: ERROR, ppc has additional syscalls\n",
1584 + ppc_syscall_iterate_name(i_ppc));
1585 + return 1;
1586 + }
1587
1588 /* if we made it here, all is good */
1589 return 0;
1590 diff --git a/src/arch-syscall-dump.c b/src/arch-syscall-dump.c
1591 index 4f53070..62992e7 100644
1592 --- a/src/arch-syscall-dump.c
1593 +++ b/src/arch-syscall-dump.c
1594 @@ -38,6 +38,8 @@
1595 #include "arch-mips64.h"
1596 #include "arch-mips64n32.h"
1597 #include "arch-aarch64.h"
1598 +#include "arch-ppc64.h"
1599 +#include "arch-ppc.h"
1600
1601 /**
1602 * Print the usage information to stderr and exit
1603 @@ -97,6 +99,9 @@ int main(int argc, char *argv[])
1604 case SCMP_ARCH_ARM:
1605 sys_name = arm_syscall_iterate_name(iter);
1606 break;
1607 + case SCMP_ARCH_AARCH64:
1608 + sys_name = aarch64_syscall_iterate_name(iter);
1609 + break;
1610 case SCMP_ARCH_MIPS:
1611 case SCMP_ARCH_MIPSEL:
1612 sys_name = mips_syscall_iterate_name(iter);
1613 @@ -109,9 +114,13 @@ int main(int argc, char *argv[])
1614 case SCMP_ARCH_MIPSEL64N32:
1615 sys_name = mips64n32_syscall_iterate_name(iter);
1616 break;
1617 - case SCMP_ARCH_AARCH64:
1618 - sys_name = aarch64_syscall_iterate_name(iter);
1619 + case SCMP_ARCH_PPC64:
1620 + sys_name = ppc64_syscall_iterate_name(iter);
1621 + break;
1622 + case SCMP_ARCH_PPC:
1623 + sys_name = ppc_syscall_iterate_name(iter);
1624 break;
1625 +
1626 default:
1627 /* invalid arch */
1628 exit_usage(argv[0]);
1629 diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate
1630 index 7cf7b8b..ba5cd89 100755
1631 --- a/src/arch-syscall-validate
1632 +++ b/src/arch-syscall-validate
1633 @@ -319,6 +319,52 @@ function dump_lib_mips64n32() {
1634 }
1635
1636 #
1637 +# Dump the ppc64 system syscall table
1638 +#
1639 +# Arguments:
1640 +# 1 path to the kernel source
1641 +#
1642 +# Dump the architecture's syscall table to stdout.
1643 +#
1644 +function dump_sys_ppc64() {
1645 + gcc -E -dM -D__powerpc64__ $1/arch/powerpc/include/uapi/asm/unistd.h | \
1646 + grep "^#define __NR_" | sort | \
1647 + sed -e 's/#define[ \t]\+__NR_\([a-z0-9_]\+\)[ \t]\+\([0-9]\+\)/\1\t\2/'
1648 +}
1649 +
1650 +#
1651 +# Dump the ppc64 library syscall table
1652 +#
1653 +# Dump the library's syscall table to stdout.
1654 +#
1655 +function dump_lib_ppc64() {
1656 + $LIB_SYS_DUMP -a ppc64 | sed -e '/[^\t]\+\t-[0-9]\+/d'
1657 +}
1658 +
1659 +#
1660 +# Dump the ppc system syscall table
1661 +#
1662 +# Arguments:
1663 +# 1 path to the kernel source
1664 +#
1665 +# Dump the architecture's syscall table to stdout.
1666 +#
1667 +function dump_sys_ppc() {
1668 + gcc -E -dM $1/arch/powerpc/include/uapi/asm/unistd.h | \
1669 + grep "^#define __NR_" | sort | \
1670 + sed -e 's/#define[ \t]\+__NR_\([a-z0-9_]\+\)[ \t]\+\([0-9]\+\)/\1\t\2/'
1671 +}
1672 +
1673 +#
1674 +# Dump the ppc library syscall table
1675 +#
1676 +# Dump the library's syscall table to stdout.
1677 +#
1678 +function dump_lib_ppc() {
1679 + $LIB_SYS_DUMP -a ppc | sed -e '/[^\t]\+\t-[0-9]\+/d'
1680 +}
1681 +
1682 +#
1683 # Dump the system syscall table
1684 #
1685 # Arguments:
1686 @@ -353,6 +399,12 @@ function dump_sys() {
1687 mips64n32)
1688 dump_sys_mips64n32 "$2"
1689 ;;
1690 + ppc64)
1691 + dump_sys_ppc64 "$2"
1692 + ;;
1693 + ppc)
1694 + dump_sys_ppc "$2"
1695 + ;;
1696 *)
1697 echo ""
1698 ;;
1699 @@ -393,6 +445,12 @@ function dump_lib() {
1700 mips64n32)
1701 dump_lib_mips64n32 "$2"
1702 ;;
1703 + ppc64)
1704 + dump_lib_ppc64 "$2"
1705 + ;;
1706 + ppc)
1707 + dump_lib_ppc "$2"
1708 + ;;
1709 *)
1710 echo ""
1711 ;;
1712 @@ -439,7 +497,7 @@ shift $(($OPTIND - 1))
1713
1714 # defaults
1715 if [[ $arches == "" ]]; then
1716 - arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32"
1717 + arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32 ppc pcc64"
1718 fi
1719
1720 # sanity checks
1721 diff --git a/src/arch-x32-syscalls.c b/src/arch-x32-syscalls.c
1722 index dc4af60..a0b4247 100644
1723 --- a/src/arch-x32-syscalls.c
1724 +++ b/src/arch-x32-syscalls.c
1725 @@ -224,6 +224,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1726 { "msgrcv", (X32_SYSCALL_BIT + 70) },
1727 { "msgsnd", (X32_SYSCALL_BIT + 69) },
1728 { "msync", (X32_SYSCALL_BIT + 26) },
1729 + { "multiplexer", __PNR_multiplexer },
1730 { "munlock", (X32_SYSCALL_BIT + 150) },
1731 { "munlockall", (X32_SYSCALL_BIT + 152) },
1732 { "munmap", (X32_SYSCALL_BIT + 11) },
1733 @@ -294,6 +295,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1734 { "rt_sigsuspend", (X32_SYSCALL_BIT + 130) },
1735 { "rt_sigtimedwait", (X32_SYSCALL_BIT + 523) },
1736 { "rt_tgsigqueueinfo", (X32_SYSCALL_BIT + 536) },
1737 + { "rtas", __PNR_rtas },
1738 { "sched_get_priority_max", (X32_SYSCALL_BIT + 146) },
1739 { "sched_get_priority_min", (X32_SYSCALL_BIT + 147) },
1740 { "sched_getaffinity", (X32_SYSCALL_BIT + 204) },
1741 @@ -372,6 +374,8 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1742 { "socketcall", __PNR_socketcall },
1743 { "socketpair", (X32_SYSCALL_BIT + 53) },
1744 { "splice", (X32_SYSCALL_BIT + 275) },
1745 + { "spu_create", __PNR_spu_create },
1746 + { "spu_run", __PNR_spu_run },
1747 { "ssetmask", __PNR_ssetmask },
1748 { "stat", (X32_SYSCALL_BIT + 4) },
1749 { "stat64", __PNR_stat64 },
1750 @@ -379,6 +383,8 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1751 { "statfs64", __PNR_statfs64 },
1752 { "stime", __PNR_stime },
1753 { "stty", __PNR_stty },
1754 + { "subpage_prot", __PNR_subpage_prot },
1755 + { "swapcontext", __PNR_swapcontext },
1756 { "swapoff", (X32_SYSCALL_BIT + 168) },
1757 { "swapon", (X32_SYSCALL_BIT + 167) },
1758 { "symlink", (X32_SYSCALL_BIT + 88) },
1759 @@ -388,6 +394,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1760 { "sync_file_range2", __PNR_sync_file_range2 },
1761 { "syncfs", (X32_SYSCALL_BIT + 306) },
1762 { "syscall", __PNR_syscall },
1763 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
1764 { "sysfs", (X32_SYSCALL_BIT + 139) },
1765 { "sysinfo", (X32_SYSCALL_BIT + 99) },
1766 { "syslog", (X32_SYSCALL_BIT + 103) },
1767 diff --git a/src/arch-x86-syscalls.c b/src/arch-x86-syscalls.c
1768 index 1669289..d27a4d1 100644
1769 --- a/src/arch-x86-syscalls.c
1770 +++ b/src/arch-x86-syscalls.c
1771 @@ -224,6 +224,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1772 { "msgrcv", __PNR_msgrcv },
1773 { "msgsnd", __PNR_msgsnd },
1774 { "msync", 144 },
1775 + { "multiplexer", __PNR_multiplexer },
1776 { "munlock", 151 },
1777 { "munlockall", 153 },
1778 { "munmap", 91 },
1779 @@ -294,6 +295,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1780 { "rt_sigsuspend", 179 },
1781 { "rt_sigtimedwait", 177 },
1782 { "rt_tgsigqueueinfo", 335 },
1783 + { "rtas", __PNR_rtas },
1784 { "sched_get_priority_max", 159 },
1785 { "sched_get_priority_min", 160 },
1786 { "sched_getaffinity", 242 },
1787 @@ -372,6 +374,8 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1788 { "socketcall", 102 },
1789 { "socketpair", __PNR_socketpair },
1790 { "splice", 313 },
1791 + { "spu_create", __PNR_spu_create },
1792 + { "spu_run", __PNR_spu_run },
1793 { "ssetmask", 69 },
1794 { "stat", 106 },
1795 { "stat64", 195 },
1796 @@ -379,6 +383,8 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1797 { "statfs64", 268 },
1798 { "stime", 25 },
1799 { "stty", 31 },
1800 + { "subpage_prot", __PNR_subpage_prot },
1801 + { "swapcontext", __PNR_swapcontext },
1802 { "swapoff", 115 },
1803 { "swapon", 87 },
1804 { "symlink", 83 },
1805 @@ -388,6 +394,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1806 { "sync_file_range2", __PNR_sync_file_range2 },
1807 { "syncfs", 344 },
1808 { "syscall", __PNR_syscall },
1809 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
1810 { "sysfs", 135 },
1811 { "sysinfo", 116 },
1812 { "syslog", 103 },
1813 diff --git a/src/arch-x86_64-syscalls.c b/src/arch-x86_64-syscalls.c
1814 index 96ca210..cd9eb6d 100644
1815 --- a/src/arch-x86_64-syscalls.c
1816 +++ b/src/arch-x86_64-syscalls.c
1817 @@ -224,6 +224,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1818 { "msgrcv", 70 },
1819 { "msgsnd", 69 },
1820 { "msync", 26 },
1821 + { "multiplexer", __PNR_multiplexer },
1822 { "munlock", 150 },
1823 { "munlockall", 152 },
1824 { "munmap", 11 },
1825 @@ -294,6 +295,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1826 { "rt_sigsuspend", 130 },
1827 { "rt_sigtimedwait", 128 },
1828 { "rt_tgsigqueueinfo", 297 },
1829 + { "rtas", __PNR_rtas },
1830 { "sched_get_priority_max", 146 },
1831 { "sched_get_priority_min", 147 },
1832 { "sched_getaffinity", 204 },
1833 @@ -372,6 +374,8 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1834 { "socketcall", __PNR_socketcall },
1835 { "socketpair", 53 },
1836 { "splice", 275 },
1837 + { "spu_create", __PNR_spu_create },
1838 + { "spu_run", __PNR_spu_run },
1839 { "ssetmask", __PNR_ssetmask },
1840 { "stat", 4 },
1841 { "stat64", __PNR_stat64 },
1842 @@ -379,6 +383,8 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1843 { "statfs64", __PNR_statfs64 },
1844 { "stime", __PNR_stime },
1845 { "stty", __PNR_stty },
1846 + { "subpage_prot", __PNR_subpage_prot },
1847 + { "swapcontext", __PNR_swapcontext },
1848 { "swapoff", 168 },
1849 { "swapon", 167 },
1850 { "symlink", 88 },
1851 @@ -388,6 +394,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1852 { "sync_file_range2", __PNR_sync_file_range2 },
1853 { "syncfs", 306 },
1854 { "syscall", __PNR_syscall },
1855 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
1856 { "sysfs", 139 },
1857 { "sysinfo", 99 },
1858 { "syslog", 103 },
1859 diff --git a/src/arch.c b/src/arch.c
1860 index 9681115..25d1ff6 100644
1861 --- a/src/arch.c
1862 +++ b/src/arch.c
1863 @@ -38,6 +38,8 @@
1864 #include "arch-mips.h"
1865 #include "arch-mips64.h"
1866 #include "arch-mips64n32.h"
1867 +#include "arch-ppc64.h"
1868 +#include "arch-ppc.h"
1869 #include "system.h"
1870
1871 #define default_arg_count_max 6
1872 @@ -74,6 +76,14 @@ const struct arch_def *arch_def_native = &arch_def_mips64n32;
1873 #elif __MIPSEL__
1874 const struct arch_def *arch_def_native = &arch_def_mipsel64n32;
1875 #endif /* _MIPS_SIM_NABI32 */
1876 +#elif __PPC64__
1877 +#ifdef __BIG_ENDIAN__
1878 +const struct arch_def *arch_def_native = &arch_def_ppc64;
1879 +#else
1880 +const struct arch_def *arch_def_native = &arch_def_ppc64le;
1881 +#endif
1882 +#elif __PPC__
1883 +const struct arch_def *arch_def_native = &arch_def_ppc;
1884 #else
1885 #error the arch code needs to know about your machine type
1886 #endif /* machine type guess */
1887 @@ -122,6 +132,12 @@ const struct arch_def *arch_def_lookup(uint32_t token)
1888 return &arch_def_mips64n32;
1889 case SCMP_ARCH_MIPSEL64N32:
1890 return &arch_def_mipsel64n32;
1891 + case SCMP_ARCH_PPC64:
1892 + return &arch_def_ppc64;
1893 + case SCMP_ARCH_PPC64LE:
1894 + return &arch_def_ppc64le;
1895 + case SCMP_ARCH_PPC:
1896 + return &arch_def_ppc;
1897 }
1898
1899 return NULL;
1900 @@ -158,6 +174,12 @@ const struct arch_def *arch_def_lookup_name(const char *arch_name)
1901 return &arch_def_mips64n32;
1902 else if (strcmp(arch_name, "mipsel64n32") == 0)
1903 return &arch_def_mipsel64n32;
1904 + else if (strcmp(arch_name, "ppc64") == 0)
1905 + return &arch_def_ppc64;
1906 + else if (strcmp(arch_name, "ppc64le") == 0)
1907 + return &arch_def_ppc64le;
1908 + else if (strcmp(arch_name, "ppc") == 0)
1909 + return &arch_def_ppc;
1910
1911 return NULL;
1912 }
1913 @@ -276,6 +298,11 @@ int arch_syscall_resolve_name(const struct arch_def *arch, const char *name)
1914 case SCMP_ARCH_MIPS64N32:
1915 case SCMP_ARCH_MIPSEL64N32:
1916 return mips64n32_syscall_resolve_name(name);
1917 + case SCMP_ARCH_PPC64:
1918 + case SCMP_ARCH_PPC64LE:
1919 + return ppc64_syscall_resolve_name(name);
1920 + case SCMP_ARCH_PPC:
1921 + return ppc_syscall_resolve_name(name);
1922 }
1923
1924 return __NR_SCMP_ERROR;
1925 @@ -313,6 +340,11 @@ const char *arch_syscall_resolve_num(const struct arch_def *arch, int num)
1926 case SCMP_ARCH_MIPS64N32:
1927 case SCMP_ARCH_MIPSEL64N32:
1928 return mips64n32_syscall_resolve_num(num);
1929 + case SCMP_ARCH_PPC64:
1930 + case SCMP_ARCH_PPC64LE:
1931 + return ppc64_syscall_resolve_num(num);
1932 + case SCMP_ARCH_PPC:
1933 + return ppc_syscall_resolve_num(num);
1934 }
1935
1936 return NULL;
1937 diff --git a/src/python/libseccomp.pxd b/src/python/libseccomp.pxd
1938 index 2b50f3f..e9c0f6a 100644
1939 --- a/src/python/libseccomp.pxd
1940 +++ b/src/python/libseccomp.pxd
1941 @@ -38,6 +38,9 @@ cdef extern from "seccomp.h":
1942 SCMP_ARCH_MIPSEL
1943 SCMP_ARCH_MIPSEL64
1944 SCMP_ARCH_MIPSEL64N32
1945 + SCMP_ARCH_PPC64
1946 + SCMP_ARCH_PPC64LE
1947 + SCMP_ARCH_PPC
1948
1949 cdef enum scmp_filter_attr:
1950 SCMP_FLTATR_ACT_DEFAULT
1951 diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx
1952 index 686f7d2..18360a7 100644
1953 --- a/src/python/seccomp.pyx
1954 +++ b/src/python/seccomp.pyx
1955 @@ -147,6 +147,8 @@ cdef class Arch:
1956 MIPSEL - MIPS little endian O32 ABI
1957 MIPSEL64 - MIPS little endian 64-bit ABI
1958 MIPSEL64N32 - MIPS little endian N32 ABI
1959 + PPC64 - 64-bit PowerPC
1960 + PPC - 32-bit PowerPC
1961 """
1962
1963 cdef int _token
1964 @@ -163,6 +165,9 @@ cdef class Arch:
1965 MIPSEL = libseccomp.SCMP_ARCH_MIPSEL
1966 MIPSEL64 = libseccomp.SCMP_ARCH_MIPSEL64
1967 MIPSEL64N32 = libseccomp.SCMP_ARCH_MIPSEL64N32
1968 + PPC64 = libseccomp.SCMP_ARCH_PPC64
1969 + PPC64LE = libseccomp.SCMP_ARCH_PPC64LE
1970 + PPC = libseccomp.SCMP_ARCH_PPC
1971
1972 def __cinit__(self, arch=libseccomp.SCMP_ARCH_NATIVE):
1973 """ Initialize the architecture object.
1974 @@ -198,6 +203,12 @@ cdef class Arch:
1975 self._token = libseccomp.SCMP_ARCH_MIPSEL64
1976 elif arch == libseccomp.SCMP_ARCH_MIPSEL64N32:
1977 self._token = libseccomp.SCMP_ARCH_MIPSEL64N32
1978 + elif arch == libseccomp.SCMP_ARCH_PPC64:
1979 + self._token = libseccomp.SCMP_ARCH_PPC64
1980 + elif arch == libseccomp.SCMP_ARCH_PPC64LE:
1981 + self._token = libseccomp.SCMP_ARCH_PPC64LE
1982 + elif arch == libseccomp.SCMP_ARCH_PPC:
1983 + self._token = libseccomp.SCMP_ARCH_PPC
1984 else:
1985 self._token = 0;
1986 elif isinstance(arch, basestring):
1987 diff --git a/tests/16-sim-arch_basic.c b/tests/16-sim-arch_basic.c
1988 index 9771913..09df44b 100644
1989 --- a/tests/16-sim-arch_basic.c
1990 +++ b/tests/16-sim-arch_basic.c
1991 @@ -68,6 +68,9 @@ int main(int argc, char *argv[])
1992 rc = seccomp_arch_add(ctx, SCMP_ARCH_MIPSEL64N32);
1993 if (rc != 0)
1994 goto out;
1995 + rc = seccomp_arch_add(ctx, SCMP_ARCH_PPC64LE);
1996 + if (rc != 0)
1997 + goto out;
1998
1999 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
2000 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
2001 diff --git a/tests/16-sim-arch_basic.py b/tests/16-sim-arch_basic.py
2002 index 57a5ac3..d9e1939 100755
2003 --- a/tests/16-sim-arch_basic.py
2004 +++ b/tests/16-sim-arch_basic.py
2005 @@ -39,6 +39,7 @@ def test(args):
2006 f.add_arch(Arch("mipsel"))
2007 f.add_arch(Arch("mipsel64"))
2008 f.add_arch(Arch("mipsel64n32"))
2009 + f.add_arch(Arch("ppc64le"))
2010 f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
2011 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
2012 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
2013 diff --git a/tests/23-sim-arch_all_le_basic.c b/tests/23-sim-arch_all_le_basic.c
2014 index eeb8556..9f67ed6 100644
2015 --- a/tests/23-sim-arch_all_le_basic.c
2016 +++ b/tests/23-sim-arch_all_le_basic.c
2017 @@ -68,6 +68,9 @@ int main(int argc, char *argv[])
2018 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mipsel64n32"));
2019 if (rc != 0)
2020 goto out;
2021 + rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("ppc64le"));
2022 + if (rc != 0)
2023 + goto out;
2024
2025 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
2026 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
2027 diff --git a/tests/23-sim-arch_all_le_basic.py b/tests/23-sim-arch_all_le_basic.py
2028 index 36ab139..212ff50 100755
2029 --- a/tests/23-sim-arch_all_le_basic.py
2030 +++ b/tests/23-sim-arch_all_le_basic.py
2031 @@ -39,6 +39,7 @@ def test(args):
2032 f.add_arch(Arch("mipsel"))
2033 f.add_arch(Arch("mipsel64"))
2034 f.add_arch(Arch("mipsel64n32"))
2035 + f.add_arch(Arch("ppc64le"))
2036 f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
2037 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
2038 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
2039 diff --git a/tests/26-sim-arch_all_be_basic.c b/tests/26-sim-arch_all_be_basic.c
2040 index a951b3c..91fcbea 100644
2041 --- a/tests/26-sim-arch_all_be_basic.c
2042 +++ b/tests/26-sim-arch_all_be_basic.c
2043 @@ -52,6 +52,12 @@ int main(int argc, char *argv[])
2044 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mips64n32"));
2045 if (rc != 0)
2046 goto out;
2047 + rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("ppc64"));
2048 + if (rc != 0)
2049 + goto out;
2050 + rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("ppc"));
2051 + if (rc != 0)
2052 + goto out;
2053
2054 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
2055 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
2056 diff --git a/tests/26-sim-arch_all_be_basic.py b/tests/26-sim-arch_all_be_basic.py
2057 index 1347406..1537013 100755
2058 --- a/tests/26-sim-arch_all_be_basic.py
2059 +++ b/tests/26-sim-arch_all_be_basic.py
2060 @@ -33,6 +33,8 @@ def test(args):
2061 f.add_arch(Arch("mips"))
2062 f.add_arch(Arch("mips64"))
2063 f.add_arch(Arch("mips64n32"))
2064 + f.add_arch(Arch("ppc64"))
2065 + f.add_arch(Arch("ppc"))
2066 f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
2067 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
2068 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
2069 diff --git a/tests/regression b/tests/regression
2070 index acb125d..2aba23b 100755
2071 --- a/tests/regression
2072 +++ b/tests/regression
2073 @@ -21,8 +21,14 @@
2074 # along with this library; if not, see <http://www.gnu.org/licenses>.
2075 #
2076
2077 -GLBL_ARCH_LE_SUPPORT="x86 x86_64 x32 arm aarch64 mipsel mipsel64 mipsel64n32"
2078 -GLBL_ARCH_BE_SUPPORT="mips mips64 mips64n32"
2079 +GLBL_ARCH_LE_SUPPORT=" \
2080 + x86 x86_64 x32 \
2081 + arm aarch64 \
2082 + mipsel mipsel64 mipsel64n32 \
2083 + ppc64le"
2084 +GLBL_ARCH_BE_SUPPORT=" \
2085 + mips mips64 mips64n32 \
2086 + ppc64 ppc"
2087
2088 GLBL_SYS_ARCH="../tools/scmp_arch_detect"
2089 GLBL_SYS_RESOLVER="../tools/scmp_sys_resolver"
2090 @@ -684,7 +690,7 @@ function run_test_live() {
2091
2092 # setup the arch specific return values
2093 case "$arch" in
2094 - x86|x86_64|x32|arm|aarch64)
2095 + x86|x86_64|x32|arm|aarch64|ppc64|ppc64le|ppc)
2096 rc_kill=159
2097 rc_allow=160
2098 rc_trap=161
2099 diff --git a/tools/scmp_arch_detect.c b/tools/scmp_arch_detect.c
2100 index 5a87252..03644c6 100644
2101 --- a/tools/scmp_arch_detect.c
2102 +++ b/tools/scmp_arch_detect.c
2103 @@ -99,6 +99,15 @@ int main(int argc, char *argv[])
2104 case SCMP_ARCH_MIPSEL64N32:
2105 printf("mipsel64n32\n");
2106 break;
2107 + case SCMP_ARCH_PPC64:
2108 + printf("ppc64\n");
2109 + break;
2110 + case SCMP_ARCH_PPC64LE:
2111 + printf("ppc64le\n");
2112 + break;
2113 + case SCMP_ARCH_PPC:
2114 + printf("ppc\n");
2115 + break;
2116 default:
2117 printf("unknown\n");
2118 }
2119 diff --git a/tools/scmp_bpf_disasm.c b/tools/scmp_bpf_disasm.c
2120 index 349b8a8..d773469 100644
2121 --- a/tools/scmp_bpf_disasm.c
2122 +++ b/tools/scmp_bpf_disasm.c
2123 @@ -334,6 +334,12 @@ int main(int argc, char *argv[])
2124 arch = AUDIT_ARCH_MIPS64N32;
2125 else if (strcmp(optarg, "mipsel64n32") == 0)
2126 arch = AUDIT_ARCH_MIPSEL64N32;
2127 + else if (strcmp(optarg, "ppc64") == 0)
2128 + arch = AUDIT_ARCH_PPC64;
2129 + else if (strcmp(optarg, "ppc64le") == 0)
2130 + arch = AUDIT_ARCH_PPC64LE;
2131 + else if (strcmp(optarg, "ppc") == 0)
2132 + arch = AUDIT_ARCH_PPC;
2133 else
2134 exit_usage(argv[0]);
2135 break;
2136 diff --git a/tools/scmp_bpf_sim.c b/tools/scmp_bpf_sim.c
2137 index bb3a2e7..a53b4fd 100644
2138 --- a/tools/scmp_bpf_sim.c
2139 +++ b/tools/scmp_bpf_sim.c
2140 @@ -249,6 +249,12 @@ int main(int argc, char *argv[])
2141 arch = AUDIT_ARCH_MIPS64N32;
2142 else if (strcmp(optarg, "mipsel64n32") == 0)
2143 arch = AUDIT_ARCH_MIPSEL64N32;
2144 + else if (strcmp(optarg, "ppc64") == 0)
2145 + arch = AUDIT_ARCH_PPC64;
2146 + else if (strcmp(optarg, "ppc64le") == 0)
2147 + arch = AUDIT_ARCH_PPC64LE;
2148 + else if (strcmp(optarg, "ppc") == 0)
2149 + arch = AUDIT_ARCH_PPC;
2150 else
2151 exit_fault(EINVAL);
2152 break;
2153 diff --git a/tools/util.c b/tools/util.c
2154 index 9b58bbb..b45de3b 100644
2155 --- a/tools/util.c
2156 +++ b/tools/util.c
2157 @@ -62,6 +62,14 @@
2158 #elif __MIPSEL__
2159 #define ARCH_NATIVE AUDIT_ARCH_MIPSEL64N32
2160 #endif /* _MIPS_SIM_NABI32 */
2161 +#elif __PPC64__
2162 +#ifdef __BIG_ENDIAN__
2163 +#define ARCH_NATIVE AUDIT_ARCH_PPC64
2164 +#else
2165 +#define ARCH_NATIVE AUDIT_ARCH_PPC64LE
2166 +#endif
2167 +#elif __PPC__
2168 +#define ARCH_NATIVE AUDIT_ARCH_PPC
2169 #else
2170 #error the simulator code needs to know about your machine type
2171 #endif
2172 diff --git a/tools/util.h b/tools/util.h
2173 index 4ec3f91..2fed617 100644
2174 --- a/tools/util.h
2175 +++ b/tools/util.h
2176 @@ -63,6 +63,15 @@
2177 __AUDIT_ARCH_CONVENTION_MIPS64_N32)
2178 #endif
2179
2180 +#ifndef AUDIT_ARCH_AARCH64
2181 +/* AArch64 support for audit was merged in 3.17-rc1 */
2182 +#define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
2183 +#endif
2184 +
2185 +#ifndef AUDIT_ARCH_PPC64LE
2186 +#define AUDIT_ARCH_PPC64LE (EM_PPC64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
2187 +#endif
2188 +
2189 extern uint32_t arch;
2190
2191 void exit_usage(const char *program);
0 commit 7f3ae6e6a12390bd38f0787b242f60c47ad076c3
1 Author: Jan Willeke <willeke@linux.vnet.ibm.com>
2 Date: Fri Sep 4 14:22:00 2015 +0200
3
4 tests: s390 python test fix
5
6 Signed-off-by: Jan Willeke <willeke@linux.vnet.ibm.com>
7 Signed-off-by: Paul Moore <pmoore@redhat.com>
8 diff --git a/tests/24-live-arg_allow.py b/tests/24-live-arg_allow.py
9 index 7df970a..f3441c6 100755
10 --- a/tests/24-live-arg_allow.py
11 +++ b/tests/24-live-arg_allow.py
12 @@ -44,6 +44,7 @@ def test():
13 f.add_rule(ALLOW, "rt_sigaction")
14 f.add_rule(ALLOW, "rt_sigreturn")
15 f.add_rule(ALLOW, "exit_group")
16 + f.add_rule(ALLOW, "brk")
17 f.load()
18
19 try:
0 commit a8fe571909e381b34d0ae0237aad71513f8739de
1 Author: Mike Frysinger <vapier@gentoo.org>
2 Date: Fri Aug 28 01:14:47 2015 -0400
3
4 pfc: add missing ppc names
5
6 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
7 Signed-off-by: Paul Moore <pmoore@redhat.com>
8 diff --git a/src/gen_pfc.c b/src/gen_pfc.c
9 index ae8361f..9219d30 100644
10 --- a/src/gen_pfc.c
11 +++ b/src/gen_pfc.c
12 @@ -71,6 +71,12 @@ static const char *_pfc_arch(const struct arch_def *arch)
13 return "mips64n32";
14 case SCMP_ARCH_MIPSEL64N32:
15 return "mipsel64n32";
16 + case SCMP_ARCH_PPC64:
17 + return "ppc64";
18 + case SCMP_ARCH_PPC64LE:
19 + return "ppc64le";
20 + case SCMP_ARCH_PPC:
21 + return "ppc";
22 case SCMP_ARCH_S390X:
23 return "s390x";
24 case SCMP_ARCH_S390:
0 commit fc886cbe8128e8544f5d197dfd0971403ee203b5
1 Merge: 6e26af4 a06972c
2 Author: Paul Moore <pmoore@redhat.com>
3 Date: Fri Aug 28 15:38:34 2015 -0400
4
5 Merge branch 'working-s390' into master
6
7 Signed-off-by: Paul Moore <pmoore@redhat.com>
8 diff --git a/include/seccomp.h.in b/include/seccomp.h.in
9 index 08eae61..adab19a 100644
10 --- a/include/seccomp.h.in
11 +++ b/include/seccomp.h.in
12 @@ -173,6 +173,12 @@ struct scmp_arg_cmp {
13 #define SCMP_ARCH_PPC64LE AUDIT_ARCH_PPC64LE
14
15 /**
16 + * The S390 architecture tokens
17 + */
18 +#define SCMP_ARCH_S390 AUDIT_ARCH_S390
19 +#define SCMP_ARCH_S390X AUDIT_ARCH_S390X
20 +
21 +/**
22 * Convert a syscall name into the associated syscall number
23 * @param x the syscall name
24 */
25 @@ -1526,6 +1532,31 @@ int seccomp_export_bpf(const scmp_filter_ctx ctx, int fd);
26 #define __NR_switch_endian __PNR_switch_endian
27 #endif /* __NR_switch_endian */
28
29 +#define __PNR_get_mempolicy -10192
30 +#ifndef __NR_get_mempolicy
31 +#define __NR_get_mempolicy __PNR_get_mempolicy
32 +#endif /* __NR_get_mempolicy */
33 +
34 +#define __PNR_move_pages -10193
35 +#ifndef __NR_move_pages
36 +#define __NR_move_pages __PNR_move_pages
37 +#endif /* __NR_move_pages */
38 +
39 +#define __PNR_mbind -10194
40 +#ifndef __NR_mbind
41 +#define __NR_mbind __PNR_mbind
42 +#endif /* __NR_mbind */
43 +
44 +#define __PNR_set_mempolicy -10195
45 +#ifndef __NR_set_mempolicy
46 +#define __NR_set_mempolicy __PNR_set_mempolicy
47 +#endif /* __NR_set_mempolicy */
48 +
49 +#define __PNR_s390_runtime_instr -10196
50 +#ifndef __NR_s390_runtime_instr
51 +#define __NR_s390_runtime_instr __PNR_s390_runtime_instr
52 +#endif /* __NR_s390_runtime_instr */
53 +
54 #ifdef __cplusplus
55 }
56 #endif
57 diff --git a/src/Makefile.am b/src/Makefile.am
58 index 23d9a91..ba9b9f4 100644
59 --- a/src/Makefile.am
60 +++ b/src/Makefile.am
61 @@ -32,7 +32,9 @@ SOURCES_ARCH = \
62 arch-mips64.h arch-mips64.c arch-mips64-syscalls.c \
63 arch-mips64n32.h arch-mips64n32.c arch-mips64n32-syscalls.c \
64 arch-ppc.h arch-ppc.c arch-ppc-syscalls.c \
65 - arch-ppc64.h arch-ppc64.c arch-ppc64-syscalls.c
66 + arch-ppc64.h arch-ppc64.c arch-ppc64-syscalls.c \
67 + arch-s390.h arch-s390.c arch-s390-syscalls.c \
68 + arch-s390x.h arch-s390x.c arch-s390x-syscalls.c
69
70 SOURCES_GEN = \
71 api.c system.h system.c \
72 diff --git a/src/arch-aarch64-syscalls.c b/src/arch-aarch64-syscalls.c
73 index 43d77ad..9ac1dd0 100644
74 --- a/src/arch-aarch64-syscalls.c
75 +++ b/src/arch-aarch64-syscalls.c
76 @@ -296,6 +296,7 @@ const struct arch_syscall_def aarch64_syscall_table[] = { \
77 { "rt_sigtimedwait", 137 },
78 { "rt_tgsigqueueinfo", 240 },
79 { "rtas", __PNR_rtas },
80 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
81 { "sched_get_priority_max", 125 },
82 { "sched_get_priority_min", 126 },
83 { "sched_getaffinity", 123 },
84 diff --git a/src/arch-arm-syscalls.c b/src/arch-arm-syscalls.c
85 index 211bbec..c4fd31e 100644
86 --- a/src/arch-arm-syscalls.c
87 +++ b/src/arch-arm-syscalls.c
88 @@ -308,6 +308,7 @@ const struct arch_syscall_def arm_syscall_table[] = { \
89 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 177) },
90 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 363) },
91 { "rtas", __PNR_rtas },
92 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
93 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 159) },
94 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 160) },
95 { "sched_getaffinity", (__NR_SYSCALL_BASE + 242) },
96 diff --git a/src/arch-mips-syscalls.c b/src/arch-mips-syscalls.c
97 index 1fe9315..ae5ebf7 100644
98 --- a/src/arch-mips-syscalls.c
99 +++ b/src/arch-mips-syscalls.c
100 @@ -300,6 +300,7 @@ const struct arch_syscall_def mips_syscall_table[] = { \
101 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 197) },
102 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 332) },
103 { "rtas", __PNR_rtas },
104 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
105 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 163) },
106 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 164) },
107 { "sched_getaffinity", (__NR_SYSCALL_BASE + 240) },
108 diff --git a/src/arch-mips64-syscalls.c b/src/arch-mips64-syscalls.c
109 index 493fe87..baffe20 100644
110 --- a/src/arch-mips64-syscalls.c
111 +++ b/src/arch-mips64-syscalls.c
112 @@ -300,6 +300,7 @@ const struct arch_syscall_def mips64_syscall_table[] = { \
113 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 126) },
114 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 291) },
115 { "rtas", __PNR_rtas },
116 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
117 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 143) },
118 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 144) },
119 { "sched_getaffinity", (__NR_SYSCALL_BASE + 196) },
120 diff --git a/src/arch-mips64n32-syscalls.c b/src/arch-mips64n32-syscalls.c
121 index e1cbf5c..dd6966e 100644
122 --- a/src/arch-mips64n32-syscalls.c
123 +++ b/src/arch-mips64n32-syscalls.c
124 @@ -300,6 +300,7 @@ const struct arch_syscall_def mips64n32_syscall_table[] = { \
125 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 126) },
126 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 295) },
127 { "rtas", __PNR_rtas },
128 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
129 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 143) },
130 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 144) },
131 { "sched_getaffinity", (__NR_SYSCALL_BASE + 196) },
132 diff --git a/src/arch-ppc-syscalls.c b/src/arch-ppc-syscalls.c
133 index 92fa1c3..8ddb750 100644
134 --- a/src/arch-ppc-syscalls.c
135 +++ b/src/arch-ppc-syscalls.c
136 @@ -297,6 +297,7 @@ const struct arch_syscall_def ppc_syscall_table[] = { \
137 { "rt_sigtimedwait", 176 },
138 { "rt_tgsigqueueinfo", 322 },
139 { "rtas", 255 },
140 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
141 { "sched_get_priority_max", 159 },
142 { "sched_get_priority_min", 160 },
143 { "sched_getaffinity", 223 },
144 diff --git a/src/arch-ppc64-syscalls.c b/src/arch-ppc64-syscalls.c
145 index b23d743..d9060f4 100644
146 --- a/src/arch-ppc64-syscalls.c
147 +++ b/src/arch-ppc64-syscalls.c
148 @@ -297,6 +297,7 @@ const struct arch_syscall_def ppc64_syscall_table[] = { \
149 { "rt_sigtimedwait", 176 },
150 { "rt_tgsigqueueinfo", 322 },
151 { "rtas", 255 },
152 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
153 { "sched_get_priority_max", 159 },
154 { "sched_get_priority_min", 160 },
155 { "sched_getaffinity", 223 },
156 diff --git a/src/arch-s390-syscalls.c b/src/arch-s390-syscalls.c
157 new file mode 100644
158 index 0000000..4da63ed
159 --- /dev/null
160 +++ b/src/arch-s390-syscalls.c
161 @@ -0,0 +1,492 @@
162 +/*
163 + * Copyright 2015 IBM
164 + * Author: Jan Willeke <willeke@linux.vnet.com.com>
165 + */
166 +
167 +#include <string.h>
168 +
169 +#include <seccomp.h>
170 +
171 +#include "arch.h"
172 +#include "arch-s390.h"
173 +
174 +/* NOTE: based on Linux 4.2-rc5 */
175 +const struct arch_syscall_def s390_syscall_table[] = { \
176 + { "_llseek", 140 },
177 + { "_newselect", 142 },
178 + { "_sysctl", 149 },
179 + { "accept", __PNR_accept },
180 + { "accept4", __PNR_accept4 },
181 + { "access", 33 },
182 + { "acct", 51 },
183 + { "add_key", 278 },
184 + { "adjtimex", 124 },
185 + { "afs_syscall", 137 },
186 + { "alarm", 27 },
187 + { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
188 + { "arm_sync_file_range", __PNR_arm_sync_file_range },
189 + { "arch_prctl", __PNR_arch_prctl },
190 + { "bdflush", 134 },
191 + { "bind", __PNR_bind },
192 + { "bpf", 351 },
193 + { "break", __PNR_break },
194 + { "breakpoint", __PNR_breakpoint },
195 + { "brk", 45 },
196 + { "cachectl", __PNR_cachectl },
197 + { "cacheflush", __PNR_cacheflush },
198 + { "capget", 184 },
199 + { "capset", 185 },
200 + { "chdir", 12 },
201 + { "chmod", 15 },
202 + { "chown", 182 },
203 + { "chown32", 212 },
204 + { "chroot", 61 },
205 + { "clock_adjtime", 337 },
206 + { "clock_getres", 261 },
207 + { "clock_gettime", 260 },
208 + { "clock_nanosleep", 262 },
209 + { "clock_settime", 259 },
210 + { "clone", 120 },
211 + { "close", 6 },
212 + { "connect", __PNR_connect },
213 + { "creat", 8 },
214 + { "create_module", 127 },
215 + { "delete_module", 129 },
216 + { "dup", 41 },
217 + { "dup2", 63 },
218 + { "dup3", 326 },
219 + { "epoll_create", 249 },
220 + { "epoll_create1", 327 },
221 + { "epoll_ctl", 250 },
222 + { "epoll_ctl_old", __PNR_epoll_ctl_old },
223 + { "epoll_pwait", 312 },
224 + { "epoll_wait", 251 },
225 + { "epoll_wait_old", __PNR_epoll_wait_old },
226 + { "eventfd", 318 },
227 + { "eventfd2", 323 },
228 + { "execve", 11 },
229 + { "execveat", 354 },
230 + { "exit", 1 },
231 + { "exit_group", 248 },
232 + { "faccessat", 300 },
233 + { "fadvise64", 253 },
234 + { "fadvise64_64", 264 },
235 + { "fallocate", 314 },
236 + { "fanotify_init", 332 },
237 + { "fanotify_mark", 333 },
238 + { "fchdir", 133 },
239 + { "fchmod", 94 },
240 + { "fchmodat", 299 },
241 + { "fchown", 95 },
242 + { "fchown32", 207 },
243 + { "fchownat", 291 },
244 + { "fcntl", 55 },
245 + { "fcntl64", 221 },
246 + { "fdatasync", 148 },
247 + { "fgetxattr", 229 },
248 + { "finit_module", 344 },
249 + { "flistxattr", 232 },
250 + { "flock", 143 },
251 + { "fork", 2 },
252 + { "fremovexattr", 235 },
253 + { "fsetxattr", 226 },
254 + { "fstat", 108 },
255 + { "fstat64", 197 },
256 + { "fstatat64", 293 },
257 + { "fstatfs", 100 },
258 + { "fstatfs64", 266 },
259 + { "fsync", 118 },
260 + { "ftime", __PNR_ftime },
261 + { "ftruncate", 93 },
262 + { "ftruncate64", 194 },
263 + { "futex", 238 },
264 + { "futimesat", 292 },
265 + { "get_kernel_syms", 130 },
266 + { "get_mempolicy", __PNR_get_mempolicy },
267 + { "get_robust_list" , 305 },
268 + { "get_thread_area", __PNR_get_thread_area },
269 + { "getcpu", 311 },
270 + { "getcwd", 183 },
271 + { "getdents", 141 },
272 + { "getdents64", 220 },
273 + { "getegid", 50 },
274 + { "getegid32", 202 },
275 + { "geteuid", 49 },
276 + { "geteuid32", 201 },
277 + { "getgid", 47 },
278 + { "getgid32", 200 },
279 + { "getgroups", 80 },
280 + { "getgroups32", 205 },
281 + { "getitimer", 105 },
282 + { "getpeername", __PNR_getpeername },
283 + { "getpgid", 132 },
284 + { "getpgrp", 65 },
285 + { "getpid", 20 },
286 + { "getpmsg", 188 },
287 + { "getppid", 64 },
288 + { "getpriority", 96 },
289 + { "getrandom", 349 },
290 + { "getresgid", 171 },
291 + { "getresgid32", 211 },
292 + { "getresuid", 165 },
293 + { "getresuid32", 209 },
294 + { "getrlimit", 76 },
295 + { "getrusage", 77 },
296 + { "getsid", 147 },
297 + { "getsockname", __PNR_getsockname },
298 + { "getsockopt", __PNR_getsockopt },
299 + { "gettid", 236 },
300 + { "gettimeofday", 78 },
301 + { "getuid", 24 },
302 + { "getuid32", 199 },
303 + { "getxattr", 227 },
304 + { "gtty", __PNR_gtty },
305 + { "idle", 112 },
306 + { "init_module", 128 },
307 + { "inotify_add_watch" , 285 },
308 + { "inotify_init", 284 },
309 + { "inotify_init1", 324 },
310 + { "inotify_rm_watch" , 286 },
311 + { "io_cancel", 247 },
312 + { "io_destroy", 244 },
313 + { "io_getevents", 245 },
314 + { "io_setup", 243 },
315 + { "io_submit", 246 },
316 + { "ioctl", 54 },
317 + { "ioperm", 101 },
318 + { "iopl", __PNR_iopl },
319 + { "ioprio_get", 283 },
320 + { "ioprio_set", 282 },
321 + { "ipc", 117 },
322 + { "kcmp", 343 },
323 + { "kexec_file_load", __PNR_kexec_file_load },
324 + { "kexec_load", 277 },
325 + { "keyctl", 280 },
326 + { "kill", 37 },
327 + { "lchown", 16 },
328 + { "lchown32", 198 },
329 + { "lgetxattr", 228 },
330 + { "link", 9 },
331 + { "linkat", 296 },
332 + { "listen", __PNR_listen },
333 + { "listxattr", 230 },
334 + { "llistxattr", 231 },
335 + { "lock", __PNR_lock },
336 + { "lookup_dcookie", 110 },
337 + { "lremovexattr", 234 },
338 + { "lseek", 19 },
339 + { "lsetxattr", 225 },
340 + { "lstat", 107 },
341 + { "lstat64", 196 },
342 + { "madvise", 219 },
343 + { "mbind", __PNR_mbind },
344 + { "memfd_create", 350 },
345 + { "migrate_pages", __PNR_migrate_pages},
346 + { "mincore", 218 },
347 + { "mkdir", 39 },
348 + { "mkdirat", 289 },
349 + { "mknod", 14 },
350 + { "mknodat", 290 },
351 + { "mlock", 150 },
352 + { "mlockall", 152 },
353 + { "mmap", 90 },
354 + { "mmap2", 192 },
355 + { "modify_ldt", __PNR_modify_ldt },
356 + { "mount", 21 },
357 + { "move_pages", __PNR_move_pages},
358 + { "mprotect", 125 },
359 + { "mpx", __PNR_mpx },
360 + { "mq_getsetattr", 276 },
361 + { "mq_notify", 275 },
362 + { "mq_open", 271 },
363 + { "mq_timedreceive" , 274 },
364 + { "mq_timedsend", 273 },
365 + { "mq_unlink", 272 },
366 + { "mremap", 163 },
367 + { "msgctl", __PNR_msgctl },
368 + { "msgget", __PNR_msgget },
369 + { "msgrcv", __PNR_msgrcv },
370 + { "msgsnd", __PNR_msgsnd },
371 + { "msync", 144 },
372 + { "multiplexer", __PNR_multiplexer },
373 + { "munlock", 151 },
374 + { "munlockall", 153 },
375 + { "munmap", 91 },
376 + { "name_to_handle_at", 335 },
377 + { "nanosleep", 162 },
378 + { "newfstatat", __NR_newfstatat },
379 + { "nfsservctl", 169 },
380 + { "nice", 34 },
381 + { "oldfstat", __PNR_oldfstat },
382 + { "oldlstat", __PNR_oldlstat },
383 + { "oldolduname", __PNR_oldolduname },
384 + { "oldstat", __PNR_oldstat },
385 + { "olduname", __PNR_olduname },
386 + { "oldwait4", __PNR_oldwait4 },
387 + { "open", 5 },
388 + { "open_by_handle_at", 336 },
389 + { "openat", 288 },
390 + { "pause", 29 },
391 + { "pciconfig_iobase", __PNR_pciconfig_iobase },
392 + { "pciconfig_read", __PNR_pciconfig_read },
393 + { "pciconfig_write", __PNR_pciconfig_write },
394 + { "perf_event_open", 331 },
395 + { "personality", 136 },
396 + { "pipe", 42 },
397 + { "pipe2", 325 },
398 + { "pivot_root", 217 },
399 + { "poll", 168 },
400 + { "ppoll", 302 },
401 + { "prctl", 172 },
402 + { "pread64", 180 },
403 + { "preadv", 328 },
404 + { "prlimit64", 334 },
405 + { "process_vm_readv", 340 },
406 + { "process_vm_writev", 341 },
407 + { "prof", __PNR_prof },
408 + { "profil", __PNR_profil },
409 + { "pselect6", 301 },
410 + { "ptrace", 26 },
411 + { "putpmsg", 189 },
412 + { "pwrite64", 181 },
413 + { "pwritev", 329 },
414 + { "query_module", 167 },
415 + { "quotactl", 131 },
416 + { "read", 3 },
417 + { "readahead", 222 },
418 + { "readdir", 89 },
419 + { "readlink", 85 },
420 + { "readlinkat", 298 },
421 + { "readv", 145 },
422 + { "reboot", 88 },
423 + { "recv", __PNR_recv },
424 + { "recvfrom", __PNR_recvfrom },
425 + { "recvmmsg", __PNR_recvmmsg },
426 + { "recvmsg", __PNR_recvmsg },
427 + { "remap_file_pages", 267 },
428 + { "removexattr", 233 },
429 + { "rename", 38 },
430 + { "renameat", 295 },
431 + { "renameat2", 347 },
432 + { "request_key", 279 },
433 + { "restart_syscall", 7 },
434 + { "rmdir", 40 },
435 + { "rt_sigaction", 174 },
436 + { "rt_sigpending", 176 },
437 + { "rt_sigprocmask", 175 },
438 + { "rt_sigqueueinfo", 178 },
439 + { "rt_sigreturn", 173 },
440 + { "rt_sigsuspend", 179 },
441 + { "rt_sigtimedwait", 177 },
442 + { "rt_tgsigqueueinfo", 330 },
443 + { "rtas", __PNR_rtas },
444 + { "s390_runtime_instr", 342 },
445 + { "sched_get_priority_max", 159 },
446 + { "sched_get_priority_min", 160 },
447 + { "sched_getaffinity" , 240 },
448 + { "sched_getattr", 346 },
449 + { "sched_getparam", 155 },
450 + { "sched_getscheduler", 157 },
451 + { "sched_rr_get_interval", 161 },
452 + { "sched_setaffinity" , 239 },
453 + { "sched_setattr", 345 },
454 + { "sched_setparam", 154 },
455 + { "sched_setscheduler", 156 },
456 + { "sched_yield", 158 },
457 + { "seccomp", 348 },
458 + { "security", __PNR_security },
459 + { "select", __PNR_select },
460 + { "semctl", __PNR_semctl },
461 + { "semget", __PNR_semget },
462 + { "semop", __PNR_semop },
463 + { "semtimedop", __PNR_semtimedop },
464 + { "send", __PNR_send },
465 + { "sendfile", 187 },
466 + { "sendfile64", 223 },
467 + { "sendmmsg", __PNR_sendmmsg },
468 + { "sendmsg", __PNR_sendmsg },
469 + { "sendto", __PNR_sendto },
470 + { "set_mempolicy", __PNR_set_mempolicy },
471 + { "set_robust_list" , 304 },
472 + { "set_thread_area", __PNR_set_thread_area },
473 + { "set_tid_address", 252 },
474 + { "set_tls", __PNR_set_tls },
475 + { "setdomainname", 121 },
476 + { "setfsgid", 139 },
477 + { "setfsgid32", 216 },
478 + { "setfsuid", 138 },
479 + { "setfsuid32", 215 },
480 + { "setgid", 46 },
481 + { "setgid32", 214 },
482 + { "setgroups", 81 },
483 + { "setgroups32", 206 },
484 + { "sethostname", 74 },
485 + { "setitimer", 104 },
486 + { "setns", 339 },
487 + { "setpgid", 57 },
488 + { "setpriority", 97 },
489 + { "setregid", 71 },
490 + { "setregid32", 204 },
491 + { "setresgid", 170 },
492 + { "setresgid32", 210 },
493 + { "setresuid", 164 },
494 + { "setresuid32", 208 },
495 + { "setreuid", 70 },
496 + { "setreuid32", 203 },
497 + { "setrlimit", 75 },
498 + { "setsid", 66 },
499 + { "setsockopt", __PNR_setsockopt },
500 + { "settimeofday", 79 },
501 + { "setuid", 23 },
502 + { "setuid32", 213 },
503 + { "setxattr", 224 },
504 + { "sgetmask", __PNR_sgetmask },
505 + { "shmat", __PNR_shmat },
506 + { "shmctl", __PNR_shmctl },
507 + { "shmdt", __PNR_shmdt },
508 + { "shmget", __PNR_shmget },
509 + { "shutdown", __PNR_shutdown },
510 + { "sigaction", 67 },
511 + { "sigaltstack", 186 },
512 + { "signal", 48 },
513 + { "signalfd", 316 },
514 + { "signalfd4", 322 },
515 + { "sigpending", 73 },
516 + { "sigprocmask", 126 },
517 + { "sigreturn", 119 },
518 + { "sigsuspend", 72 },
519 + { "socket", __PNR_socket },
520 + { "socketcall", 102 },
521 + { "socketpair", __PNR_socketpair },
522 + { "splice", 306 },
523 + { "spu_create", __PNR_spu_create },
524 + { "spu_run", __PNR_spu_run },
525 + { "ssetmask", __PNR_ssetmask },
526 + { "stat", 106 },
527 + { "stat64", 195 },
528 + { "statfs", 99 },
529 + { "statfs64", 265 },
530 + { "stime", 25 },
531 + { "stty", __PNR_stty },
532 + { "subpage_prot", __PNR_subpage_prot },
533 + { "swapcontext", __PNR_swapcontext },
534 + { "swapoff", 115 },
535 + { "swapon", 87 },
536 + { "switch_endian", __PNR_switch_endian },
537 + { "symlink", 83 },
538 + { "symlinkat", 297 },
539 + { "sync", 36 },
540 + { "sync_file_range" , 307 },
541 + { "sync_file_range2", __PNR_sync_file_range2 },
542 + { "syncfs", 338 },
543 + { "syscall", __PNR_syscall },
544 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
545 + { "sysfs", 135 },
546 + { "sysinfo", 116 },
547 + { "syslog", 103 },
548 + { "sysmips", __PNR_sysmips },
549 + { "tee", 308 },
550 + { "tgkill", 241 },
551 + { "time", 13 },
552 + { "timer_create", 254 },
553 + { "timer_delete", 258 },
554 + { "timer_getoverrun", 257 },
555 + { "timer_gettime", 256 },
556 + { "timer_settime", 255 },
557 + { "timerfd", 317 },
558 + { "timerfd_create", 319 },
559 + { "timerfd_gettime", 321 },
560 + { "timerfd_settime", 320 },
561 + { "times", 43 },
562 + { "tkill", 237 },
563 + { "truncate", 92 },
564 + { "truncate64", 193 },
565 + { "tuxcall", __PNR_tuxcall },
566 + { "ugetrlimit", 191 },
567 + { "ulimit", __PNR_ulimit },
568 + { "umask", 60 },
569 + { "umount", 22 },
570 + { "umount2", 52 },
571 + { "uname", 122 },
572 + { "unlink", 10 },
573 + { "unlinkat", 294 },
574 + { "unshare", 303 },
575 + { "uselib", 86 },
576 + { "usr26", __PNR_usr26 },
577 + { "usr32", __PNR_usr32 },
578 + { "ustat", 62 },
579 + { "utime", 30 },
580 + { "utimensat", 315 },
581 + { "utimes", 313 },
582 + { "vfork", 190 },
583 + { "vhangup", 111 },
584 + { "vm86", __PNR_vm86 },
585 + { "vm86old", __PNR_vm86old },
586 + { "vmsplice", 309 },
587 + { "vserver", __PNR_vserver },
588 + { "wait4", 114 },
589 + { "waitid", 281 },
590 + { "waitpid", __PNR_waitpid },
591 + { "write", 4 },
592 + { "writev", 146 },
593 + { NULL, __NR_SCMP_ERROR },
594 +};
595 +
596 +/**
597 + * Resolve a syscall name to a number
598 + * @param name the syscall name
599 + *
600 + * Resolve the given syscall name to the syscall number using the syscall table.
601 + * Returns the syscall number on success, including negative pseudo syscall
602 + * numbers; returns __NR_SCMP_ERROR on failure.
603 + *
604 + */
605 +int s390_syscall_resolve_name(const char *name)
606 +{
607 + unsigned int iter;
608 + const struct arch_syscall_def *table = s390_syscall_table;
609 +
610 + /* XXX - plenty of room for future improvement here */
611 + for (iter = 0; table[iter].name != NULL; iter++) {
612 + if (strcmp(name, table[iter].name) == 0)
613 + return table[iter].num;
614 + }
615 +
616 + return __NR_SCMP_ERROR;
617 +}
618 +
619 +/**
620 + * Resolve a syscall number to a name
621 + * @param num the syscall number
622 + *
623 + * Resolve the given syscall number to the syscall name using the syscall table.
624 + * Returns a pointer to the syscall name string on success, including pseudo
625 + * syscall names; returns NULL on failure.
626 + *
627 + */
628 +const char *s390_syscall_resolve_num(int num)
629 +{
630 + unsigned int iter;
631 + const struct arch_syscall_def *table = s390_syscall_table;
632 +
633 + /* XXX - plenty of room for future improvement here */
634 + for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
635 + if (num == table[iter].num)
636 + return table[iter].name;
637 + }
638 +
639 + return NULL;
640 +}
641 +/**
642 + * Iterate through the syscall table and return the syscall name
643 + * @param spot the offset into the syscall table
644 + *
645 + * Return the syscall name at position @spot or NULL on failure. This function
646 + * should only ever be used internally by libseccomp.
647 + *
648 + */
649 +const char *s390_syscall_iterate_name(unsigned int spot)
650 +{
651 + /* XXX - no safety checks here */
652 + return s390_syscall_table[spot].name;
653 +}
654 diff --git a/src/arch-s390.c b/src/arch-s390.c
655 new file mode 100644
656 index 0000000..5aa36fe
657 --- /dev/null
658 +++ b/src/arch-s390.c
659 @@ -0,0 +1,18 @@
660 +/*
661 + * Copyright 2015 IBM
662 + * Author: Jan Willeke <willeke@linux.vnet.com.com>
663 + */
664 +
665 +#include <stdlib.h>
666 +#include <errno.h>
667 +#include <linux/audit.h>
668 +
669 +#include "arch.h"
670 +#include "arch-s390.h"
671 +
672 +const struct arch_def arch_def_s390 = {
673 + .token = SCMP_ARCH_S390,
674 + .token_bpf = AUDIT_ARCH_S390,
675 + .size = ARCH_SIZE_32,
676 + .endian = ARCH_ENDIAN_BIG,
677 +};
678 diff --git a/src/arch-s390.h b/src/arch-s390.h
679 new file mode 100644
680 index 0000000..71ba260
681 --- /dev/null
682 +++ b/src/arch-s390.h
683 @@ -0,0 +1,23 @@
684 +/*
685 + * Copyright 2015 IBM
686 + * Author: Jan Willeke <willeke@linux.vnet.com.com>
687 + */
688 +
689 +#ifndef _ARCH_s390_H
690 +#define _ARCH_s390_H
691 +
692 +#include <inttypes.h>
693 +
694 +#include "arch.h"
695 +#include "system.h"
696 +
697 +#define s390_arg_count_max 6
698 +
699 +extern const struct arch_def arch_def_s390;
700 +#define s390_arg_offset(x) (offsetof(struct seccomp_data, args[x]))
701 +
702 +int s390_syscall_resolve_name(const char *name);
703 +const char *s390_syscall_resolve_num(int num);
704 +const char *s390_syscall_iterate_name(unsigned int spot);
705 +
706 +#endif
707 diff --git a/src/arch-s390x-syscalls.c b/src/arch-s390x-syscalls.c
708 new file mode 100644
709 index 0000000..50596cb
710 --- /dev/null
711 +++ b/src/arch-s390x-syscalls.c
712 @@ -0,0 +1,493 @@
713 +/*
714 + * Copyright 2015 IBM
715 + * Author: Jan Willeke <willeke@linux.vnet.com.com>
716 + */
717 +
718 +#include <string.h>
719 +
720 +#include <seccomp.h>
721 +
722 +#include "arch.h"
723 +#include "arch-s390x.h"
724 +
725 +/* NOTE: based on Linux 4.2-rc5 */
726 +const struct arch_syscall_def s390x_syscall_table[] = { \
727 + { "_llseek", __PNR__llseek },
728 + { "_newselect", __PNR__newselect },
729 + { "_sysctl", 149 },
730 + { "accept", __PNR_accept },
731 + { "accept4", __PNR_accept4 },
732 + { "access", 33 },
733 + { "acct", 51 },
734 + { "add_key", 278 },
735 + { "adjtimex", 124 },
736 + { "afs_syscall", 137 },
737 + { "alarm", 27 },
738 + { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
739 + { "arm_sync_file_range", __PNR_arm_sync_file_range },
740 + { "arch_prctl", __PNR_arch_prctl },
741 + { "bdflush", 134 },
742 + { "bind", __PNR_bind },
743 + { "bpf", 351 },
744 + { "break", __PNR_break },
745 + { "breakpoint", __PNR_breakpoint },
746 + { "brk", 45 },
747 + { "cachectl", __PNR_cachectl },
748 + { "cacheflush", __PNR_cacheflush },
749 + { "capget", 184 },
750 + { "capset", 185 },
751 + { "chdir", 12 },
752 + { "chmod", 15 },
753 + { "chown", 212 },
754 + { "chown32", __PNR_chown32 },
755 + { "chroot", 61 },
756 + { "clock_adjtime", 337 },
757 + { "clock_getres", 261 },
758 + { "clock_gettime", 260 },
759 + { "clock_nanosleep", 262 },
760 + { "clock_settime", 259 },
761 + { "clone", 120 },
762 + { "close", 6 },
763 + { "connect", __PNR_connect },
764 + { "creat", 8 },
765 + { "create_module", 127 },
766 + { "delete_module", 129 },
767 + { "dup", 41 },
768 + { "dup2", 63 },
769 + { "dup3", 326 },
770 + { "epoll_create", 249 },
771 + { "epoll_create1", 327 },
772 + { "epoll_ctl", 250 },
773 + { "epoll_ctl_old", __PNR_epoll_ctl_old },
774 + { "epoll_pwait", 312 },
775 + { "epoll_wait", 251 },
776 + { "epoll_wait_old", __PNR_epoll_wait_old },
777 + { "eventfd", 318 },
778 + { "eventfd2", 323 },
779 + { "execve", 11 },
780 + { "execveat", 354 },
781 + { "exit", 1 },
782 + { "exit_group", 248 },
783 + { "faccessat", 300 },
784 + { "fadvise64", 253 },
785 + { "fadvise64_64", __PNR_fadvise64_64 },
786 + { "fallocate", 314 },
787 + { "fanotify_init", 332 },
788 + { "fanotify_mark", 333 },
789 + { "fchdir", 133 },
790 + { "fchmod", 94 },
791 + { "fchmodat", 299 },
792 + { "fchown", 207 },
793 + { "fchown32", __PNR_fchown32 },
794 + { "fchownat", 291 },
795 + { "fcntl", 55 },
796 + { "fcntl64", __PNR_fcntl64 },
797 + { "fdatasync", 148 },
798 + { "fgetxattr", 229 },
799 + { "finit_module", 344 },
800 + { "flistxattr", 232 },
801 + { "flock", 143 },
802 + { "fork", 2 },
803 + { "fremovexattr", 235 },
804 + { "fsetxattr", 226 },
805 + { "fstat", 108 },
806 + { "fstat64", __PNR_fstat64 },
807 + { "fstatat64", __PNR_fstatat64 },
808 + { "fstatfs", 100 },
809 + { "fstatfs64", 266 },
810 + { "fsync", 118 },
811 + { "ftime", __PNR_ftime },
812 + { "ftruncate", 93 },
813 + { "ftruncate64", __PNR_ftruncate64 },
814 + { "futex", 238 },
815 + { "futimesat", 292 },
816 + { "get_kernel_syms", 130 },
817 + { "get_mempolicy", __PNR_get_mempolicy },
818 + { "get_robust_list" , 305 },
819 + { "get_thread_area", __PNR_get_thread_area },
820 + { "getcpu", 311 },
821 + { "getcwd", 183 },
822 + { "getdents", 141 },
823 + { "getdents64", 220 },
824 + { "getegid", 202 },
825 + { "getegid32", __PNR_getegid32 },
826 + { "geteuid", 201 },
827 + { "geteuid32", __PNR_geteuid32 },
828 + { "getgid", 200 },
829 + { "getgid32", __PNR_getgid32 },
830 + { "getgroups", 205 },
831 + { "getgroups32", __PNR_getgroups32 },
832 + { "getitimer", 105 },
833 + { "getpeername", __PNR_getpeername },
834 + { "getpgid", 132 },
835 + { "getpgrp", 65 },
836 + { "getpid", 20 },
837 + { "getpmsg", 188 },
838 + { "getppid", 64 },
839 + { "getpriority", 96 },
840 + { "getrandom", 349 },
841 + { "getresgid", 211 },
842 + { "getresgid32", __PNR_getresgid32 },
843 + { "getresuid", 209 },
844 + { "getresuid32", __PNR_getresuid32 },
845 + { "getrlimit", 191 },
846 + { "getrusage", 77 },
847 + { "getsid", 147 },
848 + { "getsockname", __PNR_getsockname },
849 + { "getsockopt", __PNR_getsockopt },
850 + { "gettid", 236 },
851 + { "gettimeofday", 78 },
852 + { "getuid", 199 },
853 + { "getuid32", __PNR_getuid32 },
854 + { "getxattr", 227 },
855 + { "gtty", __PNR_gtty },
856 + { "idle", 112 },
857 + { "init_module", 128 },
858 + { "inotify_add_watch" , 285 },
859 + { "inotify_init", 284 },
860 + { "inotify_init1", 324 },
861 + { "inotify_rm_watch" , 286 },
862 + { "io_cancel", 247 },
863 + { "io_destroy", 244 },
864 + { "io_getevents", 245 },
865 + { "io_setup", 243 },
866 + { "io_submit", 246 },
867 + { "ioctl", 54 },
868 + { "ioperm", __PNR_ioperm},
869 + { "iopl", __PNR_iopl },
870 + { "ioprio_get", 283 },
871 + { "ioprio_set", 282 },
872 + { "ipc", 117 },
873 + { "kcmp", 343 },
874 + { "kexec_file_load", __PNR_kexec_file_load },
875 + { "kexec_load", 277 },
876 + { "keyctl", 280 },
877 + { "kill", 37 },
878 + { "lchown", 198 },
879 + { "lchown32", __PNR_lchown32 },
880 + { "lgetxattr", 228 },
881 + { "link", 9 },
882 + { "linkat", 296 },
883 + { "listen", __PNR_listen },
884 + { "listxattr", 230 },
885 + { "llistxattr", 231 },
886 + { "lock", __PNR_lock },
887 + { "lookup_dcookie", 110 },
888 + { "lremovexattr", 234 },
889 + { "lseek", 19 },
890 + { "lsetxattr", 225 },
891 + { "lstat", 107 },
892 + { "lstat64", __PNR_lstat64 },
893 + { "madvise", 219 },
894 + { "mbind", __PNR_mbind },
895 + { "memfd_create", 350 },
896 + { "migrate_pages", __PNR_migrate_pages },
897 + { "mincore", 218 },
898 + { "mkdir", 39 },
899 + { "mkdirat", 289 },
900 + { "mknod", 14 },
901 + { "mknodat", 290 },
902 + { "mlock", 150 },
903 + { "mlockall", 152 },
904 + { "mmap", 90 },
905 + { "mmap2", __PNR_mmap2 },
906 + { "modify_ldt", __PNR_modify_ldt },
907 + { "mount", 21 },
908 + { "move_pages", __PNR_move_pages },
909 + { "mprotect", 125 },
910 + { "mpx", __PNR_mpx },
911 + { "mq_getsetattr", 276 },
912 + { "mq_notify", 275 },
913 + { "mq_open", 271 },
914 + { "mq_timedreceive" , 274 },
915 + { "mq_timedsend", 273 },
916 + { "mq_unlink", 272 },
917 + { "mremap", 163 },
918 + { "msgctl", __PNR_msgctl },
919 + { "msgget", __PNR_msgget },
920 + { "msgrcv", __PNR_msgrcv },
921 + { "msgsnd", __PNR_msgsnd },
922 + { "msync", 144 },
923 + { "multiplexer", __PNR_multiplexer },
924 + { "munlock", 151 },
925 + { "munlockall", 153 },
926 + { "munmap", 91 },
927 + { "name_to_handle_at", 335 },
928 + { "nanosleep", 162 },
929 + { "newfstatat", 293 },
930 + { "nfsservctl", 169 },
931 + { "nice", 34 },
932 + { "oldfstat", __PNR_oldfstat },
933 + { "oldlstat", __PNR_oldlstat },
934 + { "oldolduname", __PNR_oldolduname },
935 + { "oldstat", __PNR_oldstat },
936 + { "olduname", __PNR_olduname },
937 + { "oldwait4", __PNR_oldwait4 },
938 + { "open", 5 },
939 + { "open_by_handle_at", 336 },
940 + { "openat", 288 },
941 + { "pause", 29 },
942 + { "pciconfig_iobase", __PNR_pciconfig_iobase },
943 + { "pciconfig_read", __PNR_pciconfig_read },
944 + { "pciconfig_write", __PNR_pciconfig_write },
945 + { "perf_event_open", 331 },
946 + { "personality", 136 },
947 + { "pipe", 42 },
948 + { "pipe2", 325 },
949 + { "pivot_root", 217 },
950 + { "poll", 168 },
951 + { "ppoll", 302 },
952 + { "prctl", 172 },
953 + { "pread64", 180 },
954 + { "preadv", 328 },
955 + { "prlimit64", 334 },
956 + { "process_vm_readv", 340 },
957 + { "process_vm_writev", 341 },
958 + { "prof", __PNR_prof },
959 + { "profil", __PNR_profil },
960 + { "pselect6", 301 },
961 + { "ptrace", 26 },
962 + { "putpmsg", 189 },
963 + { "pwrite64", 181 },
964 + { "pwritev", 329 },
965 + { "query_module", 167 },
966 + { "quotactl", 131 },
967 + { "read", 3 },
968 + { "readahead", 222 },
969 + { "readdir", 89 },
970 + { "readlink", 85 },
971 + { "readlinkat", 298 },
972 + { "readv", 145 },
973 + { "reboot", 88 },
974 + { "recv", __PNR_recv },
975 + { "recvfrom", __PNR_recvfrom },
976 + { "recvmmsg", __PNR_recvmmsg },
977 + { "recvmsg", __PNR_recvmsg },
978 + { "remap_file_pages", 267 },
979 + { "removexattr", 233 },
980 + { "rename", 38 },
981 + { "renameat", 295 },
982 + { "renameat2", 347 },
983 + { "request_key", 279 },
984 + { "restart_syscall", 7 },
985 + { "rmdir", 40 },
986 + { "rt_sigaction", 174 },
987 + { "rt_sigpending", 176 },
988 + { "rt_sigprocmask", 175 },
989 + { "rt_sigqueueinfo", 178 },
990 + { "rt_sigreturn", 173 },
991 + { "rt_sigsuspend", 179 },
992 + { "rt_sigtimedwait", 177 },
993 + { "rt_tgsigqueueinfo", 330 },
994 + { "rtas", __PNR_rtas },
995 + { "s390_runtime_instr", 342 },
996 + { "sched_get_priority_max", 159 },
997 + { "sched_get_priority_min", 160 },
998 + { "sched_getaffinity" , 240 },
999 + { "sched_getattr", 346 },
1000 + { "sched_getparam", 155 },
1001 + { "sched_getscheduler", 157 },
1002 + { "sched_rr_get_interval", 161 },
1003 + { "sched_setaffinity" , 239 },
1004 + { "sched_setattr", 345 },
1005 + { "sched_setparam", 154 },
1006 + { "sched_setscheduler", 156 },
1007 + { "sched_yield", 158 },
1008 + { "seccomp", 348 },
1009 + { "security", __PNR_security },
1010 + { "select", 142 },
1011 + { "semctl", __PNR_semctl },
1012 + { "semget", __PNR_semget },
1013 + { "semop", __PNR_semop },
1014 + { "semtimedop", __PNR_semtimedop },
1015 + { "send", __PNR_send },
1016 + { "sendfile", 187 },
1017 + { "sendfile64", __PNR_sendfile64 },
1018 + { "sendmmsg", __PNR_sendmmsg },
1019 + { "sendmsg", __PNR_sendmsg },
1020 + { "sendto", __PNR_sendto },
1021 + { "set_mempolicy", __PNR_set_mempolicy },
1022 + { "set_robust_list" , 304 },
1023 + { "set_thread_area", __PNR_set_thread_area },
1024 + { "set_tid_address", 252 },
1025 + { "set_tls", __PNR_set_tls },
1026 + { "setdomainname", 121 },
1027 + { "setfsgid", 216 },
1028 + { "setfsgid32", __PNR_setfsgid32 },
1029 + { "setfsuid", 215 },
1030 + { "setfsuid32", __PNR_setfsuid32 },
1031 + { "setgid", 214 },
1032 + { "setgid32", __PNR_setgid32 },
1033 + { "setgroups", 206 },
1034 + { "setgroups32", __PNR_setgroups32 },
1035 + { "sethostname", 74 },
1036 + { "setitimer", 104 },
1037 + { "setns", 339 },
1038 + { "setpgid", 57 },
1039 + { "setpriority", 97 },
1040 + { "setregid", 204 },
1041 + { "setregid32", __PNR_setregid32 },
1042 + { "setresgid", 210 },
1043 + { "setresgid32", __PNR_setresgid32 },
1044 + { "setresuid", 208 },
1045 + { "setresuid32", __PNR_setresuid32 },
1046 + { "setreuid", 203 },
1047 + { "setreuid32", __PNR_setreuid32 },
1048 + { "setrlimit", 75 },
1049 + { "setsid", 66 },
1050 + { "setsockopt", __PNR_setsockopt },
1051 + { "settimeofday", 79 },
1052 + { "setuid", 213 },
1053 + { "setuid32", __PNR_setuid32 },
1054 + { "setxattr", 224 },
1055 + { "sgetmask", __PNR_sgetmask },
1056 + { "shmat", __PNR_shmat },
1057 + { "shmctl", __PNR_shmctl },
1058 + { "shmdt", __PNR_shmdt },
1059 + { "shmget", __PNR_shmget },
1060 + { "shutdown", __PNR_shutdown },
1061 + { "sigaction", 67 },
1062 + { "sigaltstack", 186 },
1063 + { "signal", 48 },
1064 + { "signalfd", 316 },
1065 + { "signalfd4", 322 },
1066 + { "sigpending", 73 },
1067 + { "sigprocmask", 126 },
1068 + { "sigreturn", 119 },
1069 + { "sigsuspend", 72 },
1070 + { "socket", __PNR_socket },
1071 + { "socketcall", 102 },
1072 + { "socketpair", __PNR_socketpair },
1073 + { "splice", 306 },
1074 + { "spu_create", __PNR_spu_create },
1075 + { "spu_run", __PNR_spu_run },
1076 + { "ssetmask", __PNR_ssetmask },
1077 + { "stat", 106 },
1078 + { "stat64", __PNR_stat64 },
1079 + { "statfs", 99 },
1080 + { "statfs64", 265 },
1081 + { "stime", __PNR_stime },
1082 + { "stty", __PNR_stty },
1083 + { "subpage_prot", __PNR_subpage_prot },
1084 + { "swapcontext", __PNR_swapcontext },
1085 + { "swapoff", 115 },
1086 + { "swapon", 87 },
1087 + { "switch_endian", __PNR_switch_endian },
1088 + { "symlink", 83 },
1089 + { "symlinkat", 297 },
1090 + { "sync", 36 },
1091 + { "sync_file_range" , 307 },
1092 + { "sync_file_range2", __PNR_sync_file_range2 },
1093 + { "syncfs", 338 },
1094 + { "syscall", __PNR_syscall },
1095 + { "sys_debug_setcontext", __PNR_sys_debug_setcontext },
1096 + { "sysfs", 135 },
1097 + { "sysinfo", 116 },
1098 + { "syslog", 103 },
1099 + { "sysmips", __PNR_sysmips },
1100 + { "tee", 308 },
1101 + { "tgkill", 241 },
1102 + { "time", __PNR_time },
1103 + { "timer_create", 254 },
1104 + { "timer_delete", 258 },
1105 + { "timer_getoverrun", 257 },
1106 + { "timer_gettime", 256 },
1107 + { "timer_settime", 255 },
1108 + { "timerfd", 317 },
1109 + { "timerfd_create", 319 },
1110 + { "timerfd_gettime", 321 },
1111 + { "timerfd_settime", 320 },
1112 + { "times", 43 },
1113 + { "tkill", 237 },
1114 + { "truncate", 92 },
1115 + { "truncate64", __PNR_truncate64 },
1116 + { "tuxcall", __PNR_tuxcall },
1117 + { "ugetrlimit", __PNR_ugetrlimit },
1118 + { "ulimit", __PNR_ulimit },
1119 + { "umask", 60 },
1120 + { "umount", 22 },
1121 + { "umount2", 52 },
1122 + { "uname", 122 },
1123 + { "unlink", 10 },
1124 + { "unlinkat", 294 },
1125 + { "unshare", 303 },
1126 + { "uselib", 86 },
1127 + { "usr26", __PNR_usr26 },
1128 + { "usr32", __PNR_usr32 },
1129 + { "ustat", 62 },
1130 + { "utime", 30 },
1131 + { "utimensat", 315 },
1132 + { "utimes", 313 },
1133 + { "vfork", 190 },
1134 + { "vhangup", 111 },
1135 + { "vm86", __PNR_vm86 },
1136 + { "vm86old", __PNR_vm86old },
1137 + { "vmsplice", 309 },
1138 + { "vserver", __PNR_vserver },
1139 + { "wait4", 114 },
1140 + { "waitid", 281 },
1141 + { "waitpid", __PNR_waitpid },
1142 + { "write", 4 },
1143 + { "writev", 146 },
1144 + { NULL, __NR_SCMP_ERROR },
1145 +};
1146 +
1147 +/**
1148 + * Resolve a syscall name to a number
1149 + * @param name the syscall name
1150 + *
1151 + * Resolve the given syscall name to the syscall number using the syscall table.
1152 + * Returns the syscall number on success, including negative pseudo syscall
1153 + * numbers; returns __NR_SCMP_ERROR on failure.
1154 + *
1155 + */
1156 +int s390x_syscall_resolve_name(const char *name)
1157 +{
1158 + unsigned int iter;
1159 + const struct arch_syscall_def *table = s390x_syscall_table;
1160 +
1161 + /* XXX - plenty of room for future improvement here */
1162 + for (iter = 0; table[iter].name != NULL; iter++) {
1163 + if (strcmp(name, table[iter].name) == 0)
1164 + return table[iter].num;
1165 + }
1166 +
1167 + return __NR_SCMP_ERROR;
1168 +}
1169 +
1170 +/**
1171 + * Resolve a syscall number to a name
1172 + * @param num the syscall number
1173 + *
1174 + * Resolve the given syscall number to the syscall name using the syscall table.
1175 + * Returns a pointer to the syscall name string on success, including pseudo
1176 + * syscall names; returns NULL on failure.
1177 + *
1178 + */
1179 +const char *s390x_syscall_resolve_num(int num)
1180 +{
1181 + unsigned int iter;
1182 + const struct arch_syscall_def *table = s390x_syscall_table;
1183 +
1184 + /* XXX - plenty of room for future improvement here */
1185 + for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
1186 + if (num == table[iter].num)
1187 + return table[iter].name;
1188 + }
1189 +
1190 + return NULL;
1191 +}
1192 +
1193 +/**
1194 + * Iterate through the syscall table and return the syscall name
1195 + * @param spot the offset into the syscall table
1196 + *
1197 + * Return the syscall name at position @spot or NULL on failure. This function
1198 + * should only ever be used internally by libseccomp.
1199 + *
1200 + */
1201 +const char *s390x_syscall_iterate_name(unsigned int spot)
1202 +{
1203 + /* XXX - no safety checks here */
1204 + return s390x_syscall_table[spot].name;
1205 +}
1206 diff --git a/src/arch-s390x.c b/src/arch-s390x.c
1207 new file mode 100644
1208 index 0000000..23c711c
1209 --- /dev/null
1210 +++ b/src/arch-s390x.c
1211 @@ -0,0 +1,18 @@
1212 +/*
1213 + * Copyright 2015 IBM
1214 + * Author: Jan Willeke <willeke@linux.vnet.com.com>
1215 + */
1216 +
1217 +#include <stdlib.h>
1218 +#include <errno.h>
1219 +#include <linux/audit.h>
1220 +
1221 +#include "arch.h"
1222 +#include "arch-s390x.h"
1223 +
1224 +const struct arch_def arch_def_s390x = {
1225 + .token = SCMP_ARCH_S390X,
1226 + .token_bpf = AUDIT_ARCH_S390X,
1227 + .size = ARCH_SIZE_64,
1228 + .endian = ARCH_ENDIAN_BIG,
1229 +};
1230 diff --git a/src/arch-s390x.h b/src/arch-s390x.h
1231 new file mode 100644
1232 index 0000000..054044b
1233 --- /dev/null
1234 +++ b/src/arch-s390x.h
1235 @@ -0,0 +1,26 @@
1236 +/*
1237 + * Copyright 2015 IBM
1238 + * Author: Jan Willeke <willeke@linux.vnet.com.com>
1239 + */
1240 +
1241 +#ifndef _ARCH_s390x_H
1242 +#define _ARCH_s390x_H
1243 +
1244 +#include <inttypes.h>
1245 +
1246 +#include "arch.h"
1247 +#include "system.h"
1248 +
1249 +#define s390x_arg_count_max 6
1250 +
1251 +extern const struct arch_def arch_def_s390x;
1252 +#define s390x_arg_offset(x) (offsetof(struct seccomp_data, args[x]))
1253 +
1254 +#define s390x_arg_offset_lo(x) (s390x_arg_offset(x) + 4)
1255 +#define s390x_arg_offset_hi(x) (s390x_arg_offset(x))
1256 +
1257 +int s390x_syscall_resolve_name(const char *name);
1258 +const char *s390x_syscall_resolve_num(int num);
1259 +const char *s390x_syscall_iterate_name(unsigned int spot);
1260 +const char *s390x_syscall_iterate_name(unsigned int spot);
1261 +#endif
1262 diff --git a/src/arch-syscall-check.c b/src/arch-syscall-check.c
1263 index 8682483..9668aec 100644
1264 --- a/src/arch-syscall-check.c
1265 +++ b/src/arch-syscall-check.c
1266 @@ -33,8 +33,10 @@
1267 #include "arch-mips.h"
1268 #include "arch-mips64.h"
1269 #include "arch-mips64n32.h"
1270 -#include "arch-ppc64.h"
1271 #include "arch-ppc.h"
1272 +#include "arch-ppc64.h"
1273 +#include "arch-s390.h"
1274 +#include "arch-s390x.h"
1275
1276 /**
1277 * compare the syscall values
1278 @@ -69,8 +71,10 @@ int main(int argc, char *argv[])
1279 int i_mips = 0;
1280 int i_mips64 = 0;
1281 int i_mips64n32 = 0;
1282 - int i_ppc64 = 0;
1283 int i_ppc = 0;
1284 + int i_ppc64 = 0;
1285 + int i_s390 = 0;
1286 + int i_s390x = 0;
1287 const char *sys_name;
1288 char str_miss[256];
1289
1290 @@ -97,10 +101,14 @@ int main(int argc, char *argv[])
1291 mips64_syscall_iterate_name(i_mips64));
1292 syscall_check(str_miss, sys_name, "mips64n32",
1293 mips64n32_syscall_iterate_name(i_mips64n32));
1294 - syscall_check(str_miss, sys_name, "ppc64",
1295 - ppc64_syscall_iterate_name(i_ppc64));
1296 syscall_check(str_miss, sys_name, "ppc",
1297 ppc_syscall_iterate_name(i_ppc));
1298 + syscall_check(str_miss, sys_name, "ppc64",
1299 + ppc64_syscall_iterate_name(i_ppc64));
1300 + syscall_check(str_miss, sys_name, "s390",
1301 + s390_syscall_iterate_name(i_s390));
1302 + syscall_check(str_miss, sys_name, "s390x",
1303 + s390x_syscall_iterate_name(i_s390x));
1304
1305 /* output the results */
1306 printf("%s: ", sys_name);
1307 @@ -127,14 +135,19 @@ int main(int argc, char *argv[])
1308 i_mips64 = -1;
1309 if (!mips64n32_syscall_iterate_name(++i_mips64n32))
1310 i_mips64n32 = -1;
1311 - if (!ppc64_syscall_iterate_name(++i_ppc64))
1312 - i_ppc64 = -1;
1313 if (!ppc_syscall_iterate_name(++i_ppc))
1314 i_ppc = -1;
1315 + if (!ppc64_syscall_iterate_name(++i_ppc64))
1316 + i_ppc64 = -1;
1317 + if (!s390_syscall_iterate_name(++i_s390))
1318 + i_s390 = -1;
1319 + if (!s390x_syscall_iterate_name(++i_s390x))
1320 + i_s390x = -1;
1321 } while (i_x86_64 >= 0 && i_x32 >= 0 &&
1322 i_arm >= 0 && i_aarch64 >= 0 &&
1323 i_mips >= 0 && i_mips64 >= 0 && i_mips64n32 >= 0 &&
1324 - i_ppc64 >= 0 && i_ppc >= 0);
1325 + i_ppc >= 0 && i_ppc64 >= 0 &&
1326 + i_s390 >= 0 && i_s390x >= 0);
1327
1328 /* check for any leftovers */
1329 sys_name = x86_syscall_iterate_name(i_x86 + 1);
1330 @@ -177,14 +190,23 @@ int main(int argc, char *argv[])
1331 mips64n32_syscall_iterate_name(i_mips64n32));
1332 return 1;
1333 }
1334 + if (i_ppc >= 0) {
1335 + printf("%s: ERROR, ppc has additional syscalls\n",
1336 + ppc_syscall_iterate_name(i_ppc));
1337 + }
1338 if (i_ppc64 >= 0) {
1339 printf("%s: ERROR, ppc64 has additional syscalls\n",
1340 ppc64_syscall_iterate_name(i_ppc64));
1341 return 1;
1342 }
1343 - if (i_ppc >= 0) {
1344 - printf("%s: ERROR, ppc has additional syscalls\n",
1345 - ppc_syscall_iterate_name(i_ppc));
1346 + if (i_s390 >= 0) {
1347 + printf("%s: ERROR, s390 has additional syscalls\n",
1348 + s390_syscall_iterate_name(i_s390));
1349 + return 1;
1350 + }
1351 + if (i_s390x >= 0) {
1352 + printf("%s: ERROR, s390x has additional syscalls\n",
1353 + s390x_syscall_iterate_name(i_s390x));
1354 return 1;
1355 }
1356
1357 diff --git a/src/arch-syscall-dump.c b/src/arch-syscall-dump.c
1358 index 62992e7..4534aec 100644
1359 --- a/src/arch-syscall-dump.c
1360 +++ b/src/arch-syscall-dump.c
1361 @@ -38,8 +38,10 @@
1362 #include "arch-mips64.h"
1363 #include "arch-mips64n32.h"
1364 #include "arch-aarch64.h"
1365 -#include "arch-ppc64.h"
1366 #include "arch-ppc.h"
1367 +#include "arch-ppc64.h"
1368 +#include "arch-s390.h"
1369 +#include "arch-s390x.h"
1370
1371 /**
1372 * Print the usage information to stderr and exit
1373 @@ -114,13 +116,19 @@ int main(int argc, char *argv[])
1374 case SCMP_ARCH_MIPSEL64N32:
1375 sys_name = mips64n32_syscall_iterate_name(iter);
1376 break;
1377 + case SCMP_ARCH_PPC:
1378 + sys_name = ppc_syscall_iterate_name(iter);
1379 + break;
1380 case SCMP_ARCH_PPC64:
1381 + case SCMP_ARCH_PPC64LE:
1382 sys_name = ppc64_syscall_iterate_name(iter);
1383 break;
1384 - case SCMP_ARCH_PPC:
1385 - sys_name = ppc_syscall_iterate_name(iter);
1386 + case SCMP_ARCH_S390:
1387 + sys_name = s390_syscall_iterate_name(iter);
1388 + break;
1389 + case SCMP_ARCH_S390X:
1390 + sys_name = s390x_syscall_iterate_name(iter);
1391 break;
1392 -
1393 default:
1394 /* invalid arch */
1395 exit_usage(argv[0]);
1396 diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate
1397 index ba5cd89..89cce3a 100755
1398 --- a/src/arch-syscall-validate
1399 +++ b/src/arch-syscall-validate
1400 @@ -319,6 +319,29 @@ function dump_lib_mips64n32() {
1401 }
1402
1403 #
1404 +# Dump the ppc system syscall table
1405 +#
1406 +# Arguments:
1407 +# 1 path to the kernel source
1408 +#
1409 +# Dump the architecture's syscall table to stdout.
1410 +#
1411 +function dump_sys_ppc() {
1412 + gcc -E -dM $1/arch/powerpc/include/uapi/asm/unistd.h | \
1413 + grep "^#define __NR_" | sort | \
1414 + sed -e 's/#define[ \t]\+__NR_\([a-z0-9_]\+\)[ \t]\+\([0-9]\+\)/\1\t\2/'
1415 +}
1416 +
1417 +#
1418 +# Dump the ppc library syscall table
1419 +#
1420 +# Dump the library's syscall table to stdout.
1421 +#
1422 +function dump_lib_ppc() {
1423 + $LIB_SYS_DUMP -a ppc | sed -e '/[^\t]\+\t-[0-9]\+/d'
1424 +}
1425 +
1426 +#
1427 # Dump the ppc64 system syscall table
1428 #
1429 # Arguments:
1430 @@ -342,26 +365,47 @@ function dump_lib_ppc64() {
1431 }
1432
1433 #
1434 -# Dump the ppc system syscall table
1435 +# Dump the s390 system syscall table
1436 #
1437 # Arguments:
1438 # 1 path to the kernel source
1439 #
1440 # Dump the architecture's syscall table to stdout.
1441 #
1442 -function dump_sys_ppc() {
1443 - gcc -E -dM $1/arch/powerpc/include/uapi/asm/unistd.h | \
1444 - grep "^#define __NR_" | sort | \
1445 - sed -e 's/#define[ \t]\+__NR_\([a-z0-9_]\+\)[ \t]\+\([0-9]\+\)/\1\t\2/'
1446 +function dump_sys_s390() {
1447 + gcc -dM -m31 -E $1/arch/s390/include/uapi/asm/unistd.h | grep __NR | \
1448 + sed 's/#define __NR_//g' | sed 's/ /\t/g' | sort
1449 }
1450
1451 #
1452 -# Dump the ppc library syscall table
1453 +# Dump the s390 library syscall table
1454 #
1455 # Dump the library's syscall table to stdout.
1456 #
1457 -function dump_lib_ppc() {
1458 - $LIB_SYS_DUMP -a ppc | sed -e '/[^\t]\+\t-[0-9]\+/d'
1459 +function dump_lib_s390() {
1460 + $LIB_SYS_DUMP -a s390 | grep -v - | sort
1461 +}
1462 +
1463 +#
1464 +# Dump the s390x system syscall table
1465 +#
1466 +# Arguments:
1467 +# 1 path to the kernel source
1468 +#
1469 +# Dump the architecture's syscall table to stdout.
1470 +#
1471 +function dump_sys_s390x() {
1472 + gcc -dM -E $1/arch/s390/include/uapi/asm/unistd.h | grep __NR | \
1473 + sed 's/#define __NR_//g' | sed 's/ /\t/g' | sort
1474 +}
1475 +
1476 +#
1477 +# Dump the s390x library syscall table
1478 +#
1479 +# Dump the library's syscall table to stdout.
1480 +#
1481 +function dump_lib_s390x() {
1482 + $LIB_SYS_DUMP -a s390x | grep -v - | sort
1483 }
1484
1485 #
1486 @@ -399,11 +443,17 @@ function dump_sys() {
1487 mips64n32)
1488 dump_sys_mips64n32 "$2"
1489 ;;
1490 + ppc)
1491 + dump_sys_ppc "$2"
1492 + ;;
1493 ppc64)
1494 dump_sys_ppc64 "$2"
1495 ;;
1496 - ppc)
1497 - dump_sys_ppc "$2"
1498 + s390)
1499 + dump_sys_s390 "$2"
1500 + ;;
1501 + s390x)
1502 + dump_sys_s390x "$2"
1503 ;;
1504 *)
1505 echo ""
1506 @@ -445,11 +495,17 @@ function dump_lib() {
1507 mips64n32)
1508 dump_lib_mips64n32 "$2"
1509 ;;
1510 + ppc)
1511 + dump_lib_ppc "$2"
1512 + ;;
1513 ppc64)
1514 dump_lib_ppc64 "$2"
1515 ;;
1516 - ppc)
1517 - dump_lib_ppc "$2"
1518 + s390)
1519 + dump_lib_s390 "$2"
1520 + ;;
1521 + s390x)
1522 + dump_lib_s390x "$2"
1523 ;;
1524 *)
1525 echo ""
1526 @@ -497,7 +553,12 @@ shift $(($OPTIND - 1))
1527
1528 # defaults
1529 if [[ $arches == "" ]]; then
1530 - arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32 ppc pcc64"
1531 + arches=" \
1532 + x86 x86_64 x32 \
1533 + arm aarch64 \
1534 + mips mips64 mips64n32 \
1535 + ppc pcc64 \
1536 + s390 s390x"
1537 fi
1538
1539 # sanity checks
1540 diff --git a/src/arch-x32-syscalls.c b/src/arch-x32-syscalls.c
1541 index 66a58a1..d6ea9d4 100644
1542 --- a/src/arch-x32-syscalls.c
1543 +++ b/src/arch-x32-syscalls.c
1544 @@ -296,6 +296,7 @@ const struct arch_syscall_def x32_syscall_table[] = { \
1545 { "rt_sigtimedwait", (X32_SYSCALL_BIT + 523) },
1546 { "rt_tgsigqueueinfo", (X32_SYSCALL_BIT + 536) },
1547 { "rtas", __PNR_rtas },
1548 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
1549 { "sched_get_priority_max", (X32_SYSCALL_BIT + 146) },
1550 { "sched_get_priority_min", (X32_SYSCALL_BIT + 147) },
1551 { "sched_getaffinity", (X32_SYSCALL_BIT + 204) },
1552 diff --git a/src/arch-x86-syscalls.c b/src/arch-x86-syscalls.c
1553 index 53f7cfa..b6665aa 100644
1554 --- a/src/arch-x86-syscalls.c
1555 +++ b/src/arch-x86-syscalls.c
1556 @@ -296,6 +296,7 @@ const struct arch_syscall_def x86_syscall_table[] = { \
1557 { "rt_sigtimedwait", 177 },
1558 { "rt_tgsigqueueinfo", 335 },
1559 { "rtas", __PNR_rtas },
1560 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
1561 { "sched_get_priority_max", 159 },
1562 { "sched_get_priority_min", 160 },
1563 { "sched_getaffinity", 242 },
1564 diff --git a/src/arch-x86_64-syscalls.c b/src/arch-x86_64-syscalls.c
1565 index b50ec23..90cc21f 100644
1566 --- a/src/arch-x86_64-syscalls.c
1567 +++ b/src/arch-x86_64-syscalls.c
1568 @@ -296,6 +296,7 @@ const struct arch_syscall_def x86_64_syscall_table[] = { \
1569 { "rt_sigtimedwait", 128 },
1570 { "rt_tgsigqueueinfo", 297 },
1571 { "rtas", __PNR_rtas },
1572 + { "s390_runtime_instr", __PNR_s390_runtime_instr },
1573 { "sched_get_priority_max", 146 },
1574 { "sched_get_priority_min", 147 },
1575 { "sched_getaffinity", 204 },
1576 diff --git a/src/arch.c b/src/arch.c
1577 index 5bb7f69..33f35a7 100644
1578 --- a/src/arch.c
1579 +++ b/src/arch.c
1580 @@ -38,8 +38,10 @@
1581 #include "arch-mips.h"
1582 #include "arch-mips64.h"
1583 #include "arch-mips64n32.h"
1584 -#include "arch-ppc64.h"
1585 #include "arch-ppc.h"
1586 +#include "arch-ppc64.h"
1587 +#include "arch-s390.h"
1588 +#include "arch-s390x.h"
1589 #include "system.h"
1590
1591 #define default_arg_count_max 6
1592 @@ -84,6 +86,10 @@ const struct arch_def *arch_def_native = &arch_def_ppc64le;
1593 #endif
1594 #elif __PPC__
1595 const struct arch_def *arch_def_native = &arch_def_ppc;
1596 +#elif __s390x__ /* s390x must be checked before s390 */
1597 +const struct arch_def *arch_def_native = &arch_def_s390x;
1598 +#elif __s390__
1599 +const struct arch_def *arch_def_native = &arch_def_s390;
1600 #else
1601 #error the arch code needs to know about your machine type
1602 #endif /* machine type guess */
1603 @@ -132,12 +138,16 @@ const struct arch_def *arch_def_lookup(uint32_t token)
1604 return &arch_def_mips64n32;
1605 case SCMP_ARCH_MIPSEL64N32:
1606 return &arch_def_mipsel64n32;
1607 + case SCMP_ARCH_PPC:
1608 + return &arch_def_ppc;
1609 case SCMP_ARCH_PPC64:
1610 return &arch_def_ppc64;
1611 case SCMP_ARCH_PPC64LE:
1612 return &arch_def_ppc64le;
1613 - case SCMP_ARCH_PPC:
1614 - return &arch_def_ppc;
1615 + case SCMP_ARCH_S390:
1616 + return &arch_def_s390;
1617 + case SCMP_ARCH_S390X:
1618 + return &arch_def_s390x;
1619 }
1620
1621 return NULL;
1622 @@ -174,12 +184,16 @@ const struct arch_def *arch_def_lookup_name(const char *arch_name)
1623 return &arch_def_mips64n32;
1624 else if (strcmp(arch_name, "mipsel64n32") == 0)
1625 return &arch_def_mipsel64n32;
1626 + else if (strcmp(arch_name, "ppc") == 0)
1627 + return &arch_def_ppc;
1628 else if (strcmp(arch_name, "ppc64") == 0)
1629 return &arch_def_ppc64;
1630 else if (strcmp(arch_name, "ppc64le") == 0)
1631 return &arch_def_ppc64le;
1632 - else if (strcmp(arch_name, "ppc") == 0)
1633 - return &arch_def_ppc;
1634 + else if (strcmp(arch_name, "s390") == 0)
1635 + return &arch_def_s390;
1636 + else if (strcmp(arch_name, "s390x") == 0)
1637 + return &arch_def_s390x;
1638
1639 return NULL;
1640 }
1641 @@ -298,11 +312,15 @@ int arch_syscall_resolve_name(const struct arch_def *arch, const char *name)
1642 case SCMP_ARCH_MIPS64N32:
1643 case SCMP_ARCH_MIPSEL64N32:
1644 return mips64n32_syscall_resolve_name(name);
1645 + case SCMP_ARCH_PPC:
1646 + return ppc_syscall_resolve_name(name);
1647 case SCMP_ARCH_PPC64:
1648 case SCMP_ARCH_PPC64LE:
1649 return ppc64_syscall_resolve_name(name);
1650 - case SCMP_ARCH_PPC:
1651 - return ppc_syscall_resolve_name(name);
1652 + case SCMP_ARCH_S390:
1653 + return s390_syscall_resolve_name(name);
1654 + case SCMP_ARCH_S390X:
1655 + return s390x_syscall_resolve_name(name);
1656 }
1657
1658 return __NR_SCMP_ERROR;
1659 @@ -340,11 +358,15 @@ const char *arch_syscall_resolve_num(const struct arch_def *arch, int num)
1660 case SCMP_ARCH_MIPS64N32:
1661 case SCMP_ARCH_MIPSEL64N32:
1662 return mips64n32_syscall_resolve_num(num);
1663 + case SCMP_ARCH_PPC:
1664 + return ppc_syscall_resolve_num(num);
1665 case SCMP_ARCH_PPC64:
1666 case SCMP_ARCH_PPC64LE:
1667 return ppc64_syscall_resolve_num(num);
1668 - case SCMP_ARCH_PPC:
1669 - return ppc_syscall_resolve_num(num);
1670 + case SCMP_ARCH_S390:
1671 + return s390_syscall_resolve_num(num);
1672 + case SCMP_ARCH_S390X:
1673 + return s390x_syscall_resolve_num(num);
1674 }
1675
1676 return NULL;
1677 diff --git a/src/gen_pfc.c b/src/gen_pfc.c
1678 index 4f2ee4f..ae8361f 100644
1679 --- a/src/gen_pfc.c
1680 +++ b/src/gen_pfc.c
1681 @@ -71,6 +71,10 @@ static const char *_pfc_arch(const struct arch_def *arch)
1682 return "mips64n32";
1683 case SCMP_ARCH_MIPSEL64N32:
1684 return "mipsel64n32";
1685 + case SCMP_ARCH_S390X:
1686 + return "s390x";
1687 + case SCMP_ARCH_S390:
1688 + return "s390";
1689 default:
1690 return "UNKNOWN";
1691 }
1692 diff --git a/src/python/libseccomp.pxd b/src/python/libseccomp.pxd
1693 index e9c0f6a..1f29c5f 100644
1694 --- a/src/python/libseccomp.pxd
1695 +++ b/src/python/libseccomp.pxd
1696 @@ -38,9 +38,11 @@ cdef extern from "seccomp.h":
1697 SCMP_ARCH_MIPSEL
1698 SCMP_ARCH_MIPSEL64
1699 SCMP_ARCH_MIPSEL64N32
1700 + SCMP_ARCH_PPC
1701 SCMP_ARCH_PPC64
1702 SCMP_ARCH_PPC64LE
1703 - SCMP_ARCH_PPC
1704 + SCMP_ARCH_S390
1705 + SCMP_ARCH_S390X
1706
1707 cdef enum scmp_filter_attr:
1708 SCMP_FLTATR_ACT_DEFAULT
1709 diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx
1710 index 18360a7..2d753a9 100644
1711 --- a/src/python/seccomp.pyx
1712 +++ b/src/python/seccomp.pyx
1713 @@ -165,9 +165,11 @@ cdef class Arch:
1714 MIPSEL = libseccomp.SCMP_ARCH_MIPSEL
1715 MIPSEL64 = libseccomp.SCMP_ARCH_MIPSEL64
1716 MIPSEL64N32 = libseccomp.SCMP_ARCH_MIPSEL64N32
1717 + PPC = libseccomp.SCMP_ARCH_PPC
1718 PPC64 = libseccomp.SCMP_ARCH_PPC64
1719 PPC64LE = libseccomp.SCMP_ARCH_PPC64LE
1720 - PPC = libseccomp.SCMP_ARCH_PPC
1721 + S390 = libseccomp.SCMP_ARCH_S390
1722 + S390X = libseccomp.SCMP_ARCH_S390X
1723
1724 def __cinit__(self, arch=libseccomp.SCMP_ARCH_NATIVE):
1725 """ Initialize the architecture object.
1726 @@ -203,12 +205,16 @@ cdef class Arch:
1727 self._token = libseccomp.SCMP_ARCH_MIPSEL64
1728 elif arch == libseccomp.SCMP_ARCH_MIPSEL64N32:
1729 self._token = libseccomp.SCMP_ARCH_MIPSEL64N32
1730 + elif arch == libseccomp.SCMP_ARCH_PPC:
1731 + self._token = libseccomp.SCMP_ARCH_PPC
1732 elif arch == libseccomp.SCMP_ARCH_PPC64:
1733 self._token = libseccomp.SCMP_ARCH_PPC64
1734 elif arch == libseccomp.SCMP_ARCH_PPC64LE:
1735 self._token = libseccomp.SCMP_ARCH_PPC64LE
1736 - elif arch == libseccomp.SCMP_ARCH_PPC:
1737 - self._token = libseccomp.SCMP_ARCH_PPC
1738 + elif arch == libseccomp.SCMP_ARCH_S390:
1739 + self._token = libseccomp.SCMP_ARCH_S390
1740 + elif arch == libseccomp.SCMP_ARCH_S390X:
1741 + self._token = libseccomp.SCMP_ARCH_S390X
1742 else:
1743 self._token = 0;
1744 elif isinstance(arch, basestring):
1745 diff --git a/tests/20-live-basic_die.py b/tests/20-live-basic_die.py
1746 index c9f437f..4d5b914 100755
1747 --- a/tests/20-live-basic_die.py
1748 +++ b/tests/20-live-basic_die.py
1749 @@ -34,6 +34,7 @@ def test():
1750 util.install_trap()
1751 f = SyscallFilter(action)
1752 f.add_rule(ALLOW, "rt_sigreturn")
1753 + f.add_rule(ALLOW, "sigreturn")
1754 f.add_rule(ALLOW, "exit_group")
1755 f.load()
1756 try:
1757 diff --git a/tests/21-live-basic_allow.py b/tests/21-live-basic_allow.py
1758 index 97dd61a..df79c9d 100755
1759 --- a/tests/21-live-basic_allow.py
1760 +++ b/tests/21-live-basic_allow.py
1761 @@ -46,6 +46,8 @@ def test():
1762 f.add_rule(ALLOW, "close")
1763 f.add_rule(ALLOW, "rt_sigaction")
1764 f.add_rule(ALLOW, "rt_sigreturn")
1765 + f.add_rule(ALLOW, "sigreturn")
1766 + f.add_rule(ALLOW, "brk")
1767 f.add_rule(ALLOW, "exit_group")
1768 f.load()
1769 try:
1770 diff --git a/tests/26-sim-arch_all_be_basic.c b/tests/26-sim-arch_all_be_basic.c
1771 index 91fcbea..d2c191c 100644
1772 --- a/tests/26-sim-arch_all_be_basic.c
1773 +++ b/tests/26-sim-arch_all_be_basic.c
1774 @@ -52,10 +52,16 @@ int main(int argc, char *argv[])
1775 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mips64n32"));
1776 if (rc != 0)
1777 goto out;
1778 + rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("ppc"));
1779 + if (rc != 0)
1780 + goto out;
1781 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("ppc64"));
1782 if (rc != 0)
1783 goto out;
1784 - rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("ppc"));
1785 + rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("s390"));
1786 + if (rc != 0)
1787 + goto out;
1788 + rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("s390x"));
1789 if (rc != 0)
1790 goto out;
1791
1792 diff --git a/tests/26-sim-arch_all_be_basic.py b/tests/26-sim-arch_all_be_basic.py
1793 index 1537013..b0b660a 100755
1794 --- a/tests/26-sim-arch_all_be_basic.py
1795 +++ b/tests/26-sim-arch_all_be_basic.py
1796 @@ -33,8 +33,10 @@ def test(args):
1797 f.add_arch(Arch("mips"))
1798 f.add_arch(Arch("mips64"))
1799 f.add_arch(Arch("mips64n32"))
1800 - f.add_arch(Arch("ppc64"))
1801 f.add_arch(Arch("ppc"))
1802 + f.add_arch(Arch("ppc64"))
1803 + f.add_arch(Arch("s390"))
1804 + f.add_arch(Arch("s390x"))
1805 f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
1806 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
1807 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
1808 diff --git a/tests/regression b/tests/regression
1809 index 6bf6ea3..53d26b2 100755
1810 --- a/tests/regression
1811 +++ b/tests/regression
1812 @@ -28,7 +28,8 @@ GLBL_ARCH_LE_SUPPORT=" \
1813 ppc64le"
1814 GLBL_ARCH_BE_SUPPORT=" \
1815 mips mips64 mips64n32 \
1816 - ppc64 ppc"
1817 + ppc ppc64 \
1818 + s390 s390x"
1819
1820 GLBL_SYS_ARCH="../tools/scmp_arch_detect"
1821 GLBL_SYS_RESOLVER="../tools/scmp_sys_resolver"
1822 @@ -700,7 +701,7 @@ function run_test_live() {
1823
1824 # setup the arch specific return values
1825 case "$arch" in
1826 - x86|x86_64|x32|arm|aarch64|ppc64|ppc64le|ppc)
1827 + x86|x86_64|x32|arm|aarch64|ppc|ppc64|ppc64le|ppc|s390|s390x)
1828 rc_kill=159
1829 rc_allow=160
1830 rc_trap=161
1831 diff --git a/tools/scmp_arch_detect.c b/tools/scmp_arch_detect.c
1832 index 03644c6..51c45c9 100644
1833 --- a/tools/scmp_arch_detect.c
1834 +++ b/tools/scmp_arch_detect.c
1835 @@ -99,14 +99,20 @@ int main(int argc, char *argv[])
1836 case SCMP_ARCH_MIPSEL64N32:
1837 printf("mipsel64n32\n");
1838 break;
1839 + case SCMP_ARCH_PPC:
1840 + printf("ppc\n");
1841 + break;
1842 case SCMP_ARCH_PPC64:
1843 printf("ppc64\n");
1844 break;
1845 case SCMP_ARCH_PPC64LE:
1846 printf("ppc64le\n");
1847 break;
1848 - case SCMP_ARCH_PPC:
1849 - printf("ppc\n");
1850 + case SCMP_ARCH_S390:
1851 + printf("s390\n");
1852 + break;
1853 + case SCMP_ARCH_S390X:
1854 + printf("s390x\n");
1855 break;
1856 default:
1857 printf("unknown\n");
1858 diff --git a/tools/scmp_bpf_sim.c b/tools/scmp_bpf_sim.c
1859 index 6b70105..ddd216c 100644
1860 --- a/tools/scmp_bpf_sim.c
1861 +++ b/tools/scmp_bpf_sim.c
1862 @@ -265,12 +265,16 @@ int main(int argc, char *argv[])
1863 arch = AUDIT_ARCH_MIPS64N32;
1864 else if (strcmp(optarg, "mipsel64n32") == 0)
1865 arch = AUDIT_ARCH_MIPSEL64N32;
1866 + else if (strcmp(optarg, "ppc") == 0)
1867 + arch = AUDIT_ARCH_PPC;
1868 else if (strcmp(optarg, "ppc64") == 0)
1869 arch = AUDIT_ARCH_PPC64;
1870 else if (strcmp(optarg, "ppc64le") == 0)
1871 arch = AUDIT_ARCH_PPC64LE;
1872 - else if (strcmp(optarg, "ppc") == 0)
1873 - arch = AUDIT_ARCH_PPC;
1874 + else if (strcmp(optarg, "s390") == 0)
1875 + arch = AUDIT_ARCH_S390;
1876 + else if (strcmp(optarg, "s390x") == 0)
1877 + arch = AUDIT_ARCH_S390X;
1878 else
1879 exit_fault(EINVAL);
1880 break;
1881 diff --git a/tools/util.c b/tools/util.c
1882 index a52c865..5b21559 100644
1883 --- a/tools/util.c
1884 +++ b/tools/util.c
1885 @@ -70,6 +70,10 @@
1886 #endif
1887 #elif __PPC__
1888 #define ARCH_NATIVE AUDIT_ARCH_PPC
1889 +#elif __s390x__ /* s390x must be checked before s390 */
1890 +#define ARCH_NATIVE AUDIT_ARCH_S390X
1891 +#elif __s390__
1892 +#define ARCH_NATIVE AUDIT_ARCH_S390
1893 #else
1894 #error the simulator code needs to know about your machine type
1895 #endif
+0
-16
debian/patches/manpage-typo.patch less more
0 Description: fix typo in manpage, noticed by lintian.
1 Author: Kees Cook <kees@debian.org>
2
3 Index: libseccomp-2.1.0/doc/man/man1/scmp_sys_resolver.1
4 ===================================================================
5 --- libseccomp-2.1.0.orig/doc/man/man1/scmp_sys_resolver.1 2013-05-29 11:46:16.000000000 -0700
6 +++ libseccomp-2.1.0/doc/man/man1/scmp_sys_resolver.1 2013-08-13 00:34:46.002565608 -0700
7 @@ -37,7 +37,7 @@
8 values are "x86", "x86_64", "x32", and "arm".
9 .TP
10 .B \-t
11 -If neccessary, translate the system call name to the proper system call number,
12 +If necessary, translate the system call name to the proper system call number,
13 even if the system call name is different, e.g. socket(2) on x86.
14 .TP
15 .B \-h
+0
-26
debian/patches/pkgconfig-macro.patch less more
0 Description: this bash trick doesn't work for some reason, so just replace
1 with the needed literal "libseccomp.pc" instead.
2 Author: Kees Cook <kees@debian.org>
3
4 Index: libseccomp-2.1.0/macros.mk
5 ===================================================================
6 --- libseccomp-2.1.0.orig/macros.mk 2013-08-13 00:02:48.756235141 -0700
7 +++ libseccomp-2.1.0/macros.mk 2013-08-13 00:02:48.752235086 -0700
8 @@ -185,15 +185,13 @@
9
10 ifeq ($(V),0)
11 INSTALL_PC_MACRO = \
12 - @echo " INSTALL $$(cat /proc/$$$$/cmdline | awk '{print $$(NF)}')" \
13 - " ($(INSTALL_LIB_DIR)/pkgconfig)";
14 + @echo " INSTALL libseccomp.pc ($(INSTALL_LIB_DIR)/pkgconfig)";
15 endif
16 INSTALL_PC_MACRO += \
17 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
18 -d "$(INSTALL_LIB_DIR)/pkgconfig"; \
19 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
20 - "$$(cat /proc/$$$$/cmdline | awk '{print $$(NF)}')" \
21 - "$(INSTALL_LIB_DIR)/pkgconfig"; \#
22 + "libseccomp.pc" "$(INSTALL_LIB_DIR)/pkgconfig"; \#
23
24 ifeq ($(V),0)
25 INSTALL_INC_MACRO = @echo " INSTALL $^ ($(INSTALL_INC_DIR))";
0 pkgconfig-macro.patch
1 manpage-typo.patch
2 build-ldflags.patch
0 git-29753076fddfed772511c67887bed1f0621b32cf.diff
1 git-18c7d1176fb236d98656eb4f4cd0343ebcfe5cc0.diff
2 git-fc886cbe8128e8544f5d197dfd0971403ee203b5.diff
3 git-13386c1fd34834b6c9d46d36c43616b623736a93.diff
4 git-7f3ae6e6a12390bd38f0787b242f60c47ad076c3.diff
5 git-a8fe571909e381b34d0ae0237aad71513f8739de.diff
6 add-membarrier.patch
7 add-x86-32bit-socket-calls.patch
44 #export DH_VERBOSE=1
55 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
66
7 LIBPKG := libseccomp2
8 DEVPKG := libseccomp-dev
9
710 # Enable verbose build details.
811 export V=1
912
1013 %:
11 dh $@ --parallel
14 dh $@ --parallel --with autoreconf
1215
1316 override_dh_auto_clean:
14 $(MAKE) dist-clean
17 dh_auto_clean
1518 rm -f regression.out
1619
17 override_dh_auto_configure:
18 ./configure --prefix=/usr \
19 --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
20 override_dh_link:
21 dh_link -p$(DEVPKG) \
22 lib/$(DEB_HOST_MULTIARCH)/$$(basename $$(readlink debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libseccomp.so)) \
23 usr/lib/$(DEB_HOST_MULTIARCH)/libseccomp.so
24 dh_link --remaining-packages
25
26 override_dh_install:
27 dh_install -p$(LIBPKG) \
28 "usr/lib/$(DEB_HOST_MULTIARCH)/libseccomp.so.*" \
29 lib/$(DEB_HOST_MULTIARCH)
30 dh_install --remaining-packages --list-missing
2031
2132 override_dh_auto_test:
2233 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
00 # See uscan(1) for format
11 version=3
22 opts=dversionmangle=s/\+dfsg// \
3 http://sf.net/libseccomp/libseccomp-(.*)\.tar\.gz \
3 https://github.com/seccomp/libseccomp/releases \
4 /download/v.*/libseccomp-(.*)\.tar\.gz \
45 debian uupdate
+0
-74
doc/Makefile less more
0 #
1 # Enhanced Seccomp Library Makefile
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 # macros
23 #
24
25 include ../macros.mk
26
27 #
28 # configuration
29 #
30
31 include $(TOPDIR)/version_info.mk
32 include $(TOPDIR)/configure.mk
33 include $(TOPDIR)/install.mk
34
35 MAN1 = \
36 man/man1/scmp_sys_resolver.1
37
38 MAN3 = \
39 man/man3/seccomp_init.3 \
40 man/man3/seccomp_load.3 \
41 man/man3/seccomp_release.3 \
42 man/man3/seccomp_reset.3 \
43 man/man3/seccomp_rule_add.3 \
44 man/man3/seccomp_rule_add_exact.3 \
45 man/man3/seccomp_syscall_priority.3 \
46 man/man3/seccomp_syscall_resolve_name.3 \
47 man/man3/seccomp_syscall_resolve_name_arch.3 \
48 man/man3/seccomp_syscall_resolve_num_arch.3 \
49 man/man3/seccomp_export_bpf.3 \
50 man/man3/seccomp_export_pfc.3 \
51 man/man3/seccomp_attr_set.3 \
52 man/man3/seccomp_attr_get.3 \
53 man/man3/seccomp_arch_add.3 \
54 man/man3/seccomp_arch_exist.3 \
55 man/man3/seccomp_arch_native.3 \
56 man/man3/seccomp_arch_remove.3 \
57 man/man3/seccomp_merge.3
58
59 #
60 # targets
61 #
62
63 .PHONY: all install install_man1 install_man3
64
65 all:
66
67 install: install_man1 install_man3
68
69 install_man1: $(MAN1)
70 $(INSTALL_MAN1_MACRO)
71
72 install_man3: $(MAN3)
73 $(INSTALL_MAN3_MACRO)
0 ####
1 # Seccomp Library Documentation
2 #
3
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the terms of version 2.1 of the GNU Lesser General Public License
7 # as published by the Free Software Foundation.
8 #
9 # This library is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses>.
16 #
17
18 dist_man1_MANS = \
19 man/man1/scmp_sys_resolver.1
20
21 dist_man3_MANS = \
22 man/man3/seccomp_arch_add.3 \
23 man/man3/seccomp_arch_exist.3 \
24 man/man3/seccomp_arch_native.3 \
25 man/man3/seccomp_arch_remove.3 \
26 man/man3/seccomp_arch_resolve_name.3 \
27 man/man3/seccomp_attr_get.3 \
28 man/man3/seccomp_attr_set.3 \
29 man/man3/seccomp_export_bpf.3 \
30 man/man3/seccomp_export_pfc.3 \
31 man/man3/seccomp_init.3 \
32 man/man3/seccomp_load.3 \
33 man/man3/seccomp_merge.3 \
34 man/man3/seccomp_release.3 \
35 man/man3/seccomp_reset.3 \
36 man/man3/seccomp_rule_add.3 \
37 man/man3/seccomp_rule_add_array.3 \
38 man/man3/seccomp_rule_add_exact.3 \
39 man/man3/seccomp_rule_add_exact_array.3 \
40 man/man3/seccomp_syscall_priority.3 \
41 man/man3/seccomp_syscall_resolve_name.3 \
42 man/man3/seccomp_syscall_resolve_name_arch.3 \
43 man/man3/seccomp_syscall_resolve_name_rewrite.3 \
44 man/man3/seccomp_syscall_resolve_num_arch.3
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
4
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 ####
17 # Seccomp Library Documentation
18 #
19
20 #
21 # This library is free software; you can redistribute it and/or modify it
22 # under the terms of version 2.1 of the GNU Lesser General Public License
23 # as published by the Free Software Foundation.
24 #
25 # This library is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
28 # General Public License for more details.
29 #
30 # You should have received a copy of the GNU Lesser General Public License
31 # along with this library; if not, see <http://www.gnu.org/licenses>.
32 #
33 VPATH = @srcdir@
34 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
35 am__make_running_with_option = \
36 case $${target_option-} in \
37 ?) ;; \
38 *) echo "am__make_running_with_option: internal error: invalid" \
39 "target option '$${target_option-}' specified" >&2; \
40 exit 1;; \
41 esac; \
42 has_opt=no; \
43 sane_makeflags=$$MAKEFLAGS; \
44 if $(am__is_gnu_make); then \
45 sane_makeflags=$$MFLAGS; \
46 else \
47 case $$MAKEFLAGS in \
48 *\\[\ \ ]*) \
49 bs=\\; \
50 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
51 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
52 esac; \
53 fi; \
54 skip_next=no; \
55 strip_trailopt () \
56 { \
57 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
58 }; \
59 for flg in $$sane_makeflags; do \
60 test $$skip_next = yes && { skip_next=no; continue; }; \
61 case $$flg in \
62 *=*|--*) continue;; \
63 -*I) strip_trailopt 'I'; skip_next=yes;; \
64 -*I?*) strip_trailopt 'I';; \
65 -*O) strip_trailopt 'O'; skip_next=yes;; \
66 -*O?*) strip_trailopt 'O';; \
67 -*l) strip_trailopt 'l'; skip_next=yes;; \
68 -*l?*) strip_trailopt 'l';; \
69 -[dEDm]) skip_next=yes;; \
70 -[JT]) skip_next=yes;; \
71 esac; \
72 case $$flg in \
73 *$$target_option*) has_opt=yes; break;; \
74 esac; \
75 done; \
76 test $$has_opt = yes
77 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
78 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
79 pkgdatadir = $(datadir)/@PACKAGE@
80 pkgincludedir = $(includedir)/@PACKAGE@
81 pkglibdir = $(libdir)/@PACKAGE@
82 pkglibexecdir = $(libexecdir)/@PACKAGE@
83 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
84 install_sh_DATA = $(install_sh) -c -m 644
85 install_sh_PROGRAM = $(install_sh) -c
86 install_sh_SCRIPT = $(install_sh) -c
87 INSTALL_HEADER = $(INSTALL_DATA)
88 transform = $(program_transform_name)
89 NORMAL_INSTALL = :
90 PRE_INSTALL = :
91 POST_INSTALL = :
92 NORMAL_UNINSTALL = :
93 PRE_UNINSTALL = :
94 POST_UNINSTALL = :
95 build_triplet = @build@
96 host_triplet = @host@
97 subdir = doc
98 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
99 $(dist_man1_MANS) $(dist_man3_MANS)
100 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
105 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
106 $(ACLOCAL_M4)
107 mkinstalldirs = $(install_sh) -d
108 CONFIG_HEADER = $(top_builddir)/configure.h
109 CONFIG_CLEAN_FILES =
110 CONFIG_CLEAN_VPATH_FILES =
111 AM_V_P = $(am__v_P_@AM_V@)
112 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
113 am__v_P_0 = false
114 am__v_P_1 = :
115 AM_V_GEN = $(am__v_GEN_@AM_V@)
116 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
117 am__v_GEN_0 = @echo " GEN " $@;
118 am__v_GEN_1 =
119 AM_V_at = $(am__v_at_@AM_V@)
120 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
121 am__v_at_0 = @
122 am__v_at_1 =
123 SOURCES =
124 DIST_SOURCES =
125 am__can_run_installinfo = \
126 case $$AM_UPDATE_INFO_DIR in \
127 n|no|NO) false;; \
128 *) (install-info --version) >/dev/null 2>&1;; \
129 esac
130 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
131 am__vpath_adj = case $$p in \
132 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
133 *) f=$$p;; \
134 esac;
135 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
136 am__install_max = 40
137 am__nobase_strip_setup = \
138 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
139 am__nobase_strip = \
140 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
141 am__nobase_list = $(am__nobase_strip_setup); \
142 for p in $$list; do echo "$$p $$p"; done | \
143 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
144 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
145 if (++n[$$2] == $(am__install_max)) \
146 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
147 END { for (dir in files) print dir, files[dir] }'
148 am__base_list = \
149 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
150 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
151 am__uninstall_files_from_dir = { \
152 test -z "$$files" \
153 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
154 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
155 $(am__cd) "$$dir" && rm -f $$files; }; \
156 }
157 man1dir = $(mandir)/man1
158 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)"
159 man3dir = $(mandir)/man3
160 NROFF = nroff
161 MANS = $(dist_man1_MANS) $(dist_man3_MANS)
162 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
163 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
164 ACLOCAL = @ACLOCAL@
165 AMTAR = @AMTAR@
166 AM_CFLAGS = @AM_CFLAGS@
167 AM_CPPFLAGS = @AM_CPPFLAGS@
168 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
169 AM_LDFLAGS = @AM_LDFLAGS@
170 AR = @AR@
171 AUTOCONF = @AUTOCONF@
172 AUTOHEADER = @AUTOHEADER@
173 AUTOMAKE = @AUTOMAKE@
174 AWK = @AWK@
175 CC = @CC@
176 CCDEPMODE = @CCDEPMODE@
177 CFLAGS = @CFLAGS@
178 CPP = @CPP@
179 CPPFLAGS = @CPPFLAGS@
180 CYGPATH_W = @CYGPATH_W@
181 DEFS = @DEFS@
182 DEPDIR = @DEPDIR@
183 DLLTOOL = @DLLTOOL@
184 DSYMUTIL = @DSYMUTIL@
185 DUMPBIN = @DUMPBIN@
186 ECHO_C = @ECHO_C@
187 ECHO_N = @ECHO_N@
188 ECHO_T = @ECHO_T@
189 EGREP = @EGREP@
190 EXEEXT = @EXEEXT@
191 FGREP = @FGREP@
192 GREP = @GREP@
193 INSTALL = @INSTALL@
194 INSTALL_DATA = @INSTALL_DATA@
195 INSTALL_PROGRAM = @INSTALL_PROGRAM@
196 INSTALL_SCRIPT = @INSTALL_SCRIPT@
197 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
198 LD = @LD@
199 LDFLAGS = @LDFLAGS@
200 LIBOBJS = @LIBOBJS@
201 LIBS = @LIBS@
202 LIBTOOL = @LIBTOOL@
203 LIPO = @LIPO@
204 LN_S = @LN_S@
205 LTLIBOBJS = @LTLIBOBJS@
206 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
207 MAKEINFO = @MAKEINFO@
208 MANIFEST_TOOL = @MANIFEST_TOOL@
209 MKDIR_P = @MKDIR_P@
210 NM = @NM@
211 NMEDIT = @NMEDIT@
212 OBJDUMP = @OBJDUMP@
213 OBJEXT = @OBJEXT@
214 OTOOL = @OTOOL@
215 OTOOL64 = @OTOOL64@
216 PACKAGE = @PACKAGE@
217 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
218 PACKAGE_NAME = @PACKAGE_NAME@
219 PACKAGE_STRING = @PACKAGE_STRING@
220 PACKAGE_TARNAME = @PACKAGE_TARNAME@
221 PACKAGE_URL = @PACKAGE_URL@
222 PACKAGE_VERSION = @PACKAGE_VERSION@
223 PATH_SEPARATOR = @PATH_SEPARATOR@
224 RANLIB = @RANLIB@
225 SED = @SED@
226 SET_MAKE = @SET_MAKE@
227 SHELL = @SHELL@
228 STRIP = @STRIP@
229 VERSION = @VERSION@
230 VERSION_MAJOR = @VERSION_MAJOR@
231 VERSION_MICRO = @VERSION_MICRO@
232 VERSION_MINOR = @VERSION_MINOR@
233 abs_builddir = @abs_builddir@
234 abs_srcdir = @abs_srcdir@
235 abs_top_builddir = @abs_top_builddir@
236 abs_top_srcdir = @abs_top_srcdir@
237 ac_ct_AR = @ac_ct_AR@
238 ac_ct_CC = @ac_ct_CC@
239 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
240 am__include = @am__include@
241 am__leading_dot = @am__leading_dot@
242 am__quote = @am__quote@
243 am__tar = @am__tar@
244 am__untar = @am__untar@
245 bindir = @bindir@
246 build = @build@
247 build_alias = @build_alias@
248 build_cpu = @build_cpu@
249 build_os = @build_os@
250 build_vendor = @build_vendor@
251 builddir = @builddir@
252 datadir = @datadir@
253 datarootdir = @datarootdir@
254 docdir = @docdir@
255 dvidir = @dvidir@
256 exec_prefix = @exec_prefix@
257 have_coverity = @have_coverity@
258 have_cython = @have_cython@
259 host = @host@
260 host_alias = @host_alias@
261 host_cpu = @host_cpu@
262 host_os = @host_os@
263 host_vendor = @host_vendor@
264 htmldir = @htmldir@
265 includedir = @includedir@
266 infodir = @infodir@
267 install_sh = @install_sh@
268 libdir = @libdir@
269 libexecdir = @libexecdir@
270 localedir = @localedir@
271 localstatedir = @localstatedir@
272 mandir = @mandir@
273 mkdir_p = @mkdir_p@
274 oldincludedir = @oldincludedir@
275 pdfdir = @pdfdir@
276 prefix = @prefix@
277 program_transform_name = @program_transform_name@
278 psdir = @psdir@
279 sbindir = @sbindir@
280 sharedstatedir = @sharedstatedir@
281 srcdir = @srcdir@
282 sysconfdir = @sysconfdir@
283 target_alias = @target_alias@
284 top_build_prefix = @top_build_prefix@
285 top_builddir = @top_builddir@
286 top_srcdir = @top_srcdir@
287 dist_man1_MANS = \
288 man/man1/scmp_sys_resolver.1
289
290 dist_man3_MANS = \
291 man/man3/seccomp_arch_add.3 \
292 man/man3/seccomp_arch_exist.3 \
293 man/man3/seccomp_arch_native.3 \
294 man/man3/seccomp_arch_remove.3 \
295 man/man3/seccomp_arch_resolve_name.3 \
296 man/man3/seccomp_attr_get.3 \
297 man/man3/seccomp_attr_set.3 \
298 man/man3/seccomp_export_bpf.3 \
299 man/man3/seccomp_export_pfc.3 \
300 man/man3/seccomp_init.3 \
301 man/man3/seccomp_load.3 \
302 man/man3/seccomp_merge.3 \
303 man/man3/seccomp_release.3 \
304 man/man3/seccomp_reset.3 \
305 man/man3/seccomp_rule_add.3 \
306 man/man3/seccomp_rule_add_array.3 \
307 man/man3/seccomp_rule_add_exact.3 \
308 man/man3/seccomp_rule_add_exact_array.3 \
309 man/man3/seccomp_syscall_priority.3 \
310 man/man3/seccomp_syscall_resolve_name.3 \
311 man/man3/seccomp_syscall_resolve_name_arch.3 \
312 man/man3/seccomp_syscall_resolve_name_rewrite.3 \
313 man/man3/seccomp_syscall_resolve_num_arch.3
314
315 all: all-am
316
317 .SUFFIXES:
318 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
319 @for dep in $?; do \
320 case '$(am__configure_deps)' in \
321 *$$dep*) \
322 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
323 && { if test -f $@; then exit 0; else break; fi; }; \
324 exit 1;; \
325 esac; \
326 done; \
327 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
328 $(am__cd) $(top_srcdir) && \
329 $(AUTOMAKE) --foreign doc/Makefile
330 .PRECIOUS: Makefile
331 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
332 @case '$?' in \
333 *config.status*) \
334 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
335 *) \
336 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
337 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
338 esac;
339
340 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
341 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
342
343 $(top_srcdir)/configure: $(am__configure_deps)
344 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
345 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
346 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
347 $(am__aclocal_m4_deps):
348
349 mostlyclean-libtool:
350 -rm -f *.lo
351
352 clean-libtool:
353 -rm -rf .libs _libs
354 install-man1: $(dist_man1_MANS)
355 @$(NORMAL_INSTALL)
356 @list1='$(dist_man1_MANS)'; \
357 list2=''; \
358 test -n "$(man1dir)" \
359 && test -n "`echo $$list1$$list2`" \
360 || exit 0; \
361 echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
362 $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
363 { for i in $$list1; do echo "$$i"; done; \
364 if test -n "$$list2"; then \
365 for i in $$list2; do echo "$$i"; done \
366 | sed -n '/\.1[a-z]*$$/p'; \
367 fi; \
368 } | while read p; do \
369 if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
370 echo "$$d$$p"; echo "$$p"; \
371 done | \
372 sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
373 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
374 sed 'N;N;s,\n, ,g' | { \
375 list=; while read file base inst; do \
376 if test "$$base" = "$$inst"; then list="$$list $$file"; else \
377 echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
378 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
379 fi; \
380 done; \
381 for i in $$list; do echo "$$i"; done | $(am__base_list) | \
382 while read files; do \
383 test -z "$$files" || { \
384 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
385 $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
386 done; }
387
388 uninstall-man1:
389 @$(NORMAL_UNINSTALL)
390 @list='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \
391 files=`{ for i in $$list; do echo "$$i"; done; \
392 } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
393 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
394 dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
395 install-man3: $(dist_man3_MANS)
396 @$(NORMAL_INSTALL)
397 @list1='$(dist_man3_MANS)'; \
398 list2=''; \
399 test -n "$(man3dir)" \
400 && test -n "`echo $$list1$$list2`" \
401 || exit 0; \
402 echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
403 $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
404 { for i in $$list1; do echo "$$i"; done; \
405 if test -n "$$list2"; then \
406 for i in $$list2; do echo "$$i"; done \
407 | sed -n '/\.3[a-z]*$$/p'; \
408 fi; \
409 } | while read p; do \
410 if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
411 echo "$$d$$p"; echo "$$p"; \
412 done | \
413 sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
414 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
415 sed 'N;N;s,\n, ,g' | { \
416 list=; while read file base inst; do \
417 if test "$$base" = "$$inst"; then list="$$list $$file"; else \
418 echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
419 $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
420 fi; \
421 done; \
422 for i in $$list; do echo "$$i"; done | $(am__base_list) | \
423 while read files; do \
424 test -z "$$files" || { \
425 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
426 $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
427 done; }
428
429 uninstall-man3:
430 @$(NORMAL_UNINSTALL)
431 @list='$(dist_man3_MANS)'; test -n "$(man3dir)" || exit 0; \
432 files=`{ for i in $$list; do echo "$$i"; done; \
433 } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
434 -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
435 dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
436 tags TAGS:
437
438 ctags CTAGS:
439
440 cscope cscopelist:
441
442
443 distdir: $(DISTFILES)
444 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
445 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
446 list='$(DISTFILES)'; \
447 dist_files=`for file in $$list; do echo $$file; done | \
448 sed -e "s|^$$srcdirstrip/||;t" \
449 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
450 case $$dist_files in \
451 */*) $(MKDIR_P) `echo "$$dist_files" | \
452 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
453 sort -u` ;; \
454 esac; \
455 for file in $$dist_files; do \
456 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
457 if test -d $$d/$$file; then \
458 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
459 if test -d "$(distdir)/$$file"; then \
460 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
461 fi; \
462 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
463 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
464 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
465 fi; \
466 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
467 else \
468 test -f "$(distdir)/$$file" \
469 || cp -p $$d/$$file "$(distdir)/$$file" \
470 || exit 1; \
471 fi; \
472 done
473 check-am: all-am
474 check: check-am
475 all-am: Makefile $(MANS)
476 installdirs:
477 for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)"; do \
478 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
479 done
480 install: install-am
481 install-exec: install-exec-am
482 install-data: install-data-am
483 uninstall: uninstall-am
484
485 install-am: all-am
486 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
487
488 installcheck: installcheck-am
489 install-strip:
490 if test -z '$(STRIP)'; then \
491 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
492 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
493 install; \
494 else \
495 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
496 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
497 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
498 fi
499 mostlyclean-generic:
500
501 clean-generic:
502
503 distclean-generic:
504 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
505 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
506
507 maintainer-clean-generic:
508 @echo "This command is intended for maintainers to use"
509 @echo "it deletes files that may require special tools to rebuild."
510 clean: clean-am
511
512 clean-am: clean-generic clean-libtool mostlyclean-am
513
514 distclean: distclean-am
515 -rm -f Makefile
516 distclean-am: clean-am distclean-generic
517
518 dvi: dvi-am
519
520 dvi-am:
521
522 html: html-am
523
524 html-am:
525
526 info: info-am
527
528 info-am:
529
530 install-data-am: install-man
531
532 install-dvi: install-dvi-am
533
534 install-dvi-am:
535
536 install-exec-am:
537
538 install-html: install-html-am
539
540 install-html-am:
541
542 install-info: install-info-am
543
544 install-info-am:
545
546 install-man: install-man1 install-man3
547
548 install-pdf: install-pdf-am
549
550 install-pdf-am:
551
552 install-ps: install-ps-am
553
554 install-ps-am:
555
556 installcheck-am:
557
558 maintainer-clean: maintainer-clean-am
559 -rm -f Makefile
560 maintainer-clean-am: distclean-am maintainer-clean-generic
561
562 mostlyclean: mostlyclean-am
563
564 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
565
566 pdf: pdf-am
567
568 pdf-am:
569
570 ps: ps-am
571
572 ps-am:
573
574 uninstall-am: uninstall-man
575
576 uninstall-man: uninstall-man1 uninstall-man3
577
578 .MAKE: install-am install-strip
579
580 .PHONY: all all-am check check-am clean clean-generic clean-libtool \
581 cscopelist-am ctags-am distclean distclean-generic \
582 distclean-libtool distdir dvi dvi-am html html-am info info-am \
583 install install-am install-data install-data-am install-dvi \
584 install-dvi-am install-exec install-exec-am install-html \
585 install-html-am install-info install-info-am install-man \
586 install-man1 install-man3 install-pdf install-pdf-am \
587 install-ps install-ps-am install-strip installcheck \
588 installcheck-am installdirs maintainer-clean \
589 maintainer-clean-generic mostlyclean mostlyclean-generic \
590 mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
591 uninstall-am uninstall-man uninstall-man1 uninstall-man3
592
593
594 # Tell versions [3.59,3.63) of GNU make to not export all variables.
595 # Otherwise a system limit (for SysV at least) may be exceeded.
596 .NOEXPORT:
3636 values are "x86", "x86_64", "x32", and "arm".
3737 .TP
3838 .B \-t
39 If neccessary, translate the system call name to the proper system call number,
39 If necessary, translate the system call name to the proper system call number,
4040 even if the system call name is different, e.g. socket(2) on x86.
4141 .TP
4242 .B \-h
5050 .\" //////////////////////////////////////////////////////////////////////////
5151 .P
5252 The libseccomp project site, with more information and the source code
53 repository, can be found at http://libseccomp.sf.net. This tool, as well as
54 the libseccomp library, is currently under development, please report any bugs
55 at the project site or directly to the author.
53 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
54 as well as the libseccomp library, is currently under development, please
55 report any bugs at the project site or directly to the author.
5656 .\" //////////////////////////////////////////////////////////////////////////
5757 .SH AUTHOR
5858 .\" //////////////////////////////////////////////////////////////////////////
0 .TH "seccomp_arch_add" 3 "26 November 2012" "paul@paul-moore.com" "libseccomp Documentation"
0 .TH "seccomp_arch_add" 3 "7 May 2014" "paul@paul-moore.com" "libseccomp Documentation"
11 .\" //////////////////////////////////////////////////////////////////////////
22 .SH NAME
33 .\" //////////////////////////////////////////////////////////////////////////
1414 .B #define SCMP_ARCH_X86
1515 .B #define SCMP_ARCH_X86_64
1616 .sp
17 .BI "uint32_t seccomp_arch_resolve_name(const char *" arch_name ");"
1718 .BI "uint32_t seccomp_arch_native();"
1819 .BI "int seccomp_arch_exist(const scmp_filter_ctx " ctx ", uint32_t " arch_token ");"
1920 .BI "int seccomp_arch_add(scmp_filter_ctx " ctx ", uint32_t " arch_token ");"
4546 .BR seccomp_arch_native ()
4647 function returns the system's architecture such that it will match one of the
4748 .BR SCMP_ARCH_*
48 constants.
49 constants. While the
50 .BR seccomp_arch_resolve_name ()
51 function also returns a
52 .BR SCMP_ARCH_*
53 constant, the returned token matches the name of the architecture
54 passed as an argument to the function.
4955 .P
5056 When a seccomp filter is initialized with the call to
5157 .BR seccomp_init (3)
52 the native architecture is automatically added to the filter. If you want to
53 remove the native architecture from the filter, you first need to add another
54 architecture to the filter as a seccomp filter must contain at least one
55 architecture at all times. After you have added a second architecture to the
56 seccomp filter, you can remove the native architecture.
58 the native architecture is automatically added to the filter.
59 .P
60 While it is possible to remove all architectures from a filter, most of the
61 libseccomp APIs will fail if the filter does not contain at least one
62 architecture.
5763 .P
5864 When adding a new architecture to an existing filter, the existing rules will
5965 not be added to the new architecture. However, rules added after adding the
109115 libseccomp.
110116 .P
111117 The libseccomp project site, with more information and the source code
112 repository, can be found at http://libseccomp.sf.net. This library is currently
113 under development, please report any bugs at the project site or directly to
114 the author.
118 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
119 as well as the libseccomp library, is currently under development, please
120 report any bugs at the project site or directly to the author.
115121 .\" //////////////////////////////////////////////////////////////////////////
116122 .SH AUTHOR
117123 .\" //////////////////////////////////////////////////////////////////////////
0 .so man3/seccomp_arch_add.3
0 .TH "seccomp_attr_set" 3 "25 July 2012" "paul@paul-moore.com" "libseccomp Documentation"
0 .TH "seccomp_attr_set" 3 "21 August 2014" "paul@paul-moore.com" "libseccomp Documentation"
11 .\" //////////////////////////////////////////////////////////////////////////
22 .SH NAME
33 .\" //////////////////////////////////////////////////////////////////////////
6464 is not set. Defaults to on (
6565 .I value
6666 == 1).
67 .TP
68 .B SCMP_FLTATR_CTL_TSYNC
69 A flag to specify if the kernel should attempt to synchronize the filters
70 across all threads on
71 .BR seccomp_load (3).
72 If the kernel is unable to synchronize all of the thread then the load
73 operation will fail. This flag is only available on Linux Kernel 3.17 or
74 greater; attempting to enable this flag on earlier kernels will result in an
75 error being returned. Defaults to off (
76 .I value
77 == 0).
6778 .\" //////////////////////////////////////////////////////////////////////////
6879 .SH RETURN VALUE
6980 .\" //////////////////////////////////////////////////////////////////////////
105116 libseccomp.
106117 .P
107118 The libseccomp project site, with more information and the source code
108 repository, can be found at http://libseccomp.sf.net. This library is currently
109 under development, please report any bugs at the project site or directly to
110 the author.
119 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
120 as well as the libseccomp library, is currently under development, please
121 report any bugs at the project site or directly to the author.
111122 .\" //////////////////////////////////////////////////////////////////////////
112123 .SH AUTHOR
113124 .\" //////////////////////////////////////////////////////////////////////////
9292 libseccomp.
9393 .P
9494 The libseccomp project site, with more information and the source code
95 repository, can be found at http://libseccomp.sf.net. This library is currently
96 under development, please report any bugs at the project site or directly to
97 the author.
95 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
96 as well as the libseccomp library, is currently under development, please
97 report any bugs at the project site or directly to the author.
9898 .\" //////////////////////////////////////////////////////////////////////////
9999 .SH AUTHOR
100100 .\" //////////////////////////////////////////////////////////////////////////
4747 values are as follows:
4848 .TP
4949 .B SCMP_ACT_KILL
50 The process will be killed by the kernel when it calls a syscall that does not
50 The thread will be killed by the kernel when it calls a syscall that does not
5151 match any of the configured seccomp filter rules.
5252 .TP
5353 .B SCMP_ACT_TRAP
54 The process will throw a SIGSYS signal when it calls a syscall that does not
54 The thread will throw a SIGSYS signal when it calls a syscall that does not
5555 match any of the configured seccomp filter rules.
5656 .TP
5757 .B SCMP_ACT_ERRNO(uint16_t errno)
58 The process will receive a return value of
58 The thread will receive a return value of
5959 .I errno
6060 when it calls a syscall that does not match any of the configured seccomp filter
6161 rules.
6262 .TP
6363 .B SCMP_ACT_TRACE(uint16_t msg_num)
64 If the process is being traced and the tracing process specified the
64 If the thread is being traced and the tracing process specified the
6565 .B PTRACE_O_TRACESECCOMP
6666 option in the call to
6767 .BR ptrace (2),
7474 option.
7575 .TP
7676 .B SCMP_ACT_ALLOW
77 The seccomp filter will have no effect on the process calling the syscall if it
77 The seccomp filter will have no effect on the thread calling the syscall if it
7878 does not match any of the configured seccomp filter rules.
7979 .\" //////////////////////////////////////////////////////////////////////////
8080 .SH RETURN VALUE
121121 libseccomp.
122122 .P
123123 The libseccomp project site, with more information and the source code
124 repository, can be found at http://libseccomp.sf.net. This library is currently
125 under development, please report any bugs at the project site or directly to
126 the author.
124 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
125 as well as the libseccomp library, is currently under development, please
126 report any bugs at the project site or directly to the author.
127127 .\" //////////////////////////////////////////////////////////////////////////
128128 .SH AUTHOR
129129 .\" //////////////////////////////////////////////////////////////////////////
6363 libseccomp.
6464 .P
6565 The libseccomp project site, with more information and the source code
66 repository, can be found at http://libseccomp.sf.net. This library is currently
67 under development, please report any bugs at the project site or directly to
68 the author.
66 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
67 as well as the libseccomp library, is currently under development, please
68 report any bugs at the project site or directly to the author.
6969 .\" //////////////////////////////////////////////////////////////////////////
7070 .SH AUTHOR
7171 .\" //////////////////////////////////////////////////////////////////////////
103103 libseccomp.
104104 .P
105105 The libseccomp project site, with more information and the source code
106 repository, can be found at http://libseccomp.sf.net. This library is currently
107 under development, please report any bugs at the project site or directly to
108 the author.
106 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
107 as well as the libseccomp library, is currently under development, please
108 report any bugs at the project site or directly to the author.
109109 .\" //////////////////////////////////////////////////////////////////////////
110110 .SH AUTHOR
111111 .\" //////////////////////////////////////////////////////////////////////////
6060 libseccomp.
6161 .P
6262 The libseccomp project site, with more information and the source code
63 repository, can be found at http://libseccomp.sf.net. This library is currently
64 under development, please report any bugs at the project site or directly to
65 the author.
63 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
64 as well as the libseccomp library, is currently under development, please
65 report any bugs at the project site or directly to the author.
6666 .\" //////////////////////////////////////////////////////////////////////////
6767 .SH AUTHOR
6868 .\" //////////////////////////////////////////////////////////////////////////
9999 values are as follows:
100100 .TP
101101 .B SCMP_ACT_KILL
102 The process will be killed by the kernel when it calls a syscall that does not
102 The thread will be killed by the kernel when it calls a syscall that does not
103103 match any of the configured seccomp filter rules.
104104 .TP
105105 .B SCMP_ACT_TRAP
106 The process will throw a SIGSYS signal when it calls a syscall that does not
106 The thread will throw a SIGSYS signal when it calls a syscall that does not
107107 match any of the configured seccomp filter rules.
108108 .TP
109109 .B SCMP_ACT_ERRNO(uint16_t errno)
110 The process will receive a return value of
110 The thread will receive a return value of
111111 .I errno
112112 when it calls a syscall that does not match any of the configured seccomp filter
113113 rules.
114114 .TP
115115 .B SCMP_ACT_TRACE(uint16_t msg_num)
116 If the process is being traced and the tracing process specified the
116 If the thread is being traced and the tracing process specified the
117117 .B PTRACE_O_TRACESECCOMP
118118 option in the call to
119119 .BR ptrace (2),
126126 option.
127127 .TP
128128 .B SCMP_ACT_ALLOW
129 The seccomp filter will have no effect on the process calling the syscall if it
129 The seccomp filter will have no effect on the thread calling the syscall if it
130130 does not match any of the configured seccomp filter rules.
131131 .P
132132 Valid comparison
280280 libseccomp.
281281 .P
282282 The libseccomp project site, with more information and the source code
283 repository, can be found at http://libseccomp.sf.net. This library is currently
284 under development, please report any bugs at the project site or directly to
285 the author.
283 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
284 as well as the libseccomp library, is currently under development, please
285 report any bugs at the project site or directly to the author.
286286 .\" //////////////////////////////////////////////////////////////////////////
287287 .SH AUTHOR
288288 .\" //////////////////////////////////////////////////////////////////////////
9696 libseccomp.
9797 .P
9898 The libseccomp project site, with more information and the source code
99 repository, can be found at http://libseccomp.sf.net. This library is currently
100 under development, please report any bugs at the project site or directly to
101 the author.
99 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
100 as well as the libseccomp library, is currently under development, please
101 report any bugs at the project site or directly to the author.
102102 .\" //////////////////////////////////////////////////////////////////////////
103103 .SH AUTHOR
104104 .\" //////////////////////////////////////////////////////////////////////////
0 .TH "seccomp_syscall_resolve_name" 3 "7 January 2013" "paul@paul-moore.com" "libseccomp Documentation"
0 .TH "seccomp_syscall_resolve_name" 3 "8 May 2014" "paul@paul-moore.com" "libseccomp Documentation"
11 .\" //////////////////////////////////////////////////////////////////////////
22 .SH NAME
33 .\" //////////////////////////////////////////////////////////////////////////
1111 .BI "int seccomp_syscall_resolve_name(const char *" name ");"
1212 .BI "int seccomp_syscall_resolve_name_arch(uint32_t " arch_token ","
1313 .BI " const char *" name ");"
14 .BI "int seccomp_syscall_resolve_name_rewrite(uint32_t " arch_token ","
15 .BI " const char *" name ");"
1416 .BI "char *seccomp_syscall_resolve_num_arch(uint32_t " arch_token ", int " num ");"
1517 .sp
1618 Link with \fI\-lseccomp\fP.
2022 .\" //////////////////////////////////////////////////////////////////////////
2123 .P
2224 The
23 .BR seccomp_syscall_resolve_name ()
25 .BR seccomp_syscall_resolve_name() ,
26 .BR seccomp_syscall_resolve_name_arch() ,
2427 and
25 .BR seccomp_syscall_resolve_name_arch()
28 .BR seccomp_syscall_resolve_name_rewrite()
2629 functions resolve the commonly used syscall name to the syscall number used by
27 the kernel and the rest of the libseccomp API. The
30 the kernel and the rest of the libseccomp API, with
31 .BR seccomp_syscall_resolve_name_rewrite()
32 rewriting the syscall number for architectures that modify the syscall. The
2833 .BR seccomp_syscall_resolve_num_arch()
2934 function resolves the syscall number used by the kernel to the commonly used
3035 syscall name.
3641 .\" //////////////////////////////////////////////////////////////////////////
3742 .P
3843 In the case of
39 .BR seccomp_syscall_resolve_name ()
44 .BR seccomp_syscall_resolve_name() ,
45 .BR seccomp_syscall_resolve_name_arch() ,
4046 and
41 .BR seccomp_syscall_resolve_name_arch()
47 .BR seccomp_syscall_resolve_name_rewrite()
4248 the associated syscall number is returned, with the negative pseudo syscall
4349 number being returned in cases where the given syscall does not exist for the
44 architeture. The value
50 architecture. The value
4551 .BR __NR_SCMP_ERROR
4652 is returned in case of error. In all cases, the return value is suitable for
4753 use in any libseccomp API function which requires the syscall number, examples include
98104 libseccomp.
99105 .P
100106 The libseccomp project site, with more information and the source code
101 repository, can be found at http://libseccomp.sf.net. This library is currently
102 under development, please report any bugs at the project site or directly to
103 the author.
107 repository, can be found at https://github.com/seccomp/libseccomp. This tool,
108 as well as the libseccomp library, is currently under development, please
109 report any bugs at the project site or directly to the author.
104110 .\" //////////////////////////////////////////////////////////////////////////
105111 .SH AUTHOR
106112 .\" //////////////////////////////////////////////////////////////////////////
0 .so man3/seccomp_syscall_resolve_name.3
+0
-57
include/Makefile less more
0 #
1 # Enhanced Seccomp Library Makefile
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 # macros
23 #
24
25 include ../macros.mk
26
27 #
28 # configuration
29 #
30
31 include $(TOPDIR)/version_info.mk
32 include $(TOPDIR)/configure.mk
33 include $(TOPDIR)/install.mk
34
35 HDR_BUILD = seccomp.h
36
37 #
38 # targets
39 #
40
41 .PHONY: all install clean
42
43 all: $(HDR_BUILD)
44
45 install: $(HDR_BUILD)
46 $(INSTALL_INC_MACRO)
47
48 seccomp.h: seccomp.h.in
49 @$(ECHO) " GEN $@"
50 $(CAT) $< | \
51 $(SED) -e 's/%%VERSION_MAJOR%%/$(VERSION_MAJOR)/g' | \
52 $(SED) -e 's/%%VERSION_MINOR%%/$(VERSION_MINOR)/g' | \
53 $(SED) -e 's/%%VERSION_MICRO%%/$(VERSION_MICRO)/g' > $@
54
55 clean:
56 @$(RM) $(HDR_BUILD)
0 ####
1 # Seccomp Library Header Files
2 #
3
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the terms of version 2.1 of the GNU Lesser General Public License
7 # as published by the Free Software Foundation.
8 #
9 # This library is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses>.
16 #
17
18 include_HEADERS = seccomp.h
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
4
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 ####
17 # Seccomp Library Header Files
18 #
19
20 #
21 # This library is free software; you can redistribute it and/or modify it
22 # under the terms of version 2.1 of the GNU Lesser General Public License
23 # as published by the Free Software Foundation.
24 #
25 # This library is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
28 # General Public License for more details.
29 #
30 # You should have received a copy of the GNU Lesser General Public License
31 # along with this library; if not, see <http://www.gnu.org/licenses>.
32 #
33
34 VPATH = @srcdir@
35 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
36 am__make_running_with_option = \
37 case $${target_option-} in \
38 ?) ;; \
39 *) echo "am__make_running_with_option: internal error: invalid" \
40 "target option '$${target_option-}' specified" >&2; \
41 exit 1;; \
42 esac; \
43 has_opt=no; \
44 sane_makeflags=$$MAKEFLAGS; \
45 if $(am__is_gnu_make); then \
46 sane_makeflags=$$MFLAGS; \
47 else \
48 case $$MAKEFLAGS in \
49 *\\[\ \ ]*) \
50 bs=\\; \
51 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
52 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
53 esac; \
54 fi; \
55 skip_next=no; \
56 strip_trailopt () \
57 { \
58 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
59 }; \
60 for flg in $$sane_makeflags; do \
61 test $$skip_next = yes && { skip_next=no; continue; }; \
62 case $$flg in \
63 *=*|--*) continue;; \
64 -*I) strip_trailopt 'I'; skip_next=yes;; \
65 -*I?*) strip_trailopt 'I';; \
66 -*O) strip_trailopt 'O'; skip_next=yes;; \
67 -*O?*) strip_trailopt 'O';; \
68 -*l) strip_trailopt 'l'; skip_next=yes;; \
69 -*l?*) strip_trailopt 'l';; \
70 -[dEDm]) skip_next=yes;; \
71 -[JT]) skip_next=yes;; \
72 esac; \
73 case $$flg in \
74 *$$target_option*) has_opt=yes; break;; \
75 esac; \
76 done; \
77 test $$has_opt = yes
78 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
79 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
80 pkgdatadir = $(datadir)/@PACKAGE@
81 pkgincludedir = $(includedir)/@PACKAGE@
82 pkglibdir = $(libdir)/@PACKAGE@
83 pkglibexecdir = $(libexecdir)/@PACKAGE@
84 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
85 install_sh_DATA = $(install_sh) -c -m 644
86 install_sh_PROGRAM = $(install_sh) -c
87 install_sh_SCRIPT = $(install_sh) -c
88 INSTALL_HEADER = $(INSTALL_DATA)
89 transform = $(program_transform_name)
90 NORMAL_INSTALL = :
91 PRE_INSTALL = :
92 POST_INSTALL = :
93 NORMAL_UNINSTALL = :
94 PRE_UNINSTALL = :
95 POST_UNINSTALL = :
96 build_triplet = @build@
97 host_triplet = @host@
98 subdir = include
99 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
100 $(srcdir)/seccomp.h.in $(include_HEADERS)
101 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
106 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
107 $(ACLOCAL_M4)
108 mkinstalldirs = $(install_sh) -d
109 CONFIG_HEADER = $(top_builddir)/configure.h
110 CONFIG_CLEAN_FILES = seccomp.h
111 CONFIG_CLEAN_VPATH_FILES =
112 AM_V_P = $(am__v_P_@AM_V@)
113 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
114 am__v_P_0 = false
115 am__v_P_1 = :
116 AM_V_GEN = $(am__v_GEN_@AM_V@)
117 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
118 am__v_GEN_0 = @echo " GEN " $@;
119 am__v_GEN_1 =
120 AM_V_at = $(am__v_at_@AM_V@)
121 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
122 am__v_at_0 = @
123 am__v_at_1 =
124 SOURCES =
125 DIST_SOURCES =
126 am__can_run_installinfo = \
127 case $$AM_UPDATE_INFO_DIR in \
128 n|no|NO) false;; \
129 *) (install-info --version) >/dev/null 2>&1;; \
130 esac
131 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
132 am__vpath_adj = case $$p in \
133 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
134 *) f=$$p;; \
135 esac;
136 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
137 am__install_max = 40
138 am__nobase_strip_setup = \
139 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
140 am__nobase_strip = \
141 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
142 am__nobase_list = $(am__nobase_strip_setup); \
143 for p in $$list; do echo "$$p $$p"; done | \
144 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
145 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
146 if (++n[$$2] == $(am__install_max)) \
147 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
148 END { for (dir in files) print dir, files[dir] }'
149 am__base_list = \
150 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
151 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
152 am__uninstall_files_from_dir = { \
153 test -z "$$files" \
154 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
155 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
156 $(am__cd) "$$dir" && rm -f $$files; }; \
157 }
158 am__installdirs = "$(DESTDIR)$(includedir)"
159 HEADERS = $(include_HEADERS)
160 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
161 # Read a list of newline-separated strings from the standard input,
162 # and print each of them once, without duplicates. Input order is
163 # *not* preserved.
164 am__uniquify_input = $(AWK) '\
165 BEGIN { nonempty = 0; } \
166 { items[$$0] = 1; nonempty = 1; } \
167 END { if (nonempty) { for (i in items) print i; }; } \
168 '
169 # Make sure the list of sources is unique. This is necessary because,
170 # e.g., the same source file might be shared among _SOURCES variables
171 # for different programs/libraries.
172 am__define_uniq_tagged_files = \
173 list='$(am__tagged_files)'; \
174 unique=`for i in $$list; do \
175 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
176 done | $(am__uniquify_input)`
177 ETAGS = etags
178 CTAGS = ctags
179 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
180 ACLOCAL = @ACLOCAL@
181 AMTAR = @AMTAR@
182 AM_CFLAGS = @AM_CFLAGS@
183 AM_CPPFLAGS = @AM_CPPFLAGS@
184 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
185 AM_LDFLAGS = @AM_LDFLAGS@
186 AR = @AR@
187 AUTOCONF = @AUTOCONF@
188 AUTOHEADER = @AUTOHEADER@
189 AUTOMAKE = @AUTOMAKE@
190 AWK = @AWK@
191 CC = @CC@
192 CCDEPMODE = @CCDEPMODE@
193 CFLAGS = @CFLAGS@
194 CPP = @CPP@
195 CPPFLAGS = @CPPFLAGS@
196 CYGPATH_W = @CYGPATH_W@
197 DEFS = @DEFS@
198 DEPDIR = @DEPDIR@
199 DLLTOOL = @DLLTOOL@
200 DSYMUTIL = @DSYMUTIL@
201 DUMPBIN = @DUMPBIN@
202 ECHO_C = @ECHO_C@
203 ECHO_N = @ECHO_N@
204 ECHO_T = @ECHO_T@
205 EGREP = @EGREP@
206 EXEEXT = @EXEEXT@
207 FGREP = @FGREP@
208 GREP = @GREP@
209 INSTALL = @INSTALL@
210 INSTALL_DATA = @INSTALL_DATA@
211 INSTALL_PROGRAM = @INSTALL_PROGRAM@
212 INSTALL_SCRIPT = @INSTALL_SCRIPT@
213 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
214 LD = @LD@
215 LDFLAGS = @LDFLAGS@
216 LIBOBJS = @LIBOBJS@
217 LIBS = @LIBS@
218 LIBTOOL = @LIBTOOL@
219 LIPO = @LIPO@
220 LN_S = @LN_S@
221 LTLIBOBJS = @LTLIBOBJS@
222 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
223 MAKEINFO = @MAKEINFO@
224 MANIFEST_TOOL = @MANIFEST_TOOL@
225 MKDIR_P = @MKDIR_P@
226 NM = @NM@
227 NMEDIT = @NMEDIT@
228 OBJDUMP = @OBJDUMP@
229 OBJEXT = @OBJEXT@
230 OTOOL = @OTOOL@
231 OTOOL64 = @OTOOL64@
232 PACKAGE = @PACKAGE@
233 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
234 PACKAGE_NAME = @PACKAGE_NAME@
235 PACKAGE_STRING = @PACKAGE_STRING@
236 PACKAGE_TARNAME = @PACKAGE_TARNAME@
237 PACKAGE_URL = @PACKAGE_URL@
238 PACKAGE_VERSION = @PACKAGE_VERSION@
239 PATH_SEPARATOR = @PATH_SEPARATOR@
240 RANLIB = @RANLIB@
241 SED = @SED@
242 SET_MAKE = @SET_MAKE@
243 SHELL = @SHELL@
244 STRIP = @STRIP@
245 VERSION = @VERSION@
246 VERSION_MAJOR = @VERSION_MAJOR@
247 VERSION_MICRO = @VERSION_MICRO@
248 VERSION_MINOR = @VERSION_MINOR@
249 abs_builddir = @abs_builddir@
250 abs_srcdir = @abs_srcdir@
251 abs_top_builddir = @abs_top_builddir@
252 abs_top_srcdir = @abs_top_srcdir@
253 ac_ct_AR = @ac_ct_AR@
254 ac_ct_CC = @ac_ct_CC@
255 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
256 am__include = @am__include@
257 am__leading_dot = @am__leading_dot@
258 am__quote = @am__quote@
259 am__tar = @am__tar@
260 am__untar = @am__untar@
261 bindir = @bindir@
262 build = @build@
263 build_alias = @build_alias@
264 build_cpu = @build_cpu@
265 build_os = @build_os@
266 build_vendor = @build_vendor@
267 builddir = @builddir@
268 datadir = @datadir@
269 datarootdir = @datarootdir@
270 docdir = @docdir@
271 dvidir = @dvidir@
272 exec_prefix = @exec_prefix@
273 have_coverity = @have_coverity@
274 have_cython = @have_cython@
275 host = @host@
276 host_alias = @host_alias@
277 host_cpu = @host_cpu@
278 host_os = @host_os@
279 host_vendor = @host_vendor@
280 htmldir = @htmldir@
281 includedir = @includedir@
282 infodir = @infodir@
283 install_sh = @install_sh@
284 libdir = @libdir@
285 libexecdir = @libexecdir@
286 localedir = @localedir@
287 localstatedir = @localstatedir@
288 mandir = @mandir@
289 mkdir_p = @mkdir_p@
290 oldincludedir = @oldincludedir@
291 pdfdir = @pdfdir@
292 prefix = @prefix@
293 program_transform_name = @program_transform_name@
294 psdir = @psdir@
295 sbindir = @sbindir@
296 sharedstatedir = @sharedstatedir@
297 srcdir = @srcdir@
298 sysconfdir = @sysconfdir@
299 target_alias = @target_alias@
300 top_build_prefix = @top_build_prefix@
301 top_builddir = @top_builddir@
302 top_srcdir = @top_srcdir@
303 include_HEADERS = seccomp.h
304 all: all-am
305
306 .SUFFIXES:
307 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
308 @for dep in $?; do \
309 case '$(am__configure_deps)' in \
310 *$$dep*) \
311 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
312 && { if test -f $@; then exit 0; else break; fi; }; \
313 exit 1;; \
314 esac; \
315 done; \
316 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
317 $(am__cd) $(top_srcdir) && \
318 $(AUTOMAKE) --foreign include/Makefile
319 .PRECIOUS: Makefile
320 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
321 @case '$?' in \
322 *config.status*) \
323 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
324 *) \
325 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
326 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
327 esac;
328
329 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
330 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
331
332 $(top_srcdir)/configure: $(am__configure_deps)
333 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
334 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
335 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
336 $(am__aclocal_m4_deps):
337 seccomp.h: $(top_builddir)/config.status $(srcdir)/seccomp.h.in
338 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
339
340 mostlyclean-libtool:
341 -rm -f *.lo
342
343 clean-libtool:
344 -rm -rf .libs _libs
345 install-includeHEADERS: $(include_HEADERS)
346 @$(NORMAL_INSTALL)
347 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
348 if test -n "$$list"; then \
349 echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
350 $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
351 fi; \
352 for p in $$list; do \
353 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
354 echo "$$d$$p"; \
355 done | $(am__base_list) | \
356 while read files; do \
357 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
358 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
359 done
360
361 uninstall-includeHEADERS:
362 @$(NORMAL_UNINSTALL)
363 @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
364 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
365 dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
366
367 ID: $(am__tagged_files)
368 $(am__define_uniq_tagged_files); mkid -fID $$unique
369 tags: tags-am
370 TAGS: tags
371
372 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
373 set x; \
374 here=`pwd`; \
375 $(am__define_uniq_tagged_files); \
376 shift; \
377 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
378 test -n "$$unique" || unique=$$empty_fix; \
379 if test $$# -gt 0; then \
380 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
381 "$$@" $$unique; \
382 else \
383 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
384 $$unique; \
385 fi; \
386 fi
387 ctags: ctags-am
388
389 CTAGS: ctags
390 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
391 $(am__define_uniq_tagged_files); \
392 test -z "$(CTAGS_ARGS)$$unique" \
393 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
394 $$unique
395
396 GTAGS:
397 here=`$(am__cd) $(top_builddir) && pwd` \
398 && $(am__cd) $(top_srcdir) \
399 && gtags -i $(GTAGS_ARGS) "$$here"
400 cscopelist: cscopelist-am
401
402 cscopelist-am: $(am__tagged_files)
403 list='$(am__tagged_files)'; \
404 case "$(srcdir)" in \
405 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
406 *) sdir=$(subdir)/$(srcdir) ;; \
407 esac; \
408 for i in $$list; do \
409 if test -f "$$i"; then \
410 echo "$(subdir)/$$i"; \
411 else \
412 echo "$$sdir/$$i"; \
413 fi; \
414 done >> $(top_builddir)/cscope.files
415
416 distclean-tags:
417 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
418
419 distdir: $(DISTFILES)
420 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
421 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
422 list='$(DISTFILES)'; \
423 dist_files=`for file in $$list; do echo $$file; done | \
424 sed -e "s|^$$srcdirstrip/||;t" \
425 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
426 case $$dist_files in \
427 */*) $(MKDIR_P) `echo "$$dist_files" | \
428 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
429 sort -u` ;; \
430 esac; \
431 for file in $$dist_files; do \
432 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
433 if test -d $$d/$$file; then \
434 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
435 if test -d "$(distdir)/$$file"; then \
436 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
437 fi; \
438 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
439 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
440 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
441 fi; \
442 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
443 else \
444 test -f "$(distdir)/$$file" \
445 || cp -p $$d/$$file "$(distdir)/$$file" \
446 || exit 1; \
447 fi; \
448 done
449 check-am: all-am
450 check: check-am
451 all-am: Makefile $(HEADERS)
452 installdirs:
453 for dir in "$(DESTDIR)$(includedir)"; do \
454 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
455 done
456 install: install-am
457 install-exec: install-exec-am
458 install-data: install-data-am
459 uninstall: uninstall-am
460
461 install-am: all-am
462 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
463
464 installcheck: installcheck-am
465 install-strip:
466 if test -z '$(STRIP)'; then \
467 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
468 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
469 install; \
470 else \
471 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
472 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
473 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
474 fi
475 mostlyclean-generic:
476
477 clean-generic:
478
479 distclean-generic:
480 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
481 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
482
483 maintainer-clean-generic:
484 @echo "This command is intended for maintainers to use"
485 @echo "it deletes files that may require special tools to rebuild."
486 clean: clean-am
487
488 clean-am: clean-generic clean-libtool mostlyclean-am
489
490 distclean: distclean-am
491 -rm -f Makefile
492 distclean-am: clean-am distclean-generic distclean-tags
493
494 dvi: dvi-am
495
496 dvi-am:
497
498 html: html-am
499
500 html-am:
501
502 info: info-am
503
504 info-am:
505
506 install-data-am: install-includeHEADERS
507
508 install-dvi: install-dvi-am
509
510 install-dvi-am:
511
512 install-exec-am:
513
514 install-html: install-html-am
515
516 install-html-am:
517
518 install-info: install-info-am
519
520 install-info-am:
521
522 install-man:
523
524 install-pdf: install-pdf-am
525
526 install-pdf-am:
527
528 install-ps: install-ps-am
529
530 install-ps-am:
531
532 installcheck-am:
533
534 maintainer-clean: maintainer-clean-am
535 -rm -f Makefile
536 maintainer-clean-am: distclean-am maintainer-clean-generic
537
538 mostlyclean: mostlyclean-am
539
540 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
541
542 pdf: pdf-am
543
544 pdf-am:
545
546 ps: ps-am
547
548 ps-am:
549
550 uninstall-am: uninstall-includeHEADERS
551
552 .MAKE: install-am install-strip
553
554 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
555 clean-libtool cscopelist-am ctags ctags-am distclean \
556 distclean-generic distclean-libtool distclean-tags distdir dvi \
557 dvi-am html html-am info info-am install install-am \
558 install-data install-data-am install-dvi install-dvi-am \
559 install-exec install-exec-am install-html install-html-am \
560 install-includeHEADERS install-info install-info-am \
561 install-man install-pdf install-pdf-am install-ps \
562 install-ps-am install-strip installcheck installcheck-am \
563 installdirs maintainer-clean maintainer-clean-generic \
564 mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
565 ps ps-am tags tags-am uninstall uninstall-am \
566 uninstall-includeHEADERS
567
568
569 # Tell versions [3.59,3.63) of GNU make to not export all variables.
570 # Otherwise a system limit (for SysV at least) may be exceeded.
571 .NOEXPORT:
0 /**
1 * Seccomp Library
2 *
3 * Copyright (c) 2012,2013 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.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 #ifndef _SECCOMP_H
22 #define _SECCOMP_H
23
24 #include <elf.h>
25 #include <inttypes.h>
26 #include <asm/unistd.h>
27 #include <linux/audit.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /*
34 * version information
35 */
36
37 #define SCMP_VER_MAJOR 2
38 #define SCMP_VER_MINOR 2
39 #define SCMP_VER_MICRO 3
40
41 /*
42 * types
43 */
44
45 /**
46 * Filter context/handle
47 */
48 typedef void *scmp_filter_ctx;
49
50 /**
51 * Filter attributes
52 */
53 enum scmp_filter_attr {
54 _SCMP_FLTATR_MIN = 0,
55 SCMP_FLTATR_ACT_DEFAULT = 1, /**< default filter action */
56 SCMP_FLTATR_ACT_BADARCH = 2, /**< bad architecture action */
57 SCMP_FLTATR_CTL_NNP = 3, /**< set NO_NEW_PRIVS on filter load */
58 SCMP_FLTATR_CTL_TSYNC = 4, /**< sync threads on filter load */
59 _SCMP_FLTATR_MAX,
60 };
61
62 /**
63 * Comparison operators
64 */
65 enum scmp_compare {
66 _SCMP_CMP_MIN = 0,
67 SCMP_CMP_NE = 1, /**< not equal */
68 SCMP_CMP_LT = 2, /**< less than */
69 SCMP_CMP_LE = 3, /**< less than or equal */
70 SCMP_CMP_EQ = 4, /**< equal */
71 SCMP_CMP_GE = 5, /**< greater than or equal */
72 SCMP_CMP_GT = 6, /**< greater than */
73 SCMP_CMP_MASKED_EQ = 7, /**< masked equality */
74 _SCMP_CMP_MAX,
75 };
76
77 /**
78 * Argument datum
79 */
80 typedef uint64_t scmp_datum_t;
81
82 /**
83 * Argument / Value comparison definition
84 */
85 struct scmp_arg_cmp {
86 unsigned int arg; /**< argument number, starting at 0 */
87 enum scmp_compare op; /**< the comparison op, e.g. SCMP_CMP_* */
88 scmp_datum_t datum_a;
89 scmp_datum_t datum_b;
90 };
91
92 /*
93 * macros/defines
94 */
95
96 /**
97 * The native architecture token
98 */
99 #define SCMP_ARCH_NATIVE 0
100
101 /**
102 * The x86 (32-bit) architecture token
103 */
104 #define SCMP_ARCH_X86 AUDIT_ARCH_I386
105
106 /**
107 * The x86-64 (64-bit) architecture token
108 */
109 #define SCMP_ARCH_X86_64 AUDIT_ARCH_X86_64
110
111 /**
112 * The x32 (32-bit x86_64) architecture token
113 *
114 * NOTE: this is different from the value used by the kernel because we need to
115 * be able to distinguish between x32 and x86_64
116 */
117 #define SCMP_ARCH_X32 (EM_X86_64|__AUDIT_ARCH_LE)
118
119 /**
120 * The ARM architecture tokens
121 */
122 #define SCMP_ARCH_ARM AUDIT_ARCH_ARM
123 /* AArch64 support for audit was merged in 3.17-rc1 */
124 #ifndef AUDIT_ARCH_AARCH64
125 #ifndef EM_AARCH64
126 #define EM_AARCH64 183
127 #endif /* EM_AARCH64 */
128 #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
129 #endif /* AUDIT_ARCH_AARCH64 */
130 #define SCMP_ARCH_AARCH64 AUDIT_ARCH_AARCH64
131
132 /**
133 * The MIPS architecture tokens
134 */
135 #ifndef __AUDIT_ARCH_CONVENTION_MIPS64_N32
136 #define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000
137 #endif
138 #ifndef EM_MIPS
139 #define EM_MIPS 8
140 #endif
141 #ifndef AUDIT_ARCH_MIPS
142 #define AUDIT_ARCH_MIPS (EM_MIPS)
143 #endif
144 #ifndef AUDIT_ARCH_MIPS64
145 #define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
146 #endif
147 /* MIPS64N32 support was merged in 3.15 */
148 #ifndef AUDIT_ARCH_MIPS64N32
149 #define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|\
150 __AUDIT_ARCH_CONVENTION_MIPS64_N32)
151 #endif
152 /* MIPSEL64N32 support was merged in 3.15 */
153 #ifndef AUDIT_ARCH_MIPSEL64N32
154 #define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\
155 __AUDIT_ARCH_CONVENTION_MIPS64_N32)
156 #endif
157 #define SCMP_ARCH_MIPS AUDIT_ARCH_MIPS
158 #define SCMP_ARCH_MIPS64 AUDIT_ARCH_MIPS64
159 #define SCMP_ARCH_MIPS64N32 AUDIT_ARCH_MIPS64N32
160 #define SCMP_ARCH_MIPSEL AUDIT_ARCH_MIPSEL
161 #define SCMP_ARCH_MIPSEL64 AUDIT_ARCH_MIPSEL64
162 #define SCMP_ARCH_MIPSEL64N32 AUDIT_ARCH_MIPSEL64N32
163
164 /**
165 * Convert a syscall name into the associated syscall number
166 * @param x the syscall name
167 */
168 #define SCMP_SYS(x) (__NR_##x)
169
170 /**
171 * Specify an argument comparison struct for use in declaring rules
172 * @param arg the argument number, starting at 0
173 * @param op the comparison operator, e.g. SCMP_CMP_*
174 * @param datum_a dependent on comparison
175 * @param datum_b dependent on comparison, optional
176 */
177 #define SCMP_CMP(...) ((struct scmp_arg_cmp){__VA_ARGS__})
178
179 /**
180 * Specify an argument comparison struct for argument 0
181 */
182 #define SCMP_A0(...) SCMP_CMP(0, __VA_ARGS__)
183
184 /**
185 * Specify an argument comparison struct for argument 1
186 */
187 #define SCMP_A1(...) SCMP_CMP(1, __VA_ARGS__)
188
189 /**
190 * Specify an argument comparison struct for argument 2
191 */
192 #define SCMP_A2(...) SCMP_CMP(2, __VA_ARGS__)
193
194 /**
195 * Specify an argument comparison struct for argument 3
196 */
197 #define SCMP_A3(...) SCMP_CMP(3, __VA_ARGS__)
198
199 /**
200 * Specify an argument comparison struct for argument 4
201 */
202 #define SCMP_A4(...) SCMP_CMP(4, __VA_ARGS__)
203
204 /**
205 * Specify an argument comparison struct for argument 5
206 */
207 #define SCMP_A5(...) SCMP_CMP(5, __VA_ARGS__)
208
209 /*
210 * seccomp actions
211 */
212
213 /**
214 * Kill the process
215 */
216 #define SCMP_ACT_KILL 0x00000000U
217 /**
218 * Throw a SIGSYS signal
219 */
220 #define SCMP_ACT_TRAP 0x00030000U
221 /**
222 * Return the specified error code
223 */
224 #define SCMP_ACT_ERRNO(x) (0x00050000U | ((x) & 0x0000ffffU))
225 /**
226 * Notify a tracing process with the specified value
227 */
228 #define SCMP_ACT_TRACE(x) (0x7ff00000U | ((x) & 0x0000ffffU))
229 /**
230 * Allow the syscall to be executed
231 */
232 #define SCMP_ACT_ALLOW 0x7fff0000U
233
234 /*
235 * functions
236 */
237
238 /**
239 * Initialize the filter state
240 * @param def_action the default filter action
241 *
242 * This function initializes the internal seccomp filter state and should
243 * be called before any other functions in this library to ensure the filter
244 * state is initialized. Returns a filter context on success, NULL on failure.
245 *
246 */
247 scmp_filter_ctx seccomp_init(uint32_t def_action);
248
249 /**
250 * Reset the filter state
251 * @param ctx the filter context
252 * @param def_action the default filter action
253 *
254 * This function resets the given seccomp filter state and ensures the
255 * filter state is reinitialized. This function does not reset any seccomp
256 * filters already loaded into the kernel. Returns zero on success, negative
257 * values on failure.
258 *
259 */
260 int seccomp_reset(scmp_filter_ctx ctx, uint32_t def_action);
261
262 /**
263 * Destroys the filter state and releases any resources
264 * @param ctx the filter context
265 *
266 * This functions destroys the given seccomp filter state and releases any
267 * resources, including memory, associated with the filter state. This
268 * function does not reset any seccomp filters already loaded into the kernel.
269 * The filter context can no longer be used after calling this function.
270 *
271 */
272 void seccomp_release(scmp_filter_ctx ctx);
273
274 /**
275 * Merge two filters
276 * @param ctx_dst the destination filter context
277 * @param ctx_src the source filter context
278 *
279 * This function merges two filter contexts into a single filter context and
280 * destroys the second filter context. The two filter contexts must have the
281 * same attribute values and not contain any of the same architectures; if they
282 * do, the merge operation will fail. On success, the source filter context
283 * will be destroyed and should no longer be used; it is not necessary to
284 * call seccomp_release() on the source filter context. Returns zero on
285 * success, negative values on failure.
286 *
287 */
288 int seccomp_merge(scmp_filter_ctx ctx_dst, scmp_filter_ctx ctx_src);
289
290 /**
291 * Resolve the architecture name to a architecture token
292 * @param arch_name the architecture name
293 *
294 * This function resolves the given architecture name to a token suitable for
295 * use with libseccomp, returns zero on failure.
296 *
297 */
298 uint32_t seccomp_arch_resolve_name(const char *arch_name);
299
300 /**
301 * Return the native architecture token
302 *
303 * This function returns the native architecture token value, e.g. SCMP_ARCH_*.
304 *
305 */
306 uint32_t seccomp_arch_native(void);
307
308 /**
309 * Check to see if an existing architecture is present in the filter
310 * @param ctx the filter context
311 * @param arch_token the architecture token, e.g. SCMP_ARCH_*
312 *
313 * This function tests to see if a given architecture is included in the filter
314 * context. If the architecture token is SCMP_ARCH_NATIVE then the native
315 * architecture will be assumed. Returns zero if the architecture exists in
316 * the filter, -EEXIST if it is not present, and other negative values on
317 * failure.
318 *
319 */
320 int seccomp_arch_exist(const scmp_filter_ctx ctx, uint32_t arch_token);
321
322 /**
323 * Adds an architecture to the filter
324 * @param ctx the filter context
325 * @param arch_token the architecture token, e.g. SCMP_ARCH_*
326 *
327 * This function adds a new architecture to the given seccomp filter context.
328 * Any new rules added after this function successfully returns will be added
329 * to this architecture but existing rules will not be added to this
330 * architecture. If the architecture token is SCMP_ARCH_NATIVE then the native
331 * architecture will be assumed. Returns zero on success, negative values on
332 * failure.
333 *
334 */
335 int seccomp_arch_add(scmp_filter_ctx ctx, uint32_t arch_token);
336
337 /**
338 * Removes an architecture from the filter
339 * @param ctx the filter context
340 * @param arch_token the architecture token, e.g. SCMP_ARCH_*
341 *
342 * This function removes an architecture from the given seccomp filter context.
343 * If the architecture token is SCMP_ARCH_NATIVE then the native architecture
344 * will be assumed. Returns zero on success, negative values on failure.
345 *
346 */
347 int seccomp_arch_remove(scmp_filter_ctx ctx, uint32_t arch_token);
348
349 /**
350 * Loads the filter into the kernel
351 * @param ctx the filter context
352 *
353 * This function loads the given seccomp filter context into the kernel. If
354 * the filter was loaded correctly, the kernel will be enforcing the filter
355 * when this function returns. Returns zero on success, negative values on
356 * error.
357 *
358 */
359 int seccomp_load(const scmp_filter_ctx ctx);
360
361 /**
362 * Get the value of a filter attribute
363 * @param ctx the filter context
364 * @param attr the filter attribute name
365 * @param value the filter attribute value
366 *
367 * This function fetches the value of the given attribute name and returns it
368 * via @value. Returns zero on success, negative values on failure.
369 *
370 */
371 int seccomp_attr_get(const scmp_filter_ctx ctx,
372 enum scmp_filter_attr attr, uint32_t *value);
373
374 /**
375 * Set the value of a filter attribute
376 * @param ctx the filter context
377 * @param attr the filter attribute name
378 * @param value the filter attribute value
379 *
380 * This function sets the value of the given attribute. Returns zero on
381 * success, negative values on failure.
382 *
383 */
384 int seccomp_attr_set(scmp_filter_ctx ctx,
385 enum scmp_filter_attr attr, uint32_t value);
386
387 /**
388 * Resolve a syscall number to a name
389 * @param arch_token the architecture token, e.g. SCMP_ARCH_*
390 * @param num the syscall number
391 *
392 * Resolve the given syscall number to the syscall name for the given
393 * architecture; it is up to the caller to free the returned string. Returns
394 * the syscall name on success, NULL on failure.
395 *
396 */
397 char *seccomp_syscall_resolve_num_arch(uint32_t arch_token, int num);
398
399 /**
400 * Resolve a syscall name to a number
401 * @param arch_token the architecture token, e.g. SCMP_ARCH_*
402 * @param name the syscall name
403 *
404 * Resolve the given syscall name to the syscall number for the given
405 * architecture. Returns the syscall number on success, including negative
406 * pseudo syscall numbers (e.g. __PNR_*); returns __NR_SCMP_ERROR on failure.
407 *
408 */
409 int seccomp_syscall_resolve_name_arch(uint32_t arch_token, const char *name);
410
411 /**
412 * Resolve a syscall name to a number and perform any rewriting necessary
413 * @param arch_token the architecture token, e.g. SCMP_ARCH_*
414 * @param name the syscall name
415 *
416 * Resolve the given syscall name to the syscall number for the given
417 * architecture and do any necessary syscall rewriting needed by the
418 * architecture. Returns the syscall number on success, including negative
419 * pseudo syscall numbers (e.g. __PNR_*); returns __NR_SCMP_ERROR on failure.
420 *
421 */
422 int seccomp_syscall_resolve_name_rewrite(uint32_t arch_token, const char *name);
423
424 /**
425 * Resolve a syscall name to a number
426 * @param name the syscall name
427 *
428 * Resolve the given syscall name to the syscall number. Returns the syscall
429 * number on success, including negative pseudo syscall numbers (e.g. __PNR_*);
430 * returns __NR_SCMP_ERROR on failure.
431 *
432 */
433 int seccomp_syscall_resolve_name(const char *name);
434
435 /**
436 * Set the priority of a given syscall
437 * @param ctx the filter context
438 * @param syscall the syscall number
439 * @param priority priority value, higher value == higher priority
440 *
441 * This function sets the priority of the given syscall; this value is used
442 * when generating the seccomp filter code such that higher priority syscalls
443 * will incur less filter code overhead than the lower priority syscalls in the
444 * filter. Returns zero on success, negative values on failure.
445 *
446 */
447 int seccomp_syscall_priority(scmp_filter_ctx ctx,
448 int syscall, uint8_t priority);
449
450 /**
451 * Add a new rule to the filter
452 * @param ctx the filter context
453 * @param action the filter action
454 * @param syscall the syscall number
455 * @param arg_cnt the number of argument filters in the argument filter chain
456 * @param ... scmp_arg_cmp structs (use of SCMP_ARG_CMP() recommended)
457 *
458 * This function adds a series of new argument/value checks to the seccomp
459 * filter for the given syscall; multiple argument/value checks can be
460 * specified and they will be chained together (AND'd together) in the filter.
461 * If the specified rule needs to be adjusted due to architecture specifics it
462 * will be adjusted without notification. Returns zero on success, negative
463 * values on failure.
464 *
465 */
466 int seccomp_rule_add(scmp_filter_ctx ctx,
467 uint32_t action, int syscall, unsigned int arg_cnt, ...);
468
469
470 /**
471 * Add a new rule to the filter
472 * @param ctx the filter context
473 * @param action the filter action
474 * @param syscall the syscall number
475 * @param arg_cnt the number of elements in the arg_array parameter
476 * @param arg_array array of scmp_arg_cmp structs
477 *
478 * This function adds a series of new argument/value checks to the seccomp
479 * filter for the given syscall; multiple argument/value checks can be
480 * specified and they will be chained together (AND'd together) in the filter.
481 * If the specified rule needs to be adjusted due to architecture specifics it
482 * will be adjusted without notification. Returns zero on success, negative
483 * values on failure.
484 *
485 */
486 int seccomp_rule_add_array(scmp_filter_ctx ctx,
487 uint32_t action, int syscall, unsigned int arg_cnt,
488 const struct scmp_arg_cmp *arg_array);
489
490 /**
491 * Add a new rule to the filter
492 * @param ctx the filter context
493 * @param action the filter action
494 * @param syscall the syscall number
495 * @param arg_cnt the number of argument filters in the argument filter chain
496 * @param ... scmp_arg_cmp structs (use of SCMP_ARG_CMP() recommended)
497 *
498 * This function adds a series of new argument/value checks to the seccomp
499 * filter for the given syscall; multiple argument/value checks can be
500 * specified and they will be chained together (AND'd together) in the filter.
501 * If the specified rule can not be represented on the architecture the
502 * function will fail. Returns zero on success, negative values on failure.
503 *
504 */
505 int seccomp_rule_add_exact(scmp_filter_ctx ctx, uint32_t action,
506 int syscall, unsigned int arg_cnt, ...);
507
508 /**
509 * Add a new rule to the filter
510 * @param ctx the filter context
511 * @param action the filter action
512 * @param syscall the syscall number
513 * @param arg_cnt the number of elements in the arg_array parameter
514 * @param arg_array array of scmp_arg_cmp structs
515 *
516 * This function adds a series of new argument/value checks to the seccomp
517 * filter for the given syscall; multiple argument/value checks can be
518 * specified and they will be chained together (AND'd together) in the filter.
519 * If the specified rule can not be represented on the architecture the
520 * function will fail. Returns zero on success, negative values on failure.
521 *
522 */
523 int seccomp_rule_add_exact_array(scmp_filter_ctx ctx,
524 uint32_t action, int syscall,
525 unsigned int arg_cnt,
526 const struct scmp_arg_cmp *arg_array);
527
528 /**
529 * Generate seccomp Pseudo Filter Code (PFC) and export it to a file
530 * @param ctx the filter context
531 * @param fd the destination fd
532 *
533 * This function generates seccomp Pseudo Filter Code (PFC) and writes it to
534 * the given fd. Returns zero on success, negative values on failure.
535 *
536 */
537 int seccomp_export_pfc(const scmp_filter_ctx ctx, int fd);
538
539 /**
540 * Generate seccomp Berkley Packet Filter (BPF) code and export it to a file
541 * @param ctx the filter context
542 * @param fd the destination fd
543 *
544 * This function generates seccomp Berkley Packer Filter (BPF) code and writes
545 * it to the given fd. Returns zero on success, negative values on failure.
546 *
547 */
548 int seccomp_export_bpf(const scmp_filter_ctx ctx, int fd);
549
550 /*
551 * pseudo syscall definitions
552 */
553
554 /* NOTE - pseudo syscall values {-1..-99} are reserved */
555 #define __NR_SCMP_ERROR -1
556
557 /* socket syscalls */
558
559 #define __PNR_socket -101
560 #ifndef __NR_socket
561 #define __NR_socket __PNR_socket
562 #endif /* __NR_socket */
563
564 #define __PNR_bind -102
565 #ifndef __NR_bind
566 #define __NR_bind __PNR_bind
567 #endif /* __NR_bind */
568
569 #define __PNR_connect -103
570 #ifndef __NR_connect
571 #define __NR_connect __PNR_connect
572 #endif /* __NR_connect */
573
574 #define __PNR_listen -104
575 #ifndef __NR_listen
576 #define __NR_listen __PNR_listen
577 #endif /* __NR_listen */
578
579 #define __PNR_accept -105
580 #ifndef __NR_accept
581 #define __NR_accept __PNR_accept
582 #endif /* __NR_accept */
583
584 #define __PNR_getsockname -106
585 #ifndef __NR_getsockname
586 #define __NR_getsockname __PNR_getsockname
587 #endif /* __NR_getsockname */
588
589 #define __PNR_getpeername -107
590 #ifndef __NR_getpeername
591 #define __NR_getpeername __PNR_getpeername
592 #endif /* __NR_getpeername */
593
594 #define __PNR_socketpair -108
595 #ifndef __NR_socketpair
596 #define __NR_socketpair __PNR_socketpair
597 #endif /* __NR_socketpair */
598
599 #define __PNR_send -109
600 #ifndef __NR_send
601 #define __NR_send __PNR_send
602 #endif /* __NR_send */
603
604 #define __PNR_recv -110
605 #ifndef __NR_recv
606 #define __NR_recv __PNR_recv
607 #endif /* __NR_recv */
608
609 #define __PNR_sendto -111
610 #ifndef __NR_sendto
611 #define __NR_sendto __PNR_sendto
612 #endif /* __NR_sendto */
613
614 #define __PNR_recvfrom -112
615 #ifndef __NR_recvfrom
616 #define __NR_recvfrom __PNR_recvfrom
617 #endif /* __NR_recvfrom */
618
619 #define __PNR_shutdown -113
620 #ifndef __NR_shutdown
621 #define __NR_shutdown __PNR_shutdown
622 #endif /* __NR_shutdown */
623
624 #define __PNR_setsockopt -114
625 #ifndef __NR_setsockopt
626 #define __NR_setsockopt __PNR_setsockopt
627 #endif /* __NR_getsockopt */
628
629 #define __PNR_getsockopt -115
630 #ifndef __NR_getsockopt
631 #define __NR_getsockopt __PNR_getsockopt
632 #endif /* __NR_getsockopt */
633
634 #define __PNR_sendmsg -116
635 #ifndef __NR_sendmsg
636 #define __NR_sendmsg __PNR_sendmsg
637 #endif /* __NR_sendmsg */
638
639 #define __PNR_recvmsg -117
640 #ifndef __NR_recvmsg
641 #define __NR_recvmsg __PNR_recvmsg
642 #endif /* __NR_recvmsg */
643
644 #define __PNR_accept4 -118
645 #ifndef __NR_accept4
646 #define __NR_accept4 __PNR_accept4
647 #endif /* __NR_accept4 */
648
649 #define __PNR_recvmmsg -119
650 #ifndef __NR_recvmmsg
651 #define __NR_recvmmsg __PNR_recvmmsg
652 #endif /* __NR_recvmmsg */
653
654 #define __PNR_sendmmsg -120
655 #ifndef __NR_sendmmsg
656 #define __NR_sendmmsg __PNR_sendmmsg
657 #endif /* __NR_sendmmsg */
658
659 /* ipc syscalls */
660
661 #define __PNR_semop -201
662 #ifndef __NR_semop
663 #define __NR_semop __PNR_semop
664 #endif /* __NR_semop */
665
666 #define __PNR_semget -202
667 #ifndef __NR_semget
668 #define __NR_semget __PNR_semget
669 #endif /* __NR_semget */
670
671 #define __PNR_semctl -203
672 #ifndef __NR_semctl
673 #define __NR_semctl __PNR_semctl
674 #endif /* __NR_semctl */
675
676 #define __PNR_semtimedop -204
677 #ifndef __NR_semtimedop
678 #define __NR_semtimedop __PNR_semtimedop
679 #endif /* __NR_semtime */
680
681 #define __PNR_msgsnd -211
682 #ifndef __NR_msgsnd
683 #define __NR_msgsnd __PNR_msgsnd
684 #endif /* __NR_msgsnd */
685
686 #define __PNR_msgrcv -212
687 #ifndef __NR_msgrcv
688 #define __NR_msgrcv __PNR_msgrcv
689 #endif /* __NR_msgrcv */
690
691 #define __PNR_msgget -213
692 #ifndef __NR_msgget
693 #define __NR_msgget __PNR_msgget
694 #endif /* __NR_msgget */
695
696 #define __PNR_msgctl -214
697 #ifndef __NR_msgctl
698 #define __NR_msgctl __PNR_msgctl
699 #endif /* __NR_msgctl */
700
701 #define __PNR_shmat -221
702 #ifndef __NR_shmat
703 #define __NR_shmat __PNR_shmat
704 #endif /* __NR_shmat */
705
706 #define __PNR_shmdt -222
707 #ifndef __NR_shmdt
708 #define __NR_shmdt __PNR_shmdt
709 #endif /* __NR_shmdt */
710
711 #define __PNR_shmget -223
712 #ifndef __NR_shmget
713 #define __NR_shmget __PNR_shmget
714 #endif /* __NR_shmget */
715
716 #define __PNR_shmctl -224
717 #ifndef __NR_shmctl
718 #define __NR_shmctl __PNR_shmctl
719 #endif /* __NR_shmctl */
720
721 /* single syscalls */
722
723 #define __PNR_arch_prctl -10001
724 #ifndef __NR_arch_prctl
725 #define __NR_arch_prctl __PNR_arch_prctl
726 #endif /* __NR_arch_prctl */
727
728 #define __PNR_bdflush -10002
729 #ifndef __NR_bdflush
730 #define __NR_bdflush __PNR_bdflush
731 #endif /* __NR_bdflush */
732
733 #define __PNR_break -10003
734 #ifndef __NR_break
735 #define __NR_break __PNR_break
736 #endif /* __NR_break */
737
738 #define __PNR_chown32 -10004
739 #ifndef __NR_chown32
740 #define __NR_chown32 __PNR_chown32
741 #endif /* __NR_chown32 */
742
743 #define __PNR_epoll_ctl_old -10005
744 #ifndef __NR_epoll_ctl_old
745 #define __NR_epoll_ctl_old __PNR_epoll_ctl_old
746 #endif /* __NR_epoll_ctl_old */
747
748 #define __PNR_epoll_wait_old -10006
749 #ifndef __NR_epoll_wait_old
750 #define __NR_epoll_wait_old __PNR_epoll_wait_old
751 #endif /* __NR_epoll_wait_old */
752
753 #define __PNR_fadvise64_64 -10007
754 #ifndef __NR_fadvise64_64
755 #define __NR_fadvise64_64 __PNR_fadvise64_64
756 #endif /* __NR_fadvise64_64 */
757
758 #define __PNR_fchown32 -10008
759 #ifndef __NR_fchown32
760 #define __NR_fchown32 __PNR_fchown32
761 #endif /* __NR_fchown32 */
762
763 #define __PNR_fcntl64 -10009
764 #ifndef __NR_fcntl64
765 #define __NR_fcntl64 __PNR_fcntl64
766 #endif /* __NR_fcntl64 */
767
768 #define __PNR_fstat64 -10010
769 #ifndef __NR_fstat64
770 #define __NR_fstat64 __PNR_fstat64
771 #endif /* __NR_fstat64 */
772
773 #define __PNR_fstatat64 -10011
774 #ifndef __NR_fstatat64
775 #define __NR_fstatat64 __PNR_fstatat64
776 #endif /* __NR_fstatat64 */
777
778 #define __PNR_fstatfs64 -10012
779 #ifndef __NR_fstatfs64
780 #define __NR_fstatfs64 __PNR_fstatfs64
781 #endif /* __NR_fstatfs64 */
782
783 #define __PNR_ftime -10013
784 #ifndef __NR_ftime
785 #define __NR_ftime __PNR_ftime
786 #endif /* __NR_ftime */
787
788 #define __PNR_ftruncate64 -10014
789 #ifndef __NR_ftruncate64
790 #define __NR_ftruncate64 __PNR_ftruncate64
791 #endif /* __NR_ftruncate64 */
792
793 #define __PNR_getegid32 -10015
794 #ifndef __NR_getegid32
795 #define __NR_getegid32 __PNR_getegid32
796 #endif /* __NR_getegid32 */
797
798 #define __PNR_geteuid32 -10016
799 #ifndef __NR_geteuid32
800 #define __NR_geteuid32 __PNR_geteuid32
801 #endif /* __NR_geteuid32 */
802
803 #define __PNR_getgid32 -10017
804 #ifndef __NR_getgid32
805 #define __NR_getgid32 __PNR_getgid32
806 #endif /* __NR_getgid32 */
807
808 #define __PNR_getgroups32 -10018
809 #ifndef __NR_getgroups32
810 #define __NR_getgroups32 __PNR_getgroups32
811 #endif /* __NR_getgroups32 */
812
813 #define __PNR_getresgid32 -10019
814 #ifndef __NR_getresgid32
815 #define __NR_getresgid32 __PNR_getresgid32
816 #endif /* __NR_getresgid32 */
817
818 #define __PNR_getresuid32 -10020
819 #ifndef __NR_getresuid32
820 #define __NR_getresuid32 __PNR_getresuid32
821 #endif /* __NR_getresuid32 */
822
823 #define __PNR_getuid32 -10021
824 #ifndef __NR_getuid32
825 #define __NR_getuid32 __PNR_getuid32
826 #endif /* __NR_getuid32 */
827
828 #define __PNR_gtty -10022
829 #ifndef __NR_gtty
830 #define __NR_gtty __PNR_gtty
831 #endif /* __NR_gtty */
832
833 #define __PNR_idle -10023
834 #ifndef __NR_idle
835 #define __NR_idle __PNR_idle
836 #endif /* __NR_idle */
837
838 #define __PNR_ipc -10024
839 #ifndef __NR_ipc
840 #define __NR_ipc __PNR_ipc
841 #endif /* __NR_ipc */
842
843 #define __PNR_lchown32 -10025
844 #ifndef __NR_lchown32
845 #define __NR_lchown32 __PNR_lchown32
846 #endif /* __NR_lchown32 */
847
848 #define __PNR__llseek -10026
849 #ifndef __NR__llseek
850 #define __NR__llseek __PNR__llseek
851 #endif /* __NR__llseek */
852
853 #define __PNR_lock -10027
854 #ifndef __NR_lock
855 #define __NR_lock __PNR_lock
856 #endif /* __NR_lock */
857
858 #define __PNR_lstat64 -10028
859 #ifndef __NR_lstat64
860 #define __NR_lstat64 __PNR_lstat64
861 #endif /* __NR_lstat64 */
862
863 #define __PNR_mmap2 -10029
864 #ifndef __NR_mmap2
865 #define __NR_mmap2 __PNR_mmap2
866 #endif /* __NR_mmap2 */
867
868 #define __PNR_mpx -10030
869 #ifndef __NR_mpx
870 #define __NR_mpx __PNR_mpx
871 #endif /* __NR_mpx */
872
873 #define __PNR_newfstatat -10031
874 #ifndef __NR_newfstatat
875 #define __NR_newfstatat __PNR_newfstatat
876 #endif /* __NR_newfstatat */
877
878 #define __PNR__newselect -10032
879 #ifndef __NR__newselect
880 #define __NR__newselect __PNR__newselect
881 #endif /* __NR__newselect */
882
883 #define __PNR_nice -10033
884 #ifndef __NR_nice
885 #define __NR_nice __PNR_nice
886 #endif /* __NR_nice */
887
888 #define __PNR_oldfstat -10034
889 #ifndef __NR_oldfstat
890 #define __NR_oldfstat __PNR_oldfstat
891 #endif /* __NR_oldfstat */
892
893 #define __PNR_oldlstat -10035
894 #ifndef __NR_oldlstat
895 #define __NR_oldlstat __PNR_oldlstat
896 #endif /* __NR_oldlstat */
897
898 #define __PNR_oldolduname -10036
899 #ifndef __NR_oldolduname
900 #define __NR_oldolduname __PNR_oldolduname
901 #endif /* __NR_oldolduname */
902
903 #define __PNR_oldstat -10037
904 #ifndef __NR_oldstat
905 #define __NR_oldstat __PNR_oldstat
906 #endif /* __NR_oldstat */
907
908 #define __PNR_olduname -10038
909 #ifndef __NR_olduname
910 #define __NR_olduname __PNR_olduname
911 #endif /* __NR_olduname */
912
913 #define __PNR_prof -10039
914 #ifndef __NR_prof
915 #define __NR_prof __PNR_prof
916 #endif /* __NR_prof */
917
918 #define __PNR_profil -10040
919 #ifndef __NR_profil
920 #define __NR_profil __PNR_profil
921 #endif /* __NR_profil */
922
923 #define __PNR_readdir -10041
924 #ifndef __NR_readdir
925 #define __NR_readdir __PNR_readdir
926 #endif /* __NR_readdir */
927
928 #define __PNR_security -10042
929 #ifndef __NR_security
930 #define __NR_security __PNR_security
931 #endif /* __NR_security */
932
933 #define __PNR_sendfile64 -10043
934 #ifndef __NR_sendfile64
935 #define __NR_sendfile64 __PNR_sendfile64
936 #endif /* __NR_sendfile64 */
937
938 #define __PNR_setfsgid32 -10044
939 #ifndef __NR_setfsgid32
940 #define __NR_setfsgid32 __PNR_setfsgid32
941 #endif /* __NR_setfsgid32 */
942
943 #define __PNR_setfsuid32 -10045
944 #ifndef __NR_setfsuid32
945 #define __NR_setfsuid32 __PNR_setfsuid32
946 #endif /* __NR_setfsuid32 */
947
948 #define __PNR_setgid32 -10046
949 #ifndef __NR_setgid32
950 #define __NR_setgid32 __PNR_setgid32
951 #endif /* __NR_setgid32 */
952
953 #define __PNR_setgroups32 -10047
954 #ifndef __NR_setgroups32
955 #define __NR_setgroups32 __PNR_setgroups32
956 #endif /* __NR_setgroups32 */
957
958 #define __PNR_setregid32 -10048
959 #ifndef __NR_setregid32
960 #define __NR_setregid32 __PNR_setregid32
961 #endif /* __NR_setregid32 */
962
963 #define __PNR_setresgid32 -10049
964 #ifndef __NR_setresgid32
965 #define __NR_setresgid32 __PNR_setresgid32
966 #endif /* __NR_setresgid32 */
967
968 #define __PNR_setresuid32 -10050
969 #ifndef __NR_setresuid32
970 #define __NR_setresuid32 __PNR_setresuid32
971 #endif /* __NR_setresuid32 */
972
973 #define __PNR_setreuid32 -10051
974 #ifndef __NR_setreuid32
975 #define __NR_setreuid32 __PNR_setreuid32
976 #endif /* __NR_setreuid32 */
977
978 #define __PNR_setuid32 -10052
979 #ifndef __NR_setuid32
980 #define __NR_setuid32 __PNR_setuid32
981 #endif /* __NR_setuid32 */
982
983 #define __PNR_sgetmask -10053
984 #ifndef __NR_sgetmask
985 #define __NR_sgetmask __PNR_sgetmask
986 #endif /* __NR_sgetmask */
987
988 #define __PNR_sigaction -10054
989 #ifndef __NR_sigaction
990 #define __NR_sigaction __PNR_sigaction
991 #endif /* __NR_sigaction */
992
993 #define __PNR_signal -10055
994 #ifndef __NR_signal
995 #define __NR_signal __PNR_signal
996 #endif /* __NR_signal */
997
998 #define __PNR_sigpending -10056
999 #ifndef __NR_sigpending
1000 #define __NR_sigpending __PNR_sigpending
1001 #endif /* __NR_sigpending */
1002
1003 #define __PNR_sigprocmask -10057
1004 #ifndef __NR_sigprocmask
1005 #define __NR_sigprocmask __PNR_sigprocmask
1006 #endif /* __NR_sigprocmask */
1007
1008 #define __PNR_sigreturn -10058
1009 #ifndef __NR_sigreturn
1010 #define __NR_sigreturn __PNR_sigreturn
1011 #endif /* __NR_sigreturn */
1012
1013 #define __PNR_sigsuspend -10059
1014 #ifndef __NR_sigsuspend
1015 #define __NR_sigsuspend __PNR_sigsuspend
1016 #endif /* __NR_sigsuspend */
1017
1018 #define __PNR_socketcall -10060
1019 #ifndef __NR_socketcall
1020 #define __NR_socketcall __PNR_socketcall
1021 #endif /* __NR_socketcall */
1022
1023 #define __PNR_ssetmask -10061
1024 #ifndef __NR_ssetmask
1025 #define __NR_ssetmask __PNR_ssetmask
1026 #endif /* __NR_ssetmask */
1027
1028 #define __PNR_stat64 -10062
1029 #ifndef __NR_stat64
1030 #define __NR_stat64 __PNR_stat64
1031 #endif /* __NR_stat64 */
1032
1033 #define __PNR_statfs64 -10063
1034 #ifndef __NR_statfs64
1035 #define __NR_statfs64 __PNR_statfs64
1036 #endif /* __NR_statfs64 */
1037
1038 #define __PNR_stime -10064
1039 #ifndef __NR_stime
1040 #define __NR_stime __PNR_stime
1041 #endif /* __NR_stime */
1042
1043 #define __PNR_stty -10065
1044 #ifndef __NR_stty
1045 #define __NR_stty __PNR_stty
1046 #endif /* __NR_stty */
1047
1048 #define __PNR_truncate64 -10066
1049 #ifndef __NR_truncate64
1050 #define __NR_truncate64 __PNR_truncate64
1051 #endif /* __NR_truncate64 */
1052
1053 #define __PNR_tuxcall -10067
1054 #ifndef __NR_tuxcall
1055 #define __NR_tuxcall __PNR_tuxcall
1056 #endif /* __NR_tuxcall */
1057
1058 #define __PNR_ugetrlimit -10068
1059 #ifndef __NR_ugetrlimit
1060 #define __NR_ugetrlimit __PNR_ugetrlimit
1061 #endif /* __NR_ugetrlimit */
1062
1063 #define __PNR_ulimit -10069
1064 #ifndef __NR_ulimit
1065 #define __NR_ulimit __PNR_ulimit
1066 #endif /* __NR_ulimit */
1067
1068 #define __PNR_umount -10070
1069 #ifndef __NR_umount
1070 #define __NR_umount __PNR_umount
1071 #endif /* __NR_umount */
1072
1073 #define __PNR_vm86 -10071
1074 #ifndef __NR_vm86
1075 #define __NR_vm86 __PNR_vm86
1076 #endif /* __NR_vm86 */
1077
1078 #define __PNR_vm86old -10072
1079 #ifndef __NR_vm86old
1080 #define __NR_vm86old __PNR_vm86old
1081 #endif /* __NR_vm86old */
1082
1083 #define __PNR_waitpid -10073
1084 #ifndef __NR_waitpid
1085 #define __NR_waitpid __PNR_waitpid
1086 #endif /* __NR_waitpid */
1087
1088 #define __PNR_create_module -10074
1089 #ifndef __NR_create_module
1090 #define __NR_create_module __PNR_create_module
1091 #endif /* __NR_create_module */
1092
1093 #define __PNR_get_kernel_syms -10075
1094 #ifndef __NR_get_kernel_syms
1095 #define __NR_get_kernel_syms __PNR_get_kernel_syms
1096 #endif /* __NR_get_kernel_syms */
1097
1098 #define __PNR_get_thread_area -10076
1099 #ifndef __NR_get_thread_area
1100 #define __NR_get_thread_area __PNR_get_thread_area
1101 #endif /* __NR_get_thread_area */
1102
1103 #define __PNR_nfsservctl -10077
1104 #ifndef __NR_nfsservctl
1105 #define __NR_nfsservctl __PNR_nfsservctl
1106 #endif /* __NR_nfsservctl */
1107
1108 #define __PNR_query_module -10078
1109 #ifndef __NR_query_module
1110 #define __NR_query_module __PNR_query_module
1111 #endif /* __NR_query_module */
1112
1113 #define __PNR_set_thread_area -10079
1114 #ifndef __NR_set_thread_area
1115 #define __NR_set_thread_area __PNR_set_thread_area
1116 #endif /* __NR_set_thread_area */
1117
1118 #define __PNR__sysctl -10080
1119 #ifndef __NR__sysctl
1120 #define __NR__sysctl __PNR__sysctl
1121 #endif /* __NR__sysctl */
1122
1123 #define __PNR_uselib -10081
1124 #ifndef __NR_uselib
1125 #define __NR_uselib __PNR_uselib
1126 #endif /* __NR_uselib */
1127
1128 #define __PNR_vserver -10082
1129 #ifndef __NR_vserver
1130 #define __NR_vserver __PNR_vserver
1131 #endif /* __NR_vserver */
1132
1133 #define __PNR_arm_fadvise64_64 -10083
1134 #ifndef __NR_arm_fadvise64_64
1135 #define __NR_arm_fadvise64_64 __PNR_arm_fadvise64_64
1136 #endif /* __NR_arm_fadvise64_64 */
1137
1138 #define __PNR_arm_sync_file_range -10084
1139 #ifndef __NR_arm_sync_file_range
1140 #define __NR_arm_sync_file_range __PNR_arm_sync_file_range
1141 #endif /* __NR_arm_sync_file_range */
1142
1143 #define __PNR_pciconfig_iobase -10086
1144 #ifndef __NR_pciconfig_iobase
1145 #define __NR_pciconfig_iobase __PNR_pciconfig_iobase
1146 #endif /* __NR_pciconfig_iobase */
1147
1148 #define __PNR_pciconfig_read -10087
1149 #ifndef __NR_pciconfig_read
1150 #define __NR_pciconfig_read __PNR_pciconfig_read
1151 #endif /* __NR_pciconfig_read */
1152
1153 #define __PNR_pciconfig_write -10088
1154 #ifndef __NR_pciconfig_write
1155 #define __NR_pciconfig_write __PNR_pciconfig_write
1156 #endif /* __NR_pciconfig_write */
1157
1158 #define __PNR_sync_file_range2 -10089
1159 #ifndef __NR_sync_file_range2
1160 #define __NR_sync_file_range2 __PNR_sync_file_range2
1161 #endif /* __NR_sync_file_range2 */
1162
1163 #define __PNR_syscall -10090
1164 #ifndef __NR_syscall
1165 #define __NR_syscall __PNR_syscall
1166 #endif /* __NR_syscall */
1167
1168 #define __PNR_afs_syscall -10091
1169 #ifndef __NR_afs_syscall
1170 #define __NR_afs_syscall __PNR_afs_syscall
1171 #endif /* __NR_afs_syscall */
1172
1173 #define __PNR_fadvise64 -10092
1174 #ifndef __NR_fadvise64
1175 #define __NR_fadvise64 __PNR_fadvise64
1176 #endif /* __NR_fadvise64 */
1177
1178 #define __PNR_getpmsg -10093
1179 #ifndef __NR_getpmsg
1180 #define __NR_getpmsg __PNR_getpmsg
1181 #endif /* __NR_getpmsg */
1182
1183 #define __PNR_ioperm -10094
1184 #ifndef __NR_ioperm
1185 #define __NR_ioperm __PNR_ioperm
1186 #endif /* __NR_ioperm */
1187
1188 #define __PNR_iopl -10095
1189 #ifndef __NR_iopl
1190 #define __NR_iopl __PNR_iopl
1191 #endif /* __NR_iopl */
1192
1193 #define __PNR_migrate_pages -10097
1194 #ifndef __NR_migrate_pages
1195 #define __NR_migrate_pages __PNR_migrate_pages
1196 #endif /* __NR_migrate_pages */
1197
1198 #define __PNR_modify_ldt -10098
1199 #ifndef __NR_modify_ldt
1200 #define __NR_modify_ldt __PNR_modify_ldt
1201 #endif /* __NR_modify_ldt */
1202
1203 #define __PNR_putpmsg -10099
1204 #ifndef __NR_putpmsg
1205 #define __NR_putpmsg __PNR_putpmsg
1206 #endif /* __NR_putpmsg */
1207
1208 #define __PNR_sync_file_range -10100
1209 #ifndef __NR_sync_file_range
1210 #define __NR_sync_file_range __PNR_sync_file_range
1211 #endif /* __NR_sync_file_range */
1212
1213 #define __PNR_select -10101
1214 #ifndef __NR_select
1215 #define __NR_select __PNR_select
1216 #endif /* __NR_select */
1217
1218 #define __PNR_vfork -10102
1219 #ifndef __NR_vfork
1220 #define __NR_vfork __PNR_vfork
1221 #endif /* __NR_vfork */
1222
1223 #define __PNR_cachectl -10103
1224 #ifndef __NR_cachectl
1225 #define __NR_cachectl __PNR_cachectl
1226 #endif /* __NR_cachectl */
1227
1228 #define __PNR_cacheflush -10104
1229 #ifdef __ARM_NR_cacheflush
1230 #define __NR_cacheflush __ARM_NR_cacheflush
1231 #else
1232 #define __NR_cacheflush __PNR_cacheflush
1233 #endif /* __ARM_NR_cacheflush */
1234
1235 #define __PNR_sysmips -10106
1236 #ifndef __NR_sysmips
1237 #define __NR_sysmips __PNR_sysmips
1238 #endif /* __NR_sysmips */
1239
1240 #define __PNR_timerfd -10107
1241 #ifndef __NR_timerfd
1242 #define __NR_timerfd __PNR_timerfd
1243 #endif /* __NR_timerfd */
1244
1245 #define __PNR_time -10108
1246 #ifndef __NR_time
1247 #define __NR_time __PNR_time
1248 #endif /* __NR_time */
1249
1250 #define __PNR_getrandom -10109
1251 #ifndef __NR_getrandom
1252 #define __NR_getrandom __PNR_getrandom
1253 #endif /* __NR_getrandom - NO LONGER NEEDED */
1254
1255 #define __PNR_memfd_create -10110
1256 #ifndef __NR_memfd_create
1257 #define __NR_memfd_create __PNR_memfd_create
1258 #endif /* __NR_memfd_create - NO LONGER NEEDED */
1259
1260 #define __PNR_kexec_file_load -10111
1261 #ifndef __NR_kexec_file_load
1262 #define __NR_kexec_file_load __PNR_kexec_file_load
1263 #endif /* __NR_kexec_file_load */
1264
1265 #define __PNR_sysfs -10145
1266 #ifndef __NR_sysfs
1267 #define __NR_sysfs __PNR_sysfs
1268 #endif /* __NR_sysfs */
1269
1270 #define __PNR_oldwait4 -10146
1271 #ifndef __NR_oldwait4
1272 #define __NR_oldwait4 __PNR_oldwait4
1273 #endif /* __NR_sysfs */
1274
1275 #define __PNR_access -10147
1276 #ifndef __NR_access
1277 #define __NR_access __PNR_access
1278 #endif /* __NR_access */
1279
1280 #define __PNR_alarm -10148
1281 #ifndef __NR_alarm
1282 #define __NR_alarm __PNR_alarm
1283 #endif /* __NR_alarm */
1284
1285 #define __PNR_chmod -10149
1286 #ifndef __NR_chmod
1287 #define __NR_chmod __PNR_chmod
1288 #endif /* __NR_chmod */
1289
1290 #define __PNR_chown -10150
1291 #ifndef __NR_chown
1292 #define __NR_chown __PNR_chown
1293 #endif /* __NR_chown */
1294
1295 #define __PNR_creat -10151
1296 #ifndef __NR_creat
1297 #define __NR_creat __PNR_creat
1298 #endif /* __NR_creat */
1299
1300 #define __PNR_dup2 -10152
1301 #ifndef __NR_dup2
1302 #define __NR_dup2 __PNR_dup2
1303 #endif /* __NR_dup2 */
1304
1305 #define __PNR_epoll_create -10153
1306 #ifndef __NR_epoll_create
1307 #define __NR_epoll_create __PNR_epoll_create
1308 #endif /* __NR_epoll_create */
1309
1310 #define __PNR_epoll_wait -10154
1311 #ifndef __NR_epoll_wait
1312 #define __NR_epoll_wait __PNR_epoll_wait
1313 #endif /* __NR_epoll_wait */
1314
1315 #define __PNR_eventfd -10155
1316 #ifndef __NR_eventfd
1317 #define __NR_eventfd __PNR_eventfd
1318 #endif /* __NR_eventfd */
1319
1320 #define __PNR_fork -10156
1321 #ifndef __NR_fork
1322 #define __NR_fork __PNR_fork
1323 #endif /* __NR_fork */
1324
1325 #define __PNR_futimesat -10157
1326 #ifndef __NR_futimesat
1327 #define __NR_futimesat __PNR_futimesat
1328 #endif /* __NR_futimesat */
1329
1330 #define __PNR_getdents -10158
1331 #ifndef __NR_getdents
1332 #define __NR_getdents __PNR_getdents
1333 #endif /* __NR_getdents */
1334
1335 #define __PNR_getpgrp -10159
1336 #ifndef __NR_getpgrp
1337 #define __NR_getpgrp __PNR_getpgrp
1338 #endif /* __NR_getpgrp */
1339
1340 #define __PNR_inotify_init -10160
1341 #ifndef __NR_inotify_init
1342 #define __NR_inotify_init __PNR_inotify_init
1343 #endif /* __NR_inotify_init */
1344
1345 #define __PNR_lchown -10161
1346 #ifndef __NR_lchown
1347 #define __NR_lchown __PNR_lchown
1348 #endif /* __NR_lchown */
1349
1350 #define __PNR_link -10162
1351 #ifndef __NR_link
1352 #define __NR_link __PNR_link
1353 #endif /* __NR_link */
1354
1355 #define __PNR_lstat -10163
1356 #ifndef __NR_lstat
1357 #define __NR_lstat __PNR_lstat
1358 #endif /* __NR_lstat */
1359
1360 #define __PNR_mkdir -10164
1361 #ifndef __NR_mkdir
1362 #define __NR_mkdir __PNR_mkdir
1363 #endif /* __NR_mkdir */
1364
1365 #define __PNR_mknod -10165
1366 #ifndef __NR_mknod
1367 #define __NR_mknod __PNR_mknod
1368 #endif /* __NR_mknod */
1369
1370 #define __PNR_open -10166
1371 #ifndef __NR_open
1372 #define __NR_open __PNR_open
1373 #endif /* __NR_open */
1374
1375 #define __PNR_pause -10167
1376 #ifndef __NR_pause
1377 #define __NR_pause __PNR_pause
1378 #endif /* __NR_pause */
1379
1380 #define __PNR_pipe -10168
1381 #ifndef __NR_pipe
1382 #define __NR_pipe __PNR_pipe
1383 #endif /* __NR_pipe */
1384
1385 #define __PNR_poll -10169
1386 #ifndef __NR_poll
1387 #define __NR_poll __PNR_poll
1388 #endif /* __NR_poll */
1389
1390 #define __PNR_readlink -10170
1391 #ifndef __NR_readlink
1392 #define __NR_readlink __PNR_readlink
1393 #endif /* __NR_readlink */
1394
1395 #define __PNR_rename -10171
1396 #ifndef __NR_rename
1397 #define __NR_rename __PNR_rename
1398 #endif /* __NR_rename */
1399
1400 #define __PNR_rmdir -10172
1401 #ifndef __NR_rmdir
1402 #define __NR_rmdir __PNR_rmdir
1403 #endif /* __NR_rmdir */
1404
1405 #define __PNR_signalfd -10173
1406 #ifndef __NR_signalfd
1407 #define __NR_signalfd __PNR_signalfd
1408 #endif /* __NR_signalfd */
1409
1410 #define __PNR_stat -10174
1411 #ifndef __NR_stat
1412 #define __NR_stat __PNR_stat
1413 #endif /* __NR_stat */
1414
1415 #define __PNR_symlink -10175
1416 #ifndef __NR_symlink
1417 #define __NR_symlink __PNR_symlink
1418 #endif /* __NR_symlink */
1419
1420 #define __PNR_unlink -10176
1421 #ifndef __NR_unlink
1422 #define __NR_unlink __PNR_unlink
1423 #endif /* __NR_unlink */
1424
1425 #define __PNR_ustat -10177
1426 #ifndef __NR_ustat
1427 #define __NR_ustat __PNR_ustat
1428 #endif /* __NR_ustat */
1429
1430 #define __PNR_utime -10178
1431 #ifndef __NR_utime
1432 #define __NR_utime __PNR_utime
1433 #endif /* __NR_utime */
1434
1435 #define __PNR_utimes -10179
1436 #ifndef __NR_utimes
1437 #define __NR_utimes __PNR_utimes
1438 #endif /* __NR_utimes */
1439
1440 #define __PNR_getrlimit -10180
1441 #ifndef __NR_getrlimit
1442 #define __NR_getrlimit __PNR_getrlimit
1443 #endif /* __NR_utimes */
1444
1445 #define __PNR_mmap -10181
1446 #ifndef __NR_mmap
1447 #define __NR_mmap __PNR_mmap
1448 #endif /* __NR_utimes */
1449
1450 #define __PNR_breakpoint -10182
1451 #ifdef __ARM_NR_breakpoint
1452 #define __NR_breakpoint __ARM_NR_breakpoint
1453 #else
1454 #define __NR_breakpoint __PNR_breakpoint
1455 #endif /* __ARM_NR_breakpoint */
1456
1457 #define __PNR_set_tls -10183
1458 #ifdef __ARM_NR_set_tls
1459 #define __NR_set_tls __ARM_NR_set_tls
1460 #else
1461 #define __NR_set_tls __PNR_set_tls
1462 #endif /* __ARM_NR_set_tls */
1463
1464 #define __PNR_usr26 -10184
1465 #ifdef __ARM_NR_usr26
1466 #define __NR_usr26 __ARM_NR_usr26
1467 #else
1468 #define __NR_usr26 __PNR_usr26
1469 #endif /* __ARM_NR_usr26 */
1470
1471 #define __PNR_usr32 -10185
1472 #ifdef __ARM_NR_usr32
1473 #define __NR_usr32 __ARM_NR_usr32
1474 #else
1475 #define __NR_usr32 __PNR_usr32
1476 #endif /* __ARM_NR_usr32 */
1477
1478 #ifdef __cplusplus
1479 }
1480 #endif
1481
1482 #endif
3434 * version information
3535 */
3636
37 #define SCMP_VER_MAJOR %%VERSION_MAJOR%%
38 #define SCMP_VER_MINOR %%VERSION_MINOR%%
39 #define SCMP_VER_MICRO %%VERSION_MICRO%%
37 #define SCMP_VER_MAJOR @VERSION_MAJOR@
38 #define SCMP_VER_MINOR @VERSION_MINOR@
39 #define SCMP_VER_MICRO @VERSION_MICRO@
4040
4141 /*
4242 * types
5555 SCMP_FLTATR_ACT_DEFAULT = 1, /**< default filter action */
5656 SCMP_FLTATR_ACT_BADARCH = 2, /**< bad architecture action */
5757 SCMP_FLTATR_CTL_NNP = 3, /**< set NO_NEW_PRIVS on filter load */
58 SCMP_FLTATR_CTL_TSYNC = 4, /**< sync threads on filter load */
5859 _SCMP_FLTATR_MAX,
5960 };
6061
116117 #define SCMP_ARCH_X32 (EM_X86_64|__AUDIT_ARCH_LE)
117118
118119 /**
119 * The ARM architecture token
120 * The ARM architecture tokens
120121 */
121122 #define SCMP_ARCH_ARM AUDIT_ARCH_ARM
123 /* AArch64 support for audit was merged in 3.17-rc1 */
124 #ifndef AUDIT_ARCH_AARCH64
125 #ifndef EM_AARCH64
126 #define EM_AARCH64 183
127 #endif /* EM_AARCH64 */
128 #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
129 #endif /* AUDIT_ARCH_AARCH64 */
130 #define SCMP_ARCH_AARCH64 AUDIT_ARCH_AARCH64
131
132 /**
133 * The MIPS architecture tokens
134 */
135 #ifndef __AUDIT_ARCH_CONVENTION_MIPS64_N32
136 #define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000
137 #endif
138 #ifndef EM_MIPS
139 #define EM_MIPS 8
140 #endif
141 #ifndef AUDIT_ARCH_MIPS
142 #define AUDIT_ARCH_MIPS (EM_MIPS)
143 #endif
144 #ifndef AUDIT_ARCH_MIPS64
145 #define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
146 #endif
147 /* MIPS64N32 support was merged in 3.15 */
148 #ifndef AUDIT_ARCH_MIPS64N32
149 #define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|\
150 __AUDIT_ARCH_CONVENTION_MIPS64_N32)
151 #endif
152 /* MIPSEL64N32 support was merged in 3.15 */
153 #ifndef AUDIT_ARCH_MIPSEL64N32
154 #define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\
155 __AUDIT_ARCH_CONVENTION_MIPS64_N32)
156 #endif
157 #define SCMP_ARCH_MIPS AUDIT_ARCH_MIPS
158 #define SCMP_ARCH_MIPS64 AUDIT_ARCH_MIPS64
159 #define SCMP_ARCH_MIPS64N32 AUDIT_ARCH_MIPS64N32
160 #define SCMP_ARCH_MIPSEL AUDIT_ARCH_MIPSEL
161 #define SCMP_ARCH_MIPSEL64 AUDIT_ARCH_MIPSEL64
162 #define SCMP_ARCH_MIPSEL64N32 AUDIT_ARCH_MIPSEL64N32
122163
123164 /**
124165 * Convert a syscall name into the associated syscall number
247288 int seccomp_merge(scmp_filter_ctx ctx_dst, scmp_filter_ctx ctx_src);
248289
249290 /**
291 * Resolve the architecture name to a architecture token
292 * @param arch_name the architecture name
293 *
294 * This function resolves the given architecture name to a token suitable for
295 * use with libseccomp, returns zero on failure.
296 *
297 */
298 uint32_t seccomp_arch_resolve_name(const char *arch_name);
299
300 /**
250301 * Return the native architecture token
251302 *
252303 * This function returns the native architecture token value, e.g. SCMP_ARCH_*.
358409 int seccomp_syscall_resolve_name_arch(uint32_t arch_token, const char *name);
359410
360411 /**
412 * Resolve a syscall name to a number and perform any rewriting necessary
413 * @param arch_token the architecture token, e.g. SCMP_ARCH_*
414 * @param name the syscall name
415 *
416 * Resolve the given syscall name to the syscall number for the given
417 * architecture and do any necessary syscall rewriting needed by the
418 * architecture. Returns the syscall number on success, including negative
419 * pseudo syscall numbers (e.g. __PNR_*); returns __NR_SCMP_ERROR on failure.
420 *
421 */
422 int seccomp_syscall_resolve_name_rewrite(uint32_t arch_token, const char *name);
423
424 /**
361425 * Resolve a syscall name to a number
362426 * @param name the syscall name
363427 *
10761140 #define __NR_arm_sync_file_range __PNR_arm_sync_file_range
10771141 #endif /* __NR_arm_sync_file_range */
10781142
1079 #define __PNR_finit_module -10085
1080 #ifndef __NR_finit_module
1081 #define __NR_finit_module __PNR_finit_module
1082 #endif /* __NR_finit_module */
1083
10841143 #define __PNR_pciconfig_iobase -10086
10851144 #ifndef __NR_pciconfig_iobase
10861145 #define __NR_pciconfig_iobase __PNR_pciconfig_iobase
11311190 #define __NR_iopl __PNR_iopl
11321191 #endif /* __NR_iopl */
11331192
1134 #define __PNR_kcmp -10096
1135 #ifndef __NR_kcmp
1136 #define __NR_kcmp __PNR_kcmp
1137 #endif /* __NR_kcmp */
1138
11391193 #define __PNR_migrate_pages -10097
11401194 #ifndef __NR_migrate_pages
11411195 #define __NR_migrate_pages __PNR_migrate_pages
11561210 #define __NR_sync_file_range __PNR_sync_file_range
11571211 #endif /* __NR_sync_file_range */
11581212
1213 #define __PNR_select -10101
1214 #ifndef __NR_select
1215 #define __NR_select __PNR_select
1216 #endif /* __NR_select */
1217
1218 #define __PNR_vfork -10102
1219 #ifndef __NR_vfork
1220 #define __NR_vfork __PNR_vfork
1221 #endif /* __NR_vfork */
1222
1223 #define __PNR_cachectl -10103
1224 #ifndef __NR_cachectl
1225 #define __NR_cachectl __PNR_cachectl
1226 #endif /* __NR_cachectl */
1227
1228 #define __PNR_cacheflush -10104
1229 #ifdef __ARM_NR_cacheflush
1230 #define __NR_cacheflush __ARM_NR_cacheflush
1231 #else
1232 #define __NR_cacheflush __PNR_cacheflush
1233 #endif /* __ARM_NR_cacheflush */
1234
1235 #define __PNR_sysmips -10106
1236 #ifndef __NR_sysmips
1237 #define __NR_sysmips __PNR_sysmips
1238 #endif /* __NR_sysmips */
1239
1240 #define __PNR_timerfd -10107
1241 #ifndef __NR_timerfd
1242 #define __NR_timerfd __PNR_timerfd
1243 #endif /* __NR_timerfd */
1244
1245 #define __PNR_time -10108
1246 #ifndef __NR_time
1247 #define __NR_time __PNR_time
1248 #endif /* __NR_time */
1249
1250 #define __PNR_getrandom -10109
1251 #ifndef __NR_getrandom
1252 #define __NR_getrandom __PNR_getrandom
1253 #endif /* __NR_getrandom - NO LONGER NEEDED */
1254
1255 #define __PNR_memfd_create -10110
1256 #ifndef __NR_memfd_create
1257 #define __NR_memfd_create __PNR_memfd_create
1258 #endif /* __NR_memfd_create - NO LONGER NEEDED */
1259
1260 #define __PNR_kexec_file_load -10111
1261 #ifndef __NR_kexec_file_load
1262 #define __NR_kexec_file_load __PNR_kexec_file_load
1263 #endif /* __NR_kexec_file_load */
1264
1265 #define __PNR_sysfs -10145
1266 #ifndef __NR_sysfs
1267 #define __NR_sysfs __PNR_sysfs
1268 #endif /* __NR_sysfs */
1269
1270 #define __PNR_oldwait4 -10146
1271 #ifndef __NR_oldwait4
1272 #define __NR_oldwait4 __PNR_oldwait4
1273 #endif /* __NR_sysfs */
1274
1275 #define __PNR_access -10147
1276 #ifndef __NR_access
1277 #define __NR_access __PNR_access
1278 #endif /* __NR_access */
1279
1280 #define __PNR_alarm -10148
1281 #ifndef __NR_alarm
1282 #define __NR_alarm __PNR_alarm
1283 #endif /* __NR_alarm */
1284
1285 #define __PNR_chmod -10149
1286 #ifndef __NR_chmod
1287 #define __NR_chmod __PNR_chmod
1288 #endif /* __NR_chmod */
1289
1290 #define __PNR_chown -10150
1291 #ifndef __NR_chown
1292 #define __NR_chown __PNR_chown
1293 #endif /* __NR_chown */
1294
1295 #define __PNR_creat -10151
1296 #ifndef __NR_creat
1297 #define __NR_creat __PNR_creat
1298 #endif /* __NR_creat */
1299
1300 #define __PNR_dup2 -10152
1301 #ifndef __NR_dup2
1302 #define __NR_dup2 __PNR_dup2
1303 #endif /* __NR_dup2 */
1304
1305 #define __PNR_epoll_create -10153
1306 #ifndef __NR_epoll_create
1307 #define __NR_epoll_create __PNR_epoll_create
1308 #endif /* __NR_epoll_create */
1309
1310 #define __PNR_epoll_wait -10154
1311 #ifndef __NR_epoll_wait
1312 #define __NR_epoll_wait __PNR_epoll_wait
1313 #endif /* __NR_epoll_wait */
1314
1315 #define __PNR_eventfd -10155
1316 #ifndef __NR_eventfd
1317 #define __NR_eventfd __PNR_eventfd
1318 #endif /* __NR_eventfd */
1319
1320 #define __PNR_fork -10156
1321 #ifndef __NR_fork
1322 #define __NR_fork __PNR_fork
1323 #endif /* __NR_fork */
1324
1325 #define __PNR_futimesat -10157
1326 #ifndef __NR_futimesat
1327 #define __NR_futimesat __PNR_futimesat
1328 #endif /* __NR_futimesat */
1329
1330 #define __PNR_getdents -10158
1331 #ifndef __NR_getdents
1332 #define __NR_getdents __PNR_getdents
1333 #endif /* __NR_getdents */
1334
1335 #define __PNR_getpgrp -10159
1336 #ifndef __NR_getpgrp
1337 #define __NR_getpgrp __PNR_getpgrp
1338 #endif /* __NR_getpgrp */
1339
1340 #define __PNR_inotify_init -10160
1341 #ifndef __NR_inotify_init
1342 #define __NR_inotify_init __PNR_inotify_init
1343 #endif /* __NR_inotify_init */
1344
1345 #define __PNR_lchown -10161
1346 #ifndef __NR_lchown
1347 #define __NR_lchown __PNR_lchown
1348 #endif /* __NR_lchown */
1349
1350 #define __PNR_link -10162
1351 #ifndef __NR_link
1352 #define __NR_link __PNR_link
1353 #endif /* __NR_link */
1354
1355 #define __PNR_lstat -10163
1356 #ifndef __NR_lstat
1357 #define __NR_lstat __PNR_lstat
1358 #endif /* __NR_lstat */
1359
1360 #define __PNR_mkdir -10164
1361 #ifndef __NR_mkdir
1362 #define __NR_mkdir __PNR_mkdir
1363 #endif /* __NR_mkdir */
1364
1365 #define __PNR_mknod -10165
1366 #ifndef __NR_mknod
1367 #define __NR_mknod __PNR_mknod
1368 #endif /* __NR_mknod */
1369
1370 #define __PNR_open -10166
1371 #ifndef __NR_open
1372 #define __NR_open __PNR_open
1373 #endif /* __NR_open */
1374
1375 #define __PNR_pause -10167
1376 #ifndef __NR_pause
1377 #define __NR_pause __PNR_pause
1378 #endif /* __NR_pause */
1379
1380 #define __PNR_pipe -10168
1381 #ifndef __NR_pipe
1382 #define __NR_pipe __PNR_pipe
1383 #endif /* __NR_pipe */
1384
1385 #define __PNR_poll -10169
1386 #ifndef __NR_poll
1387 #define __NR_poll __PNR_poll
1388 #endif /* __NR_poll */
1389
1390 #define __PNR_readlink -10170
1391 #ifndef __NR_readlink
1392 #define __NR_readlink __PNR_readlink
1393 #endif /* __NR_readlink */
1394
1395 #define __PNR_rename -10171
1396 #ifndef __NR_rename
1397 #define __NR_rename __PNR_rename
1398 #endif /* __NR_rename */
1399
1400 #define __PNR_rmdir -10172
1401 #ifndef __NR_rmdir
1402 #define __NR_rmdir __PNR_rmdir
1403 #endif /* __NR_rmdir */
1404
1405 #define __PNR_signalfd -10173
1406 #ifndef __NR_signalfd
1407 #define __NR_signalfd __PNR_signalfd
1408 #endif /* __NR_signalfd */
1409
1410 #define __PNR_stat -10174
1411 #ifndef __NR_stat
1412 #define __NR_stat __PNR_stat
1413 #endif /* __NR_stat */
1414
1415 #define __PNR_symlink -10175
1416 #ifndef __NR_symlink
1417 #define __NR_symlink __PNR_symlink
1418 #endif /* __NR_symlink */
1419
1420 #define __PNR_unlink -10176
1421 #ifndef __NR_unlink
1422 #define __NR_unlink __PNR_unlink
1423 #endif /* __NR_unlink */
1424
1425 #define __PNR_ustat -10177
1426 #ifndef __NR_ustat
1427 #define __NR_ustat __PNR_ustat
1428 #endif /* __NR_ustat */
1429
1430 #define __PNR_utime -10178
1431 #ifndef __NR_utime
1432 #define __NR_utime __PNR_utime
1433 #endif /* __NR_utime */
1434
1435 #define __PNR_utimes -10179
1436 #ifndef __NR_utimes
1437 #define __NR_utimes __PNR_utimes
1438 #endif /* __NR_utimes */
1439
1440 #define __PNR_getrlimit -10180
1441 #ifndef __NR_getrlimit
1442 #define __NR_getrlimit __PNR_getrlimit
1443 #endif /* __NR_utimes */
1444
1445 #define __PNR_mmap -10181
1446 #ifndef __NR_mmap
1447 #define __NR_mmap __PNR_mmap
1448 #endif /* __NR_utimes */
1449
1450 #define __PNR_breakpoint -10182
1451 #ifdef __ARM_NR_breakpoint
1452 #define __NR_breakpoint __ARM_NR_breakpoint
1453 #else
1454 #define __NR_breakpoint __PNR_breakpoint
1455 #endif /* __ARM_NR_breakpoint */
1456
1457 #define __PNR_set_tls -10183
1458 #ifdef __ARM_NR_set_tls
1459 #define __NR_set_tls __ARM_NR_set_tls
1460 #else
1461 #define __NR_set_tls __PNR_set_tls
1462 #endif /* __ARM_NR_set_tls */
1463
1464 #define __PNR_usr26 -10184
1465 #ifdef __ARM_NR_usr26
1466 #define __NR_usr26 __ARM_NR_usr26
1467 #else
1468 #define __NR_usr26 __PNR_usr26
1469 #endif /* __ARM_NR_usr26 */
1470
1471 #define __PNR_usr32 -10185
1472 #ifdef __ARM_NR_usr32
1473 #define __NR_usr32 __ARM_NR_usr32
1474 #else
1475 #define __NR_usr32 __PNR_usr32
1476 #endif /* __ARM_NR_usr32 */
1477
11591478 #ifdef __cplusplus
11601479 }
11611480 #endif
+0
-31
install.mk less more
0 #
1 # Enhanced Seccomp Library Installation Defaults
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 INSTALL_PREFIX ?= $(CONF_INSTALL_PREFIX)
22
23 INSTALL_SBIN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/sbin
24 INSTALL_BIN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/bin
25 INSTALL_LIB_DIR ?= $(DESTDIR)/$(CONF_INSTALL_LIBDIR)
26 INSTALL_INC_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/include
27 INSTALL_MAN_DIR ?= $(DESTDIR)/$(INSTALL_PREFIX)/share/man
28
29 INSTALL_OWNER ?= $$(id -u)
30 INSTALL_GROUP ?= $$(id -g)
1818 # along with this library; if not, see <http://www.gnu.org/licenses>.
1919 #
2020
21 prefix=%%INSTALL_PREFIX%%
22 libdir=%%INSTALL_LIBDIR%%
23 includedir=${prefix}/include
21 prefix=@prefix@
22 exec_prefix=@exec_prefix@
23 libdir=@libdir@
24 includedir=@includedir@
2425
2526 Name: libseccomp
2627 Description: The enhanced seccomp library
27 URL: http://libseccomp.sf.net
28 Version: %%VERSION_RELEASE%%
28 URL: https://github.com/seccomp/libseccomp
29 Version: @PACKAGE_VERSION@
2930 Cflags: -I${includedir}
3031 Libs: -L${libdir} -lseccomp
0 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1 #
2 # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
3 # Written by Gordon Matzigkeit, 1996
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 m4_define([_LT_COPYING], [dnl
10 # Copyright (C) 2014 Free Software Foundation, Inc.
11 # This is free software; see the source for copying conditions. There is NO
12 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 # GNU Libtool is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 2 of of the License, or
17 # (at your option) any later version.
18 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program or library that is built
21 # using GNU Libtool, you may include this file under the same
22 # distribution terms that you use for the rest of that program.
23 #
24 # GNU Libtool is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 # GNU General Public License for more details.
28 #
29 # You should have received a copy of the GNU General Public License
30 # along with this program. If not, see <http://www.gnu.org/licenses/>.
31 ])
32
33 # serial 58 LT_INIT
34
35
36 # LT_PREREQ(VERSION)
37 # ------------------
38 # Complain and exit if this libtool version is less that VERSION.
39 m4_defun([LT_PREREQ],
40 [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
41 [m4_default([$3],
42 [m4_fatal([Libtool version $1 or higher is required],
43 63)])],
44 [$2])])
45
46
47 # _LT_CHECK_BUILDDIR
48 # ------------------
49 # Complain if the absolute build directory name contains unusual characters
50 m4_defun([_LT_CHECK_BUILDDIR],
51 [case `pwd` in
52 *\ * | *\ *)
53 AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
54 esac
55 ])
56
57
58 # LT_INIT([OPTIONS])
59 # ------------------
60 AC_DEFUN([LT_INIT],
61 [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
62 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
63 AC_BEFORE([$0], [LT_LANG])dnl
64 AC_BEFORE([$0], [LT_OUTPUT])dnl
65 AC_BEFORE([$0], [LTDL_INIT])dnl
66 m4_require([_LT_CHECK_BUILDDIR])dnl
67
68 dnl Autoconf doesn't catch unexpanded LT_ macros by default:
69 m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
70 m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
71 dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
72 dnl unless we require an AC_DEFUNed macro:
73 AC_REQUIRE([LTOPTIONS_VERSION])dnl
74 AC_REQUIRE([LTSUGAR_VERSION])dnl
75 AC_REQUIRE([LTVERSION_VERSION])dnl
76 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
77 m4_require([_LT_PROG_LTMAIN])dnl
78
79 _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
80
81 dnl Parse OPTIONS
82 _LT_SET_OPTIONS([$0], [$1])
83
84 # This can be used to rebuild libtool when needed
85 LIBTOOL_DEPS=$ltmain
86
87 # Always use our own libtool.
88 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
89 AC_SUBST(LIBTOOL)dnl
90
91 _LT_SETUP
92
93 # Only expand once:
94 m4_define([LT_INIT])
95 ])# LT_INIT
96
97 # Old names:
98 AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
99 AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
100 dnl aclocal-1.4 backwards compatibility:
101 dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
102 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
103
104
105 # _LT_PREPARE_CC_BASENAME
106 # -----------------------
107 m4_defun([_LT_PREPARE_CC_BASENAME], [
108 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
109 func_cc_basename ()
110 {
111 for cc_temp in @S|@*""; do
112 case $cc_temp in
113 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
114 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
115 \-*) ;;
116 *) break;;
117 esac
118 done
119 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
120 }
121 ])# _LT_PREPARE_CC_BASENAME
122
123
124 # _LT_CC_BASENAME(CC)
125 # -------------------
126 # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
127 # but that macro is also expanded into generated libtool script, which
128 # arranges for $SED and $ECHO to be set by different means.
129 m4_defun([_LT_CC_BASENAME],
130 [m4_require([_LT_PREPARE_CC_BASENAME])dnl
131 AC_REQUIRE([_LT_DECL_SED])dnl
132 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
133 func_cc_basename $1
134 cc_basename=$func_cc_basename_result
135 ])
136
137
138 # _LT_FILEUTILS_DEFAULTS
139 # ----------------------
140 # It is okay to use these file commands and assume they have been set
141 # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
142 m4_defun([_LT_FILEUTILS_DEFAULTS],
143 [: ${CP="cp -f"}
144 : ${MV="mv -f"}
145 : ${RM="rm -f"}
146 ])# _LT_FILEUTILS_DEFAULTS
147
148
149 # _LT_SETUP
150 # ---------
151 m4_defun([_LT_SETUP],
152 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
153 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
154 AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
155 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
156
157 _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
158 dnl
159 _LT_DECL([], [host_alias], [0], [The host system])dnl
160 _LT_DECL([], [host], [0])dnl
161 _LT_DECL([], [host_os], [0])dnl
162 dnl
163 _LT_DECL([], [build_alias], [0], [The build system])dnl
164 _LT_DECL([], [build], [0])dnl
165 _LT_DECL([], [build_os], [0])dnl
166 dnl
167 AC_REQUIRE([AC_PROG_CC])dnl
168 AC_REQUIRE([LT_PATH_LD])dnl
169 AC_REQUIRE([LT_PATH_NM])dnl
170 dnl
171 AC_REQUIRE([AC_PROG_LN_S])dnl
172 test -z "$LN_S" && LN_S="ln -s"
173 _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
174 dnl
175 AC_REQUIRE([LT_CMD_MAX_LEN])dnl
176 _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
177 _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
178 dnl
179 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
180 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
181 m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
182 m4_require([_LT_CMD_RELOAD])dnl
183 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
184 m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
185 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
186 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
187 m4_require([_LT_WITH_SYSROOT])dnl
188 m4_require([_LT_CMD_TRUNCATE])dnl
189
190 _LT_CONFIG_LIBTOOL_INIT([
191 # See if we are running on zsh, and set the options that allow our
192 # commands through without removal of \ escapes INIT.
193 if test -n "\${ZSH_VERSION+set}"; then
194 setopt NO_GLOB_SUBST
195 fi
196 ])
197 if test -n "${ZSH_VERSION+set}"; then
198 setopt NO_GLOB_SUBST
199 fi
200
201 _LT_CHECK_OBJDIR
202
203 m4_require([_LT_TAG_COMPILER])dnl
204
205 case $host_os in
206 aix3*)
207 # AIX sometimes has problems with the GCC collect2 program. For some
208 # reason, if we set the COLLECT_NAMES environment variable, the problems
209 # vanish in a puff of smoke.
210 if test set != "${COLLECT_NAMES+set}"; then
211 COLLECT_NAMES=
212 export COLLECT_NAMES
213 fi
214 ;;
215 esac
216
217 # Global variables:
218 ofile=libtool
219 can_build_shared=yes
220
221 # All known linkers require a '.a' archive for static linking (except MSVC,
222 # which needs '.lib').
223 libext=a
224
225 with_gnu_ld=$lt_cv_prog_gnu_ld
226
227 old_CC=$CC
228 old_CFLAGS=$CFLAGS
229
230 # Set sane defaults for various variables
231 test -z "$CC" && CC=cc
232 test -z "$LTCC" && LTCC=$CC
233 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
234 test -z "$LD" && LD=ld
235 test -z "$ac_objext" && ac_objext=o
236
237 _LT_CC_BASENAME([$compiler])
238
239 # Only perform the check for file, if the check method requires it
240 test -z "$MAGIC_CMD" && MAGIC_CMD=file
241 case $deplibs_check_method in
242 file_magic*)
243 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
244 _LT_PATH_MAGIC
245 fi
246 ;;
247 esac
248
249 # Use C for the default configuration in the libtool script
250 LT_SUPPORTED_TAG([CC])
251 _LT_LANG_C_CONFIG
252 _LT_LANG_DEFAULT_CONFIG
253 _LT_CONFIG_COMMANDS
254 ])# _LT_SETUP
255
256
257 # _LT_PREPARE_SED_QUOTE_VARS
258 # --------------------------
259 # Define a few sed substitution that help us do robust quoting.
260 m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
261 [# Backslashify metacharacters that are still active within
262 # double-quoted strings.
263 sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
264
265 # Same as above, but do not quote variable references.
266 double_quote_subst='s/\([["`\\]]\)/\\\1/g'
267
268 # Sed substitution to delay expansion of an escaped shell variable in a
269 # double_quote_subst'ed string.
270 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
271
272 # Sed substitution to delay expansion of an escaped single quote.
273 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
274
275 # Sed substitution to avoid accidental globbing in evaled expressions
276 no_glob_subst='s/\*/\\\*/g'
277 ])
278
279 # _LT_PROG_LTMAIN
280 # ---------------
281 # Note that this code is called both from 'configure', and 'config.status'
282 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
283 # 'config.status' has no value for ac_aux_dir unless we are using Automake,
284 # so we pass a copy along to make sure it has a sensible value anyway.
285 m4_defun([_LT_PROG_LTMAIN],
286 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
287 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
288 ltmain=$ac_aux_dir/ltmain.sh
289 ])# _LT_PROG_LTMAIN
290
291
292 ## ------------------------------------- ##
293 ## Accumulate code for creating libtool. ##
294 ## ------------------------------------- ##
295
296 # So that we can recreate a full libtool script including additional
297 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
298 # in macros and then make a single call at the end using the 'libtool'
299 # label.
300
301
302 # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
303 # ----------------------------------------
304 # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
305 m4_define([_LT_CONFIG_LIBTOOL_INIT],
306 [m4_ifval([$1],
307 [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
308 [$1
309 ])])])
310
311 # Initialize.
312 m4_define([_LT_OUTPUT_LIBTOOL_INIT])
313
314
315 # _LT_CONFIG_LIBTOOL([COMMANDS])
316 # ------------------------------
317 # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
318 m4_define([_LT_CONFIG_LIBTOOL],
319 [m4_ifval([$1],
320 [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
321 [$1
322 ])])])
323
324 # Initialize.
325 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
326
327
328 # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
329 # -----------------------------------------------------
330 m4_defun([_LT_CONFIG_SAVE_COMMANDS],
331 [_LT_CONFIG_LIBTOOL([$1])
332 _LT_CONFIG_LIBTOOL_INIT([$2])
333 ])
334
335
336 # _LT_FORMAT_COMMENT([COMMENT])
337 # -----------------------------
338 # Add leading comment marks to the start of each line, and a trailing
339 # full-stop to the whole comment if one is not present already.
340 m4_define([_LT_FORMAT_COMMENT],
341 [m4_ifval([$1], [
342 m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
343 [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
344 )])
345
346
347
348 ## ------------------------ ##
349 ## FIXME: Eliminate VARNAME ##
350 ## ------------------------ ##
351
352
353 # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
354 # -------------------------------------------------------------------
355 # CONFIGNAME is the name given to the value in the libtool script.
356 # VARNAME is the (base) name used in the configure script.
357 # VALUE may be 0, 1 or 2 for a computed quote escaped value based on
358 # VARNAME. Any other value will be used directly.
359 m4_define([_LT_DECL],
360 [lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
361 [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
362 [m4_ifval([$1], [$1], [$2])])
363 lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
364 m4_ifval([$4],
365 [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
366 lt_dict_add_subkey([lt_decl_dict], [$2],
367 [tagged?], [m4_ifval([$5], [yes], [no])])])
368 ])
369
370
371 # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
372 # --------------------------------------------------------
373 m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
374
375
376 # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
377 # ------------------------------------------------
378 m4_define([lt_decl_tag_varnames],
379 [_lt_decl_filter([tagged?], [yes], $@)])
380
381
382 # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
383 # ---------------------------------------------------------
384 m4_define([_lt_decl_filter],
385 [m4_case([$#],
386 [0], [m4_fatal([$0: too few arguments: $#])],
387 [1], [m4_fatal([$0: too few arguments: $#: $1])],
388 [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
389 [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
390 [lt_dict_filter([lt_decl_dict], $@)])[]dnl
391 ])
392
393
394 # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
395 # --------------------------------------------------
396 m4_define([lt_decl_quote_varnames],
397 [_lt_decl_filter([value], [1], $@)])
398
399
400 # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
401 # ---------------------------------------------------
402 m4_define([lt_decl_dquote_varnames],
403 [_lt_decl_filter([value], [2], $@)])
404
405
406 # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
407 # ---------------------------------------------------
408 m4_define([lt_decl_varnames_tagged],
409 [m4_assert([$# <= 2])dnl
410 _$0(m4_quote(m4_default([$1], [[, ]])),
411 m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
412 m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
413 m4_define([_lt_decl_varnames_tagged],
414 [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
415
416
417 # lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
418 # ------------------------------------------------
419 m4_define([lt_decl_all_varnames],
420 [_$0(m4_quote(m4_default([$1], [[, ]])),
421 m4_if([$2], [],
422 m4_quote(lt_decl_varnames),
423 m4_quote(m4_shift($@))))[]dnl
424 ])
425 m4_define([_lt_decl_all_varnames],
426 [lt_join($@, lt_decl_varnames_tagged([$1],
427 lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
428 ])
429
430
431 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
432 # ------------------------------------
433 # Quote a variable value, and forward it to 'config.status' so that its
434 # declaration there will have the same value as in 'configure'. VARNAME
435 # must have a single quote delimited value for this to work.
436 m4_define([_LT_CONFIG_STATUS_DECLARE],
437 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
438
439
440 # _LT_CONFIG_STATUS_DECLARATIONS
441 # ------------------------------
442 # We delimit libtool config variables with single quotes, so when
443 # we write them to config.status, we have to be sure to quote all
444 # embedded single quotes properly. In configure, this macro expands
445 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
446 #
447 # <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
448 m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
449 [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
450 [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
451
452
453 # _LT_LIBTOOL_TAGS
454 # ----------------
455 # Output comment and list of tags supported by the script
456 m4_defun([_LT_LIBTOOL_TAGS],
457 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
458 available_tags='_LT_TAGS'dnl
459 ])
460
461
462 # _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
463 # -----------------------------------
464 # Extract the dictionary values for VARNAME (optionally with TAG) and
465 # expand to a commented shell variable setting:
466 #
467 # # Some comment about what VAR is for.
468 # visible_name=$lt_internal_name
469 m4_define([_LT_LIBTOOL_DECLARE],
470 [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
471 [description])))[]dnl
472 m4_pushdef([_libtool_name],
473 m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
474 m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
475 [0], [_libtool_name=[$]$1],
476 [1], [_libtool_name=$lt_[]$1],
477 [2], [_libtool_name=$lt_[]$1],
478 [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
479 m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
480 ])
481
482
483 # _LT_LIBTOOL_CONFIG_VARS
484 # -----------------------
485 # Produce commented declarations of non-tagged libtool config variables
486 # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
487 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
488 # section) are produced by _LT_LIBTOOL_TAG_VARS.
489 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
490 [m4_foreach([_lt_var],
491 m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
492 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
493
494
495 # _LT_LIBTOOL_TAG_VARS(TAG)
496 # -------------------------
497 m4_define([_LT_LIBTOOL_TAG_VARS],
498 [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
499 [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
500
501
502 # _LT_TAGVAR(VARNAME, [TAGNAME])
503 # ------------------------------
504 m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
505
506
507 # _LT_CONFIG_COMMANDS
508 # -------------------
509 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
510 # variables for single and double quote escaping we saved from calls
511 # to _LT_DECL, we can put quote escaped variables declarations
512 # into 'config.status', and then the shell code to quote escape them in
513 # for loops in 'config.status'. Finally, any additional code accumulated
514 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
515 m4_defun([_LT_CONFIG_COMMANDS],
516 [AC_PROVIDE_IFELSE([LT_OUTPUT],
517 dnl If the libtool generation code has been placed in $CONFIG_LT,
518 dnl instead of duplicating it all over again into config.status,
519 dnl then we will have config.status run $CONFIG_LT later, so it
520 dnl needs to know what name is stored there:
521 [AC_CONFIG_COMMANDS([libtool],
522 [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
523 dnl If the libtool generation code is destined for config.status,
524 dnl expand the accumulated commands and init code now:
525 [AC_CONFIG_COMMANDS([libtool],
526 [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
527 ])#_LT_CONFIG_COMMANDS
528
529
530 # Initialize.
531 m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
532 [
533
534 # The HP-UX ksh and POSIX shell print the target directory to stdout
535 # if CDPATH is set.
536 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
537
538 sed_quote_subst='$sed_quote_subst'
539 double_quote_subst='$double_quote_subst'
540 delay_variable_subst='$delay_variable_subst'
541 _LT_CONFIG_STATUS_DECLARATIONS
542 LTCC='$LTCC'
543 LTCFLAGS='$LTCFLAGS'
544 compiler='$compiler_DEFAULT'
545
546 # A function that is used when there is no print builtin or printf.
547 func_fallback_echo ()
548 {
549 eval 'cat <<_LTECHO_EOF
550 \$[]1
551 _LTECHO_EOF'
552 }
553
554 # Quote evaled strings.
555 for var in lt_decl_all_varnames([[ \
556 ]], lt_decl_quote_varnames); do
557 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
558 *[[\\\\\\\`\\"\\\$]]*)
559 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
560 ;;
561 *)
562 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
563 ;;
564 esac
565 done
566
567 # Double-quote double-evaled strings.
568 for var in lt_decl_all_varnames([[ \
569 ]], lt_decl_dquote_varnames); do
570 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
571 *[[\\\\\\\`\\"\\\$]]*)
572 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
573 ;;
574 *)
575 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
576 ;;
577 esac
578 done
579
580 _LT_OUTPUT_LIBTOOL_INIT
581 ])
582
583 # _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
584 # ------------------------------------
585 # Generate a child script FILE with all initialization necessary to
586 # reuse the environment learned by the parent script, and make the
587 # file executable. If COMMENT is supplied, it is inserted after the
588 # '#!' sequence but before initialization text begins. After this
589 # macro, additional text can be appended to FILE to form the body of
590 # the child script. The macro ends with non-zero status if the
591 # file could not be fully written (such as if the disk is full).
592 m4_ifdef([AS_INIT_GENERATED],
593 [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
594 [m4_defun([_LT_GENERATED_FILE_INIT],
595 [m4_require([AS_PREPARE])]dnl
596 [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
597 [lt_write_fail=0
598 cat >$1 <<_ASEOF || lt_write_fail=1
599 #! $SHELL
600 # Generated by $as_me.
601 $2
602 SHELL=\${CONFIG_SHELL-$SHELL}
603 export SHELL
604 _ASEOF
605 cat >>$1 <<\_ASEOF || lt_write_fail=1
606 AS_SHELL_SANITIZE
607 _AS_PREPARE
608 exec AS_MESSAGE_FD>&1
609 _ASEOF
610 test 0 = "$lt_write_fail" && chmod +x $1[]dnl
611 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
612
613 # LT_OUTPUT
614 # ---------
615 # This macro allows early generation of the libtool script (before
616 # AC_OUTPUT is called), incase it is used in configure for compilation
617 # tests.
618 AC_DEFUN([LT_OUTPUT],
619 [: ${CONFIG_LT=./config.lt}
620 AC_MSG_NOTICE([creating $CONFIG_LT])
621 _LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
622 [# Run this file to recreate a libtool stub with the current configuration.])
623
624 cat >>"$CONFIG_LT" <<\_LTEOF
625 lt_cl_silent=false
626 exec AS_MESSAGE_LOG_FD>>config.log
627 {
628 echo
629 AS_BOX([Running $as_me.])
630 } >&AS_MESSAGE_LOG_FD
631
632 lt_cl_help="\
633 '$as_me' creates a local libtool stub from the current configuration,
634 for use in further configure time tests before the real libtool is
635 generated.
636
637 Usage: $[0] [[OPTIONS]]
638
639 -h, --help print this help, then exit
640 -V, --version print version number, then exit
641 -q, --quiet do not print progress messages
642 -d, --debug don't remove temporary files
643
644 Report bugs to <bug-libtool@gnu.org>."
645
646 lt_cl_version="\
647 m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
648 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
649 configured by $[0], generated by m4_PACKAGE_STRING.
650
651 Copyright (C) 2011 Free Software Foundation, Inc.
652 This config.lt script is free software; the Free Software Foundation
653 gives unlimited permision to copy, distribute and modify it."
654
655 while test 0 != $[#]
656 do
657 case $[1] in
658 --version | --v* | -V )
659 echo "$lt_cl_version"; exit 0 ;;
660 --help | --h* | -h )
661 echo "$lt_cl_help"; exit 0 ;;
662 --debug | --d* | -d )
663 debug=: ;;
664 --quiet | --q* | --silent | --s* | -q )
665 lt_cl_silent=: ;;
666
667 -*) AC_MSG_ERROR([unrecognized option: $[1]
668 Try '$[0] --help' for more information.]) ;;
669
670 *) AC_MSG_ERROR([unrecognized argument: $[1]
671 Try '$[0] --help' for more information.]) ;;
672 esac
673 shift
674 done
675
676 if $lt_cl_silent; then
677 exec AS_MESSAGE_FD>/dev/null
678 fi
679 _LTEOF
680
681 cat >>"$CONFIG_LT" <<_LTEOF
682 _LT_OUTPUT_LIBTOOL_COMMANDS_INIT
683 _LTEOF
684
685 cat >>"$CONFIG_LT" <<\_LTEOF
686 AC_MSG_NOTICE([creating $ofile])
687 _LT_OUTPUT_LIBTOOL_COMMANDS
688 AS_EXIT(0)
689 _LTEOF
690 chmod +x "$CONFIG_LT"
691
692 # configure is writing to config.log, but config.lt does its own redirection,
693 # appending to config.log, which fails on DOS, as config.log is still kept
694 # open by configure. Here we exec the FD to /dev/null, effectively closing
695 # config.log, so it can be properly (re)opened and appended to by config.lt.
696 lt_cl_success=:
697 test yes = "$silent" &&
698 lt_config_lt_args="$lt_config_lt_args --quiet"
699 exec AS_MESSAGE_LOG_FD>/dev/null
700 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
701 exec AS_MESSAGE_LOG_FD>>config.log
702 $lt_cl_success || AS_EXIT(1)
703 ])# LT_OUTPUT
704
705
706 # _LT_CONFIG(TAG)
707 # ---------------
708 # If TAG is the built-in tag, create an initial libtool script with a
709 # default configuration from the untagged config vars. Otherwise add code
710 # to config.status for appending the configuration named by TAG from the
711 # matching tagged config vars.
712 m4_defun([_LT_CONFIG],
713 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
714 _LT_CONFIG_SAVE_COMMANDS([
715 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
716 m4_if(_LT_TAG, [C], [
717 # See if we are running on zsh, and set the options that allow our
718 # commands through without removal of \ escapes.
719 if test -n "${ZSH_VERSION+set}"; then
720 setopt NO_GLOB_SUBST
721 fi
722
723 cfgfile=${ofile}T
724 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
725 $RM "$cfgfile"
726
727 cat <<_LT_EOF >> "$cfgfile"
728 #! $SHELL
729 # Generated automatically by $as_me ($PACKAGE) $VERSION
730 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
731 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
732
733 # Provide generalized library-building support services.
734 # Written by Gordon Matzigkeit, 1996
735
736 _LT_COPYING
737 _LT_LIBTOOL_TAGS
738
739 # Configured defaults for sys_lib_dlsearch_path munging.
740 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
741
742 # ### BEGIN LIBTOOL CONFIG
743 _LT_LIBTOOL_CONFIG_VARS
744 _LT_LIBTOOL_TAG_VARS
745 # ### END LIBTOOL CONFIG
746
747 _LT_EOF
748
749 cat <<'_LT_EOF' >> "$cfgfile"
750
751 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
752
753 _LT_PREPARE_MUNGE_PATH_LIST
754 _LT_PREPARE_CC_BASENAME
755
756 # ### END FUNCTIONS SHARED WITH CONFIGURE
757
758 _LT_EOF
759
760 case $host_os in
761 aix3*)
762 cat <<\_LT_EOF >> "$cfgfile"
763 # AIX sometimes has problems with the GCC collect2 program. For some
764 # reason, if we set the COLLECT_NAMES environment variable, the problems
765 # vanish in a puff of smoke.
766 if test set != "${COLLECT_NAMES+set}"; then
767 COLLECT_NAMES=
768 export COLLECT_NAMES
769 fi
770 _LT_EOF
771 ;;
772 esac
773
774 _LT_PROG_LTMAIN
775
776 # We use sed instead of cat because bash on DJGPP gets confused if
777 # if finds mixed CR/LF and LF-only lines. Since sed operates in
778 # text mode, it properly converts lines to CR/LF. This bash problem
779 # is reportedly fixed, but why not run on old versions too?
780 sed '$q' "$ltmain" >> "$cfgfile" \
781 || (rm -f "$cfgfile"; exit 1)
782
783 mv -f "$cfgfile" "$ofile" ||
784 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
785 chmod +x "$ofile"
786 ],
787 [cat <<_LT_EOF >> "$ofile"
788
789 dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
790 dnl in a comment (ie after a #).
791 # ### BEGIN LIBTOOL TAG CONFIG: $1
792 _LT_LIBTOOL_TAG_VARS(_LT_TAG)
793 # ### END LIBTOOL TAG CONFIG: $1
794 _LT_EOF
795 ])dnl /m4_if
796 ],
797 [m4_if([$1], [], [
798 PACKAGE='$PACKAGE'
799 VERSION='$VERSION'
800 RM='$RM'
801 ofile='$ofile'], [])
802 ])dnl /_LT_CONFIG_SAVE_COMMANDS
803 ])# _LT_CONFIG
804
805
806 # LT_SUPPORTED_TAG(TAG)
807 # ---------------------
808 # Trace this macro to discover what tags are supported by the libtool
809 # --tag option, using:
810 # autoconf --trace 'LT_SUPPORTED_TAG:$1'
811 AC_DEFUN([LT_SUPPORTED_TAG], [])
812
813
814 # C support is built-in for now
815 m4_define([_LT_LANG_C_enabled], [])
816 m4_define([_LT_TAGS], [])
817
818
819 # LT_LANG(LANG)
820 # -------------
821 # Enable libtool support for the given language if not already enabled.
822 AC_DEFUN([LT_LANG],
823 [AC_BEFORE([$0], [LT_OUTPUT])dnl
824 m4_case([$1],
825 [C], [_LT_LANG(C)],
826 [C++], [_LT_LANG(CXX)],
827 [Go], [_LT_LANG(GO)],
828 [Java], [_LT_LANG(GCJ)],
829 [Fortran 77], [_LT_LANG(F77)],
830 [Fortran], [_LT_LANG(FC)],
831 [Windows Resource], [_LT_LANG(RC)],
832 [m4_ifdef([_LT_LANG_]$1[_CONFIG],
833 [_LT_LANG($1)],
834 [m4_fatal([$0: unsupported language: "$1"])])])dnl
835 ])# LT_LANG
836
837
838 # _LT_LANG(LANGNAME)
839 # ------------------
840 m4_defun([_LT_LANG],
841 [m4_ifdef([_LT_LANG_]$1[_enabled], [],
842 [LT_SUPPORTED_TAG([$1])dnl
843 m4_append([_LT_TAGS], [$1 ])dnl
844 m4_define([_LT_LANG_]$1[_enabled], [])dnl
845 _LT_LANG_$1_CONFIG($1)])dnl
846 ])# _LT_LANG
847
848
849 m4_ifndef([AC_PROG_GO], [
850 ############################################################
851 # NOTE: This macro has been submitted for inclusion into #
852 # GNU Autoconf as AC_PROG_GO. When it is available in #
853 # a released version of Autoconf we should remove this #
854 # macro and use it instead. #
855 ############################################################
856 m4_defun([AC_PROG_GO],
857 [AC_LANG_PUSH(Go)dnl
858 AC_ARG_VAR([GOC], [Go compiler command])dnl
859 AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
860 _AC_ARG_VAR_LDFLAGS()dnl
861 AC_CHECK_TOOL(GOC, gccgo)
862 if test -z "$GOC"; then
863 if test -n "$ac_tool_prefix"; then
864 AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
865 fi
866 fi
867 if test -z "$GOC"; then
868 AC_CHECK_PROG(GOC, gccgo, gccgo, false)
869 fi
870 ])#m4_defun
871 ])#m4_ifndef
872
873
874 # _LT_LANG_DEFAULT_CONFIG
875 # -----------------------
876 m4_defun([_LT_LANG_DEFAULT_CONFIG],
877 [AC_PROVIDE_IFELSE([AC_PROG_CXX],
878 [LT_LANG(CXX)],
879 [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
880
881 AC_PROVIDE_IFELSE([AC_PROG_F77],
882 [LT_LANG(F77)],
883 [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
884
885 AC_PROVIDE_IFELSE([AC_PROG_FC],
886 [LT_LANG(FC)],
887 [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
888
889 dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
890 dnl pulling things in needlessly.
891 AC_PROVIDE_IFELSE([AC_PROG_GCJ],
892 [LT_LANG(GCJ)],
893 [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
894 [LT_LANG(GCJ)],
895 [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
896 [LT_LANG(GCJ)],
897 [m4_ifdef([AC_PROG_GCJ],
898 [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
899 m4_ifdef([A][M_PROG_GCJ],
900 [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
901 m4_ifdef([LT_PROG_GCJ],
902 [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
903
904 AC_PROVIDE_IFELSE([AC_PROG_GO],
905 [LT_LANG(GO)],
906 [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
907
908 AC_PROVIDE_IFELSE([LT_PROG_RC],
909 [LT_LANG(RC)],
910 [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
911 ])# _LT_LANG_DEFAULT_CONFIG
912
913 # Obsolete macros:
914 AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
915 AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
916 AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
917 AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
918 AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
919 dnl aclocal-1.4 backwards compatibility:
920 dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
921 dnl AC_DEFUN([AC_LIBTOOL_F77], [])
922 dnl AC_DEFUN([AC_LIBTOOL_FC], [])
923 dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
924 dnl AC_DEFUN([AC_LIBTOOL_RC], [])
925
926
927 # _LT_TAG_COMPILER
928 # ----------------
929 m4_defun([_LT_TAG_COMPILER],
930 [AC_REQUIRE([AC_PROG_CC])dnl
931
932 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
933 _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
934 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
935 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
936
937 # If no C compiler was specified, use CC.
938 LTCC=${LTCC-"$CC"}
939
940 # If no C compiler flags were specified, use CFLAGS.
941 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
942
943 # Allow CC to be a program name with arguments.
944 compiler=$CC
945 ])# _LT_TAG_COMPILER
946
947
948 # _LT_COMPILER_BOILERPLATE
949 # ------------------------
950 # Check for compiler boilerplate output or warnings with
951 # the simple compiler test code.
952 m4_defun([_LT_COMPILER_BOILERPLATE],
953 [m4_require([_LT_DECL_SED])dnl
954 ac_outfile=conftest.$ac_objext
955 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
956 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
957 _lt_compiler_boilerplate=`cat conftest.err`
958 $RM conftest*
959 ])# _LT_COMPILER_BOILERPLATE
960
961
962 # _LT_LINKER_BOILERPLATE
963 # ----------------------
964 # Check for linker boilerplate output or warnings with
965 # the simple link test code.
966 m4_defun([_LT_LINKER_BOILERPLATE],
967 [m4_require([_LT_DECL_SED])dnl
968 ac_outfile=conftest.$ac_objext
969 echo "$lt_simple_link_test_code" >conftest.$ac_ext
970 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
971 _lt_linker_boilerplate=`cat conftest.err`
972 $RM -r conftest*
973 ])# _LT_LINKER_BOILERPLATE
974
975 # _LT_REQUIRED_DARWIN_CHECKS
976 # -------------------------
977 m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
978 case $host_os in
979 rhapsody* | darwin*)
980 AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
981 AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
982 AC_CHECK_TOOL([LIPO], [lipo], [:])
983 AC_CHECK_TOOL([OTOOL], [otool], [:])
984 AC_CHECK_TOOL([OTOOL64], [otool64], [:])
985 _LT_DECL([], [DSYMUTIL], [1],
986 [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
987 _LT_DECL([], [NMEDIT], [1],
988 [Tool to change global to local symbols on Mac OS X])
989 _LT_DECL([], [LIPO], [1],
990 [Tool to manipulate fat objects and archives on Mac OS X])
991 _LT_DECL([], [OTOOL], [1],
992 [ldd/readelf like tool for Mach-O binaries on Mac OS X])
993 _LT_DECL([], [OTOOL64], [1],
994 [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
995
996 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
997 [lt_cv_apple_cc_single_mod=no
998 if test -z "$LT_MULTI_MODULE"; then
999 # By default we will add the -single_module flag. You can override
1000 # by either setting the environment variable LT_MULTI_MODULE
1001 # non-empty at configure time, or by adding -multi_module to the
1002 # link flags.
1003 rm -rf libconftest.dylib*
1004 echo "int foo(void){return 1;}" > conftest.c
1005 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1006 -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1007 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1008 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1009 _lt_result=$?
1010 # If there is a non-empty error log, and "single_module"
1011 # appears in it, assume the flag caused a linker warning
1012 if test -s conftest.err && $GREP single_module conftest.err; then
1013 cat conftest.err >&AS_MESSAGE_LOG_FD
1014 # Otherwise, if the output was created with a 0 exit code from
1015 # the compiler, it worked.
1016 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1017 lt_cv_apple_cc_single_mod=yes
1018 else
1019 cat conftest.err >&AS_MESSAGE_LOG_FD
1020 fi
1021 rm -rf libconftest.dylib*
1022 rm -f conftest.*
1023 fi])
1024
1025 AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1026 [lt_cv_ld_exported_symbols_list],
1027 [lt_cv_ld_exported_symbols_list=no
1028 save_LDFLAGS=$LDFLAGS
1029 echo "_main" > conftest.sym
1030 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1031 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1032 [lt_cv_ld_exported_symbols_list=yes],
1033 [lt_cv_ld_exported_symbols_list=no])
1034 LDFLAGS=$save_LDFLAGS
1035 ])
1036
1037 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1038 [lt_cv_ld_force_load=no
1039 cat > conftest.c << _LT_EOF
1040 int forced_loaded() { return 2;}
1041 _LT_EOF
1042 echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1043 $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
1046 echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1047 $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1048 cat > conftest.c << _LT_EOF
1049 int main() { return 0;}
1050 _LT_EOF
1051 echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1052 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1053 _lt_result=$?
1054 if test -s conftest.err && $GREP force_load conftest.err; then
1055 cat conftest.err >&AS_MESSAGE_LOG_FD
1056 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1057 lt_cv_ld_force_load=yes
1058 else
1059 cat conftest.err >&AS_MESSAGE_LOG_FD
1060 fi
1061 rm -f conftest.err libconftest.a conftest conftest.c
1062 rm -rf conftest.dSYM
1063 ])
1064 case $host_os in
1065 rhapsody* | darwin1.[[012]])
1066 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1067 darwin1.*)
1068 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1069 darwin*) # darwin 5.x on
1070 # if running on 10.5 or later, the deployment target defaults
1071 # to the OS version, if on x86, and 10.4, the deployment
1072 # target defaults to 10.4. Don't you love it?
1073 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1074 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1075 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1076 10.[[012]][[,.]]*)
1077 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1078 10.*)
1079 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1080 esac
1081 ;;
1082 esac
1083 if test yes = "$lt_cv_apple_cc_single_mod"; then
1084 _lt_dar_single_mod='$single_module'
1085 fi
1086 if test yes = "$lt_cv_ld_exported_symbols_list"; then
1087 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1088 else
1089 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1090 fi
1091 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1092 _lt_dsymutil='~$DSYMUTIL $lib || :'
1093 else
1094 _lt_dsymutil=
1095 fi
1096 ;;
1097 esac
1098 ])
1099
1100
1101 # _LT_DARWIN_LINKER_FEATURES([TAG])
1102 # ---------------------------------
1103 # Checks for linker and compiler features on darwin
1104 m4_defun([_LT_DARWIN_LINKER_FEATURES],
1105 [
1106 m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1107 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1108 _LT_TAGVAR(hardcode_direct, $1)=no
1109 _LT_TAGVAR(hardcode_automatic, $1)=yes
1110 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1111 if test yes = "$lt_cv_ld_force_load"; then
1112 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1113 m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1114 [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1115 else
1116 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1117 fi
1118 _LT_TAGVAR(link_all_deplibs, $1)=yes
1119 _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1120 case $cc_basename in
1121 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1122 *) _lt_dar_can_shared=$GCC ;;
1123 esac
1124 if test yes = "$_lt_dar_can_shared"; then
1125 output_verbose_link_cmd=func_echo_all
1126 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
1127 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1128 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
1129 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
1130 m4_if([$1], [CXX],
1131 [ if test yes != "$lt_cv_apple_cc_single_mod"; then
1132 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
1133 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
1134 fi
1135 ],[])
1136 else
1137 _LT_TAGVAR(ld_shlibs, $1)=no
1138 fi
1139 ])
1140
1141 # _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1142 # ----------------------------------
1143 # Links a minimal program and checks the executable
1144 # for the system default hardcoded library path. In most cases,
1145 # this is /usr/lib:/lib, but when the MPI compilers are used
1146 # the location of the communication and MPI libs are included too.
1147 # If we don't find anything, use the default library path according
1148 # to the aix ld manual.
1149 # Store the results from the different compilers for each TAGNAME.
1150 # Allow to override them for all tags through lt_cv_aix_libpath.
1151 m4_defun([_LT_SYS_MODULE_PATH_AIX],
1152 [m4_require([_LT_DECL_SED])dnl
1153 if test set = "${lt_cv_aix_libpath+set}"; then
1154 aix_libpath=$lt_cv_aix_libpath
1155 else
1156 AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1157 [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1158 lt_aix_libpath_sed='[
1159 /Import File Strings/,/^$/ {
1160 /^0/ {
1161 s/^0 *\([^ ]*\) *$/\1/
1162 p
1163 }
1164 }]'
1165 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1166 # Check for a 64-bit object if we didn't find anything.
1167 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1168 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1169 fi],[])
1170 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1171 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1172 fi
1173 ])
1174 aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1175 fi
1176 ])# _LT_SYS_MODULE_PATH_AIX
1177
1178
1179 # _LT_SHELL_INIT(ARG)
1180 # -------------------
1181 m4_define([_LT_SHELL_INIT],
1182 [m4_divert_text([M4SH-INIT], [$1
1183 ])])# _LT_SHELL_INIT
1184
1185
1186
1187 # _LT_PROG_ECHO_BACKSLASH
1188 # -----------------------
1189 # Find how we can fake an echo command that does not interpret backslash.
1190 # In particular, with Autoconf 2.60 or later we add some code to the start
1191 # of the generated configure script that will find a shell with a builtin
1192 # printf (that we can use as an echo command).
1193 m4_defun([_LT_PROG_ECHO_BACKSLASH],
1194 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1195 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1196 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1197
1198 AC_MSG_CHECKING([how to print strings])
1199 # Test print first, because it will be a builtin if present.
1200 if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1201 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1202 ECHO='print -r --'
1203 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1204 ECHO='printf %s\n'
1205 else
1206 # Use this function as a fallback that always works.
1207 func_fallback_echo ()
1208 {
1209 eval 'cat <<_LTECHO_EOF
1210 $[]1
1211 _LTECHO_EOF'
1212 }
1213 ECHO='func_fallback_echo'
1214 fi
1215
1216 # func_echo_all arg...
1217 # Invoke $ECHO with all args, space-separated.
1218 func_echo_all ()
1219 {
1220 $ECHO "$*"
1221 }
1222
1223 case $ECHO in
1224 printf*) AC_MSG_RESULT([printf]) ;;
1225 print*) AC_MSG_RESULT([print -r]) ;;
1226 *) AC_MSG_RESULT([cat]) ;;
1227 esac
1228
1229 m4_ifdef([_AS_DETECT_SUGGESTED],
1230 [_AS_DETECT_SUGGESTED([
1231 test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1232 ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1233 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1234 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1235 PATH=/empty FPATH=/empty; export PATH FPATH
1236 test "X`printf %s $ECHO`" = "X$ECHO" \
1237 || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1238
1239 _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1240 _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1241 ])# _LT_PROG_ECHO_BACKSLASH
1242
1243
1244 # _LT_WITH_SYSROOT
1245 # ----------------
1246 AC_DEFUN([_LT_WITH_SYSROOT],
1247 [AC_MSG_CHECKING([for sysroot])
1248 AC_ARG_WITH([sysroot],
1249 [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1250 [Search for dependent libraries within DIR (or the compiler's sysroot
1251 if not specified).])],
1252 [], [with_sysroot=no])
1253
1254 dnl lt_sysroot will always be passed unquoted. We quote it here
1255 dnl in case the user passed a directory name.
1256 lt_sysroot=
1257 case $with_sysroot in #(
1258 yes)
1259 if test yes = "$GCC"; then
1260 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1261 fi
1262 ;; #(
1263 /*)
1264 lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1265 ;; #(
1266 no|'')
1267 ;; #(
1268 *)
1269 AC_MSG_RESULT([$with_sysroot])
1270 AC_MSG_ERROR([The sysroot must be an absolute path.])
1271 ;;
1272 esac
1273
1274 AC_MSG_RESULT([${lt_sysroot:-no}])
1275 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1276 [dependent libraries, and where our libraries should be installed.])])
1277
1278 # _LT_ENABLE_LOCK
1279 # ---------------
1280 m4_defun([_LT_ENABLE_LOCK],
1281 [AC_ARG_ENABLE([libtool-lock],
1282 [AS_HELP_STRING([--disable-libtool-lock],
1283 [avoid locking (might break parallel builds)])])
1284 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
1285
1286 # Some flags need to be propagated to the compiler or linker for good
1287 # libtool support.
1288 case $host in
1289 ia64-*-hpux*)
1290 # Find out what ABI is being produced by ac_compile, and set mode
1291 # options accordingly.
1292 echo 'int i;' > conftest.$ac_ext
1293 if AC_TRY_EVAL(ac_compile); then
1294 case `/usr/bin/file conftest.$ac_objext` in
1295 *ELF-32*)
1296 HPUX_IA64_MODE=32
1297 ;;
1298 *ELF-64*)
1299 HPUX_IA64_MODE=64
1300 ;;
1301 esac
1302 fi
1303 rm -rf conftest*
1304 ;;
1305 *-*-irix6*)
1306 # Find out what ABI is being produced by ac_compile, and set linker
1307 # options accordingly.
1308 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1309 if AC_TRY_EVAL(ac_compile); then
1310 if test yes = "$lt_cv_prog_gnu_ld"; then
1311 case `/usr/bin/file conftest.$ac_objext` in
1312 *32-bit*)
1313 LD="${LD-ld} -melf32bsmip"
1314 ;;
1315 *N32*)
1316 LD="${LD-ld} -melf32bmipn32"
1317 ;;
1318 *64-bit*)
1319 LD="${LD-ld} -melf64bmip"
1320 ;;
1321 esac
1322 else
1323 case `/usr/bin/file conftest.$ac_objext` in
1324 *32-bit*)
1325 LD="${LD-ld} -32"
1326 ;;
1327 *N32*)
1328 LD="${LD-ld} -n32"
1329 ;;
1330 *64-bit*)
1331 LD="${LD-ld} -64"
1332 ;;
1333 esac
1334 fi
1335 fi
1336 rm -rf conftest*
1337 ;;
1338
1339 mips64*-*linux*)
1340 # Find out what ABI is being produced by ac_compile, and set linker
1341 # options accordingly.
1342 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1343 if AC_TRY_EVAL(ac_compile); then
1344 emul=elf
1345 case `/usr/bin/file conftest.$ac_objext` in
1346 *32-bit*)
1347 emul="${emul}32"
1348 ;;
1349 *64-bit*)
1350 emul="${emul}64"
1351 ;;
1352 esac
1353 case `/usr/bin/file conftest.$ac_objext` in
1354 *MSB*)
1355 emul="${emul}btsmip"
1356 ;;
1357 *LSB*)
1358 emul="${emul}ltsmip"
1359 ;;
1360 esac
1361 case `/usr/bin/file conftest.$ac_objext` in
1362 *N32*)
1363 emul="${emul}n32"
1364 ;;
1365 esac
1366 LD="${LD-ld} -m $emul"
1367 fi
1368 rm -rf conftest*
1369 ;;
1370
1371 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1372 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1373 # Find out what ABI is being produced by ac_compile, and set linker
1374 # options accordingly. Note that the listed cases only cover the
1375 # situations where additional linker options are needed (such as when
1376 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1377 # vice versa); the common cases where no linker options are needed do
1378 # not appear in the list.
1379 echo 'int i;' > conftest.$ac_ext
1380 if AC_TRY_EVAL(ac_compile); then
1381 case `/usr/bin/file conftest.o` in
1382 *32-bit*)
1383 case $host in
1384 x86_64-*kfreebsd*-gnu)
1385 LD="${LD-ld} -m elf_i386_fbsd"
1386 ;;
1387 x86_64-*linux*)
1388 case `/usr/bin/file conftest.o` in
1389 *x86-64*)
1390 LD="${LD-ld} -m elf32_x86_64"
1391 ;;
1392 *)
1393 LD="${LD-ld} -m elf_i386"
1394 ;;
1395 esac
1396 ;;
1397 powerpc64le-*linux*)
1398 LD="${LD-ld} -m elf32lppclinux"
1399 ;;
1400 powerpc64-*linux*)
1401 LD="${LD-ld} -m elf32ppclinux"
1402 ;;
1403 s390x-*linux*)
1404 LD="${LD-ld} -m elf_s390"
1405 ;;
1406 sparc64-*linux*)
1407 LD="${LD-ld} -m elf32_sparc"
1408 ;;
1409 esac
1410 ;;
1411 *64-bit*)
1412 case $host in
1413 x86_64-*kfreebsd*-gnu)
1414 LD="${LD-ld} -m elf_x86_64_fbsd"
1415 ;;
1416 x86_64-*linux*)
1417 LD="${LD-ld} -m elf_x86_64"
1418 ;;
1419 powerpcle-*linux*)
1420 LD="${LD-ld} -m elf64lppc"
1421 ;;
1422 powerpc-*linux*)
1423 LD="${LD-ld} -m elf64ppc"
1424 ;;
1425 s390*-*linux*|s390*-*tpf*)
1426 LD="${LD-ld} -m elf64_s390"
1427 ;;
1428 sparc*-*linux*)
1429 LD="${LD-ld} -m elf64_sparc"
1430 ;;
1431 esac
1432 ;;
1433 esac
1434 fi
1435 rm -rf conftest*
1436 ;;
1437
1438 *-*-sco3.2v5*)
1439 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1440 SAVE_CFLAGS=$CFLAGS
1441 CFLAGS="$CFLAGS -belf"
1442 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1443 [AC_LANG_PUSH(C)
1444 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1445 AC_LANG_POP])
1446 if test yes != "$lt_cv_cc_needs_belf"; then
1447 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1448 CFLAGS=$SAVE_CFLAGS
1449 fi
1450 ;;
1451 *-*solaris*)
1452 # Find out what ABI is being produced by ac_compile, and set linker
1453 # options accordingly.
1454 echo 'int i;' > conftest.$ac_ext
1455 if AC_TRY_EVAL(ac_compile); then
1456 case `/usr/bin/file conftest.o` in
1457 *64-bit*)
1458 case $lt_cv_prog_gnu_ld in
1459 yes*)
1460 case $host in
1461 i?86-*-solaris*|x86_64-*-solaris*)
1462 LD="${LD-ld} -m elf_x86_64"
1463 ;;
1464 sparc*-*-solaris*)
1465 LD="${LD-ld} -m elf64_sparc"
1466 ;;
1467 esac
1468 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
1469 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1470 LD=${LD-ld}_sol2
1471 fi
1472 ;;
1473 *)
1474 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1475 LD="${LD-ld} -64"
1476 fi
1477 ;;
1478 esac
1479 ;;
1480 esac
1481 fi
1482 rm -rf conftest*
1483 ;;
1484 esac
1485
1486 need_locks=$enable_libtool_lock
1487 ])# _LT_ENABLE_LOCK
1488
1489
1490 # _LT_PROG_AR
1491 # -----------
1492 m4_defun([_LT_PROG_AR],
1493 [AC_CHECK_TOOLS(AR, [ar], false)
1494 : ${AR=ar}
1495 : ${AR_FLAGS=cru}
1496 _LT_DECL([], [AR], [1], [The archiver])
1497 _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1498
1499 AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1500 [lt_cv_ar_at_file=no
1501 AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1502 [echo conftest.$ac_objext > conftest.lst
1503 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1504 AC_TRY_EVAL([lt_ar_try])
1505 if test 0 -eq "$ac_status"; then
1506 # Ensure the archiver fails upon bogus file names.
1507 rm -f conftest.$ac_objext libconftest.a
1508 AC_TRY_EVAL([lt_ar_try])
1509 if test 0 -ne "$ac_status"; then
1510 lt_cv_ar_at_file=@
1511 fi
1512 fi
1513 rm -f conftest.* libconftest.a
1514 ])
1515 ])
1516
1517 if test no = "$lt_cv_ar_at_file"; then
1518 archiver_list_spec=
1519 else
1520 archiver_list_spec=$lt_cv_ar_at_file
1521 fi
1522 _LT_DECL([], [archiver_list_spec], [1],
1523 [How to feed a file listing to the archiver])
1524 ])# _LT_PROG_AR
1525
1526
1527 # _LT_CMD_OLD_ARCHIVE
1528 # -------------------
1529 m4_defun([_LT_CMD_OLD_ARCHIVE],
1530 [_LT_PROG_AR
1531
1532 AC_CHECK_TOOL(STRIP, strip, :)
1533 test -z "$STRIP" && STRIP=:
1534 _LT_DECL([], [STRIP], [1], [A symbol stripping program])
1535
1536 AC_CHECK_TOOL(RANLIB, ranlib, :)
1537 test -z "$RANLIB" && RANLIB=:
1538 _LT_DECL([], [RANLIB], [1],
1539 [Commands used to install an old-style archive])
1540
1541 # Determine commands to create old-style static archives.
1542 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1543 old_postinstall_cmds='chmod 644 $oldlib'
1544 old_postuninstall_cmds=
1545
1546 if test -n "$RANLIB"; then
1547 case $host_os in
1548 bitrig* | openbsd*)
1549 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1550 ;;
1551 *)
1552 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1553 ;;
1554 esac
1555 old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1556 fi
1557
1558 case $host_os in
1559 darwin*)
1560 lock_old_archive_extraction=yes ;;
1561 *)
1562 lock_old_archive_extraction=no ;;
1563 esac
1564 _LT_DECL([], [old_postinstall_cmds], [2])
1565 _LT_DECL([], [old_postuninstall_cmds], [2])
1566 _LT_TAGDECL([], [old_archive_cmds], [2],
1567 [Commands used to build an old-style archive])
1568 _LT_DECL([], [lock_old_archive_extraction], [0],
1569 [Whether to use a lock for old archive extraction])
1570 ])# _LT_CMD_OLD_ARCHIVE
1571
1572
1573 # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1574 # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1575 # ----------------------------------------------------------------
1576 # Check whether the given compiler option works
1577 AC_DEFUN([_LT_COMPILER_OPTION],
1578 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1579 m4_require([_LT_DECL_SED])dnl
1580 AC_CACHE_CHECK([$1], [$2],
1581 [$2=no
1582 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1583 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1584 lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
1585 # Insert the option either (1) after the last *FLAGS variable, or
1586 # (2) before a word containing "conftest.", or (3) at the end.
1587 # Note that $ac_compile itself does not contain backslashes and begins
1588 # with a dollar sign (not a hyphen), so the echo should work correctly.
1589 # The option is referenced via a variable to avoid confusing sed.
1590 lt_compile=`echo "$ac_compile" | $SED \
1591 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1592 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1593 -e 's:$: $lt_compiler_flag:'`
1594 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1595 (eval "$lt_compile" 2>conftest.err)
1596 ac_status=$?
1597 cat conftest.err >&AS_MESSAGE_LOG_FD
1598 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1599 if (exit $ac_status) && test -s "$ac_outfile"; then
1600 # The compiler can only warn and ignore the option if not recognized
1601 # So say no if there are warnings other than the usual output.
1602 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1603 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1604 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1605 $2=yes
1606 fi
1607 fi
1608 $RM conftest*
1609 ])
1610
1611 if test yes = "[$]$2"; then
1612 m4_if([$5], , :, [$5])
1613 else
1614 m4_if([$6], , :, [$6])
1615 fi
1616 ])# _LT_COMPILER_OPTION
1617
1618 # Old name:
1619 AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1620 dnl aclocal-1.4 backwards compatibility:
1621 dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1622
1623
1624 # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1625 # [ACTION-SUCCESS], [ACTION-FAILURE])
1626 # ----------------------------------------------------
1627 # Check whether the given linker option works
1628 AC_DEFUN([_LT_LINKER_OPTION],
1629 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1630 m4_require([_LT_DECL_SED])dnl
1631 AC_CACHE_CHECK([$1], [$2],
1632 [$2=no
1633 save_LDFLAGS=$LDFLAGS
1634 LDFLAGS="$LDFLAGS $3"
1635 echo "$lt_simple_link_test_code" > conftest.$ac_ext
1636 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1637 # The linker can only warn and ignore the option if not recognized
1638 # So say no if there are warnings
1639 if test -s conftest.err; then
1640 # Append any errors to the config.log.
1641 cat conftest.err 1>&AS_MESSAGE_LOG_FD
1642 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1643 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1644 if diff conftest.exp conftest.er2 >/dev/null; then
1645 $2=yes
1646 fi
1647 else
1648 $2=yes
1649 fi
1650 fi
1651 $RM -r conftest*
1652 LDFLAGS=$save_LDFLAGS
1653 ])
1654
1655 if test yes = "[$]$2"; then
1656 m4_if([$4], , :, [$4])
1657 else
1658 m4_if([$5], , :, [$5])
1659 fi
1660 ])# _LT_LINKER_OPTION
1661
1662 # Old name:
1663 AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1664 dnl aclocal-1.4 backwards compatibility:
1665 dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1666
1667
1668 # LT_CMD_MAX_LEN
1669 #---------------
1670 AC_DEFUN([LT_CMD_MAX_LEN],
1671 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1672 # find the maximum length of command line arguments
1673 AC_MSG_CHECKING([the maximum length of command line arguments])
1674 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1675 i=0
1676 teststring=ABCD
1677
1678 case $build_os in
1679 msdosdjgpp*)
1680 # On DJGPP, this test can blow up pretty badly due to problems in libc
1681 # (any single argument exceeding 2000 bytes causes a buffer overrun
1682 # during glob expansion). Even if it were fixed, the result of this
1683 # check would be larger than it should be.
1684 lt_cv_sys_max_cmd_len=12288; # 12K is about right
1685 ;;
1686
1687 gnu*)
1688 # Under GNU Hurd, this test is not required because there is
1689 # no limit to the length of command line arguments.
1690 # Libtool will interpret -1 as no limit whatsoever
1691 lt_cv_sys_max_cmd_len=-1;
1692 ;;
1693
1694 cygwin* | mingw* | cegcc*)
1695 # On Win9x/ME, this test blows up -- it succeeds, but takes
1696 # about 5 minutes as the teststring grows exponentially.
1697 # Worse, since 9x/ME are not pre-emptively multitasking,
1698 # you end up with a "frozen" computer, even though with patience
1699 # the test eventually succeeds (with a max line length of 256k).
1700 # Instead, let's just punt: use the minimum linelength reported by
1701 # all of the supported platforms: 8192 (on NT/2K/XP).
1702 lt_cv_sys_max_cmd_len=8192;
1703 ;;
1704
1705 mint*)
1706 # On MiNT this can take a long time and run out of memory.
1707 lt_cv_sys_max_cmd_len=8192;
1708 ;;
1709
1710 amigaos*)
1711 # On AmigaOS with pdksh, this test takes hours, literally.
1712 # So we just punt and use a minimum line length of 8192.
1713 lt_cv_sys_max_cmd_len=8192;
1714 ;;
1715
1716 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1717 # This has been around since 386BSD, at least. Likely further.
1718 if test -x /sbin/sysctl; then
1719 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1720 elif test -x /usr/sbin/sysctl; then
1721 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1722 else
1723 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
1724 fi
1725 # And add a safety zone
1726 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1727 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1728 ;;
1729
1730 interix*)
1731 # We know the value 262144 and hardcode it with a safety zone (like BSD)
1732 lt_cv_sys_max_cmd_len=196608
1733 ;;
1734
1735 os2*)
1736 # The test takes a long time on OS/2.
1737 lt_cv_sys_max_cmd_len=8192
1738 ;;
1739
1740 osf*)
1741 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1742 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1743 # nice to cause kernel panics so lets avoid the loop below.
1744 # First set a reasonable default.
1745 lt_cv_sys_max_cmd_len=16384
1746 #
1747 if test -x /sbin/sysconfig; then
1748 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1749 *1*) lt_cv_sys_max_cmd_len=-1 ;;
1750 esac
1751 fi
1752 ;;
1753 sco3.2v5*)
1754 lt_cv_sys_max_cmd_len=102400
1755 ;;
1756 sysv5* | sco5v6* | sysv4.2uw2*)
1757 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1758 if test -n "$kargmax"; then
1759 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
1760 else
1761 lt_cv_sys_max_cmd_len=32768
1762 fi
1763 ;;
1764 *)
1765 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1766 if test -n "$lt_cv_sys_max_cmd_len" && \
1767 test undefined != "$lt_cv_sys_max_cmd_len"; then
1768 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1769 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1770 else
1771 # Make teststring a little bigger before we do anything with it.
1772 # a 1K string should be a reasonable start.
1773 for i in 1 2 3 4 5 6 7 8; do
1774 teststring=$teststring$teststring
1775 done
1776 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1777 # If test is not a shell built-in, we'll probably end up computing a
1778 # maximum length that is only half of the actual maximum length, but
1779 # we can't tell.
1780 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1781 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1782 test 17 != "$i" # 1/2 MB should be enough
1783 do
1784 i=`expr $i + 1`
1785 teststring=$teststring$teststring
1786 done
1787 # Only check the string length outside the loop.
1788 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1789 teststring=
1790 # Add a significant safety factor because C++ compilers can tack on
1791 # massive amounts of additional arguments before passing them to the
1792 # linker. It appears as though 1/2 is a usable value.
1793 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1794 fi
1795 ;;
1796 esac
1797 ])
1798 if test -n "$lt_cv_sys_max_cmd_len"; then
1799 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1800 else
1801 AC_MSG_RESULT(none)
1802 fi
1803 max_cmd_len=$lt_cv_sys_max_cmd_len
1804 _LT_DECL([], [max_cmd_len], [0],
1805 [What is the maximum length of a command?])
1806 ])# LT_CMD_MAX_LEN
1807
1808 # Old name:
1809 AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1810 dnl aclocal-1.4 backwards compatibility:
1811 dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1812
1813
1814 # _LT_HEADER_DLFCN
1815 # ----------------
1816 m4_defun([_LT_HEADER_DLFCN],
1817 [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1818 ])# _LT_HEADER_DLFCN
1819
1820
1821 # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1822 # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1823 # ----------------------------------------------------------------
1824 m4_defun([_LT_TRY_DLOPEN_SELF],
1825 [m4_require([_LT_HEADER_DLFCN])dnl
1826 if test yes = "$cross_compiling"; then :
1827 [$4]
1828 else
1829 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1830 lt_status=$lt_dlunknown
1831 cat > conftest.$ac_ext <<_LT_EOF
1832 [#line $LINENO "configure"
1833 #include "confdefs.h"
1834
1835 #if HAVE_DLFCN_H
1836 #include <dlfcn.h>
1837 #endif
1838
1839 #include <stdio.h>
1840
1841 #ifdef RTLD_GLOBAL
1842 # define LT_DLGLOBAL RTLD_GLOBAL
1843 #else
1844 # ifdef DL_GLOBAL
1845 # define LT_DLGLOBAL DL_GLOBAL
1846 # else
1847 # define LT_DLGLOBAL 0
1848 # endif
1849 #endif
1850
1851 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1852 find out it does not work in some platform. */
1853 #ifndef LT_DLLAZY_OR_NOW
1854 # ifdef RTLD_LAZY
1855 # define LT_DLLAZY_OR_NOW RTLD_LAZY
1856 # else
1857 # ifdef DL_LAZY
1858 # define LT_DLLAZY_OR_NOW DL_LAZY
1859 # else
1860 # ifdef RTLD_NOW
1861 # define LT_DLLAZY_OR_NOW RTLD_NOW
1862 # else
1863 # ifdef DL_NOW
1864 # define LT_DLLAZY_OR_NOW DL_NOW
1865 # else
1866 # define LT_DLLAZY_OR_NOW 0
1867 # endif
1868 # endif
1869 # endif
1870 # endif
1871 #endif
1872
1873 /* When -fvisibility=hidden is used, assume the code has been annotated
1874 correspondingly for the symbols needed. */
1875 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1876 int fnord () __attribute__((visibility("default")));
1877 #endif
1878
1879 int fnord () { return 42; }
1880 int main ()
1881 {
1882 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1883 int status = $lt_dlunknown;
1884
1885 if (self)
1886 {
1887 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
1888 else
1889 {
1890 if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1891 else puts (dlerror ());
1892 }
1893 /* dlclose (self); */
1894 }
1895 else
1896 puts (dlerror ());
1897
1898 return status;
1899 }]
1900 _LT_EOF
1901 if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1902 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1903 lt_status=$?
1904 case x$lt_status in
1905 x$lt_dlno_uscore) $1 ;;
1906 x$lt_dlneed_uscore) $2 ;;
1907 x$lt_dlunknown|x*) $3 ;;
1908 esac
1909 else :
1910 # compilation failed
1911 $3
1912 fi
1913 fi
1914 rm -fr conftest*
1915 ])# _LT_TRY_DLOPEN_SELF
1916
1917
1918 # LT_SYS_DLOPEN_SELF
1919 # ------------------
1920 AC_DEFUN([LT_SYS_DLOPEN_SELF],
1921 [m4_require([_LT_HEADER_DLFCN])dnl
1922 if test yes != "$enable_dlopen"; then
1923 enable_dlopen=unknown
1924 enable_dlopen_self=unknown
1925 enable_dlopen_self_static=unknown
1926 else
1927 lt_cv_dlopen=no
1928 lt_cv_dlopen_libs=
1929
1930 case $host_os in
1931 beos*)
1932 lt_cv_dlopen=load_add_on
1933 lt_cv_dlopen_libs=
1934 lt_cv_dlopen_self=yes
1935 ;;
1936
1937 mingw* | pw32* | cegcc*)
1938 lt_cv_dlopen=LoadLibrary
1939 lt_cv_dlopen_libs=
1940 ;;
1941
1942 cygwin*)
1943 lt_cv_dlopen=dlopen
1944 lt_cv_dlopen_libs=
1945 ;;
1946
1947 darwin*)
1948 # if libdl is installed we need to link against it
1949 AC_CHECK_LIB([dl], [dlopen],
1950 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1951 lt_cv_dlopen=dyld
1952 lt_cv_dlopen_libs=
1953 lt_cv_dlopen_self=yes
1954 ])
1955 ;;
1956
1957 tpf*)
1958 # Don't try to run any link tests for TPF. We know it's impossible
1959 # because TPF is a cross-compiler, and we know how we open DSOs.
1960 lt_cv_dlopen=dlopen
1961 lt_cv_dlopen_libs=
1962 lt_cv_dlopen_self=no
1963 ;;
1964
1965 *)
1966 AC_CHECK_FUNC([shl_load],
1967 [lt_cv_dlopen=shl_load],
1968 [AC_CHECK_LIB([dld], [shl_load],
1969 [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1970 [AC_CHECK_FUNC([dlopen],
1971 [lt_cv_dlopen=dlopen],
1972 [AC_CHECK_LIB([dl], [dlopen],
1973 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1974 [AC_CHECK_LIB([svld], [dlopen],
1975 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1976 [AC_CHECK_LIB([dld], [dld_link],
1977 [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1978 ])
1979 ])
1980 ])
1981 ])
1982 ])
1983 ;;
1984 esac
1985
1986 if test no = "$lt_cv_dlopen"; then
1987 enable_dlopen=no
1988 else
1989 enable_dlopen=yes
1990 fi
1991
1992 case $lt_cv_dlopen in
1993 dlopen)
1994 save_CPPFLAGS=$CPPFLAGS
1995 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1996
1997 save_LDFLAGS=$LDFLAGS
1998 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1999
2000 save_LIBS=$LIBS
2001 LIBS="$lt_cv_dlopen_libs $LIBS"
2002
2003 AC_CACHE_CHECK([whether a program can dlopen itself],
2004 lt_cv_dlopen_self, [dnl
2005 _LT_TRY_DLOPEN_SELF(
2006 lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2007 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2008 ])
2009
2010 if test yes = "$lt_cv_dlopen_self"; then
2011 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2012 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2013 lt_cv_dlopen_self_static, [dnl
2014 _LT_TRY_DLOPEN_SELF(
2015 lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2016 lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
2017 ])
2018 fi
2019
2020 CPPFLAGS=$save_CPPFLAGS
2021 LDFLAGS=$save_LDFLAGS
2022 LIBS=$save_LIBS
2023 ;;
2024 esac
2025
2026 case $lt_cv_dlopen_self in
2027 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2028 *) enable_dlopen_self=unknown ;;
2029 esac
2030
2031 case $lt_cv_dlopen_self_static in
2032 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2033 *) enable_dlopen_self_static=unknown ;;
2034 esac
2035 fi
2036 _LT_DECL([dlopen_support], [enable_dlopen], [0],
2037 [Whether dlopen is supported])
2038 _LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2039 [Whether dlopen of programs is supported])
2040 _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2041 [Whether dlopen of statically linked programs is supported])
2042 ])# LT_SYS_DLOPEN_SELF
2043
2044 # Old name:
2045 AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2046 dnl aclocal-1.4 backwards compatibility:
2047 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2048
2049
2050 # _LT_COMPILER_C_O([TAGNAME])
2051 # ---------------------------
2052 # Check to see if options -c and -o are simultaneously supported by compiler.
2053 # This macro does not hard code the compiler like AC_PROG_CC_C_O.
2054 m4_defun([_LT_COMPILER_C_O],
2055 [m4_require([_LT_DECL_SED])dnl
2056 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2057 m4_require([_LT_TAG_COMPILER])dnl
2058 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2059 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2060 [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2061 $RM -r conftest 2>/dev/null
2062 mkdir conftest
2063 cd conftest
2064 mkdir out
2065 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2066
2067 lt_compiler_flag="-o out/conftest2.$ac_objext"
2068 # Insert the option either (1) after the last *FLAGS variable, or
2069 # (2) before a word containing "conftest.", or (3) at the end.
2070 # Note that $ac_compile itself does not contain backslashes and begins
2071 # with a dollar sign (not a hyphen), so the echo should work correctly.
2072 lt_compile=`echo "$ac_compile" | $SED \
2073 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2074 -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2075 -e 's:$: $lt_compiler_flag:'`
2076 (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2077 (eval "$lt_compile" 2>out/conftest.err)
2078 ac_status=$?
2079 cat out/conftest.err >&AS_MESSAGE_LOG_FD
2080 echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2081 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2082 then
2083 # The compiler can only warn and ignore the option if not recognized
2084 # So say no if there are warnings
2085 $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2086 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2087 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2088 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2089 fi
2090 fi
2091 chmod u+w . 2>&AS_MESSAGE_LOG_FD
2092 $RM conftest*
2093 # SGI C++ compiler will create directory out/ii_files/ for
2094 # template instantiation
2095 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2096 $RM out/* && rmdir out
2097 cd ..
2098 $RM -r conftest
2099 $RM conftest*
2100 ])
2101 _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2102 [Does compiler simultaneously support -c and -o options?])
2103 ])# _LT_COMPILER_C_O
2104
2105
2106 # _LT_COMPILER_FILE_LOCKS([TAGNAME])
2107 # ----------------------------------
2108 # Check to see if we can do hard links to lock some files if needed
2109 m4_defun([_LT_COMPILER_FILE_LOCKS],
2110 [m4_require([_LT_ENABLE_LOCK])dnl
2111 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2112 _LT_COMPILER_C_O([$1])
2113
2114 hard_links=nottested
2115 if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2116 # do not overwrite the value of need_locks provided by the user
2117 AC_MSG_CHECKING([if we can lock with hard links])
2118 hard_links=yes
2119 $RM conftest*
2120 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2121 touch conftest.a
2122 ln conftest.a conftest.b 2>&5 || hard_links=no
2123 ln conftest.a conftest.b 2>/dev/null && hard_links=no
2124 AC_MSG_RESULT([$hard_links])
2125 if test no = "$hard_links"; then
2126 AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2127 need_locks=warn
2128 fi
2129 else
2130 need_locks=no
2131 fi
2132 _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2133 ])# _LT_COMPILER_FILE_LOCKS
2134
2135
2136 # _LT_CHECK_OBJDIR
2137 # ----------------
2138 m4_defun([_LT_CHECK_OBJDIR],
2139 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2140 [rm -f .libs 2>/dev/null
2141 mkdir .libs 2>/dev/null
2142 if test -d .libs; then
2143 lt_cv_objdir=.libs
2144 else
2145 # MS-DOS does not allow filenames that begin with a dot.
2146 lt_cv_objdir=_libs
2147 fi
2148 rmdir .libs 2>/dev/null])
2149 objdir=$lt_cv_objdir
2150 _LT_DECL([], [objdir], [0],
2151 [The name of the directory that contains temporary libtool files])dnl
2152 m4_pattern_allow([LT_OBJDIR])dnl
2153 AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2154 [Define to the sub-directory where libtool stores uninstalled libraries.])
2155 ])# _LT_CHECK_OBJDIR
2156
2157
2158 # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2159 # --------------------------------------
2160 # Check hardcoding attributes.
2161 m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2162 [AC_MSG_CHECKING([how to hardcode library paths into programs])
2163 _LT_TAGVAR(hardcode_action, $1)=
2164 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2165 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2166 test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2167
2168 # We can hardcode non-existent directories.
2169 if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2170 # If the only mechanism to avoid hardcoding is shlibpath_var, we
2171 # have to relink, otherwise we might link with an installed library
2172 # when we should be linking with a yet-to-be-installed one
2173 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2174 test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2175 # Linking always hardcodes the temporary library directory.
2176 _LT_TAGVAR(hardcode_action, $1)=relink
2177 else
2178 # We can link without hardcoding, and we can hardcode nonexisting dirs.
2179 _LT_TAGVAR(hardcode_action, $1)=immediate
2180 fi
2181 else
2182 # We cannot hardcode anything, or else we can only hardcode existing
2183 # directories.
2184 _LT_TAGVAR(hardcode_action, $1)=unsupported
2185 fi
2186 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2187
2188 if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2189 test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2190 # Fast installation is not supported
2191 enable_fast_install=no
2192 elif test yes = "$shlibpath_overrides_runpath" ||
2193 test no = "$enable_shared"; then
2194 # Fast installation is not necessary
2195 enable_fast_install=needless
2196 fi
2197 _LT_TAGDECL([], [hardcode_action], [0],
2198 [How to hardcode a shared library path into an executable])
2199 ])# _LT_LINKER_HARDCODE_LIBPATH
2200
2201
2202 # _LT_CMD_STRIPLIB
2203 # ----------------
2204 m4_defun([_LT_CMD_STRIPLIB],
2205 [m4_require([_LT_DECL_EGREP])
2206 striplib=
2207 old_striplib=
2208 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])
2213 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
2218 striplib="$STRIP -x"
2219 old_striplib="$STRIP -S"
2220 AC_MSG_RESULT([yes])
2221 else
2222 AC_MSG_RESULT([no])
2223 fi
2224 ;;
2225 *)
2226 AC_MSG_RESULT([no])
2227 ;;
2228 esac
2229 fi
2230 _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2231 _LT_DECL([], [striplib], [1])
2232 ])# _LT_CMD_STRIPLIB
2233
2234
2235 # _LT_PREPARE_MUNGE_PATH_LIST
2236 # ---------------------------
2237 # Make sure func_munge_path_list() is defined correctly.
2238 m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2239 [[# func_munge_path_list VARIABLE PATH
2240 # -----------------------------------
2241 # VARIABLE is name of variable containing _space_ separated list of
2242 # directories to be munged by the contents of PATH, which is string
2243 # having a format:
2244 # "DIR[:DIR]:"
2245 # string "DIR[ DIR]" will be prepended to VARIABLE
2246 # ":DIR[:DIR]"
2247 # string "DIR[ DIR]" will be appended to VARIABLE
2248 # "DIRP[:DIRP]::[DIRA:]DIRA"
2249 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2250 # "DIRA[ DIRA]" will be appended to VARIABLE
2251 # "DIR[:DIR]"
2252 # VARIABLE will be replaced by "DIR[ DIR]"
2253 func_munge_path_list ()
2254 {
2255 case x@S|@2 in
2256 x)
2257 ;;
2258 *:)
2259 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2260 ;;
2261 x:*)
2262 eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2263 ;;
2264 *::*)
2265 eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2266 eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2267 ;;
2268 *)
2269 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2270 ;;
2271 esac
2272 }
2273 ]])# _LT_PREPARE_PATH_LIST
2274
2275
2276 # _LT_SYS_DYNAMIC_LINKER([TAG])
2277 # -----------------------------
2278 # PORTME Fill in your ld.so characteristics
2279 m4_defun([_LT_SYS_DYNAMIC_LINKER],
2280 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
2281 m4_require([_LT_DECL_EGREP])dnl
2282 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
2283 m4_require([_LT_DECL_OBJDUMP])dnl
2284 m4_require([_LT_DECL_SED])dnl
2285 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
2286 m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2287 AC_MSG_CHECKING([dynamic linker characteristics])
2288 m4_if([$1],
2289 [], [
2290 if test yes = "$GCC"; then
2291 case $host_os in
2292 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2293 *) lt_awk_arg='/^libraries:/' ;;
2294 esac
2295 case $host_os in
2296 mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2297 *) lt_sed_strip_eq='s|=/|/|g' ;;
2298 esac
2299 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2300 case $lt_search_path_spec in
2301 *\;*)
2302 # if the path contains ";" then we assume it to be the separator
2303 # otherwise default to the standard path separator (i.e. ":") - it is
2304 # assumed that no part of a normal pathname contains ";" but that should
2305 # okay in the real world where ";" in dirpaths is itself problematic.
2306 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2307 ;;
2308 *)
2309 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2310 ;;
2311 esac
2312 # Ok, now we have the path, separated by spaces, we can step through it
2313 # and add multilib dir if necessary...
2314 lt_tmp_lt_search_path_spec=
2315 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2316 # ...but if some path component already ends with the multilib dir we assume
2317 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2318 case "$lt_multi_os_dir; $lt_search_path_spec " in
2319 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2320 lt_multi_os_dir=
2321 ;;
2322 esac
2323 for lt_sys_path in $lt_search_path_spec; do
2324 if test -d "$lt_sys_path$lt_multi_os_dir"; then
2325 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2326 elif test -n "$lt_multi_os_dir"; then
2327 test -d "$lt_sys_path" && \
2328 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2329 fi
2330 done
2331 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2332 BEGIN {RS = " "; FS = "/|\n";} {
2333 lt_foo = "";
2334 lt_count = 0;
2335 for (lt_i = NF; lt_i > 0; lt_i--) {
2336 if ($lt_i != "" && $lt_i != ".") {
2337 if ($lt_i == "..") {
2338 lt_count++;
2339 } else {
2340 if (lt_count == 0) {
2341 lt_foo = "/" $lt_i lt_foo;
2342 } else {
2343 lt_count--;
2344 }
2345 }
2346 }
2347 }
2348 if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2349 if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2350 }'`
2351 # AWK program above erroneously prepends '/' to C:/dos/paths
2352 # for these hosts.
2353 case $host_os in
2354 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2355 $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2356 esac
2357 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2358 else
2359 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2360 fi])
2361 library_names_spec=
2362 libname_spec='lib$name'
2363 soname_spec=
2364 shrext_cmds=.so
2365 postinstall_cmds=
2366 postuninstall_cmds=
2367 finish_cmds=
2368 finish_eval=
2369 shlibpath_var=
2370 shlibpath_overrides_runpath=unknown
2371 version_type=none
2372 dynamic_linker="$host_os ld.so"
2373 sys_lib_dlsearch_path_spec="/lib /usr/lib"
2374 need_lib_prefix=unknown
2375 hardcode_into_libs=no
2376
2377 # when you set need_version to no, make sure it does not cause -set_version
2378 # flags to be left without arguments
2379 need_version=unknown
2380
2381 AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2382 [User-defined run-time library search path.])
2383
2384 case $host_os in
2385 aix3*)
2386 version_type=linux # correct to gnu/linux during the next big refactor
2387 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2388 shlibpath_var=LIBPATH
2389
2390 # AIX 3 has no versioning support, so we append a major version to the name.
2391 soname_spec='$libname$release$shared_ext$major'
2392 ;;
2393
2394 aix[[4-9]]*)
2395 version_type=linux # correct to gnu/linux during the next big refactor
2396 need_lib_prefix=no
2397 need_version=no
2398 hardcode_into_libs=yes
2399 if test ia64 = "$host_cpu"; then
2400 # AIX 5 supports IA64
2401 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2402 shlibpath_var=LD_LIBRARY_PATH
2403 else
2404 # With GCC up to 2.95.x, collect2 would create an import file
2405 # for dependence libraries. The import file would start with
2406 # the line '#! .'. This would cause the generated library to
2407 # depend on '.', always an invalid library. This was fixed in
2408 # development snapshots of GCC prior to 3.0.
2409 case $host_os in
2410 aix4 | aix4.[[01]] | aix4.[[01]].*)
2411 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2412 echo ' yes '
2413 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2414 :
2415 else
2416 can_build_shared=no
2417 fi
2418 ;;
2419 esac
2420 # Using Import Files as archive members, it is possible to support
2421 # filename-based versioning of shared library archives on AIX. While
2422 # this would work for both with and without runtime linking, it will
2423 # prevent static linking of such archives. So we do filename-based
2424 # shared library versioning with .so extension only, which is used
2425 # when both runtime linking and shared linking is enabled.
2426 # Unfortunately, runtime linking may impact performance, so we do
2427 # not want this to be the default eventually. Also, we use the
2428 # versioned .so libs for executables only if there is the -brtl
2429 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2430 # To allow for filename-based versioning support, we need to create
2431 # libNAME.so.V as an archive file, containing:
2432 # *) an Import File, referring to the versioned filename of the
2433 # archive as well as the shared archive member, telling the
2434 # bitwidth (32 or 64) of that shared object, and providing the
2435 # list of exported symbols of that shared object, eventually
2436 # decorated with the 'weak' keyword
2437 # *) the shared object with the F_LOADONLY flag set, to really avoid
2438 # it being seen by the linker.
2439 # At run time we better use the real file rather than another symlink,
2440 # but for link time we create the symlink libNAME.so -> libNAME.so.V
2441
2442 case $with_aix_soname,$aix_use_runtimelinking in
2443 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2444 # soname into executable. Probably we can add versioning support to
2445 # collect2, so additional links can be useful in future.
2446 aix,yes) # traditional libtool
2447 dynamic_linker='AIX unversionable lib.so'
2448 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2449 # instead of lib<name>.a to let people know that these are not
2450 # typical AIX shared libraries.
2451 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2452 ;;
2453 aix,no) # traditional AIX only
2454 dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2455 # We preserve .a as extension for shared libraries through AIX4.2
2456 # and later when we are not doing run time linking.
2457 library_names_spec='$libname$release.a $libname.a'
2458 soname_spec='$libname$release$shared_ext$major'
2459 ;;
2460 svr4,*) # full svr4 only
2461 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2462 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2463 # We do not specify a path in Import Files, so LIBPATH fires.
2464 shlibpath_overrides_runpath=yes
2465 ;;
2466 *,yes) # both, prefer svr4
2467 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2468 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2469 # unpreferred sharedlib libNAME.a needs extra handling
2470 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2471 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2472 # We do not specify a path in Import Files, so LIBPATH fires.
2473 shlibpath_overrides_runpath=yes
2474 ;;
2475 *,no) # both, prefer aix
2476 dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2477 library_names_spec='$libname$release.a $libname.a'
2478 soname_spec='$libname$release$shared_ext$major'
2479 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2480 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2481 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2482 ;;
2483 esac
2484 shlibpath_var=LIBPATH
2485 fi
2486 ;;
2487
2488 amigaos*)
2489 case $host_cpu in
2490 powerpc)
2491 # Since July 2007 AmigaOS4 officially supports .so libraries.
2492 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2493 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2494 ;;
2495 m68k)
2496 library_names_spec='$libname.ixlibrary $libname.a'
2497 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2498 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2499 ;;
2500 esac
2501 ;;
2502
2503 beos*)
2504 library_names_spec='$libname$shared_ext'
2505 dynamic_linker="$host_os ld.so"
2506 shlibpath_var=LIBRARY_PATH
2507 ;;
2508
2509 bsdi[[45]]*)
2510 version_type=linux # correct to gnu/linux during the next big refactor
2511 need_version=no
2512 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2513 soname_spec='$libname$release$shared_ext$major'
2514 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2515 shlibpath_var=LD_LIBRARY_PATH
2516 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2517 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2518 # the default ld.so.conf also contains /usr/contrib/lib and
2519 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2520 # libtool to hard-code these into programs
2521 ;;
2522
2523 cygwin* | mingw* | pw32* | cegcc*)
2524 version_type=windows
2525 shrext_cmds=.dll
2526 need_version=no
2527 need_lib_prefix=no
2528
2529 case $GCC,$cc_basename in
2530 yes,*)
2531 # gcc
2532 library_names_spec='$libname.dll.a'
2533 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2534 postinstall_cmds='base_file=`basename \$file`~
2535 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2536 dldir=$destdir/`dirname \$dlpath`~
2537 test -d \$dldir || mkdir -p \$dldir~
2538 $install_prog $dir/$dlname \$dldir/$dlname~
2539 chmod a+x \$dldir/$dlname~
2540 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2541 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2542 fi'
2543 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2544 dlpath=$dir/\$dldll~
2545 $RM \$dlpath'
2546 shlibpath_overrides_runpath=yes
2547
2548 case $host_os in
2549 cygwin*)
2550 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2551 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2552 m4_if([$1], [],[
2553 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2554 ;;
2555 mingw* | cegcc*)
2556 # MinGW DLLs use traditional 'lib' prefix
2557 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2558 ;;
2559 pw32*)
2560 # pw32 DLLs use 'pw' prefix rather than 'lib'
2561 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2562 ;;
2563 esac
2564 dynamic_linker='Win32 ld.exe'
2565 ;;
2566
2567 *,cl*)
2568 # Native MSVC
2569 libname_spec='$name'
2570 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2571 library_names_spec='$libname.dll.lib'
2572
2573 case $build_os in
2574 mingw*)
2575 sys_lib_search_path_spec=
2576 lt_save_ifs=$IFS
2577 IFS=';'
2578 for lt_path in $LIB
2579 do
2580 IFS=$lt_save_ifs
2581 # Let DOS variable expansion print the short 8.3 style file name.
2582 lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2583 sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2584 done
2585 IFS=$lt_save_ifs
2586 # Convert to MSYS style.
2587 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2588 ;;
2589 cygwin*)
2590 # Convert to unix form, then to dos form, then back to unix form
2591 # but this time dos style (no spaces!) so that the unix form looks
2592 # like /cygdrive/c/PROGRA~1:/cygdr...
2593 sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2594 sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2595 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2596 ;;
2597 *)
2598 sys_lib_search_path_spec=$LIB
2599 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2600 # It is most probably a Windows format PATH.
2601 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2602 else
2603 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2604 fi
2605 # FIXME: find the short name or the path components, as spaces are
2606 # common. (e.g. "Program Files" -> "PROGRA~1")
2607 ;;
2608 esac
2609
2610 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2611 postinstall_cmds='base_file=`basename \$file`~
2612 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2613 dldir=$destdir/`dirname \$dlpath`~
2614 test -d \$dldir || mkdir -p \$dldir~
2615 $install_prog $dir/$dlname \$dldir/$dlname'
2616 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2617 dlpath=$dir/\$dldll~
2618 $RM \$dlpath'
2619 shlibpath_overrides_runpath=yes
2620 dynamic_linker='Win32 link.exe'
2621 ;;
2622
2623 *)
2624 # Assume MSVC wrapper
2625 library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2626 dynamic_linker='Win32 ld.exe'
2627 ;;
2628 esac
2629 # FIXME: first we should search . and the directory the executable is in
2630 shlibpath_var=PATH
2631 ;;
2632
2633 darwin* | rhapsody*)
2634 dynamic_linker="$host_os dyld"
2635 version_type=darwin
2636 need_lib_prefix=no
2637 need_version=no
2638 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2639 soname_spec='$libname$release$major$shared_ext'
2640 shlibpath_overrides_runpath=yes
2641 shlibpath_var=DYLD_LIBRARY_PATH
2642 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2643 m4_if([$1], [],[
2644 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2645 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2646 ;;
2647
2648 dgux*)
2649 version_type=linux # correct to gnu/linux during the next big refactor
2650 need_lib_prefix=no
2651 need_version=no
2652 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2653 soname_spec='$libname$release$shared_ext$major'
2654 shlibpath_var=LD_LIBRARY_PATH
2655 ;;
2656
2657 freebsd* | dragonfly*)
2658 # DragonFly does not have aout. When/if they implement a new
2659 # versioning mechanism, adjust this.
2660 if test -x /usr/bin/objformat; then
2661 objformat=`/usr/bin/objformat`
2662 else
2663 case $host_os in
2664 freebsd[[23]].*) objformat=aout ;;
2665 *) objformat=elf ;;
2666 esac
2667 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
2676 case $version_type in
2677 freebsd-elf*)
2678 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2679 soname_spec='$libname$release$shared_ext$major'
2680 need_version=no
2681 need_lib_prefix=no
2682 ;;
2683 freebsd-*)
2684 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2685 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
2692 ;;
2693 esac
2694 shlibpath_var=LD_LIBRARY_PATH
2695 case $host_os in
2696 freebsd2.*)
2697 shlibpath_overrides_runpath=yes
2698 ;;
2699 freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2700 shlibpath_overrides_runpath=yes
2701 hardcode_into_libs=yes
2702 ;;
2703 freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2704 freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2705 shlibpath_overrides_runpath=no
2706 hardcode_into_libs=yes
2707 ;;
2708 *) # from 4.6 on, and DragonFly
2709 shlibpath_overrides_runpath=yes
2710 hardcode_into_libs=yes
2711 ;;
2712 esac
2713 ;;
2714
2715 haiku*)
2716 version_type=linux # correct to gnu/linux during the next big refactor
2717 need_lib_prefix=no
2718 need_version=no
2719 dynamic_linker="$host_os runtime_loader"
2720 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2721 soname_spec='$libname$release$shared_ext$major'
2722 shlibpath_var=LIBRARY_PATH
2723 shlibpath_overrides_runpath=no
2724 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2725 hardcode_into_libs=yes
2726 ;;
2727
2728 hpux9* | hpux10* | hpux11*)
2729 # Give a soname corresponding to the major version so that dld.sl refuses to
2730 # link against other versions.
2731 version_type=sunos
2732 need_lib_prefix=no
2733 need_version=no
2734 case $host_cpu in
2735 ia64*)
2736 shrext_cmds='.so'
2737 hardcode_into_libs=yes
2738 dynamic_linker="$host_os dld.so"
2739 shlibpath_var=LD_LIBRARY_PATH
2740 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2741 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2742 soname_spec='$libname$release$shared_ext$major'
2743 if test 32 = "$HPUX_IA64_MODE"; then
2744 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2745 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2746 else
2747 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2748 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2749 fi
2750 ;;
2751 hppa*64*)
2752 shrext_cmds='.sl'
2753 hardcode_into_libs=yes
2754 dynamic_linker="$host_os dld.sl"
2755 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2756 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2757 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2758 soname_spec='$libname$release$shared_ext$major'
2759 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2760 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2761 ;;
2762 *)
2763 shrext_cmds='.sl'
2764 dynamic_linker="$host_os dld.sl"
2765 shlibpath_var=SHLIB_PATH
2766 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2767 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2768 soname_spec='$libname$release$shared_ext$major'
2769 ;;
2770 esac
2771 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2772 postinstall_cmds='chmod 555 $lib'
2773 # or fails outright, so override atomically:
2774 install_override_mode=555
2775 ;;
2776
2777 interix[[3-9]]*)
2778 version_type=linux # correct to gnu/linux during the next big refactor
2779 need_lib_prefix=no
2780 need_version=no
2781 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2782 soname_spec='$libname$release$shared_ext$major'
2783 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2784 shlibpath_var=LD_LIBRARY_PATH
2785 shlibpath_overrides_runpath=no
2786 hardcode_into_libs=yes
2787 ;;
2788
2789 irix5* | irix6* | nonstopux*)
2790 case $host_os in
2791 nonstopux*) version_type=nonstopux ;;
2792 *)
2793 if test yes = "$lt_cv_prog_gnu_ld"; then
2794 version_type=linux # correct to gnu/linux during the next big refactor
2795 else
2796 version_type=irix
2797 fi ;;
2798 esac
2799 need_lib_prefix=no
2800 need_version=no
2801 soname_spec='$libname$release$shared_ext$major'
2802 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2803 case $host_os in
2804 irix5* | nonstopux*)
2805 libsuff= shlibsuff=
2806 ;;
2807 *)
2808 case $LD in # libtool.m4 will add one of these switches to LD
2809 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2810 libsuff= shlibsuff= libmagic=32-bit;;
2811 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2812 libsuff=32 shlibsuff=N32 libmagic=N32;;
2813 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2814 libsuff=64 shlibsuff=64 libmagic=64-bit;;
2815 *) libsuff= shlibsuff= libmagic=never-match;;
2816 esac
2817 ;;
2818 esac
2819 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2820 shlibpath_overrides_runpath=no
2821 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2822 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2823 hardcode_into_libs=yes
2824 ;;
2825
2826 # No shared lib support for Linux oldld, aout, or coff.
2827 linux*oldld* | linux*aout* | linux*coff*)
2828 dynamic_linker=no
2829 ;;
2830
2831 linux*android*)
2832 version_type=none # Android doesn't support versioned libraries.
2833 need_lib_prefix=no
2834 need_version=no
2835 library_names_spec='$libname$release$shared_ext'
2836 soname_spec='$libname$release$shared_ext'
2837 finish_cmds=
2838 shlibpath_var=LD_LIBRARY_PATH
2839 shlibpath_overrides_runpath=yes
2840
2841 # This implies no fast_install, which is unacceptable.
2842 # Some rework will be needed to allow for fast_install
2843 # before this can be enabled.
2844 hardcode_into_libs=yes
2845
2846 dynamic_linker='Android linker'
2847 # Don't embed -rpath directories since the linker doesn't support them.
2848 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2849 ;;
2850
2851 # This must be glibc/ELF.
2852 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2853 version_type=linux # correct to gnu/linux during the next big refactor
2854 need_lib_prefix=no
2855 need_version=no
2856 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2857 soname_spec='$libname$release$shared_ext$major'
2858 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2859 shlibpath_var=LD_LIBRARY_PATH
2860 shlibpath_overrides_runpath=no
2861
2862 # Some binutils ld are patched to set DT_RUNPATH
2863 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2864 [lt_cv_shlibpath_overrides_runpath=no
2865 save_LDFLAGS=$LDFLAGS
2866 save_libdir=$libdir
2867 eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2868 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2869 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2870 [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2871 [lt_cv_shlibpath_overrides_runpath=yes])])
2872 LDFLAGS=$save_LDFLAGS
2873 libdir=$save_libdir
2874 ])
2875 shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2876
2877 # This implies no fast_install, which is unacceptable.
2878 # Some rework will be needed to allow for fast_install
2879 # before this can be enabled.
2880 hardcode_into_libs=yes
2881
2882 # Ideally, we could use ldconfig to report *all* directores which are
2883 # searched for libraries, however this is still not possible. Aside from not
2884 # being certain /sbin/ldconfig is available, command
2885 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2886 # even though it is searched at run-time. Try to do the best guess by
2887 # appending ld.so.conf contents (and includes) to the search path.
2888 if test -f /etc/ld.so.conf; then
2889 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
2890 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2891 fi
2892
2893 # We used to test for /lib/ld.so.1 and disable shared libraries on
2894 # powerpc, because MkLinux only supported shared libraries with the
2895 # GNU dynamic linker. Since this was broken with cross compilers,
2896 # most powerpc-linux boxes support dynamic linking these days and
2897 # people can always --disable-shared, the test was removed, and we
2898 # assume the GNU/Linux dynamic linker is in use.
2899 dynamic_linker='GNU/Linux ld.so'
2900 ;;
2901
2902 netbsd*)
2903 version_type=sunos
2904 need_lib_prefix=no
2905 need_version=no
2906 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2907 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2908 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2909 dynamic_linker='NetBSD (a.out) ld.so'
2910 else
2911 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2912 soname_spec='$libname$release$shared_ext$major'
2913 dynamic_linker='NetBSD ld.elf_so'
2914 fi
2915 shlibpath_var=LD_LIBRARY_PATH
2916 shlibpath_overrides_runpath=yes
2917 hardcode_into_libs=yes
2918 ;;
2919
2920 newsos6)
2921 version_type=linux # correct to gnu/linux during the next big refactor
2922 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2923 shlibpath_var=LD_LIBRARY_PATH
2924 shlibpath_overrides_runpath=yes
2925 ;;
2926
2927 *nto* | *qnx*)
2928 version_type=qnx
2929 need_lib_prefix=no
2930 need_version=no
2931 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2932 soname_spec='$libname$release$shared_ext$major'
2933 shlibpath_var=LD_LIBRARY_PATH
2934 shlibpath_overrides_runpath=no
2935 hardcode_into_libs=yes
2936 dynamic_linker='ldqnx.so'
2937 ;;
2938
2939 openbsd* | bitrig*)
2940 version_type=sunos
2941 sys_lib_dlsearch_path_spec=/usr/lib
2942 need_lib_prefix=no
2943 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2944 need_version=no
2945 else
2946 need_version=yes
2947 fi
2948 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2949 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2950 shlibpath_var=LD_LIBRARY_PATH
2951 shlibpath_overrides_runpath=yes
2952 ;;
2953
2954 os2*)
2955 libname_spec='$name'
2956 version_type=windows
2957 shrext_cmds=.dll
2958 need_version=no
2959 need_lib_prefix=no
2960 # OS/2 can only load a DLL with a base name of 8 characters or less.
2961 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2962 v=$($ECHO $release$versuffix | tr -d .-);
2963 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2964 $ECHO $n$v`$shared_ext'
2965 library_names_spec='${libname}_dll.$libext'
2966 dynamic_linker='OS/2 ld.exe'
2967 shlibpath_var=BEGINLIBPATH
2968 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2969 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2970 postinstall_cmds='base_file=`basename \$file`~
2971 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2972 dldir=$destdir/`dirname \$dlpath`~
2973 test -d \$dldir || mkdir -p \$dldir~
2974 $install_prog $dir/$dlname \$dldir/$dlname~
2975 chmod a+x \$dldir/$dlname~
2976 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2977 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2978 fi'
2979 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2980 dlpath=$dir/\$dldll~
2981 $RM \$dlpath'
2982 ;;
2983
2984 osf3* | osf4* | osf5*)
2985 version_type=osf
2986 need_lib_prefix=no
2987 need_version=no
2988 soname_spec='$libname$release$shared_ext$major'
2989 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2990 shlibpath_var=LD_LIBRARY_PATH
2991 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2992 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2993 ;;
2994
2995 rdos*)
2996 dynamic_linker=no
2997 ;;
2998
2999 solaris*)
3000 version_type=linux # correct to gnu/linux during the next big refactor
3001 need_lib_prefix=no
3002 need_version=no
3003 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3004 soname_spec='$libname$release$shared_ext$major'
3005 shlibpath_var=LD_LIBRARY_PATH
3006 shlibpath_overrides_runpath=yes
3007 hardcode_into_libs=yes
3008 # ldd complains unless libraries are executable
3009 postinstall_cmds='chmod +x $lib'
3010 ;;
3011
3012 sunos4*)
3013 version_type=sunos
3014 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3015 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3016 shlibpath_var=LD_LIBRARY_PATH
3017 shlibpath_overrides_runpath=yes
3018 if test yes = "$with_gnu_ld"; then
3019 need_lib_prefix=no
3020 fi
3021 need_version=yes
3022 ;;
3023
3024 sysv4 | sysv4.3*)
3025 version_type=linux # correct to gnu/linux during the next big refactor
3026 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3027 soname_spec='$libname$release$shared_ext$major'
3028 shlibpath_var=LD_LIBRARY_PATH
3029 case $host_vendor in
3030 sni)
3031 shlibpath_overrides_runpath=no
3032 need_lib_prefix=no
3033 runpath_var=LD_RUN_PATH
3034 ;;
3035 siemens)
3036 need_lib_prefix=no
3037 ;;
3038 motorola)
3039 need_lib_prefix=no
3040 need_version=no
3041 shlibpath_overrides_runpath=no
3042 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3043 ;;
3044 esac
3045 ;;
3046
3047 sysv4*MP*)
3048 if test -d /usr/nec; then
3049 version_type=linux # correct to gnu/linux during the next big refactor
3050 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3051 soname_spec='$libname$shared_ext.$major'
3052 shlibpath_var=LD_LIBRARY_PATH
3053 fi
3054 ;;
3055
3056 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3057 version_type=sco
3058 need_lib_prefix=no
3059 need_version=no
3060 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3061 soname_spec='$libname$release$shared_ext$major'
3062 shlibpath_var=LD_LIBRARY_PATH
3063 shlibpath_overrides_runpath=yes
3064 hardcode_into_libs=yes
3065 if test yes = "$with_gnu_ld"; then
3066 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3067 else
3068 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3069 case $host_os in
3070 sco3.2v5*)
3071 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3072 ;;
3073 esac
3074 fi
3075 sys_lib_dlsearch_path_spec='/usr/lib'
3076 ;;
3077
3078 tpf*)
3079 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
3080 version_type=linux # correct to gnu/linux during the next big refactor
3081 need_lib_prefix=no
3082 need_version=no
3083 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3084 shlibpath_var=LD_LIBRARY_PATH
3085 shlibpath_overrides_runpath=no
3086 hardcode_into_libs=yes
3087 ;;
3088
3089 uts4*)
3090 version_type=linux # correct to gnu/linux during the next big refactor
3091 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3092 soname_spec='$libname$release$shared_ext$major'
3093 shlibpath_var=LD_LIBRARY_PATH
3094 ;;
3095
3096 *)
3097 dynamic_linker=no
3098 ;;
3099 esac
3100 AC_MSG_RESULT([$dynamic_linker])
3101 test no = "$dynamic_linker" && can_build_shared=no
3102
3103 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3104 if test yes = "$GCC"; then
3105 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3106 fi
3107
3108 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3109 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3110 fi
3111
3112 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3113 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3114 fi
3115
3116 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3117 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3118
3119 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3120 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3121
3122 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3123 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3124
3125 _LT_DECL([], [variables_saved_for_relink], [1],
3126 [Variables whose values should be saved in libtool wrapper scripts and
3127 restored at link time])
3128 _LT_DECL([], [need_lib_prefix], [0],
3129 [Do we need the "lib" prefix for modules?])
3130 _LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3131 _LT_DECL([], [version_type], [0], [Library versioning type])
3132 _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
3133 _LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3134 _LT_DECL([], [shlibpath_overrides_runpath], [0],
3135 [Is shlibpath searched before the hard-coded library search path?])
3136 _LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3137 _LT_DECL([], [library_names_spec], [1],
3138 [[List of archive names. First name is the real one, the rest are links.
3139 The last name is the one that the linker finds with -lNAME]])
3140 _LT_DECL([], [soname_spec], [1],
3141 [[The coded name of the library, if different from the real name]])
3142 _LT_DECL([], [install_override_mode], [1],
3143 [Permission mode override for installation of shared libraries])
3144 _LT_DECL([], [postinstall_cmds], [2],
3145 [Command to use after installation of a shared archive])
3146 _LT_DECL([], [postuninstall_cmds], [2],
3147 [Command to use after uninstallation of a shared archive])
3148 _LT_DECL([], [finish_cmds], [2],
3149 [Commands used to finish a libtool library installation in a directory])
3150 _LT_DECL([], [finish_eval], [1],
3151 [[As "finish_cmds", except a single script fragment to be evaled but
3152 not shown]])
3153 _LT_DECL([], [hardcode_into_libs], [0],
3154 [Whether we should hardcode library paths into libraries])
3155 _LT_DECL([], [sys_lib_search_path_spec], [2],
3156 [Compile-time system search path for libraries])
3157 _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3158 [Detected run-time system search path for libraries])
3159 _LT_DECL([], [configure_time_lt_sys_library_path], [2],
3160 [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3161 ])# _LT_SYS_DYNAMIC_LINKER
3162
3163
3164 # _LT_PATH_TOOL_PREFIX(TOOL)
3165 # --------------------------
3166 # find a file program that can recognize shared library
3167 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
3168 [m4_require([_LT_DECL_EGREP])dnl
3169 AC_MSG_CHECKING([for $1])
3170 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3171 [case $MAGIC_CMD in
3172 [[\\/*] | ?:[\\/]*])
3173 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3174 ;;
3175 *)
3176 lt_save_MAGIC_CMD=$MAGIC_CMD
3177 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3178 dnl $ac_dummy forces splitting on constant user-supplied paths.
3179 dnl POSIX.2 word splitting is done only on the output of word expansions,
3180 dnl not every word. This closes a longstanding sh security hole.
3181 ac_dummy="m4_if([$2], , $PATH, [$2])"
3182 for ac_dir in $ac_dummy; do
3183 IFS=$lt_save_ifs
3184 test -z "$ac_dir" && ac_dir=.
3185 if test -f "$ac_dir/$1"; then
3186 lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3187 if test -n "$file_magic_test_file"; then
3188 case $deplibs_check_method in
3189 "file_magic "*)
3190 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3191 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3192 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3193 $EGREP "$file_magic_regex" > /dev/null; then
3194 :
3195 else
3196 cat <<_LT_EOF 1>&2
3197
3198 *** Warning: the command libtool uses to detect shared libraries,
3199 *** $file_magic_cmd, produces output that libtool cannot recognize.
3200 *** The result is that libtool may fail to recognize shared libraries
3201 *** as such. This will affect the creation of libtool libraries that
3202 *** depend on shared libraries, but programs linked with such libtool
3203 *** libraries will work regardless of this problem. Nevertheless, you
3204 *** may want to report the problem to your system manager and/or to
3205 *** bug-libtool@gnu.org
3206
3207 _LT_EOF
3208 fi ;;
3209 esac
3210 fi
3211 break
3212 fi
3213 done
3214 IFS=$lt_save_ifs
3215 MAGIC_CMD=$lt_save_MAGIC_CMD
3216 ;;
3217 esac])
3218 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3219 if test -n "$MAGIC_CMD"; then
3220 AC_MSG_RESULT($MAGIC_CMD)
3221 else
3222 AC_MSG_RESULT(no)
3223 fi
3224 _LT_DECL([], [MAGIC_CMD], [0],
3225 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3226 ])# _LT_PATH_TOOL_PREFIX
3227
3228 # Old name:
3229 AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3230 dnl aclocal-1.4 backwards compatibility:
3231 dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3232
3233
3234 # _LT_PATH_MAGIC
3235 # --------------
3236 # find a file program that can recognize a shared library
3237 m4_defun([_LT_PATH_MAGIC],
3238 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3239 if test -z "$lt_cv_path_MAGIC_CMD"; then
3240 if test -n "$ac_tool_prefix"; then
3241 _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3242 else
3243 MAGIC_CMD=:
3244 fi
3245 fi
3246 ])# _LT_PATH_MAGIC
3247
3248
3249 # LT_PATH_LD
3250 # ----------
3251 # find the pathname to the GNU or non-GNU linker
3252 AC_DEFUN([LT_PATH_LD],
3253 [AC_REQUIRE([AC_PROG_CC])dnl
3254 AC_REQUIRE([AC_CANONICAL_HOST])dnl
3255 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
3256 m4_require([_LT_DECL_SED])dnl
3257 m4_require([_LT_DECL_EGREP])dnl
3258 m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3259
3260 AC_ARG_WITH([gnu-ld],
3261 [AS_HELP_STRING([--with-gnu-ld],
3262 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
3263 [test no = "$withval" || with_gnu_ld=yes],
3264 [with_gnu_ld=no])dnl
3265
3266 ac_prog=ld
3267 if test yes = "$GCC"; then
3268 # Check if gcc -print-prog-name=ld gives a path.
3269 AC_MSG_CHECKING([for ld used by $CC])
3270 case $host in
3271 *-*-mingw*)
3272 # gcc leaves a trailing carriage return, which upsets mingw
3273 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3274 *)
3275 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3276 esac
3277 case $ac_prog in
3278 # Accept absolute paths.
3279 [[\\/]]* | ?:[[\\/]]*)
3280 re_direlt='/[[^/]][[^/]]*/\.\./'
3281 # Canonicalize the pathname of ld
3282 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3283 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3284 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3285 done
3286 test -z "$LD" && LD=$ac_prog
3287 ;;
3288 "")
3289 # If it fails, then pretend we aren't using GCC.
3290 ac_prog=ld
3291 ;;
3292 *)
3293 # If it is relative, then search for the first ld in PATH.
3294 with_gnu_ld=unknown
3295 ;;
3296 esac
3297 elif test yes = "$with_gnu_ld"; then
3298 AC_MSG_CHECKING([for GNU ld])
3299 else
3300 AC_MSG_CHECKING([for non-GNU ld])
3301 fi
3302 AC_CACHE_VAL(lt_cv_path_LD,
3303 [if test -z "$LD"; then
3304 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3305 for ac_dir in $PATH; do
3306 IFS=$lt_save_ifs
3307 test -z "$ac_dir" && ac_dir=.
3308 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3309 lt_cv_path_LD=$ac_dir/$ac_prog
3310 # Check to see if the program is GNU ld. I'd rather use --version,
3311 # but apparently some variants of GNU ld only accept -v.
3312 # Break only if it was the GNU/non-GNU ld that we prefer.
3313 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3314 *GNU* | *'with BFD'*)
3315 test no != "$with_gnu_ld" && break
3316 ;;
3317 *)
3318 test yes != "$with_gnu_ld" && break
3319 ;;
3320 esac
3321 fi
3322 done
3323 IFS=$lt_save_ifs
3324 else
3325 lt_cv_path_LD=$LD # Let the user override the test with a path.
3326 fi])
3327 LD=$lt_cv_path_LD
3328 if test -n "$LD"; then
3329 AC_MSG_RESULT($LD)
3330 else
3331 AC_MSG_RESULT(no)
3332 fi
3333 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3334 _LT_PATH_LD_GNU
3335 AC_SUBST([LD])
3336
3337 _LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3338 ])# LT_PATH_LD
3339
3340 # Old names:
3341 AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3342 AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3343 dnl aclocal-1.4 backwards compatibility:
3344 dnl AC_DEFUN([AM_PROG_LD], [])
3345 dnl AC_DEFUN([AC_PROG_LD], [])
3346
3347
3348 # _LT_PATH_LD_GNU
3349 #- --------------
3350 m4_defun([_LT_PATH_LD_GNU],
3351 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3352 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
3353 case `$LD -v 2>&1 </dev/null` in
3354 *GNU* | *'with BFD'*)
3355 lt_cv_prog_gnu_ld=yes
3356 ;;
3357 *)
3358 lt_cv_prog_gnu_ld=no
3359 ;;
3360 esac])
3361 with_gnu_ld=$lt_cv_prog_gnu_ld
3362 ])# _LT_PATH_LD_GNU
3363
3364
3365 # _LT_CMD_RELOAD
3366 # --------------
3367 # find reload flag for linker
3368 # -- PORTME Some linkers may need a different reload flag.
3369 m4_defun([_LT_CMD_RELOAD],
3370 [AC_CACHE_CHECK([for $LD option to reload object files],
3371 lt_cv_ld_reload_flag,
3372 [lt_cv_ld_reload_flag='-r'])
3373 reload_flag=$lt_cv_ld_reload_flag
3374 case $reload_flag in
3375 "" | " "*) ;;
3376 *) reload_flag=" $reload_flag" ;;
3377 esac
3378 reload_cmds='$LD$reload_flag -o $output$reload_objs'
3379 case $host_os in
3380 cygwin* | mingw* | pw32* | cegcc*)
3381 if test yes != "$GCC"; then
3382 reload_cmds=false
3383 fi
3384 ;;
3385 darwin*)
3386 if test yes = "$GCC"; then
3387 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3388 else
3389 reload_cmds='$LD$reload_flag -o $output$reload_objs'
3390 fi
3391 ;;
3392 esac
3393 _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3394 _LT_TAGDECL([], [reload_cmds], [2])dnl
3395 ])# _LT_CMD_RELOAD
3396
3397
3398 # _LT_PATH_DD
3399 # -----------
3400 # find a working dd
3401 m4_defun([_LT_PATH_DD],
3402 [AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3403 [printf 0123456789abcdef0123456789abcdef >conftest.i
3404 cat conftest.i conftest.i >conftest2.i
3405 : ${lt_DD:=$DD}
3406 AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3407 [if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3408 cmp -s conftest.i conftest.out \
3409 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3410 fi])
3411 rm -f conftest.i conftest2.i conftest.out])
3412 ])# _LT_PATH_DD
3413
3414
3415 # _LT_CMD_TRUNCATE
3416 # ----------------
3417 # find command to truncate a binary pipe
3418 m4_defun([_LT_CMD_TRUNCATE],
3419 [m4_require([_LT_PATH_DD])
3420 AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3421 [printf 0123456789abcdef0123456789abcdef >conftest.i
3422 cat conftest.i conftest.i >conftest2.i
3423 lt_cv_truncate_bin=
3424 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3425 cmp -s conftest.i conftest.out \
3426 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3427 fi
3428 rm -f conftest.i conftest2.i conftest.out
3429 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3430 _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3431 [Command to truncate a binary pipe])
3432 ])# _LT_CMD_TRUNCATE
3433
3434
3435 # _LT_CHECK_MAGIC_METHOD
3436 # ----------------------
3437 # how to check for library dependencies
3438 # -- PORTME fill in with the dynamic library characteristics
3439 m4_defun([_LT_CHECK_MAGIC_METHOD],
3440 [m4_require([_LT_DECL_EGREP])
3441 m4_require([_LT_DECL_OBJDUMP])
3442 AC_CACHE_CHECK([how to recognize dependent libraries],
3443 lt_cv_deplibs_check_method,
3444 [lt_cv_file_magic_cmd='$MAGIC_CMD'
3445 lt_cv_file_magic_test_file=
3446 lt_cv_deplibs_check_method='unknown'
3447 # Need to set the preceding variable on all platforms that support
3448 # interlibrary dependencies.
3449 # 'none' -- dependencies not supported.
3450 # 'unknown' -- same as none, but documents that we really don't know.
3451 # 'pass_all' -- all dependencies passed with no checks.
3452 # 'test_compile' -- check by making test program.
3453 # 'file_magic [[regex]]' -- check by looking for files in library path
3454 # that responds to the $file_magic_cmd with a given extended regex.
3455 # If you have 'file' or equivalent on your system and you're not sure
3456 # whether 'pass_all' will *always* work, you probably want this one.
3457
3458 case $host_os in
3459 aix[[4-9]]*)
3460 lt_cv_deplibs_check_method=pass_all
3461 ;;
3462
3463 beos*)
3464 lt_cv_deplibs_check_method=pass_all
3465 ;;
3466
3467 bsdi[[45]]*)
3468 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3469 lt_cv_file_magic_cmd='/usr/bin/file -L'
3470 lt_cv_file_magic_test_file=/shlib/libc.so
3471 ;;
3472
3473 cygwin*)
3474 # func_win32_libid is a shell function defined in ltmain.sh
3475 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3476 lt_cv_file_magic_cmd='func_win32_libid'
3477 ;;
3478
3479 mingw* | pw32*)
3480 # Base MSYS/MinGW do not provide the 'file' command needed by
3481 # func_win32_libid shell function, so use a weaker test based on 'objdump',
3482 # unless we find 'file', for example because we are cross-compiling.
3483 if ( file / ) >/dev/null 2>&1; then
3484 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3485 lt_cv_file_magic_cmd='func_win32_libid'
3486 else
3487 # Keep this pattern in sync with the one in func_win32_libid.
3488 lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3489 lt_cv_file_magic_cmd='$OBJDUMP -f'
3490 fi
3491 ;;
3492
3493 cegcc*)
3494 # use the weaker test based on 'objdump'. See mingw*.
3495 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3496 lt_cv_file_magic_cmd='$OBJDUMP -f'
3497 ;;
3498
3499 darwin* | rhapsody*)
3500 lt_cv_deplibs_check_method=pass_all
3501 ;;
3502
3503 freebsd* | dragonfly*)
3504 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3505 case $host_cpu in
3506 i*86 )
3507 # Not sure whether the presence of OpenBSD here was a mistake.
3508 # Let's accept both of them until this is cleared up.
3509 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3510 lt_cv_file_magic_cmd=/usr/bin/file
3511 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3512 ;;
3513 esac
3514 else
3515 lt_cv_deplibs_check_method=pass_all
3516 fi
3517 ;;
3518
3519 haiku*)
3520 lt_cv_deplibs_check_method=pass_all
3521 ;;
3522
3523 hpux10.20* | hpux11*)
3524 lt_cv_file_magic_cmd=/usr/bin/file
3525 case $host_cpu in
3526 ia64*)
3527 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3528 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3529 ;;
3530 hppa*64*)
3531 [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
3532 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3533 ;;
3534 *)
3535 lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3536 lt_cv_file_magic_test_file=/usr/lib/libc.sl
3537 ;;
3538 esac
3539 ;;
3540
3541 interix[[3-9]]*)
3542 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3543 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3544 ;;
3545
3546 irix5* | irix6* | nonstopux*)
3547 case $LD in
3548 *-32|*"-32 ") libmagic=32-bit;;
3549 *-n32|*"-n32 ") libmagic=N32;;
3550 *-64|*"-64 ") libmagic=64-bit;;
3551 *) libmagic=never-match;;
3552 esac
3553 lt_cv_deplibs_check_method=pass_all
3554 ;;
3555
3556 # This must be glibc/ELF.
3557 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3558 lt_cv_deplibs_check_method=pass_all
3559 ;;
3560
3561 netbsd*)
3562 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3563 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3564 else
3565 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3566 fi
3567 ;;
3568
3569 newos6*)
3570 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3571 lt_cv_file_magic_cmd=/usr/bin/file
3572 lt_cv_file_magic_test_file=/usr/lib/libnls.so
3573 ;;
3574
3575 *nto* | *qnx*)
3576 lt_cv_deplibs_check_method=pass_all
3577 ;;
3578
3579 openbsd* | bitrig*)
3580 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3581 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3582 else
3583 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3584 fi
3585 ;;
3586
3587 osf3* | osf4* | osf5*)
3588 lt_cv_deplibs_check_method=pass_all
3589 ;;
3590
3591 rdos*)
3592 lt_cv_deplibs_check_method=pass_all
3593 ;;
3594
3595 solaris*)
3596 lt_cv_deplibs_check_method=pass_all
3597 ;;
3598
3599 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3600 lt_cv_deplibs_check_method=pass_all
3601 ;;
3602
3603 sysv4 | sysv4.3*)
3604 case $host_vendor in
3605 motorola)
3606 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3607 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3608 ;;
3609 ncr)
3610 lt_cv_deplibs_check_method=pass_all
3611 ;;
3612 sequent)
3613 lt_cv_file_magic_cmd='/bin/file'
3614 lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3615 ;;
3616 sni)
3617 lt_cv_file_magic_cmd='/bin/file'
3618 lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3619 lt_cv_file_magic_test_file=/lib/libc.so
3620 ;;
3621 siemens)
3622 lt_cv_deplibs_check_method=pass_all
3623 ;;
3624 pc)
3625 lt_cv_deplibs_check_method=pass_all
3626 ;;
3627 esac
3628 ;;
3629
3630 tpf*)
3631 lt_cv_deplibs_check_method=pass_all
3632 ;;
3633 os2*)
3634 lt_cv_deplibs_check_method=pass_all
3635 ;;
3636 esac
3637 ])
3638
3639 file_magic_glob=
3640 want_nocaseglob=no
3641 if test "$build" = "$host"; then
3642 case $host_os in
3643 mingw* | pw32*)
3644 if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3645 want_nocaseglob=yes
3646 else
3647 file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3648 fi
3649 ;;
3650 esac
3651 fi
3652
3653 file_magic_cmd=$lt_cv_file_magic_cmd
3654 deplibs_check_method=$lt_cv_deplibs_check_method
3655 test -z "$deplibs_check_method" && deplibs_check_method=unknown
3656
3657 _LT_DECL([], [deplibs_check_method], [1],
3658 [Method to check whether dependent libraries are shared objects])
3659 _LT_DECL([], [file_magic_cmd], [1],
3660 [Command to use when deplibs_check_method = "file_magic"])
3661 _LT_DECL([], [file_magic_glob], [1],
3662 [How to find potential files when deplibs_check_method = "file_magic"])
3663 _LT_DECL([], [want_nocaseglob], [1],
3664 [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3665 ])# _LT_CHECK_MAGIC_METHOD
3666
3667
3668 # LT_PATH_NM
3669 # ----------
3670 # find the pathname to a BSD- or MS-compatible name lister
3671 AC_DEFUN([LT_PATH_NM],
3672 [AC_REQUIRE([AC_PROG_CC])dnl
3673 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3674 [if test -n "$NM"; then
3675 # Let the user override the test.
3676 lt_cv_path_NM=$NM
3677 else
3678 lt_nm_to_check=${ac_tool_prefix}nm
3679 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3680 lt_nm_to_check="$lt_nm_to_check nm"
3681 fi
3682 for lt_tmp_nm in $lt_nm_to_check; do
3683 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3684 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3685 IFS=$lt_save_ifs
3686 test -z "$ac_dir" && ac_dir=.
3687 tmp_nm=$ac_dir/$lt_tmp_nm
3688 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3689 # Check to see if the nm accepts a BSD-compat flag.
3690 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3691 # nm: unknown option "B" ignored
3692 # Tru64's nm complains that /dev/null is an invalid object file
3693 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3694 case $build_os in
3695 mingw*) lt_bad_file=conftest.nm/nofile ;;
3696 *) lt_bad_file=/dev/null ;;
3697 esac
3698 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3699 *$lt_bad_file* | *'Invalid file or object type'*)
3700 lt_cv_path_NM="$tmp_nm -B"
3701 break 2
3702 ;;
3703 *)
3704 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3705 */dev/null*)
3706 lt_cv_path_NM="$tmp_nm -p"
3707 break 2
3708 ;;
3709 *)
3710 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3711 continue # so that we can try to find one that supports BSD flags
3712 ;;
3713 esac
3714 ;;
3715 esac
3716 fi
3717 done
3718 IFS=$lt_save_ifs
3719 done
3720 : ${lt_cv_path_NM=no}
3721 fi])
3722 if test no != "$lt_cv_path_NM"; then
3723 NM=$lt_cv_path_NM
3724 else
3725 # Didn't find any BSD compatible name lister, look for dumpbin.
3726 if test -n "$DUMPBIN"; then :
3727 # Let the user override the test.
3728 else
3729 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3730 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3731 *COFF*)
3732 DUMPBIN="$DUMPBIN -symbols -headers"
3733 ;;
3734 *)
3735 DUMPBIN=:
3736 ;;
3737 esac
3738 fi
3739 AC_SUBST([DUMPBIN])
3740 if test : != "$DUMPBIN"; then
3741 NM=$DUMPBIN
3742 fi
3743 fi
3744 test -z "$NM" && NM=nm
3745 AC_SUBST([NM])
3746 _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3747
3748 AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3749 [lt_cv_nm_interface="BSD nm"
3750 echo "int some_variable = 0;" > conftest.$ac_ext
3751 (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3752 (eval "$ac_compile" 2>conftest.err)
3753 cat conftest.err >&AS_MESSAGE_LOG_FD
3754 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3755 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3756 cat conftest.err >&AS_MESSAGE_LOG_FD
3757 (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3758 cat conftest.out >&AS_MESSAGE_LOG_FD
3759 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3760 lt_cv_nm_interface="MS dumpbin"
3761 fi
3762 rm -f conftest*])
3763 ])# LT_PATH_NM
3764
3765 # Old names:
3766 AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3767 AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3768 dnl aclocal-1.4 backwards compatibility:
3769 dnl AC_DEFUN([AM_PROG_NM], [])
3770 dnl AC_DEFUN([AC_PROG_NM], [])
3771
3772 # _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3773 # --------------------------------
3774 # how to determine the name of the shared library
3775 # associated with a specific link library.
3776 # -- PORTME fill in with the dynamic library characteristics
3777 m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3778 [m4_require([_LT_DECL_EGREP])
3779 m4_require([_LT_DECL_OBJDUMP])
3780 m4_require([_LT_DECL_DLLTOOL])
3781 AC_CACHE_CHECK([how to associate runtime and link libraries],
3782 lt_cv_sharedlib_from_linklib_cmd,
3783 [lt_cv_sharedlib_from_linklib_cmd='unknown'
3784
3785 case $host_os in
3786 cygwin* | mingw* | pw32* | cegcc*)
3787 # two different shell functions defined in ltmain.sh;
3788 # decide which one to use based on capabilities of $DLLTOOL
3789 case `$DLLTOOL --help 2>&1` in
3790 *--identify-strict*)
3791 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3792 ;;
3793 *)
3794 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3795 ;;
3796 esac
3797 ;;
3798 *)
3799 # fallback: assume linklib IS sharedlib
3800 lt_cv_sharedlib_from_linklib_cmd=$ECHO
3801 ;;
3802 esac
3803 ])
3804 sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3805 test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3806
3807 _LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3808 [Command to associate shared and link libraries])
3809 ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3810
3811
3812 # _LT_PATH_MANIFEST_TOOL
3813 # ----------------------
3814 # locate the manifest tool
3815 m4_defun([_LT_PATH_MANIFEST_TOOL],
3816 [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3817 test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3818 AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3819 [lt_cv_path_mainfest_tool=no
3820 echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3821 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3822 cat conftest.err >&AS_MESSAGE_LOG_FD
3823 if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3824 lt_cv_path_mainfest_tool=yes
3825 fi
3826 rm -f conftest*])
3827 if test yes != "$lt_cv_path_mainfest_tool"; then
3828 MANIFEST_TOOL=:
3829 fi
3830 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3831 ])# _LT_PATH_MANIFEST_TOOL
3832
3833
3834 # _LT_DLL_DEF_P([FILE])
3835 # ---------------------
3836 # True iff FILE is a Windows DLL '.def' file.
3837 # Keep in sync with func_dll_def_p in the libtool script
3838 AC_DEFUN([_LT_DLL_DEF_P],
3839 [dnl
3840 test DEF = "`$SED -n dnl
3841 -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
3842 -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
3843 -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
3844 -e q dnl Only consider the first "real" line
3845 $1`" dnl
3846 ])# _LT_DLL_DEF_P
3847
3848
3849 # LT_LIB_M
3850 # --------
3851 # check for math library
3852 AC_DEFUN([LT_LIB_M],
3853 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3854 LIBM=
3855 case $host in
3856 *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3857 # These system don't have libm, or don't need it
3858 ;;
3859 *-ncr-sysv4.3*)
3860 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3861 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3862 ;;
3863 *)
3864 AC_CHECK_LIB(m, cos, LIBM=-lm)
3865 ;;
3866 esac
3867 AC_SUBST([LIBM])
3868 ])# LT_LIB_M
3869
3870 # Old name:
3871 AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3872 dnl aclocal-1.4 backwards compatibility:
3873 dnl AC_DEFUN([AC_CHECK_LIBM], [])
3874
3875
3876 # _LT_COMPILER_NO_RTTI([TAGNAME])
3877 # -------------------------------
3878 m4_defun([_LT_COMPILER_NO_RTTI],
3879 [m4_require([_LT_TAG_COMPILER])dnl
3880
3881 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3882
3883 if test yes = "$GCC"; then
3884 case $cc_basename in
3885 nvcc*)
3886 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3887 *)
3888 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3889 esac
3890
3891 _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3892 lt_cv_prog_compiler_rtti_exceptions,
3893 [-fno-rtti -fno-exceptions], [],
3894 [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3895 fi
3896 _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3897 [Compiler flag to turn off builtin functions])
3898 ])# _LT_COMPILER_NO_RTTI
3899
3900
3901 # _LT_CMD_GLOBAL_SYMBOLS
3902 # ----------------------
3903 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3904 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
3905 AC_REQUIRE([AC_PROG_CC])dnl
3906 AC_REQUIRE([AC_PROG_AWK])dnl
3907 AC_REQUIRE([LT_PATH_NM])dnl
3908 AC_REQUIRE([LT_PATH_LD])dnl
3909 m4_require([_LT_DECL_SED])dnl
3910 m4_require([_LT_DECL_EGREP])dnl
3911 m4_require([_LT_TAG_COMPILER])dnl
3912
3913 # Check for command to grab the raw symbol name followed by C symbol from nm.
3914 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
3915 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3916 [
3917 # These are sane defaults that work on at least a few old systems.
3918 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
3919
3920 # Character class describing NM global symbol codes.
3921 symcode='[[BCDEGRST]]'
3922
3923 # Regexp to match symbols that can be accessed directly from C.
3924 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3925
3926 # Define system-specific variables.
3927 case $host_os in
3928 aix*)
3929 symcode='[[BCDT]]'
3930 ;;
3931 cygwin* | mingw* | pw32* | cegcc*)
3932 symcode='[[ABCDGISTW]]'
3933 ;;
3934 hpux*)
3935 if test ia64 = "$host_cpu"; then
3936 symcode='[[ABCDEGRST]]'
3937 fi
3938 ;;
3939 irix* | nonstopux*)
3940 symcode='[[BCDEGRST]]'
3941 ;;
3942 osf*)
3943 symcode='[[BCDEGQRST]]'
3944 ;;
3945 solaris*)
3946 symcode='[[BDRT]]'
3947 ;;
3948 sco3.2v5*)
3949 symcode='[[DT]]'
3950 ;;
3951 sysv4.2uw2*)
3952 symcode='[[DT]]'
3953 ;;
3954 sysv5* | sco5v6* | unixware* | OpenUNIX*)
3955 symcode='[[ABDT]]'
3956 ;;
3957 sysv4)
3958 symcode='[[DFNSTU]]'
3959 ;;
3960 esac
3961
3962 # If we're using GNU nm, then use its standard symbol codes.
3963 case `$NM -V 2>&1` in
3964 *GNU* | *'with BFD'*)
3965 symcode='[[ABCDGIRSTW]]' ;;
3966 esac
3967
3968 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3969 # Gets list of data symbols to import.
3970 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3971 # Adjust the below global symbol transforms to fixup imported variables.
3972 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3973 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
3974 lt_c_name_lib_hook="\
3975 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
3976 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
3977 else
3978 # Disable hooks by default.
3979 lt_cv_sys_global_symbol_to_import=
3980 lt_cdecl_hook=
3981 lt_c_name_hook=
3982 lt_c_name_lib_hook=
3983 fi
3984
3985 # Transform an extracted symbol line into a proper C declaration.
3986 # Some systems (esp. on ia64) link data and code symbols differently,
3987 # so use this general approach.
3988 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
3989 $lt_cdecl_hook\
3990 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3991 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3992
3993 # Transform an extracted symbol line into symbol name and symbol address
3994 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
3995 $lt_c_name_hook\
3996 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
3997 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
3998
3999 # Transform an extracted symbol line into symbol name with lib prefix and
4000 # symbol address.
4001 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4002 $lt_c_name_lib_hook\
4003 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
4004 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
4005 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
4006
4007 # Handle CRLF in mingw tool chain
4008 opt_cr=
4009 case $build_os in
4010 mingw*)
4011 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4012 ;;
4013 esac
4014
4015 # Try without a prefix underscore, then with it.
4016 for ac_symprfx in "" "_"; do
4017
4018 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4019 symxfrm="\\1 $ac_symprfx\\2 \\2"
4020
4021 # Write the raw and C identifiers.
4022 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4023 # Fake it for dumpbin and say T for any non-static function,
4024 # D for any global variable and I for any imported variable.
4025 # Also find C++ and __fastcall symbols from MSVC++,
4026 # which start with @ or ?.
4027 lt_cv_sys_global_symbol_pipe="$AWK ['"\
4028 " {last_section=section; section=\$ 3};"\
4029 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4030 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4031 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4032 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4033 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4034 " \$ 0!~/External *\|/{next};"\
4035 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4036 " {if(hide[section]) next};"\
4037 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4038 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4039 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4040 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4041 " ' prfx=^$ac_symprfx]"
4042 else
4043 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4044 fi
4045 lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4046
4047 # Check to see that the pipe works correctly.
4048 pipe_works=no
4049
4050 rm -f conftest*
4051 cat > conftest.$ac_ext <<_LT_EOF
4052 #ifdef __cplusplus
4053 extern "C" {
4054 #endif
4055 char nm_test_var;
4056 void nm_test_func(void);
4057 void nm_test_func(void){}
4058 #ifdef __cplusplus
4059 }
4060 #endif
4061 int main(){nm_test_var='a';nm_test_func();return(0);}
4062 _LT_EOF
4063
4064 if AC_TRY_EVAL(ac_compile); then
4065 # Now try to grab the symbols.
4066 nlist=conftest.nm
4067 if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4068 # Try sorting and uniquifying the output.
4069 if sort "$nlist" | uniq > "$nlist"T; then
4070 mv -f "$nlist"T "$nlist"
4071 else
4072 rm -f "$nlist"T
4073 fi
4074
4075 # Make sure that we snagged all the symbols we need.
4076 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4077 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4078 cat <<_LT_EOF > conftest.$ac_ext
4079 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
4080 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4081 /* DATA imports from DLLs on WIN32 can't be const, because runtime
4082 relocations are performed -- see ld's documentation on pseudo-relocs. */
4083 # define LT@&t@_DLSYM_CONST
4084 #elif defined __osf__
4085 /* This system does not cope well with relocations in const data. */
4086 # define LT@&t@_DLSYM_CONST
4087 #else
4088 # define LT@&t@_DLSYM_CONST const
4089 #endif
4090
4091 #ifdef __cplusplus
4092 extern "C" {
4093 #endif
4094
4095 _LT_EOF
4096 # Now generate the symbol file.
4097 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4098
4099 cat <<_LT_EOF >> conftest.$ac_ext
4100
4101 /* The mapping between symbol names and symbols. */
4102 LT@&t@_DLSYM_CONST struct {
4103 const char *name;
4104 void *address;
4105 }
4106 lt__PROGRAM__LTX_preloaded_symbols[[]] =
4107 {
4108 { "@PROGRAM@", (void *) 0 },
4109 _LT_EOF
4110 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4111 cat <<\_LT_EOF >> conftest.$ac_ext
4112 {0, (void *) 0}
4113 };
4114
4115 /* This works around a problem in FreeBSD linker */
4116 #ifdef FREEBSD_WORKAROUND
4117 static const void *lt_preloaded_setup() {
4118 return lt__PROGRAM__LTX_preloaded_symbols;
4119 }
4120 #endif
4121
4122 #ifdef __cplusplus
4123 }
4124 #endif
4125 _LT_EOF
4126 # Now try linking the two files.
4127 mv conftest.$ac_objext conftstm.$ac_objext
4128 lt_globsym_save_LIBS=$LIBS
4129 lt_globsym_save_CFLAGS=$CFLAGS
4130 LIBS=conftstm.$ac_objext
4131 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4132 if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4133 pipe_works=yes
4134 fi
4135 LIBS=$lt_globsym_save_LIBS
4136 CFLAGS=$lt_globsym_save_CFLAGS
4137 else
4138 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4139 fi
4140 else
4141 echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4142 fi
4143 else
4144 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4145 fi
4146 else
4147 echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4148 cat conftest.$ac_ext >&5
4149 fi
4150 rm -rf conftest* conftst*
4151
4152 # Do not use the global_symbol_pipe unless it works.
4153 if test yes = "$pipe_works"; then
4154 break
4155 else
4156 lt_cv_sys_global_symbol_pipe=
4157 fi
4158 done
4159 ])
4160 if test -z "$lt_cv_sys_global_symbol_pipe"; then
4161 lt_cv_sys_global_symbol_to_cdecl=
4162 fi
4163 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4164 AC_MSG_RESULT(failed)
4165 else
4166 AC_MSG_RESULT(ok)
4167 fi
4168
4169 # Response file support.
4170 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4171 nm_file_list_spec='@'
4172 elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4173 nm_file_list_spec='@'
4174 fi
4175
4176 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4177 [Take the output of nm and produce a listing of raw symbols and C names])
4178 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4179 [Transform the output of nm in a proper C declaration])
4180 _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4181 [Transform the output of nm into a list of symbols to manually relocate])
4182 _LT_DECL([global_symbol_to_c_name_address],
4183 [lt_cv_sys_global_symbol_to_c_name_address], [1],
4184 [Transform the output of nm in a C name address pair])
4185 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4186 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4187 [Transform the output of nm in a C name address pair when lib prefix is needed])
4188 _LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4189 [The name lister interface])
4190 _LT_DECL([], [nm_file_list_spec], [1],
4191 [Specify filename containing input files for $NM])
4192 ]) # _LT_CMD_GLOBAL_SYMBOLS
4193
4194
4195 # _LT_COMPILER_PIC([TAGNAME])
4196 # ---------------------------
4197 m4_defun([_LT_COMPILER_PIC],
4198 [m4_require([_LT_TAG_COMPILER])dnl
4199 _LT_TAGVAR(lt_prog_compiler_wl, $1)=
4200 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4201 _LT_TAGVAR(lt_prog_compiler_static, $1)=
4202
4203 m4_if([$1], [CXX], [
4204 # C++ specific cases for pic, static, wl, etc.
4205 if test yes = "$GXX"; then
4206 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4207 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4208
4209 case $host_os in
4210 aix*)
4211 # All AIX code is PIC.
4212 if test ia64 = "$host_cpu"; then
4213 # AIX 5 now supports IA64 processor
4214 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4215 fi
4216 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4217 ;;
4218
4219 amigaos*)
4220 case $host_cpu in
4221 powerpc)
4222 # see comment about AmigaOS4 .so support
4223 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4224 ;;
4225 m68k)
4226 # FIXME: we need at least 68020 code to build shared libraries, but
4227 # adding the '-m68020' flag to GCC prevents building anything better,
4228 # like '-m68040'.
4229 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4230 ;;
4231 esac
4232 ;;
4233
4234 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4235 # PIC is the default for these OSes.
4236 ;;
4237 mingw* | cygwin* | os2* | pw32* | cegcc*)
4238 # This hack is so that the source file can tell whether it is being
4239 # built for inclusion in a dll (and should export symbols for example).
4240 # Although the cygwin gcc ignores -fPIC, still need this for old-style
4241 # (--disable-auto-import) libraries
4242 m4_if([$1], [GCJ], [],
4243 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4244 case $host_os in
4245 os2*)
4246 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4247 ;;
4248 esac
4249 ;;
4250 darwin* | rhapsody*)
4251 # PIC is the default on this platform
4252 # Common symbols not allowed in MH_DYLIB files
4253 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4254 ;;
4255 *djgpp*)
4256 # DJGPP does not support shared libraries at all
4257 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4258 ;;
4259 haiku*)
4260 # PIC is the default for Haiku.
4261 # The "-static" flag exists, but is broken.
4262 _LT_TAGVAR(lt_prog_compiler_static, $1)=
4263 ;;
4264 interix[[3-9]]*)
4265 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4266 # Instead, we relocate shared libraries at runtime.
4267 ;;
4268 sysv4*MP*)
4269 if test -d /usr/nec; then
4270 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4271 fi
4272 ;;
4273 hpux*)
4274 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4275 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
4276 # sets the default TLS model and affects inlining.
4277 case $host_cpu in
4278 hppa*64*)
4279 ;;
4280 *)
4281 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4282 ;;
4283 esac
4284 ;;
4285 *qnx* | *nto*)
4286 # QNX uses GNU C++, but need to define -shared option too, otherwise
4287 # it will coredump.
4288 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4289 ;;
4290 *)
4291 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4292 ;;
4293 esac
4294 else
4295 case $host_os in
4296 aix[[4-9]]*)
4297 # All AIX code is PIC.
4298 if test ia64 = "$host_cpu"; then
4299 # AIX 5 now supports IA64 processor
4300 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4301 else
4302 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4303 fi
4304 ;;
4305 chorus*)
4306 case $cc_basename in
4307 cxch68*)
4308 # Green Hills C++ Compiler
4309 # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
4310 ;;
4311 esac
4312 ;;
4313 mingw* | cygwin* | os2* | pw32* | cegcc*)
4314 # This hack is so that the source file can tell whether it is being
4315 # built for inclusion in a dll (and should export symbols for example).
4316 m4_if([$1], [GCJ], [],
4317 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4318 ;;
4319 dgux*)
4320 case $cc_basename in
4321 ec++*)
4322 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4323 ;;
4324 ghcx*)
4325 # Green Hills C++ Compiler
4326 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4327 ;;
4328 *)
4329 ;;
4330 esac
4331 ;;
4332 freebsd* | dragonfly*)
4333 # FreeBSD uses GNU C++
4334 ;;
4335 hpux9* | hpux10* | hpux11*)
4336 case $cc_basename in
4337 CC*)
4338 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4339 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4340 if test ia64 != "$host_cpu"; then
4341 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4342 fi
4343 ;;
4344 aCC*)
4345 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4346 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4347 case $host_cpu in
4348 hppa*64*|ia64*)
4349 # +Z the default
4350 ;;
4351 *)
4352 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4353 ;;
4354 esac
4355 ;;
4356 *)
4357 ;;
4358 esac
4359 ;;
4360 interix*)
4361 # This is c89, which is MS Visual C++ (no shared libs)
4362 # Anyone wants to do a port?
4363 ;;
4364 irix5* | irix6* | nonstopux*)
4365 case $cc_basename in
4366 CC*)
4367 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4368 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4369 # CC pic flag -KPIC is the default.
4370 ;;
4371 *)
4372 ;;
4373 esac
4374 ;;
4375 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4376 case $cc_basename in
4377 KCC*)
4378 # KAI C++ Compiler
4379 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4380 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4381 ;;
4382 ecpc* )
4383 # old Intel C++ for x86_64, which still supported -KPIC.
4384 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4385 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4386 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4387 ;;
4388 icpc* )
4389 # Intel C++, used to be incompatible with GCC.
4390 # ICC 10 doesn't accept -KPIC any more.
4391 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4392 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4393 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4394 ;;
4395 pgCC* | pgcpp*)
4396 # Portland Group C++ compiler
4397 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4398 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4399 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4400 ;;
4401 cxx*)
4402 # Compaq C++
4403 # Make sure the PIC flag is empty. It appears that all Alpha
4404 # Linux and Compaq Tru64 Unix objects are PIC.
4405 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4406 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4407 ;;
4408 xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4409 # IBM XL 8.0, 9.0 on PPC and BlueGene
4410 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4411 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4412 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4413 ;;
4414 *)
4415 case `$CC -V 2>&1 | sed 5q` in
4416 *Sun\ C*)
4417 # Sun C++ 5.9
4418 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4419 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4420 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4421 ;;
4422 esac
4423 ;;
4424 esac
4425 ;;
4426 lynxos*)
4427 ;;
4428 m88k*)
4429 ;;
4430 mvs*)
4431 case $cc_basename in
4432 cxx*)
4433 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4434 ;;
4435 *)
4436 ;;
4437 esac
4438 ;;
4439 netbsd*)
4440 ;;
4441 *qnx* | *nto*)
4442 # QNX uses GNU C++, but need to define -shared option too, otherwise
4443 # it will coredump.
4444 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4445 ;;
4446 osf3* | osf4* | osf5*)
4447 case $cc_basename in
4448 KCC*)
4449 _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4450 ;;
4451 RCC*)
4452 # Rational C++ 2.4.1
4453 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4454 ;;
4455 cxx*)
4456 # Digital/Compaq C++
4457 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4458 # Make sure the PIC flag is empty. It appears that all Alpha
4459 # Linux and Compaq Tru64 Unix objects are PIC.
4460 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4461 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4462 ;;
4463 *)
4464 ;;
4465 esac
4466 ;;
4467 psos*)
4468 ;;
4469 solaris*)
4470 case $cc_basename in
4471 CC* | sunCC*)
4472 # Sun C++ 4.2, 5.x and Centerline C++
4473 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4474 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4475 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4476 ;;
4477 gcx*)
4478 # Green Hills C++ Compiler
4479 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4480 ;;
4481 *)
4482 ;;
4483 esac
4484 ;;
4485 sunos4*)
4486 case $cc_basename in
4487 CC*)
4488 # Sun C++ 4.x
4489 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4490 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4491 ;;
4492 lcc*)
4493 # Lucid
4494 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4495 ;;
4496 *)
4497 ;;
4498 esac
4499 ;;
4500 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4501 case $cc_basename in
4502 CC*)
4503 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4504 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4505 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4506 ;;
4507 esac
4508 ;;
4509 tandem*)
4510 case $cc_basename in
4511 NCC*)
4512 # NonStop-UX NCC 3.20
4513 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4514 ;;
4515 *)
4516 ;;
4517 esac
4518 ;;
4519 vxworks*)
4520 ;;
4521 *)
4522 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4523 ;;
4524 esac
4525 fi
4526 ],
4527 [
4528 if test yes = "$GCC"; then
4529 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4530 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4531
4532 case $host_os in
4533 aix*)
4534 # All AIX code is PIC.
4535 if test ia64 = "$host_cpu"; then
4536 # AIX 5 now supports IA64 processor
4537 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4538 fi
4539 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4540 ;;
4541
4542 amigaos*)
4543 case $host_cpu in
4544 powerpc)
4545 # see comment about AmigaOS4 .so support
4546 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4547 ;;
4548 m68k)
4549 # FIXME: we need at least 68020 code to build shared libraries, but
4550 # adding the '-m68020' flag to GCC prevents building anything better,
4551 # like '-m68040'.
4552 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4553 ;;
4554 esac
4555 ;;
4556
4557 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4558 # PIC is the default for these OSes.
4559 ;;
4560
4561 mingw* | cygwin* | pw32* | os2* | cegcc*)
4562 # This hack is so that the source file can tell whether it is being
4563 # built for inclusion in a dll (and should export symbols for example).
4564 # Although the cygwin gcc ignores -fPIC, still need this for old-style
4565 # (--disable-auto-import) libraries
4566 m4_if([$1], [GCJ], [],
4567 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4568 case $host_os in
4569 os2*)
4570 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4571 ;;
4572 esac
4573 ;;
4574
4575 darwin* | rhapsody*)
4576 # PIC is the default on this platform
4577 # Common symbols not allowed in MH_DYLIB files
4578 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4579 ;;
4580
4581 haiku*)
4582 # PIC is the default for Haiku.
4583 # The "-static" flag exists, but is broken.
4584 _LT_TAGVAR(lt_prog_compiler_static, $1)=
4585 ;;
4586
4587 hpux*)
4588 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4589 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
4590 # sets the default TLS model and affects inlining.
4591 case $host_cpu in
4592 hppa*64*)
4593 # +Z the default
4594 ;;
4595 *)
4596 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4597 ;;
4598 esac
4599 ;;
4600
4601 interix[[3-9]]*)
4602 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4603 # Instead, we relocate shared libraries at runtime.
4604 ;;
4605
4606 msdosdjgpp*)
4607 # Just because we use GCC doesn't mean we suddenly get shared libraries
4608 # on systems that don't support them.
4609 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4610 enable_shared=no
4611 ;;
4612
4613 *nto* | *qnx*)
4614 # QNX uses GNU C++, but need to define -shared option too, otherwise
4615 # it will coredump.
4616 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4617 ;;
4618
4619 sysv4*MP*)
4620 if test -d /usr/nec; then
4621 _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4622 fi
4623 ;;
4624
4625 *)
4626 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4627 ;;
4628 esac
4629
4630 case $cc_basename in
4631 nvcc*) # Cuda Compiler Driver 2.2
4632 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4633 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4634 _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4635 fi
4636 ;;
4637 esac
4638 else
4639 # PORTME Check for flag to pass linker flags through the system compiler.
4640 case $host_os in
4641 aix*)
4642 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4643 if test ia64 = "$host_cpu"; then
4644 # AIX 5 now supports IA64 processor
4645 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4646 else
4647 _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4648 fi
4649 ;;
4650
4651 darwin* | rhapsody*)
4652 # PIC is the default on this platform
4653 # Common symbols not allowed in MH_DYLIB files
4654 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4655 case $cc_basename in
4656 nagfor*)
4657 # NAG Fortran compiler
4658 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4659 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4660 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4661 ;;
4662 esac
4663 ;;
4664
4665 mingw* | cygwin* | pw32* | os2* | cegcc*)
4666 # This hack is so that the source file can tell whether it is being
4667 # built for inclusion in a dll (and should export symbols for example).
4668 m4_if([$1], [GCJ], [],
4669 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4670 case $host_os in
4671 os2*)
4672 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4673 ;;
4674 esac
4675 ;;
4676
4677 hpux9* | hpux10* | hpux11*)
4678 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4679 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4680 # not for PA HP-UX.
4681 case $host_cpu in
4682 hppa*64*|ia64*)
4683 # +Z the default
4684 ;;
4685 *)
4686 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4687 ;;
4688 esac
4689 # Is there a better lt_prog_compiler_static that works with the bundled CC?
4690 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4691 ;;
4692
4693 irix5* | irix6* | nonstopux*)
4694 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4695 # PIC (with -KPIC) is the default.
4696 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4697 ;;
4698
4699 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4700 case $cc_basename in
4701 # old Intel for x86_64, which still supported -KPIC.
4702 ecc*)
4703 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4704 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4705 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4706 ;;
4707 # icc used to be incompatible with GCC.
4708 # ICC 10 doesn't accept -KPIC any more.
4709 icc* | ifort*)
4710 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4711 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4712 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4713 ;;
4714 # Lahey Fortran 8.1.
4715 lf95*)
4716 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4717 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4718 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4719 ;;
4720 nagfor*)
4721 # NAG Fortran compiler
4722 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4723 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4724 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4725 ;;
4726 tcc*)
4727 # Fabrice Bellard et al's Tiny C Compiler
4728 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4729 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4730 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4731 ;;
4732 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4733 # Portland Group compilers (*not* the Pentium gcc compiler,
4734 # which looks to be a dead project)
4735 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4736 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4737 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4738 ;;
4739 ccc*)
4740 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4741 # All Alpha code is PIC.
4742 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4743 ;;
4744 xl* | bgxl* | bgf* | mpixl*)
4745 # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4746 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4747 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4748 _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4749 ;;
4750 *)
4751 case `$CC -V 2>&1 | sed 5q` in
4752 *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4753 # Sun Fortran 8.3 passes all unrecognized flags to the linker
4754 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4755 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4756 _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4757 ;;
4758 *Sun\ F* | *Sun*Fortran*)
4759 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4760 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4761 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4762 ;;
4763 *Sun\ C*)
4764 # Sun C 5.9
4765 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4766 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4767 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4768 ;;
4769 *Intel*\ [[CF]]*Compiler*)
4770 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4771 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4772 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4773 ;;
4774 *Portland\ Group*)
4775 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4776 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4777 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4778 ;;
4779 esac
4780 ;;
4781 esac
4782 ;;
4783
4784 newsos6)
4785 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4786 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4787 ;;
4788
4789 *nto* | *qnx*)
4790 # QNX uses GNU C++, but need to define -shared option too, otherwise
4791 # it will coredump.
4792 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4793 ;;
4794
4795 osf3* | osf4* | osf5*)
4796 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4797 # All OSF/1 code is PIC.
4798 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4799 ;;
4800
4801 rdos*)
4802 _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4803 ;;
4804
4805 solaris*)
4806 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4807 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4808 case $cc_basename in
4809 f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4810 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4811 *)
4812 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4813 esac
4814 ;;
4815
4816 sunos4*)
4817 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4818 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4819 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4820 ;;
4821
4822 sysv4 | sysv4.2uw2* | sysv4.3*)
4823 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4824 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4825 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4826 ;;
4827
4828 sysv4*MP*)
4829 if test -d /usr/nec; then
4830 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4831 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4832 fi
4833 ;;
4834
4835 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4836 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4837 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4838 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4839 ;;
4840
4841 unicos*)
4842 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4843 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4844 ;;
4845
4846 uts4*)
4847 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4848 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4849 ;;
4850
4851 *)
4852 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4853 ;;
4854 esac
4855 fi
4856 ])
4857 case $host_os in
4858 # For platforms that do not support PIC, -DPIC is meaningless:
4859 *djgpp*)
4860 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4861 ;;
4862 *)
4863 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4864 ;;
4865 esac
4866
4867 AC_CACHE_CHECK([for $compiler option to produce PIC],
4868 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4869 [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4870 _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4871
4872 #
4873 # Check to make sure the PIC flag actually works.
4874 #
4875 if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4876 _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4877 [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4878 [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4879 [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4880 "" | " "*) ;;
4881 *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4882 esac],
4883 [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4884 _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4885 fi
4886 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4887 [Additional compiler flags for building library objects])
4888
4889 _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4890 [How to pass a linker flag through the compiler])
4891 #
4892 # Check to make sure the static flag actually works.
4893 #
4894 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4895 _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4896 _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4897 $lt_tmp_static_flag,
4898 [],
4899 [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4900 _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4901 [Compiler flag to prevent dynamic linking])
4902 ])# _LT_COMPILER_PIC
4903
4904
4905 # _LT_LINKER_SHLIBS([TAGNAME])
4906 # ----------------------------
4907 # See if the linker supports building shared libraries.
4908 m4_defun([_LT_LINKER_SHLIBS],
4909 [AC_REQUIRE([LT_PATH_LD])dnl
4910 AC_REQUIRE([LT_PATH_NM])dnl
4911 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
4912 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
4913 m4_require([_LT_DECL_EGREP])dnl
4914 m4_require([_LT_DECL_SED])dnl
4915 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4916 m4_require([_LT_TAG_COMPILER])dnl
4917 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4918 m4_if([$1], [CXX], [
4919 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4920 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4921 case $host_os in
4922 aix[[4-9]]*)
4923 # If we're using GNU nm, then we don't want the "-C" option.
4924 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4925 # Without the "-l" option, or with the "-B" option, AIX nm treats
4926 # weak defined symbols like other global defined symbols, whereas
4927 # GNU nm marks them as "W".
4928 # While the 'weak' keyword is ignored in the Export File, we need
4929 # it in the Import File for the 'aix-soname' feature, so we have
4930 # to replace the "-B" option with "-P" for AIX nm.
4931 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4932 _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'
4933 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'
4935 fi
4936 ;;
4937 pw32*)
4938 _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4939 ;;
4940 cygwin* | mingw* | cegcc*)
4941 case $cc_basename in
4942 cl*)
4943 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4944 ;;
4945 *)
4946 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4947 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4948 ;;
4949 esac
4950 ;;
4951 *)
4952 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4953 ;;
4954 esac
4955 ], [
4956 runpath_var=
4957 _LT_TAGVAR(allow_undefined_flag, $1)=
4958 _LT_TAGVAR(always_export_symbols, $1)=no
4959 _LT_TAGVAR(archive_cmds, $1)=
4960 _LT_TAGVAR(archive_expsym_cmds, $1)=
4961 _LT_TAGVAR(compiler_needs_object, $1)=no
4962 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4963 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4964 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4965 _LT_TAGVAR(hardcode_automatic, $1)=no
4966 _LT_TAGVAR(hardcode_direct, $1)=no
4967 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4968 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4969 _LT_TAGVAR(hardcode_libdir_separator, $1)=
4970 _LT_TAGVAR(hardcode_minus_L, $1)=no
4971 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4972 _LT_TAGVAR(inherit_rpath, $1)=no
4973 _LT_TAGVAR(link_all_deplibs, $1)=unknown
4974 _LT_TAGVAR(module_cmds, $1)=
4975 _LT_TAGVAR(module_expsym_cmds, $1)=
4976 _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4977 _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4978 _LT_TAGVAR(thread_safe_flag_spec, $1)=
4979 _LT_TAGVAR(whole_archive_flag_spec, $1)=
4980 # include_expsyms should be a list of space-separated symbols to be *always*
4981 # included in the symbol list
4982 _LT_TAGVAR(include_expsyms, $1)=
4983 # exclude_expsyms can be an extended regexp of symbols to exclude
4984 # it will be wrapped by ' (' and ')$', so one must not match beginning or
4985 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4986 # as well as any symbol that contains 'd'.
4987 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4988 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4989 # platforms (ab)use it in PIC code, but their linkers get confused if
4990 # the symbol is explicitly referenced. Since portable code cannot
4991 # rely on this symbol name, it's probably fine to never include it in
4992 # preloaded symbol tables.
4993 # Exclude shared library initialization/finalization symbols.
4994 dnl Note also adjust exclude_expsyms for C++ above.
4995 extract_expsyms_cmds=
4996
4997 case $host_os in
4998 cygwin* | mingw* | pw32* | cegcc*)
4999 # FIXME: the MSVC++ port hasn't been tested in a loooong time
5000 # When not using gcc, we currently assume that we are using
5001 # Microsoft Visual C++.
5002 if test yes != "$GCC"; then
5003 with_gnu_ld=no
5004 fi
5005 ;;
5006 interix*)
5007 # we just hope/assume this is gcc and not c89 (= MSVC++)
5008 with_gnu_ld=yes
5009 ;;
5010 openbsd* | bitrig*)
5011 with_gnu_ld=no
5012 ;;
5013 esac
5014
5015 _LT_TAGVAR(ld_shlibs, $1)=yes
5016
5017 # On some targets, GNU ld is compatible enough with the native linker
5018 # that we're better off using the native interface for both.
5019 lt_use_gnu_ld_interface=no
5020 if test yes = "$with_gnu_ld"; then
5021 case $host_os in
5022 aix*)
5023 # The AIX port of GNU ld has always aspired to compatibility
5024 # with the native linker. However, as the warning in the GNU ld
5025 # block says, versions before 2.19.5* couldn't really create working
5026 # shared libraries, regardless of the interface used.
5027 case `$LD -v 2>&1` in
5028 *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5029 *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5030 *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5031 *)
5032 lt_use_gnu_ld_interface=yes
5033 ;;
5034 esac
5035 ;;
5036 *)
5037 lt_use_gnu_ld_interface=yes
5038 ;;
5039 esac
5040 fi
5041
5042 if test yes = "$lt_use_gnu_ld_interface"; then
5043 # If archive_cmds runs LD, not CC, wlarc should be empty
5044 wlarc='$wl'
5045
5046 # Set some defaults for GNU ld with shared library support. These
5047 # are reset later if shared libraries are not supported. Putting them
5048 # here allows them to be overridden if necessary.
5049 runpath_var=LD_RUN_PATH
5050 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5051 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5052 # ancient GNU ld didn't support --whole-archive et. al.
5053 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5054 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5055 else
5056 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5057 fi
5058 supports_anon_versioning=no
5059 case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
5060 *GNU\ gold*) supports_anon_versioning=yes ;;
5061 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5062 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5063 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5064 *\ 2.11.*) ;; # other 2.11 versions
5065 *) supports_anon_versioning=yes ;;
5066 esac
5067
5068 # See if GNU ld supports shared libraries.
5069 case $host_os in
5070 aix[[3-9]]*)
5071 # On AIX/PPC, the GNU linker is very broken
5072 if test ia64 != "$host_cpu"; then
5073 _LT_TAGVAR(ld_shlibs, $1)=no
5074 cat <<_LT_EOF 1>&2
5075
5076 *** Warning: the GNU linker, at least up to release 2.19, is reported
5077 *** to be unable to reliably create shared libraries on AIX.
5078 *** Therefore, libtool is disabling shared libraries support. If you
5079 *** really care for shared libraries, you may want to install binutils
5080 *** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5081 *** You will then need to restart the configuration process.
5082
5083 _LT_EOF
5084 fi
5085 ;;
5086
5087 amigaos*)
5088 case $host_cpu in
5089 powerpc)
5090 # see comment about AmigaOS4 .so support
5091 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5092 _LT_TAGVAR(archive_expsym_cmds, $1)=''
5093 ;;
5094 m68k)
5095 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5096 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5097 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5098 ;;
5099 esac
5100 ;;
5101
5102 beos*)
5103 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5104 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5105 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5106 # support --undefined. This deserves some investigation. FIXME
5107 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5108 else
5109 _LT_TAGVAR(ld_shlibs, $1)=no
5110 fi
5111 ;;
5112
5113 cygwin* | mingw* | pw32* | cegcc*)
5114 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5115 # as there is no search path for DLLs.
5116 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5117 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5118 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5119 _LT_TAGVAR(always_export_symbols, $1)=no
5120 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5121 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5122 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5123
5124 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5125 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5126 # If the export-symbols file already is a .def file, use it as
5127 # is; otherwise, prepend EXPORTS...
5128 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5129 cp $export_symbols $output_objdir/$soname.def;
5130 else
5131 echo EXPORTS > $output_objdir/$soname.def;
5132 cat $export_symbols >> $output_objdir/$soname.def;
5133 fi~
5134 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5135 else
5136 _LT_TAGVAR(ld_shlibs, $1)=no
5137 fi
5138 ;;
5139
5140 haiku*)
5141 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5142 _LT_TAGVAR(link_all_deplibs, $1)=yes
5143 ;;
5144
5145 os2*)
5146 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5147 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5148 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5149 shrext_cmds=.dll
5150 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5151 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5152 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5153 $ECHO EXPORTS >> $output_objdir/$libname.def~
5154 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5155 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5156 emximp -o $lib $output_objdir/$libname.def'
5157 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5158 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5159 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5160 $ECHO EXPORTS >> $output_objdir/$libname.def~
5161 prefix_cmds="$SED"~
5162 if test EXPORTS = "`$SED 1q $export_symbols`"; then
5163 prefix_cmds="$prefix_cmds -e 1d";
5164 fi~
5165 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5166 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5167 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5168 emximp -o $lib $output_objdir/$libname.def'
5169 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5170 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5171 ;;
5172
5173 interix[[3-9]]*)
5174 _LT_TAGVAR(hardcode_direct, $1)=no
5175 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5176 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5177 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5178 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5179 # Instead, shared libraries are loaded at an image base (0x10000000 by
5180 # default) and relocated if they conflict, which is a slow very memory
5181 # consuming and fragmenting process. To avoid this, we pick a random,
5182 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5183 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
5184 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5185 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5186 ;;
5187
5188 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5189 tmp_diet=no
5190 if test linux-dietlibc = "$host_os"; then
5191 case $cc_basename in
5192 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
5193 esac
5194 fi
5195 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5196 && test no = "$tmp_diet"
5197 then
5198 tmp_addflag=' $pic_flag'
5199 tmp_sharedflag='-shared'
5200 case $cc_basename,$host_cpu in
5201 pgcc*) # Portland Group C compiler
5202 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5203 tmp_addflag=' $pic_flag'
5204 ;;
5205 pgf77* | pgf90* | pgf95* | pgfortran*)
5206 # Portland Group f77 and f90 compilers
5207 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5208 tmp_addflag=' $pic_flag -Mnomain' ;;
5209 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
5210 tmp_addflag=' -i_dynamic' ;;
5211 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
5212 tmp_addflag=' -i_dynamic -nofor_main' ;;
5213 ifc* | ifort*) # Intel Fortran compiler
5214 tmp_addflag=' -nofor_main' ;;
5215 lf95*) # Lahey Fortran 8.1
5216 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5217 tmp_sharedflag='--shared' ;;
5218 nagfor*) # NAGFOR 5.3
5219 tmp_sharedflag='-Wl,-shared' ;;
5220 xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5221 tmp_sharedflag='-qmkshrobj'
5222 tmp_addflag= ;;
5223 nvcc*) # Cuda Compiler Driver 2.2
5224 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5225 _LT_TAGVAR(compiler_needs_object, $1)=yes
5226 ;;
5227 esac
5228 case `$CC -V 2>&1 | sed 5q` in
5229 *Sun\ C*) # Sun C 5.9
5230 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5231 _LT_TAGVAR(compiler_needs_object, $1)=yes
5232 tmp_sharedflag='-G' ;;
5233 *Sun\ F*) # Sun Fortran 8.3
5234 tmp_sharedflag='-G' ;;
5235 esac
5236 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5237
5238 if test yes = "$supports_anon_versioning"; then
5239 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5240 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5241 echo "local: *; };" >> $output_objdir/$libname.ver~
5242 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5243 fi
5244
5245 case $cc_basename in
5246 tcc*)
5247 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5248 ;;
5249 xlf* | bgf* | bgxlf* | mpixlf*)
5250 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5251 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5252 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5253 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5254 if test yes = "$supports_anon_versioning"; then
5255 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5256 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5257 echo "local: *; };" >> $output_objdir/$libname.ver~
5258 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5259 fi
5260 ;;
5261 esac
5262 else
5263 _LT_TAGVAR(ld_shlibs, $1)=no
5264 fi
5265 ;;
5266
5267 netbsd*)
5268 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5269 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5270 wlarc=
5271 else
5272 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5273 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5274 fi
5275 ;;
5276
5277 solaris*)
5278 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5279 _LT_TAGVAR(ld_shlibs, $1)=no
5280 cat <<_LT_EOF 1>&2
5281
5282 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
5283 *** create shared libraries on Solaris systems. Therefore, libtool
5284 *** is disabling shared libraries support. We urge you to upgrade GNU
5285 *** binutils to release 2.9.1 or newer. Another option is to modify
5286 *** your PATH or compiler configuration so that the native linker is
5287 *** used, and then restart.
5288
5289 _LT_EOF
5290 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5291 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5292 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5293 else
5294 _LT_TAGVAR(ld_shlibs, $1)=no
5295 fi
5296 ;;
5297
5298 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5299 case `$LD -v 2>&1` in
5300 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5301 _LT_TAGVAR(ld_shlibs, $1)=no
5302 cat <<_LT_EOF 1>&2
5303
5304 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5305 *** reliably create shared libraries on SCO systems. Therefore, libtool
5306 *** is disabling shared libraries support. We urge you to upgrade GNU
5307 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
5308 *** your PATH or compiler configuration so that the native linker is
5309 *** used, and then restart.
5310
5311 _LT_EOF
5312 ;;
5313 *)
5314 # For security reasons, it is highly recommended that you always
5315 # use absolute paths for naming shared libraries, and exclude the
5316 # DT_RUNPATH tag from executables and libraries. But doing so
5317 # requires that you compile everything twice, which is a pain.
5318 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5319 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5320 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5321 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5322 else
5323 _LT_TAGVAR(ld_shlibs, $1)=no
5324 fi
5325 ;;
5326 esac
5327 ;;
5328
5329 sunos4*)
5330 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5331 wlarc=
5332 _LT_TAGVAR(hardcode_direct, $1)=yes
5333 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5334 ;;
5335
5336 *)
5337 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5338 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5339 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5340 else
5341 _LT_TAGVAR(ld_shlibs, $1)=no
5342 fi
5343 ;;
5344 esac
5345
5346 if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5347 runpath_var=
5348 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5349 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5350 _LT_TAGVAR(whole_archive_flag_spec, $1)=
5351 fi
5352 else
5353 # PORTME fill in a description of your system's linker (not GNU ld)
5354 case $host_os in
5355 aix3*)
5356 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5357 _LT_TAGVAR(always_export_symbols, $1)=yes
5358 _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
5359 # Note: this linker hardcodes the directories in LIBPATH if there
5360 # are no directories specified by -L.
5361 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5362 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5363 # Neither direct hardcoding nor static linking is supported with a
5364 # broken collect2.
5365 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5366 fi
5367 ;;
5368
5369 aix[[4-9]]*)
5370 if test ia64 = "$host_cpu"; then
5371 # On IA64, the linker does run time linking by default, so we don't
5372 # have to do anything special.
5373 aix_use_runtimelinking=no
5374 exp_sym_flag='-Bexport'
5375 no_entry_flag=
5376 else
5377 # If we're using GNU nm, then we don't want the "-C" option.
5378 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
5379 # Without the "-l" option, or with the "-B" option, AIX nm treats
5380 # weak defined symbols like other global defined symbols, whereas
5381 # GNU nm marks them as "W".
5382 # While the 'weak' keyword is ignored in the Export File, we need
5383 # it in the Import File for the 'aix-soname' feature, so we have
5384 # to replace the "-B" option with "-P" for AIX nm.
5385 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5386 _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'
5387 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'
5389 fi
5390 aix_use_runtimelinking=no
5391
5392 # Test if we are trying to use run time linking or normal
5393 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5394 # have runtime linking enabled, and use it for executables.
5395 # For shared libraries, we enable/disable runtime linking
5396 # depending on the kind of the shared library created -
5397 # when "with_aix_soname,aix_use_runtimelinking" is:
5398 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
5399 # "aix,yes" lib.so shared, rtl:yes, for executables
5400 # lib.a static archive
5401 # "both,no" lib.so.V(shr.o) shared, rtl:yes
5402 # lib.a(lib.so.V) shared, rtl:no, for executables
5403 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5404 # lib.a(lib.so.V) shared, rtl:no
5405 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
5406 # lib.a static archive
5407 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5408 for ld_flag in $LDFLAGS; do
5409 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5410 aix_use_runtimelinking=yes
5411 break
5412 fi
5413 done
5414 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5415 # With aix-soname=svr4, we create the lib.so.V shared archives only,
5416 # so we don't have lib.a shared libs to link our executables.
5417 # We have to force runtime linking in this case.
5418 aix_use_runtimelinking=yes
5419 LDFLAGS="$LDFLAGS -Wl,-brtl"
5420 fi
5421 ;;
5422 esac
5423
5424 exp_sym_flag='-bexport'
5425 no_entry_flag='-bnoentry'
5426 fi
5427
5428 # When large executables or shared objects are built, AIX ld can
5429 # have problems creating the table of contents. If linking a library
5430 # or program results in "error TOC overflow" add -mminimal-toc to
5431 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
5432 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5433
5434 _LT_TAGVAR(archive_cmds, $1)=''
5435 _LT_TAGVAR(hardcode_direct, $1)=yes
5436 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5437 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5438 _LT_TAGVAR(link_all_deplibs, $1)=yes
5439 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5440 case $with_aix_soname,$aix_use_runtimelinking in
5441 aix,*) ;; # traditional, no import file
5442 svr4,* | *,yes) # use import file
5443 # The Import File defines what to hardcode.
5444 _LT_TAGVAR(hardcode_direct, $1)=no
5445 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5446 ;;
5447 esac
5448
5449 if test yes = "$GCC"; then
5450 case $host_os in aix4.[[012]]|aix4.[[012]].*)
5451 # We only want to do this on AIX 4.2 and lower, the check
5452 # below for broken collect2 doesn't work under 4.3+
5453 collect2name=`$CC -print-prog-name=collect2`
5454 if test -f "$collect2name" &&
5455 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5456 then
5457 # We have reworked collect2
5458 :
5459 else
5460 # We have old collect2
5461 _LT_TAGVAR(hardcode_direct, $1)=unsupported
5462 # It fails to find uninstalled libraries when the uninstalled
5463 # path is not listed in the libpath. Setting hardcode_minus_L
5464 # to unsupported forces relinking
5465 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5466 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5467 _LT_TAGVAR(hardcode_libdir_separator, $1)=
5468 fi
5469 ;;
5470 esac
5471 shared_flag='-shared'
5472 if test yes = "$aix_use_runtimelinking"; then
5473 shared_flag="$shared_flag "'$wl-G'
5474 fi
5475 # Need to ensure runtime linking is disabled for the traditional
5476 # shared library, or the linker may eventually find shared libraries
5477 # /with/ Import File - we do not want to mix them.
5478 shared_flag_aix='-shared'
5479 shared_flag_svr4='-shared $wl-G'
5480 else
5481 # not using gcc
5482 if test ia64 = "$host_cpu"; then
5483 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5484 # chokes on -Wl,-G. The following line is correct:
5485 shared_flag='-G'
5486 else
5487 if test yes = "$aix_use_runtimelinking"; then
5488 shared_flag='$wl-G'
5489 else
5490 shared_flag='$wl-bM:SRE'
5491 fi
5492 shared_flag_aix='$wl-bM:SRE'
5493 shared_flag_svr4='$wl-G'
5494 fi
5495 fi
5496
5497 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5498 # It seems that -bexpall does not export symbols beginning with
5499 # underscore (_), so it is better to generate a list of symbols to export.
5500 _LT_TAGVAR(always_export_symbols, $1)=yes
5501 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5502 # Warning - without using the other runtime loading flags (-brtl),
5503 # -berok will link without error, but may produce a broken library.
5504 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5505 # Determine the default libpath from the value encoded in an
5506 # empty executable.
5507 _LT_SYS_MODULE_PATH_AIX([$1])
5508 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5509 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
5510 else
5511 if test ia64 = "$host_cpu"; then
5512 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5513 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5514 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
5515 else
5516 # Determine the default libpath from the value encoded in an
5517 # empty executable.
5518 _LT_SYS_MODULE_PATH_AIX([$1])
5519 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5520 # Warning - without using the other run time loading flags,
5521 # -berok will link without error, but may produce a broken library.
5522 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5523 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5524 if test yes = "$with_gnu_ld"; then
5525 # We only use this code for GNU lds that support --whole-archive.
5526 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5527 else
5528 # Exported symbols can be pulled into shared objects from archives
5529 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5530 fi
5531 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5532 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5533 # -brtl affects multiple linker settings, -berok does not and is overridden later
5534 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5535 if test svr4 != "$with_aix_soname"; then
5536 # This is similar to how AIX traditionally builds its shared libraries.
5537 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
5538 fi
5539 if test aix != "$with_aix_soname"; then
5540 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
5541 else
5542 # used by -dlpreopen to get the symbols
5543 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
5544 fi
5545 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5546 fi
5547 fi
5548 ;;
5549
5550 amigaos*)
5551 case $host_cpu in
5552 powerpc)
5553 # see comment about AmigaOS4 .so support
5554 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5555 _LT_TAGVAR(archive_expsym_cmds, $1)=''
5556 ;;
5557 m68k)
5558 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5559 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5560 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5561 ;;
5562 esac
5563 ;;
5564
5565 bsdi[[45]]*)
5566 _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5567 ;;
5568
5569 cygwin* | mingw* | pw32* | cegcc*)
5570 # When not using gcc, we currently assume that we are using
5571 # Microsoft Visual C++.
5572 # hardcode_libdir_flag_spec is actually meaningless, as there is
5573 # no search path for DLLs.
5574 case $cc_basename in
5575 cl*)
5576 # Native MSVC
5577 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5578 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5579 _LT_TAGVAR(always_export_symbols, $1)=yes
5580 _LT_TAGVAR(file_list_spec, $1)='@'
5581 # Tell ltmain to make .lib files, not .a files.
5582 libext=lib
5583 # Tell ltmain to make .dll files, not .so files.
5584 shrext_cmds=.dll
5585 # FIXME: Setting linknames here is a bad hack.
5586 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5587 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5588 cp "$export_symbols" "$output_objdir/$soname.def";
5589 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5590 else
5591 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5592 fi~
5593 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5594 linknames='
5595 # The linker will not automatically build a static lib if we build a DLL.
5596 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5597 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5598 _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5599 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
5600 # Don't use ranlib
5601 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5602 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5603 lt_tool_outputfile="@TOOL_OUTPUT@"~
5604 case $lt_outputfile in
5605 *.exe|*.EXE) ;;
5606 *)
5607 lt_outputfile=$lt_outputfile.exe
5608 lt_tool_outputfile=$lt_tool_outputfile.exe
5609 ;;
5610 esac~
5611 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5612 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5613 $RM "$lt_outputfile.manifest";
5614 fi'
5615 ;;
5616 *)
5617 # Assume MSVC wrapper
5618 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5619 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5620 # Tell ltmain to make .lib files, not .a files.
5621 libext=lib
5622 # Tell ltmain to make .dll files, not .so files.
5623 shrext_cmds=.dll
5624 # FIXME: Setting linknames here is a bad hack.
5625 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5626 # The linker will automatically build a .lib file if we build a DLL.
5627 _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5628 # FIXME: Should let the user specify the lib program.
5629 _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5630 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5631 ;;
5632 esac
5633 ;;
5634
5635 darwin* | rhapsody*)
5636 _LT_DARWIN_LINKER_FEATURES($1)
5637 ;;
5638
5639 dgux*)
5640 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5641 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5642 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5643 ;;
5644
5645 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5646 # support. Future versions do this automatically, but an explicit c++rt0.o
5647 # does not break anything, and helps significantly (at the cost of a little
5648 # extra space).
5649 freebsd2.2*)
5650 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5651 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5652 _LT_TAGVAR(hardcode_direct, $1)=yes
5653 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5654 ;;
5655
5656 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5657 freebsd2.*)
5658 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5659 _LT_TAGVAR(hardcode_direct, $1)=yes
5660 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5661 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5662 ;;
5663
5664 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5665 freebsd* | dragonfly*)
5666 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5667 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5668 _LT_TAGVAR(hardcode_direct, $1)=yes
5669 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5670 ;;
5671
5672 hpux9*)
5673 if test yes = "$GCC"; then
5674 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5675 else
5676 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5677 fi
5678 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5679 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5680 _LT_TAGVAR(hardcode_direct, $1)=yes
5681
5682 # hardcode_minus_L: Not really in the search PATH,
5683 # but as the default location of the library.
5684 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5685 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5686 ;;
5687
5688 hpux10*)
5689 if test yes,no = "$GCC,$with_gnu_ld"; then
5690 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5691 else
5692 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5693 fi
5694 if test no = "$with_gnu_ld"; then
5695 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5696 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5697 _LT_TAGVAR(hardcode_direct, $1)=yes
5698 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5699 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5700 # hardcode_minus_L: Not really in the search PATH,
5701 # but as the default location of the library.
5702 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5703 fi
5704 ;;
5705
5706 hpux11*)
5707 if test yes,no = "$GCC,$with_gnu_ld"; then
5708 case $host_cpu in
5709 hppa*64*)
5710 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5711 ;;
5712 ia64*)
5713 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5714 ;;
5715 *)
5716 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5717 ;;
5718 esac
5719 else
5720 case $host_cpu in
5721 hppa*64*)
5722 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5723 ;;
5724 ia64*)
5725 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5726 ;;
5727 *)
5728 m4_if($1, [], [
5729 # Older versions of the 11.00 compiler do not understand -b yet
5730 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5731 _LT_LINKER_OPTION([if $CC understands -b],
5732 _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5733 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5734 [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5735 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5736 ;;
5737 esac
5738 fi
5739 if test no = "$with_gnu_ld"; then
5740 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5741 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5742
5743 case $host_cpu in
5744 hppa*64*|ia64*)
5745 _LT_TAGVAR(hardcode_direct, $1)=no
5746 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5747 ;;
5748 *)
5749 _LT_TAGVAR(hardcode_direct, $1)=yes
5750 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5751 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5752
5753 # hardcode_minus_L: Not really in the search PATH,
5754 # but as the default location of the library.
5755 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5756 ;;
5757 esac
5758 fi
5759 ;;
5760
5761 irix5* | irix6* | nonstopux*)
5762 if test yes = "$GCC"; then
5763 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5764 # Try to use the -exported_symbol ld option, if it does not
5765 # work, assume that -exports_file does not work either and
5766 # implicitly export all symbols.
5767 # This should be the same for all languages, so no per-tag cache variable.
5768 AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5769 [lt_cv_irix_exported_symbol],
5770 [save_LDFLAGS=$LDFLAGS
5771 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5772 AC_LINK_IFELSE(
5773 [AC_LANG_SOURCE(
5774 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5775 [C++], [[int foo (void) { return 0; }]],
5776 [Fortran 77], [[
5777 subroutine foo
5778 end]],
5779 [Fortran], [[
5780 subroutine foo
5781 end]])])],
5782 [lt_cv_irix_exported_symbol=yes],
5783 [lt_cv_irix_exported_symbol=no])
5784 LDFLAGS=$save_LDFLAGS])
5785 if test yes = "$lt_cv_irix_exported_symbol"; then
5786 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
5787 fi
5788 else
5789 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5790 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
5791 fi
5792 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5793 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5794 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5795 _LT_TAGVAR(inherit_rpath, $1)=yes
5796 _LT_TAGVAR(link_all_deplibs, $1)=yes
5797 ;;
5798
5799 linux*)
5800 case $cc_basename in
5801 tcc*)
5802 # Fabrice Bellard et al's Tiny C Compiler
5803 _LT_TAGVAR(ld_shlibs, $1)=yes
5804 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5805 ;;
5806 esac
5807 ;;
5808
5809 netbsd*)
5810 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5811 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
5812 else
5813 _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
5814 fi
5815 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5816 _LT_TAGVAR(hardcode_direct, $1)=yes
5817 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5818 ;;
5819
5820 newsos6)
5821 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5822 _LT_TAGVAR(hardcode_direct, $1)=yes
5823 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5824 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5825 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5826 ;;
5827
5828 *nto* | *qnx*)
5829 ;;
5830
5831 openbsd* | bitrig*)
5832 if test -f /usr/libexec/ld.so; then
5833 _LT_TAGVAR(hardcode_direct, $1)=yes
5834 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5835 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5836 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5837 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5838 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5839 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5840 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5841 else
5842 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5843 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5844 fi
5845 else
5846 _LT_TAGVAR(ld_shlibs, $1)=no
5847 fi
5848 ;;
5849
5850 os2*)
5851 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5852 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5853 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5854 shrext_cmds=.dll
5855 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5856 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5857 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5858 $ECHO EXPORTS >> $output_objdir/$libname.def~
5859 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5860 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5861 emximp -o $lib $output_objdir/$libname.def'
5862 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5863 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5864 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5865 $ECHO EXPORTS >> $output_objdir/$libname.def~
5866 prefix_cmds="$SED"~
5867 if test EXPORTS = "`$SED 1q $export_symbols`"; then
5868 prefix_cmds="$prefix_cmds -e 1d";
5869 fi~
5870 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5871 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5872 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5873 emximp -o $lib $output_objdir/$libname.def'
5874 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5875 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5876 ;;
5877
5878 osf3*)
5879 if test yes = "$GCC"; then
5880 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5881 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5882 else
5883 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5884 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5885 fi
5886 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5887 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5888 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5889 ;;
5890
5891 osf4* | osf5*) # as osf3* with the addition of -msym flag
5892 if test yes = "$GCC"; then
5893 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5894 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5895 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5896 else
5897 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5898 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5899 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
5900 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
5901
5902 # Both c and cxx compiler support -rpath directly
5903 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5904 fi
5905 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5906 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5907 ;;
5908
5909 solaris*)
5910 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5911 if test yes = "$GCC"; then
5912 wlarc='$wl'
5913 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5914 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5915 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5916 else
5917 case `$CC -V 2>&1` in
5918 *"Compilers 5.0"*)
5919 wlarc=''
5920 _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5921 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5922 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5923 ;;
5924 *)
5925 wlarc='$wl'
5926 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5927 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5928 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5929 ;;
5930 esac
5931 fi
5932 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5933 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5934 case $host_os in
5935 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5936 *)
5937 # The compiler driver will combine and reorder linker options,
5938 # but understands '-z linker_flag'. GCC discards it without '$wl',
5939 # but is careful enough not to reorder.
5940 # Supported since Solaris 2.6 (maybe 2.5.1?)
5941 if test yes = "$GCC"; then
5942 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5943 else
5944 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5945 fi
5946 ;;
5947 esac
5948 _LT_TAGVAR(link_all_deplibs, $1)=yes
5949 ;;
5950
5951 sunos4*)
5952 if test sequent = "$host_vendor"; then
5953 # Use $CC to link under sequent, because it throws in some extra .o
5954 # files that make .init and .fini sections work.
5955 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5956 else
5957 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5958 fi
5959 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5960 _LT_TAGVAR(hardcode_direct, $1)=yes
5961 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5962 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5963 ;;
5964
5965 sysv4)
5966 case $host_vendor in
5967 sni)
5968 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5969 _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5970 ;;
5971 siemens)
5972 ## LD is ld it makes a PLAMLIB
5973 ## CC just makes a GrossModule.
5974 _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5975 _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5976 _LT_TAGVAR(hardcode_direct, $1)=no
5977 ;;
5978 motorola)
5979 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5980 _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5981 ;;
5982 esac
5983 runpath_var='LD_RUN_PATH'
5984 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5985 ;;
5986
5987 sysv4.3*)
5988 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5989 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5990 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5991 ;;
5992
5993 sysv4*MP*)
5994 if test -d /usr/nec; then
5995 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5996 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5997 runpath_var=LD_RUN_PATH
5998 hardcode_runpath_var=yes
5999 _LT_TAGVAR(ld_shlibs, $1)=yes
6000 fi
6001 ;;
6002
6003 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6004 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6005 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6006 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6007 runpath_var='LD_RUN_PATH'
6008
6009 if test yes = "$GCC"; then
6010 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6011 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6012 else
6013 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6014 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6015 fi
6016 ;;
6017
6018 sysv5* | sco3.2v5* | sco5v6*)
6019 # Note: We CANNOT use -z defs as we might desire, because we do not
6020 # link with -lc, and that would cause any symbols used from libc to
6021 # always be unresolved, which means just about no library would
6022 # ever link correctly. If we're not using GNU ld we use -z text
6023 # though, which does catch some bad symbols but isn't as heavy-handed
6024 # as -z defs.
6025 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6026 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6027 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6028 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6029 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6030 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6031 _LT_TAGVAR(link_all_deplibs, $1)=yes
6032 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6033 runpath_var='LD_RUN_PATH'
6034
6035 if test yes = "$GCC"; then
6036 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6037 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6038 else
6039 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6040 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6041 fi
6042 ;;
6043
6044 uts4*)
6045 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6046 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6047 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6048 ;;
6049
6050 *)
6051 _LT_TAGVAR(ld_shlibs, $1)=no
6052 ;;
6053 esac
6054
6055 if test sni = "$host_vendor"; then
6056 case $host in
6057 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6058 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6059 ;;
6060 esac
6061 fi
6062 fi
6063 ])
6064 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6065 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6066
6067 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6068
6069 _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6070 _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6071 _LT_DECL([], [extract_expsyms_cmds], [2],
6072 [The commands to extract the exported symbol list from a shared archive])
6073
6074 #
6075 # Do we need to explicitly link libc?
6076 #
6077 case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6078 x|xyes)
6079 # Assume -lc should be added
6080 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6081
6082 if test yes,yes = "$GCC,$enable_shared"; then
6083 case $_LT_TAGVAR(archive_cmds, $1) in
6084 *'~'*)
6085 # FIXME: we may have to deal with multi-command sequences.
6086 ;;
6087 '$CC '*)
6088 # Test whether the compiler implicitly links with -lc since on some
6089 # systems, -lgcc has to come before -lc. If gcc already passes -lc
6090 # to ld, don't add -lc before -lgcc.
6091 AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6092 [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6093 [$RM conftest*
6094 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6095
6096 if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6097 soname=conftest
6098 lib=conftest
6099 libobjs=conftest.$ac_objext
6100 deplibs=
6101 wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6102 pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6103 compiler_flags=-v
6104 linker_flags=-v
6105 verstring=
6106 output_objdir=.
6107 libname=conftest
6108 lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6109 _LT_TAGVAR(allow_undefined_flag, $1)=
6110 if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6111 then
6112 lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6113 else
6114 lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6115 fi
6116 _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6117 else
6118 cat conftest.err 1>&5
6119 fi
6120 $RM conftest*
6121 ])
6122 _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6123 ;;
6124 esac
6125 fi
6126 ;;
6127 esac
6128
6129 _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6130 [Whether or not to add -lc for building shared libraries])
6131 _LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6132 [enable_shared_with_static_runtimes], [0],
6133 [Whether or not to disallow shared libs when runtime libs are static])
6134 _LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6135 [Compiler flag to allow reflexive dlopens])
6136 _LT_TAGDECL([], [whole_archive_flag_spec], [1],
6137 [Compiler flag to generate shared objects directly from archives])
6138 _LT_TAGDECL([], [compiler_needs_object], [1],
6139 [Whether the compiler copes with passing no objects directly])
6140 _LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6141 [Create an old-style archive from a shared archive])
6142 _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6143 [Create a temporary old-style archive to link instead of a shared archive])
6144 _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6145 _LT_TAGDECL([], [archive_expsym_cmds], [2])
6146 _LT_TAGDECL([], [module_cmds], [2],
6147 [Commands used to build a loadable module if different from building
6148 a shared archive.])
6149 _LT_TAGDECL([], [module_expsym_cmds], [2])
6150 _LT_TAGDECL([], [with_gnu_ld], [1],
6151 [Whether we are building with GNU ld or not])
6152 _LT_TAGDECL([], [allow_undefined_flag], [1],
6153 [Flag that allows shared libraries with undefined symbols to be built])
6154 _LT_TAGDECL([], [no_undefined_flag], [1],
6155 [Flag that enforces no undefined symbols])
6156 _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6157 [Flag to hardcode $libdir into a binary during linking.
6158 This must work even if $libdir does not exist])
6159 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
6160 [Whether we need a single "-rpath" flag with a separated argument])
6161 _LT_TAGDECL([], [hardcode_direct], [0],
6162 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6163 DIR into the resulting binary])
6164 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
6165 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6166 DIR into the resulting binary and the resulting library dependency is
6167 "absolute", i.e impossible to change by setting $shlibpath_var if the
6168 library is relocated])
6169 _LT_TAGDECL([], [hardcode_minus_L], [0],
6170 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6171 into the resulting binary])
6172 _LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6173 [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6174 into the resulting binary])
6175 _LT_TAGDECL([], [hardcode_automatic], [0],
6176 [Set to "yes" if building a shared library automatically hardcodes DIR
6177 into the library and all subsequent libraries and executables linked
6178 against it])
6179 _LT_TAGDECL([], [inherit_rpath], [0],
6180 [Set to yes if linker adds runtime paths of dependent libraries
6181 to runtime path list])
6182 _LT_TAGDECL([], [link_all_deplibs], [0],
6183 [Whether libtool must link a program against all its dependency libraries])
6184 _LT_TAGDECL([], [always_export_symbols], [0],
6185 [Set to "yes" if exported symbols are required])
6186 _LT_TAGDECL([], [export_symbols_cmds], [2],
6187 [The commands to list exported symbols])
6188 _LT_TAGDECL([], [exclude_expsyms], [1],
6189 [Symbols that should not be listed in the preloaded symbols])
6190 _LT_TAGDECL([], [include_expsyms], [1],
6191 [Symbols that must always be exported])
6192 _LT_TAGDECL([], [prelink_cmds], [2],
6193 [Commands necessary for linking programs (against libraries) with templates])
6194 _LT_TAGDECL([], [postlink_cmds], [2],
6195 [Commands necessary for finishing linking programs])
6196 _LT_TAGDECL([], [file_list_spec], [1],
6197 [Specify filename containing input files])
6198 dnl FIXME: Not yet implemented
6199 dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6200 dnl [Compiler flag to generate thread safe objects])
6201 ])# _LT_LINKER_SHLIBS
6202
6203
6204 # _LT_LANG_C_CONFIG([TAG])
6205 # ------------------------
6206 # Ensure that the configuration variables for a C compiler are suitably
6207 # defined. These variables are subsequently used by _LT_CONFIG to write
6208 # the compiler configuration to 'libtool'.
6209 m4_defun([_LT_LANG_C_CONFIG],
6210 [m4_require([_LT_DECL_EGREP])dnl
6211 lt_save_CC=$CC
6212 AC_LANG_PUSH(C)
6213
6214 # Source file extension for C test sources.
6215 ac_ext=c
6216
6217 # Object file extension for compiled C test sources.
6218 objext=o
6219 _LT_TAGVAR(objext, $1)=$objext
6220
6221 # Code to be used in simple compile tests
6222 lt_simple_compile_test_code="int some_variable = 0;"
6223
6224 # Code to be used in simple link tests
6225 lt_simple_link_test_code='int main(){return(0);}'
6226
6227 _LT_TAG_COMPILER
6228 # Save the default compiler, since it gets overwritten when the other
6229 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6230 compiler_DEFAULT=$CC
6231
6232 # save warnings/boilerplate of simple test code
6233 _LT_COMPILER_BOILERPLATE
6234 _LT_LINKER_BOILERPLATE
6235
6236 ## CAVEAT EMPTOR:
6237 ## There is no encapsulation within the following macros, do not change
6238 ## the running order or otherwise move them around unless you know exactly
6239 ## what you are doing...
6240 if test -n "$compiler"; then
6241 _LT_COMPILER_NO_RTTI($1)
6242 _LT_COMPILER_PIC($1)
6243 _LT_COMPILER_C_O($1)
6244 _LT_COMPILER_FILE_LOCKS($1)
6245 _LT_LINKER_SHLIBS($1)
6246 _LT_SYS_DYNAMIC_LINKER($1)
6247 _LT_LINKER_HARDCODE_LIBPATH($1)
6248 LT_SYS_DLOPEN_SELF
6249 _LT_CMD_STRIPLIB
6250
6251 # Report what library types will actually be built
6252 AC_MSG_CHECKING([if libtool supports shared libraries])
6253 AC_MSG_RESULT([$can_build_shared])
6254
6255 AC_MSG_CHECKING([whether to build shared libraries])
6256 test no = "$can_build_shared" && enable_shared=no
6257
6258 # On AIX, shared libraries and static libraries use the same namespace, and
6259 # are all built from PIC.
6260 case $host_os in
6261 aix3*)
6262 test yes = "$enable_shared" && enable_static=no
6263 if test -n "$RANLIB"; then
6264 archive_cmds="$archive_cmds~\$RANLIB \$lib"
6265 postinstall_cmds='$RANLIB $lib'
6266 fi
6267 ;;
6268
6269 aix[[4-9]]*)
6270 if test ia64 != "$host_cpu"; then
6271 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6272 yes,aix,yes) ;; # shared object as lib.so file only
6273 yes,svr4,*) ;; # shared object as lib.so archive member only
6274 yes,*) enable_static=no ;; # shared object in lib.a archive as well
6275 esac
6276 fi
6277 ;;
6278 esac
6279 AC_MSG_RESULT([$enable_shared])
6280
6281 AC_MSG_CHECKING([whether to build static libraries])
6282 # Make sure either enable_shared or enable_static is yes.
6283 test yes = "$enable_shared" || enable_static=yes
6284 AC_MSG_RESULT([$enable_static])
6285
6286 _LT_CONFIG($1)
6287 fi
6288 AC_LANG_POP
6289 CC=$lt_save_CC
6290 ])# _LT_LANG_C_CONFIG
6291
6292
6293 # _LT_LANG_CXX_CONFIG([TAG])
6294 # --------------------------
6295 # Ensure that the configuration variables for a C++ compiler are suitably
6296 # defined. These variables are subsequently used by _LT_CONFIG to write
6297 # the compiler configuration to 'libtool'.
6298 m4_defun([_LT_LANG_CXX_CONFIG],
6299 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6300 m4_require([_LT_DECL_EGREP])dnl
6301 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6302 if test -n "$CXX" && ( test no != "$CXX" &&
6303 ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6304 (test g++ != "$CXX"))); then
6305 AC_PROG_CXXCPP
6306 else
6307 _lt_caught_CXX_error=yes
6308 fi
6309
6310 AC_LANG_PUSH(C++)
6311 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6312 _LT_TAGVAR(allow_undefined_flag, $1)=
6313 _LT_TAGVAR(always_export_symbols, $1)=no
6314 _LT_TAGVAR(archive_expsym_cmds, $1)=
6315 _LT_TAGVAR(compiler_needs_object, $1)=no
6316 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
6317 _LT_TAGVAR(hardcode_direct, $1)=no
6318 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6319 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6320 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6321 _LT_TAGVAR(hardcode_minus_L, $1)=no
6322 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6323 _LT_TAGVAR(hardcode_automatic, $1)=no
6324 _LT_TAGVAR(inherit_rpath, $1)=no
6325 _LT_TAGVAR(module_cmds, $1)=
6326 _LT_TAGVAR(module_expsym_cmds, $1)=
6327 _LT_TAGVAR(link_all_deplibs, $1)=unknown
6328 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6329 _LT_TAGVAR(reload_flag, $1)=$reload_flag
6330 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6331 _LT_TAGVAR(no_undefined_flag, $1)=
6332 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6333 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6334
6335 # Source file extension for C++ test sources.
6336 ac_ext=cpp
6337
6338 # Object file extension for compiled C++ test sources.
6339 objext=o
6340 _LT_TAGVAR(objext, $1)=$objext
6341
6342 # No sense in running all these tests if we already determined that
6343 # the CXX compiler isn't working. Some variables (like enable_shared)
6344 # are currently assumed to apply to all compilers on this platform,
6345 # and will be corrupted by setting them based on a non-working compiler.
6346 if test yes != "$_lt_caught_CXX_error"; then
6347 # Code to be used in simple compile tests
6348 lt_simple_compile_test_code="int some_variable = 0;"
6349
6350 # Code to be used in simple link tests
6351 lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6352
6353 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6354 _LT_TAG_COMPILER
6355
6356 # save warnings/boilerplate of simple test code
6357 _LT_COMPILER_BOILERPLATE
6358 _LT_LINKER_BOILERPLATE
6359
6360 # Allow CC to be a program name with arguments.
6361 lt_save_CC=$CC
6362 lt_save_CFLAGS=$CFLAGS
6363 lt_save_LD=$LD
6364 lt_save_GCC=$GCC
6365 GCC=$GXX
6366 lt_save_with_gnu_ld=$with_gnu_ld
6367 lt_save_path_LD=$lt_cv_path_LD
6368 if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6369 lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6370 else
6371 $as_unset lt_cv_prog_gnu_ld
6372 fi
6373 if test -n "${lt_cv_path_LDCXX+set}"; then
6374 lt_cv_path_LD=$lt_cv_path_LDCXX
6375 else
6376 $as_unset lt_cv_path_LD
6377 fi
6378 test -z "${LDCXX+set}" || LD=$LDCXX
6379 CC=${CXX-"c++"}
6380 CFLAGS=$CXXFLAGS
6381 compiler=$CC
6382 _LT_TAGVAR(compiler, $1)=$CC
6383 _LT_CC_BASENAME([$compiler])
6384
6385 if test -n "$compiler"; then
6386 # We don't want -fno-exception when compiling C++ code, so set the
6387 # no_builtin_flag separately
6388 if test yes = "$GXX"; then
6389 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6390 else
6391 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6392 fi
6393
6394 if test yes = "$GXX"; then
6395 # Set up default GNU C++ configuration
6396
6397 LT_PATH_LD
6398
6399 # Check if GNU C++ uses GNU ld as the underlying linker, since the
6400 # archiving commands below assume that GNU ld is being used.
6401 if test yes = "$with_gnu_ld"; then
6402 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6403 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6404
6405 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6406 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6407
6408 # If archive_cmds runs LD, not CC, wlarc should be empty
6409 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6410 # investigate it a little bit more. (MM)
6411 wlarc='$wl'
6412
6413 # ancient GNU ld didn't support --whole-archive et. al.
6414 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6415 $GREP 'no-whole-archive' > /dev/null; then
6416 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6417 else
6418 _LT_TAGVAR(whole_archive_flag_spec, $1)=
6419 fi
6420 else
6421 with_gnu_ld=no
6422 wlarc=
6423
6424 # A generic and very simple default shared library creation
6425 # command for GNU C++ for the case where it uses the native
6426 # linker, instead of GNU ld. If possible, this setting should
6427 # overridden to take advantage of the native linker features on
6428 # the platform it is being used on.
6429 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6430 fi
6431
6432 # Commands to make compiler produce verbose output that lists
6433 # what "hidden" libraries, object files and flags are used when
6434 # linking a shared library.
6435 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6436
6437 else
6438 GXX=no
6439 with_gnu_ld=no
6440 wlarc=
6441 fi
6442
6443 # PORTME: fill in a description of your system's C++ link characteristics
6444 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6445 _LT_TAGVAR(ld_shlibs, $1)=yes
6446 case $host_os in
6447 aix3*)
6448 # FIXME: insert proper C++ library support
6449 _LT_TAGVAR(ld_shlibs, $1)=no
6450 ;;
6451 aix[[4-9]]*)
6452 if test ia64 = "$host_cpu"; then
6453 # On IA64, the linker does run time linking by default, so we don't
6454 # have to do anything special.
6455 aix_use_runtimelinking=no
6456 exp_sym_flag='-Bexport'
6457 no_entry_flag=
6458 else
6459 aix_use_runtimelinking=no
6460
6461 # Test if we are trying to use run time linking or normal
6462 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6463 # have runtime linking enabled, and use it for executables.
6464 # For shared libraries, we enable/disable runtime linking
6465 # depending on the kind of the shared library created -
6466 # when "with_aix_soname,aix_use_runtimelinking" is:
6467 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
6468 # "aix,yes" lib.so shared, rtl:yes, for executables
6469 # lib.a static archive
6470 # "both,no" lib.so.V(shr.o) shared, rtl:yes
6471 # lib.a(lib.so.V) shared, rtl:no, for executables
6472 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6473 # lib.a(lib.so.V) shared, rtl:no
6474 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
6475 # lib.a static archive
6476 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6477 for ld_flag in $LDFLAGS; do
6478 case $ld_flag in
6479 *-brtl*)
6480 aix_use_runtimelinking=yes
6481 break
6482 ;;
6483 esac
6484 done
6485 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6486 # With aix-soname=svr4, we create the lib.so.V shared archives only,
6487 # so we don't have lib.a shared libs to link our executables.
6488 # We have to force runtime linking in this case.
6489 aix_use_runtimelinking=yes
6490 LDFLAGS="$LDFLAGS -Wl,-brtl"
6491 fi
6492 ;;
6493 esac
6494
6495 exp_sym_flag='-bexport'
6496 no_entry_flag='-bnoentry'
6497 fi
6498
6499 # When large executables or shared objects are built, AIX ld can
6500 # have problems creating the table of contents. If linking a library
6501 # or program results in "error TOC overflow" add -mminimal-toc to
6502 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
6503 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6504
6505 _LT_TAGVAR(archive_cmds, $1)=''
6506 _LT_TAGVAR(hardcode_direct, $1)=yes
6507 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6508 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6509 _LT_TAGVAR(link_all_deplibs, $1)=yes
6510 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6511 case $with_aix_soname,$aix_use_runtimelinking in
6512 aix,*) ;; # no import file
6513 svr4,* | *,yes) # use import file
6514 # The Import File defines what to hardcode.
6515 _LT_TAGVAR(hardcode_direct, $1)=no
6516 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6517 ;;
6518 esac
6519
6520 if test yes = "$GXX"; then
6521 case $host_os in aix4.[[012]]|aix4.[[012]].*)
6522 # We only want to do this on AIX 4.2 and lower, the check
6523 # below for broken collect2 doesn't work under 4.3+
6524 collect2name=`$CC -print-prog-name=collect2`
6525 if test -f "$collect2name" &&
6526 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6527 then
6528 # We have reworked collect2
6529 :
6530 else
6531 # We have old collect2
6532 _LT_TAGVAR(hardcode_direct, $1)=unsupported
6533 # It fails to find uninstalled libraries when the uninstalled
6534 # path is not listed in the libpath. Setting hardcode_minus_L
6535 # to unsupported forces relinking
6536 _LT_TAGVAR(hardcode_minus_L, $1)=yes
6537 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6538 _LT_TAGVAR(hardcode_libdir_separator, $1)=
6539 fi
6540 esac
6541 shared_flag='-shared'
6542 if test yes = "$aix_use_runtimelinking"; then
6543 shared_flag=$shared_flag' $wl-G'
6544 fi
6545 # Need to ensure runtime linking is disabled for the traditional
6546 # shared library, or the linker may eventually find shared libraries
6547 # /with/ Import File - we do not want to mix them.
6548 shared_flag_aix='-shared'
6549 shared_flag_svr4='-shared $wl-G'
6550 else
6551 # not using gcc
6552 if test ia64 = "$host_cpu"; then
6553 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6554 # chokes on -Wl,-G. The following line is correct:
6555 shared_flag='-G'
6556 else
6557 if test yes = "$aix_use_runtimelinking"; then
6558 shared_flag='$wl-G'
6559 else
6560 shared_flag='$wl-bM:SRE'
6561 fi
6562 shared_flag_aix='$wl-bM:SRE'
6563 shared_flag_svr4='$wl-G'
6564 fi
6565 fi
6566
6567 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6568 # It seems that -bexpall does not export symbols beginning with
6569 # underscore (_), so it is better to generate a list of symbols to
6570 # export.
6571 _LT_TAGVAR(always_export_symbols, $1)=yes
6572 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6573 # Warning - without using the other runtime loading flags (-brtl),
6574 # -berok will link without error, but may produce a broken library.
6575 # The "-G" linker flag allows undefined symbols.
6576 _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6577 # Determine the default libpath from the value encoded in an empty
6578 # executable.
6579 _LT_SYS_MODULE_PATH_AIX([$1])
6580 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6581
6582 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
6583 else
6584 if test ia64 = "$host_cpu"; then
6585 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6586 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6587 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
6588 else
6589 # Determine the default libpath from the value encoded in an
6590 # empty executable.
6591 _LT_SYS_MODULE_PATH_AIX([$1])
6592 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6593 # Warning - without using the other run time loading flags,
6594 # -berok will link without error, but may produce a broken library.
6595 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6596 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6597 if test yes = "$with_gnu_ld"; then
6598 # We only use this code for GNU lds that support --whole-archive.
6599 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6600 else
6601 # Exported symbols can be pulled into shared objects from archives
6602 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6603 fi
6604 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6605 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6606 # -brtl affects multiple linker settings, -berok does not and is overridden later
6607 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6608 if test svr4 != "$with_aix_soname"; then
6609 # This is similar to how AIX traditionally builds its shared
6610 # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6611 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
6612 fi
6613 if test aix != "$with_aix_soname"; then
6614 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
6615 else
6616 # used by -dlpreopen to get the symbols
6617 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
6618 fi
6619 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6620 fi
6621 fi
6622 ;;
6623
6624 beos*)
6625 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6626 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6627 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6628 # support --undefined. This deserves some investigation. FIXME
6629 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6630 else
6631 _LT_TAGVAR(ld_shlibs, $1)=no
6632 fi
6633 ;;
6634
6635 chorus*)
6636 case $cc_basename in
6637 *)
6638 # FIXME: insert proper C++ library support
6639 _LT_TAGVAR(ld_shlibs, $1)=no
6640 ;;
6641 esac
6642 ;;
6643
6644 cygwin* | mingw* | pw32* | cegcc*)
6645 case $GXX,$cc_basename in
6646 ,cl* | no,cl*)
6647 # Native MSVC
6648 # hardcode_libdir_flag_spec is actually meaningless, as there is
6649 # no search path for DLLs.
6650 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6651 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6652 _LT_TAGVAR(always_export_symbols, $1)=yes
6653 _LT_TAGVAR(file_list_spec, $1)='@'
6654 # Tell ltmain to make .lib files, not .a files.
6655 libext=lib
6656 # Tell ltmain to make .dll files, not .so files.
6657 shrext_cmds=.dll
6658 # FIXME: Setting linknames here is a bad hack.
6659 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6660 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6661 cp "$export_symbols" "$output_objdir/$soname.def";
6662 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6663 else
6664 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6665 fi~
6666 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6667 linknames='
6668 # The linker will not automatically build a static lib if we build a DLL.
6669 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6670 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6671 # Don't use ranlib
6672 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6673 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6674 lt_tool_outputfile="@TOOL_OUTPUT@"~
6675 case $lt_outputfile in
6676 *.exe|*.EXE) ;;
6677 *)
6678 lt_outputfile=$lt_outputfile.exe
6679 lt_tool_outputfile=$lt_tool_outputfile.exe
6680 ;;
6681 esac~
6682 func_to_tool_file "$lt_outputfile"~
6683 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6684 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6685 $RM "$lt_outputfile.manifest";
6686 fi'
6687 ;;
6688 *)
6689 # g++
6690 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6691 # as there is no search path for DLLs.
6692 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6693 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6694 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6695 _LT_TAGVAR(always_export_symbols, $1)=no
6696 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6697
6698 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6699 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6700 # If the export-symbols file already is a .def file, use it as
6701 # is; otherwise, prepend EXPORTS...
6702 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6703 cp $export_symbols $output_objdir/$soname.def;
6704 else
6705 echo EXPORTS > $output_objdir/$soname.def;
6706 cat $export_symbols >> $output_objdir/$soname.def;
6707 fi~
6708 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6709 else
6710 _LT_TAGVAR(ld_shlibs, $1)=no
6711 fi
6712 ;;
6713 esac
6714 ;;
6715 darwin* | rhapsody*)
6716 _LT_DARWIN_LINKER_FEATURES($1)
6717 ;;
6718
6719 os2*)
6720 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6721 _LT_TAGVAR(hardcode_minus_L, $1)=yes
6722 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6723 shrext_cmds=.dll
6724 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6725 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6726 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6727 $ECHO EXPORTS >> $output_objdir/$libname.def~
6728 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6729 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6730 emximp -o $lib $output_objdir/$libname.def'
6731 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6732 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6733 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6734 $ECHO EXPORTS >> $output_objdir/$libname.def~
6735 prefix_cmds="$SED"~
6736 if test EXPORTS = "`$SED 1q $export_symbols`"; then
6737 prefix_cmds="$prefix_cmds -e 1d";
6738 fi~
6739 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6740 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6741 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6742 emximp -o $lib $output_objdir/$libname.def'
6743 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6744 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6745 ;;
6746
6747 dgux*)
6748 case $cc_basename in
6749 ec++*)
6750 # FIXME: insert proper C++ library support
6751 _LT_TAGVAR(ld_shlibs, $1)=no
6752 ;;
6753 ghcx*)
6754 # Green Hills C++ Compiler
6755 # FIXME: insert proper C++ library support
6756 _LT_TAGVAR(ld_shlibs, $1)=no
6757 ;;
6758 *)
6759 # FIXME: insert proper C++ library support
6760 _LT_TAGVAR(ld_shlibs, $1)=no
6761 ;;
6762 esac
6763 ;;
6764
6765 freebsd2.*)
6766 # C++ shared libraries reported to be fairly broken before
6767 # switch to ELF
6768 _LT_TAGVAR(ld_shlibs, $1)=no
6769 ;;
6770
6771 freebsd-elf*)
6772 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6773 ;;
6774
6775 freebsd* | dragonfly*)
6776 # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6777 # conventions
6778 _LT_TAGVAR(ld_shlibs, $1)=yes
6779 ;;
6780
6781 haiku*)
6782 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6783 _LT_TAGVAR(link_all_deplibs, $1)=yes
6784 ;;
6785
6786 hpux9*)
6787 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6788 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6789 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6790 _LT_TAGVAR(hardcode_direct, $1)=yes
6791 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6792 # but as the default
6793 # location of the library.
6794
6795 case $cc_basename in
6796 CC*)
6797 # FIXME: insert proper C++ library support
6798 _LT_TAGVAR(ld_shlibs, $1)=no
6799 ;;
6800 aCC*)
6801 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6802 # Commands to make compiler produce verbose output that lists
6803 # what "hidden" libraries, object files and flags are used when
6804 # linking a shared library.
6805 #
6806 # There doesn't appear to be a way to prevent this compiler from
6807 # explicitly linking system object files so we need to strip them
6808 # from the output so that they don't get included in the library
6809 # dependencies.
6810 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6811 ;;
6812 *)
6813 if test yes = "$GXX"; then
6814 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6815 else
6816 # FIXME: insert proper C++ library support
6817 _LT_TAGVAR(ld_shlibs, $1)=no
6818 fi
6819 ;;
6820 esac
6821 ;;
6822
6823 hpux10*|hpux11*)
6824 if test no = "$with_gnu_ld"; then
6825 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6826 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6827
6828 case $host_cpu in
6829 hppa*64*|ia64*)
6830 ;;
6831 *)
6832 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6833 ;;
6834 esac
6835 fi
6836 case $host_cpu in
6837 hppa*64*|ia64*)
6838 _LT_TAGVAR(hardcode_direct, $1)=no
6839 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6840 ;;
6841 *)
6842 _LT_TAGVAR(hardcode_direct, $1)=yes
6843 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6844 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6845 # but as the default
6846 # location of the library.
6847 ;;
6848 esac
6849
6850 case $cc_basename in
6851 CC*)
6852 # FIXME: insert proper C++ library support
6853 _LT_TAGVAR(ld_shlibs, $1)=no
6854 ;;
6855 aCC*)
6856 case $host_cpu in
6857 hppa*64*)
6858 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6859 ;;
6860 ia64*)
6861 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6862 ;;
6863 *)
6864 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6865 ;;
6866 esac
6867 # Commands to make compiler produce verbose output that lists
6868 # what "hidden" libraries, object files and flags are used when
6869 # linking a shared library.
6870 #
6871 # There doesn't appear to be a way to prevent this compiler from
6872 # explicitly linking system object files so we need to strip them
6873 # from the output so that they don't get included in the library
6874 # dependencies.
6875 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6876 ;;
6877 *)
6878 if test yes = "$GXX"; then
6879 if test no = "$with_gnu_ld"; then
6880 case $host_cpu in
6881 hppa*64*)
6882 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6883 ;;
6884 ia64*)
6885 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6886 ;;
6887 *)
6888 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6889 ;;
6890 esac
6891 fi
6892 else
6893 # FIXME: insert proper C++ library support
6894 _LT_TAGVAR(ld_shlibs, $1)=no
6895 fi
6896 ;;
6897 esac
6898 ;;
6899
6900 interix[[3-9]]*)
6901 _LT_TAGVAR(hardcode_direct, $1)=no
6902 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6903 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6904 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6905 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6906 # Instead, shared libraries are loaded at an image base (0x10000000 by
6907 # default) and relocated if they conflict, which is a slow very memory
6908 # consuming and fragmenting process. To avoid this, we pick a random,
6909 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6910 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
6911 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6912 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6913 ;;
6914 irix5* | irix6*)
6915 case $cc_basename in
6916 CC*)
6917 # SGI C++
6918 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
6919
6920 # Archives containing C++ object files must be created using
6921 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
6922 # necessary to make sure instantiated templates are included
6923 # in the archive.
6924 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6925 ;;
6926 *)
6927 if test yes = "$GXX"; then
6928 if test no = "$with_gnu_ld"; then
6929 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
6930 else
6931 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
6932 fi
6933 fi
6934 _LT_TAGVAR(link_all_deplibs, $1)=yes
6935 ;;
6936 esac
6937 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6938 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6939 _LT_TAGVAR(inherit_rpath, $1)=yes
6940 ;;
6941
6942 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6943 case $cc_basename in
6944 KCC*)
6945 # Kuck and Associates, Inc. (KAI) C++ Compiler
6946
6947 # KCC will only create a shared library if the output file
6948 # ends with ".so" (or ".sl" for HP-UX), so rename the library
6949 # to its proper name (with version) after linking.
6950 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6951 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
6952 # Commands to make compiler produce verbose output that lists
6953 # what "hidden" libraries, object files and flags are used when
6954 # linking a shared library.
6955 #
6956 # There doesn't appear to be a way to prevent this compiler from
6957 # explicitly linking system object files so we need to strip them
6958 # from the output so that they don't get included in the library
6959 # dependencies.
6960 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6961
6962 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6963 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6964
6965 # Archives containing C++ object files must be created using
6966 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6967 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6968 ;;
6969 icpc* | ecpc* )
6970 # Intel C++
6971 with_gnu_ld=yes
6972 # version 8.0 and above of icpc choke on multiply defined symbols
6973 # if we add $predep_objects and $postdep_objects, however 7.1 and
6974 # earlier do not add the objects themselves.
6975 case `$CC -V 2>&1` in
6976 *"Version 7."*)
6977 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6978 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6979 ;;
6980 *) # Version 8.0 or newer
6981 tmp_idyn=
6982 case $host_cpu in
6983 ia64*) tmp_idyn=' -i_dynamic';;
6984 esac
6985 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6986 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6987 ;;
6988 esac
6989 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6990 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6991 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6992 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6993 ;;
6994 pgCC* | pgcpp*)
6995 # Portland Group C++ compiler
6996 case `$CC -V` in
6997 *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6998 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6999 rm -rf $tpldir~
7000 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7001 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7002 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7003 rm -rf $tpldir~
7004 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7005 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7006 $RANLIB $oldlib'
7007 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7008 rm -rf $tpldir~
7009 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7010 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7011 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7012 rm -rf $tpldir~
7013 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7014 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
7015 ;;
7016 *) # Version 6 and above use weak symbols
7017 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7018 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
7019 ;;
7020 esac
7021
7022 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7023 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7024 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
7025 ;;
7026 cxx*)
7027 # Compaq C++
7028 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7029 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
7030
7031 runpath_var=LD_RUN_PATH
7032 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7033 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7034
7035 # Commands to make compiler produce verbose output that lists
7036 # what "hidden" libraries, object files and flags are used when
7037 # linking a shared library.
7038 #
7039 # There doesn't appear to be a way to prevent this compiler from
7040 # explicitly linking system object files so we need to strip them
7041 # from the output so that they don't get included in the library
7042 # dependencies.
7043 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
7044 ;;
7045 xl* | mpixl* | bgxl*)
7046 # IBM XL 8.0 on PPC, with GNU ld
7047 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7048 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7049 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7050 if test yes = "$supports_anon_versioning"; then
7051 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7052 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7053 echo "local: *; };" >> $output_objdir/$libname.ver~
7054 $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7055 fi
7056 ;;
7057 *)
7058 case `$CC -V 2>&1 | sed 5q` in
7059 *Sun\ C*)
7060 # Sun C++ 5.9
7061 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7062 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7063 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
7064 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7065 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
7066 _LT_TAGVAR(compiler_needs_object, $1)=yes
7067
7068 # Not sure whether something based on
7069 # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7070 # would be better.
7071 output_verbose_link_cmd='func_echo_all'
7072
7073 # Archives containing C++ object files must be created using
7074 # "CC -xar", where "CC" is the Sun C++ compiler. This is
7075 # necessary to make sure instantiated templates are included
7076 # in the archive.
7077 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7078 ;;
7079 esac
7080 ;;
7081 esac
7082 ;;
7083
7084 lynxos*)
7085 # FIXME: insert proper C++ library support
7086 _LT_TAGVAR(ld_shlibs, $1)=no
7087 ;;
7088
7089 m88k*)
7090 # FIXME: insert proper C++ library support
7091 _LT_TAGVAR(ld_shlibs, $1)=no
7092 ;;
7093
7094 mvs*)
7095 case $cc_basename in
7096 cxx*)
7097 # FIXME: insert proper C++ library support
7098 _LT_TAGVAR(ld_shlibs, $1)=no
7099 ;;
7100 *)
7101 # FIXME: insert proper C++ library support
7102 _LT_TAGVAR(ld_shlibs, $1)=no
7103 ;;
7104 esac
7105 ;;
7106
7107 netbsd*)
7108 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7109 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7110 wlarc=
7111 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7112 _LT_TAGVAR(hardcode_direct, $1)=yes
7113 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7114 fi
7115 # Workaround some broken pre-1.5 toolchains
7116 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7117 ;;
7118
7119 *nto* | *qnx*)
7120 _LT_TAGVAR(ld_shlibs, $1)=yes
7121 ;;
7122
7123 openbsd* | bitrig*)
7124 if test -f /usr/libexec/ld.so; then
7125 _LT_TAGVAR(hardcode_direct, $1)=yes
7126 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7127 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7128 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7129 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7130 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7131 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
7132 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7133 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7134 fi
7135 output_verbose_link_cmd=func_echo_all
7136 else
7137 _LT_TAGVAR(ld_shlibs, $1)=no
7138 fi
7139 ;;
7140
7141 osf3* | osf4* | osf5*)
7142 case $cc_basename in
7143 KCC*)
7144 # Kuck and Associates, Inc. (KAI) C++ Compiler
7145
7146 # KCC will only create a shared library if the output file
7147 # ends with ".so" (or ".sl" for HP-UX), so rename the library
7148 # to its proper name (with version) after linking.
7149 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7150
7151 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7152 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7153
7154 # Archives containing C++ object files must be created using
7155 # the KAI C++ compiler.
7156 case $host in
7157 osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7158 *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7159 esac
7160 ;;
7161 RCC*)
7162 # Rational C++ 2.4.1
7163 # FIXME: insert proper C++ library support
7164 _LT_TAGVAR(ld_shlibs, $1)=no
7165 ;;
7166 cxx*)
7167 case $host in
7168 osf3*)
7169 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7170 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7171 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7172 ;;
7173 *)
7174 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7175 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7176 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7177 echo "-hidden">> $lib.exp~
7178 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
7179 $RM $lib.exp'
7180 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7181 ;;
7182 esac
7183
7184 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7185
7186 # Commands to make compiler produce verbose output that lists
7187 # what "hidden" libraries, object files and flags are used when
7188 # linking a shared library.
7189 #
7190 # There doesn't appear to be a way to prevent this compiler from
7191 # explicitly linking system object files so we need to strip them
7192 # from the output so that they don't get included in the library
7193 # dependencies.
7194 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7195 ;;
7196 *)
7197 if test yes,no = "$GXX,$with_gnu_ld"; then
7198 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7199 case $host in
7200 osf3*)
7201 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7202 ;;
7203 *)
7204 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7205 ;;
7206 esac
7207
7208 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7209 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7210
7211 # Commands to make compiler produce verbose output that lists
7212 # what "hidden" libraries, object files and flags are used when
7213 # linking a shared library.
7214 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7215
7216 else
7217 # FIXME: insert proper C++ library support
7218 _LT_TAGVAR(ld_shlibs, $1)=no
7219 fi
7220 ;;
7221 esac
7222 ;;
7223
7224 psos*)
7225 # FIXME: insert proper C++ library support
7226 _LT_TAGVAR(ld_shlibs, $1)=no
7227 ;;
7228
7229 sunos4*)
7230 case $cc_basename in
7231 CC*)
7232 # Sun C++ 4.x
7233 # FIXME: insert proper C++ library support
7234 _LT_TAGVAR(ld_shlibs, $1)=no
7235 ;;
7236 lcc*)
7237 # Lucid
7238 # FIXME: insert proper C++ library support
7239 _LT_TAGVAR(ld_shlibs, $1)=no
7240 ;;
7241 *)
7242 # FIXME: insert proper C++ library support
7243 _LT_TAGVAR(ld_shlibs, $1)=no
7244 ;;
7245 esac
7246 ;;
7247
7248 solaris*)
7249 case $cc_basename in
7250 CC* | sunCC*)
7251 # Sun C++ 4.2, 5.x and Centerline C++
7252 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7253 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7254 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7255 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7256 $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7257
7258 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7259 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7260 case $host_os in
7261 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7262 *)
7263 # The compiler driver will combine and reorder linker options,
7264 # but understands '-z linker_flag'.
7265 # Supported since Solaris 2.6 (maybe 2.5.1?)
7266 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7267 ;;
7268 esac
7269 _LT_TAGVAR(link_all_deplibs, $1)=yes
7270
7271 output_verbose_link_cmd='func_echo_all'
7272
7273 # Archives containing C++ object files must be created using
7274 # "CC -xar", where "CC" is the Sun C++ compiler. This is
7275 # necessary to make sure instantiated templates are included
7276 # in the archive.
7277 _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7278 ;;
7279 gcx*)
7280 # Green Hills C++ Compiler
7281 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7282
7283 # The C++ compiler must be used to create the archive.
7284 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7285 ;;
7286 *)
7287 # GNU C++ compiler with Solaris linker
7288 if test yes,no = "$GXX,$with_gnu_ld"; then
7289 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7290 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7291 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7292 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7293 $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7294
7295 # Commands to make compiler produce verbose output that lists
7296 # what "hidden" libraries, object files and flags are used when
7297 # linking a shared library.
7298 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7299 else
7300 # g++ 2.7 appears to require '-G' NOT '-shared' on this
7301 # platform.
7302 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7303 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7304 $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7305
7306 # Commands to make compiler produce verbose output that lists
7307 # what "hidden" libraries, object files and flags are used when
7308 # linking a shared library.
7309 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7310 fi
7311
7312 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7313 case $host_os in
7314 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7315 *)
7316 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7317 ;;
7318 esac
7319 fi
7320 ;;
7321 esac
7322 ;;
7323
7324 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7325 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7326 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7327 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7328 runpath_var='LD_RUN_PATH'
7329
7330 case $cc_basename in
7331 CC*)
7332 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7333 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7334 ;;
7335 *)
7336 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7337 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7338 ;;
7339 esac
7340 ;;
7341
7342 sysv5* | sco3.2v5* | sco5v6*)
7343 # Note: We CANNOT use -z defs as we might desire, because we do not
7344 # link with -lc, and that would cause any symbols used from libc to
7345 # always be unresolved, which means just about no library would
7346 # ever link correctly. If we're not using GNU ld we use -z text
7347 # though, which does catch some bad symbols but isn't as heavy-handed
7348 # as -z defs.
7349 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7350 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7351 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7352 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7353 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7354 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7355 _LT_TAGVAR(link_all_deplibs, $1)=yes
7356 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7357 runpath_var='LD_RUN_PATH'
7358
7359 case $cc_basename in
7360 CC*)
7361 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7362 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7363 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7364 '"$_LT_TAGVAR(old_archive_cmds, $1)"
7365 _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7366 '"$_LT_TAGVAR(reload_cmds, $1)"
7367 ;;
7368 *)
7369 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7370 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7371 ;;
7372 esac
7373 ;;
7374
7375 tandem*)
7376 case $cc_basename in
7377 NCC*)
7378 # NonStop-UX NCC 3.20
7379 # FIXME: insert proper C++ library support
7380 _LT_TAGVAR(ld_shlibs, $1)=no
7381 ;;
7382 *)
7383 # FIXME: insert proper C++ library support
7384 _LT_TAGVAR(ld_shlibs, $1)=no
7385 ;;
7386 esac
7387 ;;
7388
7389 vxworks*)
7390 # FIXME: insert proper C++ library support
7391 _LT_TAGVAR(ld_shlibs, $1)=no
7392 ;;
7393
7394 *)
7395 # FIXME: insert proper C++ library support
7396 _LT_TAGVAR(ld_shlibs, $1)=no
7397 ;;
7398 esac
7399
7400 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7401 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7402
7403 _LT_TAGVAR(GCC, $1)=$GXX
7404 _LT_TAGVAR(LD, $1)=$LD
7405
7406 ## CAVEAT EMPTOR:
7407 ## There is no encapsulation within the following macros, do not change
7408 ## the running order or otherwise move them around unless you know exactly
7409 ## what you are doing...
7410 _LT_SYS_HIDDEN_LIBDEPS($1)
7411 _LT_COMPILER_PIC($1)
7412 _LT_COMPILER_C_O($1)
7413 _LT_COMPILER_FILE_LOCKS($1)
7414 _LT_LINKER_SHLIBS($1)
7415 _LT_SYS_DYNAMIC_LINKER($1)
7416 _LT_LINKER_HARDCODE_LIBPATH($1)
7417
7418 _LT_CONFIG($1)
7419 fi # test -n "$compiler"
7420
7421 CC=$lt_save_CC
7422 CFLAGS=$lt_save_CFLAGS
7423 LDCXX=$LD
7424 LD=$lt_save_LD
7425 GCC=$lt_save_GCC
7426 with_gnu_ld=$lt_save_with_gnu_ld
7427 lt_cv_path_LDCXX=$lt_cv_path_LD
7428 lt_cv_path_LD=$lt_save_path_LD
7429 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7430 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7431 fi # test yes != "$_lt_caught_CXX_error"
7432
7433 AC_LANG_POP
7434 ])# _LT_LANG_CXX_CONFIG
7435
7436
7437 # _LT_FUNC_STRIPNAME_CNF
7438 # ----------------------
7439 # func_stripname_cnf prefix suffix name
7440 # strip PREFIX and SUFFIX off of NAME.
7441 # PREFIX and SUFFIX must not contain globbing or regex special
7442 # characters, hashes, percent signs, but SUFFIX may contain a leading
7443 # dot (in which case that matches only a dot).
7444 #
7445 # This function is identical to the (non-XSI) version of func_stripname,
7446 # except this one can be used by m4 code that may be executed by configure,
7447 # rather than the libtool script.
7448 m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7449 AC_REQUIRE([_LT_DECL_SED])
7450 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7451 func_stripname_cnf ()
7452 {
7453 case @S|@2 in
7454 .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7455 *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7456 esac
7457 } # func_stripname_cnf
7458 ])# _LT_FUNC_STRIPNAME_CNF
7459
7460
7461 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7462 # ---------------------------------
7463 # Figure out "hidden" library dependencies from verbose
7464 # compiler output when linking a shared library.
7465 # Parse the compiler output and extract the necessary
7466 # objects, libraries and library flags.
7467 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7468 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7469 AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7470 # Dependencies to place before and after the object being linked:
7471 _LT_TAGVAR(predep_objects, $1)=
7472 _LT_TAGVAR(postdep_objects, $1)=
7473 _LT_TAGVAR(predeps, $1)=
7474 _LT_TAGVAR(postdeps, $1)=
7475 _LT_TAGVAR(compiler_lib_search_path, $1)=
7476
7477 dnl we can't use the lt_simple_compile_test_code here,
7478 dnl because it contains code intended for an executable,
7479 dnl not a library. It's possible we should let each
7480 dnl tag define a new lt_????_link_test_code variable,
7481 dnl but it's only used here...
7482 m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7483 int a;
7484 void foo (void) { a = 0; }
7485 _LT_EOF
7486 ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7487 class Foo
7488 {
7489 public:
7490 Foo (void) { a = 0; }
7491 private:
7492 int a;
7493 };
7494 _LT_EOF
7495 ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7496 subroutine foo
7497 implicit none
7498 integer*4 a
7499 a=0
7500 return
7501 end
7502 _LT_EOF
7503 ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7504 subroutine foo
7505 implicit none
7506 integer a
7507 a=0
7508 return
7509 end
7510 _LT_EOF
7511 ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7512 public class foo {
7513 private int a;
7514 public void bar (void) {
7515 a = 0;
7516 }
7517 };
7518 _LT_EOF
7519 ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7520 package foo
7521 func foo() {
7522 }
7523 _LT_EOF
7524 ])
7525
7526 _lt_libdeps_save_CFLAGS=$CFLAGS
7527 case "$CC $CFLAGS " in #(
7528 *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7529 *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7530 *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7531 esac
7532
7533 dnl Parse the compiler output and extract the necessary
7534 dnl objects, libraries and library flags.
7535 if AC_TRY_EVAL(ac_compile); then
7536 # Parse the compiler output and extract the necessary
7537 # objects, libraries and library flags.
7538
7539 # Sentinel used to keep track of whether or not we are before
7540 # the conftest object file.
7541 pre_test_object_deps_done=no
7542
7543 for p in `eval "$output_verbose_link_cmd"`; do
7544 case $prev$p in
7545
7546 -L* | -R* | -l*)
7547 # Some compilers place space between "-{L,R}" and the path.
7548 # Remove the space.
7549 if test x-L = "$p" ||
7550 test x-R = "$p"; then
7551 prev=$p
7552 continue
7553 fi
7554
7555 # Expand the sysroot to ease extracting the directories later.
7556 if test -z "$prev"; then
7557 case $p in
7558 -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7559 -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7560 -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7561 esac
7562 fi
7563 case $p in
7564 =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7565 esac
7566 if test no = "$pre_test_object_deps_done"; then
7567 case $prev in
7568 -L | -R)
7569 # Internal compiler library paths should come after those
7570 # provided the user. The postdeps already come after the
7571 # user supplied libs so there is no need to process them.
7572 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7573 _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7574 else
7575 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7576 fi
7577 ;;
7578 # The "-l" case would never come before the object being
7579 # linked, so don't bother handling this case.
7580 esac
7581 else
7582 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7583 _LT_TAGVAR(postdeps, $1)=$prev$p
7584 else
7585 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7586 fi
7587 fi
7588 prev=
7589 ;;
7590
7591 *.lto.$objext) ;; # Ignore GCC LTO objects
7592 *.$objext)
7593 # This assumes that the test object file only shows up
7594 # once in the compiler output.
7595 if test "$p" = "conftest.$objext"; then
7596 pre_test_object_deps_done=yes
7597 continue
7598 fi
7599
7600 if test no = "$pre_test_object_deps_done"; then
7601 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7602 _LT_TAGVAR(predep_objects, $1)=$p
7603 else
7604 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7605 fi
7606 else
7607 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7608 _LT_TAGVAR(postdep_objects, $1)=$p
7609 else
7610 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7611 fi
7612 fi
7613 ;;
7614
7615 *) ;; # Ignore the rest.
7616
7617 esac
7618 done
7619
7620 # Clean up.
7621 rm -f a.out a.exe
7622 else
7623 echo "libtool.m4: error: problem compiling $1 test program"
7624 fi
7625
7626 $RM -f confest.$objext
7627 CFLAGS=$_lt_libdeps_save_CFLAGS
7628
7629 # PORTME: override above test on systems where it is broken
7630 m4_if([$1], [CXX],
7631 [case $host_os in
7632 interix[[3-9]]*)
7633 # Interix 3.5 installs completely hosed .la files for C++, so rather than
7634 # hack all around it, let's just trust "g++" to DTRT.
7635 _LT_TAGVAR(predep_objects,$1)=
7636 _LT_TAGVAR(postdep_objects,$1)=
7637 _LT_TAGVAR(postdeps,$1)=
7638 ;;
7639 esac
7640 ])
7641
7642 case " $_LT_TAGVAR(postdeps, $1) " in
7643 *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7644 esac
7645 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7646 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7647 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7648 fi
7649 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7650 [The directories searched by this compiler when creating a shared library])
7651 _LT_TAGDECL([], [predep_objects], [1],
7652 [Dependencies to place before and after the objects being linked to
7653 create a shared library])
7654 _LT_TAGDECL([], [postdep_objects], [1])
7655 _LT_TAGDECL([], [predeps], [1])
7656 _LT_TAGDECL([], [postdeps], [1])
7657 _LT_TAGDECL([], [compiler_lib_search_path], [1],
7658 [The library search path used internally by the compiler when linking
7659 a shared library])
7660 ])# _LT_SYS_HIDDEN_LIBDEPS
7661
7662
7663 # _LT_LANG_F77_CONFIG([TAG])
7664 # --------------------------
7665 # Ensure that the configuration variables for a Fortran 77 compiler are
7666 # suitably defined. These variables are subsequently used by _LT_CONFIG
7667 # to write the compiler configuration to 'libtool'.
7668 m4_defun([_LT_LANG_F77_CONFIG],
7669 [AC_LANG_PUSH(Fortran 77)
7670 if test -z "$F77" || test no = "$F77"; then
7671 _lt_disable_F77=yes
7672 fi
7673
7674 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7675 _LT_TAGVAR(allow_undefined_flag, $1)=
7676 _LT_TAGVAR(always_export_symbols, $1)=no
7677 _LT_TAGVAR(archive_expsym_cmds, $1)=
7678 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
7679 _LT_TAGVAR(hardcode_direct, $1)=no
7680 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
7681 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7682 _LT_TAGVAR(hardcode_libdir_separator, $1)=
7683 _LT_TAGVAR(hardcode_minus_L, $1)=no
7684 _LT_TAGVAR(hardcode_automatic, $1)=no
7685 _LT_TAGVAR(inherit_rpath, $1)=no
7686 _LT_TAGVAR(module_cmds, $1)=
7687 _LT_TAGVAR(module_expsym_cmds, $1)=
7688 _LT_TAGVAR(link_all_deplibs, $1)=unknown
7689 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7690 _LT_TAGVAR(reload_flag, $1)=$reload_flag
7691 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7692 _LT_TAGVAR(no_undefined_flag, $1)=
7693 _LT_TAGVAR(whole_archive_flag_spec, $1)=
7694 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7695
7696 # Source file extension for f77 test sources.
7697 ac_ext=f
7698
7699 # Object file extension for compiled f77 test sources.
7700 objext=o
7701 _LT_TAGVAR(objext, $1)=$objext
7702
7703 # No sense in running all these tests if we already determined that
7704 # the F77 compiler isn't working. Some variables (like enable_shared)
7705 # are currently assumed to apply to all compilers on this platform,
7706 # and will be corrupted by setting them based on a non-working compiler.
7707 if test yes != "$_lt_disable_F77"; then
7708 # Code to be used in simple compile tests
7709 lt_simple_compile_test_code="\
7710 subroutine t
7711 return
7712 end
7713 "
7714
7715 # Code to be used in simple link tests
7716 lt_simple_link_test_code="\
7717 program t
7718 end
7719 "
7720
7721 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7722 _LT_TAG_COMPILER
7723
7724 # save warnings/boilerplate of simple test code
7725 _LT_COMPILER_BOILERPLATE
7726 _LT_LINKER_BOILERPLATE
7727
7728 # Allow CC to be a program name with arguments.
7729 lt_save_CC=$CC
7730 lt_save_GCC=$GCC
7731 lt_save_CFLAGS=$CFLAGS
7732 CC=${F77-"f77"}
7733 CFLAGS=$FFLAGS
7734 compiler=$CC
7735 _LT_TAGVAR(compiler, $1)=$CC
7736 _LT_CC_BASENAME([$compiler])
7737 GCC=$G77
7738 if test -n "$compiler"; then
7739 AC_MSG_CHECKING([if libtool supports shared libraries])
7740 AC_MSG_RESULT([$can_build_shared])
7741
7742 AC_MSG_CHECKING([whether to build shared libraries])
7743 test no = "$can_build_shared" && enable_shared=no
7744
7745 # On AIX, shared libraries and static libraries use the same namespace, and
7746 # are all built from PIC.
7747 case $host_os in
7748 aix3*)
7749 test yes = "$enable_shared" && enable_static=no
7750 if test -n "$RANLIB"; then
7751 archive_cmds="$archive_cmds~\$RANLIB \$lib"
7752 postinstall_cmds='$RANLIB $lib'
7753 fi
7754 ;;
7755 aix[[4-9]]*)
7756 if test ia64 != "$host_cpu"; then
7757 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7758 yes,aix,yes) ;; # shared object as lib.so file only
7759 yes,svr4,*) ;; # shared object as lib.so archive member only
7760 yes,*) enable_static=no ;; # shared object in lib.a archive as well
7761 esac
7762 fi
7763 ;;
7764 esac
7765 AC_MSG_RESULT([$enable_shared])
7766
7767 AC_MSG_CHECKING([whether to build static libraries])
7768 # Make sure either enable_shared or enable_static is yes.
7769 test yes = "$enable_shared" || enable_static=yes
7770 AC_MSG_RESULT([$enable_static])
7771
7772 _LT_TAGVAR(GCC, $1)=$G77
7773 _LT_TAGVAR(LD, $1)=$LD
7774
7775 ## CAVEAT EMPTOR:
7776 ## There is no encapsulation within the following macros, do not change
7777 ## the running order or otherwise move them around unless you know exactly
7778 ## what you are doing...
7779 _LT_COMPILER_PIC($1)
7780 _LT_COMPILER_C_O($1)
7781 _LT_COMPILER_FILE_LOCKS($1)
7782 _LT_LINKER_SHLIBS($1)
7783 _LT_SYS_DYNAMIC_LINKER($1)
7784 _LT_LINKER_HARDCODE_LIBPATH($1)
7785
7786 _LT_CONFIG($1)
7787 fi # test -n "$compiler"
7788
7789 GCC=$lt_save_GCC
7790 CC=$lt_save_CC
7791 CFLAGS=$lt_save_CFLAGS
7792 fi # test yes != "$_lt_disable_F77"
7793
7794 AC_LANG_POP
7795 ])# _LT_LANG_F77_CONFIG
7796
7797
7798 # _LT_LANG_FC_CONFIG([TAG])
7799 # -------------------------
7800 # Ensure that the configuration variables for a Fortran compiler are
7801 # suitably defined. These variables are subsequently used by _LT_CONFIG
7802 # to write the compiler configuration to 'libtool'.
7803 m4_defun([_LT_LANG_FC_CONFIG],
7804 [AC_LANG_PUSH(Fortran)
7805
7806 if test -z "$FC" || test no = "$FC"; then
7807 _lt_disable_FC=yes
7808 fi
7809
7810 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7811 _LT_TAGVAR(allow_undefined_flag, $1)=
7812 _LT_TAGVAR(always_export_symbols, $1)=no
7813 _LT_TAGVAR(archive_expsym_cmds, $1)=
7814 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
7815 _LT_TAGVAR(hardcode_direct, $1)=no
7816 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
7817 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7818 _LT_TAGVAR(hardcode_libdir_separator, $1)=
7819 _LT_TAGVAR(hardcode_minus_L, $1)=no
7820 _LT_TAGVAR(hardcode_automatic, $1)=no
7821 _LT_TAGVAR(inherit_rpath, $1)=no
7822 _LT_TAGVAR(module_cmds, $1)=
7823 _LT_TAGVAR(module_expsym_cmds, $1)=
7824 _LT_TAGVAR(link_all_deplibs, $1)=unknown
7825 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7826 _LT_TAGVAR(reload_flag, $1)=$reload_flag
7827 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7828 _LT_TAGVAR(no_undefined_flag, $1)=
7829 _LT_TAGVAR(whole_archive_flag_spec, $1)=
7830 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7831
7832 # Source file extension for fc test sources.
7833 ac_ext=${ac_fc_srcext-f}
7834
7835 # Object file extension for compiled fc test sources.
7836 objext=o
7837 _LT_TAGVAR(objext, $1)=$objext
7838
7839 # No sense in running all these tests if we already determined that
7840 # the FC compiler isn't working. Some variables (like enable_shared)
7841 # are currently assumed to apply to all compilers on this platform,
7842 # and will be corrupted by setting them based on a non-working compiler.
7843 if test yes != "$_lt_disable_FC"; then
7844 # Code to be used in simple compile tests
7845 lt_simple_compile_test_code="\
7846 subroutine t
7847 return
7848 end
7849 "
7850
7851 # Code to be used in simple link tests
7852 lt_simple_link_test_code="\
7853 program t
7854 end
7855 "
7856
7857 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7858 _LT_TAG_COMPILER
7859
7860 # save warnings/boilerplate of simple test code
7861 _LT_COMPILER_BOILERPLATE
7862 _LT_LINKER_BOILERPLATE
7863
7864 # Allow CC to be a program name with arguments.
7865 lt_save_CC=$CC
7866 lt_save_GCC=$GCC
7867 lt_save_CFLAGS=$CFLAGS
7868 CC=${FC-"f95"}
7869 CFLAGS=$FCFLAGS
7870 compiler=$CC
7871 GCC=$ac_cv_fc_compiler_gnu
7872
7873 _LT_TAGVAR(compiler, $1)=$CC
7874 _LT_CC_BASENAME([$compiler])
7875
7876 if test -n "$compiler"; then
7877 AC_MSG_CHECKING([if libtool supports shared libraries])
7878 AC_MSG_RESULT([$can_build_shared])
7879
7880 AC_MSG_CHECKING([whether to build shared libraries])
7881 test no = "$can_build_shared" && enable_shared=no
7882
7883 # On AIX, shared libraries and static libraries use the same namespace, and
7884 # are all built from PIC.
7885 case $host_os in
7886 aix3*)
7887 test yes = "$enable_shared" && enable_static=no
7888 if test -n "$RANLIB"; then
7889 archive_cmds="$archive_cmds~\$RANLIB \$lib"
7890 postinstall_cmds='$RANLIB $lib'
7891 fi
7892 ;;
7893 aix[[4-9]]*)
7894 if test ia64 != "$host_cpu"; then
7895 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7896 yes,aix,yes) ;; # shared object as lib.so file only
7897 yes,svr4,*) ;; # shared object as lib.so archive member only
7898 yes,*) enable_static=no ;; # shared object in lib.a archive as well
7899 esac
7900 fi
7901 ;;
7902 esac
7903 AC_MSG_RESULT([$enable_shared])
7904
7905 AC_MSG_CHECKING([whether to build static libraries])
7906 # Make sure either enable_shared or enable_static is yes.
7907 test yes = "$enable_shared" || enable_static=yes
7908 AC_MSG_RESULT([$enable_static])
7909
7910 _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7911 _LT_TAGVAR(LD, $1)=$LD
7912
7913 ## CAVEAT EMPTOR:
7914 ## There is no encapsulation within the following macros, do not change
7915 ## the running order or otherwise move them around unless you know exactly
7916 ## what you are doing...
7917 _LT_SYS_HIDDEN_LIBDEPS($1)
7918 _LT_COMPILER_PIC($1)
7919 _LT_COMPILER_C_O($1)
7920 _LT_COMPILER_FILE_LOCKS($1)
7921 _LT_LINKER_SHLIBS($1)
7922 _LT_SYS_DYNAMIC_LINKER($1)
7923 _LT_LINKER_HARDCODE_LIBPATH($1)
7924
7925 _LT_CONFIG($1)
7926 fi # test -n "$compiler"
7927
7928 GCC=$lt_save_GCC
7929 CC=$lt_save_CC
7930 CFLAGS=$lt_save_CFLAGS
7931 fi # test yes != "$_lt_disable_FC"
7932
7933 AC_LANG_POP
7934 ])# _LT_LANG_FC_CONFIG
7935
7936
7937 # _LT_LANG_GCJ_CONFIG([TAG])
7938 # --------------------------
7939 # Ensure that the configuration variables for the GNU Java Compiler compiler
7940 # are suitably defined. These variables are subsequently used by _LT_CONFIG
7941 # to write the compiler configuration to 'libtool'.
7942 m4_defun([_LT_LANG_GCJ_CONFIG],
7943 [AC_REQUIRE([LT_PROG_GCJ])dnl
7944 AC_LANG_SAVE
7945
7946 # Source file extension for Java test sources.
7947 ac_ext=java
7948
7949 # Object file extension for compiled Java test sources.
7950 objext=o
7951 _LT_TAGVAR(objext, $1)=$objext
7952
7953 # Code to be used in simple compile tests
7954 lt_simple_compile_test_code="class foo {}"
7955
7956 # Code to be used in simple link tests
7957 lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7958
7959 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7960 _LT_TAG_COMPILER
7961
7962 # save warnings/boilerplate of simple test code
7963 _LT_COMPILER_BOILERPLATE
7964 _LT_LINKER_BOILERPLATE
7965
7966 # Allow CC to be a program name with arguments.
7967 lt_save_CC=$CC
7968 lt_save_CFLAGS=$CFLAGS
7969 lt_save_GCC=$GCC
7970 GCC=yes
7971 CC=${GCJ-"gcj"}
7972 CFLAGS=$GCJFLAGS
7973 compiler=$CC
7974 _LT_TAGVAR(compiler, $1)=$CC
7975 _LT_TAGVAR(LD, $1)=$LD
7976 _LT_CC_BASENAME([$compiler])
7977
7978 # GCJ did not exist at the time GCC didn't implicitly link libc in.
7979 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7980
7981 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7982 _LT_TAGVAR(reload_flag, $1)=$reload_flag
7983 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7984
7985 ## CAVEAT EMPTOR:
7986 ## There is no encapsulation within the following macros, do not change
7987 ## the running order or otherwise move them around unless you know exactly
7988 ## what you are doing...
7989 if test -n "$compiler"; then
7990 _LT_COMPILER_NO_RTTI($1)
7991 _LT_COMPILER_PIC($1)
7992 _LT_COMPILER_C_O($1)
7993 _LT_COMPILER_FILE_LOCKS($1)
7994 _LT_LINKER_SHLIBS($1)
7995 _LT_LINKER_HARDCODE_LIBPATH($1)
7996
7997 _LT_CONFIG($1)
7998 fi
7999
8000 AC_LANG_RESTORE
8001
8002 GCC=$lt_save_GCC
8003 CC=$lt_save_CC
8004 CFLAGS=$lt_save_CFLAGS
8005 ])# _LT_LANG_GCJ_CONFIG
8006
8007
8008 # _LT_LANG_GO_CONFIG([TAG])
8009 # --------------------------
8010 # Ensure that the configuration variables for the GNU Go compiler
8011 # are suitably defined. These variables are subsequently used by _LT_CONFIG
8012 # to write the compiler configuration to 'libtool'.
8013 m4_defun([_LT_LANG_GO_CONFIG],
8014 [AC_REQUIRE([LT_PROG_GO])dnl
8015 AC_LANG_SAVE
8016
8017 # Source file extension for Go test sources.
8018 ac_ext=go
8019
8020 # Object file extension for compiled Go test sources.
8021 objext=o
8022 _LT_TAGVAR(objext, $1)=$objext
8023
8024 # Code to be used in simple compile tests
8025 lt_simple_compile_test_code="package main; func main() { }"
8026
8027 # Code to be used in simple link tests
8028 lt_simple_link_test_code='package main; func main() { }'
8029
8030 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8031 _LT_TAG_COMPILER
8032
8033 # save warnings/boilerplate of simple test code
8034 _LT_COMPILER_BOILERPLATE
8035 _LT_LINKER_BOILERPLATE
8036
8037 # Allow CC to be a program name with arguments.
8038 lt_save_CC=$CC
8039 lt_save_CFLAGS=$CFLAGS
8040 lt_save_GCC=$GCC
8041 GCC=yes
8042 CC=${GOC-"gccgo"}
8043 CFLAGS=$GOFLAGS
8044 compiler=$CC
8045 _LT_TAGVAR(compiler, $1)=$CC
8046 _LT_TAGVAR(LD, $1)=$LD
8047 _LT_CC_BASENAME([$compiler])
8048
8049 # Go did not exist at the time GCC didn't implicitly link libc in.
8050 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
8051
8052 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8053 _LT_TAGVAR(reload_flag, $1)=$reload_flag
8054 _LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8055
8056 ## CAVEAT EMPTOR:
8057 ## There is no encapsulation within the following macros, do not change
8058 ## the running order or otherwise move them around unless you know exactly
8059 ## what you are doing...
8060 if test -n "$compiler"; then
8061 _LT_COMPILER_NO_RTTI($1)
8062 _LT_COMPILER_PIC($1)
8063 _LT_COMPILER_C_O($1)
8064 _LT_COMPILER_FILE_LOCKS($1)
8065 _LT_LINKER_SHLIBS($1)
8066 _LT_LINKER_HARDCODE_LIBPATH($1)
8067
8068 _LT_CONFIG($1)
8069 fi
8070
8071 AC_LANG_RESTORE
8072
8073 GCC=$lt_save_GCC
8074 CC=$lt_save_CC
8075 CFLAGS=$lt_save_CFLAGS
8076 ])# _LT_LANG_GO_CONFIG
8077
8078
8079 # _LT_LANG_RC_CONFIG([TAG])
8080 # -------------------------
8081 # Ensure that the configuration variables for the Windows resource compiler
8082 # are suitably defined. These variables are subsequently used by _LT_CONFIG
8083 # to write the compiler configuration to 'libtool'.
8084 m4_defun([_LT_LANG_RC_CONFIG],
8085 [AC_REQUIRE([LT_PROG_RC])dnl
8086 AC_LANG_SAVE
8087
8088 # Source file extension for RC test sources.
8089 ac_ext=rc
8090
8091 # Object file extension for compiled RC test sources.
8092 objext=o
8093 _LT_TAGVAR(objext, $1)=$objext
8094
8095 # Code to be used in simple compile tests
8096 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8097
8098 # Code to be used in simple link tests
8099 lt_simple_link_test_code=$lt_simple_compile_test_code
8100
8101 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
8102 _LT_TAG_COMPILER
8103
8104 # save warnings/boilerplate of simple test code
8105 _LT_COMPILER_BOILERPLATE
8106 _LT_LINKER_BOILERPLATE
8107
8108 # Allow CC to be a program name with arguments.
8109 lt_save_CC=$CC
8110 lt_save_CFLAGS=$CFLAGS
8111 lt_save_GCC=$GCC
8112 GCC=
8113 CC=${RC-"windres"}
8114 CFLAGS=
8115 compiler=$CC
8116 _LT_TAGVAR(compiler, $1)=$CC
8117 _LT_CC_BASENAME([$compiler])
8118 _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8119
8120 if test -n "$compiler"; then
8121 :
8122 _LT_CONFIG($1)
8123 fi
8124
8125 GCC=$lt_save_GCC
8126 AC_LANG_RESTORE
8127 CC=$lt_save_CC
8128 CFLAGS=$lt_save_CFLAGS
8129 ])# _LT_LANG_RC_CONFIG
8130
8131
8132 # LT_PROG_GCJ
8133 # -----------
8134 AC_DEFUN([LT_PROG_GCJ],
8135 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8136 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8137 [AC_CHECK_TOOL(GCJ, gcj,)
8138 test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8139 AC_SUBST(GCJFLAGS)])])[]dnl
8140 ])
8141
8142 # Old name:
8143 AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8144 dnl aclocal-1.4 backwards compatibility:
8145 dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8146
8147
8148 # LT_PROG_GO
8149 # ----------
8150 AC_DEFUN([LT_PROG_GO],
8151 [AC_CHECK_TOOL(GOC, gccgo,)
8152 ])
8153
8154
8155 # LT_PROG_RC
8156 # ----------
8157 AC_DEFUN([LT_PROG_RC],
8158 [AC_CHECK_TOOL(RC, windres,)
8159 ])
8160
8161 # Old name:
8162 AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8163 dnl aclocal-1.4 backwards compatibility:
8164 dnl AC_DEFUN([LT_AC_PROG_RC], [])
8165
8166
8167 # _LT_DECL_EGREP
8168 # --------------
8169 # If we don't have a new enough Autoconf to choose the best grep
8170 # available, choose the one first in the user's PATH.
8171 m4_defun([_LT_DECL_EGREP],
8172 [AC_REQUIRE([AC_PROG_EGREP])dnl
8173 AC_REQUIRE([AC_PROG_FGREP])dnl
8174 test -z "$GREP" && GREP=grep
8175 _LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8176 _LT_DECL([], [EGREP], [1], [An ERE matcher])
8177 _LT_DECL([], [FGREP], [1], [A literal string matcher])
8178 dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8179 AC_SUBST([GREP])
8180 ])
8181
8182
8183 # _LT_DECL_OBJDUMP
8184 # --------------
8185 # If we don't have a new enough Autoconf to choose the best objdump
8186 # available, choose the one first in the user's PATH.
8187 m4_defun([_LT_DECL_OBJDUMP],
8188 [AC_CHECK_TOOL(OBJDUMP, objdump, false)
8189 test -z "$OBJDUMP" && OBJDUMP=objdump
8190 _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8191 AC_SUBST([OBJDUMP])
8192 ])
8193
8194 # _LT_DECL_DLLTOOL
8195 # ----------------
8196 # Ensure DLLTOOL variable is set.
8197 m4_defun([_LT_DECL_DLLTOOL],
8198 [AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8199 test -z "$DLLTOOL" && DLLTOOL=dlltool
8200 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8201 AC_SUBST([DLLTOOL])
8202 ])
8203
8204 # _LT_DECL_SED
8205 # ------------
8206 # Check for a fully-functional sed program, that truncates
8207 # as few characters as possible. Prefer GNU sed if found.
8208 m4_defun([_LT_DECL_SED],
8209 [AC_PROG_SED
8210 test -z "$SED" && SED=sed
8211 Xsed="$SED -e 1s/^X//"
8212 _LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8213 _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8214 [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8215 ])# _LT_DECL_SED
8216
8217 m4_ifndef([AC_PROG_SED], [
8218 ############################################################
8219 # NOTE: This macro has been submitted for inclusion into #
8220 # GNU Autoconf as AC_PROG_SED. When it is available in #
8221 # a released version of Autoconf we should remove this #
8222 # macro and use it instead. #
8223 ############################################################
8224
8225 m4_defun([AC_PROG_SED],
8226 [AC_MSG_CHECKING([for a sed that does not truncate output])
8227 AC_CACHE_VAL(lt_cv_path_SED,
8228 [# Loop through the user's path and test for sed and gsed.
8229 # Then use that list of sed's as ones to test for truncation.
8230 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8231 for as_dir in $PATH
8232 do
8233 IFS=$as_save_IFS
8234 test -z "$as_dir" && as_dir=.
8235 for lt_ac_prog in sed gsed; do
8236 for ac_exec_ext in '' $ac_executable_extensions; do
8237 if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8238 lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8239 fi
8240 done
8241 done
8242 done
8243 IFS=$as_save_IFS
8244 lt_ac_max=0
8245 lt_ac_count=0
8246 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
8247 # along with /bin/sed that truncates output.
8248 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8249 test ! -f "$lt_ac_sed" && continue
8250 cat /dev/null > conftest.in
8251 lt_ac_count=0
8252 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8253 # Check for GNU sed and select it if it is found.
8254 if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8255 lt_cv_path_SED=$lt_ac_sed
8256 break
8257 fi
8258 while true; do
8259 cat conftest.in conftest.in >conftest.tmp
8260 mv conftest.tmp conftest.in
8261 cp conftest.in conftest.nl
8262 echo >>conftest.nl
8263 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8264 cmp -s conftest.out conftest.nl || break
8265 # 10000 chars as input seems more than enough
8266 test 10 -lt "$lt_ac_count" && break
8267 lt_ac_count=`expr $lt_ac_count + 1`
8268 if test "$lt_ac_count" -gt "$lt_ac_max"; then
8269 lt_ac_max=$lt_ac_count
8270 lt_cv_path_SED=$lt_ac_sed
8271 fi
8272 done
8273 done
8274 ])
8275 SED=$lt_cv_path_SED
8276 AC_SUBST([SED])
8277 AC_MSG_RESULT([$SED])
8278 ])#AC_PROG_SED
8279 ])#m4_ifndef
8280
8281 # Old name:
8282 AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8283 dnl aclocal-1.4 backwards compatibility:
8284 dnl AC_DEFUN([LT_AC_PROG_SED], [])
8285
8286
8287 # _LT_CHECK_SHELL_FEATURES
8288 # ------------------------
8289 # Find out whether the shell is Bourne or XSI compatible,
8290 # or has some other useful features.
8291 m4_defun([_LT_CHECK_SHELL_FEATURES],
8292 [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8293 lt_unset=unset
8294 else
8295 lt_unset=false
8296 fi
8297 _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8298
8299 # test EBCDIC or ASCII
8300 case `echo X|tr X '\101'` in
8301 A) # ASCII based system
8302 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8303 lt_SP2NL='tr \040 \012'
8304 lt_NL2SP='tr \015\012 \040\040'
8305 ;;
8306 *) # EBCDIC based system
8307 lt_SP2NL='tr \100 \n'
8308 lt_NL2SP='tr \r\n \100\100'
8309 ;;
8310 esac
8311 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8312 _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8313 ])# _LT_CHECK_SHELL_FEATURES
8314
8315
8316 # _LT_PATH_CONVERSION_FUNCTIONS
8317 # -----------------------------
8318 # Determine what file name conversion functions should be used by
8319 # func_to_host_file (and, implicitly, by func_to_host_path). These are needed
8320 # for certain cross-compile configurations and native mingw.
8321 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8322 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
8323 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
8324 AC_MSG_CHECKING([how to convert $build file names to $host format])
8325 AC_CACHE_VAL(lt_cv_to_host_file_cmd,
8326 [case $host in
8327 *-*-mingw* )
8328 case $build in
8329 *-*-mingw* ) # actually msys
8330 lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8331 ;;
8332 *-*-cygwin* )
8333 lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8334 ;;
8335 * ) # otherwise, assume *nix
8336 lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8337 ;;
8338 esac
8339 ;;
8340 *-*-cygwin* )
8341 case $build in
8342 *-*-mingw* ) # actually msys
8343 lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8344 ;;
8345 *-*-cygwin* )
8346 lt_cv_to_host_file_cmd=func_convert_file_noop
8347 ;;
8348 * ) # otherwise, assume *nix
8349 lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8350 ;;
8351 esac
8352 ;;
8353 * ) # unhandled hosts (and "normal" native builds)
8354 lt_cv_to_host_file_cmd=func_convert_file_noop
8355 ;;
8356 esac
8357 ])
8358 to_host_file_cmd=$lt_cv_to_host_file_cmd
8359 AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8360 _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8361 [0], [convert $build file names to $host format])dnl
8362
8363 AC_MSG_CHECKING([how to convert $build file names to toolchain format])
8364 AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8365 [#assume ordinary cross tools, or native build.
8366 lt_cv_to_tool_file_cmd=func_convert_file_noop
8367 case $host in
8368 *-*-mingw* )
8369 case $build in
8370 *-*-mingw* ) # actually msys
8371 lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8372 ;;
8373 esac
8374 ;;
8375 esac
8376 ])
8377 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
8378 AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8379 _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8380 [0], [convert $build files to toolchain format])dnl
8381 ])# _LT_PATH_CONVERSION_FUNCTIONS
0 # Helper functions for option handling. -*- Autoconf -*-
1 #
2 # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
3 # Foundation, Inc.
4 # Written by Gary V. Vaughan, 2004
5 #
6 # This file is free software; the Free Software Foundation gives
7 # unlimited permission to copy and/or distribute it, with or without
8 # modifications, as long as this notice is preserved.
9
10 # serial 8 ltoptions.m4
11
12 # This is to help aclocal find these macros, as it can't see m4_define.
13 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
14
15
16 # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
17 # ------------------------------------------
18 m4_define([_LT_MANGLE_OPTION],
19 [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
20
21
22 # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
23 # ---------------------------------------
24 # Set option OPTION-NAME for macro MACRO-NAME, and if there is a
25 # matching handler defined, dispatch to it. Other OPTION-NAMEs are
26 # saved as a flag.
27 m4_define([_LT_SET_OPTION],
28 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
29 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
30 _LT_MANGLE_DEFUN([$1], [$2]),
31 [m4_warning([Unknown $1 option '$2'])])[]dnl
32 ])
33
34
35 # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
36 # ------------------------------------------------------------
37 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
38 m4_define([_LT_IF_OPTION],
39 [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
40
41
42 # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
43 # -------------------------------------------------------
44 # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
45 # are set.
46 m4_define([_LT_UNLESS_OPTIONS],
47 [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
48 [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
49 [m4_define([$0_found])])])[]dnl
50 m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
51 ])[]dnl
52 ])
53
54
55 # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
56 # ----------------------------------------
57 # OPTION-LIST is a space-separated list of Libtool options associated
58 # with MACRO-NAME. If any OPTION has a matching handler declared with
59 # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
60 # the unknown option and exit.
61 m4_defun([_LT_SET_OPTIONS],
62 [# Set options
63 m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
64 [_LT_SET_OPTION([$1], _LT_Option)])
65
66 m4_if([$1],[LT_INIT],[
67 dnl
68 dnl Simply set some default values (i.e off) if boolean options were not
69 dnl specified:
70 _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
71 ])
72 _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
73 ])
74 dnl
75 dnl If no reference was made to various pairs of opposing options, then
76 dnl we run the default mode handler for the pair. For example, if neither
77 dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
78 dnl archives by default:
79 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
80 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
81 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
82 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
83 [_LT_ENABLE_FAST_INSTALL])
84 _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
85 [_LT_WITH_AIX_SONAME([aix])])
86 ])
87 ])# _LT_SET_OPTIONS
88
89
90 ## --------------------------------- ##
91 ## Macros to handle LT_INIT options. ##
92 ## --------------------------------- ##
93
94 # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
95 # -----------------------------------------
96 m4_define([_LT_MANGLE_DEFUN],
97 [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
98
99
100 # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
101 # -----------------------------------------------
102 m4_define([LT_OPTION_DEFINE],
103 [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
104 ])# LT_OPTION_DEFINE
105
106
107 # dlopen
108 # ------
109 LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
110 ])
111
112 AU_DEFUN([AC_LIBTOOL_DLOPEN],
113 [_LT_SET_OPTION([LT_INIT], [dlopen])
114 AC_DIAGNOSE([obsolete],
115 [$0: Remove this warning and the call to _LT_SET_OPTION when you
116 put the 'dlopen' option into LT_INIT's first parameter.])
117 ])
118
119 dnl aclocal-1.4 backwards compatibility:
120 dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
121
122
123 # win32-dll
124 # ---------
125 # Declare package support for building win32 dll's.
126 LT_OPTION_DEFINE([LT_INIT], [win32-dll],
127 [enable_win32_dll=yes
128
129 case $host in
130 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
131 AC_CHECK_TOOL(AS, as, false)
132 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
133 AC_CHECK_TOOL(OBJDUMP, objdump, false)
134 ;;
135 esac
136
137 test -z "$AS" && AS=as
138 _LT_DECL([], [AS], [1], [Assembler program])dnl
139
140 test -z "$DLLTOOL" && DLLTOOL=dlltool
141 _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
142
143 test -z "$OBJDUMP" && OBJDUMP=objdump
144 _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
145 ])# win32-dll
146
147 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
148 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
149 _LT_SET_OPTION([LT_INIT], [win32-dll])
150 AC_DIAGNOSE([obsolete],
151 [$0: Remove this warning and the call to _LT_SET_OPTION when you
152 put the 'win32-dll' option into LT_INIT's first parameter.])
153 ])
154
155 dnl aclocal-1.4 backwards compatibility:
156 dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
157
158
159 # _LT_ENABLE_SHARED([DEFAULT])
160 # ----------------------------
161 # implement the --enable-shared flag, and supports the 'shared' and
162 # 'disable-shared' LT_INIT options.
163 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
164 m4_define([_LT_ENABLE_SHARED],
165 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
166 AC_ARG_ENABLE([shared],
167 [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
168 [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
169 [p=${PACKAGE-default}
170 case $enableval in
171 yes) enable_shared=yes ;;
172 no) enable_shared=no ;;
173 *)
174 enable_shared=no
175 # Look at the argument we got. We use all the common list separators.
176 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
177 for pkg in $enableval; do
178 IFS=$lt_save_ifs
179 if test "X$pkg" = "X$p"; then
180 enable_shared=yes
181 fi
182 done
183 IFS=$lt_save_ifs
184 ;;
185 esac],
186 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
187
188 _LT_DECL([build_libtool_libs], [enable_shared], [0],
189 [Whether or not to build shared libraries])
190 ])# _LT_ENABLE_SHARED
191
192 LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
193 LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
194
195 # Old names:
196 AC_DEFUN([AC_ENABLE_SHARED],
197 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
198 ])
199
200 AC_DEFUN([AC_DISABLE_SHARED],
201 [_LT_SET_OPTION([LT_INIT], [disable-shared])
202 ])
203
204 AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
205 AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
206
207 dnl aclocal-1.4 backwards compatibility:
208 dnl AC_DEFUN([AM_ENABLE_SHARED], [])
209 dnl AC_DEFUN([AM_DISABLE_SHARED], [])
210
211
212
213 # _LT_ENABLE_STATIC([DEFAULT])
214 # ----------------------------
215 # implement the --enable-static flag, and support the 'static' and
216 # 'disable-static' LT_INIT options.
217 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
218 m4_define([_LT_ENABLE_STATIC],
219 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
220 AC_ARG_ENABLE([static],
221 [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
222 [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
223 [p=${PACKAGE-default}
224 case $enableval in
225 yes) enable_static=yes ;;
226 no) enable_static=no ;;
227 *)
228 enable_static=no
229 # Look at the argument we got. We use all the common list separators.
230 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
231 for pkg in $enableval; do
232 IFS=$lt_save_ifs
233 if test "X$pkg" = "X$p"; then
234 enable_static=yes
235 fi
236 done
237 IFS=$lt_save_ifs
238 ;;
239 esac],
240 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
241
242 _LT_DECL([build_old_libs], [enable_static], [0],
243 [Whether or not to build static libraries])
244 ])# _LT_ENABLE_STATIC
245
246 LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
247 LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
248
249 # Old names:
250 AC_DEFUN([AC_ENABLE_STATIC],
251 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
252 ])
253
254 AC_DEFUN([AC_DISABLE_STATIC],
255 [_LT_SET_OPTION([LT_INIT], [disable-static])
256 ])
257
258 AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
259 AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
260
261 dnl aclocal-1.4 backwards compatibility:
262 dnl AC_DEFUN([AM_ENABLE_STATIC], [])
263 dnl AC_DEFUN([AM_DISABLE_STATIC], [])
264
265
266
267 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
268 # ----------------------------------
269 # implement the --enable-fast-install flag, and support the 'fast-install'
270 # and 'disable-fast-install' LT_INIT options.
271 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
272 m4_define([_LT_ENABLE_FAST_INSTALL],
273 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
274 AC_ARG_ENABLE([fast-install],
275 [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
276 [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
277 [p=${PACKAGE-default}
278 case $enableval in
279 yes) enable_fast_install=yes ;;
280 no) enable_fast_install=no ;;
281 *)
282 enable_fast_install=no
283 # Look at the argument we got. We use all the common list separators.
284 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
285 for pkg in $enableval; do
286 IFS=$lt_save_ifs
287 if test "X$pkg" = "X$p"; then
288 enable_fast_install=yes
289 fi
290 done
291 IFS=$lt_save_ifs
292 ;;
293 esac],
294 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
295
296 _LT_DECL([fast_install], [enable_fast_install], [0],
297 [Whether or not to optimize for fast installation])dnl
298 ])# _LT_ENABLE_FAST_INSTALL
299
300 LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
301 LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
302
303 # Old names:
304 AU_DEFUN([AC_ENABLE_FAST_INSTALL],
305 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
306 AC_DIAGNOSE([obsolete],
307 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
308 the 'fast-install' option into LT_INIT's first parameter.])
309 ])
310
311 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
312 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
313 AC_DIAGNOSE([obsolete],
314 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
315 the 'disable-fast-install' option into LT_INIT's first parameter.])
316 ])
317
318 dnl aclocal-1.4 backwards compatibility:
319 dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
320 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
321
322
323 # _LT_WITH_AIX_SONAME([DEFAULT])
324 # ----------------------------------
325 # implement the --with-aix-soname flag, and support the `aix-soname=aix'
326 # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
327 # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
328 m4_define([_LT_WITH_AIX_SONAME],
329 [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
330 shared_archive_member_spec=
331 case $host,$enable_shared in
332 power*-*-aix[[5-9]]*,yes)
333 AC_MSG_CHECKING([which variant of shared library versioning to provide])
334 AC_ARG_WITH([aix-soname],
335 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
336 [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
337 [case $withval in
338 aix|svr4|both)
339 ;;
340 *)
341 AC_MSG_ERROR([Unknown argument to --with-aix-soname])
342 ;;
343 esac
344 lt_cv_with_aix_soname=$with_aix_soname],
345 [AC_CACHE_VAL([lt_cv_with_aix_soname],
346 [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
347 with_aix_soname=$lt_cv_with_aix_soname])
348 AC_MSG_RESULT([$with_aix_soname])
349 if test aix != "$with_aix_soname"; then
350 # For the AIX way of multilib, we name the shared archive member
351 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
352 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
353 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
354 # the AIX toolchain works better with OBJECT_MODE set (default 32).
355 if test 64 = "${OBJECT_MODE-32}"; then
356 shared_archive_member_spec=shr_64
357 else
358 shared_archive_member_spec=shr
359 fi
360 fi
361 ;;
362 *)
363 with_aix_soname=aix
364 ;;
365 esac
366
367 _LT_DECL([], [shared_archive_member_spec], [0],
368 [Shared archive member basename, for filename based shared library versioning on AIX])dnl
369 ])# _LT_WITH_AIX_SONAME
370
371 LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
372 LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
373 LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
374
375
376 # _LT_WITH_PIC([MODE])
377 # --------------------
378 # implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
379 # LT_INIT options.
380 # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
381 m4_define([_LT_WITH_PIC],
382 [AC_ARG_WITH([pic],
383 [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
384 [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
385 [lt_p=${PACKAGE-default}
386 case $withval in
387 yes|no) pic_mode=$withval ;;
388 *)
389 pic_mode=default
390 # Look at the argument we got. We use all the common list separators.
391 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
392 for lt_pkg in $withval; do
393 IFS=$lt_save_ifs
394 if test "X$lt_pkg" = "X$lt_p"; then
395 pic_mode=yes
396 fi
397 done
398 IFS=$lt_save_ifs
399 ;;
400 esac],
401 [pic_mode=m4_default([$1], [default])])
402
403 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
404 ])# _LT_WITH_PIC
405
406 LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
407 LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
408
409 # Old name:
410 AU_DEFUN([AC_LIBTOOL_PICMODE],
411 [_LT_SET_OPTION([LT_INIT], [pic-only])
412 AC_DIAGNOSE([obsolete],
413 [$0: Remove this warning and the call to _LT_SET_OPTION when you
414 put the 'pic-only' option into LT_INIT's first parameter.])
415 ])
416
417 dnl aclocal-1.4 backwards compatibility:
418 dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
419
420 ## ----------------- ##
421 ## LTDL_INIT Options ##
422 ## ----------------- ##
423
424 m4_define([_LTDL_MODE], [])
425 LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
426 [m4_define([_LTDL_MODE], [nonrecursive])])
427 LT_OPTION_DEFINE([LTDL_INIT], [recursive],
428 [m4_define([_LTDL_MODE], [recursive])])
429 LT_OPTION_DEFINE([LTDL_INIT], [subproject],
430 [m4_define([_LTDL_MODE], [subproject])])
431
432 m4_define([_LTDL_TYPE], [])
433 LT_OPTION_DEFINE([LTDL_INIT], [installable],
434 [m4_define([_LTDL_TYPE], [installable])])
435 LT_OPTION_DEFINE([LTDL_INIT], [convenience],
436 [m4_define([_LTDL_TYPE], [convenience])])
0 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
1 #
2 # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
3 # Foundation, Inc.
4 # Written by Gary V. Vaughan, 2004
5 #
6 # This file is free software; the Free Software Foundation gives
7 # unlimited permission to copy and/or distribute it, with or without
8 # modifications, as long as this notice is preserved.
9
10 # serial 6 ltsugar.m4
11
12 # This is to help aclocal find these macros, as it can't see m4_define.
13 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
14
15
16 # lt_join(SEP, ARG1, [ARG2...])
17 # -----------------------------
18 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
19 # associated separator.
20 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
21 # versions in m4sugar had bugs.
22 m4_define([lt_join],
23 [m4_if([$#], [1], [],
24 [$#], [2], [[$2]],
25 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
26 m4_define([_lt_join],
27 [m4_if([$#$2], [2], [],
28 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
29
30
31 # lt_car(LIST)
32 # lt_cdr(LIST)
33 # ------------
34 # Manipulate m4 lists.
35 # These macros are necessary as long as will still need to support
36 # Autoconf-2.59, which quotes differently.
37 m4_define([lt_car], [[$1]])
38 m4_define([lt_cdr],
39 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
40 [$#], 1, [],
41 [m4_dquote(m4_shift($@))])])
42 m4_define([lt_unquote], $1)
43
44
45 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
46 # ------------------------------------------
47 # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
48 # Note that neither SEPARATOR nor STRING are expanded; they are appended
49 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
50 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
51 # than defined and empty).
52 #
53 # This macro is needed until we can rely on Autoconf 2.62, since earlier
54 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
55 m4_define([lt_append],
56 [m4_define([$1],
57 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
58
59
60
61 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
62 # ----------------------------------------------------------
63 # Produce a SEP delimited list of all paired combinations of elements of
64 # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
65 # has the form PREFIXmINFIXSUFFIXn.
66 # Needed until we can rely on m4_combine added in Autoconf 2.62.
67 m4_define([lt_combine],
68 [m4_if(m4_eval([$# > 3]), [1],
69 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
70 [[m4_foreach([_Lt_prefix], [$2],
71 [m4_foreach([_Lt_suffix],
72 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
73 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
74
75
76 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
77 # -----------------------------------------------------------------------
78 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
79 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
80 m4_define([lt_if_append_uniq],
81 [m4_ifdef([$1],
82 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
83 [lt_append([$1], [$2], [$3])$4],
84 [$5])],
85 [lt_append([$1], [$2], [$3])$4])])
86
87
88 # lt_dict_add(DICT, KEY, VALUE)
89 # -----------------------------
90 m4_define([lt_dict_add],
91 [m4_define([$1($2)], [$3])])
92
93
94 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
95 # --------------------------------------------
96 m4_define([lt_dict_add_subkey],
97 [m4_define([$1($2:$3)], [$4])])
98
99
100 # lt_dict_fetch(DICT, KEY, [SUBKEY])
101 # ----------------------------------
102 m4_define([lt_dict_fetch],
103 [m4_ifval([$3],
104 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
105 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
106
107
108 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
109 # -----------------------------------------------------------------
110 m4_define([lt_if_dict_fetch],
111 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
112 [$5],
113 [$6])])
114
115
116 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
117 # --------------------------------------------------------------
118 m4_define([lt_dict_filter],
119 [m4_if([$5], [], [],
120 [lt_join(m4_quote(m4_default([$4], [[, ]])),
121 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
122 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
123 ])
0 # ltversion.m4 -- version numbers -*- Autoconf -*-
1 #
2 # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
3 # Written by Scott James Remnant, 2004
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 # @configure_input@
10
11 # serial 4179 ltversion.m4
12 # This file is part of GNU Libtool
13
14 m4_define([LT_PACKAGE_VERSION], [2.4.6])
15 m4_define([LT_PACKAGE_REVISION], [2.4.6])
16
17 AC_DEFUN([LTVERSION_VERSION],
18 [macro_version='2.4.6'
19 macro_revision='2.4.6'
20 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
21 _LT_DECL(, macro_revision, 0)
22 ])
0 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
1 #
2 # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
3 # Foundation, Inc.
4 # Written by Scott James Remnant, 2004.
5 #
6 # This file is free software; the Free Software Foundation gives
7 # unlimited permission to copy and/or distribute it, with or without
8 # modifications, as long as this notice is preserved.
9
10 # serial 5 lt~obsolete.m4
11
12 # These exist entirely to fool aclocal when bootstrapping libtool.
13 #
14 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
15 # which have later been changed to m4_define as they aren't part of the
16 # exported API, or moved to Autoconf or Automake where they belong.
17 #
18 # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
19 # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
20 # using a macro with the same name in our local m4/libtool.m4 it'll
21 # pull the old libtool.m4 in (it doesn't see our shiny new m4_define
22 # and doesn't know about Autoconf macros at all.)
23 #
24 # So we provide this file, which has a silly filename so it's always
25 # included after everything else. This provides aclocal with the
26 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
27 # because those macros already exist, or will be overwritten later.
28 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
29 #
30 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
31 # Yes, that means every name once taken will need to remain here until
32 # we give up compatibility with versions before 1.7, at which point
33 # we need to keep only those names which we still refer to.
34
35 # This is to help aclocal find these macros, as it can't see m4_define.
36 AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
37
38 m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
39 m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
40 m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
41 m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
42 m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
43 m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
44 m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
45 m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
46 m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
47 m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
48 m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
49 m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
50 m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
51 m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
52 m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
53 m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
54 m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
55 m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
56 m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
57 m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
58 m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
59 m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
60 m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
61 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
62 m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
63 m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
64 m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
65 m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
66 m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
67 m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
68 m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
69 m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
70 m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
71 m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
72 m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
73 m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
74 m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
75 m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
76 m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
77 m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
78 m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
79 m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
80 m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
81 m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
82 m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
83 m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
84 m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
85 m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
86 m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
87 m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
88 m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
89 m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
90 m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
91 m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
92 m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
93 m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
94 m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
95 m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
96 m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
97 m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
98 m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
+0
-234
macros.mk less more
0 #
1 # Enhanced Seccomp Library Build Macros
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 SHELL = /bin/bash
22
23 #
24 # simple /bin/bash script to find the top of the tree
25 #
26
27 TOPDIR := $(shell \
28 ftd() { \
29 cd $$1; \
30 if [[ -r "macros.mk" ]]; then \
31 pwd; \
32 else \
33 ftd "../"; \
34 fi \
35 }; \
36 ftd .)
37
38 #
39 # build configuration
40 #
41
42 V ?= 0
43
44 CPPFLAGS += -I$(TOPDIR) -I$(TOPDIR)/include
45 LIBFLAGS =
46
47 CFLAGS ?= -Wl,-z,relro -Wall -O0 -g -fvisibility=hidden
48 CFLAGS += -fPIC
49 PYCFLAGS ?= -fvisibility=default
50 LDFLAGS ?= -z relro -g
51
52 #
53 # build tools
54 #
55
56 LN ?= ln
57 MV ?= mv
58 CAT ?= cat
59 ECHO ?= echo
60 TAR ?= tar
61 MKDIR ?= mkdir
62
63 SED ?= sed
64 AWK ?= awk
65
66 PYTHON ?= /usr/bin/env python
67
68 # we require gcc specific functionality
69 GCC ?= gcc
70
71 INSTALL ?= install
72
73 ifeq ($(V),0)
74 MAKE += --quiet --no-print-directory
75 ECHO_INFO ?= $(ECHO) ">> INFO:"
76 else
77 ECHO_INFO ?= /bin/true || $(ECHO) ">> INFO:"
78 endif
79
80 #
81 # auto dependencies
82 #
83
84 MAKEDEP = @$(GCC) $(CPPFLAGS) -MM -MF $(patsubst %.o,%.d,$@) $<;
85 MAKEDEP_EXEC = \
86 @$(GCC) $(CPPFLAGS) -MM -MT $(patsubst %.d,%,$@) \
87 -MF $@ $(patsubst %.d,%.c,$@);
88
89 ADDDEP = \
90 @adddep_func() { \
91 $(MV) $$1 $$1.dtmp; \
92 $(CAT) $$1.dtmp | $(SED) -e 's/\([^\]\)$$/\1 \\/' | \
93 ( $(CAT) - && $(ECHO) " $$2" ) > $$1; \
94 $(RM) -f $@.dtmp; \
95 }; \
96 adddep_func
97
98 #
99 # build constants
100 #
101
102 VERSION_HDR = version.h
103
104 #
105 # build macros
106 #
107
108 PY_DISTUTILS = \
109 VERSION_RELEASE="$(VERSION_RELEASE)" \
110 CFLAGS="$(CFLAGS) $(CPPFLAGS) $(PYCFLAGS)" LDFLAGS="$(LDFLAGS)" \
111 $(PYTHON) ./setup.py
112
113 ifeq ($(V),0)
114 PY_BUILD = @echo " PYTHON build";
115 endif
116 PY_BUILD += $(PY_DISTUTILS)
117 ifeq ($(V),0)
118 PY_BUILD += -q
119 endif
120 PY_BUILD += build
121
122 ifeq ($(V),0)
123 PY_INSTALL = @echo " PYTHON install";
124 endif
125 PY_INSTALL += $(PY_DISTUTILS)
126 ifeq ($(V),0)
127 PY_INSTALL += -q
128 endif
129 PY_INSTALL += install
130
131 ifeq ($(V),0)
132 COMPILE = @echo " CC $@";
133 endif
134 COMPILE += $(GCC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<;
135
136 ifeq ($(V),0)
137 COMPILE_EXEC = @echo " CC $@";
138 endif
139 COMPILE_EXEC += $(GCC) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LDFLAGS);
140
141 ifeq ($(V),0)
142 ARCHIVE = @echo " AR $@";
143 endif
144 ARCHIVE += $(AR) -cru $@ $?;
145
146 ifeq ($(V),0)
147 LINK_EXEC = @echo " LD $@";
148 endif
149 LINK_EXEC += $(GCC) $(LDFLAGS) -o $@ $^ $(LIBFLAGS);
150
151 ifeq ($(V),0)
152 LINK_LIB = @echo " LD $@" \
153 "($(patsubst %.so.$(VERSION_RELEASE),%.so.$(VERSION_MAJOR),$@))";
154 endif
155 LINK_LIB += $(GCC) $(LDFLAGS) -o $@ $^ -shared \
156 -Wl,-soname=$(patsubst %.so.$(VERSION_RELEASE),%.so.$(VERSION_MAJOR),$@)
157
158 #
159 # install macros
160 #
161
162 ifeq ($(V),0)
163 INSTALL_LIB_MACRO = @echo " INSTALL $^ ($(INSTALL_LIB_DIR)/$^)";
164 endif
165 INSTALL_LIB_MACRO += \
166 basename=$$(echo $^ | sed -e 's/.so.*$$/.so/'); \
167 soname=$$(objdump -p $^ | grep "SONAME" | awk '{print $$2}'); \
168 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
169 -d "$(INSTALL_LIB_DIR)"; \
170 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0755 \
171 $^ "$(INSTALL_LIB_DIR)"; \
172 (cd "$(INSTALL_LIB_DIR)"; $(RM) $$soname); \
173 (cd "$(INSTALL_LIB_DIR)"; $(LN) -s $^ $$soname); \
174 (cd "$(INSTALL_LIB_DIR)"; $(RM) $$basname); \
175 (cd "$(INSTALL_LIB_DIR)"; $(LN) -s $^ $$basename);
176
177 ifeq ($(V),0)
178 INSTALL_BIN_MACRO = @echo " INSTALL $^ ($(INSTALL_BIN_DIR)/$^)";
179 endif
180 INSTALL_BIN_MACRO += \
181 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
182 -d "$(INSTALL_BIN_DIR)"; \
183 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0755 \
184 $^ "$(INSTALL_BIN_DIR)";
185
186 ifeq ($(V),0)
187 INSTALL_PC_MACRO = \
188 @echo " INSTALL $$(cat /proc/$$$$/cmdline | awk '{print $$(NF)}')" \
189 " ($(INSTALL_LIB_DIR)/pkgconfig)";
190 endif
191 INSTALL_PC_MACRO += \
192 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
193 -d "$(INSTALL_LIB_DIR)/pkgconfig"; \
194 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
195 "$$(cat /proc/$$$$/cmdline | awk '{print $$(NF)}')" \
196 "$(INSTALL_LIB_DIR)/pkgconfig"; \#
197
198 ifeq ($(V),0)
199 INSTALL_INC_MACRO = @echo " INSTALL $^ ($(INSTALL_INC_DIR))";
200 endif
201 INSTALL_INC_MACRO += \
202 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
203 -d "$(INSTALL_INC_DIR)"; \
204 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
205 $^ "$(INSTALL_INC_DIR)";
206
207 ifeq ($(V),0)
208 INSTALL_MAN1_MACRO = \
209 @echo " INSTALL manpages ($(INSTALL_MAN_DIR)/man1)";
210 endif
211 INSTALL_MAN1_MACRO += \
212 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
213 -d "$(INSTALL_MAN_DIR)/man1"; \
214 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
215 $^ "$(INSTALL_MAN_DIR)/man1";
216
217 ifeq ($(V),0)
218 INSTALL_MAN3_MACRO = \
219 @echo " INSTALL manpages ($(INSTALL_MAN_DIR)/man3)";
220 endif
221 INSTALL_MAN3_MACRO += \
222 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) \
223 -d "$(INSTALL_MAN_DIR)/man3"; \
224 $(INSTALL) -o $(INSTALL_OWNER) -g $(INSTALL_GROUP) -m 0644 \
225 $^ "$(INSTALL_MAN_DIR)/man3";
226
227 #
228 # default build targets
229 #
230
231 %.o: %.c
232 $(MAKEDEP)
233 $(COMPILE)
+0
-92
src/Makefile less more
0 #
1 # Enhanced Seccomp Library Makefile
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 # macros
23 #
24
25 include ../macros.mk
26
27 #
28 # configuration
29 #
30
31 include $(TOPDIR)/version_info.mk
32 include $(TOPDIR)/configure.mk
33 include $(TOPDIR)/install.mk
34
35 LIB_STATIC = libseccomp.a
36 LIB_SHARED = libseccomp.so.$(VERSION_RELEASE)
37
38 OBJS = \
39 api.o db.o arch.o \
40 arch-x86.o arch-x86-syscalls.o \
41 arch-x86_64.o arch-x86_64-syscalls.o \
42 arch-x32.o arch-x32-syscalls.o \
43 arch-arm.o arch-arm-syscalls.o \
44 hash.o \
45 gen_pfc.o gen_bpf.o
46
47 DEPS = $(OBJS:%.o=%.d)
48
49 #
50 # bindings configuration
51 #
52
53 BINDINGS =
54
55 ifeq ($(CONF_BINDINGS_PYTHON), 1)
56 BINDINGS += python
57 endif
58
59 #
60 # targets
61 #
62
63 .PHONY: all install clean python
64
65 all: $(LIB_STATIC) $(LIB_SHARED) $(BINDINGS)
66
67 -include $(DEPS)
68
69 $(LIB_STATIC): $(OBJS)
70 $(ARCHIVE)
71
72 $(LIB_SHARED): $(OBJS)
73 $(LINK_LIB)
74
75 python: $(LIB_STATIC)
76 @$(ECHO_INFO) "building in directory $@/ ..."
77 @$(MAKE) -C $@
78
79 install: $(LIB_SHARED)
80 $(INSTALL_LIB_MACRO)
81 @for dir in $(BINDINGS); do \
82 $(ECHO) ">> INFO: installing from $$dir/"; \
83 $(MAKE) -C $$dir install; \
84 done
85
86 clean:
87 $(RM) $(DEPS) $(OBJS) $(LIB_STATIC) libseccomp.so.*
88 @for dir in python; do \
89 $(MAKE) -C $$dir clean; \
90 done
91
0 ####
1 # Seccomp Library Source Files
2 #
3
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the terms of version 2.1 of the GNU Lesser General Public License
7 # as published by the Free Software Foundation.
8 #
9 # This library is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses>.
16 #
17
18 SUBDIRS = .
19 if ENABLE_PYTHON
20 SUBDIRS += python
21 endif
22
23 SOURCES_ARCH = \
24 arch.c arch.h \
25 arch-x86.h arch-x86.c arch-x86-syscalls.c \
26 arch-x86_64.h arch-x86_64.c arch-x86_64-syscalls.c \
27 arch-x32.h arch-x32.c arch-x32-syscalls.c \
28 arch-arm.h arch-arm.c arch-arm-syscalls.c \
29 arch-aarch64.h arch-aarch64.c arch-aarch64-syscalls.c \
30 arch-mips.h arch-mips.c arch-mips-syscalls.c \
31 arch-mips64.h arch-mips64.c arch-mips64-syscalls.c \
32 arch-mips64n32.h arch-mips64n32.c arch-mips64n32-syscalls.c
33
34 SOURCES_GEN = \
35 api.c system.h system.c \
36 db.h db.c \
37 hash.h hash.c \
38 gen_pfc.h gen_pfc.c gen_bpf.h gen_bpf.c
39
40 EXTRA_DIST = arch-syscall-validate
41
42 TESTS = arch-syscall-check
43
44 check_PROGRAMS = arch-syscall-check arch-syscall-dump
45
46 lib_LTLIBRARIES = libseccomp.la
47
48 arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ARCH}
49
50 arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ARCH}
51
52 libseccomp_la_SOURCES = ${SOURCES_GEN} ${SOURCES_ARCH}
53 libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} -I$(top_builddir)/include
54 libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden
55 libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \
56 -version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO}
57
58 check-build:
59 ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS}
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
4
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 ####
17 # Seccomp Library Source Files
18 #
19
20 #
21 # This library is free software; you can redistribute it and/or modify it
22 # under the terms of version 2.1 of the GNU Lesser General Public License
23 # as published by the Free Software Foundation.
24 #
25 # This library is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
28 # General Public License for more details.
29 #
30 # You should have received a copy of the GNU Lesser General Public License
31 # along with this library; if not, see <http://www.gnu.org/licenses>.
32 #
33
34 VPATH = @srcdir@
35 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
36 am__make_running_with_option = \
37 case $${target_option-} in \
38 ?) ;; \
39 *) echo "am__make_running_with_option: internal error: invalid" \
40 "target option '$${target_option-}' specified" >&2; \
41 exit 1;; \
42 esac; \
43 has_opt=no; \
44 sane_makeflags=$$MAKEFLAGS; \
45 if $(am__is_gnu_make); then \
46 sane_makeflags=$$MFLAGS; \
47 else \
48 case $$MAKEFLAGS in \
49 *\\[\ \ ]*) \
50 bs=\\; \
51 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
52 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
53 esac; \
54 fi; \
55 skip_next=no; \
56 strip_trailopt () \
57 { \
58 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
59 }; \
60 for flg in $$sane_makeflags; do \
61 test $$skip_next = yes && { skip_next=no; continue; }; \
62 case $$flg in \
63 *=*|--*) continue;; \
64 -*I) strip_trailopt 'I'; skip_next=yes;; \
65 -*I?*) strip_trailopt 'I';; \
66 -*O) strip_trailopt 'O'; skip_next=yes;; \
67 -*O?*) strip_trailopt 'O';; \
68 -*l) strip_trailopt 'l'; skip_next=yes;; \
69 -*l?*) strip_trailopt 'l';; \
70 -[dEDm]) skip_next=yes;; \
71 -[JT]) skip_next=yes;; \
72 esac; \
73 case $$flg in \
74 *$$target_option*) has_opt=yes; break;; \
75 esac; \
76 done; \
77 test $$has_opt = yes
78 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
79 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
80 pkgdatadir = $(datadir)/@PACKAGE@
81 pkgincludedir = $(includedir)/@PACKAGE@
82 pkglibdir = $(libdir)/@PACKAGE@
83 pkglibexecdir = $(libexecdir)/@PACKAGE@
84 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
85 install_sh_DATA = $(install_sh) -c -m 644
86 install_sh_PROGRAM = $(install_sh) -c
87 install_sh_SCRIPT = $(install_sh) -c
88 INSTALL_HEADER = $(INSTALL_DATA)
89 transform = $(program_transform_name)
90 NORMAL_INSTALL = :
91 PRE_INSTALL = :
92 POST_INSTALL = :
93 NORMAL_UNINSTALL = :
94 PRE_UNINSTALL = :
95 POST_UNINSTALL = :
96 build_triplet = @build@
97 host_triplet = @host@
98 @ENABLE_PYTHON_TRUE@am__append_1 = python
99 TESTS = arch-syscall-check$(EXEEXT)
100 check_PROGRAMS = arch-syscall-check$(EXEEXT) \
101 arch-syscall-dump$(EXEEXT)
102 subdir = src
103 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
104 $(top_srcdir)/build-aux/depcomp
105 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
110 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
111 $(ACLOCAL_M4)
112 mkinstalldirs = $(install_sh) -d
113 CONFIG_HEADER = $(top_builddir)/configure.h
114 CONFIG_CLEAN_FILES =
115 CONFIG_CLEAN_VPATH_FILES =
116 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
117 am__vpath_adj = case $$p in \
118 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
119 *) f=$$p;; \
120 esac;
121 am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
122 am__install_max = 40
123 am__nobase_strip_setup = \
124 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
125 am__nobase_strip = \
126 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
127 am__nobase_list = $(am__nobase_strip_setup); \
128 for p in $$list; do echo "$$p $$p"; done | \
129 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
130 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
131 if (++n[$$2] == $(am__install_max)) \
132 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
133 END { for (dir in files) print dir, files[dir] }'
134 am__base_list = \
135 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
136 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
137 am__uninstall_files_from_dir = { \
138 test -z "$$files" \
139 || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
140 || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
141 $(am__cd) "$$dir" && rm -f $$files; }; \
142 }
143 am__installdirs = "$(DESTDIR)$(libdir)"
144 LTLIBRARIES = $(lib_LTLIBRARIES)
145 libseccomp_la_LIBADD =
146 am__objects_1 = libseccomp_la-api.lo libseccomp_la-system.lo \
147 libseccomp_la-db.lo libseccomp_la-hash.lo \
148 libseccomp_la-gen_pfc.lo libseccomp_la-gen_bpf.lo
149 am__objects_2 = libseccomp_la-arch.lo libseccomp_la-arch-x86.lo \
150 libseccomp_la-arch-x86-syscalls.lo \
151 libseccomp_la-arch-x86_64.lo \
152 libseccomp_la-arch-x86_64-syscalls.lo \
153 libseccomp_la-arch-x32.lo libseccomp_la-arch-x32-syscalls.lo \
154 libseccomp_la-arch-arm.lo libseccomp_la-arch-arm-syscalls.lo \
155 libseccomp_la-arch-aarch64.lo \
156 libseccomp_la-arch-aarch64-syscalls.lo \
157 libseccomp_la-arch-mips.lo libseccomp_la-arch-mips-syscalls.lo \
158 libseccomp_la-arch-mips64.lo \
159 libseccomp_la-arch-mips64-syscalls.lo \
160 libseccomp_la-arch-mips64n32.lo \
161 libseccomp_la-arch-mips64n32-syscalls.lo
162 am_libseccomp_la_OBJECTS = $(am__objects_1) $(am__objects_2)
163 libseccomp_la_OBJECTS = $(am_libseccomp_la_OBJECTS)
164 AM_V_lt = $(am__v_lt_@AM_V@)
165 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
166 am__v_lt_0 = --silent
167 am__v_lt_1 =
168 libseccomp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
169 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libseccomp_la_CFLAGS) \
170 $(CFLAGS) $(libseccomp_la_LDFLAGS) $(LDFLAGS) -o $@
171 am__objects_3 = arch.$(OBJEXT) arch-x86.$(OBJEXT) \
172 arch-x86-syscalls.$(OBJEXT) arch-x86_64.$(OBJEXT) \
173 arch-x86_64-syscalls.$(OBJEXT) arch-x32.$(OBJEXT) \
174 arch-x32-syscalls.$(OBJEXT) arch-arm.$(OBJEXT) \
175 arch-arm-syscalls.$(OBJEXT) arch-aarch64.$(OBJEXT) \
176 arch-aarch64-syscalls.$(OBJEXT) arch-mips.$(OBJEXT) \
177 arch-mips-syscalls.$(OBJEXT) arch-mips64.$(OBJEXT) \
178 arch-mips64-syscalls.$(OBJEXT) arch-mips64n32.$(OBJEXT) \
179 arch-mips64n32-syscalls.$(OBJEXT)
180 am_arch_syscall_check_OBJECTS = arch-syscall-check.$(OBJEXT) \
181 $(am__objects_3)
182 arch_syscall_check_OBJECTS = $(am_arch_syscall_check_OBJECTS)
183 arch_syscall_check_LDADD = $(LDADD)
184 am_arch_syscall_dump_OBJECTS = arch-syscall-dump.$(OBJEXT) \
185 $(am__objects_3)
186 arch_syscall_dump_OBJECTS = $(am_arch_syscall_dump_OBJECTS)
187 arch_syscall_dump_LDADD = $(LDADD)
188 AM_V_P = $(am__v_P_@AM_V@)
189 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
190 am__v_P_0 = false
191 am__v_P_1 = :
192 AM_V_GEN = $(am__v_GEN_@AM_V@)
193 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
194 am__v_GEN_0 = @echo " GEN " $@;
195 am__v_GEN_1 =
196 AM_V_at = $(am__v_at_@AM_V@)
197 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
198 am__v_at_0 = @
199 am__v_at_1 =
200 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
201 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
202 am__depfiles_maybe = depfiles
203 am__mv = mv -f
204 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
205 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
206 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
207 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
208 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
209 $(AM_CFLAGS) $(CFLAGS)
210 AM_V_CC = $(am__v_CC_@AM_V@)
211 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
212 am__v_CC_0 = @echo " CC " $@;
213 am__v_CC_1 =
214 CCLD = $(CC)
215 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
216 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
217 $(AM_LDFLAGS) $(LDFLAGS) -o $@
218 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
219 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
220 am__v_CCLD_0 = @echo " CCLD " $@;
221 am__v_CCLD_1 =
222 SOURCES = $(libseccomp_la_SOURCES) $(arch_syscall_check_SOURCES) \
223 $(arch_syscall_dump_SOURCES)
224 DIST_SOURCES = $(libseccomp_la_SOURCES) $(arch_syscall_check_SOURCES) \
225 $(arch_syscall_dump_SOURCES)
226 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
227 ctags-recursive dvi-recursive html-recursive info-recursive \
228 install-data-recursive install-dvi-recursive \
229 install-exec-recursive install-html-recursive \
230 install-info-recursive install-pdf-recursive \
231 install-ps-recursive install-recursive installcheck-recursive \
232 installdirs-recursive pdf-recursive ps-recursive \
233 tags-recursive uninstall-recursive
234 am__can_run_installinfo = \
235 case $$AM_UPDATE_INFO_DIR in \
236 n|no|NO) false;; \
237 *) (install-info --version) >/dev/null 2>&1;; \
238 esac
239 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
240 distclean-recursive maintainer-clean-recursive
241 am__recursive_targets = \
242 $(RECURSIVE_TARGETS) \
243 $(RECURSIVE_CLEAN_TARGETS) \
244 $(am__extra_recursive_targets)
245 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
246 distdir
247 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
248 # Read a list of newline-separated strings from the standard input,
249 # and print each of them once, without duplicates. Input order is
250 # *not* preserved.
251 am__uniquify_input = $(AWK) '\
252 BEGIN { nonempty = 0; } \
253 { items[$$0] = 1; nonempty = 1; } \
254 END { if (nonempty) { for (i in items) print i; }; } \
255 '
256 # Make sure the list of sources is unique. This is necessary because,
257 # e.g., the same source file might be shared among _SOURCES variables
258 # for different programs/libraries.
259 am__define_uniq_tagged_files = \
260 list='$(am__tagged_files)'; \
261 unique=`for i in $$list; do \
262 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
263 done | $(am__uniquify_input)`
264 ETAGS = etags
265 CTAGS = ctags
266 am__tty_colors_dummy = \
267 mgn= red= grn= lgn= blu= brg= std=; \
268 am__color_tests=no
269 am__tty_colors = { \
270 $(am__tty_colors_dummy); \
271 if test "X$(AM_COLOR_TESTS)" = Xno; then \
272 am__color_tests=no; \
273 elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
274 am__color_tests=yes; \
275 elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
276 am__color_tests=yes; \
277 fi; \
278 if test $$am__color_tests = yes; then \
279 red=''; \
280 grn=''; \
281 lgn=''; \
282 blu=''; \
283 mgn=''; \
284 brg=''; \
285 std=''; \
286 fi; \
287 }
288 DIST_SUBDIRS = . python
289 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
290 am__relativize = \
291 dir0=`pwd`; \
292 sed_first='s,^\([^/]*\)/.*$$,\1,'; \
293 sed_rest='s,^[^/]*/*,,'; \
294 sed_last='s,^.*/\([^/]*\)$$,\1,'; \
295 sed_butlast='s,/*[^/]*$$,,'; \
296 while test -n "$$dir1"; do \
297 first=`echo "$$dir1" | sed -e "$$sed_first"`; \
298 if test "$$first" != "."; then \
299 if test "$$first" = ".."; then \
300 dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
301 dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
302 else \
303 first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
304 if test "$$first2" = "$$first"; then \
305 dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
306 else \
307 dir2="../$$dir2"; \
308 fi; \
309 dir0="$$dir0"/"$$first"; \
310 fi; \
311 fi; \
312 dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
313 done; \
314 reldir="$$dir2"
315 ACLOCAL = @ACLOCAL@
316 AMTAR = @AMTAR@
317 AM_CFLAGS = @AM_CFLAGS@
318 AM_CPPFLAGS = @AM_CPPFLAGS@
319 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
320 AM_LDFLAGS = @AM_LDFLAGS@
321 AR = @AR@
322 AUTOCONF = @AUTOCONF@
323 AUTOHEADER = @AUTOHEADER@
324 AUTOMAKE = @AUTOMAKE@
325 AWK = @AWK@
326 CC = @CC@
327 CCDEPMODE = @CCDEPMODE@
328 CFLAGS = @CFLAGS@
329 CPP = @CPP@
330 CPPFLAGS = @CPPFLAGS@
331 CYGPATH_W = @CYGPATH_W@
332 DEFS = @DEFS@
333 DEPDIR = @DEPDIR@
334 DLLTOOL = @DLLTOOL@
335 DSYMUTIL = @DSYMUTIL@
336 DUMPBIN = @DUMPBIN@
337 ECHO_C = @ECHO_C@
338 ECHO_N = @ECHO_N@
339 ECHO_T = @ECHO_T@
340 EGREP = @EGREP@
341 EXEEXT = @EXEEXT@
342 FGREP = @FGREP@
343 GREP = @GREP@
344 INSTALL = @INSTALL@
345 INSTALL_DATA = @INSTALL_DATA@
346 INSTALL_PROGRAM = @INSTALL_PROGRAM@
347 INSTALL_SCRIPT = @INSTALL_SCRIPT@
348 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
349 LD = @LD@
350 LDFLAGS = @LDFLAGS@
351 LIBOBJS = @LIBOBJS@
352 LIBS = @LIBS@
353 LIBTOOL = @LIBTOOL@
354 LIPO = @LIPO@
355 LN_S = @LN_S@
356 LTLIBOBJS = @LTLIBOBJS@
357 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
358 MAKEINFO = @MAKEINFO@
359 MANIFEST_TOOL = @MANIFEST_TOOL@
360 MKDIR_P = @MKDIR_P@
361 NM = @NM@
362 NMEDIT = @NMEDIT@
363 OBJDUMP = @OBJDUMP@
364 OBJEXT = @OBJEXT@
365 OTOOL = @OTOOL@
366 OTOOL64 = @OTOOL64@
367 PACKAGE = @PACKAGE@
368 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
369 PACKAGE_NAME = @PACKAGE_NAME@
370 PACKAGE_STRING = @PACKAGE_STRING@
371 PACKAGE_TARNAME = @PACKAGE_TARNAME@
372 PACKAGE_URL = @PACKAGE_URL@
373 PACKAGE_VERSION = @PACKAGE_VERSION@
374 PATH_SEPARATOR = @PATH_SEPARATOR@
375 RANLIB = @RANLIB@
376 SED = @SED@
377 SET_MAKE = @SET_MAKE@
378 SHELL = @SHELL@
379 STRIP = @STRIP@
380 VERSION = @VERSION@
381 VERSION_MAJOR = @VERSION_MAJOR@
382 VERSION_MICRO = @VERSION_MICRO@
383 VERSION_MINOR = @VERSION_MINOR@
384 abs_builddir = @abs_builddir@
385 abs_srcdir = @abs_srcdir@
386 abs_top_builddir = @abs_top_builddir@
387 abs_top_srcdir = @abs_top_srcdir@
388 ac_ct_AR = @ac_ct_AR@
389 ac_ct_CC = @ac_ct_CC@
390 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
391 am__include = @am__include@
392 am__leading_dot = @am__leading_dot@
393 am__quote = @am__quote@
394 am__tar = @am__tar@
395 am__untar = @am__untar@
396 bindir = @bindir@
397 build = @build@
398 build_alias = @build_alias@
399 build_cpu = @build_cpu@
400 build_os = @build_os@
401 build_vendor = @build_vendor@
402 builddir = @builddir@
403 datadir = @datadir@
404 datarootdir = @datarootdir@
405 docdir = @docdir@
406 dvidir = @dvidir@
407 exec_prefix = @exec_prefix@
408 have_coverity = @have_coverity@
409 have_cython = @have_cython@
410 host = @host@
411 host_alias = @host_alias@
412 host_cpu = @host_cpu@
413 host_os = @host_os@
414 host_vendor = @host_vendor@
415 htmldir = @htmldir@
416 includedir = @includedir@
417 infodir = @infodir@
418 install_sh = @install_sh@
419 libdir = @libdir@
420 libexecdir = @libexecdir@
421 localedir = @localedir@
422 localstatedir = @localstatedir@
423 mandir = @mandir@
424 mkdir_p = @mkdir_p@
425 oldincludedir = @oldincludedir@
426 pdfdir = @pdfdir@
427 prefix = @prefix@
428 program_transform_name = @program_transform_name@
429 psdir = @psdir@
430 sbindir = @sbindir@
431 sharedstatedir = @sharedstatedir@
432 srcdir = @srcdir@
433 sysconfdir = @sysconfdir@
434 target_alias = @target_alias@
435 top_build_prefix = @top_build_prefix@
436 top_builddir = @top_builddir@
437 top_srcdir = @top_srcdir@
438 SUBDIRS = . $(am__append_1)
439 SOURCES_ARCH = \
440 arch.c arch.h \
441 arch-x86.h arch-x86.c arch-x86-syscalls.c \
442 arch-x86_64.h arch-x86_64.c arch-x86_64-syscalls.c \
443 arch-x32.h arch-x32.c arch-x32-syscalls.c \
444 arch-arm.h arch-arm.c arch-arm-syscalls.c \
445 arch-aarch64.h arch-aarch64.c arch-aarch64-syscalls.c \
446 arch-mips.h arch-mips.c arch-mips-syscalls.c \
447 arch-mips64.h arch-mips64.c arch-mips64-syscalls.c \
448 arch-mips64n32.h arch-mips64n32.c arch-mips64n32-syscalls.c
449
450 SOURCES_GEN = \
451 api.c system.h system.c \
452 db.h db.c \
453 hash.h hash.c \
454 gen_pfc.h gen_pfc.c gen_bpf.h gen_bpf.c
455
456 EXTRA_DIST = arch-syscall-validate
457 lib_LTLIBRARIES = libseccomp.la
458 arch_syscall_dump_SOURCES = arch-syscall-dump.c ${SOURCES_ARCH}
459 arch_syscall_check_SOURCES = arch-syscall-check.c ${SOURCES_ARCH}
460 libseccomp_la_SOURCES = ${SOURCES_GEN} ${SOURCES_ARCH}
461 libseccomp_la_CPPFLAGS = ${AM_CPPFLAGS} -I$(top_builddir)/include
462 libseccomp_la_CFLAGS = ${AM_CFLAGS} ${CFLAGS} -fPIC -DPIC -fvisibility=hidden
463 libseccomp_la_LDFLAGS = ${AM_LDFLAGS} ${LDFLAGS} \
464 -version-number ${VERSION_MAJOR}:${VERSION_MINOR}:${VERSION_MICRO}
465
466 all: all-recursive
467
468 .SUFFIXES:
469 .SUFFIXES: .c .lo .o .obj
470 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
471 @for dep in $?; do \
472 case '$(am__configure_deps)' in \
473 *$$dep*) \
474 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
475 && { if test -f $@; then exit 0; else break; fi; }; \
476 exit 1;; \
477 esac; \
478 done; \
479 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
480 $(am__cd) $(top_srcdir) && \
481 $(AUTOMAKE) --foreign src/Makefile
482 .PRECIOUS: Makefile
483 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
484 @case '$?' in \
485 *config.status*) \
486 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
487 *) \
488 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
489 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
490 esac;
491
492 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
493 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
494
495 $(top_srcdir)/configure: $(am__configure_deps)
496 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
497 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
498 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
499 $(am__aclocal_m4_deps):
500
501 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
502 @$(NORMAL_INSTALL)
503 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
504 list2=; for p in $$list; do \
505 if test -f $$p; then \
506 list2="$$list2 $$p"; \
507 else :; fi; \
508 done; \
509 test -z "$$list2" || { \
510 echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
511 $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
512 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
513 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
514 }
515
516 uninstall-libLTLIBRARIES:
517 @$(NORMAL_UNINSTALL)
518 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
519 for p in $$list; do \
520 $(am__strip_dir) \
521 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
522 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
523 done
524
525 clean-libLTLIBRARIES:
526 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
527 @list='$(lib_LTLIBRARIES)'; \
528 locs=`for p in $$list; do echo $$p; done | \
529 sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
530 sort -u`; \
531 test -z "$$locs" || { \
532 echo rm -f $${locs}; \
533 rm -f $${locs}; \
534 }
535
536 libseccomp.la: $(libseccomp_la_OBJECTS) $(libseccomp_la_DEPENDENCIES) $(EXTRA_libseccomp_la_DEPENDENCIES)
537 $(AM_V_CCLD)$(libseccomp_la_LINK) -rpath $(libdir) $(libseccomp_la_OBJECTS) $(libseccomp_la_LIBADD) $(LIBS)
538
539 clean-checkPROGRAMS:
540 @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
541 echo " rm -f" $$list; \
542 rm -f $$list || exit $$?; \
543 test -n "$(EXEEXT)" || exit 0; \
544 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
545 echo " rm -f" $$list; \
546 rm -f $$list
547
548 arch-syscall-check$(EXEEXT): $(arch_syscall_check_OBJECTS) $(arch_syscall_check_DEPENDENCIES) $(EXTRA_arch_syscall_check_DEPENDENCIES)
549 @rm -f arch-syscall-check$(EXEEXT)
550 $(AM_V_CCLD)$(LINK) $(arch_syscall_check_OBJECTS) $(arch_syscall_check_LDADD) $(LIBS)
551
552 arch-syscall-dump$(EXEEXT): $(arch_syscall_dump_OBJECTS) $(arch_syscall_dump_DEPENDENCIES) $(EXTRA_arch_syscall_dump_DEPENDENCIES)
553 @rm -f arch-syscall-dump$(EXEEXT)
554 $(AM_V_CCLD)$(LINK) $(arch_syscall_dump_OBJECTS) $(arch_syscall_dump_LDADD) $(LIBS)
555
556 mostlyclean-compile:
557 -rm -f *.$(OBJEXT)
558
559 distclean-compile:
560 -rm -f *.tab.c
561
562 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-aarch64-syscalls.Po@am__quote@
563 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-aarch64.Po@am__quote@
564 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-arm-syscalls.Po@am__quote@
565 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-arm.Po@am__quote@
566 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips-syscalls.Po@am__quote@
567 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips.Po@am__quote@
568 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips64-syscalls.Po@am__quote@
569 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips64.Po@am__quote@
570 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips64n32-syscalls.Po@am__quote@
571 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-mips64n32.Po@am__quote@
572 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-syscall-check.Po@am__quote@
573 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-syscall-dump.Po@am__quote@
574 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-x32-syscalls.Po@am__quote@
575 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-x32.Po@am__quote@
576 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-x86-syscalls.Po@am__quote@
577 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-x86.Po@am__quote@
578 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-x86_64-syscalls.Po@am__quote@
579 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch-x86_64.Po@am__quote@
580 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch.Po@am__quote@
581 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-api.Plo@am__quote@
582 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-aarch64-syscalls.Plo@am__quote@
583 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-aarch64.Plo@am__quote@
584 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-arm-syscalls.Plo@am__quote@
585 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-arm.Plo@am__quote@
586 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-mips-syscalls.Plo@am__quote@
587 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-mips.Plo@am__quote@
588 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-mips64-syscalls.Plo@am__quote@
589 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-mips64.Plo@am__quote@
590 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-mips64n32-syscalls.Plo@am__quote@
591 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-mips64n32.Plo@am__quote@
592 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-x32-syscalls.Plo@am__quote@
593 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-x32.Plo@am__quote@
594 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-x86-syscalls.Plo@am__quote@
595 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-x86.Plo@am__quote@
596 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-x86_64-syscalls.Plo@am__quote@
597 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch-x86_64.Plo@am__quote@
598 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-arch.Plo@am__quote@
599 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-db.Plo@am__quote@
600 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-gen_bpf.Plo@am__quote@
601 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-gen_pfc.Plo@am__quote@
602 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-hash.Plo@am__quote@
603 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libseccomp_la-system.Plo@am__quote@
604
605 .c.o:
606 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
607 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
608 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
609 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
610 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
611 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
612
613 .c.obj:
614 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
615 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
616 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
617 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
618 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
619 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
620
621 .c.lo:
622 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
623 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
624 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
625 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
626 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
627 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
628
629 libseccomp_la-api.lo: api.c
630 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-api.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-api.Tpo -c -o libseccomp_la-api.lo `test -f 'api.c' || echo '$(srcdir)/'`api.c
631 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-api.Tpo $(DEPDIR)/libseccomp_la-api.Plo
632 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='api.c' object='libseccomp_la-api.lo' libtool=yes @AMDEPBACKSLASH@
633 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
634 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-api.lo `test -f 'api.c' || echo '$(srcdir)/'`api.c
635
636 libseccomp_la-system.lo: system.c
637 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-system.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-system.Tpo -c -o libseccomp_la-system.lo `test -f 'system.c' || echo '$(srcdir)/'`system.c
638 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-system.Tpo $(DEPDIR)/libseccomp_la-system.Plo
639 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='system.c' object='libseccomp_la-system.lo' libtool=yes @AMDEPBACKSLASH@
640 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
641 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-system.lo `test -f 'system.c' || echo '$(srcdir)/'`system.c
642
643 libseccomp_la-db.lo: db.c
644 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-db.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-db.Tpo -c -o libseccomp_la-db.lo `test -f 'db.c' || echo '$(srcdir)/'`db.c
645 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-db.Tpo $(DEPDIR)/libseccomp_la-db.Plo
646 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='db.c' object='libseccomp_la-db.lo' libtool=yes @AMDEPBACKSLASH@
647 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
648 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-db.lo `test -f 'db.c' || echo '$(srcdir)/'`db.c
649
650 libseccomp_la-hash.lo: hash.c
651 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-hash.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-hash.Tpo -c -o libseccomp_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
652 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-hash.Tpo $(DEPDIR)/libseccomp_la-hash.Plo
653 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='libseccomp_la-hash.lo' libtool=yes @AMDEPBACKSLASH@
654 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
655 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-hash.lo `test -f 'hash.c' || echo '$(srcdir)/'`hash.c
656
657 libseccomp_la-gen_pfc.lo: gen_pfc.c
658 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-gen_pfc.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-gen_pfc.Tpo -c -o libseccomp_la-gen_pfc.lo `test -f 'gen_pfc.c' || echo '$(srcdir)/'`gen_pfc.c
659 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-gen_pfc.Tpo $(DEPDIR)/libseccomp_la-gen_pfc.Plo
660 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gen_pfc.c' object='libseccomp_la-gen_pfc.lo' libtool=yes @AMDEPBACKSLASH@
661 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
662 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-gen_pfc.lo `test -f 'gen_pfc.c' || echo '$(srcdir)/'`gen_pfc.c
663
664 libseccomp_la-gen_bpf.lo: gen_bpf.c
665 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-gen_bpf.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-gen_bpf.Tpo -c -o libseccomp_la-gen_bpf.lo `test -f 'gen_bpf.c' || echo '$(srcdir)/'`gen_bpf.c
666 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-gen_bpf.Tpo $(DEPDIR)/libseccomp_la-gen_bpf.Plo
667 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gen_bpf.c' object='libseccomp_la-gen_bpf.lo' libtool=yes @AMDEPBACKSLASH@
668 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
669 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-gen_bpf.lo `test -f 'gen_bpf.c' || echo '$(srcdir)/'`gen_bpf.c
670
671 libseccomp_la-arch.lo: arch.c
672 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch.Tpo -c -o libseccomp_la-arch.lo `test -f 'arch.c' || echo '$(srcdir)/'`arch.c
673 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch.Tpo $(DEPDIR)/libseccomp_la-arch.Plo
674 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch.c' object='libseccomp_la-arch.lo' libtool=yes @AMDEPBACKSLASH@
675 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
676 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch.lo `test -f 'arch.c' || echo '$(srcdir)/'`arch.c
677
678 libseccomp_la-arch-x86.lo: arch-x86.c
679 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-x86.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-x86.Tpo -c -o libseccomp_la-arch-x86.lo `test -f 'arch-x86.c' || echo '$(srcdir)/'`arch-x86.c
680 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-x86.Tpo $(DEPDIR)/libseccomp_la-arch-x86.Plo
681 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-x86.c' object='libseccomp_la-arch-x86.lo' libtool=yes @AMDEPBACKSLASH@
682 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
683 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-x86.lo `test -f 'arch-x86.c' || echo '$(srcdir)/'`arch-x86.c
684
685 libseccomp_la-arch-x86-syscalls.lo: arch-x86-syscalls.c
686 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-x86-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-x86-syscalls.Tpo -c -o libseccomp_la-arch-x86-syscalls.lo `test -f 'arch-x86-syscalls.c' || echo '$(srcdir)/'`arch-x86-syscalls.c
687 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-x86-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-x86-syscalls.Plo
688 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-x86-syscalls.c' object='libseccomp_la-arch-x86-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
689 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
690 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-x86-syscalls.lo `test -f 'arch-x86-syscalls.c' || echo '$(srcdir)/'`arch-x86-syscalls.c
691
692 libseccomp_la-arch-x86_64.lo: arch-x86_64.c
693 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-x86_64.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-x86_64.Tpo -c -o libseccomp_la-arch-x86_64.lo `test -f 'arch-x86_64.c' || echo '$(srcdir)/'`arch-x86_64.c
694 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-x86_64.Tpo $(DEPDIR)/libseccomp_la-arch-x86_64.Plo
695 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-x86_64.c' object='libseccomp_la-arch-x86_64.lo' libtool=yes @AMDEPBACKSLASH@
696 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
697 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-x86_64.lo `test -f 'arch-x86_64.c' || echo '$(srcdir)/'`arch-x86_64.c
698
699 libseccomp_la-arch-x86_64-syscalls.lo: arch-x86_64-syscalls.c
700 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-x86_64-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-x86_64-syscalls.Tpo -c -o libseccomp_la-arch-x86_64-syscalls.lo `test -f 'arch-x86_64-syscalls.c' || echo '$(srcdir)/'`arch-x86_64-syscalls.c
701 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-x86_64-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-x86_64-syscalls.Plo
702 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-x86_64-syscalls.c' object='libseccomp_la-arch-x86_64-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
703 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
704 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-x86_64-syscalls.lo `test -f 'arch-x86_64-syscalls.c' || echo '$(srcdir)/'`arch-x86_64-syscalls.c
705
706 libseccomp_la-arch-x32.lo: arch-x32.c
707 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-x32.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-x32.Tpo -c -o libseccomp_la-arch-x32.lo `test -f 'arch-x32.c' || echo '$(srcdir)/'`arch-x32.c
708 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-x32.Tpo $(DEPDIR)/libseccomp_la-arch-x32.Plo
709 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-x32.c' object='libseccomp_la-arch-x32.lo' libtool=yes @AMDEPBACKSLASH@
710 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
711 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-x32.lo `test -f 'arch-x32.c' || echo '$(srcdir)/'`arch-x32.c
712
713 libseccomp_la-arch-x32-syscalls.lo: arch-x32-syscalls.c
714 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-x32-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-x32-syscalls.Tpo -c -o libseccomp_la-arch-x32-syscalls.lo `test -f 'arch-x32-syscalls.c' || echo '$(srcdir)/'`arch-x32-syscalls.c
715 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-x32-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-x32-syscalls.Plo
716 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-x32-syscalls.c' object='libseccomp_la-arch-x32-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
717 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
718 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-x32-syscalls.lo `test -f 'arch-x32-syscalls.c' || echo '$(srcdir)/'`arch-x32-syscalls.c
719
720 libseccomp_la-arch-arm.lo: arch-arm.c
721 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-arm.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-arm.Tpo -c -o libseccomp_la-arch-arm.lo `test -f 'arch-arm.c' || echo '$(srcdir)/'`arch-arm.c
722 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-arm.Tpo $(DEPDIR)/libseccomp_la-arch-arm.Plo
723 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-arm.c' object='libseccomp_la-arch-arm.lo' libtool=yes @AMDEPBACKSLASH@
724 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
725 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-arm.lo `test -f 'arch-arm.c' || echo '$(srcdir)/'`arch-arm.c
726
727 libseccomp_la-arch-arm-syscalls.lo: arch-arm-syscalls.c
728 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-arm-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-arm-syscalls.Tpo -c -o libseccomp_la-arch-arm-syscalls.lo `test -f 'arch-arm-syscalls.c' || echo '$(srcdir)/'`arch-arm-syscalls.c
729 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-arm-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-arm-syscalls.Plo
730 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-arm-syscalls.c' object='libseccomp_la-arch-arm-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
731 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
732 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-arm-syscalls.lo `test -f 'arch-arm-syscalls.c' || echo '$(srcdir)/'`arch-arm-syscalls.c
733
734 libseccomp_la-arch-aarch64.lo: arch-aarch64.c
735 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-aarch64.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-aarch64.Tpo -c -o libseccomp_la-arch-aarch64.lo `test -f 'arch-aarch64.c' || echo '$(srcdir)/'`arch-aarch64.c
736 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-aarch64.Tpo $(DEPDIR)/libseccomp_la-arch-aarch64.Plo
737 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-aarch64.c' object='libseccomp_la-arch-aarch64.lo' libtool=yes @AMDEPBACKSLASH@
738 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
739 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-aarch64.lo `test -f 'arch-aarch64.c' || echo '$(srcdir)/'`arch-aarch64.c
740
741 libseccomp_la-arch-aarch64-syscalls.lo: arch-aarch64-syscalls.c
742 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-aarch64-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-aarch64-syscalls.Tpo -c -o libseccomp_la-arch-aarch64-syscalls.lo `test -f 'arch-aarch64-syscalls.c' || echo '$(srcdir)/'`arch-aarch64-syscalls.c
743 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-aarch64-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-aarch64-syscalls.Plo
744 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-aarch64-syscalls.c' object='libseccomp_la-arch-aarch64-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
745 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
746 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-aarch64-syscalls.lo `test -f 'arch-aarch64-syscalls.c' || echo '$(srcdir)/'`arch-aarch64-syscalls.c
747
748 libseccomp_la-arch-mips.lo: arch-mips.c
749 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-mips.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-mips.Tpo -c -o libseccomp_la-arch-mips.lo `test -f 'arch-mips.c' || echo '$(srcdir)/'`arch-mips.c
750 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-mips.Tpo $(DEPDIR)/libseccomp_la-arch-mips.Plo
751 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-mips.c' object='libseccomp_la-arch-mips.lo' libtool=yes @AMDEPBACKSLASH@
752 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
753 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-mips.lo `test -f 'arch-mips.c' || echo '$(srcdir)/'`arch-mips.c
754
755 libseccomp_la-arch-mips-syscalls.lo: arch-mips-syscalls.c
756 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-mips-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-mips-syscalls.Tpo -c -o libseccomp_la-arch-mips-syscalls.lo `test -f 'arch-mips-syscalls.c' || echo '$(srcdir)/'`arch-mips-syscalls.c
757 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-mips-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-mips-syscalls.Plo
758 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-mips-syscalls.c' object='libseccomp_la-arch-mips-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
759 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
760 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-mips-syscalls.lo `test -f 'arch-mips-syscalls.c' || echo '$(srcdir)/'`arch-mips-syscalls.c
761
762 libseccomp_la-arch-mips64.lo: arch-mips64.c
763 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-mips64.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-mips64.Tpo -c -o libseccomp_la-arch-mips64.lo `test -f 'arch-mips64.c' || echo '$(srcdir)/'`arch-mips64.c
764 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-mips64.Tpo $(DEPDIR)/libseccomp_la-arch-mips64.Plo
765 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-mips64.c' object='libseccomp_la-arch-mips64.lo' libtool=yes @AMDEPBACKSLASH@
766 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
767 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-mips64.lo `test -f 'arch-mips64.c' || echo '$(srcdir)/'`arch-mips64.c
768
769 libseccomp_la-arch-mips64-syscalls.lo: arch-mips64-syscalls.c
770 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-mips64-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-mips64-syscalls.Tpo -c -o libseccomp_la-arch-mips64-syscalls.lo `test -f 'arch-mips64-syscalls.c' || echo '$(srcdir)/'`arch-mips64-syscalls.c
771 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-mips64-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-mips64-syscalls.Plo
772 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-mips64-syscalls.c' object='libseccomp_la-arch-mips64-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
773 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
774 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-mips64-syscalls.lo `test -f 'arch-mips64-syscalls.c' || echo '$(srcdir)/'`arch-mips64-syscalls.c
775
776 libseccomp_la-arch-mips64n32.lo: arch-mips64n32.c
777 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-mips64n32.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-mips64n32.Tpo -c -o libseccomp_la-arch-mips64n32.lo `test -f 'arch-mips64n32.c' || echo '$(srcdir)/'`arch-mips64n32.c
778 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-mips64n32.Tpo $(DEPDIR)/libseccomp_la-arch-mips64n32.Plo
779 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-mips64n32.c' object='libseccomp_la-arch-mips64n32.lo' libtool=yes @AMDEPBACKSLASH@
780 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
781 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-mips64n32.lo `test -f 'arch-mips64n32.c' || echo '$(srcdir)/'`arch-mips64n32.c
782
783 libseccomp_la-arch-mips64n32-syscalls.lo: arch-mips64n32-syscalls.c
784 @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -MT libseccomp_la-arch-mips64n32-syscalls.lo -MD -MP -MF $(DEPDIR)/libseccomp_la-arch-mips64n32-syscalls.Tpo -c -o libseccomp_la-arch-mips64n32-syscalls.lo `test -f 'arch-mips64n32-syscalls.c' || echo '$(srcdir)/'`arch-mips64n32-syscalls.c
785 @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libseccomp_la-arch-mips64n32-syscalls.Tpo $(DEPDIR)/libseccomp_la-arch-mips64n32-syscalls.Plo
786 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='arch-mips64n32-syscalls.c' object='libseccomp_la-arch-mips64n32-syscalls.lo' libtool=yes @AMDEPBACKSLASH@
787 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
788 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libseccomp_la_CPPFLAGS) $(CPPFLAGS) $(libseccomp_la_CFLAGS) $(CFLAGS) -c -o libseccomp_la-arch-mips64n32-syscalls.lo `test -f 'arch-mips64n32-syscalls.c' || echo '$(srcdir)/'`arch-mips64n32-syscalls.c
789
790 mostlyclean-libtool:
791 -rm -f *.lo
792
793 clean-libtool:
794 -rm -rf .libs _libs
795
796 # This directory's subdirectories are mostly independent; you can cd
797 # into them and run 'make' without going through this Makefile.
798 # To change the values of 'make' variables: instead of editing Makefiles,
799 # (1) if the variable is set in 'config.status', edit 'config.status'
800 # (which will cause the Makefiles to be regenerated when you run 'make');
801 # (2) otherwise, pass the desired values on the 'make' command line.
802 $(am__recursive_targets):
803 @fail=; \
804 if $(am__make_keepgoing); then \
805 failcom='fail=yes'; \
806 else \
807 failcom='exit 1'; \
808 fi; \
809 dot_seen=no; \
810 target=`echo $@ | sed s/-recursive//`; \
811 case "$@" in \
812 distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
813 *) list='$(SUBDIRS)' ;; \
814 esac; \
815 for subdir in $$list; do \
816 echo "Making $$target in $$subdir"; \
817 if test "$$subdir" = "."; then \
818 dot_seen=yes; \
819 local_target="$$target-am"; \
820 else \
821 local_target="$$target"; \
822 fi; \
823 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
824 || eval $$failcom; \
825 done; \
826 if test "$$dot_seen" = "no"; then \
827 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
828 fi; test -z "$$fail"
829
830 ID: $(am__tagged_files)
831 $(am__define_uniq_tagged_files); mkid -fID $$unique
832 tags: tags-recursive
833 TAGS: tags
834
835 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
836 set x; \
837 here=`pwd`; \
838 if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
839 include_option=--etags-include; \
840 empty_fix=.; \
841 else \
842 include_option=--include; \
843 empty_fix=; \
844 fi; \
845 list='$(SUBDIRS)'; for subdir in $$list; do \
846 if test "$$subdir" = .; then :; else \
847 test ! -f $$subdir/TAGS || \
848 set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
849 fi; \
850 done; \
851 $(am__define_uniq_tagged_files); \
852 shift; \
853 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
854 test -n "$$unique" || unique=$$empty_fix; \
855 if test $$# -gt 0; then \
856 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
857 "$$@" $$unique; \
858 else \
859 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
860 $$unique; \
861 fi; \
862 fi
863 ctags: ctags-recursive
864
865 CTAGS: ctags
866 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
867 $(am__define_uniq_tagged_files); \
868 test -z "$(CTAGS_ARGS)$$unique" \
869 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
870 $$unique
871
872 GTAGS:
873 here=`$(am__cd) $(top_builddir) && pwd` \
874 && $(am__cd) $(top_srcdir) \
875 && gtags -i $(GTAGS_ARGS) "$$here"
876 cscopelist: cscopelist-recursive
877
878 cscopelist-am: $(am__tagged_files)
879 list='$(am__tagged_files)'; \
880 case "$(srcdir)" in \
881 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
882 *) sdir=$(subdir)/$(srcdir) ;; \
883 esac; \
884 for i in $$list; do \
885 if test -f "$$i"; then \
886 echo "$(subdir)/$$i"; \
887 else \
888 echo "$$sdir/$$i"; \
889 fi; \
890 done >> $(top_builddir)/cscope.files
891
892 distclean-tags:
893 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
894
895 check-TESTS: $(TESTS)
896 @failed=0; all=0; xfail=0; xpass=0; skip=0; \
897 srcdir=$(srcdir); export srcdir; \
898 list=' $(TESTS) '; \
899 $(am__tty_colors); \
900 if test -n "$$list"; then \
901 for tst in $$list; do \
902 if test -f ./$$tst; then dir=./; \
903 elif test -f $$tst; then dir=; \
904 else dir="$(srcdir)/"; fi; \
905 if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
906 all=`expr $$all + 1`; \
907 case " $(XFAIL_TESTS) " in \
908 *[\ \ ]$$tst[\ \ ]*) \
909 xpass=`expr $$xpass + 1`; \
910 failed=`expr $$failed + 1`; \
911 col=$$red; res=XPASS; \
912 ;; \
913 *) \
914 col=$$grn; res=PASS; \
915 ;; \
916 esac; \
917 elif test $$? -ne 77; then \
918 all=`expr $$all + 1`; \
919 case " $(XFAIL_TESTS) " in \
920 *[\ \ ]$$tst[\ \ ]*) \
921 xfail=`expr $$xfail + 1`; \
922 col=$$lgn; res=XFAIL; \
923 ;; \
924 *) \
925 failed=`expr $$failed + 1`; \
926 col=$$red; res=FAIL; \
927 ;; \
928 esac; \
929 else \
930 skip=`expr $$skip + 1`; \
931 col=$$blu; res=SKIP; \
932 fi; \
933 echo "$${col}$$res$${std}: $$tst"; \
934 done; \
935 if test "$$all" -eq 1; then \
936 tests="test"; \
937 All=""; \
938 else \
939 tests="tests"; \
940 All="All "; \
941 fi; \
942 if test "$$failed" -eq 0; then \
943 if test "$$xfail" -eq 0; then \
944 banner="$$All$$all $$tests passed"; \
945 else \
946 if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
947 banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
948 fi; \
949 else \
950 if test "$$xpass" -eq 0; then \
951 banner="$$failed of $$all $$tests failed"; \
952 else \
953 if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
954 banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
955 fi; \
956 fi; \
957 dashes="$$banner"; \
958 skipped=""; \
959 if test "$$skip" -ne 0; then \
960 if test "$$skip" -eq 1; then \
961 skipped="($$skip test was not run)"; \
962 else \
963 skipped="($$skip tests were not run)"; \
964 fi; \
965 test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
966 dashes="$$skipped"; \
967 fi; \
968 report=""; \
969 if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
970 report="Please report to $(PACKAGE_BUGREPORT)"; \
971 test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
972 dashes="$$report"; \
973 fi; \
974 dashes=`echo "$$dashes" | sed s/./=/g`; \
975 if test "$$failed" -eq 0; then \
976 col="$$grn"; \
977 else \
978 col="$$red"; \
979 fi; \
980 echo "$${col}$$dashes$${std}"; \
981 echo "$${col}$$banner$${std}"; \
982 test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
983 test -z "$$report" || echo "$${col}$$report$${std}"; \
984 echo "$${col}$$dashes$${std}"; \
985 test "$$failed" -eq 0; \
986 else :; fi
987
988 distdir: $(DISTFILES)
989 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
990 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
991 list='$(DISTFILES)'; \
992 dist_files=`for file in $$list; do echo $$file; done | \
993 sed -e "s|^$$srcdirstrip/||;t" \
994 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
995 case $$dist_files in \
996 */*) $(MKDIR_P) `echo "$$dist_files" | \
997 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
998 sort -u` ;; \
999 esac; \
1000 for file in $$dist_files; do \
1001 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
1002 if test -d $$d/$$file; then \
1003 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
1004 if test -d "$(distdir)/$$file"; then \
1005 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
1006 fi; \
1007 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
1008 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
1009 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
1010 fi; \
1011 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
1012 else \
1013 test -f "$(distdir)/$$file" \
1014 || cp -p $$d/$$file "$(distdir)/$$file" \
1015 || exit 1; \
1016 fi; \
1017 done
1018 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
1019 if test "$$subdir" = .; then :; else \
1020 $(am__make_dryrun) \
1021 || test -d "$(distdir)/$$subdir" \
1022 || $(MKDIR_P) "$(distdir)/$$subdir" \
1023 || exit 1; \
1024 dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
1025 $(am__relativize); \
1026 new_distdir=$$reldir; \
1027 dir1=$$subdir; dir2="$(top_distdir)"; \
1028 $(am__relativize); \
1029 new_top_distdir=$$reldir; \
1030 echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
1031 echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
1032 ($(am__cd) $$subdir && \
1033 $(MAKE) $(AM_MAKEFLAGS) \
1034 top_distdir="$$new_top_distdir" \
1035 distdir="$$new_distdir" \
1036 am__remove_distdir=: \
1037 am__skip_length_check=: \
1038 am__skip_mode_fix=: \
1039 distdir) \
1040 || exit 1; \
1041 fi; \
1042 done
1043 check-am: all-am
1044 $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
1045 $(MAKE) $(AM_MAKEFLAGS) check-TESTS
1046 check: check-recursive
1047 all-am: Makefile $(LTLIBRARIES)
1048 installdirs: installdirs-recursive
1049 installdirs-am:
1050 for dir in "$(DESTDIR)$(libdir)"; do \
1051 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
1052 done
1053 install: install-recursive
1054 install-exec: install-exec-recursive
1055 install-data: install-data-recursive
1056 uninstall: uninstall-recursive
1057
1058 install-am: all-am
1059 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
1060
1061 installcheck: installcheck-recursive
1062 install-strip:
1063 if test -z '$(STRIP)'; then \
1064 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1065 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1066 install; \
1067 else \
1068 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1069 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1070 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
1071 fi
1072 mostlyclean-generic:
1073
1074 clean-generic:
1075
1076 distclean-generic:
1077 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
1078 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
1079
1080 maintainer-clean-generic:
1081 @echo "This command is intended for maintainers to use"
1082 @echo "it deletes files that may require special tools to rebuild."
1083 clean: clean-recursive
1084
1085 clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \
1086 clean-libtool mostlyclean-am
1087
1088 distclean: distclean-recursive
1089 -rm -rf ./$(DEPDIR)
1090 -rm -f Makefile
1091 distclean-am: clean-am distclean-compile distclean-generic \
1092 distclean-tags
1093
1094 dvi: dvi-recursive
1095
1096 dvi-am:
1097
1098 html: html-recursive
1099
1100 html-am:
1101
1102 info: info-recursive
1103
1104 info-am:
1105
1106 install-data-am:
1107
1108 install-dvi: install-dvi-recursive
1109
1110 install-dvi-am:
1111
1112 install-exec-am: install-libLTLIBRARIES
1113
1114 install-html: install-html-recursive
1115
1116 install-html-am:
1117
1118 install-info: install-info-recursive
1119
1120 install-info-am:
1121
1122 install-man:
1123
1124 install-pdf: install-pdf-recursive
1125
1126 install-pdf-am:
1127
1128 install-ps: install-ps-recursive
1129
1130 install-ps-am:
1131
1132 installcheck-am:
1133
1134 maintainer-clean: maintainer-clean-recursive
1135 -rm -rf ./$(DEPDIR)
1136 -rm -f Makefile
1137 maintainer-clean-am: distclean-am maintainer-clean-generic
1138
1139 mostlyclean: mostlyclean-recursive
1140
1141 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
1142 mostlyclean-libtool
1143
1144 pdf: pdf-recursive
1145
1146 pdf-am:
1147
1148 ps: ps-recursive
1149
1150 ps-am:
1151
1152 uninstall-am: uninstall-libLTLIBRARIES
1153
1154 .MAKE: $(am__recursive_targets) check-am install-am install-strip
1155
1156 .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
1157 check-TESTS check-am clean clean-checkPROGRAMS clean-generic \
1158 clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
1159 ctags-am distclean distclean-compile distclean-generic \
1160 distclean-libtool distclean-tags distdir dvi dvi-am html \
1161 html-am info info-am install install-am install-data \
1162 install-data-am install-dvi install-dvi-am install-exec \
1163 install-exec-am install-html install-html-am install-info \
1164 install-info-am install-libLTLIBRARIES install-man install-pdf \
1165 install-pdf-am install-ps install-ps-am install-strip \
1166 installcheck installcheck-am installdirs installdirs-am \
1167 maintainer-clean maintainer-clean-generic mostlyclean \
1168 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
1169 pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
1170 uninstall-libLTLIBRARIES
1171
1172
1173 check-build:
1174 ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS}
1175
1176 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1177 # Otherwise a system limit (for SysV at least) may be exceeded.
1178 .NOEXPORT:
2626 #include <stdlib.h>
2727 #include <string.h>
2828 #include <stdbool.h>
29 #include <sys/prctl.h>
3029
3130 #include <seccomp.h>
3231
101100 struct db_filter_col *col = (struct db_filter_col *)ctx;
102101 struct db_filter *db;
103102
104 if (db_col_valid(col) || db_action_valid(def_action) < 0)
103 if (ctx == NULL || db_action_valid(def_action) < 0)
105104 return -EINVAL;
106105
107106 db_col_reset(col, def_action);
119118 /* NOTE - function header comment in include/seccomp.h */
120119 API void seccomp_release(scmp_filter_ctx ctx)
121120 {
122 if (_ctx_valid(ctx))
123 return;
124
125121 db_col_release((struct db_filter_col *)ctx);
126122 }
127123
135131 if (db_col_valid(col_dst) || db_col_valid(col_src))
136132 return -EINVAL;
137133
138 /* NOTE: only the default action and NNP settings must match */
134 /* NOTE: only the default action, NNP, and TSYNC settings must match */
139135 if ((col_dst->attr.act_default != col_src->attr.act_default) ||
140 (col_dst->attr.nnp_enable != col_src->attr.nnp_enable))
136 (col_dst->attr.nnp_enable != col_src->attr.nnp_enable) ||
137 (col_dst->attr.tsync_enable != col_src->attr.tsync_enable))
141138 return -EINVAL;
142139
143140 return db_col_merge(col_dst, col_src);
141 }
142
143 /* NOTE - function header comment in include/seccomp.h */
144 API uint32_t seccomp_arch_resolve_name(const char *arch_name)
145 {
146 const struct arch_def *arch;
147
148 if (arch_name == NULL)
149 return 0;
150
151 arch = arch_def_lookup_name(arch_name);
152 if (arch == NULL)
153 return 0;
154
155 return arch->token;
144156 }
145157
146158 /* NOTE - function header comment in include/seccomp.h */
212224 /* NOTE - function header comment in include/seccomp.h */
213225 API int seccomp_load(const scmp_filter_ctx ctx)
214226 {
215 int rc;
216227 struct db_filter_col *col;
217 struct bpf_program *program;
218228
219229 if (_ctx_valid(ctx))
220230 return -EINVAL;
221231 col = (struct db_filter_col *)ctx;
222232
223 program = gen_bpf_generate((struct db_filter_col *)ctx);
224 if (program == NULL)
225 return -ENOMEM;
226 /* attempt to set NO_NEW_PRIVS */
227 if (col->attr.nnp_enable) {
228 rc = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
229 if (rc < 0)
230 return -errno;
231 }
232 /* load the filter into the kernel */
233 rc = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, program);
234 gen_bpf_release(program);
235 if (rc < 0)
236 return -errno;
237
238 return 0;
233 return sys_filter_load(col);
239234 }
240235
241236 /* NOTE - function header comment in include/seccomp.h */
285280 const struct arch_def *arch;
286281
287282 if (name == NULL)
288 return -EINVAL;
283 return __NR_SCMP_ERROR;
289284
290285 if (arch_token == 0)
291286 arch_token = arch_def_native->token;
292287 if (arch_valid(arch_token))
293 return -EINVAL;
288 return __NR_SCMP_ERROR;
294289 arch = arch_def_lookup(arch_token);
295290 if (arch == NULL)
296 return -EFAULT;
291 return __NR_SCMP_ERROR;
297292
298293 return arch_syscall_resolve_name(arch, name);
294 }
295
296 /* NOTE - function header comment in include/seccomp.h */
297 API int seccomp_syscall_resolve_name_rewrite(uint32_t arch_token,
298 const char *name)
299 {
300 int syscall;
301 const struct arch_def *arch;
302
303 if (name == NULL)
304 return __NR_SCMP_ERROR;
305
306 if (arch_token == 0)
307 arch_token = arch_def_native->token;
308 if (arch_valid(arch_token))
309 return __NR_SCMP_ERROR;
310 arch = arch_def_lookup(arch_token);
311 if (arch == NULL)
312 return __NR_SCMP_ERROR;
313
314 syscall = arch_syscall_resolve_name(arch, name);
315 if (syscall == __NR_SCMP_ERROR)
316 return __NR_SCMP_ERROR;
317 if (arch_syscall_rewrite(arch, 0, &syscall) < 0)
318 return __NR_SCMP_ERROR;
319
320 return syscall;
299321 }
300322
301323 /* NOTE - function header comment in include/seccomp.h */
357379 * @param action the filter action
358380 * @param syscall the syscall number
359381 * @param arg_cnt the number of argument filters in the argument filter chain
360 * @param arg_list the argument filter chain, (uint, enum scmp_compare, ulong)
382 * @param arg_array the argument filter chain, (uint, enum scmp_compare, ulong)
361383 *
362384 * This function adds a new argument/comparison/value to the seccomp filter for
363385 * a syscall; multiple arguments can be specified and they will be chained
493515 unsigned int arg_cnt,
494516 const struct scmp_arg_cmp *arg_array)
495517 {
496 if (arg_cnt < 0 || arg_cnt > ARG_COUNT_MAX)
518 /* arg_cnt is unsigned, so no need to check the lower bound */
519 if (arg_cnt > ARG_COUNT_MAX)
497520 return -EINVAL;
498521
499522 return _seccomp_rule_add((struct db_filter_col *)ctx,
510533 struct scmp_arg_cmp arg_array[ARG_COUNT_MAX];
511534 va_list arg_list;
512535
513 if (arg_cnt < 0 || arg_cnt > ARG_COUNT_MAX)
536 /* arg_cnt is unsigned, so no need to check the lower bound */
537 if (arg_cnt > ARG_COUNT_MAX)
514538 return -EINVAL;
515539
516540 va_start(arg_list, arg_cnt);
528552 unsigned int arg_cnt,
529553 const struct scmp_arg_cmp *arg_array)
530554 {
531 if (arg_cnt < 0 || arg_cnt > ARG_COUNT_MAX)
555 /* arg_cnt is unsigned, so no need to check the lower bound */
556 if (arg_cnt > ARG_COUNT_MAX)
532557 return -EINVAL;
533558
534559 return _seccomp_rule_add((struct db_filter_col *)ctx,
545570 struct scmp_arg_cmp arg_array[ARG_COUNT_MAX];
546571 va_list arg_list;
547572
548 if (arg_cnt < 0 || arg_cnt > ARG_COUNT_MAX)
573 /* arg_cnt is unsigned, so no need to check the lower bound */
574 if (arg_cnt > ARG_COUNT_MAX)
549575 return -EINVAL;
550576
551577 va_start(arg_list, arg_cnt);
0 /**
1 * Enhanced Seccomp AArch64 Syscall Table
2 *
3 * Copyright (c) 2014 Red Hat <mjuszkiewicz@redhat.com>
4 * Author: Marcin Juszkiewicz <mjuszkiewicz@redhat.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 #include <string.h>
22
23 #include <seccomp.h>
24
25 #include "arch.h"
26 #include "arch-aarch64.h"
27
28 /* NOTE: based on Linux 3.19 */
29 const struct arch_syscall_def aarch64_syscall_table[] = { \
30 { "_llseek", __PNR__llseek },
31 { "_newselect", __PNR__newselect },
32 { "_sysctl", __PNR__sysctl },
33 { "accept", 202 },
34 { "accept4", 242 },
35 { "access", __PNR_access },
36 { "acct", 89 },
37 { "add_key", 217 },
38 { "adjtimex", 171 },
39 { "afs_syscall", __PNR_afs_syscall },
40 { "alarm", __PNR_alarm },
41 { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
42 { "arm_sync_file_range", __PNR_arm_sync_file_range },
43 { "arch_prctl", __PNR_arch_prctl },
44 { "bdflush", __PNR_bdflush },
45 { "bind", 200 },
46 { "bpf", 280 },
47 { "break", __PNR_break },
48 { "breakpoint", __PNR_breakpoint },
49 { "brk", 214 },
50 { "cachectl", __PNR_cachectl },
51 { "cacheflush", __PNR_cacheflush },
52 { "capget", 90 },
53 { "capset", 91 },
54 { "chdir", 49 },
55 { "chmod", __PNR_chmod },
56 { "chown", __PNR_chown },
57 { "chown32", __PNR_chown32 },
58 { "chroot", 51 },
59 { "clock_adjtime", 266 },
60 { "clock_getres", 114 },
61 { "clock_gettime", 113 },
62 { "clock_nanosleep", 115 },
63 { "clock_settime", 112 },
64 { "clone", 220 },
65 { "close", 57 },
66 { "connect", 203 },
67 { "creat", __PNR_creat },
68 { "create_module", __PNR_create_module },
69 { "delete_module", 106 },
70 { "dup", 23 },
71 { "dup2", __PNR_dup2 },
72 { "dup3", 24 },
73 { "epoll_create", __PNR_epoll_create },
74 { "epoll_create1", 20 },
75 { "epoll_ctl", 21 },
76 { "epoll_ctl_old", __PNR_epoll_ctl_old },
77 { "epoll_pwait", 22 },
78 { "epoll_wait", __PNR_epoll_wait },
79 { "epoll_wait_old", __PNR_epoll_wait_old },
80 { "eventfd", __PNR_eventfd },
81 { "eventfd2", 19 },
82 { "execve", 221 },
83 { "execveat", 281 },
84 { "exit", 93 },
85 { "exit_group", 94 },
86 { "faccessat", 48 },
87 { "fadvise64", 223 },
88 { "fadvise64_64", __PNR_fadvise64_64 },
89 { "fallocate", 47 },
90 { "fanotify_init", 262 },
91 { "fanotify_mark", 263 },
92 { "fchdir", 50 },
93 { "fchmod", 52 },
94 { "fchmodat", 53 },
95 { "fchown", 55 },
96 { "fchown32", __PNR_fchown32 },
97 { "fchownat", 54 },
98 { "fcntl", 25 },
99 { "fcntl64", __PNR_fcntl64 },
100 { "fdatasync", 83 },
101 { "fgetxattr", 10 },
102 { "finit_module", 273 },
103 { "flistxattr", 13 },
104 { "flock", 32 },
105 { "fork", __PNR_fork },
106 { "fremovexattr", 16 },
107 { "fsetxattr", 7 },
108 { "fstat", 80 },
109 { "fstat64", __PNR_fstat64 },
110 { "fstatat64", __PNR_fstatat64 },
111 { "fstatfs", 44 },
112 { "fstatfs64", __PNR_fstatfs64 },
113 { "fsync", 82 },
114 { "ftime", __PNR_ftime },
115 { "ftruncate", 46 },
116 { "ftruncate64", __PNR_ftruncate64 },
117 { "futex", 98 },
118 { "futimesat", __PNR_futimesat },
119 { "get_kernel_syms", __PNR_get_kernel_syms },
120 { "get_mempolicy", 236 },
121 { "get_robust_list", 100 },
122 { "get_thread_area", __PNR_get_thread_area },
123 { "getcpu", 168 },
124 { "getcwd", 17 },
125 { "getdents", __PNR_getdents },
126 { "getdents64", 61 },
127 { "getegid", 177 },
128 { "getegid32", __PNR_getegid32 },
129 { "geteuid", 175 },
130 { "geteuid32", __PNR_geteuid32 },
131 { "getgid", 176 },
132 { "getgid32", __PNR_getgid32 },
133 { "getgroups", 158 },
134 { "getgroups32", __PNR_getgroups32 },
135 { "getitimer", 102 },
136 { "getpeername", 205 },
137 { "getpgid", 155 },
138 { "getpgrp", __PNR_getpgrp },
139 { "getpid", 172 },
140 { "getpmsg", __PNR_getpmsg },
141 { "getppid", 173 },
142 { "getpriority", 141 },
143 { "getrandom", 278 },
144 { "getresgid", 150 },
145 { "getresgid32", __PNR_getresgid32 },
146 { "getresuid", 148 },
147 { "getresuid32", __PNR_getresuid32 },
148 { "getrlimit", 163 },
149 { "getrusage", 165 },
150 { "getsid", 156 },
151 { "getsockname", 204 },
152 { "getsockopt", 209 },
153 { "gettid", 178 },
154 { "gettimeofday", 169 },
155 { "getuid", 174 },
156 { "getuid32", __PNR_getuid32 },
157 { "getxattr", 8 },
158 { "gtty", __PNR_gtty },
159 { "idle", __PNR_idle },
160 { "init_module", 105 },
161 { "inotify_add_watch", 27 },
162 { "inotify_init", __PNR_inotify_init },
163 { "inotify_init1", 26 },
164 { "inotify_rm_watch", 28 },
165 { "io_cancel", 3 },
166 { "io_destroy", 1 },
167 { "io_getevents", 4 },
168 { "io_setup", 0 },
169 { "io_submit", 2 },
170 { "ioctl", 29 },
171 { "ioperm", __PNR_ioperm },
172 { "iopl", __PNR_iopl },
173 { "ioprio_get", 31 },
174 { "ioprio_set", 30 },
175 { "ipc", __PNR_ipc },
176 { "kcmp", 272 },
177 { "kexec_file_load", __PNR_kexec_file_load },
178 { "kexec_load", 104 },
179 { "keyctl", 219 },
180 { "kill", 129 },
181 { "lchown", __PNR_lchown },
182 { "lchown32", __PNR_lchown32 },
183 { "lgetxattr", 9 },
184 { "link", __PNR_link },
185 { "linkat", 37 },
186 { "listen", 201 },
187 { "listxattr", 11 },
188 { "llistxattr", 12 },
189 { "lock", __PNR_lock },
190 { "lookup_dcookie", 18 },
191 { "lremovexattr", 15 },
192 { "lseek", 62 },
193 { "lsetxattr", 6 },
194 { "lstat", __PNR_lstat },
195 { "lstat64", __PNR_lstat64 },
196 { "madvise", 233 },
197 { "mbind", 235 },
198 { "memfd_create", 279 },
199 { "migrate_pages", 238 },
200 { "mincore", 232 },
201 { "mkdir", __PNR_mkdir },
202 { "mkdirat", 34 },
203 { "mknod", __PNR_mknod },
204 { "mknodat", 33 },
205 { "mlock", 228 },
206 { "mlockall", 230 },
207 { "mmap", 222 },
208 { "mmap2", __PNR_mmap2 },
209 { "modify_ldt", __PNR_modify_ldt },
210 { "mount", 40 },
211 { "move_pages", 239 },
212 { "mprotect", 226 },
213 { "mpx", __PNR_mpx },
214 { "mq_getsetattr", 185 },
215 { "mq_notify", 184 },
216 { "mq_open", 180 },
217 { "mq_timedreceive", 183 },
218 { "mq_timedsend", 182 },
219 { "mq_unlink", 181 },
220 { "mremap", 216 },
221 { "msgctl", 187 },
222 { "msgget", 186 },
223 { "msgrcv", 188 },
224 { "msgsnd", 189 },
225 { "msync", 227 },
226 { "munlock", 229 },
227 { "munlockall", 231 },
228 { "munmap", 215 },
229 { "name_to_handle_at", 264 },
230 { "nanosleep", 101 },
231 { "newfstatat", 79 },
232 { "nfsservctl", 42 },
233 { "nice", __PNR_nice },
234 { "oldfstat", __PNR_oldfstat },
235 { "oldlstat", __PNR_oldlstat },
236 { "oldolduname", __PNR_oldolduname },
237 { "oldstat", __PNR_oldstat },
238 { "olduname", __PNR_olduname },
239 { "oldwait4", __PNR_oldwait4 },
240 { "open", __PNR_open },
241 { "open_by_handle_at", 265 },
242 { "openat", 56 },
243 { "pause", __PNR_pause },
244 { "pciconfig_iobase", __PNR_pciconfig_iobase },
245 { "pciconfig_read", __PNR_pciconfig_read },
246 { "pciconfig_write", __PNR_pciconfig_write },
247 { "perf_event_open", 241 },
248 { "personality", 92 },
249 { "pipe", __PNR_pipe },
250 { "pipe2", 59 },
251 { "pivot_root", 41 },
252 { "poll", __PNR_poll },
253 { "ppoll", 73 },
254 { "prctl", 167 },
255 { "pread64", 67 },
256 { "preadv", 69 },
257 { "prlimit64", 261 },
258 { "process_vm_readv", 270 },
259 { "process_vm_writev", 271 },
260 { "prof", __PNR_prof },
261 { "profil", __PNR_profil },
262 { "pselect6", 72 },
263 { "ptrace", 117 },
264 { "putpmsg", __PNR_putpmsg },
265 { "pwrite64", 68 },
266 { "pwritev", 70 },
267 { "query_module", __PNR_query_module },
268 { "quotactl", 60 },
269 { "read", 63 },
270 { "readahead", 213 },
271 { "readdir", __PNR_readdir },
272 { "readlink", __PNR_readlink },
273 { "readlinkat", 78 },
274 { "readv", 65 },
275 { "reboot", 142 },
276 { "recv", __PNR_recv },
277 { "recvfrom", 207 },
278 { "recvmmsg", 243 },
279 { "recvmsg", 212 },
280 { "remap_file_pages", 234 },
281 { "removexattr", 14 },
282 { "rename", __PNR_rename },
283 { "renameat", 38 },
284 { "renameat2", 276 },
285 { "request_key", 218 },
286 { "restart_syscall", 128 },
287 { "rmdir", __PNR_rmdir },
288 { "rt_sigaction", 134 },
289 { "rt_sigpending", 136 },
290 { "rt_sigprocmask", 135 },
291 { "rt_sigqueueinfo", 138 },
292 { "rt_sigreturn", 139 },
293 { "rt_sigsuspend", 133 },
294 { "rt_sigtimedwait", 137 },
295 { "rt_tgsigqueueinfo", 240 },
296 { "sched_get_priority_max", 125 },
297 { "sched_get_priority_min", 126 },
298 { "sched_getaffinity", 123 },
299 { "sched_getattr", 275 },
300 { "sched_getparam", 121 },
301 { "sched_getscheduler", 120 },
302 { "sched_rr_get_interval", 127 },
303 { "sched_setaffinity", 122 },
304 { "sched_setattr", 274 },
305 { "sched_setparam", 118 },
306 { "sched_setscheduler", 119 },
307 { "sched_yield", 124 },
308 { "seccomp", 277 },
309 { "security", __PNR_security },
310 { "select", __PNR_select },
311 { "semctl", 191 },
312 { "semget", 190 },
313 { "semop", 193 },
314 { "semtimedop", 192 },
315 { "send", __PNR_send },
316 { "sendfile", 71 },
317 { "sendfile64", __PNR_sendfile64 },
318 { "sendmmsg", 269 },
319 { "sendmsg", 211 },
320 { "sendto", 206 },
321 { "set_mempolicy", 237 },
322 { "set_robust_list", 99 },
323 { "set_thread_area", __PNR_set_thread_area },
324 { "set_tid_address", 96 },
325 { "set_tls", __PNR_set_tls },
326 { "setdomainname", 162 },
327 { "setfsgid", 152 },
328 { "setfsgid32", __PNR_setfsgid32 },
329 { "setfsuid", 151 },
330 { "setfsuid32", __PNR_setfsuid32 },
331 { "setgid", 144 },
332 { "setgid32", __PNR_setgid32 },
333 { "setgroups", 159 },
334 { "setgroups32", __PNR_setgroups32 },
335 { "sethostname", 161 },
336 { "setitimer", 103 },
337 { "setns", 268 },
338 { "setpgid", 154 },
339 { "setpriority", 140 },
340 { "setregid", 143 },
341 { "setregid32", __PNR_setregid32 },
342 { "setresgid", 149 },
343 { "setresgid32", __PNR_setresgid32 },
344 { "setresuid", 147 },
345 { "setresuid32", __PNR_setresuid32 },
346 { "setreuid", 145 },
347 { "setreuid32", __PNR_setreuid32 },
348 { "setrlimit", 164 },
349 { "setsid", 157 },
350 { "setsockopt", 208 },
351 { "settimeofday", 170 },
352 { "setuid", 146 },
353 { "setuid32", __PNR_setuid32 },
354 { "setxattr", 5 },
355 { "sgetmask", __PNR_sgetmask },
356 { "shmat", 196 },
357 { "shmctl", 195 },
358 { "shmdt", 197 },
359 { "shmget", 194 },
360 { "shutdown", 210 },
361 { "sigaction", __PNR_sigaction },
362 { "sigaltstack", 132 },
363 { "signal", __PNR_signal },
364 { "signalfd", __PNR_signalfd },
365 { "signalfd4", 74 },
366 { "sigpending", __PNR_sigpending },
367 { "sigprocmask", __PNR_sigprocmask },
368 { "sigreturn", __PNR_sigreturn },
369 { "sigsuspend", __PNR_sigsuspend },
370 { "socket", 198 },
371 { "socketcall", __PNR_socketcall },
372 { "socketpair", 199 },
373 { "splice", 76 },
374 { "ssetmask", __PNR_ssetmask },
375 { "stat", __PNR_stat },
376 { "stat64", __PNR_stat64 },
377 { "statfs", 43 },
378 { "statfs64", __PNR_statfs64 },
379 { "stime", __PNR_stime },
380 { "stty", __PNR_stty },
381 { "swapoff", 225 },
382 { "swapon", 224 },
383 { "symlink", __PNR_symlink },
384 { "symlinkat", 36 },
385 { "sync", 81 },
386 { "sync_file_range", 84 },
387 { "sync_file_range2", __PNR_sync_file_range2 },
388 { "syncfs", 267 },
389 { "syscall", __PNR_syscall },
390 { "sysfs", __PNR_sysfs },
391 { "sysinfo", 179 },
392 { "syslog", 116 },
393 { "sysmips", __PNR_sysmips },
394 { "tee", 77 },
395 { "tgkill", 131 },
396 { "time", __PNR_time },
397 { "timer_create", 107 },
398 { "timer_delete", 111 },
399 { "timer_getoverrun", 109 },
400 { "timer_gettime", 108 },
401 { "timer_settime", 110 },
402 { "timerfd", __PNR_timerfd },
403 { "timerfd_create", 85 },
404 { "timerfd_gettime", 87 },
405 { "timerfd_settime", 86 },
406 { "times", 153 },
407 { "tkill", 130 },
408 { "truncate", 45 },
409 { "truncate64", __PNR_truncate64 },
410 { "tuxcall", __PNR_tuxcall },
411 { "ugetrlimit", __PNR_ugetrlimit },
412 { "ulimit", __PNR_ulimit },
413 { "umask", 166 },
414 { "umount", __PNR_umount },
415 { "umount2", 39 },
416 { "uname", 160 },
417 { "unlink", __PNR_unlink },
418 { "unlinkat", 35 },
419 { "unshare", 97 },
420 { "uselib", __PNR_uselib },
421 { "usr26", __PNR_usr26 },
422 { "usr32", __PNR_usr32 },
423 { "ustat", __PNR_ustat },
424 { "utime", __PNR_utime },
425 { "utimensat", 88 },
426 { "utimes", __PNR_utimes },
427 { "vfork", __PNR_vfork },
428 { "vhangup", 58 },
429 { "vm86", __PNR_vm86 },
430 { "vm86old", __PNR_vm86old },
431 { "vmsplice", 75 },
432 { "vserver", __PNR_vserver },
433 { "wait4", 260 },
434 { "waitid", 95 },
435 { "waitpid", __PNR_waitpid },
436 { "write", 64 },
437 { "writev", 66 },
438 { NULL, __NR_SCMP_ERROR },
439 };
440
441 /**
442 * Resolve a syscall name to a number
443 * @param name the syscall name
444 *
445 * Resolve the given syscall name to the syscall number using the syscall table.
446 * Returns the syscall number on success, including negative pseudo syscall
447 * numbers; returns __NR_SCMP_ERROR on failure.
448 *
449 */
450 int aarch64_syscall_resolve_name(const char *name)
451 {
452 unsigned int iter;
453 const struct arch_syscall_def *table = aarch64_syscall_table;
454
455 /* XXX - plenty of room for future improvement here */
456 for (iter = 0; table[iter].name != NULL; iter++) {
457 if (strcmp(name, table[iter].name) == 0)
458 return table[iter].num;
459 }
460
461 return __NR_SCMP_ERROR;
462 }
463
464 /**
465 * Resolve a syscall number to a name
466 * @param num the syscall number
467 *
468 * Resolve the given syscall number to the syscall name using the syscall table.
469 * Returns a pointer to the syscall name string on success, including pseudo
470 * syscall names; returns NULL on failure.
471 *
472 */
473 const char *aarch64_syscall_resolve_num(int num)
474 {
475 unsigned int iter;
476 const struct arch_syscall_def *table = aarch64_syscall_table;
477
478 /* XXX - plenty of room for future improvement here */
479 for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
480 if (num == table[iter].num)
481 return table[iter].name;
482 }
483
484 return NULL;
485 }
486
487
488 /**
489 * Iterate through the syscall table and return the syscall name
490 * @param spot the offset into the syscall table
491 *
492 * Return the syscall name at position @spot or NULL on failure. This function
493 * should only ever be used internally by libseccomp.
494 *
495 */
496 const char *aarch64_syscall_iterate_name(unsigned int spot)
497 {
498 /* XXX - no safety checks here */
499 return aarch64_syscall_table[spot].name;
500 }
0 /**
1 * Enhanced Seccomp AArch64 Syscall Table
2 *
3 * Copyright (c) 2014 Red Hat <mjuszkiewicz@redhat.com>
4 * Author: Marcin Juszkiewicz <mjuszkiewicz@redhat.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 #include <stdlib.h>
22 #include <errno.h>
23 #include <linux/audit.h>
24
25 #include "arch.h"
26 #include "arch-aarch64.h"
27
28 const struct arch_def arch_def_aarch64 = {
29 .token = SCMP_ARCH_AARCH64,
30 .token_bpf = AUDIT_ARCH_AARCH64,
31 .size = ARCH_SIZE_64,
32 .endian = ARCH_ENDIAN_LITTLE,
33 };
0 /**
1 * Enhanced Seccomp AArch64 Syscall Table
2 *
3 * Copyright (c) 2014 Red Hat <mjuszkiewicz@redhat.com>
4 * Author: Marcin Juszkiewicz <mjuszkiewicz@redhat.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 #ifndef _ARCH_AARCH64_H
22 #define _ARCH_AARCH64_H
23
24 #include <inttypes.h>
25
26 #include "arch.h"
27 #include "system.h"
28
29 extern const struct arch_def arch_def_aarch64;
30
31 int aarch64_syscall_resolve_name(const char *name);
32 const char *aarch64_syscall_resolve_num(int num);
33
34 const char *aarch64_syscall_iterate_name(unsigned int spot);
35 #endif
2626 #include "arch-arm.h"
2727
2828 #define __NR_OABI_SYSCALL_BASE 0x900000
29 #define __ARM_NR_BASE 0x0f0000
2930
3031 /* NOTE: we currently only support the ARM EABI, more info at the URL below:
3132 * -> http://wiki.embeddedarm.com/wiki/EABI_vs_OABI */
3536 #define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
3637 #endif
3738
38 /* NOTE: based on Linux 3.8.0-rc5 */
39 /* NOTE: based on Linux 3.19 */
3940 const struct arch_syscall_def arm_syscall_table[] = { \
4041 /* NOTE: arm_sync_file_range() and sync_file_range2() share values */
42 { "_llseek", (__NR_SYSCALL_BASE + 140) },
43 { "_newselect", (__NR_SYSCALL_BASE + 142) },
44 { "_sysctl", (__NR_SYSCALL_BASE + 149) },
4145 { "accept", (__NR_SYSCALL_BASE + 285) },
4246 { "accept4", (__NR_SYSCALL_BASE + 366) },
4347 { "access", (__NR_SYSCALL_BASE + 33) },
4549 { "add_key", (__NR_SYSCALL_BASE + 309) },
4650 { "adjtimex", (__NR_SYSCALL_BASE + 124) },
4751 { "afs_syscall", __PNR_afs_syscall },
48 { "alarm", (__NR_SYSCALL_BASE + 27) },
52 { "alarm", __PNR_alarm },
4953 { "arm_fadvise64_64", (__NR_SYSCALL_BASE + 270) },
5054 { "arm_sync_file_range", (__NR_SYSCALL_BASE + 341) },
5155 { "arch_prctl", __PNR_arch_prctl },
5256 { "bdflush", (__NR_SYSCALL_BASE + 134) },
5357 { "bind", (__NR_SYSCALL_BASE + 282) },
58 { "bpf", (__NR_SYSCALL_BASE + 386) },
5459 { "break", __PNR_break },
60 { "breakpoint", (__NR_SYSCALL_BASE + (__ARM_NR_BASE + 1)) },
5561 { "brk", (__NR_SYSCALL_BASE + 45) },
62 { "cachectl", __PNR_cachectl },
63 { "cacheflush", (__NR_SYSCALL_BASE + (__ARM_NR_BASE + 2)) },
5664 { "capget", (__NR_SYSCALL_BASE + 184) },
5765 { "capset", (__NR_SYSCALL_BASE + 185) },
5866 { "chdir", (__NR_SYSCALL_BASE + 12) },
8492 { "eventfd", (__NR_SYSCALL_BASE + 351) },
8593 { "eventfd2", (__NR_SYSCALL_BASE + 356) },
8694 { "execve", (__NR_SYSCALL_BASE + 11) },
95 { "execveat", (__NR_SYSCALL_BASE + 387) },
8796 { "exit", (__NR_SYSCALL_BASE + 1) },
8897 { "exit_group", (__NR_SYSCALL_BASE + 248) },
8998 { "faccessat", (__NR_SYSCALL_BASE + 334) },
143152 { "getpmsg", __PNR_getpmsg },
144153 { "getppid", (__NR_SYSCALL_BASE + 64) },
145154 { "getpriority", (__NR_SYSCALL_BASE + 96) },
155 { "getrandom", (__NR_SYSCALL_BASE + 384) },
146156 { "getresgid", (__NR_SYSCALL_BASE + 171) },
147157 { "getresgid32", (__NR_SYSCALL_BASE + 211) },
148158 { "getresuid", (__NR_SYSCALL_BASE + 165) },
149159 { "getresuid32", (__NR_SYSCALL_BASE + 209) },
150 { "getrlimit", (__NR_SYSCALL_BASE + 76) },
160 { "getrlimit", __PNR_getrlimit },
151161 { "getrusage", (__NR_SYSCALL_BASE + 77) },
152162 { "getsid", (__NR_SYSCALL_BASE + 147) },
153163 { "getsockname", (__NR_SYSCALL_BASE + 286) },
174184 { "iopl", __PNR_iopl },
175185 { "ioprio_get", (__NR_SYSCALL_BASE + 315) },
176186 { "ioprio_set", (__NR_SYSCALL_BASE + 314) },
177 { "ipc", (__NR_SYSCALL_BASE + 117) },
178 { "kcmp", __PNR_kcmp },
187 { "ipc", __PNR_ipc },
188 { "kcmp", (__NR_SYSCALL_BASE + 378) },
189 { "kexec_file_load", __PNR_kexec_file_load },
179190 { "kexec_load", (__NR_SYSCALL_BASE + 347) },
180191 { "keyctl", (__NR_SYSCALL_BASE + 311) },
181192 { "kill", (__NR_SYSCALL_BASE + 37) },
187198 { "listen", (__NR_SYSCALL_BASE + 284) },
188199 { "listxattr", (__NR_SYSCALL_BASE + 232) },
189200 { "llistxattr", (__NR_SYSCALL_BASE + 233) },
190 { "_llseek", (__NR_SYSCALL_BASE + 140) },
191201 { "lock", __PNR_lock },
192202 { "lookup_dcookie", (__NR_SYSCALL_BASE + 249) },
193203 { "lremovexattr", (__NR_SYSCALL_BASE + 236) },
197207 { "lstat64", (__NR_SYSCALL_BASE + 196) },
198208 { "madvise", (__NR_SYSCALL_BASE + 220) },
199209 { "mbind", (__NR_SYSCALL_BASE + 319) },
210 { "memfd_create", (__NR_SYSCALL_BASE + 385) },
200211 { "migrate_pages", __PNR_migrate_pages },
201212 { "mincore", (__NR_SYSCALL_BASE + 219) },
202213 { "mkdir", (__NR_SYSCALL_BASE + 39) },
205216 { "mknodat", (__NR_SYSCALL_BASE + 324) },
206217 { "mlock", (__NR_SYSCALL_BASE + 150) },
207218 { "mlockall", (__NR_SYSCALL_BASE + 152) },
208 { "mmap", (__NR_SYSCALL_BASE + 90) },
219 { "mmap", __PNR_mmap },
209220 { "mmap2", (__NR_SYSCALL_BASE + 192) },
210221 { "modify_ldt", __PNR_modify_ldt },
211222 { "mount", (__NR_SYSCALL_BASE + 21) },
229240 { "munmap", (__NR_SYSCALL_BASE + 91) },
230241 { "name_to_handle_at", (__NR_SYSCALL_BASE + 370) },
231242 { "nanosleep", (__NR_SYSCALL_BASE + 162) },
232 { "_newselect", (__NR_SYSCALL_BASE + 142) },
233243 { "newfstatat", __PNR_newfstatat },
234244 { "nfsservctl", (__NR_SYSCALL_BASE + 169) },
235245 { "nice", (__NR_SYSCALL_BASE + 34) },
238248 { "oldolduname", __PNR_oldolduname },
239249 { "oldstat", __PNR_oldstat },
240250 { "olduname", __PNR_olduname },
251 { "oldwait4", __PNR_oldwait4 },
241252 { "open", (__NR_SYSCALL_BASE + 5) },
242253 { "open_by_handle_at", (__NR_SYSCALL_BASE + 371) },
243254 { "openat", (__NR_SYSCALL_BASE + 322) },
269280 { "quotactl", (__NR_SYSCALL_BASE + 131) },
270281 { "read", (__NR_SYSCALL_BASE + 3) },
271282 { "readahead", (__NR_SYSCALL_BASE + 225) },
272 { "readdir", (__NR_SYSCALL_BASE + 89) },
283 { "readdir", __PNR_readdir },
273284 { "readlink", (__NR_SYSCALL_BASE + 85) },
274285 { "readlinkat", (__NR_SYSCALL_BASE + 332) },
275286 { "readv", (__NR_SYSCALL_BASE + 145) },
282293 { "removexattr", (__NR_SYSCALL_BASE + 235) },
283294 { "rename", (__NR_SYSCALL_BASE + 38) },
284295 { "renameat", (__NR_SYSCALL_BASE + 329) },
296 { "renameat2", (__NR_SYSCALL_BASE + 382) },
285297 { "request_key", (__NR_SYSCALL_BASE + 310) },
286298 { "restart_syscall", (__NR_SYSCALL_BASE + 0) },
287299 { "rmdir", (__NR_SYSCALL_BASE + 40) },
296308 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 159) },
297309 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 160) },
298310 { "sched_getaffinity", (__NR_SYSCALL_BASE + 242) },
311 { "sched_getattr", (__NR_SYSCALL_BASE + 381) },
299312 { "sched_getparam", (__NR_SYSCALL_BASE + 155) },
300313 { "sched_getscheduler", (__NR_SYSCALL_BASE + 157) },
301314 { "sched_rr_get_interval", (__NR_SYSCALL_BASE + 161) },
302315 { "sched_setaffinity", (__NR_SYSCALL_BASE + 241) },
316 { "sched_setattr", (__NR_SYSCALL_BASE + 380) },
303317 { "sched_setparam", (__NR_SYSCALL_BASE + 154) },
304318 { "sched_setscheduler", (__NR_SYSCALL_BASE + 156) },
305319 { "sched_yield", (__NR_SYSCALL_BASE + 158) },
320 { "seccomp", (__NR_SYSCALL_BASE + 383) },
306321 { "security", __PNR_security },
307 { "select", (__NR_SYSCALL_BASE + 82) },
322 { "select", __PNR_select },
308323 { "semctl", (__NR_SYSCALL_BASE + 300) },
309324 { "semget", (__NR_SYSCALL_BASE + 299) },
310325 { "semop", (__NR_SYSCALL_BASE + 298) },
319334 { "set_robust_list", (__NR_SYSCALL_BASE + 338) },
320335 { "set_thread_area", __PNR_set_thread_area },
321336 { "set_tid_address", (__NR_SYSCALL_BASE + 256) },
337 { "set_tls", (__NR_SYSCALL_BASE + (__ARM_NR_BASE + 5)) },
322338 { "setdomainname", (__NR_SYSCALL_BASE + 121) },
323339 { "setfsgid", (__NR_SYSCALL_BASE + 139) },
324340 { "setfsgid32", (__NR_SYSCALL_BASE + 216) },
364380 { "sigreturn", (__NR_SYSCALL_BASE + 119) },
365381 { "sigsuspend", (__NR_SYSCALL_BASE + 72) },
366382 { "socket", (__NR_SYSCALL_BASE + 281) },
367 { "socketcall", (__NR_SYSCALL_BASE + 102) },
383 { "socketcall", __PNR_socketcall },
368384 { "socketpair", (__NR_SYSCALL_BASE + 288) },
369385 { "splice", (__NR_SYSCALL_BASE + 340) },
370386 { "ssetmask", __PNR_ssetmask },
372388 { "stat64", (__NR_SYSCALL_BASE + 195) },
373389 { "statfs", (__NR_SYSCALL_BASE + 99) },
374390 { "statfs64", (__NR_SYSCALL_BASE + 266) },
375 { "stime", (__NR_SYSCALL_BASE + 25) },
391 { "stime", __PNR_stime },
376392 { "stty", __PNR_stty },
377393 { "swapoff", (__NR_SYSCALL_BASE + 115) },
378394 { "swapon", (__NR_SYSCALL_BASE + 87) },
382398 { "sync_file_range", __PNR_sync_file_range },
383399 { "sync_file_range2", (__NR_SYSCALL_BASE + 341) },
384400 { "syncfs", (__NR_SYSCALL_BASE + 373) },
385 { "syscall", (__NR_SYSCALL_BASE + 113) },
386 { "_sysctl", (__NR_SYSCALL_BASE + 149) },
401 { "syscall", __PNR_syscall },
387402 { "sysfs", (__NR_SYSCALL_BASE + 135) },
388403 { "sysinfo", (__NR_SYSCALL_BASE + 116) },
389404 { "syslog", (__NR_SYSCALL_BASE + 103) },
405 { "sysmips", __PNR_sysmips },
390406 { "tee", (__NR_SYSCALL_BASE + 342) },
391407 { "tgkill", (__NR_SYSCALL_BASE + 268) },
392 { "time", (__NR_SYSCALL_BASE + 13) },
408 { "time", __PNR_time },
393409 { "timer_create", (__NR_SYSCALL_BASE + 257) },
394410 { "timer_delete", (__NR_SYSCALL_BASE + 261) },
395411 { "timer_getoverrun", (__NR_SYSCALL_BASE + 260) },
396412 { "timer_gettime", (__NR_SYSCALL_BASE + 259) },
397413 { "timer_settime", (__NR_SYSCALL_BASE + 258) },
414 { "timerfd", __PNR_timerfd },
398415 { "timerfd_create", (__NR_SYSCALL_BASE + 350) },
399416 { "timerfd_gettime", (__NR_SYSCALL_BASE + 354) },
400417 { "timerfd_settime", (__NR_SYSCALL_BASE + 353) },
406423 { "ugetrlimit", (__NR_SYSCALL_BASE + 191) },
407424 { "ulimit", __PNR_ulimit },
408425 { "umask", (__NR_SYSCALL_BASE + 60) },
409 { "umount", (__NR_SYSCALL_BASE + 22) },
426 { "umount", __PNR_umount },
410427 { "umount2", (__NR_SYSCALL_BASE + 52) },
411428 { "uname", (__NR_SYSCALL_BASE + 122) },
412429 { "unlink", (__NR_SYSCALL_BASE + 10) },
413430 { "unlinkat", (__NR_SYSCALL_BASE + 328) },
414431 { "unshare", (__NR_SYSCALL_BASE + 337) },
415432 { "uselib", (__NR_SYSCALL_BASE + 86) },
433 { "usr26", (__NR_SYSCALL_BASE + (__ARM_NR_BASE + 3)) },
434 { "usr32", (__NR_SYSCALL_BASE + (__ARM_NR_BASE + 4)) },
416435 { "ustat", (__NR_SYSCALL_BASE + 62) },
417 { "utime", (__NR_SYSCALL_BASE + 30) },
436 { "utime", __PNR_utime },
418437 { "utimensat", (__NR_SYSCALL_BASE + 348) },
419438 { "utimes", (__NR_SYSCALL_BASE + 269) },
420439 { "vfork", (__NR_SYSCALL_BASE + 190) },
476495
477496 return NULL;
478497 }
498
499 /**
500 * Iterate through the syscall table and return the syscall name
501 * @param spot the offset into the syscall table
502 *
503 * Return the syscall name at position @spot or NULL on failure. This function
504 * should only ever be used internally by libseccomp.
505 *
506 */
507 const char *arm_syscall_iterate_name(unsigned int spot)
508 {
509 /* XXX - no safety checks here */
510 return arm_syscall_table[spot].name;
511 }
2626 #include "arch.h"
2727 #include "system.h"
2828
29 #define arm_arg_count_max 6
30
3129 extern const struct arch_def arch_def_arm;
3230
3331 int arm_syscall_resolve_name(const char *name);
3432 const char *arm_syscall_resolve_num(int num);
3533
34 const char *arm_syscall_iterate_name(unsigned int spot);
35
3636 #endif
0 /**
1 * Enhanced Seccomp MIPS Specific Code
2 *
3 * Copyright (c) 2014 Imagination Technologies Ltd.
4 * Author: Markos Chandras <markos.chandras@imgtec.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #include <string.h>
23
24 #include <seccomp.h>
25
26 #include "arch.h"
27 #include "arch-mips.h"
28
29 /* O32 ABI */
30 #define __NR_SYSCALL_BASE 4000
31
32 /* NOTE: based on Linux 3.19 */
33 const struct arch_syscall_def mips_syscall_table[] = { \
34 { "_llseek", (__NR_SYSCALL_BASE + 140) },
35 { "_newselect", (__NR_SYSCALL_BASE + 142) },
36 { "_sysctl", (__NR_SYSCALL_BASE + 153) },
37 { "accept", (__NR_SYSCALL_BASE + 168) },
38 { "accept4", (__NR_SYSCALL_BASE + 334) },
39 { "access", (__NR_SYSCALL_BASE + 33) },
40 { "acct", (__NR_SYSCALL_BASE + 51) },
41 { "add_key", (__NR_SYSCALL_BASE + 280) },
42 { "adjtimex", (__NR_SYSCALL_BASE + 124) },
43 { "afs_syscall", __NR_SYSCALL_BASE + 137 },
44 { "alarm", (__NR_SYSCALL_BASE + 27) },
45 { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
46 { "arm_sync_file_range", __PNR_arm_sync_file_range },
47 { "arch_prctl", __PNR_arch_prctl },
48 { "bdflush", (__NR_SYSCALL_BASE + 134) },
49 { "bind", (__NR_SYSCALL_BASE + 169) },
50 { "bpf", (__NR_SYSCALL_BASE + 355) },
51 { "break", __NR_SYSCALL_BASE + 17 },
52 { "breakpoint", __PNR_breakpoint },
53 { "brk", (__NR_SYSCALL_BASE + 45) },
54 { "cachectl", (__NR_SYSCALL_BASE + 148) },
55 { "cacheflush", (__NR_SYSCALL_BASE + 147) },
56 { "capget", (__NR_SYSCALL_BASE + 204) },
57 { "capset", (__NR_SYSCALL_BASE + 205) },
58 { "chdir", (__NR_SYSCALL_BASE + 12) },
59 { "chmod", (__NR_SYSCALL_BASE + 15) },
60 { "chown", (__NR_SYSCALL_BASE + 202) },
61 { "chown32", (__PNR_chown32) },
62 { "chroot", (__NR_SYSCALL_BASE + 61) },
63 { "clock_adjtime", (__NR_SYSCALL_BASE + 341) },
64 { "clock_getres", (__NR_SYSCALL_BASE + 264) },
65 { "clock_gettime", (__NR_SYSCALL_BASE + 263) },
66 { "clock_nanosleep", (__NR_SYSCALL_BASE + 265) },
67 { "clock_settime", (__NR_SYSCALL_BASE + 262) },
68 { "clone", (__NR_SYSCALL_BASE + 120) },
69 { "close", (__NR_SYSCALL_BASE + 6) },
70 { "connect", (__NR_SYSCALL_BASE + 170) },
71 { "creat", (__NR_SYSCALL_BASE + 8) },
72 { "create_module", __NR_SYSCALL_BASE + 127 },
73 { "delete_module", (__NR_SYSCALL_BASE + 129) },
74 { "dup", (__NR_SYSCALL_BASE + 41) },
75 { "dup2", (__NR_SYSCALL_BASE + 63) },
76 { "dup3", (__NR_SYSCALL_BASE + 327) },
77 { "epoll_create", (__NR_SYSCALL_BASE + 248) },
78 { "epoll_create1", (__NR_SYSCALL_BASE + 326) },
79 { "epoll_ctl", (__NR_SYSCALL_BASE + 249) },
80 { "epoll_ctl_old", __PNR_epoll_ctl_old },
81 { "epoll_pwait", (__NR_SYSCALL_BASE + 313) },
82 { "epoll_wait", (__NR_SYSCALL_BASE + 250) },
83 { "epoll_wait_old", __PNR_epoll_wait_old },
84 { "eventfd", (__NR_SYSCALL_BASE + 319) },
85 { "eventfd2", (__NR_SYSCALL_BASE + 325) },
86 { "execve", (__NR_SYSCALL_BASE + 11) },
87 { "execveat", (__NR_SYSCALL_BASE + 356) },
88 { "exit", (__NR_SYSCALL_BASE + 1) },
89 { "exit_group", (__NR_SYSCALL_BASE + 246) },
90 { "faccessat", (__NR_SYSCALL_BASE + 300) },
91 { "fadvise64", __NR_SYSCALL_BASE + 254 },
92 { "fadvise64_64", __PNR_fadvise64_64 },
93 { "fallocate", (__NR_SYSCALL_BASE + 320) },
94 { "fanotify_init", (__NR_SYSCALL_BASE + 336) },
95 { "fanotify_mark", (__NR_SYSCALL_BASE + 337) },
96 { "fchdir", (__NR_SYSCALL_BASE + 133) },
97 { "fchmod", (__NR_SYSCALL_BASE + 94) },
98 { "fchmodat", (__NR_SYSCALL_BASE + 299) },
99 { "fchown", (__NR_SYSCALL_BASE + 95) },
100 { "fchown32", (__PNR_fchown32) },
101 { "fchownat", (__NR_SYSCALL_BASE + 291) },
102 { "fcntl", (__NR_SYSCALL_BASE + 55) },
103 { "fcntl64", (__NR_SYSCALL_BASE + 220) },
104 { "fdatasync", (__NR_SYSCALL_BASE + 152) },
105 { "fgetxattr", (__NR_SYSCALL_BASE + 229) },
106 { "finit_module", (__NR_SYSCALL_BASE + 348) },
107 { "flistxattr", (__NR_SYSCALL_BASE + 232) },
108 { "flock", (__NR_SYSCALL_BASE + 143) },
109 { "fork", (__NR_SYSCALL_BASE + 2) },
110 { "fremovexattr", (__NR_SYSCALL_BASE + 235) },
111 { "fsetxattr", (__NR_SYSCALL_BASE + 226) },
112 { "fstat", (__NR_SYSCALL_BASE + 108) },
113 { "fstat64", (__NR_SYSCALL_BASE + 215) },
114 { "fstatat64", (__NR_SYSCALL_BASE + 293) },
115 { "fstatfs", (__NR_SYSCALL_BASE + 100) },
116 { "fstatfs64", (__NR_SYSCALL_BASE + 256) },
117 { "fsync", (__NR_SYSCALL_BASE + 118) },
118 { "ftime", (__NR_SYSCALL_BASE + 35) },
119 { "ftruncate", (__NR_SYSCALL_BASE + 93) },
120 { "ftruncate64", (__NR_SYSCALL_BASE + 212) },
121 { "futex", (__NR_SYSCALL_BASE + 238) },
122 { "futimesat", (__NR_SYSCALL_BASE + 292) },
123 { "get_kernel_syms", (__NR_SYSCALL_BASE + 130) },
124 { "get_mempolicy", (__NR_SYSCALL_BASE + 269) },
125 { "get_robust_list", (__NR_SYSCALL_BASE + 310) },
126 { "get_thread_area", __PNR_get_thread_area },
127 { "getcpu", (__NR_SYSCALL_BASE + 312) },
128 { "getcwd", (__NR_SYSCALL_BASE + 203) },
129 { "getdents", (__NR_SYSCALL_BASE + 141) },
130 { "getdents64", (__NR_SYSCALL_BASE + 219) },
131 { "getegid", (__NR_SYSCALL_BASE + 50) },
132 { "getegid32", __PNR_getegid32 },
133 { "geteuid", (__NR_SYSCALL_BASE + 49) },
134 { "geteuid32", __PNR_geteuid32 },
135 { "getgid", (__NR_SYSCALL_BASE + 47) },
136 { "getgid32", __PNR_getgid32 },
137 { "getgroups", (__NR_SYSCALL_BASE + 80) },
138 { "getgroups32", __PNR_getgroups32 },
139 { "getitimer", (__NR_SYSCALL_BASE + 105) },
140 { "getpeername", (__NR_SYSCALL_BASE + 171) },
141 { "getpgid", (__NR_SYSCALL_BASE + 132) },
142 { "getpgrp", (__NR_SYSCALL_BASE + 65) },
143 { "getpid", (__NR_SYSCALL_BASE + 20) },
144 { "getpmsg", (__NR_SYSCALL_BASE + 208) },
145 { "getppid", (__NR_SYSCALL_BASE + 64) },
146 { "getpriority", (__NR_SYSCALL_BASE + 96) },
147 { "getrandom", (__NR_SYSCALL_BASE + 353) },
148 { "getresgid", (__NR_SYSCALL_BASE + 191) },
149 { "getresgid32", __PNR_getresgid32 },
150 { "getresuid", (__NR_SYSCALL_BASE + 186) },
151 { "getresuid32", __PNR_getresuid32 },
152 { "getrlimit", (__NR_SYSCALL_BASE + 76) },
153 { "getrusage", (__NR_SYSCALL_BASE + 77) },
154 { "getsid", (__NR_SYSCALL_BASE + 151) },
155 { "getsockname", (__NR_SYSCALL_BASE + 172) },
156 { "getsockopt", (__NR_SYSCALL_BASE + 173) },
157 { "gettid", (__NR_SYSCALL_BASE + 222) },
158 { "gettimeofday", (__NR_SYSCALL_BASE + 78) },
159 { "getuid", (__NR_SYSCALL_BASE + 24) },
160 { "getuid32", __PNR_getuid32 },
161 { "getxattr", (__NR_SYSCALL_BASE + 227) },
162 { "gtty", (__NR_SYSCALL_BASE + 32) },
163 { "idle", (__NR_SYSCALL_BASE + 112) },
164 { "init_module", (__NR_SYSCALL_BASE + 128) },
165 { "inotify_add_watch", (__NR_SYSCALL_BASE + 285) },
166 { "inotify_init", (__NR_SYSCALL_BASE + 284) },
167 { "inotify_init1", (__NR_SYSCALL_BASE + 329) },
168 { "inotify_rm_watch", (__NR_SYSCALL_BASE + 286) },
169 { "io_cancel", (__NR_SYSCALL_BASE + 245) },
170 { "io_destroy", (__NR_SYSCALL_BASE + 242) },
171 { "io_getevents", (__NR_SYSCALL_BASE + 243) },
172 { "io_setup", (__NR_SYSCALL_BASE + 241) },
173 { "io_submit", (__NR_SYSCALL_BASE + 244) },
174 { "ioctl", (__NR_SYSCALL_BASE + 54) },
175 { "ioperm", (__NR_SYSCALL_BASE + 101) },
176 { "iopl", (__NR_SYSCALL_BASE + 110) },
177 { "ioprio_get", (__NR_SYSCALL_BASE + 315) },
178 { "ioprio_set", (__NR_SYSCALL_BASE + 314) },
179 { "ipc", (__NR_SYSCALL_BASE + 117) },
180 { "kcmp", (__NR_SYSCALL_BASE + 347) },
181 { "kexec_file_load", __PNR_kexec_file_load },
182 { "kexec_load", (__NR_SYSCALL_BASE + 311) },
183 { "keyctl", (__NR_SYSCALL_BASE + 282) },
184 { "kill", (__NR_SYSCALL_BASE + 37) },
185 { "lchown", (__NR_SYSCALL_BASE + 16) },
186 { "lchown32", __PNR_lchown32 },
187 { "lgetxattr", (__NR_SYSCALL_BASE + 228) },
188 { "link", (__NR_SYSCALL_BASE + 9) },
189 { "linkat", (__NR_SYSCALL_BASE + 296) },
190 { "listen", (__NR_SYSCALL_BASE + 174) },
191 { "listxattr", (__NR_SYSCALL_BASE + 230) },
192 { "llistxattr", (__NR_SYSCALL_BASE + 231) },
193 { "lock", (__NR_SYSCALL_BASE + 53) },
194 { "lookup_dcookie", (__NR_SYSCALL_BASE + 247) },
195 { "lremovexattr", (__NR_SYSCALL_BASE + 234) },
196 { "lseek", (__NR_SYSCALL_BASE + 19) },
197 { "lsetxattr", (__NR_SYSCALL_BASE + 225) },
198 { "lstat", (__NR_SYSCALL_BASE + 107) },
199 { "lstat64", (__NR_SYSCALL_BASE + 214) },
200 { "madvise", (__NR_SYSCALL_BASE + 218) },
201 { "mbind", (__NR_SYSCALL_BASE + 268) },
202 { "memfd_create", (__NR_SYSCALL_BASE + 354) },
203 { "migrate_pages", (__NR_SYSCALL_BASE + 287) },
204 { "mincore", (__NR_SYSCALL_BASE + 217) },
205 { "mkdir", (__NR_SYSCALL_BASE + 39) },
206 { "mkdirat", (__NR_SYSCALL_BASE + 289) },
207 { "mknod", (__NR_SYSCALL_BASE + 14) },
208 { "mknodat", (__NR_SYSCALL_BASE + 290) },
209 { "mlock", (__NR_SYSCALL_BASE + 154) },
210 { "mlockall", (__NR_SYSCALL_BASE + 156) },
211 { "mmap", (__NR_SYSCALL_BASE + 90) },
212 { "mmap2", (__NR_SYSCALL_BASE + 210) },
213 { "modify_ldt", (__NR_SYSCALL_BASE + 123) },
214 { "mount", (__NR_SYSCALL_BASE + 21) },
215 { "move_pages", (__NR_SYSCALL_BASE + 308) },
216 { "mprotect", (__NR_SYSCALL_BASE + 125) },
217 { "mpx", (__NR_SYSCALL_BASE + 56) },
218 { "mq_getsetattr", (__NR_SYSCALL_BASE + 276) },
219 { "mq_notify", (__NR_SYSCALL_BASE + 275) },
220 { "mq_open", (__NR_SYSCALL_BASE + 271) },
221 { "mq_timedreceive", (__NR_SYSCALL_BASE + 274) },
222 { "mq_timedsend", (__NR_SYSCALL_BASE + 273) },
223 { "mq_unlink", (__NR_SYSCALL_BASE + 272) },
224 { "mremap", (__NR_SYSCALL_BASE + 167) },
225 { "msgctl", __PNR_msgctl },
226 { "msgget", __PNR_msgget },
227 { "msgrcv", __PNR_msgrcv },
228 { "msgsnd", __PNR_msgsnd },
229 { "msync", (__NR_SYSCALL_BASE + 144) },
230 { "munlock", (__NR_SYSCALL_BASE + 155) },
231 { "munlockall", (__NR_SYSCALL_BASE + 157) },
232 { "munmap", (__NR_SYSCALL_BASE + 91) },
233 { "name_to_handle_at", (__NR_SYSCALL_BASE + 339) },
234 { "nanosleep", (__NR_SYSCALL_BASE + 166) },
235 { "newfstatat", __PNR_newfstatat },
236 { "nfsservctl", (__NR_SYSCALL_BASE + 189) },
237 { "nice", (__NR_SYSCALL_BASE + 34) },
238 { "oldfstat", __PNR_oldfstat },
239 { "oldlstat", __PNR_oldlstat },
240 { "oldolduname", __PNR_oldolduname },
241 { "oldstat", __PNR_oldstat },
242 { "olduname", __PNR_olduname },
243 { "oldwait4", __PNR_oldwait4 },
244 { "open", (__NR_SYSCALL_BASE + 5) },
245 { "open_by_handle_at", (__NR_SYSCALL_BASE + 340) },
246 { "openat", (__NR_SYSCALL_BASE + 288) },
247 { "pause", (__NR_SYSCALL_BASE + 29) },
248 { "pciconfig_iobase", __PNR_pciconfig_iobase },
249 { "pciconfig_read", __PNR_pciconfig_read },
250 { "pciconfig_write", __PNR_pciconfig_write },
251 { "perf_event_open", (__NR_SYSCALL_BASE + 333) },
252 { "personality", (__NR_SYSCALL_BASE + 136) },
253 { "pipe", (__NR_SYSCALL_BASE + 42) },
254 { "pipe2", (__NR_SYSCALL_BASE + 328) },
255 { "pivot_root", (__NR_SYSCALL_BASE + 216) },
256 { "poll", (__NR_SYSCALL_BASE + 188) },
257 { "ppoll", (__NR_SYSCALL_BASE + 302) },
258 { "prctl", (__NR_SYSCALL_BASE + 192) },
259 { "pread64", (__NR_SYSCALL_BASE + 200) },
260 { "preadv", (__NR_SYSCALL_BASE + 330) },
261 { "prlimit64", (__NR_SYSCALL_BASE + 338) },
262 { "process_vm_readv", (__NR_SYSCALL_BASE + 345) },
263 { "process_vm_writev", (__NR_SYSCALL_BASE + 346) },
264 { "prof", (__NR_SYSCALL_BASE + 44) },
265 { "profil", (__NR_SYSCALL_BASE + 98) },
266 { "pselect6", (__NR_SYSCALL_BASE + 301) },
267 { "ptrace", (__NR_SYSCALL_BASE + 26) },
268 { "putpmsg", (__NR_SYSCALL_BASE + 209) },
269 { "pwrite64", (__NR_SYSCALL_BASE + 201) },
270 { "pwritev", (__NR_SYSCALL_BASE + 331) },
271 { "query_module", (__NR_SYSCALL_BASE + 187) },
272 { "quotactl", (__NR_SYSCALL_BASE + 131) },
273 { "read", (__NR_SYSCALL_BASE + 3) },
274 { "readahead", (__NR_SYSCALL_BASE + 223) },
275 { "readdir", (__NR_SYSCALL_BASE + 89) },
276 { "readlink", (__NR_SYSCALL_BASE + 85) },
277 { "readlinkat", (__NR_SYSCALL_BASE + 298) },
278 { "readv", (__NR_SYSCALL_BASE + 145) },
279 { "reboot", (__NR_SYSCALL_BASE + 88) },
280 { "recv", (__NR_SYSCALL_BASE + 175) },
281 { "recvfrom", (__NR_SYSCALL_BASE + 176) },
282 { "recvmmsg", (__NR_SYSCALL_BASE + 335) },
283 { "recvmsg", (__NR_SYSCALL_BASE + 177) },
284 { "remap_file_pages", (__NR_SYSCALL_BASE + 251) },
285 { "removexattr", (__NR_SYSCALL_BASE + 233) },
286 { "rename", (__NR_SYSCALL_BASE + 38) },
287 { "renameat", (__NR_SYSCALL_BASE + 295) },
288 { "renameat2", (__NR_SYSCALL_BASE + 351) },
289 { "request_key", (__NR_SYSCALL_BASE + 281) },
290 { "restart_syscall", (__NR_SYSCALL_BASE + 253) },
291 { "rmdir", (__NR_SYSCALL_BASE + 40) },
292 { "rt_sigaction", (__NR_SYSCALL_BASE + 194) },
293 { "rt_sigpending", (__NR_SYSCALL_BASE + 196) },
294 { "rt_sigprocmask", (__NR_SYSCALL_BASE + 195) },
295 { "rt_sigqueueinfo", (__NR_SYSCALL_BASE + 198) },
296 { "rt_sigreturn", (__NR_SYSCALL_BASE + 193) },
297 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 199) },
298 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 197) },
299 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 332) },
300 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 163) },
301 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 164) },
302 { "sched_getaffinity", (__NR_SYSCALL_BASE + 240) },
303 { "sched_getattr", (__NR_SYSCALL_BASE + 350) },
304 { "sched_getparam", (__NR_SYSCALL_BASE + 159) },
305 { "sched_getscheduler", (__NR_SYSCALL_BASE + 161) },
306 { "sched_rr_get_interval", (__NR_SYSCALL_BASE + 165) },
307 { "sched_setaffinity", (__NR_SYSCALL_BASE + 239) },
308 { "sched_setattr", (__NR_SYSCALL_BASE + 349) },
309 { "sched_setparam", (__NR_SYSCALL_BASE + 158) },
310 { "sched_setscheduler", (__NR_SYSCALL_BASE + 160) },
311 { "sched_yield", (__NR_SYSCALL_BASE + 162) },
312 { "seccomp", (__NR_SYSCALL_BASE + 352) },
313 { "security", __PNR_security },
314 { "select", __PNR_select },
315 { "semctl", __PNR_semctl },
316 { "semget", __PNR_semget },
317 { "semop", __PNR_semop },
318 { "semtimedop", __PNR_semtimedop },
319 { "send", (__NR_SYSCALL_BASE + 178) },
320 { "sendfile", (__NR_SYSCALL_BASE + 207) },
321 { "sendfile64", (__NR_SYSCALL_BASE + 237) },
322 { "sendmmsg", (__NR_SYSCALL_BASE + 343) },
323 { "sendmsg", (__NR_SYSCALL_BASE + 179) },
324 { "sendto", (__NR_SYSCALL_BASE + 180) },
325 { "set_mempolicy", (__NR_SYSCALL_BASE + 270) },
326 { "set_robust_list", (__NR_SYSCALL_BASE + 309) },
327 { "set_thread_area", (__NR_SYSCALL_BASE + 283) },
328 { "set_tid_address", (__NR_SYSCALL_BASE + 252) },
329 { "set_tls", __PNR_set_tls },
330 { "setdomainname", (__NR_SYSCALL_BASE + 121) },
331 { "setfsgid", (__NR_SYSCALL_BASE + 139) },
332 { "setfsgid32", __PNR_setfsgid32 },
333 { "setfsuid", (__NR_SYSCALL_BASE + 138) },
334 { "setfsuid32", __PNR_setfsuid32 },
335 { "setgid", (__NR_SYSCALL_BASE + 46) },
336 { "setgid32", __PNR_setgid32 },
337 { "setgroups", (__NR_SYSCALL_BASE + 81) },
338 { "setgroups32", __PNR_setgroups32 },
339 { "sethostname", (__NR_SYSCALL_BASE + 74) },
340 { "setitimer", (__NR_SYSCALL_BASE + 104) },
341 { "setns", (__NR_SYSCALL_BASE + 344) },
342 { "setpgid", (__NR_SYSCALL_BASE + 57) },
343 { "setpriority", (__NR_SYSCALL_BASE + 97) },
344 { "setregid", (__NR_SYSCALL_BASE + 71) },
345 { "setregid32", __PNR_setregid32 },
346 { "setresgid", (__NR_SYSCALL_BASE + 190) },
347 { "setresgid32", __PNR_setresgid32 },
348 { "setresuid", (__NR_SYSCALL_BASE + 185) },
349 { "setresuid32", __PNR_setresuid32 },
350 { "setreuid", (__NR_SYSCALL_BASE + 70) },
351 { "setreuid32", __PNR_setreuid32 },
352 { "setrlimit", (__NR_SYSCALL_BASE + 75) },
353 { "setsid", (__NR_SYSCALL_BASE + 66) },
354 { "setsockopt", (__NR_SYSCALL_BASE + 181) },
355 { "settimeofday", (__NR_SYSCALL_BASE + 79) },
356 { "setuid", (__NR_SYSCALL_BASE + 23) },
357 { "setuid32", __PNR_setuid32 },
358 { "setxattr", (__NR_SYSCALL_BASE + 224) },
359 { "sgetmask", (__NR_SYSCALL_BASE + 68) },
360 { "shmat", __PNR_shmat },
361 { "shmctl", __PNR_shmctl },
362 { "shmdt", __PNR_shmdt },
363 { "shmget", __PNR_shmget },
364 { "shutdown", (__NR_SYSCALL_BASE + 182) },
365 { "sigaction", (__NR_SYSCALL_BASE + 67) },
366 { "sigaltstack", (__NR_SYSCALL_BASE + 206) },
367 { "signal", (__NR_SYSCALL_BASE + 48) },
368 { "signalfd", (__NR_SYSCALL_BASE + 317) },
369 { "signalfd4", (__NR_SYSCALL_BASE + 324) },
370 { "sigpending", (__NR_SYSCALL_BASE + 73) },
371 { "sigprocmask", (__NR_SYSCALL_BASE + 126) },
372 { "sigreturn", (__NR_SYSCALL_BASE + 119) },
373 { "sigsuspend", (__NR_SYSCALL_BASE + 72) },
374 { "socket", (__NR_SYSCALL_BASE + 183) },
375 { "socketcall", (__NR_SYSCALL_BASE + 102) },
376 { "socketpair", (__NR_SYSCALL_BASE + 184) },
377 { "splice", (__NR_SYSCALL_BASE + 304) },
378 { "ssetmask", (__NR_SYSCALL_BASE + 69) },
379 { "stat", (__NR_SYSCALL_BASE + 106) },
380 { "stat64", (__NR_SYSCALL_BASE + 213) },
381 { "statfs", (__NR_SYSCALL_BASE + 99) },
382 { "statfs64", (__NR_SYSCALL_BASE + 255) },
383 { "stime", (__NR_SYSCALL_BASE + 25) },
384 { "stty", (__NR_SYSCALL_BASE + 31) },
385 { "swapoff", (__NR_SYSCALL_BASE + 115) },
386 { "swapon", (__NR_SYSCALL_BASE + 87) },
387 { "symlink", (__NR_SYSCALL_BASE + 83) },
388 { "symlinkat", (__NR_SYSCALL_BASE + 297) },
389 { "sync", (__NR_SYSCALL_BASE + 36) },
390 { "sync_file_range", (__NR_SYSCALL_BASE + 305) },
391 { "sync_file_range2", __PNR_sync_file_range2 },
392 { "syncfs", (__NR_SYSCALL_BASE + 342) },
393 { "syscall", (__NR_SYSCALL_BASE + 0) },
394 { "sysfs", (__NR_SYSCALL_BASE + 135) },
395 { "sysinfo", (__NR_SYSCALL_BASE + 116) },
396 { "syslog", (__NR_SYSCALL_BASE + 103) },
397 { "sysmips", (__NR_SYSCALL_BASE + 149) },
398 { "tee", (__NR_SYSCALL_BASE + 306) },
399 { "tgkill", (__NR_SYSCALL_BASE + 266) },
400 { "time", (__NR_SYSCALL_BASE + 13) },
401 { "timer_create", (__NR_SYSCALL_BASE + 257) },
402 { "timer_delete", (__NR_SYSCALL_BASE + 261) },
403 { "timer_getoverrun", (__NR_SYSCALL_BASE + 260) },
404 { "timer_gettime", (__NR_SYSCALL_BASE + 259) },
405 { "timer_settime", (__NR_SYSCALL_BASE + 258) },
406 { "timerfd", (__NR_SYSCALL_BASE + 318) },
407 { "timerfd_create", (__NR_SYSCALL_BASE + 321) },
408 { "timerfd_gettime", (__NR_SYSCALL_BASE + 322) },
409 { "timerfd_settime", (__NR_SYSCALL_BASE + 323) },
410 { "times", (__NR_SYSCALL_BASE + 43) },
411 { "tkill", (__NR_SYSCALL_BASE + 236) },
412 { "truncate", (__NR_SYSCALL_BASE + 92) },
413 { "truncate64", (__NR_SYSCALL_BASE + 211) },
414 { "tuxcall", __PNR_tuxcall },
415 { "ugetrlimit", __PNR_ugetrlimit },
416 { "ulimit", (__NR_SYSCALL_BASE + 58) },
417 { "umask", (__NR_SYSCALL_BASE + 60) },
418 { "umount", (__NR_SYSCALL_BASE + 22) },
419 { "umount2", (__NR_SYSCALL_BASE + 52) },
420 { "uname", (__NR_SYSCALL_BASE + 122) },
421 { "unlink", (__NR_SYSCALL_BASE + 10) },
422 { "unlinkat", (__NR_SYSCALL_BASE + 294) },
423 { "unshare", (__NR_SYSCALL_BASE + 303) },
424 { "uselib", (__NR_SYSCALL_BASE + 86) },
425 { "usr26", __PNR_usr26 },
426 { "usr32", __PNR_usr32 },
427 { "ustat", (__NR_SYSCALL_BASE + 62) },
428 { "utime", (__NR_SYSCALL_BASE + 30) },
429 { "utimensat", (__NR_SYSCALL_BASE + 316) },
430 { "utimes", (__NR_SYSCALL_BASE + 267) },
431 { "vfork", __PNR_vfork },
432 { "vhangup", (__NR_SYSCALL_BASE + 111) },
433 { "vm86", (__NR_SYSCALL_BASE + 113) },
434 { "vm86old", __PNR_vm86old },
435 { "vmsplice", (__NR_SYSCALL_BASE + 307) },
436 { "vserver", (__NR_SYSCALL_BASE + 277) },
437 { "wait4", (__NR_SYSCALL_BASE + 114) },
438 { "waitid", (__NR_SYSCALL_BASE + 278) },
439 { "waitpid", (__NR_SYSCALL_BASE + 7) },
440 { "write", (__NR_SYSCALL_BASE + 4) },
441 { "writev", (__NR_SYSCALL_BASE + 146) },
442 { NULL, __NR_SCMP_ERROR },
443 };
444
445 /**
446 * Resolve a syscall name to a number
447 * @param name the syscall name
448 *
449 * Resolve the given syscall name to the syscall number using the syscall table.
450 * Returns the syscall number on success, including negative pseudo syscall
451 * numbers; returns __NR_SCMP_ERROR on failure.
452 *
453 */
454 int mips_syscall_resolve_name(const char *name)
455 {
456 unsigned int iter;
457 const struct arch_syscall_def *table = mips_syscall_table;
458
459 /* XXX - plenty of room for future improvement here */
460 for (iter = 0; table[iter].name != NULL; iter++) {
461 if (strcmp(name, table[iter].name) == 0)
462 return table[iter].num;
463 }
464
465 return __NR_SCMP_ERROR;
466 }
467
468 /**
469 * Resolve a syscall number to a name
470 * @param num the syscall number
471 *
472 * Resolve the given syscall number to the syscall name using the syscall table.
473 * Returns a pointer to the syscall name string on success, including pseudo
474 * syscall names; returns NULL on failure.
475 *
476 */
477 const char *mips_syscall_resolve_num(int num)
478 {
479 unsigned int iter;
480 const struct arch_syscall_def *table = mips_syscall_table;
481
482 /* XXX - plenty of room for future improvement here */
483 for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
484 if (num == table[iter].num)
485 return table[iter].name;
486 }
487
488 return NULL;
489 }
490
491 /**
492 * Iterate through the syscall table and return the syscall name
493 * @param spot the offset into the syscall table
494 *
495 * Return the syscall name at position @spot or NULL on failure. This function
496 * should only ever be used internally by libseccomp.
497 *
498 */
499 const char *mips_syscall_iterate_name(unsigned int spot)
500 {
501 /* XXX - no safety checks here */
502 return mips_syscall_table[spot].name;
503 }
0 /**
1 * Enhanced Seccomp MIPS Specific Code
2 *
3 * Copyright (c) 2014 Imagination Technologies Ltd.
4 * Author: Markos Chandras <markos.chandras@imgtec.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #include <stdlib.h>
23 #include <errno.h>
24 #include <linux/audit.h>
25
26 #include "arch.h"
27 #include "arch-mips.h"
28
29 const struct arch_def arch_def_mips = {
30 .token = SCMP_ARCH_MIPS,
31 .token_bpf = AUDIT_ARCH_MIPS,
32 .size = ARCH_SIZE_32,
33 .endian = ARCH_ENDIAN_BIG,
34 };
35
36 const struct arch_def arch_def_mipsel = {
37 .token = SCMP_ARCH_MIPSEL,
38 .token_bpf = AUDIT_ARCH_MIPSEL,
39 .size = ARCH_SIZE_32,
40 .endian = ARCH_ENDIAN_LITTLE,
41 };
0 /**
1 * Enhanced Seccomp MIPS Specific Code
2 *
3 * Copyright (c) 2014 Imagination Technologies Ltd.
4 * Author: Markos Chandras <markos.chandras@imgtec.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #ifndef _ARCH_MIPS_H
23 #define _ARCH_MIPS_H
24
25 #include <inttypes.h>
26
27 #include "arch.h"
28 #include "system.h"
29
30 extern const struct arch_def arch_def_mips;
31 extern const struct arch_def arch_def_mipsel;
32
33 int mips_syscall_resolve_name(const char *name);
34 const char *mips_syscall_resolve_num(int num);
35
36 const char *mips_syscall_iterate_name(unsigned int spot);
37
38 #endif
0 /**
1 * Enhanced Seccomp MIPS64 Specific Code
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #include <string.h>
23
24 #include <seccomp.h>
25
26 #include "arch.h"
27 #include "arch-mips64.h"
28
29 /* 64 ABI */
30 #define __NR_SYSCALL_BASE 5000
31
32 /* NOTE: based on Linux 3.19 */
33 const struct arch_syscall_def mips64_syscall_table[] = { \
34 { "_llseek", __PNR__llseek },
35 { "_newselect", (__NR_SYSCALL_BASE + 22) },
36 { "_sysctl", (__NR_SYSCALL_BASE + 152) },
37 { "accept", (__NR_SYSCALL_BASE + 42) },
38 { "accept4", (__NR_SYSCALL_BASE + 293) },
39 { "access", (__NR_SYSCALL_BASE + 20) },
40 { "acct", (__NR_SYSCALL_BASE + 158) },
41 { "add_key", (__NR_SYSCALL_BASE + 239) },
42 { "adjtimex", (__NR_SYSCALL_BASE + 154) },
43 { "afs_syscall", (__NR_SYSCALL_BASE + 176) },
44 { "alarm", (__NR_SYSCALL_BASE + 37) },
45 { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
46 { "arm_sync_file_range", __PNR_arm_sync_file_range },
47 { "arch_prctl", __PNR_arch_prctl },
48 { "bdflush", __PNR_bdflush },
49 { "bind", (__NR_SYSCALL_BASE + 48) },
50 { "bpf", (__NR_SYSCALL_BASE + 315) },
51 { "break", __PNR_break },
52 { "breakpoint", __PNR_breakpoint },
53 { "brk", (__NR_SYSCALL_BASE + 12) },
54 { "cachectl", (__NR_SYSCALL_BASE + 198) },
55 { "cacheflush", (__NR_SYSCALL_BASE + 197) },
56 { "capget", (__NR_SYSCALL_BASE + 123) },
57 { "capset", (__NR_SYSCALL_BASE + 124) },
58 { "chdir", (__NR_SYSCALL_BASE + 78) },
59 { "chmod", (__NR_SYSCALL_BASE + 88) },
60 { "chown", (__NR_SYSCALL_BASE + 90) },
61 { "chown32", __PNR_chown32 },
62 { "chroot", (__NR_SYSCALL_BASE + 156) },
63 { "clock_adjtime", (__NR_SYSCALL_BASE + 300) },
64 { "clock_getres", (__NR_SYSCALL_BASE + 223) },
65 { "clock_gettime", (__NR_SYSCALL_BASE + 222) },
66 { "clock_nanosleep", (__NR_SYSCALL_BASE + 224) },
67 { "clock_settime", (__NR_SYSCALL_BASE + 221) },
68 { "clone", (__NR_SYSCALL_BASE + 55) },
69 { "close", (__NR_SYSCALL_BASE + 3) },
70 { "connect", (__NR_SYSCALL_BASE + 41) },
71 { "creat", (__NR_SYSCALL_BASE + 83) },
72 { "create_module", (__NR_SYSCALL_BASE + 167) },
73 { "delete_module", (__NR_SYSCALL_BASE + 169) },
74 { "dup", (__NR_SYSCALL_BASE + 31) },
75 { "dup2", (__NR_SYSCALL_BASE + 32) },
76 { "dup3", (__NR_SYSCALL_BASE + 286) },
77 { "epoll_create", (__NR_SYSCALL_BASE + 207) },
78 { "epoll_create1", (__NR_SYSCALL_BASE + 285) },
79 { "epoll_ctl", (__NR_SYSCALL_BASE + 208) },
80 { "epoll_ctl_old", __PNR_epoll_ctl_old },
81 { "epoll_pwait", (__NR_SYSCALL_BASE + 272) },
82 { "epoll_wait", (__NR_SYSCALL_BASE + 209) },
83 { "epoll_wait_old", __PNR_epoll_wait_old },
84 { "eventfd", (__NR_SYSCALL_BASE + 278) },
85 { "eventfd2", (__NR_SYSCALL_BASE + 284) },
86 { "execve", (__NR_SYSCALL_BASE + 57) },
87 { "execveat", (__NR_SYSCALL_BASE + 316) },
88 { "exit", (__NR_SYSCALL_BASE + 58) },
89 { "exit_group", (__NR_SYSCALL_BASE + 205) },
90 { "faccessat", (__NR_SYSCALL_BASE + 259) },
91 { "fadvise64", (__NR_SYSCALL_BASE + 215) },
92 { "fadvise64_64", __PNR_fadvise64_64 },
93 { "fallocate", (__NR_SYSCALL_BASE + 279) },
94 { "fanotify_init", (__NR_SYSCALL_BASE + 295) },
95 { "fanotify_mark", (__NR_SYSCALL_BASE + 296) },
96 { "fchdir", (__NR_SYSCALL_BASE + 79) },
97 { "fchmod", (__NR_SYSCALL_BASE + 89) },
98 { "fchmodat", (__NR_SYSCALL_BASE + 258) },
99 { "fchown", (__NR_SYSCALL_BASE + 91) },
100 { "fchown32", __PNR_fchown32 },
101 { "fchownat", (__NR_SYSCALL_BASE + 250) },
102 { "fcntl", (__NR_SYSCALL_BASE + 70) },
103 { "fcntl64", __PNR_fcntl64 },
104 { "fdatasync", (__NR_SYSCALL_BASE + 73) },
105 { "fgetxattr", (__NR_SYSCALL_BASE + 185) },
106 { "finit_module", (__NR_SYSCALL_BASE + 307) },
107 { "flistxattr", (__NR_SYSCALL_BASE + 188) },
108 { "flock", (__NR_SYSCALL_BASE + 71) },
109 { "fork", (__NR_SYSCALL_BASE + 56) },
110 { "fremovexattr", (__NR_SYSCALL_BASE + 191) },
111 { "fsetxattr", (__NR_SYSCALL_BASE + 182) },
112 { "fstat", (__NR_SYSCALL_BASE + 5) },
113 { "fstat64", __PNR_fstat64 },
114 { "fstatat64", __PNR_fstat64 },
115 { "fstatfs", (__NR_SYSCALL_BASE + 135) },
116 { "fstatfs64", __PNR_fstatfs64 },
117 { "fsync", (__NR_SYSCALL_BASE + 72) },
118 { "ftime", __PNR_ftime },
119 { "ftruncate", (__NR_SYSCALL_BASE + 75) },
120 { "ftruncate64", __PNR_ftruncate64 },
121 { "futex", (__NR_SYSCALL_BASE + 194) },
122 { "futimesat", (__NR_SYSCALL_BASE + 251) },
123 { "get_kernel_syms", (__NR_SYSCALL_BASE + 170) },
124 { "get_mempolicy", (__NR_SYSCALL_BASE + 228) },
125 { "get_robust_list", (__NR_SYSCALL_BASE + 269) },
126 { "get_thread_area", __PNR_get_thread_area },
127 { "getcpu", (__NR_SYSCALL_BASE + 271) },
128 { "getcwd", (__NR_SYSCALL_BASE + 77) },
129 { "getdents", (__NR_SYSCALL_BASE + 76) },
130 { "getdents64", (__NR_SYSCALL_BASE + 308) },
131 { "getegid", (__NR_SYSCALL_BASE + 106) },
132 { "getegid32", __PNR_getegid32 },
133 { "geteuid", (__NR_SYSCALL_BASE + 105) },
134 { "geteuid32", __PNR_geteuid32 },
135 { "getgid", (__NR_SYSCALL_BASE + 102) },
136 { "getgid32", __PNR_getgid32 },
137 { "getgroups", (__NR_SYSCALL_BASE + 113) },
138 { "getgroups32", __PNR_getgroups32 },
139 { "getitimer", (__NR_SYSCALL_BASE + 35) },
140 { "getpeername", (__NR_SYSCALL_BASE + 51) },
141 { "getpgid", (__NR_SYSCALL_BASE + 119) },
142 { "getpgrp", (__NR_SYSCALL_BASE + 109) },
143 { "getpid", (__NR_SYSCALL_BASE + 38) },
144 { "getpmsg", (__NR_SYSCALL_BASE + 174) },
145 { "getppid", (__NR_SYSCALL_BASE + 108) },
146 { "getpriority", (__NR_SYSCALL_BASE + 137) },
147 { "getrandom", (__NR_SYSCALL_BASE + 313) },
148 { "getresgid", (__NR_SYSCALL_BASE + 118) },
149 { "getresgid32", __PNR_getresgid32 },
150 { "getresuid", (__NR_SYSCALL_BASE + 116) },
151 { "getresuid32", __PNR_getresuid32 },
152 { "getrlimit", (__NR_SYSCALL_BASE + 95) },
153 { "getrusage", (__NR_SYSCALL_BASE + 96) },
154 { "getsid", (__NR_SYSCALL_BASE + 122) },
155 { "getsockname", (__NR_SYSCALL_BASE + 50) },
156 { "getsockopt", (__NR_SYSCALL_BASE + 54) },
157 { "gettid", (__NR_SYSCALL_BASE + 178) },
158 { "gettimeofday", (__NR_SYSCALL_BASE + 94) },
159 { "getuid", (__NR_SYSCALL_BASE + 100) },
160 { "getuid32", __PNR_getuid32 },
161 { "getxattr", (__NR_SYSCALL_BASE + 183) },
162 { "gtty", __PNR_gtty },
163 { "idle", __PNR_idle },
164 { "init_module", (__NR_SYSCALL_BASE + 168) },
165 { "inotify_add_watch", (__NR_SYSCALL_BASE + 244) },
166 { "inotify_init", (__NR_SYSCALL_BASE + 243) },
167 { "inotify_init1", (__NR_SYSCALL_BASE + 288) },
168 { "inotify_rm_watch", (__NR_SYSCALL_BASE + 245) },
169 { "io_cancel", (__NR_SYSCALL_BASE + 204) },
170 { "io_destroy", (__NR_SYSCALL_BASE + 201) },
171 { "io_getevents", (__NR_SYSCALL_BASE + 202) },
172 { "io_setup", (__NR_SYSCALL_BASE + 200) },
173 { "io_submit", (__NR_SYSCALL_BASE + 203) },
174 { "ioctl", (__NR_SYSCALL_BASE + 15) },
175 { "ioperm", __PNR_ioperm },
176 { "iopl", __PNR_iopl },
177 { "ioprio_get", (__NR_SYSCALL_BASE + 274) },
178 { "ioprio_set", (__NR_SYSCALL_BASE + 273) },
179 { "ipc", __PNR_ipc },
180 { "kcmp", (__NR_SYSCALL_BASE + 306) },
181 { "kexec_file_load", __PNR_kexec_file_load },
182 { "kexec_load", (__NR_SYSCALL_BASE + 270) },
183 { "keyctl", (__NR_SYSCALL_BASE + 241) },
184 { "kill", (__NR_SYSCALL_BASE + 60) },
185 { "lchown", (__NR_SYSCALL_BASE + 92) },
186 { "lchown32", __PNR_lchown32 },
187 { "lgetxattr", (__NR_SYSCALL_BASE + 184) },
188 { "link", (__NR_SYSCALL_BASE + 84) },
189 { "linkat", (__NR_SYSCALL_BASE + 255) },
190 { "listen", (__NR_SYSCALL_BASE + 49) },
191 { "listxattr", (__NR_SYSCALL_BASE + 186) },
192 { "llistxattr", (__NR_SYSCALL_BASE + 187) },
193 { "lock", __PNR_lock },
194 { "lookup_dcookie", (__NR_SYSCALL_BASE + 206) },
195 { "lremovexattr", (__NR_SYSCALL_BASE + 190) },
196 { "lseek", (__NR_SYSCALL_BASE + 8) },
197 { "lsetxattr", (__NR_SYSCALL_BASE + 181) },
198 { "lstat", (__NR_SYSCALL_BASE + 6) },
199 { "lstat64", __PNR_lstat64 },
200 { "madvise", (__NR_SYSCALL_BASE + 27) },
201 { "mbind", (__NR_SYSCALL_BASE + 227) },
202 { "memfd_create", (__NR_SYSCALL_BASE + 314) },
203 { "migrate_pages", (__NR_SYSCALL_BASE + 246) },
204 { "mincore", (__NR_SYSCALL_BASE + 26) },
205 { "mkdir", (__NR_SYSCALL_BASE + 81) },
206 { "mkdirat", (__NR_SYSCALL_BASE + 248) },
207 { "mknod", (__NR_SYSCALL_BASE + 131) },
208 { "mknodat", (__NR_SYSCALL_BASE + 249) },
209 { "mlock", (__NR_SYSCALL_BASE + 146) },
210 { "mlockall", (__NR_SYSCALL_BASE + 148) },
211 { "mmap", (__NR_SYSCALL_BASE + 9) },
212 { "mmap2", __PNR_mmap2 },
213 { "modify_ldt", __PNR_modify_ldt },
214 { "mount", (__NR_SYSCALL_BASE + 160) },
215 { "move_pages", (__NR_SYSCALL_BASE + 267) },
216 { "mprotect", (__NR_SYSCALL_BASE + 10) },
217 { "mpx", __PNR_mpx },
218 { "mq_getsetattr", (__NR_SYSCALL_BASE + 235) },
219 { "mq_notify", (__NR_SYSCALL_BASE + 234) },
220 { "mq_open", (__NR_SYSCALL_BASE + 230) },
221 { "mq_timedreceive", (__NR_SYSCALL_BASE + 233) },
222 { "mq_timedsend", (__NR_SYSCALL_BASE + 232) },
223 { "mq_unlink", (__NR_SYSCALL_BASE + 231) },
224 { "mremap", (__NR_SYSCALL_BASE + 24) },
225 { "msgctl", (__NR_SYSCALL_BASE + 69) },
226 { "msgget", (__NR_SYSCALL_BASE + 66) },
227 { "msgrcv", (__NR_SYSCALL_BASE + 68) },
228 { "msgsnd", (__NR_SYSCALL_BASE + 67) },
229 { "msync", (__NR_SYSCALL_BASE + 25) },
230 { "munlock", (__NR_SYSCALL_BASE + 147) },
231 { "munlockall", (__NR_SYSCALL_BASE + 149) },
232 { "munmap", (__NR_SYSCALL_BASE + 11) },
233 { "name_to_handle_at", (__NR_SYSCALL_BASE + 298) },
234 { "nanosleep", (__NR_SYSCALL_BASE + 34) },
235 { "newfstatat", (__NR_SYSCALL_BASE + 252) },
236 { "nfsservctl", (__NR_SYSCALL_BASE + 173) },
237 { "nice", __PNR_nice },
238 { "oldfstat", __PNR_oldfstat },
239 { "oldlstat", __PNR_oldlstat },
240 { "oldolduname", __PNR_oldolduname },
241 { "oldstat", __PNR_oldstat },
242 { "olduname", __PNR_olduname },
243 { "oldwait4", __PNR_oldwait4 },
244 { "open", (__NR_SYSCALL_BASE + 2) },
245 { "open_by_handle_at", (__NR_SYSCALL_BASE + 299) },
246 { "openat", (__NR_SYSCALL_BASE + 247) },
247 { "pause", (__NR_SYSCALL_BASE + 33) },
248 { "pciconfig_iobase", __PNR_pciconfig_iobase },
249 { "pciconfig_read", __PNR_pciconfig_read },
250 { "pciconfig_write", __PNR_pciconfig_write },
251 { "perf_event_open", (__NR_SYSCALL_BASE + 292) },
252 { "personality", (__NR_SYSCALL_BASE + 132) },
253 { "pipe", (__NR_SYSCALL_BASE + 21) },
254 { "pipe2", (__NR_SYSCALL_BASE + 287) },
255 { "pivot_root", (__NR_SYSCALL_BASE + 151) },
256 { "poll", (__NR_SYSCALL_BASE + 7) },
257 { "ppoll", (__NR_SYSCALL_BASE + 261) },
258 { "prctl", (__NR_SYSCALL_BASE + 153) },
259 { "pread64", (__NR_SYSCALL_BASE + 16) },
260 { "preadv", (__NR_SYSCALL_BASE + 289) },
261 { "prlimit64", (__NR_SYSCALL_BASE + 297) },
262 { "process_vm_readv", (__NR_SYSCALL_BASE + 304) },
263 { "process_vm_writev", (__NR_SYSCALL_BASE + 305) },
264 { "prof", __PNR_prof },
265 { "profil", __PNR_profil },
266 { "pselect6", (__NR_SYSCALL_BASE + 260) },
267 { "ptrace", (__NR_SYSCALL_BASE + 99) },
268 { "putpmsg", (__NR_SYSCALL_BASE + 175) },
269 { "pwrite64", (__NR_SYSCALL_BASE + 17) },
270 { "pwritev", (__NR_SYSCALL_BASE + 290) },
271 { "query_module", (__NR_SYSCALL_BASE + 171) },
272 { "quotactl", (__NR_SYSCALL_BASE + 172) },
273 { "read", (__NR_SYSCALL_BASE + 0) },
274 { "readahead", (__NR_SYSCALL_BASE + 179) },
275 { "readdir", __PNR_readdir },
276 { "readlink", (__NR_SYSCALL_BASE + 87) },
277 { "readlinkat", (__NR_SYSCALL_BASE + 257) },
278 { "readv", (__NR_SYSCALL_BASE + 18) },
279 { "reboot", (__NR_SYSCALL_BASE + 164) },
280 { "recv", __PNR_recv },
281 { "recvfrom", (__NR_SYSCALL_BASE + 44) },
282 { "recvmmsg", (__NR_SYSCALL_BASE + 294) },
283 { "recvmsg", (__NR_SYSCALL_BASE + 46) },
284 { "remap_file_pages", (__NR_SYSCALL_BASE + 210) },
285 { "removexattr", (__NR_SYSCALL_BASE + 189) },
286 { "rename", (__NR_SYSCALL_BASE + 80) },
287 { "renameat", (__NR_SYSCALL_BASE + 254) },
288 { "renameat2", (__NR_SYSCALL_BASE + 311) },
289 { "request_key", (__NR_SYSCALL_BASE + 240) },
290 { "restart_syscall", (__NR_SYSCALL_BASE + 213) },
291 { "rmdir", (__NR_SYSCALL_BASE + 82) },
292 { "rt_sigaction", (__NR_SYSCALL_BASE + 13) },
293 { "rt_sigpending", (__NR_SYSCALL_BASE + 125) },
294 { "rt_sigprocmask", (__NR_SYSCALL_BASE + 14) },
295 { "rt_sigqueueinfo", (__NR_SYSCALL_BASE + 127) },
296 { "rt_sigreturn", (__NR_SYSCALL_BASE + 211) },
297 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 128) },
298 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 126) },
299 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 291) },
300 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 143) },
301 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 144) },
302 { "sched_getaffinity", (__NR_SYSCALL_BASE + 196) },
303 { "sched_getattr", (__NR_SYSCALL_BASE + 310) },
304 { "sched_getparam", (__NR_SYSCALL_BASE + 140) },
305 { "sched_getscheduler", (__NR_SYSCALL_BASE + 142) },
306 { "sched_rr_get_interval", (__NR_SYSCALL_BASE + 145) },
307 { "sched_setaffinity", (__NR_SYSCALL_BASE + 195) },
308 { "sched_setattr", (__NR_SYSCALL_BASE + 309) },
309 { "sched_setparam", (__NR_SYSCALL_BASE + 139) },
310 { "sched_setscheduler", (__NR_SYSCALL_BASE + 141) },
311 { "sched_yield", (__NR_SYSCALL_BASE + 23) },
312 { "seccomp", (__NR_SYSCALL_BASE + 312) },
313 { "security", __PNR_security },
314 { "select", __PNR_select },
315 { "semctl", (__NR_SYSCALL_BASE + 64) },
316 { "semget", (__NR_SYSCALL_BASE + 62) },
317 { "semop", (__NR_SYSCALL_BASE + 63) },
318 { "semtimedop", (__NR_SYSCALL_BASE + 214) },
319 { "send", __PNR_send },
320 { "sendfile", (__NR_SYSCALL_BASE + 39) },
321 { "sendfile64", __PNR_sendfile64 },
322 { "sendmmsg", (__NR_SYSCALL_BASE + 302) },
323 { "sendmsg", (__NR_SYSCALL_BASE + 45) },
324 { "sendto", (__NR_SYSCALL_BASE + 43) },
325 { "set_mempolicy", (__NR_SYSCALL_BASE + 229) },
326 { "set_robust_list", (__NR_SYSCALL_BASE + 268) },
327 { "set_thread_area", (__NR_SYSCALL_BASE + 242) },
328 { "set_tid_address", (__NR_SYSCALL_BASE + 212) },
329 { "set_tls", __PNR_set_tls },
330 { "setdomainname", (__NR_SYSCALL_BASE + 166) },
331 { "setfsgid", (__NR_SYSCALL_BASE + 121) },
332 { "setfsgid32", __PNR_setfsgid32 },
333 { "setfsuid", (__NR_SYSCALL_BASE + 120) },
334 { "setfsuid32", __PNR_setfsuid32 },
335 { "setgid", (__NR_SYSCALL_BASE + 104) },
336 { "setgid32", __PNR_setgid32 },
337 { "setgroups", (__NR_SYSCALL_BASE + 114) },
338 { "setgroups32", __PNR_setgroups32 },
339 { "sethostname", (__NR_SYSCALL_BASE + 165) },
340 { "setitimer", (__NR_SYSCALL_BASE + 36) },
341 { "setns", (__NR_SYSCALL_BASE + 303) },
342 { "setpgid", (__NR_SYSCALL_BASE + 107) },
343 { "setpriority", (__NR_SYSCALL_BASE + 138) },
344 { "setregid", (__NR_SYSCALL_BASE + 112) },
345 { "setregid32", __PNR_setregid32 },
346 { "setresgid", (__NR_SYSCALL_BASE + 117) },
347 { "setresgid32", __PNR_setresgid32 },
348 { "setresuid", (__NR_SYSCALL_BASE + 115) },
349 { "setresuid32", __PNR_setresuid32 },
350 { "setreuid", (__NR_SYSCALL_BASE + 111) },
351 { "setreuid32", __PNR_setreuid32 },
352 { "setrlimit", (__NR_SYSCALL_BASE + 155) },
353 { "setsid", (__NR_SYSCALL_BASE + 110) },
354 { "setsockopt", (__NR_SYSCALL_BASE + 53) },
355 { "settimeofday", (__NR_SYSCALL_BASE + 159) },
356 { "setuid", (__NR_SYSCALL_BASE + 103) },
357 { "setuid32", __PNR_setuid32 },
358 { "setxattr", (__NR_SYSCALL_BASE + 180) },
359 { "sgetmask", __PNR_sgetmask },
360 { "shmat", (__NR_SYSCALL_BASE + 29) },
361 { "shmctl", (__NR_SYSCALL_BASE + 30) },
362 { "shmdt", (__NR_SYSCALL_BASE + 65) },
363 { "shmget", (__NR_SYSCALL_BASE + 28) },
364 { "shutdown", (__NR_SYSCALL_BASE + 47) },
365 { "sigaction", __PNR_sigaction },
366 { "sigaltstack", (__NR_SYSCALL_BASE + 129) },
367 { "signal", __PNR_signal },
368 { "signalfd", (__NR_SYSCALL_BASE + 276) },
369 { "signalfd4", (__NR_SYSCALL_BASE + 283) },
370 { "sigpending", __PNR_sigpending },
371 { "sigprocmask", __PNR_sigprocmask },
372 { "sigreturn", __PNR_sigreturn },
373 { "sigsuspend", __PNR_sigsuspend },
374 { "socket", (__NR_SYSCALL_BASE + 40) },
375 { "socketcall", __PNR_socketcall },
376 { "socketpair", (__NR_SYSCALL_BASE + 52) },
377 { "splice", (__NR_SYSCALL_BASE + 263) },
378 { "ssetmask", __PNR_ssetmask },
379 { "stat", (__NR_SYSCALL_BASE + 4) },
380 { "stat64", __PNR_stat64 },
381 { "statfs", (__NR_SYSCALL_BASE + 134) },
382 { "statfs64", __PNR_statfs64 },
383 { "stime", __PNR_stime },
384 { "stty", __PNR_stty },
385 { "swapoff", (__NR_SYSCALL_BASE + 163) },
386 { "swapon", (__NR_SYSCALL_BASE + 162) },
387 { "symlink", (__NR_SYSCALL_BASE + 86) },
388 { "symlinkat", (__NR_SYSCALL_BASE + 256) },
389 { "sync", (__NR_SYSCALL_BASE + 157) },
390 { "sync_file_range", (__NR_SYSCALL_BASE + 264) },
391 { "sync_file_range2", __PNR_sync_file_range2 },
392 { "syncfs", (__NR_SYSCALL_BASE + 301) },
393 { "syscall", __PNR_syscall },
394 { "sysfs", (__NR_SYSCALL_BASE + 136) },
395 { "sysinfo", (__NR_SYSCALL_BASE + 97) },
396 { "syslog", (__NR_SYSCALL_BASE + 101) },
397 { "sysmips", (__NR_SYSCALL_BASE + 199) },
398 { "tee", (__NR_SYSCALL_BASE + 265) },
399 { "tgkill", (__NR_SYSCALL_BASE + 225) },
400 { "time", __PNR_time },
401 { "timer_create", (__NR_SYSCALL_BASE + 216) },
402 { "timer_delete", (__NR_SYSCALL_BASE + 220) },
403 { "timer_getoverrun", (__NR_SYSCALL_BASE + 219) },
404 { "timer_gettime", (__NR_SYSCALL_BASE + 218) },
405 { "timer_settime", (__NR_SYSCALL_BASE + 217) },
406 { "timerfd", (__NR_SYSCALL_BASE + 277) },
407 { "timerfd_create", (__NR_SYSCALL_BASE + 280) },
408 { "timerfd_gettime", (__NR_SYSCALL_BASE + 281) },
409 { "timerfd_settime", (__NR_SYSCALL_BASE + 282) },
410 { "times", (__NR_SYSCALL_BASE + 98) },
411 { "tkill", (__NR_SYSCALL_BASE + 192) },
412 { "truncate", (__NR_SYSCALL_BASE + 74) },
413 { "truncate64", __PNR_truncate64 },
414 { "tuxcall", __PNR_tuxcall },
415 { "ugetrlimit", __PNR_ugetrlimit },
416 { "ulimit", __PNR_ulimit },
417 { "umask", (__NR_SYSCALL_BASE + 93) },
418 { "umount", __PNR_umount },
419 { "umount2", (__NR_SYSCALL_BASE + 161) },
420 { "uname", (__NR_SYSCALL_BASE + 61) },
421 { "unlink", (__NR_SYSCALL_BASE + 85) },
422 { "unlinkat", (__NR_SYSCALL_BASE + 253) },
423 { "unshare", (__NR_SYSCALL_BASE + 262) },
424 { "uselib", __PNR_uselib },
425 { "usr26", __PNR_usr26 },
426 { "usr32", __PNR_usr32 },
427 { "ustat", (__NR_SYSCALL_BASE + 133) },
428 { "utime", (__NR_SYSCALL_BASE + 130) },
429 { "utimensat", (__NR_SYSCALL_BASE + 275) },
430 { "utimes", (__NR_SYSCALL_BASE + 226) },
431 { "vfork", __PNR_vfork },
432 { "vhangup", (__NR_SYSCALL_BASE + 150) },
433 { "vm86", __PNR_vm86 },
434 { "vm86old", __PNR_vm86old },
435 { "vmsplice", (__NR_SYSCALL_BASE + 266) },
436 { "vserver", (__NR_SYSCALL_BASE + 236) },
437 { "wait4", (__NR_SYSCALL_BASE + 59) },
438 { "waitid", (__NR_SYSCALL_BASE + 237) },
439 { "waitpid", __PNR_waitpid },
440 { "write", (__NR_SYSCALL_BASE + 1) },
441 { "writev", (__NR_SYSCALL_BASE + 19) },
442 { NULL, __NR_SCMP_ERROR },
443 };
444
445 /**
446 * Resolve a syscall name to a number
447 * @param name the syscall name
448 *
449 * Resolve the given syscall name to the syscall number using the syscall table.
450 * Returns the syscall number on success, including negative pseudo syscall
451 * numbers; returns __NR_SCMP_ERROR on failure.
452 *
453 */
454 int mips64_syscall_resolve_name(const char *name)
455 {
456 unsigned int iter;
457 const struct arch_syscall_def *table = mips64_syscall_table;
458
459 /* XXX - plenty of room for future improvement here */
460 for (iter = 0; table[iter].name != NULL; iter++) {
461 if (strcmp(name, table[iter].name) == 0)
462 return table[iter].num;
463 }
464
465 return __NR_SCMP_ERROR;
466 }
467
468 /**
469 * Resolve a syscall number to a name
470 * @param num the syscall number
471 *
472 * Resolve the given syscall number to the syscall name using the syscall table.
473 * Returns a pointer to the syscall name string on success, including pseudo
474 * syscall names; returns NULL on failure.
475 *
476 */
477 const char *mips64_syscall_resolve_num(int num)
478 {
479 unsigned int iter;
480 const struct arch_syscall_def *table = mips64_syscall_table;
481
482 /* XXX - plenty of room for future improvement here */
483 for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
484 if (num == table[iter].num)
485 return table[iter].name;
486 }
487
488 return NULL;
489 }
490
491 /**
492 * Iterate through the syscall table and return the syscall name
493 * @param spot the offset into the syscall table
494 *
495 * Return the syscall name at position @spot or NULL on failure. This function
496 * should only ever be used internally by libseccomp.
497 *
498 */
499 const char *mips64_syscall_iterate_name(unsigned int spot)
500 {
501 /* XXX - no safety checks here */
502 return mips64_syscall_table[spot].name;
503 }
0 /**
1 * Enhanced Seccomp MIPS64 Specific Code
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #include <linux/audit.h>
23
24 #include "arch.h"
25 #include "arch-mips64.h"
26
27 const struct arch_def arch_def_mips64 = {
28 .token = SCMP_ARCH_MIPS64,
29 .token_bpf = AUDIT_ARCH_MIPS64,
30 .size = ARCH_SIZE_64,
31 .endian = ARCH_ENDIAN_BIG,
32 };
33
34 const struct arch_def arch_def_mipsel64 = {
35 .token = SCMP_ARCH_MIPSEL64,
36 .token_bpf = AUDIT_ARCH_MIPSEL64,
37 .size = ARCH_SIZE_64,
38 .endian = ARCH_ENDIAN_LITTLE,
39 };
0 /**
1 * Enhanced Seccomp MIPS64 Specific Code
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #ifndef _ARCH_MIPS64_H
23 #define _ARCH_MIPS64_H
24
25 #include <inttypes.h>
26
27 #include "arch.h"
28 #include "system.h"
29
30 extern const struct arch_def arch_def_mips64;
31 extern const struct arch_def arch_def_mipsel64;
32
33 int mips64_syscall_resolve_name(const char *name);
34 const char *mips64_syscall_resolve_num(int num);
35
36 const char *mips64_syscall_iterate_name(unsigned int spot);
37
38 #endif
0 /**
1 * Enhanced Seccomp MIPS Specific Code
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #include <string.h>
23
24 #include <seccomp.h>
25
26 #include "arch.h"
27 #include "arch-mips64n32.h"
28
29 /* N32 ABI */
30 #define __NR_SYSCALL_BASE 6000
31
32 /* NOTE: based on Linux 3.19 */
33 const struct arch_syscall_def mips64n32_syscall_table[] = { \
34 { "_llseek", __PNR__llseek },
35 { "_newselect", (__NR_SYSCALL_BASE + 22) },
36 { "_sysctl", (__NR_SYSCALL_BASE + 152) },
37 { "accept", (__NR_SYSCALL_BASE + 42) },
38 { "accept4", (__NR_SYSCALL_BASE + 297) },
39 { "access", (__NR_SYSCALL_BASE + 20) },
40 { "acct", (__NR_SYSCALL_BASE + 158) },
41 { "add_key", (__NR_SYSCALL_BASE + 243) },
42 { "adjtimex", (__NR_SYSCALL_BASE + 154) },
43 { "afs_syscall", (__NR_SYSCALL_BASE + 176) },
44 { "alarm", (__NR_SYSCALL_BASE + 37) },
45 { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
46 { "arm_sync_file_range", __PNR_arm_sync_file_range },
47 { "arch_prctl", __PNR_arch_prctl },
48 { "bdflush", __PNR_bdflush },
49 { "bind", (__NR_SYSCALL_BASE + 48) },
50 { "bpf", (__NR_SYSCALL_BASE + 319) },
51 { "break", __PNR_break },
52 { "breakpoint", __PNR_breakpoint },
53 { "brk", (__NR_SYSCALL_BASE + 12) },
54 { "cachectl", (__NR_SYSCALL_BASE + 198) },
55 { "cacheflush", (__NR_SYSCALL_BASE + 197) },
56 { "capget", (__NR_SYSCALL_BASE + 123) },
57 { "capset", (__NR_SYSCALL_BASE + 124) },
58 { "chdir", (__NR_SYSCALL_BASE + 78) },
59 { "chmod", (__NR_SYSCALL_BASE + 88) },
60 { "chown", (__NR_SYSCALL_BASE + 90) },
61 { "chown32", __PNR_chown32 },
62 { "chroot", (__NR_SYSCALL_BASE + 156) },
63 { "clock_adjtime", (__NR_SYSCALL_BASE + 305) },
64 { "clock_getres", (__NR_SYSCALL_BASE + 227) },
65 { "clock_gettime", (__NR_SYSCALL_BASE + 226) },
66 { "clock_nanosleep", (__NR_SYSCALL_BASE + 228) },
67 { "clock_settime", (__NR_SYSCALL_BASE + 225) },
68 { "clone", (__NR_SYSCALL_BASE + 55) },
69 { "close", (__NR_SYSCALL_BASE + 3) },
70 { "connect", (__NR_SYSCALL_BASE + 41) },
71 { "creat", (__NR_SYSCALL_BASE + 83) },
72 { "create_module", (__NR_SYSCALL_BASE + 167) },
73 { "delete_module", (__NR_SYSCALL_BASE + 169) },
74 { "dup", (__NR_SYSCALL_BASE + 31) },
75 { "dup2", (__NR_SYSCALL_BASE + 32) },
76 { "dup3", (__NR_SYSCALL_BASE + 290) },
77 { "epoll_create", (__NR_SYSCALL_BASE + 207) },
78 { "epoll_create1", (__NR_SYSCALL_BASE + 289) },
79 { "epoll_ctl", (__NR_SYSCALL_BASE + 208) },
80 { "epoll_ctl_old", __PNR_epoll_ctl_old },
81 { "epoll_pwait", (__NR_SYSCALL_BASE + 276) },
82 { "epoll_wait", (__NR_SYSCALL_BASE + 209) },
83 { "epoll_wait_old", __PNR_epoll_wait_old },
84 { "eventfd", (__NR_SYSCALL_BASE + 282) },
85 { "eventfd2", (__NR_SYSCALL_BASE + 288) },
86 { "execve", (__NR_SYSCALL_BASE + 57) },
87 { "execveat", (__NR_SYSCALL_BASE + 320) },
88 { "exit", (__NR_SYSCALL_BASE + 58) },
89 { "exit_group", (__NR_SYSCALL_BASE + 205) },
90 { "faccessat", (__NR_SYSCALL_BASE + 263) },
91 { "fadvise64", (__NR_SYSCALL_BASE + 216) },
92 { "fadvise64_64", __PNR_fadvise64_64 },
93 { "fallocate", (__NR_SYSCALL_BASE + 283) },
94 { "fanotify_init", (__NR_SYSCALL_BASE + 300) },
95 { "fanotify_mark", (__NR_SYSCALL_BASE + 301) },
96 { "fchdir", (__NR_SYSCALL_BASE + 79) },
97 { "fchmod", (__NR_SYSCALL_BASE + 89) },
98 { "fchmodat", (__NR_SYSCALL_BASE + 262) },
99 { "fchown", (__NR_SYSCALL_BASE + 91) },
100 { "fchown32", __PNR_fchown32 },
101 { "fchownat", (__NR_SYSCALL_BASE + 254) },
102 { "fcntl", (__NR_SYSCALL_BASE + 70) },
103 { "fcntl64", (__NR_SYSCALL_BASE + 212) },
104 { "fdatasync", (__NR_SYSCALL_BASE + 73) },
105 { "fgetxattr", (__NR_SYSCALL_BASE + 185) },
106 { "finit_module", (__NR_SYSCALL_BASE + 312) },
107 { "flistxattr", (__NR_SYSCALL_BASE + 188) },
108 { "flock", (__NR_SYSCALL_BASE + 71) },
109 { "fork", (__NR_SYSCALL_BASE + 56) },
110 { "fremovexattr", (__NR_SYSCALL_BASE + 191) },
111 { "fsetxattr", (__NR_SYSCALL_BASE + 182) },
112 { "fstat", (__NR_SYSCALL_BASE + 5) },
113 { "fstat64", __PNR_fstat64 },
114 { "fstatat64", __PNR_fstat64 },
115 { "fstatfs", (__NR_SYSCALL_BASE + 135) },
116 { "fstatfs64", (__NR_SYSCALL_BASE + 218) },
117 { "fsync", (__NR_SYSCALL_BASE + 72) },
118 { "ftime", __PNR_ftime },
119 { "ftruncate", (__NR_SYSCALL_BASE + 75) },
120 { "ftruncate64", __PNR_ftruncate64 },
121 { "futex", (__NR_SYSCALL_BASE + 194) },
122 { "futimesat", (__NR_SYSCALL_BASE + 255) },
123 { "get_kernel_syms", (__NR_SYSCALL_BASE + 170) },
124 { "get_mempolicy", (__NR_SYSCALL_BASE + 232) },
125 { "get_robust_list", (__NR_SYSCALL_BASE + 273) },
126 { "get_thread_area", __PNR_get_thread_area },
127 { "getcpu", (__NR_SYSCALL_BASE + 275) },
128 { "getcwd", (__NR_SYSCALL_BASE + 77) },
129 { "getdents", (__NR_SYSCALL_BASE + 76) },
130 { "getdents64", (__NR_SYSCALL_BASE + 299) },
131 { "getegid", (__NR_SYSCALL_BASE + 106) },
132 { "getegid32", __PNR_getegid32 },
133 { "geteuid", (__NR_SYSCALL_BASE + 105) },
134 { "geteuid32", __PNR_geteuid32 },
135 { "getgid", (__NR_SYSCALL_BASE + 102) },
136 { "getgid32", __PNR_getgid32 },
137 { "getgroups", (__NR_SYSCALL_BASE + 113) },
138 { "getgroups32", __PNR_getgroups32 },
139 { "getitimer", (__NR_SYSCALL_BASE + 35) },
140 { "getpeername", (__NR_SYSCALL_BASE + 51) },
141 { "getpgid", (__NR_SYSCALL_BASE + 119) },
142 { "getpgrp", (__NR_SYSCALL_BASE + 109) },
143 { "getpid", (__NR_SYSCALL_BASE + 38) },
144 { "getpmsg", (__NR_SYSCALL_BASE + 174) },
145 { "getppid", (__NR_SYSCALL_BASE + 108) },
146 { "getpriority", (__NR_SYSCALL_BASE + 137) },
147 { "getrandom", (__NR_SYSCALL_BASE + 317) },
148 { "getresgid", (__NR_SYSCALL_BASE + 118) },
149 { "getresgid32", __PNR_getresgid32 },
150 { "getresuid", (__NR_SYSCALL_BASE + 116) },
151 { "getresuid32", __PNR_getresuid32 },
152 { "getrlimit", (__NR_SYSCALL_BASE + 95) },
153 { "getrusage", (__NR_SYSCALL_BASE + 96) },
154 { "getsid", (__NR_SYSCALL_BASE + 122) },
155 { "getsockname", (__NR_SYSCALL_BASE + 50) },
156 { "getsockopt", (__NR_SYSCALL_BASE + 54) },
157 { "gettid", (__NR_SYSCALL_BASE + 178) },
158 { "gettimeofday", (__NR_SYSCALL_BASE + 94) },
159 { "getuid", (__NR_SYSCALL_BASE + 100) },
160 { "getuid32", __PNR_getuid32 },
161 { "getxattr", (__NR_SYSCALL_BASE + 183) },
162 { "gtty", __PNR_gtty },
163 { "idle", __PNR_idle },
164 { "init_module", (__NR_SYSCALL_BASE + 168) },
165 { "inotify_add_watch", (__NR_SYSCALL_BASE + 248) },
166 { "inotify_init", (__NR_SYSCALL_BASE + 247) },
167 { "inotify_init1", (__NR_SYSCALL_BASE + 292) },
168 { "inotify_rm_watch", (__NR_SYSCALL_BASE + 249) },
169 { "io_cancel", (__NR_SYSCALL_BASE + 204) },
170 { "io_destroy", (__NR_SYSCALL_BASE + 201) },
171 { "io_getevents", (__NR_SYSCALL_BASE + 202) },
172 { "io_setup", (__NR_SYSCALL_BASE + 200) },
173 { "io_submit", (__NR_SYSCALL_BASE + 203) },
174 { "ioctl", (__NR_SYSCALL_BASE + 15) },
175 { "ioperm", __PNR_ioperm },
176 { "iopl", __PNR_iopl },
177 { "ioprio_get", (__NR_SYSCALL_BASE + 278) },
178 { "ioprio_set", (__NR_SYSCALL_BASE + 277) },
179 { "ipc", __PNR_ipc },
180 { "kcmp", (__NR_SYSCALL_BASE + 311) },
181 { "kexec_file_load", __PNR_kexec_file_load },
182 { "kexec_load", (__NR_SYSCALL_BASE + 274) },
183 { "keyctl", (__NR_SYSCALL_BASE + 245) },
184 { "kill", (__NR_SYSCALL_BASE + 60) },
185 { "lchown", (__NR_SYSCALL_BASE + 92) },
186 { "lchown32", __PNR_lchown32 },
187 { "lgetxattr", (__NR_SYSCALL_BASE + 184) },
188 { "link", (__NR_SYSCALL_BASE + 84) },
189 { "linkat", (__NR_SYSCALL_BASE + 259) },
190 { "listen", (__NR_SYSCALL_BASE + 49) },
191 { "listxattr", (__NR_SYSCALL_BASE + 186) },
192 { "llistxattr", (__NR_SYSCALL_BASE + 187) },
193 { "lock", __PNR_lock },
194 { "lookup_dcookie", (__NR_SYSCALL_BASE + 206) },
195 { "lremovexattr", (__NR_SYSCALL_BASE + 190) },
196 { "lseek", (__NR_SYSCALL_BASE + 8) },
197 { "lsetxattr", (__NR_SYSCALL_BASE + 181) },
198 { "lstat", (__NR_SYSCALL_BASE + 6) },
199 { "lstat64", __PNR_lstat64 },
200 { "madvise", (__NR_SYSCALL_BASE + 27) },
201 { "mbind", (__NR_SYSCALL_BASE + 231) },
202 { "memfd_create", (__NR_SYSCALL_BASE + 318) },
203 { "migrate_pages", (__NR_SYSCALL_BASE + 250) },
204 { "mincore", (__NR_SYSCALL_BASE + 26) },
205 { "mkdir", (__NR_SYSCALL_BASE + 81) },
206 { "mkdirat", (__NR_SYSCALL_BASE + 252) },
207 { "mknod", (__NR_SYSCALL_BASE + 131) },
208 { "mknodat", (__NR_SYSCALL_BASE + 253) },
209 { "mlock", (__NR_SYSCALL_BASE + 146) },
210 { "mlockall", (__NR_SYSCALL_BASE + 148) },
211 { "mmap", (__NR_SYSCALL_BASE + 9) },
212 { "mmap2", __PNR_mmap2 },
213 { "modify_ldt", __PNR_modify_ldt },
214 { "mount", (__NR_SYSCALL_BASE + 160) },
215 { "move_pages", (__NR_SYSCALL_BASE + 271) },
216 { "mprotect", (__NR_SYSCALL_BASE + 10) },
217 { "mpx", __PNR_mpx },
218 { "mq_getsetattr", (__NR_SYSCALL_BASE + 239) },
219 { "mq_notify", (__NR_SYSCALL_BASE + 238) },
220 { "mq_open", (__NR_SYSCALL_BASE + 234) },
221 { "mq_timedreceive", (__NR_SYSCALL_BASE + 237) },
222 { "mq_timedsend", (__NR_SYSCALL_BASE + 236) },
223 { "mq_unlink", (__NR_SYSCALL_BASE + 235) },
224 { "mremap", (__NR_SYSCALL_BASE + 24) },
225 { "msgctl", (__NR_SYSCALL_BASE + 69) },
226 { "msgget", (__NR_SYSCALL_BASE + 66) },
227 { "msgrcv", (__NR_SYSCALL_BASE + 68) },
228 { "msgsnd", (__NR_SYSCALL_BASE + 67) },
229 { "msync", (__NR_SYSCALL_BASE + 25) },
230 { "munlock", (__NR_SYSCALL_BASE + 147) },
231 { "munlockall", (__NR_SYSCALL_BASE + 149) },
232 { "munmap", (__NR_SYSCALL_BASE + 11) },
233 { "name_to_handle_at", (__NR_SYSCALL_BASE + 303) },
234 { "nanosleep", (__NR_SYSCALL_BASE + 34) },
235 { "newfstatat", (__NR_SYSCALL_BASE + 256) },
236 { "nfsservctl", (__NR_SYSCALL_BASE + 173) },
237 { "nice", __PNR_nice },
238 { "oldfstat", __PNR_oldfstat },
239 { "oldlstat", __PNR_oldlstat },
240 { "oldolduname", __PNR_oldolduname },
241 { "oldstat", __PNR_oldstat },
242 { "olduname", __PNR_olduname },
243 { "oldwait4", __PNR_oldwait4 },
244 { "open", (__NR_SYSCALL_BASE + 2) },
245 { "open_by_handle_at", (__NR_SYSCALL_BASE + 304) },
246 { "openat", (__NR_SYSCALL_BASE + 251) },
247 { "pause", (__NR_SYSCALL_BASE + 33) },
248 { "pciconfig_iobase", __PNR_pciconfig_iobase },
249 { "pciconfig_read", __PNR_pciconfig_read },
250 { "pciconfig_write", __PNR_pciconfig_write },
251 { "perf_event_open", (__NR_SYSCALL_BASE + 296) },
252 { "personality", (__NR_SYSCALL_BASE + 132) },
253 { "pipe", (__NR_SYSCALL_BASE + 21) },
254 { "pipe2", (__NR_SYSCALL_BASE + 291) },
255 { "pivot_root", (__NR_SYSCALL_BASE + 151) },
256 { "poll", (__NR_SYSCALL_BASE + 7) },
257 { "ppoll", (__NR_SYSCALL_BASE + 265) },
258 { "prctl", (__NR_SYSCALL_BASE + 153) },
259 { "pread64", (__NR_SYSCALL_BASE + 16) },
260 { "preadv", (__NR_SYSCALL_BASE + 293) },
261 { "prlimit64", (__NR_SYSCALL_BASE + 302) },
262 { "process_vm_readv", (__NR_SYSCALL_BASE + 309) },
263 { "process_vm_writev", (__NR_SYSCALL_BASE + 310) },
264 { "prof", __PNR_prof },
265 { "profil", __PNR_profil },
266 { "pselect6", (__NR_SYSCALL_BASE + 264) },
267 { "ptrace", (__NR_SYSCALL_BASE + 99) },
268 { "putpmsg", (__NR_SYSCALL_BASE + 175) },
269 { "pwrite64", (__NR_SYSCALL_BASE + 17) },
270 { "pwritev", (__NR_SYSCALL_BASE + 294) },
271 { "query_module", (__NR_SYSCALL_BASE + 171) },
272 { "quotactl", (__NR_SYSCALL_BASE + 172) },
273 { "read", (__NR_SYSCALL_BASE + 0) },
274 { "readahead", (__NR_SYSCALL_BASE + 179) },
275 { "readdir", __PNR_readdir },
276 { "readlink", (__NR_SYSCALL_BASE + 87) },
277 { "readlinkat", (__NR_SYSCALL_BASE + 261) },
278 { "readv", (__NR_SYSCALL_BASE + 18) },
279 { "reboot", (__NR_SYSCALL_BASE + 164) },
280 { "recv", __PNR_recv },
281 { "recvfrom", (__NR_SYSCALL_BASE + 44) },
282 { "recvmmsg", (__NR_SYSCALL_BASE + 298) },
283 { "recvmsg", (__NR_SYSCALL_BASE + 46) },
284 { "remap_file_pages", (__NR_SYSCALL_BASE + 210) },
285 { "removexattr", (__NR_SYSCALL_BASE + 189) },
286 { "rename", (__NR_SYSCALL_BASE + 80) },
287 { "renameat", (__NR_SYSCALL_BASE + 258) },
288 { "renameat2", (__NR_SYSCALL_BASE + 315) },
289 { "request_key", (__NR_SYSCALL_BASE + 244) },
290 { "restart_syscall", (__NR_SYSCALL_BASE + 214) },
291 { "rmdir", (__NR_SYSCALL_BASE + 82) },
292 { "rt_sigaction", (__NR_SYSCALL_BASE + 13) },
293 { "rt_sigpending", (__NR_SYSCALL_BASE + 125) },
294 { "rt_sigprocmask", (__NR_SYSCALL_BASE + 14) },
295 { "rt_sigqueueinfo", (__NR_SYSCALL_BASE + 127) },
296 { "rt_sigreturn", (__NR_SYSCALL_BASE + 211) },
297 { "rt_sigsuspend", (__NR_SYSCALL_BASE + 128) },
298 { "rt_sigtimedwait", (__NR_SYSCALL_BASE + 126) },
299 { "rt_tgsigqueueinfo", (__NR_SYSCALL_BASE + 295) },
300 { "sched_get_priority_max", (__NR_SYSCALL_BASE + 143) },
301 { "sched_get_priority_min", (__NR_SYSCALL_BASE + 144) },
302 { "sched_getaffinity", (__NR_SYSCALL_BASE + 196) },
303 { "sched_getattr", (__NR_SYSCALL_BASE + 314) },
304 { "sched_getparam", (__NR_SYSCALL_BASE + 140) },
305 { "sched_getscheduler", (__NR_SYSCALL_BASE + 142) },
306 { "sched_rr_get_interval", (__NR_SYSCALL_BASE + 145) },
307 { "sched_setaffinity", (__NR_SYSCALL_BASE + 195) },
308 { "sched_setattr", (__NR_SYSCALL_BASE + 313) },
309 { "sched_setparam", (__NR_SYSCALL_BASE + 139) },
310 { "sched_setscheduler", (__NR_SYSCALL_BASE + 141) },
311 { "sched_yield", (__NR_SYSCALL_BASE + 23) },
312 { "seccomp", (__NR_SYSCALL_BASE + 316) },
313 { "security", __PNR_security },
314 { "select", __PNR_select },
315 { "semctl", (__NR_SYSCALL_BASE + 64) },
316 { "semget", (__NR_SYSCALL_BASE + 62) },
317 { "semop", (__NR_SYSCALL_BASE + 63) },
318 { "semtimedop", (__NR_SYSCALL_BASE + 215) },
319 { "send", __PNR_send },
320 { "sendfile", (__NR_SYSCALL_BASE + 39) },
321 { "sendfile64", (__NR_SYSCALL_BASE + 219) },
322 { "sendmmsg", (__NR_SYSCALL_BASE + 307) },
323 { "sendmsg", (__NR_SYSCALL_BASE + 45) },
324 { "sendto", (__NR_SYSCALL_BASE + 43) },
325 { "set_mempolicy", (__NR_SYSCALL_BASE + 233) },
326 { "set_robust_list", (__NR_SYSCALL_BASE + 272) },
327 { "set_thread_area", (__NR_SYSCALL_BASE + 246) },
328 { "set_tid_address", (__NR_SYSCALL_BASE + 213) },
329 { "set_tls", __PNR_set_tls },
330 { "setdomainname", (__NR_SYSCALL_BASE + 166) },
331 { "setfsgid", (__NR_SYSCALL_BASE + 121) },
332 { "setfsgid32", __PNR_setfsgid32 },
333 { "setfsuid", (__NR_SYSCALL_BASE + 120) },
334 { "setfsuid32", __PNR_setfsuid32 },
335 { "setgid", (__NR_SYSCALL_BASE + 104) },
336 { "setgid32", __PNR_setgid32 },
337 { "setgroups", (__NR_SYSCALL_BASE + 114) },
338 { "setgroups32", __PNR_setgroups32 },
339 { "sethostname", (__NR_SYSCALL_BASE + 165) },
340 { "setitimer", (__NR_SYSCALL_BASE + 36) },
341 { "setns", (__NR_SYSCALL_BASE + 308) },
342 { "setpgid", (__NR_SYSCALL_BASE + 107) },
343 { "setpriority", (__NR_SYSCALL_BASE + 138) },
344 { "setregid", (__NR_SYSCALL_BASE + 112) },
345 { "setregid32", __PNR_setregid32 },
346 { "setresgid", (__NR_SYSCALL_BASE + 117) },
347 { "setresgid32", __PNR_setresgid32 },
348 { "setresuid", (__NR_SYSCALL_BASE + 115) },
349 { "setresuid32", __PNR_setresuid32 },
350 { "setreuid", (__NR_SYSCALL_BASE + 111) },
351 { "setreuid32", __PNR_setreuid32 },
352 { "setrlimit", (__NR_SYSCALL_BASE + 155) },
353 { "setsid", (__NR_SYSCALL_BASE + 110) },
354 { "setsockopt", (__NR_SYSCALL_BASE + 53) },
355 { "settimeofday", (__NR_SYSCALL_BASE + 159) },
356 { "setuid", (__NR_SYSCALL_BASE + 103) },
357 { "setuid32", __PNR_setuid32 },
358 { "setxattr", (__NR_SYSCALL_BASE + 180) },
359 { "sgetmask", __PNR_sgetmask },
360 { "shmat", (__NR_SYSCALL_BASE + 29) },
361 { "shmctl", (__NR_SYSCALL_BASE + 30) },
362 { "shmdt", (__NR_SYSCALL_BASE + 65) },
363 { "shmget", (__NR_SYSCALL_BASE + 28) },
364 { "shutdown", (__NR_SYSCALL_BASE + 47) },
365 { "sigaction", __PNR_sigaction },
366 { "sigaltstack", (__NR_SYSCALL_BASE + 129) },
367 { "signal", __PNR_signal },
368 { "signalfd", (__NR_SYSCALL_BASE + 280) },
369 { "signalfd4", (__NR_SYSCALL_BASE + 287) },
370 { "sigpending", __PNR_sigpending },
371 { "sigprocmask", __PNR_sigprocmask },
372 { "sigreturn", __PNR_sigreturn },
373 { "sigsuspend", __PNR_sigsuspend },
374 { "socket", (__NR_SYSCALL_BASE + 40) },
375 { "socketcall", __PNR_socketcall },
376 { "socketpair", (__NR_SYSCALL_BASE + 52) },
377 { "splice", (__NR_SYSCALL_BASE + 267) },
378 { "ssetmask", __PNR_ssetmask },
379 { "stat", (__NR_SYSCALL_BASE + 4) },
380 { "stat64", __PNR_stat64 },
381 { "statfs", (__NR_SYSCALL_BASE + 134) },
382 { "statfs64", (__NR_SYSCALL_BASE + 217) },
383 { "stime", __PNR_stime },
384 { "stty", __PNR_stty },
385 { "swapoff", (__NR_SYSCALL_BASE + 163) },
386 { "swapon", (__NR_SYSCALL_BASE + 162) },
387 { "symlink", (__NR_SYSCALL_BASE + 86) },
388 { "symlinkat", (__NR_SYSCALL_BASE + 260) },
389 { "sync", (__NR_SYSCALL_BASE + 157) },
390 { "sync_file_range", (__NR_SYSCALL_BASE + 268) },
391 { "sync_file_range2", __PNR_sync_file_range2 },
392 { "syncfs", (__NR_SYSCALL_BASE + 306) },
393 { "syscall", __PNR_syscall },
394 { "sysfs", (__NR_SYSCALL_BASE + 136) },
395 { "sysinfo", (__NR_SYSCALL_BASE + 97) },
396 { "syslog", (__NR_SYSCALL_BASE + 101) },
397 { "sysmips", (__NR_SYSCALL_BASE + 199) },
398 { "tee", (__NR_SYSCALL_BASE + 269) },
399 { "tgkill", (__NR_SYSCALL_BASE + 229) },
400 { "time", __PNR_time },
401 { "timer_create", (__NR_SYSCALL_BASE + 220) },
402 { "timer_delete", (__NR_SYSCALL_BASE + 224) },
403 { "timer_getoverrun", (__NR_SYSCALL_BASE + 223) },
404 { "timer_gettime", (__NR_SYSCALL_BASE + 222) },
405 { "timer_settime", (__NR_SYSCALL_BASE + 221) },
406 { "timerfd", (__NR_SYSCALL_BASE + 281) },
407 { "timerfd_create", (__NR_SYSCALL_BASE + 284) },
408 { "timerfd_gettime", (__NR_SYSCALL_BASE + 285) },
409 { "timerfd_settime", (__NR_SYSCALL_BASE + 286) },
410 { "times", (__NR_SYSCALL_BASE + 98) },
411 { "tkill", (__NR_SYSCALL_BASE + 192) },
412 { "truncate", (__NR_SYSCALL_BASE + 74) },
413 { "truncate64", __PNR_truncate64 },
414 { "tuxcall", __PNR_tuxcall },
415 { "ugetrlimit", __PNR_ugetrlimit },
416 { "ulimit", __PNR_ulimit },
417 { "umask", (__NR_SYSCALL_BASE + 93) },
418 { "umount", __PNR_umount },
419 { "umount2", (__NR_SYSCALL_BASE + 161) },
420 { "uname", (__NR_SYSCALL_BASE + 61) },
421 { "unlink", (__NR_SYSCALL_BASE + 85) },
422 { "unlinkat", (__NR_SYSCALL_BASE + 257) },
423 { "unshare", (__NR_SYSCALL_BASE + 266) },
424 { "uselib", __PNR_uselib },
425 { "usr26", __PNR_usr26 },
426 { "usr32", __PNR_usr32 },
427 { "ustat", (__NR_SYSCALL_BASE + 133) },
428 { "utime", (__NR_SYSCALL_BASE + 130) },
429 { "utimensat", (__NR_SYSCALL_BASE + 279) },
430 { "utimes", (__NR_SYSCALL_BASE + 230) },
431 { "vfork", __PNR_vfork },
432 { "vhangup", (__NR_SYSCALL_BASE + 150) },
433 { "vm86", __PNR_vm86 },
434 { "vm86old", __PNR_vm86old },
435 { "vmsplice", (__NR_SYSCALL_BASE + 270) },
436 { "vserver", (__NR_SYSCALL_BASE + 240) },
437 { "wait4", (__NR_SYSCALL_BASE + 59) },
438 { "waitid", (__NR_SYSCALL_BASE + 241) },
439 { "waitpid", __PNR_waitpid },
440 { "write", (__NR_SYSCALL_BASE + 1) },
441 { "writev", (__NR_SYSCALL_BASE + 19) },
442 { NULL, __NR_SCMP_ERROR },
443 };
444
445 /**
446 * Resolve a syscall name to a number
447 * @param name the syscall name
448 *
449 * Resolve the given syscall name to the syscall number using the syscall table.
450 * Returns the syscall number on success, including negative pseudo syscall
451 * numbers; returns __NR_SCMP_ERROR on failure.
452 *
453 */
454 int mips64n32_syscall_resolve_name(const char *name)
455 {
456 unsigned int iter;
457 const struct arch_syscall_def *table = mips64n32_syscall_table;
458
459 /* XXX - plenty of room for future improvement here */
460 for (iter = 0; table[iter].name != NULL; iter++) {
461 if (strcmp(name, table[iter].name) == 0)
462 return table[iter].num;
463 }
464
465 return __NR_SCMP_ERROR;
466 }
467
468 /**
469 * Resolve a syscall number to a name
470 * @param num the syscall number
471 *
472 * Resolve the given syscall number to the syscall name using the syscall table.
473 * Returns a pointer to the syscall name string on success, including pseudo
474 * syscall names; returns NULL on failure.
475 *
476 */
477 const char *mips64n32_syscall_resolve_num(int num)
478 {
479 unsigned int iter;
480 const struct arch_syscall_def *table = mips64n32_syscall_table;
481
482 /* XXX - plenty of room for future improvement here */
483 for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
484 if (num == table[iter].num)
485 return table[iter].name;
486 }
487
488 return NULL;
489 }
490
491 /**
492 * Iterate through the syscall table and return the syscall name
493 * @param spot the offset into the syscall table
494 *
495 * Return the syscall name at position @spot or NULL on failure. This function
496 * should only ever be used internally by libseccomp.
497 *
498 */
499 const char *mips64n32_syscall_iterate_name(unsigned int spot)
500 {
501 /* XXX - no safety checks here */
502 return mips64n32_syscall_table[spot].name;
503 }
0 /**
1 * Enhanced Seccomp MIPS Specific Code
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #include <stdlib.h>
23 #include <errno.h>
24 #include <linux/audit.h>
25
26 #include "arch.h"
27 #include "arch-mips64n32.h"
28
29 const struct arch_def arch_def_mips64n32 = {
30 .token = SCMP_ARCH_MIPS64N32,
31 .token_bpf = AUDIT_ARCH_MIPS64N32,
32 .size = ARCH_SIZE_32,
33 .endian = ARCH_ENDIAN_BIG,
34 };
35
36 const struct arch_def arch_def_mipsel64n32 = {
37 .token = SCMP_ARCH_MIPSEL64N32,
38 .token_bpf = AUDIT_ARCH_MIPSEL64N32,
39 .size = ARCH_SIZE_32,
40 .endian = ARCH_ENDIAN_LITTLE,
41 };
0 /**
1 * Enhanced Seccomp MIPS Specific Code
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #ifndef _ARCH_MIPS64N32_H
23 #define _ARCH_MIPS64N32_H
24
25 #include <inttypes.h>
26
27 #include "arch.h"
28 #include "system.h"
29
30 extern const struct arch_def arch_def_mips64n32;
31 extern const struct arch_def arch_def_mipsel64n32;
32
33 int mips64n32_syscall_resolve_name(const char *name);
34 const char *mips64n32_syscall_resolve_num(int num);
35
36 const char *mips64n32_syscall_iterate_name(unsigned int spot);
37
38 #endif
0 /**
1 * Enhanced Seccomp Architecture Sycall Checker
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #include <stdlib.h>
23 #include <stdio.h>
24 #include <string.h>
25
26 #include "arch.h"
27 #include "arch-x86.h"
28 #include "arch-x86_64.h"
29 #include "arch-x32.h"
30 #include "arch-arm.h"
31 #include "arch-aarch64.h"
32 #include "arch-mips.h"
33 #include "arch-mips64.h"
34 #include "arch-mips64n32.h"
35
36 /**
37 * compare the syscall values
38 * @param str_miss the other bad architectures
39 * @param syscall the syscall string to compare against
40 * @param arch_name the name of the arch being tested
41 * @param arch_sys the syscall name to compare
42 *
43 * Compare the syscall names and update @str_miss if necessary.
44 *
45 */
46 void syscall_check(char *str_miss, const char *syscall,
47 const char *arch_name, const char *arch_sys)
48 {
49 if (strcmp(syscall, arch_sys)) {
50 if (str_miss[0] != '\0')
51 strcat(str_miss, ",");
52 strcat(str_miss, arch_name);
53 }
54 }
55
56 /**
57 * main
58 */
59 int main(int argc, char *argv[])
60 {
61 int i_x86 = 0;
62 int i_x86_64 = 0;
63 int i_x32 = 0;
64 int i_arm = 0;
65 int i_aarch64 = 0;
66 int i_mips = 0;
67 int i_mips64 = 0;
68 int i_mips64n32 = 0;
69 const char *sys_name;
70 char str_miss[256];
71
72 do {
73 str_miss[0] = '\0';
74 sys_name = x86_syscall_iterate_name(i_x86);
75 if (sys_name == NULL) {
76 printf("FAULT\n");
77 return 1;
78 }
79
80 /* check each arch using x86 as the reference */
81 syscall_check(str_miss, sys_name, "x86_64",
82 x86_64_syscall_iterate_name(i_x86_64));
83 syscall_check(str_miss, sys_name, "x32",
84 x32_syscall_iterate_name(i_x32));
85 syscall_check(str_miss, sys_name, "arm",
86 arm_syscall_iterate_name(i_arm));
87 syscall_check(str_miss, sys_name, "aarch64",
88 aarch64_syscall_iterate_name(i_aarch64));
89 syscall_check(str_miss, sys_name, "mips",
90 mips_syscall_iterate_name(i_mips));
91 syscall_check(str_miss, sys_name, "mips64",
92 mips64_syscall_iterate_name(i_mips64));
93 syscall_check(str_miss, sys_name, "mips64n32",
94 mips64n32_syscall_iterate_name(i_mips64n32));
95
96 /* output the results */
97 printf("%s: ", sys_name);
98 if (str_miss[0] != '\0') {
99 printf("MISS(%s)\n", str_miss);
100 return 1;
101 } else
102 printf("OK\n");
103
104 /* next */
105 if (x86_syscall_iterate_name(i_x86 + 1))
106 i_x86++;
107 if (!x86_64_syscall_iterate_name(++i_x86_64))
108 i_x86_64 = -1;
109 if (!x32_syscall_iterate_name(++i_x32))
110 i_x32 = -1;
111 if (!arm_syscall_iterate_name(++i_arm))
112 i_arm = -1;
113 if (!mips_syscall_iterate_name(++i_mips))
114 i_mips = -1;
115 if (!mips64_syscall_iterate_name(++i_mips64))
116 i_mips64 = -1;
117 if (!mips64n32_syscall_iterate_name(++i_mips64n32))
118 i_mips64n32 = -1;
119 if (!aarch64_syscall_iterate_name(++i_aarch64))
120 i_aarch64 = -1;
121 } while (i_x86_64 >= 0 && i_x32 >= 0 &&
122 i_arm >= 0 && i_aarch64 >= 0 &&
123 i_mips >= 0 && i_mips64 >= 0 && i_mips64n32 >= 0);
124
125 /* check for any leftovers */
126 sys_name = x86_syscall_iterate_name(i_x86 + 1);
127 if (sys_name) {
128 printf("%s: ERROR, x86 has additional syscalls\n", sys_name);
129 return 1;
130 }
131 if (i_x86_64 >= 0) {
132 printf("%s: ERROR, x86_64 has additional syscalls\n",
133 x86_64_syscall_iterate_name(i_x86_64));
134 return 1;
135 }
136 if (i_x32 >= 0) {
137 printf("%s: ERROR, x32 has additional syscalls\n",
138 x32_syscall_iterate_name(i_x32));
139 return 1;
140 }
141 if (i_arm >= 0) {
142 printf("%s: ERROR, arm has additional syscalls\n",
143 arm_syscall_iterate_name(i_arm));
144 return 1;
145 }
146 if (i_aarch64 >= 0) {
147 printf("%s: ERROR, aarch64 has additional syscalls\n",
148 aarch64_syscall_iterate_name(i_aarch64));
149 return 1;
150 }
151 if (i_mips >= 0) {
152 printf("%s: ERROR, mips has additional syscalls\n",
153 mips_syscall_iterate_name(i_mips));
154 return 1;
155 }
156 if (i_mips64 >= 0) {
157 printf("%s: ERROR, mips64 has additional syscalls\n",
158 mips64_syscall_iterate_name(i_mips64));
159 return 1;
160 }
161 if (i_mips64n32 >= 0) {
162 printf("%s: ERROR, mips64n32 has additional syscalls\n",
163 mips64n32_syscall_iterate_name(i_mips64n32));
164 return 1;
165 }
166
167 /* if we made it here, all is good */
168 return 0;
169 }
0 /**
1 * Enhanced Seccomp Architecture Sycall Checker
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.com>
5 *
6 */
7
8 /*
9 * This library is free software; you can redistribute it and/or modify it
10 * under the terms of version 2.1 of the GNU Lesser General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this library; if not, see <http://www.gnu.org/licenses>.
20 */
21
22 #include <errno.h>
23 #include <stdlib.h>
24 #include <stdio.h>
25 #include <ctype.h>
26 #include <string.h>
27 #include <unistd.h>
28
29 #include <seccomp.h>
30
31 #include "arch.h"
32 #include "arch-x86.h"
33 #include "arch-x86_64.h"
34 #include "arch-x32.h"
35 #include "arch-arm.h"
36 #include "arch-mips.h"
37 #include "arch-mips64.h"
38 #include "arch-mips64n32.h"
39 #include "arch-aarch64.h"
40
41 /**
42 * Print the usage information to stderr and exit
43 * @param program the name of the current program being invoked
44 *
45 * Print the usage information and exit with EINVAL.
46 *
47 */
48 static void exit_usage(const char *program)
49 {
50 fprintf(stderr, "usage: %s [-h] [-a <arch>] [-o <offset>]\n", program);
51 exit(EINVAL);
52 }
53
54 /**
55 * main
56 */
57 int main(int argc, char *argv[])
58 {
59 int opt;
60 const struct arch_def *arch = arch_def_native;
61 int offset = 0;
62 int iter;
63 int sys_num;
64 const char *sys_name;
65
66 /* parse the command line */
67 while ((opt = getopt(argc, argv, "a:o:h")) > 0) {
68 switch (opt) {
69 case 'a':
70 arch = arch_def_lookup_name(optarg);
71 if (arch == 0)
72 exit_usage(argv[0]);
73 break;
74 case 'o':
75 offset = atoi(optarg);
76 break;
77 case 'h':
78 default:
79 /* usage information */
80 exit_usage(argv[0]);
81 }
82 }
83
84 iter = 0;
85 do {
86 switch (arch->token) {
87 case SCMP_ARCH_X86:
88 sys_name = x86_syscall_iterate_name(iter);
89 break;
90 case SCMP_ARCH_X86_64:
91 sys_name = x86_64_syscall_iterate_name(iter);
92 break;
93 case SCMP_ARCH_X32:
94 sys_name = x32_syscall_iterate_name(iter);
95 break;
96 case SCMP_ARCH_ARM:
97 sys_name = arm_syscall_iterate_name(iter);
98 break;
99 case SCMP_ARCH_MIPS:
100 case SCMP_ARCH_MIPSEL:
101 sys_name = mips_syscall_iterate_name(iter);
102 break;
103 case SCMP_ARCH_MIPS64:
104 case SCMP_ARCH_MIPSEL64:
105 sys_name = mips64_syscall_iterate_name(iter);
106 break;
107 case SCMP_ARCH_MIPS64N32:
108 case SCMP_ARCH_MIPSEL64N32:
109 sys_name = mips64n32_syscall_iterate_name(iter);
110 break;
111 case SCMP_ARCH_AARCH64:
112 sys_name = aarch64_syscall_iterate_name(iter);
113 break;
114 default:
115 /* invalid arch */
116 exit_usage(argv[0]);
117 }
118 if (sys_name != NULL) {
119 sys_num = arch_syscall_resolve_name(arch, sys_name);
120 if (offset > 0 && sys_num > 0)
121 sys_num -= offset;
122
123 /* output the results */
124 printf("%s\t%d\n", sys_name, sys_num);
125
126 /* next */
127 iter++;
128 }
129 } while (sys_name != NULL);
130
131 return 0;
132 }
0 #!/bin/bash
1
2 #
3 # libseccomp syscall validation script
4 #
5 # Copyright (c) 2014 Red Hat <pmoore@redhat.com>
6 # Author: Paul Moore <pmoore@redhat.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 LIB_SYS_DUMP="./arch-syscall-dump"
24
25 ####
26 # functions
27
28 #
29 # Dependency check
30 #
31 # Arguments:
32 # 1 Dependency to check for
33 #
34 function check_deps() {
35 [[ -z "$1" ]] && return
36 which "$1" >& /dev/null
37 return $?
38 }
39
40 #
41 # Dependency verification
42 #
43 # Arguments:
44 # 1 Dependency to check for
45 #
46 function verify_deps() {
47 [[ -z "$1" ]] && return
48 if ! check_deps "$1"; then
49 echo "error: install \"$1\" and include it in your \$PATH"
50 exit 1
51 fi
52 }
53
54 #
55 # Print out script usage details
56 #
57 function usage() {
58 cat << EOF
59 usage: arch-syscall-validate [-h] [-a <arch>] <kernel_directory>
60
61 libseccomp syscall validation script
62 optional arguments:
63 -h show this help message and exit
64 -a architecture
65 EOF
66 }
67
68 #
69 # Dump the x86 system syscall table
70 #
71 # Arguments:
72 # 1 path to the kernel source
73 #
74 # Dump the architecture's syscall table to stdout.
75 #
76 function dump_sys_x86() {
77 cat $1/arch/x86/entry/syscalls/syscall_32.tbl | \
78 grep -v "^#" | awk '{ print $3"\t"$1 }' | sed '/^[ \t]*$/d' | \
79 sort
80 }
81
82 #
83 # Dump the x86 library syscall table
84 #
85 # Dump the library's syscall table to stdout.
86 #
87 function dump_lib_x86() {
88 $LIB_SYS_DUMP -a x86 | sed -e '/[^\t]\+\t-[0-9]\+/d'
89 }
90
91 #
92 # Dump the x86_64 system syscall table
93 #
94 # Arguments:
95 # 1 path to the kernel source
96 #
97 # Dump the architecture's syscall table to stdout.
98 #
99 function dump_sys_x86_64() {
100 cat $1/arch/x86/entry/syscalls/syscall_64.tbl | \
101 grep -v "^#" | awk '{ print $2,$3,$1 }' | sed -e '/^x32/d' | \
102 awk '{ print $2"\t"$3 }' | sed '/^[ \t]*$/d' | sort
103 }
104
105 #
106 # Dump the x86_64 library syscall table
107 #
108 # Dump the library's syscall table to stdout.
109 #
110 function dump_lib_x86_64() {
111 $LIB_SYS_DUMP -a x86_64 | sed -e '/[^\t]\+\t-[0-9]\+/d'
112 }
113
114 #
115 # Dump the x32 system syscall table
116 #
117 # Arguments:
118 # 1 path to the kernel source
119 #
120 # Dump the architecture's syscall table to stdout.
121 #
122 function dump_sys_x32() {
123 cat $1/arch/x86/entry/syscalls/syscall_64.tbl | \
124 grep -v "^#" | awk '{ print $2,$3,$1 }' | sed -e '/^64/d' | \
125 awk '{ print $2"\t"$3 }' | sed '/^[ \t]*$/d' | sort
126 }
127
128 #
129 # Dump the x32 library syscall table
130 #
131 # Dump the library's syscall table to stdout.
132 #
133 function dump_lib_x32() {
134 # 1073741824 == 0x40000000
135 $LIB_SYS_DUMP -a x32 -o 1073741824 | sed -e '/[^\t]\+\t-[0-9]\+/d'
136 }
137
138 #
139 # Dump the arm system syscall table
140 #
141 # Arguments:
142 # 1 path to the kernel source
143 #
144 # Dump the architecture's syscall table to stdout.
145 #
146 function dump_sys_arm() {
147 # NOTE: arm_sync_file_range() and sync_file_range2() share values
148 gcc -E -dM -D__ARM_EABI__ $1/arch/arm/include/uapi/asm/unistd.h | \
149 grep "^#define __\(ARM_\)*NR_" | \
150 grep -v "^#define __NR_OABI_SYSCALL_BASE" | \
151 grep -v "^#define __NR_SYSCALL_BASE" | \
152 grep -v "^#define __ARM_NR_BASE" | \
153 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/' | \
154 while read line; do \
155 if echo "$line" | grep -q "+"; then \
156 echo "$line" | awk '{ print $1"\t"$2+$4 }'; \
157 else \
158 echo "$line"; \
159 fi; \
160 done | \
161 cat - | \
162 sed -e '/#define __NR_sync_file_range2[ \t]\+__NR_arm_sync_file_range/d' | \
163 sort
164 }
165
166 #
167 # Dump the arm library syscall table
168 #
169 # Dump the library's syscall table to stdout.
170 #
171 function dump_lib_arm() {
172 # NOTE: arm_sync_file_range() and sync_file_range2() share values
173 $LIB_SYS_DUMP -a arm | sed -e '/[^\t]\+\t-[0-9]\+/d' | \
174 sed -e '/sync_file_range2[ \t]\+341/d'
175 }
176
177 #
178 # Dump the aarch64 system syscall table
179 #
180 # Arguments:
181 # 1 path to the kernel source
182 #
183 # Dump the architecture's syscall table to stdout.
184 #
185 function dump_sys_aarch64() {
186 gcc -E -dM -I$1/include/uapi -D__BITS_PER_LONG=64 $1/include/uapi/asm-generic/unistd.h | \
187 grep "^#define __NR_" | \
188 sed -e '/__NR_syscalls/d' | \
189 sed -e '/__NR_arch_specific_syscall/d' | \
190 sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+\(.*\)/\1\t\2/' | \
191 sed -e 's/__NR3264_statfs/43/' | \
192 sed -e 's/__NR3264_ftruncate/46/' | \
193 sed -e 's/__NR3264_truncate/45/' | \
194 sed -e 's/__NR3264_lseek/62/' | \
195 sed -e 's/__NR3264_sendfile/71/' | \
196 sed -e 's/__NR3264_fstatat/79/' | \
197 sed -e 's/__NR3264_fstatfs/44/' | \
198 sed -e 's/__NR3264_fcntl/25/' | \
199 sed -e 's/__NR3264_fadvise64/223/' | \
200 sed -e 's/__NR3264_mmap/222/' | \
201 sed -e 's/__NR3264_fstat/80/' | \
202 sed -e 's/__NR3264_lstat/1039/' | \
203 sed -e 's/__NR3264_stat/1038/' | \
204 sort
205 }
206
207 #
208 # Dump the aarch64 library syscall table
209 #
210 # Dump the library's syscall table to stdout.
211 #
212 function dump_lib_aarch64() {
213 $LIB_SYS_DUMP -a aarch64 | sed -e '/[^\t]\+\t-[0-9]\+/d'
214 }
215
216 #
217 # Dump the mips system syscall table
218 #
219 # Arguments:
220 # 1 path to the kernel source
221 #
222 # Dump the architecture's syscall table to stdout.
223 #
224 function dump_sys_mips() {
225 # _MIPS_SIM values:
226 # _MIPS_SIM_ABI32 == 1
227 # _MIPS_SIM_NABI32 == 2
228 # _MIPS_SIM_ABI64 == 3
229 gcc -E -dM -I$1/arch/mips/include/uapi -D_MIPS_SIM=1 $1/arch/mips/include/uapi/asm/unistd.h | \
230 grep "^#define __NR_" | \
231 grep -v "^#define __NR_O32_" | \
232 grep -v "^#define __NR_N32_" | \
233 grep -v "^#define __NR_64_" | \
234 grep -v "^#define __NR_Linux" | \
235 grep -v "^#define __NR_unused" | \
236 grep -v "^#define __NR_reserved" | \
237 sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+(__NR_Linux[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t\2/' | \
238 sort
239 }
240
241 #
242 # Dump the mips library syscall table
243 #
244 # Dump the library's syscall table to stdout.
245 #
246 function dump_lib_mips() {
247 $LIB_SYS_DUMP -a mips -o 4000 | sed -e '/[^\t]\+\t-[0-9]\+/d'
248 }
249
250 #
251 # Dump the mips64 system syscall table
252 #
253 # Arguments:
254 # 1 path to the kernel source
255 #
256 # Dump the architecture's syscall table to stdout.
257 #
258 function dump_sys_mips64() {
259 # _MIPS_SIM values:
260 # _MIPS_SIM_ABI32 == 1
261 # _MIPS_SIM_NABI32 == 2
262 # _MIPS_SIM_ABI64 == 3
263 gcc -E -dM -I$1/arch/mips/include/uapi -D_MIPS_SIM=3 $1/arch/mips/include/uapi/asm/unistd.h | \
264 grep "^#define __NR_" | \
265 grep -v "^#define __NR_O32_" | \
266 grep -v "^#define __NR_N32_" | \
267 grep -v "^#define __NR_64_" | \
268 grep -v "^#define __NR_Linux" | \
269 grep -v "^#define __NR_unused" | \
270 grep -v "^#define __NR_reserved" | \
271 sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+(__NR_Linux[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t\2/' | \
272 sort
273 }
274
275 #
276 # Dump the mips64 library syscall table
277 #
278 # Dump the library's syscall table to stdout.
279 #
280 function dump_lib_mips64() {
281 $LIB_SYS_DUMP -a mips64 -o 5000 | sed -e '/[^\t]\+\t-[0-9]\+/d'
282 }
283
284 #
285 # Dump the mips64n32 system syscall table
286 #
287 # Arguments:
288 # 1 path to the kernel source
289 #
290 # Dump the architecture's syscall table to stdout.
291 #
292 function dump_sys_mips64n32() {
293 # _MIPS_SIM values:
294 # _MIPS_SIM_ABI32 == 1
295 # _MIPS_SIM_NABI32 == 2
296 # _MIPS_SIM_ABI64 == 3
297 gcc -E -dM -I$1/arch/mips/include/uapi -D_MIPS_SIM=2 $1/arch/mips/include/uapi/asm/unistd.h | \
298 grep "^#define __NR_" | \
299 grep -v "^#define __NR_O32_" | \
300 grep -v "^#define __NR_N32_" | \
301 grep -v "^#define __NR_64_" | \
302 grep -v "^#define __NR_Linux" | \
303 grep -v "^#define __NR_unused" | \
304 grep -v "^#define __NR_reserved" | \
305 sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+(__NR_Linux[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t\2/' | \
306 sort
307 }
308
309 #
310 # Dump the mips64n32 library syscall table
311 #
312 # Dump the library's syscall table to stdout.
313 #
314 function dump_lib_mips64n32() {
315 $LIB_SYS_DUMP -a mips64n32 -o 6000 | sed -e '/[^\t]\+\t-[0-9]\+/d'
316 }
317
318 #
319 # Dump the system syscall table
320 #
321 # Arguments:
322 # 1 architecture
323 # 2 path to the kernel source
324 #
325 # Dump the system's syscall table to stdout using the given architecture.
326 #
327 function dump_sys() {
328 case $1 in
329 x86)
330 dump_sys_x86 "$2"
331 ;;
332 x86_64)
333 dump_sys_x86_64 "$2"
334 ;;
335 x32)
336 dump_sys_x32 "$2"
337 ;;
338 arm)
339 dump_sys_arm "$2"
340 ;;
341 aarch64)
342 dump_sys_aarch64 "$2"
343 ;;
344 mips)
345 dump_sys_mips "$2"
346 ;;
347 mips64)
348 dump_sys_mips64 "$2"
349 ;;
350 mips64n32)
351 dump_sys_mips64n32 "$2"
352 ;;
353 *)
354 echo ""
355 ;;
356 esac
357 }
358
359 #
360 # Dump the library syscall table
361 #
362 # Arguments:
363 # 1 architecture
364 #
365 # Dump the library's syscall table to stdout using the given architecture.
366 #
367 function dump_lib() {
368 case $1 in
369 x86)
370 dump_lib_x86 "$2"
371 ;;
372 x86_64)
373 dump_lib_x86_64 "$2"
374 ;;
375 x32)
376 dump_lib_x32 "$2"
377 ;;
378 arm)
379 dump_lib_arm "$2"
380 ;;
381 aarch64)
382 dump_lib_aarch64 "$2"
383 ;;
384 mips)
385 dump_lib_mips "$2"
386 ;;
387 mips64)
388 dump_lib_mips64 "$2"
389 ;;
390 mips64n32)
391 dump_lib_mips64n32 "$2"
392 ;;
393 *)
394 echo ""
395 ;;
396 esac
397 }
398
399 ####
400 # main
401
402 verify_deps diff
403 verify_deps gcc
404 verify_deps grep
405 verify_deps mktemp
406 verify_deps sed
407 if [[ ! -x $LIB_SYS_DUMP ]]; then
408 echo "error: \"$LIB_SYS_DUMP\" is not in the current working directory"
409 exit 1
410 fi
411
412 arches=""
413
414 while getopts "a:h" opt; do
415 case $opt in
416 a)
417 arches+="$OPTARG "
418 ;;
419 h|*)
420 usage
421 exit 1
422 ;;
423 esac
424 done
425 shift $(($OPTIND - 1))
426
427 # defaults
428 if [[ $arches == "" ]]; then
429 arches="x86 x86_64 x32 arm aarch64 mips mips64 mips64n32"
430 fi
431
432 # sanity checks
433 kernel_dir="$1"
434 if [[ -z $kernel_dir ]]; then
435 usage
436 exit 1
437 fi
438 if [[ ! -d $kernel_dir ]]; then
439 echo "error: \"$1\" is not a valid directory"
440 exit 1
441 fi
442
443 # generate some temp files
444 tmp_orig=$(mktemp -t syscall_validate_XXXXXX)
445 tmp_new=$(mktemp -t syscall_validate_XXXXXX)
446
447 # loop through the architectures
448 for i in $arches; do
449 # dump the syscall tables
450 dump_lib $i > $tmp_orig
451 dump_sys $i "$kernel_dir" > $tmp_new
452
453 # do the comparison
454 diff -u --label="$i [library]" $tmp_orig --label "$i [system]" $tmp_new
455 done
456
457 # cleanup and exit
458 rm -f $tmp_orig $tmp_new
459
460 exit 0
2323 #include <seccomp.h>
2424
2525 #include "arch.h"
26 #include "arch-x86_64.h"
2726 #include "arch-x32.h"
27
28 /* NOTE: based on Linux 3.19 */
29 const struct arch_syscall_def x32_syscall_table[] = { \
30 { "_llseek", __PNR__llseek },
31 { "_newselect", __PNR__newselect },
32 { "_sysctl", __PNR__sysctl },
33 { "accept", (X32_SYSCALL_BIT + 43) },
34 { "accept4", (X32_SYSCALL_BIT + 288) },
35 { "access", (X32_SYSCALL_BIT + 21) },
36 { "acct", (X32_SYSCALL_BIT + 163) },
37 { "add_key", (X32_SYSCALL_BIT + 248) },
38 { "adjtimex", (X32_SYSCALL_BIT + 159) },
39 { "afs_syscall", (X32_SYSCALL_BIT + 183) },
40 { "alarm", (X32_SYSCALL_BIT + 37) },
41 { "arm_fadvise64_64", __PNR_arm_fadvise64_64 },
42 { "arm_sync_file_range", __PNR_arm_sync_file_range },
43 { "arch_prctl", (X32_SYSCALL_BIT + 158) },
44 { "bdflush", __PNR_bdflush },
45 { "bind", (X32_SYSCALL_BIT + 49) },
46 { "bpf", (X32_SYSCALL_BIT + 321) },
47 { "break", __PNR_break },
48 { "breakpoint", __PNR_breakpoint },
49 { "brk", (X32_SYSCALL_BIT + 12) },
50 { "cachectl", __PNR_cachectl },
51 { "cacheflush", __PNR_cacheflush },
52 { "capget", (X32_SYSCALL_BIT + 125) },
53 { "capset", (X32_SYSCALL_BIT + 126) },
54 { "chdir", (X32_SYSCALL_BIT + 80) },
55 { "chmod", (X32_SYSCALL_BIT + 90) },
56 { "chown", (X32_SYSCALL_BIT + 92) },
57 { "chown32", __PNR_chown32 },
58 { "chroot", (X32_SYSCALL_BIT + 161) },
59 { "clock_adjtime", (X32_SYSCALL_BIT + 305) },
60 { "clock_getres", (X32_SYSCALL_BIT + 229) },
61 { "clock_gettime", (X32_SYSCALL_BIT + 228) },
62 { "clock_nanosleep", (X32_SYSCALL_BIT + 230) },
63 { "clock_settime", (X32_SYSCALL_BIT + 227) },
64 { "clone", (X32_SYSCALL_BIT + 56) },
65 { "close", (X32_SYSCALL_BIT + 3) },
66 { "connect", (X32_SYSCALL_BIT + 42) },
67 { "creat", (X32_SYSCALL_BIT + 85) },
68 { "create_module", __PNR_create_module },
69 { "delete_module", (X32_SYSCALL_BIT + 176) },
70 { "dup", (X32_SYSCALL_BIT + 32) },
71 { "dup2", (X32_SYSCALL_BIT + 33) },
72 { "dup3", (X32_SYSCALL_BIT + 292) },
73 { "epoll_create", (X32_SYSCALL_BIT + 213) },
74 { "epoll_create1", (X32_SYSCALL_BIT + 291) },
75 { "epoll_ctl", (X32_SYSCALL_BIT + 233) },
76 { "epoll_ctl_old", __PNR_epoll_ctl_old },
77 { "epoll_pwait", (X32_SYSCALL_BIT + 281) },
78 { "epoll_wait", (X32_SYSCALL_BIT + 232) },
79 { "epoll_wait_old", __PNR_epoll_wait_old },
80 { "eventfd", (X32_SYSCALL_BIT + 284) },
81 { "eventfd2", (X32_SYSCALL_BIT + 290) },
82 { "execve", (X32_SYSCALL_BIT + 520) },
83 { "execveat", (X32_SYSCALL_BIT + 545) },
84 { "exit", (X32_SYSCALL_BIT + 60) },
85 { "exit_group", (X32_SYSCALL_BIT + 231) },
86 { "faccessat", (X32_SYSCALL_BIT + 269) },
87 { "fadvise64", (X32_SYSCALL_BIT + 221) },
88 { "fadvise64_64", __PNR_fadvise64_64 },
89 { "fallocate", (X32_SYSCALL_BIT + 285) },
90 { "fanotify_init", (X32_SYSCALL_BIT + 300) },
91 { "fanotify_mark", (X32_SYSCALL_BIT + 301) },
92 { "fchdir", (X32_SYSCALL_BIT + 81) },
93 { "fchmod", (X32_SYSCALL_BIT + 91) },
94 { "fchmodat", (X32_SYSCALL_BIT + 268) },
95 { "fchown", (X32_SYSCALL_BIT + 93) },
96 { "fchown32", __PNR_fchown32 },
97 { "fchownat", (X32_SYSCALL_BIT + 260) },
98 { "fcntl", (X32_SYSCALL_BIT + 72) },
99 { "fcntl64", __PNR_fcntl64 },
100 { "fdatasync", (X32_SYSCALL_BIT + 75) },
101 { "fgetxattr", (X32_SYSCALL_BIT + 193) },
102 { "finit_module", (X32_SYSCALL_BIT + 313) },
103 { "flistxattr", (X32_SYSCALL_BIT + 196) },
104 { "flock", (X32_SYSCALL_BIT + 73) },
105 { "fork", (X32_SYSCALL_BIT + 57) },
106 { "fremovexattr", (X32_SYSCALL_BIT + 199) },
107 { "fsetxattr", (X32_SYSCALL_BIT + 190) },
108 { "fstat", (X32_SYSCALL_BIT + 5) },
109 { "fstat64", __PNR_fstat64 },
110 { "fstatat64", __PNR_fstatat64 },
111 { "fstatfs", (X32_SYSCALL_BIT + 138) },
112 { "fstatfs64", __PNR_fstatfs64 },
113 { "fsync", (X32_SYSCALL_BIT + 74) },
114 { "ftime", __PNR_ftime },
115 { "ftruncate", (X32_SYSCALL_BIT + 77) },
116 { "ftruncate64", __PNR_ftruncate64 },
117 { "futex", (X32_SYSCALL_BIT + 202) },
118 { "futimesat", (X32_SYSCALL_BIT + 261) },
119 { "get_kernel_syms", __PNR_get_kernel_syms },
120 { "get_mempolicy", (X32_SYSCALL_BIT + 239) },
121 { "get_robust_list", (X32_SYSCALL_BIT + 531) },
122 { "get_thread_area", __PNR_get_thread_area },
123 { "getcpu", (X32_SYSCALL_BIT + 309) },
124 { "getcwd", (X32_SYSCALL_BIT + 79) },
125 { "getdents", (X32_SYSCALL_BIT + 78) },
126 { "getdents64", (X32_SYSCALL_BIT + 217) },
127 { "getegid", (X32_SYSCALL_BIT + 108) },
128 { "getegid32", __PNR_getegid32 },
129 { "geteuid", (X32_SYSCALL_BIT + 107) },
130 { "geteuid32", __PNR_geteuid32 },
131 { "getgid", (X32_SYSCALL_BIT + 104) },
132 { "getgid32", __PNR_getgid32 },
133 { "getgroups", (X32_SYSCALL_BIT + 115) },
134 { "getgroups32", __PNR_getgroups32 },
135 { "getitimer", (X32_SYSCALL_BIT + 36) },
136 { "getpeername", (X32_SYSCALL_BIT + 52) },
137 { "getpgid", (X32_SYSCALL_BIT + 121) },
138 { "getpgrp", (X32_SYSCALL_BIT + 111) },
139 { "getpid", (X32_SYSCALL_BIT + 39) },
140 { "getpmsg", (X32_SYSCALL_BIT + 181) },
141 { "getppid", (X32_SYSCALL_BIT + 110) },
142 { "getpriority", (X32_SYSCALL_BIT + 140) },
143 { "getrandom", (X32_SYSCALL_BIT + 318) },
144 { "getresgid", (X32_SYSCALL_BIT + 120) },
145 { "getresgid32", __PNR_getresgid32 },
146 { "getresuid", (X32_SYSCALL_BIT + 118) },
147 { "getresuid32", __PNR_getresuid32 },
148 { "getrlimit", (X32_SYSCALL_BIT + 97) },
149 { "getrusage", (X32_SYSCALL_BIT + 98) },
150 { "getsid", (X32_SYSCALL_BIT + 124) },
151 { "getsockname", (X32_SYSCALL_BIT + 51) },
152 { "getsockopt", (X32_SYSCALL_BIT + 542) },
153 { "gettid", (X32_SYSCALL_BIT + 186) },
154 { "gettimeofday", (X32_SYSCALL_BIT + 96) },
155 { "getuid", (X32_SYSCALL_BIT + 102) },
156 { "getuid32", __PNR_getuid32 },
157 { "getxattr", (X32_SYSCALL_BIT + 191) },
158 { "gtty", __PNR_gtty },
159 { "idle", __PNR_idle },
160 { "init_module", (X32_SYSCALL_BIT + 175) },
161 { "inotify_add_watch", (X32_SYSCALL_BIT + 254) },
162 { "inotify_init", (X32_SYSCALL_BIT + 253) },
163 { "inotify_init1", (X32_SYSCALL_BIT + 294) },
164 { "inotify_rm_watch", (X32_SYSCALL_BIT + 255) },
165 { "io_cancel", (X32_SYSCALL_BIT + 210) },
166 { "io_destroy", (X32_SYSCALL_BIT + 207) },
167 { "io_getevents", (X32_SYSCALL_BIT + 208) },
168 { "io_setup", (X32_SYSCALL_BIT + 543) },
169 { "io_submit", (X32_SYSCALL_BIT + 544) },
170 { "ioctl", (X32_SYSCALL_BIT + 514) },
171 { "ioperm", (X32_SYSCALL_BIT + 173) },
172 { "iopl", (X32_SYSCALL_BIT + 172) },
173 { "ioprio_get", (X32_SYSCALL_BIT + 252) },
174 { "ioprio_set", (X32_SYSCALL_BIT + 251) },
175 { "ipc", __PNR_ipc },
176 { "kcmp", (X32_SYSCALL_BIT + 312) },
177 { "kexec_file_load", (X32_SYSCALL_BIT + 320) },
178 { "kexec_load", (X32_SYSCALL_BIT + 528) },
179 { "keyctl", (X32_SYSCALL_BIT + 250) },
180 { "kill", (X32_SYSCALL_BIT + 62) },
181 { "lchown", (X32_SYSCALL_BIT + 94) },
182 { "lchown32", __PNR_lchown32 },
183 { "lgetxattr", (X32_SYSCALL_BIT + 192) },
184 { "link", (X32_SYSCALL_BIT + 86) },
185 { "linkat", (X32_SYSCALL_BIT + 265) },
186 { "listen", (X32_SYSCALL_BIT + 50) },
187 { "listxattr", (X32_SYSCALL_BIT + 194) },
188 { "llistxattr", (X32_SYSCALL_BIT + 195) },
189 { "lock", __PNR_lock },
190 { "lookup_dcookie", (X32_SYSCALL_BIT + 212) },
191 { "lremovexattr", (X32_SYSCALL_BIT + 198) },
192 { "lseek", (X32_SYSCALL_BIT + 8) },
193 { "lsetxattr", (X32_SYSCALL_BIT + 189) },
194 { "lstat", (X32_SYSCALL_BIT + 6) },
195 { "lstat64", __PNR_lstat64 },
196 { "madvise", (X32_SYSCALL_BIT + 28) },
197 { "mbind", (X32_SYSCALL_BIT + 237) },
198 { "memfd_create", (X32_SYSCALL_BIT + 319) },
199 { "migrate_pages", (X32_SYSCALL_BIT + 256) },
200 { "mincore", (X32_SYSCALL_BIT + 27) },
201 { "mkdir", (X32_SYSCALL_BIT + 83) },
202 { "mkdirat", (X32_SYSCALL_BIT + 258) },
203 { "mknod", (X32_SYSCALL_BIT + 133) },
204 { "mknodat", (X32_SYSCALL_BIT + 259) },
205 { "mlock", (X32_SYSCALL_BIT + 149) },
206 { "mlockall", (X32_SYSCALL_BIT + 151) },
207 { "mmap", (X32_SYSCALL_BIT + 9) },
208 { "mmap2", __PNR_mmap2 },
209 { "modify_ldt", (X32_SYSCALL_BIT + 154) },
210 { "mount", (X32_SYSCALL_BIT + 165) },
211 { "move_pages", (X32_SYSCALL_BIT + 533) },
212 { "mprotect", (X32_SYSCALL_BIT + 10) },
213 { "mpx", __PNR_mpx },
214 { "mq_getsetattr", (X32_SYSCALL_BIT + 245) },
215 { "mq_notify", (X32_SYSCALL_BIT + 527) },
216 { "mq_open", (X32_SYSCALL_BIT + 240) },
217 { "mq_timedreceive", (X32_SYSCALL_BIT + 243) },
218 { "mq_timedsend", (X32_SYSCALL_BIT + 242) },
219 { "mq_unlink", (X32_SYSCALL_BIT + 241) },
220 { "mremap", (X32_SYSCALL_BIT + 25) },
221 { "msgctl", (X32_SYSCALL_BIT + 71) },
222 { "msgget", (X32_SYSCALL_BIT + 68) },
223 { "msgrcv", (X32_SYSCALL_BIT + 70) },
224 { "msgsnd", (X32_SYSCALL_BIT + 69) },
225 { "msync", (X32_SYSCALL_BIT + 26) },
226 { "munlock", (X32_SYSCALL_BIT + 150) },
227 { "munlockall", (X32_SYSCALL_BIT + 152) },
228 { "munmap", (X32_SYSCALL_BIT + 11) },
229 { "name_to_handle_at", (X32_SYSCALL_BIT + 303) },
230 { "nanosleep", (X32_SYSCALL_BIT + 35) },
231 { "newfstatat", (X32_SYSCALL_BIT + 262) },
232 { "nfsservctl", __PNR_nfsservctl },
233 { "nice", __PNR_nice },
234 { "oldfstat", __PNR_oldfstat },
235 { "oldlstat", __PNR_oldlstat },
236 { "oldolduname", __PNR_oldolduname },
237 { "oldstat", __PNR_oldstat },
238 { "olduname", __PNR_olduname },
239 { "oldwait4", __PNR_oldwait4 },
240 { "open", (X32_SYSCALL_BIT + 2) },
241 { "open_by_handle_at", (X32_SYSCALL_BIT + 304) },
242 { "openat", (X32_SYSCALL_BIT + 257) },
243 { "pause", (X32_SYSCALL_BIT + 34) },
244 { "pciconfig_iobase", __PNR_pciconfig_iobase },
245 { "pciconfig_read", __PNR_pciconfig_read },
246 { "pciconfig_write", __PNR_pciconfig_write },
247 { "perf_event_open", (X32_SYSCALL_BIT + 298) },
248 { "personality", (X32_SYSCALL_BIT + 135) },
249 { "pipe", (X32_SYSCALL_BIT + 22) },
250 { "pipe2", (X32_SYSCALL_BIT + 293) },
251 { "pivot_root", (X32_SYSCALL_BIT + 155) },
252 { "poll", (X32_SYSCALL_BIT + 7) },
253 { "ppoll", (X32_SYSCALL_BIT + 271) },
254 { "prctl", (X32_SYSCALL_BIT + 157) },
255 { "pread64", (X32_SYSCALL_BIT + 17) },
256 { "preadv", (X32_SYSCALL_BIT + 534) },
257 { "prlimit64", (X32_SYSCALL_BIT + 302) },
258 { "process_vm_readv", (X32_SYSCALL_BIT + 539) },
259 { "process_vm_writev", (X32_SYSCALL_BIT + 540) },
260 { "prof", __PNR_prof },
261 { "profil", __PNR_profil },
262 { "pselect6", (X32_SYSCALL_BIT + 270) },
263 { "ptrace", (X32_SYSCALL_BIT + 521) },
264 { "putpmsg", (X32_SYSCALL_BIT + 182) },
265 { "pwrite64", (X32_SYSCALL_BIT + 18) },
266 { "pwritev", (X32_SYSCALL_BIT + 535) },
267 { "query_module", __PNR_query_module },
268 { "quotactl", (X32_SYSCALL_BIT + 179) },
269 { "read", (X32_SYSCALL_BIT + 0) },
270 { "readahead", (X32_SYSCALL_BIT + 187) },
271 { "readdir", __PNR_readdir },
272 { "readlink", (X32_SYSCALL_BIT + 89) },
273 { "readlinkat", (X32_SYSCALL_BIT + 267) },
274 { "readv", (X32_SYSCALL_BIT + 515) },
275 { "reboot", (X32_SYSCALL_BIT + 169) },
276 { "recv", __PNR_recv },
277 { "recvfrom", (X32_SYSCALL_BIT + 517) },
278 { "recvmmsg", (X32_SYSCALL_BIT + 537) },
279 { "recvmsg", (X32_SYSCALL_BIT + 519) },
280 { "remap_file_pages", (X32_SYSCALL_BIT + 216) },
281 { "removexattr", (X32_SYSCALL_BIT + 197) },
282 { "rename", (X32_SYSCALL_BIT + 82) },
283 { "renameat", (X32_SYSCALL_BIT + 264) },
284 { "renameat2", (X32_SYSCALL_BIT + 316) },
285 { "request_key", (X32_SYSCALL_BIT + 249) },
286 { "restart_syscall", (X32_SYSCALL_BIT + 219) },
287 { "rmdir", (X32_SYSCALL_BIT + 84) },
288 { "rt_sigaction", (X32_SYSCALL_BIT + 512) },
289 { "rt_sigpending", (X32_SYSCALL_BIT + 522) },
290 { "rt_sigprocmask", (X32_SYSCALL_BIT + 14) },
291 { "rt_sigqueueinfo", (X32_SYSCALL_BIT + 524) },
292 { "rt_sigreturn", (X32_SYSCALL_BIT + 513) },
293 { "rt_sigsuspend", (X32_SYSCALL_BIT + 130) },
294 { "rt_sigtimedwait", (X32_SYSCALL_BIT + 523) },
295 { "rt_tgsigqueueinfo", (X32_SYSCALL_BIT + 536) },
296 { "sched_get_priority_max", (X32_SYSCALL_BIT + 146) },
297 { "sched_get_priority_min", (X32_SYSCALL_BIT + 147) },
298 { "sched_getaffinity", (X32_SYSCALL_BIT + 204) },
299 { "sched_getattr", (X32_SYSCALL_BIT + 315) },
300 { "sched_getparam", (X32_SYSCALL_BIT + 143) },
301 { "sched_getscheduler", (X32_SYSCALL_BIT + 145) },
302 { "sched_rr_get_interval", (X32_SYSCALL_BIT + 148) },
303 { "sched_setaffinity", (X32_SYSCALL_BIT + 203) },
304 { "sched_setattr", (X32_SYSCALL_BIT + 314) },
305 { "sched_setparam", (X32_SYSCALL_BIT + 142) },
306 { "sched_setscheduler", (X32_SYSCALL_BIT + 144) },
307 { "sched_yield", (X32_SYSCALL_BIT + 24) },
308 { "seccomp", (X32_SYSCALL_BIT + 317) },
309 { "security", (X32_SYSCALL_BIT + 185) },
310 { "select", (X32_SYSCALL_BIT + 23) },
311 { "semctl", (X32_SYSCALL_BIT + 66) },
312 { "semget", (X32_SYSCALL_BIT + 64) },
313 { "semop", (X32_SYSCALL_BIT + 65) },
314 { "semtimedop", (X32_SYSCALL_BIT + 220) },
315 { "send", __PNR_send },
316 { "sendfile", (X32_SYSCALL_BIT + 40) },
317 { "sendfile64", __PNR_sendfile64 },
318 { "sendmmsg", (X32_SYSCALL_BIT + 538) },
319 { "sendmsg", (X32_SYSCALL_BIT + 518) },
320 { "sendto", (X32_SYSCALL_BIT + 44) },
321 { "set_mempolicy", (X32_SYSCALL_BIT + 238) },
322 { "set_robust_list", (X32_SYSCALL_BIT + 530) },
323 { "set_thread_area", __PNR_set_thread_area },
324 { "set_tid_address", (X32_SYSCALL_BIT + 218) },
325 { "set_tls", __PNR_set_tls },
326 { "setdomainname", (X32_SYSCALL_BIT + 171) },
327 { "setfsgid", (X32_SYSCALL_BIT + 123) },
328 { "setfsgid32", __PNR_setfsgid32 },
329 { "setfsuid", (X32_SYSCALL_BIT + 122) },
330 { "setfsuid32", __PNR_setfsuid32 },
331 { "setgid", (X32_SYSCALL_BIT + 106) },
332 { "setgid32", __PNR_setgid32 },
333 { "setgroups", (X32_SYSCALL_BIT + 116) },
334 { "setgroups32", __PNR_setgroups32 },
335 { "sethostname", (X32_SYSCALL_BIT + 170) },
336 { "setitimer", (X32_SYSCALL_BIT + 38) },
337 { "setns", (X32_SYSCALL_BIT + 308) },
338 { "setpgid", (X32_SYSCALL_BIT + 109) },
339 { "setpriority", (X32_SYSCALL_BIT + 141) },
340 { "setregid", (X32_SYSCALL_BIT + 114) },
341 { "setregid32", __PNR_setregid32 },
342 { "setresgid", (X32_SYSCALL_BIT + 119) },
343 { "setresgid32", __PNR_setresgid32 },
344 { "setresuid", (X32_SYSCALL_BIT + 117) },
345 { "setresuid32", __PNR_setresuid32 },
346 { "setreuid", (X32_SYSCALL_BIT + 113) },
347 { "setreuid32", __PNR_setreuid32 },
348 { "setrlimit", (X32_SYSCALL_BIT + 160) },
349 { "setsid", (X32_SYSCALL_BIT + 112) },
350 { "setsockopt", (X32_SYSCALL_BIT + 541) },
351 { "settimeofday", (X32_SYSCALL_BIT + 164) },
352 { "setuid", (X32_SYSCALL_BIT + 105) },
353 { "setuid32", __PNR_setuid32 },
354 { "setxattr", (X32_SYSCALL_BIT + 188) },
355 { "sgetmask", __PNR_sgetmask },
356 { "shmat", (X32_SYSCALL_BIT + 30) },
357 { "shmctl", (X32_SYSCALL_BIT + 31) },
358 { "shmdt", (X32_SYSCALL_BIT + 67) },
359 { "shmget", (X32_SYSCALL_BIT + 29) },
360 { "shutdown", (X32_SYSCALL_BIT + 48) },
361 { "sigaction", __PNR_sigaction },
362 { "sigaltstack", (X32_SYSCALL_BIT + 525) },
363 { "signal", __PNR_signal },
364 { "signalfd", (X32_SYSCALL_BIT + 282) },
365 { "signalfd4", (X32_SYSCALL_BIT + 289) },
366 { "sigpending", __PNR_sigpending },
367 { "sigprocmask", __PNR_sigprocmask },
368 { "sigreturn", __PNR_sigreturn },
369 { "sigsuspend", __PNR_sigsuspend },
370 { "socket", (X32_SYSCALL_BIT + 41) },
371 { "socketcall", __PNR_socketcall },
372 { "socketpair", (X32_SYSCALL_BIT + 53) },
373 { "splice", (X32_SYSCALL_BIT + 275) },
374 { "ssetmask", __PNR_ssetmask },
375 { "stat", (X32_SYSCALL_BIT + 4) },
376 { "stat64", __PNR_stat64 },
377 { "statfs", (X32_SYSCALL_BIT + 137) },
378 { "statfs64", __PNR_statfs64 },
379 { "stime", __PNR_stime },
380 { "stty", __PNR_stty },
381 { "swapoff", (X32_SYSCALL_BIT + 168) },
382 { "swapon", (X32_SYSCALL_BIT + 167) },
383 { "symlink", (X32_SYSCALL_BIT + 88) },
384 { "symlinkat", (X32_SYSCALL_BIT + 266) },
385 { "sync", (X32_SYSCALL_BIT + 162) },
386 { "sync_file_range", (X32_SYSCALL_BIT + 277) },
387 { "sync_file_range2", __PNR_sync_file_range2 },
388 { "syncfs", (X32_SYSCALL_BIT + 306) },
389 { "syscall", __PNR_syscall },
390 { "sysfs", (X32_SYSCALL_BIT + 139) },
391 { "sysinfo", (X32_SYSCALL_BIT + 99) },
392 { "syslog", (X32_SYSCALL_BIT + 103) },
393 { "sysmips", __PNR_sysmips },
394 { "tee", (X32_SYSCALL_BIT + 276) },
395 { "tgkill", (X32_SYSCALL_BIT + 234) },
396 { "time", (X32_SYSCALL_BIT + 201) },
397 { "timer_create", (X32_SYSCALL_BIT + 526) },
398 { "timer_delete", (X32_SYSCALL_BIT + 226) },
399 { "timer_getoverrun", (X32_SYSCALL_BIT + 225) },
400 { "timer_gettime", (X32_SYSCALL_BIT + 224) },
401 { "timer_settime", (X32_SYSCALL_BIT + 223) },
402 { "timerfd", __PNR_timerfd },
403 { "timerfd_create", (X32_SYSCALL_BIT + 283) },
404 { "timerfd_gettime", (X32_SYSCALL_BIT + 287) },
405 { "timerfd_settime", (X32_SYSCALL_BIT + 286) },
406 { "times", (X32_SYSCALL_BIT + 100) },
407 { "tkill", (X32_SYSCALL_BIT + 200) },
408 { "truncate", (X32_SYSCALL_BIT + 76) },
409 { "truncate64", __PNR_truncate64 },
410 { "tuxcall", (X32_SYSCALL_BIT + 184) },
411 { "ugetrlimit", __PNR_ugetrlimit },
412 { "ulimit", __PNR_ulimit },
413 { "umask", (X32_SYSCALL_BIT + 95) },
414 { "umount", __PNR_umount },
415 { "umount2", (X32_SYSCALL_BIT + 166) },
416 { "uname", (X32_SYSCALL_BIT + 63) },
417 { "unlink", (X32_SYSCALL_BIT + 87) },
418 { "unlinkat", (X32_SYSCALL_BIT + 263) },
419 { "unshare", (X32_SYSCALL_BIT + 272) },
420 { "uselib", __PNR_uselib },
421 { "usr26", __PNR_usr26 },
422 { "usr32", __PNR_usr32 },
423 { "ustat", (X32_SYSCALL_BIT + 136) },
424 { "utime", (X32_SYSCALL_BIT + 132) },
425 { "utimensat", (X32_SYSCALL_BIT + 280) },
426 { "utimes", (X32_SYSCALL_BIT + 235) },
427 { "vfork", (X32_SYSCALL_BIT + 58) },
428 { "vhangup", (X32_SYSCALL_BIT + 153) },
429 { "vm86", __PNR_vm86 },
430 { "vm86old", __PNR_vm86old },
431 { "vmsplice", (X32_SYSCALL_BIT + 532) },
432 { "vserver", __PNR_vserver },
433 { "wait4", (X32_SYSCALL_BIT + 61) },
434 { "waitid", (X32_SYSCALL_BIT + 529) },
435 { "waitpid", __PNR_waitpid },
436 { "write", (X32_SYSCALL_BIT + 1) },
437 { "writev", (X32_SYSCALL_BIT + 516) },
438 { NULL, __NR_SCMP_ERROR},
439 };
28440
29441 /**
30442 * Resolve a syscall name to a number
37449 */
38450 int x32_syscall_resolve_name(const char *name)
39451 {
40 int syscall;
41
42 syscall = x86_64_syscall_resolve_name(name);
43 if (syscall >= 0)
44 syscall |= X32_SYSCALL_BIT;
45
46 return syscall;
452 unsigned int iter;
453 const struct arch_syscall_def *table = x32_syscall_table;
454
455 /* XXX - plenty of room for future improvement here */
456 for (iter = 0; table[iter].name != NULL; iter++) {
457 if (strcmp(name, table[iter].name) == 0)
458 return table[iter].num;
459 }
460
461 return __NR_SCMP_ERROR;
47462 }
48463
49464 /**
57472 */
58473 const char *x32_syscall_resolve_num(int num)
59474 {
60 int syscall = num;
61
62 if (syscall >= 0)
63 syscall &= (~X32_SYSCALL_BIT);
64
65 return x86_64_syscall_resolve_num(syscall);
475 unsigned int iter;
476 const struct arch_syscall_def *table = x32_syscall_table;
477
478 /* XXX - plenty of room for future improvement here */
479 for (iter = 0; table[iter].num != __NR_SCMP_ERROR; iter++) {
480 if (num == table[iter].num)
481 return table[iter].name;
482 }
483
484 return NULL;
66485 }
486
487 /**
488 * Iterate through the syscall table and return the syscall name
489 * @param spot the offset into the syscall table
490 *
491 * Return the syscall name at position @spot or NULL on failure. This function
492 * should only ever be used internally by libseccomp.
493 *
494 */
495 const char *x32_syscall_iterate_name(unsigned int spot)
496 {
497 /* XXX - no safety checks here */
498 return x32_syscall_table[spot].name;
499 }
2828
2929 #define X32_SYSCALL_BIT 0x40000000
3030
31 #define x32_arg_count_max 6
32
3331 extern const struct arch_def arch_def_x32;
3432
3533 int x32_syscall_resolve_name(const char *name);
3634 const char *x32_syscall_resolve_num(int num);
3735
36 const char *x32_syscall_iterate_name(unsigned int spot);
37
3838 #endif
2525 #include "arch.h"
2626 #include "arch-x86.h"
2727
28 /* NOTE: based on Linux 3.4.7 */
29 static const struct arch_syscall_def x86_syscall_table[] = { \
28 /* NOTE: based on Linux 3.19 */
29 const struct arch_syscall_def x86_syscall_table[] = { \
30 { "_llseek", 140 },
31 { "_newselect", 142 },
32 { "_sysctl", 149 },
3033 { "accept", __PNR_accept },
3134 { "accept4", __PNR_accept4 },
3235 { "access", 33 },
4043 { "arch_prctl", __PNR_arch_prctl },
4144 { "bdflush", 134 },
4245 { "bind", __PNR_bind },
46 { "bpf", 357 },
4347 { "break", 17 },
48 { "breakpoint", __PNR_breakpoint },
4449 { "brk", 45 },
50 { "cachectl", __PNR_cachectl },
51 { "cacheflush", __PNR_cacheflush },
4552 { "capget", 184 },
4653 { "capset", 185 },
4754 { "chdir", 12 },
7380 { "eventfd", 323 },
7481 { "eventfd2", 328 },
7582 { "execve", 11 },
83 { "execveat", 358 },
7684 { "exit", 1 },
7785 { "exit_group", 252 },
7886 { "faccessat", 307 },
9199 { "fcntl64", 221 },
92100 { "fdatasync", 148 },
93101 { "fgetxattr", 231 },
94 { "finit_module", __PNR_finit_module },
102 { "finit_module", 350 },
95103 { "flistxattr", 234 },
96104 { "flock", 143 },
97105 { "fork", 2 },
132140 { "getpmsg", 188 },
133141 { "getppid", 64 },
134142 { "getpriority", 96 },
143 { "getrandom", 355 },
135144 { "getresgid", 171 },
136145 { "getresgid32", 211 },
137146 { "getresuid", 165 },
165174 { "ioprio_set", 289 },
166175 { "ipc", 117 },
167176 { "kcmp", 349 },
177 { "kexec_file_load", __PNR_kexec_file_load },
168178 { "kexec_load", 283 },
169179 { "keyctl", 288 },
170180 { "kill", 37 },
176186 { "listen", __PNR_listen },
177187 { "listxattr", 232 },
178188 { "llistxattr", 233 },
179 { "_llseek", 140 },
180189 { "lock", 53 },
181190 { "lookup_dcookie", 253 },
182191 { "lremovexattr", 236 },
186195 { "lstat64", 196 },
187196 { "madvise", 219 },
188197 { "mbind", 274 },
198 { "memfd_create", 356 },
189199 { "migrate_pages", 294 },
190200 { "mincore", 218 },
191201 { "mkdir", 39 },
218228 { "munmap", 91 },
219229 { "name_to_handle_at", 341 },
220230 { "nanosleep", 162 },
221 { "_newselect", 142 },
222231 { "newfstatat", __PNR_newfstatat },
223232 { "nfsservctl", 169 },
224233 { "nice", 34 },
227236 { "oldolduname", 59 },
228237 { "oldstat", 18 },
229238 { "olduname", 109 },
239 { "oldwait4", __PNR_oldwait4 },
230240 { "open", 5 },
231241 { "open_by_handle_at", 342 },
232242 { "openat", 295 },
271281 { "removexattr", 235 },
272282 { "rename", 38 },
273283 { "renameat", 302 },
284 { "renameat2", 353 },
274285 { "request_key", 287 },
275286 { "restart_syscall", 0 },
276287 { "rmdir", 40 },
285296 { "sched_get_priority_max", 159 },
286297 { "sched_get_priority_min", 160 },
287298 { "sched_getaffinity", 242 },
299 { "sched_getattr", 352 },
288300 { "sched_getparam", 155 },
289301 { "sched_getscheduler", 157 },
290302 { "sched_rr_get_interval", 161 },
291303 { "sched_setaffinity", 241 },
304 { "sched_setattr", 351 },
292305 { "sched_setparam", 154 },
293306 { "sched_setscheduler", 156 },
294307 { "sched_yield", 158 },
308 { "seccomp", 354 },
295309 { "security", __PNR_security },
296310 { "select", 82 },
297311 { "semctl", __PNR_semctl },
308322 { "set_robust_list", 311 },
309323 { "set_thread_area", 243 },
310324 { "set_tid_address", 258 },
325 { "set_tls", __PNR_set_tls },
311326 { "setdomainname", 121 },
312327 { "setfsgid", 139 },
313328 { "setfsgid32", 216 },
372387 { "sync_file_range2", __PNR_sync_file_range2 },
373388 { "syncfs", 344 },
374389 { "syscall", __PNR_syscall },
375 { "_sysctl", 149 },
376390 { "sysfs", 135 },
377391 { "sysinfo", 116 },
378392 { "syslog", 103 },
393 { "sysmips", __PNR_sysmips },
379394 { "tee", 315 },
380395 { "tgkill", 270 },
381396 { "time", 13 },
384399 { "timer_getoverrun", 262 },
385400 { "timer_gettime", 261 },
386401 { "timer_settime", 260 },
402 { "timerfd", __PNR_timerfd },
387403 { "timerfd_create", 322 },
388404 { "timerfd_gettime", 326 },
389405 { "timerfd_settime", 325 },
402418 { "unlinkat", 301 },
403419 { "unshare", 310 },
404420 { "uselib", 86 },
421 { "usr26", __PNR_usr26 },
422 { "usr32", __PNR_usr32 },
405423 { "ustat", 62 },
406424 { "utime", 30 },
407425 { "utimensat", 320 },
465483
466484 return NULL;
467485 }
486
487 /**
488 * Iterate through the syscall table and return the syscall name
489 * @param spot the offset into the syscall table
490 *
491 * Return the syscall name at position @spot or NULL on failure. This function
492 * should only ever be used internally by libseccomp.
493 *
494 */
495 const char *x86_syscall_iterate_name(unsigned int spot)
496 {
497 /* XXX - no safety checks here */
498 return x86_syscall_table[spot].name;
499 }
8181 int *syscall, struct db_api_arg *chain)
8282 {
8383 unsigned int iter;
84 int arg_max;
85
86 arg_max = arch_arg_count_max(arch);
87 if (arg_max < 0)
88 return arg_max;
8489
8590 if ((*syscall) <= -100 && (*syscall) >= -117) {
86 for (iter = 0; iter < x86_arg_count_max; iter++) {
91 for (iter = 0; iter < arg_max; iter++) {
8792 if ((chain[iter].valid != 0) && (strict))
8893 return -EINVAL;
8994 }
9499 chain[0].valid = 1;
95100 *syscall = __x86_NR_socketcall;
96101 } else if ((*syscall) <= -200 && (*syscall) >= -211) {
97 for (iter = 0; iter < x86_arg_count_max; iter++) {
102 for (iter = 0; iter < arg_max; iter++) {
98103 if ((chain[iter].valid != 0) && (strict))
99104 return -EINVAL;
100105 }
2727 #include "db.h"
2828 #include "system.h"
2929
30 #define x86_arg_count_max 6
31
3230 extern const struct arch_def arch_def_x86;
3331
3432 int x86_syscall_resolve_name(const char *name);
3533 const char *x86_syscall_resolve_num(int num);
34
35 const char *x86_syscall_iterate_name(unsigned int spot);
3636
3737 int x86_syscall_rewrite(const struct arch_def *arch, bool strict, int *syscall);
3838
2525 #include "arch.h"
2626 #include "arch-x86_64.h"
2727
28 /* NOTE: based on Linux 3.4.7 */
28 /* NOTE: based on Linux 3.19 */
2929 const struct arch_syscall_def x86_64_syscall_table[] = { \
30 { "_llseek", __PNR__llseek },
31 { "_newselect", __PNR__newselect },
32 { "_sysctl", 156 },
3033 { "accept", 43 },
3134 { "accept4", 288 },
3235 { "access", 21 },
4043 { "arch_prctl", 158 },
4144 { "bdflush", __PNR_bdflush },
4245 { "bind", 49 },
46 { "bpf", 321 },
4347 { "break", __PNR_break },
48 { "breakpoint", __PNR_breakpoint },
4449 { "brk", 12 },
50 { "cachectl", __PNR_cachectl },
51 { "cacheflush", __PNR_cacheflush },
4552 { "capget", 125 },
4653 { "capset", 126 },
4754 { "chdir", 80 },
7380 { "eventfd", 284 },
7481 { "eventfd2", 290 },
7582 { "execve", 59 },
83 { "execveat", 322 },
7684 { "exit", 60 },
7785 { "exit_group", 231 },
7886 { "faccessat", 269 },
9199 { "fcntl64", __PNR_fcntl64 },
92100 { "fdatasync", 75 },
93101 { "fgetxattr", 193 },
94 { "finit_module", __PNR_finit_module },
102 { "finit_module", 313 },
95103 { "flistxattr", 196 },
96104 { "flock", 73 },
97105 { "fork", 57 },
132140 { "getpmsg", 181 },
133141 { "getppid", 110 },
134142 { "getpriority", 140 },
143 { "getrandom", 318 },
135144 { "getresgid", 120 },
136145 { "getresgid32", __PNR_getresgid32 },
137146 { "getresuid", 118 },
165174 { "ioprio_set", 251 },
166175 { "ipc", __PNR_ipc },
167176 { "kcmp", 312 },
177 { "kexec_file_load", 320 },
168178 { "kexec_load", 246 },
169179 { "keyctl", 250 },
170180 { "kill", 62 },
176186 { "listen", 50 },
177187 { "listxattr", 194 },
178188 { "llistxattr", 195 },
179 { "_llseek", __PNR__llseek },
180189 { "lock", __PNR_lock },
181190 { "lookup_dcookie", 212 },
182191 { "lremovexattr", 198 },
186195 { "lstat64", __PNR_lstat64 },
187196 { "madvise", 28 },
188197 { "mbind", 237 },
198 { "memfd_create", 319 },
189199 { "migrate_pages", 256 },
190200 { "mincore", 27 },
191201 { "mkdir", 83 },
218228 { "munmap", 11 },
219229 { "name_to_handle_at", 303 },
220230 { "nanosleep", 35 },
221 { "_newselect", __PNR__newselect },
222231 { "newfstatat", 262 },
223232 { "nfsservctl", 180 },
224233 { "nice", __PNR_nice },
227236 { "oldolduname", __PNR_oldolduname },
228237 { "oldstat", __PNR_oldstat },
229238 { "olduname", __PNR_olduname },
239 { "oldwait4", __PNR_oldwait4 },
230240 { "open", 2 },
231241 { "open_by_handle_at", 304 },
232242 { "openat", 257 },
271281 { "removexattr", 197 },
272282 { "rename", 82 },
273283 { "renameat", 264 },
284 { "renameat2", 316 },
274285 { "request_key", 249 },
275286 { "restart_syscall", 219 },
276287 { "rmdir", 84 },
285296 { "sched_get_priority_max", 146 },
286297 { "sched_get_priority_min", 147 },
287298 { "sched_getaffinity", 204 },
299 { "sched_getattr", 315 },
288300 { "sched_getparam", 143 },
289301 { "sched_getscheduler", 145 },
290302 { "sched_rr_get_interval", 148 },
291303 { "sched_setaffinity", 203 },
304 { "sched_setattr", 314 },
292305 { "sched_setparam", 142 },
293306 { "sched_setscheduler", 144 },
294307 { "sched_yield", 24 },
308 { "seccomp", 317 },
295309 { "security", 185 },
296310 { "select", 23 },
297311 { "semctl", 66 },
308322 { "set_robust_list", 273 },
309323 { "set_thread_area", 205 },
310324 { "set_tid_address", 218 },
325 { "set_tls", __PNR_set_tls },
311326 { "setdomainname", 171 },
312327 { "setfsgid", 123 },
313328 { "setfsgid32", __PNR_setfsgid32 },
372387 { "sync_file_range2", __PNR_sync_file_range2 },
373388 { "syncfs", 306 },
374389 { "syscall", __PNR_syscall },
375 { "_sysctl", 156 },
376390 { "sysfs", 139 },
377391 { "sysinfo", 99 },
378392 { "syslog", 103 },
393 { "sysmips", __PNR_sysmips },
379394 { "tee", 276 },
380395 { "tgkill", 234 },
381396 { "time", 201 },
384399 { "timer_getoverrun", 225 },
385400 { "timer_gettime", 224 },
386401 { "timer_settime", 223 },
402 { "timerfd", __PNR_timerfd },
387403 { "timerfd_create", 283 },
388404 { "timerfd_gettime", 287 },
389405 { "timerfd_settime", 286 },
402418 { "unlinkat", 263 },
403419 { "unshare", 272 },
404420 { "uselib", 134 },
421 { "usr26", __PNR_usr26 },
422 { "usr32", __PNR_usr32 },
405423 { "ustat", 136 },
406424 { "utime", 132 },
407425 { "utimensat", 280 },
465483
466484 return NULL;
467485 }
486
487 /**
488 * Iterate through the syscall table and return the syscall name
489 * @param spot the offset into the syscall table
490 *
491 * Return the syscall name at position @spot or NULL on failure. This function
492 * should only ever be used internally by libseccomp.
493 *
494 */
495 const char *x86_64_syscall_iterate_name(unsigned int spot)
496 {
497 /* XXX - no safety checks here */
498 return x86_64_syscall_table[spot].name;
499 }
500
2626 #include "arch.h"
2727 #include "system.h"
2828
29 #define x86_64_arg_count_max 6
30
3129 extern const struct arch_def arch_def_x86_64;
32
33 #define x86_64_arg_offset_lo(x) (arch_arg_offset(x))
34 #define x86_64_arg_offset_hi(x) (arch_arg_offset(x) + 4)
3530
3631 int x86_64_syscall_resolve_name(const char *name);
3732 const char *x86_64_syscall_resolve_num(int num);
3833
34 const char *x86_64_syscall_iterate_name(unsigned int spot);
35
3936 #endif
3333 #include "arch-x86_64.h"
3434 #include "arch-x32.h"
3535 #include "arch-arm.h"
36 #include "arch-aarch64.h"
37 #include "arch-mips.h"
38 #include "arch-mips64.h"
39 #include "arch-mips64n32.h"
3640 #include "system.h"
41
42 #define default_arg_count_max 6
43
44 #define default_arg_offset(x) (offsetof(struct seccomp_data, args[x]))
3745
3846 #if __i386__
3947 const struct arch_def *arch_def_native = &arch_def_x86;
4553 #endif /* __ILP32__ */
4654 #elif __arm__
4755 const struct arch_def *arch_def_native = &arch_def_arm;
56 #elif __aarch64__
57 const struct arch_def *arch_def_native = &arch_def_aarch64;
58 #elif __mips__ && _MIPS_SIM == _MIPS_SIM_ABI32
59 #if __MIPSEB__
60 const struct arch_def *arch_def_native = &arch_def_mips;
61 #elif __MIPSEL__
62 const struct arch_def *arch_def_native = &arch_def_mipsel;
63 #endif /* _MIPS_SIM_ABI32 */
64 #elif __mips__ && _MIPS_SIM == _MIPS_SIM_ABI64
65 #if __MIPSEB__
66 const struct arch_def *arch_def_native = &arch_def_mips64;
67 #elif __MIPSEL__
68 const struct arch_def *arch_def_native = &arch_def_mipsel64;
69 #endif /* _MIPS_SIM_ABI64 */
70 #elif __mips__ && _MIPS_SIM == _MIPS_SIM_NABI32
71 #if __MIPSEB__
72 const struct arch_def *arch_def_native = &arch_def_mips64n32;
73 #elif __MIPSEL__
74 const struct arch_def *arch_def_native = &arch_def_mipsel64n32;
75 #endif /* _MIPS_SIM_NABI32 */
4876 #else
4977 #error the arch code needs to know about your machine type
5078 #endif /* machine type guess */
5886 */
5987 int arch_valid(uint32_t arch)
6088 {
61 switch (arch) {
62 case SCMP_ARCH_X86:
63 case SCMP_ARCH_X86_64:
64 case SCMP_ARCH_X32:
65 case SCMP_ARCH_ARM:
66 return 0;
67 }
68
69 return -EINVAL;
89 return (arch_def_lookup(arch) ? 0 : -EINVAL);
7090 }
7191
7292 /**
87107 return &arch_def_x32;
88108 case SCMP_ARCH_ARM:
89109 return &arch_def_arm;
90 }
110 case SCMP_ARCH_AARCH64:
111 return &arch_def_aarch64;
112 case SCMP_ARCH_MIPS:
113 return &arch_def_mips;
114 case SCMP_ARCH_MIPSEL:
115 return &arch_def_mipsel;
116 case SCMP_ARCH_MIPS64:
117 return &arch_def_mips64;
118 case SCMP_ARCH_MIPSEL64:
119 return &arch_def_mipsel64;
120 case SCMP_ARCH_MIPS64N32:
121 return &arch_def_mips64n32;
122 case SCMP_ARCH_MIPSEL64N32:
123 return &arch_def_mipsel64n32;
124 }
125
126 return NULL;
127 }
128
129 /**
130 * Lookup the architecture definition by name
131 * @param arch_name the architecure name
132 *
133 * Return the matching architecture definition, returns NULL on failure.
134 *
135 */
136 const struct arch_def *arch_def_lookup_name(const char *arch_name)
137 {
138 if (strcmp(arch_name, "x86") == 0)
139 return &arch_def_x86;
140 else if (strcmp(arch_name, "x86_64") == 0)
141 return &arch_def_x86_64;
142 else if (strcmp(arch_name, "x32") == 0)
143 return &arch_def_x32;
144 else if (strcmp(arch_name, "arm") == 0)
145 return &arch_def_arm;
146 else if (strcmp(arch_name, "aarch64") == 0)
147 return &arch_def_aarch64;
148 else if (strcmp(arch_name, "mips") == 0)
149 return &arch_def_mips;
150 else if (strcmp(arch_name, "mipsel") == 0)
151 return &arch_def_mipsel;
152 else if (strcmp(arch_name, "mips64") == 0)
153 return &arch_def_mips64;
154 else if (strcmp(arch_name, "mipsel64") == 0)
155 return &arch_def_mipsel64;
156 else if (strcmp(arch_name, "mips64n32") == 0)
157 return &arch_def_mips64n32;
158 else if (strcmp(arch_name, "mipsel64n32") == 0)
159 return &arch_def_mipsel64n32;
91160
92161 return NULL;
93162 }
102171 */
103172 int arch_arg_count_max(const struct arch_def *arch)
104173 {
105 switch (arch->token) {
106 case SCMP_ARCH_X86:
107 return x86_arg_count_max;
108 case SCMP_ARCH_X86_64:
109 return x86_64_arg_count_max;
110 case SCMP_ARCH_X32:
111 return x32_arg_count_max;
112 case SCMP_ARCH_ARM:
113 return arm_arg_count_max;
114 }
115
116 return -EDOM;
174 return (arch_valid(arch->token) == 0 ? default_arg_count_max : -EDOM);
117175 }
118176
119177 /**
128186 */
129187 int arch_arg_offset_lo(const struct arch_def *arch, unsigned int arg)
130188 {
131 switch (arch->token) {
132 case SCMP_ARCH_X86_64:
133 return x86_64_arg_offset_lo(arg);
189 if (arch_valid(arch->token) < 0)
190 return -EDOM;
191
192 switch (arch->endian) {
193 case ARCH_ENDIAN_LITTLE:
194 return default_arg_offset(arg);
195 break;
196 case ARCH_ENDIAN_BIG:
197 return default_arg_offset(arg) + 4;
198 break;
134199 default:
135200 return -EDOM;
136201 }
148213 */
149214 int arch_arg_offset_hi(const struct arch_def *arch, unsigned int arg)
150215 {
151 switch (arch->token) {
152 case SCMP_ARCH_X86_64:
153 return x86_64_arg_offset_hi(arg);
216 if (arch_valid(arch->token) < 0 || arch->size != ARCH_SIZE_64)
217 return -EDOM;
218
219 switch (arch->endian) {
220 case ARCH_ENDIAN_LITTLE:
221 return default_arg_offset(arg) + 4;
222 break;
223 case ARCH_ENDIAN_BIG:
224 return default_arg_offset(arg);
225 break;
154226 default:
155227 return -EDOM;
156228 }
229 }
230
231 /**
232 * Determine the argument offset
233 * @param arch the architecture definition
234 * @param arg the argument number
235 *
236 * Determine the correct offset for the given argument based on the
237 * architecture definition. Returns the offset on success, negative values on
238 * failure.
239 *
240 */
241 int arch_arg_offset(const struct arch_def *arch, unsigned int arg)
242 {
243 return arch_arg_offset_lo(arch, arg);
157244 }
158245
159246 /**
177264 return x32_syscall_resolve_name(name);
178265 case SCMP_ARCH_ARM:
179266 return arm_syscall_resolve_name(name);
267 case SCMP_ARCH_AARCH64:
268 return aarch64_syscall_resolve_name(name);
269 case SCMP_ARCH_MIPS:
270 case SCMP_ARCH_MIPSEL:
271 return mips_syscall_resolve_name(name);
272 case SCMP_ARCH_MIPS64:
273 case SCMP_ARCH_MIPSEL64:
274 return mips64_syscall_resolve_name(name);
275 case SCMP_ARCH_MIPS64N32:
276 case SCMP_ARCH_MIPSEL64N32:
277 return mips64n32_syscall_resolve_name(name);
180278 }
181279
182280 return __NR_SCMP_ERROR;
203301 return x32_syscall_resolve_num(num);
204302 case SCMP_ARCH_ARM:
205303 return arm_syscall_resolve_num(num);
304 case SCMP_ARCH_AARCH64:
305 return aarch64_syscall_resolve_num(num);
306 case SCMP_ARCH_MIPS:
307 case SCMP_ARCH_MIPSEL:
308 return mips_syscall_resolve_num(num);
309 case SCMP_ARCH_MIPS64:
310 case SCMP_ARCH_MIPSEL64:
311 return mips64_syscall_resolve_num(num);
312 case SCMP_ARCH_MIPS64N32:
313 case SCMP_ARCH_MIPSEL64N32:
314 return mips64n32_syscall_resolve_num(num);
206315 }
207316
208317 return NULL;
7777 int arch_valid(uint32_t arch);
7878
7979 const struct arch_def *arch_def_lookup(uint32_t token);
80 const struct arch_def *arch_def_lookup_name(const char *arch_name);
8081
8182 int arch_arg_count_max(const struct arch_def *arch);
8283
83 /**
84 * Determine the argument offset
85 * @param _arg the argument number
86 *
87 * Return the correct offset of the given argument.
88 *
89 */
90 #define arch_arg_offset(_arg) (offsetof(struct seccomp_data, args[_arg]))
91
9284 int arch_arg_offset_lo(const struct arch_def *arch, unsigned int arg);
9385 int arch_arg_offset_hi(const struct arch_def *arch, unsigned int arg);
86 int arch_arg_offset(const struct arch_def *arch, unsigned int arg);
9487
9588 int arch_syscall_resolve_name(const struct arch_def *arch, const char *name);
9689 const char *arch_syscall_resolve_num(const struct arch_def *arch, int num);
7171
7272 /**
7373 * Free a syscall filter argument chain tree
74 * @param list the argument chain list
75 *
76 * This function frees a syscall argument chain list and returns the number of
77 * nodes freed.
74 * @param tree the argument chain list
75 *
76 * This function frees a tree and returns the number of nodes freed.
7877 *
7978 */
8079 static unsigned int _db_tree_free(struct db_arg_chain_tree *tree)
388387 for (iter = 0; iter < col->filter_cnt; iter++)
389388 db_release(col->filters[iter]);
390389 col->filter_cnt = 0;
391 free(col->filters);
390 if (col->filters)
391 free(col->filters);
392392 col->filters = NULL;
393
394 /* set the endianess to undefined */
395 col->endian = 0;
393396
394397 /* set the default attribute values */
395398 col->attr.act_default = def_action;
396399 col->attr.act_badarch = SCMP_ACT_KILL;
397400 col->attr.nnp_enable = 1;
401 col->attr.tsync_enable = 0;
398402
399403 /* set the state */
400404 col->state = _DB_STA_VALID;
456460 */
457461 int db_col_valid(struct db_filter_col *col)
458462 {
459 if (col != NULL && col->state == _DB_STA_VALID)
463 if (col != NULL && col->state == _DB_STA_VALID && col->filter_cnt > 0)
460464 return 0;
461465 return -EINVAL;
462466 }
475479 {
476480 unsigned int iter_a, iter_b;
477481 struct db_filter **dbs;
482
483 /* verify that the endianess is a match */
484 if (col_dst->endian != col_src->endian)
485 return -EEXIST;
478486
479487 /* make sure we don't have any arch/filter collisions */
480488 for (iter_a = 0; iter_a < col_dst->filter_cnt; iter_a++) {
553561 case SCMP_FLTATR_CTL_NNP:
554562 *value = col->attr.nnp_enable;
555563 break;
564 case SCMP_FLTATR_CTL_TSYNC:
565 *value = col->attr.tsync_enable;
566 break;
556567 default:
557568 rc = -EEXIST;
558569 break;
563574
564575 /**
565576 * Set a filter attribute
566 * @param db the seccomp filter collection
577 * @param col the seccomp filter collection
567578 * @param attr the filter attribute
568579 * @param value the filter attribute value
569580 *
590601 case SCMP_FLTATR_CTL_NNP:
591602 col->attr.nnp_enable = (value ? 1 : 0);
592603 break;
604 case SCMP_FLTATR_CTL_TSYNC:
605 rc = sys_chk_seccomp_flag(SECCOMP_FILTER_FLAG_TSYNC);
606 if (rc)
607 return rc;
608 col->attr.tsync_enable = (value ? 1 : 0);
609 break;
593610 default:
594611 rc = -EEXIST;
595612 break;
611628 int db_col_db_add(struct db_filter_col *col, struct db_filter *db)
612629 {
613630 struct db_filter **dbs;
631
632 if (col->endian != 0 && col->endian != db->arch->endian)
633 return -EEXIST;
614634
615635 if (db_col_arch_exist(col, db->arch->token))
616636 return -EEXIST;
622642 col->filters = dbs;
623643 col->filter_cnt++;
624644 col->filters[col->filter_cnt - 1] = db;
645 if (col->endian == 0)
646 col->endian = db->arch->endian;
625647
626648 return 0;
627649 }
641663 unsigned int found;
642664 struct db_filter **dbs;
643665
644 if ((col->filter_cnt <= 1) || (db_col_arch_exist(col, arch_token) == 0))
666 if ((col->filter_cnt <= 0) || (db_col_arch_exist(col, arch_token) == 0))
645667 return -EINVAL;
646668
647669 for (found = 0, iter = 0; iter < col->filter_cnt; iter++) {
654676 }
655677 col->filters[--col->filter_cnt] = NULL;
656678
657 /* NOTE: if we can't do the realloc it isn't fatal, we just have some
658 * extra space that will get cleaned up later */
659 dbs = realloc(col->filters,
660 sizeof(struct db_filter *) * col->filter_cnt);
661 if (dbs != NULL)
662 col->filters = dbs;
679 if (col->filter_cnt > 0) {
680 /* NOTE: if we can't do the realloc it isn't fatal, we just
681 * have some extra space allocated */
682 dbs = realloc(col->filters,
683 sizeof(struct db_filter *) * col->filter_cnt);
684 if (dbs != NULL)
685 col->filters = dbs;
686 } else {
687 /* this was the last filter so free all the associated memory
688 * and reset the endian token */
689 free(col->filters);
690 col->filters = NULL;
691 col->endian = 0;
692 }
663693
664694 return 0;
665695 }
667697 /**
668698 * Free and reset the seccomp filter DB
669699 * @param db the seccomp filter DB
670 * @param def_action the default filter action
671700 *
672701 * This function frees any existing filters and resets the filter DB to a
673702 * default state; only the DB architecture is preserved.
795824 }
796825
797826 /**
827 * Test if the argument filter can be skipped because it's a tautology
828 * @param arg argument filter
829 *
830 * If this argument filter applied to the lower 32 bit can be skipped this
831 * function returns false.
832 *
833 */
834 static bool _db_arg_cmp_need_lo(const struct db_api_arg *arg)
835 {
836 if (arg->op == SCMP_CMP_MASKED_EQ && D64_LO(arg->mask) == 0)
837 return false;
838
839 return true;
840 }
841
842 /**
843 * Test if the argument filter can be skipped because it's a tautology
844 * @param arg argument filter
845 *
846 * If this argument filter applied to the upper 32 bit can be skipped this
847 * function returns false.
848 *
849 */
850 static bool _db_arg_cmp_need_hi(const struct db_api_arg *arg)
851 {
852 if (arg->op == SCMP_CMP_MASKED_EQ && D64_HI(arg->mask) == 0)
853 return false;
854
855 return true;
856 }
857
858 /**
798859 * Fixup the node based on the op/mask
799860 * @param node the chain node
800861 *
801 * Apply some simplifications based on the comparison op and mask value.
862 * Ensure the datum is masked as well.
802863 *
803864 */
804865 static void _db_node_mask_fixup(struct db_arg_chain_tree *node)
805866 {
806 if (node->op == SCMP_CMP_MASKED_EQ && node->mask == 0) {
807 node->op = SCMP_CMP_EQ;
808 node->mask = ARG_MASK_MAX;
809 node->datum = 0;
810 } else
811 node->datum &= node->mask;
867 node->datum &= node->mask;
812868 }
813869
814870 /**
842898 s_new->valid = true;
843899 /* run through the argument chain */
844900 chain_len_max = arch_arg_count_max(arch);
901 if (chain_len_max < 0)
902 goto gen_64_failure;
845903 for (iter = 0; iter < chain_len_max; iter++) {
846904 if (chain[iter].valid == 0)
905 continue;
906
907 /* TODO: handle the case were either hi or lo isn't needed */
908
909 /* skip generating instruction which are no-ops */
910 if (!_db_arg_cmp_need_hi(&chain[iter]) &&
911 !_db_arg_cmp_need_lo(&chain[iter]))
847912 continue;
848913
849914 c_iter_hi = malloc(sizeof(*c_iter_hi));
9721037 s_new->valid = true;
9731038 /* run through the argument chain */
9741039 chain_len_max = arch_arg_count_max(arch);
1040 if (chain_len_max < 0)
1041 goto gen_32_failure;
9751042 for (iter = 0; iter < chain_len_max; iter++) {
9761043 if (chain[iter].valid == 0)
1044 continue;
1045
1046 /* skip generating instructions which are no-ops */
1047 if (!_db_arg_cmp_need_lo(&chain[iter]))
9771048 continue;
9781049
9791050 c_iter = malloc(sizeof(*c_iter));
9821053 memset(c_iter, 0, sizeof(*c_iter));
9831054 c_iter->refcnt = 1;
9841055 c_iter->arg = chain[iter].arg;
985 c_iter->arg_offset = arch_arg_offset(c_iter->arg);
1056 c_iter->arg_offset = arch_arg_offset(arch, c_iter->arg);
9861057 c_iter->op = chain[iter].op;
1058 /* implicitly strips off the upper 32 bit */
9871059 c_iter->mask = chain[iter].mask;
9881060 c_iter->datum = chain[iter].datum;
9891061
126126 uint32_t act_badarch;
127127 /* NO_NEW_PRIVS related attributes */
128128 uint32_t nnp_enable;
129 /* SECCOMP_FILTER_FLAG_TSYNC related attributes */
130 uint32_t tsync_enable;
129131 };
130132
131133 struct db_filter {
144146 struct db_filter_attr attr;
145147
146148 /* individual filters */
149 int endian;
147150 struct db_filter **filters;
148151 unsigned int filter_cnt;
149152 };
2525 #include <string.h>
2626 #include <stdbool.h>
2727
28 #ifndef _BSD_SOURCE
29 #define _BSD_SOURCE
30 #endif
31 #include <endian.h>
32
2833 #include <seccomp.h>
2934
3035 #include "arch.h"
4247 int32_t offset;
4348 uint32_t mask;
4449 };
50 #define _ACC_STATE(x,y) \
51 (struct acc_state){ .offset = (x), .mask = (y) }
52 #define _ACC_STATE_OFFSET(x) \
53 _ACC_STATE(x,ARG_MASK_MAX)
54 #define _ACC_STATE_UNDEF \
55 _ACC_STATE_OFFSET(-1)
56 #define _ACC_CMP_EQ(x,y) \
57 ((x).offset == (y).offset && (x).mask == (y).mask)
4558
4659 enum bpf_jump_type {
4760 TGT_NONE = 0,
6477 } tgt;
6578 enum bpf_jump_type type;
6679 };
80 #define _BPF_OP(a,x) \
81 (_htot16(a,x))
6782 #define _BPF_JMP_NO \
6883 ((struct bpf_jump) { .type = TGT_NONE })
6984 #define _BPF_JMP_NXT(x) \
7691 ((struct bpf_jump) { .type = TGT_PTR_BLK, .tgt = { .blk = (x) } })
7792 #define _BPF_JMP_HSH(x) \
7893 ((struct bpf_jump) { .type = TGT_PTR_HSH, .tgt = { .hash = (x) } })
79 #define _BPF_K(x) \
80 ((struct bpf_jump) { .type = TGT_K, .tgt = { .imm_k = (x) } })
94 #define _BPF_K(a,x) \
95 ((struct bpf_jump) { .type = TGT_K, .tgt = { .imm_k = _htot32(a,x) } })
8196 #define _BPF_JMP_MAX 255
8297 #define _BPF_JMP_MAX_RET 255
8398
88103 struct bpf_jump k;
89104 };
90105 #define _BPF_OFFSET_SYSCALL (offsetof(struct seccomp_data, nr))
91 #define _BPF_SYSCALL _BPF_K(_BPF_OFFSET_SYSCALL)
106 #define _BPF_SYSCALL(a) _BPF_K(a,_BPF_OFFSET_SYSCALL)
107 #define _BPF_OFFSET_ARCH (offsetof(struct seccomp_data, arch))
108 #define _BPF_ARCH(a) _BPF_K(a,_BPF_OFFSET_ARCH)
92109
93110 struct bpf_blk {
111 /* bpf instructions */
94112 struct bpf_instr *blks;
95113 unsigned int blk_cnt;
96114 unsigned int blk_alloc;
115
116 /* accumulator state */
117 struct acc_state acc_start;
118 struct acc_state acc_end;
97119
98120 /* priority - higher is better */
99121 unsigned int priority;
111133 struct bpf_blk *hash_nxt;
112134 struct bpf_blk *prev, *next;
113135 struct bpf_blk *lvl_prv, *lvl_nxt;
114 struct acc_state acc_state;
115136 };
116137 #define _BLK_MSZE(x) \
117138 ((x)->blk_cnt * sizeof(*((x)->blks)))
131152
132153 /* filter attributes */
133154 const struct db_filter_attr *attr;
155 /* bad arch action */
156 uint64_t bad_arch_hsh;
134157 /* default action */
135158 uint64_t def_hsh;
136159
169192
170193 static struct bpf_blk *_hsh_remove(struct bpf_state *state, uint64_t h_val);
171194 static struct bpf_blk *_hsh_find(const struct bpf_state *state, uint64_t h_val);
195
196 /**
197 * Convert a 16-bit host integer into the target's endianess
198 * @param arch the architecture definition
199 * @param val the 16-bit integer
200 *
201 * Convert the endianess of the supplied value and return it to the caller.
202 *
203 */
204 uint16_t _htot16(const struct arch_def *arch, uint16_t val)
205 {
206 if (arch->endian == ARCH_ENDIAN_LITTLE)
207 return htole16(val);
208 else
209 return htobe16(val);
210 }
211
212 /**
213 * Convert a 32-bit host integer into the target's endianess
214 * @param arch the architecture definition
215 * @param val the 32-bit integer
216 *
217 * Convert the endianess of the supplied value and return it to the caller.
218 *
219 */
220 uint32_t _htot32(const struct arch_def *arch, uint32_t val)
221 {
222 if (arch->endian == ARCH_ENDIAN_LITTLE)
223 return htole32(val);
224 else
225 return htobe32(val);
226 }
172227
173228 /**
174229 * Free the BPF instruction block
248303 }
249304
250305 /**
306 * Allocate and initialize a new instruction block
307 *
308 * Allocate a new BPF instruction block and perform some very basic
309 * initialization. Returns a pointer to the block on success, NULL on failure.
310 *
311 */
312 static struct bpf_blk *_blk_alloc(void)
313 {
314 struct bpf_blk *blk;
315
316 blk = malloc(sizeof(*blk));
317 if (blk == NULL)
318 return NULL;
319
320 memset(blk, 0, sizeof(*blk));
321 blk->flag_unique = true;
322 blk->acc_start = _ACC_STATE_UNDEF;
323 blk->acc_end = _ACC_STATE_UNDEF;
324
325 return blk;
326 }
327
328 /**
329 * Resize an instruction block
330 * @param state the BPF state
331 * @param blk the existing instruction block, or NULL
332 * @param size_add the minimum amount of instructions to add
333 *
334 * Resize the given instruction block such that it is at least as large as the
335 * current size plus @size_add. Returns a pointer to the block on success,
336 * NULL on failure.
337 *
338 */
339 static struct bpf_blk *_blk_resize(struct bpf_state *state,
340 struct bpf_blk *blk,
341 unsigned int size_add)
342 {
343 unsigned int size_adj = (AINC_BLK > size_add ? AINC_BLK : size_add);
344 struct bpf_instr *new;
345
346 if (blk == NULL)
347 return NULL;
348
349 if ((blk->blk_cnt + size_adj) <= blk->blk_alloc)
350 return blk;
351
352 blk->blk_alloc += size_adj;
353 new = realloc(blk->blks, blk->blk_alloc * sizeof(*(blk->blks)));
354 if (new == NULL) {
355 _blk_free(state, blk);
356 return NULL;
357 }
358 blk->blks = new;
359
360 return blk;
361 }
362
363 /**
251364 * Append a new BPF instruction to an instruction block
252365 * @param state the BPF state
253366 * @param blk the existing instruction block, or NULL
254367 * @param instr the new instruction
255368 *
256 * Add the new BPF instruction to the end of the give instruction block. If
369 * Add the new BPF instruction to the end of the given instruction block. If
257370 * the given instruction block is NULL, a new block will be allocated. Returns
258371 * a pointer to the block on success, NULL on failure, and in the case of
259372 * failure the instruction block is free'd.
263376 struct bpf_blk *blk,
264377 const struct bpf_instr *instr)
265378 {
266 struct bpf_instr *new;
267
268379 if (blk == NULL) {
269 blk = malloc(sizeof(*blk));
380 blk = _blk_alloc();
270381 if (blk == NULL)
271382 return NULL;
272 memset(blk, 0, sizeof(*blk));
273 blk->flag_unique = true;
274 }
275 if ((blk->blk_cnt + 1) > blk->blk_alloc) {
276 blk->blk_alloc += AINC_BLK;
277 new = realloc(blk->blks, blk->blk_alloc * sizeof(*(blk->blks)));
278 if (new == NULL) {
279 _blk_free(state, blk);
280 return NULL;
281 }
282 blk->blks = new;
283 }
383 }
384
385 if (_blk_resize(state, blk, 1) == NULL)
386 return NULL;
284387 memcpy(&blk->blks[blk->blk_cnt++], instr, sizeof(*instr));
388
389 return blk;
390 }
391
392 /**
393 * Prepend a new BPF instruction to an instruction block
394 * @param state the BPF state
395 * @param blk the existing instruction block, or NULL
396 * @param instr the new instruction
397 *
398 * Add the new BPF instruction to the start of the given instruction block.
399 * If the given instruction block is NULL, a new block will be allocated.
400 * Returns a pointer to the block on success, NULL on failure, and in the case
401 * of failure the instruction block is free'd.
402 *
403 */
404 static struct bpf_blk *_blk_prepend(struct bpf_state *state,
405 struct bpf_blk *blk,
406 const struct bpf_instr *instr)
407 {
408 /* empty - we can treat this like a normal append operation */
409 if (blk == NULL || blk->blk_cnt == 0)
410 return _blk_append(state, blk, instr);
411
412 if (_blk_resize(state, blk, 1) == NULL)
413 return NULL;
414 memmove(&blk->blks[1], &blk->blks[0], blk->blk_cnt++ * sizeof(*instr));
415 memcpy(&blk->blks[0], instr, sizeof(*instr));
285416
286417 return blk;
287418 }
386517
387518 /**
388519 * Free the BPF state
389 * @param the BPF state
520 * @param state the BPF state
390521 *
391522 * Free all of the BPF state, including the BPF program if present.
392523 *
450581 h_new->found = (found ? 1 : 0);
451582
452583 /* insert the block into the hash table */
584 hsh_add_restart:
453585 h_iter = state->htbl[h_val & _BPF_HASH_MASK];
454586 if (h_iter != NULL) {
455587 do {
490622 /* overflow */
491623 blk->flag_hash = false;
492624 blk->hash = 0;
625 free(h_new);
493626 return -EFAULT;
494627 }
495628 h_val += ((uint64_t)1 << 32);
496629 h_new->blk->hash = h_val;
497630
498631 /* restart at the beginning of the bucket */
499 h_iter = state->htbl[h_val & _BPF_HASH_MASK];
632 goto hsh_add_restart;
500633 } else {
501634 /* no match, move along */
502635 h_prev = h_iter;
626759 {
627760 struct bpf_instr instr;
628761
629 _BPF_INSTR(instr, BPF_RET, _BPF_JMP_NO, _BPF_JMP_NO, _BPF_K(action));
762 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_RET),
763 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_K(state->arch, action));
630764 return _blk_append(state, blk, &instr);
631765 }
632766
672806 int32_t acc_offset;
673807 uint32_t acc_mask;
674808 uint64_t act_t_hash = 0, act_f_hash = 0;
675 struct bpf_blk *blk = NULL, *b_act;
809 struct bpf_blk *blk, *b_act;
676810 struct bpf_instr instr;
677 struct acc_state a_state_orig = *a_state;
811
812 blk = _blk_alloc();
813 if (blk == NULL)
814 return NULL;
815 blk->acc_start = *a_state;
678816
679817 /* generate the action blocks */
680818 if (node->act_t_flg) {
700838 /* reload the accumulator */
701839 a_state->offset = acc_offset;
702840 a_state->mask = ARG_MASK_MAX;
703 _BPF_INSTR(instr, BPF_LD + BPF_ABS,
704 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_K(acc_offset));
841 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_LD + BPF_ABS),
842 _BPF_JMP_NO, _BPF_JMP_NO,
843 _BPF_K(state->arch, acc_offset));
705844 blk = _blk_append(state, blk, &instr);
706845 if (blk == NULL)
707846 goto node_failure;
847 /* we're not dependent on the accumulator anymore */
848 blk->acc_start = _ACC_STATE_UNDEF;
708849 }
709850 if (acc_mask != a_state->mask) {
710851 /* apply the bitmask */
711852 a_state->mask = acc_mask;
712 _BPF_INSTR(instr, BPF_ALU + BPF_AND,
713 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_K(acc_mask));
853 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_ALU + BPF_AND),
854 _BPF_JMP_NO, _BPF_JMP_NO,
855 _BPF_K(state->arch, acc_mask));
714856 blk = _blk_append(state, blk, &instr);
715857 if (blk == NULL)
716858 goto node_failure;
720862 switch (node->op) {
721863 case SCMP_CMP_MASKED_EQ:
722864 case SCMP_CMP_EQ:
723 _BPF_INSTR(instr, BPF_JMP + BPF_JEQ,
724 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_K(node->datum));
865 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_JMP + BPF_JEQ),
866 _BPF_JMP_NO, _BPF_JMP_NO,
867 _BPF_K(state->arch, node->datum));
725868 break;
726869 case SCMP_CMP_GT:
727 _BPF_INSTR(instr, BPF_JMP + BPF_JGT,
728 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_K(node->datum));
870 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_JMP + BPF_JGT),
871 _BPF_JMP_NO, _BPF_JMP_NO,
872 _BPF_K(state->arch, node->datum));
729873 break;
730874 case SCMP_CMP_GE:
731 _BPF_INSTR(instr, BPF_JMP + BPF_JGE,
732 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_K(node->datum));
875 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_JMP + BPF_JGE),
876 _BPF_JMP_NO, _BPF_JMP_NO,
877 _BPF_K(state->arch, node->datum));
733878 break;
734879 case SCMP_CMP_NE:
735880 case SCMP_CMP_LT:
758903 goto node_failure;
759904
760905 blk->node = node;
761 blk->acc_state = a_state_orig;
906 blk->acc_end = *a_state;
762907 return blk;
763908
764909 node_failure:
813958 case TGT_PTR_DB:
814959 node = (struct db_arg_chain_tree *)i_iter->jt.tgt.db;
815960 b_new = _gen_bpf_chain(state, sys, node,
816 nxt_jump, &blk->acc_state);
961 nxt_jump, &blk->acc_start);
817962 if (b_new == NULL)
818963 return NULL;
819964 i_iter->jt = _BPF_JMP_HSH(b_new->hash);
839984 case TGT_PTR_DB:
840985 node = (struct db_arg_chain_tree *)i_iter->jf.tgt.db;
841986 b_new = _gen_bpf_chain(state, sys, node,
842 nxt_jump, &blk->acc_state);
987 nxt_jump, &blk->acc_start);
843988 if (b_new == NULL)
844989 return NULL;
845990 i_iter->jf = _BPF_JMP_HSH(b_new->hash);
8921037 const struct db_arg_chain_tree *c_iter;
8931038 unsigned int iter;
8941039 struct bpf_jump nxt_jump_tmp;
1040 struct acc_state acc = *a_state;
8951041
8961042 if (chain == NULL) {
8971043 b_head = _gen_bpf_action(state, NULL, sys->action);
9061052
9071053 /* build all of the blocks for this level */
9081054 do {
909 b_iter = _gen_bpf_node(state, c_iter, a_state);
1055 b_iter = _gen_bpf_node(state, c_iter, &acc);
9101056 if (b_iter == NULL)
9111057 goto chain_failure;
9121058 if (b_head != NULL) {
10101156 {
10111157 int rc;
10121158 struct bpf_instr instr;
1013 struct bpf_blk *blk_c, *blk_s = NULL;
1159 struct bpf_blk *blk_c, *blk_s;
10141160 struct bpf_jump def_jump;
10151161 struct acc_state a_state;
10161162
10181164 memset(&def_jump, 0, sizeof(def_jump));
10191165 def_jump = _BPF_JMP_HSH(state->def_hsh);
10201166
1167 blk_s = _blk_alloc();
1168 if (blk_s == NULL)
1169 return NULL;
1170
10211171 /* setup the accumulator state */
10221172 if (acc_reset) {
1023 _BPF_INSTR(instr, BPF_LD + BPF_ABS, _BPF_JMP_NO, _BPF_JMP_NO,
1024 _BPF_SYSCALL);
1025 blk_s = _blk_append(state, NULL, &instr);
1173 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_LD + BPF_ABS),
1174 _BPF_JMP_NO, _BPF_JMP_NO,
1175 _BPF_SYSCALL(state->arch));
1176 blk_s = _blk_append(state, blk_s, &instr);
10261177 if (blk_s == NULL)
10271178 return NULL;
1028 a_state.offset = _BPF_OFFSET_SYSCALL;
1029 a_state.mask = ARG_MASK_MAX;
1179 /* we've loaded the syscall ourselves */
1180 a_state = _ACC_STATE_OFFSET(_BPF_OFFSET_SYSCALL);
1181 blk_s->acc_start = _ACC_STATE_UNDEF;
1182 blk_s->acc_end = _ACC_STATE_OFFSET(_BPF_OFFSET_SYSCALL);
10301183 } else {
1031 /* set the accumulator state to an unknown value */
1032 a_state.offset = -1;
1033 a_state.mask = ARG_MASK_MAX;
1184 /* we rely on someone else to load the syscall */
1185 a_state = _ACC_STATE_UNDEF;
1186 blk_s->acc_start = _ACC_STATE_OFFSET(_BPF_OFFSET_SYSCALL);
1187 blk_s->acc_end = _ACC_STATE_OFFSET(_BPF_OFFSET_SYSCALL);
10341188 }
10351189
10361190 /* generate the argument chains */
10371191 blk_c = _gen_bpf_chain(state, sys, sys->chains, &def_jump, &a_state);
1038 if (blk_c == NULL)
1192 if (blk_c == NULL) {
1193 _blk_free(state, blk_s);
10391194 return NULL;
1195 }
10401196
10411197 /* syscall check */
1042 _BPF_INSTR(instr, BPF_JMP + BPF_JEQ,
1198 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_JMP + BPF_JEQ),
10431199 _BPF_JMP_HSH(blk_c->hash), _BPF_JMP_HSH(nxt_hash),
1044 _BPF_K(sys->num));
1200 _BPF_K(state->arch, sys->num));
10451201 blk_s = _blk_append(state, blk_s, &instr);
10461202 if (blk_s == NULL)
10471203 return NULL;
11481304 }
11491305 }
11501306
1151 if ((db->arch->token == SCMP_ARCH_X86_64 ||
1152 db->arch->token == SCMP_ARCH_X32) && (db_secondary == NULL))
1307 if ((state->arch->token == SCMP_ARCH_X86_64 ||
1308 state->arch->token == SCMP_ARCH_X32) && (db_secondary == NULL))
11531309 acc_reset = false;
11541310 else
11551311 acc_reset = true;
11851341 }
11861342
11871343 /* additional ABI filtering */
1188 if ((db->arch->token == SCMP_ARCH_X86_64 ||
1189 db->arch->token == SCMP_ARCH_X32) && (db_secondary == NULL)) {
1190 _BPF_INSTR(instr, BPF_LD + BPF_ABS, _BPF_JMP_NO, _BPF_JMP_NO,
1191 _BPF_SYSCALL);
1344 if ((state->arch->token == SCMP_ARCH_X86_64 ||
1345 state->arch->token == SCMP_ARCH_X32) && (db_secondary == NULL)) {
1346 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_LD + BPF_ABS),
1347 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_SYSCALL(state->arch));
11921348 b_new = _blk_append(state, NULL, &instr);
11931349 if (b_new == NULL)
11941350 goto arch_failure;
1195 if (db->arch->token == SCMP_ARCH_X86_64) {
1351 b_new->acc_end = _ACC_STATE_OFFSET(_BPF_OFFSET_SYSCALL);
1352 if (state->arch->token == SCMP_ARCH_X86_64) {
11961353 /* filter out x32 */
1197 _BPF_INSTR(instr, BPF_JMP + BPF_JGE,
1198 _BPF_JMP_NXT(blk_cnt++), _BPF_JMP_NO,
1199 _BPF_K(X32_SYSCALL_BIT));
1354 _BPF_INSTR(instr,
1355 _BPF_OP(state->arch, BPF_JMP + BPF_JGE),
1356 _BPF_JMP_HSH(state->bad_arch_hsh),
1357 _BPF_JMP_NO,
1358 _BPF_K(state->arch, X32_SYSCALL_BIT));
12001359 if (b_head != NULL)
12011360 instr.jf = _BPF_JMP_HSH(b_head->hash);
12021361 else
12031362 instr.jf = _BPF_JMP_HSH(state->def_hsh);
1204 } else if (db->arch->token == SCMP_ARCH_X32) {
1363 blk_cnt++;
1364 } else if (state->arch->token == SCMP_ARCH_X32) {
12051365 /* filter out x86_64 */
1206 _BPF_INSTR(instr, BPF_JMP + BPF_JGE,
1207 _BPF_JMP_NO, _BPF_JMP_NXT(blk_cnt++),
1208 _BPF_K(X32_SYSCALL_BIT));
1366 _BPF_INSTR(instr,
1367 _BPF_OP(state->arch, BPF_JMP + BPF_JGE),
1368 _BPF_JMP_NO,
1369 _BPF_JMP_HSH(state->bad_arch_hsh),
1370 _BPF_K(state->arch, X32_SYSCALL_BIT));
12091371 if (b_head != NULL)
12101372 instr.jt = _BPF_JMP_HSH(b_head->hash);
12111373 else
12121374 instr.jt = _BPF_JMP_HSH(state->def_hsh);
1375 blk_cnt++;
12131376 } else
12141377 /* we should never get here */
12151378 goto arch_failure;
12261389 }
12271390
12281391 /* do the ABI/architecture check */
1229 _BPF_INSTR(instr, BPF_JMP + BPF_JEQ,
1392 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_JMP + BPF_JEQ),
12301393 _BPF_JMP_NO, _BPF_JMP_NXT(blk_cnt++),
1231 _BPF_K(db->arch->token_bpf));
1394 _BPF_K(state->arch, state->arch->token_bpf));
12321395 if (b_head != NULL)
12331396 instr.jt = _BPF_JMP_HSH(b_head->hash);
12341397 else
13101473 j_len += b_jmp->blk_cnt;
13111474 b_jmp = b_jmp->next;
13121475 }
1476 if (b_jmp == NULL)
1477 return -EFAULT;
13131478 if (j_len <= _BPF_JMP_MAX_RET && b_jmp == blk_ret)
13141479 return 0;
1315 if (b_jmp == NULL)
1316 return -EFAULT;
13171480
13181481 /* we need a closer return instruction, see if one already exists */
13191482 j_len = blk->blk_cnt - (offset + 1);
13231486 j_len += b_jmp->blk_cnt;
13241487 b_jmp = b_jmp->next;
13251488 }
1489 if (b_jmp == NULL)
1490 return -EFAULT;
13261491 if (j_len <= _BPF_JMP_MAX_RET && b_jmp->hash == tgt_hash)
13271492 return 0;
1328 if (b_jmp == NULL)
1329 return -EFAULT;
13301493
13311494 /* we need to insert a new return instruction - create one */
13321495 b_new = _gen_bpf_action(state, NULL, blk_ret->blks[0].k.tgt.imm_k);
13811544 if (b_tgt == blk)
13821545 return -EFAULT;
13831546
1384 if (b_tgt->blk_cnt == 1 && b_tgt->blks[0].op == BPF_RET) {
1547 if (b_tgt->blk_cnt == 1 &&
1548 b_tgt->blks[0].op == _BPF_OP(state->arch, BPF_RET)) {
13851549 rc = _gen_bpf_build_jmp_ret(state, blk, offset, b_tgt);
13861550 if (rc == 1)
13871551 return 1;
13961560 jmp_len += b_jmp->blk_cnt;
13971561 b_jmp = b_jmp->next;
13981562 }
1563 if (b_jmp == NULL)
1564 return -EFAULT;
13991565 if (jmp_len <= _BPF_JMP_MAX && b_jmp == b_tgt)
14001566 return 0;
1401 if (b_jmp == NULL)
1402 return -EFAULT;
14031567
14041568 /* we need a long jump, see if one already exists */
14051569 jmp_len = blk->blk_cnt - (offset + 1);
14091573 jmp_len += b_jmp->blk_cnt;
14101574 b_jmp = b_jmp->next;
14111575 }
1576 if (b_jmp == NULL)
1577 return -EFAULT;
14121578 if (jmp_len <= _BPF_JMP_MAX && b_jmp->hash == tgt_hash)
14131579 return 0;
1414 if (b_jmp == NULL)
1415 return -EFAULT;
14161580
14171581 /* we need to insert a long jump - create one */
1418 _BPF_INSTR(instr, BPF_JMP + BPF_JA,
1582 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_JMP + BPF_JA),
14191583 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_JMP_HSH(tgt_hash));
14201584 b_new = _blk_append(state, NULL, &instr);
14211585 if (b_new == NULL)
14601624 struct bpf_blk *b_badarch, *b_default;
14611625 struct bpf_blk *b_head = NULL, *b_tail = NULL, *b_iter, *b_new, *b_jmp;
14621626 struct db_filter *db_secondary = NULL;
1627 struct arch_def pseudo_arch;
14631628
14641629 if (col->filter_cnt == 0)
14651630 return -EINVAL;
1631
1632 /* create a fake architecture definition for use in the early stages */
1633 memset(&pseudo_arch, 0, sizeof(pseudo_arch));
1634 pseudo_arch.endian = col->endian;
1635 state->arch = &pseudo_arch;
14661636
14671637 /* generate the badarch action */
14681638 b_badarch = _gen_bpf_action(state, NULL, state->attr->act_badarch);
14711641 rc = _hsh_add(state, &b_badarch, 1);
14721642 if (rc < 0)
14731643 return rc;
1644 state->bad_arch_hsh = b_badarch->hash;
14741645
14751646 /* generate the default action */
14761647 b_default = _gen_bpf_action(state, NULL, state->attr->act_default);
14821653 state->def_hsh = b_default->hash;
14831654
14841655 /* load the architecture token/number */
1485 _BPF_INSTR(instr, BPF_LD + BPF_ABS, _BPF_JMP_NO, _BPF_JMP_NO,
1486 _BPF_K(offsetof(struct seccomp_data, arch)));
1656 _BPF_INSTR(instr, _BPF_OP(state->arch, BPF_LD + BPF_ABS),
1657 _BPF_JMP_NO, _BPF_JMP_NO, _BPF_ARCH(state->arch));
14871658 b_head = _blk_append(state, NULL, &instr);
14881659 if (b_head == NULL)
14891660 return -ENOMEM;
1661 b_head->acc_end = _ACC_STATE_OFFSET(_BPF_OFFSET_ARCH);
14901662 rc = _hsh_add(state, &b_head, 1);
14911663 if (rc < 0)
14921664 return rc;
15301702 b_badarch->next = NULL;
15311703 b_tail->next = b_badarch;
15321704 b_tail = b_badarch;
1705
1706 /* reset the state to the pseudo_arch for the final resolution */
1707 state->arch = &pseudo_arch;
15331708
15341709 /* resolve any TGT_NXT jumps at the top level */
15351710 b_iter = b_head;
15741749 b_jmp = _hsh_find_once(state,
15751750 i_iter->k.tgt.hash);
15761751 if (b_jmp != NULL) {
1752 /* do we need to reload the accumulator? */
1753 if ((b_jmp->acc_start.offset != -1) &&
1754 !_ACC_CMP_EQ(b_iter->acc_end,
1755 b_jmp->acc_start)) {
1756 if (b_jmp->acc_start.mask != ARG_MASK_MAX) {
1757 _BPF_INSTR(instr,
1758 _BPF_OP(state->arch,
1759 BPF_ALU + BPF_AND),
1760 _BPF_JMP_NO,
1761 _BPF_JMP_NO,
1762 _BPF_K(state->arch,
1763 b_jmp->acc_start.mask));
1764 b_jmp = _blk_prepend(state,
1765 b_jmp,
1766 &instr);
1767 if (b_jmp == NULL)
1768 return -EFAULT;
1769 }
1770 _BPF_INSTR(instr,
1771 _BPF_OP(state->arch,
1772 BPF_LD + BPF_ABS),
1773 _BPF_JMP_NO, _BPF_JMP_NO,
1774 _BPF_K(state->arch,
1775 b_jmp->acc_start.offset));
1776 b_jmp = _blk_prepend(state,
1777 b_jmp, &instr);
1778 if (b_jmp == NULL)
1779 return -EFAULT;
1780 /* not reliant on the accumulator */
1781 b_jmp->acc_start = _ACC_STATE_UNDEF;
1782 }
15771783 /* insert the new block after this block */
15781784 b_jmp->prev = b_iter;
15791785 b_jmp->next = b_iter->next;
15891795 } else
15901796 b_iter = b_iter->prev;
15911797 } while (b_iter != NULL);
1798
15921799
15931800 /* NOTE - from here to the end of the function we need to fail via the
15941801 * the build_bpf_free_blks label, not just return an error; see
16831890 }
16841891 if (b_jmp == NULL)
16851892 goto build_bpf_free_blks;
1686 i_iter->k = _BPF_K(jmp_len);
1893 i_iter->k = _BPF_K(state->arch, jmp_len);
16871894 }
16881895 }
16891896
17421949
17431950 /**
17441951 * Free memory associated with a BPF representation
1745 * @param fprog the BPF representation
1952 * @param program the BPF representation
17461953 *
17471954 * Free the memory associated with a BPF representation generated by the
17481955 * gen_bpf_generate() function.
5656 return "x32";
5757 case SCMP_ARCH_ARM:
5858 return "arm";
59 case SCMP_ARCH_AARCH64:
60 return "aarch64";
61 case SCMP_ARCH_MIPS:
62 return "mips";
63 case SCMP_ARCH_MIPSEL:
64 return "mipsel";
65 case SCMP_ARCH_MIPS64:
66 return "mips64";
67 case SCMP_ARCH_MIPSEL64:
68 return "mipsel64";
69 case SCMP_ARCH_MIPS64N32:
70 return "mips64n32";
71 case SCMP_ARCH_MIPSEL64N32:
72 return "mipsel64n32";
5973 default:
6074 return "UNKNOWN";
6175 }
162176 case SCMP_CMP_MASKED_EQ:
163177 fprintf(fds, " & 0x%.8x == ", c_iter->mask);
164178 break;
179 case SCMP_CMP_NE:
180 case SCMP_CMP_LT:
181 case SCMP_CMP_LE:
165182 default:
166183 fprintf(fds, " ??? ");
167184 }
232249 static int _gen_pfc_arch(const struct db_filter_col *col,
233250 const struct db_filter *db, FILE *fds)
234251 {
235 int rc;
252 int rc = 0;
236253 struct db_sys_list *s_iter;
237254 struct pfc_sys_list *p_iter = NULL, *p_new, *p_head = NULL, *p_prev;
238255
188188
189189 /**
190190 * Hash a variable-length key into a 32-bit value
191 * @param k the key (the unaligned variable-length array of bytes)
191 * @param key the key (the unaligned variable-length array of bytes)
192192 * @param length the length of the key, counting by bytes
193193 * @param initval can be any 4-byte value
194194 *
455455
456456 /**
457457 * Hash a variable-length key into a 32-bit value
458 * @param k the key (the unaligned variable-length array of bytes)
458 * @param key the key (the unaligned variable-length array of bytes)
459459 * @param length the length of the key, counting by bytes
460460 * @param initval can be any 4-byte value
461461 *
654654
655655 /**
656656 * Hash a variable-length key into a 32-bit value
657 * @param k the key (the unaligned variable-length array of bytes)
657 * @param key the key (the unaligned variable-length array of bytes)
658658 * @param length the length of the key, counting by bytes
659659 * @param initval can be any 4-byte value
660660 *
+0
-54
src/python/Makefile less more
0 #
1 # Enhanced Seccomp Library Python Bindings Makefile
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 # macros
23 #
24
25 include ../../macros.mk
26
27 #
28 # configuration
29 #
30
31 include $(TOPDIR)/version_info.mk
32 include $(TOPDIR)/configure.mk
33 include $(TOPDIR)/install.mk
34
35 LIB_STATIC = ../libseccomp.a
36
37 #
38 # targets
39 #
40
41 .PHONY: all install clean
42
43 all: build
44
45 build: $(LIB_STATIC) libseccomp.pxd seccomp.pyx
46 @$(RM) seccomp.c
47 $(PY_BUILD) && touch build
48
49 install: build
50 $(PY_INSTALL) install --prefix=$(DESTDIR)/$(INSTALL_PREFIX)
51
52 clean:
53 $(RM) -rf build seccomp.c
0 ####
1 # Seccomp Library Python Bindings
2 #
3
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the terms of version 2.1 of the GNU Lesser General Public License
7 # as published by the Free Software Foundation.
8 #
9 # This library is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses>.
16 #
17
18 PYTHON = /usr/bin/env python
19
20 PY_DISTUTILS = \
21 VERSION_RELEASE="@PACKAGE_VERSION@" \
22 CPPFLAGS="-I\${top_srcdir}/include ${AM_CPPFLAGS} ${CPPFLAGS}" \
23 CFLAGS="${AM_CFLAGS} ${CFLAGS}" \
24 LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}" \
25 ${PYTHON} ./setup.py
26
27 # support silent builds
28 PY_BUILD_0 = @echo " PYTHON " $@; ${PY_DISTUTILS} -q build
29 PY_BUILD_1 = ${PY_DISTUTILS} build
30 PY_BUILD_ = ${PY_BUILD_0}
31 PY_BUILD = ${PY_BUILD_@AM_V@}
32
33 PY_INSTALL = ${PY_DISTUTILS} install
34
35 EXTRA_DIST = libseccomp.pxd seccomp.pyx setup.py
36
37 all-local: build
38
39 build: ../libseccomp.la libseccomp.pxd seccomp.pyx setup.py
40 ${PY_BUILD} && touch build
41
42 install-exec-local: build
43 ${PY_INSTALL} --prefix=${DESTDIR}/${prefix}
44
45 clean-local:
46 ${RM} -rf seccomp.c build
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
4
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 ####
17 # Seccomp Library Python Bindings
18 #
19
20 #
21 # This library is free software; you can redistribute it and/or modify it
22 # under the terms of version 2.1 of the GNU Lesser General Public License
23 # as published by the Free Software Foundation.
24 #
25 # This library is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
28 # General Public License for more details.
29 #
30 # You should have received a copy of the GNU Lesser General Public License
31 # along with this library; if not, see <http://www.gnu.org/licenses>.
32 #
33 VPATH = @srcdir@
34 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
35 am__make_running_with_option = \
36 case $${target_option-} in \
37 ?) ;; \
38 *) echo "am__make_running_with_option: internal error: invalid" \
39 "target option '$${target_option-}' specified" >&2; \
40 exit 1;; \
41 esac; \
42 has_opt=no; \
43 sane_makeflags=$$MAKEFLAGS; \
44 if $(am__is_gnu_make); then \
45 sane_makeflags=$$MFLAGS; \
46 else \
47 case $$MAKEFLAGS in \
48 *\\[\ \ ]*) \
49 bs=\\; \
50 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
51 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
52 esac; \
53 fi; \
54 skip_next=no; \
55 strip_trailopt () \
56 { \
57 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
58 }; \
59 for flg in $$sane_makeflags; do \
60 test $$skip_next = yes && { skip_next=no; continue; }; \
61 case $$flg in \
62 *=*|--*) continue;; \
63 -*I) strip_trailopt 'I'; skip_next=yes;; \
64 -*I?*) strip_trailopt 'I';; \
65 -*O) strip_trailopt 'O'; skip_next=yes;; \
66 -*O?*) strip_trailopt 'O';; \
67 -*l) strip_trailopt 'l'; skip_next=yes;; \
68 -*l?*) strip_trailopt 'l';; \
69 -[dEDm]) skip_next=yes;; \
70 -[JT]) skip_next=yes;; \
71 esac; \
72 case $$flg in \
73 *$$target_option*) has_opt=yes; break;; \
74 esac; \
75 done; \
76 test $$has_opt = yes
77 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
78 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
79 pkgdatadir = $(datadir)/@PACKAGE@
80 pkgincludedir = $(includedir)/@PACKAGE@
81 pkglibdir = $(libdir)/@PACKAGE@
82 pkglibexecdir = $(libexecdir)/@PACKAGE@
83 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
84 install_sh_DATA = $(install_sh) -c -m 644
85 install_sh_PROGRAM = $(install_sh) -c
86 install_sh_SCRIPT = $(install_sh) -c
87 INSTALL_HEADER = $(INSTALL_DATA)
88 transform = $(program_transform_name)
89 NORMAL_INSTALL = :
90 PRE_INSTALL = :
91 POST_INSTALL = :
92 NORMAL_UNINSTALL = :
93 PRE_UNINSTALL = :
94 POST_UNINSTALL = :
95 build_triplet = @build@
96 host_triplet = @host@
97 subdir = src/python
98 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
99 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
104 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
105 $(ACLOCAL_M4)
106 mkinstalldirs = $(install_sh) -d
107 CONFIG_HEADER = $(top_builddir)/configure.h
108 CONFIG_CLEAN_FILES =
109 CONFIG_CLEAN_VPATH_FILES =
110 AM_V_P = $(am__v_P_@AM_V@)
111 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
112 am__v_P_0 = false
113 am__v_P_1 = :
114 AM_V_GEN = $(am__v_GEN_@AM_V@)
115 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
116 am__v_GEN_0 = @echo " GEN " $@;
117 am__v_GEN_1 =
118 AM_V_at = $(am__v_at_@AM_V@)
119 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
120 am__v_at_0 = @
121 am__v_at_1 =
122 SOURCES =
123 DIST_SOURCES =
124 am__can_run_installinfo = \
125 case $$AM_UPDATE_INFO_DIR in \
126 n|no|NO) false;; \
127 *) (install-info --version) >/dev/null 2>&1;; \
128 esac
129 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
130 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
131 ACLOCAL = @ACLOCAL@
132 AMTAR = @AMTAR@
133 AM_CFLAGS = @AM_CFLAGS@
134 AM_CPPFLAGS = @AM_CPPFLAGS@
135 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
136 AM_LDFLAGS = @AM_LDFLAGS@
137 AR = @AR@
138 AUTOCONF = @AUTOCONF@
139 AUTOHEADER = @AUTOHEADER@
140 AUTOMAKE = @AUTOMAKE@
141 AWK = @AWK@
142 CC = @CC@
143 CCDEPMODE = @CCDEPMODE@
144 CFLAGS = @CFLAGS@
145 CPP = @CPP@
146 CPPFLAGS = @CPPFLAGS@
147 CYGPATH_W = @CYGPATH_W@
148 DEFS = @DEFS@
149 DEPDIR = @DEPDIR@
150 DLLTOOL = @DLLTOOL@
151 DSYMUTIL = @DSYMUTIL@
152 DUMPBIN = @DUMPBIN@
153 ECHO_C = @ECHO_C@
154 ECHO_N = @ECHO_N@
155 ECHO_T = @ECHO_T@
156 EGREP = @EGREP@
157 EXEEXT = @EXEEXT@
158 FGREP = @FGREP@
159 GREP = @GREP@
160 INSTALL = @INSTALL@
161 INSTALL_DATA = @INSTALL_DATA@
162 INSTALL_PROGRAM = @INSTALL_PROGRAM@
163 INSTALL_SCRIPT = @INSTALL_SCRIPT@
164 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
165 LD = @LD@
166 LDFLAGS = @LDFLAGS@
167 LIBOBJS = @LIBOBJS@
168 LIBS = @LIBS@
169 LIBTOOL = @LIBTOOL@
170 LIPO = @LIPO@
171 LN_S = @LN_S@
172 LTLIBOBJS = @LTLIBOBJS@
173 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
174 MAKEINFO = @MAKEINFO@
175 MANIFEST_TOOL = @MANIFEST_TOOL@
176 MKDIR_P = @MKDIR_P@
177 NM = @NM@
178 NMEDIT = @NMEDIT@
179 OBJDUMP = @OBJDUMP@
180 OBJEXT = @OBJEXT@
181 OTOOL = @OTOOL@
182 OTOOL64 = @OTOOL64@
183 PACKAGE = @PACKAGE@
184 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
185 PACKAGE_NAME = @PACKAGE_NAME@
186 PACKAGE_STRING = @PACKAGE_STRING@
187 PACKAGE_TARNAME = @PACKAGE_TARNAME@
188 PACKAGE_URL = @PACKAGE_URL@
189 PACKAGE_VERSION = @PACKAGE_VERSION@
190 PATH_SEPARATOR = @PATH_SEPARATOR@
191 RANLIB = @RANLIB@
192 SED = @SED@
193 SET_MAKE = @SET_MAKE@
194 SHELL = @SHELL@
195 STRIP = @STRIP@
196 VERSION = @VERSION@
197 VERSION_MAJOR = @VERSION_MAJOR@
198 VERSION_MICRO = @VERSION_MICRO@
199 VERSION_MINOR = @VERSION_MINOR@
200 abs_builddir = @abs_builddir@
201 abs_srcdir = @abs_srcdir@
202 abs_top_builddir = @abs_top_builddir@
203 abs_top_srcdir = @abs_top_srcdir@
204 ac_ct_AR = @ac_ct_AR@
205 ac_ct_CC = @ac_ct_CC@
206 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
207 am__include = @am__include@
208 am__leading_dot = @am__leading_dot@
209 am__quote = @am__quote@
210 am__tar = @am__tar@
211 am__untar = @am__untar@
212 bindir = @bindir@
213 build = @build@
214 build_alias = @build_alias@
215 build_cpu = @build_cpu@
216 build_os = @build_os@
217 build_vendor = @build_vendor@
218 builddir = @builddir@
219 datadir = @datadir@
220 datarootdir = @datarootdir@
221 docdir = @docdir@
222 dvidir = @dvidir@
223 exec_prefix = @exec_prefix@
224 have_coverity = @have_coverity@
225 have_cython = @have_cython@
226 host = @host@
227 host_alias = @host_alias@
228 host_cpu = @host_cpu@
229 host_os = @host_os@
230 host_vendor = @host_vendor@
231 htmldir = @htmldir@
232 includedir = @includedir@
233 infodir = @infodir@
234 install_sh = @install_sh@
235 libdir = @libdir@
236 libexecdir = @libexecdir@
237 localedir = @localedir@
238 localstatedir = @localstatedir@
239 mandir = @mandir@
240 mkdir_p = @mkdir_p@
241 oldincludedir = @oldincludedir@
242 pdfdir = @pdfdir@
243 prefix = @prefix@
244 program_transform_name = @program_transform_name@
245 psdir = @psdir@
246 sbindir = @sbindir@
247 sharedstatedir = @sharedstatedir@
248 srcdir = @srcdir@
249 sysconfdir = @sysconfdir@
250 target_alias = @target_alias@
251 top_build_prefix = @top_build_prefix@
252 top_builddir = @top_builddir@
253 top_srcdir = @top_srcdir@
254 PYTHON = /usr/bin/env python
255 PY_DISTUTILS = \
256 VERSION_RELEASE="@PACKAGE_VERSION@" \
257 CPPFLAGS="-I\${top_srcdir}/include ${AM_CPPFLAGS} ${CPPFLAGS}" \
258 CFLAGS="${AM_CFLAGS} ${CFLAGS}" \
259 LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}" \
260 ${PYTHON} ./setup.py
261
262
263 # support silent builds
264 PY_BUILD_0 = @echo " PYTHON " $@; ${PY_DISTUTILS} -q build
265 PY_BUILD_1 = ${PY_DISTUTILS} build
266 PY_BUILD_ = ${PY_BUILD_0}
267 PY_BUILD = ${PY_BUILD_@AM_V@}
268 PY_INSTALL = ${PY_DISTUTILS} install
269 EXTRA_DIST = libseccomp.pxd seccomp.pyx setup.py
270 all: all-am
271
272 .SUFFIXES:
273 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
274 @for dep in $?; do \
275 case '$(am__configure_deps)' in \
276 *$$dep*) \
277 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
278 && { if test -f $@; then exit 0; else break; fi; }; \
279 exit 1;; \
280 esac; \
281 done; \
282 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/python/Makefile'; \
283 $(am__cd) $(top_srcdir) && \
284 $(AUTOMAKE) --foreign src/python/Makefile
285 .PRECIOUS: Makefile
286 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
287 @case '$?' in \
288 *config.status*) \
289 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
290 *) \
291 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
292 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
293 esac;
294
295 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
296 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
297
298 $(top_srcdir)/configure: $(am__configure_deps)
299 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
300 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
301 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
302 $(am__aclocal_m4_deps):
303
304 mostlyclean-libtool:
305 -rm -f *.lo
306
307 clean-libtool:
308 -rm -rf .libs _libs
309 tags TAGS:
310
311 ctags CTAGS:
312
313 cscope cscopelist:
314
315
316 distdir: $(DISTFILES)
317 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
318 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
319 list='$(DISTFILES)'; \
320 dist_files=`for file in $$list; do echo $$file; done | \
321 sed -e "s|^$$srcdirstrip/||;t" \
322 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
323 case $$dist_files in \
324 */*) $(MKDIR_P) `echo "$$dist_files" | \
325 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
326 sort -u` ;; \
327 esac; \
328 for file in $$dist_files; do \
329 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
330 if test -d $$d/$$file; then \
331 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
332 if test -d "$(distdir)/$$file"; then \
333 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
334 fi; \
335 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
336 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
337 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
338 fi; \
339 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
340 else \
341 test -f "$(distdir)/$$file" \
342 || cp -p $$d/$$file "$(distdir)/$$file" \
343 || exit 1; \
344 fi; \
345 done
346 check-am: all-am
347 check: check-am
348 all-am: Makefile all-local
349 installdirs:
350 install: install-am
351 install-exec: install-exec-am
352 install-data: install-data-am
353 uninstall: uninstall-am
354
355 install-am: all-am
356 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
357
358 installcheck: installcheck-am
359 install-strip:
360 if test -z '$(STRIP)'; then \
361 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
362 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
363 install; \
364 else \
365 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
366 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
367 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
368 fi
369 mostlyclean-generic:
370
371 clean-generic:
372
373 distclean-generic:
374 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
375 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
376
377 maintainer-clean-generic:
378 @echo "This command is intended for maintainers to use"
379 @echo "it deletes files that may require special tools to rebuild."
380 clean: clean-am
381
382 clean-am: clean-generic clean-libtool clean-local mostlyclean-am
383
384 distclean: distclean-am
385 -rm -f Makefile
386 distclean-am: clean-am distclean-generic
387
388 dvi: dvi-am
389
390 dvi-am:
391
392 html: html-am
393
394 html-am:
395
396 info: info-am
397
398 info-am:
399
400 install-data-am:
401
402 install-dvi: install-dvi-am
403
404 install-dvi-am:
405
406 install-exec-am: install-exec-local
407
408 install-html: install-html-am
409
410 install-html-am:
411
412 install-info: install-info-am
413
414 install-info-am:
415
416 install-man:
417
418 install-pdf: install-pdf-am
419
420 install-pdf-am:
421
422 install-ps: install-ps-am
423
424 install-ps-am:
425
426 installcheck-am:
427
428 maintainer-clean: maintainer-clean-am
429 -rm -f Makefile
430 maintainer-clean-am: distclean-am maintainer-clean-generic
431
432 mostlyclean: mostlyclean-am
433
434 mostlyclean-am: mostlyclean-generic mostlyclean-libtool
435
436 pdf: pdf-am
437
438 pdf-am:
439
440 ps: ps-am
441
442 ps-am:
443
444 uninstall-am:
445
446 .MAKE: install-am install-strip
447
448 .PHONY: all all-am all-local check check-am clean clean-generic \
449 clean-libtool clean-local cscopelist-am ctags-am distclean \
450 distclean-generic distclean-libtool distdir dvi dvi-am html \
451 html-am info info-am install install-am install-data \
452 install-data-am install-dvi install-dvi-am install-exec \
453 install-exec-am install-exec-local install-html \
454 install-html-am install-info install-info-am install-man \
455 install-pdf install-pdf-am install-ps install-ps-am \
456 install-strip installcheck installcheck-am installdirs \
457 maintainer-clean maintainer-clean-generic mostlyclean \
458 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
459 tags-am uninstall uninstall-am
460
461
462 all-local: build
463
464 build: ../libseccomp.la libseccomp.pxd seccomp.pyx setup.py
465 ${PY_BUILD} && touch build
466
467 install-exec-local: build
468 ${PY_INSTALL} --prefix=${DESTDIR}/${prefix}
469
470 clean-local:
471 ${RM} -rf seccomp.c build
472
473 # Tell versions [3.59,3.63) of GNU make to not export all variables.
474 # Otherwise a system limit (for SysV at least) may be exceeded.
475 .NOEXPORT:
3030 SCMP_ARCH_X86_64
3131 SCMP_ARCH_X32
3232 SCMP_ARCH_ARM
33 SCMP_ARCH_AARCH64
34 SCMP_ARCH_MIPS
35 SCMP_ARCH_MIPS64
36 SCMP_ARCH_MIPS64N32
37 SCMP_ARCH_MIPSEL
38 SCMP_ARCH_MIPSEL64
39 SCMP_ARCH_MIPSEL64N32
3340
3441 cdef enum scmp_filter_attr:
3542 SCMP_FLTATR_ACT_DEFAULT
6673
6774 int seccomp_merge(scmp_filter_ctx ctx_dst, scmp_filter_ctx ctx_src)
6875
76 uint32_t seccomp_arch_resolve_name(char *arch_name)
6977 uint32_t seccomp_arch_native()
70 int seccomp_arch_exist(scmp_filter_ctx ctx, uint32_t arch_token)
71 int seccomp_arch_add(scmp_filter_ctx ctx, uint32_t arch_token)
72 int seccomp_arch_remove(scmp_filter_ctx ctx, uint32_t arch_token)
78 int seccomp_arch_exist(scmp_filter_ctx ctx, int arch_token)
79 int seccomp_arch_add(scmp_filter_ctx ctx, int arch_token)
80 int seccomp_arch_remove(scmp_filter_ctx ctx, int arch_token)
7381
7482 int seccomp_load(scmp_filter_ctx ctx)
7583
7886 int seccomp_attr_set(scmp_filter_ctx ctx,
7987 scmp_filter_attr attr, uint32_t value)
8088
81 char *seccomp_syscall_resolve_num_arch(uint32_t arch_token, int num)
82 int seccomp_syscall_resolve_name_arch(uint32_t arch_token, char *name)
89 char *seccomp_syscall_resolve_num_arch(int arch_token, int num)
90 int seccomp_syscall_resolve_name_arch(int arch_token, char *name)
91 int seccomp_syscall_resolve_name_rewrite(int arch_token, char *name)
8392 int seccomp_syscall_resolve_name(char *name)
8493 int seccomp_syscall_priority(scmp_filter_ctx ctx,
8594 int syscall, uint8_t priority)
7878 TRAP = libseccomp.SCMP_ACT_TRAP
7979 ALLOW = libseccomp.SCMP_ACT_ALLOW
8080 def ERRNO(int errno):
81 """The action ERRNO(x) means that the syscall will return (x).
82 To conform to Linux syscall calling conventions, the syscall return
83 value should almost always be a negative number.
84 """
8185 return libseccomp.SCMP_ACT_ERRNO(errno)
8286 def TRACE(int value):
87 """The action TRACE(x) means that, if the process is being traced, (x)
88 will be returned to the tracing process via PTRACE_EVENT_SECCOMP
89 and the PTRACE_GETEVENTMSG option.
90 """
8391 return libseccomp.SCMP_ACT_TRACE(value)
8492
8593 NE = libseccomp.SCMP_CMP_NE
109117 Resolve an architecture's syscall name to the correct number or the
110118 syscall number to the correct name.
111119 """
112 if (isinstance(syscall, basestring)):
113 return libseccomp.seccomp_syscall_resolve_name_arch(arch, syscall)
114 elif (isinstance(syscall, int)):
115 return libseccomp.seccomp_syscall_resolve_num_arch(arch, syscall)
120 cdef char *ret_str
121
122 if isinstance(syscall, basestring):
123 return libseccomp.seccomp_syscall_resolve_name_rewrite(arch, syscall)
124 elif isinstance(syscall, int):
125 ret_str = libseccomp.seccomp_syscall_resolve_num_arch(arch, syscall)
126 if ret_str is NULL:
127 raise ValueError('Unknown syscall %d on arch %d' % (syscall, arch))
128 else:
129 return ret_str
116130 else:
117131 raise TypeError("Syscall must either be an int or str type")
118132
125139 X86_64 - 64-bit x86
126140 X32 - 64-bit x86 using the x32 ABI
127141 ARM - ARM
142 AARCH64 - 64-bit ARM
143 MIPS - MIPS O32 ABI
144 MIPS64 - MIPS 64-bit ABI
145 MIPS64N32 - MIPS N32 ABI
146 MIPSEL - MIPS little endian O32 ABI
147 MIPSEL64 - MIPS little endian 64-bit ABI
148 MIPSEL64N32 - MIPS little endian N32 ABI
128149 """
150
151 cdef int _token
129152
130153 NATIVE = libseccomp.SCMP_ARCH_NATIVE
131154 X86 = libseccomp.SCMP_ARCH_X86
132155 X86_64 = libseccomp.SCMP_ARCH_X86_64
133156 X32 = libseccomp.SCMP_ARCH_X32
134157 ARM = libseccomp.SCMP_ARCH_ARM
158 AARCH64 = libseccomp.SCMP_ARCH_AARCH64
159 MIPS = libseccomp.SCMP_ARCH_MIPS
160 MIPS64 = libseccomp.SCMP_ARCH_MIPS64
161 MIPS64N32 = libseccomp.SCMP_ARCH_MIPS64N32
162 MIPSEL = libseccomp.SCMP_ARCH_MIPSEL
163 MIPSEL64 = libseccomp.SCMP_ARCH_MIPSEL64
164 MIPSEL64N32 = libseccomp.SCMP_ARCH_MIPSEL64N32
165
166 def __cinit__(self, arch=libseccomp.SCMP_ARCH_NATIVE):
167 """ Initialize the architecture object.
168
169 Arguments:
170 arch - the architecture name or token value
171
172 Description:
173 Create an architecture object using the given name or token value.
174 """
175 if isinstance(arch, int):
176 if arch == libseccomp.SCMP_ARCH_NATIVE:
177 self._token = libseccomp.seccomp_arch_native()
178 elif arch == libseccomp.SCMP_ARCH_X86:
179 self._token = libseccomp.SCMP_ARCH_X86
180 elif arch == libseccomp.SCMP_ARCH_X86_64:
181 self._token = libseccomp.SCMP_ARCH_X86_64
182 elif arch == libseccomp.SCMP_ARCH_X32:
183 self._token = libseccomp.SCMP_ARCH_X32
184 elif arch == libseccomp.SCMP_ARCH_ARM:
185 self._token = libseccomp.SCMP_ARCH_ARM
186 elif arch == libseccomp.SCMP_ARCH_AARCH64:
187 self._token = libseccomp.SCMP_ARCH_AARCH64
188 elif arch == libseccomp.SCMP_ARCH_MIPS:
189 self._token = libseccomp.SCMP_ARCH_MIPS
190 elif arch == libseccomp.SCMP_ARCH_MIPS64:
191 self._token = libseccomp.SCMP_ARCH_MIPS64
192 elif arch == libseccomp.SCMP_ARCH_MIPS64N32:
193 self._token = libseccomp.SCMP_ARCH_MIPS64N32
194 elif arch == libseccomp.SCMP_ARCH_MIPSEL:
195 self._token = libseccomp.SCMP_ARCH_MIPSEL
196 elif arch == libseccomp.SCMP_ARCH_MIPSEL64:
197 self._token = libseccomp.SCMP_ARCH_MIPSEL64
198 elif arch == libseccomp.SCMP_ARCH_MIPSEL64N32:
199 self._token = libseccomp.SCMP_ARCH_MIPSEL64N32
200 else:
201 self._token = 0;
202 elif isinstance(arch, basestring):
203 self._token = libseccomp.seccomp_arch_resolve_name(arch)
204 else:
205 raise TypeError("Architecture must be an int or str type")
206 if self._token == 0:
207 raise ValueError("Invalid architecture")
208
209 def __int__(self):
210 """ Convert the architecture object to a token value.
211
212 Description:
213 Convert the architecture object to an integer representing the
214 architecture's token value.
215 """
216 return self._token
135217
136218 cdef class Attr:
137219 """ Python object representing the SyscallFilter attributes.
154236 """ Initialize the argument comparison.
155237
156238 Arguments:
157 arg - the arguement number, starting at 0
239 arg - the argument number, starting at 0
158240 op - the argument comparison operator, e.g. {NE,LT,LE,...}
159241 datum_a - argument value
160242 datum_b - argument value, only valid when op == MASKED_EQ
167249 self._arg.datum_a = datum_a
168250 self._arg.datum_b = datum_b
169251
170 def to_c(self):
252 cdef libseccomp.scmp_arg_cmp to_c(self):
171253 """ Convert the object into a C structure.
172254
173255 Description:
326408 Lookup the given attribute in the filter and return the
327409 attribute's value to the caller.
328410 """
329 value = 0
411 cdef uint32_t value = 0
330412 rc = libseccomp.seccomp_attr_get(self._ctx,
331413 attr, <uint32_t *>&value)
332414 if rc == -errno.EINVAL:
410492 """ NOTE: the code below exists solely to deal with the varadic
411493 nature of seccomp_rule_add() function and the inability of Cython
412494 to handle this automatically """
495 if len(args) > 6:
496 raise RuntimeError("Maximum number of arguments exceeded")
497 cdef Arg arg
413498 for i, arg in enumerate(args):
414499 c_arg[i] = arg.to_c()
415500 if len(args) == 0:
489574 """ NOTE: the code below exists solely to deal with the varadic
490575 nature of seccomp_rule_add_exact() function and the inability of
491576 Cython to handle this automatically """
577 if len(args) > 6:
578 raise RuntimeError("Maximum number of arguments exceeded")
579 cdef Arg arg
492580 for i, arg in enumerate(args):
493581 c_arg[i] = arg.to_c()
494582 if len(args) == 0:
3939 cmdclass = {'build_ext': build_ext},
4040 ext_modules = [
4141 Extension("seccomp", ["seccomp.pyx"],
42 extra_objects=["../libseccomp.a"])
43 ]
42 # unable to handle libtool libraries directly
43 extra_objects=["../.libs/libseccomp.a"],
44 # fix build warnings, see PEP 3123
45 extra_compile_args=["-fno-strict-aliasing"])
46 ]
4447 )
0 /**
1 * Seccomp System Interfaces
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.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 #include <stdlib.h>
22 #include <errno.h>
23 #include <sys/prctl.h>
24
25 #include <seccomp.h>
26
27 #include "db.h"
28 #include "gen_bpf.h"
29 #include "system.h"
30
31 /**
32 * Check to see if a seccomp() flag is supported
33 * @param flag the seccomp() flag
34 *
35 * This function checks to see if a seccomp() flag is supported by the system.
36 * If the flag is supported zero is returned, negative values otherwise.
37 *
38 */
39 int sys_chk_seccomp_flag(int flag)
40 {
41 #ifdef HAVE_SECCOMP
42 switch (flags) {
43 case SECCOMP_FILTER_FLAG_TSYNC:
44 return 0;
45 default:
46 return -EOPNOTSUPP;
47 }
48 #else
49 return -EOPNOTSUPP;
50 #endif /* HAVE_SECCOMP */
51 }
52
53 /**
54 * Loads the filter into the kernel
55 * @param col the filter collection
56 *
57 * This function loads the given seccomp filter context into the kernel. If
58 * the filter was loaded correctly, the kernel will be enforcing the filter
59 * when this function returns. Returns zero on success, negative values on
60 * error.
61 *
62 */
63 int sys_filter_load(const struct db_filter_col *col)
64 {
65 int rc;
66 struct bpf_program *program = NULL;
67
68 program = gen_bpf_generate(col);
69 if (program == NULL)
70 return -ENOMEM;
71
72 /* attempt to set NO_NEW_PRIVS */
73 if (col->attr.nnp_enable) {
74 rc = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
75 if (rc < 0)
76 goto filter_load_out;
77 }
78
79 /* load the filter into the kernel */
80 #ifdef HAVE_SECCOMP
81 {
82 int flags = 0;
83 if (col->attr.tsync_enable)
84 flags = SECCOMP_FILTER_FLAG_TSYNC;
85 rc = seccomp(SECCOMP_SET_MODE_FILTER, flags, program);
86 if (rc > 0 && col->attr.tsync_enable)
87 /* always return -ESRCH if we fail to sync threads */
88 errno = -ESRCH;
89 }
90 #else
91 rc = prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, program);
92 #endif /* HAVE_SECCOMP */
93
94 filter_load_out:
95 /* cleanup and return */
96 gen_bpf_release(program);
97 if (rc < 0)
98 return -errno;
99 return 0;
100 }
00 /**
1 * Seccomp System Information
1 * Seccomp System Interfaces
22 *
33 * Copyright (c) 2012 Red Hat <pmoore@redhat.com>
44 * Author: Paul Moore <pmoore@redhat.com>
2424 #include <linux/filter.h>
2525 #include <linux/prctl.h>
2626
27 #include <configure.h>
27 #include "configure.h"
2828
29 #ifdef CONF_SYSINC_SECCOMP
29 struct db_filter_col;
30
31 #ifdef HAVE_LINUX_SECCOMP_H
3032
3133 /* system header file */
3234 #include <linux/seccomp.h>
7577 __u64 args[6];
7678 };
7779
78 #endif /* CONF_SYSINC_SECCOMP */
80 #endif /* HAVE_LINUX_SECCOMP_H */
7981
8082 /* rename some of the socket filter types to make more sense */
8183 typedef struct sock_filter bpf_instr_raw;
8284
85 /* no new privs defintions */
8386 #ifndef PR_SET_NO_NEW_PRIVS
84 #define PR_SET_NO_NEW_PRIVS 38
85 #endif /* PR_SET_NO_NEW_PRIVS */
87 #define PR_SET_NO_NEW_PRIVS 38
88 #endif
8689
8790 #ifndef PR_GET_NO_NEW_PRIVS
88 #define PR_GET_NO_NEW_PRIVS 39
89 #endif /* PR_GET_NO_NEW_PRIVS */
91 #define PR_GET_NO_NEW_PRIVS 39
92 #endif
93
94 /* operations for the seccomp() syscall */
95 #ifndef SECCOMP_MODE_STRICT
96 #define SECCOMP_SET_MODE_STRICT 0
97 #endif
98 #ifndef SECCOMP_SET_MODE_FILTER
99 #define SECCOMP_SET_MODE_FILTER 1
100 #endif
101
102 /* flags for the seccomp() syscall */
103 #ifndef SECCOMP_FILTER_FLAG_TSYNC
104 #define SECCOMP_FILTER_FLAG_TSYNC 1
105 #endif
106
107 int sys_chk_seccomp_flag(int flag);
108
109 int sys_filter_load(const struct db_filter_col *col);
90110
91111 #endif
+0
-779
tags less more
0 !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
1 !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
2 !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
3 !_TAG_PROGRAM_NAME Exuberant Ctags //
4 !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
5 !_TAG_PROGRAM_VERSION 5.8 //
6 ACT_BADARCH src/python/seccomp.pyx /^ ACT_BADARCH = libseccomp.SCMP_FLTATR_ACT_BADARCH$/;" v class:Attr
7 ACT_DEFAULT src/python/seccomp.pyx /^ ACT_DEFAULT = libseccomp.SCMP_FLTATR_ACT_DEFAULT$/;" v class:Attr
8 ADDDEP macros.mk /^ADDDEP = \\$/;" m
9 AINC_BLK src/gen_bpf.c 39;" d file:
10 AINC_PROG src/gen_bpf.c 40;" d file:
11 ALLOW src/python/seccomp.pyx /^ALLOW = libseccomp.SCMP_ACT_ALLOW$/;" v
12 ARCHIVE macros.mk /^ ARCHIVE = @echo " AR $@";$/;" m
13 ARCH_ENDIAN_BIG src/arch.h /^ ARCH_ENDIAN_BIG,$/;" e enum:arch_def::__anon3
14 ARCH_ENDIAN_LITTLE src/arch.h /^ ARCH_ENDIAN_LITTLE,$/;" e enum:arch_def::__anon3
15 ARCH_ENDIAN_UNSPEC src/arch.h /^ ARCH_ENDIAN_UNSPEC = 0,$/;" e enum:arch_def::__anon3
16 ARCH_SIZE_32 src/arch.h /^ ARCH_SIZE_32 = 32,$/;" e enum:arch_def::__anon2
17 ARCH_SIZE_64 src/arch.h /^ ARCH_SIZE_64 = 64,$/;" e enum:arch_def::__anon2
18 ARCH_SIZE_UNSPEC src/arch.h /^ ARCH_SIZE_UNSPEC = 0,$/;" e enum:arch_def::__anon2
19 ARG_COUNT_MAX src/arch.h 76;" d
20 ARG_MASK_MAX src/db.h 70;" d
21 ARM src/python/seccomp.pyx /^ ARM = libseccomp.SCMP_ARCH_ARM$/;" v class:Arch
22 AWK macros.mk /^AWK ?= awk$/;" m
23 Arch src/python/seccomp.pyx /^cdef class Arch:$/;" c
24 Arg src/python/seccomp.pyx /^cdef class Arg:$/;" c
25 Attr src/python/seccomp.pyx /^cdef class Attr:$/;" c
26 BINDINGS src/Makefile /^BINDINGS =$/;" m
27 BPF_A tools/bpf.h 117;" d
28 BPF_ABS tools/bpf.h 87;" d
29 BPF_ADD tools/bpf.h 95;" d
30 BPF_ALU tools/bpf.h 75;" d
31 BPF_AND tools/bpf.h 100;" d
32 BPF_B tools/bpf.h 84;" d
33 BPF_CLASS tools/bpf.h 70;" d
34 BPF_DIV tools/bpf.h 98;" d
35 BPF_H tools/bpf.h 83;" d
36 BPF_IMM tools/bpf.h 86;" d
37 BPF_IND tools/bpf.h 88;" d
38 BPF_JA tools/bpf.h 105;" d
39 BPF_JEQ tools/bpf.h 106;" d
40 BPF_JGE tools/bpf.h 108;" d
41 BPF_JGT tools/bpf.h 107;" d
42 BPF_JMP tools/bpf.h 76;" d
43 BPF_JSET tools/bpf.h 109;" d
44 BPF_K tools/bpf.h 112;" d
45 BPF_LD tools/bpf.h 71;" d
46 BPF_LDX tools/bpf.h 72;" d
47 BPF_LEN tools/bpf.h 90;" d
48 BPF_LSH tools/bpf.h 101;" d
49 BPF_MEM tools/bpf.h 89;" d
50 BPF_MISC tools/bpf.h 78;" d
51 BPF_MISCOP tools/bpf.h 120;" d
52 BPF_MODE tools/bpf.h 85;" d
53 BPF_MSH tools/bpf.h 91;" d
54 BPF_MUL tools/bpf.h 97;" d
55 BPF_NEG tools/bpf.h 103;" d
56 BPF_OP tools/bpf.h 93;" d
57 BPF_OR tools/bpf.h 99;" d
58 BPF_PGM_SIZE src/gen_bpf.h 36;" d
59 BPF_PRG_MAX_LEN tools/scmp_bpf_sim.c 36;" d file:
60 BPF_RET tools/bpf.h 77;" d
61 BPF_RSH tools/bpf.h 102;" d
62 BPF_RVAL tools/bpf.h 116;" d
63 BPF_SCRATCH_SIZE tools/bpf.h 33;" d
64 BPF_SIZE tools/bpf.h 81;" d
65 BPF_SRC tools/bpf.h 111;" d
66 BPF_ST tools/bpf.h 73;" d
67 BPF_STX tools/bpf.h 74;" d
68 BPF_SUB tools/bpf.h 96;" d
69 BPF_SYSCALL_MAX tools/bpf.h 45;" d
70 BPF_SYS_ARG_MAX tools/bpf.h 38;" d
71 BPF_TAX tools/bpf.h 121;" d
72 BPF_TXA tools/bpf.h 122;" d
73 BPF_W tools/bpf.h 82;" d
74 BPF_X tools/bpf.h 113;" d
75 CAT macros.mk /^CAT ?= cat$/;" m
76 CFLAGS macros.mk /^CFLAGS ?= -Wl,-z,relro -Wall -O0 -g$/;" m
77 COMPILE macros.mk /^ COMPILE = @echo " CC $@";$/;" m
78 COMPILE_EXEC macros.mk /^ COMPILE_EXEC = @echo " CC $@";$/;" m
79 CONFIGS Makefile /^CONFIGS = configure.mk configure.h version_info.mk libseccomp.pc$/;" m
80 CONF_BINDINGS_PYTHON configure.h 8;" d
81 CONF_BINDINGS_PYTHON configure.mk /^CONF_BINDINGS_PYTHON = 1$/;" m
82 CONF_INSTALL_LIBDIR configure.mk /^CONF_INSTALL_LIBDIR = "\/usr\/local\/lib"$/;" m
83 CONF_INSTALL_PREFIX configure.mk /^CONF_INSTALL_PREFIX = "\/usr\/local"$/;" m
84 CONF_SYSINC_SECCOMP configure.h 7;" d
85 CONF_SYSINC_SECCOMP configure.mk /^CONF_SYSINC_SECCOMP = 1$/;" m
86 CTL_NNP src/python/seccomp.pyx /^ CTL_NNP = libseccomp.SCMP_FLTATR_CTL_NNP$/;" v class:Attr
87 D64_HI src/arch.h 74;" d
88 D64_LO src/arch.h 73;" d
89 DATUM_MAX src/arch.h 72;" d
90 DEPS src/Makefile /^DEPS = $(OBJS:%.o=%.d)$/;" m
91 DEPS tools/Makefile /^DEPS = $(TOOLS:%=%.d)$/;" m
92 DEPS_OBJS tests/Makefile /^DEPS_OBJS = $(OBJS:%.o=%.d)$/;" m
93 DEPS_TESTS tests/Makefile /^DEPS_TESTS = $(TESTS:%=%.d)$/;" m
94 ECHO macros.mk /^ECHO ?= echo$/;" m
95 ECHO_INFO macros.mk /^ ECHO_INFO ?= $(ECHO) ">> INFO:"$/;" m
96 ECHO_INFO macros.mk /^ ECHO_INFO ?= \/bin\/true || $(ECHO) ">> INFO:"$/;" m
97 EQ src/python/seccomp.pyx /^EQ = libseccomp.SCMP_CMP_EQ$/;" v
98 ERRNO src/python/seccomp.pyx /^def ERRNO(int errno):$/;" f
99 Extension src/python/setup.py /^from distutils.extension import Extension$/;" i
100 GCC macros.mk /^GCC ?= gcc$/;" m
101 GE src/python/seccomp.pyx /^GE = libseccomp.SCMP_CMP_GE$/;" v
102 GT src/python/seccomp.pyx /^GT = libseccomp.SCMP_CMP_GT$/;" v
103 HASH_BIG_ENDIAN src/hash.c 55;" d file:
104 HASH_BIG_ENDIAN src/hash.c 60;" d file:
105 HASH_BIG_ENDIAN src/hash.c 63;" d file:
106 HASH_LITTLE_ENDIAN src/hash.c 54;" d file:
107 HASH_LITTLE_ENDIAN src/hash.c 59;" d file:
108 HASH_LITTLE_ENDIAN src/hash.c 62;" d file:
109 HDR_BUILD include/Makefile /^HDR_BUILD = seccomp.h$/;" m
110 INSTALL macros.mk /^INSTALL ?= install$/;" m
111 INSTALL_BIN_DIR install.mk /^INSTALL_BIN_DIR ?= $(DESTDIR)\/$(INSTALL_PREFIX)\/bin$/;" m
112 INSTALL_BIN_MACRO macros.mk /^ INSTALL_BIN_MACRO = @echo " INSTALL $^ ($(INSTALL_BIN_DIR)\/$^)";$/;" m
113 INSTALL_GROUP install.mk /^INSTALL_GROUP ?= $$(id -g)$/;" m
114 INSTALL_INC_DIR install.mk /^INSTALL_INC_DIR ?= $(DESTDIR)\/$(INSTALL_PREFIX)\/include$/;" m
115 INSTALL_INC_MACRO macros.mk /^ INSTALL_INC_MACRO = @echo " INSTALL $^ ($(INSTALL_INC_DIR))";$/;" m
116 INSTALL_LIB_DIR install.mk /^INSTALL_LIB_DIR ?= $(DESTDIR)\/$(CONF_INSTALL_LIBDIR)$/;" m
117 INSTALL_LIB_MACRO macros.mk /^ INSTALL_LIB_MACRO = @echo " INSTALL $^ ($(INSTALL_LIB_DIR)\/$^)";$/;" m
118 INSTALL_MAN1_MACRO macros.mk /^ INSTALL_MAN1_MACRO = \\$/;" m
119 INSTALL_MAN3_MACRO macros.mk /^ INSTALL_MAN3_MACRO = \\$/;" m
120 INSTALL_MAN_DIR install.mk /^INSTALL_MAN_DIR ?= $(DESTDIR)\/$(INSTALL_PREFIX)\/share\/man$/;" m
121 INSTALL_OWNER install.mk /^INSTALL_OWNER ?= $$(id -u)$/;" m
122 INSTALL_PC_MACRO macros.mk /^ INSTALL_PC_MACRO = \\$/;" m
123 INSTALL_PREFIX install.mk /^INSTALL_PREFIX ?= $(CONF_INSTALL_PREFIX)$/;" m
124 INSTALL_SBIN_DIR install.mk /^INSTALL_SBIN_DIR ?= $(DESTDIR)\/$(INSTALL_PREFIX)\/sbin$/;" m
125 KILL src/python/seccomp.pyx /^KILL = libseccomp.SCMP_ACT_KILL$/;" v
126 LDFLAGS macros.mk /^LDFLAGS ?= -z relro -g$/;" m
127 LDFLAGS tests/Makefile /^LDFLAGS := ..\/src\/libseccomp.a $(OBJS)$/;" m
128 LDFLAGS tools/Makefile /^LDFLAGS := ..\/src\/libseccomp.a$/;" m
129 LE src/python/seccomp.pyx /^LE = libseccomp.SCMP_CMP_LE$/;" v
130 LIBFLAGS macros.mk /^LIBFLAGS =$/;" m
131 LIB_SHARED src/Makefile /^LIB_SHARED = libseccomp.so.$(VERSION_RELEASE)$/;" m
132 LIB_STATIC src/Makefile /^LIB_STATIC = libseccomp.a$/;" m
133 LIB_STATIC src/python/Makefile /^LIB_STATIC = ..\/libseccomp.a$/;" m
134 LINK_EXEC macros.mk /^ LINK_EXEC = @echo " LD $@";$/;" m
135 LINK_LIB macros.mk /^ LINK_LIB = @echo " LD $@" \\$/;" m
136 LN macros.mk /^LN ?= ln$/;" m
137 LT src/python/seccomp.pyx /^LT = libseccomp.SCMP_CMP_LT$/;" v
138 MAKEDEP macros.mk /^MAKEDEP = @$(GCC) $(CPPFLAGS) -MM -MF $(patsubst %.o,%.d,$@) $<;$/;" m
139 MAKEDEP_EXEC macros.mk /^MAKEDEP_EXEC = \\$/;" m
140 MAN1 doc/Makefile /^MAN1 = \\$/;" m
141 MAN3 doc/Makefile /^MAN3 = \\$/;" m
142 MASKED_EQ src/python/seccomp.pyx /^MASKED_EQ = libseccomp.SCMP_CMP_MASKED_EQ$/;" v
143 MKDIR macros.mk /^MKDIR ?= mkdir$/;" m
144 MV macros.mk /^MV ?= mv$/;" m
145 NATIVE src/python/seccomp.pyx /^ NATIVE = libseccomp.SCMP_ARCH_NATIVE$/;" v class:Arch
146 NE src/python/seccomp.pyx /^NE = libseccomp.SCMP_CMP_NE$/;" v
147 OBJS src/Makefile /^OBJS = \\$/;" m
148 OBJS tests/Makefile /^OBJS = util.o$/;" m
149 PR_GET_NO_NEW_PRIVS src/system.h 89;" d
150 PR_SET_NO_NEW_PRIVS src/system.h 85;" d
151 PYTHON macros.mk /^PYTHON ?= \/usr\/bin\/env python$/;" m
152 PY_BUILD macros.mk /^ PY_BUILD = @echo " PYTHON build";$/;" m
153 PY_DISTUTILS macros.mk /^PY_DISTUTILS = \\$/;" m
154 PY_INSTALL macros.mk /^ PY_INSTALL = @echo " PYTHON install";$/;" m
155 SECCOMP_MODE_DISABLED src/system.h 41;" d
156 SECCOMP_MODE_FILTER src/system.h 43;" d
157 SECCOMP_MODE_STRICT src/system.h 42;" d
158 SECCOMP_RET_ACTION src/system.h 60;" d
159 SECCOMP_RET_ACTION tools/bpf.h 59;" d
160 SECCOMP_RET_ALLOW src/system.h 57;" d
161 SECCOMP_RET_ALLOW tools/bpf.h 67;" d
162 SECCOMP_RET_DATA src/system.h 61;" d
163 SECCOMP_RET_DATA tools/bpf.h 60;" d
164 SECCOMP_RET_ERRNO src/system.h 55;" d
165 SECCOMP_RET_ERRNO tools/bpf.h 65;" d
166 SECCOMP_RET_KILL src/system.h 53;" d
167 SECCOMP_RET_KILL tools/bpf.h 63;" d
168 SECCOMP_RET_TRACE src/system.h 56;" d
169 SECCOMP_RET_TRACE tools/bpf.h 66;" d
170 SECCOMP_RET_TRAP src/system.h 54;" d
171 SECCOMP_RET_TRAP tools/bpf.h 64;" d
172 SED macros.mk /^SED ?= sed$/;" m
173 SHELL macros.mk /^SHELL = \/bin\/bash$/;" m
174 SUBDIRS_BUILD Makefile /^SUBDIRS_BUILD = include src tests tools$/;" m
175 SUBDIRS_INSTALL Makefile /^SUBDIRS_INSTALL = include src tools doc$/;" m
176 SyscallFilter src/python/seccomp.pyx /^cdef class SyscallFilter:$/;" c
177 TAR macros.mk /^TAR ?= tar$/;" m
178 TESTS tests/Makefile /^TESTS = 01-sim-allow \\$/;" m
179 TEST_PRIVATE tests/Makefile /^TEST_PRIVATE = 00-test$/;" m
180 TGT_IMM src/gen_bpf.c /^ TGT_IMM, \/* resolved immediate value *\/$/;" e enum:bpf_jump_type file:
181 TGT_K src/gen_bpf.c /^ TGT_K, \/* immediate "k" value *\/$/;" e enum:bpf_jump_type file:
182 TGT_NONE src/gen_bpf.c /^ TGT_NONE = 0,$/;" e enum:bpf_jump_type file:
183 TGT_NXT src/gen_bpf.c /^ TGT_NXT, \/* fall through to the next block *\/$/;" e enum:bpf_jump_type file:
184 TGT_PTR_BLK src/gen_bpf.c /^ TGT_PTR_BLK, \/* pointer to an instruction block *\/$/;" e enum:bpf_jump_type file:
185 TGT_PTR_DB src/gen_bpf.c /^ TGT_PTR_DB, \/* pointer to part of the filter db *\/$/;" e enum:bpf_jump_type file:
186 TGT_PTR_HSH src/gen_bpf.c /^ TGT_PTR_HSH, \/* pointer to a block hash table *\/$/;" e enum:bpf_jump_type file:
187 TOOLS tools/Makefile /^TOOLS = scmp_bpf_disasm \\$/;" m
188 TOOLS_INSTALL tools/Makefile /^TOOLS_INSTALL = scmp_sys_resolver$/;" m
189 TOPDIR macros.mk /^TOPDIR := $(shell \\$/;" m
190 TRACE src/python/seccomp.pyx /^def TRACE(int value):$/;" f
191 TRAP src/python/seccomp.pyx /^TRAP = libseccomp.SCMP_ACT_TRAP$/;" v
192 V macros.mk /^V ?= 0$/;" m
193 VERSION_HDR macros.mk /^VERSION_HDR = version.h$/;" m
194 VERSION_MAJOR version.h 5;" d
195 VERSION_MAJOR version_info.mk /^VERSION_MAJOR=0$/;" m
196 VERSION_MICRO version.h 7;" d
197 VERSION_MICRO version_info.mk /^VERSION_MICRO=0$/;" m
198 VERSION_MINOR version.h 6;" d
199 VERSION_MINOR version_info.mk /^VERSION_MINOR=0$/;" m
200 VERSION_RELEASE version.h 4;" d
201 VERSION_RELEASE version_info.mk /^VERSION_RELEASE=0.0.0$/;" m
202 X32 src/python/seccomp.pyx /^ X32 = libseccomp.SCMP_ARCH_X32$/;" v class:Arch
203 X32_SYSCALL_BIT src/arch-x32.h 30;" d
204 X86 src/python/seccomp.pyx /^ X86 = libseccomp.SCMP_ARCH_X86$/;" v class:Arch
205 X86_64 src/python/seccomp.pyx /^ X86_64 = libseccomp.SCMP_ARCH_X86_64$/;" v class:Arch
206 _ARCH_ARM_H src/arch-arm.h 23;" d
207 _ARCH_H src/arch.h 23;" d
208 _ARCH_X32_H src/arch-x32.h 23;" d
209 _ARCH_X86_H src/arch-x86.h 23;" d
210 _ARCH_x86_64_H src/arch-x86_64.h 23;" d
211 _BLK_MSZE src/gen_bpf.c 117;" d file:
212 _BPF_H tools/bpf.h 23;" d
213 _BPF_HASH_BITS src/gen_bpf.c 126;" d file:
214 _BPF_HASH_MASK src/gen_bpf.c 128;" d file:
215 _BPF_HASH_SIZE src/gen_bpf.c 127;" d file:
216 _BPF_INSTR src/gen_bpf.c 156;" d file:
217 _BPF_JMP_BLK src/gen_bpf.c 76;" d file:
218 _BPF_JMP_DB src/gen_bpf.c 74;" d file:
219 _BPF_JMP_HSH src/gen_bpf.c 78;" d file:
220 _BPF_JMP_IMM src/gen_bpf.c 72;" d file:
221 _BPF_JMP_MAX src/gen_bpf.c 82;" d file:
222 _BPF_JMP_MAX_RET src/gen_bpf.c 83;" d file:
223 _BPF_JMP_NO src/gen_bpf.c 68;" d file:
224 _BPF_JMP_NXT src/gen_bpf.c 70;" d file:
225 _BPF_K src/gen_bpf.c 80;" d file:
226 _BPF_OFFSET_SYSCALL src/gen_bpf.c 91;" d file:
227 _BPF_SYSCALL src/gen_bpf.c 92;" d file:
228 _CONFIGURE_H configure.h 5;" d
229 _DB_PRI_MASK_CHAIN src/db.c 41;" d file:
230 _DB_PRI_MASK_USER src/db.c 42;" d file:
231 _DB_PRI_USER src/db.c 43;" d file:
232 _DB_STA_FREED src/db.c 36;" d file:
233 _DB_STA_VALID src/db.c 35;" d file:
234 _FILTER_DB_H src/db.h 23;" d
235 _HASH_H src/hash.h 19;" d
236 _OP_FMT tools/scmp_bpf_disasm.c 35;" d file:
237 _SYSTEM_H src/system.h 23;" d
238 _TRANSLATOR_BPF_H src/gen_bpf.h 23;" d
239 _TRANSLATOR_STR_H src/gen_pfc.h 23;" d
240 _UTIL_TEST_H tests/util.h 23;" d
241 _VERSION_H version.h 3;" d
242 __NR_OABI_SYSCALL_BASE src/arch-arm-syscalls.c 29;" d file:
243 __NR_SYSCALL_BASE src/arch-arm-syscalls.c 34;" d file:
244 __NR_SYSCALL_BASE src/arch-arm-syscalls.c 36;" d file:
245 __author__ src/python/seccomp.pyx /^__author__ = 'Paul Moore <paul@paul-moore.com>'$/;" v
246 __blk_free src/gen_bpf.c /^static void __blk_free(struct bpf_state *state, struct bpf_blk *blk)$/;" f file:
247 __cinit__ src/python/seccomp.pyx /^ def __cinit__(self, arg, op, datum_a, datum_b = 0):$/;" m class:Arg file:
248 __cinit__ src/python/seccomp.pyx /^ def __cinit__(self, int defaction):$/;" m class:SyscallFilter file:
249 __date__ src/python/seccomp.pyx /^__date__ = "7 January 2013"$/;" v
250 __db_tree_free src/db.c /^static unsigned int __db_tree_free(struct db_arg_chain_tree *tree)$/;" f file:
251 __dealloc__ src/python/seccomp.pyx /^ def __dealloc__(self):$/;" m class:SyscallFilter file:
252 __x86_NR_ipc src/arch-x86.c 31;" d file:
253 __x86_NR_socketcall src/arch-x86.c 30;" d file:
254 _blk_append src/gen_bpf.c /^static struct bpf_blk *_blk_append(struct bpf_state *state,$/;" f file:
255 _blk_free src/gen_bpf.c /^static void _blk_free(struct bpf_state *state, struct bpf_blk *blk)$/;" f file:
256 _bpf_append_blk src/gen_bpf.c /^static int _bpf_append_blk(struct bpf_program *prg, const struct bpf_blk *blk)$/;" f file:
257 _ctx_valid src/api.c /^static int _ctx_valid(const scmp_filter_ctx *ctx)$/;" f file:
258 _db_node_mask_fixup src/db.c /^static void _db_node_mask_fixup(struct db_arg_chain_tree *node)$/;" f file:
259 _db_rule_gen_32 src/db.c /^static struct db_sys_list *_db_rule_gen_32(const struct arch_def *arch,$/;" f file:
260 _db_rule_gen_64 src/db.c /^static struct db_sys_list *_db_rule_gen_64(const struct arch_def *arch,$/;" f file:
261 _db_tree_act_check src/db.c /^static int _db_tree_act_check(struct db_arg_chain_tree *tree, uint32_t action)$/;" f file:
262 _db_tree_free src/db.c /^static unsigned int _db_tree_free(struct db_arg_chain_tree *tree)$/;" f file:
263 _db_tree_remove src/db.c /^static unsigned int _db_tree_remove(struct db_arg_chain_tree **tree,$/;" f file:
264 _db_tree_sub_prune src/db.c /^static int _db_tree_sub_prune(struct db_arg_chain_tree **tree_head,$/;" f file:
265 _gen_bpf_action src/gen_bpf.c /^static struct bpf_blk *_gen_bpf_action(struct bpf_state *state,$/;" f file:
266 _gen_bpf_action_hsh src/gen_bpf.c /^static struct bpf_blk *_gen_bpf_action_hsh(struct bpf_state *state,$/;" f file:
267 _gen_bpf_arch src/gen_bpf.c /^static struct bpf_blk *_gen_bpf_arch(struct bpf_state *state,$/;" f file:
268 _gen_bpf_build_bpf src/gen_bpf.c /^static int _gen_bpf_build_bpf(struct bpf_state *state,$/;" f file:
269 _gen_bpf_build_jmp src/gen_bpf.c /^static int _gen_bpf_build_jmp(struct bpf_state *state,$/;" f file:
270 _gen_bpf_build_jmp_ret src/gen_bpf.c /^static int _gen_bpf_build_jmp_ret(struct bpf_state *state,$/;" f file:
271 _gen_bpf_chain src/gen_bpf.c /^static struct bpf_blk *_gen_bpf_chain(struct bpf_state *state,$/;" f file:
272 _gen_bpf_chain_lvl_res src/gen_bpf.c /^static struct bpf_blk *_gen_bpf_chain_lvl_res(struct bpf_state *state,$/;" f file:
273 _gen_bpf_find_nxt src/gen_bpf.c /^static struct bpf_blk *_gen_bpf_find_nxt(const struct bpf_blk *blk,$/;" f file:
274 _gen_bpf_node src/gen_bpf.c /^static struct bpf_blk *_gen_bpf_node(struct bpf_state *state,$/;" f file:
275 _gen_bpf_syscall src/gen_bpf.c /^static struct bpf_blk *_gen_bpf_syscall(struct bpf_state *state,$/;" f file:
276 _gen_pfc_arch src/gen_pfc.c /^static int _gen_pfc_arch(const struct db_filter_col *col,$/;" f file:
277 _gen_pfc_chain src/gen_pfc.c /^static void _gen_pfc_chain(const struct arch_def *arch,$/;" f file:
278 _gen_pfc_syscall src/gen_pfc.c /^static void _gen_pfc_syscall(const struct arch_def *arch,$/;" f file:
279 _hsh_add src/gen_bpf.c /^static int _hsh_add(struct bpf_state *state, struct bpf_blk **blk_p,$/;" f file:
280 _hsh_find src/gen_bpf.c /^static struct bpf_blk *_hsh_find(const struct bpf_state *state, uint64_t h_val)$/;" f file:
281 _hsh_find_bkt src/gen_bpf.c /^static struct bpf_hash_bkt *_hsh_find_bkt(const struct bpf_state *state,$/;" f file:
282 _hsh_find_once src/gen_bpf.c /^static struct bpf_blk *_hsh_find_once(const struct bpf_state *state,$/;" f file:
283 _hsh_remove src/gen_bpf.c /^static struct bpf_blk *_hsh_remove(struct bpf_state *state, uint64_t h_val)$/;" f file:
284 _indent src/gen_pfc.c /^static void _indent(FILE *fds, unsigned int lvl)$/;" f file:
285 _pfc_action src/gen_pfc.c /^static void _pfc_action(FILE *fds, uint32_t action)$/;" f file:
286 _pfc_arch src/gen_pfc.c /^static const char *_pfc_arch(const struct arch_def *arch)$/;" f file:
287 _pfc_arg src/gen_pfc.c /^static void _pfc_arg(FILE *fds,$/;" f file:
288 _program_free src/gen_bpf.c /^static void _program_free(struct bpf_program *prg)$/;" f file:
289 _seccomp_rule_add src/api.c /^static int _seccomp_rule_add(struct db_filter_col *col,$/;" f file:
290 _state_release src/gen_bpf.c /^static void _state_release(struct bpf_state *state)$/;" f file:
291 _syscall_valid src/api.c /^static int _syscall_valid(int syscall)$/;" f file:
292 _trap_handler tests/util.c /^static void _trap_handler(int signal, siginfo_t *info, void *ctx)$/;" f file:
293 acc tools/scmp_bpf_sim.c /^ uint32_t acc;$/;" m struct:sim_state file:
294 acc_state src/gen_bpf.c /^ struct acc_state acc_state;$/;" m struct:bpf_blk typeref:struct:bpf_blk::acc_state file:
295 acc_state src/gen_bpf.c /^struct acc_state {$/;" s file:
296 act_badarch src/db.h /^ uint32_t act_badarch;$/;" m struct:db_filter_attr
297 act_default src/db.h /^ uint32_t act_default;$/;" m struct:db_filter_attr
298 act_f src/db.h /^ uint32_t act_f;$/;" m struct:db_arg_chain_tree
299 act_f_flg src/db.h /^ bool act_f_flg;$/;" m struct:db_arg_chain_tree
300 act_t src/db.h /^ uint32_t act_t;$/;" m struct:db_arg_chain_tree
301 act_t_flg src/db.h /^ bool act_t_flg;$/;" m struct:db_arg_chain_tree
302 action src/db.h /^ uint32_t action;$/;" m struct:db_sys_list
303 add_arch src/python/seccomp.pyx /^ def add_arch(self, arch):$/;" m class:SyscallFilter
304 add_rule src/python/seccomp.pyx /^ def add_rule(self, int action, syscall, *args):$/;" m class:SyscallFilter
305 add_rule_exactly src/python/seccomp.pyx /^ def add_rule_exactly(self, int action, syscall, *args):$/;" m class:SyscallFilter
306 arch src/db.h /^ const struct arch_def *arch;$/;" m struct:db_filter typeref:struct:db_filter::arch_def
307 arch src/gen_bpf.c /^ const struct arch_def *arch;$/;" m struct:bpf_state typeref:struct:bpf_state::arch_def file:
308 arch src/system.h /^ __u32 arch;$/;" m struct:seccomp_data
309 arch tools/bpf.h /^ uint32_t arch;$/;" m struct:seccomp_data
310 arch_arg_count_max src/arch.c /^int arch_arg_count_max(const struct arch_def *arch)$/;" f
311 arch_arg_offset src/arch.h 91;" d
312 arch_arg_offset_hi src/arch.c /^int arch_arg_offset_hi(const struct arch_def *arch, unsigned int arg)$/;" f
313 arch_arg_offset_lo src/arch.c /^int arch_arg_offset_lo(const struct arch_def *arch, unsigned int arg)$/;" f
314 arch_def src/arch.h /^struct arch_def {$/;" s
315 arch_def_arm src/arch-arm.c /^const struct arch_def arch_def_arm = {$/;" v typeref:struct:arch_def
316 arch_def_lookup src/arch.c /^const struct arch_def *arch_def_lookup(uint32_t token)$/;" f
317 arch_def_native src/arch.c /^const struct arch_def *arch_def_native = &arch_def_arm;$/;" v typeref:struct:arch_def
318 arch_def_native src/arch.c /^const struct arch_def *arch_def_native = &arch_def_x32;$/;" v typeref:struct:arch_def
319 arch_def_native src/arch.c /^const struct arch_def *arch_def_native = &arch_def_x86;$/;" v typeref:struct:arch_def
320 arch_def_native src/arch.c /^const struct arch_def *arch_def_native = &arch_def_x86_64;$/;" v typeref:struct:arch_def
321 arch_def_x32 src/arch-x32.c /^const struct arch_def arch_def_x32 = {$/;" v typeref:struct:arch_def
322 arch_def_x86 src/arch-x86.c /^const struct arch_def arch_def_x86 = {$/;" v typeref:struct:arch_def
323 arch_def_x86_64 src/arch-x86_64.c /^const struct arch_def arch_def_x86_64 = {$/;" v typeref:struct:arch_def
324 arch_filter_rewrite src/arch.c /^int arch_filter_rewrite(const struct arch_def *arch,$/;" f
325 arch_syscall_def src/arch.h /^struct arch_syscall_def {$/;" s
326 arch_syscall_resolve_name src/arch.c /^int arch_syscall_resolve_name(const struct arch_def *arch, const char *name)$/;" f
327 arch_syscall_resolve_num src/arch.c /^const char *arch_syscall_resolve_num(const struct arch_def *arch, int num)$/;" f
328 arch_syscall_rewrite src/arch.c /^int arch_syscall_rewrite(const struct arch_def *arch, bool strict, int *syscall)$/;" f
329 arch_syscall_translate src/arch.c /^int arch_syscall_translate(const struct arch_def *arch, int *syscall)$/;" f
330 arch_valid src/arch.c /^int arch_valid(uint32_t arch)$/;" f
331 arg src/db.h /^ unsigned int arg;$/;" m struct:db_api_arg
332 arg src/db.h /^ unsigned int arg;$/;" m struct:db_arg_chain_tree
333 arg_offset src/db.h /^ unsigned int arg_offset;$/;" m struct:db_arg_chain_tree
334 argparse tests/01-sim-allow.py /^import argparse$/;" i
335 argparse tests/02-sim-basic.py /^import argparse$/;" i
336 argparse tests/03-sim-basic_chains.py /^import argparse$/;" i
337 argparse tests/04-sim-multilevel_chains.py /^import argparse$/;" i
338 argparse tests/05-sim-long_jumps.py /^import argparse$/;" i
339 argparse tests/06-sim-actions.py /^import argparse$/;" i
340 argparse tests/07-sim-db_bug_looping.py /^import argparse$/;" i
341 argparse tests/08-sim-subtree_checks.py /^import argparse$/;" i
342 argparse tests/09-sim-syscall_priority_pre.py /^import argparse$/;" i
343 argparse tests/10-sim-syscall_priority_post.py /^import argparse$/;" i
344 argparse tests/11-basic-basic_errors.py /^import argparse$/;" i
345 argparse tests/12-sim-basic_masked_ops.py /^import argparse$/;" i
346 argparse tests/13-basic-attrs.py /^import argparse$/;" i
347 argparse tests/14-sim-reset.py /^import argparse$/;" i
348 argparse tests/15-basic-resolver.py /^import argparse$/;" i
349 argparse tests/16-sim-arch_basic.py /^import argparse$/;" i
350 argparse tests/17-sim-arch_merge.py /^import argparse$/;" i
351 argparse tests/18-sim-basic_whitelist.py /^import argparse$/;" i
352 argparse tests/19-sim-missing_syscalls.py /^import argparse$/;" i
353 argparse tests/20-live-basic_die.py /^import argparse$/;" i
354 argparse tests/21-live-basic_allow.py /^import argparse$/;" i
355 argparse tests/22-sim-basic_chains_array.py /^import argparse$/;" i
356 argparse tests/23-sim-arch_all_basic.py /^import argparse$/;" i
357 argparse tests/24-live-arg_allow.py /^import argparse$/;" i
358 argparse tests/25-sim-multilevel_chains_adv.py /^import argparse$/;" i
359 argparse tests/util.py /^import argparse$/;" i
360 args src/system.h /^ __u64 args[6];$/;" m struct:seccomp_data
361 args tests/01-sim-allow.py /^args = util.get_opt()$/;" v
362 args tests/02-sim-basic.py /^args = util.get_opt()$/;" v
363 args tests/03-sim-basic_chains.py /^args = util.get_opt()$/;" v
364 args tests/04-sim-multilevel_chains.py /^args = util.get_opt()$/;" v
365 args tests/05-sim-long_jumps.py /^args = util.get_opt()$/;" v
366 args tests/06-sim-actions.py /^args = util.get_opt()$/;" v
367 args tests/07-sim-db_bug_looping.py /^args = util.get_opt()$/;" v
368 args tests/08-sim-subtree_checks.py /^args = util.get_opt()$/;" v
369 args tests/09-sim-syscall_priority_pre.py /^args = util.get_opt()$/;" v
370 args tests/10-sim-syscall_priority_post.py /^args = util.get_opt()$/;" v
371 args tests/12-sim-basic_masked_ops.py /^args = util.get_opt()$/;" v
372 args tests/14-sim-reset.py /^args = util.get_opt()$/;" v
373 args tests/16-sim-arch_basic.py /^args = util.get_opt()$/;" v
374 args tests/17-sim-arch_merge.py /^args = util.get_opt()$/;" v
375 args tests/18-sim-basic_whitelist.py /^args = util.get_opt()$/;" v
376 args tests/19-sim-missing_syscalls.py /^args = util.get_opt()$/;" v
377 args tests/22-sim-basic_chains_array.py /^args = util.get_opt()$/;" v
378 args tests/23-sim-arch_all_basic.py /^args = util.get_opt()$/;" v
379 args tests/25-sim-multilevel_chains_adv.py /^args = util.get_opt()$/;" v
380 args tools/bpf.h /^ uint64_t args[BPF_SYS_ARG_MAX];$/;" m struct:seccomp_data
381 arm_arg_count_max src/arch-arm.h 30;" d
382 arm_syscall_resolve_name src/arch-arm-syscalls.c /^int arm_syscall_resolve_name(const char *name)$/;" f
383 arm_syscall_resolve_num src/arch-arm-syscalls.c /^const char *arm_syscall_resolve_num(int num)$/;" f
384 arm_syscall_table src/arch-arm-syscalls.c /^const struct arch_syscall_def arm_syscall_table[] = \\$/;" v typeref:struct:arch_syscall_def
385 attr src/db.h /^ struct db_filter_attr attr;$/;" m struct:db_filter_col typeref:struct:db_filter_col::db_filter_attr
386 attr src/gen_bpf.c /^ const struct db_filter_attr *attr;$/;" m struct:bpf_state typeref:struct:bpf_state::db_filter_attr file:
387 blk src/gen_bpf.c /^ struct bpf_blk *blk;$/;" m union:bpf_jump::__anon1 typeref:struct:bpf_jump::__anon1::bpf_blk file:
388 blk src/gen_bpf.c /^ struct bpf_blk *blk;$/;" m struct:bpf_hash_bkt typeref:struct:bpf_hash_bkt::bpf_blk file:
389 blk_alloc src/gen_bpf.c /^ unsigned int blk_alloc;$/;" m struct:bpf_blk file:
390 blk_cnt src/gen_bpf.c /^ unsigned int blk_cnt;$/;" m struct:bpf_blk file:
391 blk_cnt src/gen_bpf.h /^ uint16_t blk_cnt;$/;" m struct:bpf_program
392 blks src/gen_bpf.c /^ struct bpf_instr *blks;$/;" m struct:bpf_blk typeref:struct:bpf_blk::bpf_instr file:
393 blks src/gen_bpf.h /^ bpf_instr_raw *blks;$/;" m struct:bpf_program
394 bpf src/gen_bpf.c /^ struct bpf_program *bpf;$/;" m struct:bpf_state typeref:struct:bpf_state::bpf_program file:
395 bpf_blk src/gen_bpf.c /^struct bpf_blk {$/;" s file:
396 bpf_decode tools/scmp_bpf_disasm.c /^static int bpf_decode(FILE *file)$/;" f file:
397 bpf_decode_args tools/scmp_bpf_disasm.c /^static void bpf_decode_args(const bpf_instr_raw *bpf, unsigned int line)$/;" f file:
398 bpf_decode_op tools/scmp_bpf_disasm.c /^static void bpf_decode_op(const bpf_instr_raw *bpf)$/;" f file:
399 bpf_execute tools/scmp_bpf_sim.c /^static void bpf_execute(const struct bpf_program *prg,$/;" f file:
400 bpf_flg tests/util.h /^ int bpf_flg;$/;" m struct:util_options
401 bpf_hash_bkt src/gen_bpf.c /^struct bpf_hash_bkt {$/;" s file:
402 bpf_instr src/gen_bpf.c /^struct bpf_instr {$/;" s file:
403 bpf_instr_raw src/system.h /^typedef struct sock_filter bpf_instr_raw;$/;" t typeref:struct:sock_filter
404 bpf_instr_raw tools/bpf.h /^typedef struct sock_filter bpf_instr_raw;$/;" t typeref:struct:sock_filter
405 bpf_jump src/gen_bpf.c /^struct bpf_jump {$/;" s file:
406 bpf_jump_type src/gen_bpf.c /^enum bpf_jump_type {$/;" g file:
407 bpf_program src/gen_bpf.h /^struct bpf_program {$/;" s
408 bpf_program tools/scmp_bpf_sim.c /^struct bpf_program {$/;" s file:
409 bpf_state src/gen_bpf.c /^struct bpf_state {$/;" s file:
410 build_ext src/python/setup.py /^from Cython.Distutils import build_ext$/;" i
411 chains src/db.h /^ struct db_arg_chain_tree *chains;$/;" m struct:db_sys_list typeref:struct:db_sys_list::db_arg_chain_tree
412 cmdclass src/python/setup.py /^ cmdclass = {'build_ext': build_ext},$/;" v
413 cnf_entry configure /^function cnf_entry() {$/;" f
414 cnf_footer configure /^function cnf_footer() {$/;" f
415 cnf_h_entry configure /^function cnf_h_entry() {$/;" f
416 cnf_h_footer configure /^function cnf_h_footer() {$/;" f
417 cnf_h_header configure /^function cnf_h_header() {$/;" f
418 cnf_header configure /^function cnf_header() {$/;" f
419 cnf_mk_entry configure /^function cnf_mk_entry() {$/;" f
420 cnf_mk_footer configure /^function cnf_mk_footer() {$/;" f
421 cnf_mk_header configure /^function cnf_mk_header() {$/;" f
422 cnf_reset configure /^function cnf_reset() {$/;" f
423 code tools/bpf.h /^ uint16_t code;$/;" m struct:sock_filter
424 ctx tests/01-sim-allow.py /^ctx = test(args)$/;" v
425 ctx tests/02-sim-basic.py /^ctx = test(args)$/;" v
426 ctx tests/03-sim-basic_chains.py /^ctx = test(args)$/;" v
427 ctx tests/04-sim-multilevel_chains.py /^ctx = test(args)$/;" v
428 ctx tests/05-sim-long_jumps.py /^ctx = test(args)$/;" v
429 ctx tests/06-sim-actions.py /^ctx = test(args)$/;" v
430 ctx tests/07-sim-db_bug_looping.py /^ctx = test(args)$/;" v
431 ctx tests/08-sim-subtree_checks.py /^ctx = test(args)$/;" v
432 ctx tests/09-sim-syscall_priority_pre.py /^ctx = test(args)$/;" v
433 ctx tests/10-sim-syscall_priority_post.py /^ctx = test(args)$/;" v
434 ctx tests/12-sim-basic_masked_ops.py /^ctx = test(args)$/;" v
435 ctx tests/14-sim-reset.py /^ctx = test(args)$/;" v
436 ctx tests/16-sim-arch_basic.py /^ctx = test(args)$/;" v
437 ctx tests/17-sim-arch_merge.py /^ctx = test(args)$/;" v
438 ctx tests/18-sim-basic_whitelist.py /^ctx = test(args)$/;" v
439 ctx tests/19-sim-missing_syscalls.py /^ctx = test(args)$/;" v
440 ctx tests/22-sim-basic_chains_array.py /^ctx = test(args)$/;" v
441 ctx tests/23-sim-arch_all_basic.py /^ctx = test(args)$/;" v
442 ctx tests/25-sim-multilevel_chains_adv.py /^ctx = test(args)$/;" v
443 datum src/db.h /^ scmp_datum_t datum;$/;" m struct:db_api_arg
444 datum src/db.h /^ uint32_t datum;$/;" m struct:db_arg_chain_tree
445 db src/gen_bpf.c /^ struct db_arg_chain_tree *db;$/;" m union:bpf_jump::__anon1 typeref:struct:bpf_jump::__anon1::db_arg_chain_tree file:
446 db_action_valid src/db.c /^int db_action_valid(uint32_t action)$/;" f
447 db_api_arg src/db.h /^struct db_api_arg {$/;" s
448 db_arg_chain_tree src/db.h /^struct db_arg_chain_tree {$/;" s
449 db_chain_eq src/db.h 75;" d
450 db_chain_eq_result src/db.h 85;" d
451 db_chain_gt src/db.h 79;" d
452 db_chain_leaf src/db.h 83;" d
453 db_chain_lt src/db.h 71;" d
454 db_col_arch_exist src/db.c /^int db_col_arch_exist(struct db_filter_col *col, uint32_t arch_token)$/;" f
455 db_col_attr_get src/db.c /^int db_col_attr_get(const struct db_filter_col *col,$/;" f
456 db_col_attr_set src/db.c /^int db_col_attr_set(struct db_filter_col *col,$/;" f
457 db_col_db_add src/db.c /^int db_col_db_add(struct db_filter_col *col, struct db_filter *db)$/;" f
458 db_col_db_remove src/db.c /^int db_col_db_remove(struct db_filter_col *col, uint32_t arch_token)$/;" f
459 db_col_init src/db.c /^struct db_filter_col *db_col_init(uint32_t def_action)$/;" f
460 db_col_merge src/db.c /^int db_col_merge(struct db_filter_col *col_dst, struct db_filter_col *col_src)$/;" f
461 db_col_release src/db.c /^void db_col_release(struct db_filter_col *col)$/;" f
462 db_col_reset src/db.c /^void db_col_reset(struct db_filter_col *col, uint32_t def_action)$/;" f
463 db_col_valid src/db.c /^int db_col_valid(struct db_filter_col *col)$/;" f
464 db_filter src/db.h /^struct db_filter {$/;" s
465 db_filter_attr src/db.h /^struct db_filter_attr {$/;" s
466 db_filter_col src/db.h /^struct db_filter_col {$/;" s
467 db_init src/db.c /^struct db_filter *db_init(const struct arch_def *arch)$/;" f
468 db_list_foreach src/db.h 156;" d
469 db_release src/db.c /^void db_release(struct db_filter *db)$/;" f
470 db_reset src/db.c /^void db_reset(struct db_filter *db)$/;" f
471 db_rule_add src/db.c /^int db_rule_add(struct db_filter *db, uint32_t action, unsigned int syscall,$/;" f
472 db_sys_list src/db.h /^struct db_sys_list {$/;" s
473 db_syscall_priority src/db.c /^int db_syscall_priority(struct db_filter *db,$/;" f
474 def_hsh src/gen_bpf.c /^ uint64_t def_hsh;$/;" m struct:bpf_state file:
475 description src/python/setup.py /^ description = "Python binding for libseccomp",$/;" v
476 end_action tools/scmp_bpf_sim.c /^static void end_action(uint32_t action, unsigned int line)$/;" f file:
477 endian src/arch.h /^ } endian;$/;" m struct:arch_def typeref:enum:arch_def::__anon3
478 errno src/python/seccomp.pyx /^import errno$/;" i
479 errno tests/06-sim-actions.py /^import errno$/;" i
480 exist_arch src/python/seccomp.pyx /^ def exist_arch(self, arch):$/;" m class:SyscallFilter
481 exit_error tools/scmp_bpf_sim.c /^static void exit_error(unsigned int rc, unsigned int line)$/;" f file:
482 exit_fault tools/scmp_bpf_sim.c /^static void exit_fault(unsigned int rc)$/;" f file:
483 exit_usage tools/scmp_arch_detect.c /^static void exit_usage(const char *program)$/;" f file:
484 exit_usage tools/scmp_bpf_sim.c /^static void exit_usage(const char *program)$/;" f file:
485 exit_usage tools/scmp_sys_resolver.c /^static void exit_usage(const char *program)$/;" f file:
486 export_bpf src/python/seccomp.pyx /^ def export_bpf(self, file):$/;" m class:SyscallFilter
487 export_pfc src/python/seccomp.pyx /^ def export_pfc(self, file):$/;" m class:SyscallFilter
488 ext_modules src/python/setup.py /^ ext_modules = [$/;" v
489 extra_objects src/python/setup.py /^ extra_objects=["..\/libseccomp.a"])$/;" v
490 filter_cnt src/db.h /^ unsigned int filter_cnt;$/;" m struct:db_filter_col
491 filter_output tests/util.py /^def filter_output(args, ctx):$/;" f
492 filters src/db.h /^ struct db_filter **filters;$/;" m struct:db_filter_col typeref:struct:db_filter_col::db_filter
493 final src/hash.c 149;" d file:
494 flag_dup src/gen_bpf.c /^ bool flag_dup; \/* duplicate block and in use *\/$/;" m struct:bpf_blk file:
495 flag_hash src/gen_bpf.c /^ bool flag_hash; \/* added to the hash table *\/$/;" m struct:bpf_blk file:
496 flag_unique src/gen_bpf.c /^ bool flag_unique; \/* ->blks is unique to this block *\/$/;" m struct:bpf_blk file:
497 found src/gen_bpf.c /^ unsigned int found;$/;" m struct:bpf_hash_bkt file:
498 gen_bpf_generate src/gen_bpf.c /^struct bpf_program *gen_bpf_generate(const struct db_filter_col *col)$/;" f
499 gen_bpf_release src/gen_bpf.c /^void gen_bpf_release(struct bpf_program *program)$/;" f
500 gen_pfc_generate src/gen_pfc.c /^int gen_pfc_generate(const struct db_filter_col *col, int fd)$/;" f
501 generate_random_data tests/regression /^function generate_random_data() {$/;" f
502 generate_test_num tests/regression /^function generate_test_num() {$/;" f
503 get_attr src/python/seccomp.pyx /^ def get_attr(self, attr):$/;" m class:SyscallFilter
504 get_opt tests/util.py /^def get_opt():$/;" f
505 get_range tests/regression /^function get_range() {$/;" f
506 hash src/gen_bpf.c /^ uint64_t hash;$/;" m union:bpf_jump::__anon1 file:
507 hash src/gen_bpf.c /^ uint64_t hash;$/;" m struct:bpf_blk file:
508 hash_nxt src/gen_bpf.c /^ struct bpf_blk *hash_nxt;$/;" m struct:bpf_blk typeref:struct:bpf_blk::bpf_blk file:
509 hashbig src/hash.c /^uint32_t hashbig( const void *key, size_t length, uint32_t initval)$/;" f
510 hashlittle src/hash.c /^uint32_t hashlittle( const void *key, size_t length, uint32_t initval)$/;" f
511 hashlittle src/hash.c 44;" d file:
512 hashlittle2 src/hash.c /^void hashlittle2($/;" f
513 hashmask src/hash.c 67;" d file:
514 hashsize src/hash.c 66;" d file:
515 hashword src/hash.c /^uint32_t hashword($/;" f
516 hashword2 src/hash.c /^void hashword2 ($/;" f
517 htbl src/gen_bpf.c /^ struct bpf_hash_bkt *htbl[_BPF_HASH_SIZE];$/;" m struct:bpf_state typeref:struct:bpf_state::bpf_hash_bkt file:
518 i tools/scmp_bpf_sim.c /^ bpf_instr_raw *i;$/;" m struct:bpf_program file:
519 i_cnt tools/scmp_bpf_sim.c /^ size_t i_cnt;$/;" m struct:bpf_program file:
520 imm_j src/gen_bpf.c /^ uint8_t imm_j;$/;" m union:bpf_jump::__anon1 file:
521 imm_k src/gen_bpf.c /^ uint32_t imm_k;$/;" m union:bpf_jump::__anon1 file:
522 install_trap tests/util.py /^def install_trap():$/;" f
523 instruction_pointer src/system.h /^ __u64 instruction_pointer;$/;" m struct:seccomp_data
524 instruction_pointer tools/bpf.h /^ uint64_t instruction_pointer;$/;" m struct:seccomp_data
525 jf src/gen_bpf.c /^ struct bpf_jump jf;$/;" m struct:bpf_instr typeref:struct:bpf_instr::bpf_jump file:
526 jf tools/bpf.h /^ uint8_t jf;$/;" m struct:sock_filter
527 jt src/gen_bpf.c /^ struct bpf_jump jt;$/;" m struct:bpf_instr typeref:struct:bpf_instr::bpf_jump file:
528 jt tools/bpf.h /^ uint8_t jt;$/;" m struct:sock_filter
529 k src/gen_bpf.c /^ struct bpf_jump k;$/;" m struct:bpf_instr typeref:struct:bpf_instr::bpf_jump file:
530 k tools/bpf.h /^ uint32_t k;$/;" m struct:sock_filter
531 libseccomp src/python/seccomp.pyx /^cimport libseccomp$/;" i
532 license src/python/setup.py /^ license = "LGPLv2.1",$/;" v
533 load src/python/seccomp.pyx /^ def load(self):$/;" m class:SyscallFilter
534 long_description src/python/setup.py /^ long_description = "Python API for the Linux Kernel's syscall filtering capability, seccomp.",$/;" v
535 lvl_nxt src/db.h /^ struct db_arg_chain_tree *lvl_prv, *lvl_nxt;$/;" m struct:db_arg_chain_tree typeref:struct:db_arg_chain_tree::
536 lvl_nxt src/gen_bpf.c /^ struct bpf_blk *lvl_prv, *lvl_nxt;$/;" m struct:bpf_blk typeref:struct:bpf_blk:: file:
537 lvl_prv src/db.h /^ struct db_arg_chain_tree *lvl_prv, *lvl_nxt;$/;" m struct:db_arg_chain_tree typeref:struct:db_arg_chain_tree::db_arg_chain_tree
538 lvl_prv src/gen_bpf.c /^ struct bpf_blk *lvl_prv, *lvl_nxt;$/;" m struct:bpf_blk typeref:struct:bpf_blk::bpf_blk file:
539 main tests/00-test.c /^int main(void)$/;" f
540 main tests/01-sim-allow.c /^int main(int argc, char *argv[])$/;" f
541 main tests/02-sim-basic.c /^int main(int argc, char *argv[])$/;" f
542 main tests/03-sim-basic_chains.c /^int main(int argc, char *argv[])$/;" f
543 main tests/04-sim-multilevel_chains.c /^int main(int argc, char *argv[])$/;" f
544 main tests/05-sim-long_jumps.c /^int main(int argc, char *argv[])$/;" f
545 main tests/06-sim-actions.c /^int main(int argc, char *argv[])$/;" f
546 main tests/07-sim-db_bug_looping.c /^int main(int argc, char *argv[])$/;" f
547 main tests/08-sim-subtree_checks.c /^int main(int argc, char *argv[])$/;" f
548 main tests/09-sim-syscall_priority_pre.c /^int main(int argc, char *argv[])$/;" f
549 main tests/10-sim-syscall_priority_post.c /^int main(int argc, char *argv[])$/;" f
550 main tests/11-basic-basic_errors.c /^int main(int argc, char *argv[])$/;" f
551 main tests/12-sim-basic_masked_ops.c /^int main(int argc, char *argv[])$/;" f
552 main tests/13-basic-attrs.c /^int main(int argc, char *argv[])$/;" f
553 main tests/14-sim-reset.c /^int main(int argc, char *argv[])$/;" f
554 main tests/15-basic-resolver.c /^int main(int argc, char *argv[])$/;" f
555 main tests/16-sim-arch_basic.c /^int main(int argc, char *argv[])$/;" f
556 main tests/17-sim-arch_merge.c /^int main(int argc, char *argv[])$/;" f
557 main tests/18-sim-basic_whitelist.c /^int main(int argc, char *argv[])$/;" f
558 main tests/19-sim-missing_syscalls.c /^int main(int argc, char *argv[])$/;" f
559 main tests/20-live-basic_die.c /^int main(int argc, char *argv[])$/;" f
560 main tests/21-live-basic_allow.c /^int main(int argc, char *argv[])$/;" f
561 main tests/22-sim-basic_chains_array.c /^int main(int argc, char *argv[])$/;" f
562 main tests/23-sim-arch_all_basic.c /^int main(int argc, char *argv[])$/;" f
563 main tests/24-live-arg_allow.c /^int main(int argc, char *argv[])$/;" f
564 main tests/25-sim-multilevel_chains_adv.c /^int main(int argc, char *argv[])$/;" f
565 main tools/scmp_arch_detect.c /^int main(int argc, char *argv[])$/;" f
566 main tools/scmp_bpf_disasm.c /^int main(int argc, char *argv[])$/;" f
567 main tools/scmp_bpf_sim.c /^int main(int argc, char *argv[])$/;" f
568 main tools/scmp_sys_resolver.c /^int main(int argc, char *argv[])$/;" f
569 maintainer src/python/setup.py /^ maintainer = "Paul Moore",$/;" v
570 maintainer_email src/python/setup.py /^ maintainer_email = "paul@paul-moore.com",$/;" v
571 mask src/db.h /^ scmp_datum_t mask;$/;" m struct:db_api_arg
572 mask src/db.h /^ uint32_t mask;$/;" m struct:db_arg_chain_tree
573 mask src/gen_bpf.c /^ uint32_t mask;$/;" m struct:acc_state file:
574 merge src/python/seccomp.pyx /^ def merge(self, SyscallFilter filter):$/;" m class:SyscallFilter
575 mix src/hash.c 114;" d file:
576 msg_error configure /^function msg_error() {$/;" f
577 msg_summary configure /^function msg_summary() {$/;" f
578 msg_usage configure /^function msg_usage() {$/;" f
579 name src/arch.h /^ const char *name;$/;" m struct:arch_syscall_def
580 name src/python/setup.py /^ name = "seccomp",$/;" v
581 next src/db.h /^ struct db_sys_list *next;$/;" m struct:db_sys_list typeref:struct:db_sys_list::db_sys_list
582 next src/gen_bpf.c /^ struct bpf_blk *prev, *next;$/;" m struct:bpf_blk typeref:struct:bpf_blk:: file:
583 next src/gen_bpf.c /^ struct bpf_hash_bkt *next;$/;" m struct:bpf_hash_bkt typeref:struct:bpf_hash_bkt::bpf_hash_bkt file:
584 next src/gen_pfc.c /^ struct pfc_sys_list *next;$/;" m struct:pfc_sys_list typeref:struct:pfc_sys_list::pfc_sys_list file:
585 nnp_enable src/db.h /^ uint32_t nnp_enable;$/;" m struct:db_filter_attr
586 node src/gen_bpf.c /^ const struct db_arg_chain_tree *node;$/;" m struct:bpf_blk typeref:struct:bpf_blk::db_arg_chain_tree file:
587 node_cnt src/db.h /^ unsigned int node_cnt;$/;" m struct:db_sys_list
588 nr src/system.h /^ int nr;$/;" m struct:seccomp_data
589 nr tools/bpf.h /^ int32_t nr;$/;" m struct:seccomp_data
590 num src/arch.h /^ unsigned int num;$/;" m struct:arch_syscall_def
591 num src/db.h /^ unsigned int num;$/;" m struct:db_sys_list
592 nxt src/gen_bpf.c /^ unsigned int nxt;$/;" m union:bpf_jump::__anon1 file:
593 nxt_f src/db.h /^ struct db_arg_chain_tree *nxt_f;$/;" m struct:db_arg_chain_tree typeref:struct:db_arg_chain_tree::db_arg_chain_tree
594 nxt_t src/db.h /^ struct db_arg_chain_tree *nxt_t;$/;" m struct:db_arg_chain_tree typeref:struct:db_arg_chain_tree::db_arg_chain_tree
595 offset src/gen_bpf.c /^ int32_t offset;$/;" m struct:acc_state file:
596 op src/db.h /^ enum scmp_compare op;$/;" m struct:db_arg_chain_tree typeref:enum:db_arg_chain_tree::scmp_compare
597 op src/db.h /^ unsigned int op;$/;" m struct:db_api_arg
598 op src/gen_bpf.c /^ uint16_t op;$/;" m struct:bpf_instr file:
599 opt_verbose tools/scmp_bpf_sim.c /^static unsigned int opt_verbose = 0;$/;" v file:
600 os src/python/setup.py /^import os$/;" i
601 os tests/24-live-arg_allow.py /^import os$/;" i
602 os tests/util.py /^import os$/;" i
603 parse_action tests/util.py /^def parse_action(action):$/;" f
604 pfc_sys_list src/gen_pfc.c /^struct pfc_sys_list {$/;" s file:
605 platforms src/python/setup.py /^ platforms = "Linux",$/;" v
606 prev src/gen_bpf.c /^ struct bpf_blk *prev, *next;$/;" m struct:bpf_blk typeref:struct:bpf_blk::bpf_blk file:
607 pri_nxt src/db.h /^ struct db_sys_list *pri_prv, *pri_nxt;$/;" m struct:db_sys_list typeref:struct:db_sys_list::
608 pri_prv src/db.h /^ struct db_sys_list *pri_prv, *pri_nxt;$/;" m struct:db_sys_list typeref:struct:db_sys_list::db_sys_list
609 print_data tests/regression /^function print_data() {$/;" f
610 print_result tests/regression /^function print_result() {$/;" f
611 print_valgrind tests/regression /^function print_valgrind() {$/;" f
612 priority src/db.h /^ unsigned int priority;$/;" m struct:db_sys_list
613 priority src/gen_bpf.c /^ unsigned int priority;$/;" m struct:bpf_blk file:
614 refcnt src/db.h /^ unsigned int refcnt;$/;" m struct:db_arg_chain_tree
615 remove_arch src/python/seccomp.pyx /^ def remove_arch(self, arch):$/;" m class:SyscallFilter
616 reset src/python/seccomp.pyx /^ def reset(self, int defaction = -1):$/;" m class:SyscallFilter
617 resolve_syscall src/python/seccomp.pyx /^def resolve_syscall(arch, syscall):$/;" f
618 rot src/hash.c 68;" d file:
619 run_test tests/regression /^function run_test() {$/;" f
620 run_test_basic tests/regression /^function run_test_basic() {$/;" f
621 run_test_bpf_sim tests/regression /^function run_test_bpf_sim() {$/;" f
622 run_test_bpf_sim_fuzz tests/regression /^function run_test_bpf_sim_fuzz() {$/;" f
623 run_test_command tests/regression /^function run_test_command() {$/;" f
624 run_test_live tests/regression /^function run_test_live() {$/;" f
625 run_tests tests/regression /^function run_tests() {$/;" f
626 seccomp_arch_add src/api.c /^int seccomp_arch_add(scmp_filter_ctx ctx, uint32_t arch_token)$/;" f
627 seccomp_arch_exist src/api.c /^int seccomp_arch_exist(const scmp_filter_ctx ctx, uint32_t arch_token)$/;" f
628 seccomp_arch_native src/api.c /^uint32_t seccomp_arch_native(void)$/;" f
629 seccomp_arch_remove src/api.c /^int seccomp_arch_remove(scmp_filter_ctx ctx, uint32_t arch_token)$/;" f
630 seccomp_attr_get src/api.c /^int seccomp_attr_get(const scmp_filter_ctx ctx,$/;" f
631 seccomp_attr_set src/api.c /^int seccomp_attr_set(scmp_filter_ctx ctx,$/;" f
632 seccomp_data src/system.h /^struct seccomp_data {$/;" s
633 seccomp_data tools/bpf.h /^struct seccomp_data {$/;" s
634 seccomp_export_bpf src/api.c /^int seccomp_export_bpf(const scmp_filter_ctx ctx, int fd)$/;" f
635 seccomp_export_pfc src/api.c /^int seccomp_export_pfc(const scmp_filter_ctx ctx, int fd)$/;" f
636 seccomp_init src/api.c /^scmp_filter_ctx seccomp_init(uint32_t def_action)$/;" f
637 seccomp_load src/api.c /^int seccomp_load(const scmp_filter_ctx ctx)$/;" f
638 seccomp_merge src/api.c /^int seccomp_merge(scmp_filter_ctx ctx_dst, scmp_filter_ctx ctx_src)$/;" f
639 seccomp_release src/api.c /^void seccomp_release(scmp_filter_ctx ctx)$/;" f
640 seccomp_reset src/api.c /^int seccomp_reset(scmp_filter_ctx ctx, uint32_t def_action)$/;" f
641 seccomp_rule_add src/api.c /^int seccomp_rule_add(scmp_filter_ctx ctx,$/;" f
642 seccomp_rule_add_array src/api.c /^int seccomp_rule_add_array(scmp_filter_ctx ctx,$/;" f
643 seccomp_rule_add_exact src/api.c /^int seccomp_rule_add_exact(scmp_filter_ctx ctx, uint32_t action,$/;" f
644 seccomp_rule_add_exact_array src/api.c /^int seccomp_rule_add_exact_array(scmp_filter_ctx ctx,$/;" f
645 seccomp_syscall_priority src/api.c /^int seccomp_syscall_priority(scmp_filter_ctx ctx, int syscall, uint8_t priority)$/;" f
646 seccomp_syscall_resolve_name src/api.c /^int seccomp_syscall_resolve_name(const char *name)$/;" f
647 seccomp_syscall_resolve_name_arch src/api.c /^int seccomp_syscall_resolve_name_arch(uint32_t arch_token, const char *name)$/;" f
648 seccomp_syscall_resolve_num_arch src/api.c /^char *seccomp_syscall_resolve_num_arch(uint32_t arch_token, int num)$/;" f
649 set_attr src/python/seccomp.pyx /^ def set_attr(self, attr, int value):$/;" m class:SyscallFilter
650 setup src/python/setup.py /^from distutils.core import setup$/;" i
651 signal tests/util.py /^import signal$/;" i
652 sim_state tools/scmp_bpf_sim.c /^struct sim_state {$/;" s file:
653 size src/arch.h /^ } size;$/;" m struct:arch_def typeref:enum:arch_def::__anon2
654 sock_filter tools/bpf.h /^struct sock_filter {$/;" s
655 state src/db.h /^ int state;$/;" m struct:db_filter_col
656 sys src/gen_pfc.c /^ struct db_sys_list *sys;$/;" m struct:pfc_sys_list typeref:struct:pfc_sys_list::db_sys_list file:
657 sys tests/01-sim-allow.py /^import sys$/;" i
658 sys tests/02-sim-basic.py /^import sys$/;" i
659 sys tests/03-sim-basic_chains.py /^import sys$/;" i
660 sys tests/04-sim-multilevel_chains.py /^import sys$/;" i
661 sys tests/05-sim-long_jumps.py /^import sys$/;" i
662 sys tests/06-sim-actions.py /^import sys$/;" i
663 sys tests/07-sim-db_bug_looping.py /^import sys$/;" i
664 sys tests/08-sim-subtree_checks.py /^import sys$/;" i
665 sys tests/09-sim-syscall_priority_pre.py /^import sys$/;" i
666 sys tests/10-sim-syscall_priority_post.py /^import sys$/;" i
667 sys tests/11-basic-basic_errors.py /^import sys$/;" i
668 sys tests/12-sim-basic_masked_ops.py /^import sys$/;" i
669 sys tests/13-basic-attrs.py /^import sys$/;" i
670 sys tests/14-sim-reset.py /^import sys$/;" i
671 sys tests/15-basic-resolver.py /^import sys$/;" i
672 sys tests/16-sim-arch_basic.py /^import sys$/;" i
673 sys tests/17-sim-arch_merge.py /^import sys$/;" i
674 sys tests/18-sim-basic_whitelist.py /^import sys$/;" i
675 sys tests/19-sim-missing_syscalls.py /^import sys$/;" i
676 sys tests/20-live-basic_die.py /^import sys$/;" i
677 sys tests/21-live-basic_allow.py /^import sys$/;" i
678 sys tests/22-sim-basic_chains_array.py /^import sys$/;" i
679 sys tests/23-sim-arch_all_basic.py /^import sys$/;" i
680 sys tests/24-live-arg_allow.py /^import sys$/;" i
681 sys tests/25-sim-multilevel_chains_adv.py /^import sys$/;" i
682 sys tests/util.py /^import sys$/;" i
683 syscall_priority src/python/seccomp.pyx /^ def syscall_priority(self, syscall, int priority):$/;" m class:SyscallFilter
684 syscalls src/db.h /^ struct db_sys_list *syscalls;$/;" m struct:db_filter typeref:struct:db_filter::db_sys_list
685 system_arch src/python/seccomp.pyx /^def system_arch():$/;" f
686 temp tools/scmp_bpf_sim.c /^ uint32_t temp[BPF_SCRATCH_SIZE];$/;" m struct:sim_state file:
687 test tests/01-sim-allow.py /^def test(args):$/;" f
688 test tests/02-sim-basic.py /^def test(args):$/;" f
689 test tests/03-sim-basic_chains.py /^def test(args):$/;" f
690 test tests/04-sim-multilevel_chains.py /^def test(args):$/;" f
691 test tests/05-sim-long_jumps.py /^def test(args):$/;" f
692 test tests/06-sim-actions.py /^def test(args):$/;" f
693 test tests/07-sim-db_bug_looping.py /^def test(args):$/;" f
694 test tests/08-sim-subtree_checks.py /^def test(args):$/;" f
695 test tests/09-sim-syscall_priority_pre.py /^def test(args):$/;" f
696 test tests/10-sim-syscall_priority_post.py /^def test(args):$/;" f
697 test tests/11-basic-basic_errors.py /^def test():$/;" f
698 test tests/12-sim-basic_masked_ops.py /^def test(args):$/;" f
699 test tests/13-basic-attrs.py /^def test():$/;" f
700 test tests/14-sim-reset.py /^def test(args):$/;" f
701 test tests/15-basic-resolver.py /^def test():$/;" f
702 test tests/16-sim-arch_basic.py /^def test(args):$/;" f
703 test tests/17-sim-arch_merge.py /^def test(args):$/;" f
704 test tests/18-sim-basic_whitelist.py /^def test(args):$/;" f
705 test tests/19-sim-missing_syscalls.py /^def test(args):$/;" f
706 test tests/20-live-basic_die.py /^def test():$/;" f
707 test tests/21-live-basic_allow.py /^def test():$/;" f
708 test tests/22-sim-basic_chains_array.py /^def test(args):$/;" f
709 test tests/23-sim-arch_all_basic.py /^def test(args):$/;" f
710 test tests/24-live-arg_allow.py /^def test():$/;" f
711 test tests/25-sim-multilevel_chains_adv.py /^def test(args):$/;" f
712 test_deps configure /^function test_deps() {$/;" f
713 tgt src/gen_bpf.c /^ } tgt;$/;" m struct:bpf_jump typeref:union:bpf_jump::__anon1 file:
714 tmpl_filter configure /^function tmpl_filter() {$/;" f
715 to_c src/python/seccomp.pyx /^ def to_c(self):$/;" m class:Arg
716 token src/arch.h /^ uint32_t token;$/;" m struct:arch_def
717 token_bpf src/arch.h /^ uint32_t token_bpf;$/;" m struct:arch_def
718 trap_handler tests/util.py /^def trap_handler(signum, frame):$/;" f
719 type src/gen_bpf.c /^ enum bpf_jump_type type;$/;" m struct:bpf_jump typeref:enum:bpf_jump::bpf_jump_type file:
720 uint32_t src/python/libseccomp.pxd /^from libc.stdint cimport uint8_t, uint32_t, uint64_t$/;" i
721 uint32_t src/python/seccomp.pyx /^from libc.stdint cimport uint32_t$/;" i
722 uint64_t src/python/libseccomp.pxd /^from libc.stdint cimport uint8_t, uint32_t, uint64_t$/;" i
723 uint8_t src/python/libseccomp.pxd /^from libc.stdint cimport uint8_t, uint32_t, uint64_t$/;" i
724 url src/python/setup.py /^ url = "http:\/\/libseccomp.sf.net",$/;" v
725 usage tests/regression /^function usage() {$/;" f
726 util tests/01-sim-allow.py /^import util$/;" i
727 util tests/02-sim-basic.py /^import util$/;" i
728 util tests/03-sim-basic_chains.py /^import util$/;" i
729 util tests/04-sim-multilevel_chains.py /^import util$/;" i
730 util tests/05-sim-long_jumps.py /^import util$/;" i
731 util tests/06-sim-actions.py /^import util$/;" i
732 util tests/07-sim-db_bug_looping.py /^import util$/;" i
733 util tests/08-sim-subtree_checks.py /^import util$/;" i
734 util tests/09-sim-syscall_priority_pre.py /^import util$/;" i
735 util tests/10-sim-syscall_priority_post.py /^import util$/;" i
736 util tests/11-basic-basic_errors.py /^import util$/;" i
737 util tests/12-sim-basic_masked_ops.py /^import util$/;" i
738 util tests/13-basic-attrs.py /^import util$/;" i
739 util tests/14-sim-reset.py /^import util$/;" i
740 util tests/15-basic-resolver.py /^import util$/;" i
741 util tests/16-sim-arch_basic.py /^import util$/;" i
742 util tests/17-sim-arch_merge.py /^import util$/;" i
743 util tests/18-sim-basic_whitelist.py /^import util$/;" i
744 util tests/19-sim-missing_syscalls.py /^import util$/;" i
745 util tests/20-live-basic_die.py /^import util$/;" i
746 util tests/21-live-basic_allow.py /^import util$/;" i
747 util tests/22-sim-basic_chains_array.py /^import util$/;" i
748 util tests/23-sim-arch_all_basic.py /^import util$/;" i
749 util tests/24-live-arg_allow.py /^import util$/;" i
750 util tests/25-sim-multilevel_chains_adv.py /^import util$/;" i
751 util_action_parse tests/util.c /^int util_action_parse(const char *action)$/;" f
752 util_file_write tests/util.c /^int util_file_write(const char *path)$/;" f
753 util_filter_output tests/util.c /^int util_filter_output(const struct util_options *opts,$/;" f
754 util_getopt tests/util.c /^int util_getopt(int argc, char *argv[], struct util_options *opts)$/;" f
755 util_options tests/util.h /^struct util_options {$/;" s
756 util_trap_install tests/util.c /^int util_trap_install(void)$/;" f
757 valid src/db.h /^ bool valid;$/;" m struct:db_api_arg
758 valid src/db.h /^ bool valid;$/;" m struct:db_sys_list
759 verify_deps configure /^function verify_deps() {$/;" f
760 verify_deps tests/regression /^function verify_deps() {$/;" f
761 verify_deps tools/scmp_app_inspector /^function verify_deps() {$/;" f
762 version src/python/setup.py /^ version = os.environ["VERSION_RELEASE"],$/;" v
763 write_file tests/util.py /^def write_file(path):$/;" f
764 x32_arg_count_max src/arch-x32.h 32;" d
765 x32_syscall_resolve_name src/arch-x32-syscalls.c /^int x32_syscall_resolve_name(const char *name)$/;" f
766 x32_syscall_resolve_num src/arch-x32-syscalls.c /^const char *x32_syscall_resolve_num(int num)$/;" f
767 x86_64_arg_count_max src/arch-x86_64.h 30;" d
768 x86_64_arg_offset_hi src/arch-x86_64.h 35;" d
769 x86_64_arg_offset_lo src/arch-x86_64.h 34;" d
770 x86_64_syscall_resolve_name src/arch-x86_64-syscalls.c /^int x86_64_syscall_resolve_name(const char *name)$/;" f
771 x86_64_syscall_resolve_num src/arch-x86_64-syscalls.c /^const char *x86_64_syscall_resolve_num(int num)$/;" f
772 x86_64_syscall_table src/arch-x86_64-syscalls.c /^const struct arch_syscall_def x86_64_syscall_table[] = \\$/;" v typeref:struct:arch_syscall_def
773 x86_arg_count_max src/arch-x86.h 31;" d
774 x86_filter_rewrite src/arch-x86.c /^int x86_filter_rewrite(const struct arch_def *arch, bool strict,$/;" f
775 x86_syscall_resolve_name src/arch-x86-syscalls.c /^int x86_syscall_resolve_name(const char *name)$/;" f
776 x86_syscall_resolve_num src/arch-x86-syscalls.c /^const char *x86_syscall_resolve_num(int num)$/;" f
777 x86_syscall_rewrite src/arch-x86.c /^int x86_syscall_rewrite(const struct arch_def *arch, bool strict, int *syscall)$/;" f
778 x86_syscall_table src/arch-x86-syscalls.c /^static const struct arch_syscall_def x86_syscall_table[] = \\$/;" v typeref:struct:arch_syscall_def file:
0
1 /*
2 * This library is free software; you can redistribute it and/or modify it
3 * under the terms of version 2.1 of the GNU Lesser General Public License as
4 * published by the Free Software Foundation.
5 *
6 * This library is distributed in the hope that it will be useful, but WITHOUT
7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
9 * for more details.
10 *
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this library; if not, see <http://www.gnu.org/licenses>.
13 */
14
0 #include <errno.h>
1 #include <fcntl.h>
2 #include <getopt.h>
153 #include <signal.h>
164 #include <stdio.h>
5 #include <string.h>
176 #include <unistd.h>
7 #include <sys/types.h>
8 #include <sys/stat.h>
9
10 #include <errno.h>
11 #include <stdint.h>
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <string.h>
15 #include <sys/socket.h>
16 #include <sys/types.h>
1817
1918 #include <seccomp.h>
2019
21 #include "util.h"
20 const int blocks[] = {
21 3, 4, 5, 6,
22 7, 8, 9, 11,
23 12, 13, 14, 15
24 };
2225
23 int main(void)
26 int block_call(int syscall, enum scmp_compare op, uint64_t value,
27 scmp_filter_ctx ctx);
28
29 int main(int argc, char **argv)
2430 {
25 scmp_filter_ctx ctx;
26 int status;
31 int ret_code, socket_syscall_num, i;
32 scmp_filter_ctx filter;
2733
28 ctx = seccomp_init(SCMP_ACT_KILL);
29 if (ctx == NULL)
30 return 1;
34 // Let us make a Seccomp filter
35 filter = seccomp_init(SCMP_ACT_ALLOW);
3136
32 status = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(prctl), 0);
33 if (status < 0)
34 return 1;
37 if(filter == NULL) {
38 printf("Error initializing filter!\n");
39 return -1;
40 }
3541
36 status = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
37 if (status < 0)
38 return 1;
42 // We need to know which syscall Socket is
43 socket_syscall_num = seccomp_syscall_resolve_name("socket");
44 if(socket_syscall_num == __NR_SCMP_ERROR) {
45 printf("Error looking up syscall number of Socket!\n");
46 return -1;
47 }
48
49 #if 0
50 printf("Got syscall number of Socket as %d\n", socket_syscall_num);
51 #endif
52
53 // Block all our predefined argument numbers
54 for(i = 0; i < 12; i++) {
55 ret_code = block_call(socket_syscall_num, SCMP_CMP_EQ, blocks[i], filter);
56 if(ret_code != 0) {
57 printf("Error creating filter rule!\n");
58 return -1;
59 }
60 }
3961
4062 #if 1
41 status = seccomp_load(ctx);
42 if (status < 0)
43 return 1;
63 // Block everything over 16
64 ret_code = block_call(socket_syscall_num, SCMP_CMP_GT, 16, filter);
65 if(ret_code != 0) {
66 printf("Error creating filter rule!\n");
67 return -1;
68 }
4469 #endif
4570
46 status = seccomp_reset(ctx, SCMP_ACT_ALLOW);
47 if (status < 0)
48 return 1;
71 seccomp_export_bpf(filter, STDOUT_FILENO);
72 exit(0);
4973
50 #if 0
51 status = seccomp_load(ctx);
52 if (status < 0)
53 return 1;
54 #endif
74 printf("Filter initialized and filled!\n");
5575
56 write(2, "OK\n", 3);
76 // Load the filter into the kernel
77 ret_code = seccomp_load(filter);
78 if(ret_code != 0) {
79 printf("Filter load failed!\n");
80 return -1;
81 }
82
83 printf("Filter load successful!\n");
84
85 // Release the filter when we're done to free memory
86 seccomp_release(filter);
87
88 // All right. Go through socket invocations. See which ones succeed, which ones fail.
89 for(i = 1; i < AF_MAX; i++) {
90 ret_code = socket(i, 0, SOCK_STREAM);
91
92 if(ret_code != -1) {
93 printf("Socket call for address family %d succeeded!\n", i);
94 } else {
95 printf("Error creating socket for address family %d: %d %s\n", i, ret_code,
96 strerror(errno));
97 }
98 }
5799
58100 return 0;
59 }
101 }
102
103
104 /**
105 * Add a single rule to a preexisting filter
106 */
107 int block_call(int syscall, enum scmp_compare op, uint64_t value,
108 scmp_filter_ctx ctx)
109 {
110 struct scmp_arg_cmp *arg;
111 int ret_code;
112
113 // Malloc/free to mimic the way the bindings behave to the greatest extent possible
114 arg = (struct scmp_arg_cmp *)malloc(sizeof(struct scmp_arg_cmp));
115 if(arg == NULL) {
116 printf("Malloc failed!\n");
117 return -1;
118 }
119
120 arg->arg = 0;
121 arg->op = op;
122 arg->datum_a = value;
123 arg->datum_b = 0;
124
125 ret_code = seccomp_rule_add_exact_array(ctx, SCMP_ACT_ERRNO(EPERM), syscall, 1,
126 arg);
127 if(ret_code != 0) {
128 return -1;
129 }
130
131 free(arg);
132
133 return 0;
134 }
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_ALLOW);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 rc = util_filter_output(&opts, ctx);
4243 if (rc)
2323 * read, write, exit, and rt_sigreturn
2424 */
2525
26 #include <errno.h>
2627 #include <unistd.h>
2728
2829 #include <seccomp.h>
3334 {
3435 int rc;
3536 struct util_options opts;
36 scmp_filter_ctx ctx;
37 scmp_filter_ctx ctx = NULL;
3738
3839 rc = util_getopt(argc, argv, &opts);
3940 if (rc < 0)
4142
4243 ctx = seccomp_init(SCMP_ACT_KILL);
4344 if (ctx == NULL)
44 goto out;
45
45 return ENOMEM;
4646
4747 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0);
4848 if (rc != 0)
2929
3030 def test(args):
3131 f = SyscallFilter(KILL)
32 f.add_rule_exactly(ALLOW, "read");
33 f.add_rule_exactly(ALLOW, "write");
34 f.add_rule_exactly(ALLOW, "close");
35 f.add_rule_exactly(ALLOW, "rt_sigreturn");
32 f.add_rule_exactly(ALLOW, "read")
33 f.add_rule_exactly(ALLOW, "write")
34 f.add_rule_exactly(ALLOW, "close")
35 f.add_rule_exactly(ALLOW, "rt_sigreturn")
3636 return f
3737
3838 args = util.get_opt()
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
4243 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
2929
3030 def test(args):
3131 f = SyscallFilter(KILL)
32 f.add_rule_exactly(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()));
33 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()));
34 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()));
35 f.add_rule_exactly(ALLOW, "close");
36 f.add_rule_exactly(ALLOW, "rt_sigreturn");
32 f.add_rule_exactly(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
33 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
34 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
35 f.add_rule_exactly(ALLOW, "close")
36 f.add_rule_exactly(ALLOW, "rt_sigreturn")
3737 return f
3838
3939 args = util.get_opt()
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <limits.h>
2223 #include <unistd.h>
2324
2930 {
3031 int rc;
3132 struct util_options opts;
32 scmp_filter_ctx ctx;
33 scmp_filter_ctx ctx = NULL;
3334
3435 rc = util_getopt(argc, argv, &opts);
3536 if (rc < 0)
3738
3839 ctx = seccomp_init(SCMP_ACT_KILL);
3940 if (ctx == NULL)
40 goto out;
41 return ENOMEM;
4142
42 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
43 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
4344 if (rc != 0)
4445 goto out;
4546
46 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
47 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
4748 if (rc != 0)
4849 goto out;
4950
50 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 3,
51 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO),
52 SCMP_A1(SCMP_CMP_NE, 0x0),
53 SCMP_A2(SCMP_CMP_LT, SSIZE_MAX));
51 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 3,
52 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO),
53 SCMP_A1(SCMP_CMP_NE, 0x0),
54 SCMP_A2(SCMP_CMP_LT, SSIZE_MAX));
5455 if (rc != 0)
5556 goto out;
5657
57 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 3,
58 SCMP_A0(SCMP_CMP_EQ, STDOUT_FILENO),
59 SCMP_A1(SCMP_CMP_NE, 0x0),
60 SCMP_A2(SCMP_CMP_LT, SSIZE_MAX));
58 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 3,
59 SCMP_A0(SCMP_CMP_EQ, STDOUT_FILENO),
60 SCMP_A1(SCMP_CMP_NE, 0x0),
61 SCMP_A2(SCMP_CMP_LT, SSIZE_MAX));
6162 if (rc != 0)
6263 goto out;
63 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 3,
64 SCMP_A0(SCMP_CMP_EQ, STDERR_FILENO),
65 SCMP_A1(SCMP_CMP_NE, 0x0),
66 SCMP_A2(SCMP_CMP_LT, SSIZE_MAX));
64 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 3,
65 SCMP_A0(SCMP_CMP_EQ, STDERR_FILENO),
66 SCMP_A1(SCMP_CMP_NE, 0x0),
67 SCMP_A2(SCMP_CMP_LT, SSIZE_MAX));
6768 if (rc != 0)
6869 goto out;
6970
70 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
71 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
7172 if (rc != 0)
7273 goto out;
7374
74 rc = seccomp_rule_add_exact(ctx,
75 SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
75 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
7676 if (rc != 0)
7777 goto out;
7878
2929
3030 def test(args):
3131 f = SyscallFilter(KILL)
32 f.add_rule_exactly(ALLOW, "open");
33 f.add_rule_exactly(ALLOW, "close");
34 f.add_rule_exactly(ALLOW, "read",
35 Arg(0, EQ, sys.stdin.fileno()),
36 Arg(1, NE, 0),
37 Arg(2, LT, sys.maxsize));
38 f.add_rule_exactly(ALLOW, "write",
39 Arg(0, EQ, sys.stdout.fileno()),
40 Arg(1, NE, 0),
41 Arg(2, LT, sys.maxsize));
42 f.add_rule_exactly(ALLOW, "write",
43 Arg(0, EQ, sys.stderr.fileno()),
44 Arg(1, NE, 0),
45 Arg(2, LT, sys.maxsize));
46 f.add_rule_exactly(ALLOW, "close");
47 f.add_rule_exactly(ALLOW, "rt_sigreturn");
32 f.add_rule(ALLOW, "open")
33 f.add_rule(ALLOW, "close")
34 f.add_rule(ALLOW, "read",
35 Arg(0, EQ, sys.stdin.fileno()),
36 Arg(1, NE, 0),
37 Arg(2, LT, sys.maxsize))
38 f.add_rule(ALLOW, "write",
39 Arg(0, EQ, sys.stdout.fileno()),
40 Arg(1, NE, 0),
41 Arg(2, LT, sys.maxsize))
42 f.add_rule(ALLOW, "write",
43 Arg(0, EQ, sys.stderr.fileno()),
44 Arg(1, NE, 0),
45 Arg(2, LT, sys.maxsize))
46 f.add_rule(ALLOW, "close")
47 f.add_rule(ALLOW, "rt_sigreturn")
4848 return f
4949
5050 args = util.get_opt()
66
77 test type: bpf-sim
88
9 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 04-sim-multilevel_chains all open 0x856B008 4 N N N N ALLOW
11 04-sim-multilevel_chains all close 4 N N N N N ALLOW
12 04-sim-multilevel_chains x86 read 0 0x856B008 0x7FFFFFFE N N N ALLOW
13 04-sim-multilevel_chains x86_64 read 0 0x856B008 0x7FFFFFFFFFFFFFFE N N N ALLOW
14 04-sim-multilevel_chains x86 read 0 0x856B008 0x7FFFFFFF N N N KILL
15 04-sim-multilevel_chains x86_64 read 0 0x856B008 0x7FFFFFFFFFFFFFFF N N N KILL
16 04-sim-multilevel_chains x86 read 0 0 0x7FFFFFFE N N N KILL
17 04-sim-multilevel_chains x86_64 read 0 0 0x7FFFFFFFFFFFFFFE N N N KILL
18 04-sim-multilevel_chains all read 1-10 0x856B008 0x7FFFFFFE N N N KILL
19 04-sim-multilevel_chains x86 write 1-2 0x856B008 0x7FFFFFFE N N N ALLOW
20 04-sim-multilevel_chains x86_64 write 1-2 0x856B008 0x7FFFFFFFFFFFFFFE N N N ALLOW
21 04-sim-multilevel_chains x86 write 1-2 0 0x7FFFFFFE N N N KILL
22 04-sim-multilevel_chains x86_64 write 1-2 0 0x7FFFFFFFFFFFFFFE N N N KILL
23 04-sim-multilevel_chains x86 write 1-2 0x856B008 0x7FFFFFFF N N N KILL
24 04-sim-multilevel_chains x86_64 write 1-2 0x856B008 0x7FFFFFFFFFFFFFFF N N N KILL
25 04-sim-multilevel_chains all write 3-10 0x856B008 0x7FFFFFFE N N N KILL
26 04-sim-multilevel_chains all rt_sigreturn N N N N N N ALLOW
27 04-sim-multilevel_chains x86 0-2 N N N N N N KILL
28 04-sim-multilevel_chains x86 7-172 N N N N N N KILL
29 04-sim-multilevel_chains x86 174-350 N N N N N N KILL
30 04-sim-multilevel_chains x86_64 4-14 N N N N N N KILL
31 04-sim-multilevel_chains x86_64 16-350 N N N N N N KILL
9 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 04-sim-multilevel_chains all,-aarch64 open 0x856B008 4 N N N N ALLOW
11 04-sim-multilevel_chains all close 4 N N N N N ALLOW
12 04-sim-multilevel_chains x86 read 0 0x856B008 0x7FFFFFFE N N N ALLOW
13 04-sim-multilevel_chains x86_64 read 0 0x856B008 0x7FFFFFFFFFFFFFFE N N N ALLOW
14 04-sim-multilevel_chains x86 read 0 0x856B008 0x7FFFFFFF N N N KILL
15 04-sim-multilevel_chains x86_64 read 0 0x856B008 0x7FFFFFFFFFFFFFFF N N N KILL
16 04-sim-multilevel_chains x86 read 0 0 0x7FFFFFFE N N N KILL
17 04-sim-multilevel_chains x86_64 read 0 0 0x7FFFFFFFFFFFFFFE N N N KILL
18 04-sim-multilevel_chains all read 1-10 0x856B008 0x7FFFFFFE N N N KILL
19 04-sim-multilevel_chains x86 write 1-2 0x856B008 0x7FFFFFFE N N N ALLOW
20 04-sim-multilevel_chains x86_64 write 1-2 0x856B008 0x7FFFFFFFFFFFFFFE N N N ALLOW
21 04-sim-multilevel_chains x86 write 1-2 0 0x7FFFFFFE N N N KILL
22 04-sim-multilevel_chains x86_64 write 1-2 0 0x7FFFFFFFFFFFFFFE N N N KILL
23 04-sim-multilevel_chains x86 write 1-2 0x856B008 0x7FFFFFFF N N N KILL
24 04-sim-multilevel_chains x86_64 write 1-2 0x856B008 0x7FFFFFFFFFFFFFFF N N N KILL
25 04-sim-multilevel_chains all write 3-10 0x856B008 0x7FFFFFFE N N N KILL
26 04-sim-multilevel_chains all rt_sigreturn N N N N N N ALLOW
27 04-sim-multilevel_chains x86 0-2 N N N N N N KILL
28 04-sim-multilevel_chains x86 7-172 N N N N N N KILL
29 04-sim-multilevel_chains x86 174-350 N N N N N N KILL
30 04-sim-multilevel_chains x86_64 4-14 N N N N N N KILL
31 04-sim-multilevel_chains x86_64 16-350 N N N N N N KILL
3232
3333 test type: bpf-sim-fuzz
3434
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223 #include <limits.h>
2324
3031 int rc;
3132 int iter;
3233 struct util_options opts;
33 scmp_filter_ctx ctx;
34 scmp_filter_ctx ctx = NULL;
3435
3536 rc = util_getopt(argc, argv, &opts);
3637 if (rc < 0)
3839
3940 ctx = seccomp_init(SCMP_ACT_KILL);
4041 if (ctx == NULL)
41 goto out;
42 return ENOMEM;
4243
4344 /* NOTE - syscalls referenced by number to make the test simpler */
4445
2929 {
3030 int rc;
3131 struct util_options opts;
32 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3333
3434 rc = util_getopt(argc, argv, &opts);
3535 if (rc < 0)
3737
3838 ctx = seccomp_init(SCMP_ACT_KILL);
3939 if (ctx == NULL)
40 goto out;
40 return ENOMEM;
4141
42 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0);
42 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0);
4343 if (rc != 0)
4444 goto out;
4545
46 rc = seccomp_rule_add_exact(ctx,
47 SCMP_ACT_ERRNO(EPERM), SCMP_SYS(write), 0);
46 rc = seccomp_rule_add(ctx, SCMP_ACT_ERRNO(EPERM), SCMP_SYS(write), 0);
4847 if (rc != 0)
4948 goto out;
5049
51 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_TRAP, SCMP_SYS(close), 0);
50 rc = seccomp_rule_add(ctx, SCMP_ACT_TRAP, SCMP_SYS(close), 0);
5251 if (rc != 0)
5352 goto out;
5453
55 rc = seccomp_rule_add_exact(ctx,
56 SCMP_ACT_TRACE(1234), SCMP_SYS(open), 0);
54 rc = seccomp_rule_add(ctx, SCMP_ACT_TRACE(1234), SCMP_SYS(open), 0);
5755 if (rc != 0)
5856 goto out;
5957
66
77 test type: bpf-sim
88
9 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 06-sim-actions all read 4 0x856B008 80 N N N ALLOW
11 06-sim-actions all write 1 0x856B008 N N N N ERRNO(1)
12 06-sim-actions all close 4 N N N N N TRAP
13 06-sim-actions all open 0x856B008 4 N N N N TRACE(1234)
14 06-sim-actions x86 0-2 N N N N N N KILL
15 06-sim-actions x86 7-350 N N N N N N KILL
16 06-sim-actions x86_64 4-350 N N N N N N KILL
9 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 06-sim-actions all read 4 0x856B008 80 N N N ALLOW
11 06-sim-actions all write 1 0x856B008 N N N N ERRNO(1)
12 06-sim-actions all close 4 N N N N N TRAP
13 06-sim-actions all,-aarch64 open 0x856B008 4 N N N N TRACE(1234)
14 06-sim-actions x86 0-2 N N N N N N KILL
15 06-sim-actions x86 7-350 N N N N N N KILL
16 06-sim-actions x86_64 4-350 N N N N N N KILL
1717
1818 test type: bpf-sim-fuzz
1919
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 /* The next three seccomp_rule_add_exact() calls for read must
4243 * go together in this order to catch an infinite loop. */
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 /* the syscall and argument numbers are all fake to make the test
4243 * simpler */
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 /* the syscall and argument numbers are all fake to make the test
4243 * simpler */
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 /* the syscall and argument numbers are all fake to make the test
4243 * simpler */
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
22 #include <errno.h>
2323
2424 #include <seccomp.h>
2525
8484 rc = seccomp_rule_add(ctx, SCMP_ACT_KILL - 1, SCMP_SYS(read), 0);
8585 if (rc != -EINVAL)
8686 return -1;
87 rc = seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(read), 6);
87 rc = seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(read), 7);
8888 if (rc != -EINVAL)
8989 return -1;
9090 rc = seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(read), 7,
116116 ctx = seccomp_init(SCMP_ACT_ALLOW);
117117 if (ctx == NULL)
118118 return -1;
119 if (seccomp_arch_native() != SCMP_ARCH_X86) {
120 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
121 if (rc != 0)
122 return -1;
123 rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
124 if (rc != 0)
125 return -1;
126 }
119 rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
120 if (rc != 0)
121 return -1;
122 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
123 if (rc != 0)
124 return -1;
127125 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, SCMP_SYS(socket), 1,
128126 SCMP_A0(SCMP_CMP_EQ, 2));
129127 if (rc != -EINVAL)
7373 pass
7474
7575 f = SyscallFilter(ALLOW)
76 if not f.exist_arch(Arch.X86):
77 f.add_arch(Arch.X86)
78 f.remove_arch(Arch.NATIVE)
76 f.remove_arch(Arch())
77 f.add_arch(Arch("x86"))
7978 try:
8079 f.add_rule_exactly(KILL, "socket", Arg(0, EQ, 2))
8180 except RuntimeError:
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 /* the syscall and argument numbers are all fake to make the test
4243 * simpler */
66
77 test type: bpf-sim
88
9 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 12-sim-basic_masked_ops all 1000 0 1 2 N N N ALLOW
11 12-sim-basic_masked_ops all 1000 0 0x01 2 N N N ALLOW
12 12-sim-basic_masked_ops all 1000 0 0x02-0x0A 2 N N N KILL
13 12-sim-basic_masked_ops all 1000 0 0x101 2 N N N ALLOW
14 12-sim-basic_masked_ops all 1000 0 11 2 N N N ALLOW
15 12-sim-basic_masked_ops all 1000 0 0x0B 2 N N N ALLOW
16 12-sim-basic_masked_ops all 1000 0 0x0C-0x6E 2 N N N KILL
17 12-sim-basic_masked_ops all 1000 0 0x1000B 2 N N N ALLOW
18 12-sim-basic_masked_ops all 1000 0 111 2 N N N ALLOW
19 12-sim-basic_masked_ops all 1000 0 0x6F 2 N N N ALLOW
20 12-sim-basic_masked_ops all 1000 0 0x70-0x100 2 N N N KILL
21 12-sim-basic_masked_ops all 1000 0 0x102-0x200 2 N N N KILL
22 12-sim-basic_masked_ops all 1000 0 0x10002-0x1000A 2 N N N KILL
23 12-sim-basic_masked_ops all 1000 0 0x1000C-0x1006E 2 N N N KILL
24 12-sim-basic_masked_ops all 1000 0 0x1006F 2 N N N ALLOW
25 12-sim-basic_masked_ops all 1000 0 1000 2 N N N ALLOW
26 12-sim-basic_masked_ops all 1000 0 0x3E8 2 N N N ALLOW
27 12-sim-basic_masked_ops all 1000 0 0x2FF 2 N N N KILL
28 12-sim-basic_masked_ops all 1000 0 0x300-0x3FF 2 N N N ALLOW
29 12-sim-basic_masked_ops all 1000 0 0x400 2 N N N KILL
30 12-sim-basic_masked_ops all 1000 0 0x402-0x4FF 2 N N N KILL
31 12-sim-basic_masked_ops all 1000 0 0x10300-0x103FF 2 N N N ALLOW
9 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 12-sim-basic_masked_ops all 1000 0 1 2 N N N ALLOW
11 12-sim-basic_masked_ops all 1000 0 0x01 2 N N N ALLOW
12 12-sim-basic_masked_ops all 1000 0 0x02-0x0A 2 N N N KILL
13 12-sim-basic_masked_ops all 1000 0 0x101 2 N N N ALLOW
14 12-sim-basic_masked_ops all 1000 0 11 2 N N N ALLOW
15 12-sim-basic_masked_ops all 1000 0 0x0B 2 N N N ALLOW
16 12-sim-basic_masked_ops all 1000 0 0x0C-0x6E 2 N N N KILL
17 12-sim-basic_masked_ops all 1000 0 0x1000B 2 N N N ALLOW
18 12-sim-basic_masked_ops all 1000 0 111 2 N N N ALLOW
19 12-sim-basic_masked_ops all 1000 0 0x6F 2 N N N ALLOW
20 12-sim-basic_masked_ops all 1000 0 0x70-0x100 2 N N N KILL
21 12-sim-basic_masked_ops all 1000 0 0x102-0x200 2 N N N KILL
22 12-sim-basic_masked_ops all 1000 0 0x10002-0x1000A 2 N N N KILL
23 12-sim-basic_masked_ops all 1000 0 0x1000C-0x1006E 2 N N N KILL
24 12-sim-basic_masked_ops all 1000 0 0x1006F 2 N N N ALLOW
25 12-sim-basic_masked_ops all 1000 0 1000 2 N N N ALLOW
26 12-sim-basic_masked_ops all 1000 0 0x3E8 2 N N N ALLOW
27 12-sim-basic_masked_ops all 1000 0 0x2FF 2 N N N KILL
28 12-sim-basic_masked_ops all 1000 0 0x300-0x3FF 2 N N N ALLOW
29 12-sim-basic_masked_ops all 1000 0 0x400 2 N N N KILL
30 12-sim-basic_masked_ops all 1000 0 0x402-0x4FF 2 N N N KILL
31 12-sim-basic_masked_ops all 1000 0 0x10300-0x103FF 2 N N N ALLOW
32 12-sim-basic_masked_ops all 1000 0 0x00000000F00003E8 2 N N N ALLOW
33 12-sim-basic_masked_ops all 1000 0 0x00000000800003E8 2 N N N ALLOW
34 12-sim-basic_masked_ops all 1000 0 0x00000001800003E8 2 N N N ALLOW
35 12-sim-basic_masked_ops all 1000 0 0x00000001000003E8 2 N N N ALLOW
36 12-sim-basic_masked_ops all 1000 0 0x0000000F000003E8 2 N N N ALLOW
37 # NOTE: disabling the test below due to problems on 32-bit ARM relating to the
38 # shell utilities, see the thread below
39 # -> https://groups.google.com/forum/#!topic/libseccomp/VtrClkXxLGA
40 #12-sim-basic_masked_ops all 1000 0 0xFFFFFFFFFFFF03E8 2 N N N ALLOW
3241
3342 test type: bpf-sim-fuzz
3443
2929 {
3030 int rc;
3131 uint32_t val = (uint32_t)(-1);
32 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3333
3434 ctx = seccomp_init(SCMP_ACT_ALLOW);
3535 if (ctx == NULL)
36 goto out;
36 return ENOMEM;
3737
3838 rc = seccomp_attr_get(ctx, SCMP_FLTATR_ACT_DEFAULT, &val);
3939 if (rc != 0)
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40
40 return ENOMEM;
4141
4242 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0);
4343 if (rc != 0)
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <string.h>
23 #include <stdlib.h>
2224
2325 #include <seccomp.h>
2426
2527 int main(int argc, char *argv[])
2628 {
27 char *name;
29 char *name = NULL;
2830
2931 if (seccomp_syscall_resolve_name("open") != __NR_open)
30 return 1;
32 goto fail;
3133 if (seccomp_syscall_resolve_name("socket") != __NR_socket)
32 return 1;
34 goto fail;
3335 if (seccomp_syscall_resolve_name("INVALID") != __NR_SCMP_ERROR)
34 return 1;
36 goto fail;
3537
3638 if (seccomp_syscall_resolve_name_arch(SCMP_ARCH_NATIVE,
3739 "open") != __NR_open)
38 return 1;
40 goto fail;
3941 if (seccomp_syscall_resolve_name_arch(SCMP_ARCH_NATIVE,
4042 "socket") != __NR_socket)
41 return 1;
43 goto fail;
4244 if (seccomp_syscall_resolve_name_arch(SCMP_ARCH_NATIVE,
4345 "INVALID") != __NR_SCMP_ERROR)
44 return 1;
46 goto fail;
4547
4648 name = seccomp_syscall_resolve_num_arch(SCMP_ARCH_NATIVE, __NR_open);
4749 if (name == NULL || strcmp(name, "open") != 0)
48 return 1;
50 goto fail;
51 free(name);
52
4953 name = seccomp_syscall_resolve_num_arch(SCMP_ARCH_NATIVE, __NR_socket);
5054 if (name == NULL || strcmp(name, "socket") != 0)
51 return 1;
55 goto fail;
56 free(name);
57
5258 name = seccomp_syscall_resolve_num_arch(SCMP_ARCH_NATIVE,
5359 __NR_SCMP_ERROR);
5460 if (name != NULL)
55 return 1;
61 goto fail;
62 free(name);
5663
5764 return 0;
65
66 fail:
67 if (name != NULL)
68 free(name);
69 return 1;
5870 }
3838 except RuntimeError:
3939 pass
4040
41 sys_num = resolve_syscall(Arch.NATIVE, "open")
42 sys_name = resolve_syscall(Arch.NATIVE, sys_num)
41 sys_num = resolve_syscall(Arch(), "open")
42 sys_name = resolve_syscall(Arch(), sys_num)
4343 if (sys_name != "open"):
4444 raise RuntimeError("Test failure")
45 sys_num = resolve_syscall(Arch.NATIVE, "socket")
46 sys_name = resolve_syscall(Arch.NATIVE, sys_num)
45 sys_num = resolve_syscall(Arch(), "socket")
46 sys_name = resolve_syscall(Arch(), sys_num)
4747 if (sys_name != "socket"):
4848 raise RuntimeError("Test failure")
4949
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
22 #include <errno.h>
2323
2424 #include <seccomp.h>
2525
2929 {
3030 int rc;
3131 struct util_options opts;
32 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3333
3434 rc = util_getopt(argc, argv, &opts);
3535 if (rc < 0)
3737
3838 ctx = seccomp_init(SCMP_ACT_KILL);
3939 if (ctx == NULL)
40 return ENOMEM;
41
42 rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
43 if (rc != 0)
4044 goto out;
4145
42 if (seccomp_arch_exist(ctx, SCMP_ARCH_X86)) {
43 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
44 if (rc != 0)
45 goto out;
46 }
47 if (seccomp_arch_exist(ctx, SCMP_ARCH_X86_64)) {
48 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64);
49 if (rc != 0)
50 goto out;
51 }
52 if (seccomp_arch_exist(ctx, SCMP_ARCH_X32)) {
53 rc = seccomp_arch_add(ctx, SCMP_ARCH_X32);
54 if (rc != 0)
55 goto out;
56 }
57 if (seccomp_arch_exist(ctx, SCMP_ARCH_ARM)) {
58 rc = seccomp_arch_add(ctx, SCMP_ARCH_ARM);
59 if (rc != 0)
60 goto out;
61 }
46 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
47 if (rc != 0)
48 goto out;
49 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64);
50 if (rc != 0)
51 goto out;
52 rc = seccomp_arch_add(ctx, SCMP_ARCH_X32);
53 if (rc != 0)
54 goto out;
55 rc = seccomp_arch_add(ctx, SCMP_ARCH_ARM);
56 if (rc != 0)
57 goto out;
58 rc = seccomp_arch_add(ctx, SCMP_ARCH_AARCH64);
59 if (rc != 0)
60 goto out;
61 rc = seccomp_arch_add(ctx, SCMP_ARCH_MIPSEL);
62 if (rc != 0)
63 goto out;
64 rc = seccomp_arch_add(ctx, SCMP_ARCH_MIPSEL64);
65 if (rc != 0)
66 goto out;
67 rc = seccomp_arch_add(ctx, SCMP_ARCH_MIPSEL64N32);
68 if (rc != 0)
69 goto out;
6270
6371 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
6472 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
2929
3030 def test(args):
3131 f = SyscallFilter(KILL)
32 if not f.exist_arch(Arch.X86):
33 f.add_arch(Arch.X86)
34 if not f.exist_arch(Arch.X86_64):
35 f.add_arch(Arch.X86_64)
36 if not f.exist_arch(Arch.X32):
37 f.add_arch(Arch.X32)
38 if not f.exist_arch(Arch.ARM):
39 f.add_arch(Arch.ARM)
32 f.remove_arch(Arch())
33 f.add_arch(Arch("x86"))
34 f.add_arch(Arch("x86_64"))
35 f.add_arch(Arch("x32"))
36 f.add_arch(Arch("arm"))
37 f.add_arch(Arch("aarch64"))
38 f.add_arch(Arch("mipsel"))
39 f.add_arch(Arch("mipsel64"))
40 f.add_arch(Arch("mipsel64n32"))
4041 f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
4142 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
4243 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
77 test type: bpf-sim
88
99 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 16-sim-arch_basic +all read 0 0x856B008 10 N N N ALLOW
11 16-sim-arch_basic +all read 1-10 0x856B008 10 N N N KILL
12 16-sim-arch_basic +all write 1-2 0x856B008 10 N N N ALLOW
13 16-sim-arch_basic +all write 3-10 0x856B008 10 N N N KILL
14 16-sim-arch_basic +all close N N N N N N ALLOW
15 16-sim-arch_basic +all open 0x856B008 4 N N N N KILL
10 16-sim-arch_basic +all_le read 0 0x856B008 10 N N N ALLOW
11 16-sim-arch_basic +all_le read 1-10 0x856B008 10 N N N KILL
12 16-sim-arch_basic +all_le write 1-2 0x856B008 10 N N N ALLOW
13 16-sim-arch_basic +all_le write 3-10 0x856B008 10 N N N KILL
14 16-sim-arch_basic +all_le close N N N N N N ALLOW
15 16-sim-arch_basic +all_le open 0x856B008 4 N N N N KILL
1616 16-sim-arch_basic +x86 socket 1 N N N N N ALLOW
1717 16-sim-arch_basic +x86 connect 3 N N N N N ALLOW
1818 16-sim-arch_basic +x86 shutdown 13 N N N N N ALLOW
2020 16-sim-arch_basic +x86_64 connect 0 1 2 N N N ALLOW
2121 16-sim-arch_basic +x86_64 shutdown 0 1 2 N N N ALLOW
2222
23 test type: bpf-sim-fuzz
24
25 # Testname StressCount
26 16-sim-arch_basic 50
27
2823 test type: bpf-valgrind
2924
3025 # Testname
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
22 #include <errno.h>
2323
2424 #include <seccomp.h>
2525
2929 {
3030 int rc;
3131 struct util_options opts;
32 scmp_filter_ctx ctx_64, ctx_32;
32 scmp_filter_ctx ctx_64 = NULL, ctx_32 = NULL;
3333
3434 rc = util_getopt(argc, argv, &opts);
3535 if (rc < 0)
3636 goto out_all;
3737
3838 ctx_32 = seccomp_init(SCMP_ACT_KILL);
39 if (ctx_32 == NULL)
39 if (ctx_32 == NULL) {
40 rc = -ENOMEM;
4041 goto out_all;
42 }
4143 ctx_64 = seccomp_init(SCMP_ACT_KILL);
42 if (ctx_64 == NULL)
44 if (ctx_64 == NULL) {
45 rc = -ENOMEM;
4346 goto out_all;
47 }
4448
45 if (seccomp_arch_exist(ctx_32, SCMP_ARCH_X86) == -EEXIST) {
46 rc = seccomp_arch_add(ctx_32, SCMP_ARCH_X86);
47 if (rc != 0)
48 goto out_all;
49 rc = seccomp_arch_remove(ctx_32, SCMP_ARCH_NATIVE);
50 if (rc != 0)
51 goto out_all;
52 }
53 if (seccomp_arch_exist(ctx_64, SCMP_ARCH_X86_64) == -EEXIST) {
54 rc = seccomp_arch_add(ctx_64, SCMP_ARCH_X86_64);
55 if (rc != 0)
56 goto out_all;
57 rc = seccomp_arch_remove(ctx_64, SCMP_ARCH_NATIVE);
58 if (rc != 0)
59 goto out_all;
60 }
49 rc = seccomp_arch_remove(ctx_32, SCMP_ARCH_NATIVE);
50 if (rc != 0)
51 goto out;
52 rc = seccomp_arch_remove(ctx_64, SCMP_ARCH_NATIVE);
53 if (rc != 0)
54 goto out;
55
56 rc = seccomp_arch_add(ctx_32, SCMP_ARCH_X86);
57 if (rc != 0)
58 goto out_all;
59 rc = seccomp_arch_add(ctx_64, SCMP_ARCH_X86_64);
60 if (rc != 0)
61 goto out_all;
6162
6263 rc = seccomp_rule_add(ctx_32, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
6364 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
3030 def test(args):
3131 f32 = SyscallFilter(KILL)
3232 f64 = SyscallFilter(KILL)
33 if not f32.exist_arch(Arch.X86):
34 f32.add_arch(Arch.X86)
35 f32.remove_arch(Arch.NATIVE)
36 if not f64.exist_arch(Arch.X86_64):
37 f64.add_arch(Arch.X86_64)
38 f64.remove_arch(Arch.NATIVE)
33 f32.remove_arch(Arch())
34 f64.remove_arch(Arch())
35 f32.add_arch(Arch("x86"))
36 f64.add_arch(Arch("x86_64"))
3937 f32.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
4038 f32.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
4139 f32.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
1717 17-sim-arch_merge +x86_64 connect 0 1 2 N N N ALLOW
1818 17-sim-arch_merge +x86_64 shutdown 0 1 2 N N N ALLOW
1919
20 test type: bpf-sim-fuzz
21
22 # Testname StressCount
23 17-sim-arch_merge 50
24
2520 test type: bpf-valgrind
2621
2722 # Testname
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_ALLOW);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, SCMP_SYS(read), 1,
4243 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
2929
3030 def test(args):
3131 f = SyscallFilter(ALLOW)
32 f.add_rule_exactly(KILL, "read", Arg(0, EQ, sys.stdin.fileno()));
33 f.add_rule_exactly(KILL, "write", Arg(0, EQ, sys.stdout.fileno()));
34 f.add_rule_exactly(KILL, "write", Arg(0, EQ, sys.stderr.fileno()));
35 f.add_rule_exactly(KILL, "close");
36 f.add_rule_exactly(KILL, "rt_sigreturn");
32 f.add_rule_exactly(KILL, "read", Arg(0, EQ, sys.stdin.fileno()))
33 f.add_rule_exactly(KILL, "write", Arg(0, EQ, sys.stdout.fileno()))
34 f.add_rule_exactly(KILL, "write", Arg(0, EQ, sys.stderr.fileno()))
35 f.add_rule_exactly(KILL, "close")
36 f.add_rule_exactly(KILL, "rt_sigreturn")
3737 return f
3838
3939 args = util.get_opt()
2929 {
3030 int rc;
3131 struct util_options opts;
32 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3333
3434 rc = util_getopt(argc, argv, &opts);
3535 if (rc < 0)
3737
3838 ctx = seccomp_init(SCMP_ACT_KILL);
3939 if (ctx == NULL)
40 return ENOMEM;
41
42 rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
43 if (rc != 0)
4044 goto out;
4145
42 if (seccomp_arch_native() != SCMP_ARCH_X86) {
43 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
44 if (rc != 0)
45 goto out;
46 rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
47 if (rc != 0)
48 goto out;
49 }
46 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
47 if (rc != 0)
48 goto out;
5049
5150 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(tuxcall), 0);
5251 if (rc != 0)
2929
3030 def test(args):
3131 f = SyscallFilter(KILL)
32 if not system_arch() == Arch.X86:
33 f.add_arch(Arch.X86)
34 f.remove_arch(Arch.NATIVE)
32 f.remove_arch(Arch())
33 f.add_arch(Arch("x86"))
3534 f.add_rule(ALLOW, "tuxcall")
3635 try:
3736 f.add_rule_exactly(ALLOW, "tuxcall")
99 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
1010 19-sim-missing_syscalls +x86 0-350 N N N N N N KILL
1111
12 test type: bpf-sim-fuzz
13
14 # Testname StressCount
15 19-sim-missing_syscalls 50
16
1712 test type: bpf-valgrind
1813
1914 # Testname
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 int action;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_action_parse(argv[1]);
3435 if (rc == -1)
4344
4445 ctx = seccomp_init(action);
4546 if (ctx == NULL)
46 goto out;
47 rc = seccomp_rule_add_exact(ctx,
48 SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
47 return ENOMEM;
48
49 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
4950 if (rc != 0)
5051 goto out;
51 rc = seccomp_rule_add_exact(ctx,
52 SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
52 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
5353 if (rc != 0)
5454 goto out;
55
5556 rc = seccomp_load(ctx);
5657 if (rc != 0)
5758 goto out;
3232 if action == TRAP:
3333 util.install_trap()
3434 f = SyscallFilter(action)
35 f.add_rule_exactly(ALLOW, "rt_sigreturn")
36 f.add_rule_exactly(ALLOW, "exit_group")
35 f.add_rule(ALLOW, "rt_sigreturn")
36 f.add_rule(ALLOW, "exit_group")
3737 f.load()
3838 try:
3939 util.write_file("/dev/null")
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <unistd.h>
2223
2324 #include <seccomp.h>
2728 int main(int argc, char *argv[])
2829 {
2930 int rc;
30 scmp_filter_ctx ctx;
31 scmp_filter_ctx ctx = NULL;
3132
3233 rc = util_action_parse(argv[1]);
3334 if (rc != SCMP_ACT_ALLOW) {
4142
4243 ctx = seccomp_init(SCMP_ACT_TRAP);
4344 if (ctx == NULL)
44 goto out;
45 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
45 return ENOMEM;
46
47 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
4648 if (rc != 0)
4749 goto out;
48 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 0);
50 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(openat), 0);
4951 if (rc != 0)
5052 goto out;
51 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
53 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 0);
5254 if (rc != 0)
5355 goto out;
54 rc = seccomp_rule_add_exact(ctx,
55 SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
56 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
5657 if (rc != 0)
5758 goto out;
58 rc = seccomp_rule_add_exact(ctx,
59 SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
59 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
6060 if (rc != 0)
6161 goto out;
62 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
63 if (rc != 0)
64 goto out;
65
6266 rc = seccomp_load(ctx);
6367 if (rc != 0)
6468 goto out;
3434 util.install_trap()
3535 f = SyscallFilter(TRAP)
3636 # NOTE: additional syscalls required for python
37 f.add_rule_exactly(ALLOW, "stat")
38 f.add_rule_exactly(ALLOW, "fstat")
39 f.add_rule_exactly(ALLOW, "open")
40 f.add_rule_exactly(ALLOW, "mmap")
41 f.add_rule_exactly(ALLOW, "munmap")
42 f.add_rule_exactly(ALLOW, "read")
43 f.add_rule_exactly(ALLOW, "write")
44 f.add_rule_exactly(ALLOW, "close")
45 f.add_rule_exactly(ALLOW, "rt_sigaction")
46 f.add_rule_exactly(ALLOW, "rt_sigreturn")
47 f.add_rule_exactly(ALLOW, "exit_group")
37 f.add_rule(ALLOW, "stat")
38 f.add_rule(ALLOW, "fstat")
39 f.add_rule(ALLOW, "open")
40 f.add_rule(ALLOW, "openat")
41 f.add_rule(ALLOW, "mmap")
42 f.add_rule(ALLOW, "munmap")
43 f.add_rule(ALLOW, "read")
44 f.add_rule(ALLOW, "write")
45 f.add_rule(ALLOW, "close")
46 f.add_rule(ALLOW, "rt_sigaction")
47 f.add_rule(ALLOW, "rt_sigreturn")
48 f.add_rule(ALLOW, "exit_group")
4849 f.load()
4950 try:
5051 util.write_file("/dev/null")
1717 * along with this library; if not, see <http://www.gnu.org/licenses>.
1818 */
1919
20 #include <errno.h>
2021 #include <unistd.h>
2122
2223 #include <seccomp.h>
2728 {
2829 int rc;
2930 struct util_options opts;
30 scmp_filter_ctx ctx;
31 scmp_filter_ctx ctx = NULL;
3132 struct scmp_arg_cmp arg_cmp;
3233
3334 rc = util_getopt(argc, argv, &opts);
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 arg_cmp = SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO);
4243 rc = seccomp_rule_add_exact_array(ctx, SCMP_ACT_ALLOW,
3232
3333 def test(args):
3434 f = SyscallFilter(KILL)
35 f.add_rule_exactly(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()));
36 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()));
37 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()));
38 f.add_rule_exactly(ALLOW, "close");
39 f.add_rule_exactly(ALLOW, "rt_sigreturn");
35 f.add_rule_exactly(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
36 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
37 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
38 f.add_rule_exactly(ALLOW, "close")
39 f.add_rule_exactly(ALLOW, "rt_sigreturn")
4040 return f
4141
4242 args = util.get_opt()
+0
-93
tests/23-sim-arch_all_basic.c less more
0 /**
1 * Seccomp Library test program
2 *
3 * Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.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 #include <unistd.h>
22
23 #include <seccomp.h>
24
25 #include "util.h"
26
27 int main(int argc, char *argv[])
28 {
29 int rc;
30 struct util_options opts;
31 scmp_filter_ctx ctx;
32
33 rc = util_getopt(argc, argv, &opts);
34 if (rc < 0)
35 goto out;
36
37 ctx = seccomp_init(SCMP_ACT_KILL);
38 if (ctx == NULL)
39 goto out;
40
41 if (seccomp_arch_exist(ctx, SCMP_ARCH_X86)) {
42 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
43 if (rc != 0)
44 goto out;
45 }
46 if (seccomp_arch_exist(ctx, SCMP_ARCH_X86_64)) {
47 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64);
48 if (rc != 0)
49 goto out;
50 }
51 if (seccomp_arch_exist(ctx, SCMP_ARCH_X32)) {
52 rc = seccomp_arch_add(ctx, SCMP_ARCH_X32);
53 if (rc != 0)
54 goto out;
55 }
56 if (seccomp_arch_exist(ctx, SCMP_ARCH_ARM)) {
57 rc = seccomp_arch_add(ctx, SCMP_ARCH_ARM);
58 if (rc != 0)
59 goto out;
60 }
61
62 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
63 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
64 if (rc != 0)
65 goto out;
66
67 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
68 SCMP_A0(SCMP_CMP_EQ, STDOUT_FILENO));
69 if (rc != 0)
70 goto out;
71
72 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
73 SCMP_A0(SCMP_CMP_EQ, STDERR_FILENO));
74 if (rc != 0)
75 goto out;
76
77 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
78 if (rc != 0)
79 goto out;
80
81 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
82 if (rc != 0)
83 goto out;
84
85 rc = util_filter_output(&opts, ctx);
86 if (rc)
87 goto out;
88
89 out:
90 seccomp_release(ctx);
91 return (rc < 0 ? -rc : rc);
92 }
+0
-53
tests/23-sim-arch_all_basic.py less more
0 #!/usr/bin/env python
1
2 #
3 # Seccomp Library test program
4 #
5 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
6 # Author: Paul Moore <pmoore@redhat.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 if not f.exist_arch(Arch.X86):
33 f.add_arch(Arch.X86)
34 if not f.exist_arch(Arch.X86_64):
35 f.add_arch(Arch.X86_64)
36 if not f.exist_arch(Arch.X32):
37 f.add_arch(Arch.X32)
38 if not f.exist_arch(Arch.ARM):
39 f.add_arch(Arch.ARM)
40 f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
41 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
42 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
43 f.add_rule(ALLOW, "close")
44 f.add_rule(ALLOW, "rt_sigreturn")
45 return f
46
47 args = util.get_opt()
48 ctx = test(args)
49 util.filter_output(args, ctx)
50
51 # kate: syntax python;
52 # kate: indent-mode python; space-indent on; indent-width 4; mixedindent off;
+0
-28
tests/23-sim-arch_all_basic.tests less more
0 #
1 # libseccomp regression test automation data
2 #
3 #
4 # Copyright (c) 2013 Red Hat <pmoore@redhat.com>
5 # Author: Paul Moore <pmoore@redhat.com
6 #
7
8 test type: bpf-sim
9
10 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
11 23-sim-arch_all_basic +all read 0 0x856B008 10 N N N ALLOW
12 23-sim-arch_all_basic +all read 1-10 0x856B008 10 N N N KILL
13 23-sim-arch_all_basic +all write 1-2 0x856B008 10 N N N ALLOW
14 23-sim-arch_all_basic +all write 3-10 0x856B008 10 N N N KILL
15 23-sim-arch_all_basic +all close N N N N N N ALLOW
16 23-sim-arch_all_basic +all rt_sigreturn N N N N N N ALLOW
17 23-sim-arch_all_basic +all open 0x856B008 4 N N N N KILL
18
19 test type: bpf-sim-fuzz
20
21 # Testname StressCount
22 23-sim-arch_all_basic 50
23
24 test type: bpf-valgrind
25
26 # Testname
27 23-sim-arch_all_basic
0 /**
1 * Seccomp Library test program
2 *
3 * Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.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 #include <errno.h>
22 #include <unistd.h>
23
24 #include <seccomp.h>
25
26 #include "util.h"
27
28 int main(int argc, char *argv[])
29 {
30 int rc;
31 struct util_options opts;
32 scmp_filter_ctx ctx = NULL;
33
34 rc = util_getopt(argc, argv, &opts);
35 if (rc < 0)
36 goto out;
37
38 ctx = seccomp_init(SCMP_ACT_KILL);
39 if (ctx == NULL)
40 return ENOMEM;
41
42 rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
43 if (rc != 0)
44 goto out;
45
46 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("x86"));
47 if (rc != 0)
48 goto out;
49 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("x86_64"));
50 if (rc != 0)
51 goto out;
52 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("x32"));
53 if (rc != 0)
54 goto out;
55 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("arm"));
56 if (rc != 0)
57 goto out;
58 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("aarch64"));
59 if (rc != 0)
60 goto out;
61 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mipsel"));
62 if (rc != 0)
63 goto out;
64 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mipsel64"));
65 if (rc != 0)
66 goto out;
67 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mipsel64n32"));
68 if (rc != 0)
69 goto out;
70
71 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
72 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
73 if (rc != 0)
74 goto out;
75
76 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
77 SCMP_A0(SCMP_CMP_EQ, STDOUT_FILENO));
78 if (rc != 0)
79 goto out;
80
81 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
82 SCMP_A0(SCMP_CMP_EQ, STDERR_FILENO));
83 if (rc != 0)
84 goto out;
85
86 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
87 if (rc != 0)
88 goto out;
89
90 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
91 if (rc != 0)
92 goto out;
93
94 rc = util_filter_output(&opts, ctx);
95 if (rc)
96 goto out;
97
98 out:
99 seccomp_release(ctx);
100 return (rc < 0 ? -rc : rc);
101 }
0 #!/usr/bin/env python
1
2 #
3 # Seccomp Library test program
4 #
5 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
6 # Author: Paul Moore <pmoore@redhat.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.add_arch(Arch("x32"))
36 f.add_arch(Arch("arm"))
37 f.add_arch(Arch("aarch64"))
38 f.add_arch(Arch("mipsel"))
39 f.add_arch(Arch("mipsel64"))
40 f.add_arch(Arch("mipsel64n32"))
41 f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
42 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
43 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
44 f.add_rule(ALLOW, "close")
45 f.add_rule(ALLOW, "rt_sigreturn")
46 return f
47
48 args = util.get_opt()
49 ctx = test(args)
50 util.filter_output(args, ctx)
51
52 # kate: syntax python;
53 # kate: indent-mode python; space-indent on; indent-width 4; mixedindent off;
0 #
1 # libseccomp regression test automation data
2 #
3 #
4 # Copyright (c) 2013 Red Hat <pmoore@redhat.com>
5 # Author: Paul Moore <pmoore@redhat.com
6 #
7
8 test type: bpf-sim
9
10 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
11 23-sim-arch_all_le_basic +all_le read 0 0x856B008 10 N N N ALLOW
12 23-sim-arch_all_le_basic +all_le read 1-10 0x856B008 10 N N N KILL
13 23-sim-arch_all_le_basic +all_le write 1-2 0x856B008 10 N N N ALLOW
14 23-sim-arch_all_le_basic +all_le write 3-10 0x856B008 10 N N N KILL
15 23-sim-arch_all_le_basic +all_le close N N N N N N ALLOW
16 23-sim-arch_all_le_basic +all_le rt_sigreturn N N N N N N ALLOW
17 23-sim-arch_all_le_basic +all_le open 0x856B008 4 N N N N KILL
18
19 test type: bpf-valgrind
20
21 # Testname
22 23-sim-arch_all_le_basic
3333 {
3434 int rc;
3535 int fd;
36 scmp_filter_ctx ctx;
36 scmp_filter_ctx ctx = NULL;
3737 const char buf[] = "testing";
3838 ssize_t buf_len = strlen(buf);
3939
5555
5656 ctx = seccomp_init(SCMP_ACT_TRAP);
5757 if (ctx == NULL)
58 goto out;
59 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
60 SCMP_A0(SCMP_CMP_EQ, fd));
58 return ENOMEM;
59
60 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
61 SCMP_A0(SCMP_CMP_EQ, fd));
6162 if (rc != 0)
6263 goto out;
63 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
64 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
6465 if (rc != 0)
6566 goto out;
66 rc = seccomp_rule_add_exact(ctx,
67 SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
67 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
6868 if (rc != 0)
6969 goto out;
70 rc = seccomp_rule_add_exact(ctx,
71 SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
70 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(exit_group), 0);
7271 if (rc != 0)
7372 goto out;
73
7474 rc = seccomp_load(ctx);
7575 if (rc != 0)
7676 goto out;
3838
3939 f = SyscallFilter(TRAP)
4040 # NOTE: additional syscalls required for python
41 f.add_rule_exactly(ALLOW, "write", Arg(0, EQ, fd))
42 f.add_rule_exactly(ALLOW, "close")
43 f.add_rule_exactly(ALLOW, "rt_sigaction")
44 f.add_rule_exactly(ALLOW, "rt_sigreturn")
45 f.add_rule_exactly(ALLOW, "exit_group")
41 f.add_rule(ALLOW, "write", Arg(0, EQ, fd))
42 f.add_rule(ALLOW, "close")
43 f.add_rule(ALLOW, "rt_sigaction")
44 f.add_rule(ALLOW, "rt_sigreturn")
45 f.add_rule(ALLOW, "exit_group")
4646 f.load()
4747
4848 try:
1818 * along with this library; if not, see <http://www.gnu.org/licenses>.
1919 */
2020
21 #include <errno.h>
2122 #include <stdlib.h>
2223
2324 #include <seccomp.h>
2829 {
2930 int rc;
3031 struct util_options opts;
31 scmp_filter_ctx ctx;
32 scmp_filter_ctx ctx = NULL;
3233
3334 rc = util_getopt(argc, argv, &opts);
3435 if (rc < 0)
3637
3738 ctx = seccomp_init(SCMP_ACT_KILL);
3839 if (ctx == NULL)
39 goto out;
40 return ENOMEM;
4041
4142 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_ALLOW, 10, 2,
4243 SCMP_A0(SCMP_CMP_EQ, 11),
3131 f = SyscallFilter(KILL)
3232 f.add_rule_exactly(ALLOW, 10,
3333 Arg(0, EQ, 11),
34 Arg(1, NE, 12));
34 Arg(1, NE, 12))
3535 f.add_rule_exactly(ALLOW, 20,
3636 Arg(0, EQ, 21),
3737 Arg(1, NE, 22),
38 Arg(2, EQ, 23));
38 Arg(2, EQ, 23))
3939 return f
4040
4141 args = util.get_opt()
0 /**
1 * Seccomp Library test program
2 *
3 * Author: Markos Chandras <markos.chandras@imgtec.com>
4 */
5
6 /*
7 * This library is free software; you can redistribute it and/or modify it
8 * under the terms of version 2.1 of the GNU Lesser General Public License as
9 * published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library; if not, see <http://www.gnu.org/licenses>.
18 */
19
20 #include <errno.h>
21 #include <unistd.h>
22
23 #include <seccomp.h>
24
25 #include "util.h"
26
27 int main(int argc, char *argv[])
28 {
29 int rc;
30 struct util_options opts;
31 scmp_filter_ctx ctx = NULL;
32
33 rc = util_getopt(argc, argv, &opts);
34 if (rc < 0)
35 goto out;
36
37 ctx = seccomp_init(SCMP_ACT_KILL);
38 if (ctx == NULL)
39 return ENOMEM;
40
41 rc = seccomp_arch_remove(ctx, SCMP_ARCH_NATIVE);
42 if (rc != 0)
43 goto out;
44
45 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mips"));
46 if (rc != 0)
47 goto out;
48 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mips64"));
49 if (rc != 0)
50 goto out;
51 rc = seccomp_arch_add(ctx, seccomp_arch_resolve_name("mips64n32"));
52 if (rc != 0)
53 goto out;
54
55 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 1,
56 SCMP_A0(SCMP_CMP_EQ, STDIN_FILENO));
57 if (rc != 0)
58 goto out;
59
60 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
61 SCMP_A0(SCMP_CMP_EQ, STDOUT_FILENO));
62 if (rc != 0)
63 goto out;
64
65 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(write), 1,
66 SCMP_A0(SCMP_CMP_EQ, STDERR_FILENO));
67 if (rc != 0)
68 goto out;
69
70 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(close), 0);
71 if (rc != 0)
72 goto out;
73
74 rc = seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(rt_sigreturn), 0);
75 if (rc != 0)
76 goto out;
77
78 rc = util_filter_output(&opts, ctx);
79 if (rc)
80 goto out;
81
82 out:
83 seccomp_release(ctx);
84 return (rc < 0 ? -rc : rc);
85 }
0 #!/usr/bin/env python
1
2 #
3 # Seccomp Library test program
4 #
5 # Author: Markos Chandras <markos.chandras@imgtec.com>
6 #
7
8 #
9 # This library is free software; you can redistribute it and/or modify it
10 # under the terms of version 2.1 of the GNU Lesser General Public License as
11 # published by the Free Software Foundation.
12 #
13 # This library is distributed in the hope that it will be useful, but WITHOUT
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 # for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public License
19 # along with this library; if not, see <http://www.gnu.org/licenses>.
20 #
21
22 import argparse
23 import sys
24
25 import util
26
27 from seccomp import *
28
29 def test(args):
30 f = SyscallFilter(KILL)
31 f.remove_arch(Arch())
32 f.add_arch(Arch("mips"))
33 f.add_arch(Arch("mips64"))
34 f.add_arch(Arch("mips64n32"))
35 f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
36 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
37 f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))
38 f.add_rule(ALLOW, "close")
39 f.add_rule(ALLOW, "rt_sigreturn")
40 return f
41
42 args = util.get_opt()
43 ctx = test(args)
44 util.filter_output(args, ctx)
45
46 # kate: syntax python;
47 # kate: indent-mode python; space-indent on; indent-width 4; mixedindent off;
0 #
1 # libseccomp regression test automation data
2 #
3 # Author: Markos Chandras <markos.chandras@imgtec.com>
4 #
5 # Similar to 23-sim-arch_all_basic but for big-endian architectures
6 #
7
8 test type: bpf-sim
9
10 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
11 26-sim-arch_all_be_basic +all_be read 0 0x856B008 10 N N N ALLOW
12 26-sim-arch_all_be_basic +all_be read 1-10 0x856B008 10 N N N KILL
13 26-sim-arch_all_be_basic +all_be write 1-2 0x856B008 10 N N N ALLOW
14 26-sim-arch_all_be_basic +all_be write 3-10 0x856B008 10 N N N KILL
15 26-sim-arch_all_be_basic +all_be close N N N N N N ALLOW
16 26-sim-arch_all_be_basic +all_be rt_sigreturn N N N N N N ALLOW
17 26-sim-arch_all_be_basic +all_be open 0x856B008 4 N N N N KILL
18
19 test type: bpf-valgrind
20
21 # Testname
22 26-sim-arch_all_be_basic
0 /**
1 * Seccomp Library test program
2 *
3 * Copyright (c) 2015 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.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 #include <errno.h>
22 #include <unistd.h>
23
24 #include <seccomp.h>
25
26 #include "util.h"
27
28 int main(int argc, char *argv[])
29 {
30 int rc;
31 struct util_options opts;
32 scmp_filter_ctx ctx = NULL;
33
34 rc = util_getopt(argc, argv, &opts);
35 if (rc < 0)
36 goto out;
37
38 ctx = seccomp_init(SCMP_ACT_ALLOW);
39 if (ctx == NULL)
40 return ENOMEM;
41
42 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
43 SCMP_A0(SCMP_CMP_EQ, 3));
44 if (rc != 0)
45 goto out;
46 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
47 SCMP_A0(SCMP_CMP_EQ, 4));
48 if (rc != 0)
49 goto out;
50 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
51 SCMP_A0(SCMP_CMP_EQ, 5));
52 if (rc != 0)
53 goto out;
54 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
55 SCMP_A0(SCMP_CMP_EQ, 6));
56 if (rc != 0)
57 goto out;
58 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
59 SCMP_A0(SCMP_CMP_EQ, 7));
60 if (rc != 0)
61 goto out;
62 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
63 SCMP_A0(SCMP_CMP_EQ, 8));
64 if (rc != 0)
65 goto out;
66 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
67 SCMP_A0(SCMP_CMP_EQ, 9));
68 if (rc != 0)
69 goto out;
70 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
71 SCMP_A0(SCMP_CMP_EQ, 11));
72 if (rc != 0)
73 goto out;
74 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
75 SCMP_A0(SCMP_CMP_EQ, 12));
76 if (rc != 0)
77 goto out;
78 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
79 SCMP_A0(SCMP_CMP_EQ, 13));
80 if (rc != 0)
81 goto out;
82 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
83 SCMP_A0(SCMP_CMP_EQ, 14));
84 if (rc != 0)
85 goto out;
86 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
87 SCMP_A0(SCMP_CMP_EQ, 15));
88 if (rc != 0)
89 goto out;
90 rc = seccomp_rule_add_exact(ctx, SCMP_ACT_KILL, 1000, 1,
91 SCMP_A0(SCMP_CMP_GE, 16));
92 if (rc != 0)
93 goto out;
94
95 rc = util_filter_output(&opts, ctx);
96 if (rc)
97 goto out;
98
99 out:
100 seccomp_release(ctx);
101 return (rc < 0 ? -rc : rc);
102 }
0 #!/usr/bin/env python
1
2 #
3 # Seccomp Library test program
4 #
5 # Copyright (c) 2015 Red Hat <pmoore@redhat.com>
6 # Author: Paul Moore <pmoore@redhat.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(ALLOW)
32 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 3))
33 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 4))
34 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 5))
35 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 6))
36 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 7))
37 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 8))
38 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 9))
39 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 11))
40 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 12))
41 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 13))
42 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 14))
43 f.add_rule_exactly(KILL, 1000, Arg(0, EQ, 15))
44 f.add_rule_exactly(KILL, 1000, Arg(0, GE, 16))
45 return f
46
47 args = util.get_opt()
48 ctx = test(args)
49 util.filter_output(args, ctx)
50
51 # kate: syntax python;
52 # kate: indent-mode python; space-indent on; indent-width 4; mixedindent off;
0 #
1 # libseccomp regression test automation data
2 #
3 # Copyright (c) 2015 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.com
5 #
6
7 test type: bpf-sim
8
9 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
10 27-sim-bpf_blk_state all 1000 0-2 N N N N N ALLOW
11 27-sim-bpf_blk_state all 1000 3-9 N N N N N KILL
12 27-sim-bpf_blk_state all 1000 10 N N N N N ALLOW
13 27-sim-bpf_blk_state all 1000 11-32 N N N N N KILL
14
15 test type: bpf-sim-fuzz
16
17 # Testname StressCount
18 27-sim-bpf_blk_state 50
19
20 test type: bpf-valgrind
21
22 # Testname
23 27-sim-bpf_blk_state
0 /**
1 * Seccomp Library test program
2 *
3 * This test triggered a bug in libseccomp erroneously allowing the close()
4 * syscall on x32 instead of 'KILL'ing it, as it should do for unsupported
5 * architectures.
6 *
7 * Copyright (c) 2012 Red Hat <pmoore@redhat.com>
8 * Authors: Paul Moore <pmoore@redhat.com>
9 * Mathias Krause <minipli@googlemail.com>
10 */
11
12 /*
13 * This library is free software; you can redistribute it and/or modify it
14 * under the terms of version 2.1 of the GNU Lesser General Public License as
15 * published by the Free Software Foundation.
16 *
17 * This library is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
20 * for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this library; if not, see <http://www.gnu.org/licenses>.
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_ALLOW);
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 /* add x86-64 and x86 (in that order!) but explicitly leave out x32 */
52 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86_64);
53 if (rc != 0)
54 goto out;
55 rc = seccomp_arch_add(ctx, SCMP_ARCH_X86);
56 if (rc != 0)
57 goto out;
58
59 rc = seccomp_rule_add(ctx, SCMP_ACT_ERRNO(1), SCMP_SYS(close), 0);
60 if (rc != 0)
61 goto out;
62
63 rc = util_filter_output(&opts, ctx);
64 if (rc)
65 goto out;
66
67 out:
68 seccomp_release(ctx);
69 return (rc < 0 ? -rc : rc);
70 }
0 #!/usr/bin/env python
1
2 #
3 # Seccomp Library test program
4 #
5 # Copyright (c) 2015 Red Hat <pmoore@redhat.com>
6 # Author: Paul Moore <pmoore@redhat.com>
7 #
8 # Adapted from 29-sim-arch_x86.c by Mathias Krause <minipli@googlemail.com>
9 #
10
11 #
12 # This library is free software; you can redistribute it and/or modify it
13 # under the terms of version 2.1 of the GNU Lesser General Public License as
14 # published by the Free Software Foundation.
15 #
16 # This library is distributed in the hope that it will be useful, but WITHOUT
17 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
19 # for more details.
20 #
21 # You should have received a copy of the GNU Lesser General Public License
22 # along with this library; if not, see <http://www.gnu.org/licenses>.
23 #
24
25 import argparse
26 import sys
27
28 import util
29
30 from seccomp import *
31
32 def test(args):
33 f = SyscallFilter(ALLOW)
34 f.remove_arch(Arch())
35 # add x86-64 and x86 (in that order!) but explicitly leave out x32
36 f.add_arch(Arch("x86_64"))
37 f.add_arch(Arch("x86"))
38 f.add_rule(ERRNO(1), "close")
39 return f
40
41 args = util.get_opt()
42 ctx = test(args)
43 util.filter_output(args, ctx)
44
45 # kate: syntax python;
46 # kate: indent-mode python; space-indent on; indent-width 4; mixedindent off;
0 #
1 # libseccomp regression test automation data
2 #
3 # This test triggered a bug in libseccomp erroneously allowing the close()
4 # syscall on x32 instead of 'KILL'ing it, as it should do for unsupported
5 # architectures.
6 #
7 # Author: Mathias Krause <minipli@googlemail.com>
8 #
9
10 test type: bpf-sim
11
12 # Testname Arch Syscall Arg0 Arg1 Arg2 Arg3 Arg4 Arg5 Result
13 28-sim-arch_x86 +x86,+x86_64 read N N N N N N ALLOW
14 28-sim-arch_x86 +x86,+x86_64 close N N N N N N ERRNO(1)
15 28-sim-arch_x86 +arm,+x32 read N N N N N N KILL
16 28-sim-arch_x86 +arm,+x32 close N N N N N N KILL
17
18 test type: bpf-sim-fuzz
19
20 # Testname StressCount
21 28-sim-arch_x86 50
22
23 test type: bpf-valgrind
24
25 # Testname
26 28-sim-arch_x86
+0
-95
tests/Makefile less more
0 #
1 # Enhanced Seccomp Library Makefile
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 # macros
23 #
24
25 include ../macros.mk
26
27 #
28 # configuration
29 #
30
31 include $(TOPDIR)/version_info.mk
32 include $(TOPDIR)/configure.mk
33
34 OBJS = util.o
35
36 LDFLAGS := ../src/libseccomp.a $(OBJS)
37
38 TEST_PRIVATE = 00-test
39
40 TESTS = 01-sim-allow \
41 02-sim-basic \
42 03-sim-basic_chains \
43 04-sim-multilevel_chains \
44 05-sim-long_jumps \
45 06-sim-actions \
46 07-sim-db_bug_looping \
47 08-sim-subtree_checks \
48 09-sim-syscall_priority_pre \
49 10-sim-syscall_priority_post \
50 11-basic-basic_errors \
51 12-sim-basic_masked_ops \
52 13-basic-attrs \
53 14-sim-reset \
54 15-basic-resolver \
55 16-sim-arch_basic \
56 17-sim-arch_merge \
57 18-sim-basic_whitelist \
58 19-sim-missing_syscalls \
59 20-live-basic_die \
60 21-live-basic_allow \
61 22-sim-basic_chains_array \
62 23-sim-arch_all_basic \
63 24-live-arg_allow \
64 25-sim-multilevel_chains_adv
65
66 DEPS_OBJS = $(OBJS:%.o=%.d)
67 DEPS_TESTS = $(TESTS:%=%.d)
68
69 #
70 # targets
71 #
72
73 .PHONY: check clean
74
75 all: $(TESTS) $(OBJS)
76
77 -include $(DEPS_TESTS) $(DEPS_OBJS)
78
79 $(DEPS_TESTS):
80 $(MAKEDEP_EXEC)
81 $(ADDDEP) $@ ../src/libseccomp.a
82 $(ADDDEP) $@ $(OBJS)
83
84 $(TESTS):
85 $(COMPILE_EXEC)
86
87 $(TEST_PRIVATE): 00-test.c $(OBJS) ../src/libseccomp.a
88 $(COMPILE_EXEC)
89
90 check: $(TESTS)
91 ./regression
92
93 clean:
94 $(RM) $(DEPS_TESTS) $(DEPS_OBJS) $(TESTS) $(TEST_PRIVATE) $(OBJS) *.pyc
0 ####
1 # Seccomp Library Tests
2 #
3
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the terms of version 2.1 of the GNU Lesser General Public License
7 # as published by the Free Software Foundation.
8 #
9 # This library is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses>.
16 #
17
18 AM_LDFLAGS = -static
19 LDADD = util.la ../src/libseccomp.la
20
21 check_LTLIBRARIES = util.la
22 util_la_SOURCES = util.c util.h
23 util_la_LDFLAGS = -module
24
25 TESTS = regression
26
27 check_PROGRAMS = \
28 01-sim-allow \
29 02-sim-basic \
30 03-sim-basic_chains \
31 04-sim-multilevel_chains \
32 05-sim-long_jumps \
33 06-sim-actions \
34 07-sim-db_bug_looping \
35 08-sim-subtree_checks \
36 09-sim-syscall_priority_pre \
37 10-sim-syscall_priority_post \
38 11-basic-basic_errors \
39 12-sim-basic_masked_ops \
40 13-basic-attrs \
41 14-sim-reset \
42 15-basic-resolver \
43 16-sim-arch_basic \
44 17-sim-arch_merge \
45 18-sim-basic_whitelist \
46 19-sim-missing_syscalls \
47 20-live-basic_die \
48 21-live-basic_allow \
49 22-sim-basic_chains_array \
50 23-sim-arch_all_le_basic \
51 24-live-arg_allow \
52 25-sim-multilevel_chains_adv \
53 26-sim-arch_all_be_basic \
54 27-sim-bpf_blk_state \
55 28-sim-arch_x86
56
57 EXTRA_DIST_TESTPYTHON = \
58 util.py \
59 01-sim-allow.py \
60 02-sim-basic.py \
61 03-sim-basic_chains.py \
62 04-sim-multilevel_chains.py \
63 05-sim-long_jumps.py \
64 06-sim-actions.py \
65 07-sim-db_bug_looping.py \
66 08-sim-subtree_checks.py \
67 09-sim-syscall_priority_pre.py \
68 10-sim-syscall_priority_post.py \
69 11-basic-basic_errors.py \
70 12-sim-basic_masked_ops.py \
71 13-basic-attrs.py \
72 14-sim-reset.py \
73 15-basic-resolver.py \
74 16-sim-arch_basic.py \
75 17-sim-arch_merge.py \
76 18-sim-basic_whitelist.py \
77 19-sim-missing_syscalls.py \
78 20-live-basic_die.py \
79 21-live-basic_allow.py \
80 22-sim-basic_chains_array.py \
81 23-sim-arch_all_le_basic.py \
82 24-live-arg_allow.py \
83 25-sim-multilevel_chains_adv.py \
84 26-sim-arch_all_be_basic.py \
85 27-sim-bpf_blk_state.py \
86 28-sim-arch_x86.py
87
88 EXTRA_DIST_TESTCFGS = \
89 01-sim-allow.tests \
90 02-sim-basic.tests \
91 03-sim-basic_chains.tests \
92 04-sim-multilevel_chains.tests \
93 05-sim-long_jumps.tests \
94 06-sim-actions.tests \
95 07-sim-db_bug_looping.tests \
96 08-sim-subtree_checks.tests \
97 09-sim-syscall_priority_pre.tests \
98 10-sim-syscall_priority_post.tests \
99 11-basic-basic_errors.tests \
100 12-sim-basic_masked_ops.tests \
101 13-basic-attrs.tests \
102 14-sim-reset.tests \
103 15-basic-resolver.tests \
104 16-sim-arch_basic.tests \
105 17-sim-arch_merge.tests \
106 18-sim-basic_whitelist.tests \
107 19-sim-missing_syscalls.tests \
108 20-live-basic_die.tests \
109 21-live-basic_allow.tests \
110 22-sim-basic_chains_array.tests \
111 23-sim-arch_all_le_basic.tests \
112 24-live-arg_allow.tests \
113 25-sim-multilevel_chains_adv.tests \
114 26-sim-arch_all_be_basic.tests \
115 27-sim-bpf_blk_state.tests \
116 28-sim-arch_x86.tests
117
118 EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen
119
120 EXTRA_DIST_TESTVALGRIND = valgrind_test.supp
121
122 EXTRA_DIST = \
123 ${EXTRA_DIST_TESTCFGS} \
124 ${EXTRA_DIST_TESTPYTHON} \
125 ${EXTRA_DIST_TESTSCRIPTS} \
126 ${EXTRA_DIST_TESTVALGRIND}
127
128 EXTRA_PROGRAMS = 00-test
129
130 check-build:
131 ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS}
132
133 clean-local:
134 ${RM} -f 00-test *.pyc
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
4
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 ####
17 # Seccomp Library Tests
18 #
19
20 #
21 # This library is free software; you can redistribute it and/or modify it
22 # under the terms of version 2.1 of the GNU Lesser General Public License
23 # as published by the Free Software Foundation.
24 #
25 # This library is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
28 # General Public License for more details.
29 #
30 # You should have received a copy of the GNU Lesser General Public License
31 # along with this library; if not, see <http://www.gnu.org/licenses>.
32 #
33 VPATH = @srcdir@
34 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
35 am__make_running_with_option = \
36 case $${target_option-} in \
37 ?) ;; \
38 *) echo "am__make_running_with_option: internal error: invalid" \
39 "target option '$${target_option-}' specified" >&2; \
40 exit 1;; \
41 esac; \
42 has_opt=no; \
43 sane_makeflags=$$MAKEFLAGS; \
44 if $(am__is_gnu_make); then \
45 sane_makeflags=$$MFLAGS; \
46 else \
47 case $$MAKEFLAGS in \
48 *\\[\ \ ]*) \
49 bs=\\; \
50 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
51 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
52 esac; \
53 fi; \
54 skip_next=no; \
55 strip_trailopt () \
56 { \
57 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
58 }; \
59 for flg in $$sane_makeflags; do \
60 test $$skip_next = yes && { skip_next=no; continue; }; \
61 case $$flg in \
62 *=*|--*) continue;; \
63 -*I) strip_trailopt 'I'; skip_next=yes;; \
64 -*I?*) strip_trailopt 'I';; \
65 -*O) strip_trailopt 'O'; skip_next=yes;; \
66 -*O?*) strip_trailopt 'O';; \
67 -*l) strip_trailopt 'l'; skip_next=yes;; \
68 -*l?*) strip_trailopt 'l';; \
69 -[dEDm]) skip_next=yes;; \
70 -[JT]) skip_next=yes;; \
71 esac; \
72 case $$flg in \
73 *$$target_option*) has_opt=yes; break;; \
74 esac; \
75 done; \
76 test $$has_opt = yes
77 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
78 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
79 pkgdatadir = $(datadir)/@PACKAGE@
80 pkgincludedir = $(includedir)/@PACKAGE@
81 pkglibdir = $(libdir)/@PACKAGE@
82 pkglibexecdir = $(libexecdir)/@PACKAGE@
83 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
84 install_sh_DATA = $(install_sh) -c -m 644
85 install_sh_PROGRAM = $(install_sh) -c
86 install_sh_SCRIPT = $(install_sh) -c
87 INSTALL_HEADER = $(INSTALL_DATA)
88 transform = $(program_transform_name)
89 NORMAL_INSTALL = :
90 PRE_INSTALL = :
91 POST_INSTALL = :
92 NORMAL_UNINSTALL = :
93 PRE_UNINSTALL = :
94 POST_UNINSTALL = :
95 build_triplet = @build@
96 host_triplet = @host@
97 check_PROGRAMS = 01-sim-allow$(EXEEXT) 02-sim-basic$(EXEEXT) \
98 03-sim-basic_chains$(EXEEXT) 04-sim-multilevel_chains$(EXEEXT) \
99 05-sim-long_jumps$(EXEEXT) 06-sim-actions$(EXEEXT) \
100 07-sim-db_bug_looping$(EXEEXT) 08-sim-subtree_checks$(EXEEXT) \
101 09-sim-syscall_priority_pre$(EXEEXT) \
102 10-sim-syscall_priority_post$(EXEEXT) \
103 11-basic-basic_errors$(EXEEXT) \
104 12-sim-basic_masked_ops$(EXEEXT) 13-basic-attrs$(EXEEXT) \
105 14-sim-reset$(EXEEXT) 15-basic-resolver$(EXEEXT) \
106 16-sim-arch_basic$(EXEEXT) 17-sim-arch_merge$(EXEEXT) \
107 18-sim-basic_whitelist$(EXEEXT) \
108 19-sim-missing_syscalls$(EXEEXT) 20-live-basic_die$(EXEEXT) \
109 21-live-basic_allow$(EXEEXT) \
110 22-sim-basic_chains_array$(EXEEXT) \
111 23-sim-arch_all_le_basic$(EXEEXT) 24-live-arg_allow$(EXEEXT) \
112 25-sim-multilevel_chains_adv$(EXEEXT) \
113 26-sim-arch_all_be_basic$(EXEEXT) \
114 27-sim-bpf_blk_state$(EXEEXT) 28-sim-arch_x86$(EXEEXT)
115 EXTRA_PROGRAMS = 00-test$(EXEEXT)
116 subdir = tests
117 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
118 $(top_srcdir)/build-aux/depcomp
119 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
120 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
121 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
122 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
123 $(top_srcdir)/configure.ac
124 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
125 $(ACLOCAL_M4)
126 mkinstalldirs = $(install_sh) -d
127 CONFIG_HEADER = $(top_builddir)/configure.h
128 CONFIG_CLEAN_FILES =
129 CONFIG_CLEAN_VPATH_FILES =
130 util_la_LIBADD =
131 am_util_la_OBJECTS = util.lo
132 util_la_OBJECTS = $(am_util_la_OBJECTS)
133 AM_V_lt = $(am__v_lt_@AM_V@)
134 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
135 am__v_lt_0 = --silent
136 am__v_lt_1 =
137 util_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
138 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
139 $(util_la_LDFLAGS) $(LDFLAGS) -o $@
140 00_test_SOURCES = 00-test.c
141 00_test_OBJECTS = 00-test.$(OBJEXT)
142 00_test_LDADD = $(LDADD)
143 00_test_DEPENDENCIES = util.la ../src/libseccomp.la
144 01_sim_allow_SOURCES = 01-sim-allow.c
145 01_sim_allow_OBJECTS = 01-sim-allow.$(OBJEXT)
146 01_sim_allow_LDADD = $(LDADD)
147 01_sim_allow_DEPENDENCIES = util.la ../src/libseccomp.la
148 02_sim_basic_SOURCES = 02-sim-basic.c
149 02_sim_basic_OBJECTS = 02-sim-basic.$(OBJEXT)
150 02_sim_basic_LDADD = $(LDADD)
151 02_sim_basic_DEPENDENCIES = util.la ../src/libseccomp.la
152 03_sim_basic_chains_SOURCES = 03-sim-basic_chains.c
153 03_sim_basic_chains_OBJECTS = 03-sim-basic_chains.$(OBJEXT)
154 03_sim_basic_chains_LDADD = $(LDADD)
155 03_sim_basic_chains_DEPENDENCIES = util.la ../src/libseccomp.la
156 04_sim_multilevel_chains_SOURCES = 04-sim-multilevel_chains.c
157 04_sim_multilevel_chains_OBJECTS = 04-sim-multilevel_chains.$(OBJEXT)
158 04_sim_multilevel_chains_LDADD = $(LDADD)
159 04_sim_multilevel_chains_DEPENDENCIES = util.la ../src/libseccomp.la
160 05_sim_long_jumps_SOURCES = 05-sim-long_jumps.c
161 05_sim_long_jumps_OBJECTS = 05-sim-long_jumps.$(OBJEXT)
162 05_sim_long_jumps_LDADD = $(LDADD)
163 05_sim_long_jumps_DEPENDENCIES = util.la ../src/libseccomp.la
164 06_sim_actions_SOURCES = 06-sim-actions.c
165 06_sim_actions_OBJECTS = 06-sim-actions.$(OBJEXT)
166 06_sim_actions_LDADD = $(LDADD)
167 06_sim_actions_DEPENDENCIES = util.la ../src/libseccomp.la
168 07_sim_db_bug_looping_SOURCES = 07-sim-db_bug_looping.c
169 07_sim_db_bug_looping_OBJECTS = 07-sim-db_bug_looping.$(OBJEXT)
170 07_sim_db_bug_looping_LDADD = $(LDADD)
171 07_sim_db_bug_looping_DEPENDENCIES = util.la ../src/libseccomp.la
172 08_sim_subtree_checks_SOURCES = 08-sim-subtree_checks.c
173 08_sim_subtree_checks_OBJECTS = 08-sim-subtree_checks.$(OBJEXT)
174 08_sim_subtree_checks_LDADD = $(LDADD)
175 08_sim_subtree_checks_DEPENDENCIES = util.la ../src/libseccomp.la
176 09_sim_syscall_priority_pre_SOURCES = 09-sim-syscall_priority_pre.c
177 09_sim_syscall_priority_pre_OBJECTS = \
178 09-sim-syscall_priority_pre.$(OBJEXT)
179 09_sim_syscall_priority_pre_LDADD = $(LDADD)
180 09_sim_syscall_priority_pre_DEPENDENCIES = util.la \
181 ../src/libseccomp.la
182 10_sim_syscall_priority_post_SOURCES = 10-sim-syscall_priority_post.c
183 10_sim_syscall_priority_post_OBJECTS = \
184 10-sim-syscall_priority_post.$(OBJEXT)
185 10_sim_syscall_priority_post_LDADD = $(LDADD)
186 10_sim_syscall_priority_post_DEPENDENCIES = util.la \
187 ../src/libseccomp.la
188 11_basic_basic_errors_SOURCES = 11-basic-basic_errors.c
189 11_basic_basic_errors_OBJECTS = 11-basic-basic_errors.$(OBJEXT)
190 11_basic_basic_errors_LDADD = $(LDADD)
191 11_basic_basic_errors_DEPENDENCIES = util.la ../src/libseccomp.la
192 12_sim_basic_masked_ops_SOURCES = 12-sim-basic_masked_ops.c
193 12_sim_basic_masked_ops_OBJECTS = 12-sim-basic_masked_ops.$(OBJEXT)
194 12_sim_basic_masked_ops_LDADD = $(LDADD)
195 12_sim_basic_masked_ops_DEPENDENCIES = util.la ../src/libseccomp.la
196 13_basic_attrs_SOURCES = 13-basic-attrs.c
197 13_basic_attrs_OBJECTS = 13-basic-attrs.$(OBJEXT)
198 13_basic_attrs_LDADD = $(LDADD)
199 13_basic_attrs_DEPENDENCIES = util.la ../src/libseccomp.la
200 14_sim_reset_SOURCES = 14-sim-reset.c
201 14_sim_reset_OBJECTS = 14-sim-reset.$(OBJEXT)
202 14_sim_reset_LDADD = $(LDADD)
203 14_sim_reset_DEPENDENCIES = util.la ../src/libseccomp.la
204 15_basic_resolver_SOURCES = 15-basic-resolver.c
205 15_basic_resolver_OBJECTS = 15-basic-resolver.$(OBJEXT)
206 15_basic_resolver_LDADD = $(LDADD)
207 15_basic_resolver_DEPENDENCIES = util.la ../src/libseccomp.la
208 16_sim_arch_basic_SOURCES = 16-sim-arch_basic.c
209 16_sim_arch_basic_OBJECTS = 16-sim-arch_basic.$(OBJEXT)
210 16_sim_arch_basic_LDADD = $(LDADD)
211 16_sim_arch_basic_DEPENDENCIES = util.la ../src/libseccomp.la
212 17_sim_arch_merge_SOURCES = 17-sim-arch_merge.c
213 17_sim_arch_merge_OBJECTS = 17-sim-arch_merge.$(OBJEXT)
214 17_sim_arch_merge_LDADD = $(LDADD)
215 17_sim_arch_merge_DEPENDENCIES = util.la ../src/libseccomp.la
216 18_sim_basic_whitelist_SOURCES = 18-sim-basic_whitelist.c
217 18_sim_basic_whitelist_OBJECTS = 18-sim-basic_whitelist.$(OBJEXT)
218 18_sim_basic_whitelist_LDADD = $(LDADD)
219 18_sim_basic_whitelist_DEPENDENCIES = util.la ../src/libseccomp.la
220 19_sim_missing_syscalls_SOURCES = 19-sim-missing_syscalls.c
221 19_sim_missing_syscalls_OBJECTS = 19-sim-missing_syscalls.$(OBJEXT)
222 19_sim_missing_syscalls_LDADD = $(LDADD)
223 19_sim_missing_syscalls_DEPENDENCIES = util.la ../src/libseccomp.la
224 20_live_basic_die_SOURCES = 20-live-basic_die.c
225 20_live_basic_die_OBJECTS = 20-live-basic_die.$(OBJEXT)
226 20_live_basic_die_LDADD = $(LDADD)
227 20_live_basic_die_DEPENDENCIES = util.la ../src/libseccomp.la
228 21_live_basic_allow_SOURCES = 21-live-basic_allow.c
229 21_live_basic_allow_OBJECTS = 21-live-basic_allow.$(OBJEXT)
230 21_live_basic_allow_LDADD = $(LDADD)
231 21_live_basic_allow_DEPENDENCIES = util.la ../src/libseccomp.la
232 22_sim_basic_chains_array_SOURCES = 22-sim-basic_chains_array.c
233 22_sim_basic_chains_array_OBJECTS = \
234 22-sim-basic_chains_array.$(OBJEXT)
235 22_sim_basic_chains_array_LDADD = $(LDADD)
236 22_sim_basic_chains_array_DEPENDENCIES = util.la ../src/libseccomp.la
237 23_sim_arch_all_le_basic_SOURCES = 23-sim-arch_all_le_basic.c
238 23_sim_arch_all_le_basic_OBJECTS = 23-sim-arch_all_le_basic.$(OBJEXT)
239 23_sim_arch_all_le_basic_LDADD = $(LDADD)
240 23_sim_arch_all_le_basic_DEPENDENCIES = util.la ../src/libseccomp.la
241 24_live_arg_allow_SOURCES = 24-live-arg_allow.c
242 24_live_arg_allow_OBJECTS = 24-live-arg_allow.$(OBJEXT)
243 24_live_arg_allow_LDADD = $(LDADD)
244 24_live_arg_allow_DEPENDENCIES = util.la ../src/libseccomp.la
245 25_sim_multilevel_chains_adv_SOURCES = 25-sim-multilevel_chains_adv.c
246 25_sim_multilevel_chains_adv_OBJECTS = \
247 25-sim-multilevel_chains_adv.$(OBJEXT)
248 25_sim_multilevel_chains_adv_LDADD = $(LDADD)
249 25_sim_multilevel_chains_adv_DEPENDENCIES = util.la \
250 ../src/libseccomp.la
251 26_sim_arch_all_be_basic_SOURCES = 26-sim-arch_all_be_basic.c
252 26_sim_arch_all_be_basic_OBJECTS = 26-sim-arch_all_be_basic.$(OBJEXT)
253 26_sim_arch_all_be_basic_LDADD = $(LDADD)
254 26_sim_arch_all_be_basic_DEPENDENCIES = util.la ../src/libseccomp.la
255 27_sim_bpf_blk_state_SOURCES = 27-sim-bpf_blk_state.c
256 27_sim_bpf_blk_state_OBJECTS = 27-sim-bpf_blk_state.$(OBJEXT)
257 27_sim_bpf_blk_state_LDADD = $(LDADD)
258 27_sim_bpf_blk_state_DEPENDENCIES = util.la ../src/libseccomp.la
259 28_sim_arch_x86_SOURCES = 28-sim-arch_x86.c
260 28_sim_arch_x86_OBJECTS = 28-sim-arch_x86.$(OBJEXT)
261 28_sim_arch_x86_LDADD = $(LDADD)
262 28_sim_arch_x86_DEPENDENCIES = util.la ../src/libseccomp.la
263 AM_V_P = $(am__v_P_@AM_V@)
264 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
265 am__v_P_0 = false
266 am__v_P_1 = :
267 AM_V_GEN = $(am__v_GEN_@AM_V@)
268 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
269 am__v_GEN_0 = @echo " GEN " $@;
270 am__v_GEN_1 =
271 AM_V_at = $(am__v_at_@AM_V@)
272 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
273 am__v_at_0 = @
274 am__v_at_1 =
275 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
276 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
277 am__depfiles_maybe = depfiles
278 am__mv = mv -f
279 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
280 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
281 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
282 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
283 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
284 $(AM_CFLAGS) $(CFLAGS)
285 AM_V_CC = $(am__v_CC_@AM_V@)
286 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
287 am__v_CC_0 = @echo " CC " $@;
288 am__v_CC_1 =
289 CCLD = $(CC)
290 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
291 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
292 $(AM_LDFLAGS) $(LDFLAGS) -o $@
293 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
294 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
295 am__v_CCLD_0 = @echo " CCLD " $@;
296 am__v_CCLD_1 =
297 SOURCES = $(util_la_SOURCES) 00-test.c 01-sim-allow.c 02-sim-basic.c \
298 03-sim-basic_chains.c 04-sim-multilevel_chains.c \
299 05-sim-long_jumps.c 06-sim-actions.c 07-sim-db_bug_looping.c \
300 08-sim-subtree_checks.c 09-sim-syscall_priority_pre.c \
301 10-sim-syscall_priority_post.c 11-basic-basic_errors.c \
302 12-sim-basic_masked_ops.c 13-basic-attrs.c 14-sim-reset.c \
303 15-basic-resolver.c 16-sim-arch_basic.c 17-sim-arch_merge.c \
304 18-sim-basic_whitelist.c 19-sim-missing_syscalls.c \
305 20-live-basic_die.c 21-live-basic_allow.c \
306 22-sim-basic_chains_array.c 23-sim-arch_all_le_basic.c \
307 24-live-arg_allow.c 25-sim-multilevel_chains_adv.c \
308 26-sim-arch_all_be_basic.c 27-sim-bpf_blk_state.c \
309 28-sim-arch_x86.c
310 DIST_SOURCES = $(util_la_SOURCES) 00-test.c 01-sim-allow.c \
311 02-sim-basic.c 03-sim-basic_chains.c \
312 04-sim-multilevel_chains.c 05-sim-long_jumps.c \
313 06-sim-actions.c 07-sim-db_bug_looping.c \
314 08-sim-subtree_checks.c 09-sim-syscall_priority_pre.c \
315 10-sim-syscall_priority_post.c 11-basic-basic_errors.c \
316 12-sim-basic_masked_ops.c 13-basic-attrs.c 14-sim-reset.c \
317 15-basic-resolver.c 16-sim-arch_basic.c 17-sim-arch_merge.c \
318 18-sim-basic_whitelist.c 19-sim-missing_syscalls.c \
319 20-live-basic_die.c 21-live-basic_allow.c \
320 22-sim-basic_chains_array.c 23-sim-arch_all_le_basic.c \
321 24-live-arg_allow.c 25-sim-multilevel_chains_adv.c \
322 26-sim-arch_all_be_basic.c 27-sim-bpf_blk_state.c \
323 28-sim-arch_x86.c
324 am__can_run_installinfo = \
325 case $$AM_UPDATE_INFO_DIR in \
326 n|no|NO) false;; \
327 *) (install-info --version) >/dev/null 2>&1;; \
328 esac
329 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
330 # Read a list of newline-separated strings from the standard input,
331 # and print each of them once, without duplicates. Input order is
332 # *not* preserved.
333 am__uniquify_input = $(AWK) '\
334 BEGIN { nonempty = 0; } \
335 { items[$$0] = 1; nonempty = 1; } \
336 END { if (nonempty) { for (i in items) print i; }; } \
337 '
338 # Make sure the list of sources is unique. This is necessary because,
339 # e.g., the same source file might be shared among _SOURCES variables
340 # for different programs/libraries.
341 am__define_uniq_tagged_files = \
342 list='$(am__tagged_files)'; \
343 unique=`for i in $$list; do \
344 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
345 done | $(am__uniquify_input)`
346 ETAGS = etags
347 CTAGS = ctags
348 am__tty_colors_dummy = \
349 mgn= red= grn= lgn= blu= brg= std=; \
350 am__color_tests=no
351 am__tty_colors = { \
352 $(am__tty_colors_dummy); \
353 if test "X$(AM_COLOR_TESTS)" = Xno; then \
354 am__color_tests=no; \
355 elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
356 am__color_tests=yes; \
357 elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
358 am__color_tests=yes; \
359 fi; \
360 if test $$am__color_tests = yes; then \
361 red=''; \
362 grn=''; \
363 lgn=''; \
364 blu=''; \
365 mgn=''; \
366 brg=''; \
367 std=''; \
368 fi; \
369 }
370 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
371 ACLOCAL = @ACLOCAL@
372 AMTAR = @AMTAR@
373 AM_CFLAGS = @AM_CFLAGS@
374 AM_CPPFLAGS = @AM_CPPFLAGS@
375 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
376 AM_LDFLAGS = -static
377 AR = @AR@
378 AUTOCONF = @AUTOCONF@
379 AUTOHEADER = @AUTOHEADER@
380 AUTOMAKE = @AUTOMAKE@
381 AWK = @AWK@
382 CC = @CC@
383 CCDEPMODE = @CCDEPMODE@
384 CFLAGS = @CFLAGS@
385 CPP = @CPP@
386 CPPFLAGS = @CPPFLAGS@
387 CYGPATH_W = @CYGPATH_W@
388 DEFS = @DEFS@
389 DEPDIR = @DEPDIR@
390 DLLTOOL = @DLLTOOL@
391 DSYMUTIL = @DSYMUTIL@
392 DUMPBIN = @DUMPBIN@
393 ECHO_C = @ECHO_C@
394 ECHO_N = @ECHO_N@
395 ECHO_T = @ECHO_T@
396 EGREP = @EGREP@
397 EXEEXT = @EXEEXT@
398 FGREP = @FGREP@
399 GREP = @GREP@
400 INSTALL = @INSTALL@
401 INSTALL_DATA = @INSTALL_DATA@
402 INSTALL_PROGRAM = @INSTALL_PROGRAM@
403 INSTALL_SCRIPT = @INSTALL_SCRIPT@
404 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
405 LD = @LD@
406 LDFLAGS = @LDFLAGS@
407 LIBOBJS = @LIBOBJS@
408 LIBS = @LIBS@
409 LIBTOOL = @LIBTOOL@
410 LIPO = @LIPO@
411 LN_S = @LN_S@
412 LTLIBOBJS = @LTLIBOBJS@
413 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
414 MAKEINFO = @MAKEINFO@
415 MANIFEST_TOOL = @MANIFEST_TOOL@
416 MKDIR_P = @MKDIR_P@
417 NM = @NM@
418 NMEDIT = @NMEDIT@
419 OBJDUMP = @OBJDUMP@
420 OBJEXT = @OBJEXT@
421 OTOOL = @OTOOL@
422 OTOOL64 = @OTOOL64@
423 PACKAGE = @PACKAGE@
424 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
425 PACKAGE_NAME = @PACKAGE_NAME@
426 PACKAGE_STRING = @PACKAGE_STRING@
427 PACKAGE_TARNAME = @PACKAGE_TARNAME@
428 PACKAGE_URL = @PACKAGE_URL@
429 PACKAGE_VERSION = @PACKAGE_VERSION@
430 PATH_SEPARATOR = @PATH_SEPARATOR@
431 RANLIB = @RANLIB@
432 SED = @SED@
433 SET_MAKE = @SET_MAKE@
434 SHELL = @SHELL@
435 STRIP = @STRIP@
436 VERSION = @VERSION@
437 VERSION_MAJOR = @VERSION_MAJOR@
438 VERSION_MICRO = @VERSION_MICRO@
439 VERSION_MINOR = @VERSION_MINOR@
440 abs_builddir = @abs_builddir@
441 abs_srcdir = @abs_srcdir@
442 abs_top_builddir = @abs_top_builddir@
443 abs_top_srcdir = @abs_top_srcdir@
444 ac_ct_AR = @ac_ct_AR@
445 ac_ct_CC = @ac_ct_CC@
446 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
447 am__include = @am__include@
448 am__leading_dot = @am__leading_dot@
449 am__quote = @am__quote@
450 am__tar = @am__tar@
451 am__untar = @am__untar@
452 bindir = @bindir@
453 build = @build@
454 build_alias = @build_alias@
455 build_cpu = @build_cpu@
456 build_os = @build_os@
457 build_vendor = @build_vendor@
458 builddir = @builddir@
459 datadir = @datadir@
460 datarootdir = @datarootdir@
461 docdir = @docdir@
462 dvidir = @dvidir@
463 exec_prefix = @exec_prefix@
464 have_coverity = @have_coverity@
465 have_cython = @have_cython@
466 host = @host@
467 host_alias = @host_alias@
468 host_cpu = @host_cpu@
469 host_os = @host_os@
470 host_vendor = @host_vendor@
471 htmldir = @htmldir@
472 includedir = @includedir@
473 infodir = @infodir@
474 install_sh = @install_sh@
475 libdir = @libdir@
476 libexecdir = @libexecdir@
477 localedir = @localedir@
478 localstatedir = @localstatedir@
479 mandir = @mandir@
480 mkdir_p = @mkdir_p@
481 oldincludedir = @oldincludedir@
482 pdfdir = @pdfdir@
483 prefix = @prefix@
484 program_transform_name = @program_transform_name@
485 psdir = @psdir@
486 sbindir = @sbindir@
487 sharedstatedir = @sharedstatedir@
488 srcdir = @srcdir@
489 sysconfdir = @sysconfdir@
490 target_alias = @target_alias@
491 top_build_prefix = @top_build_prefix@
492 top_builddir = @top_builddir@
493 top_srcdir = @top_srcdir@
494 LDADD = util.la ../src/libseccomp.la
495 check_LTLIBRARIES = util.la
496 util_la_SOURCES = util.c util.h
497 util_la_LDFLAGS = -module
498 TESTS = regression
499 EXTRA_DIST_TESTPYTHON = \
500 util.py \
501 01-sim-allow.py \
502 02-sim-basic.py \
503 03-sim-basic_chains.py \
504 04-sim-multilevel_chains.py \
505 05-sim-long_jumps.py \
506 06-sim-actions.py \
507 07-sim-db_bug_looping.py \
508 08-sim-subtree_checks.py \
509 09-sim-syscall_priority_pre.py \
510 10-sim-syscall_priority_post.py \
511 11-basic-basic_errors.py \
512 12-sim-basic_masked_ops.py \
513 13-basic-attrs.py \
514 14-sim-reset.py \
515 15-basic-resolver.py \
516 16-sim-arch_basic.py \
517 17-sim-arch_merge.py \
518 18-sim-basic_whitelist.py \
519 19-sim-missing_syscalls.py \
520 20-live-basic_die.py \
521 21-live-basic_allow.py \
522 22-sim-basic_chains_array.py \
523 23-sim-arch_all_le_basic.py \
524 24-live-arg_allow.py \
525 25-sim-multilevel_chains_adv.py \
526 26-sim-arch_all_be_basic.py \
527 27-sim-bpf_blk_state.py \
528 28-sim-arch_x86.py
529
530 EXTRA_DIST_TESTCFGS = \
531 01-sim-allow.tests \
532 02-sim-basic.tests \
533 03-sim-basic_chains.tests \
534 04-sim-multilevel_chains.tests \
535 05-sim-long_jumps.tests \
536 06-sim-actions.tests \
537 07-sim-db_bug_looping.tests \
538 08-sim-subtree_checks.tests \
539 09-sim-syscall_priority_pre.tests \
540 10-sim-syscall_priority_post.tests \
541 11-basic-basic_errors.tests \
542 12-sim-basic_masked_ops.tests \
543 13-basic-attrs.tests \
544 14-sim-reset.tests \
545 15-basic-resolver.tests \
546 16-sim-arch_basic.tests \
547 17-sim-arch_merge.tests \
548 18-sim-basic_whitelist.tests \
549 19-sim-missing_syscalls.tests \
550 20-live-basic_die.tests \
551 21-live-basic_allow.tests \
552 22-sim-basic_chains_array.tests \
553 23-sim-arch_all_le_basic.tests \
554 24-live-arg_allow.tests \
555 25-sim-multilevel_chains_adv.tests \
556 26-sim-arch_all_be_basic.tests \
557 27-sim-bpf_blk_state.tests \
558 28-sim-arch_x86.tests
559
560 EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen
561 EXTRA_DIST_TESTVALGRIND = valgrind_test.supp
562 EXTRA_DIST = \
563 ${EXTRA_DIST_TESTCFGS} \
564 ${EXTRA_DIST_TESTPYTHON} \
565 ${EXTRA_DIST_TESTSCRIPTS} \
566 ${EXTRA_DIST_TESTVALGRIND}
567
568 all: all-am
569
570 .SUFFIXES:
571 .SUFFIXES: .c .lo .o .obj
572 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
573 @for dep in $?; do \
574 case '$(am__configure_deps)' in \
575 *$$dep*) \
576 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
577 && { if test -f $@; then exit 0; else break; fi; }; \
578 exit 1;; \
579 esac; \
580 done; \
581 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
582 $(am__cd) $(top_srcdir) && \
583 $(AUTOMAKE) --foreign tests/Makefile
584 .PRECIOUS: Makefile
585 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
586 @case '$?' in \
587 *config.status*) \
588 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
589 *) \
590 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
591 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
592 esac;
593
594 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
595 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
596
597 $(top_srcdir)/configure: $(am__configure_deps)
598 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
599 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
600 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
601 $(am__aclocal_m4_deps):
602
603 clean-checkLTLIBRARIES:
604 -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES)
605 @list='$(check_LTLIBRARIES)'; \
606 locs=`for p in $$list; do echo $$p; done | \
607 sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
608 sort -u`; \
609 test -z "$$locs" || { \
610 echo rm -f $${locs}; \
611 rm -f $${locs}; \
612 }
613
614 util.la: $(util_la_OBJECTS) $(util_la_DEPENDENCIES) $(EXTRA_util_la_DEPENDENCIES)
615 $(AM_V_CCLD)$(util_la_LINK) $(util_la_OBJECTS) $(util_la_LIBADD) $(LIBS)
616
617 clean-checkPROGRAMS:
618 @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
619 echo " rm -f" $$list; \
620 rm -f $$list || exit $$?; \
621 test -n "$(EXEEXT)" || exit 0; \
622 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
623 echo " rm -f" $$list; \
624 rm -f $$list
625
626 00-test$(EXEEXT): $(00_test_OBJECTS) $(00_test_DEPENDENCIES) $(EXTRA_00_test_DEPENDENCIES)
627 @rm -f 00-test$(EXEEXT)
628 $(AM_V_CCLD)$(LINK) $(00_test_OBJECTS) $(00_test_LDADD) $(LIBS)
629
630 01-sim-allow$(EXEEXT): $(01_sim_allow_OBJECTS) $(01_sim_allow_DEPENDENCIES) $(EXTRA_01_sim_allow_DEPENDENCIES)
631 @rm -f 01-sim-allow$(EXEEXT)
632 $(AM_V_CCLD)$(LINK) $(01_sim_allow_OBJECTS) $(01_sim_allow_LDADD) $(LIBS)
633
634 02-sim-basic$(EXEEXT): $(02_sim_basic_OBJECTS) $(02_sim_basic_DEPENDENCIES) $(EXTRA_02_sim_basic_DEPENDENCIES)
635 @rm -f 02-sim-basic$(EXEEXT)
636 $(AM_V_CCLD)$(LINK) $(02_sim_basic_OBJECTS) $(02_sim_basic_LDADD) $(LIBS)
637
638 03-sim-basic_chains$(EXEEXT): $(03_sim_basic_chains_OBJECTS) $(03_sim_basic_chains_DEPENDENCIES) $(EXTRA_03_sim_basic_chains_DEPENDENCIES)
639 @rm -f 03-sim-basic_chains$(EXEEXT)
640 $(AM_V_CCLD)$(LINK) $(03_sim_basic_chains_OBJECTS) $(03_sim_basic_chains_LDADD) $(LIBS)
641
642 04-sim-multilevel_chains$(EXEEXT): $(04_sim_multilevel_chains_OBJECTS) $(04_sim_multilevel_chains_DEPENDENCIES) $(EXTRA_04_sim_multilevel_chains_DEPENDENCIES)
643 @rm -f 04-sim-multilevel_chains$(EXEEXT)
644 $(AM_V_CCLD)$(LINK) $(04_sim_multilevel_chains_OBJECTS) $(04_sim_multilevel_chains_LDADD) $(LIBS)
645
646 05-sim-long_jumps$(EXEEXT): $(05_sim_long_jumps_OBJECTS) $(05_sim_long_jumps_DEPENDENCIES) $(EXTRA_05_sim_long_jumps_DEPENDENCIES)
647 @rm -f 05-sim-long_jumps$(EXEEXT)
648 $(AM_V_CCLD)$(LINK) $(05_sim_long_jumps_OBJECTS) $(05_sim_long_jumps_LDADD) $(LIBS)
649
650 06-sim-actions$(EXEEXT): $(06_sim_actions_OBJECTS) $(06_sim_actions_DEPENDENCIES) $(EXTRA_06_sim_actions_DEPENDENCIES)
651 @rm -f 06-sim-actions$(EXEEXT)
652 $(AM_V_CCLD)$(LINK) $(06_sim_actions_OBJECTS) $(06_sim_actions_LDADD) $(LIBS)
653
654 07-sim-db_bug_looping$(EXEEXT): $(07_sim_db_bug_looping_OBJECTS) $(07_sim_db_bug_looping_DEPENDENCIES) $(EXTRA_07_sim_db_bug_looping_DEPENDENCIES)
655 @rm -f 07-sim-db_bug_looping$(EXEEXT)
656 $(AM_V_CCLD)$(LINK) $(07_sim_db_bug_looping_OBJECTS) $(07_sim_db_bug_looping_LDADD) $(LIBS)
657
658 08-sim-subtree_checks$(EXEEXT): $(08_sim_subtree_checks_OBJECTS) $(08_sim_subtree_checks_DEPENDENCIES) $(EXTRA_08_sim_subtree_checks_DEPENDENCIES)
659 @rm -f 08-sim-subtree_checks$(EXEEXT)
660 $(AM_V_CCLD)$(LINK) $(08_sim_subtree_checks_OBJECTS) $(08_sim_subtree_checks_LDADD) $(LIBS)
661
662 09-sim-syscall_priority_pre$(EXEEXT): $(09_sim_syscall_priority_pre_OBJECTS) $(09_sim_syscall_priority_pre_DEPENDENCIES) $(EXTRA_09_sim_syscall_priority_pre_DEPENDENCIES)
663 @rm -f 09-sim-syscall_priority_pre$(EXEEXT)
664 $(AM_V_CCLD)$(LINK) $(09_sim_syscall_priority_pre_OBJECTS) $(09_sim_syscall_priority_pre_LDADD) $(LIBS)
665
666 10-sim-syscall_priority_post$(EXEEXT): $(10_sim_syscall_priority_post_OBJECTS) $(10_sim_syscall_priority_post_DEPENDENCIES) $(EXTRA_10_sim_syscall_priority_post_DEPENDENCIES)
667 @rm -f 10-sim-syscall_priority_post$(EXEEXT)
668 $(AM_V_CCLD)$(LINK) $(10_sim_syscall_priority_post_OBJECTS) $(10_sim_syscall_priority_post_LDADD) $(LIBS)
669
670 11-basic-basic_errors$(EXEEXT): $(11_basic_basic_errors_OBJECTS) $(11_basic_basic_errors_DEPENDENCIES) $(EXTRA_11_basic_basic_errors_DEPENDENCIES)
671 @rm -f 11-basic-basic_errors$(EXEEXT)
672 $(AM_V_CCLD)$(LINK) $(11_basic_basic_errors_OBJECTS) $(11_basic_basic_errors_LDADD) $(LIBS)
673
674 12-sim-basic_masked_ops$(EXEEXT): $(12_sim_basic_masked_ops_OBJECTS) $(12_sim_basic_masked_ops_DEPENDENCIES) $(EXTRA_12_sim_basic_masked_ops_DEPENDENCIES)
675 @rm -f 12-sim-basic_masked_ops$(EXEEXT)
676 $(AM_V_CCLD)$(LINK) $(12_sim_basic_masked_ops_OBJECTS) $(12_sim_basic_masked_ops_LDADD) $(LIBS)
677
678 13-basic-attrs$(EXEEXT): $(13_basic_attrs_OBJECTS) $(13_basic_attrs_DEPENDENCIES) $(EXTRA_13_basic_attrs_DEPENDENCIES)
679 @rm -f 13-basic-attrs$(EXEEXT)
680 $(AM_V_CCLD)$(LINK) $(13_basic_attrs_OBJECTS) $(13_basic_attrs_LDADD) $(LIBS)
681
682 14-sim-reset$(EXEEXT): $(14_sim_reset_OBJECTS) $(14_sim_reset_DEPENDENCIES) $(EXTRA_14_sim_reset_DEPENDENCIES)
683 @rm -f 14-sim-reset$(EXEEXT)
684 $(AM_V_CCLD)$(LINK) $(14_sim_reset_OBJECTS) $(14_sim_reset_LDADD) $(LIBS)
685
686 15-basic-resolver$(EXEEXT): $(15_basic_resolver_OBJECTS) $(15_basic_resolver_DEPENDENCIES) $(EXTRA_15_basic_resolver_DEPENDENCIES)
687 @rm -f 15-basic-resolver$(EXEEXT)
688 $(AM_V_CCLD)$(LINK) $(15_basic_resolver_OBJECTS) $(15_basic_resolver_LDADD) $(LIBS)
689
690 16-sim-arch_basic$(EXEEXT): $(16_sim_arch_basic_OBJECTS) $(16_sim_arch_basic_DEPENDENCIES) $(EXTRA_16_sim_arch_basic_DEPENDENCIES)
691 @rm -f 16-sim-arch_basic$(EXEEXT)
692 $(AM_V_CCLD)$(LINK) $(16_sim_arch_basic_OBJECTS) $(16_sim_arch_basic_LDADD) $(LIBS)
693
694 17-sim-arch_merge$(EXEEXT): $(17_sim_arch_merge_OBJECTS) $(17_sim_arch_merge_DEPENDENCIES) $(EXTRA_17_sim_arch_merge_DEPENDENCIES)
695 @rm -f 17-sim-arch_merge$(EXEEXT)
696 $(AM_V_CCLD)$(LINK) $(17_sim_arch_merge_OBJECTS) $(17_sim_arch_merge_LDADD) $(LIBS)
697
698 18-sim-basic_whitelist$(EXEEXT): $(18_sim_basic_whitelist_OBJECTS) $(18_sim_basic_whitelist_DEPENDENCIES) $(EXTRA_18_sim_basic_whitelist_DEPENDENCIES)
699 @rm -f 18-sim-basic_whitelist$(EXEEXT)
700 $(AM_V_CCLD)$(LINK) $(18_sim_basic_whitelist_OBJECTS) $(18_sim_basic_whitelist_LDADD) $(LIBS)
701
702 19-sim-missing_syscalls$(EXEEXT): $(19_sim_missing_syscalls_OBJECTS) $(19_sim_missing_syscalls_DEPENDENCIES) $(EXTRA_19_sim_missing_syscalls_DEPENDENCIES)
703 @rm -f 19-sim-missing_syscalls$(EXEEXT)
704 $(AM_V_CCLD)$(LINK) $(19_sim_missing_syscalls_OBJECTS) $(19_sim_missing_syscalls_LDADD) $(LIBS)
705
706 20-live-basic_die$(EXEEXT): $(20_live_basic_die_OBJECTS) $(20_live_basic_die_DEPENDENCIES) $(EXTRA_20_live_basic_die_DEPENDENCIES)
707 @rm -f 20-live-basic_die$(EXEEXT)
708 $(AM_V_CCLD)$(LINK) $(20_live_basic_die_OBJECTS) $(20_live_basic_die_LDADD) $(LIBS)
709
710 21-live-basic_allow$(EXEEXT): $(21_live_basic_allow_OBJECTS) $(21_live_basic_allow_DEPENDENCIES) $(EXTRA_21_live_basic_allow_DEPENDENCIES)
711 @rm -f 21-live-basic_allow$(EXEEXT)
712 $(AM_V_CCLD)$(LINK) $(21_live_basic_allow_OBJECTS) $(21_live_basic_allow_LDADD) $(LIBS)
713
714 22-sim-basic_chains_array$(EXEEXT): $(22_sim_basic_chains_array_OBJECTS) $(22_sim_basic_chains_array_DEPENDENCIES) $(EXTRA_22_sim_basic_chains_array_DEPENDENCIES)
715 @rm -f 22-sim-basic_chains_array$(EXEEXT)
716 $(AM_V_CCLD)$(LINK) $(22_sim_basic_chains_array_OBJECTS) $(22_sim_basic_chains_array_LDADD) $(LIBS)
717
718 23-sim-arch_all_le_basic$(EXEEXT): $(23_sim_arch_all_le_basic_OBJECTS) $(23_sim_arch_all_le_basic_DEPENDENCIES) $(EXTRA_23_sim_arch_all_le_basic_DEPENDENCIES)
719 @rm -f 23-sim-arch_all_le_basic$(EXEEXT)
720 $(AM_V_CCLD)$(LINK) $(23_sim_arch_all_le_basic_OBJECTS) $(23_sim_arch_all_le_basic_LDADD) $(LIBS)
721
722 24-live-arg_allow$(EXEEXT): $(24_live_arg_allow_OBJECTS) $(24_live_arg_allow_DEPENDENCIES) $(EXTRA_24_live_arg_allow_DEPENDENCIES)
723 @rm -f 24-live-arg_allow$(EXEEXT)
724 $(AM_V_CCLD)$(LINK) $(24_live_arg_allow_OBJECTS) $(24_live_arg_allow_LDADD) $(LIBS)
725
726 25-sim-multilevel_chains_adv$(EXEEXT): $(25_sim_multilevel_chains_adv_OBJECTS) $(25_sim_multilevel_chains_adv_DEPENDENCIES) $(EXTRA_25_sim_multilevel_chains_adv_DEPENDENCIES)
727 @rm -f 25-sim-multilevel_chains_adv$(EXEEXT)
728 $(AM_V_CCLD)$(LINK) $(25_sim_multilevel_chains_adv_OBJECTS) $(25_sim_multilevel_chains_adv_LDADD) $(LIBS)
729
730 26-sim-arch_all_be_basic$(EXEEXT): $(26_sim_arch_all_be_basic_OBJECTS) $(26_sim_arch_all_be_basic_DEPENDENCIES) $(EXTRA_26_sim_arch_all_be_basic_DEPENDENCIES)
731 @rm -f 26-sim-arch_all_be_basic$(EXEEXT)
732 $(AM_V_CCLD)$(LINK) $(26_sim_arch_all_be_basic_OBJECTS) $(26_sim_arch_all_be_basic_LDADD) $(LIBS)
733
734 27-sim-bpf_blk_state$(EXEEXT): $(27_sim_bpf_blk_state_OBJECTS) $(27_sim_bpf_blk_state_DEPENDENCIES) $(EXTRA_27_sim_bpf_blk_state_DEPENDENCIES)
735 @rm -f 27-sim-bpf_blk_state$(EXEEXT)
736 $(AM_V_CCLD)$(LINK) $(27_sim_bpf_blk_state_OBJECTS) $(27_sim_bpf_blk_state_LDADD) $(LIBS)
737
738 28-sim-arch_x86$(EXEEXT): $(28_sim_arch_x86_OBJECTS) $(28_sim_arch_x86_DEPENDENCIES) $(EXTRA_28_sim_arch_x86_DEPENDENCIES)
739 @rm -f 28-sim-arch_x86$(EXEEXT)
740 $(AM_V_CCLD)$(LINK) $(28_sim_arch_x86_OBJECTS) $(28_sim_arch_x86_LDADD) $(LIBS)
741
742 mostlyclean-compile:
743 -rm -f *.$(OBJEXT)
744
745 distclean-compile:
746 -rm -f *.tab.c
747
748 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/00-test.Po@am__quote@
749 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/01-sim-allow.Po@am__quote@
750 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/02-sim-basic.Po@am__quote@
751 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/03-sim-basic_chains.Po@am__quote@
752 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/04-sim-multilevel_chains.Po@am__quote@
753 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/05-sim-long_jumps.Po@am__quote@
754 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/06-sim-actions.Po@am__quote@
755 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/07-sim-db_bug_looping.Po@am__quote@
756 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/08-sim-subtree_checks.Po@am__quote@
757 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/09-sim-syscall_priority_pre.Po@am__quote@
758 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/10-sim-syscall_priority_post.Po@am__quote@
759 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/11-basic-basic_errors.Po@am__quote@
760 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/12-sim-basic_masked_ops.Po@am__quote@
761 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/13-basic-attrs.Po@am__quote@
762 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/14-sim-reset.Po@am__quote@
763 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/15-basic-resolver.Po@am__quote@
764 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/16-sim-arch_basic.Po@am__quote@
765 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/17-sim-arch_merge.Po@am__quote@
766 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/18-sim-basic_whitelist.Po@am__quote@
767 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/19-sim-missing_syscalls.Po@am__quote@
768 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/20-live-basic_die.Po@am__quote@
769 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/21-live-basic_allow.Po@am__quote@
770 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/22-sim-basic_chains_array.Po@am__quote@
771 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/23-sim-arch_all_le_basic.Po@am__quote@
772 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/24-live-arg_allow.Po@am__quote@
773 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/25-sim-multilevel_chains_adv.Po@am__quote@
774 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/26-sim-arch_all_be_basic.Po@am__quote@
775 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/27-sim-bpf_blk_state.Po@am__quote@
776 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/28-sim-arch_x86.Po@am__quote@
777 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@
778
779 .c.o:
780 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
781 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
782 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
783 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
784 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
785 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
786
787 .c.obj:
788 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
789 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
790 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
791 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
792 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
793 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
794
795 .c.lo:
796 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
797 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
798 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
799 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
800 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
801 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
802
803 mostlyclean-libtool:
804 -rm -f *.lo
805
806 clean-libtool:
807 -rm -rf .libs _libs
808
809 ID: $(am__tagged_files)
810 $(am__define_uniq_tagged_files); mkid -fID $$unique
811 tags: tags-am
812 TAGS: tags
813
814 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
815 set x; \
816 here=`pwd`; \
817 $(am__define_uniq_tagged_files); \
818 shift; \
819 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
820 test -n "$$unique" || unique=$$empty_fix; \
821 if test $$# -gt 0; then \
822 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
823 "$$@" $$unique; \
824 else \
825 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
826 $$unique; \
827 fi; \
828 fi
829 ctags: ctags-am
830
831 CTAGS: ctags
832 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
833 $(am__define_uniq_tagged_files); \
834 test -z "$(CTAGS_ARGS)$$unique" \
835 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
836 $$unique
837
838 GTAGS:
839 here=`$(am__cd) $(top_builddir) && pwd` \
840 && $(am__cd) $(top_srcdir) \
841 && gtags -i $(GTAGS_ARGS) "$$here"
842 cscopelist: cscopelist-am
843
844 cscopelist-am: $(am__tagged_files)
845 list='$(am__tagged_files)'; \
846 case "$(srcdir)" in \
847 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
848 *) sdir=$(subdir)/$(srcdir) ;; \
849 esac; \
850 for i in $$list; do \
851 if test -f "$$i"; then \
852 echo "$(subdir)/$$i"; \
853 else \
854 echo "$$sdir/$$i"; \
855 fi; \
856 done >> $(top_builddir)/cscope.files
857
858 distclean-tags:
859 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
860
861 check-TESTS: $(TESTS)
862 @failed=0; all=0; xfail=0; xpass=0; skip=0; \
863 srcdir=$(srcdir); export srcdir; \
864 list=' $(TESTS) '; \
865 $(am__tty_colors); \
866 if test -n "$$list"; then \
867 for tst in $$list; do \
868 if test -f ./$$tst; then dir=./; \
869 elif test -f $$tst; then dir=; \
870 else dir="$(srcdir)/"; fi; \
871 if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \
872 all=`expr $$all + 1`; \
873 case " $(XFAIL_TESTS) " in \
874 *[\ \ ]$$tst[\ \ ]*) \
875 xpass=`expr $$xpass + 1`; \
876 failed=`expr $$failed + 1`; \
877 col=$$red; res=XPASS; \
878 ;; \
879 *) \
880 col=$$grn; res=PASS; \
881 ;; \
882 esac; \
883 elif test $$? -ne 77; then \
884 all=`expr $$all + 1`; \
885 case " $(XFAIL_TESTS) " in \
886 *[\ \ ]$$tst[\ \ ]*) \
887 xfail=`expr $$xfail + 1`; \
888 col=$$lgn; res=XFAIL; \
889 ;; \
890 *) \
891 failed=`expr $$failed + 1`; \
892 col=$$red; res=FAIL; \
893 ;; \
894 esac; \
895 else \
896 skip=`expr $$skip + 1`; \
897 col=$$blu; res=SKIP; \
898 fi; \
899 echo "$${col}$$res$${std}: $$tst"; \
900 done; \
901 if test "$$all" -eq 1; then \
902 tests="test"; \
903 All=""; \
904 else \
905 tests="tests"; \
906 All="All "; \
907 fi; \
908 if test "$$failed" -eq 0; then \
909 if test "$$xfail" -eq 0; then \
910 banner="$$All$$all $$tests passed"; \
911 else \
912 if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
913 banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
914 fi; \
915 else \
916 if test "$$xpass" -eq 0; then \
917 banner="$$failed of $$all $$tests failed"; \
918 else \
919 if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
920 banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
921 fi; \
922 fi; \
923 dashes="$$banner"; \
924 skipped=""; \
925 if test "$$skip" -ne 0; then \
926 if test "$$skip" -eq 1; then \
927 skipped="($$skip test was not run)"; \
928 else \
929 skipped="($$skip tests were not run)"; \
930 fi; \
931 test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
932 dashes="$$skipped"; \
933 fi; \
934 report=""; \
935 if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
936 report="Please report to $(PACKAGE_BUGREPORT)"; \
937 test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
938 dashes="$$report"; \
939 fi; \
940 dashes=`echo "$$dashes" | sed s/./=/g`; \
941 if test "$$failed" -eq 0; then \
942 col="$$grn"; \
943 else \
944 col="$$red"; \
945 fi; \
946 echo "$${col}$$dashes$${std}"; \
947 echo "$${col}$$banner$${std}"; \
948 test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
949 test -z "$$report" || echo "$${col}$$report$${std}"; \
950 echo "$${col}$$dashes$${std}"; \
951 test "$$failed" -eq 0; \
952 else :; fi
953
954 distdir: $(DISTFILES)
955 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
956 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
957 list='$(DISTFILES)'; \
958 dist_files=`for file in $$list; do echo $$file; done | \
959 sed -e "s|^$$srcdirstrip/||;t" \
960 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
961 case $$dist_files in \
962 */*) $(MKDIR_P) `echo "$$dist_files" | \
963 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
964 sort -u` ;; \
965 esac; \
966 for file in $$dist_files; do \
967 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
968 if test -d $$d/$$file; then \
969 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
970 if test -d "$(distdir)/$$file"; then \
971 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
972 fi; \
973 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
974 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
975 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
976 fi; \
977 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
978 else \
979 test -f "$(distdir)/$$file" \
980 || cp -p $$d/$$file "$(distdir)/$$file" \
981 || exit 1; \
982 fi; \
983 done
984 check-am: all-am
985 $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) $(check_PROGRAMS)
986 $(MAKE) $(AM_MAKEFLAGS) check-TESTS
987 check: check-am
988 all-am: Makefile
989 installdirs:
990 install: install-am
991 install-exec: install-exec-am
992 install-data: install-data-am
993 uninstall: uninstall-am
994
995 install-am: all-am
996 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
997
998 installcheck: installcheck-am
999 install-strip:
1000 if test -z '$(STRIP)'; then \
1001 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1002 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1003 install; \
1004 else \
1005 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
1006 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
1007 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
1008 fi
1009 mostlyclean-generic:
1010
1011 clean-generic:
1012
1013 distclean-generic:
1014 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
1015 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
1016
1017 maintainer-clean-generic:
1018 @echo "This command is intended for maintainers to use"
1019 @echo "it deletes files that may require special tools to rebuild."
1020 clean: clean-am
1021
1022 clean-am: clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \
1023 clean-libtool clean-local mostlyclean-am
1024
1025 distclean: distclean-am
1026 -rm -rf ./$(DEPDIR)
1027 -rm -f Makefile
1028 distclean-am: clean-am distclean-compile distclean-generic \
1029 distclean-tags
1030
1031 dvi: dvi-am
1032
1033 dvi-am:
1034
1035 html: html-am
1036
1037 html-am:
1038
1039 info: info-am
1040
1041 info-am:
1042
1043 install-data-am:
1044
1045 install-dvi: install-dvi-am
1046
1047 install-dvi-am:
1048
1049 install-exec-am:
1050
1051 install-html: install-html-am
1052
1053 install-html-am:
1054
1055 install-info: install-info-am
1056
1057 install-info-am:
1058
1059 install-man:
1060
1061 install-pdf: install-pdf-am
1062
1063 install-pdf-am:
1064
1065 install-ps: install-ps-am
1066
1067 install-ps-am:
1068
1069 installcheck-am:
1070
1071 maintainer-clean: maintainer-clean-am
1072 -rm -rf ./$(DEPDIR)
1073 -rm -f Makefile
1074 maintainer-clean-am: distclean-am maintainer-clean-generic
1075
1076 mostlyclean: mostlyclean-am
1077
1078 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
1079 mostlyclean-libtool
1080
1081 pdf: pdf-am
1082
1083 pdf-am:
1084
1085 ps: ps-am
1086
1087 ps-am:
1088
1089 uninstall-am:
1090
1091 .MAKE: check-am install-am install-strip
1092
1093 .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
1094 clean-checkLTLIBRARIES clean-checkPROGRAMS clean-generic \
1095 clean-libtool clean-local cscopelist-am ctags ctags-am \
1096 distclean distclean-compile distclean-generic \
1097 distclean-libtool distclean-tags distdir dvi dvi-am html \
1098 html-am info info-am install install-am install-data \
1099 install-data-am install-dvi install-dvi-am install-exec \
1100 install-exec-am install-html install-html-am install-info \
1101 install-info-am install-man install-pdf install-pdf-am \
1102 install-ps install-ps-am install-strip installcheck \
1103 installcheck-am installdirs maintainer-clean \
1104 maintainer-clean-generic mostlyclean mostlyclean-compile \
1105 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
1106 tags tags-am uninstall uninstall-am
1107
1108
1109 check-build:
1110 ${MAKE} ${AM_MAKEFLAGS} ${check_PROGRAMS}
1111
1112 clean-local:
1113 ${RM} -f 00-test *.pyc
1114
1115 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1116 # Otherwise a system limit (for SysV at least) may be exceeded.
1117 .NOEXPORT:
2020 # along with this library; if not, see <http://www.gnu.org/licenses>.
2121 #
2222
23 GLBL_ARCH_SUPPORT="x86 x86_64 x32 arm"
23 GLBL_ARCH_LE_SUPPORT="x86 x86_64 x32 arm aarch64 mipsel mipsel64 mipsel64n32"
24 GLBL_ARCH_BE_SUPPORT="mips mips64 mips64n32"
2425
2526 GLBL_SYS_ARCH="../tools/scmp_arch_detect"
2627 GLBL_SYS_RESOLVER="../tools/scmp_sys_resolver"
340341 local -a high_arg #line[3-8]
341342 local result=${line[9]}
342343
343 if [[ "${testarch:0:1}" == "+" ]]; then
344 # run the tests on the specified architecture(s)
345 simarch_list="${testarch:1}"
346 if [[ "$simarch_list" == "all" ]]; then
347 simarch_list="$GLBL_ARCH_SUPPORT"
344 # expand the architecture list
345 local simarch_tmp
346 local simarch_avoid
347 simarch_tmp=""
348 simarch_avoid=""
349 for arch_i in $(echo $testarch | sed -e 's/,/ /g'); do
350 case $arch_i in
351 all)
352 # add the native arch
353 simarch_tmp+=" $arch"
354 ;;
355 all_le)
356 # add the native arch only if it is little endian
357 if echo "$GLBL_ARCH_LE_SUPPORT" | grep -qw "$arch"; then
358 simarch_tmp+=" $arch"
359 fi
360 ;;
361 +all_le)
362 # add all of the little endian architectures
363 simarch_tmp+=" $GLBL_ARCH_LE_SUPPORT"
364 ;;
365 all_be)
366 # add the native arch only if it is big endian
367 if echo "$GLBL_ARCH_BE_SUPPORT" | grep -qw "$arch"; then
368 simarch_tmp+=" $arch"
369 fi
370 ;;
371 +all_be)
372 # add all of the big endian architectures
373 simarch_tmp+=" $GLBL_ARCH_BE_SUPPORT"
374 ;;
375 +*)
376 # add the architecture specified
377 simarch_tmp+=" ${arch_i:1}"
378 ;;
379 -*)
380 # remove the architecture specified
381 simarch_avoid+=" ${arch_i:1}"
382 ;;
383 *)
384 # add the architecture specified if it is native
385 if [[ "$arch_i" == "$arch" ]]; then
386 simarch_tmp+=" $arch_i"
387 fi
388 ;;
389 esac
390 done
391
392 # make sure we remove any undesired architectures
393 local simarch_list
394 simarch_list=""
395 for arch_i in $simarch_tmp; do
396 if echo "$simarch_avoid" | grep -q -v -w "$arch_i"; then
397 simarch_list+=" $arch_i"
348398 fi
349 elif [[ "$testarch" != "all" ]] && [[ "$testarch" != "$arch" ]]; then
350 # only run tests that match the current architecture
399 done
400 simarch_list=$(echo $simarch_list | sed -e 's/ / /g;s/^ //;')
401
402 # do we have any architectures remaining in the list?
403 if [[ $simarch_list == "" ]]; then
351404 print_result $(generate_test_num "$1" $2 1) "INFO" \
352 "Test skipped due to test/system architecture difference"
405 "Test skipped due to architecture difference"
353406 stats_skipped=$(($stats_skipped+1))
354407 return
355 else
356 # run the tests on the native architecture
357 simarch_list="$arch"
358408 fi
359409
360410 # get low and high range arg values
543593 #
544594 function run_test_bpf_valgrind() {
545595 local rc
546 local testcmd
547596
548597 # we only support the native/c test mode here
549598 if [[ $mode != "c" ]]; then
555604 print_data "$1" "$2"
556605
557606 # build the command
558 testcmd="$2"
559607 testvalgrind="valgrind \
560608 --tool=memcheck \
561609 --error-exitcode=1 \
562610 --leak-check=full \
563611 --read-var-info=yes \
564 --track-origins=yes"
612 --track-origins=yes \
613 --suppressions=$basedir/valgrind_test.supp"
565614 if [[ -n $logfile ]]; then
566615 testvalgrind+=" --log-fd=$logfd"
567616 fi
572621 # run the command
573622 exec 4>/dev/null
574623 print_valgrind "$1"
575 run_test_command "$1" "$testvalgrind --" "./$testcmd -b" 4 2
624 run_test_command "$1" "$testvalgrind --" "./$2 -b" 4 2
576625 rc=$?
577626 exec 4>&-
578627 if [[ $rc -ne 0 ]]; then
613662 run_test_command "$1" "./$line_cmd" "$line_act" "" 4
614663 rc=$?
615664 exec 4>&-
616
617 # return value codes for this test type:
618 # 159: KILL
619 # 160: ALLOW
620 # 161: TRAP
621 # 162: TRACE (currently unsupported)
622 # 163: ERRNO
623 if [[ $line_act == "KILL" && $rc -eq 159 ]]; then
665 stats_all=$(($stats_all+1))
666
667 # setup the arch specific return values
668 case "$arch" in
669 x86|x86_64|x32|arm|aarch64)
670 rc_kill=159
671 rc_allow=160
672 rc_trap=161
673 rc_trace=162
674 rc_errno=163
675 ;;
676 mips|mipsel|mips64|mips64n32|mipsel64|mipsel64n32)
677 rc_kill=140
678 rc_allow=160
679 rc_trap=161
680 rc_trace=162
681 rc_errno=163
682 ;;
683 *)
684 print_result $testnumstr "ERROR" "arch $arch not supported"
685 stats_error=$(($stats_error+1))
686 return
687 ;;
688 esac
689
690 # verify the results
691 if [[ $line_act == "KILL" && $rc -eq $rc_kill ]]; then
624692 print_result $1 "SUCCESS" ""
625693 stats_success=$(($stats_success+1))
626 elif [[ $line_act == "ALLOW" && $rc -eq 160 ]]; then
694 elif [[ $line_act == "ALLOW" && $rc -eq $rc_allow ]]; then
627695 print_result $1 "SUCCESS" ""
628696 stats_success=$(($stats_success+1))
629 elif [[ $line_act == "TRAP" && $rc -eq 161 ]]; then
697 elif [[ $line_act == "TRAP" && $rc -eq $rc_trap ]]; then
630698 print_result $1 "SUCCESS" ""
631699 stats_success=$(($stats_success+1))
632700 elif [[ $line_act == "TRACE" ]]; then
633701 print_result $1 "ERROR" "unsupported action \"$line_act\""
634702 stats_error=$(($stats_error+1))
635 elif [[ $line_act == "ERRNO" && $rc -eq 163 ]]; then
703 elif [[ $line_act == "ERRNO" && $rc -eq $rc_errno ]]; then
636704 print_result $1 "SUCCESS" ""
637705 stats_success=$(($stats_success+1))
638706 else
639707 print_result $1 "FAILURE" "$line_test rc=$rc"
640708 stats_failure=$(($stats_failure+1))
641709 fi
642 stats_all=$(($stats_all+1))
643710 }
644711
645712 #
690757 #
691758 function run_tests() {
692759 # loop through all test files
693 for file in *.tests; do
760 for file in $basedir/*.tests; do
694761 local testnum=1
695762 local batch_requested=false
696763 local batch_name=""
758825 # verify general script dependencies
759826 verify_deps head
760827 verify_deps sed
828 verify_deps awk
761829 verify_deps seq
762830 verify_deps tr
763831
781849 stats_failure=0
782850 stats_error=0
783851
852 # set the test root directory
853 basedir=$(dirname $0)
854
855 # parse the command line
784856 while getopts "ab:gl:m:s:t:T:vh" opt; do
785857 case $opt in
786858 a)
827899 esac
828900 done
829901
830 # default to running the C tests
902 # determine the mode test automatically
831903 if [[ -z $mode_list ]]; then
904 # always perform the native c tests
832905 mode_list="c"
906
907 # query the build configuration
908 if [[ -r "../configure.h" ]]; then
909 # python tests
910 [[ "$(grep "ENABLE_PYTHON" ../configure.h | \
911 awk '{ print $3 }')" = "1" ]] && \
912 mode_list="$mode_list python"
913 fi
833914 fi
834915
835916 # default to all tests if batch or single tests not requested
131131 --leak-check=full \
132132 --read-var-info=yes \
133133 --track-origins=yes \
134 --suppressions=valgrind_test.supp \
134135 -- ./$batch_name -b > /dev/null
135136 rc=$?
136137 stats_all=$(($stats_all + 1))
0 #
1 # Valgrind suppression file for the libseccomp automated tests
2 #
3
4 # information:
5 # to create entries run with the "--gen-suppressions=all" option, e.g.
6 # valgrind --gen-suppressions=all ...
7 # to use the suppressions run with the "--suppressions" options, e.g.
8 # valgrind --suppressions=<file> ...
9
10 # Gentoo x86-64 system with valgrind-3.9.0 and glibc-2.19
11 {
12 gentoo-x86-64_valgrind-3.9.0_glibc-2.19_1
13 Memcheck:Cond
14 fun:index
15 fun:expand_dynamic_string_token
16 fun:_dl_map_object
17 fun:map_doit
18 fun:_dl_catch_error
19 fun:do_preload
20 fun:dl_main
21 fun:_dl_sysdep_start
22 fun:_dl_start
23 obj:/lib64/ld-2.19.so
24 obj:*
25 obj:*
26 }
+0
-66
tools/Makefile less more
0 #
1 # Enhanced Seccomp Library Makefile
2 #
3 # Copyright (c) 2012 Red Hat <pmoore@redhat.com>
4 # Author: Paul Moore <pmoore@redhat.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 # macros
23 #
24
25 include ../macros.mk
26
27 #
28 # configuration
29 #
30
31 include $(TOPDIR)/configure.mk
32 include $(TOPDIR)/install.mk
33
34 LDFLAGS := ../src/libseccomp.a
35
36 TOOLS = scmp_bpf_disasm \
37 scmp_bpf_sim \
38 scmp_sys_resolver \
39 scmp_arch_detect
40
41 TOOLS_INSTALL = scmp_sys_resolver
42
43 DEPS = $(TOOLS:%=%.d)
44
45 #
46 # targets
47 #
48
49 .PHONY: install clean
50
51 all: $(TOOLS)
52
53 -include $(DEPS)
54
55 $(DEPS):
56 $(MAKEDEP_EXEC)
57
58 $(TOOLS):
59 $(COMPILE_EXEC)
60
61 install: $(TOOLS_INSTALL)
62 $(INSTALL_BIN_MACRO)
63
64 clean:
65 $(RM) $(DEPS) $(TOOLS)
0 ####
1 # Seccomp Library Utility Tools
2 #
3
4 #
5 # This library is free software; you can redistribute it and/or modify it
6 # under the terms of version 2.1 of the GNU Lesser General Public License
7 # as published by the Free Software Foundation.
8 #
9 # This library is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public License
15 # along with this library; if not, see <http://www.gnu.org/licenses>.
16 #
17
18 AM_CPPFLAGS = -I$(top_builddir)/include
19
20 noinst_LTLIBRARIES = util.la
21 util_la_SOURCES = util.c util.h bpf.h
22 util_la_LDFLAGS = -module
23
24 bin_PROGRAMS = \
25 scmp_sys_resolver
26 noinst_PROGRAMS = \
27 scmp_arch_detect \
28 scmp_bpf_disasm \
29 scmp_bpf_sim
30
31 EXTRA_DIST = check-syntax scmp_app_inspector
32
33 scmp_bpf_disasm_SOURCES = scmp_bpf_disasm.c bpf.h util.h
34 scmp_bpf_sim_SOURCES = scmp_bpf_sim.c bpf.h util.h
35
36 scmp_sys_resolver_LDADD = ../src/libseccomp.la
37 scmp_sys_resolver_LDFLAGS = -static
38 scmp_arch_detect_LDADD = ../src/libseccomp.la
39 scmp_arch_detect_LDFLAGS = -static
40 scmp_bpf_disasm_LDADD = util.la
41 scmp_bpf_sim_LDADD = util.la
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
1 # @configure_input@
2
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
4
5 # This Makefile.in is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 @SET_MAKE@
15
16 ####
17 # Seccomp Library Utility Tools
18 #
19
20 #
21 # This library is free software; you can redistribute it and/or modify it
22 # under the terms of version 2.1 of the GNU Lesser General Public License
23 # as published by the Free Software Foundation.
24 #
25 # This library is distributed in the hope that it will be useful, but
26 # WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
28 # General Public License for more details.
29 #
30 # You should have received a copy of the GNU Lesser General Public License
31 # along with this library; if not, see <http://www.gnu.org/licenses>.
32 #
33
34
35 VPATH = @srcdir@
36 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
37 am__make_running_with_option = \
38 case $${target_option-} in \
39 ?) ;; \
40 *) echo "am__make_running_with_option: internal error: invalid" \
41 "target option '$${target_option-}' specified" >&2; \
42 exit 1;; \
43 esac; \
44 has_opt=no; \
45 sane_makeflags=$$MAKEFLAGS; \
46 if $(am__is_gnu_make); then \
47 sane_makeflags=$$MFLAGS; \
48 else \
49 case $$MAKEFLAGS in \
50 *\\[\ \ ]*) \
51 bs=\\; \
52 sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
53 | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
54 esac; \
55 fi; \
56 skip_next=no; \
57 strip_trailopt () \
58 { \
59 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
60 }; \
61 for flg in $$sane_makeflags; do \
62 test $$skip_next = yes && { skip_next=no; continue; }; \
63 case $$flg in \
64 *=*|--*) continue;; \
65 -*I) strip_trailopt 'I'; skip_next=yes;; \
66 -*I?*) strip_trailopt 'I';; \
67 -*O) strip_trailopt 'O'; skip_next=yes;; \
68 -*O?*) strip_trailopt 'O';; \
69 -*l) strip_trailopt 'l'; skip_next=yes;; \
70 -*l?*) strip_trailopt 'l';; \
71 -[dEDm]) skip_next=yes;; \
72 -[JT]) skip_next=yes;; \
73 esac; \
74 case $$flg in \
75 *$$target_option*) has_opt=yes; break;; \
76 esac; \
77 done; \
78 test $$has_opt = yes
79 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
80 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
81 pkgdatadir = $(datadir)/@PACKAGE@
82 pkgincludedir = $(includedir)/@PACKAGE@
83 pkglibdir = $(libdir)/@PACKAGE@
84 pkglibexecdir = $(libexecdir)/@PACKAGE@
85 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
86 install_sh_DATA = $(install_sh) -c -m 644
87 install_sh_PROGRAM = $(install_sh) -c
88 install_sh_SCRIPT = $(install_sh) -c
89 INSTALL_HEADER = $(INSTALL_DATA)
90 transform = $(program_transform_name)
91 NORMAL_INSTALL = :
92 PRE_INSTALL = :
93 POST_INSTALL = :
94 NORMAL_UNINSTALL = :
95 PRE_UNINSTALL = :
96 POST_UNINSTALL = :
97 build_triplet = @build@
98 host_triplet = @host@
99 bin_PROGRAMS = scmp_sys_resolver$(EXEEXT)
100 noinst_PROGRAMS = scmp_arch_detect$(EXEEXT) scmp_bpf_disasm$(EXEEXT) \
101 scmp_bpf_sim$(EXEEXT)
102 subdir = tools
103 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
104 $(top_srcdir)/build-aux/depcomp
105 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
110 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
111 $(ACLOCAL_M4)
112 mkinstalldirs = $(install_sh) -d
113 CONFIG_HEADER = $(top_builddir)/configure.h
114 CONFIG_CLEAN_FILES =
115 CONFIG_CLEAN_VPATH_FILES =
116 LTLIBRARIES = $(noinst_LTLIBRARIES)
117 util_la_LIBADD =
118 am_util_la_OBJECTS = util.lo
119 util_la_OBJECTS = $(am_util_la_OBJECTS)
120 AM_V_lt = $(am__v_lt_@AM_V@)
121 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
122 am__v_lt_0 = --silent
123 am__v_lt_1 =
124 util_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
125 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
126 $(util_la_LDFLAGS) $(LDFLAGS) -o $@
127 am__installdirs = "$(DESTDIR)$(bindir)"
128 PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
129 scmp_arch_detect_SOURCES = scmp_arch_detect.c
130 scmp_arch_detect_OBJECTS = scmp_arch_detect.$(OBJEXT)
131 scmp_arch_detect_DEPENDENCIES = ../src/libseccomp.la
132 scmp_arch_detect_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
133 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
134 $(AM_CFLAGS) $(CFLAGS) $(scmp_arch_detect_LDFLAGS) $(LDFLAGS) \
135 -o $@
136 am_scmp_bpf_disasm_OBJECTS = scmp_bpf_disasm.$(OBJEXT)
137 scmp_bpf_disasm_OBJECTS = $(am_scmp_bpf_disasm_OBJECTS)
138 scmp_bpf_disasm_DEPENDENCIES = util.la
139 am_scmp_bpf_sim_OBJECTS = scmp_bpf_sim.$(OBJEXT)
140 scmp_bpf_sim_OBJECTS = $(am_scmp_bpf_sim_OBJECTS)
141 scmp_bpf_sim_DEPENDENCIES = util.la
142 scmp_sys_resolver_SOURCES = scmp_sys_resolver.c
143 scmp_sys_resolver_OBJECTS = scmp_sys_resolver.$(OBJEXT)
144 scmp_sys_resolver_DEPENDENCIES = ../src/libseccomp.la
145 scmp_sys_resolver_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
146 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
147 $(AM_CFLAGS) $(CFLAGS) $(scmp_sys_resolver_LDFLAGS) $(LDFLAGS) \
148 -o $@
149 AM_V_P = $(am__v_P_@AM_V@)
150 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
151 am__v_P_0 = false
152 am__v_P_1 = :
153 AM_V_GEN = $(am__v_GEN_@AM_V@)
154 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
155 am__v_GEN_0 = @echo " GEN " $@;
156 am__v_GEN_1 =
157 AM_V_at = $(am__v_at_@AM_V@)
158 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
159 am__v_at_0 = @
160 am__v_at_1 =
161 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
162 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
163 am__depfiles_maybe = depfiles
164 am__mv = mv -f
165 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
166 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
167 LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
168 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
169 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
170 $(AM_CFLAGS) $(CFLAGS)
171 AM_V_CC = $(am__v_CC_@AM_V@)
172 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
173 am__v_CC_0 = @echo " CC " $@;
174 am__v_CC_1 =
175 CCLD = $(CC)
176 LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
177 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
178 $(AM_LDFLAGS) $(LDFLAGS) -o $@
179 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
180 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
181 am__v_CCLD_0 = @echo " CCLD " $@;
182 am__v_CCLD_1 =
183 SOURCES = $(util_la_SOURCES) scmp_arch_detect.c \
184 $(scmp_bpf_disasm_SOURCES) $(scmp_bpf_sim_SOURCES) \
185 scmp_sys_resolver.c
186 DIST_SOURCES = $(util_la_SOURCES) scmp_arch_detect.c \
187 $(scmp_bpf_disasm_SOURCES) $(scmp_bpf_sim_SOURCES) \
188 scmp_sys_resolver.c
189 am__can_run_installinfo = \
190 case $$AM_UPDATE_INFO_DIR in \
191 n|no|NO) false;; \
192 *) (install-info --version) >/dev/null 2>&1;; \
193 esac
194 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
195 # Read a list of newline-separated strings from the standard input,
196 # and print each of them once, without duplicates. Input order is
197 # *not* preserved.
198 am__uniquify_input = $(AWK) '\
199 BEGIN { nonempty = 0; } \
200 { items[$$0] = 1; nonempty = 1; } \
201 END { if (nonempty) { for (i in items) print i; }; } \
202 '
203 # Make sure the list of sources is unique. This is necessary because,
204 # e.g., the same source file might be shared among _SOURCES variables
205 # for different programs/libraries.
206 am__define_uniq_tagged_files = \
207 list='$(am__tagged_files)'; \
208 unique=`for i in $$list; do \
209 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
210 done | $(am__uniquify_input)`
211 ETAGS = etags
212 CTAGS = ctags
213 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
214 ACLOCAL = @ACLOCAL@
215 AMTAR = @AMTAR@
216 AM_CFLAGS = @AM_CFLAGS@
217 AM_CPPFLAGS = -I$(top_builddir)/include
218 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
219 AM_LDFLAGS = @AM_LDFLAGS@
220 AR = @AR@
221 AUTOCONF = @AUTOCONF@
222 AUTOHEADER = @AUTOHEADER@
223 AUTOMAKE = @AUTOMAKE@
224 AWK = @AWK@
225 CC = @CC@
226 CCDEPMODE = @CCDEPMODE@
227 CFLAGS = @CFLAGS@
228 CPP = @CPP@
229 CPPFLAGS = @CPPFLAGS@
230 CYGPATH_W = @CYGPATH_W@
231 DEFS = @DEFS@
232 DEPDIR = @DEPDIR@
233 DLLTOOL = @DLLTOOL@
234 DSYMUTIL = @DSYMUTIL@
235 DUMPBIN = @DUMPBIN@
236 ECHO_C = @ECHO_C@
237 ECHO_N = @ECHO_N@
238 ECHO_T = @ECHO_T@
239 EGREP = @EGREP@
240 EXEEXT = @EXEEXT@
241 FGREP = @FGREP@
242 GREP = @GREP@
243 INSTALL = @INSTALL@
244 INSTALL_DATA = @INSTALL_DATA@
245 INSTALL_PROGRAM = @INSTALL_PROGRAM@
246 INSTALL_SCRIPT = @INSTALL_SCRIPT@
247 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
248 LD = @LD@
249 LDFLAGS = @LDFLAGS@
250 LIBOBJS = @LIBOBJS@
251 LIBS = @LIBS@
252 LIBTOOL = @LIBTOOL@
253 LIPO = @LIPO@
254 LN_S = @LN_S@
255 LTLIBOBJS = @LTLIBOBJS@
256 LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
257 MAKEINFO = @MAKEINFO@
258 MANIFEST_TOOL = @MANIFEST_TOOL@
259 MKDIR_P = @MKDIR_P@
260 NM = @NM@
261 NMEDIT = @NMEDIT@
262 OBJDUMP = @OBJDUMP@
263 OBJEXT = @OBJEXT@
264 OTOOL = @OTOOL@
265 OTOOL64 = @OTOOL64@
266 PACKAGE = @PACKAGE@
267 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
268 PACKAGE_NAME = @PACKAGE_NAME@
269 PACKAGE_STRING = @PACKAGE_STRING@
270 PACKAGE_TARNAME = @PACKAGE_TARNAME@
271 PACKAGE_URL = @PACKAGE_URL@
272 PACKAGE_VERSION = @PACKAGE_VERSION@
273 PATH_SEPARATOR = @PATH_SEPARATOR@
274 RANLIB = @RANLIB@
275 SED = @SED@
276 SET_MAKE = @SET_MAKE@
277 SHELL = @SHELL@
278 STRIP = @STRIP@
279 VERSION = @VERSION@
280 VERSION_MAJOR = @VERSION_MAJOR@
281 VERSION_MICRO = @VERSION_MICRO@
282 VERSION_MINOR = @VERSION_MINOR@
283 abs_builddir = @abs_builddir@
284 abs_srcdir = @abs_srcdir@
285 abs_top_builddir = @abs_top_builddir@
286 abs_top_srcdir = @abs_top_srcdir@
287 ac_ct_AR = @ac_ct_AR@
288 ac_ct_CC = @ac_ct_CC@
289 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
290 am__include = @am__include@
291 am__leading_dot = @am__leading_dot@
292 am__quote = @am__quote@
293 am__tar = @am__tar@
294 am__untar = @am__untar@
295 bindir = @bindir@
296 build = @build@
297 build_alias = @build_alias@
298 build_cpu = @build_cpu@
299 build_os = @build_os@
300 build_vendor = @build_vendor@
301 builddir = @builddir@
302 datadir = @datadir@
303 datarootdir = @datarootdir@
304 docdir = @docdir@
305 dvidir = @dvidir@
306 exec_prefix = @exec_prefix@
307 have_coverity = @have_coverity@
308 have_cython = @have_cython@
309 host = @host@
310 host_alias = @host_alias@
311 host_cpu = @host_cpu@
312 host_os = @host_os@
313 host_vendor = @host_vendor@
314 htmldir = @htmldir@
315 includedir = @includedir@
316 infodir = @infodir@
317 install_sh = @install_sh@
318 libdir = @libdir@
319 libexecdir = @libexecdir@
320 localedir = @localedir@
321 localstatedir = @localstatedir@
322 mandir = @mandir@
323 mkdir_p = @mkdir_p@
324 oldincludedir = @oldincludedir@
325 pdfdir = @pdfdir@
326 prefix = @prefix@
327 program_transform_name = @program_transform_name@
328 psdir = @psdir@
329 sbindir = @sbindir@
330 sharedstatedir = @sharedstatedir@
331 srcdir = @srcdir@
332 sysconfdir = @sysconfdir@
333 target_alias = @target_alias@
334 top_build_prefix = @top_build_prefix@
335 top_builddir = @top_builddir@
336 top_srcdir = @top_srcdir@
337 noinst_LTLIBRARIES = util.la
338 util_la_SOURCES = util.c util.h bpf.h
339 util_la_LDFLAGS = -module
340 EXTRA_DIST = check-syntax scmp_app_inspector
341 scmp_bpf_disasm_SOURCES = scmp_bpf_disasm.c bpf.h util.h
342 scmp_bpf_sim_SOURCES = scmp_bpf_sim.c bpf.h util.h
343 scmp_sys_resolver_LDADD = ../src/libseccomp.la
344 scmp_sys_resolver_LDFLAGS = -static
345 scmp_arch_detect_LDADD = ../src/libseccomp.la
346 scmp_arch_detect_LDFLAGS = -static
347 scmp_bpf_disasm_LDADD = util.la
348 scmp_bpf_sim_LDADD = util.la
349 all: all-am
350
351 .SUFFIXES:
352 .SUFFIXES: .c .lo .o .obj
353 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
354 @for dep in $?; do \
355 case '$(am__configure_deps)' in \
356 *$$dep*) \
357 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
358 && { if test -f $@; then exit 0; else break; fi; }; \
359 exit 1;; \
360 esac; \
361 done; \
362 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
363 $(am__cd) $(top_srcdir) && \
364 $(AUTOMAKE) --foreign tools/Makefile
365 .PRECIOUS: Makefile
366 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
367 @case '$?' in \
368 *config.status*) \
369 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
370 *) \
371 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
372 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
373 esac;
374
375 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
376 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
377
378 $(top_srcdir)/configure: $(am__configure_deps)
379 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
380 $(ACLOCAL_M4): $(am__aclocal_m4_deps)
381 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
382 $(am__aclocal_m4_deps):
383
384 clean-noinstLTLIBRARIES:
385 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
386 @list='$(noinst_LTLIBRARIES)'; \
387 locs=`for p in $$list; do echo $$p; done | \
388 sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
389 sort -u`; \
390 test -z "$$locs" || { \
391 echo rm -f $${locs}; \
392 rm -f $${locs}; \
393 }
394
395 util.la: $(util_la_OBJECTS) $(util_la_DEPENDENCIES) $(EXTRA_util_la_DEPENDENCIES)
396 $(AM_V_CCLD)$(util_la_LINK) $(util_la_OBJECTS) $(util_la_LIBADD) $(LIBS)
397 install-binPROGRAMS: $(bin_PROGRAMS)
398 @$(NORMAL_INSTALL)
399 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
400 if test -n "$$list"; then \
401 echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
402 $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
403 fi; \
404 for p in $$list; do echo "$$p $$p"; done | \
405 sed 's/$(EXEEXT)$$//' | \
406 while read p p1; do if test -f $$p \
407 || test -f $$p1 \
408 ; then echo "$$p"; echo "$$p"; else :; fi; \
409 done | \
410 sed -e 'p;s,.*/,,;n;h' \
411 -e 's|.*|.|' \
412 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
413 sed 'N;N;N;s,\n, ,g' | \
414 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
415 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
416 if ($$2 == $$4) files[d] = files[d] " " $$1; \
417 else { print "f", $$3 "/" $$4, $$1; } } \
418 END { for (d in files) print "f", d, files[d] }' | \
419 while read type dir files; do \
420 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
421 test -z "$$files" || { \
422 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
423 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
424 } \
425 ; done
426
427 uninstall-binPROGRAMS:
428 @$(NORMAL_UNINSTALL)
429 @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
430 files=`for p in $$list; do echo "$$p"; done | \
431 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
432 -e 's/$$/$(EXEEXT)/' \
433 `; \
434 test -n "$$list" || exit 0; \
435 echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
436 cd "$(DESTDIR)$(bindir)" && rm -f $$files
437
438 clean-binPROGRAMS:
439 @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
440 echo " rm -f" $$list; \
441 rm -f $$list || exit $$?; \
442 test -n "$(EXEEXT)" || exit 0; \
443 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
444 echo " rm -f" $$list; \
445 rm -f $$list
446
447 clean-noinstPROGRAMS:
448 @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
449 echo " rm -f" $$list; \
450 rm -f $$list || exit $$?; \
451 test -n "$(EXEEXT)" || exit 0; \
452 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
453 echo " rm -f" $$list; \
454 rm -f $$list
455
456 scmp_arch_detect$(EXEEXT): $(scmp_arch_detect_OBJECTS) $(scmp_arch_detect_DEPENDENCIES) $(EXTRA_scmp_arch_detect_DEPENDENCIES)
457 @rm -f scmp_arch_detect$(EXEEXT)
458 $(AM_V_CCLD)$(scmp_arch_detect_LINK) $(scmp_arch_detect_OBJECTS) $(scmp_arch_detect_LDADD) $(LIBS)
459
460 scmp_bpf_disasm$(EXEEXT): $(scmp_bpf_disasm_OBJECTS) $(scmp_bpf_disasm_DEPENDENCIES) $(EXTRA_scmp_bpf_disasm_DEPENDENCIES)
461 @rm -f scmp_bpf_disasm$(EXEEXT)
462 $(AM_V_CCLD)$(LINK) $(scmp_bpf_disasm_OBJECTS) $(scmp_bpf_disasm_LDADD) $(LIBS)
463
464 scmp_bpf_sim$(EXEEXT): $(scmp_bpf_sim_OBJECTS) $(scmp_bpf_sim_DEPENDENCIES) $(EXTRA_scmp_bpf_sim_DEPENDENCIES)
465 @rm -f scmp_bpf_sim$(EXEEXT)
466 $(AM_V_CCLD)$(LINK) $(scmp_bpf_sim_OBJECTS) $(scmp_bpf_sim_LDADD) $(LIBS)
467
468 scmp_sys_resolver$(EXEEXT): $(scmp_sys_resolver_OBJECTS) $(scmp_sys_resolver_DEPENDENCIES) $(EXTRA_scmp_sys_resolver_DEPENDENCIES)
469 @rm -f scmp_sys_resolver$(EXEEXT)
470 $(AM_V_CCLD)$(scmp_sys_resolver_LINK) $(scmp_sys_resolver_OBJECTS) $(scmp_sys_resolver_LDADD) $(LIBS)
471
472 mostlyclean-compile:
473 -rm -f *.$(OBJEXT)
474
475 distclean-compile:
476 -rm -f *.tab.c
477
478 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scmp_arch_detect.Po@am__quote@
479 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scmp_bpf_disasm.Po@am__quote@
480 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scmp_bpf_sim.Po@am__quote@
481 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scmp_sys_resolver.Po@am__quote@
482 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@
483
484 .c.o:
485 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
486 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
487 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
488 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
489 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
490 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
491
492 .c.obj:
493 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
494 @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
495 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
496 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
497 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
498 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
499
500 .c.lo:
501 @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
502 @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
503 @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
504 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
505 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
506 @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
507
508 mostlyclean-libtool:
509 -rm -f *.lo
510
511 clean-libtool:
512 -rm -rf .libs _libs
513
514 ID: $(am__tagged_files)
515 $(am__define_uniq_tagged_files); mkid -fID $$unique
516 tags: tags-am
517 TAGS: tags
518
519 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
520 set x; \
521 here=`pwd`; \
522 $(am__define_uniq_tagged_files); \
523 shift; \
524 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
525 test -n "$$unique" || unique=$$empty_fix; \
526 if test $$# -gt 0; then \
527 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
528 "$$@" $$unique; \
529 else \
530 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
531 $$unique; \
532 fi; \
533 fi
534 ctags: ctags-am
535
536 CTAGS: ctags
537 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
538 $(am__define_uniq_tagged_files); \
539 test -z "$(CTAGS_ARGS)$$unique" \
540 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
541 $$unique
542
543 GTAGS:
544 here=`$(am__cd) $(top_builddir) && pwd` \
545 && $(am__cd) $(top_srcdir) \
546 && gtags -i $(GTAGS_ARGS) "$$here"
547 cscopelist: cscopelist-am
548
549 cscopelist-am: $(am__tagged_files)
550 list='$(am__tagged_files)'; \
551 case "$(srcdir)" in \
552 [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
553 *) sdir=$(subdir)/$(srcdir) ;; \
554 esac; \
555 for i in $$list; do \
556 if test -f "$$i"; then \
557 echo "$(subdir)/$$i"; \
558 else \
559 echo "$$sdir/$$i"; \
560 fi; \
561 done >> $(top_builddir)/cscope.files
562
563 distclean-tags:
564 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
565
566 distdir: $(DISTFILES)
567 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
568 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
569 list='$(DISTFILES)'; \
570 dist_files=`for file in $$list; do echo $$file; done | \
571 sed -e "s|^$$srcdirstrip/||;t" \
572 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
573 case $$dist_files in \
574 */*) $(MKDIR_P) `echo "$$dist_files" | \
575 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
576 sort -u` ;; \
577 esac; \
578 for file in $$dist_files; do \
579 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
580 if test -d $$d/$$file; then \
581 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
582 if test -d "$(distdir)/$$file"; then \
583 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
584 fi; \
585 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
586 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
587 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
588 fi; \
589 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
590 else \
591 test -f "$(distdir)/$$file" \
592 || cp -p $$d/$$file "$(distdir)/$$file" \
593 || exit 1; \
594 fi; \
595 done
596 check-am: all-am
597 check: check-am
598 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
599 installdirs:
600 for dir in "$(DESTDIR)$(bindir)"; do \
601 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
602 done
603 install: install-am
604 install-exec: install-exec-am
605 install-data: install-data-am
606 uninstall: uninstall-am
607
608 install-am: all-am
609 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
610
611 installcheck: installcheck-am
612 install-strip:
613 if test -z '$(STRIP)'; then \
614 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
615 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
616 install; \
617 else \
618 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
619 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
620 "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
621 fi
622 mostlyclean-generic:
623
624 clean-generic:
625
626 distclean-generic:
627 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
628 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
629
630 maintainer-clean-generic:
631 @echo "This command is intended for maintainers to use"
632 @echo "it deletes files that may require special tools to rebuild."
633 clean: clean-am
634
635 clean-am: clean-binPROGRAMS clean-generic clean-libtool \
636 clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
637
638 distclean: distclean-am
639 -rm -rf ./$(DEPDIR)
640 -rm -f Makefile
641 distclean-am: clean-am distclean-compile distclean-generic \
642 distclean-tags
643
644 dvi: dvi-am
645
646 dvi-am:
647
648 html: html-am
649
650 html-am:
651
652 info: info-am
653
654 info-am:
655
656 install-data-am:
657
658 install-dvi: install-dvi-am
659
660 install-dvi-am:
661
662 install-exec-am: install-binPROGRAMS
663
664 install-html: install-html-am
665
666 install-html-am:
667
668 install-info: install-info-am
669
670 install-info-am:
671
672 install-man:
673
674 install-pdf: install-pdf-am
675
676 install-pdf-am:
677
678 install-ps: install-ps-am
679
680 install-ps-am:
681
682 installcheck-am:
683
684 maintainer-clean: maintainer-clean-am
685 -rm -rf ./$(DEPDIR)
686 -rm -f Makefile
687 maintainer-clean-am: distclean-am maintainer-clean-generic
688
689 mostlyclean: mostlyclean-am
690
691 mostlyclean-am: mostlyclean-compile mostlyclean-generic \
692 mostlyclean-libtool
693
694 pdf: pdf-am
695
696 pdf-am:
697
698 ps: ps-am
699
700 ps-am:
701
702 uninstall-am: uninstall-binPROGRAMS
703
704 .MAKE: install-am install-strip
705
706 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
707 clean-binPROGRAMS clean-generic clean-libtool \
708 clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \
709 ctags ctags-am distclean distclean-compile distclean-generic \
710 distclean-libtool distclean-tags distdir dvi dvi-am html \
711 html-am info info-am install install-am install-binPROGRAMS \
712 install-data install-data-am install-dvi install-dvi-am \
713 install-exec install-exec-am install-html install-html-am \
714 install-info install-info-am install-man install-pdf \
715 install-pdf-am install-ps install-ps-am install-strip \
716 installcheck installcheck-am installdirs maintainer-clean \
717 maintainer-clean-generic mostlyclean mostlyclean-compile \
718 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
719 tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
720
721
722 # Tell versions [3.59,3.63) of GNU make to not export all variables.
723 # Otherwise a system limit (for SysV at least) may be exceeded.
724 .NOEXPORT:
7777 --align-reference=name \
7878 --max-code-length=80 \
7979 --break-after-logical < "$1" \
80 | diff -pu --label="$1" "$1" --label="$1 [CORRECTED]" -
80 | diff -pu --label="$1.orig" "$1" --label="$1" -
8181 }
8282
8383 #
7777 case SCMP_ARCH_ARM:
7878 printf("arm\n");
7979 break;
80 case SCMP_ARCH_AARCH64:
81 printf("aarch64\n");
82 break;
83 case SCMP_ARCH_MIPS:
84 printf("mips\n");
85 break;
86 case SCMP_ARCH_MIPSEL:
87 printf("mipsel\n");
88 break;
89 case SCMP_ARCH_MIPS64:
90 printf("mips64\n");
91 break;
92 case SCMP_ARCH_MIPSEL64:
93 printf("mipsel64\n");
94 break;
95 case SCMP_ARCH_MIPS64N32:
96 printf("mips64n32\n");
97 break;
98 case SCMP_ARCH_MIPSEL64N32:
99 printf("mipsel64n32\n");
100 break;
80101 default:
81102 printf("unknown\n");
82103 }
2626 #include <stdio.h>
2727 #include <string.h>
2828 #include <unistd.h>
29 #include <linux/audit.h>
2930 #include <sys/types.h>
3031 #include <sys/stat.h>
3132
3233 #include "bpf.h"
34 #include "util.h"
3335
3436 #define _OP_FMT "%-3s"
3537
273275 printf("=================================\n");
274276
275277 while ((len = fread(&bpf, sizeof(bpf), 1, file))) {
278 /* convert the bpf statement */
279 bpf.code = ttoh16(arch, bpf.code);
280 bpf.k = ttoh32(arch, bpf.k);
281
282 /* display a hex dump */
276283 printf(" %.4u: 0x%.2x 0x%.2x 0x%.2x 0x%.8x",
277284 line, bpf.code, bpf.jt, bpf.jf, bpf.k);
278285
286 /* display the assembler statements */
279287 printf(" ");
280288 bpf_decode_op(&bpf);
281289 printf(" ");
296304 int main(int argc, char *argv[])
297305 {
298306 int rc;
307 int opt;
299308 FILE *file;
300309
301 if (argc > 2) {
302 fprintf(stderr, "usage: %s [<bpf_file>]\n", argv[0]);
303 return EINVAL;
310 /* parse the command line */
311 while ((opt = getopt(argc, argv, "a:h")) > 0) {
312 switch (opt) {
313 case 'a':
314 if (strcmp(optarg, "x86") == 0)
315 arch = AUDIT_ARCH_I386;
316 else if (strcmp(optarg, "x86_64") == 0)
317 arch = AUDIT_ARCH_X86_64;
318 else if (strcmp(optarg, "x32") == 0)
319 arch = AUDIT_ARCH_X86_64;
320 else if (strcmp(optarg, "arm") == 0)
321 arch = AUDIT_ARCH_ARM;
322 else if (strcmp(optarg, "aarch64") == 0)
323 arch = AUDIT_ARCH_AARCH64;
324 else if (strcmp(optarg, "mips") == 0)
325 arch = AUDIT_ARCH_MIPS;
326 else if (strcmp(optarg, "mipsel") == 0)
327 arch = AUDIT_ARCH_MIPSEL;
328 else if (strcmp(optarg, "mips64") == 0)
329 arch = AUDIT_ARCH_MIPS64;
330 else if (strcmp(optarg, "mipsel64") == 0)
331 arch = AUDIT_ARCH_MIPSEL64;
332 else if (strcmp(optarg, "mips64n32") == 0)
333 arch = AUDIT_ARCH_MIPS64N32;
334 else if (strcmp(optarg, "mipsel64n32") == 0)
335 arch = AUDIT_ARCH_MIPSEL64N32;
336 else
337 exit_usage(argv[0]);
338 break;
339 default:
340 /* usage information */
341 exit_usage(argv[0]);
342 }
304343 }
305344
306 if (argc == 2) {
307 file = fopen(argv[1], "r");
345 if ((optind > 1) && (optind < argc)) {
346 int opt_file = optind - 1 ;
347 file = fopen(argv[opt_file], "r");
308348 if (file == NULL) {
309349 fprintf(stderr, "error: unable to open \"%s\" (%s)\n",
310 argv[1], strerror(errno));
350 argv[opt_file], strerror(errno));
311351 return errno;
312352 }
313353 } else
318358
319359 return rc;
320360 }
321
3131 #include <sys/stat.h>
3232
3333 #include "bpf.h"
34 #include "util.h"
3435
3536 #define BPF_PRG_MAX_LEN 4096
3637
4849 };
4950
5051 static unsigned int opt_verbose = 0;
51
52 /**
53 * Print the usage information to stderr and exit
54 * @param program the name of the current program being invoked
55 *
56 * Print the usage information and exit with EINVAL.
57 *
58 */
59 static void exit_usage(const char *program)
60 {
61 fprintf(stderr,
62 "usage: %s -f <bpf_file> [-v]"
63 " -a <arch> -s <syscall_num> [-0 <a0>] ... [-5 <a5>]\n",
64 program);
65 exit(EINVAL);
66 }
6752
6853 /**
6954 * Handle a simulator fault
151136 struct sim_state state;
152137 bpf_instr_raw *bpf;
153138 unsigned char *sys_data_b = (unsigned char *)sys_data;
139 uint16_t code;
140 uint8_t jt;
141 uint8_t jf;
142 uint32_t k;
154143
155144 /* initialize the machine state */
156145 ip_c = 0;
162151 ip_c = ip;
163152 bpf = &prg->i[ip++];
164153
165 switch (bpf->code) {
154 code = ttoh16(arch, bpf->code);
155 jt = bpf->jt;
156 jf = bpf->jf;
157 k = ttoh32(arch, bpf->k);
158
159 switch (code) {
166160 case BPF_LD+BPF_W+BPF_ABS:
167 if (bpf->k < BPF_SYSCALL_MAX)
168 state.acc = *((uint32_t *)&sys_data_b[bpf->k]);
161 if (k < BPF_SYSCALL_MAX) {
162 uint32_t val = *((uint32_t *)&sys_data_b[k]);
163 state.acc = ttoh32(arch, val);
164 } else
165 exit_error(ERANGE, ip_c);
166 break;
167 case BPF_ALU+BPF_OR+BPF_K:
168 state.acc |= k;
169 break;
170 case BPF_ALU+BPF_AND+BPF_K:
171 state.acc &= k;
172 break;
173 case BPF_JMP+BPF_JA:
174 ip += k;
175 break;
176 case BPF_JMP+BPF_JEQ+BPF_K:
177 if (state.acc == k)
178 ip += jt;
169179 else
170 exit_error(ERANGE, ip_c);
171 break;
172 case BPF_ALU+BPF_OR+BPF_K:
173 state.acc |= bpf->k;
174 break;
175 case BPF_ALU+BPF_AND+BPF_K:
176 state.acc &= bpf->k;
177 break;
178 case BPF_JMP+BPF_JA:
179 ip += bpf->k;
180 break;
181 case BPF_JMP+BPF_JEQ+BPF_K:
182 if (state.acc == bpf->k)
183 ip += bpf->jt;
180 ip += jf;
181 break;
182 case BPF_JMP+BPF_JGT+BPF_K:
183 if (state.acc > k)
184 ip += jt;
184185 else
185 ip += bpf->jf;
186 break;
187 case BPF_JMP+BPF_JGT+BPF_K:
188 if (state.acc > bpf->k)
189 ip += bpf->jt;
186 ip += jf;
187 break;
188 case BPF_JMP+BPF_JGE+BPF_K:
189 if (state.acc >= k)
190 ip += jt;
190191 else
191 ip += bpf->jf;
192 break;
193 case BPF_JMP+BPF_JGE+BPF_K:
194 if (state.acc >= bpf->k)
195 ip += bpf->jt;
196 else
197 ip += bpf->jf;
192 ip += jf;
198193 break;
199194 case BPF_RET+BPF_K:
200 end_action(bpf->k, ip_c);
195 end_action(k, ip_c);
201196 break;
202197 default:
203198 /* since we don't support the full bpf language just
217212 int main(int argc, char *argv[])
218213 {
219214 int opt;
215 int iter;
220216 char *opt_file = NULL;
221217 FILE *file;
222218 size_t file_read_len;
223219 struct seccomp_data sys_data;
224220 struct bpf_program bpf_prg;
225221
226 /* clear the syscall record */
222 /* initialize the syscall record */
227223 memset(&sys_data, 0, sizeof(sys_data));
228224
229225 /* parse the command line */
231227 switch (opt) {
232228 case 'a':
233229 if (strcmp(optarg, "x86") == 0)
234 sys_data.arch = AUDIT_ARCH_I386;
230 arch = AUDIT_ARCH_I386;
235231 else if (strcmp(optarg, "x86_64") == 0)
236 sys_data.arch = AUDIT_ARCH_X86_64;
232 arch = AUDIT_ARCH_X86_64;
237233 else if (strcmp(optarg, "x32") == 0)
238 sys_data.arch = AUDIT_ARCH_X86_64;
234 arch = AUDIT_ARCH_X86_64;
239235 else if (strcmp(optarg, "arm") == 0)
240 sys_data.arch = AUDIT_ARCH_ARM;
236 arch = AUDIT_ARCH_ARM;
237 else if (strcmp(optarg, "aarch64") == 0)
238 arch = AUDIT_ARCH_AARCH64;
239 else if (strcmp(optarg, "mips") == 0)
240 arch = AUDIT_ARCH_MIPS;
241 else if (strcmp(optarg, "mipsel") == 0)
242 arch = AUDIT_ARCH_MIPSEL;
243 else if (strcmp(optarg, "mips64") == 0)
244 arch = AUDIT_ARCH_MIPS64;
245 else if (strcmp(optarg, "mipsel64") == 0)
246 arch = AUDIT_ARCH_MIPSEL64;
247 else if (strcmp(optarg, "mips64n32") == 0)
248 arch = AUDIT_ARCH_MIPS64N32;
249 else if (strcmp(optarg, "mipsel64n32") == 0)
250 arch = AUDIT_ARCH_MIPSEL64N32;
241251 else
242252 exit_fault(EINVAL);
243253 break;
276286 exit_usage(argv[0]);
277287 }
278288 }
289
290 /* adjust the endianess of sys_data to match the target */
291 sys_data.nr = htot32(arch, sys_data.nr);
292 sys_data.arch = htot32(arch, arch);
293 sys_data.instruction_pointer = htot64(arch,
294 sys_data.instruction_pointer);
295 for (iter = 0; iter < BPF_SYS_ARG_MAX; iter++)
296 sys_data.args[iter] = htot64(arch, sys_data.args[iter]);
279297
280298 /* allocate space for the bpf program */
281299 /* XXX - we should make this dynamic */
2525 #include <string.h>
2626 #include <unistd.h>
2727
28 #include "../src/arch.h"
29 #include "../src/arch-x86.h"
30 #include "../src/arch-x86_64.h"
31 #include "../src/arch-x32.h"
32 #include "../src/arch-arm.h"
28 #include <seccomp.h>
3329
3430 /**
3531 * Print the usage information to stderr and exit
5349 {
5450 int opt;
5551 int translate = 0;
56 const struct arch_def *arch = arch_def_native;
52 uint32_t arch;
5753 int sys_num;
5854 const char *sys_name;
55
56 arch = seccomp_arch_native();
5957
6058 /* parse the command line */
6159 while ((opt = getopt(argc, argv, "a:ht")) > 0) {
6260 switch (opt) {
6361 case 'a':
64 if (strcmp(optarg, "x86") == 0)
65 arch = &arch_def_x86;
66 else if (strcmp(optarg, "x86_64") == 0)
67 arch = &arch_def_x86_64;
68 else if (strcmp(optarg, "x32") == 0)
69 arch = &arch_def_x32;
70 else if (strcmp(optarg, "arm") == 0)
71 arch = &arch_def_arm;
72 else
62 arch = seccomp_arch_resolve_name(optarg);
63 if (arch == 0)
7364 exit_usage(argv[0]);
7465 break;
7566 case 't':
8980 /* perform the syscall lookup */
9081 if (isdigit(argv[optind][0]) || argv[optind][0] == '-') {
9182 sys_num = atoi(argv[optind]);
92 sys_name = arch_syscall_resolve_num(arch, sys_num);
93 printf("%s\n", sys_name);
83 sys_name = seccomp_syscall_resolve_num_arch(arch, sys_num);
84 printf("%s\n", (sys_name ? sys_name : "UNKNOWN"));
85 } else if (translate) {
86 sys_num = seccomp_syscall_resolve_name_rewrite(arch,
87 argv[optind]);
88 printf("%d\n", sys_num);
9489 } else {
95 sys_num = arch_syscall_resolve_name(arch, argv[optind]);
96 if (translate != 0)
97 /* ignore errors and just output the resolved number */
98 arch_syscall_rewrite(arch, 0, &sys_num);
90 sys_num = seccomp_syscall_resolve_name_arch(arch, argv[optind]);
9991 printf("%d\n", sys_num);
10092 }
10193
0 /**
1 * Tool utility functions
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.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 #include <errno.h>
22 #include <stdlib.h>
23 #include <stdio.h>
24 #include <linux/audit.h>
25
26 #ifndef _BSD_SOURCE
27 #define _BSD_SOURCE
28 #endif
29 #include <endian.h>
30
31 #include "util.h"
32
33 /* determine the native architecture */
34 #if __i386__
35 #define ARCH_NATIVE AUDIT_ARCH_I386
36 #elif __x86_64__
37 #ifdef __ILP32__
38 #define ARCH_NATIVE AUDIT_ARCH_X86_64
39 #else
40 #define ARCH_NATIVE AUDIT_ARCH_X86_64
41 #endif /* __ILP32__ */
42 #elif __arm__
43 #define ARCH_NATIVE AUDIT_ARCH_ARM
44 #elif __aarch64__
45 #define ARCH_NATIVE AUDIT_ARCH_AARCH64
46 #elif __mips__ && _MIPS_SIM == _MIPS_SIM_ABI32
47 #if __MIPSEB__
48 #define ARCH_NATIVE AUDIT_ARCH_MIPS
49 #elif __MIPSEL__
50 #define ARCH_NATIVE AUDIT_ARCH_MIPSEL
51 #endif /* _MIPS_SIM_ABI32 */
52 #elif __mips__ && _MIPS_SIM == _MIPS_SIM_ABI64
53 #if __MIPSEB__
54 #define ARCH_NATIVE AUDIT_ARCH_MIPS64
55 #elif __MIPSEL__
56 #define ARCH_NATIVE AUDIT_ARCH_MIPSEL64
57 #endif /* _MIPS_SIM_ABI64 */
58 #elif __mips__ && _MIPS_SIM == _MIPS_SIM_NABI32
59 #if __MIPSEB__
60 #define ARCH_NATIVE AUDIT_ARCH_MIPS64N32
61 #elif __MIPSEL__
62 #define ARCH_NATIVE AUDIT_ARCH_MIPSEL64N32
63 #endif /* _MIPS_SIM_NABI32 */
64 #else
65 #error the simulator code needs to know about your machine type
66 #endif
67
68 /* default to the native arch */
69 uint32_t arch = ARCH_NATIVE;
70
71 /**
72 * Print the usage information to stderr and exit
73 * @param program the name of the current program being invoked
74 *
75 * Print the usage information and exit with EINVAL.
76 *
77 */
78 void exit_usage(const char *program)
79 {
80 fprintf(stderr,
81 "usage: %s -f <bpf_file> [-v]"
82 " -a <arch> -s <syscall_num> [-0 <a0>] ... [-5 <a5>]\n",
83 program);
84 exit(EINVAL);
85 }
86
87 /**
88 * Convert a 16-bit target integer into the host's endianess
89 * @param arch the architecture token
90 * @param val the 16-bit integer
91 *
92 * Convert the endianess of the supplied value and return it to the caller.
93 *
94 */
95 uint16_t ttoh16(uint32_t arch, uint16_t val)
96 {
97 if (arch & __AUDIT_ARCH_LE)
98 return le16toh(val);
99 else
100 return be16toh(val);
101 }
102
103 /**
104 * Convert a 32-bit target integer into the host's endianess
105 * @param arch the architecture token
106 * @param val the 32-bit integer
107 *
108 * Convert the endianess of the supplied value and return it to the caller.
109 *
110 */
111 uint32_t ttoh32(uint32_t arch, uint32_t val)
112 {
113 if (arch & __AUDIT_ARCH_LE)
114 return le32toh(val);
115 else
116 return be32toh(val);
117 }
118
119 /**
120 * Convert a 32-bit host integer into the target's endianess
121 * @param arch the architecture token
122 * @param val the 32-bit integer
123 *
124 * Convert the endianess of the supplied value and return it to the caller.
125 *
126 */
127 uint32_t htot32(uint32_t arch, uint32_t val)
128 {
129 if (arch & __AUDIT_ARCH_LE)
130 return htole32(val);
131 else
132 return htobe32(val);
133 }
134
135 /**
136 * Convert a 64-bit host integer into the target's endianess
137 * @param arch the architecture token
138 * @param val the 64-bit integer
139 *
140 * Convert the endianess of the supplied value and return it to the caller.
141 *
142 */
143 uint64_t htot64(uint32_t arch, uint64_t val)
144 {
145 if (arch & __AUDIT_ARCH_LE)
146 return htole64(val);
147 else
148 return htobe64(val);
149 }
0 /**
1 * Tool utility functions
2 *
3 * Copyright (c) 2014 Red Hat <pmoore@redhat.com>
4 * Author: Paul Moore <pmoore@redhat.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 #ifndef _UTIL_H
22 #define _UTIL_H
23
24 #include <elf.h>
25 #include <inttypes.h>
26 #include <linux/audit.h>
27
28 /**
29 * The ARM architecture tokens
30 */
31 /* AArch64 support for audit was merged in 3.17-rc1 */
32 #ifndef AUDIT_ARCH_AARCH64
33 #ifndef EM_AARCH64
34 #define EM_AARCH64 183
35 #endif /* EM_AARCH64 */
36 #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
37 #endif /* AUDIT_ARCH_AARCH64 */
38
39 /**
40 * The MIPS architecture tokens
41 */
42 #ifndef __AUDIT_ARCH_CONVENTION_MIPS64_N32
43 #define __AUDIT_ARCH_CONVENTION_MIPS64_N32 0x20000000
44 #endif
45 #ifndef EM_MIPS
46 #define EM_MIPS 8
47 #endif
48 #ifndef AUDIT_ARCH_MIPS
49 #define AUDIT_ARCH_MIPS (EM_MIPS)
50 #endif
51 #ifndef AUDIT_ARCH_MIPS64
52 #define AUDIT_ARCH_MIPS64 (EM_MIPS|__AUDIT_ARCH_64BIT)
53 #endif
54 /* MIPS64N32 support was merged in 3.15 */
55 #ifndef AUDIT_ARCH_MIPS64N32
56 #define AUDIT_ARCH_MIPS64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|\
57 __AUDIT_ARCH_CONVENTION_MIPS64_N32)
58 #endif
59 /* MIPSEL64N32 support was merged in 3.15 */
60 #ifndef AUDIT_ARCH_MIPSEL64N32
61 #define AUDIT_ARCH_MIPSEL64N32 (EM_MIPS|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE|\
62 __AUDIT_ARCH_CONVENTION_MIPS64_N32)
63 #endif
64
65 extern uint32_t arch;
66
67 void exit_usage(const char *program);
68
69 uint16_t ttoh16(uint32_t arch, uint16_t val);
70 uint32_t ttoh32(uint32_t arch, uint32_t val);
71
72 uint32_t htot32(uint32_t arch, uint32_t val);
73 uint64_t htot64(uint32_t arch, uint64_t val);
74
75 #endif
+0
-8
version.h less more
0 /* automatically generated - do not edit */
1 #ifndef _VERSION_H
2 #define _VERSION_H
3 #define VERSION_RELEASE "2.1.1"
4 #define VERSION_MAJOR 2
5 #define VERSION_MINOR 1
6 #define VERSION_MICRO 1
7 #endif
+0
-8
version_info less more
0 #
1 # version_info - version information for seccomp library
2 #
3
4 # version components
5 VERSION_MAJOR=2
6 VERSION_MINOR=1
7 VERSION_MICRO=1