External, Non-PPA KXStudio Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24681 lines
747KB

  1. --- /dev/null
  2. +++ cardinal-22.02/src/Rack/dep/jansson-2.12/test/bin/Makefile.am
  3. @@ -0,0 +1,5 @@
  4. +check_PROGRAMS = json_process
  5. +
  6. +AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
  7. +LDFLAGS = -static # for speed and Valgrind
  8. +LDADD = $(top_builddir)/src/libjansson.la
  9. --- /dev/null
  10. +++ cardinal-22.02/src/Rack/dep/jansson-2.12/test/bin/Makefile.in
  11. @@ -0,0 +1,596 @@
  12. +# Makefile.in generated by automake 1.16.1 from Makefile.am.
  13. +# @configure_input@
  14. +
  15. +# Copyright (C) 1994-2018 Free Software Foundation, Inc.
  16. +
  17. +# This Makefile.in is free software; the Free Software Foundation
  18. +# gives unlimited permission to copy and/or distribute it,
  19. +# with or without modifications, as long as this notice is preserved.
  20. +
  21. +# This program is distributed in the hope that it will be useful,
  22. +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  23. +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  24. +# PARTICULAR PURPOSE.
  25. +
  26. +@SET_MAKE@
  27. +VPATH = @srcdir@
  28. +am__is_gnu_make = { \
  29. + if test -z '$(MAKELEVEL)'; then \
  30. + false; \
  31. + elif test -n '$(MAKE_HOST)'; then \
  32. + true; \
  33. + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
  34. + true; \
  35. + else \
  36. + false; \
  37. + fi; \
  38. +}
  39. +am__make_running_with_option = \
  40. + case $${target_option-} in \
  41. + ?) ;; \
  42. + *) echo "am__make_running_with_option: internal error: invalid" \
  43. + "target option '$${target_option-}' specified" >&2; \
  44. + exit 1;; \
  45. + esac; \
  46. + has_opt=no; \
  47. + sane_makeflags=$$MAKEFLAGS; \
  48. + if $(am__is_gnu_make); then \
  49. + sane_makeflags=$$MFLAGS; \
  50. + else \
  51. + case $$MAKEFLAGS in \
  52. + *\\[\ \ ]*) \
  53. + bs=\\; \
  54. + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
  55. + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
  56. + esac; \
  57. + fi; \
  58. + skip_next=no; \
  59. + strip_trailopt () \
  60. + { \
  61. + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
  62. + }; \
  63. + for flg in $$sane_makeflags; do \
  64. + test $$skip_next = yes && { skip_next=no; continue; }; \
  65. + case $$flg in \
  66. + *=*|--*) continue;; \
  67. + -*I) strip_trailopt 'I'; skip_next=yes;; \
  68. + -*I?*) strip_trailopt 'I';; \
  69. + -*O) strip_trailopt 'O'; skip_next=yes;; \
  70. + -*O?*) strip_trailopt 'O';; \
  71. + -*l) strip_trailopt 'l'; skip_next=yes;; \
  72. + -*l?*) strip_trailopt 'l';; \
  73. + -[dEDm]) skip_next=yes;; \
  74. + -[JT]) skip_next=yes;; \
  75. + esac; \
  76. + case $$flg in \
  77. + *$$target_option*) has_opt=yes; break;; \
  78. + esac; \
  79. + done; \
  80. + test $$has_opt = yes
  81. +am__make_dryrun = (target_option=n; $(am__make_running_with_option))
  82. +am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
  83. +pkgdatadir = $(datadir)/@PACKAGE@
  84. +pkgincludedir = $(includedir)/@PACKAGE@
  85. +pkglibdir = $(libdir)/@PACKAGE@
  86. +pkglibexecdir = $(libexecdir)/@PACKAGE@
  87. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
  88. +install_sh_DATA = $(install_sh) -c -m 644
  89. +install_sh_PROGRAM = $(install_sh) -c
  90. +install_sh_SCRIPT = $(install_sh) -c
  91. +INSTALL_HEADER = $(INSTALL_DATA)
  92. +transform = $(program_transform_name)
  93. +NORMAL_INSTALL = :
  94. +PRE_INSTALL = :
  95. +POST_INSTALL = :
  96. +NORMAL_UNINSTALL = :
  97. +PRE_UNINSTALL = :
  98. +POST_UNINSTALL = :
  99. +build_triplet = @build@
  100. +host_triplet = @host@
  101. +check_PROGRAMS = json_process$(EXEEXT)
  102. +subdir = test/bin
  103. +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
  104. +am__aclocal_m4_deps = $(top_srcdir)/configure.ac
  105. +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
  106. + $(ACLOCAL_M4)
  107. +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
  108. +mkinstalldirs = $(install_sh) -d
  109. +CONFIG_HEADER = $(top_builddir)/jansson_private_config.h
  110. +CONFIG_CLEAN_FILES =
  111. +CONFIG_CLEAN_VPATH_FILES =
  112. +json_process_SOURCES = json_process.c
  113. +json_process_OBJECTS = json_process.$(OBJEXT)
  114. +json_process_LDADD = $(LDADD)
  115. +json_process_DEPENDENCIES = $(top_builddir)/src/libjansson.la
  116. +AM_V_lt = $(am__v_lt_@AM_V@)
  117. +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
  118. +am__v_lt_0 = --silent
  119. +am__v_lt_1 =
  120. +AM_V_P = $(am__v_P_@AM_V@)
  121. +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
  122. +am__v_P_0 = false
  123. +am__v_P_1 = :
  124. +AM_V_GEN = $(am__v_GEN_@AM_V@)
  125. +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
  126. +am__v_GEN_0 = @echo " GEN " $@;
  127. +am__v_GEN_1 =
  128. +AM_V_at = $(am__v_at_@AM_V@)
  129. +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
  130. +am__v_at_0 = @
  131. +am__v_at_1 =
  132. +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
  133. +depcomp = $(SHELL) $(top_srcdir)/depcomp
  134. +am__maybe_remake_depfiles = depfiles
  135. +am__depfiles_remade = ./$(DEPDIR)/json_process.Po
  136. +am__mv = mv -f
  137. +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  138. + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  139. +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
  140. + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
  141. + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
  142. + $(AM_CFLAGS) $(CFLAGS)
  143. +AM_V_CC = $(am__v_CC_@AM_V@)
  144. +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
  145. +am__v_CC_0 = @echo " CC " $@;
  146. +am__v_CC_1 =
  147. +CCLD = $(CC)
  148. +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
  149. + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
  150. + $(AM_LDFLAGS) $(LDFLAGS) -o $@
  151. +AM_V_CCLD = $(am__v_CCLD_@AM_V@)
  152. +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
  153. +am__v_CCLD_0 = @echo " CCLD " $@;
  154. +am__v_CCLD_1 =
  155. +SOURCES = json_process.c
  156. +DIST_SOURCES = json_process.c
  157. +am__can_run_installinfo = \
  158. + case $$AM_UPDATE_INFO_DIR in \
  159. + n|no|NO) false;; \
  160. + *) (install-info --version) >/dev/null 2>&1;; \
  161. + esac
  162. +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
  163. +# Read a list of newline-separated strings from the standard input,
  164. +# and print each of them once, without duplicates. Input order is
  165. +# *not* preserved.
  166. +am__uniquify_input = $(AWK) '\
  167. + BEGIN { nonempty = 0; } \
  168. + { items[$$0] = 1; nonempty = 1; } \
  169. + END { if (nonempty) { for (i in items) print i; }; } \
  170. +'
  171. +# Make sure the list of sources is unique. This is necessary because,
  172. +# e.g., the same source file might be shared among _SOURCES variables
  173. +# for different programs/libraries.
  174. +am__define_uniq_tagged_files = \
  175. + list='$(am__tagged_files)'; \
  176. + unique=`for i in $$list; do \
  177. + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  178. + done | $(am__uniquify_input)`
  179. +ETAGS = etags
  180. +CTAGS = ctags
  181. +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
  182. +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  183. +ACLOCAL = @ACLOCAL@
  184. +AMTAR = @AMTAR@
  185. +AM_CFLAGS = @AM_CFLAGS@
  186. +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
  187. +AR = @AR@
  188. +AUTOCONF = @AUTOCONF@
  189. +AUTOHEADER = @AUTOHEADER@
  190. +AUTOMAKE = @AUTOMAKE@
  191. +AWK = @AWK@
  192. +CC = @CC@
  193. +CCDEPMODE = @CCDEPMODE@
  194. +CFLAGS = @CFLAGS@
  195. +CPP = @CPP@
  196. +CPPFLAGS = @CPPFLAGS@
  197. +CYGPATH_W = @CYGPATH_W@
  198. +DEFS = @DEFS@
  199. +DEPDIR = @DEPDIR@
  200. +DLLTOOL = @DLLTOOL@
  201. +DSYMUTIL = @DSYMUTIL@
  202. +DUMPBIN = @DUMPBIN@
  203. +ECHO_C = @ECHO_C@
  204. +ECHO_N = @ECHO_N@
  205. +ECHO_T = @ECHO_T@
  206. +EGREP = @EGREP@
  207. +EXEEXT = @EXEEXT@
  208. +FGREP = @FGREP@
  209. +GREP = @GREP@
  210. +INSTALL = @INSTALL@
  211. +INSTALL_DATA = @INSTALL_DATA@
  212. +INSTALL_PROGRAM = @INSTALL_PROGRAM@
  213. +INSTALL_SCRIPT = @INSTALL_SCRIPT@
  214. +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  215. +JSON_BSYMBOLIC_LDFLAGS = @JSON_BSYMBOLIC_LDFLAGS@
  216. +LD = @LD@
  217. +LDFLAGS = -static # for speed and Valgrind
  218. +LIBOBJS = @LIBOBJS@
  219. +LIBS = @LIBS@
  220. +LIBTOOL = @LIBTOOL@
  221. +LIPO = @LIPO@
  222. +LN_S = @LN_S@
  223. +LTLIBOBJS = @LTLIBOBJS@
  224. +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
  225. +MAKEINFO = @MAKEINFO@
  226. +MANIFEST_TOOL = @MANIFEST_TOOL@
  227. +MKDIR_P = @MKDIR_P@
  228. +NM = @NM@
  229. +NMEDIT = @NMEDIT@
  230. +OBJDUMP = @OBJDUMP@
  231. +OBJEXT = @OBJEXT@
  232. +OTOOL = @OTOOL@
  233. +OTOOL64 = @OTOOL64@
  234. +PACKAGE = @PACKAGE@
  235. +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
  236. +PACKAGE_NAME = @PACKAGE_NAME@
  237. +PACKAGE_STRING = @PACKAGE_STRING@
  238. +PACKAGE_TARNAME = @PACKAGE_TARNAME@
  239. +PACKAGE_URL = @PACKAGE_URL@
  240. +PACKAGE_VERSION = @PACKAGE_VERSION@
  241. +PATH_SEPARATOR = @PATH_SEPARATOR@
  242. +RANLIB = @RANLIB@
  243. +SED = @SED@
  244. +SET_MAKE = @SET_MAKE@
  245. +SHELL = @SHELL@
  246. +STRIP = @STRIP@
  247. +VERSION = @VERSION@
  248. +abs_builddir = @abs_builddir@
  249. +abs_srcdir = @abs_srcdir@
  250. +abs_top_builddir = @abs_top_builddir@
  251. +abs_top_srcdir = @abs_top_srcdir@
  252. +ac_ct_AR = @ac_ct_AR@
  253. +ac_ct_CC = @ac_ct_CC@
  254. +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
  255. +am__include = @am__include@
  256. +am__leading_dot = @am__leading_dot@
  257. +am__quote = @am__quote@
  258. +am__tar = @am__tar@
  259. +am__untar = @am__untar@
  260. +bindir = @bindir@
  261. +build = @build@
  262. +build_alias = @build_alias@
  263. +build_cpu = @build_cpu@
  264. +build_os = @build_os@
  265. +build_vendor = @build_vendor@
  266. +builddir = @builddir@
  267. +datadir = @datadir@
  268. +datarootdir = @datarootdir@
  269. +docdir = @docdir@
  270. +dvidir = @dvidir@
  271. +exec_prefix = @exec_prefix@
  272. +host = @host@
  273. +host_alias = @host_alias@
  274. +host_cpu = @host_cpu@
  275. +host_os = @host_os@
  276. +host_vendor = @host_vendor@
  277. +htmldir = @htmldir@
  278. +includedir = @includedir@
  279. +infodir = @infodir@
  280. +install_sh = @install_sh@
  281. +json_have_atomic_builtins = @json_have_atomic_builtins@
  282. +json_have_localeconv = @json_have_localeconv@
  283. +json_have_long_long = @json_have_long_long@
  284. +json_have_sync_builtins = @json_have_sync_builtins@
  285. +json_inline = @json_inline@
  286. +libdir = @libdir@
  287. +libexecdir = @libexecdir@
  288. +localedir = @localedir@
  289. +localstatedir = @localstatedir@
  290. +mandir = @mandir@
  291. +mkdir_p = @mkdir_p@
  292. +oldincludedir = @oldincludedir@
  293. +pdfdir = @pdfdir@
  294. +prefix = @prefix@
  295. +program_transform_name = @program_transform_name@
  296. +psdir = @psdir@
  297. +sbindir = @sbindir@
  298. +sharedstatedir = @sharedstatedir@
  299. +srcdir = @srcdir@
  300. +sysconfdir = @sysconfdir@
  301. +target_alias = @target_alias@
  302. +top_build_prefix = @top_build_prefix@
  303. +top_builddir = @top_builddir@
  304. +top_srcdir = @top_srcdir@
  305. +AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
  306. +LDADD = $(top_builddir)/src/libjansson.la
  307. +all: all-am
  308. +
  309. +.SUFFIXES:
  310. +.SUFFIXES: .c .lo .o .obj
  311. +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
  312. + @for dep in $?; do \
  313. + case '$(am__configure_deps)' in \
  314. + *$$dep*) \
  315. + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
  316. + && { if test -f $@; then exit 0; else break; fi; }; \
  317. + exit 1;; \
  318. + esac; \
  319. + done; \
  320. + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/bin/Makefile'; \
  321. + $(am__cd) $(top_srcdir) && \
  322. + $(AUTOMAKE) --foreign test/bin/Makefile
  323. +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  324. + @case '$?' in \
  325. + *config.status*) \
  326. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
  327. + *) \
  328. + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
  329. + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
  330. + esac;
  331. +
  332. +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
  333. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  334. +
  335. +$(top_srcdir)/configure: $(am__configure_deps)
  336. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  337. +$(ACLOCAL_M4): $(am__aclocal_m4_deps)
  338. + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  339. +$(am__aclocal_m4_deps):
  340. +
  341. +clean-checkPROGRAMS:
  342. + @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
  343. + echo " rm -f" $$list; \
  344. + rm -f $$list || exit $$?; \
  345. + test -n "$(EXEEXT)" || exit 0; \
  346. + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
  347. + echo " rm -f" $$list; \
  348. + rm -f $$list
  349. +
  350. +json_process$(EXEEXT): $(json_process_OBJECTS) $(json_process_DEPENDENCIES) $(EXTRA_json_process_DEPENDENCIES)
  351. + @rm -f json_process$(EXEEXT)
  352. + $(AM_V_CCLD)$(LINK) $(json_process_OBJECTS) $(json_process_LDADD) $(LIBS)
  353. +
  354. +mostlyclean-compile:
  355. + -rm -f *.$(OBJEXT)
  356. +
  357. +distclean-compile:
  358. + -rm -f *.tab.c
  359. +
  360. +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json_process.Po@am__quote@ # am--include-marker
  361. +
  362. +$(am__depfiles_remade):
  363. + @$(MKDIR_P) $(@D)
  364. + @echo '# dummy' >$@-t && $(am__mv) $@-t $@
  365. +
  366. +am--depfiles: $(am__depfiles_remade)
  367. +
  368. +.c.o:
  369. +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
  370. +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
  371. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  372. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  373. +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
  374. +
  375. +.c.obj:
  376. +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
  377. +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
  378. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
  379. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  380. +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
  381. +
  382. +.c.lo:
  383. +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
  384. +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
  385. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
  386. +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
  387. +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
  388. +
  389. +mostlyclean-libtool:
  390. + -rm -f *.lo
  391. +
  392. +clean-libtool:
  393. + -rm -rf .libs _libs
  394. +
  395. +ID: $(am__tagged_files)
  396. + $(am__define_uniq_tagged_files); mkid -fID $$unique
  397. +tags: tags-am
  398. +TAGS: tags
  399. +
  400. +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
  401. + set x; \
  402. + here=`pwd`; \
  403. + $(am__define_uniq_tagged_files); \
  404. + shift; \
  405. + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
  406. + test -n "$$unique" || unique=$$empty_fix; \
  407. + if test $$# -gt 0; then \
  408. + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
  409. + "$$@" $$unique; \
  410. + else \
  411. + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
  412. + $$unique; \
  413. + fi; \
  414. + fi
  415. +ctags: ctags-am
  416. +
  417. +CTAGS: ctags
  418. +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
  419. + $(am__define_uniq_tagged_files); \
  420. + test -z "$(CTAGS_ARGS)$$unique" \
  421. + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
  422. + $$unique
  423. +
  424. +GTAGS:
  425. + here=`$(am__cd) $(top_builddir) && pwd` \
  426. + && $(am__cd) $(top_srcdir) \
  427. + && gtags -i $(GTAGS_ARGS) "$$here"
  428. +cscopelist: cscopelist-am
  429. +
  430. +cscopelist-am: $(am__tagged_files)
  431. + list='$(am__tagged_files)'; \
  432. + case "$(srcdir)" in \
  433. + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
  434. + *) sdir=$(subdir)/$(srcdir) ;; \
  435. + esac; \
  436. + for i in $$list; do \
  437. + if test -f "$$i"; then \
  438. + echo "$(subdir)/$$i"; \
  439. + else \
  440. + echo "$$sdir/$$i"; \
  441. + fi; \
  442. + done >> $(top_builddir)/cscope.files
  443. +
  444. +distclean-tags:
  445. + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
  446. +
  447. +distdir: $(BUILT_SOURCES)
  448. + $(MAKE) $(AM_MAKEFLAGS) distdir-am
  449. +
  450. +distdir-am: $(DISTFILES)
  451. + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
  452. + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
  453. + list='$(DISTFILES)'; \
  454. + dist_files=`for file in $$list; do echo $$file; done | \
  455. + sed -e "s|^$$srcdirstrip/||;t" \
  456. + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
  457. + case $$dist_files in \
  458. + */*) $(MKDIR_P) `echo "$$dist_files" | \
  459. + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
  460. + sort -u` ;; \
  461. + esac; \
  462. + for file in $$dist_files; do \
  463. + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
  464. + if test -d $$d/$$file; then \
  465. + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
  466. + if test -d "$(distdir)/$$file"; then \
  467. + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
  468. + fi; \
  469. + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
  470. + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
  471. + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
  472. + fi; \
  473. + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
  474. + else \
  475. + test -f "$(distdir)/$$file" \
  476. + || cp -p $$d/$$file "$(distdir)/$$file" \
  477. + || exit 1; \
  478. + fi; \
  479. + done
  480. +check-am: all-am
  481. + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
  482. +check: check-am
  483. +all-am: Makefile
  484. +installdirs:
  485. +install: install-am
  486. +install-exec: install-exec-am
  487. +install-data: install-data-am
  488. +uninstall: uninstall-am
  489. +
  490. +install-am: all-am
  491. + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  492. +
  493. +installcheck: installcheck-am
  494. +install-strip:
  495. + if test -z '$(STRIP)'; then \
  496. + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  497. + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  498. + install; \
  499. + else \
  500. + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
  501. + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
  502. + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
  503. + fi
  504. +mostlyclean-generic:
  505. +
  506. +clean-generic:
  507. +
  508. +distclean-generic:
  509. + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
  510. + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
  511. +
  512. +maintainer-clean-generic:
  513. + @echo "This command is intended for maintainers to use"
  514. + @echo "it deletes files that may require special tools to rebuild."
  515. +clean: clean-am
  516. +
  517. +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
  518. + mostlyclean-am
  519. +
  520. +distclean: distclean-am
  521. + -rm -f ./$(DEPDIR)/json_process.Po
  522. + -rm -f Makefile
  523. +distclean-am: clean-am distclean-compile distclean-generic \
  524. + distclean-tags
  525. +
  526. +dvi: dvi-am
  527. +
  528. +dvi-am:
  529. +
  530. +html: html-am
  531. +
  532. +html-am:
  533. +
  534. +info: info-am
  535. +
  536. +info-am:
  537. +
  538. +install-data-am:
  539. +
  540. +install-dvi: install-dvi-am
  541. +
  542. +install-dvi-am:
  543. +
  544. +install-exec-am:
  545. +
  546. +install-html: install-html-am
  547. +
  548. +install-html-am:
  549. +
  550. +install-info: install-info-am
  551. +
  552. +install-info-am:
  553. +
  554. +install-man:
  555. +
  556. +install-pdf: install-pdf-am
  557. +
  558. +install-pdf-am:
  559. +
  560. +install-ps: install-ps-am
  561. +
  562. +install-ps-am:
  563. +
  564. +installcheck-am:
  565. +
  566. +maintainer-clean: maintainer-clean-am
  567. + -rm -f ./$(DEPDIR)/json_process.Po
  568. + -rm -f Makefile
  569. +maintainer-clean-am: distclean-am maintainer-clean-generic
  570. +
  571. +mostlyclean: mostlyclean-am
  572. +
  573. +mostlyclean-am: mostlyclean-compile mostlyclean-generic \
  574. + mostlyclean-libtool
  575. +
  576. +pdf: pdf-am
  577. +
  578. +pdf-am:
  579. +
  580. +ps: ps-am
  581. +
  582. +ps-am:
  583. +
  584. +uninstall-am:
  585. +
  586. +.MAKE: check-am install-am install-strip
  587. +
  588. +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
  589. + clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
  590. + ctags ctags-am distclean distclean-compile distclean-generic \
  591. + distclean-libtool distclean-tags distdir dvi dvi-am html \
  592. + html-am info info-am install install-am install-data \
  593. + install-data-am install-dvi install-dvi-am install-exec \
  594. + install-exec-am install-html install-html-am install-info \
  595. + install-info-am install-man install-pdf install-pdf-am \
  596. + install-ps install-ps-am install-strip installcheck \
  597. + installcheck-am installdirs maintainer-clean \
  598. + maintainer-clean-generic mostlyclean mostlyclean-compile \
  599. + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
  600. + tags tags-am uninstall uninstall-am
  601. +
  602. +.PRECIOUS: Makefile
  603. +
  604. +
  605. +# Tell versions [3.59,3.63) of GNU make to not export all variables.
  606. +# Otherwise a system limit (for SysV at least) may be exceeded.
  607. +.NOEXPORT:
  608. --- /dev/null
  609. +++ cardinal-22.02/src/Rack/dep/jansson-2.12/test/bin/json_process.c
  610. @@ -0,0 +1,385 @@
  611. +/*
  612. + * Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>
  613. + *
  614. + * Jansson is free software; you can redistribute it and/or modify
  615. + * it under the terms of the MIT license. See LICENSE for details.
  616. + */
  617. +
  618. +#ifdef HAVE_CONFIG_H
  619. +#include <jansson_private_config.h>
  620. +#endif
  621. +
  622. +#include <stdio.h>
  623. +#include <stdlib.h>
  624. +#include <string.h>
  625. +#include <ctype.h>
  626. +#include <jansson.h>
  627. +
  628. +#ifdef HAVE_LOCALE_H
  629. +#include <locale.h>
  630. + #endif
  631. +
  632. +#if _WIN32
  633. +#include <io.h> /* for _setmode() */
  634. +#include <fcntl.h> /* for _O_BINARY */
  635. +
  636. +static const char dir_sep = '\\';
  637. +#else
  638. +static const char dir_sep = '/';
  639. +#endif
  640. +
  641. +
  642. +struct config {
  643. + int indent;
  644. + int compact;
  645. + int preserve_order;
  646. + int ensure_ascii;
  647. + int sort_keys;
  648. + int strip;
  649. + int use_env;
  650. + int have_hashseed;
  651. + int hashseed;
  652. + int precision;
  653. +} conf;
  654. +
  655. +#define l_isspace(c) ((c) == ' ' || (c) == '\n' || (c) == '\r' || (c) == '\t')
  656. +
  657. +/* Return a pointer to the first non-whitespace character of str.
  658. + Modifies str so that all trailing whitespace characters are
  659. + replaced by '\0'. */
  660. +static const char *strip(char *str)
  661. +{
  662. + size_t length;
  663. + char *result = str;
  664. + while (*result && l_isspace(*result))
  665. + result++;
  666. +
  667. + length = strlen(result);
  668. + if (length == 0)
  669. + return result;
  670. +
  671. + while (l_isspace(result[length - 1]))
  672. + result[--length] = '\0';
  673. +
  674. + return result;
  675. +}
  676. +
  677. +
  678. +static char *loadfile(FILE *file)
  679. +{
  680. + long fsize, ret;
  681. + char *buf;
  682. +
  683. + fseek(file, 0, SEEK_END);
  684. + fsize = ftell(file);
  685. + fseek(file, 0, SEEK_SET);
  686. +
  687. + buf = malloc(fsize+1);
  688. + ret = fread(buf, 1, fsize, file);
  689. + if (ret != fsize)
  690. + exit(1);
  691. + buf[fsize] = '\0';
  692. +
  693. + return buf;
  694. +}
  695. +
  696. +
  697. +static void read_conf(FILE *conffile)
  698. +{
  699. + char *buffer, *line, *val;
  700. +
  701. + buffer = loadfile(conffile);
  702. + for (line = strtok(buffer, "\r\n"); line; line = strtok(NULL, "\r\n")) {
  703. + if (!strncmp(line, "export ", 7))
  704. + continue;
  705. + val = strchr(line, '=');
  706. + if (!val) {
  707. + printf("invalid configuration line\n");
  708. + break;
  709. + }
  710. + *val++ = '\0';
  711. +
  712. + if (!strcmp(line, "JSON_INDENT"))
  713. + conf.indent = atoi(val);
  714. + if (!strcmp(line, "JSON_COMPACT"))
  715. + conf.compact = atoi(val);
  716. + if (!strcmp(line, "JSON_ENSURE_ASCII"))
  717. + conf.ensure_ascii = atoi(val);
  718. + if (!strcmp(line, "JSON_PRESERVE_ORDER"))
  719. + conf.preserve_order = atoi(val);
  720. + if (!strcmp(line, "JSON_SORT_KEYS"))
  721. + conf.sort_keys = atoi(val);
  722. + if (!strcmp(line, "JSON_REAL_PRECISION"))
  723. + conf.precision = atoi(val);
  724. + if (!strcmp(line, "STRIP"))
  725. + conf.strip = atoi(val);
  726. + if (!strcmp(line, "HASHSEED")) {
  727. + conf.have_hashseed = 1;
  728. + conf.hashseed = atoi(val);
  729. + } else {
  730. + conf.have_hashseed = 0;
  731. + }
  732. + }
  733. +
  734. + free(buffer);
  735. +}
  736. +
  737. +
  738. +static int cmpfile(const char *str, const char *path, const char *fname)
  739. +{
  740. + char filename[1024], *buffer;
  741. + int ret;
  742. + FILE *file;
  743. +
  744. + sprintf(filename, "%s%c%s", path, dir_sep, fname);
  745. + file = fopen(filename, "rb");
  746. + if (!file) {
  747. + if (conf.strip)
  748. + strcat(filename, ".strip");
  749. + else
  750. + strcat(filename, ".normal");
  751. + file = fopen(filename, "rb");
  752. + }
  753. + if (!file) {
  754. + printf("Error: test result file could not be opened.\n");
  755. + exit(1);
  756. + }
  757. +
  758. + buffer = loadfile(file);
  759. + if (strcmp(buffer, str) != 0)
  760. + ret = 1;
  761. + else
  762. + ret = 0;
  763. + free(buffer);
  764. + fclose(file);
  765. +
  766. + return ret;
  767. +}
  768. +
  769. +int use_conf(char *test_path)
  770. +{
  771. + int ret;
  772. + size_t flags = 0;
  773. + char filename[1024], errstr[1024];
  774. + char *buffer;
  775. + FILE *infile, *conffile;
  776. + json_t *json;
  777. + json_error_t error;
  778. +
  779. + sprintf(filename, "%s%cinput", test_path, dir_sep);
  780. + if (!(infile = fopen(filename, "rb"))) {
  781. + fprintf(stderr, "Could not open \"%s\"\n", filename);
  782. + return 2;
  783. + }
  784. +
  785. + sprintf(filename, "%s%cenv", test_path, dir_sep);
  786. + conffile = fopen(filename, "rb");
  787. + if (conffile) {
  788. + read_conf(conffile);
  789. + fclose(conffile);
  790. + }
  791. +
  792. + if (conf.indent < 0 || conf.indent > 31) {
  793. + fprintf(stderr, "invalid value for JSON_INDENT: %d\n", conf.indent);
  794. + fclose(infile);
  795. + return 2;
  796. + }
  797. + if (conf.indent)
  798. + flags |= JSON_INDENT(conf.indent);
  799. +
  800. + if (conf.compact)
  801. + flags |= JSON_COMPACT;
  802. +
  803. + if (conf.ensure_ascii)
  804. + flags |= JSON_ENSURE_ASCII;
  805. +
  806. + if (conf.preserve_order)
  807. + flags |= JSON_PRESERVE_ORDER;
  808. +
  809. + if (conf.sort_keys)
  810. + flags |= JSON_SORT_KEYS;
  811. +
  812. + if (conf.precision < 0 || conf.precision > 31) {
  813. + fprintf(stderr, "invalid value for JSON_REAL_PRECISION: %d\n",
  814. + conf.precision);
  815. + fclose(infile);
  816. + return 2;
  817. + }
  818. + if (conf.precision)
  819. + flags |= JSON_REAL_PRECISION(conf.precision);
  820. +
  821. + if (conf.have_hashseed)
  822. + json_object_seed(conf.hashseed);
  823. +
  824. + if (conf.strip) {
  825. + /* Load to memory, strip leading and trailing whitespace */
  826. + buffer = loadfile(infile);
  827. + json = json_loads(strip(buffer), 0, &error);
  828. + free(buffer);
  829. + }
  830. + else
  831. + json = json_loadf(infile, 0, &error);
  832. +
  833. + fclose(infile);
  834. +
  835. + if (!json) {
  836. + sprintf(errstr, "%d %d %d\n%s\n",
  837. + error.line, error.column, error.position,
  838. + error.text);
  839. +
  840. + ret = cmpfile(errstr, test_path, "error");
  841. + return ret;
  842. + }
  843. +
  844. + buffer = json_dumps(json, flags);
  845. + ret = cmpfile(buffer, test_path, "output");
  846. + free(buffer);
  847. + json_decref(json);
  848. +
  849. + return ret;
  850. +}
  851. +
  852. +static int getenv_int(const char *name)
  853. +{
  854. + char *value, *end;
  855. + long result;
  856. +
  857. + value = getenv(name);
  858. + if(!value)
  859. + return 0;
  860. +
  861. + result = strtol(value, &end, 10);
  862. + if(*end != '\0')
  863. + return 0;
  864. +
  865. + return (int)result;
  866. +}
  867. +
  868. +int use_env()
  869. +{
  870. + int indent, precision;
  871. + size_t flags = 0;
  872. + json_t *json;
  873. + json_error_t error;
  874. +
  875. + #ifdef _WIN32
  876. + /* On Windows, set stdout and stderr to binary mode to avoid
  877. + outputting DOS line terminators */
  878. + _setmode(_fileno(stdout), _O_BINARY);
  879. + _setmode(_fileno(stderr), _O_BINARY);
  880. + #endif
  881. +
  882. + indent = getenv_int("JSON_INDENT");
  883. + if(indent < 0 || indent > 31) {
  884. + fprintf(stderr, "invalid value for JSON_INDENT: %d\n", indent);
  885. + return 2;
  886. + }
  887. + if(indent > 0)
  888. + flags |= JSON_INDENT(indent);
  889. +
  890. + if(getenv_int("JSON_COMPACT") > 0)
  891. + flags |= JSON_COMPACT;
  892. +
  893. + if(getenv_int("JSON_ENSURE_ASCII"))
  894. + flags |= JSON_ENSURE_ASCII;
  895. +
  896. + if(getenv_int("JSON_PRESERVE_ORDER"))
  897. + flags |= JSON_PRESERVE_ORDER;
  898. +
  899. + if(getenv_int("JSON_SORT_KEYS"))
  900. + flags |= JSON_SORT_KEYS;
  901. +
  902. + precision = getenv_int("JSON_REAL_PRECISION");
  903. + if(precision < 0 || precision > 31) {
  904. + fprintf(stderr, "invalid value for JSON_REAL_PRECISION: %d\n",
  905. + precision);
  906. + return 2;
  907. + }
  908. +
  909. + if(getenv("HASHSEED"))
  910. + json_object_seed(getenv_int("HASHSEED"));
  911. +
  912. + if(precision > 0)
  913. + flags |= JSON_REAL_PRECISION(precision);
  914. +
  915. + if(getenv_int("STRIP")) {
  916. + /* Load to memory, strip leading and trailing whitespace */
  917. + size_t size = 0, used = 0;
  918. + char *buffer = NULL, *buf_ck = NULL;
  919. +
  920. + while(1) {
  921. + size_t count;
  922. +
  923. + size = (size == 0 ? 128 : size * 2);
  924. + buf_ck = realloc(buffer, size);
  925. + if(!buf_ck) {
  926. + fprintf(stderr, "Unable to allocate %d bytes\n", (int)size);
  927. + free(buffer);
  928. + return 1;
  929. + }
  930. + buffer = buf_ck;
  931. +
  932. + count = fread(buffer + used, 1, size - used, stdin);
  933. + if(count < size - used) {
  934. + buffer[used + count] = '\0';
  935. + break;
  936. + }
  937. + used += count;
  938. + }
  939. +
  940. + json = json_loads(strip(buffer), 0, &error);
  941. + free(buffer);
  942. + }
  943. + else
  944. + json = json_loadf(stdin, 0, &error);
  945. +
  946. + if(!json) {
  947. + fprintf(stderr, "%d %d %d\n%s\n",
  948. + error.line, error.column,
  949. + error.position, error.text);
  950. + return 1;
  951. + }
  952. +
  953. + json_dumpf(json, stdout, flags);
  954. + json_decref(json);
  955. +
  956. + return 0;
  957. +}
  958. +
  959. +int main(int argc, char *argv[])
  960. +{
  961. + int i;
  962. + char *test_path = NULL;
  963. +
  964. + #ifdef HAVE_SETLOCALE
  965. + setlocale(LC_ALL, "");
  966. + #endif
  967. +
  968. + if (argc < 2) {
  969. + goto usage;
  970. + }
  971. +
  972. + for (i = 1; i < argc; i++) {
  973. + if (!strcmp(argv[i], "--strip"))
  974. + conf.strip = 1;
  975. + else if (!strcmp(argv[i], "--env"))
  976. + conf.use_env = 1;
  977. + else
  978. + test_path = argv[i];
  979. + }
  980. +
  981. + if (conf.use_env)
  982. + return use_env();
  983. + else
  984. + {
  985. + if (!test_path)
  986. + goto usage;
  987. +
  988. + return use_conf(test_path);
  989. + }
  990. +
  991. +usage:
  992. + fprintf(stderr, "argc =%d\n", argc);
  993. + fprintf(stderr, "usage: %s [--strip] [--env] test_dir\n", argv[0]);
  994. + return 2;
  995. +}
  996. --- /dev/null
  997. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/ax_append_compile_flags.m4
  998. @@ -0,0 +1,67 @@
  999. +# ===========================================================================
  1000. +# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
  1001. +# ===========================================================================
  1002. +#
  1003. +# SYNOPSIS
  1004. +#
  1005. +# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
  1006. +#
  1007. +# DESCRIPTION
  1008. +#
  1009. +# For every FLAG1, FLAG2 it is checked whether the compiler works with the
  1010. +# flag. If it does, the flag is added FLAGS-VARIABLE
  1011. +#
  1012. +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
  1013. +# CFLAGS) is used. During the check the flag is always added to the
  1014. +# current language's flags.
  1015. +#
  1016. +# If EXTRA-FLAGS is defined, it is added to the current language's default
  1017. +# flags (e.g. CFLAGS) when the check is done. The check is thus made with
  1018. +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
  1019. +# force the compiler to issue an error when a bad flag is given.
  1020. +#
  1021. +# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
  1022. +#
  1023. +# NOTE: This macro depends on the AX_APPEND_FLAG and
  1024. +# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
  1025. +# AX_APPEND_LINK_FLAGS.
  1026. +#
  1027. +# LICENSE
  1028. +#
  1029. +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  1030. +#
  1031. +# This program is free software: you can redistribute it and/or modify it
  1032. +# under the terms of the GNU General Public License as published by the
  1033. +# Free Software Foundation, either version 3 of the License, or (at your
  1034. +# option) any later version.
  1035. +#
  1036. +# This program is distributed in the hope that it will be useful, but
  1037. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  1038. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  1039. +# Public License for more details.
  1040. +#
  1041. +# You should have received a copy of the GNU General Public License along
  1042. +# with this program. If not, see <http://www.gnu.org/licenses/>.
  1043. +#
  1044. +# As a special exception, the respective Autoconf Macro's copyright owner
  1045. +# gives unlimited permission to copy, distribute and modify the configure
  1046. +# scripts that are the output of Autoconf when processing the Macro. You
  1047. +# need not follow the terms of the GNU General Public License when using
  1048. +# or distributing such scripts, even though portions of the text of the
  1049. +# Macro appear in them. The GNU General Public License (GPL) does govern
  1050. +# all other use of the material that constitutes the Autoconf Macro.
  1051. +#
  1052. +# This special exception to the GPL applies to versions of the Autoconf
  1053. +# Macro released by the Autoconf Archive. When you make and distribute a
  1054. +# modified version of the Autoconf Macro, you may extend this special
  1055. +# exception to the GPL to apply to your modified version as well.
  1056. +
  1057. +#serial 5
  1058. +
  1059. +AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
  1060. +[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
  1061. +AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
  1062. +for flag in $1; do
  1063. + AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4])
  1064. +done
  1065. +])dnl AX_APPEND_COMPILE_FLAGS
  1066. --- /dev/null
  1067. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/ax_append_flag.m4
  1068. @@ -0,0 +1,71 @@
  1069. +# ===========================================================================
  1070. +# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
  1071. +# ===========================================================================
  1072. +#
  1073. +# SYNOPSIS
  1074. +#
  1075. +# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
  1076. +#
  1077. +# DESCRIPTION
  1078. +#
  1079. +# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
  1080. +# added in between.
  1081. +#
  1082. +# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
  1083. +# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
  1084. +# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
  1085. +# FLAG.
  1086. +#
  1087. +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
  1088. +#
  1089. +# LICENSE
  1090. +#
  1091. +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  1092. +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  1093. +#
  1094. +# This program is free software: you can redistribute it and/or modify it
  1095. +# under the terms of the GNU General Public License as published by the
  1096. +# Free Software Foundation, either version 3 of the License, or (at your
  1097. +# option) any later version.
  1098. +#
  1099. +# This program is distributed in the hope that it will be useful, but
  1100. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  1101. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  1102. +# Public License for more details.
  1103. +#
  1104. +# You should have received a copy of the GNU General Public License along
  1105. +# with this program. If not, see <http://www.gnu.org/licenses/>.
  1106. +#
  1107. +# As a special exception, the respective Autoconf Macro's copyright owner
  1108. +# gives unlimited permission to copy, distribute and modify the configure
  1109. +# scripts that are the output of Autoconf when processing the Macro. You
  1110. +# need not follow the terms of the GNU General Public License when using
  1111. +# or distributing such scripts, even though portions of the text of the
  1112. +# Macro appear in them. The GNU General Public License (GPL) does govern
  1113. +# all other use of the material that constitutes the Autoconf Macro.
  1114. +#
  1115. +# This special exception to the GPL applies to versions of the Autoconf
  1116. +# Macro released by the Autoconf Archive. When you make and distribute a
  1117. +# modified version of the Autoconf Macro, you may extend this special
  1118. +# exception to the GPL to apply to your modified version as well.
  1119. +
  1120. +#serial 6
  1121. +
  1122. +AC_DEFUN([AX_APPEND_FLAG],
  1123. +[dnl
  1124. +AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
  1125. +AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
  1126. +AS_VAR_SET_IF(FLAGS,[
  1127. + AS_CASE([" AS_VAR_GET(FLAGS) "],
  1128. + [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
  1129. + [
  1130. + AS_VAR_APPEND(FLAGS,[" $1"])
  1131. + AC_RUN_LOG([: FLAGS="$FLAGS"])
  1132. + ])
  1133. + ],
  1134. + [
  1135. + AS_VAR_SET(FLAGS,[$1])
  1136. + AC_RUN_LOG([: FLAGS="$FLAGS"])
  1137. + ])
  1138. +AS_VAR_POPDEF([FLAGS])dnl
  1139. +])dnl AX_APPEND_FLAG
  1140. --- /dev/null
  1141. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/ax_check_compile_flag.m4
  1142. @@ -0,0 +1,74 @@
  1143. +# ===========================================================================
  1144. +# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
  1145. +# ===========================================================================
  1146. +#
  1147. +# SYNOPSIS
  1148. +#
  1149. +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
  1150. +#
  1151. +# DESCRIPTION
  1152. +#
  1153. +# Check whether the given FLAG works with the current language's compiler
  1154. +# or gives an error. (Warnings, however, are ignored)
  1155. +#
  1156. +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  1157. +# success/failure.
  1158. +#
  1159. +# If EXTRA-FLAGS is defined, it is added to the current language's default
  1160. +# flags (e.g. CFLAGS) when the check is done. The check is thus made with
  1161. +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
  1162. +# force the compiler to issue an error when a bad flag is given.
  1163. +#
  1164. +# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
  1165. +#
  1166. +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
  1167. +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
  1168. +#
  1169. +# LICENSE
  1170. +#
  1171. +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  1172. +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  1173. +#
  1174. +# This program is free software: you can redistribute it and/or modify it
  1175. +# under the terms of the GNU General Public License as published by the
  1176. +# Free Software Foundation, either version 3 of the License, or (at your
  1177. +# option) any later version.
  1178. +#
  1179. +# This program is distributed in the hope that it will be useful, but
  1180. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  1181. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  1182. +# Public License for more details.
  1183. +#
  1184. +# You should have received a copy of the GNU General Public License along
  1185. +# with this program. If not, see <http://www.gnu.org/licenses/>.
  1186. +#
  1187. +# As a special exception, the respective Autoconf Macro's copyright owner
  1188. +# gives unlimited permission to copy, distribute and modify the configure
  1189. +# scripts that are the output of Autoconf when processing the Macro. You
  1190. +# need not follow the terms of the GNU General Public License when using
  1191. +# or distributing such scripts, even though portions of the text of the
  1192. +# Macro appear in them. The GNU General Public License (GPL) does govern
  1193. +# all other use of the material that constitutes the Autoconf Macro.
  1194. +#
  1195. +# This special exception to the GPL applies to versions of the Autoconf
  1196. +# Macro released by the Autoconf Archive. When you make and distribute a
  1197. +# modified version of the Autoconf Macro, you may extend this special
  1198. +# exception to the GPL to apply to your modified version as well.
  1199. +
  1200. +#serial 4
  1201. +
  1202. +AC_DEFUN([AX_CHECK_COMPILE_FLAG],
  1203. +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
  1204. +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
  1205. +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
  1206. + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
  1207. + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
  1208. + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
  1209. + [AS_VAR_SET(CACHEVAR,[yes])],
  1210. + [AS_VAR_SET(CACHEVAR,[no])])
  1211. + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
  1212. +AS_VAR_IF(CACHEVAR,yes,
  1213. + [m4_default([$2], :)],
  1214. + [m4_default([$3], :)])
  1215. +AS_VAR_POPDEF([CACHEVAR])dnl
  1216. +])dnl AX_CHECK_COMPILE_FLAGS
  1217. --- /dev/null
  1218. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/ax_require_defined.m4
  1219. @@ -0,0 +1,37 @@
  1220. +# ===========================================================================
  1221. +# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
  1222. +# ===========================================================================
  1223. +#
  1224. +# SYNOPSIS
  1225. +#
  1226. +# AX_REQUIRE_DEFINED(MACRO)
  1227. +#
  1228. +# DESCRIPTION
  1229. +#
  1230. +# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
  1231. +# been defined and thus are available for use. This avoids random issues
  1232. +# where a macro isn't expanded. Instead the configure script emits a
  1233. +# non-fatal:
  1234. +#
  1235. +# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
  1236. +#
  1237. +# It's like AC_REQUIRE except it doesn't expand the required macro.
  1238. +#
  1239. +# Here's an example:
  1240. +#
  1241. +# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
  1242. +#
  1243. +# LICENSE
  1244. +#
  1245. +# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
  1246. +#
  1247. +# Copying and distribution of this file, with or without modification, are
  1248. +# permitted in any medium without royalty provided the copyright notice
  1249. +# and this notice are preserved. This file is offered as-is, without any
  1250. +# warranty.
  1251. +
  1252. +#serial 1
  1253. +
  1254. +AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
  1255. + m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
  1256. +])dnl AX_REQUIRE_DEFINED
  1257. --- /dev/null
  1258. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/check_stdcall_func.m4
  1259. @@ -0,0 +1,51 @@
  1260. +# AC_LANG_STDCALL_FUNC_LINK_TRY(FUNCTION, SIGNATURE)
  1261. +# -------------------------------
  1262. +# Produce a source which links correctly iff the FUNCTION exists.
  1263. +AC_DEFUN([AC_LANG_STDCALL_FUNC_LINK_TRY],
  1264. +[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
  1265. +
  1266. +# AC_CHECK_STDCALL_FUNC(FUNCTION, SIGNATURE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  1267. +# -----------------------------------------------------------------
  1268. +AC_DEFUN([AC_CHECK_STDCALL_FUNC],
  1269. +[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$1])dnl
  1270. +AC_CACHE_CHECK([for $1], ac_var,
  1271. +[AC_LINK_IFELSE([AC_LANG_STDCALL_FUNC_LINK_TRY([$1],[$2])],
  1272. + [AS_VAR_SET(ac_var, yes)],
  1273. + [AS_VAR_SET(ac_var, no)])])
  1274. +AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
  1275. +AS_VAR_POPDEF([ac_var])dnl
  1276. +])# AC_CHECK_FUNC
  1277. +
  1278. +# AC_LANG_STDCALL_FUNC_LINK_TRY(C)(FUNCTION, SIGNATURE)
  1279. +# ----------------------------------
  1280. +# Don't include <ctype.h> because on OSF/1 3.0 it includes
  1281. +# <sys/types.h> which includes <sys/select.h> which contains a
  1282. +# prototype for select. Similarly for bzero.
  1283. +m4_define([AC_LANG_STDCALL_FUNC_LINK_TRY(C)],
  1284. +[AC_LANG_PROGRAM(
  1285. +[/* System header to define __stub macros and hopefully few prototypes,
  1286. + which can conflict with char __stdcall $1 ( $2 ) below. */
  1287. +#include <assert.h>
  1288. +/* Override any gcc2 internal prototype to avoid an error. */
  1289. +#ifdef __cplusplus
  1290. +extern "C"
  1291. +#endif
  1292. +/* We use char because int might match the return type of a gcc2
  1293. + builtin and then its argument prototype would still apply. */
  1294. +char __stdcall $1 ( $2 );
  1295. +char (*f) ( $2 );
  1296. +],
  1297. +[/* The GNU C library defines this for functions which it implements
  1298. + to always fail with ENOSYS. Some functions are actually named
  1299. + something starting with __ and the normal name is an alias. */
  1300. +#if defined (__stub_$1) || defined (__stub___$1)
  1301. +choke me
  1302. +#else
  1303. +f = $1;
  1304. +#endif
  1305. +])])
  1306. +
  1307. +# AC_LANG_STDCALL_FUNC_LINK_TRY(C++)(FUNCTION)
  1308. +# ------------------------------------
  1309. +m4_copy([AC_LANG_STDCALL_FUNC_LINK_TRY(C)], [AC_LANG_STDCALL_FUNC_LINK_TRY(C++)])
  1310. +
  1311. --- /dev/null
  1312. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/compile
  1313. @@ -0,0 +1,347 @@
  1314. +#! /bin/sh
  1315. +# Wrapper for compilers which do not understand '-c -o'.
  1316. +
  1317. +scriptversion=2012-10-14.11; # UTC
  1318. +
  1319. +# Copyright (C) 1999-2014 Free Software Foundation, Inc.
  1320. +# Written by Tom Tromey <tromey@cygnus.com>.
  1321. +#
  1322. +# This program is free software; you can redistribute it and/or modify
  1323. +# it under the terms of the GNU General Public License as published by
  1324. +# the Free Software Foundation; either version 2, or (at your option)
  1325. +# any later version.
  1326. +#
  1327. +# This program is distributed in the hope that it will be useful,
  1328. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  1329. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1330. +# GNU General Public License for more details.
  1331. +#
  1332. +# You should have received a copy of the GNU General Public License
  1333. +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  1334. +
  1335. +# As a special exception to the GNU General Public License, if you
  1336. +# distribute this file as part of a program that contains a
  1337. +# configuration script generated by Autoconf, you may include it under
  1338. +# the same distribution terms that you use for the rest of that program.
  1339. +
  1340. +# This file is maintained in Automake, please report
  1341. +# bugs to <bug-automake@gnu.org> or send patches to
  1342. +# <automake-patches@gnu.org>.
  1343. +
  1344. +nl='
  1345. +'
  1346. +
  1347. +# We need space, tab and new line, in precisely that order. Quoting is
  1348. +# there to prevent tools from complaining about whitespace usage.
  1349. +IFS=" "" $nl"
  1350. +
  1351. +file_conv=
  1352. +
  1353. +# func_file_conv build_file lazy
  1354. +# Convert a $build file to $host form and store it in $file
  1355. +# Currently only supports Windows hosts. If the determined conversion
  1356. +# type is listed in (the comma separated) LAZY, no conversion will
  1357. +# take place.
  1358. +func_file_conv ()
  1359. +{
  1360. + file=$1
  1361. + case $file in
  1362. + / | /[!/]*) # absolute file, and not a UNC file
  1363. + if test -z "$file_conv"; then
  1364. + # lazily determine how to convert abs files
  1365. + case `uname -s` in
  1366. + MINGW*)
  1367. + file_conv=mingw
  1368. + ;;
  1369. + CYGWIN*)
  1370. + file_conv=cygwin
  1371. + ;;
  1372. + *)
  1373. + file_conv=wine
  1374. + ;;
  1375. + esac
  1376. + fi
  1377. + case $file_conv/,$2, in
  1378. + *,$file_conv,*)
  1379. + ;;
  1380. + mingw/*)
  1381. + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
  1382. + ;;
  1383. + cygwin/*)
  1384. + file=`cygpath -m "$file" || echo "$file"`
  1385. + ;;
  1386. + wine/*)
  1387. + file=`winepath -w "$file" || echo "$file"`
  1388. + ;;
  1389. + esac
  1390. + ;;
  1391. + esac
  1392. +}
  1393. +
  1394. +# func_cl_dashL linkdir
  1395. +# Make cl look for libraries in LINKDIR
  1396. +func_cl_dashL ()
  1397. +{
  1398. + func_file_conv "$1"
  1399. + if test -z "$lib_path"; then
  1400. + lib_path=$file
  1401. + else
  1402. + lib_path="$lib_path;$file"
  1403. + fi
  1404. + linker_opts="$linker_opts -LIBPATH:$file"
  1405. +}
  1406. +
  1407. +# func_cl_dashl library
  1408. +# Do a library search-path lookup for cl
  1409. +func_cl_dashl ()
  1410. +{
  1411. + lib=$1
  1412. + found=no
  1413. + save_IFS=$IFS
  1414. + IFS=';'
  1415. + for dir in $lib_path $LIB
  1416. + do
  1417. + IFS=$save_IFS
  1418. + if $shared && test -f "$dir/$lib.dll.lib"; then
  1419. + found=yes
  1420. + lib=$dir/$lib.dll.lib
  1421. + break
  1422. + fi
  1423. + if test -f "$dir/$lib.lib"; then
  1424. + found=yes
  1425. + lib=$dir/$lib.lib
  1426. + break
  1427. + fi
  1428. + if test -f "$dir/lib$lib.a"; then
  1429. + found=yes
  1430. + lib=$dir/lib$lib.a
  1431. + break
  1432. + fi
  1433. + done
  1434. + IFS=$save_IFS
  1435. +
  1436. + if test "$found" != yes; then
  1437. + lib=$lib.lib
  1438. + fi
  1439. +}
  1440. +
  1441. +# func_cl_wrapper cl arg...
  1442. +# Adjust compile command to suit cl
  1443. +func_cl_wrapper ()
  1444. +{
  1445. + # Assume a capable shell
  1446. + lib_path=
  1447. + shared=:
  1448. + linker_opts=
  1449. + for arg
  1450. + do
  1451. + if test -n "$eat"; then
  1452. + eat=
  1453. + else
  1454. + case $1 in
  1455. + -o)
  1456. + # configure might choose to run compile as 'compile cc -o foo foo.c'.
  1457. + eat=1
  1458. + case $2 in
  1459. + *.o | *.[oO][bB][jJ])
  1460. + func_file_conv "$2"
  1461. + set x "$@" -Fo"$file"
  1462. + shift
  1463. + ;;
  1464. + *)
  1465. + func_file_conv "$2"
  1466. + set x "$@" -Fe"$file"
  1467. + shift
  1468. + ;;
  1469. + esac
  1470. + ;;
  1471. + -I)
  1472. + eat=1
  1473. + func_file_conv "$2" mingw
  1474. + set x "$@" -I"$file"
  1475. + shift
  1476. + ;;
  1477. + -I*)
  1478. + func_file_conv "${1#-I}" mingw
  1479. + set x "$@" -I"$file"
  1480. + shift
  1481. + ;;
  1482. + -l)
  1483. + eat=1
  1484. + func_cl_dashl "$2"
  1485. + set x "$@" "$lib"
  1486. + shift
  1487. + ;;
  1488. + -l*)
  1489. + func_cl_dashl "${1#-l}"
  1490. + set x "$@" "$lib"
  1491. + shift
  1492. + ;;
  1493. + -L)
  1494. + eat=1
  1495. + func_cl_dashL "$2"
  1496. + ;;
  1497. + -L*)
  1498. + func_cl_dashL "${1#-L}"
  1499. + ;;
  1500. + -static)
  1501. + shared=false
  1502. + ;;
  1503. + -Wl,*)
  1504. + arg=${1#-Wl,}
  1505. + save_ifs="$IFS"; IFS=','
  1506. + for flag in $arg; do
  1507. + IFS="$save_ifs"
  1508. + linker_opts="$linker_opts $flag"
  1509. + done
  1510. + IFS="$save_ifs"
  1511. + ;;
  1512. + -Xlinker)
  1513. + eat=1
  1514. + linker_opts="$linker_opts $2"
  1515. + ;;
  1516. + -*)
  1517. + set x "$@" "$1"
  1518. + shift
  1519. + ;;
  1520. + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
  1521. + func_file_conv "$1"
  1522. + set x "$@" -Tp"$file"
  1523. + shift
  1524. + ;;
  1525. + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
  1526. + func_file_conv "$1" mingw
  1527. + set x "$@" "$file"
  1528. + shift
  1529. + ;;
  1530. + *)
  1531. + set x "$@" "$1"
  1532. + shift
  1533. + ;;
  1534. + esac
  1535. + fi
  1536. + shift
  1537. + done
  1538. + if test -n "$linker_opts"; then
  1539. + linker_opts="-link$linker_opts"
  1540. + fi
  1541. + exec "$@" $linker_opts
  1542. + exit 1
  1543. +}
  1544. +
  1545. +eat=
  1546. +
  1547. +case $1 in
  1548. + '')
  1549. + echo "$0: No command. Try '$0 --help' for more information." 1>&2
  1550. + exit 1;
  1551. + ;;
  1552. + -h | --h*)
  1553. + cat <<\EOF
  1554. +Usage: compile [--help] [--version] PROGRAM [ARGS]
  1555. +
  1556. +Wrapper for compilers which do not understand '-c -o'.
  1557. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
  1558. +arguments, and rename the output as expected.
  1559. +
  1560. +If you are trying to build a whole package this is not the
  1561. +right script to run: please start by reading the file 'INSTALL'.
  1562. +
  1563. +Report bugs to <bug-automake@gnu.org>.
  1564. +EOF
  1565. + exit $?
  1566. + ;;
  1567. + -v | --v*)
  1568. + echo "compile $scriptversion"
  1569. + exit $?
  1570. + ;;
  1571. + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
  1572. + func_cl_wrapper "$@" # Doesn't return...
  1573. + ;;
  1574. +esac
  1575. +
  1576. +ofile=
  1577. +cfile=
  1578. +
  1579. +for arg
  1580. +do
  1581. + if test -n "$eat"; then
  1582. + eat=
  1583. + else
  1584. + case $1 in
  1585. + -o)
  1586. + # configure might choose to run compile as 'compile cc -o foo foo.c'.
  1587. + # So we strip '-o arg' only if arg is an object.
  1588. + eat=1
  1589. + case $2 in
  1590. + *.o | *.obj)
  1591. + ofile=$2
  1592. + ;;
  1593. + *)
  1594. + set x "$@" -o "$2"
  1595. + shift
  1596. + ;;
  1597. + esac
  1598. + ;;
  1599. + *.c)
  1600. + cfile=$1
  1601. + set x "$@" "$1"
  1602. + shift
  1603. + ;;
  1604. + *)
  1605. + set x "$@" "$1"
  1606. + shift
  1607. + ;;
  1608. + esac
  1609. + fi
  1610. + shift
  1611. +done
  1612. +
  1613. +if test -z "$ofile" || test -z "$cfile"; then
  1614. + # If no '-o' option was seen then we might have been invoked from a
  1615. + # pattern rule where we don't need one. That is ok -- this is a
  1616. + # normal compilation that the losing compiler can handle. If no
  1617. + # '.c' file was seen then we are probably linking. That is also
  1618. + # ok.
  1619. + exec "$@"
  1620. +fi
  1621. +
  1622. +# Name of file we expect compiler to create.
  1623. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
  1624. +
  1625. +# Create the lock directory.
  1626. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name
  1627. +# that we are using for the .o file. Also, base the name on the expected
  1628. +# object file name, since that is what matters with a parallel build.
  1629. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
  1630. +while true; do
  1631. + if mkdir "$lockdir" >/dev/null 2>&1; then
  1632. + break
  1633. + fi
  1634. + sleep 1
  1635. +done
  1636. +# FIXME: race condition here if user kills between mkdir and trap.
  1637. +trap "rmdir '$lockdir'; exit 1" 1 2 15
  1638. +
  1639. +# Run the compile.
  1640. +"$@"
  1641. +ret=$?
  1642. +
  1643. +if test -f "$cofile"; then
  1644. + test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
  1645. +elif test -f "${cofile}bj"; then
  1646. + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
  1647. +fi
  1648. +
  1649. +rmdir "$lockdir"
  1650. +exit $ret
  1651. +
  1652. +# Local Variables:
  1653. +# mode: shell-script
  1654. +# sh-indentation: 2
  1655. +# eval: (add-hook 'write-file-hooks 'time-stamp)
  1656. +# time-stamp-start: "scriptversion="
  1657. +# time-stamp-format: "%:y-%02m-%02d.%02H"
  1658. +# time-stamp-time-zone: "UTC"
  1659. +# time-stamp-end: "; # UTC"
  1660. +# End:
  1661. --- /dev/null
  1662. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/config.guess
  1663. @@ -0,0 +1,1480 @@
  1664. +#! /bin/sh
  1665. +# Attempt to guess a canonical system name.
  1666. +# Copyright 1992-2018 Free Software Foundation, Inc.
  1667. +
  1668. +timestamp='2018-02-24'
  1669. +
  1670. +# This file is free software; you can redistribute it and/or modify it
  1671. +# under the terms of the GNU General Public License as published by
  1672. +# the Free Software Foundation; either version 3 of the License, or
  1673. +# (at your option) any later version.
  1674. +#
  1675. +# This program is distributed in the hope that it will be useful, but
  1676. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  1677. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1678. +# General Public License for more details.
  1679. +#
  1680. +# You should have received a copy of the GNU General Public License
  1681. +# along with this program; if not, see <https://www.gnu.org/licenses/>.
  1682. +#
  1683. +# As a special exception to the GNU General Public License, if you
  1684. +# distribute this file as part of a program that contains a
  1685. +# configuration script generated by Autoconf, you may include it under
  1686. +# the same distribution terms that you use for the rest of that
  1687. +# program. This Exception is an additional permission under section 7
  1688. +# of the GNU General Public License, version 3 ("GPLv3").
  1689. +#
  1690. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
  1691. +#
  1692. +# You can get the latest version of this script from:
  1693. +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
  1694. +#
  1695. +# Please send patches to <config-patches@gnu.org>.
  1696. +
  1697. +
  1698. +me=`echo "$0" | sed -e 's,.*/,,'`
  1699. +
  1700. +usage="\
  1701. +Usage: $0 [OPTION]
  1702. +
  1703. +Output the configuration name of the system \`$me' is run on.
  1704. +
  1705. +Options:
  1706. + -h, --help print this help, then exit
  1707. + -t, --time-stamp print date of last modification, then exit
  1708. + -v, --version print version number, then exit
  1709. +
  1710. +Report bugs and patches to <config-patches@gnu.org>."
  1711. +
  1712. +version="\
  1713. +GNU config.guess ($timestamp)
  1714. +
  1715. +Originally written by Per Bothner.
  1716. +Copyright 1992-2018 Free Software Foundation, Inc.
  1717. +
  1718. +This is free software; see the source for copying conditions. There is NO
  1719. +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  1720. +
  1721. +help="
  1722. +Try \`$me --help' for more information."
  1723. +
  1724. +# Parse command line
  1725. +while test $# -gt 0 ; do
  1726. + case $1 in
  1727. + --time-stamp | --time* | -t )
  1728. + echo "$timestamp" ; exit ;;
  1729. + --version | -v )
  1730. + echo "$version" ; exit ;;
  1731. + --help | --h* | -h )
  1732. + echo "$usage"; exit ;;
  1733. + -- ) # Stop option processing
  1734. + shift; break ;;
  1735. + - ) # Use stdin as input.
  1736. + break ;;
  1737. + -* )
  1738. + echo "$me: invalid option $1$help" >&2
  1739. + exit 1 ;;
  1740. + * )
  1741. + break ;;
  1742. + esac
  1743. +done
  1744. +
  1745. +if test $# != 0; then
  1746. + echo "$me: too many arguments$help" >&2
  1747. + exit 1
  1748. +fi
  1749. +
  1750. +trap 'exit 1' 1 2 15
  1751. +
  1752. +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
  1753. +# compiler to aid in system detection is discouraged as it requires
  1754. +# temporary files to be created and, as you can see below, it is a
  1755. +# headache to deal with in a portable fashion.
  1756. +
  1757. +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
  1758. +# use `HOST_CC' if defined, but it is deprecated.
  1759. +
  1760. +# Portable tmp directory creation inspired by the Autoconf team.
  1761. +
  1762. +set_cc_for_build='
  1763. +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
  1764. +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
  1765. +: ${TMPDIR=/tmp} ;
  1766. + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  1767. + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  1768. + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  1769. + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
  1770. +dummy=$tmp/dummy ;
  1771. +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
  1772. +case $CC_FOR_BUILD,$HOST_CC,$CC in
  1773. + ,,) echo "int x;" > "$dummy.c" ;
  1774. + for c in cc gcc c89 c99 ; do
  1775. + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
  1776. + CC_FOR_BUILD="$c"; break ;
  1777. + fi ;
  1778. + done ;
  1779. + if test x"$CC_FOR_BUILD" = x ; then
  1780. + CC_FOR_BUILD=no_compiler_found ;
  1781. + fi
  1782. + ;;
  1783. + ,,*) CC_FOR_BUILD=$CC ;;
  1784. + ,*,*) CC_FOR_BUILD=$HOST_CC ;;
  1785. +esac ; set_cc_for_build= ;'
  1786. +
  1787. +# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  1788. +# (ghazi@noc.rutgers.edu 1994-08-24)
  1789. +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
  1790. + PATH=$PATH:/.attbin ; export PATH
  1791. +fi
  1792. +
  1793. +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  1794. +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  1795. +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  1796. +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  1797. +
  1798. +case "$UNAME_SYSTEM" in
  1799. +Linux|GNU|GNU/*)
  1800. + # If the system lacks a compiler, then just pick glibc.
  1801. + # We could probably try harder.
  1802. + LIBC=gnu
  1803. +
  1804. + eval "$set_cc_for_build"
  1805. + cat <<-EOF > "$dummy.c"
  1806. + #include <features.h>
  1807. + #if defined(__UCLIBC__)
  1808. + LIBC=uclibc
  1809. + #elif defined(__dietlibc__)
  1810. + LIBC=dietlibc
  1811. + #else
  1812. + LIBC=gnu
  1813. + #endif
  1814. + EOF
  1815. + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
  1816. +
  1817. + # If ldd exists, use it to detect musl libc.
  1818. + if command -v ldd >/dev/null && \
  1819. + ldd --version 2>&1 | grep -q ^musl
  1820. + then
  1821. + LIBC=musl
  1822. + fi
  1823. + ;;
  1824. +esac
  1825. +
  1826. +# Note: order is significant - the case branches are not exclusive.
  1827. +
  1828. +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
  1829. + *:NetBSD:*:*)
  1830. + # NetBSD (nbsd) targets should (where applicable) match one or
  1831. + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
  1832. + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
  1833. + # switched to ELF, *-*-netbsd* would select the old
  1834. + # object file format. This provides both forward
  1835. + # compatibility and a consistent mechanism for selecting the
  1836. + # object file format.
  1837. + #
  1838. + # Note: NetBSD doesn't particularly care about the vendor
  1839. + # portion of the name. We always set it to "unknown".
  1840. + sysctl="sysctl -n hw.machine_arch"
  1841. + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
  1842. + "/sbin/$sysctl" 2>/dev/null || \
  1843. + "/usr/sbin/$sysctl" 2>/dev/null || \
  1844. + echo unknown)`
  1845. + case "$UNAME_MACHINE_ARCH" in
  1846. + armeb) machine=armeb-unknown ;;
  1847. + arm*) machine=arm-unknown ;;
  1848. + sh3el) machine=shl-unknown ;;
  1849. + sh3eb) machine=sh-unknown ;;
  1850. + sh5el) machine=sh5le-unknown ;;
  1851. + earmv*)
  1852. + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
  1853. + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
  1854. + machine="${arch}${endian}"-unknown
  1855. + ;;
  1856. + *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
  1857. + esac
  1858. + # The Operating System including object format, if it has switched
  1859. + # to ELF recently (or will in the future) and ABI.
  1860. + case "$UNAME_MACHINE_ARCH" in
  1861. + earm*)
  1862. + os=netbsdelf
  1863. + ;;
  1864. + arm*|i386|m68k|ns32k|sh3*|sparc|vax)
  1865. + eval "$set_cc_for_build"
  1866. + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
  1867. + | grep -q __ELF__
  1868. + then
  1869. + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
  1870. + # Return netbsd for either. FIX?
  1871. + os=netbsd
  1872. + else
  1873. + os=netbsdelf
  1874. + fi
  1875. + ;;
  1876. + *)
  1877. + os=netbsd
  1878. + ;;
  1879. + esac
  1880. + # Determine ABI tags.
  1881. + case "$UNAME_MACHINE_ARCH" in
  1882. + earm*)
  1883. + expr='s/^earmv[0-9]/-eabi/;s/eb$//'
  1884. + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
  1885. + ;;
  1886. + esac
  1887. + # The OS release
  1888. + # Debian GNU/NetBSD machines have a different userland, and
  1889. + # thus, need a distinct triplet. However, they do not need
  1890. + # kernel version information, so it can be replaced with a
  1891. + # suitable tag, in the style of linux-gnu.
  1892. + case "$UNAME_VERSION" in
  1893. + Debian*)
  1894. + release='-gnu'
  1895. + ;;
  1896. + *)
  1897. + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
  1898. + ;;
  1899. + esac
  1900. + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
  1901. + # contains redundant information, the shorter form:
  1902. + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
  1903. + echo "$machine-${os}${release}${abi}"
  1904. + exit ;;
  1905. + *:Bitrig:*:*)
  1906. + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
  1907. + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
  1908. + exit ;;
  1909. + *:OpenBSD:*:*)
  1910. + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
  1911. + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
  1912. + exit ;;
  1913. + *:LibertyBSD:*:*)
  1914. + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
  1915. + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
  1916. + exit ;;
  1917. + *:MidnightBSD:*:*)
  1918. + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
  1919. + exit ;;
  1920. + *:ekkoBSD:*:*)
  1921. + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
  1922. + exit ;;
  1923. + *:SolidBSD:*:*)
  1924. + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
  1925. + exit ;;
  1926. + macppc:MirBSD:*:*)
  1927. + echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
  1928. + exit ;;
  1929. + *:MirBSD:*:*)
  1930. + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
  1931. + exit ;;
  1932. + *:Sortix:*:*)
  1933. + echo "$UNAME_MACHINE"-unknown-sortix
  1934. + exit ;;
  1935. + *:Redox:*:*)
  1936. + echo "$UNAME_MACHINE"-unknown-redox
  1937. + exit ;;
  1938. + mips:OSF1:*.*)
  1939. + echo mips-dec-osf1
  1940. + exit ;;
  1941. + alpha:OSF1:*:*)
  1942. + case $UNAME_RELEASE in
  1943. + *4.0)
  1944. + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
  1945. + ;;
  1946. + *5.*)
  1947. + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
  1948. + ;;
  1949. + esac
  1950. + # According to Compaq, /usr/sbin/psrinfo has been available on
  1951. + # OSF/1 and Tru64 systems produced since 1995. I hope that
  1952. + # covers most systems running today. This code pipes the CPU
  1953. + # types through head -n 1, so we only detect the type of CPU 0.
  1954. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
  1955. + case "$ALPHA_CPU_TYPE" in
  1956. + "EV4 (21064)")
  1957. + UNAME_MACHINE=alpha ;;
  1958. + "EV4.5 (21064)")
  1959. + UNAME_MACHINE=alpha ;;
  1960. + "LCA4 (21066/21068)")
  1961. + UNAME_MACHINE=alpha ;;
  1962. + "EV5 (21164)")
  1963. + UNAME_MACHINE=alphaev5 ;;
  1964. + "EV5.6 (21164A)")
  1965. + UNAME_MACHINE=alphaev56 ;;
  1966. + "EV5.6 (21164PC)")
  1967. + UNAME_MACHINE=alphapca56 ;;
  1968. + "EV5.7 (21164PC)")
  1969. + UNAME_MACHINE=alphapca57 ;;
  1970. + "EV6 (21264)")
  1971. + UNAME_MACHINE=alphaev6 ;;
  1972. + "EV6.7 (21264A)")
  1973. + UNAME_MACHINE=alphaev67 ;;
  1974. + "EV6.8CB (21264C)")
  1975. + UNAME_MACHINE=alphaev68 ;;
  1976. + "EV6.8AL (21264B)")
  1977. + UNAME_MACHINE=alphaev68 ;;
  1978. + "EV6.8CX (21264D)")
  1979. + UNAME_MACHINE=alphaev68 ;;
  1980. + "EV6.9A (21264/EV69A)")
  1981. + UNAME_MACHINE=alphaev69 ;;
  1982. + "EV7 (21364)")
  1983. + UNAME_MACHINE=alphaev7 ;;
  1984. + "EV7.9 (21364A)")
  1985. + UNAME_MACHINE=alphaev79 ;;
  1986. + esac
  1987. + # A Pn.n version is a patched version.
  1988. + # A Vn.n version is a released version.
  1989. + # A Tn.n version is a released field test version.
  1990. + # A Xn.n version is an unreleased experimental baselevel.
  1991. + # 1.2 uses "1.2" for uname -r.
  1992. + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
  1993. + # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
  1994. + exitcode=$?
  1995. + trap '' 0
  1996. + exit $exitcode ;;
  1997. + Amiga*:UNIX_System_V:4.0:*)
  1998. + echo m68k-unknown-sysv4
  1999. + exit ;;
  2000. + *:[Aa]miga[Oo][Ss]:*:*)
  2001. + echo "$UNAME_MACHINE"-unknown-amigaos
  2002. + exit ;;
  2003. + *:[Mm]orph[Oo][Ss]:*:*)
  2004. + echo "$UNAME_MACHINE"-unknown-morphos
  2005. + exit ;;
  2006. + *:OS/390:*:*)
  2007. + echo i370-ibm-openedition
  2008. + exit ;;
  2009. + *:z/VM:*:*)
  2010. + echo s390-ibm-zvmoe
  2011. + exit ;;
  2012. + *:OS400:*:*)
  2013. + echo powerpc-ibm-os400
  2014. + exit ;;
  2015. + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  2016. + echo arm-acorn-riscix"$UNAME_RELEASE"
  2017. + exit ;;
  2018. + arm*:riscos:*:*|arm*:RISCOS:*:*)
  2019. + echo arm-unknown-riscos
  2020. + exit ;;
  2021. + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
  2022. + echo hppa1.1-hitachi-hiuxmpp
  2023. + exit ;;
  2024. + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
  2025. + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
  2026. + if test "`(/bin/universe) 2>/dev/null`" = att ; then
  2027. + echo pyramid-pyramid-sysv3
  2028. + else
  2029. + echo pyramid-pyramid-bsd
  2030. + fi
  2031. + exit ;;
  2032. + NILE*:*:*:dcosx)
  2033. + echo pyramid-pyramid-svr4
  2034. + exit ;;
  2035. + DRS?6000:unix:4.0:6*)
  2036. + echo sparc-icl-nx6
  2037. + exit ;;
  2038. + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
  2039. + case `/usr/bin/uname -p` in
  2040. + sparc) echo sparc-icl-nx7; exit ;;
  2041. + esac ;;
  2042. + s390x:SunOS:*:*)
  2043. + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
  2044. + exit ;;
  2045. + sun4H:SunOS:5.*:*)
  2046. + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
  2047. + exit ;;
  2048. + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
  2049. + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
  2050. + exit ;;
  2051. + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
  2052. + echo i386-pc-auroraux"$UNAME_RELEASE"
  2053. + exit ;;
  2054. + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
  2055. + eval "$set_cc_for_build"
  2056. + SUN_ARCH=i386
  2057. + # If there is a compiler, see if it is configured for 64-bit objects.
  2058. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
  2059. + # This test works for both compilers.
  2060. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
  2061. + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
  2062. + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  2063. + grep IS_64BIT_ARCH >/dev/null
  2064. + then
  2065. + SUN_ARCH=x86_64
  2066. + fi
  2067. + fi
  2068. + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
  2069. + exit ;;
  2070. + sun4*:SunOS:6*:*)
  2071. + # According to config.sub, this is the proper way to canonicalize
  2072. + # SunOS6. Hard to guess exactly what SunOS6 will be like, but
  2073. + # it's likely to be more like Solaris than SunOS4.
  2074. + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
  2075. + exit ;;
  2076. + sun4*:SunOS:*:*)
  2077. + case "`/usr/bin/arch -k`" in
  2078. + Series*|S4*)
  2079. + UNAME_RELEASE=`uname -v`
  2080. + ;;
  2081. + esac
  2082. + # Japanese Language versions have a version number like `4.1.3-JL'.
  2083. + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
  2084. + exit ;;
  2085. + sun3*:SunOS:*:*)
  2086. + echo m68k-sun-sunos"$UNAME_RELEASE"
  2087. + exit ;;
  2088. + sun*:*:4.2BSD:*)
  2089. + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
  2090. + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
  2091. + case "`/bin/arch`" in
  2092. + sun3)
  2093. + echo m68k-sun-sunos"$UNAME_RELEASE"
  2094. + ;;
  2095. + sun4)
  2096. + echo sparc-sun-sunos"$UNAME_RELEASE"
  2097. + ;;
  2098. + esac
  2099. + exit ;;
  2100. + aushp:SunOS:*:*)
  2101. + echo sparc-auspex-sunos"$UNAME_RELEASE"
  2102. + exit ;;
  2103. + # The situation for MiNT is a little confusing. The machine name
  2104. + # can be virtually everything (everything which is not
  2105. + # "atarist" or "atariste" at least should have a processor
  2106. + # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
  2107. + # to the lowercase version "mint" (or "freemint"). Finally
  2108. + # the system name "TOS" denotes a system which is actually not
  2109. + # MiNT. But MiNT is downward compatible to TOS, so this should
  2110. + # be no problem.
  2111. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
  2112. + echo m68k-atari-mint"$UNAME_RELEASE"
  2113. + exit ;;
  2114. + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
  2115. + echo m68k-atari-mint"$UNAME_RELEASE"
  2116. + exit ;;
  2117. + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
  2118. + echo m68k-atari-mint"$UNAME_RELEASE"
  2119. + exit ;;
  2120. + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
  2121. + echo m68k-milan-mint"$UNAME_RELEASE"
  2122. + exit ;;
  2123. + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
  2124. + echo m68k-hades-mint"$UNAME_RELEASE"
  2125. + exit ;;
  2126. + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
  2127. + echo m68k-unknown-mint"$UNAME_RELEASE"
  2128. + exit ;;
  2129. + m68k:machten:*:*)
  2130. + echo m68k-apple-machten"$UNAME_RELEASE"
  2131. + exit ;;
  2132. + powerpc:machten:*:*)
  2133. + echo powerpc-apple-machten"$UNAME_RELEASE"
  2134. + exit ;;
  2135. + RISC*:Mach:*:*)
  2136. + echo mips-dec-mach_bsd4.3
  2137. + exit ;;
  2138. + RISC*:ULTRIX:*:*)
  2139. + echo mips-dec-ultrix"$UNAME_RELEASE"
  2140. + exit ;;
  2141. + VAX*:ULTRIX*:*:*)
  2142. + echo vax-dec-ultrix"$UNAME_RELEASE"
  2143. + exit ;;
  2144. + 2020:CLIX:*:* | 2430:CLIX:*:*)
  2145. + echo clipper-intergraph-clix"$UNAME_RELEASE"
  2146. + exit ;;
  2147. + mips:*:*:UMIPS | mips:*:*:RISCos)
  2148. + eval "$set_cc_for_build"
  2149. + sed 's/^ //' << EOF > "$dummy.c"
  2150. +#ifdef __cplusplus
  2151. +#include <stdio.h> /* for printf() prototype */
  2152. + int main (int argc, char *argv[]) {
  2153. +#else
  2154. + int main (argc, argv) int argc; char *argv[]; {
  2155. +#endif
  2156. + #if defined (host_mips) && defined (MIPSEB)
  2157. + #if defined (SYSTYPE_SYSV)
  2158. + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
  2159. + #endif
  2160. + #if defined (SYSTYPE_SVR4)
  2161. + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
  2162. + #endif
  2163. + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
  2164. + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
  2165. + #endif
  2166. + #endif
  2167. + exit (-1);
  2168. + }
  2169. +EOF
  2170. + $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
  2171. + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
  2172. + SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
  2173. + { echo "$SYSTEM_NAME"; exit; }
  2174. + echo mips-mips-riscos"$UNAME_RELEASE"
  2175. + exit ;;
  2176. + Motorola:PowerMAX_OS:*:*)
  2177. + echo powerpc-motorola-powermax
  2178. + exit ;;
  2179. + Motorola:*:4.3:PL8-*)
  2180. + echo powerpc-harris-powermax
  2181. + exit ;;
  2182. + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
  2183. + echo powerpc-harris-powermax
  2184. + exit ;;
  2185. + Night_Hawk:Power_UNIX:*:*)
  2186. + echo powerpc-harris-powerunix
  2187. + exit ;;
  2188. + m88k:CX/UX:7*:*)
  2189. + echo m88k-harris-cxux7
  2190. + exit ;;
  2191. + m88k:*:4*:R4*)
  2192. + echo m88k-motorola-sysv4
  2193. + exit ;;
  2194. + m88k:*:3*:R3*)
  2195. + echo m88k-motorola-sysv3
  2196. + exit ;;
  2197. + AViiON:dgux:*:*)
  2198. + # DG/UX returns AViiON for all architectures
  2199. + UNAME_PROCESSOR=`/usr/bin/uname -p`
  2200. + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
  2201. + then
  2202. + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
  2203. + [ "$TARGET_BINARY_INTERFACE"x = x ]
  2204. + then
  2205. + echo m88k-dg-dgux"$UNAME_RELEASE"
  2206. + else
  2207. + echo m88k-dg-dguxbcs"$UNAME_RELEASE"
  2208. + fi
  2209. + else
  2210. + echo i586-dg-dgux"$UNAME_RELEASE"
  2211. + fi
  2212. + exit ;;
  2213. + M88*:DolphinOS:*:*) # DolphinOS (SVR3)
  2214. + echo m88k-dolphin-sysv3
  2215. + exit ;;
  2216. + M88*:*:R3*:*)
  2217. + # Delta 88k system running SVR3
  2218. + echo m88k-motorola-sysv3
  2219. + exit ;;
  2220. + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  2221. + echo m88k-tektronix-sysv3
  2222. + exit ;;
  2223. + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  2224. + echo m68k-tektronix-bsd
  2225. + exit ;;
  2226. + *:IRIX*:*:*)
  2227. + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
  2228. + exit ;;
  2229. + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  2230. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
  2231. + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
  2232. + i*86:AIX:*:*)
  2233. + echo i386-ibm-aix
  2234. + exit ;;
  2235. + ia64:AIX:*:*)
  2236. + if [ -x /usr/bin/oslevel ] ; then
  2237. + IBM_REV=`/usr/bin/oslevel`
  2238. + else
  2239. + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
  2240. + fi
  2241. + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
  2242. + exit ;;
  2243. + *:AIX:2:3)
  2244. + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  2245. + eval "$set_cc_for_build"
  2246. + sed 's/^ //' << EOF > "$dummy.c"
  2247. + #include <sys/systemcfg.h>
  2248. +
  2249. + main()
  2250. + {
  2251. + if (!__power_pc())
  2252. + exit(1);
  2253. + puts("powerpc-ibm-aix3.2.5");
  2254. + exit(0);
  2255. + }
  2256. +EOF
  2257. + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
  2258. + then
  2259. + echo "$SYSTEM_NAME"
  2260. + else
  2261. + echo rs6000-ibm-aix3.2.5
  2262. + fi
  2263. + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  2264. + echo rs6000-ibm-aix3.2.4
  2265. + else
  2266. + echo rs6000-ibm-aix3.2
  2267. + fi
  2268. + exit ;;
  2269. + *:AIX:*:[4567])
  2270. + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
  2271. + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
  2272. + IBM_ARCH=rs6000
  2273. + else
  2274. + IBM_ARCH=powerpc
  2275. + fi
  2276. + if [ -x /usr/bin/lslpp ] ; then
  2277. + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
  2278. + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
  2279. + else
  2280. + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
  2281. + fi
  2282. + echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
  2283. + exit ;;
  2284. + *:AIX:*:*)
  2285. + echo rs6000-ibm-aix
  2286. + exit ;;
  2287. + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
  2288. + echo romp-ibm-bsd4.4
  2289. + exit ;;
  2290. + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
  2291. + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
  2292. + exit ;; # report: romp-ibm BSD 4.3
  2293. + *:BOSX:*:*)
  2294. + echo rs6000-bull-bosx
  2295. + exit ;;
  2296. + DPX/2?00:B.O.S.:*:*)
  2297. + echo m68k-bull-sysv3
  2298. + exit ;;
  2299. + 9000/[34]??:4.3bsd:1.*:*)
  2300. + echo m68k-hp-bsd
  2301. + exit ;;
  2302. + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  2303. + echo m68k-hp-bsd4.4
  2304. + exit ;;
  2305. + 9000/[34678]??:HP-UX:*:*)
  2306. + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
  2307. + case "$UNAME_MACHINE" in
  2308. + 9000/31?) HP_ARCH=m68000 ;;
  2309. + 9000/[34]??) HP_ARCH=m68k ;;
  2310. + 9000/[678][0-9][0-9])
  2311. + if [ -x /usr/bin/getconf ]; then
  2312. + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
  2313. + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
  2314. + case "$sc_cpu_version" in
  2315. + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
  2316. + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
  2317. + 532) # CPU_PA_RISC2_0
  2318. + case "$sc_kernel_bits" in
  2319. + 32) HP_ARCH=hppa2.0n ;;
  2320. + 64) HP_ARCH=hppa2.0w ;;
  2321. + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
  2322. + esac ;;
  2323. + esac
  2324. + fi
  2325. + if [ "$HP_ARCH" = "" ]; then
  2326. + eval "$set_cc_for_build"
  2327. + sed 's/^ //' << EOF > "$dummy.c"
  2328. +
  2329. + #define _HPUX_SOURCE
  2330. + #include <stdlib.h>
  2331. + #include <unistd.h>
  2332. +
  2333. + int main ()
  2334. + {
  2335. + #if defined(_SC_KERNEL_BITS)
  2336. + long bits = sysconf(_SC_KERNEL_BITS);
  2337. + #endif
  2338. + long cpu = sysconf (_SC_CPU_VERSION);
  2339. +
  2340. + switch (cpu)
  2341. + {
  2342. + case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
  2343. + case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
  2344. + case CPU_PA_RISC2_0:
  2345. + #if defined(_SC_KERNEL_BITS)
  2346. + switch (bits)
  2347. + {
  2348. + case 64: puts ("hppa2.0w"); break;
  2349. + case 32: puts ("hppa2.0n"); break;
  2350. + default: puts ("hppa2.0"); break;
  2351. + } break;
  2352. + #else /* !defined(_SC_KERNEL_BITS) */
  2353. + puts ("hppa2.0"); break;
  2354. + #endif
  2355. + default: puts ("hppa1.0"); break;
  2356. + }
  2357. + exit (0);
  2358. + }
  2359. +EOF
  2360. + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
  2361. + test -z "$HP_ARCH" && HP_ARCH=hppa
  2362. + fi ;;
  2363. + esac
  2364. + if [ "$HP_ARCH" = hppa2.0w ]
  2365. + then
  2366. + eval "$set_cc_for_build"
  2367. +
  2368. + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
  2369. + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
  2370. + # generating 64-bit code. GNU and HP use different nomenclature:
  2371. + #
  2372. + # $ CC_FOR_BUILD=cc ./config.guess
  2373. + # => hppa2.0w-hp-hpux11.23
  2374. + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
  2375. + # => hppa64-hp-hpux11.23
  2376. +
  2377. + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
  2378. + grep -q __LP64__
  2379. + then
  2380. + HP_ARCH=hppa2.0w
  2381. + else
  2382. + HP_ARCH=hppa64
  2383. + fi
  2384. + fi
  2385. + echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
  2386. + exit ;;
  2387. + ia64:HP-UX:*:*)
  2388. + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
  2389. + echo ia64-hp-hpux"$HPUX_REV"
  2390. + exit ;;
  2391. + 3050*:HI-UX:*:*)
  2392. + eval "$set_cc_for_build"
  2393. + sed 's/^ //' << EOF > "$dummy.c"
  2394. + #include <unistd.h>
  2395. + int
  2396. + main ()
  2397. + {
  2398. + long cpu = sysconf (_SC_CPU_VERSION);
  2399. + /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  2400. + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
  2401. + results, however. */
  2402. + if (CPU_IS_PA_RISC (cpu))
  2403. + {
  2404. + switch (cpu)
  2405. + {
  2406. + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  2407. + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  2408. + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  2409. + default: puts ("hppa-hitachi-hiuxwe2"); break;
  2410. + }
  2411. + }
  2412. + else if (CPU_IS_HP_MC68K (cpu))
  2413. + puts ("m68k-hitachi-hiuxwe2");
  2414. + else puts ("unknown-hitachi-hiuxwe2");
  2415. + exit (0);
  2416. + }
  2417. +EOF
  2418. + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
  2419. + { echo "$SYSTEM_NAME"; exit; }
  2420. + echo unknown-hitachi-hiuxwe2
  2421. + exit ;;
  2422. + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
  2423. + echo hppa1.1-hp-bsd
  2424. + exit ;;
  2425. + 9000/8??:4.3bsd:*:*)
  2426. + echo hppa1.0-hp-bsd
  2427. + exit ;;
  2428. + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
  2429. + echo hppa1.0-hp-mpeix
  2430. + exit ;;
  2431. + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
  2432. + echo hppa1.1-hp-osf
  2433. + exit ;;
  2434. + hp8??:OSF1:*:*)
  2435. + echo hppa1.0-hp-osf
  2436. + exit ;;
  2437. + i*86:OSF1:*:*)
  2438. + if [ -x /usr/sbin/sysversion ] ; then
  2439. + echo "$UNAME_MACHINE"-unknown-osf1mk
  2440. + else
  2441. + echo "$UNAME_MACHINE"-unknown-osf1
  2442. + fi
  2443. + exit ;;
  2444. + parisc*:Lites*:*:*)
  2445. + echo hppa1.1-hp-lites
  2446. + exit ;;
  2447. + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  2448. + echo c1-convex-bsd
  2449. + exit ;;
  2450. + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  2451. + if getsysinfo -f scalar_acc
  2452. + then echo c32-convex-bsd
  2453. + else echo c2-convex-bsd
  2454. + fi
  2455. + exit ;;
  2456. + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  2457. + echo c34-convex-bsd
  2458. + exit ;;
  2459. + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  2460. + echo c38-convex-bsd
  2461. + exit ;;
  2462. + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  2463. + echo c4-convex-bsd
  2464. + exit ;;
  2465. + CRAY*Y-MP:*:*:*)
  2466. + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
  2467. + exit ;;
  2468. + CRAY*[A-Z]90:*:*:*)
  2469. + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
  2470. + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  2471. + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
  2472. + -e 's/\.[^.]*$/.X/'
  2473. + exit ;;
  2474. + CRAY*TS:*:*:*)
  2475. + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
  2476. + exit ;;
  2477. + CRAY*T3E:*:*:*)
  2478. + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
  2479. + exit ;;
  2480. + CRAY*SV1:*:*:*)
  2481. + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
  2482. + exit ;;
  2483. + *:UNICOS/mp:*:*)
  2484. + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
  2485. + exit ;;
  2486. + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
  2487. + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
  2488. + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
  2489. + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
  2490. + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  2491. + exit ;;
  2492. + 5000:UNIX_System_V:4.*:*)
  2493. + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
  2494. + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
  2495. + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  2496. + exit ;;
  2497. + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
  2498. + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
  2499. + exit ;;
  2500. + sparc*:BSD/OS:*:*)
  2501. + echo sparc-unknown-bsdi"$UNAME_RELEASE"
  2502. + exit ;;
  2503. + *:BSD/OS:*:*)
  2504. + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
  2505. + exit ;;
  2506. + *:FreeBSD:*:*)
  2507. + UNAME_PROCESSOR=`/usr/bin/uname -p`
  2508. + case "$UNAME_PROCESSOR" in
  2509. + amd64)
  2510. + UNAME_PROCESSOR=x86_64 ;;
  2511. + i386)
  2512. + UNAME_PROCESSOR=i586 ;;
  2513. + esac
  2514. + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
  2515. + exit ;;
  2516. + i*:CYGWIN*:*)
  2517. + echo "$UNAME_MACHINE"-pc-cygwin
  2518. + exit ;;
  2519. + *:MINGW64*:*)
  2520. + echo "$UNAME_MACHINE"-pc-mingw64
  2521. + exit ;;
  2522. + *:MINGW*:*)
  2523. + echo "$UNAME_MACHINE"-pc-mingw32
  2524. + exit ;;
  2525. + *:MSYS*:*)
  2526. + echo "$UNAME_MACHINE"-pc-msys
  2527. + exit ;;
  2528. + i*:PW*:*)
  2529. + echo "$UNAME_MACHINE"-pc-pw32
  2530. + exit ;;
  2531. + *:Interix*:*)
  2532. + case "$UNAME_MACHINE" in
  2533. + x86)
  2534. + echo i586-pc-interix"$UNAME_RELEASE"
  2535. + exit ;;
  2536. + authenticamd | genuineintel | EM64T)
  2537. + echo x86_64-unknown-interix"$UNAME_RELEASE"
  2538. + exit ;;
  2539. + IA64)
  2540. + echo ia64-unknown-interix"$UNAME_RELEASE"
  2541. + exit ;;
  2542. + esac ;;
  2543. + i*:UWIN*:*)
  2544. + echo "$UNAME_MACHINE"-pc-uwin
  2545. + exit ;;
  2546. + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
  2547. + echo x86_64-unknown-cygwin
  2548. + exit ;;
  2549. + prep*:SunOS:5.*:*)
  2550. + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
  2551. + exit ;;
  2552. + *:GNU:*:*)
  2553. + # the GNU system
  2554. + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
  2555. + exit ;;
  2556. + *:GNU/*:*:*)
  2557. + # other systems with GNU libc and userland
  2558. + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
  2559. + exit ;;
  2560. + i*86:Minix:*:*)
  2561. + echo "$UNAME_MACHINE"-pc-minix
  2562. + exit ;;
  2563. + aarch64:Linux:*:*)
  2564. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2565. + exit ;;
  2566. + aarch64_be:Linux:*:*)
  2567. + UNAME_MACHINE=aarch64_be
  2568. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2569. + exit ;;
  2570. + alpha:Linux:*:*)
  2571. + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
  2572. + EV5) UNAME_MACHINE=alphaev5 ;;
  2573. + EV56) UNAME_MACHINE=alphaev56 ;;
  2574. + PCA56) UNAME_MACHINE=alphapca56 ;;
  2575. + PCA57) UNAME_MACHINE=alphapca56 ;;
  2576. + EV6) UNAME_MACHINE=alphaev6 ;;
  2577. + EV67) UNAME_MACHINE=alphaev67 ;;
  2578. + EV68*) UNAME_MACHINE=alphaev68 ;;
  2579. + esac
  2580. + objdump --private-headers /bin/sh | grep -q ld.so.1
  2581. + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
  2582. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2583. + exit ;;
  2584. + arc:Linux:*:* | arceb:Linux:*:*)
  2585. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2586. + exit ;;
  2587. + arm*:Linux:*:*)
  2588. + eval "$set_cc_for_build"
  2589. + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
  2590. + | grep -q __ARM_EABI__
  2591. + then
  2592. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2593. + else
  2594. + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
  2595. + | grep -q __ARM_PCS_VFP
  2596. + then
  2597. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
  2598. + else
  2599. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
  2600. + fi
  2601. + fi
  2602. + exit ;;
  2603. + avr32*:Linux:*:*)
  2604. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2605. + exit ;;
  2606. + cris:Linux:*:*)
  2607. + echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
  2608. + exit ;;
  2609. + crisv32:Linux:*:*)
  2610. + echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
  2611. + exit ;;
  2612. + e2k:Linux:*:*)
  2613. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2614. + exit ;;
  2615. + frv:Linux:*:*)
  2616. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2617. + exit ;;
  2618. + hexagon:Linux:*:*)
  2619. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2620. + exit ;;
  2621. + i*86:Linux:*:*)
  2622. + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
  2623. + exit ;;
  2624. + ia64:Linux:*:*)
  2625. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2626. + exit ;;
  2627. + k1om:Linux:*:*)
  2628. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2629. + exit ;;
  2630. + m32r*:Linux:*:*)
  2631. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2632. + exit ;;
  2633. + m68*:Linux:*:*)
  2634. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2635. + exit ;;
  2636. + mips:Linux:*:* | mips64:Linux:*:*)
  2637. + eval "$set_cc_for_build"
  2638. + sed 's/^ //' << EOF > "$dummy.c"
  2639. + #undef CPU
  2640. + #undef ${UNAME_MACHINE}
  2641. + #undef ${UNAME_MACHINE}el
  2642. + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  2643. + CPU=${UNAME_MACHINE}el
  2644. + #else
  2645. + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  2646. + CPU=${UNAME_MACHINE}
  2647. + #else
  2648. + CPU=
  2649. + #endif
  2650. + #endif
  2651. +EOF
  2652. + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
  2653. + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
  2654. + ;;
  2655. + mips64el:Linux:*:*)
  2656. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2657. + exit ;;
  2658. + openrisc*:Linux:*:*)
  2659. + echo or1k-unknown-linux-"$LIBC"
  2660. + exit ;;
  2661. + or32:Linux:*:* | or1k*:Linux:*:*)
  2662. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2663. + exit ;;
  2664. + padre:Linux:*:*)
  2665. + echo sparc-unknown-linux-"$LIBC"
  2666. + exit ;;
  2667. + parisc64:Linux:*:* | hppa64:Linux:*:*)
  2668. + echo hppa64-unknown-linux-"$LIBC"
  2669. + exit ;;
  2670. + parisc:Linux:*:* | hppa:Linux:*:*)
  2671. + # Look for CPU level
  2672. + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  2673. + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
  2674. + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
  2675. + *) echo hppa-unknown-linux-"$LIBC" ;;
  2676. + esac
  2677. + exit ;;
  2678. + ppc64:Linux:*:*)
  2679. + echo powerpc64-unknown-linux-"$LIBC"
  2680. + exit ;;
  2681. + ppc:Linux:*:*)
  2682. + echo powerpc-unknown-linux-"$LIBC"
  2683. + exit ;;
  2684. + ppc64le:Linux:*:*)
  2685. + echo powerpc64le-unknown-linux-"$LIBC"
  2686. + exit ;;
  2687. + ppcle:Linux:*:*)
  2688. + echo powerpcle-unknown-linux-"$LIBC"
  2689. + exit ;;
  2690. + riscv32:Linux:*:* | riscv64:Linux:*:*)
  2691. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2692. + exit ;;
  2693. + s390:Linux:*:* | s390x:Linux:*:*)
  2694. + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
  2695. + exit ;;
  2696. + sh64*:Linux:*:*)
  2697. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2698. + exit ;;
  2699. + sh*:Linux:*:*)
  2700. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2701. + exit ;;
  2702. + sparc:Linux:*:* | sparc64:Linux:*:*)
  2703. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2704. + exit ;;
  2705. + tile*:Linux:*:*)
  2706. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2707. + exit ;;
  2708. + vax:Linux:*:*)
  2709. + echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
  2710. + exit ;;
  2711. + x86_64:Linux:*:*)
  2712. + if objdump -f /bin/sh | grep -q elf32-x86-64; then
  2713. + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
  2714. + else
  2715. + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
  2716. + fi
  2717. + exit ;;
  2718. + xtensa*:Linux:*:*)
  2719. + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
  2720. + exit ;;
  2721. + i*86:DYNIX/ptx:4*:*)
  2722. + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  2723. + # earlier versions are messed up and put the nodename in both
  2724. + # sysname and nodename.
  2725. + echo i386-sequent-sysv4
  2726. + exit ;;
  2727. + i*86:UNIX_SV:4.2MP:2.*)
  2728. + # Unixware is an offshoot of SVR4, but it has its own version
  2729. + # number series starting with 2...
  2730. + # I am not positive that other SVR4 systems won't match this,
  2731. + # I just have to hope. -- rms.
  2732. + # Use sysv4.2uw... so that sysv4* matches it.
  2733. + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
  2734. + exit ;;
  2735. + i*86:OS/2:*:*)
  2736. + # If we were able to find `uname', then EMX Unix compatibility
  2737. + # is probably installed.
  2738. + echo "$UNAME_MACHINE"-pc-os2-emx
  2739. + exit ;;
  2740. + i*86:XTS-300:*:STOP)
  2741. + echo "$UNAME_MACHINE"-unknown-stop
  2742. + exit ;;
  2743. + i*86:atheos:*:*)
  2744. + echo "$UNAME_MACHINE"-unknown-atheos
  2745. + exit ;;
  2746. + i*86:syllable:*:*)
  2747. + echo "$UNAME_MACHINE"-pc-syllable
  2748. + exit ;;
  2749. + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
  2750. + echo i386-unknown-lynxos"$UNAME_RELEASE"
  2751. + exit ;;
  2752. + i*86:*DOS:*:*)
  2753. + echo "$UNAME_MACHINE"-pc-msdosdjgpp
  2754. + exit ;;
  2755. + i*86:*:4.*:*)
  2756. + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
  2757. + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  2758. + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
  2759. + else
  2760. + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
  2761. + fi
  2762. + exit ;;
  2763. + i*86:*:5:[678]*)
  2764. + # UnixWare 7.x, OpenUNIX and OpenServer 6.
  2765. + case `/bin/uname -X | grep "^Machine"` in
  2766. + *486*) UNAME_MACHINE=i486 ;;
  2767. + *Pentium) UNAME_MACHINE=i586 ;;
  2768. + *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  2769. + esac
  2770. + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
  2771. + exit ;;
  2772. + i*86:*:3.2:*)
  2773. + if test -f /usr/options/cb.name; then
  2774. + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  2775. + echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
  2776. + elif /bin/uname -X 2>/dev/null >/dev/null ; then
  2777. + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
  2778. + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
  2779. + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
  2780. + && UNAME_MACHINE=i586
  2781. + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
  2782. + && UNAME_MACHINE=i686
  2783. + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
  2784. + && UNAME_MACHINE=i686
  2785. + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
  2786. + else
  2787. + echo "$UNAME_MACHINE"-pc-sysv32
  2788. + fi
  2789. + exit ;;
  2790. + pc:*:*:*)
  2791. + # Left here for compatibility:
  2792. + # uname -m prints for DJGPP always 'pc', but it prints nothing about
  2793. + # the processor, so we play safe by assuming i586.
  2794. + # Note: whatever this is, it MUST be the same as what config.sub
  2795. + # prints for the "djgpp" host, or else GDB configure will decide that
  2796. + # this is a cross-build.
  2797. + echo i586-pc-msdosdjgpp
  2798. + exit ;;
  2799. + Intel:Mach:3*:*)
  2800. + echo i386-pc-mach3
  2801. + exit ;;
  2802. + paragon:*:*:*)
  2803. + echo i860-intel-osf1
  2804. + exit ;;
  2805. + i860:*:4.*:*) # i860-SVR4
  2806. + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  2807. + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
  2808. + else # Add other i860-SVR4 vendors below as they are discovered.
  2809. + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
  2810. + fi
  2811. + exit ;;
  2812. + mini*:CTIX:SYS*5:*)
  2813. + # "miniframe"
  2814. + echo m68010-convergent-sysv
  2815. + exit ;;
  2816. + mc68k:UNIX:SYSTEM5:3.51m)
  2817. + echo m68k-convergent-sysv
  2818. + exit ;;
  2819. + M680?0:D-NIX:5.3:*)
  2820. + echo m68k-diab-dnix
  2821. + exit ;;
  2822. + M68*:*:R3V[5678]*:*)
  2823. + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
  2824. + 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)
  2825. + OS_REL=''
  2826. + test -r /etc/.relid \
  2827. + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  2828. + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  2829. + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  2830. + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  2831. + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  2832. + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  2833. + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  2834. + && { echo i486-ncr-sysv4; exit; } ;;
  2835. + NCR*:*:4.2:* | MPRAS*:*:4.2:*)
  2836. + OS_REL='.3'
  2837. + test -r /etc/.relid \
  2838. + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  2839. + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  2840. + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
  2841. + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  2842. + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
  2843. + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
  2844. + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
  2845. + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  2846. + echo m68k-unknown-lynxos"$UNAME_RELEASE"
  2847. + exit ;;
  2848. + mc68030:UNIX_System_V:4.*:*)
  2849. + echo m68k-atari-sysv4
  2850. + exit ;;
  2851. + TSUNAMI:LynxOS:2.*:*)
  2852. + echo sparc-unknown-lynxos"$UNAME_RELEASE"
  2853. + exit ;;
  2854. + rs6000:LynxOS:2.*:*)
  2855. + echo rs6000-unknown-lynxos"$UNAME_RELEASE"
  2856. + exit ;;
  2857. + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
  2858. + echo powerpc-unknown-lynxos"$UNAME_RELEASE"
  2859. + exit ;;
  2860. + SM[BE]S:UNIX_SV:*:*)
  2861. + echo mips-dde-sysv"$UNAME_RELEASE"
  2862. + exit ;;
  2863. + RM*:ReliantUNIX-*:*:*)
  2864. + echo mips-sni-sysv4
  2865. + exit ;;
  2866. + RM*:SINIX-*:*:*)
  2867. + echo mips-sni-sysv4
  2868. + exit ;;
  2869. + *:SINIX-*:*:*)
  2870. + if uname -p 2>/dev/null >/dev/null ; then
  2871. + UNAME_MACHINE=`(uname -p) 2>/dev/null`
  2872. + echo "$UNAME_MACHINE"-sni-sysv4
  2873. + else
  2874. + echo ns32k-sni-sysv
  2875. + fi
  2876. + exit ;;
  2877. + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  2878. + # says <Richard.M.Bartel@ccMail.Census.GOV>
  2879. + echo i586-unisys-sysv4
  2880. + exit ;;
  2881. + *:UNIX_System_V:4*:FTX*)
  2882. + # From Gerald Hewes <hewes@openmarket.com>.
  2883. + # How about differentiating between stratus architectures? -djm
  2884. + echo hppa1.1-stratus-sysv4
  2885. + exit ;;
  2886. + *:*:*:FTX*)
  2887. + # From seanf@swdc.stratus.com.
  2888. + echo i860-stratus-sysv4
  2889. + exit ;;
  2890. + i*86:VOS:*:*)
  2891. + # From Paul.Green@stratus.com.
  2892. + echo "$UNAME_MACHINE"-stratus-vos
  2893. + exit ;;
  2894. + *:VOS:*:*)
  2895. + # From Paul.Green@stratus.com.
  2896. + echo hppa1.1-stratus-vos
  2897. + exit ;;
  2898. + mc68*:A/UX:*:*)
  2899. + echo m68k-apple-aux"$UNAME_RELEASE"
  2900. + exit ;;
  2901. + news*:NEWS-OS:6*:*)
  2902. + echo mips-sony-newsos6
  2903. + exit ;;
  2904. + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  2905. + if [ -d /usr/nec ]; then
  2906. + echo mips-nec-sysv"$UNAME_RELEASE"
  2907. + else
  2908. + echo mips-unknown-sysv"$UNAME_RELEASE"
  2909. + fi
  2910. + exit ;;
  2911. + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
  2912. + echo powerpc-be-beos
  2913. + exit ;;
  2914. + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
  2915. + echo powerpc-apple-beos
  2916. + exit ;;
  2917. + BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
  2918. + echo i586-pc-beos
  2919. + exit ;;
  2920. + BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
  2921. + echo i586-pc-haiku
  2922. + exit ;;
  2923. + x86_64:Haiku:*:*)
  2924. + echo x86_64-unknown-haiku
  2925. + exit ;;
  2926. + SX-4:SUPER-UX:*:*)
  2927. + echo sx4-nec-superux"$UNAME_RELEASE"
  2928. + exit ;;
  2929. + SX-5:SUPER-UX:*:*)
  2930. + echo sx5-nec-superux"$UNAME_RELEASE"
  2931. + exit ;;
  2932. + SX-6:SUPER-UX:*:*)
  2933. + echo sx6-nec-superux"$UNAME_RELEASE"
  2934. + exit ;;
  2935. + SX-7:SUPER-UX:*:*)
  2936. + echo sx7-nec-superux"$UNAME_RELEASE"
  2937. + exit ;;
  2938. + SX-8:SUPER-UX:*:*)
  2939. + echo sx8-nec-superux"$UNAME_RELEASE"
  2940. + exit ;;
  2941. + SX-8R:SUPER-UX:*:*)
  2942. + echo sx8r-nec-superux"$UNAME_RELEASE"
  2943. + exit ;;
  2944. + SX-ACE:SUPER-UX:*:*)
  2945. + echo sxace-nec-superux"$UNAME_RELEASE"
  2946. + exit ;;
  2947. + Power*:Rhapsody:*:*)
  2948. + echo powerpc-apple-rhapsody"$UNAME_RELEASE"
  2949. + exit ;;
  2950. + *:Rhapsody:*:*)
  2951. + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
  2952. + exit ;;
  2953. + *:Darwin:*:*)
  2954. + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
  2955. + eval "$set_cc_for_build"
  2956. + if test "$UNAME_PROCESSOR" = unknown ; then
  2957. + UNAME_PROCESSOR=powerpc
  2958. + fi
  2959. + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
  2960. + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
  2961. + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
  2962. + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  2963. + grep IS_64BIT_ARCH >/dev/null
  2964. + then
  2965. + case $UNAME_PROCESSOR in
  2966. + i386) UNAME_PROCESSOR=x86_64 ;;
  2967. + powerpc) UNAME_PROCESSOR=powerpc64 ;;
  2968. + esac
  2969. + fi
  2970. + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
  2971. + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
  2972. + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  2973. + grep IS_PPC >/dev/null
  2974. + then
  2975. + UNAME_PROCESSOR=powerpc
  2976. + fi
  2977. + fi
  2978. + elif test "$UNAME_PROCESSOR" = i386 ; then
  2979. + # Avoid executing cc on OS X 10.9, as it ships with a stub
  2980. + # that puts up a graphical alert prompting to install
  2981. + # developer tools. Any system running Mac OS X 10.7 or
  2982. + # later (Darwin 11 and later) is required to have a 64-bit
  2983. + # processor. This is not true of the ARM version of Darwin
  2984. + # that Apple uses in portable devices.
  2985. + UNAME_PROCESSOR=x86_64
  2986. + fi
  2987. + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
  2988. + exit ;;
  2989. + *:procnto*:*:* | *:QNX:[0123456789]*:*)
  2990. + UNAME_PROCESSOR=`uname -p`
  2991. + if test "$UNAME_PROCESSOR" = x86; then
  2992. + UNAME_PROCESSOR=i386
  2993. + UNAME_MACHINE=pc
  2994. + fi
  2995. + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
  2996. + exit ;;
  2997. + *:QNX:*:4*)
  2998. + echo i386-pc-qnx
  2999. + exit ;;
  3000. + NEO-*:NONSTOP_KERNEL:*:*)
  3001. + echo neo-tandem-nsk"$UNAME_RELEASE"
  3002. + exit ;;
  3003. + NSE-*:NONSTOP_KERNEL:*:*)
  3004. + echo nse-tandem-nsk"$UNAME_RELEASE"
  3005. + exit ;;
  3006. + NSR-*:NONSTOP_KERNEL:*:*)
  3007. + echo nsr-tandem-nsk"$UNAME_RELEASE"
  3008. + exit ;;
  3009. + NSV-*:NONSTOP_KERNEL:*:*)
  3010. + echo nsv-tandem-nsk"$UNAME_RELEASE"
  3011. + exit ;;
  3012. + NSX-*:NONSTOP_KERNEL:*:*)
  3013. + echo nsx-tandem-nsk"$UNAME_RELEASE"
  3014. + exit ;;
  3015. + *:NonStop-UX:*:*)
  3016. + echo mips-compaq-nonstopux
  3017. + exit ;;
  3018. + BS2000:POSIX*:*:*)
  3019. + echo bs2000-siemens-sysv
  3020. + exit ;;
  3021. + DS/*:UNIX_System_V:*:*)
  3022. + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
  3023. + exit ;;
  3024. + *:Plan9:*:*)
  3025. + # "uname -m" is not consistent, so use $cputype instead. 386
  3026. + # is converted to i386 for consistency with other x86
  3027. + # operating systems.
  3028. + if test "$cputype" = 386; then
  3029. + UNAME_MACHINE=i386
  3030. + else
  3031. + UNAME_MACHINE="$cputype"
  3032. + fi
  3033. + echo "$UNAME_MACHINE"-unknown-plan9
  3034. + exit ;;
  3035. + *:TOPS-10:*:*)
  3036. + echo pdp10-unknown-tops10
  3037. + exit ;;
  3038. + *:TENEX:*:*)
  3039. + echo pdp10-unknown-tenex
  3040. + exit ;;
  3041. + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
  3042. + echo pdp10-dec-tops20
  3043. + exit ;;
  3044. + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
  3045. + echo pdp10-xkl-tops20
  3046. + exit ;;
  3047. + *:TOPS-20:*:*)
  3048. + echo pdp10-unknown-tops20
  3049. + exit ;;
  3050. + *:ITS:*:*)
  3051. + echo pdp10-unknown-its
  3052. + exit ;;
  3053. + SEI:*:*:SEIUX)
  3054. + echo mips-sei-seiux"$UNAME_RELEASE"
  3055. + exit ;;
  3056. + *:DragonFly:*:*)
  3057. + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
  3058. + exit ;;
  3059. + *:*VMS:*:*)
  3060. + UNAME_MACHINE=`(uname -p) 2>/dev/null`
  3061. + case "$UNAME_MACHINE" in
  3062. + A*) echo alpha-dec-vms ; exit ;;
  3063. + I*) echo ia64-dec-vms ; exit ;;
  3064. + V*) echo vax-dec-vms ; exit ;;
  3065. + esac ;;
  3066. + *:XENIX:*:SysV)
  3067. + echo i386-pc-xenix
  3068. + exit ;;
  3069. + i*86:skyos:*:*)
  3070. + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
  3071. + exit ;;
  3072. + i*86:rdos:*:*)
  3073. + echo "$UNAME_MACHINE"-pc-rdos
  3074. + exit ;;
  3075. + i*86:AROS:*:*)
  3076. + echo "$UNAME_MACHINE"-pc-aros
  3077. + exit ;;
  3078. + x86_64:VMkernel:*:*)
  3079. + echo "$UNAME_MACHINE"-unknown-esx
  3080. + exit ;;
  3081. + amd64:Isilon\ OneFS:*:*)
  3082. + echo x86_64-unknown-onefs
  3083. + exit ;;
  3084. +esac
  3085. +
  3086. +echo "$0: unable to guess system type" >&2
  3087. +
  3088. +case "$UNAME_MACHINE:$UNAME_SYSTEM" in
  3089. + mips:Linux | mips64:Linux)
  3090. + # If we got here on MIPS GNU/Linux, output extra information.
  3091. + cat >&2 <<EOF
  3092. +
  3093. +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
  3094. +the system type. Please install a C compiler and try again.
  3095. +EOF
  3096. + ;;
  3097. +esac
  3098. +
  3099. +cat >&2 <<EOF
  3100. +
  3101. +This script (version $timestamp), has failed to recognize the
  3102. +operating system you are using. If your script is old, overwrite *all*
  3103. +copies of config.guess and config.sub with the latest versions from:
  3104. +
  3105. + https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
  3106. +and
  3107. + https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
  3108. +
  3109. +If $0 has already been updated, send the following data and any
  3110. +information you think might be pertinent to config-patches@gnu.org to
  3111. +provide the necessary information to handle your system.
  3112. +
  3113. +config.guess timestamp = $timestamp
  3114. +
  3115. +uname -m = `(uname -m) 2>/dev/null || echo unknown`
  3116. +uname -r = `(uname -r) 2>/dev/null || echo unknown`
  3117. +uname -s = `(uname -s) 2>/dev/null || echo unknown`
  3118. +uname -v = `(uname -v) 2>/dev/null || echo unknown`
  3119. +
  3120. +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  3121. +/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
  3122. +
  3123. +hostinfo = `(hostinfo) 2>/dev/null`
  3124. +/bin/universe = `(/bin/universe) 2>/dev/null`
  3125. +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
  3126. +/bin/arch = `(/bin/arch) 2>/dev/null`
  3127. +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
  3128. +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  3129. +
  3130. +UNAME_MACHINE = "$UNAME_MACHINE"
  3131. +UNAME_RELEASE = "$UNAME_RELEASE"
  3132. +UNAME_SYSTEM = "$UNAME_SYSTEM"
  3133. +UNAME_VERSION = "$UNAME_VERSION"
  3134. +EOF
  3135. +
  3136. +exit 1
  3137. +
  3138. +# Local variables:
  3139. +# eval: (add-hook 'write-file-functions 'time-stamp)
  3140. +# time-stamp-start: "timestamp='"
  3141. +# time-stamp-format: "%:y-%02m-%02d"
  3142. +# time-stamp-end: "'"
  3143. +# End:
  3144. --- /dev/null
  3145. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/config.rpath
  3146. @@ -0,0 +1,696 @@
  3147. +#! /bin/sh
  3148. +#
  3149. +# NOTE: This file was brought from
  3150. +# http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/config.rpath
  3151. +# You should sometimes check if the file is updated and bring it to
  3152. +# our trunk and copy this note to the top of that file.
  3153. +#
  3154. +# Output a system dependent set of variables, describing how to set the
  3155. +# run time search path of shared libraries in an executable.
  3156. +#
  3157. +# Copyright 1996-2011 Free Software Foundation, Inc.
  3158. +# Taken from GNU libtool, 2001
  3159. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  3160. +#
  3161. +# This file is free software; the Free Software Foundation gives
  3162. +# unlimited permission to copy and/or distribute it, with or without
  3163. +# modifications, as long as this notice is preserved.
  3164. +#
  3165. +# The first argument passed to this file is the canonical host specification,
  3166. +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  3167. +# or
  3168. +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
  3169. +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
  3170. +# should be set by the caller.
  3171. +#
  3172. +# The set of defined variables is at the end of this script.
  3173. +
  3174. +# Known limitations:
  3175. +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
  3176. +# than 256 bytes, otherwise the compiler driver will dump core. The only
  3177. +# known workaround is to choose shorter directory names for the build
  3178. +# directory and/or the installation directory.
  3179. +
  3180. +# All known linkers require a `.a' archive for static linking (except MSVC,
  3181. +# which needs '.lib').
  3182. +libext=a
  3183. +shrext=.so
  3184. +
  3185. +host="$1"
  3186. +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  3187. +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  3188. +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  3189. +
  3190. +# Code taken from libtool.m4's _LT_CC_BASENAME.
  3191. +
  3192. +for cc_temp in $CC""; do
  3193. + case $cc_temp in
  3194. + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
  3195. + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
  3196. + \-*) ;;
  3197. + *) break;;
  3198. + esac
  3199. +done
  3200. +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
  3201. +
  3202. +# Code taken from libtool.m4's _LT_COMPILER_PIC.
  3203. +
  3204. +wl=
  3205. +if test "$GCC" = yes; then
  3206. + wl='-Wl,'
  3207. +else
  3208. + case "$host_os" in
  3209. + aix*)
  3210. + wl='-Wl,'
  3211. + ;;
  3212. + mingw* | cygwin* | msys* | pw32* | os2* | cegcc*)
  3213. + ;;
  3214. + hpux9* | hpux10* | hpux11*)
  3215. + wl='-Wl,'
  3216. + ;;
  3217. + irix5* | irix6* | nonstopux*)
  3218. + wl='-Wl,'
  3219. + ;;
  3220. + linux* | k*bsd*-gnu | kopensolaris*-gnu)
  3221. + case $cc_basename in
  3222. + ecc*)
  3223. + wl='-Wl,'
  3224. + ;;
  3225. + icc* | ifort*)
  3226. + wl='-Wl,'
  3227. + ;;
  3228. + lf95*)
  3229. + wl='-Wl,'
  3230. + ;;
  3231. + nagfor*)
  3232. + wl='-Wl,-Wl,,'
  3233. + ;;
  3234. + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
  3235. + wl='-Wl,'
  3236. + ;;
  3237. + ccc*)
  3238. + wl='-Wl,'
  3239. + ;;
  3240. + xl* | bgxl* | bgf* | mpixl*)
  3241. + wl='-Wl,'
  3242. + ;;
  3243. + como)
  3244. + wl='-lopt='
  3245. + ;;
  3246. + *)
  3247. + case `$CC -V 2>&1 | sed 5q` in
  3248. + *Sun\ F* | *Sun*Fortran*)
  3249. + wl=
  3250. + ;;
  3251. + *Sun\ C*)
  3252. + wl='-Wl,'
  3253. + ;;
  3254. + esac
  3255. + ;;
  3256. + esac
  3257. + ;;
  3258. + newsos6)
  3259. + ;;
  3260. + *nto* | *qnx*)
  3261. + ;;
  3262. + osf3* | osf4* | osf5*)
  3263. + wl='-Wl,'
  3264. + ;;
  3265. + rdos*)
  3266. + ;;
  3267. + solaris*)
  3268. + case $cc_basename in
  3269. + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
  3270. + wl='-Qoption ld '
  3271. + ;;
  3272. + *)
  3273. + wl='-Wl,'
  3274. + ;;
  3275. + esac
  3276. + ;;
  3277. + sunos4*)
  3278. + wl='-Qoption ld '
  3279. + ;;
  3280. + sysv4 | sysv4.2uw2* | sysv4.3*)
  3281. + wl='-Wl,'
  3282. + ;;
  3283. + sysv4*MP*)
  3284. + ;;
  3285. + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
  3286. + wl='-Wl,'
  3287. + ;;
  3288. + unicos*)
  3289. + wl='-Wl,'
  3290. + ;;
  3291. + uts4*)
  3292. + ;;
  3293. + esac
  3294. +fi
  3295. +
  3296. +# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
  3297. +
  3298. +hardcode_libdir_flag_spec=
  3299. +hardcode_libdir_separator=
  3300. +hardcode_direct=no
  3301. +hardcode_minus_L=no
  3302. +
  3303. +case "$host_os" in
  3304. + cygwin* | msys* | mingw* | pw32* | cegcc*)
  3305. + # FIXME: the MSVC++ port hasn't been tested in a loooong time
  3306. + # When not using gcc, we currently assume that we are using
  3307. + # Microsoft Visual C++.
  3308. + if test "$GCC" != yes; then
  3309. + with_gnu_ld=no
  3310. + fi
  3311. + ;;
  3312. + interix*)
  3313. + # we just hope/assume this is gcc and not c89 (= MSVC++)
  3314. + with_gnu_ld=yes
  3315. + ;;
  3316. + openbsd*)
  3317. + with_gnu_ld=no
  3318. + ;;
  3319. +esac
  3320. +
  3321. +ld_shlibs=yes
  3322. +if test "$with_gnu_ld" = yes; then
  3323. + # Set some defaults for GNU ld with shared library support. These
  3324. + # are reset later if shared libraries are not supported. Putting them
  3325. + # here allows them to be overridden if necessary.
  3326. + # Unlike libtool, we use -rpath here, not --rpath, since the documented
  3327. + # option of GNU ld is called -rpath, not --rpath.
  3328. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  3329. + case "$host_os" in
  3330. + aix[3-9]*)
  3331. + # On AIX/PPC, the GNU linker is very broken
  3332. + if test "$host_cpu" != ia64; then
  3333. + ld_shlibs=no
  3334. + fi
  3335. + ;;
  3336. + amigaos*)
  3337. + case "$host_cpu" in
  3338. + powerpc)
  3339. + ;;
  3340. + m68k)
  3341. + hardcode_libdir_flag_spec='-L$libdir'
  3342. + hardcode_minus_L=yes
  3343. + ;;
  3344. + esac
  3345. + ;;
  3346. + beos*)
  3347. + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  3348. + :
  3349. + else
  3350. + ld_shlibs=no
  3351. + fi
  3352. + ;;
  3353. + cygwin* | msys* | mingw* | pw32* | cegcc*)
  3354. + # hardcode_libdir_flag_spec is actually meaningless, as there is
  3355. + # no search path for DLLs.
  3356. + hardcode_libdir_flag_spec='-L$libdir'
  3357. + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
  3358. + :
  3359. + else
  3360. + ld_shlibs=no
  3361. + fi
  3362. + ;;
  3363. + haiku*)
  3364. + ;;
  3365. + interix[3-9]*)
  3366. + hardcode_direct=no
  3367. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  3368. + ;;
  3369. + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
  3370. + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  3371. + :
  3372. + else
  3373. + ld_shlibs=no
  3374. + fi
  3375. + ;;
  3376. + netbsd*)
  3377. + ;;
  3378. + solaris*)
  3379. + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
  3380. + ld_shlibs=no
  3381. + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  3382. + :
  3383. + else
  3384. + ld_shlibs=no
  3385. + fi
  3386. + ;;
  3387. + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
  3388. + case `$LD -v 2>&1` in
  3389. + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
  3390. + ld_shlibs=no
  3391. + ;;
  3392. + *)
  3393. + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  3394. + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
  3395. + else
  3396. + ld_shlibs=no
  3397. + fi
  3398. + ;;
  3399. + esac
  3400. + ;;
  3401. + sunos4*)
  3402. + hardcode_direct=yes
  3403. + ;;
  3404. + *)
  3405. + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  3406. + :
  3407. + else
  3408. + ld_shlibs=no
  3409. + fi
  3410. + ;;
  3411. + esac
  3412. + if test "$ld_shlibs" = no; then
  3413. + hardcode_libdir_flag_spec=
  3414. + fi
  3415. +else
  3416. + case "$host_os" in
  3417. + aix3*)
  3418. + # Note: this linker hardcodes the directories in LIBPATH if there
  3419. + # are no directories specified by -L.
  3420. + hardcode_minus_L=yes
  3421. + if test "$GCC" = yes; then
  3422. + # Neither direct hardcoding nor static linking is supported with a
  3423. + # broken collect2.
  3424. + hardcode_direct=unsupported
  3425. + fi
  3426. + ;;
  3427. + aix[4-9]*)
  3428. + if test "$host_cpu" = ia64; then
  3429. + # On IA64, the linker does run time linking by default, so we don't
  3430. + # have to do anything special.
  3431. + aix_use_runtimelinking=no
  3432. + else
  3433. + aix_use_runtimelinking=no
  3434. + # Test if we are trying to use run time linking or normal
  3435. + # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  3436. + # need to do runtime linking.
  3437. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
  3438. + for ld_flag in $LDFLAGS; do
  3439. + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
  3440. + aix_use_runtimelinking=yes
  3441. + break
  3442. + fi
  3443. + done
  3444. + ;;
  3445. + esac
  3446. + fi
  3447. + hardcode_direct=yes
  3448. + hardcode_libdir_separator=':'
  3449. + if test "$GCC" = yes; then
  3450. + case $host_os in aix4.[012]|aix4.[012].*)
  3451. + collect2name=`${CC} -print-prog-name=collect2`
  3452. + if test -f "$collect2name" && \
  3453. + strings "$collect2name" | grep resolve_lib_name >/dev/null
  3454. + then
  3455. + # We have reworked collect2
  3456. + :
  3457. + else
  3458. + # We have old collect2
  3459. + hardcode_direct=unsupported
  3460. + hardcode_minus_L=yes
  3461. + hardcode_libdir_flag_spec='-L$libdir'
  3462. + hardcode_libdir_separator=
  3463. + fi
  3464. + ;;
  3465. + esac
  3466. + fi
  3467. + # Begin _LT_AC_SYS_LIBPATH_AIX.
  3468. + echo 'int main () { return 0; }' > conftest.c
  3469. + ${CC} ${LDFLAGS} conftest.c -o conftest
  3470. + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  3471. +}'`
  3472. + if test -z "$aix_libpath"; then
  3473. + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  3474. +}'`
  3475. + fi
  3476. + if test -z "$aix_libpath"; then
  3477. + aix_libpath="/usr/lib:/lib"
  3478. + fi
  3479. + rm -f conftest.c conftest
  3480. + # End _LT_AC_SYS_LIBPATH_AIX.
  3481. + if test "$aix_use_runtimelinking" = yes; then
  3482. + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
  3483. + else
  3484. + if test "$host_cpu" = ia64; then
  3485. + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
  3486. + else
  3487. + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
  3488. + fi
  3489. + fi
  3490. + ;;
  3491. + amigaos*)
  3492. + case "$host_cpu" in
  3493. + powerpc)
  3494. + ;;
  3495. + m68k)
  3496. + hardcode_libdir_flag_spec='-L$libdir'
  3497. + hardcode_minus_L=yes
  3498. + ;;
  3499. + esac
  3500. + ;;
  3501. + bsdi[45]*)
  3502. + ;;
  3503. + cygwin* | msys* | mingw* | pw32* | cegcc*)
  3504. + # When not using gcc, we currently assume that we are using
  3505. + # Microsoft Visual C++.
  3506. + # hardcode_libdir_flag_spec is actually meaningless, as there is
  3507. + # no search path for DLLs.
  3508. + hardcode_libdir_flag_spec=' '
  3509. + libext=lib
  3510. + ;;
  3511. + darwin* | rhapsody*)
  3512. + hardcode_direct=no
  3513. + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
  3514. + :
  3515. + else
  3516. + ld_shlibs=no
  3517. + fi
  3518. + ;;
  3519. + dgux*)
  3520. + hardcode_libdir_flag_spec='-L$libdir'
  3521. + ;;
  3522. + freebsd2.2*)
  3523. + hardcode_libdir_flag_spec='-R$libdir'
  3524. + hardcode_direct=yes
  3525. + ;;
  3526. + freebsd2*)
  3527. + hardcode_direct=yes
  3528. + hardcode_minus_L=yes
  3529. + ;;
  3530. + freebsd* | dragonfly*)
  3531. + hardcode_libdir_flag_spec='-R$libdir'
  3532. + hardcode_direct=yes
  3533. + ;;
  3534. + hpux9*)
  3535. + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  3536. + hardcode_libdir_separator=:
  3537. + hardcode_direct=yes
  3538. + # hardcode_minus_L: Not really in the search PATH,
  3539. + # but as the default location of the library.
  3540. + hardcode_minus_L=yes
  3541. + ;;
  3542. + hpux10*)
  3543. + if test "$with_gnu_ld" = no; then
  3544. + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  3545. + hardcode_libdir_separator=:
  3546. + hardcode_direct=yes
  3547. + # hardcode_minus_L: Not really in the search PATH,
  3548. + # but as the default location of the library.
  3549. + hardcode_minus_L=yes
  3550. + fi
  3551. + ;;
  3552. + hpux11*)
  3553. + if test "$with_gnu_ld" = no; then
  3554. + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  3555. + hardcode_libdir_separator=:
  3556. + case $host_cpu in
  3557. + hppa*64*|ia64*)
  3558. + hardcode_direct=no
  3559. + ;;
  3560. + *)
  3561. + hardcode_direct=yes
  3562. + # hardcode_minus_L: Not really in the search PATH,
  3563. + # but as the default location of the library.
  3564. + hardcode_minus_L=yes
  3565. + ;;
  3566. + esac
  3567. + fi
  3568. + ;;
  3569. + irix5* | irix6* | nonstopux*)
  3570. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  3571. + hardcode_libdir_separator=:
  3572. + ;;
  3573. + netbsd*)
  3574. + hardcode_libdir_flag_spec='-R$libdir'
  3575. + hardcode_direct=yes
  3576. + ;;
  3577. + newsos6)
  3578. + hardcode_direct=yes
  3579. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  3580. + hardcode_libdir_separator=:
  3581. + ;;
  3582. + *nto* | *qnx*)
  3583. + ;;
  3584. + openbsd*)
  3585. + if test -f /usr/libexec/ld.so; then
  3586. + hardcode_direct=yes
  3587. + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  3588. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  3589. + else
  3590. + case "$host_os" in
  3591. + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
  3592. + hardcode_libdir_flag_spec='-R$libdir'
  3593. + ;;
  3594. + *)
  3595. + hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  3596. + ;;
  3597. + esac
  3598. + fi
  3599. + else
  3600. + ld_shlibs=no
  3601. + fi
  3602. + ;;
  3603. + os2*)
  3604. + hardcode_libdir_flag_spec='-L$libdir'
  3605. + hardcode_minus_L=yes
  3606. + ;;
  3607. + osf3*)
  3608. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  3609. + hardcode_libdir_separator=:
  3610. + ;;
  3611. + osf4* | osf5*)
  3612. + if test "$GCC" = yes; then
  3613. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  3614. + else
  3615. + # Both cc and cxx compiler support -rpath directly
  3616. + hardcode_libdir_flag_spec='-rpath $libdir'
  3617. + fi
  3618. + hardcode_libdir_separator=:
  3619. + ;;
  3620. + solaris*)
  3621. + hardcode_libdir_flag_spec='-R$libdir'
  3622. + ;;
  3623. + sunos4*)
  3624. + hardcode_libdir_flag_spec='-L$libdir'
  3625. + hardcode_direct=yes
  3626. + hardcode_minus_L=yes
  3627. + ;;
  3628. + sysv4)
  3629. + case $host_vendor in
  3630. + sni)
  3631. + hardcode_direct=yes # is this really true???
  3632. + ;;
  3633. + siemens)
  3634. + hardcode_direct=no
  3635. + ;;
  3636. + motorola)
  3637. + hardcode_direct=no #Motorola manual says yes, but my tests say they lie
  3638. + ;;
  3639. + esac
  3640. + ;;
  3641. + sysv4.3*)
  3642. + ;;
  3643. + sysv4*MP*)
  3644. + if test -d /usr/nec; then
  3645. + ld_shlibs=yes
  3646. + fi
  3647. + ;;
  3648. + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
  3649. + ;;
  3650. + sysv5* | sco3.2v5* | sco5v6*)
  3651. + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
  3652. + hardcode_libdir_separator=':'
  3653. + ;;
  3654. + uts4*)
  3655. + hardcode_libdir_flag_spec='-L$libdir'
  3656. + ;;
  3657. + *)
  3658. + ld_shlibs=no
  3659. + ;;
  3660. + esac
  3661. +fi
  3662. +
  3663. +# Check dynamic linker characteristics
  3664. +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
  3665. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but
  3666. +# only about the one the linker finds when passed -lNAME. This is the last
  3667. +# element of library_names_spec in libtool.m4, or possibly two of them if the
  3668. +# linker has special search rules.
  3669. +library_names_spec= # the last element of library_names_spec in libtool.m4
  3670. +libname_spec='lib$name'
  3671. +case "$host_os" in
  3672. + aix3*)
  3673. + library_names_spec='$libname.a'
  3674. + ;;
  3675. + aix[4-9]*)
  3676. + library_names_spec='$libname$shrext'
  3677. + ;;
  3678. + amigaos*)
  3679. + case "$host_cpu" in
  3680. + powerpc*)
  3681. + library_names_spec='$libname$shrext' ;;
  3682. + m68k)
  3683. + library_names_spec='$libname.a' ;;
  3684. + esac
  3685. + ;;
  3686. + beos*)
  3687. + library_names_spec='$libname$shrext'
  3688. + ;;
  3689. + bsdi[45]*)
  3690. + library_names_spec='$libname$shrext'
  3691. + ;;
  3692. + cygwin* | msys* | mingw* | pw32* | cegcc*)
  3693. + shrext=.dll
  3694. + library_names_spec='$libname.dll.a $libname.lib'
  3695. + ;;
  3696. + darwin* | rhapsody*)
  3697. + shrext=.dylib
  3698. + library_names_spec='$libname$shrext'
  3699. + ;;
  3700. + dgux*)
  3701. + library_names_spec='$libname$shrext'
  3702. + ;;
  3703. + freebsd* | dragonfly*)
  3704. + case "$host_os" in
  3705. + freebsd[123]*)
  3706. + library_names_spec='$libname$shrext$versuffix' ;;
  3707. + *)
  3708. + library_names_spec='$libname$shrext' ;;
  3709. + esac
  3710. + ;;
  3711. + gnu*)
  3712. + library_names_spec='$libname$shrext'
  3713. + ;;
  3714. + haiku*)
  3715. + library_names_spec='$libname$shrext'
  3716. + ;;
  3717. + hpux9* | hpux10* | hpux11*)
  3718. + case $host_cpu in
  3719. + ia64*)
  3720. + shrext=.so
  3721. + ;;
  3722. + hppa*64*)
  3723. + shrext=.sl
  3724. + ;;
  3725. + *)
  3726. + shrext=.sl
  3727. + ;;
  3728. + esac
  3729. + library_names_spec='$libname$shrext'
  3730. + ;;
  3731. + interix[3-9]*)
  3732. + library_names_spec='$libname$shrext'
  3733. + ;;
  3734. + irix5* | irix6* | nonstopux*)
  3735. + library_names_spec='$libname$shrext'
  3736. + case "$host_os" in
  3737. + irix5* | nonstopux*)
  3738. + libsuff= shlibsuff=
  3739. + ;;
  3740. + *)
  3741. + case $LD in
  3742. + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
  3743. + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
  3744. + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
  3745. + *) libsuff= shlibsuff= ;;
  3746. + esac
  3747. + ;;
  3748. + esac
  3749. + ;;
  3750. + linux*oldld* | linux*aout* | linux*coff*)
  3751. + ;;
  3752. + linux* | k*bsd*-gnu | kopensolaris*-gnu)
  3753. + library_names_spec='$libname$shrext'
  3754. + ;;
  3755. + knetbsd*-gnu)
  3756. + library_names_spec='$libname$shrext'
  3757. + ;;
  3758. + netbsd*)
  3759. + library_names_spec='$libname$shrext'
  3760. + ;;
  3761. + newsos6)
  3762. + library_names_spec='$libname$shrext'
  3763. + ;;
  3764. + *nto* | *qnx*)
  3765. + library_names_spec='$libname$shrext'
  3766. + ;;
  3767. + openbsd*)
  3768. + library_names_spec='$libname$shrext$versuffix'
  3769. + ;;
  3770. + os2*)
  3771. + libname_spec='$name'
  3772. + shrext=.dll
  3773. + library_names_spec='$libname.a'
  3774. + ;;
  3775. + osf3* | osf4* | osf5*)
  3776. + library_names_spec='$libname$shrext'
  3777. + ;;
  3778. + rdos*)
  3779. + ;;
  3780. + solaris*)
  3781. + library_names_spec='$libname$shrext'
  3782. + ;;
  3783. + sunos4*)
  3784. + library_names_spec='$libname$shrext$versuffix'
  3785. + ;;
  3786. + sysv4 | sysv4.3*)
  3787. + library_names_spec='$libname$shrext'
  3788. + ;;
  3789. + sysv4*MP*)
  3790. + library_names_spec='$libname$shrext'
  3791. + ;;
  3792. + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  3793. + library_names_spec='$libname$shrext'
  3794. + ;;
  3795. + tpf*)
  3796. + library_names_spec='$libname$shrext'
  3797. + ;;
  3798. + uts4*)
  3799. + library_names_spec='$libname$shrext'
  3800. + ;;
  3801. +esac
  3802. +
  3803. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
  3804. +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
  3805. +shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
  3806. +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  3807. +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  3808. +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  3809. +
  3810. +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
  3811. +
  3812. +# How to pass a linker flag through the compiler.
  3813. +wl="$escaped_wl"
  3814. +
  3815. +# Static library suffix (normally "a").
  3816. +libext="$libext"
  3817. +
  3818. +# Shared library suffix (normally "so").
  3819. +shlibext="$shlibext"
  3820. +
  3821. +# Format of library name prefix.
  3822. +libname_spec="$escaped_libname_spec"
  3823. +
  3824. +# Library names that the linker finds when passed -lNAME.
  3825. +library_names_spec="$escaped_library_names_spec"
  3826. +
  3827. +# Flag to hardcode \$libdir into a binary during linking.
  3828. +# This must work even if \$libdir does not exist.
  3829. +hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
  3830. +
  3831. +# Whether we need a single -rpath flag with a separated argument.
  3832. +hardcode_libdir_separator="$hardcode_libdir_separator"
  3833. +
  3834. +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  3835. +# resulting binary.
  3836. +hardcode_direct="$hardcode_direct"
  3837. +
  3838. +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  3839. +# resulting binary.
  3840. +hardcode_minus_L="$hardcode_minus_L"
  3841. +
  3842. +EOF
  3843. --- /dev/null
  3844. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/config.sub
  3845. @@ -0,0 +1,1801 @@
  3846. +#! /bin/sh
  3847. +# Configuration validation subroutine script.
  3848. +# Copyright 1992-2018 Free Software Foundation, Inc.
  3849. +
  3850. +timestamp='2018-02-22'
  3851. +
  3852. +# This file is free software; you can redistribute it and/or modify it
  3853. +# under the terms of the GNU General Public License as published by
  3854. +# the Free Software Foundation; either version 3 of the License, or
  3855. +# (at your option) any later version.
  3856. +#
  3857. +# This program is distributed in the hope that it will be useful, but
  3858. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  3859. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  3860. +# General Public License for more details.
  3861. +#
  3862. +# You should have received a copy of the GNU General Public License
  3863. +# along with this program; if not, see <https://www.gnu.org/licenses/>.
  3864. +#
  3865. +# As a special exception to the GNU General Public License, if you
  3866. +# distribute this file as part of a program that contains a
  3867. +# configuration script generated by Autoconf, you may include it under
  3868. +# the same distribution terms that you use for the rest of that
  3869. +# program. This Exception is an additional permission under section 7
  3870. +# of the GNU General Public License, version 3 ("GPLv3").
  3871. +
  3872. +
  3873. +# Please send patches to <config-patches@gnu.org>.
  3874. +#
  3875. +# Configuration subroutine to validate and canonicalize a configuration type.
  3876. +# Supply the specified configuration type as an argument.
  3877. +# If it is invalid, we print an error message on stderr and exit with code 1.
  3878. +# Otherwise, we print the canonical config type on stdout and succeed.
  3879. +
  3880. +# You can get the latest version of this script from:
  3881. +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
  3882. +
  3883. +# This file is supposed to be the same for all GNU packages
  3884. +# and recognize all the CPU types, system types and aliases
  3885. +# that are meaningful with *any* GNU software.
  3886. +# Each package is responsible for reporting which valid configurations
  3887. +# it does not support. The user should be able to distinguish
  3888. +# a failure to support a valid configuration from a meaningless
  3889. +# configuration.
  3890. +
  3891. +# The goal of this file is to map all the various variations of a given
  3892. +# machine specification into a single specification in the form:
  3893. +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  3894. +# or in some cases, the newer four-part form:
  3895. +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
  3896. +# It is wrong to echo any other type of specification.
  3897. +
  3898. +me=`echo "$0" | sed -e 's,.*/,,'`
  3899. +
  3900. +usage="\
  3901. +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
  3902. +
  3903. +Canonicalize a configuration name.
  3904. +
  3905. +Options:
  3906. + -h, --help print this help, then exit
  3907. + -t, --time-stamp print date of last modification, then exit
  3908. + -v, --version print version number, then exit
  3909. +
  3910. +Report bugs and patches to <config-patches@gnu.org>."
  3911. +
  3912. +version="\
  3913. +GNU config.sub ($timestamp)
  3914. +
  3915. +Copyright 1992-2018 Free Software Foundation, Inc.
  3916. +
  3917. +This is free software; see the source for copying conditions. There is NO
  3918. +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  3919. +
  3920. +help="
  3921. +Try \`$me --help' for more information."
  3922. +
  3923. +# Parse command line
  3924. +while test $# -gt 0 ; do
  3925. + case $1 in
  3926. + --time-stamp | --time* | -t )
  3927. + echo "$timestamp" ; exit ;;
  3928. + --version | -v )
  3929. + echo "$version" ; exit ;;
  3930. + --help | --h* | -h )
  3931. + echo "$usage"; exit ;;
  3932. + -- ) # Stop option processing
  3933. + shift; break ;;
  3934. + - ) # Use stdin as input.
  3935. + break ;;
  3936. + -* )
  3937. + echo "$me: invalid option $1$help"
  3938. + exit 1 ;;
  3939. +
  3940. + *local*)
  3941. + # First pass through any local machine types.
  3942. + echo "$1"
  3943. + exit ;;
  3944. +
  3945. + * )
  3946. + break ;;
  3947. + esac
  3948. +done
  3949. +
  3950. +case $# in
  3951. + 0) echo "$me: missing argument$help" >&2
  3952. + exit 1;;
  3953. + 1) ;;
  3954. + *) echo "$me: too many arguments$help" >&2
  3955. + exit 1;;
  3956. +esac
  3957. +
  3958. +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
  3959. +# Here we must recognize all the valid KERNEL-OS combinations.
  3960. +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  3961. +case $maybe_os in
  3962. + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
  3963. + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
  3964. + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
  3965. + kopensolaris*-gnu* | cloudabi*-eabi* | \
  3966. + storm-chaos* | os2-emx* | rtmk-nova*)
  3967. + os=-$maybe_os
  3968. + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
  3969. + ;;
  3970. + android-linux)
  3971. + os=-linux-android
  3972. + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
  3973. + ;;
  3974. + *)
  3975. + basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
  3976. + if [ "$basic_machine" != "$1" ]
  3977. + then os=`echo "$1" | sed 's/.*-/-/'`
  3978. + else os=; fi
  3979. + ;;
  3980. +esac
  3981. +
  3982. +### Let's recognize common machines as not being operating systems so
  3983. +### that things like config.sub decstation-3100 work. We also
  3984. +### recognize some manufacturers as not being operating systems, so we
  3985. +### can provide default operating systems below.
  3986. +case $os in
  3987. + -sun*os*)
  3988. + # Prevent following clause from handling this invalid input.
  3989. + ;;
  3990. + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  3991. + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  3992. + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
  3993. + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  3994. + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  3995. + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  3996. + -apple | -axis | -knuth | -cray | -microblaze*)
  3997. + os=
  3998. + basic_machine=$1
  3999. + ;;
  4000. + -bluegene*)
  4001. + os=-cnk
  4002. + ;;
  4003. + -sim | -cisco | -oki | -wec | -winbond)
  4004. + os=
  4005. + basic_machine=$1
  4006. + ;;
  4007. + -scout)
  4008. + ;;
  4009. + -wrs)
  4010. + os=-vxworks
  4011. + basic_machine=$1
  4012. + ;;
  4013. + -chorusos*)
  4014. + os=-chorusos
  4015. + basic_machine=$1
  4016. + ;;
  4017. + -chorusrdb)
  4018. + os=-chorusrdb
  4019. + basic_machine=$1
  4020. + ;;
  4021. + -hiux*)
  4022. + os=-hiuxwe2
  4023. + ;;
  4024. + -sco6)
  4025. + os=-sco5v6
  4026. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4027. + ;;
  4028. + -sco5)
  4029. + os=-sco3.2v5
  4030. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4031. + ;;
  4032. + -sco4)
  4033. + os=-sco3.2v4
  4034. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4035. + ;;
  4036. + -sco3.2.[4-9]*)
  4037. + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  4038. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4039. + ;;
  4040. + -sco3.2v[4-9]*)
  4041. + # Don't forget version if it is 3.2v4 or newer.
  4042. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4043. + ;;
  4044. + -sco5v6*)
  4045. + # Don't forget version if it is 3.2v4 or newer.
  4046. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4047. + ;;
  4048. + -sco*)
  4049. + os=-sco3.2v2
  4050. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4051. + ;;
  4052. + -udk*)
  4053. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4054. + ;;
  4055. + -isc)
  4056. + os=-isc2.2
  4057. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4058. + ;;
  4059. + -clix*)
  4060. + basic_machine=clipper-intergraph
  4061. + ;;
  4062. + -isc*)
  4063. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
  4064. + ;;
  4065. + -lynx*178)
  4066. + os=-lynxos178
  4067. + ;;
  4068. + -lynx*5)
  4069. + os=-lynxos5
  4070. + ;;
  4071. + -lynx*)
  4072. + os=-lynxos
  4073. + ;;
  4074. + -ptx*)
  4075. + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
  4076. + ;;
  4077. + -psos*)
  4078. + os=-psos
  4079. + ;;
  4080. + -mint | -mint[0-9]*)
  4081. + basic_machine=m68k-atari
  4082. + os=-mint
  4083. + ;;
  4084. +esac
  4085. +
  4086. +# Decode aliases for certain CPU-COMPANY combinations.
  4087. +case $basic_machine in
  4088. + # Recognize the basic CPU types without company name.
  4089. + # Some are omitted here because they have special meanings below.
  4090. + 1750a | 580 \
  4091. + | a29k \
  4092. + | aarch64 | aarch64_be \
  4093. + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
  4094. + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
  4095. + | am33_2.0 \
  4096. + | arc | arceb \
  4097. + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
  4098. + | avr | avr32 \
  4099. + | ba \
  4100. + | be32 | be64 \
  4101. + | bfin \
  4102. + | c4x | c8051 | clipper \
  4103. + | d10v | d30v | dlx | dsp16xx \
  4104. + | e2k | epiphany \
  4105. + | fido | fr30 | frv | ft32 \
  4106. + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
  4107. + | hexagon \
  4108. + | i370 | i860 | i960 | ia16 | ia64 \
  4109. + | ip2k | iq2000 \
  4110. + | k1om \
  4111. + | le32 | le64 \
  4112. + | lm32 \
  4113. + | m32c | m32r | m32rle | m68000 | m68k | m88k \
  4114. + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
  4115. + | mips | mipsbe | mipseb | mipsel | mipsle \
  4116. + | mips16 \
  4117. + | mips64 | mips64el \
  4118. + | mips64octeon | mips64octeonel \
  4119. + | mips64orion | mips64orionel \
  4120. + | mips64r5900 | mips64r5900el \
  4121. + | mips64vr | mips64vrel \
  4122. + | mips64vr4100 | mips64vr4100el \
  4123. + | mips64vr4300 | mips64vr4300el \
  4124. + | mips64vr5000 | mips64vr5000el \
  4125. + | mips64vr5900 | mips64vr5900el \
  4126. + | mipsisa32 | mipsisa32el \
  4127. + | mipsisa32r2 | mipsisa32r2el \
  4128. + | mipsisa32r6 | mipsisa32r6el \
  4129. + | mipsisa64 | mipsisa64el \
  4130. + | mipsisa64r2 | mipsisa64r2el \
  4131. + | mipsisa64r6 | mipsisa64r6el \
  4132. + | mipsisa64sb1 | mipsisa64sb1el \
  4133. + | mipsisa64sr71k | mipsisa64sr71kel \
  4134. + | mipsr5900 | mipsr5900el \
  4135. + | mipstx39 | mipstx39el \
  4136. + | mn10200 | mn10300 \
  4137. + | moxie \
  4138. + | mt \
  4139. + | msp430 \
  4140. + | nds32 | nds32le | nds32be \
  4141. + | nios | nios2 | nios2eb | nios2el \
  4142. + | ns16k | ns32k \
  4143. + | open8 | or1k | or1knd | or32 \
  4144. + | pdp10 | pj | pjl \
  4145. + | powerpc | powerpc64 | powerpc64le | powerpcle \
  4146. + | pru \
  4147. + | pyramid \
  4148. + | riscv32 | riscv64 \
  4149. + | rl78 | rx \
  4150. + | score \
  4151. + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
  4152. + | sh64 | sh64le \
  4153. + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
  4154. + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
  4155. + | spu \
  4156. + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
  4157. + | ubicom32 \
  4158. + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
  4159. + | visium \
  4160. + | wasm32 \
  4161. + | x86 | xc16x | xstormy16 | xtensa \
  4162. + | z8k | z80)
  4163. + basic_machine=$basic_machine-unknown
  4164. + ;;
  4165. + c54x)
  4166. + basic_machine=tic54x-unknown
  4167. + ;;
  4168. + c55x)
  4169. + basic_machine=tic55x-unknown
  4170. + ;;
  4171. + c6x)
  4172. + basic_machine=tic6x-unknown
  4173. + ;;
  4174. + leon|leon[3-9])
  4175. + basic_machine=sparc-$basic_machine
  4176. + ;;
  4177. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
  4178. + basic_machine=$basic_machine-unknown
  4179. + os=-none
  4180. + ;;
  4181. + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
  4182. + ;;
  4183. + ms1)
  4184. + basic_machine=mt-unknown
  4185. + ;;
  4186. +
  4187. + strongarm | thumb | xscale)
  4188. + basic_machine=arm-unknown
  4189. + ;;
  4190. + xgate)
  4191. + basic_machine=$basic_machine-unknown
  4192. + os=-none
  4193. + ;;
  4194. + xscaleeb)
  4195. + basic_machine=armeb-unknown
  4196. + ;;
  4197. +
  4198. + xscaleel)
  4199. + basic_machine=armel-unknown
  4200. + ;;
  4201. +
  4202. + # We use `pc' rather than `unknown'
  4203. + # because (1) that's what they normally are, and
  4204. + # (2) the word "unknown" tends to confuse beginning users.
  4205. + i*86 | x86_64)
  4206. + basic_machine=$basic_machine-pc
  4207. + ;;
  4208. + # Object if more than one company name word.
  4209. + *-*-*)
  4210. + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
  4211. + exit 1
  4212. + ;;
  4213. + # Recognize the basic CPU types with company name.
  4214. + 580-* \
  4215. + | a29k-* \
  4216. + | aarch64-* | aarch64_be-* \
  4217. + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
  4218. + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
  4219. + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
  4220. + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
  4221. + | avr-* | avr32-* \
  4222. + | ba-* \
  4223. + | be32-* | be64-* \
  4224. + | bfin-* | bs2000-* \
  4225. + | c[123]* | c30-* | [cjt]90-* | c4x-* \
  4226. + | c8051-* | clipper-* | craynv-* | cydra-* \
  4227. + | d10v-* | d30v-* | dlx-* \
  4228. + | e2k-* | elxsi-* \
  4229. + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
  4230. + | h8300-* | h8500-* \
  4231. + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
  4232. + | hexagon-* \
  4233. + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
  4234. + | ip2k-* | iq2000-* \
  4235. + | k1om-* \
  4236. + | le32-* | le64-* \
  4237. + | lm32-* \
  4238. + | m32c-* | m32r-* | m32rle-* \
  4239. + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
  4240. + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
  4241. + | microblaze-* | microblazeel-* \
  4242. + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
  4243. + | mips16-* \
  4244. + | mips64-* | mips64el-* \
  4245. + | mips64octeon-* | mips64octeonel-* \
  4246. + | mips64orion-* | mips64orionel-* \
  4247. + | mips64r5900-* | mips64r5900el-* \
  4248. + | mips64vr-* | mips64vrel-* \
  4249. + | mips64vr4100-* | mips64vr4100el-* \
  4250. + | mips64vr4300-* | mips64vr4300el-* \
  4251. + | mips64vr5000-* | mips64vr5000el-* \
  4252. + | mips64vr5900-* | mips64vr5900el-* \
  4253. + | mipsisa32-* | mipsisa32el-* \
  4254. + | mipsisa32r2-* | mipsisa32r2el-* \
  4255. + | mipsisa32r6-* | mipsisa32r6el-* \
  4256. + | mipsisa64-* | mipsisa64el-* \
  4257. + | mipsisa64r2-* | mipsisa64r2el-* \
  4258. + | mipsisa64r6-* | mipsisa64r6el-* \
  4259. + | mipsisa64sb1-* | mipsisa64sb1el-* \
  4260. + | mipsisa64sr71k-* | mipsisa64sr71kel-* \
  4261. + | mipsr5900-* | mipsr5900el-* \
  4262. + | mipstx39-* | mipstx39el-* \
  4263. + | mmix-* \
  4264. + | mt-* \
  4265. + | msp430-* \
  4266. + | nds32-* | nds32le-* | nds32be-* \
  4267. + | nios-* | nios2-* | nios2eb-* | nios2el-* \
  4268. + | none-* | np1-* | ns16k-* | ns32k-* \
  4269. + | open8-* \
  4270. + | or1k*-* \
  4271. + | orion-* \
  4272. + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
  4273. + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
  4274. + | pru-* \
  4275. + | pyramid-* \
  4276. + | riscv32-* | riscv64-* \
  4277. + | rl78-* | romp-* | rs6000-* | rx-* \
  4278. + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
  4279. + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
  4280. + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
  4281. + | sparclite-* \
  4282. + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
  4283. + | tahoe-* \
  4284. + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
  4285. + | tile*-* \
  4286. + | tron-* \
  4287. + | ubicom32-* \
  4288. + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
  4289. + | vax-* \
  4290. + | visium-* \
  4291. + | wasm32-* \
  4292. + | we32k-* \
  4293. + | x86-* | x86_64-* | xc16x-* | xps100-* \
  4294. + | xstormy16-* | xtensa*-* \
  4295. + | ymp-* \
  4296. + | z8k-* | z80-*)
  4297. + ;;
  4298. + # Recognize the basic CPU types without company name, with glob match.
  4299. + xtensa*)
  4300. + basic_machine=$basic_machine-unknown
  4301. + ;;
  4302. + # Recognize the various machine names and aliases which stand
  4303. + # for a CPU type and a company and sometimes even an OS.
  4304. + 386bsd)
  4305. + basic_machine=i386-pc
  4306. + os=-bsd
  4307. + ;;
  4308. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
  4309. + basic_machine=m68000-att
  4310. + ;;
  4311. + 3b*)
  4312. + basic_machine=we32k-att
  4313. + ;;
  4314. + a29khif)
  4315. + basic_machine=a29k-amd
  4316. + os=-udi
  4317. + ;;
  4318. + abacus)
  4319. + basic_machine=abacus-unknown
  4320. + ;;
  4321. + adobe68k)
  4322. + basic_machine=m68010-adobe
  4323. + os=-scout
  4324. + ;;
  4325. + alliant | fx80)
  4326. + basic_machine=fx80-alliant
  4327. + ;;
  4328. + altos | altos3068)
  4329. + basic_machine=m68k-altos
  4330. + ;;
  4331. + am29k)
  4332. + basic_machine=a29k-none
  4333. + os=-bsd
  4334. + ;;
  4335. + amd64)
  4336. + basic_machine=x86_64-pc
  4337. + ;;
  4338. + amd64-*)
  4339. + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4340. + ;;
  4341. + amdahl)
  4342. + basic_machine=580-amdahl
  4343. + os=-sysv
  4344. + ;;
  4345. + amiga | amiga-*)
  4346. + basic_machine=m68k-unknown
  4347. + ;;
  4348. + amigaos | amigados)
  4349. + basic_machine=m68k-unknown
  4350. + os=-amigaos
  4351. + ;;
  4352. + amigaunix | amix)
  4353. + basic_machine=m68k-unknown
  4354. + os=-sysv4
  4355. + ;;
  4356. + apollo68)
  4357. + basic_machine=m68k-apollo
  4358. + os=-sysv
  4359. + ;;
  4360. + apollo68bsd)
  4361. + basic_machine=m68k-apollo
  4362. + os=-bsd
  4363. + ;;
  4364. + aros)
  4365. + basic_machine=i386-pc
  4366. + os=-aros
  4367. + ;;
  4368. + asmjs)
  4369. + basic_machine=asmjs-unknown
  4370. + ;;
  4371. + aux)
  4372. + basic_machine=m68k-apple
  4373. + os=-aux
  4374. + ;;
  4375. + balance)
  4376. + basic_machine=ns32k-sequent
  4377. + os=-dynix
  4378. + ;;
  4379. + blackfin)
  4380. + basic_machine=bfin-unknown
  4381. + os=-linux
  4382. + ;;
  4383. + blackfin-*)
  4384. + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4385. + os=-linux
  4386. + ;;
  4387. + bluegene*)
  4388. + basic_machine=powerpc-ibm
  4389. + os=-cnk
  4390. + ;;
  4391. + c54x-*)
  4392. + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4393. + ;;
  4394. + c55x-*)
  4395. + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4396. + ;;
  4397. + c6x-*)
  4398. + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4399. + ;;
  4400. + c90)
  4401. + basic_machine=c90-cray
  4402. + os=-unicos
  4403. + ;;
  4404. + cegcc)
  4405. + basic_machine=arm-unknown
  4406. + os=-cegcc
  4407. + ;;
  4408. + convex-c1)
  4409. + basic_machine=c1-convex
  4410. + os=-bsd
  4411. + ;;
  4412. + convex-c2)
  4413. + basic_machine=c2-convex
  4414. + os=-bsd
  4415. + ;;
  4416. + convex-c32)
  4417. + basic_machine=c32-convex
  4418. + os=-bsd
  4419. + ;;
  4420. + convex-c34)
  4421. + basic_machine=c34-convex
  4422. + os=-bsd
  4423. + ;;
  4424. + convex-c38)
  4425. + basic_machine=c38-convex
  4426. + os=-bsd
  4427. + ;;
  4428. + cray | j90)
  4429. + basic_machine=j90-cray
  4430. + os=-unicos
  4431. + ;;
  4432. + craynv)
  4433. + basic_machine=craynv-cray
  4434. + os=-unicosmp
  4435. + ;;
  4436. + cr16 | cr16-*)
  4437. + basic_machine=cr16-unknown
  4438. + os=-elf
  4439. + ;;
  4440. + crds | unos)
  4441. + basic_machine=m68k-crds
  4442. + ;;
  4443. + crisv32 | crisv32-* | etraxfs*)
  4444. + basic_machine=crisv32-axis
  4445. + ;;
  4446. + cris | cris-* | etrax*)
  4447. + basic_machine=cris-axis
  4448. + ;;
  4449. + crx)
  4450. + basic_machine=crx-unknown
  4451. + os=-elf
  4452. + ;;
  4453. + da30 | da30-*)
  4454. + basic_machine=m68k-da30
  4455. + ;;
  4456. + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
  4457. + basic_machine=mips-dec
  4458. + ;;
  4459. + decsystem10* | dec10*)
  4460. + basic_machine=pdp10-dec
  4461. + os=-tops10
  4462. + ;;
  4463. + decsystem20* | dec20*)
  4464. + basic_machine=pdp10-dec
  4465. + os=-tops20
  4466. + ;;
  4467. + delta | 3300 | motorola-3300 | motorola-delta \
  4468. + | 3300-motorola | delta-motorola)
  4469. + basic_machine=m68k-motorola
  4470. + ;;
  4471. + delta88)
  4472. + basic_machine=m88k-motorola
  4473. + os=-sysv3
  4474. + ;;
  4475. + dicos)
  4476. + basic_machine=i686-pc
  4477. + os=-dicos
  4478. + ;;
  4479. + djgpp)
  4480. + basic_machine=i586-pc
  4481. + os=-msdosdjgpp
  4482. + ;;
  4483. + dpx20 | dpx20-*)
  4484. + basic_machine=rs6000-bull
  4485. + os=-bosx
  4486. + ;;
  4487. + dpx2*)
  4488. + basic_machine=m68k-bull
  4489. + os=-sysv3
  4490. + ;;
  4491. + e500v[12])
  4492. + basic_machine=powerpc-unknown
  4493. + os=$os"spe"
  4494. + ;;
  4495. + e500v[12]-*)
  4496. + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4497. + os=$os"spe"
  4498. + ;;
  4499. + ebmon29k)
  4500. + basic_machine=a29k-amd
  4501. + os=-ebmon
  4502. + ;;
  4503. + elxsi)
  4504. + basic_machine=elxsi-elxsi
  4505. + os=-bsd
  4506. + ;;
  4507. + encore | umax | mmax)
  4508. + basic_machine=ns32k-encore
  4509. + ;;
  4510. + es1800 | OSE68k | ose68k | ose | OSE)
  4511. + basic_machine=m68k-ericsson
  4512. + os=-ose
  4513. + ;;
  4514. + fx2800)
  4515. + basic_machine=i860-alliant
  4516. + ;;
  4517. + genix)
  4518. + basic_machine=ns32k-ns
  4519. + ;;
  4520. + gmicro)
  4521. + basic_machine=tron-gmicro
  4522. + os=-sysv
  4523. + ;;
  4524. + go32)
  4525. + basic_machine=i386-pc
  4526. + os=-go32
  4527. + ;;
  4528. + h3050r* | hiux*)
  4529. + basic_machine=hppa1.1-hitachi
  4530. + os=-hiuxwe2
  4531. + ;;
  4532. + h8300hms)
  4533. + basic_machine=h8300-hitachi
  4534. + os=-hms
  4535. + ;;
  4536. + h8300xray)
  4537. + basic_machine=h8300-hitachi
  4538. + os=-xray
  4539. + ;;
  4540. + h8500hms)
  4541. + basic_machine=h8500-hitachi
  4542. + os=-hms
  4543. + ;;
  4544. + harris)
  4545. + basic_machine=m88k-harris
  4546. + os=-sysv3
  4547. + ;;
  4548. + hp300-*)
  4549. + basic_machine=m68k-hp
  4550. + ;;
  4551. + hp300bsd)
  4552. + basic_machine=m68k-hp
  4553. + os=-bsd
  4554. + ;;
  4555. + hp300hpux)
  4556. + basic_machine=m68k-hp
  4557. + os=-hpux
  4558. + ;;
  4559. + hp3k9[0-9][0-9] | hp9[0-9][0-9])
  4560. + basic_machine=hppa1.0-hp
  4561. + ;;
  4562. + hp9k2[0-9][0-9] | hp9k31[0-9])
  4563. + basic_machine=m68000-hp
  4564. + ;;
  4565. + hp9k3[2-9][0-9])
  4566. + basic_machine=m68k-hp
  4567. + ;;
  4568. + hp9k6[0-9][0-9] | hp6[0-9][0-9])
  4569. + basic_machine=hppa1.0-hp
  4570. + ;;
  4571. + hp9k7[0-79][0-9] | hp7[0-79][0-9])
  4572. + basic_machine=hppa1.1-hp
  4573. + ;;
  4574. + hp9k78[0-9] | hp78[0-9])
  4575. + # FIXME: really hppa2.0-hp
  4576. + basic_machine=hppa1.1-hp
  4577. + ;;
  4578. + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
  4579. + # FIXME: really hppa2.0-hp
  4580. + basic_machine=hppa1.1-hp
  4581. + ;;
  4582. + hp9k8[0-9][13679] | hp8[0-9][13679])
  4583. + basic_machine=hppa1.1-hp
  4584. + ;;
  4585. + hp9k8[0-9][0-9] | hp8[0-9][0-9])
  4586. + basic_machine=hppa1.0-hp
  4587. + ;;
  4588. + hppaosf)
  4589. + basic_machine=hppa1.1-hp
  4590. + os=-osf
  4591. + ;;
  4592. + hppro)
  4593. + basic_machine=hppa1.1-hp
  4594. + os=-proelf
  4595. + ;;
  4596. + i370-ibm* | ibm*)
  4597. + basic_machine=i370-ibm
  4598. + ;;
  4599. + i*86v32)
  4600. + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
  4601. + os=-sysv32
  4602. + ;;
  4603. + i*86v4*)
  4604. + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
  4605. + os=-sysv4
  4606. + ;;
  4607. + i*86v)
  4608. + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
  4609. + os=-sysv
  4610. + ;;
  4611. + i*86sol2)
  4612. + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
  4613. + os=-solaris2
  4614. + ;;
  4615. + i386mach)
  4616. + basic_machine=i386-mach
  4617. + os=-mach
  4618. + ;;
  4619. + vsta)
  4620. + basic_machine=i386-unknown
  4621. + os=-vsta
  4622. + ;;
  4623. + iris | iris4d)
  4624. + basic_machine=mips-sgi
  4625. + case $os in
  4626. + -irix*)
  4627. + ;;
  4628. + *)
  4629. + os=-irix4
  4630. + ;;
  4631. + esac
  4632. + ;;
  4633. + isi68 | isi)
  4634. + basic_machine=m68k-isi
  4635. + os=-sysv
  4636. + ;;
  4637. + leon-*|leon[3-9]-*)
  4638. + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
  4639. + ;;
  4640. + m68knommu)
  4641. + basic_machine=m68k-unknown
  4642. + os=-linux
  4643. + ;;
  4644. + m68knommu-*)
  4645. + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4646. + os=-linux
  4647. + ;;
  4648. + magnum | m3230)
  4649. + basic_machine=mips-mips
  4650. + os=-sysv
  4651. + ;;
  4652. + merlin)
  4653. + basic_machine=ns32k-utek
  4654. + os=-sysv
  4655. + ;;
  4656. + microblaze*)
  4657. + basic_machine=microblaze-xilinx
  4658. + ;;
  4659. + mingw64)
  4660. + basic_machine=x86_64-pc
  4661. + os=-mingw64
  4662. + ;;
  4663. + mingw32)
  4664. + basic_machine=i686-pc
  4665. + os=-mingw32
  4666. + ;;
  4667. + mingw32ce)
  4668. + basic_machine=arm-unknown
  4669. + os=-mingw32ce
  4670. + ;;
  4671. + miniframe)
  4672. + basic_machine=m68000-convergent
  4673. + ;;
  4674. + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
  4675. + basic_machine=m68k-atari
  4676. + os=-mint
  4677. + ;;
  4678. + mips3*-*)
  4679. + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
  4680. + ;;
  4681. + mips3*)
  4682. + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
  4683. + ;;
  4684. + monitor)
  4685. + basic_machine=m68k-rom68k
  4686. + os=-coff
  4687. + ;;
  4688. + morphos)
  4689. + basic_machine=powerpc-unknown
  4690. + os=-morphos
  4691. + ;;
  4692. + moxiebox)
  4693. + basic_machine=moxie-unknown
  4694. + os=-moxiebox
  4695. + ;;
  4696. + msdos)
  4697. + basic_machine=i386-pc
  4698. + os=-msdos
  4699. + ;;
  4700. + ms1-*)
  4701. + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
  4702. + ;;
  4703. + msys)
  4704. + basic_machine=i686-pc
  4705. + os=-msys
  4706. + ;;
  4707. + mvs)
  4708. + basic_machine=i370-ibm
  4709. + os=-mvs
  4710. + ;;
  4711. + nacl)
  4712. + basic_machine=le32-unknown
  4713. + os=-nacl
  4714. + ;;
  4715. + ncr3000)
  4716. + basic_machine=i486-ncr
  4717. + os=-sysv4
  4718. + ;;
  4719. + netbsd386)
  4720. + basic_machine=i386-unknown
  4721. + os=-netbsd
  4722. + ;;
  4723. + netwinder)
  4724. + basic_machine=armv4l-rebel
  4725. + os=-linux
  4726. + ;;
  4727. + news | news700 | news800 | news900)
  4728. + basic_machine=m68k-sony
  4729. + os=-newsos
  4730. + ;;
  4731. + news1000)
  4732. + basic_machine=m68030-sony
  4733. + os=-newsos
  4734. + ;;
  4735. + news-3600 | risc-news)
  4736. + basic_machine=mips-sony
  4737. + os=-newsos
  4738. + ;;
  4739. + necv70)
  4740. + basic_machine=v70-nec
  4741. + os=-sysv
  4742. + ;;
  4743. + next | m*-next)
  4744. + basic_machine=m68k-next
  4745. + case $os in
  4746. + -nextstep* )
  4747. + ;;
  4748. + -ns2*)
  4749. + os=-nextstep2
  4750. + ;;
  4751. + *)
  4752. + os=-nextstep3
  4753. + ;;
  4754. + esac
  4755. + ;;
  4756. + nh3000)
  4757. + basic_machine=m68k-harris
  4758. + os=-cxux
  4759. + ;;
  4760. + nh[45]000)
  4761. + basic_machine=m88k-harris
  4762. + os=-cxux
  4763. + ;;
  4764. + nindy960)
  4765. + basic_machine=i960-intel
  4766. + os=-nindy
  4767. + ;;
  4768. + mon960)
  4769. + basic_machine=i960-intel
  4770. + os=-mon960
  4771. + ;;
  4772. + nonstopux)
  4773. + basic_machine=mips-compaq
  4774. + os=-nonstopux
  4775. + ;;
  4776. + np1)
  4777. + basic_machine=np1-gould
  4778. + ;;
  4779. + neo-tandem)
  4780. + basic_machine=neo-tandem
  4781. + ;;
  4782. + nse-tandem)
  4783. + basic_machine=nse-tandem
  4784. + ;;
  4785. + nsr-tandem)
  4786. + basic_machine=nsr-tandem
  4787. + ;;
  4788. + nsv-tandem)
  4789. + basic_machine=nsv-tandem
  4790. + ;;
  4791. + nsx-tandem)
  4792. + basic_machine=nsx-tandem
  4793. + ;;
  4794. + op50n-* | op60c-*)
  4795. + basic_machine=hppa1.1-oki
  4796. + os=-proelf
  4797. + ;;
  4798. + openrisc | openrisc-*)
  4799. + basic_machine=or32-unknown
  4800. + ;;
  4801. + os400)
  4802. + basic_machine=powerpc-ibm
  4803. + os=-os400
  4804. + ;;
  4805. + OSE68000 | ose68000)
  4806. + basic_machine=m68000-ericsson
  4807. + os=-ose
  4808. + ;;
  4809. + os68k)
  4810. + basic_machine=m68k-none
  4811. + os=-os68k
  4812. + ;;
  4813. + pa-hitachi)
  4814. + basic_machine=hppa1.1-hitachi
  4815. + os=-hiuxwe2
  4816. + ;;
  4817. + paragon)
  4818. + basic_machine=i860-intel
  4819. + os=-osf
  4820. + ;;
  4821. + parisc)
  4822. + basic_machine=hppa-unknown
  4823. + os=-linux
  4824. + ;;
  4825. + parisc-*)
  4826. + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4827. + os=-linux
  4828. + ;;
  4829. + pbd)
  4830. + basic_machine=sparc-tti
  4831. + ;;
  4832. + pbb)
  4833. + basic_machine=m68k-tti
  4834. + ;;
  4835. + pc532 | pc532-*)
  4836. + basic_machine=ns32k-pc532
  4837. + ;;
  4838. + pc98)
  4839. + basic_machine=i386-pc
  4840. + ;;
  4841. + pc98-*)
  4842. + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4843. + ;;
  4844. + pentium | p5 | k5 | k6 | nexgen | viac3)
  4845. + basic_machine=i586-pc
  4846. + ;;
  4847. + pentiumpro | p6 | 6x86 | athlon | athlon_*)
  4848. + basic_machine=i686-pc
  4849. + ;;
  4850. + pentiumii | pentium2 | pentiumiii | pentium3)
  4851. + basic_machine=i686-pc
  4852. + ;;
  4853. + pentium4)
  4854. + basic_machine=i786-pc
  4855. + ;;
  4856. + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
  4857. + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4858. + ;;
  4859. + pentiumpro-* | p6-* | 6x86-* | athlon-*)
  4860. + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4861. + ;;
  4862. + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
  4863. + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4864. + ;;
  4865. + pentium4-*)
  4866. + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4867. + ;;
  4868. + pn)
  4869. + basic_machine=pn-gould
  4870. + ;;
  4871. + power) basic_machine=power-ibm
  4872. + ;;
  4873. + ppc | ppcbe) basic_machine=powerpc-unknown
  4874. + ;;
  4875. + ppc-* | ppcbe-*)
  4876. + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4877. + ;;
  4878. + ppcle | powerpclittle)
  4879. + basic_machine=powerpcle-unknown
  4880. + ;;
  4881. + ppcle-* | powerpclittle-*)
  4882. + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4883. + ;;
  4884. + ppc64) basic_machine=powerpc64-unknown
  4885. + ;;
  4886. + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4887. + ;;
  4888. + ppc64le | powerpc64little)
  4889. + basic_machine=powerpc64le-unknown
  4890. + ;;
  4891. + ppc64le-* | powerpc64little-*)
  4892. + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4893. + ;;
  4894. + ps2)
  4895. + basic_machine=i386-ibm
  4896. + ;;
  4897. + pw32)
  4898. + basic_machine=i586-unknown
  4899. + os=-pw32
  4900. + ;;
  4901. + rdos | rdos64)
  4902. + basic_machine=x86_64-pc
  4903. + os=-rdos
  4904. + ;;
  4905. + rdos32)
  4906. + basic_machine=i386-pc
  4907. + os=-rdos
  4908. + ;;
  4909. + rom68k)
  4910. + basic_machine=m68k-rom68k
  4911. + os=-coff
  4912. + ;;
  4913. + rm[46]00)
  4914. + basic_machine=mips-siemens
  4915. + ;;
  4916. + rtpc | rtpc-*)
  4917. + basic_machine=romp-ibm
  4918. + ;;
  4919. + s390 | s390-*)
  4920. + basic_machine=s390-ibm
  4921. + ;;
  4922. + s390x | s390x-*)
  4923. + basic_machine=s390x-ibm
  4924. + ;;
  4925. + sa29200)
  4926. + basic_machine=a29k-amd
  4927. + os=-udi
  4928. + ;;
  4929. + sb1)
  4930. + basic_machine=mipsisa64sb1-unknown
  4931. + ;;
  4932. + sb1el)
  4933. + basic_machine=mipsisa64sb1el-unknown
  4934. + ;;
  4935. + sde)
  4936. + basic_machine=mipsisa32-sde
  4937. + os=-elf
  4938. + ;;
  4939. + sei)
  4940. + basic_machine=mips-sei
  4941. + os=-seiux
  4942. + ;;
  4943. + sequent)
  4944. + basic_machine=i386-sequent
  4945. + ;;
  4946. + sh5el)
  4947. + basic_machine=sh5le-unknown
  4948. + ;;
  4949. + simso-wrs)
  4950. + basic_machine=sparclite-wrs
  4951. + os=-vxworks
  4952. + ;;
  4953. + sps7)
  4954. + basic_machine=m68k-bull
  4955. + os=-sysv2
  4956. + ;;
  4957. + spur)
  4958. + basic_machine=spur-unknown
  4959. + ;;
  4960. + st2000)
  4961. + basic_machine=m68k-tandem
  4962. + ;;
  4963. + stratus)
  4964. + basic_machine=i860-stratus
  4965. + os=-sysv4
  4966. + ;;
  4967. + strongarm-* | thumb-*)
  4968. + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
  4969. + ;;
  4970. + sun2)
  4971. + basic_machine=m68000-sun
  4972. + ;;
  4973. + sun2os3)
  4974. + basic_machine=m68000-sun
  4975. + os=-sunos3
  4976. + ;;
  4977. + sun2os4)
  4978. + basic_machine=m68000-sun
  4979. + os=-sunos4
  4980. + ;;
  4981. + sun3os3)
  4982. + basic_machine=m68k-sun
  4983. + os=-sunos3
  4984. + ;;
  4985. + sun3os4)
  4986. + basic_machine=m68k-sun
  4987. + os=-sunos4
  4988. + ;;
  4989. + sun4os3)
  4990. + basic_machine=sparc-sun
  4991. + os=-sunos3
  4992. + ;;
  4993. + sun4os4)
  4994. + basic_machine=sparc-sun
  4995. + os=-sunos4
  4996. + ;;
  4997. + sun4sol2)
  4998. + basic_machine=sparc-sun
  4999. + os=-solaris2
  5000. + ;;
  5001. + sun3 | sun3-*)
  5002. + basic_machine=m68k-sun
  5003. + ;;
  5004. + sun4)
  5005. + basic_machine=sparc-sun
  5006. + ;;
  5007. + sun386 | sun386i | roadrunner)
  5008. + basic_machine=i386-sun
  5009. + ;;
  5010. + sv1)
  5011. + basic_machine=sv1-cray
  5012. + os=-unicos
  5013. + ;;
  5014. + symmetry)
  5015. + basic_machine=i386-sequent
  5016. + os=-dynix
  5017. + ;;
  5018. + t3e)
  5019. + basic_machine=alphaev5-cray
  5020. + os=-unicos
  5021. + ;;
  5022. + t90)
  5023. + basic_machine=t90-cray
  5024. + os=-unicos
  5025. + ;;
  5026. + tile*)
  5027. + basic_machine=$basic_machine-unknown
  5028. + os=-linux-gnu
  5029. + ;;
  5030. + tx39)
  5031. + basic_machine=mipstx39-unknown
  5032. + ;;
  5033. + tx39el)
  5034. + basic_machine=mipstx39el-unknown
  5035. + ;;
  5036. + toad1)
  5037. + basic_machine=pdp10-xkl
  5038. + os=-tops20
  5039. + ;;
  5040. + tower | tower-32)
  5041. + basic_machine=m68k-ncr
  5042. + ;;
  5043. + tpf)
  5044. + basic_machine=s390x-ibm
  5045. + os=-tpf
  5046. + ;;
  5047. + udi29k)
  5048. + basic_machine=a29k-amd
  5049. + os=-udi
  5050. + ;;
  5051. + ultra3)
  5052. + basic_machine=a29k-nyu
  5053. + os=-sym1
  5054. + ;;
  5055. + v810 | necv810)
  5056. + basic_machine=v810-nec
  5057. + os=-none
  5058. + ;;
  5059. + vaxv)
  5060. + basic_machine=vax-dec
  5061. + os=-sysv
  5062. + ;;
  5063. + vms)
  5064. + basic_machine=vax-dec
  5065. + os=-vms
  5066. + ;;
  5067. + vpp*|vx|vx-*)
  5068. + basic_machine=f301-fujitsu
  5069. + ;;
  5070. + vxworks960)
  5071. + basic_machine=i960-wrs
  5072. + os=-vxworks
  5073. + ;;
  5074. + vxworks68)
  5075. + basic_machine=m68k-wrs
  5076. + os=-vxworks
  5077. + ;;
  5078. + vxworks29k)
  5079. + basic_machine=a29k-wrs
  5080. + os=-vxworks
  5081. + ;;
  5082. + w65*)
  5083. + basic_machine=w65-wdc
  5084. + os=-none
  5085. + ;;
  5086. + w89k-*)
  5087. + basic_machine=hppa1.1-winbond
  5088. + os=-proelf
  5089. + ;;
  5090. + x64)
  5091. + basic_machine=x86_64-pc
  5092. + ;;
  5093. + xbox)
  5094. + basic_machine=i686-pc
  5095. + os=-mingw32
  5096. + ;;
  5097. + xps | xps100)
  5098. + basic_machine=xps100-honeywell
  5099. + ;;
  5100. + xscale-* | xscalee[bl]-*)
  5101. + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
  5102. + ;;
  5103. + ymp)
  5104. + basic_machine=ymp-cray
  5105. + os=-unicos
  5106. + ;;
  5107. + none)
  5108. + basic_machine=none-none
  5109. + os=-none
  5110. + ;;
  5111. +
  5112. +# Here we handle the default manufacturer of certain CPU types. It is in
  5113. +# some cases the only manufacturer, in others, it is the most popular.
  5114. + w89k)
  5115. + basic_machine=hppa1.1-winbond
  5116. + ;;
  5117. + op50n)
  5118. + basic_machine=hppa1.1-oki
  5119. + ;;
  5120. + op60c)
  5121. + basic_machine=hppa1.1-oki
  5122. + ;;
  5123. + romp)
  5124. + basic_machine=romp-ibm
  5125. + ;;
  5126. + mmix)
  5127. + basic_machine=mmix-knuth
  5128. + ;;
  5129. + rs6000)
  5130. + basic_machine=rs6000-ibm
  5131. + ;;
  5132. + vax)
  5133. + basic_machine=vax-dec
  5134. + ;;
  5135. + pdp11)
  5136. + basic_machine=pdp11-dec
  5137. + ;;
  5138. + we32k)
  5139. + basic_machine=we32k-att
  5140. + ;;
  5141. + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
  5142. + basic_machine=sh-unknown
  5143. + ;;
  5144. + cydra)
  5145. + basic_machine=cydra-cydrome
  5146. + ;;
  5147. + orion)
  5148. + basic_machine=orion-highlevel
  5149. + ;;
  5150. + orion105)
  5151. + basic_machine=clipper-highlevel
  5152. + ;;
  5153. + mac | mpw | mac-mpw)
  5154. + basic_machine=m68k-apple
  5155. + ;;
  5156. + pmac | pmac-mpw)
  5157. + basic_machine=powerpc-apple
  5158. + ;;
  5159. + *-unknown)
  5160. + # Make sure to match an already-canonicalized machine name.
  5161. + ;;
  5162. + *)
  5163. + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
  5164. + exit 1
  5165. + ;;
  5166. +esac
  5167. +
  5168. +# Here we canonicalize certain aliases for manufacturers.
  5169. +case $basic_machine in
  5170. + *-digital*)
  5171. + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
  5172. + ;;
  5173. + *-commodore*)
  5174. + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
  5175. + ;;
  5176. + *)
  5177. + ;;
  5178. +esac
  5179. +
  5180. +# Decode manufacturer-specific aliases for certain operating systems.
  5181. +
  5182. +if [ x"$os" != x"" ]
  5183. +then
  5184. +case $os in
  5185. + # First match some system type aliases that might get confused
  5186. + # with valid system types.
  5187. + # -solaris* is a basic system type, with this one exception.
  5188. + -auroraux)
  5189. + os=-auroraux
  5190. + ;;
  5191. + -solaris1 | -solaris1.*)
  5192. + os=`echo $os | sed -e 's|solaris1|sunos4|'`
  5193. + ;;
  5194. + -solaris)
  5195. + os=-solaris2
  5196. + ;;
  5197. + -unixware*)
  5198. + os=-sysv4.2uw
  5199. + ;;
  5200. + -gnu/linux*)
  5201. + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  5202. + ;;
  5203. + # es1800 is here to avoid being matched by es* (a different OS)
  5204. + -es1800*)
  5205. + os=-ose
  5206. + ;;
  5207. + # Now accept the basic system types.
  5208. + # The portable systems comes first.
  5209. + # Each alternative MUST end in a * to match a version number.
  5210. + # -sysv* is not here because it comes later, after sysvr4.
  5211. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  5212. + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
  5213. + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
  5214. + | -sym* | -kopensolaris* | -plan9* \
  5215. + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  5216. + | -aos* | -aros* | -cloudabi* | -sortix* \
  5217. + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  5218. + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  5219. + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
  5220. + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
  5221. + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
  5222. + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  5223. + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  5224. + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  5225. + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
  5226. + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  5227. + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
  5228. + | -linux-newlib* | -linux-musl* | -linux-uclibc* \
  5229. + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
  5230. + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
  5231. + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  5232. + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
  5233. + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
  5234. + | -morphos* | -superux* | -rtmk* | -windiss* \
  5235. + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
  5236. + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
  5237. + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
  5238. + | -midnightbsd*)
  5239. + # Remember, each alternative MUST END IN *, to match a version number.
  5240. + ;;
  5241. + -qnx*)
  5242. + case $basic_machine in
  5243. + x86-* | i*86-*)
  5244. + ;;
  5245. + *)
  5246. + os=-nto$os
  5247. + ;;
  5248. + esac
  5249. + ;;
  5250. + -nto-qnx*)
  5251. + ;;
  5252. + -nto*)
  5253. + os=`echo $os | sed -e 's|nto|nto-qnx|'`
  5254. + ;;
  5255. + -sim | -xray | -os68k* | -v88r* \
  5256. + | -windows* | -osx | -abug | -netware* | -os9* \
  5257. + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
  5258. + ;;
  5259. + -mac*)
  5260. + os=`echo "$os" | sed -e 's|mac|macos|'`
  5261. + ;;
  5262. + -linux-dietlibc)
  5263. + os=-linux-dietlibc
  5264. + ;;
  5265. + -linux*)
  5266. + os=`echo $os | sed -e 's|linux|linux-gnu|'`
  5267. + ;;
  5268. + -sunos5*)
  5269. + os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
  5270. + ;;
  5271. + -sunos6*)
  5272. + os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
  5273. + ;;
  5274. + -opened*)
  5275. + os=-openedition
  5276. + ;;
  5277. + -os400*)
  5278. + os=-os400
  5279. + ;;
  5280. + -wince*)
  5281. + os=-wince
  5282. + ;;
  5283. + -utek*)
  5284. + os=-bsd
  5285. + ;;
  5286. + -dynix*)
  5287. + os=-bsd
  5288. + ;;
  5289. + -acis*)
  5290. + os=-aos
  5291. + ;;
  5292. + -atheos*)
  5293. + os=-atheos
  5294. + ;;
  5295. + -syllable*)
  5296. + os=-syllable
  5297. + ;;
  5298. + -386bsd)
  5299. + os=-bsd
  5300. + ;;
  5301. + -ctix* | -uts*)
  5302. + os=-sysv
  5303. + ;;
  5304. + -nova*)
  5305. + os=-rtmk-nova
  5306. + ;;
  5307. + -ns2)
  5308. + os=-nextstep2
  5309. + ;;
  5310. + -nsk*)
  5311. + os=-nsk
  5312. + ;;
  5313. + # Preserve the version number of sinix5.
  5314. + -sinix5.*)
  5315. + os=`echo $os | sed -e 's|sinix|sysv|'`
  5316. + ;;
  5317. + -sinix*)
  5318. + os=-sysv4
  5319. + ;;
  5320. + -tpf*)
  5321. + os=-tpf
  5322. + ;;
  5323. + -triton*)
  5324. + os=-sysv3
  5325. + ;;
  5326. + -oss*)
  5327. + os=-sysv3
  5328. + ;;
  5329. + -svr4*)
  5330. + os=-sysv4
  5331. + ;;
  5332. + -svr3)
  5333. + os=-sysv3
  5334. + ;;
  5335. + -sysvr4)
  5336. + os=-sysv4
  5337. + ;;
  5338. + # This must come after -sysvr4.
  5339. + -sysv*)
  5340. + ;;
  5341. + -ose*)
  5342. + os=-ose
  5343. + ;;
  5344. + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
  5345. + os=-mint
  5346. + ;;
  5347. + -zvmoe)
  5348. + os=-zvmoe
  5349. + ;;
  5350. + -dicos*)
  5351. + os=-dicos
  5352. + ;;
  5353. + -pikeos*)
  5354. + # Until real need of OS specific support for
  5355. + # particular features comes up, bare metal
  5356. + # configurations are quite functional.
  5357. + case $basic_machine in
  5358. + arm*)
  5359. + os=-eabi
  5360. + ;;
  5361. + *)
  5362. + os=-elf
  5363. + ;;
  5364. + esac
  5365. + ;;
  5366. + -nacl*)
  5367. + ;;
  5368. + -ios)
  5369. + ;;
  5370. + -none)
  5371. + ;;
  5372. + *)
  5373. + # Get rid of the `-' at the beginning of $os.
  5374. + os=`echo $os | sed 's/[^-]*-//'`
  5375. + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
  5376. + exit 1
  5377. + ;;
  5378. +esac
  5379. +else
  5380. +
  5381. +# Here we handle the default operating systems that come with various machines.
  5382. +# The value should be what the vendor currently ships out the door with their
  5383. +# machine or put another way, the most popular os provided with the machine.
  5384. +
  5385. +# Note that if you're going to try to match "-MANUFACTURER" here (say,
  5386. +# "-sun"), then you have to tell the case statement up towards the top
  5387. +# that MANUFACTURER isn't an operating system. Otherwise, code above
  5388. +# will signal an error saying that MANUFACTURER isn't an operating
  5389. +# system, and we'll never get to this point.
  5390. +
  5391. +case $basic_machine in
  5392. + score-*)
  5393. + os=-elf
  5394. + ;;
  5395. + spu-*)
  5396. + os=-elf
  5397. + ;;
  5398. + *-acorn)
  5399. + os=-riscix1.2
  5400. + ;;
  5401. + arm*-rebel)
  5402. + os=-linux
  5403. + ;;
  5404. + arm*-semi)
  5405. + os=-aout
  5406. + ;;
  5407. + c4x-* | tic4x-*)
  5408. + os=-coff
  5409. + ;;
  5410. + c8051-*)
  5411. + os=-elf
  5412. + ;;
  5413. + hexagon-*)
  5414. + os=-elf
  5415. + ;;
  5416. + tic54x-*)
  5417. + os=-coff
  5418. + ;;
  5419. + tic55x-*)
  5420. + os=-coff
  5421. + ;;
  5422. + tic6x-*)
  5423. + os=-coff
  5424. + ;;
  5425. + # This must come before the *-dec entry.
  5426. + pdp10-*)
  5427. + os=-tops20
  5428. + ;;
  5429. + pdp11-*)
  5430. + os=-none
  5431. + ;;
  5432. + *-dec | vax-*)
  5433. + os=-ultrix4.2
  5434. + ;;
  5435. + m68*-apollo)
  5436. + os=-domain
  5437. + ;;
  5438. + i386-sun)
  5439. + os=-sunos4.0.2
  5440. + ;;
  5441. + m68000-sun)
  5442. + os=-sunos3
  5443. + ;;
  5444. + m68*-cisco)
  5445. + os=-aout
  5446. + ;;
  5447. + mep-*)
  5448. + os=-elf
  5449. + ;;
  5450. + mips*-cisco)
  5451. + os=-elf
  5452. + ;;
  5453. + mips*-*)
  5454. + os=-elf
  5455. + ;;
  5456. + or32-*)
  5457. + os=-coff
  5458. + ;;
  5459. + *-tti) # must be before sparc entry or we get the wrong os.
  5460. + os=-sysv3
  5461. + ;;
  5462. + sparc-* | *-sun)
  5463. + os=-sunos4.1.1
  5464. + ;;
  5465. + pru-*)
  5466. + os=-elf
  5467. + ;;
  5468. + *-be)
  5469. + os=-beos
  5470. + ;;
  5471. + *-ibm)
  5472. + os=-aix
  5473. + ;;
  5474. + *-knuth)
  5475. + os=-mmixware
  5476. + ;;
  5477. + *-wec)
  5478. + os=-proelf
  5479. + ;;
  5480. + *-winbond)
  5481. + os=-proelf
  5482. + ;;
  5483. + *-oki)
  5484. + os=-proelf
  5485. + ;;
  5486. + *-hp)
  5487. + os=-hpux
  5488. + ;;
  5489. + *-hitachi)
  5490. + os=-hiux
  5491. + ;;
  5492. + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  5493. + os=-sysv
  5494. + ;;
  5495. + *-cbm)
  5496. + os=-amigaos
  5497. + ;;
  5498. + *-dg)
  5499. + os=-dgux
  5500. + ;;
  5501. + *-dolphin)
  5502. + os=-sysv3
  5503. + ;;
  5504. + m68k-ccur)
  5505. + os=-rtu
  5506. + ;;
  5507. + m88k-omron*)
  5508. + os=-luna
  5509. + ;;
  5510. + *-next)
  5511. + os=-nextstep
  5512. + ;;
  5513. + *-sequent)
  5514. + os=-ptx
  5515. + ;;
  5516. + *-crds)
  5517. + os=-unos
  5518. + ;;
  5519. + *-ns)
  5520. + os=-genix
  5521. + ;;
  5522. + i370-*)
  5523. + os=-mvs
  5524. + ;;
  5525. + *-gould)
  5526. + os=-sysv
  5527. + ;;
  5528. + *-highlevel)
  5529. + os=-bsd
  5530. + ;;
  5531. + *-encore)
  5532. + os=-bsd
  5533. + ;;
  5534. + *-sgi)
  5535. + os=-irix
  5536. + ;;
  5537. + *-siemens)
  5538. + os=-sysv4
  5539. + ;;
  5540. + *-masscomp)
  5541. + os=-rtu
  5542. + ;;
  5543. + f30[01]-fujitsu | f700-fujitsu)
  5544. + os=-uxpv
  5545. + ;;
  5546. + *-rom68k)
  5547. + os=-coff
  5548. + ;;
  5549. + *-*bug)
  5550. + os=-coff
  5551. + ;;
  5552. + *-apple)
  5553. + os=-macos
  5554. + ;;
  5555. + *-atari*)
  5556. + os=-mint
  5557. + ;;
  5558. + *)
  5559. + os=-none
  5560. + ;;
  5561. +esac
  5562. +fi
  5563. +
  5564. +# Here we handle the case where we know the os, and the CPU type, but not the
  5565. +# manufacturer. We pick the logical manufacturer.
  5566. +vendor=unknown
  5567. +case $basic_machine in
  5568. + *-unknown)
  5569. + case $os in
  5570. + -riscix*)
  5571. + vendor=acorn
  5572. + ;;
  5573. + -sunos*)
  5574. + vendor=sun
  5575. + ;;
  5576. + -cnk*|-aix*)
  5577. + vendor=ibm
  5578. + ;;
  5579. + -beos*)
  5580. + vendor=be
  5581. + ;;
  5582. + -hpux*)
  5583. + vendor=hp
  5584. + ;;
  5585. + -mpeix*)
  5586. + vendor=hp
  5587. + ;;
  5588. + -hiux*)
  5589. + vendor=hitachi
  5590. + ;;
  5591. + -unos*)
  5592. + vendor=crds
  5593. + ;;
  5594. + -dgux*)
  5595. + vendor=dg
  5596. + ;;
  5597. + -luna*)
  5598. + vendor=omron
  5599. + ;;
  5600. + -genix*)
  5601. + vendor=ns
  5602. + ;;
  5603. + -mvs* | -opened*)
  5604. + vendor=ibm
  5605. + ;;
  5606. + -os400*)
  5607. + vendor=ibm
  5608. + ;;
  5609. + -ptx*)
  5610. + vendor=sequent
  5611. + ;;
  5612. + -tpf*)
  5613. + vendor=ibm
  5614. + ;;
  5615. + -vxsim* | -vxworks* | -windiss*)
  5616. + vendor=wrs
  5617. + ;;
  5618. + -aux*)
  5619. + vendor=apple
  5620. + ;;
  5621. + -hms*)
  5622. + vendor=hitachi
  5623. + ;;
  5624. + -mpw* | -macos*)
  5625. + vendor=apple
  5626. + ;;
  5627. + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
  5628. + vendor=atari
  5629. + ;;
  5630. + -vos*)
  5631. + vendor=stratus
  5632. + ;;
  5633. + esac
  5634. + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
  5635. + ;;
  5636. +esac
  5637. +
  5638. +echo "$basic_machine$os"
  5639. +exit
  5640. +
  5641. +# Local variables:
  5642. +# eval: (add-hook 'write-file-functions 'time-stamp)
  5643. +# time-stamp-start: "timestamp='"
  5644. +# time-stamp-format: "%:y-%02m-%02d"
  5645. +# time-stamp-end: "'"
  5646. +# End:
  5647. --- /dev/null
  5648. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/depcomp
  5649. @@ -0,0 +1,791 @@
  5650. +#! /bin/sh
  5651. +# depcomp - compile a program generating dependencies as side-effects
  5652. +
  5653. +scriptversion=2016-01-11.22; # UTC
  5654. +
  5655. +# Copyright (C) 1999-2017 Free Software Foundation, Inc.
  5656. +
  5657. +# This program is free software; you can redistribute it and/or modify
  5658. +# it under the terms of the GNU General Public License as published by
  5659. +# the Free Software Foundation; either version 2, or (at your option)
  5660. +# any later version.
  5661. +
  5662. +# This program is distributed in the hope that it will be useful,
  5663. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  5664. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  5665. +# GNU General Public License for more details.
  5666. +
  5667. +# You should have received a copy of the GNU General Public License
  5668. +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  5669. +
  5670. +# As a special exception to the GNU General Public License, if you
  5671. +# distribute this file as part of a program that contains a
  5672. +# configuration script generated by Autoconf, you may include it under
  5673. +# the same distribution terms that you use for the rest of that program.
  5674. +
  5675. +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
  5676. +
  5677. +case $1 in
  5678. + '')
  5679. + echo "$0: No command. Try '$0 --help' for more information." 1>&2
  5680. + exit 1;
  5681. + ;;
  5682. + -h | --h*)
  5683. + cat <<\EOF
  5684. +Usage: depcomp [--help] [--version] PROGRAM [ARGS]
  5685. +
  5686. +Run PROGRAMS ARGS to compile a file, generating dependencies
  5687. +as side-effects.
  5688. +
  5689. +Environment variables:
  5690. + depmode Dependency tracking mode.
  5691. + source Source file read by 'PROGRAMS ARGS'.
  5692. + object Object file output by 'PROGRAMS ARGS'.
  5693. + DEPDIR directory where to store dependencies.
  5694. + depfile Dependency file to output.
  5695. + tmpdepfile Temporary file to use when outputting dependencies.
  5696. + libtool Whether libtool is used (yes/no).
  5697. +
  5698. +Report bugs to <bug-automake@gnu.org>.
  5699. +EOF
  5700. + exit $?
  5701. + ;;
  5702. + -v | --v*)
  5703. + echo "depcomp $scriptversion"
  5704. + exit $?
  5705. + ;;
  5706. +esac
  5707. +
  5708. +# Get the directory component of the given path, and save it in the
  5709. +# global variables '$dir'. Note that this directory component will
  5710. +# be either empty or ending with a '/' character. This is deliberate.
  5711. +set_dir_from ()
  5712. +{
  5713. + case $1 in
  5714. + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
  5715. + *) dir=;;
  5716. + esac
  5717. +}
  5718. +
  5719. +# Get the suffix-stripped basename of the given path, and save it the
  5720. +# global variable '$base'.
  5721. +set_base_from ()
  5722. +{
  5723. + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
  5724. +}
  5725. +
  5726. +# If no dependency file was actually created by the compiler invocation,
  5727. +# we still have to create a dummy depfile, to avoid errors with the
  5728. +# Makefile "include basename.Plo" scheme.
  5729. +make_dummy_depfile ()
  5730. +{
  5731. + echo "#dummy" > "$depfile"
  5732. +}
  5733. +
  5734. +# Factor out some common post-processing of the generated depfile.
  5735. +# Requires the auxiliary global variable '$tmpdepfile' to be set.
  5736. +aix_post_process_depfile ()
  5737. +{
  5738. + # If the compiler actually managed to produce a dependency file,
  5739. + # post-process it.
  5740. + if test -f "$tmpdepfile"; then
  5741. + # Each line is of the form 'foo.o: dependency.h'.
  5742. + # Do two passes, one to just change these to
  5743. + # $object: dependency.h
  5744. + # and one to simply output
  5745. + # dependency.h:
  5746. + # which is needed to avoid the deleted-header problem.
  5747. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
  5748. + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
  5749. + } > "$depfile"
  5750. + rm -f "$tmpdepfile"
  5751. + else
  5752. + make_dummy_depfile
  5753. + fi
  5754. +}
  5755. +
  5756. +# A tabulation character.
  5757. +tab=' '
  5758. +# A newline character.
  5759. +nl='
  5760. +'
  5761. +# Character ranges might be problematic outside the C locale.
  5762. +# These definitions help.
  5763. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
  5764. +lower=abcdefghijklmnopqrstuvwxyz
  5765. +digits=0123456789
  5766. +alpha=${upper}${lower}
  5767. +
  5768. +if test -z "$depmode" || test -z "$source" || test -z "$object"; then
  5769. + echo "depcomp: Variables source, object and depmode must be set" 1>&2
  5770. + exit 1
  5771. +fi
  5772. +
  5773. +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
  5774. +depfile=${depfile-`echo "$object" |
  5775. + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
  5776. +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
  5777. +
  5778. +rm -f "$tmpdepfile"
  5779. +
  5780. +# Avoid interferences from the environment.
  5781. +gccflag= dashmflag=
  5782. +
  5783. +# Some modes work just like other modes, but use different flags. We
  5784. +# parameterize here, but still list the modes in the big case below,
  5785. +# to make depend.m4 easier to write. Note that we *cannot* use a case
  5786. +# here, because this file can only contain one case statement.
  5787. +if test "$depmode" = hp; then
  5788. + # HP compiler uses -M and no extra arg.
  5789. + gccflag=-M
  5790. + depmode=gcc
  5791. +fi
  5792. +
  5793. +if test "$depmode" = dashXmstdout; then
  5794. + # This is just like dashmstdout with a different argument.
  5795. + dashmflag=-xM
  5796. + depmode=dashmstdout
  5797. +fi
  5798. +
  5799. +cygpath_u="cygpath -u -f -"
  5800. +if test "$depmode" = msvcmsys; then
  5801. + # This is just like msvisualcpp but w/o cygpath translation.
  5802. + # Just convert the backslash-escaped backslashes to single forward
  5803. + # slashes to satisfy depend.m4
  5804. + cygpath_u='sed s,\\\\,/,g'
  5805. + depmode=msvisualcpp
  5806. +fi
  5807. +
  5808. +if test "$depmode" = msvc7msys; then
  5809. + # This is just like msvc7 but w/o cygpath translation.
  5810. + # Just convert the backslash-escaped backslashes to single forward
  5811. + # slashes to satisfy depend.m4
  5812. + cygpath_u='sed s,\\\\,/,g'
  5813. + depmode=msvc7
  5814. +fi
  5815. +
  5816. +if test "$depmode" = xlc; then
  5817. + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
  5818. + gccflag=-qmakedep=gcc,-MF
  5819. + depmode=gcc
  5820. +fi
  5821. +
  5822. +case "$depmode" in
  5823. +gcc3)
  5824. +## gcc 3 implements dependency tracking that does exactly what
  5825. +## we want. Yay! Note: for some reason libtool 1.4 doesn't like
  5826. +## it if -MD -MP comes after the -MF stuff. Hmm.
  5827. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon
  5828. +## the command line argument order; so add the flags where they
  5829. +## appear in depend2.am. Note that the slowdown incurred here
  5830. +## affects only configure: in makefiles, %FASTDEP% shortcuts this.
  5831. + for arg
  5832. + do
  5833. + case $arg in
  5834. + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
  5835. + *) set fnord "$@" "$arg" ;;
  5836. + esac
  5837. + shift # fnord
  5838. + shift # $arg
  5839. + done
  5840. + "$@"
  5841. + stat=$?
  5842. + if test $stat -ne 0; then
  5843. + rm -f "$tmpdepfile"
  5844. + exit $stat
  5845. + fi
  5846. + mv "$tmpdepfile" "$depfile"
  5847. + ;;
  5848. +
  5849. +gcc)
  5850. +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
  5851. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
  5852. +## (see the conditional assignment to $gccflag above).
  5853. +## There are various ways to get dependency output from gcc. Here's
  5854. +## why we pick this rather obscure method:
  5855. +## - Don't want to use -MD because we'd like the dependencies to end
  5856. +## up in a subdir. Having to rename by hand is ugly.
  5857. +## (We might end up doing this anyway to support other compilers.)
  5858. +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
  5859. +## -MM, not -M (despite what the docs say). Also, it might not be
  5860. +## supported by the other compilers which use the 'gcc' depmode.
  5861. +## - Using -M directly means running the compiler twice (even worse
  5862. +## than renaming).
  5863. + if test -z "$gccflag"; then
  5864. + gccflag=-MD,
  5865. + fi
  5866. + "$@" -Wp,"$gccflag$tmpdepfile"
  5867. + stat=$?
  5868. + if test $stat -ne 0; then
  5869. + rm -f "$tmpdepfile"
  5870. + exit $stat
  5871. + fi
  5872. + rm -f "$depfile"
  5873. + echo "$object : \\" > "$depfile"
  5874. + # The second -e expression handles DOS-style file names with drive
  5875. + # letters.
  5876. + sed -e 's/^[^:]*: / /' \
  5877. + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
  5878. +## This next piece of magic avoids the "deleted header file" problem.
  5879. +## The problem is that when a header file which appears in a .P file
  5880. +## is deleted, the dependency causes make to die (because there is
  5881. +## typically no way to rebuild the header). We avoid this by adding
  5882. +## dummy dependencies for each header file. Too bad gcc doesn't do
  5883. +## this for us directly.
  5884. +## Some versions of gcc put a space before the ':'. On the theory
  5885. +## that the space means something, we add a space to the output as
  5886. +## well. hp depmode also adds that space, but also prefixes the VPATH
  5887. +## to the object. Take care to not repeat it in the output.
  5888. +## Some versions of the HPUX 10.20 sed can't process this invocation
  5889. +## correctly. Breaking it into two sed invocations is a workaround.
  5890. + tr ' ' "$nl" < "$tmpdepfile" \
  5891. + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
  5892. + | sed -e 's/$/ :/' >> "$depfile"
  5893. + rm -f "$tmpdepfile"
  5894. + ;;
  5895. +
  5896. +hp)
  5897. + # This case exists only to let depend.m4 do its work. It works by
  5898. + # looking at the text of this script. This case will never be run,
  5899. + # since it is checked for above.
  5900. + exit 1
  5901. + ;;
  5902. +
  5903. +sgi)
  5904. + if test "$libtool" = yes; then
  5905. + "$@" "-Wp,-MDupdate,$tmpdepfile"
  5906. + else
  5907. + "$@" -MDupdate "$tmpdepfile"
  5908. + fi
  5909. + stat=$?
  5910. + if test $stat -ne 0; then
  5911. + rm -f "$tmpdepfile"
  5912. + exit $stat
  5913. + fi
  5914. + rm -f "$depfile"
  5915. +
  5916. + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
  5917. + echo "$object : \\" > "$depfile"
  5918. + # Clip off the initial element (the dependent). Don't try to be
  5919. + # clever and replace this with sed code, as IRIX sed won't handle
  5920. + # lines with more than a fixed number of characters (4096 in
  5921. + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
  5922. + # the IRIX cc adds comments like '#:fec' to the end of the
  5923. + # dependency line.
  5924. + tr ' ' "$nl" < "$tmpdepfile" \
  5925. + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
  5926. + | tr "$nl" ' ' >> "$depfile"
  5927. + echo >> "$depfile"
  5928. + # The second pass generates a dummy entry for each header file.
  5929. + tr ' ' "$nl" < "$tmpdepfile" \
  5930. + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
  5931. + >> "$depfile"
  5932. + else
  5933. + make_dummy_depfile
  5934. + fi
  5935. + rm -f "$tmpdepfile"
  5936. + ;;
  5937. +
  5938. +xlc)
  5939. + # This case exists only to let depend.m4 do its work. It works by
  5940. + # looking at the text of this script. This case will never be run,
  5941. + # since it is checked for above.
  5942. + exit 1
  5943. + ;;
  5944. +
  5945. +aix)
  5946. + # The C for AIX Compiler uses -M and outputs the dependencies
  5947. + # in a .u file. In older versions, this file always lives in the
  5948. + # current directory. Also, the AIX compiler puts '$object:' at the
  5949. + # start of each line; $object doesn't have directory information.
  5950. + # Version 6 uses the directory in both cases.
  5951. + set_dir_from "$object"
  5952. + set_base_from "$object"
  5953. + if test "$libtool" = yes; then
  5954. + tmpdepfile1=$dir$base.u
  5955. + tmpdepfile2=$base.u
  5956. + tmpdepfile3=$dir.libs/$base.u
  5957. + "$@" -Wc,-M
  5958. + else
  5959. + tmpdepfile1=$dir$base.u
  5960. + tmpdepfile2=$dir$base.u
  5961. + tmpdepfile3=$dir$base.u
  5962. + "$@" -M
  5963. + fi
  5964. + stat=$?
  5965. + if test $stat -ne 0; then
  5966. + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  5967. + exit $stat
  5968. + fi
  5969. +
  5970. + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  5971. + do
  5972. + test -f "$tmpdepfile" && break
  5973. + done
  5974. + aix_post_process_depfile
  5975. + ;;
  5976. +
  5977. +tcc)
  5978. + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
  5979. + # FIXME: That version still under development at the moment of writing.
  5980. + # Make that this statement remains true also for stable, released
  5981. + # versions.
  5982. + # It will wrap lines (doesn't matter whether long or short) with a
  5983. + # trailing '\', as in:
  5984. + #
  5985. + # foo.o : \
  5986. + # foo.c \
  5987. + # foo.h \
  5988. + #
  5989. + # It will put a trailing '\' even on the last line, and will use leading
  5990. + # spaces rather than leading tabs (at least since its commit 0394caf7
  5991. + # "Emit spaces for -MD").
  5992. + "$@" -MD -MF "$tmpdepfile"
  5993. + stat=$?
  5994. + if test $stat -ne 0; then
  5995. + rm -f "$tmpdepfile"
  5996. + exit $stat
  5997. + fi
  5998. + rm -f "$depfile"
  5999. + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
  6000. + # We have to change lines of the first kind to '$object: \'.
  6001. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
  6002. + # And for each line of the second kind, we have to emit a 'dep.h:'
  6003. + # dummy dependency, to avoid the deleted-header problem.
  6004. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
  6005. + rm -f "$tmpdepfile"
  6006. + ;;
  6007. +
  6008. +## The order of this option in the case statement is important, since the
  6009. +## shell code in configure will try each of these formats in the order
  6010. +## listed in this file. A plain '-MD' option would be understood by many
  6011. +## compilers, so we must ensure this comes after the gcc and icc options.
  6012. +pgcc)
  6013. + # Portland's C compiler understands '-MD'.
  6014. + # Will always output deps to 'file.d' where file is the root name of the
  6015. + # source file under compilation, even if file resides in a subdirectory.
  6016. + # The object file name does not affect the name of the '.d' file.
  6017. + # pgcc 10.2 will output
  6018. + # foo.o: sub/foo.c sub/foo.h
  6019. + # and will wrap long lines using '\' :
  6020. + # foo.o: sub/foo.c ... \
  6021. + # sub/foo.h ... \
  6022. + # ...
  6023. + set_dir_from "$object"
  6024. + # Use the source, not the object, to determine the base name, since
  6025. + # that's sadly what pgcc will do too.
  6026. + set_base_from "$source"
  6027. + tmpdepfile=$base.d
  6028. +
  6029. + # For projects that build the same source file twice into different object
  6030. + # files, the pgcc approach of using the *source* file root name can cause
  6031. + # problems in parallel builds. Use a locking strategy to avoid stomping on
  6032. + # the same $tmpdepfile.
  6033. + lockdir=$base.d-lock
  6034. + trap "
  6035. + echo '$0: caught signal, cleaning up...' >&2
  6036. + rmdir '$lockdir'
  6037. + exit 1
  6038. + " 1 2 13 15
  6039. + numtries=100
  6040. + i=$numtries
  6041. + while test $i -gt 0; do
  6042. + # mkdir is a portable test-and-set.
  6043. + if mkdir "$lockdir" 2>/dev/null; then
  6044. + # This process acquired the lock.
  6045. + "$@" -MD
  6046. + stat=$?
  6047. + # Release the lock.
  6048. + rmdir "$lockdir"
  6049. + break
  6050. + else
  6051. + # If the lock is being held by a different process, wait
  6052. + # until the winning process is done or we timeout.
  6053. + while test -d "$lockdir" && test $i -gt 0; do
  6054. + sleep 1
  6055. + i=`expr $i - 1`
  6056. + done
  6057. + fi
  6058. + i=`expr $i - 1`
  6059. + done
  6060. + trap - 1 2 13 15
  6061. + if test $i -le 0; then
  6062. + echo "$0: failed to acquire lock after $numtries attempts" >&2
  6063. + echo "$0: check lockdir '$lockdir'" >&2
  6064. + exit 1
  6065. + fi
  6066. +
  6067. + if test $stat -ne 0; then
  6068. + rm -f "$tmpdepfile"
  6069. + exit $stat
  6070. + fi
  6071. + rm -f "$depfile"
  6072. + # Each line is of the form `foo.o: dependent.h',
  6073. + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
  6074. + # Do two passes, one to just change these to
  6075. + # `$object: dependent.h' and one to simply `dependent.h:'.
  6076. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
  6077. + # Some versions of the HPUX 10.20 sed can't process this invocation
  6078. + # correctly. Breaking it into two sed invocations is a workaround.
  6079. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
  6080. + | sed -e 's/$/ :/' >> "$depfile"
  6081. + rm -f "$tmpdepfile"
  6082. + ;;
  6083. +
  6084. +hp2)
  6085. + # The "hp" stanza above does not work with aCC (C++) and HP's ia64
  6086. + # compilers, which have integrated preprocessors. The correct option
  6087. + # to use with these is +Maked; it writes dependencies to a file named
  6088. + # 'foo.d', which lands next to the object file, wherever that
  6089. + # happens to be.
  6090. + # Much of this is similar to the tru64 case; see comments there.
  6091. + set_dir_from "$object"
  6092. + set_base_from "$object"
  6093. + if test "$libtool" = yes; then
  6094. + tmpdepfile1=$dir$base.d
  6095. + tmpdepfile2=$dir.libs/$base.d
  6096. + "$@" -Wc,+Maked
  6097. + else
  6098. + tmpdepfile1=$dir$base.d
  6099. + tmpdepfile2=$dir$base.d
  6100. + "$@" +Maked
  6101. + fi
  6102. + stat=$?
  6103. + if test $stat -ne 0; then
  6104. + rm -f "$tmpdepfile1" "$tmpdepfile2"
  6105. + exit $stat
  6106. + fi
  6107. +
  6108. + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
  6109. + do
  6110. + test -f "$tmpdepfile" && break
  6111. + done
  6112. + if test -f "$tmpdepfile"; then
  6113. + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
  6114. + # Add 'dependent.h:' lines.
  6115. + sed -ne '2,${
  6116. + s/^ *//
  6117. + s/ \\*$//
  6118. + s/$/:/
  6119. + p
  6120. + }' "$tmpdepfile" >> "$depfile"
  6121. + else
  6122. + make_dummy_depfile
  6123. + fi
  6124. + rm -f "$tmpdepfile" "$tmpdepfile2"
  6125. + ;;
  6126. +
  6127. +tru64)
  6128. + # The Tru64 compiler uses -MD to generate dependencies as a side
  6129. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
  6130. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
  6131. + # dependencies in 'foo.d' instead, so we check for that too.
  6132. + # Subdirectories are respected.
  6133. + set_dir_from "$object"
  6134. + set_base_from "$object"
  6135. +
  6136. + if test "$libtool" = yes; then
  6137. + # Libtool generates 2 separate objects for the 2 libraries. These
  6138. + # two compilations output dependencies in $dir.libs/$base.o.d and
  6139. + # in $dir$base.o.d. We have to check for both files, because
  6140. + # one of the two compilations can be disabled. We should prefer
  6141. + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
  6142. + # automatically cleaned when .libs/ is deleted, while ignoring
  6143. + # the former would cause a distcleancheck panic.
  6144. + tmpdepfile1=$dir$base.o.d # libtool 1.5
  6145. + tmpdepfile2=$dir.libs/$base.o.d # Likewise.
  6146. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
  6147. + "$@" -Wc,-MD
  6148. + else
  6149. + tmpdepfile1=$dir$base.d
  6150. + tmpdepfile2=$dir$base.d
  6151. + tmpdepfile3=$dir$base.d
  6152. + "$@" -MD
  6153. + fi
  6154. +
  6155. + stat=$?
  6156. + if test $stat -ne 0; then
  6157. + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  6158. + exit $stat
  6159. + fi
  6160. +
  6161. + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  6162. + do
  6163. + test -f "$tmpdepfile" && break
  6164. + done
  6165. + # Same post-processing that is required for AIX mode.
  6166. + aix_post_process_depfile
  6167. + ;;
  6168. +
  6169. +msvc7)
  6170. + if test "$libtool" = yes; then
  6171. + showIncludes=-Wc,-showIncludes
  6172. + else
  6173. + showIncludes=-showIncludes
  6174. + fi
  6175. + "$@" $showIncludes > "$tmpdepfile"
  6176. + stat=$?
  6177. + grep -v '^Note: including file: ' "$tmpdepfile"
  6178. + if test $stat -ne 0; then
  6179. + rm -f "$tmpdepfile"
  6180. + exit $stat
  6181. + fi
  6182. + rm -f "$depfile"
  6183. + echo "$object : \\" > "$depfile"
  6184. + # The first sed program below extracts the file names and escapes
  6185. + # backslashes for cygpath. The second sed program outputs the file
  6186. + # name when reading, but also accumulates all include files in the
  6187. + # hold buffer in order to output them again at the end. This only
  6188. + # works with sed implementations that can handle large buffers.
  6189. + sed < "$tmpdepfile" -n '
  6190. +/^Note: including file: *\(.*\)/ {
  6191. + s//\1/
  6192. + s/\\/\\\\/g
  6193. + p
  6194. +}' | $cygpath_u | sort -u | sed -n '
  6195. +s/ /\\ /g
  6196. +s/\(.*\)/'"$tab"'\1 \\/p
  6197. +s/.\(.*\) \\/\1:/
  6198. +H
  6199. +$ {
  6200. + s/.*/'"$tab"'/
  6201. + G
  6202. + p
  6203. +}' >> "$depfile"
  6204. + echo >> "$depfile" # make sure the fragment doesn't end with a backslash
  6205. + rm -f "$tmpdepfile"
  6206. + ;;
  6207. +
  6208. +msvc7msys)
  6209. + # This case exists only to let depend.m4 do its work. It works by
  6210. + # looking at the text of this script. This case will never be run,
  6211. + # since it is checked for above.
  6212. + exit 1
  6213. + ;;
  6214. +
  6215. +#nosideeffect)
  6216. + # This comment above is used by automake to tell side-effect
  6217. + # dependency tracking mechanisms from slower ones.
  6218. +
  6219. +dashmstdout)
  6220. + # Important note: in order to support this mode, a compiler *must*
  6221. + # always write the preprocessed file to stdout, regardless of -o.
  6222. + "$@" || exit $?
  6223. +
  6224. + # Remove the call to Libtool.
  6225. + if test "$libtool" = yes; then
  6226. + while test "X$1" != 'X--mode=compile'; do
  6227. + shift
  6228. + done
  6229. + shift
  6230. + fi
  6231. +
  6232. + # Remove '-o $object'.
  6233. + IFS=" "
  6234. + for arg
  6235. + do
  6236. + case $arg in
  6237. + -o)
  6238. + shift
  6239. + ;;
  6240. + $object)
  6241. + shift
  6242. + ;;
  6243. + *)
  6244. + set fnord "$@" "$arg"
  6245. + shift # fnord
  6246. + shift # $arg
  6247. + ;;
  6248. + esac
  6249. + done
  6250. +
  6251. + test -z "$dashmflag" && dashmflag=-M
  6252. + # Require at least two characters before searching for ':'
  6253. + # in the target name. This is to cope with DOS-style filenames:
  6254. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
  6255. + "$@" $dashmflag |
  6256. + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
  6257. + rm -f "$depfile"
  6258. + cat < "$tmpdepfile" > "$depfile"
  6259. + # Some versions of the HPUX 10.20 sed can't process this sed invocation
  6260. + # correctly. Breaking it into two sed invocations is a workaround.
  6261. + tr ' ' "$nl" < "$tmpdepfile" \
  6262. + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
  6263. + | sed -e 's/$/ :/' >> "$depfile"
  6264. + rm -f "$tmpdepfile"
  6265. + ;;
  6266. +
  6267. +dashXmstdout)
  6268. + # This case only exists to satisfy depend.m4. It is never actually
  6269. + # run, as this mode is specially recognized in the preamble.
  6270. + exit 1
  6271. + ;;
  6272. +
  6273. +makedepend)
  6274. + "$@" || exit $?
  6275. + # Remove any Libtool call
  6276. + if test "$libtool" = yes; then
  6277. + while test "X$1" != 'X--mode=compile'; do
  6278. + shift
  6279. + done
  6280. + shift
  6281. + fi
  6282. + # X makedepend
  6283. + shift
  6284. + cleared=no eat=no
  6285. + for arg
  6286. + do
  6287. + case $cleared in
  6288. + no)
  6289. + set ""; shift
  6290. + cleared=yes ;;
  6291. + esac
  6292. + if test $eat = yes; then
  6293. + eat=no
  6294. + continue
  6295. + fi
  6296. + case "$arg" in
  6297. + -D*|-I*)
  6298. + set fnord "$@" "$arg"; shift ;;
  6299. + # Strip any option that makedepend may not understand. Remove
  6300. + # the object too, otherwise makedepend will parse it as a source file.
  6301. + -arch)
  6302. + eat=yes ;;
  6303. + -*|$object)
  6304. + ;;
  6305. + *)
  6306. + set fnord "$@" "$arg"; shift ;;
  6307. + esac
  6308. + done
  6309. + obj_suffix=`echo "$object" | sed 's/^.*\././'`
  6310. + touch "$tmpdepfile"
  6311. + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
  6312. + rm -f "$depfile"
  6313. + # makedepend may prepend the VPATH from the source file name to the object.
  6314. + # No need to regex-escape $object, excess matching of '.' is harmless.
  6315. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
  6316. + # Some versions of the HPUX 10.20 sed can't process the last invocation
  6317. + # correctly. Breaking it into two sed invocations is a workaround.
  6318. + sed '1,2d' "$tmpdepfile" \
  6319. + | tr ' ' "$nl" \
  6320. + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
  6321. + | sed -e 's/$/ :/' >> "$depfile"
  6322. + rm -f "$tmpdepfile" "$tmpdepfile".bak
  6323. + ;;
  6324. +
  6325. +cpp)
  6326. + # Important note: in order to support this mode, a compiler *must*
  6327. + # always write the preprocessed file to stdout.
  6328. + "$@" || exit $?
  6329. +
  6330. + # Remove the call to Libtool.
  6331. + if test "$libtool" = yes; then
  6332. + while test "X$1" != 'X--mode=compile'; do
  6333. + shift
  6334. + done
  6335. + shift
  6336. + fi
  6337. +
  6338. + # Remove '-o $object'.
  6339. + IFS=" "
  6340. + for arg
  6341. + do
  6342. + case $arg in
  6343. + -o)
  6344. + shift
  6345. + ;;
  6346. + $object)
  6347. + shift
  6348. + ;;
  6349. + *)
  6350. + set fnord "$@" "$arg"
  6351. + shift # fnord
  6352. + shift # $arg
  6353. + ;;
  6354. + esac
  6355. + done
  6356. +
  6357. + "$@" -E \
  6358. + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
  6359. + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
  6360. + | sed '$ s: \\$::' > "$tmpdepfile"
  6361. + rm -f "$depfile"
  6362. + echo "$object : \\" > "$depfile"
  6363. + cat < "$tmpdepfile" >> "$depfile"
  6364. + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
  6365. + rm -f "$tmpdepfile"
  6366. + ;;
  6367. +
  6368. +msvisualcpp)
  6369. + # Important note: in order to support this mode, a compiler *must*
  6370. + # always write the preprocessed file to stdout.
  6371. + "$@" || exit $?
  6372. +
  6373. + # Remove the call to Libtool.
  6374. + if test "$libtool" = yes; then
  6375. + while test "X$1" != 'X--mode=compile'; do
  6376. + shift
  6377. + done
  6378. + shift
  6379. + fi
  6380. +
  6381. + IFS=" "
  6382. + for arg
  6383. + do
  6384. + case "$arg" in
  6385. + -o)
  6386. + shift
  6387. + ;;
  6388. + $object)
  6389. + shift
  6390. + ;;
  6391. + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
  6392. + set fnord "$@"
  6393. + shift
  6394. + shift
  6395. + ;;
  6396. + *)
  6397. + set fnord "$@" "$arg"
  6398. + shift
  6399. + shift
  6400. + ;;
  6401. + esac
  6402. + done
  6403. + "$@" -E 2>/dev/null |
  6404. + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
  6405. + rm -f "$depfile"
  6406. + echo "$object : \\" > "$depfile"
  6407. + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
  6408. + echo "$tab" >> "$depfile"
  6409. + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
  6410. + rm -f "$tmpdepfile"
  6411. + ;;
  6412. +
  6413. +msvcmsys)
  6414. + # This case exists only to let depend.m4 do its work. It works by
  6415. + # looking at the text of this script. This case will never be run,
  6416. + # since it is checked for above.
  6417. + exit 1
  6418. + ;;
  6419. +
  6420. +none)
  6421. + exec "$@"
  6422. + ;;
  6423. +
  6424. +*)
  6425. + echo "Unknown depmode $depmode" 1>&2
  6426. + exit 1
  6427. + ;;
  6428. +esac
  6429. +
  6430. +exit 0
  6431. +
  6432. +# Local Variables:
  6433. +# mode: shell-script
  6434. +# sh-indentation: 2
  6435. +# eval: (add-hook 'write-file-hooks 'time-stamp)
  6436. +# time-stamp-start: "scriptversion="
  6437. +# time-stamp-format: "%:y-%02m-%02d.%02H"
  6438. +# time-stamp-time-zone: "UTC0"
  6439. +# time-stamp-end: "; # UTC"
  6440. +# End:
  6441. --- /dev/null
  6442. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/iconv.m4
  6443. @@ -0,0 +1,271 @@
  6444. +# iconv.m4 serial 19 (gettext-0.18.2)
  6445. +dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc.
  6446. +dnl This file is free software; the Free Software Foundation
  6447. +dnl gives unlimited permission to copy and/or distribute it,
  6448. +dnl with or without modifications, as long as this notice is preserved.
  6449. +
  6450. +dnl From Bruno Haible.
  6451. +
  6452. +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
  6453. +[
  6454. + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
  6455. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  6456. + AC_REQUIRE([AC_LIB_RPATH])
  6457. +
  6458. + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  6459. + dnl accordingly.
  6460. + AC_LIB_LINKFLAGS_BODY([iconv])
  6461. +])
  6462. +
  6463. +AC_DEFUN([AM_ICONV_LINK],
  6464. +[
  6465. + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
  6466. + dnl those with the standalone portable GNU libiconv installed).
  6467. + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
  6468. +
  6469. + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  6470. + dnl accordingly.
  6471. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
  6472. +
  6473. + dnl Add $INCICONV to CPPFLAGS before performing the following checks,
  6474. + dnl because if the user has installed libiconv and not disabled its use
  6475. + dnl via --without-libiconv-prefix, he wants to use it. The first
  6476. + dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
  6477. + am_save_CPPFLAGS="$CPPFLAGS"
  6478. + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
  6479. +
  6480. + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
  6481. + am_cv_func_iconv="no, consider installing GNU libiconv"
  6482. + am_cv_lib_iconv=no
  6483. + AC_LINK_IFELSE(
  6484. + [AC_LANG_PROGRAM(
  6485. + [[
  6486. +#include <stdlib.h>
  6487. +#include <iconv.h>
  6488. + ]],
  6489. + [[iconv_t cd = iconv_open("","");
  6490. + iconv(cd,NULL,NULL,NULL,NULL);
  6491. + iconv_close(cd);]])],
  6492. + [am_cv_func_iconv=yes])
  6493. + if test "$am_cv_func_iconv" != yes; then
  6494. + am_save_LIBS="$LIBS"
  6495. + LIBS="$LIBS $LIBICONV"
  6496. + AC_LINK_IFELSE(
  6497. + [AC_LANG_PROGRAM(
  6498. + [[
  6499. +#include <stdlib.h>
  6500. +#include <iconv.h>
  6501. + ]],
  6502. + [[iconv_t cd = iconv_open("","");
  6503. + iconv(cd,NULL,NULL,NULL,NULL);
  6504. + iconv_close(cd);]])],
  6505. + [am_cv_lib_iconv=yes]
  6506. + [am_cv_func_iconv=yes])
  6507. + LIBS="$am_save_LIBS"
  6508. + fi
  6509. + ])
  6510. + if test "$am_cv_func_iconv" = yes; then
  6511. + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
  6512. + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
  6513. + dnl Solaris 10.
  6514. + am_save_LIBS="$LIBS"
  6515. + if test $am_cv_lib_iconv = yes; then
  6516. + LIBS="$LIBS $LIBICONV"
  6517. + fi
  6518. + am_cv_func_iconv_works=no
  6519. + for ac_iconv_const in '' 'const'; do
  6520. + AC_RUN_IFELSE(
  6521. + [AC_LANG_PROGRAM(
  6522. + [[
  6523. +#include <iconv.h>
  6524. +#include <string.h>
  6525. +
  6526. +#ifndef ICONV_CONST
  6527. +# define ICONV_CONST $ac_iconv_const
  6528. +#endif
  6529. + ]],
  6530. + [[int result = 0;
  6531. + /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
  6532. + returns. */
  6533. + {
  6534. + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
  6535. + if (cd_utf8_to_88591 != (iconv_t)(-1))
  6536. + {
  6537. + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
  6538. + char buf[10];
  6539. + ICONV_CONST char *inptr = input;
  6540. + size_t inbytesleft = strlen (input);
  6541. + char *outptr = buf;
  6542. + size_t outbytesleft = sizeof (buf);
  6543. + size_t res = iconv (cd_utf8_to_88591,
  6544. + &inptr, &inbytesleft,
  6545. + &outptr, &outbytesleft);
  6546. + if (res == 0)
  6547. + result |= 1;
  6548. + iconv_close (cd_utf8_to_88591);
  6549. + }
  6550. + }
  6551. + /* Test against Solaris 10 bug: Failures are not distinguishable from
  6552. + successful returns. */
  6553. + {
  6554. + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
  6555. + if (cd_ascii_to_88591 != (iconv_t)(-1))
  6556. + {
  6557. + static ICONV_CONST char input[] = "\263";
  6558. + char buf[10];
  6559. + ICONV_CONST char *inptr = input;
  6560. + size_t inbytesleft = strlen (input);
  6561. + char *outptr = buf;
  6562. + size_t outbytesleft = sizeof (buf);
  6563. + size_t res = iconv (cd_ascii_to_88591,
  6564. + &inptr, &inbytesleft,
  6565. + &outptr, &outbytesleft);
  6566. + if (res == 0)
  6567. + result |= 2;
  6568. + iconv_close (cd_ascii_to_88591);
  6569. + }
  6570. + }
  6571. + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
  6572. + {
  6573. + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
  6574. + if (cd_88591_to_utf8 != (iconv_t)(-1))
  6575. + {
  6576. + static ICONV_CONST char input[] = "\304";
  6577. + static char buf[2] = { (char)0xDE, (char)0xAD };
  6578. + ICONV_CONST char *inptr = input;
  6579. + size_t inbytesleft = 1;
  6580. + char *outptr = buf;
  6581. + size_t outbytesleft = 1;
  6582. + size_t res = iconv (cd_88591_to_utf8,
  6583. + &inptr, &inbytesleft,
  6584. + &outptr, &outbytesleft);
  6585. + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
  6586. + result |= 4;
  6587. + iconv_close (cd_88591_to_utf8);
  6588. + }
  6589. + }
  6590. +#if 0 /* This bug could be worked around by the caller. */
  6591. + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
  6592. + {
  6593. + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
  6594. + if (cd_88591_to_utf8 != (iconv_t)(-1))
  6595. + {
  6596. + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
  6597. + char buf[50];
  6598. + ICONV_CONST char *inptr = input;
  6599. + size_t inbytesleft = strlen (input);
  6600. + char *outptr = buf;
  6601. + size_t outbytesleft = sizeof (buf);
  6602. + size_t res = iconv (cd_88591_to_utf8,
  6603. + &inptr, &inbytesleft,
  6604. + &outptr, &outbytesleft);
  6605. + if ((int)res > 0)
  6606. + result |= 8;
  6607. + iconv_close (cd_88591_to_utf8);
  6608. + }
  6609. + }
  6610. +#endif
  6611. + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
  6612. + provided. */
  6613. + if (/* Try standardized names. */
  6614. + iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
  6615. + /* Try IRIX, OSF/1 names. */
  6616. + && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
  6617. + /* Try AIX names. */
  6618. + && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
  6619. + /* Try HP-UX names. */
  6620. + && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
  6621. + result |= 16;
  6622. + return result;
  6623. +]])],
  6624. + [am_cv_func_iconv_works=yes], ,
  6625. + [case "$host_os" in
  6626. + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
  6627. + *) am_cv_func_iconv_works="guessing yes" ;;
  6628. + esac])
  6629. + test "$am_cv_func_iconv_works" = no || break
  6630. + done
  6631. + LIBS="$am_save_LIBS"
  6632. + ])
  6633. + case "$am_cv_func_iconv_works" in
  6634. + *no) am_func_iconv=no am_cv_lib_iconv=no ;;
  6635. + *) am_func_iconv=yes ;;
  6636. + esac
  6637. + else
  6638. + am_func_iconv=no am_cv_lib_iconv=no
  6639. + fi
  6640. + if test "$am_func_iconv" = yes; then
  6641. + AC_DEFINE([HAVE_ICONV], [1],
  6642. + [Define if you have the iconv() function and it works.])
  6643. + fi
  6644. + if test "$am_cv_lib_iconv" = yes; then
  6645. + AC_MSG_CHECKING([how to link with libiconv])
  6646. + AC_MSG_RESULT([$LIBICONV])
  6647. + else
  6648. + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
  6649. + dnl either.
  6650. + CPPFLAGS="$am_save_CPPFLAGS"
  6651. + LIBICONV=
  6652. + LTLIBICONV=
  6653. + fi
  6654. + AC_SUBST([LIBICONV])
  6655. + AC_SUBST([LTLIBICONV])
  6656. +])
  6657. +
  6658. +dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
  6659. +dnl avoid warnings like
  6660. +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
  6661. +dnl This is tricky because of the way 'aclocal' is implemented:
  6662. +dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
  6663. +dnl Otherwise aclocal's initial scan pass would miss the macro definition.
  6664. +dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
  6665. +dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
  6666. +dnl warnings.
  6667. +m4_define([gl_iconv_AC_DEFUN],
  6668. + m4_version_prereq([2.64],
  6669. + [[AC_DEFUN_ONCE(
  6670. + [$1], [$2])]],
  6671. + [m4_ifdef([gl_00GNULIB],
  6672. + [[AC_DEFUN_ONCE(
  6673. + [$1], [$2])]],
  6674. + [[AC_DEFUN(
  6675. + [$1], [$2])]])]))
  6676. +gl_iconv_AC_DEFUN([AM_ICONV],
  6677. +[
  6678. + AM_ICONV_LINK
  6679. + if test "$am_cv_func_iconv" = yes; then
  6680. + AC_MSG_CHECKING([for iconv declaration])
  6681. + AC_CACHE_VAL([am_cv_proto_iconv], [
  6682. + AC_COMPILE_IFELSE(
  6683. + [AC_LANG_PROGRAM(
  6684. + [[
  6685. +#include <stdlib.h>
  6686. +#include <iconv.h>
  6687. +extern
  6688. +#ifdef __cplusplus
  6689. +"C"
  6690. +#endif
  6691. +#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
  6692. +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
  6693. +#else
  6694. +size_t iconv();
  6695. +#endif
  6696. + ]],
  6697. + [[]])],
  6698. + [am_cv_proto_iconv_arg1=""],
  6699. + [am_cv_proto_iconv_arg1="const"])
  6700. + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
  6701. + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
  6702. + AC_MSG_RESULT([
  6703. + $am_cv_proto_iconv])
  6704. + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
  6705. + [Define as const if the declaration of iconv() needs const.])
  6706. + dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
  6707. + m4_ifdef([gl_ICONV_H_DEFAULTS],
  6708. + [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
  6709. + if test -n "$am_cv_proto_iconv_arg1"; then
  6710. + ICONV_CONST="const"
  6711. + fi
  6712. + ])
  6713. + fi
  6714. +])
  6715. --- /dev/null
  6716. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/install-sh
  6717. @@ -0,0 +1,508 @@
  6718. +#!/bin/sh
  6719. +# install - install a program, script, or datafile
  6720. +
  6721. +scriptversion=2014-09-12.12; # UTC
  6722. +
  6723. +# This originates from X11R5 (mit/util/scripts/install.sh), which was
  6724. +# later released in X11R6 (xc/config/util/install.sh) with the
  6725. +# following copyright and license.
  6726. +#
  6727. +# Copyright (C) 1994 X Consortium
  6728. +#
  6729. +# Permission is hereby granted, free of charge, to any person obtaining a copy
  6730. +# of this software and associated documentation files (the "Software"), to
  6731. +# deal in the Software without restriction, including without limitation the
  6732. +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  6733. +# sell copies of the Software, and to permit persons to whom the Software is
  6734. +# furnished to do so, subject to the following conditions:
  6735. +#
  6736. +# The above copyright notice and this permission notice shall be included in
  6737. +# all copies or substantial portions of the Software.
  6738. +#
  6739. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6740. +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6741. +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6742. +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  6743. +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
  6744. +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  6745. +#
  6746. +# Except as contained in this notice, the name of the X Consortium shall not
  6747. +# be used in advertising or otherwise to promote the sale, use or other deal-
  6748. +# ings in this Software without prior written authorization from the X Consor-
  6749. +# tium.
  6750. +#
  6751. +#
  6752. +# FSF changes to this file are in the public domain.
  6753. +#
  6754. +# Calling this script install-sh is preferred over install.sh, to prevent
  6755. +# 'make' implicit rules from creating a file called install from it
  6756. +# when there is no Makefile.
  6757. +#
  6758. +# This script is compatible with the BSD install script, but was written
  6759. +# from scratch.
  6760. +
  6761. +tab=' '
  6762. +nl='
  6763. +'
  6764. +IFS=" $tab$nl"
  6765. +
  6766. +# Set DOITPROG to "echo" to test this script.
  6767. +
  6768. +doit=${DOITPROG-}
  6769. +doit_exec=${doit:-exec}
  6770. +
  6771. +# Put in absolute file names if you don't have them in your path;
  6772. +# or use environment vars.
  6773. +
  6774. +chgrpprog=${CHGRPPROG-chgrp}
  6775. +chmodprog=${CHMODPROG-chmod}
  6776. +chownprog=${CHOWNPROG-chown}
  6777. +cmpprog=${CMPPROG-cmp}
  6778. +cpprog=${CPPROG-cp}
  6779. +mkdirprog=${MKDIRPROG-mkdir}
  6780. +mvprog=${MVPROG-mv}
  6781. +rmprog=${RMPROG-rm}
  6782. +stripprog=${STRIPPROG-strip}
  6783. +
  6784. +posix_mkdir=
  6785. +
  6786. +# Desired mode of installed file.
  6787. +mode=0755
  6788. +
  6789. +chgrpcmd=
  6790. +chmodcmd=$chmodprog
  6791. +chowncmd=
  6792. +mvcmd=$mvprog
  6793. +rmcmd="$rmprog -f"
  6794. +stripcmd=
  6795. +
  6796. +src=
  6797. +dst=
  6798. +dir_arg=
  6799. +dst_arg=
  6800. +
  6801. +copy_on_change=false
  6802. +is_target_a_directory=possibly
  6803. +
  6804. +usage="\
  6805. +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
  6806. + or: $0 [OPTION]... SRCFILES... DIRECTORY
  6807. + or: $0 [OPTION]... -t DIRECTORY SRCFILES...
  6808. + or: $0 [OPTION]... -d DIRECTORIES...
  6809. +
  6810. +In the 1st form, copy SRCFILE to DSTFILE.
  6811. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
  6812. +In the 4th, create DIRECTORIES.
  6813. +
  6814. +Options:
  6815. + --help display this help and exit.
  6816. + --version display version info and exit.
  6817. +
  6818. + -c (ignored)
  6819. + -C install only if different (preserve the last data modification time)
  6820. + -d create directories instead of installing files.
  6821. + -g GROUP $chgrpprog installed files to GROUP.
  6822. + -m MODE $chmodprog installed files to MODE.
  6823. + -o USER $chownprog installed files to USER.
  6824. + -s $stripprog installed files.
  6825. + -t DIRECTORY install into DIRECTORY.
  6826. + -T report an error if DSTFILE is a directory.
  6827. +
  6828. +Environment variables override the default commands:
  6829. + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
  6830. + RMPROG STRIPPROG
  6831. +"
  6832. +
  6833. +while test $# -ne 0; do
  6834. + case $1 in
  6835. + -c) ;;
  6836. +
  6837. + -C) copy_on_change=true;;
  6838. +
  6839. + -d) dir_arg=true;;
  6840. +
  6841. + -g) chgrpcmd="$chgrpprog $2"
  6842. + shift;;
  6843. +
  6844. + --help) echo "$usage"; exit $?;;
  6845. +
  6846. + -m) mode=$2
  6847. + case $mode in
  6848. + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
  6849. + echo "$0: invalid mode: $mode" >&2
  6850. + exit 1;;
  6851. + esac
  6852. + shift;;
  6853. +
  6854. + -o) chowncmd="$chownprog $2"
  6855. + shift;;
  6856. +
  6857. + -s) stripcmd=$stripprog;;
  6858. +
  6859. + -t)
  6860. + is_target_a_directory=always
  6861. + dst_arg=$2
  6862. + # Protect names problematic for 'test' and other utilities.
  6863. + case $dst_arg in
  6864. + -* | [=\(\)!]) dst_arg=./$dst_arg;;
  6865. + esac
  6866. + shift;;
  6867. +
  6868. + -T) is_target_a_directory=never;;
  6869. +
  6870. + --version) echo "$0 $scriptversion"; exit $?;;
  6871. +
  6872. + --) shift
  6873. + break;;
  6874. +
  6875. + -*) echo "$0: invalid option: $1" >&2
  6876. + exit 1;;
  6877. +
  6878. + *) break;;
  6879. + esac
  6880. + shift
  6881. +done
  6882. +
  6883. +# We allow the use of options -d and -T together, by making -d
  6884. +# take the precedence; this is for compatibility with GNU install.
  6885. +
  6886. +if test -n "$dir_arg"; then
  6887. + if test -n "$dst_arg"; then
  6888. + echo "$0: target directory not allowed when installing a directory." >&2
  6889. + exit 1
  6890. + fi
  6891. +fi
  6892. +
  6893. +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
  6894. + # When -d is used, all remaining arguments are directories to create.
  6895. + # When -t is used, the destination is already specified.
  6896. + # Otherwise, the last argument is the destination. Remove it from $@.
  6897. + for arg
  6898. + do
  6899. + if test -n "$dst_arg"; then
  6900. + # $@ is not empty: it contains at least $arg.
  6901. + set fnord "$@" "$dst_arg"
  6902. + shift # fnord
  6903. + fi
  6904. + shift # arg
  6905. + dst_arg=$arg
  6906. + # Protect names problematic for 'test' and other utilities.
  6907. + case $dst_arg in
  6908. + -* | [=\(\)!]) dst_arg=./$dst_arg;;
  6909. + esac
  6910. + done
  6911. +fi
  6912. +
  6913. +if test $# -eq 0; then
  6914. + if test -z "$dir_arg"; then
  6915. + echo "$0: no input file specified." >&2
  6916. + exit 1
  6917. + fi
  6918. + # It's OK to call 'install-sh -d' without argument.
  6919. + # This can happen when creating conditional directories.
  6920. + exit 0
  6921. +fi
  6922. +
  6923. +if test -z "$dir_arg"; then
  6924. + if test $# -gt 1 || test "$is_target_a_directory" = always; then
  6925. + if test ! -d "$dst_arg"; then
  6926. + echo "$0: $dst_arg: Is not a directory." >&2
  6927. + exit 1
  6928. + fi
  6929. + fi
  6930. +fi
  6931. +
  6932. +if test -z "$dir_arg"; then
  6933. + do_exit='(exit $ret); exit $ret'
  6934. + trap "ret=129; $do_exit" 1
  6935. + trap "ret=130; $do_exit" 2
  6936. + trap "ret=141; $do_exit" 13
  6937. + trap "ret=143; $do_exit" 15
  6938. +
  6939. + # Set umask so as not to create temps with too-generous modes.
  6940. + # However, 'strip' requires both read and write access to temps.
  6941. + case $mode in
  6942. + # Optimize common cases.
  6943. + *644) cp_umask=133;;
  6944. + *755) cp_umask=22;;
  6945. +
  6946. + *[0-7])
  6947. + if test -z "$stripcmd"; then
  6948. + u_plus_rw=
  6949. + else
  6950. + u_plus_rw='% 200'
  6951. + fi
  6952. + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
  6953. + *)
  6954. + if test -z "$stripcmd"; then
  6955. + u_plus_rw=
  6956. + else
  6957. + u_plus_rw=,u+rw
  6958. + fi
  6959. + cp_umask=$mode$u_plus_rw;;
  6960. + esac
  6961. +fi
  6962. +
  6963. +for src
  6964. +do
  6965. + # Protect names problematic for 'test' and other utilities.
  6966. + case $src in
  6967. + -* | [=\(\)!]) src=./$src;;
  6968. + esac
  6969. +
  6970. + if test -n "$dir_arg"; then
  6971. + dst=$src
  6972. + dstdir=$dst
  6973. + test -d "$dstdir"
  6974. + dstdir_status=$?
  6975. + else
  6976. +
  6977. + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
  6978. + # might cause directories to be created, which would be especially bad
  6979. + # if $src (and thus $dsttmp) contains '*'.
  6980. + if test ! -f "$src" && test ! -d "$src"; then
  6981. + echo "$0: $src does not exist." >&2
  6982. + exit 1
  6983. + fi
  6984. +
  6985. + if test -z "$dst_arg"; then
  6986. + echo "$0: no destination specified." >&2
  6987. + exit 1
  6988. + fi
  6989. + dst=$dst_arg
  6990. +
  6991. + # If destination is a directory, append the input filename; won't work
  6992. + # if double slashes aren't ignored.
  6993. + if test -d "$dst"; then
  6994. + if test "$is_target_a_directory" = never; then
  6995. + echo "$0: $dst_arg: Is a directory" >&2
  6996. + exit 1
  6997. + fi
  6998. + dstdir=$dst
  6999. + dst=$dstdir/`basename "$src"`
  7000. + dstdir_status=0
  7001. + else
  7002. + dstdir=`dirname "$dst"`
  7003. + test -d "$dstdir"
  7004. + dstdir_status=$?
  7005. + fi
  7006. + fi
  7007. +
  7008. + obsolete_mkdir_used=false
  7009. +
  7010. + if test $dstdir_status != 0; then
  7011. + case $posix_mkdir in
  7012. + '')
  7013. + # Create intermediate dirs using mode 755 as modified by the umask.
  7014. + # This is like FreeBSD 'install' as of 1997-10-28.
  7015. + umask=`umask`
  7016. + case $stripcmd.$umask in
  7017. + # Optimize common cases.
  7018. + *[2367][2367]) mkdir_umask=$umask;;
  7019. + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
  7020. +
  7021. + *[0-7])
  7022. + mkdir_umask=`expr $umask + 22 \
  7023. + - $umask % 100 % 40 + $umask % 20 \
  7024. + - $umask % 10 % 4 + $umask % 2
  7025. + `;;
  7026. + *) mkdir_umask=$umask,go-w;;
  7027. + esac
  7028. +
  7029. + # With -d, create the new directory with the user-specified mode.
  7030. + # Otherwise, rely on $mkdir_umask.
  7031. + if test -n "$dir_arg"; then
  7032. + mkdir_mode=-m$mode
  7033. + else
  7034. + mkdir_mode=
  7035. + fi
  7036. +
  7037. + posix_mkdir=false
  7038. + case $umask in
  7039. + *[123567][0-7][0-7])
  7040. + # POSIX mkdir -p sets u+wx bits regardless of umask, which
  7041. + # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
  7042. + ;;
  7043. + *)
  7044. + # $RANDOM is not portable (e.g. dash); use it when possible to
  7045. + # lower collision chance
  7046. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
  7047. + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
  7048. +
  7049. + # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
  7050. + # create the $tmpdir first (and fail if unsuccessful) to make sure
  7051. + # that nobody tries to guess the $tmpdir name.
  7052. + if (umask $mkdir_umask &&
  7053. + $mkdirprog $mkdir_mode "$tmpdir" &&
  7054. + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
  7055. + then
  7056. + if test -z "$dir_arg" || {
  7057. + # Check for POSIX incompatibilities with -m.
  7058. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
  7059. + # other-writable bit of parent directory when it shouldn't.
  7060. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
  7061. + test_tmpdir="$tmpdir/a"
  7062. + ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
  7063. + case $ls_ld_tmpdir in
  7064. + d????-?r-*) different_mode=700;;
  7065. + d????-?--*) different_mode=755;;
  7066. + *) false;;
  7067. + esac &&
  7068. + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
  7069. + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
  7070. + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
  7071. + }
  7072. + }
  7073. + then posix_mkdir=:
  7074. + fi
  7075. + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
  7076. + else
  7077. + # Remove any dirs left behind by ancient mkdir implementations.
  7078. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
  7079. + fi
  7080. + trap '' 0;;
  7081. + esac;;
  7082. + esac
  7083. +
  7084. + if
  7085. + $posix_mkdir && (
  7086. + umask $mkdir_umask &&
  7087. + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
  7088. + )
  7089. + then :
  7090. + else
  7091. +
  7092. + # The umask is ridiculous, or mkdir does not conform to POSIX,
  7093. + # or it failed possibly due to a race condition. Create the
  7094. + # directory the slow way, step by step, checking for races as we go.
  7095. +
  7096. + case $dstdir in
  7097. + /*) prefix='/';;
  7098. + [-=\(\)!]*) prefix='./';;
  7099. + *) prefix='';;
  7100. + esac
  7101. +
  7102. + oIFS=$IFS
  7103. + IFS=/
  7104. + set -f
  7105. + set fnord $dstdir
  7106. + shift
  7107. + set +f
  7108. + IFS=$oIFS
  7109. +
  7110. + prefixes=
  7111. +
  7112. + for d
  7113. + do
  7114. + test X"$d" = X && continue
  7115. +
  7116. + prefix=$prefix$d
  7117. + if test -d "$prefix"; then
  7118. + prefixes=
  7119. + else
  7120. + if $posix_mkdir; then
  7121. + (umask=$mkdir_umask &&
  7122. + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
  7123. + # Don't fail if two instances are running concurrently.
  7124. + test -d "$prefix" || exit 1
  7125. + else
  7126. + case $prefix in
  7127. + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
  7128. + *) qprefix=$prefix;;
  7129. + esac
  7130. + prefixes="$prefixes '$qprefix'"
  7131. + fi
  7132. + fi
  7133. + prefix=$prefix/
  7134. + done
  7135. +
  7136. + if test -n "$prefixes"; then
  7137. + # Don't fail if two instances are running concurrently.
  7138. + (umask $mkdir_umask &&
  7139. + eval "\$doit_exec \$mkdirprog $prefixes") ||
  7140. + test -d "$dstdir" || exit 1
  7141. + obsolete_mkdir_used=true
  7142. + fi
  7143. + fi
  7144. + fi
  7145. +
  7146. + if test -n "$dir_arg"; then
  7147. + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
  7148. + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
  7149. + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
  7150. + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
  7151. + else
  7152. +
  7153. + # Make a couple of temp file names in the proper directory.
  7154. + dsttmp=$dstdir/_inst.$$_
  7155. + rmtmp=$dstdir/_rm.$$_
  7156. +
  7157. + # Trap to clean up those temp files at exit.
  7158. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
  7159. +
  7160. + # Copy the file name to the temp name.
  7161. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
  7162. +
  7163. + # and set any options; do chmod last to preserve setuid bits.
  7164. + #
  7165. + # If any of these fail, we abort the whole thing. If we want to
  7166. + # ignore errors from any of these, just make sure not to ignore
  7167. + # errors from the above "$doit $cpprog $src $dsttmp" command.
  7168. + #
  7169. + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
  7170. + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
  7171. + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
  7172. + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
  7173. +
  7174. + # If -C, don't bother to copy if it wouldn't change the file.
  7175. + if $copy_on_change &&
  7176. + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
  7177. + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
  7178. + set -f &&
  7179. + set X $old && old=:$2:$4:$5:$6 &&
  7180. + set X $new && new=:$2:$4:$5:$6 &&
  7181. + set +f &&
  7182. + test "$old" = "$new" &&
  7183. + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
  7184. + then
  7185. + rm -f "$dsttmp"
  7186. + else
  7187. + # Rename the file to the real destination.
  7188. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
  7189. +
  7190. + # The rename failed, perhaps because mv can't rename something else
  7191. + # to itself, or perhaps because mv is so ancient that it does not
  7192. + # support -f.
  7193. + {
  7194. + # Now remove or move aside any old file at destination location.
  7195. + # We try this two ways since rm can't unlink itself on some
  7196. + # systems and the destination file might be busy for other
  7197. + # reasons. In this case, the final cleanup might fail but the new
  7198. + # file should still install successfully.
  7199. + {
  7200. + test ! -f "$dst" ||
  7201. + $doit $rmcmd -f "$dst" 2>/dev/null ||
  7202. + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
  7203. + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
  7204. + } ||
  7205. + { echo "$0: cannot unlink or rename $dst" >&2
  7206. + (exit 1); exit 1
  7207. + }
  7208. + } &&
  7209. +
  7210. + # Now rename the file to the real destination.
  7211. + $doit $mvcmd "$dsttmp" "$dst"
  7212. + }
  7213. + fi || exit 1
  7214. +
  7215. + trap '' 0
  7216. + fi
  7217. +done
  7218. +
  7219. +# Local variables:
  7220. +# eval: (add-hook 'write-file-hooks 'time-stamp)
  7221. +# time-stamp-start: "scriptversion="
  7222. +# time-stamp-format: "%:y-%02m-%02d.%02H"
  7223. +# time-stamp-time-zone: "UTC"
  7224. +# time-stamp-end: "; # UTC"
  7225. +# End:
  7226. --- /dev/null
  7227. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/la_uid_t.m4
  7228. @@ -0,0 +1,20 @@
  7229. +# la_TYPE_UID_T
  7230. +# -------------
  7231. +AC_DEFUN([la_TYPE_UID_T],
  7232. +[AC_REQUIRE([AC_CANONICAL_HOST])dnl
  7233. +AC_CACHE_CHECK(for uid_t in sys/types.h, la_cv_type_uid_t,
  7234. +[AC_EGREP_HEADER(uid_t, sys/types.h,
  7235. + la_cv_type_uid_t=yes, la_cv_type_uid_t=no)])
  7236. +if test $la_cv_type_uid_t = no; then
  7237. + case $host in
  7238. + *mingw*) def_uid_t=short ;;
  7239. + *) def_uid_t=int ;;
  7240. + esac
  7241. + AC_DEFINE_UNQUOTED(uid_t, [$def_uid_t],
  7242. + [Define to match typeof st_uid field of struct stat if <sys/types.h> doesn't define.])
  7243. + AC_DEFINE_UNQUOTED(gid_t, [$def_uid_t],
  7244. + [Define to match typeof st_gid field of struct stat if <sys/types.h> doesn't define.])
  7245. +fi
  7246. +])
  7247. +AU_ALIAS([AC_TYPE_UID_T], [la_TYPE_UID_T])
  7248. +
  7249. --- /dev/null
  7250. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/lib-ld.m4
  7251. @@ -0,0 +1,109 @@
  7252. +# lib-ld.m4 serial 5 (gettext-0.18.2)
  7253. +dnl Copyright (C) 1996-2003, 2009-2011 Free Software Foundation, Inc.
  7254. +dnl This file is free software; the Free Software Foundation
  7255. +dnl gives unlimited permission to copy and/or distribute it,
  7256. +dnl with or without modifications, as long as this notice is preserved.
  7257. +
  7258. +dnl Subroutines of libtool.m4,
  7259. +dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
  7260. +dnl with libtool.m4.
  7261. +
  7262. +dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
  7263. +AC_DEFUN([AC_LIB_PROG_LD_GNU],
  7264. +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
  7265. +[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  7266. +case `$LD -v 2>&1 </dev/null` in
  7267. +*GNU* | *'with BFD'*)
  7268. + acl_cv_prog_gnu_ld=yes ;;
  7269. +*)
  7270. + acl_cv_prog_gnu_ld=no ;;
  7271. +esac])
  7272. +with_gnu_ld=$acl_cv_prog_gnu_ld
  7273. +])
  7274. +
  7275. +dnl From libtool-1.4. Sets the variable LD.
  7276. +AC_DEFUN([AC_LIB_PROG_LD],
  7277. +[AC_ARG_WITH([gnu-ld],
  7278. +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
  7279. +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  7280. +AC_REQUIRE([AC_PROG_CC])dnl
  7281. +AC_REQUIRE([AC_CANONICAL_HOST])dnl
  7282. +# Prepare PATH_SEPARATOR.
  7283. +# The user is always right.
  7284. +if test "${PATH_SEPARATOR+set}" != set; then
  7285. + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
  7286. + # contains only /bin. Note that ksh looks also at the FPATH variable,
  7287. + # so we have to set that as well for the test.
  7288. + PATH_SEPARATOR=:
  7289. + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
  7290. + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
  7291. + || PATH_SEPARATOR=';'
  7292. + }
  7293. +fi
  7294. +ac_prog=ld
  7295. +if test "$GCC" = yes; then
  7296. + # Check if gcc -print-prog-name=ld gives a path.
  7297. + AC_MSG_CHECKING([for ld used by GCC])
  7298. + case $host in
  7299. + *-*-mingw*)
  7300. + # gcc leaves a trailing carriage return which upsets mingw
  7301. + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  7302. + *)
  7303. + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  7304. + esac
  7305. + case $ac_prog in
  7306. + # Accept absolute paths.
  7307. + [[\\/]* | [A-Za-z]:[\\/]*)]
  7308. + [re_direlt='/[^/][^/]*/\.\./']
  7309. + # Canonicalize the path of ld
  7310. + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  7311. + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  7312. + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  7313. + done
  7314. + test -z "$LD" && LD="$ac_prog"
  7315. + ;;
  7316. + "")
  7317. + # If it fails, then pretend we aren't using GCC.
  7318. + ac_prog=ld
  7319. + ;;
  7320. + *)
  7321. + # If it is relative, then search for the first ld in PATH.
  7322. + with_gnu_ld=unknown
  7323. + ;;
  7324. + esac
  7325. +elif test "$with_gnu_ld" = yes; then
  7326. + AC_MSG_CHECKING([for GNU ld])
  7327. +else
  7328. + AC_MSG_CHECKING([for non-GNU ld])
  7329. +fi
  7330. +AC_CACHE_VAL([acl_cv_path_LD],
  7331. +[if test -z "$LD"; then
  7332. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  7333. + for ac_dir in $PATH; do
  7334. + test -z "$ac_dir" && ac_dir=.
  7335. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  7336. + acl_cv_path_LD="$ac_dir/$ac_prog"
  7337. + # Check to see if the program is GNU ld. I'd rather use --version,
  7338. + # but apparently some GNU ld's only accept -v.
  7339. + # Break only if it was the GNU/non-GNU ld that we prefer.
  7340. + case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
  7341. + *GNU* | *'with BFD'*)
  7342. + test "$with_gnu_ld" != no && break ;;
  7343. + *)
  7344. + test "$with_gnu_ld" != yes && break ;;
  7345. + esac
  7346. + fi
  7347. + done
  7348. + IFS="$ac_save_ifs"
  7349. +else
  7350. + acl_cv_path_LD="$LD" # Let the user override the test with a path.
  7351. +fi])
  7352. +LD="$acl_cv_path_LD"
  7353. +if test -n "$LD"; then
  7354. + AC_MSG_RESULT([$LD])
  7355. +else
  7356. + AC_MSG_RESULT([no])
  7357. +fi
  7358. +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  7359. +AC_LIB_PROG_LD_GNU
  7360. +])
  7361. --- /dev/null
  7362. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/lib-link.m4
  7363. @@ -0,0 +1,777 @@
  7364. +# lib-link.m4 serial 26 (gettext-0.18.2)
  7365. +dnl Copyright (C) 2001-2011 Free Software Foundation, Inc.
  7366. +dnl This file is free software; the Free Software Foundation
  7367. +dnl gives unlimited permission to copy and/or distribute it,
  7368. +dnl with or without modifications, as long as this notice is preserved.
  7369. +
  7370. +dnl From Bruno Haible.
  7371. +
  7372. +AC_PREREQ([2.54])
  7373. +
  7374. +dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
  7375. +dnl the libraries corresponding to explicit and implicit dependencies.
  7376. +dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
  7377. +dnl augments the CPPFLAGS variable.
  7378. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
  7379. +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  7380. +AC_DEFUN([AC_LIB_LINKFLAGS],
  7381. +[
  7382. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  7383. + AC_REQUIRE([AC_LIB_RPATH])
  7384. + pushdef([Name],[m4_translit([$1],[./+-], [____])])
  7385. + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  7386. + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  7387. + AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
  7388. + AC_LIB_LINKFLAGS_BODY([$1], [$2])
  7389. + ac_cv_lib[]Name[]_libs="$LIB[]NAME"
  7390. + ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
  7391. + ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
  7392. + ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
  7393. + ])
  7394. + LIB[]NAME="$ac_cv_lib[]Name[]_libs"
  7395. + LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
  7396. + INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
  7397. + LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
  7398. + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  7399. + AC_SUBST([LIB]NAME)
  7400. + AC_SUBST([LTLIB]NAME)
  7401. + AC_SUBST([LIB]NAME[_PREFIX])
  7402. + dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
  7403. + dnl results of this search when this library appears as a dependency.
  7404. + HAVE_LIB[]NAME=yes
  7405. + popdef([NAME])
  7406. + popdef([Name])
  7407. +])
  7408. +
  7409. +dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
  7410. +dnl searches for libname and the libraries corresponding to explicit and
  7411. +dnl implicit dependencies, together with the specified include files and
  7412. +dnl the ability to compile and link the specified testcode. The missing-message
  7413. +dnl defaults to 'no' and may contain additional hints for the user.
  7414. +dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
  7415. +dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
  7416. +dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
  7417. +dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
  7418. +dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
  7419. +dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  7420. +AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
  7421. +[
  7422. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  7423. + AC_REQUIRE([AC_LIB_RPATH])
  7424. + pushdef([Name],[m4_translit([$1],[./+-], [____])])
  7425. + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  7426. + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  7427. +
  7428. + dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
  7429. + dnl accordingly.
  7430. + AC_LIB_LINKFLAGS_BODY([$1], [$2])
  7431. +
  7432. + dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
  7433. + dnl because if the user has installed lib[]Name and not disabled its use
  7434. + dnl via --without-lib[]Name-prefix, he wants to use it.
  7435. + ac_save_CPPFLAGS="$CPPFLAGS"
  7436. + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  7437. +
  7438. + AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
  7439. + ac_save_LIBS="$LIBS"
  7440. + dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
  7441. + dnl because these -l options might require -L options that are present in
  7442. + dnl LIBS. -l options benefit only from the -L options listed before it.
  7443. + dnl Otherwise, add it to the front of LIBS, because it may be a static
  7444. + dnl library that depends on another static library that is present in LIBS.
  7445. + dnl Static libraries benefit only from the static libraries listed after
  7446. + dnl it.
  7447. + case " $LIB[]NAME" in
  7448. + *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
  7449. + *) LIBS="$LIB[]NAME $LIBS" ;;
  7450. + esac
  7451. + AC_LINK_IFELSE(
  7452. + [AC_LANG_PROGRAM([[$3]], [[$4]])],
  7453. + [ac_cv_lib[]Name=yes],
  7454. + [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
  7455. + LIBS="$ac_save_LIBS"
  7456. + ])
  7457. + if test "$ac_cv_lib[]Name" = yes; then
  7458. + HAVE_LIB[]NAME=yes
  7459. + AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
  7460. + AC_MSG_CHECKING([how to link with lib[]$1])
  7461. + AC_MSG_RESULT([$LIB[]NAME])
  7462. + else
  7463. + HAVE_LIB[]NAME=no
  7464. + dnl If $LIB[]NAME didn't lead to a usable library, we don't need
  7465. + dnl $INC[]NAME either.
  7466. + CPPFLAGS="$ac_save_CPPFLAGS"
  7467. + LIB[]NAME=
  7468. + LTLIB[]NAME=
  7469. + LIB[]NAME[]_PREFIX=
  7470. + fi
  7471. + AC_SUBST([HAVE_LIB]NAME)
  7472. + AC_SUBST([LIB]NAME)
  7473. + AC_SUBST([LTLIB]NAME)
  7474. + AC_SUBST([LIB]NAME[_PREFIX])
  7475. + popdef([NAME])
  7476. + popdef([Name])
  7477. +])
  7478. +
  7479. +dnl Determine the platform dependent parameters needed to use rpath:
  7480. +dnl acl_libext,
  7481. +dnl acl_shlibext,
  7482. +dnl acl_libname_spec,
  7483. +dnl acl_library_names_spec,
  7484. +dnl acl_hardcode_libdir_flag_spec,
  7485. +dnl acl_hardcode_libdir_separator,
  7486. +dnl acl_hardcode_direct,
  7487. +dnl acl_hardcode_minus_L.
  7488. +AC_DEFUN([AC_LIB_RPATH],
  7489. +[
  7490. + dnl Tell automake >= 1.10 to complain if config.rpath is missing.
  7491. + m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
  7492. + AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
  7493. + AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
  7494. + AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
  7495. + AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
  7496. + AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
  7497. + CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
  7498. + ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
  7499. + . ./conftest.sh
  7500. + rm -f ./conftest.sh
  7501. + acl_cv_rpath=done
  7502. + ])
  7503. + wl="$acl_cv_wl"
  7504. + acl_libext="$acl_cv_libext"
  7505. + acl_shlibext="$acl_cv_shlibext"
  7506. + acl_libname_spec="$acl_cv_libname_spec"
  7507. + acl_library_names_spec="$acl_cv_library_names_spec"
  7508. + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
  7509. + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
  7510. + acl_hardcode_direct="$acl_cv_hardcode_direct"
  7511. + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
  7512. + dnl Determine whether the user wants rpath handling at all.
  7513. + AC_ARG_ENABLE([rpath],
  7514. + [ --disable-rpath do not hardcode runtime library paths],
  7515. + :, enable_rpath=yes)
  7516. +])
  7517. +
  7518. +dnl AC_LIB_FROMPACKAGE(name, package)
  7519. +dnl declares that libname comes from the given package. The configure file
  7520. +dnl will then not have a --with-libname-prefix option but a
  7521. +dnl --with-package-prefix option. Several libraries can come from the same
  7522. +dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
  7523. +dnl macro call that searches for libname.
  7524. +AC_DEFUN([AC_LIB_FROMPACKAGE],
  7525. +[
  7526. + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  7527. + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  7528. + define([acl_frompackage_]NAME, [$2])
  7529. + popdef([NAME])
  7530. + pushdef([PACK],[$2])
  7531. + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
  7532. + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  7533. + define([acl_libsinpackage_]PACKUP,
  7534. + m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
  7535. + popdef([PACKUP])
  7536. + popdef([PACK])
  7537. +])
  7538. +
  7539. +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
  7540. +dnl the libraries corresponding to explicit and implicit dependencies.
  7541. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
  7542. +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
  7543. +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  7544. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
  7545. +[
  7546. + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  7547. + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  7548. + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  7549. + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
  7550. + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
  7551. + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  7552. + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
  7553. + dnl Autoconf >= 2.61 supports dots in --with options.
  7554. + pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
  7555. + dnl By default, look in $includedir and $libdir.
  7556. + use_additional=yes
  7557. + AC_LIB_WITH_FINAL_PREFIX([
  7558. + eval additional_includedir=\"$includedir\"
  7559. + eval additional_libdir=\"$libdir\"
  7560. + ])
  7561. + AC_ARG_WITH(P_A_C_K[-prefix],
  7562. +[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
  7563. + --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
  7564. +[
  7565. + if test "X$withval" = "Xno"; then
  7566. + use_additional=no
  7567. + else
  7568. + if test "X$withval" = "X"; then
  7569. + AC_LIB_WITH_FINAL_PREFIX([
  7570. + eval additional_includedir=\"$includedir\"
  7571. + eval additional_libdir=\"$libdir\"
  7572. + ])
  7573. + else
  7574. + additional_includedir="$withval/include"
  7575. + additional_libdir="$withval/$acl_libdirstem"
  7576. + if test "$acl_libdirstem2" != "$acl_libdirstem" \
  7577. + && ! test -d "$withval/$acl_libdirstem"; then
  7578. + additional_libdir="$withval/$acl_libdirstem2"
  7579. + fi
  7580. + fi
  7581. + fi
  7582. +])
  7583. + dnl Search the library and its dependencies in $additional_libdir and
  7584. + dnl $LDFLAGS. Using breadth-first-seach.
  7585. + LIB[]NAME=
  7586. + LTLIB[]NAME=
  7587. + INC[]NAME=
  7588. + LIB[]NAME[]_PREFIX=
  7589. + dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
  7590. + dnl computed. So it has to be reset here.
  7591. + HAVE_LIB[]NAME=
  7592. + rpathdirs=
  7593. + ltrpathdirs=
  7594. + names_already_handled=
  7595. + names_next_round='$1 $2'
  7596. + while test -n "$names_next_round"; do
  7597. + names_this_round="$names_next_round"
  7598. + names_next_round=
  7599. + for name in $names_this_round; do
  7600. + already_handled=
  7601. + for n in $names_already_handled; do
  7602. + if test "$n" = "$name"; then
  7603. + already_handled=yes
  7604. + break
  7605. + fi
  7606. + done
  7607. + if test -z "$already_handled"; then
  7608. + names_already_handled="$names_already_handled $name"
  7609. + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
  7610. + dnl or AC_LIB_HAVE_LINKFLAGS call.
  7611. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
  7612. + eval value=\"\$HAVE_LIB$uppername\"
  7613. + if test -n "$value"; then
  7614. + if test "$value" = yes; then
  7615. + eval value=\"\$LIB$uppername\"
  7616. + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
  7617. + eval value=\"\$LTLIB$uppername\"
  7618. + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
  7619. + else
  7620. + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
  7621. + dnl that this library doesn't exist. So just drop it.
  7622. + :
  7623. + fi
  7624. + else
  7625. + dnl Search the library lib$name in $additional_libdir and $LDFLAGS
  7626. + dnl and the already constructed $LIBNAME/$LTLIBNAME.
  7627. + found_dir=
  7628. + found_la=
  7629. + found_so=
  7630. + found_a=
  7631. + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
  7632. + if test -n "$acl_shlibext"; then
  7633. + shrext=".$acl_shlibext" # typically: shrext=.so
  7634. + else
  7635. + shrext=
  7636. + fi
  7637. + if test $use_additional = yes; then
  7638. + dir="$additional_libdir"
  7639. + dnl The same code as in the loop below:
  7640. + dnl First look for a shared library.
  7641. + if test -n "$acl_shlibext"; then
  7642. + if test -f "$dir/$libname$shrext"; then
  7643. + found_dir="$dir"
  7644. + found_so="$dir/$libname$shrext"
  7645. + else
  7646. + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
  7647. + ver=`(cd "$dir" && \
  7648. + for f in "$libname$shrext".*; do echo "$f"; done \
  7649. + | sed -e "s,^$libname$shrext\\\\.,," \
  7650. + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
  7651. + | sed 1q ) 2>/dev/null`
  7652. + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
  7653. + found_dir="$dir"
  7654. + found_so="$dir/$libname$shrext.$ver"
  7655. + fi
  7656. + else
  7657. + eval library_names=\"$acl_library_names_spec\"
  7658. + for f in $library_names; do
  7659. + if test -f "$dir/$f"; then
  7660. + found_dir="$dir"
  7661. + found_so="$dir/$f"
  7662. + break
  7663. + fi
  7664. + done
  7665. + fi
  7666. + fi
  7667. + fi
  7668. + dnl Then look for a static library.
  7669. + if test "X$found_dir" = "X"; then
  7670. + if test -f "$dir/$libname.$acl_libext"; then
  7671. + found_dir="$dir"
  7672. + found_a="$dir/$libname.$acl_libext"
  7673. + fi
  7674. + fi
  7675. + if test "X$found_dir" != "X"; then
  7676. + if test -f "$dir/$libname.la"; then
  7677. + found_la="$dir/$libname.la"
  7678. + fi
  7679. + fi
  7680. + fi
  7681. + if test "X$found_dir" = "X"; then
  7682. + for x in $LDFLAGS $LTLIB[]NAME; do
  7683. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  7684. + case "$x" in
  7685. + -L*)
  7686. + dir=`echo "X$x" | sed -e 's/^X-L//'`
  7687. + dnl First look for a shared library.
  7688. + if test -n "$acl_shlibext"; then
  7689. + if test -f "$dir/$libname$shrext"; then
  7690. + found_dir="$dir"
  7691. + found_so="$dir/$libname$shrext"
  7692. + else
  7693. + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
  7694. + ver=`(cd "$dir" && \
  7695. + for f in "$libname$shrext".*; do echo "$f"; done \
  7696. + | sed -e "s,^$libname$shrext\\\\.,," \
  7697. + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
  7698. + | sed 1q ) 2>/dev/null`
  7699. + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
  7700. + found_dir="$dir"
  7701. + found_so="$dir/$libname$shrext.$ver"
  7702. + fi
  7703. + else
  7704. + eval library_names=\"$acl_library_names_spec\"
  7705. + for f in $library_names; do
  7706. + if test -f "$dir/$f"; then
  7707. + found_dir="$dir"
  7708. + found_so="$dir/$f"
  7709. + break
  7710. + fi
  7711. + done
  7712. + fi
  7713. + fi
  7714. + fi
  7715. + dnl Then look for a static library.
  7716. + if test "X$found_dir" = "X"; then
  7717. + if test -f "$dir/$libname.$acl_libext"; then
  7718. + found_dir="$dir"
  7719. + found_a="$dir/$libname.$acl_libext"
  7720. + fi
  7721. + fi
  7722. + if test "X$found_dir" != "X"; then
  7723. + if test -f "$dir/$libname.la"; then
  7724. + found_la="$dir/$libname.la"
  7725. + fi
  7726. + fi
  7727. + ;;
  7728. + esac
  7729. + if test "X$found_dir" != "X"; then
  7730. + break
  7731. + fi
  7732. + done
  7733. + fi
  7734. + if test "X$found_dir" != "X"; then
  7735. + dnl Found the library.
  7736. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
  7737. + if test "X$found_so" != "X"; then
  7738. + dnl Linking with a shared library. We attempt to hardcode its
  7739. + dnl directory into the executable's runpath, unless it's the
  7740. + dnl standard /usr/lib.
  7741. + if test "$enable_rpath" = no \
  7742. + || test "X$found_dir" = "X/usr/$acl_libdirstem" \
  7743. + || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
  7744. + dnl No hardcoding is needed.
  7745. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  7746. + else
  7747. + dnl Use an explicit option to hardcode DIR into the resulting
  7748. + dnl binary.
  7749. + dnl Potentially add DIR to ltrpathdirs.
  7750. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  7751. + haveit=
  7752. + for x in $ltrpathdirs; do
  7753. + if test "X$x" = "X$found_dir"; then
  7754. + haveit=yes
  7755. + break
  7756. + fi
  7757. + done
  7758. + if test -z "$haveit"; then
  7759. + ltrpathdirs="$ltrpathdirs $found_dir"
  7760. + fi
  7761. + dnl The hardcoding into $LIBNAME is system dependent.
  7762. + if test "$acl_hardcode_direct" = yes; then
  7763. + dnl Using DIR/libNAME.so during linking hardcodes DIR into the
  7764. + dnl resulting binary.
  7765. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  7766. + else
  7767. + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
  7768. + dnl Use an explicit option to hardcode DIR into the resulting
  7769. + dnl binary.
  7770. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  7771. + dnl Potentially add DIR to rpathdirs.
  7772. + dnl The rpathdirs will be appended to $LIBNAME at the end.
  7773. + haveit=
  7774. + for x in $rpathdirs; do
  7775. + if test "X$x" = "X$found_dir"; then
  7776. + haveit=yes
  7777. + break
  7778. + fi
  7779. + done
  7780. + if test -z "$haveit"; then
  7781. + rpathdirs="$rpathdirs $found_dir"
  7782. + fi
  7783. + else
  7784. + dnl Rely on "-L$found_dir".
  7785. + dnl But don't add it if it's already contained in the LDFLAGS
  7786. + dnl or the already constructed $LIBNAME
  7787. + haveit=
  7788. + for x in $LDFLAGS $LIB[]NAME; do
  7789. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  7790. + if test "X$x" = "X-L$found_dir"; then
  7791. + haveit=yes
  7792. + break
  7793. + fi
  7794. + done
  7795. + if test -z "$haveit"; then
  7796. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
  7797. + fi
  7798. + if test "$acl_hardcode_minus_L" != no; then
  7799. + dnl FIXME: Not sure whether we should use
  7800. + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  7801. + dnl here.
  7802. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  7803. + else
  7804. + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
  7805. + dnl here, because this doesn't fit in flags passed to the
  7806. + dnl compiler. So give up. No hardcoding. This affects only
  7807. + dnl very old systems.
  7808. + dnl FIXME: Not sure whether we should use
  7809. + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  7810. + dnl here.
  7811. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  7812. + fi
  7813. + fi
  7814. + fi
  7815. + fi
  7816. + else
  7817. + if test "X$found_a" != "X"; then
  7818. + dnl Linking with a static library.
  7819. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
  7820. + else
  7821. + dnl We shouldn't come here, but anyway it's good to have a
  7822. + dnl fallback.
  7823. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
  7824. + fi
  7825. + fi
  7826. + dnl Assume the include files are nearby.
  7827. + additional_includedir=
  7828. + case "$found_dir" in
  7829. + */$acl_libdirstem | */$acl_libdirstem/)
  7830. + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
  7831. + if test "$name" = '$1'; then
  7832. + LIB[]NAME[]_PREFIX="$basedir"
  7833. + fi
  7834. + additional_includedir="$basedir/include"
  7835. + ;;
  7836. + */$acl_libdirstem2 | */$acl_libdirstem2/)
  7837. + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
  7838. + if test "$name" = '$1'; then
  7839. + LIB[]NAME[]_PREFIX="$basedir"
  7840. + fi
  7841. + additional_includedir="$basedir/include"
  7842. + ;;
  7843. + esac
  7844. + if test "X$additional_includedir" != "X"; then
  7845. + dnl Potentially add $additional_includedir to $INCNAME.
  7846. + dnl But don't add it
  7847. + dnl 1. if it's the standard /usr/include,
  7848. + dnl 2. if it's /usr/local/include and we are using GCC on Linux,
  7849. + dnl 3. if it's already present in $CPPFLAGS or the already
  7850. + dnl constructed $INCNAME,
  7851. + dnl 4. if it doesn't exist as a directory.
  7852. + if test "X$additional_includedir" != "X/usr/include"; then
  7853. + haveit=
  7854. + if test "X$additional_includedir" = "X/usr/local/include"; then
  7855. + if test -n "$GCC"; then
  7856. + case $host_os in
  7857. + linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  7858. + esac
  7859. + fi
  7860. + fi
  7861. + if test -z "$haveit"; then
  7862. + for x in $CPPFLAGS $INC[]NAME; do
  7863. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  7864. + if test "X$x" = "X-I$additional_includedir"; then
  7865. + haveit=yes
  7866. + break
  7867. + fi
  7868. + done
  7869. + if test -z "$haveit"; then
  7870. + if test -d "$additional_includedir"; then
  7871. + dnl Really add $additional_includedir to $INCNAME.
  7872. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
  7873. + fi
  7874. + fi
  7875. + fi
  7876. + fi
  7877. + fi
  7878. + dnl Look for dependencies.
  7879. + if test -n "$found_la"; then
  7880. + dnl Read the .la file. It defines the variables
  7881. + dnl dlname, library_names, old_library, dependency_libs, current,
  7882. + dnl age, revision, installed, dlopen, dlpreopen, libdir.
  7883. + save_libdir="$libdir"
  7884. + case "$found_la" in
  7885. + */* | *\\*) . "$found_la" ;;
  7886. + *) . "./$found_la" ;;
  7887. + esac
  7888. + libdir="$save_libdir"
  7889. + dnl We use only dependency_libs.
  7890. + for dep in $dependency_libs; do
  7891. + case "$dep" in
  7892. + -L*)
  7893. + additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
  7894. + dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
  7895. + dnl But don't add it
  7896. + dnl 1. if it's the standard /usr/lib,
  7897. + dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
  7898. + dnl 3. if it's already present in $LDFLAGS or the already
  7899. + dnl constructed $LIBNAME,
  7900. + dnl 4. if it doesn't exist as a directory.
  7901. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
  7902. + && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
  7903. + haveit=
  7904. + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
  7905. + || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
  7906. + if test -n "$GCC"; then
  7907. + case $host_os in
  7908. + linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  7909. + esac
  7910. + fi
  7911. + fi
  7912. + if test -z "$haveit"; then
  7913. + haveit=
  7914. + for x in $LDFLAGS $LIB[]NAME; do
  7915. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  7916. + if test "X$x" = "X-L$additional_libdir"; then
  7917. + haveit=yes
  7918. + break
  7919. + fi
  7920. + done
  7921. + if test -z "$haveit"; then
  7922. + if test -d "$additional_libdir"; then
  7923. + dnl Really add $additional_libdir to $LIBNAME.
  7924. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
  7925. + fi
  7926. + fi
  7927. + haveit=
  7928. + for x in $LDFLAGS $LTLIB[]NAME; do
  7929. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  7930. + if test "X$x" = "X-L$additional_libdir"; then
  7931. + haveit=yes
  7932. + break
  7933. + fi
  7934. + done
  7935. + if test -z "$haveit"; then
  7936. + if test -d "$additional_libdir"; then
  7937. + dnl Really add $additional_libdir to $LTLIBNAME.
  7938. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
  7939. + fi
  7940. + fi
  7941. + fi
  7942. + fi
  7943. + ;;
  7944. + -R*)
  7945. + dir=`echo "X$dep" | sed -e 's/^X-R//'`
  7946. + if test "$enable_rpath" != no; then
  7947. + dnl Potentially add DIR to rpathdirs.
  7948. + dnl The rpathdirs will be appended to $LIBNAME at the end.
  7949. + haveit=
  7950. + for x in $rpathdirs; do
  7951. + if test "X$x" = "X$dir"; then
  7952. + haveit=yes
  7953. + break
  7954. + fi
  7955. + done
  7956. + if test -z "$haveit"; then
  7957. + rpathdirs="$rpathdirs $dir"
  7958. + fi
  7959. + dnl Potentially add DIR to ltrpathdirs.
  7960. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  7961. + haveit=
  7962. + for x in $ltrpathdirs; do
  7963. + if test "X$x" = "X$dir"; then
  7964. + haveit=yes
  7965. + break
  7966. + fi
  7967. + done
  7968. + if test -z "$haveit"; then
  7969. + ltrpathdirs="$ltrpathdirs $dir"
  7970. + fi
  7971. + fi
  7972. + ;;
  7973. + -l*)
  7974. + dnl Handle this in the next round.
  7975. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
  7976. + ;;
  7977. + *.la)
  7978. + dnl Handle this in the next round. Throw away the .la's
  7979. + dnl directory; it is already contained in a preceding -L
  7980. + dnl option.
  7981. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
  7982. + ;;
  7983. + *)
  7984. + dnl Most likely an immediate library name.
  7985. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
  7986. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
  7987. + ;;
  7988. + esac
  7989. + done
  7990. + fi
  7991. + else
  7992. + dnl Didn't find the library; assume it is in the system directories
  7993. + dnl known to the linker and runtime loader. (All the system
  7994. + dnl directories known to the linker should also be known to the
  7995. + dnl runtime loader, otherwise the system is severely misconfigured.)
  7996. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  7997. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
  7998. + fi
  7999. + fi
  8000. + fi
  8001. + done
  8002. + done
  8003. + if test "X$rpathdirs" != "X"; then
  8004. + if test -n "$acl_hardcode_libdir_separator"; then
  8005. + dnl Weird platform: only the last -rpath option counts, the user must
  8006. + dnl pass all path elements in one option. We can arrange that for a
  8007. + dnl single library, but not when more than one $LIBNAMEs are used.
  8008. + alldirs=
  8009. + for found_dir in $rpathdirs; do
  8010. + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
  8011. + done
  8012. + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
  8013. + acl_save_libdir="$libdir"
  8014. + libdir="$alldirs"
  8015. + eval flag=\"$acl_hardcode_libdir_flag_spec\"
  8016. + libdir="$acl_save_libdir"
  8017. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  8018. + else
  8019. + dnl The -rpath options are cumulative.
  8020. + for found_dir in $rpathdirs; do
  8021. + acl_save_libdir="$libdir"
  8022. + libdir="$found_dir"
  8023. + eval flag=\"$acl_hardcode_libdir_flag_spec\"
  8024. + libdir="$acl_save_libdir"
  8025. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  8026. + done
  8027. + fi
  8028. + fi
  8029. + if test "X$ltrpathdirs" != "X"; then
  8030. + dnl When using libtool, the option that works for both libraries and
  8031. + dnl executables is -R. The -R options are cumulative.
  8032. + for found_dir in $ltrpathdirs; do
  8033. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
  8034. + done
  8035. + fi
  8036. + popdef([P_A_C_K])
  8037. + popdef([PACKLIBS])
  8038. + popdef([PACKUP])
  8039. + popdef([PACK])
  8040. + popdef([NAME])
  8041. +])
  8042. +
  8043. +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
  8044. +dnl unless already present in VAR.
  8045. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
  8046. +dnl contains two or three consecutive elements that belong together.
  8047. +AC_DEFUN([AC_LIB_APPENDTOVAR],
  8048. +[
  8049. + for element in [$2]; do
  8050. + haveit=
  8051. + for x in $[$1]; do
  8052. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  8053. + if test "X$x" = "X$element"; then
  8054. + haveit=yes
  8055. + break
  8056. + fi
  8057. + done
  8058. + if test -z "$haveit"; then
  8059. + [$1]="${[$1]}${[$1]:+ }$element"
  8060. + fi
  8061. + done
  8062. +])
  8063. +
  8064. +dnl For those cases where a variable contains several -L and -l options
  8065. +dnl referring to unknown libraries and directories, this macro determines the
  8066. +dnl necessary additional linker options for the runtime path.
  8067. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
  8068. +dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
  8069. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
  8070. +dnl otherwise linking without libtool is assumed.
  8071. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
  8072. +[
  8073. + AC_REQUIRE([AC_LIB_RPATH])
  8074. + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  8075. + $1=
  8076. + if test "$enable_rpath" != no; then
  8077. + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
  8078. + dnl Use an explicit option to hardcode directories into the resulting
  8079. + dnl binary.
  8080. + rpathdirs=
  8081. + next=
  8082. + for opt in $2; do
  8083. + if test -n "$next"; then
  8084. + dir="$next"
  8085. + dnl No need to hardcode the standard /usr/lib.
  8086. + if test "X$dir" != "X/usr/$acl_libdirstem" \
  8087. + && test "X$dir" != "X/usr/$acl_libdirstem2"; then
  8088. + rpathdirs="$rpathdirs $dir"
  8089. + fi
  8090. + next=
  8091. + else
  8092. + case $opt in
  8093. + -L) next=yes ;;
  8094. + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
  8095. + dnl No need to hardcode the standard /usr/lib.
  8096. + if test "X$dir" != "X/usr/$acl_libdirstem" \
  8097. + && test "X$dir" != "X/usr/$acl_libdirstem2"; then
  8098. + rpathdirs="$rpathdirs $dir"
  8099. + fi
  8100. + next= ;;
  8101. + *) next= ;;
  8102. + esac
  8103. + fi
  8104. + done
  8105. + if test "X$rpathdirs" != "X"; then
  8106. + if test -n ""$3""; then
  8107. + dnl libtool is used for linking. Use -R options.
  8108. + for dir in $rpathdirs; do
  8109. + $1="${$1}${$1:+ }-R$dir"
  8110. + done
  8111. + else
  8112. + dnl The linker is used for linking directly.
  8113. + if test -n "$acl_hardcode_libdir_separator"; then
  8114. + dnl Weird platform: only the last -rpath option counts, the user
  8115. + dnl must pass all path elements in one option.
  8116. + alldirs=
  8117. + for dir in $rpathdirs; do
  8118. + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
  8119. + done
  8120. + acl_save_libdir="$libdir"
  8121. + libdir="$alldirs"
  8122. + eval flag=\"$acl_hardcode_libdir_flag_spec\"
  8123. + libdir="$acl_save_libdir"
  8124. + $1="$flag"
  8125. + else
  8126. + dnl The -rpath options are cumulative.
  8127. + for dir in $rpathdirs; do
  8128. + acl_save_libdir="$libdir"
  8129. + libdir="$dir"
  8130. + eval flag=\"$acl_hardcode_libdir_flag_spec\"
  8131. + libdir="$acl_save_libdir"
  8132. + $1="${$1}${$1:+ }$flag"
  8133. + done
  8134. + fi
  8135. + fi
  8136. + fi
  8137. + fi
  8138. + fi
  8139. + AC_SUBST([$1])
  8140. +])
  8141. --- /dev/null
  8142. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/lib-prefix.m4
  8143. @@ -0,0 +1,224 @@
  8144. +# lib-prefix.m4 serial 7 (gettext-0.18)
  8145. +dnl Copyright (C) 2001-2005, 2008-2011 Free Software Foundation, Inc.
  8146. +dnl This file is free software; the Free Software Foundation
  8147. +dnl gives unlimited permission to copy and/or distribute it,
  8148. +dnl with or without modifications, as long as this notice is preserved.
  8149. +
  8150. +dnl From Bruno Haible.
  8151. +
  8152. +dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
  8153. +dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
  8154. +dnl require excessive bracketing.
  8155. +ifdef([AC_HELP_STRING],
  8156. +[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
  8157. +[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
  8158. +
  8159. +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
  8160. +dnl to access previously installed libraries. The basic assumption is that
  8161. +dnl a user will want packages to use other packages he previously installed
  8162. +dnl with the same --prefix option.
  8163. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
  8164. +dnl libraries, but is otherwise very convenient.
  8165. +AC_DEFUN([AC_LIB_PREFIX],
  8166. +[
  8167. + AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  8168. + AC_REQUIRE([AC_PROG_CC])
  8169. + AC_REQUIRE([AC_CANONICAL_HOST])
  8170. + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  8171. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  8172. + dnl By default, look in $includedir and $libdir.
  8173. + use_additional=yes
  8174. + AC_LIB_WITH_FINAL_PREFIX([
  8175. + eval additional_includedir=\"$includedir\"
  8176. + eval additional_libdir=\"$libdir\"
  8177. + ])
  8178. + AC_LIB_ARG_WITH([lib-prefix],
  8179. +[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
  8180. + --without-lib-prefix don't search for libraries in includedir and libdir],
  8181. +[
  8182. + if test "X$withval" = "Xno"; then
  8183. + use_additional=no
  8184. + else
  8185. + if test "X$withval" = "X"; then
  8186. + AC_LIB_WITH_FINAL_PREFIX([
  8187. + eval additional_includedir=\"$includedir\"
  8188. + eval additional_libdir=\"$libdir\"
  8189. + ])
  8190. + else
  8191. + additional_includedir="$withval/include"
  8192. + additional_libdir="$withval/$acl_libdirstem"
  8193. + fi
  8194. + fi
  8195. +])
  8196. + if test $use_additional = yes; then
  8197. + dnl Potentially add $additional_includedir to $CPPFLAGS.
  8198. + dnl But don't add it
  8199. + dnl 1. if it's the standard /usr/include,
  8200. + dnl 2. if it's already present in $CPPFLAGS,
  8201. + dnl 3. if it's /usr/local/include and we are using GCC on Linux,
  8202. + dnl 4. if it doesn't exist as a directory.
  8203. + if test "X$additional_includedir" != "X/usr/include"; then
  8204. + haveit=
  8205. + for x in $CPPFLAGS; do
  8206. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  8207. + if test "X$x" = "X-I$additional_includedir"; then
  8208. + haveit=yes
  8209. + break
  8210. + fi
  8211. + done
  8212. + if test -z "$haveit"; then
  8213. + if test "X$additional_includedir" = "X/usr/local/include"; then
  8214. + if test -n "$GCC"; then
  8215. + case $host_os in
  8216. + linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  8217. + esac
  8218. + fi
  8219. + fi
  8220. + if test -z "$haveit"; then
  8221. + if test -d "$additional_includedir"; then
  8222. + dnl Really add $additional_includedir to $CPPFLAGS.
  8223. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
  8224. + fi
  8225. + fi
  8226. + fi
  8227. + fi
  8228. + dnl Potentially add $additional_libdir to $LDFLAGS.
  8229. + dnl But don't add it
  8230. + dnl 1. if it's the standard /usr/lib,
  8231. + dnl 2. if it's already present in $LDFLAGS,
  8232. + dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
  8233. + dnl 4. if it doesn't exist as a directory.
  8234. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
  8235. + haveit=
  8236. + for x in $LDFLAGS; do
  8237. + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  8238. + if test "X$x" = "X-L$additional_libdir"; then
  8239. + haveit=yes
  8240. + break
  8241. + fi
  8242. + done
  8243. + if test -z "$haveit"; then
  8244. + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
  8245. + if test -n "$GCC"; then
  8246. + case $host_os in
  8247. + linux*) haveit=yes;;
  8248. + esac
  8249. + fi
  8250. + fi
  8251. + if test -z "$haveit"; then
  8252. + if test -d "$additional_libdir"; then
  8253. + dnl Really add $additional_libdir to $LDFLAGS.
  8254. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
  8255. + fi
  8256. + fi
  8257. + fi
  8258. + fi
  8259. + fi
  8260. +])
  8261. +
  8262. +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
  8263. +dnl acl_final_exec_prefix, containing the values to which $prefix and
  8264. +dnl $exec_prefix will expand at the end of the configure script.
  8265. +AC_DEFUN([AC_LIB_PREPARE_PREFIX],
  8266. +[
  8267. + dnl Unfortunately, prefix and exec_prefix get only finally determined
  8268. + dnl at the end of configure.
  8269. + if test "X$prefix" = "XNONE"; then
  8270. + acl_final_prefix="$ac_default_prefix"
  8271. + else
  8272. + acl_final_prefix="$prefix"
  8273. + fi
  8274. + if test "X$exec_prefix" = "XNONE"; then
  8275. + acl_final_exec_prefix='${prefix}'
  8276. + else
  8277. + acl_final_exec_prefix="$exec_prefix"
  8278. + fi
  8279. + acl_save_prefix="$prefix"
  8280. + prefix="$acl_final_prefix"
  8281. + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  8282. + prefix="$acl_save_prefix"
  8283. +])
  8284. +
  8285. +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
  8286. +dnl variables prefix and exec_prefix bound to the values they will have
  8287. +dnl at the end of the configure script.
  8288. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
  8289. +[
  8290. + acl_save_prefix="$prefix"
  8291. + prefix="$acl_final_prefix"
  8292. + acl_save_exec_prefix="$exec_prefix"
  8293. + exec_prefix="$acl_final_exec_prefix"
  8294. + $1
  8295. + exec_prefix="$acl_save_exec_prefix"
  8296. + prefix="$acl_save_prefix"
  8297. +])
  8298. +
  8299. +dnl AC_LIB_PREPARE_MULTILIB creates
  8300. +dnl - a variable acl_libdirstem, containing the basename of the libdir, either
  8301. +dnl "lib" or "lib64" or "lib/64",
  8302. +dnl - a variable acl_libdirstem2, as a secondary possible value for
  8303. +dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
  8304. +dnl "lib/amd64".
  8305. +AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
  8306. +[
  8307. + dnl There is no formal standard regarding lib and lib64.
  8308. + dnl On glibc systems, the current practice is that on a system supporting
  8309. + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  8310. + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
  8311. + dnl the compiler's default mode by looking at the compiler's library search
  8312. + dnl path. If at least one of its elements ends in /lib64 or points to a
  8313. + dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
  8314. + dnl Otherwise we use the default, namely "lib".
  8315. + dnl On Solaris systems, the current practice is that on a system supporting
  8316. + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  8317. + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
  8318. + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
  8319. + AC_REQUIRE([AC_CANONICAL_HOST])
  8320. + acl_libdirstem=lib
  8321. + acl_libdirstem2=
  8322. + case "$host_os" in
  8323. + solaris*)
  8324. + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
  8325. + dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
  8326. + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
  8327. + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
  8328. + dnl symlink is missing, so we set acl_libdirstem2 too.
  8329. + AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
  8330. + [AC_EGREP_CPP([sixtyfour bits], [
  8331. +#ifdef _LP64
  8332. +sixtyfour bits
  8333. +#endif
  8334. + ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
  8335. + ])
  8336. + if test $gl_cv_solaris_64bit = yes; then
  8337. + acl_libdirstem=lib/64
  8338. + case "$host_cpu" in
  8339. + sparc*) acl_libdirstem2=lib/sparcv9 ;;
  8340. + i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
  8341. + esac
  8342. + fi
  8343. + ;;
  8344. + *)
  8345. + searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  8346. + if test -n "$searchpath"; then
  8347. + acl_save_IFS="${IFS= }"; IFS=":"
  8348. + for searchdir in $searchpath; do
  8349. + if test -d "$searchdir"; then
  8350. + case "$searchdir" in
  8351. + */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
  8352. + */../ | */.. )
  8353. + # Better ignore directories of this form. They are misleading.
  8354. + ;;
  8355. + *) searchdir=`cd "$searchdir" && pwd`
  8356. + case "$searchdir" in
  8357. + */lib64 ) acl_libdirstem=lib64 ;;
  8358. + esac ;;
  8359. + esac
  8360. + fi
  8361. + done
  8362. + IFS="$acl_save_IFS"
  8363. + fi
  8364. + ;;
  8365. + esac
  8366. + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
  8367. +])
  8368. --- /dev/null
  8369. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/ltmain.sh
  8370. @@ -0,0 +1,11156 @@
  8371. +#! /bin/sh
  8372. +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
  8373. +## by inline-source v2014-01-03.01
  8374. +
  8375. +# libtool (GNU libtool) 2.4.6
  8376. +# Provide generalized library-building support services.
  8377. +# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  8378. +
  8379. +# Copyright (C) 1996-2015 Free Software Foundation, Inc.
  8380. +# This is free software; see the source for copying conditions. There is NO
  8381. +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8382. +
  8383. +# GNU Libtool is free software; you can redistribute it and/or modify
  8384. +# it under the terms of the GNU General Public License as published by
  8385. +# the Free Software Foundation; either version 2 of the License, or
  8386. +# (at your option) any later version.
  8387. +#
  8388. +# As a special exception to the GNU General Public License,
  8389. +# if you distribute this file as part of a program or library that
  8390. +# is built using GNU Libtool, you may include this file under the
  8391. +# same distribution terms that you use for the rest of that program.
  8392. +#
  8393. +# GNU Libtool is distributed in the hope that it will be useful, but
  8394. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  8395. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  8396. +# General Public License for more details.
  8397. +#
  8398. +# You should have received a copy of the GNU General Public License
  8399. +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  8400. +
  8401. +
  8402. +PROGRAM=libtool
  8403. +PACKAGE=libtool
  8404. +VERSION="2.4.6 Debian-2.4.6-2"
  8405. +package_revision=2.4.6
  8406. +
  8407. +
  8408. +## ------ ##
  8409. +## Usage. ##
  8410. +## ------ ##
  8411. +
  8412. +# Run './libtool --help' for help with using this script from the
  8413. +# command line.
  8414. +
  8415. +
  8416. +## ------------------------------- ##
  8417. +## User overridable command paths. ##
  8418. +## ------------------------------- ##
  8419. +
  8420. +# After configure completes, it has a better idea of some of the
  8421. +# shell tools we need than the defaults used by the functions shared
  8422. +# with bootstrap, so set those here where they can still be over-
  8423. +# ridden by the user, but otherwise take precedence.
  8424. +
  8425. +: ${AUTOCONF="autoconf"}
  8426. +: ${AUTOMAKE="automake"}
  8427. +
  8428. +
  8429. +## -------------------------- ##
  8430. +## Source external libraries. ##
  8431. +## -------------------------- ##
  8432. +
  8433. +# Much of our low-level functionality needs to be sourced from external
  8434. +# libraries, which are installed to $pkgauxdir.
  8435. +
  8436. +# Set a version string for this script.
  8437. +scriptversion=2015-01-20.17; # UTC
  8438. +
  8439. +# General shell script boiler plate, and helper functions.
  8440. +# Written by Gary V. Vaughan, 2004
  8441. +
  8442. +# Copyright (C) 2004-2015 Free Software Foundation, Inc.
  8443. +# This is free software; see the source for copying conditions. There is NO
  8444. +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8445. +
  8446. +# This program is free software; you can redistribute it and/or modify
  8447. +# it under the terms of the GNU General Public License as published by
  8448. +# the Free Software Foundation; either version 3 of the License, or
  8449. +# (at your option) any later version.
  8450. +
  8451. +# As a special exception to the GNU General Public License, if you distribute
  8452. +# this file as part of a program or library that is built using GNU Libtool,
  8453. +# you may include this file under the same distribution terms that you use
  8454. +# for the rest of that program.
  8455. +
  8456. +# This program is distributed in the hope that it will be useful,
  8457. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  8458. +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
  8459. +# General Public License for more details.
  8460. +
  8461. +# You should have received a copy of the GNU General Public License
  8462. +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  8463. +
  8464. +# Please report bugs or propose patches to gary@gnu.org.
  8465. +
  8466. +
  8467. +## ------ ##
  8468. +## Usage. ##
  8469. +## ------ ##
  8470. +
  8471. +# Evaluate this file near the top of your script to gain access to
  8472. +# the functions and variables defined here:
  8473. +#
  8474. +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
  8475. +#
  8476. +# If you need to override any of the default environment variable
  8477. +# settings, do that before evaluating this file.
  8478. +
  8479. +
  8480. +## -------------------- ##
  8481. +## Shell normalisation. ##
  8482. +## -------------------- ##
  8483. +
  8484. +# Some shells need a little help to be as Bourne compatible as possible.
  8485. +# Before doing anything else, make sure all that help has been provided!
  8486. +
  8487. +DUALCASE=1; export DUALCASE # for MKS sh
  8488. +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  8489. + emulate sh
  8490. + NULLCMD=:
  8491. + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  8492. + # is contrary to our usage. Disable this feature.
  8493. + alias -g '${1+"$@"}'='"$@"'
  8494. + setopt NO_GLOB_SUBST
  8495. +else
  8496. + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
  8497. +fi
  8498. +
  8499. +# NLS nuisances: We save the old values in case they are required later.
  8500. +_G_user_locale=
  8501. +_G_safe_locale=
  8502. +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  8503. +do
  8504. + eval "if test set = \"\${$_G_var+set}\"; then
  8505. + save_$_G_var=\$$_G_var
  8506. + $_G_var=C
  8507. + export $_G_var
  8508. + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
  8509. + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
  8510. + fi"
  8511. +done
  8512. +
  8513. +# CDPATH.
  8514. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  8515. +
  8516. +# Make sure IFS has a sensible default
  8517. +sp=' '
  8518. +nl='
  8519. +'
  8520. +IFS="$sp $nl"
  8521. +
  8522. +# There are apparently some retarded systems that use ';' as a PATH separator!
  8523. +if test "${PATH_SEPARATOR+set}" != set; then
  8524. + PATH_SEPARATOR=:
  8525. + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
  8526. + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
  8527. + PATH_SEPARATOR=';'
  8528. + }
  8529. +fi
  8530. +
  8531. +
  8532. +
  8533. +## ------------------------- ##
  8534. +## Locate command utilities. ##
  8535. +## ------------------------- ##
  8536. +
  8537. +
  8538. +# func_executable_p FILE
  8539. +# ----------------------
  8540. +# Check that FILE is an executable regular file.
  8541. +func_executable_p ()
  8542. +{
  8543. + test -f "$1" && test -x "$1"
  8544. +}
  8545. +
  8546. +
  8547. +# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
  8548. +# --------------------------------------------
  8549. +# Search for either a program that responds to --version with output
  8550. +# containing "GNU", or else returned by CHECK_FUNC otherwise, by
  8551. +# trying all the directories in PATH with each of the elements of
  8552. +# PROGS_LIST.
  8553. +#
  8554. +# CHECK_FUNC should accept the path to a candidate program, and
  8555. +# set $func_check_prog_result if it truncates its output less than
  8556. +# $_G_path_prog_max characters.
  8557. +func_path_progs ()
  8558. +{
  8559. + _G_progs_list=$1
  8560. + _G_check_func=$2
  8561. + _G_PATH=${3-"$PATH"}
  8562. +
  8563. + _G_path_prog_max=0
  8564. + _G_path_prog_found=false
  8565. + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
  8566. + for _G_dir in $_G_PATH; do
  8567. + IFS=$_G_save_IFS
  8568. + test -z "$_G_dir" && _G_dir=.
  8569. + for _G_prog_name in $_G_progs_list; do
  8570. + for _exeext in '' .EXE; do
  8571. + _G_path_prog=$_G_dir/$_G_prog_name$_exeext
  8572. + func_executable_p "$_G_path_prog" || continue
  8573. + case `"$_G_path_prog" --version 2>&1` in
  8574. + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
  8575. + *) $_G_check_func $_G_path_prog
  8576. + func_path_progs_result=$func_check_prog_result
  8577. + ;;
  8578. + esac
  8579. + $_G_path_prog_found && break 3
  8580. + done
  8581. + done
  8582. + done
  8583. + IFS=$_G_save_IFS
  8584. + test -z "$func_path_progs_result" && {
  8585. + echo "no acceptable sed could be found in \$PATH" >&2
  8586. + exit 1
  8587. + }
  8588. +}
  8589. +
  8590. +
  8591. +# We want to be able to use the functions in this file before configure
  8592. +# has figured out where the best binaries are kept, which means we have
  8593. +# to search for them ourselves - except when the results are already set
  8594. +# where we skip the searches.
  8595. +
  8596. +# Unless the user overrides by setting SED, search the path for either GNU
  8597. +# sed, or the sed that truncates its output the least.
  8598. +test -z "$SED" && {
  8599. + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
  8600. + for _G_i in 1 2 3 4 5 6 7; do
  8601. + _G_sed_script=$_G_sed_script$nl$_G_sed_script
  8602. + done
  8603. + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
  8604. + _G_sed_script=
  8605. +
  8606. + func_check_prog_sed ()
  8607. + {
  8608. + _G_path_prog=$1
  8609. +
  8610. + _G_count=0
  8611. + printf 0123456789 >conftest.in
  8612. + while :
  8613. + do
  8614. + cat conftest.in conftest.in >conftest.tmp
  8615. + mv conftest.tmp conftest.in
  8616. + cp conftest.in conftest.nl
  8617. + echo '' >> conftest.nl
  8618. + "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
  8619. + diff conftest.out conftest.nl >/dev/null 2>&1 || break
  8620. + _G_count=`expr $_G_count + 1`
  8621. + if test "$_G_count" -gt "$_G_path_prog_max"; then
  8622. + # Best one so far, save it but keep looking for a better one
  8623. + func_check_prog_result=$_G_path_prog
  8624. + _G_path_prog_max=$_G_count
  8625. + fi
  8626. + # 10*(2^10) chars as input seems more than enough
  8627. + test 10 -lt "$_G_count" && break
  8628. + done
  8629. + rm -f conftest.in conftest.tmp conftest.nl conftest.out
  8630. + }
  8631. +
  8632. + func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
  8633. + rm -f conftest.sed
  8634. + SED=$func_path_progs_result
  8635. +}
  8636. +
  8637. +
  8638. +# Unless the user overrides by setting GREP, search the path for either GNU
  8639. +# grep, or the grep that truncates its output the least.
  8640. +test -z "$GREP" && {
  8641. + func_check_prog_grep ()
  8642. + {
  8643. + _G_path_prog=$1
  8644. +
  8645. + _G_count=0
  8646. + _G_path_prog_max=0
  8647. + printf 0123456789 >conftest.in
  8648. + while :
  8649. + do
  8650. + cat conftest.in conftest.in >conftest.tmp
  8651. + mv conftest.tmp conftest.in
  8652. + cp conftest.in conftest.nl
  8653. + echo 'GREP' >> conftest.nl
  8654. + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
  8655. + diff conftest.out conftest.nl >/dev/null 2>&1 || break
  8656. + _G_count=`expr $_G_count + 1`
  8657. + if test "$_G_count" -gt "$_G_path_prog_max"; then
  8658. + # Best one so far, save it but keep looking for a better one
  8659. + func_check_prog_result=$_G_path_prog
  8660. + _G_path_prog_max=$_G_count
  8661. + fi
  8662. + # 10*(2^10) chars as input seems more than enough
  8663. + test 10 -lt "$_G_count" && break
  8664. + done
  8665. + rm -f conftest.in conftest.tmp conftest.nl conftest.out
  8666. + }
  8667. +
  8668. + func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
  8669. + GREP=$func_path_progs_result
  8670. +}
  8671. +
  8672. +
  8673. +## ------------------------------- ##
  8674. +## User overridable command paths. ##
  8675. +## ------------------------------- ##
  8676. +
  8677. +# All uppercase variable names are used for environment variables. These
  8678. +# variables can be overridden by the user before calling a script that
  8679. +# uses them if a suitable command of that name is not already available
  8680. +# in the command search PATH.
  8681. +
  8682. +: ${CP="cp -f"}
  8683. +: ${ECHO="printf %s\n"}
  8684. +: ${EGREP="$GREP -E"}
  8685. +: ${FGREP="$GREP -F"}
  8686. +: ${LN_S="ln -s"}
  8687. +: ${MAKE="make"}
  8688. +: ${MKDIR="mkdir"}
  8689. +: ${MV="mv -f"}
  8690. +: ${RM="rm -f"}
  8691. +: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
  8692. +
  8693. +
  8694. +## -------------------- ##
  8695. +## Useful sed snippets. ##
  8696. +## -------------------- ##
  8697. +
  8698. +sed_dirname='s|/[^/]*$||'
  8699. +sed_basename='s|^.*/||'
  8700. +
  8701. +# Sed substitution that helps us do robust quoting. It backslashifies
  8702. +# metacharacters that are still active within double-quoted strings.
  8703. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
  8704. +
  8705. +# Same as above, but do not quote variable references.
  8706. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
  8707. +
  8708. +# Sed substitution that turns a string into a regex matching for the
  8709. +# string literally.
  8710. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
  8711. +
  8712. +# Sed substitution that converts a w32 file name or path
  8713. +# that contains forward slashes, into one that contains
  8714. +# (escaped) backslashes. A very naive implementation.
  8715. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  8716. +
  8717. +# Re-'\' parameter expansions in output of sed_double_quote_subst that
  8718. +# were '\'-ed in input to the same. If an odd number of '\' preceded a
  8719. +# '$' in input to sed_double_quote_subst, that '$' was protected from
  8720. +# expansion. Since each input '\' is now two '\'s, look for any number
  8721. +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
  8722. +_G_bs='\\'
  8723. +_G_bs2='\\\\'
  8724. +_G_bs4='\\\\\\\\'
  8725. +_G_dollar='\$'
  8726. +sed_double_backslash="\
  8727. + s/$_G_bs4/&\\
  8728. +/g
  8729. + s/^$_G_bs2$_G_dollar/$_G_bs&/
  8730. + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
  8731. + s/\n//g"
  8732. +
  8733. +
  8734. +## ----------------- ##
  8735. +## Global variables. ##
  8736. +## ----------------- ##
  8737. +
  8738. +# Except for the global variables explicitly listed below, the following
  8739. +# functions in the '^func_' namespace, and the '^require_' namespace
  8740. +# variables initialised in the 'Resource management' section, sourcing
  8741. +# this file will not pollute your global namespace with anything
  8742. +# else. There's no portable way to scope variables in Bourne shell
  8743. +# though, so actually running these functions will sometimes place
  8744. +# results into a variable named after the function, and often use
  8745. +# temporary variables in the '^_G_' namespace. If you are careful to
  8746. +# avoid using those namespaces casually in your sourcing script, things
  8747. +# should continue to work as you expect. And, of course, you can freely
  8748. +# overwrite any of the functions or variables defined here before
  8749. +# calling anything to customize them.
  8750. +
  8751. +EXIT_SUCCESS=0
  8752. +EXIT_FAILURE=1
  8753. +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
  8754. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
  8755. +
  8756. +# Allow overriding, eg assuming that you follow the convention of
  8757. +# putting '$debug_cmd' at the start of all your functions, you can get
  8758. +# bash to show function call trace with:
  8759. +#
  8760. +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
  8761. +debug_cmd=${debug_cmd-":"}
  8762. +exit_cmd=:
  8763. +
  8764. +# By convention, finish your script with:
  8765. +#
  8766. +# exit $exit_status
  8767. +#
  8768. +# so that you can set exit_status to non-zero if you want to indicate
  8769. +# something went wrong during execution without actually bailing out at
  8770. +# the point of failure.
  8771. +exit_status=$EXIT_SUCCESS
  8772. +
  8773. +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  8774. +# is ksh but when the shell is invoked as "sh" and the current value of
  8775. +# the _XPG environment variable is not equal to 1 (one), the special
  8776. +# positional parameter $0, within a function call, is the name of the
  8777. +# function.
  8778. +progpath=$0
  8779. +
  8780. +# The name of this program.
  8781. +progname=`$ECHO "$progpath" |$SED "$sed_basename"`
  8782. +
  8783. +# Make sure we have an absolute progpath for reexecution:
  8784. +case $progpath in
  8785. + [\\/]*|[A-Za-z]:\\*) ;;
  8786. + *[\\/]*)
  8787. + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
  8788. + progdir=`cd "$progdir" && pwd`
  8789. + progpath=$progdir/$progname
  8790. + ;;
  8791. + *)
  8792. + _G_IFS=$IFS
  8793. + IFS=${PATH_SEPARATOR-:}
  8794. + for progdir in $PATH; do
  8795. + IFS=$_G_IFS
  8796. + test -x "$progdir/$progname" && break
  8797. + done
  8798. + IFS=$_G_IFS
  8799. + test -n "$progdir" || progdir=`pwd`
  8800. + progpath=$progdir/$progname
  8801. + ;;
  8802. +esac
  8803. +
  8804. +
  8805. +## ----------------- ##
  8806. +## Standard options. ##
  8807. +## ----------------- ##
  8808. +
  8809. +# The following options affect the operation of the functions defined
  8810. +# below, and should be set appropriately depending on run-time para-
  8811. +# meters passed on the command line.
  8812. +
  8813. +opt_dry_run=false
  8814. +opt_quiet=false
  8815. +opt_verbose=false
  8816. +
  8817. +# Categories 'all' and 'none' are always available. Append any others
  8818. +# you will pass as the first argument to func_warning from your own
  8819. +# code.
  8820. +warning_categories=
  8821. +
  8822. +# By default, display warnings according to 'opt_warning_types'. Set
  8823. +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to
  8824. +# treat the next displayed warning as a fatal error.
  8825. +warning_func=func_warn_and_continue
  8826. +
  8827. +# Set to 'all' to display all warnings, 'none' to suppress all
  8828. +# warnings, or a space delimited list of some subset of
  8829. +# 'warning_categories' to display only the listed warnings.
  8830. +opt_warning_types=all
  8831. +
  8832. +
  8833. +## -------------------- ##
  8834. +## Resource management. ##
  8835. +## -------------------- ##
  8836. +
  8837. +# This section contains definitions for functions that each ensure a
  8838. +# particular resource (a file, or a non-empty configuration variable for
  8839. +# example) is available, and if appropriate to extract default values
  8840. +# from pertinent package files. Call them using their associated
  8841. +# 'require_*' variable to ensure that they are executed, at most, once.
  8842. +#
  8843. +# It's entirely deliberate that calling these functions can set
  8844. +# variables that don't obey the namespace limitations obeyed by the rest
  8845. +# of this file, in order that that they be as useful as possible to
  8846. +# callers.
  8847. +
  8848. +
  8849. +# require_term_colors
  8850. +# -------------------
  8851. +# Allow display of bold text on terminals that support it.
  8852. +require_term_colors=func_require_term_colors
  8853. +func_require_term_colors ()
  8854. +{
  8855. + $debug_cmd
  8856. +
  8857. + test -t 1 && {
  8858. + # COLORTERM and USE_ANSI_COLORS environment variables take
  8859. + # precedence, because most terminfo databases neglect to describe
  8860. + # whether color sequences are supported.
  8861. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
  8862. +
  8863. + if test 1 = "$USE_ANSI_COLORS"; then
  8864. + # Standard ANSI escape sequences
  8865. + tc_reset=''
  8866. + tc_bold=''; tc_standout=''
  8867. + tc_red=''; tc_green=''
  8868. + tc_blue=''; tc_cyan=''
  8869. + else
  8870. + # Otherwise trust the terminfo database after all.
  8871. + test -n "`tput sgr0 2>/dev/null`" && {
  8872. + tc_reset=`tput sgr0`
  8873. + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
  8874. + tc_standout=$tc_bold
  8875. + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
  8876. + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
  8877. + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
  8878. + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
  8879. + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
  8880. + }
  8881. + fi
  8882. + }
  8883. +
  8884. + require_term_colors=:
  8885. +}
  8886. +
  8887. +
  8888. +## ----------------- ##
  8889. +## Function library. ##
  8890. +## ----------------- ##
  8891. +
  8892. +# This section contains a variety of useful functions to call in your
  8893. +# scripts. Take note of the portable wrappers for features provided by
  8894. +# some modern shells, which will fall back to slower equivalents on
  8895. +# less featureful shells.
  8896. +
  8897. +
  8898. +# func_append VAR VALUE
  8899. +# ---------------------
  8900. +# Append VALUE onto the existing contents of VAR.
  8901. +
  8902. + # We should try to minimise forks, especially on Windows where they are
  8903. + # unreasonably slow, so skip the feature probes when bash or zsh are
  8904. + # being used:
  8905. + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
  8906. + : ${_G_HAVE_ARITH_OP="yes"}
  8907. + : ${_G_HAVE_XSI_OPS="yes"}
  8908. + # The += operator was introduced in bash 3.1
  8909. + case $BASH_VERSION in
  8910. + [12].* | 3.0 | 3.0*) ;;
  8911. + *)
  8912. + : ${_G_HAVE_PLUSEQ_OP="yes"}
  8913. + ;;
  8914. + esac
  8915. + fi
  8916. +
  8917. + # _G_HAVE_PLUSEQ_OP
  8918. + # Can be empty, in which case the shell is probed, "yes" if += is
  8919. + # useable or anything else if it does not work.
  8920. + test -z "$_G_HAVE_PLUSEQ_OP" \
  8921. + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
  8922. + && _G_HAVE_PLUSEQ_OP=yes
  8923. +
  8924. +if test yes = "$_G_HAVE_PLUSEQ_OP"
  8925. +then
  8926. + # This is an XSI compatible shell, allowing a faster implementation...
  8927. + eval 'func_append ()
  8928. + {
  8929. + $debug_cmd
  8930. +
  8931. + eval "$1+=\$2"
  8932. + }'
  8933. +else
  8934. + # ...otherwise fall back to using expr, which is often a shell builtin.
  8935. + func_append ()
  8936. + {
  8937. + $debug_cmd
  8938. +
  8939. + eval "$1=\$$1\$2"
  8940. + }
  8941. +fi
  8942. +
  8943. +
  8944. +# func_append_quoted VAR VALUE
  8945. +# ----------------------------
  8946. +# Quote VALUE and append to the end of shell variable VAR, separated
  8947. +# by a space.
  8948. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then
  8949. + eval 'func_append_quoted ()
  8950. + {
  8951. + $debug_cmd
  8952. +
  8953. + func_quote_for_eval "$2"
  8954. + eval "$1+=\\ \$func_quote_for_eval_result"
  8955. + }'
  8956. +else
  8957. + func_append_quoted ()
  8958. + {
  8959. + $debug_cmd
  8960. +
  8961. + func_quote_for_eval "$2"
  8962. + eval "$1=\$$1\\ \$func_quote_for_eval_result"
  8963. + }
  8964. +fi
  8965. +
  8966. +
  8967. +# func_append_uniq VAR VALUE
  8968. +# --------------------------
  8969. +# Append unique VALUE onto the existing contents of VAR, assuming
  8970. +# entries are delimited by the first character of VALUE. For example:
  8971. +#
  8972. +# func_append_uniq options " --another-option option-argument"
  8973. +#
  8974. +# will only append to $options if " --another-option option-argument "
  8975. +# is not already present somewhere in $options already (note spaces at
  8976. +# each end implied by leading space in second argument).
  8977. +func_append_uniq ()
  8978. +{
  8979. + $debug_cmd
  8980. +
  8981. + eval _G_current_value='`$ECHO $'$1'`'
  8982. + _G_delim=`expr "$2" : '\(.\)'`
  8983. +
  8984. + case $_G_delim$_G_current_value$_G_delim in
  8985. + *"$2$_G_delim"*) ;;
  8986. + *) func_append "$@" ;;
  8987. + esac
  8988. +}
  8989. +
  8990. +
  8991. +# func_arith TERM...
  8992. +# ------------------
  8993. +# Set func_arith_result to the result of evaluating TERMs.
  8994. + test -z "$_G_HAVE_ARITH_OP" \
  8995. + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
  8996. + && _G_HAVE_ARITH_OP=yes
  8997. +
  8998. +if test yes = "$_G_HAVE_ARITH_OP"; then
  8999. + eval 'func_arith ()
  9000. + {
  9001. + $debug_cmd
  9002. +
  9003. + func_arith_result=$(( $* ))
  9004. + }'
  9005. +else
  9006. + func_arith ()
  9007. + {
  9008. + $debug_cmd
  9009. +
  9010. + func_arith_result=`expr "$@"`
  9011. + }
  9012. +fi
  9013. +
  9014. +
  9015. +# func_basename FILE
  9016. +# ------------------
  9017. +# Set func_basename_result to FILE with everything up to and including
  9018. +# the last / stripped.
  9019. +if test yes = "$_G_HAVE_XSI_OPS"; then
  9020. + # If this shell supports suffix pattern removal, then use it to avoid
  9021. + # forking. Hide the definitions single quotes in case the shell chokes
  9022. + # on unsupported syntax...
  9023. + _b='func_basename_result=${1##*/}'
  9024. + _d='case $1 in
  9025. + */*) func_dirname_result=${1%/*}$2 ;;
  9026. + * ) func_dirname_result=$3 ;;
  9027. + esac'
  9028. +
  9029. +else
  9030. + # ...otherwise fall back to using sed.
  9031. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
  9032. + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
  9033. + if test "X$func_dirname_result" = "X$1"; then
  9034. + func_dirname_result=$3
  9035. + else
  9036. + func_append func_dirname_result "$2"
  9037. + fi'
  9038. +fi
  9039. +
  9040. +eval 'func_basename ()
  9041. +{
  9042. + $debug_cmd
  9043. +
  9044. + '"$_b"'
  9045. +}'
  9046. +
  9047. +
  9048. +# func_dirname FILE APPEND NONDIR_REPLACEMENT
  9049. +# -------------------------------------------
  9050. +# Compute the dirname of FILE. If nonempty, add APPEND to the result,
  9051. +# otherwise set result to NONDIR_REPLACEMENT.
  9052. +eval 'func_dirname ()
  9053. +{
  9054. + $debug_cmd
  9055. +
  9056. + '"$_d"'
  9057. +}'
  9058. +
  9059. +
  9060. +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
  9061. +# --------------------------------------------------------
  9062. +# Perform func_basename and func_dirname in a single function
  9063. +# call:
  9064. +# dirname: Compute the dirname of FILE. If nonempty,
  9065. +# add APPEND to the result, otherwise set result
  9066. +# to NONDIR_REPLACEMENT.
  9067. +# value returned in "$func_dirname_result"
  9068. +# basename: Compute filename of FILE.
  9069. +# value retuned in "$func_basename_result"
  9070. +# For efficiency, we do not delegate to the functions above but instead
  9071. +# duplicate the functionality here.
  9072. +eval 'func_dirname_and_basename ()
  9073. +{
  9074. + $debug_cmd
  9075. +
  9076. + '"$_b"'
  9077. + '"$_d"'
  9078. +}'
  9079. +
  9080. +
  9081. +# func_echo ARG...
  9082. +# ----------------
  9083. +# Echo program name prefixed message.
  9084. +func_echo ()
  9085. +{
  9086. + $debug_cmd
  9087. +
  9088. + _G_message=$*
  9089. +
  9090. + func_echo_IFS=$IFS
  9091. + IFS=$nl
  9092. + for _G_line in $_G_message; do
  9093. + IFS=$func_echo_IFS
  9094. + $ECHO "$progname: $_G_line"
  9095. + done
  9096. + IFS=$func_echo_IFS
  9097. +}
  9098. +
  9099. +
  9100. +# func_echo_all ARG...
  9101. +# --------------------
  9102. +# Invoke $ECHO with all args, space-separated.
  9103. +func_echo_all ()
  9104. +{
  9105. + $ECHO "$*"
  9106. +}
  9107. +
  9108. +
  9109. +# func_echo_infix_1 INFIX ARG...
  9110. +# ------------------------------
  9111. +# Echo program name, followed by INFIX on the first line, with any
  9112. +# additional lines not showing INFIX.
  9113. +func_echo_infix_1 ()
  9114. +{
  9115. + $debug_cmd
  9116. +
  9117. + $require_term_colors
  9118. +
  9119. + _G_infix=$1; shift
  9120. + _G_indent=$_G_infix
  9121. + _G_prefix="$progname: $_G_infix: "
  9122. + _G_message=$*
  9123. +
  9124. + # Strip color escape sequences before counting printable length
  9125. + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
  9126. + do
  9127. + test -n "$_G_tc" && {
  9128. + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
  9129. + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
  9130. + }
  9131. + done
  9132. + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
  9133. +
  9134. + func_echo_infix_1_IFS=$IFS
  9135. + IFS=$nl
  9136. + for _G_line in $_G_message; do
  9137. + IFS=$func_echo_infix_1_IFS
  9138. + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
  9139. + _G_prefix=$_G_indent
  9140. + done
  9141. + IFS=$func_echo_infix_1_IFS
  9142. +}
  9143. +
  9144. +
  9145. +# func_error ARG...
  9146. +# -----------------
  9147. +# Echo program name prefixed message to standard error.
  9148. +func_error ()
  9149. +{
  9150. + $debug_cmd
  9151. +
  9152. + $require_term_colors
  9153. +
  9154. + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
  9155. +}
  9156. +
  9157. +
  9158. +# func_fatal_error ARG...
  9159. +# -----------------------
  9160. +# Echo program name prefixed message to standard error, and exit.
  9161. +func_fatal_error ()
  9162. +{
  9163. + $debug_cmd
  9164. +
  9165. + func_error "$*"
  9166. + exit $EXIT_FAILURE
  9167. +}
  9168. +
  9169. +
  9170. +# func_grep EXPRESSION FILENAME
  9171. +# -----------------------------
  9172. +# Check whether EXPRESSION matches any line of FILENAME, without output.
  9173. +func_grep ()
  9174. +{
  9175. + $debug_cmd
  9176. +
  9177. + $GREP "$1" "$2" >/dev/null 2>&1
  9178. +}
  9179. +
  9180. +
  9181. +# func_len STRING
  9182. +# ---------------
  9183. +# Set func_len_result to the length of STRING. STRING may not
  9184. +# start with a hyphen.
  9185. + test -z "$_G_HAVE_XSI_OPS" \
  9186. + && (eval 'x=a/b/c;
  9187. + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  9188. + && _G_HAVE_XSI_OPS=yes
  9189. +
  9190. +if test yes = "$_G_HAVE_XSI_OPS"; then
  9191. + eval 'func_len ()
  9192. + {
  9193. + $debug_cmd
  9194. +
  9195. + func_len_result=${#1}
  9196. + }'
  9197. +else
  9198. + func_len ()
  9199. + {
  9200. + $debug_cmd
  9201. +
  9202. + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
  9203. + }
  9204. +fi
  9205. +
  9206. +
  9207. +# func_mkdir_p DIRECTORY-PATH
  9208. +# ---------------------------
  9209. +# Make sure the entire path to DIRECTORY-PATH is available.
  9210. +func_mkdir_p ()
  9211. +{
  9212. + $debug_cmd
  9213. +
  9214. + _G_directory_path=$1
  9215. + _G_dir_list=
  9216. +
  9217. + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
  9218. +
  9219. + # Protect directory names starting with '-'
  9220. + case $_G_directory_path in
  9221. + -*) _G_directory_path=./$_G_directory_path ;;
  9222. + esac
  9223. +
  9224. + # While some portion of DIR does not yet exist...
  9225. + while test ! -d "$_G_directory_path"; do
  9226. + # ...make a list in topmost first order. Use a colon delimited
  9227. + # list incase some portion of path contains whitespace.
  9228. + _G_dir_list=$_G_directory_path:$_G_dir_list
  9229. +
  9230. + # If the last portion added has no slash in it, the list is done
  9231. + case $_G_directory_path in */*) ;; *) break ;; esac
  9232. +
  9233. + # ...otherwise throw away the child directory and loop
  9234. + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
  9235. + done
  9236. + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
  9237. +
  9238. + func_mkdir_p_IFS=$IFS; IFS=:
  9239. + for _G_dir in $_G_dir_list; do
  9240. + IFS=$func_mkdir_p_IFS
  9241. + # mkdir can fail with a 'File exist' error if two processes
  9242. + # try to create one of the directories concurrently. Don't
  9243. + # stop in that case!
  9244. + $MKDIR "$_G_dir" 2>/dev/null || :
  9245. + done
  9246. + IFS=$func_mkdir_p_IFS
  9247. +
  9248. + # Bail out if we (or some other process) failed to create a directory.
  9249. + test -d "$_G_directory_path" || \
  9250. + func_fatal_error "Failed to create '$1'"
  9251. + fi
  9252. +}
  9253. +
  9254. +
  9255. +# func_mktempdir [BASENAME]
  9256. +# -------------------------
  9257. +# Make a temporary directory that won't clash with other running
  9258. +# libtool processes, and avoids race conditions if possible. If
  9259. +# given, BASENAME is the basename for that directory.
  9260. +func_mktempdir ()
  9261. +{
  9262. + $debug_cmd
  9263. +
  9264. + _G_template=${TMPDIR-/tmp}/${1-$progname}
  9265. +
  9266. + if test : = "$opt_dry_run"; then
  9267. + # Return a directory name, but don't create it in dry-run mode
  9268. + _G_tmpdir=$_G_template-$$
  9269. + else
  9270. +
  9271. + # If mktemp works, use that first and foremost
  9272. + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
  9273. +
  9274. + if test ! -d "$_G_tmpdir"; then
  9275. + # Failing that, at least try and use $RANDOM to avoid a race
  9276. + _G_tmpdir=$_G_template-${RANDOM-0}$$
  9277. +
  9278. + func_mktempdir_umask=`umask`
  9279. + umask 0077
  9280. + $MKDIR "$_G_tmpdir"
  9281. + umask $func_mktempdir_umask
  9282. + fi
  9283. +
  9284. + # If we're not in dry-run mode, bomb out on failure
  9285. + test -d "$_G_tmpdir" || \
  9286. + func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
  9287. + fi
  9288. +
  9289. + $ECHO "$_G_tmpdir"
  9290. +}
  9291. +
  9292. +
  9293. +# func_normal_abspath PATH
  9294. +# ------------------------
  9295. +# Remove doubled-up and trailing slashes, "." path components,
  9296. +# and cancel out any ".." path components in PATH after making
  9297. +# it an absolute path.
  9298. +func_normal_abspath ()
  9299. +{
  9300. + $debug_cmd
  9301. +
  9302. + # These SED scripts presuppose an absolute path with a trailing slash.
  9303. + _G_pathcar='s|^/\([^/]*\).*$|\1|'
  9304. + _G_pathcdr='s|^/[^/]*||'
  9305. + _G_removedotparts=':dotsl
  9306. + s|/\./|/|g
  9307. + t dotsl
  9308. + s|/\.$|/|'
  9309. + _G_collapseslashes='s|/\{1,\}|/|g'
  9310. + _G_finalslash='s|/*$|/|'
  9311. +
  9312. + # Start from root dir and reassemble the path.
  9313. + func_normal_abspath_result=
  9314. + func_normal_abspath_tpath=$1
  9315. + func_normal_abspath_altnamespace=
  9316. + case $func_normal_abspath_tpath in
  9317. + "")
  9318. + # Empty path, that just means $cwd.
  9319. + func_stripname '' '/' "`pwd`"
  9320. + func_normal_abspath_result=$func_stripname_result
  9321. + return
  9322. + ;;
  9323. + # The next three entries are used to spot a run of precisely
  9324. + # two leading slashes without using negated character classes;
  9325. + # we take advantage of case's first-match behaviour.
  9326. + ///*)
  9327. + # Unusual form of absolute path, do nothing.
  9328. + ;;
  9329. + //*)
  9330. + # Not necessarily an ordinary path; POSIX reserves leading '//'
  9331. + # and for example Cygwin uses it to access remote file shares
  9332. + # over CIFS/SMB, so we conserve a leading double slash if found.
  9333. + func_normal_abspath_altnamespace=/
  9334. + ;;
  9335. + /*)
  9336. + # Absolute path, do nothing.
  9337. + ;;
  9338. + *)
  9339. + # Relative path, prepend $cwd.
  9340. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
  9341. + ;;
  9342. + esac
  9343. +
  9344. + # Cancel out all the simple stuff to save iterations. We also want
  9345. + # the path to end with a slash for ease of parsing, so make sure
  9346. + # there is one (and only one) here.
  9347. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  9348. + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
  9349. + while :; do
  9350. + # Processed it all yet?
  9351. + if test / = "$func_normal_abspath_tpath"; then
  9352. + # If we ascended to the root using ".." the result may be empty now.
  9353. + if test -z "$func_normal_abspath_result"; then
  9354. + func_normal_abspath_result=/
  9355. + fi
  9356. + break
  9357. + fi
  9358. + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
  9359. + -e "$_G_pathcar"`
  9360. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  9361. + -e "$_G_pathcdr"`
  9362. + # Figure out what to do with it
  9363. + case $func_normal_abspath_tcomponent in
  9364. + "")
  9365. + # Trailing empty path component, ignore it.
  9366. + ;;
  9367. + ..)
  9368. + # Parent dir; strip last assembled component from result.
  9369. + func_dirname "$func_normal_abspath_result"
  9370. + func_normal_abspath_result=$func_dirname_result
  9371. + ;;
  9372. + *)
  9373. + # Actual path component, append it.
  9374. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
  9375. + ;;
  9376. + esac
  9377. + done
  9378. + # Restore leading double-slash if one was found on entry.
  9379. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
  9380. +}
  9381. +
  9382. +
  9383. +# func_notquiet ARG...
  9384. +# --------------------
  9385. +# Echo program name prefixed message only when not in quiet mode.
  9386. +func_notquiet ()
  9387. +{
  9388. + $debug_cmd
  9389. +
  9390. + $opt_quiet || func_echo ${1+"$@"}
  9391. +
  9392. + # A bug in bash halts the script if the last line of a function
  9393. + # fails when set -e is in force, so we need another command to
  9394. + # work around that:
  9395. + :
  9396. +}
  9397. +
  9398. +
  9399. +# func_relative_path SRCDIR DSTDIR
  9400. +# --------------------------------
  9401. +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
  9402. +func_relative_path ()
  9403. +{
  9404. + $debug_cmd
  9405. +
  9406. + func_relative_path_result=
  9407. + func_normal_abspath "$1"
  9408. + func_relative_path_tlibdir=$func_normal_abspath_result
  9409. + func_normal_abspath "$2"
  9410. + func_relative_path_tbindir=$func_normal_abspath_result
  9411. +
  9412. + # Ascend the tree starting from libdir
  9413. + while :; do
  9414. + # check if we have found a prefix of bindir
  9415. + case $func_relative_path_tbindir in
  9416. + $func_relative_path_tlibdir)
  9417. + # found an exact match
  9418. + func_relative_path_tcancelled=
  9419. + break
  9420. + ;;
  9421. + $func_relative_path_tlibdir*)
  9422. + # found a matching prefix
  9423. + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
  9424. + func_relative_path_tcancelled=$func_stripname_result
  9425. + if test -z "$func_relative_path_result"; then
  9426. + func_relative_path_result=.
  9427. + fi
  9428. + break
  9429. + ;;
  9430. + *)
  9431. + func_dirname $func_relative_path_tlibdir
  9432. + func_relative_path_tlibdir=$func_dirname_result
  9433. + if test -z "$func_relative_path_tlibdir"; then
  9434. + # Have to descend all the way to the root!
  9435. + func_relative_path_result=../$func_relative_path_result
  9436. + func_relative_path_tcancelled=$func_relative_path_tbindir
  9437. + break
  9438. + fi
  9439. + func_relative_path_result=../$func_relative_path_result
  9440. + ;;
  9441. + esac
  9442. + done
  9443. +
  9444. + # Now calculate path; take care to avoid doubling-up slashes.
  9445. + func_stripname '' '/' "$func_relative_path_result"
  9446. + func_relative_path_result=$func_stripname_result
  9447. + func_stripname '/' '/' "$func_relative_path_tcancelled"
  9448. + if test -n "$func_stripname_result"; then
  9449. + func_append func_relative_path_result "/$func_stripname_result"
  9450. + fi
  9451. +
  9452. + # Normalisation. If bindir is libdir, return '.' else relative path.
  9453. + if test -n "$func_relative_path_result"; then
  9454. + func_stripname './' '' "$func_relative_path_result"
  9455. + func_relative_path_result=$func_stripname_result
  9456. + fi
  9457. +
  9458. + test -n "$func_relative_path_result" || func_relative_path_result=.
  9459. +
  9460. + :
  9461. +}
  9462. +
  9463. +
  9464. +# func_quote_for_eval ARG...
  9465. +# --------------------------
  9466. +# Aesthetically quote ARGs to be evaled later.
  9467. +# This function returns two values:
  9468. +# i) func_quote_for_eval_result
  9469. +# double-quoted, suitable for a subsequent eval
  9470. +# ii) func_quote_for_eval_unquoted_result
  9471. +# has all characters that are still active within double
  9472. +# quotes backslashified.
  9473. +func_quote_for_eval ()
  9474. +{
  9475. + $debug_cmd
  9476. +
  9477. + func_quote_for_eval_unquoted_result=
  9478. + func_quote_for_eval_result=
  9479. + while test 0 -lt $#; do
  9480. + case $1 in
  9481. + *[\\\`\"\$]*)
  9482. + _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
  9483. + *)
  9484. + _G_unquoted_arg=$1 ;;
  9485. + esac
  9486. + if test -n "$func_quote_for_eval_unquoted_result"; then
  9487. + func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
  9488. + else
  9489. + func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
  9490. + fi
  9491. +
  9492. + case $_G_unquoted_arg in
  9493. + # Double-quote args containing shell metacharacters to delay
  9494. + # word splitting, command substitution and variable expansion
  9495. + # for a subsequent eval.
  9496. + # Many Bourne shells cannot handle close brackets correctly
  9497. + # in scan sets, so we specify it separately.
  9498. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  9499. + _G_quoted_arg=\"$_G_unquoted_arg\"
  9500. + ;;
  9501. + *)
  9502. + _G_quoted_arg=$_G_unquoted_arg
  9503. + ;;
  9504. + esac
  9505. +
  9506. + if test -n "$func_quote_for_eval_result"; then
  9507. + func_append func_quote_for_eval_result " $_G_quoted_arg"
  9508. + else
  9509. + func_append func_quote_for_eval_result "$_G_quoted_arg"
  9510. + fi
  9511. + shift
  9512. + done
  9513. +}
  9514. +
  9515. +
  9516. +# func_quote_for_expand ARG
  9517. +# -------------------------
  9518. +# Aesthetically quote ARG to be evaled later; same as above,
  9519. +# but do not quote variable references.
  9520. +func_quote_for_expand ()
  9521. +{
  9522. + $debug_cmd
  9523. +
  9524. + case $1 in
  9525. + *[\\\`\"]*)
  9526. + _G_arg=`$ECHO "$1" | $SED \
  9527. + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
  9528. + *)
  9529. + _G_arg=$1 ;;
  9530. + esac
  9531. +
  9532. + case $_G_arg in
  9533. + # Double-quote args containing shell metacharacters to delay
  9534. + # word splitting and command substitution for a subsequent eval.
  9535. + # Many Bourne shells cannot handle close brackets correctly
  9536. + # in scan sets, so we specify it separately.
  9537. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  9538. + _G_arg=\"$_G_arg\"
  9539. + ;;
  9540. + esac
  9541. +
  9542. + func_quote_for_expand_result=$_G_arg
  9543. +}
  9544. +
  9545. +
  9546. +# func_stripname PREFIX SUFFIX NAME
  9547. +# ---------------------------------
  9548. +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
  9549. +# PREFIX and SUFFIX must not contain globbing or regex special
  9550. +# characters, hashes, percent signs, but SUFFIX may contain a leading
  9551. +# dot (in which case that matches only a dot).
  9552. +if test yes = "$_G_HAVE_XSI_OPS"; then
  9553. + eval 'func_stripname ()
  9554. + {
  9555. + $debug_cmd
  9556. +
  9557. + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  9558. + # positional parameters, so assign one to ordinary variable first.
  9559. + func_stripname_result=$3
  9560. + func_stripname_result=${func_stripname_result#"$1"}
  9561. + func_stripname_result=${func_stripname_result%"$2"}
  9562. + }'
  9563. +else
  9564. + func_stripname ()
  9565. + {
  9566. + $debug_cmd
  9567. +
  9568. + case $2 in
  9569. + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
  9570. + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
  9571. + esac
  9572. + }
  9573. +fi
  9574. +
  9575. +
  9576. +# func_show_eval CMD [FAIL_EXP]
  9577. +# -----------------------------
  9578. +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  9579. +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  9580. +# is given, then evaluate it.
  9581. +func_show_eval ()
  9582. +{
  9583. + $debug_cmd
  9584. +
  9585. + _G_cmd=$1
  9586. + _G_fail_exp=${2-':'}
  9587. +
  9588. + func_quote_for_expand "$_G_cmd"
  9589. + eval "func_notquiet $func_quote_for_expand_result"
  9590. +
  9591. + $opt_dry_run || {
  9592. + eval "$_G_cmd"
  9593. + _G_status=$?
  9594. + if test 0 -ne "$_G_status"; then
  9595. + eval "(exit $_G_status); $_G_fail_exp"
  9596. + fi
  9597. + }
  9598. +}
  9599. +
  9600. +
  9601. +# func_show_eval_locale CMD [FAIL_EXP]
  9602. +# ------------------------------------
  9603. +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  9604. +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  9605. +# is given, then evaluate it. Use the saved locale for evaluation.
  9606. +func_show_eval_locale ()
  9607. +{
  9608. + $debug_cmd
  9609. +
  9610. + _G_cmd=$1
  9611. + _G_fail_exp=${2-':'}
  9612. +
  9613. + $opt_quiet || {
  9614. + func_quote_for_expand "$_G_cmd"
  9615. + eval "func_echo $func_quote_for_expand_result"
  9616. + }
  9617. +
  9618. + $opt_dry_run || {
  9619. + eval "$_G_user_locale
  9620. + $_G_cmd"
  9621. + _G_status=$?
  9622. + eval "$_G_safe_locale"
  9623. + if test 0 -ne "$_G_status"; then
  9624. + eval "(exit $_G_status); $_G_fail_exp"
  9625. + fi
  9626. + }
  9627. +}
  9628. +
  9629. +
  9630. +# func_tr_sh
  9631. +# ----------
  9632. +# Turn $1 into a string suitable for a shell variable name.
  9633. +# Result is stored in $func_tr_sh_result. All characters
  9634. +# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
  9635. +# if $1 begins with a digit, a '_' is prepended as well.
  9636. +func_tr_sh ()
  9637. +{
  9638. + $debug_cmd
  9639. +
  9640. + case $1 in
  9641. + [0-9]* | *[!a-zA-Z0-9_]*)
  9642. + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
  9643. + ;;
  9644. + * )
  9645. + func_tr_sh_result=$1
  9646. + ;;
  9647. + esac
  9648. +}
  9649. +
  9650. +
  9651. +# func_verbose ARG...
  9652. +# -------------------
  9653. +# Echo program name prefixed message in verbose mode only.
  9654. +func_verbose ()
  9655. +{
  9656. + $debug_cmd
  9657. +
  9658. + $opt_verbose && func_echo "$*"
  9659. +
  9660. + :
  9661. +}
  9662. +
  9663. +
  9664. +# func_warn_and_continue ARG...
  9665. +# -----------------------------
  9666. +# Echo program name prefixed warning message to standard error.
  9667. +func_warn_and_continue ()
  9668. +{
  9669. + $debug_cmd
  9670. +
  9671. + $require_term_colors
  9672. +
  9673. + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
  9674. +}
  9675. +
  9676. +
  9677. +# func_warning CATEGORY ARG...
  9678. +# ----------------------------
  9679. +# Echo program name prefixed warning message to standard error. Warning
  9680. +# messages can be filtered according to CATEGORY, where this function
  9681. +# elides messages where CATEGORY is not listed in the global variable
  9682. +# 'opt_warning_types'.
  9683. +func_warning ()
  9684. +{
  9685. + $debug_cmd
  9686. +
  9687. + # CATEGORY must be in the warning_categories list!
  9688. + case " $warning_categories " in
  9689. + *" $1 "*) ;;
  9690. + *) func_internal_error "invalid warning category '$1'" ;;
  9691. + esac
  9692. +
  9693. + _G_category=$1
  9694. + shift
  9695. +
  9696. + case " $opt_warning_types " in
  9697. + *" $_G_category "*) $warning_func ${1+"$@"} ;;
  9698. + esac
  9699. +}
  9700. +
  9701. +
  9702. +# func_sort_ver VER1 VER2
  9703. +# -----------------------
  9704. +# 'sort -V' is not generally available.
  9705. +# Note this deviates from the version comparison in automake
  9706. +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
  9707. +# but this should suffice as we won't be specifying old
  9708. +# version formats or redundant trailing .0 in bootstrap.conf.
  9709. +# If we did want full compatibility then we should probably
  9710. +# use m4_version_compare from autoconf.
  9711. +func_sort_ver ()
  9712. +{
  9713. + $debug_cmd
  9714. +
  9715. + printf '%s\n%s\n' "$1" "$2" \
  9716. + | 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
  9717. +}
  9718. +
  9719. +# func_lt_ver PREV CURR
  9720. +# ---------------------
  9721. +# Return true if PREV and CURR are in the correct order according to
  9722. +# func_sort_ver, otherwise false. Use it like this:
  9723. +#
  9724. +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
  9725. +func_lt_ver ()
  9726. +{
  9727. + $debug_cmd
  9728. +
  9729. + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
  9730. +}
  9731. +
  9732. +
  9733. +# Local variables:
  9734. +# mode: shell-script
  9735. +# sh-indentation: 2
  9736. +# eval: (add-hook 'before-save-hook 'time-stamp)
  9737. +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  9738. +# time-stamp-time-zone: "UTC"
  9739. +# End:
  9740. +#! /bin/sh
  9741. +
  9742. +# Set a version string for this script.
  9743. +scriptversion=2014-01-07.03; # UTC
  9744. +
  9745. +# A portable, pluggable option parser for Bourne shell.
  9746. +# Written by Gary V. Vaughan, 2010
  9747. +
  9748. +# Copyright (C) 2010-2015 Free Software Foundation, Inc.
  9749. +# This is free software; see the source for copying conditions. There is NO
  9750. +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9751. +
  9752. +# This program is free software: you can redistribute it and/or modify
  9753. +# it under the terms of the GNU General Public License as published by
  9754. +# the Free Software Foundation, either version 3 of the License, or
  9755. +# (at your option) any later version.
  9756. +
  9757. +# This program is distributed in the hope that it will be useful,
  9758. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  9759. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9760. +# GNU General Public License for more details.
  9761. +
  9762. +# You should have received a copy of the GNU General Public License
  9763. +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  9764. +
  9765. +# Please report bugs or propose patches to gary@gnu.org.
  9766. +
  9767. +
  9768. +## ------ ##
  9769. +## Usage. ##
  9770. +## ------ ##
  9771. +
  9772. +# This file is a library for parsing options in your shell scripts along
  9773. +# with assorted other useful supporting features that you can make use
  9774. +# of too.
  9775. +#
  9776. +# For the simplest scripts you might need only:
  9777. +#
  9778. +# #!/bin/sh
  9779. +# . relative/path/to/funclib.sh
  9780. +# . relative/path/to/options-parser
  9781. +# scriptversion=1.0
  9782. +# func_options ${1+"$@"}
  9783. +# eval set dummy "$func_options_result"; shift
  9784. +# ...rest of your script...
  9785. +#
  9786. +# In order for the '--version' option to work, you will need to have a
  9787. +# suitably formatted comment like the one at the top of this file
  9788. +# starting with '# Written by ' and ending with '# warranty; '.
  9789. +#
  9790. +# For '-h' and '--help' to work, you will also need a one line
  9791. +# description of your script's purpose in a comment directly above the
  9792. +# '# Written by ' line, like the one at the top of this file.
  9793. +#
  9794. +# The default options also support '--debug', which will turn on shell
  9795. +# execution tracing (see the comment above debug_cmd below for another
  9796. +# use), and '--verbose' and the func_verbose function to allow your script
  9797. +# to display verbose messages only when your user has specified
  9798. +# '--verbose'.
  9799. +#
  9800. +# After sourcing this file, you can plug processing for additional
  9801. +# options by amending the variables from the 'Configuration' section
  9802. +# below, and following the instructions in the 'Option parsing'
  9803. +# section further down.
  9804. +
  9805. +## -------------- ##
  9806. +## Configuration. ##
  9807. +## -------------- ##
  9808. +
  9809. +# You should override these variables in your script after sourcing this
  9810. +# file so that they reflect the customisations you have added to the
  9811. +# option parser.
  9812. +
  9813. +# The usage line for option parsing errors and the start of '-h' and
  9814. +# '--help' output messages. You can embed shell variables for delayed
  9815. +# expansion at the time the message is displayed, but you will need to
  9816. +# quote other shell meta-characters carefully to prevent them being
  9817. +# expanded when the contents are evaled.
  9818. +usage='$progpath [OPTION]...'
  9819. +
  9820. +# Short help message in response to '-h' and '--help'. Add to this or
  9821. +# override it after sourcing this library to reflect the full set of
  9822. +# options your script accepts.
  9823. +usage_message="\
  9824. + --debug enable verbose shell tracing
  9825. + -W, --warnings=CATEGORY
  9826. + report the warnings falling in CATEGORY [all]
  9827. + -v, --verbose verbosely report processing
  9828. + --version print version information and exit
  9829. + -h, --help print short or long help message and exit
  9830. +"
  9831. +
  9832. +# Additional text appended to 'usage_message' in response to '--help'.
  9833. +long_help_message="
  9834. +Warning categories include:
  9835. + 'all' show all warnings
  9836. + 'none' turn off all the warnings
  9837. + 'error' warnings are treated as fatal errors"
  9838. +
  9839. +# Help message printed before fatal option parsing errors.
  9840. +fatal_help="Try '\$progname --help' for more information."
  9841. +
  9842. +
  9843. +
  9844. +## ------------------------- ##
  9845. +## Hook function management. ##
  9846. +## ------------------------- ##
  9847. +
  9848. +# This section contains functions for adding, removing, and running hooks
  9849. +# to the main code. A hook is just a named list of of function, that can
  9850. +# be run in order later on.
  9851. +
  9852. +# func_hookable FUNC_NAME
  9853. +# -----------------------
  9854. +# Declare that FUNC_NAME will run hooks added with
  9855. +# 'func_add_hook FUNC_NAME ...'.
  9856. +func_hookable ()
  9857. +{
  9858. + $debug_cmd
  9859. +
  9860. + func_append hookable_fns " $1"
  9861. +}
  9862. +
  9863. +
  9864. +# func_add_hook FUNC_NAME HOOK_FUNC
  9865. +# ---------------------------------
  9866. +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
  9867. +# first have been declared "hookable" by a call to 'func_hookable'.
  9868. +func_add_hook ()
  9869. +{
  9870. + $debug_cmd
  9871. +
  9872. + case " $hookable_fns " in
  9873. + *" $1 "*) ;;
  9874. + *) func_fatal_error "'$1' does not accept hook functions." ;;
  9875. + esac
  9876. +
  9877. + eval func_append ${1}_hooks '" $2"'
  9878. +}
  9879. +
  9880. +
  9881. +# func_remove_hook FUNC_NAME HOOK_FUNC
  9882. +# ------------------------------------
  9883. +# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
  9884. +func_remove_hook ()
  9885. +{
  9886. + $debug_cmd
  9887. +
  9888. + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
  9889. +}
  9890. +
  9891. +
  9892. +# func_run_hooks FUNC_NAME [ARG]...
  9893. +# ---------------------------------
  9894. +# Run all hook functions registered to FUNC_NAME.
  9895. +# It is assumed that the list of hook functions contains nothing more
  9896. +# than a whitespace-delimited list of legal shell function names, and
  9897. +# no effort is wasted trying to catch shell meta-characters or preserve
  9898. +# whitespace.
  9899. +func_run_hooks ()
  9900. +{
  9901. + $debug_cmd
  9902. +
  9903. + case " $hookable_fns " in
  9904. + *" $1 "*) ;;
  9905. + *) func_fatal_error "'$1' does not support hook funcions.n" ;;
  9906. + esac
  9907. +
  9908. + eval _G_hook_fns=\$$1_hooks; shift
  9909. +
  9910. + for _G_hook in $_G_hook_fns; do
  9911. + eval $_G_hook '"$@"'
  9912. +
  9913. + # store returned options list back into positional
  9914. + # parameters for next 'cmd' execution.
  9915. + eval _G_hook_result=\$${_G_hook}_result
  9916. + eval set dummy "$_G_hook_result"; shift
  9917. + done
  9918. +
  9919. + func_quote_for_eval ${1+"$@"}
  9920. + func_run_hooks_result=$func_quote_for_eval_result
  9921. +}
  9922. +
  9923. +
  9924. +
  9925. +## --------------- ##
  9926. +## Option parsing. ##
  9927. +## --------------- ##
  9928. +
  9929. +# In order to add your own option parsing hooks, you must accept the
  9930. +# full positional parameter list in your hook function, remove any
  9931. +# options that you action, and then pass back the remaining unprocessed
  9932. +# options in '<hooked_function_name>_result', escaped suitably for
  9933. +# 'eval'. Like this:
  9934. +#
  9935. +# my_options_prep ()
  9936. +# {
  9937. +# $debug_cmd
  9938. +#
  9939. +# # Extend the existing usage message.
  9940. +# usage_message=$usage_message'
  9941. +# -s, --silent don'\''t print informational messages
  9942. +# '
  9943. +#
  9944. +# func_quote_for_eval ${1+"$@"}
  9945. +# my_options_prep_result=$func_quote_for_eval_result
  9946. +# }
  9947. +# func_add_hook func_options_prep my_options_prep
  9948. +#
  9949. +#
  9950. +# my_silent_option ()
  9951. +# {
  9952. +# $debug_cmd
  9953. +#
  9954. +# # Note that for efficiency, we parse as many options as we can
  9955. +# # recognise in a loop before passing the remainder back to the
  9956. +# # caller on the first unrecognised argument we encounter.
  9957. +# while test $# -gt 0; do
  9958. +# opt=$1; shift
  9959. +# case $opt in
  9960. +# --silent|-s) opt_silent=: ;;
  9961. +# # Separate non-argument short options:
  9962. +# -s*) func_split_short_opt "$_G_opt"
  9963. +# set dummy "$func_split_short_opt_name" \
  9964. +# "-$func_split_short_opt_arg" ${1+"$@"}
  9965. +# shift
  9966. +# ;;
  9967. +# *) set dummy "$_G_opt" "$*"; shift; break ;;
  9968. +# esac
  9969. +# done
  9970. +#
  9971. +# func_quote_for_eval ${1+"$@"}
  9972. +# my_silent_option_result=$func_quote_for_eval_result
  9973. +# }
  9974. +# func_add_hook func_parse_options my_silent_option
  9975. +#
  9976. +#
  9977. +# my_option_validation ()
  9978. +# {
  9979. +# $debug_cmd
  9980. +#
  9981. +# $opt_silent && $opt_verbose && func_fatal_help "\
  9982. +# '--silent' and '--verbose' options are mutually exclusive."
  9983. +#
  9984. +# func_quote_for_eval ${1+"$@"}
  9985. +# my_option_validation_result=$func_quote_for_eval_result
  9986. +# }
  9987. +# func_add_hook func_validate_options my_option_validation
  9988. +#
  9989. +# You'll alse need to manually amend $usage_message to reflect the extra
  9990. +# options you parse. It's preferable to append if you can, so that
  9991. +# multiple option parsing hooks can be added safely.
  9992. +
  9993. +
  9994. +# func_options [ARG]...
  9995. +# ---------------------
  9996. +# All the functions called inside func_options are hookable. See the
  9997. +# individual implementations for details.
  9998. +func_hookable func_options
  9999. +func_options ()
  10000. +{
  10001. + $debug_cmd
  10002. +
  10003. + func_options_prep ${1+"$@"}
  10004. + eval func_parse_options \
  10005. + ${func_options_prep_result+"$func_options_prep_result"}
  10006. + eval func_validate_options \
  10007. + ${func_parse_options_result+"$func_parse_options_result"}
  10008. +
  10009. + eval func_run_hooks func_options \
  10010. + ${func_validate_options_result+"$func_validate_options_result"}
  10011. +
  10012. + # save modified positional parameters for caller
  10013. + func_options_result=$func_run_hooks_result
  10014. +}
  10015. +
  10016. +
  10017. +# func_options_prep [ARG]...
  10018. +# --------------------------
  10019. +# All initialisations required before starting the option parse loop.
  10020. +# Note that when calling hook functions, we pass through the list of
  10021. +# positional parameters. If a hook function modifies that list, and
  10022. +# needs to propogate that back to rest of this script, then the complete
  10023. +# modified list must be put in 'func_run_hooks_result' before
  10024. +# returning.
  10025. +func_hookable func_options_prep
  10026. +func_options_prep ()
  10027. +{
  10028. + $debug_cmd
  10029. +
  10030. + # Option defaults:
  10031. + opt_verbose=false
  10032. + opt_warning_types=
  10033. +
  10034. + func_run_hooks func_options_prep ${1+"$@"}
  10035. +
  10036. + # save modified positional parameters for caller
  10037. + func_options_prep_result=$func_run_hooks_result
  10038. +}
  10039. +
  10040. +
  10041. +# func_parse_options [ARG]...
  10042. +# ---------------------------
  10043. +# The main option parsing loop.
  10044. +func_hookable func_parse_options
  10045. +func_parse_options ()
  10046. +{
  10047. + $debug_cmd
  10048. +
  10049. + func_parse_options_result=
  10050. +
  10051. + # this just eases exit handling
  10052. + while test $# -gt 0; do
  10053. + # Defer to hook functions for initial option parsing, so they
  10054. + # get priority in the event of reusing an option name.
  10055. + func_run_hooks func_parse_options ${1+"$@"}
  10056. +
  10057. + # Adjust func_parse_options positional parameters to match
  10058. + eval set dummy "$func_run_hooks_result"; shift
  10059. +
  10060. + # Break out of the loop if we already parsed every option.
  10061. + test $# -gt 0 || break
  10062. +
  10063. + _G_opt=$1
  10064. + shift
  10065. + case $_G_opt in
  10066. + --debug|-x) debug_cmd='set -x'
  10067. + func_echo "enabling shell trace mode"
  10068. + $debug_cmd
  10069. + ;;
  10070. +
  10071. + --no-warnings|--no-warning|--no-warn)
  10072. + set dummy --warnings none ${1+"$@"}
  10073. + shift
  10074. + ;;
  10075. +
  10076. + --warnings|--warning|-W)
  10077. + test $# = 0 && func_missing_arg $_G_opt && break
  10078. + case " $warning_categories $1" in
  10079. + *" $1 "*)
  10080. + # trailing space prevents matching last $1 above
  10081. + func_append_uniq opt_warning_types " $1"
  10082. + ;;
  10083. + *all)
  10084. + opt_warning_types=$warning_categories
  10085. + ;;
  10086. + *none)
  10087. + opt_warning_types=none
  10088. + warning_func=:
  10089. + ;;
  10090. + *error)
  10091. + opt_warning_types=$warning_categories
  10092. + warning_func=func_fatal_error
  10093. + ;;
  10094. + *)
  10095. + func_fatal_error \
  10096. + "unsupported warning category: '$1'"
  10097. + ;;
  10098. + esac
  10099. + shift
  10100. + ;;
  10101. +
  10102. + --verbose|-v) opt_verbose=: ;;
  10103. + --version) func_version ;;
  10104. + -\?|-h) func_usage ;;
  10105. + --help) func_help ;;
  10106. +
  10107. + # Separate optargs to long options (plugins may need this):
  10108. + --*=*) func_split_equals "$_G_opt"
  10109. + set dummy "$func_split_equals_lhs" \
  10110. + "$func_split_equals_rhs" ${1+"$@"}
  10111. + shift
  10112. + ;;
  10113. +
  10114. + # Separate optargs to short options:
  10115. + -W*)
  10116. + func_split_short_opt "$_G_opt"
  10117. + set dummy "$func_split_short_opt_name" \
  10118. + "$func_split_short_opt_arg" ${1+"$@"}
  10119. + shift
  10120. + ;;
  10121. +
  10122. + # Separate non-argument short options:
  10123. + -\?*|-h*|-v*|-x*)
  10124. + func_split_short_opt "$_G_opt"
  10125. + set dummy "$func_split_short_opt_name" \
  10126. + "-$func_split_short_opt_arg" ${1+"$@"}
  10127. + shift
  10128. + ;;
  10129. +
  10130. + --) break ;;
  10131. + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
  10132. + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  10133. + esac
  10134. + done
  10135. +
  10136. + # save modified positional parameters for caller
  10137. + func_quote_for_eval ${1+"$@"}
  10138. + func_parse_options_result=$func_quote_for_eval_result
  10139. +}
  10140. +
  10141. +
  10142. +# func_validate_options [ARG]...
  10143. +# ------------------------------
  10144. +# Perform any sanity checks on option settings and/or unconsumed
  10145. +# arguments.
  10146. +func_hookable func_validate_options
  10147. +func_validate_options ()
  10148. +{
  10149. + $debug_cmd
  10150. +
  10151. + # Display all warnings if -W was not given.
  10152. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
  10153. +
  10154. + func_run_hooks func_validate_options ${1+"$@"}
  10155. +
  10156. + # Bail if the options were screwed!
  10157. + $exit_cmd $EXIT_FAILURE
  10158. +
  10159. + # save modified positional parameters for caller
  10160. + func_validate_options_result=$func_run_hooks_result
  10161. +}
  10162. +
  10163. +
  10164. +
  10165. +## ----------------- ##
  10166. +## Helper functions. ##
  10167. +## ----------------- ##
  10168. +
  10169. +# This section contains the helper functions used by the rest of the
  10170. +# hookable option parser framework in ascii-betical order.
  10171. +
  10172. +
  10173. +# func_fatal_help ARG...
  10174. +# ----------------------
  10175. +# Echo program name prefixed message to standard error, followed by
  10176. +# a help hint, and exit.
  10177. +func_fatal_help ()
  10178. +{
  10179. + $debug_cmd
  10180. +
  10181. + eval \$ECHO \""Usage: $usage"\"
  10182. + eval \$ECHO \""$fatal_help"\"
  10183. + func_error ${1+"$@"}
  10184. + exit $EXIT_FAILURE
  10185. +}
  10186. +
  10187. +
  10188. +# func_help
  10189. +# ---------
  10190. +# Echo long help message to standard output and exit.
  10191. +func_help ()
  10192. +{
  10193. + $debug_cmd
  10194. +
  10195. + func_usage_message
  10196. + $ECHO "$long_help_message"
  10197. + exit 0
  10198. +}
  10199. +
  10200. +
  10201. +# func_missing_arg ARGNAME
  10202. +# ------------------------
  10203. +# Echo program name prefixed message to standard error and set global
  10204. +# exit_cmd.
  10205. +func_missing_arg ()
  10206. +{
  10207. + $debug_cmd
  10208. +
  10209. + func_error "Missing argument for '$1'."
  10210. + exit_cmd=exit
  10211. +}
  10212. +
  10213. +
  10214. +# func_split_equals STRING
  10215. +# ------------------------
  10216. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
  10217. +# splitting STRING at the '=' sign.
  10218. +test -z "$_G_HAVE_XSI_OPS" \
  10219. + && (eval 'x=a/b/c;
  10220. + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  10221. + && _G_HAVE_XSI_OPS=yes
  10222. +
  10223. +if test yes = "$_G_HAVE_XSI_OPS"
  10224. +then
  10225. + # This is an XSI compatible shell, allowing a faster implementation...
  10226. + eval 'func_split_equals ()
  10227. + {
  10228. + $debug_cmd
  10229. +
  10230. + func_split_equals_lhs=${1%%=*}
  10231. + func_split_equals_rhs=${1#*=}
  10232. + test "x$func_split_equals_lhs" = "x$1" \
  10233. + && func_split_equals_rhs=
  10234. + }'
  10235. +else
  10236. + # ...otherwise fall back to using expr, which is often a shell builtin.
  10237. + func_split_equals ()
  10238. + {
  10239. + $debug_cmd
  10240. +
  10241. + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
  10242. + func_split_equals_rhs=
  10243. + test "x$func_split_equals_lhs" = "x$1" \
  10244. + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
  10245. + }
  10246. +fi #func_split_equals
  10247. +
  10248. +
  10249. +# func_split_short_opt SHORTOPT
  10250. +# -----------------------------
  10251. +# Set func_split_short_opt_name and func_split_short_opt_arg shell
  10252. +# variables after splitting SHORTOPT after the 2nd character.
  10253. +if test yes = "$_G_HAVE_XSI_OPS"
  10254. +then
  10255. + # This is an XSI compatible shell, allowing a faster implementation...
  10256. + eval 'func_split_short_opt ()
  10257. + {
  10258. + $debug_cmd
  10259. +
  10260. + func_split_short_opt_arg=${1#??}
  10261. + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
  10262. + }'
  10263. +else
  10264. + # ...otherwise fall back to using expr, which is often a shell builtin.
  10265. + func_split_short_opt ()
  10266. + {
  10267. + $debug_cmd
  10268. +
  10269. + func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
  10270. + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
  10271. + }
  10272. +fi #func_split_short_opt
  10273. +
  10274. +
  10275. +# func_usage
  10276. +# ----------
  10277. +# Echo short help message to standard output and exit.
  10278. +func_usage ()
  10279. +{
  10280. + $debug_cmd
  10281. +
  10282. + func_usage_message
  10283. + $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
  10284. + exit 0
  10285. +}
  10286. +
  10287. +
  10288. +# func_usage_message
  10289. +# ------------------
  10290. +# Echo short help message to standard output.
  10291. +func_usage_message ()
  10292. +{
  10293. + $debug_cmd
  10294. +
  10295. + eval \$ECHO \""Usage: $usage"\"
  10296. + echo
  10297. + $SED -n 's|^# ||
  10298. + /^Written by/{
  10299. + x;p;x
  10300. + }
  10301. + h
  10302. + /^Written by/q' < "$progpath"
  10303. + echo
  10304. + eval \$ECHO \""$usage_message"\"
  10305. +}
  10306. +
  10307. +
  10308. +# func_version
  10309. +# ------------
  10310. +# Echo version message to standard output and exit.
  10311. +func_version ()
  10312. +{
  10313. + $debug_cmd
  10314. +
  10315. + printf '%s\n' "$progname $scriptversion"
  10316. + $SED -n '
  10317. + /(C)/!b go
  10318. + :more
  10319. + /\./!{
  10320. + N
  10321. + s|\n# | |
  10322. + b more
  10323. + }
  10324. + :go
  10325. + /^# Written by /,/# warranty; / {
  10326. + s|^# ||
  10327. + s|^# *$||
  10328. + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
  10329. + p
  10330. + }
  10331. + /^# Written by / {
  10332. + s|^# ||
  10333. + p
  10334. + }
  10335. + /^warranty; /q' < "$progpath"
  10336. +
  10337. + exit $?
  10338. +}
  10339. +
  10340. +
  10341. +# Local variables:
  10342. +# mode: shell-script
  10343. +# sh-indentation: 2
  10344. +# eval: (add-hook 'before-save-hook 'time-stamp)
  10345. +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  10346. +# time-stamp-time-zone: "UTC"
  10347. +# End:
  10348. +
  10349. +# Set a version string.
  10350. +scriptversion='(GNU libtool) 2.4.6'
  10351. +
  10352. +
  10353. +# func_echo ARG...
  10354. +# ----------------
  10355. +# Libtool also displays the current mode in messages, so override
  10356. +# funclib.sh func_echo with this custom definition.
  10357. +func_echo ()
  10358. +{
  10359. + $debug_cmd
  10360. +
  10361. + _G_message=$*
  10362. +
  10363. + func_echo_IFS=$IFS
  10364. + IFS=$nl
  10365. + for _G_line in $_G_message; do
  10366. + IFS=$func_echo_IFS
  10367. + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
  10368. + done
  10369. + IFS=$func_echo_IFS
  10370. +}
  10371. +
  10372. +
  10373. +# func_warning ARG...
  10374. +# -------------------
  10375. +# Libtool warnings are not categorized, so override funclib.sh
  10376. +# func_warning with this simpler definition.
  10377. +func_warning ()
  10378. +{
  10379. + $debug_cmd
  10380. +
  10381. + $warning_func ${1+"$@"}
  10382. +}
  10383. +
  10384. +
  10385. +## ---------------- ##
  10386. +## Options parsing. ##
  10387. +## ---------------- ##
  10388. +
  10389. +# Hook in the functions to make sure our own options are parsed during
  10390. +# the option parsing loop.
  10391. +
  10392. +usage='$progpath [OPTION]... [MODE-ARG]...'
  10393. +
  10394. +# Short help message in response to '-h'.
  10395. +usage_message="Options:
  10396. + --config show all configuration variables
  10397. + --debug enable verbose shell tracing
  10398. + -n, --dry-run display commands without modifying any files
  10399. + --features display basic configuration information and exit
  10400. + --mode=MODE use operation mode MODE
  10401. + --no-warnings equivalent to '-Wnone'
  10402. + --preserve-dup-deps don't remove duplicate dependency libraries
  10403. + --quiet, --silent don't print informational messages
  10404. + --tag=TAG use configuration variables from tag TAG
  10405. + -v, --verbose print more informational messages than default
  10406. + --version print version information
  10407. + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
  10408. + -h, --help, --help-all print short, long, or detailed help message
  10409. +"
  10410. +
  10411. +# Additional text appended to 'usage_message' in response to '--help'.
  10412. +func_help ()
  10413. +{
  10414. + $debug_cmd
  10415. +
  10416. + func_usage_message
  10417. + $ECHO "$long_help_message
  10418. +
  10419. +MODE must be one of the following:
  10420. +
  10421. + clean remove files from the build directory
  10422. + compile compile a source file into a libtool object
  10423. + execute automatically set library path, then run a program
  10424. + finish complete the installation of libtool libraries
  10425. + install install libraries or executables
  10426. + link create a library or an executable
  10427. + uninstall remove libraries from an installed directory
  10428. +
  10429. +MODE-ARGS vary depending on the MODE. When passed as first option,
  10430. +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
  10431. +Try '$progname --help --mode=MODE' for a more detailed description of MODE.
  10432. +
  10433. +When reporting a bug, please describe a test case to reproduce it and
  10434. +include the following information:
  10435. +
  10436. + host-triplet: $host
  10437. + shell: $SHELL
  10438. + compiler: $LTCC
  10439. + compiler flags: $LTCFLAGS
  10440. + linker: $LD (gnu? $with_gnu_ld)
  10441. + version: $progname $scriptversion Debian-2.4.6-2
  10442. + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
  10443. + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
  10444. +
  10445. +Report bugs to <bug-libtool@gnu.org>.
  10446. +GNU libtool home page: <http://www.gnu.org/s/libtool/>.
  10447. +General help using GNU software: <http://www.gnu.org/gethelp/>."
  10448. + exit 0
  10449. +}
  10450. +
  10451. +
  10452. +# func_lo2o OBJECT-NAME
  10453. +# ---------------------
  10454. +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
  10455. +# object suffix.
  10456. +
  10457. +lo2o=s/\\.lo\$/.$objext/
  10458. +o2lo=s/\\.$objext\$/.lo/
  10459. +
  10460. +if test yes = "$_G_HAVE_XSI_OPS"; then
  10461. + eval 'func_lo2o ()
  10462. + {
  10463. + case $1 in
  10464. + *.lo) func_lo2o_result=${1%.lo}.$objext ;;
  10465. + * ) func_lo2o_result=$1 ;;
  10466. + esac
  10467. + }'
  10468. +
  10469. + # func_xform LIBOBJ-OR-SOURCE
  10470. + # ---------------------------
  10471. + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
  10472. + # suffix to a '.lo' libtool-object suffix.
  10473. + eval 'func_xform ()
  10474. + {
  10475. + func_xform_result=${1%.*}.lo
  10476. + }'
  10477. +else
  10478. + # ...otherwise fall back to using sed.
  10479. + func_lo2o ()
  10480. + {
  10481. + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
  10482. + }
  10483. +
  10484. + func_xform ()
  10485. + {
  10486. + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
  10487. + }
  10488. +fi
  10489. +
  10490. +
  10491. +# func_fatal_configuration ARG...
  10492. +# -------------------------------
  10493. +# Echo program name prefixed message to standard error, followed by
  10494. +# a configuration failure hint, and exit.
  10495. +func_fatal_configuration ()
  10496. +{
  10497. + func__fatal_error ${1+"$@"} \
  10498. + "See the $PACKAGE documentation for more information." \
  10499. + "Fatal configuration error."
  10500. +}
  10501. +
  10502. +
  10503. +# func_config
  10504. +# -----------
  10505. +# Display the configuration for all the tags in this script.
  10506. +func_config ()
  10507. +{
  10508. + re_begincf='^# ### BEGIN LIBTOOL'
  10509. + re_endcf='^# ### END LIBTOOL'
  10510. +
  10511. + # Default configuration.
  10512. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
  10513. +
  10514. + # Now print the configurations for the tags.
  10515. + for tagname in $taglist; do
  10516. + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
  10517. + done
  10518. +
  10519. + exit $?
  10520. +}
  10521. +
  10522. +
  10523. +# func_features
  10524. +# -------------
  10525. +# Display the features supported by this script.
  10526. +func_features ()
  10527. +{
  10528. + echo "host: $host"
  10529. + if test yes = "$build_libtool_libs"; then
  10530. + echo "enable shared libraries"
  10531. + else
  10532. + echo "disable shared libraries"
  10533. + fi
  10534. + if test yes = "$build_old_libs"; then
  10535. + echo "enable static libraries"
  10536. + else
  10537. + echo "disable static libraries"
  10538. + fi
  10539. +
  10540. + exit $?
  10541. +}
  10542. +
  10543. +
  10544. +# func_enable_tag TAGNAME
  10545. +# -----------------------
  10546. +# Verify that TAGNAME is valid, and either flag an error and exit, or
  10547. +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
  10548. +# variable here.
  10549. +func_enable_tag ()
  10550. +{
  10551. + # Global variable:
  10552. + tagname=$1
  10553. +
  10554. + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  10555. + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  10556. + sed_extractcf=/$re_begincf/,/$re_endcf/p
  10557. +
  10558. + # Validate tagname.
  10559. + case $tagname in
  10560. + *[!-_A-Za-z0-9,/]*)
  10561. + func_fatal_error "invalid tag name: $tagname"
  10562. + ;;
  10563. + esac
  10564. +
  10565. + # Don't test for the "default" C tag, as we know it's
  10566. + # there but not specially marked.
  10567. + case $tagname in
  10568. + CC) ;;
  10569. + *)
  10570. + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
  10571. + taglist="$taglist $tagname"
  10572. +
  10573. + # Evaluate the configuration. Be careful to quote the path
  10574. + # and the sed script, to avoid splitting on whitespace, but
  10575. + # also don't use non-portable quotes within backquotes within
  10576. + # quotes we have to do it in 2 steps:
  10577. + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
  10578. + eval "$extractedcf"
  10579. + else
  10580. + func_error "ignoring unknown tag $tagname"
  10581. + fi
  10582. + ;;
  10583. + esac
  10584. +}
  10585. +
  10586. +
  10587. +# func_check_version_match
  10588. +# ------------------------
  10589. +# Ensure that we are using m4 macros, and libtool script from the same
  10590. +# release of libtool.
  10591. +func_check_version_match ()
  10592. +{
  10593. + if test "$package_revision" != "$macro_revision"; then
  10594. + if test "$VERSION" != "$macro_version"; then
  10595. + if test -z "$macro_version"; then
  10596. + cat >&2 <<_LT_EOF
  10597. +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  10598. +$progname: definition of this LT_INIT comes from an older release.
  10599. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  10600. +$progname: and run autoconf again.
  10601. +_LT_EOF
  10602. + else
  10603. + cat >&2 <<_LT_EOF
  10604. +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  10605. +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
  10606. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  10607. +$progname: and run autoconf again.
  10608. +_LT_EOF
  10609. + fi
  10610. + else
  10611. + cat >&2 <<_LT_EOF
  10612. +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
  10613. +$progname: but the definition of this LT_INIT comes from revision $macro_revision.
  10614. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision
  10615. +$progname: of $PACKAGE $VERSION and run autoconf again.
  10616. +_LT_EOF
  10617. + fi
  10618. +
  10619. + exit $EXIT_MISMATCH
  10620. + fi
  10621. +}
  10622. +
  10623. +
  10624. +# libtool_options_prep [ARG]...
  10625. +# -----------------------------
  10626. +# Preparation for options parsed by libtool.
  10627. +libtool_options_prep ()
  10628. +{
  10629. + $debug_mode
  10630. +
  10631. + # Option defaults:
  10632. + opt_config=false
  10633. + opt_dlopen=
  10634. + opt_dry_run=false
  10635. + opt_help=false
  10636. + opt_mode=
  10637. + opt_preserve_dup_deps=false
  10638. + opt_quiet=false
  10639. +
  10640. + nonopt=
  10641. + preserve_args=
  10642. +
  10643. + # Shorthand for --mode=foo, only valid as the first argument
  10644. + case $1 in
  10645. + clean|clea|cle|cl)
  10646. + shift; set dummy --mode clean ${1+"$@"}; shift
  10647. + ;;
  10648. + compile|compil|compi|comp|com|co|c)
  10649. + shift; set dummy --mode compile ${1+"$@"}; shift
  10650. + ;;
  10651. + execute|execut|execu|exec|exe|ex|e)
  10652. + shift; set dummy --mode execute ${1+"$@"}; shift
  10653. + ;;
  10654. + finish|finis|fini|fin|fi|f)
  10655. + shift; set dummy --mode finish ${1+"$@"}; shift
  10656. + ;;
  10657. + install|instal|insta|inst|ins|in|i)
  10658. + shift; set dummy --mode install ${1+"$@"}; shift
  10659. + ;;
  10660. + link|lin|li|l)
  10661. + shift; set dummy --mode link ${1+"$@"}; shift
  10662. + ;;
  10663. + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  10664. + shift; set dummy --mode uninstall ${1+"$@"}; shift
  10665. + ;;
  10666. + esac
  10667. +
  10668. + # Pass back the list of options.
  10669. + func_quote_for_eval ${1+"$@"}
  10670. + libtool_options_prep_result=$func_quote_for_eval_result
  10671. +}
  10672. +func_add_hook func_options_prep libtool_options_prep
  10673. +
  10674. +
  10675. +# libtool_parse_options [ARG]...
  10676. +# ---------------------------------
  10677. +# Provide handling for libtool specific options.
  10678. +libtool_parse_options ()
  10679. +{
  10680. + $debug_cmd
  10681. +
  10682. + # Perform our own loop to consume as many options as possible in
  10683. + # each iteration.
  10684. + while test $# -gt 0; do
  10685. + _G_opt=$1
  10686. + shift
  10687. + case $_G_opt in
  10688. + --dry-run|--dryrun|-n)
  10689. + opt_dry_run=:
  10690. + ;;
  10691. +
  10692. + --config) func_config ;;
  10693. +
  10694. + --dlopen|-dlopen)
  10695. + opt_dlopen="${opt_dlopen+$opt_dlopen
  10696. +}$1"
  10697. + shift
  10698. + ;;
  10699. +
  10700. + --preserve-dup-deps)
  10701. + opt_preserve_dup_deps=: ;;
  10702. +
  10703. + --features) func_features ;;
  10704. +
  10705. + --finish) set dummy --mode finish ${1+"$@"}; shift ;;
  10706. +
  10707. + --help) opt_help=: ;;
  10708. +
  10709. + --help-all) opt_help=': help-all' ;;
  10710. +
  10711. + --mode) test $# = 0 && func_missing_arg $_G_opt && break
  10712. + opt_mode=$1
  10713. + case $1 in
  10714. + # Valid mode arguments:
  10715. + clean|compile|execute|finish|install|link|relink|uninstall) ;;
  10716. +
  10717. + # Catch anything else as an error
  10718. + *) func_error "invalid argument for $_G_opt"
  10719. + exit_cmd=exit
  10720. + break
  10721. + ;;
  10722. + esac
  10723. + shift
  10724. + ;;
  10725. +
  10726. + --no-silent|--no-quiet)
  10727. + opt_quiet=false
  10728. + func_append preserve_args " $_G_opt"
  10729. + ;;
  10730. +
  10731. + --no-warnings|--no-warning|--no-warn)
  10732. + opt_warning=false
  10733. + func_append preserve_args " $_G_opt"
  10734. + ;;
  10735. +
  10736. + --no-verbose)
  10737. + opt_verbose=false
  10738. + func_append preserve_args " $_G_opt"
  10739. + ;;
  10740. +
  10741. + --silent|--quiet)
  10742. + opt_quiet=:
  10743. + opt_verbose=false
  10744. + func_append preserve_args " $_G_opt"
  10745. + ;;
  10746. +
  10747. + --tag) test $# = 0 && func_missing_arg $_G_opt && break
  10748. + opt_tag=$1
  10749. + func_append preserve_args " $_G_opt $1"
  10750. + func_enable_tag "$1"
  10751. + shift
  10752. + ;;
  10753. +
  10754. + --verbose|-v) opt_quiet=false
  10755. + opt_verbose=:
  10756. + func_append preserve_args " $_G_opt"
  10757. + ;;
  10758. +
  10759. + # An option not handled by this hook function:
  10760. + *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  10761. + esac
  10762. + done
  10763. +
  10764. +
  10765. + # save modified positional parameters for caller
  10766. + func_quote_for_eval ${1+"$@"}
  10767. + libtool_parse_options_result=$func_quote_for_eval_result
  10768. +}
  10769. +func_add_hook func_parse_options libtool_parse_options
  10770. +
  10771. +
  10772. +
  10773. +# libtool_validate_options [ARG]...
  10774. +# ---------------------------------
  10775. +# Perform any sanity checks on option settings and/or unconsumed
  10776. +# arguments.
  10777. +libtool_validate_options ()
  10778. +{
  10779. + # save first non-option argument
  10780. + if test 0 -lt $#; then
  10781. + nonopt=$1
  10782. + shift
  10783. + fi
  10784. +
  10785. + # preserve --debug
  10786. + test : = "$debug_cmd" || func_append preserve_args " --debug"
  10787. +
  10788. + case $host in
  10789. + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
  10790. + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
  10791. + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
  10792. + # don't eliminate duplications in $postdeps and $predeps
  10793. + opt_duplicate_compiler_generated_deps=:
  10794. + ;;
  10795. + *)
  10796. + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
  10797. + ;;
  10798. + esac
  10799. +
  10800. + $opt_help || {
  10801. + # Sanity checks first:
  10802. + func_check_version_match
  10803. +
  10804. + test yes != "$build_libtool_libs" \
  10805. + && test yes != "$build_old_libs" \
  10806. + && func_fatal_configuration "not configured to build any kind of library"
  10807. +
  10808. + # Darwin sucks
  10809. + eval std_shrext=\"$shrext_cmds\"
  10810. +
  10811. + # Only execute mode is allowed to have -dlopen flags.
  10812. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
  10813. + func_error "unrecognized option '-dlopen'"
  10814. + $ECHO "$help" 1>&2
  10815. + exit $EXIT_FAILURE
  10816. + fi
  10817. +
  10818. + # Change the help message to a mode-specific one.
  10819. + generic_help=$help
  10820. + help="Try '$progname --help --mode=$opt_mode' for more information."
  10821. + }
  10822. +
  10823. + # Pass back the unparsed argument list
  10824. + func_quote_for_eval ${1+"$@"}
  10825. + libtool_validate_options_result=$func_quote_for_eval_result
  10826. +}
  10827. +func_add_hook func_validate_options libtool_validate_options
  10828. +
  10829. +
  10830. +# Process options as early as possible so that --help and --version
  10831. +# can return quickly.
  10832. +func_options ${1+"$@"}
  10833. +eval set dummy "$func_options_result"; shift
  10834. +
  10835. +
  10836. +
  10837. +## ----------- ##
  10838. +## Main. ##
  10839. +## ----------- ##
  10840. +
  10841. +magic='%%%MAGIC variable%%%'
  10842. +magic_exe='%%%MAGIC EXE variable%%%'
  10843. +
  10844. +# Global variables.
  10845. +extracted_archives=
  10846. +extracted_serial=0
  10847. +
  10848. +# If this variable is set in any of the actions, the command in it
  10849. +# will be execed at the end. This prevents here-documents from being
  10850. +# left over by shells.
  10851. +exec_cmd=
  10852. +
  10853. +
  10854. +# A function that is used when there is no print builtin or printf.
  10855. +func_fallback_echo ()
  10856. +{
  10857. + eval 'cat <<_LTECHO_EOF
  10858. +$1
  10859. +_LTECHO_EOF'
  10860. +}
  10861. +
  10862. +# func_generated_by_libtool
  10863. +# True iff stdin has been generated by Libtool. This function is only
  10864. +# a basic sanity check; it will hardly flush out determined imposters.
  10865. +func_generated_by_libtool_p ()
  10866. +{
  10867. + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
  10868. +}
  10869. +
  10870. +# func_lalib_p file
  10871. +# True iff FILE is a libtool '.la' library or '.lo' object file.
  10872. +# This function is only a basic sanity check; it will hardly flush out
  10873. +# determined imposters.
  10874. +func_lalib_p ()
  10875. +{
  10876. + test -f "$1" &&
  10877. + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
  10878. +}
  10879. +
  10880. +# func_lalib_unsafe_p file
  10881. +# True iff FILE is a libtool '.la' library or '.lo' object file.
  10882. +# This function implements the same check as func_lalib_p without
  10883. +# resorting to external programs. To this end, it redirects stdin and
  10884. +# closes it afterwards, without saving the original file descriptor.
  10885. +# As a safety measure, use it only where a negative result would be
  10886. +# fatal anyway. Works if 'file' does not exist.
  10887. +func_lalib_unsafe_p ()
  10888. +{
  10889. + lalib_p=no
  10890. + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
  10891. + for lalib_p_l in 1 2 3 4
  10892. + do
  10893. + read lalib_p_line
  10894. + case $lalib_p_line in
  10895. + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
  10896. + esac
  10897. + done
  10898. + exec 0<&5 5<&-
  10899. + fi
  10900. + test yes = "$lalib_p"
  10901. +}
  10902. +
  10903. +# func_ltwrapper_script_p file
  10904. +# True iff FILE is a libtool wrapper script
  10905. +# This function is only a basic sanity check; it will hardly flush out
  10906. +# determined imposters.
  10907. +func_ltwrapper_script_p ()
  10908. +{
  10909. + test -f "$1" &&
  10910. + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
  10911. +}
  10912. +
  10913. +# func_ltwrapper_executable_p file
  10914. +# True iff FILE is a libtool wrapper executable
  10915. +# This function is only a basic sanity check; it will hardly flush out
  10916. +# determined imposters.
  10917. +func_ltwrapper_executable_p ()
  10918. +{
  10919. + func_ltwrapper_exec_suffix=
  10920. + case $1 in
  10921. + *.exe) ;;
  10922. + *) func_ltwrapper_exec_suffix=.exe ;;
  10923. + esac
  10924. + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
  10925. +}
  10926. +
  10927. +# func_ltwrapper_scriptname file
  10928. +# Assumes file is an ltwrapper_executable
  10929. +# uses $file to determine the appropriate filename for a
  10930. +# temporary ltwrapper_script.
  10931. +func_ltwrapper_scriptname ()
  10932. +{
  10933. + func_dirname_and_basename "$1" "" "."
  10934. + func_stripname '' '.exe' "$func_basename_result"
  10935. + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
  10936. +}
  10937. +
  10938. +# func_ltwrapper_p file
  10939. +# True iff FILE is a libtool wrapper script or wrapper executable
  10940. +# This function is only a basic sanity check; it will hardly flush out
  10941. +# determined imposters.
  10942. +func_ltwrapper_p ()
  10943. +{
  10944. + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
  10945. +}
  10946. +
  10947. +
  10948. +# func_execute_cmds commands fail_cmd
  10949. +# Execute tilde-delimited COMMANDS.
  10950. +# If FAIL_CMD is given, eval that upon failure.
  10951. +# FAIL_CMD may read-access the current command in variable CMD!
  10952. +func_execute_cmds ()
  10953. +{
  10954. + $debug_cmd
  10955. +
  10956. + save_ifs=$IFS; IFS='~'
  10957. + for cmd in $1; do
  10958. + IFS=$sp$nl
  10959. + eval cmd=\"$cmd\"
  10960. + IFS=$save_ifs
  10961. + func_show_eval "$cmd" "${2-:}"
  10962. + done
  10963. + IFS=$save_ifs
  10964. +}
  10965. +
  10966. +
  10967. +# func_source file
  10968. +# Source FILE, adding directory component if necessary.
  10969. +# Note that it is not necessary on cygwin/mingw to append a dot to
  10970. +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
  10971. +# behavior happens only for exec(3), not for open(2)! Also, sourcing
  10972. +# 'FILE.' does not work on cygwin managed mounts.
  10973. +func_source ()
  10974. +{
  10975. + $debug_cmd
  10976. +
  10977. + case $1 in
  10978. + */* | *\\*) . "$1" ;;
  10979. + *) . "./$1" ;;
  10980. + esac
  10981. +}
  10982. +
  10983. +
  10984. +# func_resolve_sysroot PATH
  10985. +# Replace a leading = in PATH with a sysroot. Store the result into
  10986. +# func_resolve_sysroot_result
  10987. +func_resolve_sysroot ()
  10988. +{
  10989. + func_resolve_sysroot_result=$1
  10990. + case $func_resolve_sysroot_result in
  10991. + =*)
  10992. + func_stripname '=' '' "$func_resolve_sysroot_result"
  10993. + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
  10994. + ;;
  10995. + esac
  10996. +}
  10997. +
  10998. +# func_replace_sysroot PATH
  10999. +# If PATH begins with the sysroot, replace it with = and
  11000. +# store the result into func_replace_sysroot_result.
  11001. +func_replace_sysroot ()
  11002. +{
  11003. + case $lt_sysroot:$1 in
  11004. + ?*:"$lt_sysroot"*)
  11005. + func_stripname "$lt_sysroot" '' "$1"
  11006. + func_replace_sysroot_result='='$func_stripname_result
  11007. + ;;
  11008. + *)
  11009. + # Including no sysroot.
  11010. + func_replace_sysroot_result=$1
  11011. + ;;
  11012. + esac
  11013. +}
  11014. +
  11015. +# func_infer_tag arg
  11016. +# Infer tagged configuration to use if any are available and
  11017. +# if one wasn't chosen via the "--tag" command line option.
  11018. +# Only attempt this if the compiler in the base compile
  11019. +# command doesn't match the default compiler.
  11020. +# arg is usually of the form 'gcc ...'
  11021. +func_infer_tag ()
  11022. +{
  11023. + $debug_cmd
  11024. +
  11025. + if test -n "$available_tags" && test -z "$tagname"; then
  11026. + CC_quoted=
  11027. + for arg in $CC; do
  11028. + func_append_quoted CC_quoted "$arg"
  11029. + done
  11030. + CC_expanded=`func_echo_all $CC`
  11031. + CC_quoted_expanded=`func_echo_all $CC_quoted`
  11032. + case $@ in
  11033. + # Blanks in the command may have been stripped by the calling shell,
  11034. + # but not from the CC environment variable when configure was run.
  11035. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  11036. + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
  11037. + # Blanks at the start of $base_compile will cause this to fail
  11038. + # if we don't check for them as well.
  11039. + *)
  11040. + for z in $available_tags; do
  11041. + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  11042. + # Evaluate the configuration.
  11043. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  11044. + CC_quoted=
  11045. + for arg in $CC; do
  11046. + # Double-quote args containing other shell metacharacters.
  11047. + func_append_quoted CC_quoted "$arg"
  11048. + done
  11049. + CC_expanded=`func_echo_all $CC`
  11050. + CC_quoted_expanded=`func_echo_all $CC_quoted`
  11051. + case "$@ " in
  11052. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  11053. + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
  11054. + # The compiler in the base compile command matches
  11055. + # the one in the tagged configuration.
  11056. + # Assume this is the tagged configuration we want.
  11057. + tagname=$z
  11058. + break
  11059. + ;;
  11060. + esac
  11061. + fi
  11062. + done
  11063. + # If $tagname still isn't set, then no tagged configuration
  11064. + # was found and let the user know that the "--tag" command
  11065. + # line option must be used.
  11066. + if test -z "$tagname"; then
  11067. + func_echo "unable to infer tagged configuration"
  11068. + func_fatal_error "specify a tag with '--tag'"
  11069. +# else
  11070. +# func_verbose "using $tagname tagged configuration"
  11071. + fi
  11072. + ;;
  11073. + esac
  11074. + fi
  11075. +}
  11076. +
  11077. +
  11078. +
  11079. +# func_write_libtool_object output_name pic_name nonpic_name
  11080. +# Create a libtool object file (analogous to a ".la" file),
  11081. +# but don't create it if we're doing a dry run.
  11082. +func_write_libtool_object ()
  11083. +{
  11084. + write_libobj=$1
  11085. + if test yes = "$build_libtool_libs"; then
  11086. + write_lobj=\'$2\'
  11087. + else
  11088. + write_lobj=none
  11089. + fi
  11090. +
  11091. + if test yes = "$build_old_libs"; then
  11092. + write_oldobj=\'$3\'
  11093. + else
  11094. + write_oldobj=none
  11095. + fi
  11096. +
  11097. + $opt_dry_run || {
  11098. + cat >${write_libobj}T <<EOF
  11099. +# $write_libobj - a libtool object file
  11100. +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  11101. +#
  11102. +# Please DO NOT delete this file!
  11103. +# It is necessary for linking the library.
  11104. +
  11105. +# Name of the PIC object.
  11106. +pic_object=$write_lobj
  11107. +
  11108. +# Name of the non-PIC object
  11109. +non_pic_object=$write_oldobj
  11110. +
  11111. +EOF
  11112. + $MV "${write_libobj}T" "$write_libobj"
  11113. + }
  11114. +}
  11115. +
  11116. +
  11117. +##################################################
  11118. +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
  11119. +##################################################
  11120. +
  11121. +# func_convert_core_file_wine_to_w32 ARG
  11122. +# Helper function used by file name conversion functions when $build is *nix,
  11123. +# and $host is mingw, cygwin, or some other w32 environment. Relies on a
  11124. +# correctly configured wine environment available, with the winepath program
  11125. +# in $build's $PATH.
  11126. +#
  11127. +# ARG is the $build file name to be converted to w32 format.
  11128. +# Result is available in $func_convert_core_file_wine_to_w32_result, and will
  11129. +# be empty on error (or when ARG is empty)
  11130. +func_convert_core_file_wine_to_w32 ()
  11131. +{
  11132. + $debug_cmd
  11133. +
  11134. + func_convert_core_file_wine_to_w32_result=$1
  11135. + if test -n "$1"; then
  11136. + # Unfortunately, winepath does not exit with a non-zero error code, so we
  11137. + # are forced to check the contents of stdout. On the other hand, if the
  11138. + # command is not found, the shell will set an exit code of 127 and print
  11139. + # *an error message* to stdout. So we must check for both error code of
  11140. + # zero AND non-empty stdout, which explains the odd construction:
  11141. + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
  11142. + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
  11143. + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
  11144. + $SED -e "$sed_naive_backslashify"`
  11145. + else
  11146. + func_convert_core_file_wine_to_w32_result=
  11147. + fi
  11148. + fi
  11149. +}
  11150. +# end: func_convert_core_file_wine_to_w32
  11151. +
  11152. +
  11153. +# func_convert_core_path_wine_to_w32 ARG
  11154. +# Helper function used by path conversion functions when $build is *nix, and
  11155. +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
  11156. +# configured wine environment available, with the winepath program in $build's
  11157. +# $PATH. Assumes ARG has no leading or trailing path separator characters.
  11158. +#
  11159. +# ARG is path to be converted from $build format to win32.
  11160. +# Result is available in $func_convert_core_path_wine_to_w32_result.
  11161. +# Unconvertible file (directory) names in ARG are skipped; if no directory names
  11162. +# are convertible, then the result may be empty.
  11163. +func_convert_core_path_wine_to_w32 ()
  11164. +{
  11165. + $debug_cmd
  11166. +
  11167. + # unfortunately, winepath doesn't convert paths, only file names
  11168. + func_convert_core_path_wine_to_w32_result=
  11169. + if test -n "$1"; then
  11170. + oldIFS=$IFS
  11171. + IFS=:
  11172. + for func_convert_core_path_wine_to_w32_f in $1; do
  11173. + IFS=$oldIFS
  11174. + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
  11175. + if test -n "$func_convert_core_file_wine_to_w32_result"; then
  11176. + if test -z "$func_convert_core_path_wine_to_w32_result"; then
  11177. + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
  11178. + else
  11179. + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
  11180. + fi
  11181. + fi
  11182. + done
  11183. + IFS=$oldIFS
  11184. + fi
  11185. +}
  11186. +# end: func_convert_core_path_wine_to_w32
  11187. +
  11188. +
  11189. +# func_cygpath ARGS...
  11190. +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
  11191. +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
  11192. +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
  11193. +# (2), returns the Cygwin file name or path in func_cygpath_result (input
  11194. +# file name or path is assumed to be in w32 format, as previously converted
  11195. +# from $build's *nix or MSYS format). In case (3), returns the w32 file name
  11196. +# or path in func_cygpath_result (input file name or path is assumed to be in
  11197. +# Cygwin format). Returns an empty string on error.
  11198. +#
  11199. +# ARGS are passed to cygpath, with the last one being the file name or path to
  11200. +# be converted.
  11201. +#
  11202. +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
  11203. +# environment variable; do not put it in $PATH.
  11204. +func_cygpath ()
  11205. +{
  11206. + $debug_cmd
  11207. +
  11208. + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
  11209. + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
  11210. + if test "$?" -ne 0; then
  11211. + # on failure, ensure result is empty
  11212. + func_cygpath_result=
  11213. + fi
  11214. + else
  11215. + func_cygpath_result=
  11216. + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
  11217. + fi
  11218. +}
  11219. +#end: func_cygpath
  11220. +
  11221. +
  11222. +# func_convert_core_msys_to_w32 ARG
  11223. +# Convert file name or path ARG from MSYS format to w32 format. Return
  11224. +# result in func_convert_core_msys_to_w32_result.
  11225. +func_convert_core_msys_to_w32 ()
  11226. +{
  11227. + $debug_cmd
  11228. +
  11229. + # awkward: cmd appends spaces to result
  11230. + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
  11231. + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
  11232. +}
  11233. +#end: func_convert_core_msys_to_w32
  11234. +
  11235. +
  11236. +# func_convert_file_check ARG1 ARG2
  11237. +# Verify that ARG1 (a file name in $build format) was converted to $host
  11238. +# format in ARG2. Otherwise, emit an error message, but continue (resetting
  11239. +# func_to_host_file_result to ARG1).
  11240. +func_convert_file_check ()
  11241. +{
  11242. + $debug_cmd
  11243. +
  11244. + if test -z "$2" && test -n "$1"; then
  11245. + func_error "Could not determine host file name corresponding to"
  11246. + func_error " '$1'"
  11247. + func_error "Continuing, but uninstalled executables may not work."
  11248. + # Fallback:
  11249. + func_to_host_file_result=$1
  11250. + fi
  11251. +}
  11252. +# end func_convert_file_check
  11253. +
  11254. +
  11255. +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
  11256. +# Verify that FROM_PATH (a path in $build format) was converted to $host
  11257. +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
  11258. +# func_to_host_file_result to a simplistic fallback value (see below).
  11259. +func_convert_path_check ()
  11260. +{
  11261. + $debug_cmd
  11262. +
  11263. + if test -z "$4" && test -n "$3"; then
  11264. + func_error "Could not determine the host path corresponding to"
  11265. + func_error " '$3'"
  11266. + func_error "Continuing, but uninstalled executables may not work."
  11267. + # Fallback. This is a deliberately simplistic "conversion" and
  11268. + # should not be "improved". See libtool.info.
  11269. + if test "x$1" != "x$2"; then
  11270. + lt_replace_pathsep_chars="s|$1|$2|g"
  11271. + func_to_host_path_result=`echo "$3" |
  11272. + $SED -e "$lt_replace_pathsep_chars"`
  11273. + else
  11274. + func_to_host_path_result=$3
  11275. + fi
  11276. + fi
  11277. +}
  11278. +# end func_convert_path_check
  11279. +
  11280. +
  11281. +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
  11282. +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
  11283. +# and appending REPL if ORIG matches BACKPAT.
  11284. +func_convert_path_front_back_pathsep ()
  11285. +{
  11286. + $debug_cmd
  11287. +
  11288. + case $4 in
  11289. + $1 ) func_to_host_path_result=$3$func_to_host_path_result
  11290. + ;;
  11291. + esac
  11292. + case $4 in
  11293. + $2 ) func_append func_to_host_path_result "$3"
  11294. + ;;
  11295. + esac
  11296. +}
  11297. +# end func_convert_path_front_back_pathsep
  11298. +
  11299. +
  11300. +##################################################
  11301. +# $build to $host FILE NAME CONVERSION FUNCTIONS #
  11302. +##################################################
  11303. +# invoked via '$to_host_file_cmd ARG'
  11304. +#
  11305. +# In each case, ARG is the path to be converted from $build to $host format.
  11306. +# Result will be available in $func_to_host_file_result.
  11307. +
  11308. +
  11309. +# func_to_host_file ARG
  11310. +# Converts the file name ARG from $build format to $host format. Return result
  11311. +# in func_to_host_file_result.
  11312. +func_to_host_file ()
  11313. +{
  11314. + $debug_cmd
  11315. +
  11316. + $to_host_file_cmd "$1"
  11317. +}
  11318. +# end func_to_host_file
  11319. +
  11320. +
  11321. +# func_to_tool_file ARG LAZY
  11322. +# converts the file name ARG from $build format to toolchain format. Return
  11323. +# result in func_to_tool_file_result. If the conversion in use is listed
  11324. +# in (the comma separated) LAZY, no conversion takes place.
  11325. +func_to_tool_file ()
  11326. +{
  11327. + $debug_cmd
  11328. +
  11329. + case ,$2, in
  11330. + *,"$to_tool_file_cmd",*)
  11331. + func_to_tool_file_result=$1
  11332. + ;;
  11333. + *)
  11334. + $to_tool_file_cmd "$1"
  11335. + func_to_tool_file_result=$func_to_host_file_result
  11336. + ;;
  11337. + esac
  11338. +}
  11339. +# end func_to_tool_file
  11340. +
  11341. +
  11342. +# func_convert_file_noop ARG
  11343. +# Copy ARG to func_to_host_file_result.
  11344. +func_convert_file_noop ()
  11345. +{
  11346. + func_to_host_file_result=$1
  11347. +}
  11348. +# end func_convert_file_noop
  11349. +
  11350. +
  11351. +# func_convert_file_msys_to_w32 ARG
  11352. +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
  11353. +# conversion to w32 is not available inside the cwrapper. Returns result in
  11354. +# func_to_host_file_result.
  11355. +func_convert_file_msys_to_w32 ()
  11356. +{
  11357. + $debug_cmd
  11358. +
  11359. + func_to_host_file_result=$1
  11360. + if test -n "$1"; then
  11361. + func_convert_core_msys_to_w32 "$1"
  11362. + func_to_host_file_result=$func_convert_core_msys_to_w32_result
  11363. + fi
  11364. + func_convert_file_check "$1" "$func_to_host_file_result"
  11365. +}
  11366. +# end func_convert_file_msys_to_w32
  11367. +
  11368. +
  11369. +# func_convert_file_cygwin_to_w32 ARG
  11370. +# Convert file name ARG from Cygwin to w32 format. Returns result in
  11371. +# func_to_host_file_result.
  11372. +func_convert_file_cygwin_to_w32 ()
  11373. +{
  11374. + $debug_cmd
  11375. +
  11376. + func_to_host_file_result=$1
  11377. + if test -n "$1"; then
  11378. + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
  11379. + # LT_CYGPATH in this case.
  11380. + func_to_host_file_result=`cygpath -m "$1"`
  11381. + fi
  11382. + func_convert_file_check "$1" "$func_to_host_file_result"
  11383. +}
  11384. +# end func_convert_file_cygwin_to_w32
  11385. +
  11386. +
  11387. +# func_convert_file_nix_to_w32 ARG
  11388. +# Convert file name ARG from *nix to w32 format. Requires a wine environment
  11389. +# and a working winepath. Returns result in func_to_host_file_result.
  11390. +func_convert_file_nix_to_w32 ()
  11391. +{
  11392. + $debug_cmd
  11393. +
  11394. + func_to_host_file_result=$1
  11395. + if test -n "$1"; then
  11396. + func_convert_core_file_wine_to_w32 "$1"
  11397. + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
  11398. + fi
  11399. + func_convert_file_check "$1" "$func_to_host_file_result"
  11400. +}
  11401. +# end func_convert_file_nix_to_w32
  11402. +
  11403. +
  11404. +# func_convert_file_msys_to_cygwin ARG
  11405. +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  11406. +# Returns result in func_to_host_file_result.
  11407. +func_convert_file_msys_to_cygwin ()
  11408. +{
  11409. + $debug_cmd
  11410. +
  11411. + func_to_host_file_result=$1
  11412. + if test -n "$1"; then
  11413. + func_convert_core_msys_to_w32 "$1"
  11414. + func_cygpath -u "$func_convert_core_msys_to_w32_result"
  11415. + func_to_host_file_result=$func_cygpath_result
  11416. + fi
  11417. + func_convert_file_check "$1" "$func_to_host_file_result"
  11418. +}
  11419. +# end func_convert_file_msys_to_cygwin
  11420. +
  11421. +
  11422. +# func_convert_file_nix_to_cygwin ARG
  11423. +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
  11424. +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
  11425. +# in func_to_host_file_result.
  11426. +func_convert_file_nix_to_cygwin ()
  11427. +{
  11428. + $debug_cmd
  11429. +
  11430. + func_to_host_file_result=$1
  11431. + if test -n "$1"; then
  11432. + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
  11433. + func_convert_core_file_wine_to_w32 "$1"
  11434. + func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
  11435. + func_to_host_file_result=$func_cygpath_result
  11436. + fi
  11437. + func_convert_file_check "$1" "$func_to_host_file_result"
  11438. +}
  11439. +# end func_convert_file_nix_to_cygwin
  11440. +
  11441. +
  11442. +#############################################
  11443. +# $build to $host PATH CONVERSION FUNCTIONS #
  11444. +#############################################
  11445. +# invoked via '$to_host_path_cmd ARG'
  11446. +#
  11447. +# In each case, ARG is the path to be converted from $build to $host format.
  11448. +# The result will be available in $func_to_host_path_result.
  11449. +#
  11450. +# Path separators are also converted from $build format to $host format. If
  11451. +# ARG begins or ends with a path separator character, it is preserved (but
  11452. +# converted to $host format) on output.
  11453. +#
  11454. +# All path conversion functions are named using the following convention:
  11455. +# file name conversion function : func_convert_file_X_to_Y ()
  11456. +# path conversion function : func_convert_path_X_to_Y ()
  11457. +# where, for any given $build/$host combination the 'X_to_Y' value is the
  11458. +# same. If conversion functions are added for new $build/$host combinations,
  11459. +# the two new functions must follow this pattern, or func_init_to_host_path_cmd
  11460. +# will break.
  11461. +
  11462. +
  11463. +# func_init_to_host_path_cmd
  11464. +# Ensures that function "pointer" variable $to_host_path_cmd is set to the
  11465. +# appropriate value, based on the value of $to_host_file_cmd.
  11466. +to_host_path_cmd=
  11467. +func_init_to_host_path_cmd ()
  11468. +{
  11469. + $debug_cmd
  11470. +
  11471. + if test -z "$to_host_path_cmd"; then
  11472. + func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
  11473. + to_host_path_cmd=func_convert_path_$func_stripname_result
  11474. + fi
  11475. +}
  11476. +
  11477. +
  11478. +# func_to_host_path ARG
  11479. +# Converts the path ARG from $build format to $host format. Return result
  11480. +# in func_to_host_path_result.
  11481. +func_to_host_path ()
  11482. +{
  11483. + $debug_cmd
  11484. +
  11485. + func_init_to_host_path_cmd
  11486. + $to_host_path_cmd "$1"
  11487. +}
  11488. +# end func_to_host_path
  11489. +
  11490. +
  11491. +# func_convert_path_noop ARG
  11492. +# Copy ARG to func_to_host_path_result.
  11493. +func_convert_path_noop ()
  11494. +{
  11495. + func_to_host_path_result=$1
  11496. +}
  11497. +# end func_convert_path_noop
  11498. +
  11499. +
  11500. +# func_convert_path_msys_to_w32 ARG
  11501. +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
  11502. +# conversion to w32 is not available inside the cwrapper. Returns result in
  11503. +# func_to_host_path_result.
  11504. +func_convert_path_msys_to_w32 ()
  11505. +{
  11506. + $debug_cmd
  11507. +
  11508. + func_to_host_path_result=$1
  11509. + if test -n "$1"; then
  11510. + # Remove leading and trailing path separator characters from ARG. MSYS
  11511. + # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
  11512. + # and winepath ignores them completely.
  11513. + func_stripname : : "$1"
  11514. + func_to_host_path_tmp1=$func_stripname_result
  11515. + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  11516. + func_to_host_path_result=$func_convert_core_msys_to_w32_result
  11517. + func_convert_path_check : ";" \
  11518. + "$func_to_host_path_tmp1" "$func_to_host_path_result"
  11519. + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  11520. + fi
  11521. +}
  11522. +# end func_convert_path_msys_to_w32
  11523. +
  11524. +
  11525. +# func_convert_path_cygwin_to_w32 ARG
  11526. +# Convert path ARG from Cygwin to w32 format. Returns result in
  11527. +# func_to_host_file_result.
  11528. +func_convert_path_cygwin_to_w32 ()
  11529. +{
  11530. + $debug_cmd
  11531. +
  11532. + func_to_host_path_result=$1
  11533. + if test -n "$1"; then
  11534. + # See func_convert_path_msys_to_w32:
  11535. + func_stripname : : "$1"
  11536. + func_to_host_path_tmp1=$func_stripname_result
  11537. + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
  11538. + func_convert_path_check : ";" \
  11539. + "$func_to_host_path_tmp1" "$func_to_host_path_result"
  11540. + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  11541. + fi
  11542. +}
  11543. +# end func_convert_path_cygwin_to_w32
  11544. +
  11545. +
  11546. +# func_convert_path_nix_to_w32 ARG
  11547. +# Convert path ARG from *nix to w32 format. Requires a wine environment and
  11548. +# a working winepath. Returns result in func_to_host_file_result.
  11549. +func_convert_path_nix_to_w32 ()
  11550. +{
  11551. + $debug_cmd
  11552. +
  11553. + func_to_host_path_result=$1
  11554. + if test -n "$1"; then
  11555. + # See func_convert_path_msys_to_w32:
  11556. + func_stripname : : "$1"
  11557. + func_to_host_path_tmp1=$func_stripname_result
  11558. + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  11559. + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
  11560. + func_convert_path_check : ";" \
  11561. + "$func_to_host_path_tmp1" "$func_to_host_path_result"
  11562. + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  11563. + fi
  11564. +}
  11565. +# end func_convert_path_nix_to_w32
  11566. +
  11567. +
  11568. +# func_convert_path_msys_to_cygwin ARG
  11569. +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  11570. +# Returns result in func_to_host_file_result.
  11571. +func_convert_path_msys_to_cygwin ()
  11572. +{
  11573. + $debug_cmd
  11574. +
  11575. + func_to_host_path_result=$1
  11576. + if test -n "$1"; then
  11577. + # See func_convert_path_msys_to_w32:
  11578. + func_stripname : : "$1"
  11579. + func_to_host_path_tmp1=$func_stripname_result
  11580. + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  11581. + func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
  11582. + func_to_host_path_result=$func_cygpath_result
  11583. + func_convert_path_check : : \
  11584. + "$func_to_host_path_tmp1" "$func_to_host_path_result"
  11585. + func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  11586. + fi
  11587. +}
  11588. +# end func_convert_path_msys_to_cygwin
  11589. +
  11590. +
  11591. +# func_convert_path_nix_to_cygwin ARG
  11592. +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
  11593. +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
  11594. +# func_to_host_file_result.
  11595. +func_convert_path_nix_to_cygwin ()
  11596. +{
  11597. + $debug_cmd
  11598. +
  11599. + func_to_host_path_result=$1
  11600. + if test -n "$1"; then
  11601. + # Remove leading and trailing path separator characters from
  11602. + # ARG. msys behavior is inconsistent here, cygpath turns them
  11603. + # into '.;' and ';.', and winepath ignores them completely.
  11604. + func_stripname : : "$1"
  11605. + func_to_host_path_tmp1=$func_stripname_result
  11606. + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  11607. + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
  11608. + func_to_host_path_result=$func_cygpath_result
  11609. + func_convert_path_check : : \
  11610. + "$func_to_host_path_tmp1" "$func_to_host_path_result"
  11611. + func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  11612. + fi
  11613. +}
  11614. +# end func_convert_path_nix_to_cygwin
  11615. +
  11616. +
  11617. +# func_dll_def_p FILE
  11618. +# True iff FILE is a Windows DLL '.def' file.
  11619. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4
  11620. +func_dll_def_p ()
  11621. +{
  11622. + $debug_cmd
  11623. +
  11624. + func_dll_def_p_tmp=`$SED -n \
  11625. + -e 's/^[ ]*//' \
  11626. + -e '/^\(;.*\)*$/d' \
  11627. + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
  11628. + -e q \
  11629. + "$1"`
  11630. + test DEF = "$func_dll_def_p_tmp"
  11631. +}
  11632. +
  11633. +
  11634. +# func_mode_compile arg...
  11635. +func_mode_compile ()
  11636. +{
  11637. + $debug_cmd
  11638. +
  11639. + # Get the compilation command and the source file.
  11640. + base_compile=
  11641. + srcfile=$nonopt # always keep a non-empty value in "srcfile"
  11642. + suppress_opt=yes
  11643. + suppress_output=
  11644. + arg_mode=normal
  11645. + libobj=
  11646. + later=
  11647. + pie_flag=
  11648. +
  11649. + for arg
  11650. + do
  11651. + case $arg_mode in
  11652. + arg )
  11653. + # do not "continue". Instead, add this to base_compile
  11654. + lastarg=$arg
  11655. + arg_mode=normal
  11656. + ;;
  11657. +
  11658. + target )
  11659. + libobj=$arg
  11660. + arg_mode=normal
  11661. + continue
  11662. + ;;
  11663. +
  11664. + normal )
  11665. + # Accept any command-line options.
  11666. + case $arg in
  11667. + -o)
  11668. + test -n "$libobj" && \
  11669. + func_fatal_error "you cannot specify '-o' more than once"
  11670. + arg_mode=target
  11671. + continue
  11672. + ;;
  11673. +
  11674. + -pie | -fpie | -fPIE)
  11675. + func_append pie_flag " $arg"
  11676. + continue
  11677. + ;;
  11678. +
  11679. + -shared | -static | -prefer-pic | -prefer-non-pic)
  11680. + func_append later " $arg"
  11681. + continue
  11682. + ;;
  11683. +
  11684. + -no-suppress)
  11685. + suppress_opt=no
  11686. + continue
  11687. + ;;
  11688. +
  11689. + -Xcompiler)
  11690. + arg_mode=arg # the next one goes into the "base_compile" arg list
  11691. + continue # The current "srcfile" will either be retained or
  11692. + ;; # replaced later. I would guess that would be a bug.
  11693. +
  11694. + -Wc,*)
  11695. + func_stripname '-Wc,' '' "$arg"
  11696. + args=$func_stripname_result
  11697. + lastarg=
  11698. + save_ifs=$IFS; IFS=,
  11699. + for arg in $args; do
  11700. + IFS=$save_ifs
  11701. + func_append_quoted lastarg "$arg"
  11702. + done
  11703. + IFS=$save_ifs
  11704. + func_stripname ' ' '' "$lastarg"
  11705. + lastarg=$func_stripname_result
  11706. +
  11707. + # Add the arguments to base_compile.
  11708. + func_append base_compile " $lastarg"
  11709. + continue
  11710. + ;;
  11711. +
  11712. + *)
  11713. + # Accept the current argument as the source file.
  11714. + # The previous "srcfile" becomes the current argument.
  11715. + #
  11716. + lastarg=$srcfile
  11717. + srcfile=$arg
  11718. + ;;
  11719. + esac # case $arg
  11720. + ;;
  11721. + esac # case $arg_mode
  11722. +
  11723. + # Aesthetically quote the previous argument.
  11724. + func_append_quoted base_compile "$lastarg"
  11725. + done # for arg
  11726. +
  11727. + case $arg_mode in
  11728. + arg)
  11729. + func_fatal_error "you must specify an argument for -Xcompile"
  11730. + ;;
  11731. + target)
  11732. + func_fatal_error "you must specify a target with '-o'"
  11733. + ;;
  11734. + *)
  11735. + # Get the name of the library object.
  11736. + test -z "$libobj" && {
  11737. + func_basename "$srcfile"
  11738. + libobj=$func_basename_result
  11739. + }
  11740. + ;;
  11741. + esac
  11742. +
  11743. + # Recognize several different file suffixes.
  11744. + # If the user specifies -o file.o, it is replaced with file.lo
  11745. + case $libobj in
  11746. + *.[cCFSifmso] | \
  11747. + *.ada | *.adb | *.ads | *.asm | \
  11748. + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  11749. + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
  11750. + func_xform "$libobj"
  11751. + libobj=$func_xform_result
  11752. + ;;
  11753. + esac
  11754. +
  11755. + case $libobj in
  11756. + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  11757. + *)
  11758. + func_fatal_error "cannot determine name of library object from '$libobj'"
  11759. + ;;
  11760. + esac
  11761. +
  11762. + func_infer_tag $base_compile
  11763. +
  11764. + for arg in $later; do
  11765. + case $arg in
  11766. + -shared)
  11767. + test yes = "$build_libtool_libs" \
  11768. + || func_fatal_configuration "cannot build a shared library"
  11769. + build_old_libs=no
  11770. + continue
  11771. + ;;
  11772. +
  11773. + -static)
  11774. + build_libtool_libs=no
  11775. + build_old_libs=yes
  11776. + continue
  11777. + ;;
  11778. +
  11779. + -prefer-pic)
  11780. + pic_mode=yes
  11781. + continue
  11782. + ;;
  11783. +
  11784. + -prefer-non-pic)
  11785. + pic_mode=no
  11786. + continue
  11787. + ;;
  11788. + esac
  11789. + done
  11790. +
  11791. + func_quote_for_eval "$libobj"
  11792. + test "X$libobj" != "X$func_quote_for_eval_result" \
  11793. + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
  11794. + && func_warning "libobj name '$libobj' may not contain shell special characters."
  11795. + func_dirname_and_basename "$obj" "/" ""
  11796. + objname=$func_basename_result
  11797. + xdir=$func_dirname_result
  11798. + lobj=$xdir$objdir/$objname
  11799. +
  11800. + test -z "$base_compile" && \
  11801. + func_fatal_help "you must specify a compilation command"
  11802. +
  11803. + # Delete any leftover library objects.
  11804. + if test yes = "$build_old_libs"; then
  11805. + removelist="$obj $lobj $libobj ${libobj}T"
  11806. + else
  11807. + removelist="$lobj $libobj ${libobj}T"
  11808. + fi
  11809. +
  11810. + # On Cygwin there's no "real" PIC flag so we must build both object types
  11811. + case $host_os in
  11812. + cygwin* | mingw* | pw32* | os2* | cegcc*)
  11813. + pic_mode=default
  11814. + ;;
  11815. + esac
  11816. + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
  11817. + # non-PIC code in shared libraries is not supported
  11818. + pic_mode=default
  11819. + fi
  11820. +
  11821. + # Calculate the filename of the output object if compiler does
  11822. + # not support -o with -c
  11823. + if test no = "$compiler_c_o"; then
  11824. + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
  11825. + lockfile=$output_obj.lock
  11826. + else
  11827. + output_obj=
  11828. + need_locks=no
  11829. + lockfile=
  11830. + fi
  11831. +
  11832. + # Lock this critical section if it is needed
  11833. + # We use this script file to make the link, it avoids creating a new file
  11834. + if test yes = "$need_locks"; then
  11835. + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  11836. + func_echo "Waiting for $lockfile to be removed"
  11837. + sleep 2
  11838. + done
  11839. + elif test warn = "$need_locks"; then
  11840. + if test -f "$lockfile"; then
  11841. + $ECHO "\
  11842. +*** ERROR, $lockfile exists and contains:
  11843. +`cat $lockfile 2>/dev/null`
  11844. +
  11845. +This indicates that another process is trying to use the same
  11846. +temporary object file, and libtool could not work around it because
  11847. +your compiler does not support '-c' and '-o' together. If you
  11848. +repeat this compilation, it may succeed, by chance, but you had better
  11849. +avoid parallel builds (make -j) in this platform, or get a better
  11850. +compiler."
  11851. +
  11852. + $opt_dry_run || $RM $removelist
  11853. + exit $EXIT_FAILURE
  11854. + fi
  11855. + func_append removelist " $output_obj"
  11856. + $ECHO "$srcfile" > "$lockfile"
  11857. + fi
  11858. +
  11859. + $opt_dry_run || $RM $removelist
  11860. + func_append removelist " $lockfile"
  11861. + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  11862. +
  11863. + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
  11864. + srcfile=$func_to_tool_file_result
  11865. + func_quote_for_eval "$srcfile"
  11866. + qsrcfile=$func_quote_for_eval_result
  11867. +
  11868. + # Only build a PIC object if we are building libtool libraries.
  11869. + if test yes = "$build_libtool_libs"; then
  11870. + # Without this assignment, base_compile gets emptied.
  11871. + fbsd_hideous_sh_bug=$base_compile
  11872. +
  11873. + if test no != "$pic_mode"; then
  11874. + command="$base_compile $qsrcfile $pic_flag"
  11875. + else
  11876. + # Don't build PIC code
  11877. + command="$base_compile $qsrcfile"
  11878. + fi
  11879. +
  11880. + func_mkdir_p "$xdir$objdir"
  11881. +
  11882. + if test -z "$output_obj"; then
  11883. + # Place PIC objects in $objdir
  11884. + func_append command " -o $lobj"
  11885. + fi
  11886. +
  11887. + func_show_eval_locale "$command" \
  11888. + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  11889. +
  11890. + if test warn = "$need_locks" &&
  11891. + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  11892. + $ECHO "\
  11893. +*** ERROR, $lockfile contains:
  11894. +`cat $lockfile 2>/dev/null`
  11895. +
  11896. +but it should contain:
  11897. +$srcfile
  11898. +
  11899. +This indicates that another process is trying to use the same
  11900. +temporary object file, and libtool could not work around it because
  11901. +your compiler does not support '-c' and '-o' together. If you
  11902. +repeat this compilation, it may succeed, by chance, but you had better
  11903. +avoid parallel builds (make -j) in this platform, or get a better
  11904. +compiler."
  11905. +
  11906. + $opt_dry_run || $RM $removelist
  11907. + exit $EXIT_FAILURE
  11908. + fi
  11909. +
  11910. + # Just move the object if needed, then go on to compile the next one
  11911. + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  11912. + func_show_eval '$MV "$output_obj" "$lobj"' \
  11913. + 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  11914. + fi
  11915. +
  11916. + # Allow error messages only from the first compilation.
  11917. + if test yes = "$suppress_opt"; then
  11918. + suppress_output=' >/dev/null 2>&1'
  11919. + fi
  11920. + fi
  11921. +
  11922. + # Only build a position-dependent object if we build old libraries.
  11923. + if test yes = "$build_old_libs"; then
  11924. + if test yes != "$pic_mode"; then
  11925. + # Don't build PIC code
  11926. + command="$base_compile $qsrcfile$pie_flag"
  11927. + else
  11928. + command="$base_compile $qsrcfile $pic_flag"
  11929. + fi
  11930. + if test yes = "$compiler_c_o"; then
  11931. + func_append command " -o $obj"
  11932. + fi
  11933. +
  11934. + # Suppress compiler output if we already did a PIC compilation.
  11935. + func_append command "$suppress_output"
  11936. + func_show_eval_locale "$command" \
  11937. + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
  11938. +
  11939. + if test warn = "$need_locks" &&
  11940. + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  11941. + $ECHO "\
  11942. +*** ERROR, $lockfile contains:
  11943. +`cat $lockfile 2>/dev/null`
  11944. +
  11945. +but it should contain:
  11946. +$srcfile
  11947. +
  11948. +This indicates that another process is trying to use the same
  11949. +temporary object file, and libtool could not work around it because
  11950. +your compiler does not support '-c' and '-o' together. If you
  11951. +repeat this compilation, it may succeed, by chance, but you had better
  11952. +avoid parallel builds (make -j) in this platform, or get a better
  11953. +compiler."
  11954. +
  11955. + $opt_dry_run || $RM $removelist
  11956. + exit $EXIT_FAILURE
  11957. + fi
  11958. +
  11959. + # Just move the object if needed
  11960. + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  11961. + func_show_eval '$MV "$output_obj" "$obj"' \
  11962. + 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  11963. + fi
  11964. + fi
  11965. +
  11966. + $opt_dry_run || {
  11967. + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  11968. +
  11969. + # Unlock the critical section if it was locked
  11970. + if test no != "$need_locks"; then
  11971. + removelist=$lockfile
  11972. + $RM "$lockfile"
  11973. + fi
  11974. + }
  11975. +
  11976. + exit $EXIT_SUCCESS
  11977. +}
  11978. +
  11979. +$opt_help || {
  11980. + test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
  11981. +}
  11982. +
  11983. +func_mode_help ()
  11984. +{
  11985. + # We need to display help for each of the modes.
  11986. + case $opt_mode in
  11987. + "")
  11988. + # Generic help is extracted from the usage comments
  11989. + # at the start of this file.
  11990. + func_help
  11991. + ;;
  11992. +
  11993. + clean)
  11994. + $ECHO \
  11995. +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  11996. +
  11997. +Remove files from the build directory.
  11998. +
  11999. +RM is the name of the program to use to delete files associated with each FILE
  12000. +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  12001. +to RM.
  12002. +
  12003. +If FILE is a libtool library, object or program, all the files associated
  12004. +with it are deleted. Otherwise, only FILE itself is deleted using RM."
  12005. + ;;
  12006. +
  12007. + compile)
  12008. + $ECHO \
  12009. +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  12010. +
  12011. +Compile a source file into a libtool library object.
  12012. +
  12013. +This mode accepts the following additional options:
  12014. +
  12015. + -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  12016. + -no-suppress do not suppress compiler output for multiple passes
  12017. + -prefer-pic try to build PIC objects only
  12018. + -prefer-non-pic try to build non-PIC objects only
  12019. + -shared do not build a '.o' file suitable for static linking
  12020. + -static only build a '.o' file suitable for static linking
  12021. + -Wc,FLAG pass FLAG directly to the compiler
  12022. +
  12023. +COMPILE-COMMAND is a command to be used in creating a 'standard' object file
  12024. +from the given SOURCEFILE.
  12025. +
  12026. +The output file name is determined by removing the directory component from
  12027. +SOURCEFILE, then substituting the C source code suffix '.c' with the
  12028. +library object suffix, '.lo'."
  12029. + ;;
  12030. +
  12031. + execute)
  12032. + $ECHO \
  12033. +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  12034. +
  12035. +Automatically set library path, then run a program.
  12036. +
  12037. +This mode accepts the following additional options:
  12038. +
  12039. + -dlopen FILE add the directory containing FILE to the library path
  12040. +
  12041. +This mode sets the library path environment variable according to '-dlopen'
  12042. +flags.
  12043. +
  12044. +If any of the ARGS are libtool executable wrappers, then they are translated
  12045. +into their corresponding uninstalled binary, and any of their required library
  12046. +directories are added to the library path.
  12047. +
  12048. +Then, COMMAND is executed, with ARGS as arguments."
  12049. + ;;
  12050. +
  12051. + finish)
  12052. + $ECHO \
  12053. +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  12054. +
  12055. +Complete the installation of libtool libraries.
  12056. +
  12057. +Each LIBDIR is a directory that contains libtool libraries.
  12058. +
  12059. +The commands that this mode executes may require superuser privileges. Use
  12060. +the '--dry-run' option if you just want to see what would be executed."
  12061. + ;;
  12062. +
  12063. + install)
  12064. + $ECHO \
  12065. +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  12066. +
  12067. +Install executables or libraries.
  12068. +
  12069. +INSTALL-COMMAND is the installation command. The first component should be
  12070. +either the 'install' or 'cp' program.
  12071. +
  12072. +The following components of INSTALL-COMMAND are treated specially:
  12073. +
  12074. + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
  12075. +
  12076. +The rest of the components are interpreted as arguments to that command (only
  12077. +BSD-compatible install options are recognized)."
  12078. + ;;
  12079. +
  12080. + link)
  12081. + $ECHO \
  12082. +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  12083. +
  12084. +Link object files or libraries together to form another library, or to
  12085. +create an executable program.
  12086. +
  12087. +LINK-COMMAND is a command using the C compiler that you would use to create
  12088. +a program from several object files.
  12089. +
  12090. +The following components of LINK-COMMAND are treated specially:
  12091. +
  12092. + -all-static do not do any dynamic linking at all
  12093. + -avoid-version do not add a version suffix if possible
  12094. + -bindir BINDIR specify path to binaries directory (for systems where
  12095. + libraries must be found in the PATH setting at runtime)
  12096. + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
  12097. + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  12098. + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  12099. + -export-symbols SYMFILE
  12100. + try to export only the symbols listed in SYMFILE
  12101. + -export-symbols-regex REGEX
  12102. + try to export only the symbols matching REGEX
  12103. + -LLIBDIR search LIBDIR for required installed libraries
  12104. + -lNAME OUTPUT-FILE requires the installed library libNAME
  12105. + -module build a library that can dlopened
  12106. + -no-fast-install disable the fast-install mode
  12107. + -no-install link a not-installable executable
  12108. + -no-undefined declare that a library does not refer to external symbols
  12109. + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  12110. + -objectlist FILE use a list of object files found in FILE to specify objects
  12111. + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
  12112. + -precious-files-regex REGEX
  12113. + don't remove output files matching REGEX
  12114. + -release RELEASE specify package release information
  12115. + -rpath LIBDIR the created library will eventually be installed in LIBDIR
  12116. + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  12117. + -shared only do dynamic linking of libtool libraries
  12118. + -shrext SUFFIX override the standard shared library file extension
  12119. + -static do not do any dynamic linking of uninstalled libtool libraries
  12120. + -static-libtool-libs
  12121. + do not do any dynamic linking of libtool libraries
  12122. + -version-info CURRENT[:REVISION[:AGE]]
  12123. + specify library version info [each variable defaults to 0]
  12124. + -weak LIBNAME declare that the target provides the LIBNAME interface
  12125. + -Wc,FLAG
  12126. + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
  12127. + -Wl,FLAG
  12128. + -Xlinker FLAG pass linker-specific FLAG directly to the linker
  12129. + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
  12130. +
  12131. +All other options (arguments beginning with '-') are ignored.
  12132. +
  12133. +Every other argument is treated as a filename. Files ending in '.la' are
  12134. +treated as uninstalled libtool libraries, other files are standard or library
  12135. +object files.
  12136. +
  12137. +If the OUTPUT-FILE ends in '.la', then a libtool library is created,
  12138. +only library objects ('.lo' files) may be specified, and '-rpath' is
  12139. +required, except when creating a convenience library.
  12140. +
  12141. +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
  12142. +using 'ar' and 'ranlib', or on Windows using 'lib'.
  12143. +
  12144. +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
  12145. +is created, otherwise an executable program is created."
  12146. + ;;
  12147. +
  12148. + uninstall)
  12149. + $ECHO \
  12150. +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  12151. +
  12152. +Remove libraries from an installation directory.
  12153. +
  12154. +RM is the name of the program to use to delete files associated with each FILE
  12155. +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  12156. +to RM.
  12157. +
  12158. +If FILE is a libtool library, all the files associated with it are deleted.
  12159. +Otherwise, only FILE itself is deleted using RM."
  12160. + ;;
  12161. +
  12162. + *)
  12163. + func_fatal_help "invalid operation mode '$opt_mode'"
  12164. + ;;
  12165. + esac
  12166. +
  12167. + echo
  12168. + $ECHO "Try '$progname --help' for more information about other modes."
  12169. +}
  12170. +
  12171. +# Now that we've collected a possible --mode arg, show help if necessary
  12172. +if $opt_help; then
  12173. + if test : = "$opt_help"; then
  12174. + func_mode_help
  12175. + else
  12176. + {
  12177. + func_help noexit
  12178. + for opt_mode in compile link execute install finish uninstall clean; do
  12179. + func_mode_help
  12180. + done
  12181. + } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
  12182. + {
  12183. + func_help noexit
  12184. + for opt_mode in compile link execute install finish uninstall clean; do
  12185. + echo
  12186. + func_mode_help
  12187. + done
  12188. + } |
  12189. + $SED '1d
  12190. + /^When reporting/,/^Report/{
  12191. + H
  12192. + d
  12193. + }
  12194. + $x
  12195. + /information about other modes/d
  12196. + /more detailed .*MODE/d
  12197. + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
  12198. + fi
  12199. + exit $?
  12200. +fi
  12201. +
  12202. +
  12203. +# func_mode_execute arg...
  12204. +func_mode_execute ()
  12205. +{
  12206. + $debug_cmd
  12207. +
  12208. + # The first argument is the command name.
  12209. + cmd=$nonopt
  12210. + test -z "$cmd" && \
  12211. + func_fatal_help "you must specify a COMMAND"
  12212. +
  12213. + # Handle -dlopen flags immediately.
  12214. + for file in $opt_dlopen; do
  12215. + test -f "$file" \
  12216. + || func_fatal_help "'$file' is not a file"
  12217. +
  12218. + dir=
  12219. + case $file in
  12220. + *.la)
  12221. + func_resolve_sysroot "$file"
  12222. + file=$func_resolve_sysroot_result
  12223. +
  12224. + # Check to see that this really is a libtool archive.
  12225. + func_lalib_unsafe_p "$file" \
  12226. + || func_fatal_help "'$lib' is not a valid libtool archive"
  12227. +
  12228. + # Read the libtool library.
  12229. + dlname=
  12230. + library_names=
  12231. + func_source "$file"
  12232. +
  12233. + # Skip this library if it cannot be dlopened.
  12234. + if test -z "$dlname"; then
  12235. + # Warn if it was a shared library.
  12236. + test -n "$library_names" && \
  12237. + func_warning "'$file' was not linked with '-export-dynamic'"
  12238. + continue
  12239. + fi
  12240. +
  12241. + func_dirname "$file" "" "."
  12242. + dir=$func_dirname_result
  12243. +
  12244. + if test -f "$dir/$objdir/$dlname"; then
  12245. + func_append dir "/$objdir"
  12246. + else
  12247. + if test ! -f "$dir/$dlname"; then
  12248. + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
  12249. + fi
  12250. + fi
  12251. + ;;
  12252. +
  12253. + *.lo)
  12254. + # Just add the directory containing the .lo file.
  12255. + func_dirname "$file" "" "."
  12256. + dir=$func_dirname_result
  12257. + ;;
  12258. +
  12259. + *)
  12260. + func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
  12261. + continue
  12262. + ;;
  12263. + esac
  12264. +
  12265. + # Get the absolute pathname.
  12266. + absdir=`cd "$dir" && pwd`
  12267. + test -n "$absdir" && dir=$absdir
  12268. +
  12269. + # Now add the directory to shlibpath_var.
  12270. + if eval "test -z \"\$$shlibpath_var\""; then
  12271. + eval "$shlibpath_var=\"\$dir\""
  12272. + else
  12273. + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  12274. + fi
  12275. + done
  12276. +
  12277. + # This variable tells wrapper scripts just to set shlibpath_var
  12278. + # rather than running their programs.
  12279. + libtool_execute_magic=$magic
  12280. +
  12281. + # Check if any of the arguments is a wrapper script.
  12282. + args=
  12283. + for file
  12284. + do
  12285. + case $file in
  12286. + -* | *.la | *.lo ) ;;
  12287. + *)
  12288. + # Do a test to see if this is really a libtool program.
  12289. + if func_ltwrapper_script_p "$file"; then
  12290. + func_source "$file"
  12291. + # Transform arg to wrapped name.
  12292. + file=$progdir/$program
  12293. + elif func_ltwrapper_executable_p "$file"; then
  12294. + func_ltwrapper_scriptname "$file"
  12295. + func_source "$func_ltwrapper_scriptname_result"
  12296. + # Transform arg to wrapped name.
  12297. + file=$progdir/$program
  12298. + fi
  12299. + ;;
  12300. + esac
  12301. + # Quote arguments (to preserve shell metacharacters).
  12302. + func_append_quoted args "$file"
  12303. + done
  12304. +
  12305. + if $opt_dry_run; then
  12306. + # Display what would be done.
  12307. + if test -n "$shlibpath_var"; then
  12308. + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  12309. + echo "export $shlibpath_var"
  12310. + fi
  12311. + $ECHO "$cmd$args"
  12312. + exit $EXIT_SUCCESS
  12313. + else
  12314. + if test -n "$shlibpath_var"; then
  12315. + # Export the shlibpath_var.
  12316. + eval "export $shlibpath_var"
  12317. + fi
  12318. +
  12319. + # Restore saved environment variables
  12320. + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  12321. + do
  12322. + eval "if test \"\${save_$lt_var+set}\" = set; then
  12323. + $lt_var=\$save_$lt_var; export $lt_var
  12324. + else
  12325. + $lt_unset $lt_var
  12326. + fi"
  12327. + done
  12328. +
  12329. + # Now prepare to actually exec the command.
  12330. + exec_cmd=\$cmd$args
  12331. + fi
  12332. +}
  12333. +
  12334. +test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
  12335. +
  12336. +
  12337. +# func_mode_finish arg...
  12338. +func_mode_finish ()
  12339. +{
  12340. + $debug_cmd
  12341. +
  12342. + libs=
  12343. + libdirs=
  12344. + admincmds=
  12345. +
  12346. + for opt in "$nonopt" ${1+"$@"}
  12347. + do
  12348. + if test -d "$opt"; then
  12349. + func_append libdirs " $opt"
  12350. +
  12351. + elif test -f "$opt"; then
  12352. + if func_lalib_unsafe_p "$opt"; then
  12353. + func_append libs " $opt"
  12354. + else
  12355. + func_warning "'$opt' is not a valid libtool archive"
  12356. + fi
  12357. +
  12358. + else
  12359. + func_fatal_error "invalid argument '$opt'"
  12360. + fi
  12361. + done
  12362. +
  12363. + if test -n "$libs"; then
  12364. + if test -n "$lt_sysroot"; then
  12365. + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
  12366. + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
  12367. + else
  12368. + sysroot_cmd=
  12369. + fi
  12370. +
  12371. + # Remove sysroot references
  12372. + if $opt_dry_run; then
  12373. + for lib in $libs; do
  12374. + echo "removing references to $lt_sysroot and '=' prefixes from $lib"
  12375. + done
  12376. + else
  12377. + tmpdir=`func_mktempdir`
  12378. + for lib in $libs; do
  12379. + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
  12380. + > $tmpdir/tmp-la
  12381. + mv -f $tmpdir/tmp-la $lib
  12382. + done
  12383. + ${RM}r "$tmpdir"
  12384. + fi
  12385. + fi
  12386. +
  12387. + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  12388. + for libdir in $libdirs; do
  12389. + if test -n "$finish_cmds"; then
  12390. + # Do each command in the finish commands.
  12391. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  12392. +'"$cmd"'"'
  12393. + fi
  12394. + if test -n "$finish_eval"; then
  12395. + # Do the single finish_eval.
  12396. + eval cmds=\"$finish_eval\"
  12397. + $opt_dry_run || eval "$cmds" || func_append admincmds "
  12398. + $cmds"
  12399. + fi
  12400. + done
  12401. + fi
  12402. +
  12403. + # Exit here if they wanted silent mode.
  12404. + $opt_quiet && exit $EXIT_SUCCESS
  12405. +
  12406. + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  12407. + echo "----------------------------------------------------------------------"
  12408. + echo "Libraries have been installed in:"
  12409. + for libdir in $libdirs; do
  12410. + $ECHO " $libdir"
  12411. + done
  12412. + echo
  12413. + echo "If you ever happen to want to link against installed libraries"
  12414. + echo "in a given directory, LIBDIR, you must either use libtool, and"
  12415. + echo "specify the full pathname of the library, or use the '-LLIBDIR'"
  12416. + echo "flag during linking and do at least one of the following:"
  12417. + if test -n "$shlibpath_var"; then
  12418. + echo " - add LIBDIR to the '$shlibpath_var' environment variable"
  12419. + echo " during execution"
  12420. + fi
  12421. + if test -n "$runpath_var"; then
  12422. + echo " - add LIBDIR to the '$runpath_var' environment variable"
  12423. + echo " during linking"
  12424. + fi
  12425. + if test -n "$hardcode_libdir_flag_spec"; then
  12426. + libdir=LIBDIR
  12427. + eval flag=\"$hardcode_libdir_flag_spec\"
  12428. +
  12429. + $ECHO " - use the '$flag' linker flag"
  12430. + fi
  12431. + if test -n "$admincmds"; then
  12432. + $ECHO " - have your system administrator run these commands:$admincmds"
  12433. + fi
  12434. + if test -f /etc/ld.so.conf; then
  12435. + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
  12436. + fi
  12437. + echo
  12438. +
  12439. + echo "See any operating system documentation about shared libraries for"
  12440. + case $host in
  12441. + solaris2.[6789]|solaris2.1[0-9])
  12442. + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  12443. + echo "pages."
  12444. + ;;
  12445. + *)
  12446. + echo "more information, such as the ld(1) and ld.so(8) manual pages."
  12447. + ;;
  12448. + esac
  12449. + echo "----------------------------------------------------------------------"
  12450. + fi
  12451. + exit $EXIT_SUCCESS
  12452. +}
  12453. +
  12454. +test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
  12455. +
  12456. +
  12457. +# func_mode_install arg...
  12458. +func_mode_install ()
  12459. +{
  12460. + $debug_cmd
  12461. +
  12462. + # There may be an optional sh(1) argument at the beginning of
  12463. + # install_prog (especially on Windows NT).
  12464. + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
  12465. + # Allow the use of GNU shtool's install command.
  12466. + case $nonopt in *shtool*) :;; *) false;; esac
  12467. + then
  12468. + # Aesthetically quote it.
  12469. + func_quote_for_eval "$nonopt"
  12470. + install_prog="$func_quote_for_eval_result "
  12471. + arg=$1
  12472. + shift
  12473. + else
  12474. + install_prog=
  12475. + arg=$nonopt
  12476. + fi
  12477. +
  12478. + # The real first argument should be the name of the installation program.
  12479. + # Aesthetically quote it.
  12480. + func_quote_for_eval "$arg"
  12481. + func_append install_prog "$func_quote_for_eval_result"
  12482. + install_shared_prog=$install_prog
  12483. + case " $install_prog " in
  12484. + *[\\\ /]cp\ *) install_cp=: ;;
  12485. + *) install_cp=false ;;
  12486. + esac
  12487. +
  12488. + # We need to accept at least all the BSD install flags.
  12489. + dest=
  12490. + files=
  12491. + opts=
  12492. + prev=
  12493. + install_type=
  12494. + isdir=false
  12495. + stripme=
  12496. + no_mode=:
  12497. + for arg
  12498. + do
  12499. + arg2=
  12500. + if test -n "$dest"; then
  12501. + func_append files " $dest"
  12502. + dest=$arg
  12503. + continue
  12504. + fi
  12505. +
  12506. + case $arg in
  12507. + -d) isdir=: ;;
  12508. + -f)
  12509. + if $install_cp; then :; else
  12510. + prev=$arg
  12511. + fi
  12512. + ;;
  12513. + -g | -m | -o)
  12514. + prev=$arg
  12515. + ;;
  12516. + -s)
  12517. + stripme=" -s"
  12518. + continue
  12519. + ;;
  12520. + -*)
  12521. + ;;
  12522. + *)
  12523. + # If the previous option needed an argument, then skip it.
  12524. + if test -n "$prev"; then
  12525. + if test X-m = "X$prev" && test -n "$install_override_mode"; then
  12526. + arg2=$install_override_mode
  12527. + no_mode=false
  12528. + fi
  12529. + prev=
  12530. + else
  12531. + dest=$arg
  12532. + continue
  12533. + fi
  12534. + ;;
  12535. + esac
  12536. +
  12537. + # Aesthetically quote the argument.
  12538. + func_quote_for_eval "$arg"
  12539. + func_append install_prog " $func_quote_for_eval_result"
  12540. + if test -n "$arg2"; then
  12541. + func_quote_for_eval "$arg2"
  12542. + fi
  12543. + func_append install_shared_prog " $func_quote_for_eval_result"
  12544. + done
  12545. +
  12546. + test -z "$install_prog" && \
  12547. + func_fatal_help "you must specify an install program"
  12548. +
  12549. + test -n "$prev" && \
  12550. + func_fatal_help "the '$prev' option requires an argument"
  12551. +
  12552. + if test -n "$install_override_mode" && $no_mode; then
  12553. + if $install_cp; then :; else
  12554. + func_quote_for_eval "$install_override_mode"
  12555. + func_append install_shared_prog " -m $func_quote_for_eval_result"
  12556. + fi
  12557. + fi
  12558. +
  12559. + if test -z "$files"; then
  12560. + if test -z "$dest"; then
  12561. + func_fatal_help "no file or destination specified"
  12562. + else
  12563. + func_fatal_help "you must specify a destination"
  12564. + fi
  12565. + fi
  12566. +
  12567. + # Strip any trailing slash from the destination.
  12568. + func_stripname '' '/' "$dest"
  12569. + dest=$func_stripname_result
  12570. +
  12571. + # Check to see that the destination is a directory.
  12572. + test -d "$dest" && isdir=:
  12573. + if $isdir; then
  12574. + destdir=$dest
  12575. + destname=
  12576. + else
  12577. + func_dirname_and_basename "$dest" "" "."
  12578. + destdir=$func_dirname_result
  12579. + destname=$func_basename_result
  12580. +
  12581. + # Not a directory, so check to see that there is only one file specified.
  12582. + set dummy $files; shift
  12583. + test "$#" -gt 1 && \
  12584. + func_fatal_help "'$dest' is not a directory"
  12585. + fi
  12586. + case $destdir in
  12587. + [\\/]* | [A-Za-z]:[\\/]*) ;;
  12588. + *)
  12589. + for file in $files; do
  12590. + case $file in
  12591. + *.lo) ;;
  12592. + *)
  12593. + func_fatal_help "'$destdir' must be an absolute directory name"
  12594. + ;;
  12595. + esac
  12596. + done
  12597. + ;;
  12598. + esac
  12599. +
  12600. + # This variable tells wrapper scripts just to set variables rather
  12601. + # than running their programs.
  12602. + libtool_install_magic=$magic
  12603. +
  12604. + staticlibs=
  12605. + future_libdirs=
  12606. + current_libdirs=
  12607. + for file in $files; do
  12608. +
  12609. + # Do each installation.
  12610. + case $file in
  12611. + *.$libext)
  12612. + # Do the static libraries later.
  12613. + func_append staticlibs " $file"
  12614. + ;;
  12615. +
  12616. + *.la)
  12617. + func_resolve_sysroot "$file"
  12618. + file=$func_resolve_sysroot_result
  12619. +
  12620. + # Check to see that this really is a libtool archive.
  12621. + func_lalib_unsafe_p "$file" \
  12622. + || func_fatal_help "'$file' is not a valid libtool archive"
  12623. +
  12624. + library_names=
  12625. + old_library=
  12626. + relink_command=
  12627. + func_source "$file"
  12628. +
  12629. + # Add the libdir to current_libdirs if it is the destination.
  12630. + if test "X$destdir" = "X$libdir"; then
  12631. + case "$current_libdirs " in
  12632. + *" $libdir "*) ;;
  12633. + *) func_append current_libdirs " $libdir" ;;
  12634. + esac
  12635. + else
  12636. + # Note the libdir as a future libdir.
  12637. + case "$future_libdirs " in
  12638. + *" $libdir "*) ;;
  12639. + *) func_append future_libdirs " $libdir" ;;
  12640. + esac
  12641. + fi
  12642. +
  12643. + func_dirname "$file" "/" ""
  12644. + dir=$func_dirname_result
  12645. + func_append dir "$objdir"
  12646. +
  12647. + if test -n "$relink_command"; then
  12648. + # Determine the prefix the user has applied to our future dir.
  12649. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
  12650. +
  12651. + # Don't allow the user to place us outside of our expected
  12652. + # location b/c this prevents finding dependent libraries that
  12653. + # are installed to the same prefix.
  12654. + # At present, this check doesn't affect windows .dll's that
  12655. + # are installed into $libdir/../bin (currently, that works fine)
  12656. + # but it's something to keep an eye on.
  12657. + test "$inst_prefix_dir" = "$destdir" && \
  12658. + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
  12659. +
  12660. + if test -n "$inst_prefix_dir"; then
  12661. + # Stick the inst_prefix_dir data into the link command.
  12662. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  12663. + else
  12664. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  12665. + fi
  12666. +
  12667. + func_warning "relinking '$file'"
  12668. + func_show_eval "$relink_command" \
  12669. + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
  12670. + fi
  12671. +
  12672. + # See the names of the shared library.
  12673. + set dummy $library_names; shift
  12674. + if test -n "$1"; then
  12675. + realname=$1
  12676. + shift
  12677. +
  12678. + srcname=$realname
  12679. + test -n "$relink_command" && srcname=${realname}T
  12680. +
  12681. + # Install the shared library and build the symlinks.
  12682. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
  12683. + 'exit $?'
  12684. + tstripme=$stripme
  12685. + case $host_os in
  12686. + cygwin* | mingw* | pw32* | cegcc*)
  12687. + case $realname in
  12688. + *.dll.a)
  12689. + tstripme=
  12690. + ;;
  12691. + esac
  12692. + ;;
  12693. + os2*)
  12694. + case $realname in
  12695. + *_dll.a)
  12696. + tstripme=
  12697. + ;;
  12698. + esac
  12699. + ;;
  12700. + esac
  12701. + if test -n "$tstripme" && test -n "$striplib"; then
  12702. + func_show_eval "$striplib $destdir/$realname" 'exit $?'
  12703. + fi
  12704. +
  12705. + if test "$#" -gt 0; then
  12706. + # Delete the old symlinks, and create new ones.
  12707. + # Try 'ln -sf' first, because the 'ln' binary might depend on
  12708. + # the symlink we replace! Solaris /bin/ln does not understand -f,
  12709. + # so we also need to try rm && ln -s.
  12710. + for linkname
  12711. + do
  12712. + test "$linkname" != "$realname" \
  12713. + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  12714. + done
  12715. + fi
  12716. +
  12717. + # Do each command in the postinstall commands.
  12718. + lib=$destdir/$realname
  12719. + func_execute_cmds "$postinstall_cmds" 'exit $?'
  12720. + fi
  12721. +
  12722. + # Install the pseudo-library for information purposes.
  12723. + func_basename "$file"
  12724. + name=$func_basename_result
  12725. + instname=$dir/${name}i
  12726. + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  12727. +
  12728. + # Maybe install the static library, too.
  12729. + test -n "$old_library" && func_append staticlibs " $dir/$old_library"
  12730. + ;;
  12731. +
  12732. + *.lo)
  12733. + # Install (i.e. copy) a libtool object.
  12734. +
  12735. + # Figure out destination file name, if it wasn't already specified.
  12736. + if test -n "$destname"; then
  12737. + destfile=$destdir/$destname
  12738. + else
  12739. + func_basename "$file"
  12740. + destfile=$func_basename_result
  12741. + destfile=$destdir/$destfile
  12742. + fi
  12743. +
  12744. + # Deduce the name of the destination old-style object file.
  12745. + case $destfile in
  12746. + *.lo)
  12747. + func_lo2o "$destfile"
  12748. + staticdest=$func_lo2o_result
  12749. + ;;
  12750. + *.$objext)
  12751. + staticdest=$destfile
  12752. + destfile=
  12753. + ;;
  12754. + *)
  12755. + func_fatal_help "cannot copy a libtool object to '$destfile'"
  12756. + ;;
  12757. + esac
  12758. +
  12759. + # Install the libtool object if requested.
  12760. + test -n "$destfile" && \
  12761. + func_show_eval "$install_prog $file $destfile" 'exit $?'
  12762. +
  12763. + # Install the old object if enabled.
  12764. + if test yes = "$build_old_libs"; then
  12765. + # Deduce the name of the old-style object file.
  12766. + func_lo2o "$file"
  12767. + staticobj=$func_lo2o_result
  12768. + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  12769. + fi
  12770. + exit $EXIT_SUCCESS
  12771. + ;;
  12772. +
  12773. + *)
  12774. + # Figure out destination file name, if it wasn't already specified.
  12775. + if test -n "$destname"; then
  12776. + destfile=$destdir/$destname
  12777. + else
  12778. + func_basename "$file"
  12779. + destfile=$func_basename_result
  12780. + destfile=$destdir/$destfile
  12781. + fi
  12782. +
  12783. + # If the file is missing, and there is a .exe on the end, strip it
  12784. + # because it is most likely a libtool script we actually want to
  12785. + # install
  12786. + stripped_ext=
  12787. + case $file in
  12788. + *.exe)
  12789. + if test ! -f "$file"; then
  12790. + func_stripname '' '.exe' "$file"
  12791. + file=$func_stripname_result
  12792. + stripped_ext=.exe
  12793. + fi
  12794. + ;;
  12795. + esac
  12796. +
  12797. + # Do a test to see if this is really a libtool program.
  12798. + case $host in
  12799. + *cygwin* | *mingw*)
  12800. + if func_ltwrapper_executable_p "$file"; then
  12801. + func_ltwrapper_scriptname "$file"
  12802. + wrapper=$func_ltwrapper_scriptname_result
  12803. + else
  12804. + func_stripname '' '.exe' "$file"
  12805. + wrapper=$func_stripname_result
  12806. + fi
  12807. + ;;
  12808. + *)
  12809. + wrapper=$file
  12810. + ;;
  12811. + esac
  12812. + if func_ltwrapper_script_p "$wrapper"; then
  12813. + notinst_deplibs=
  12814. + relink_command=
  12815. +
  12816. + func_source "$wrapper"
  12817. +
  12818. + # Check the variables that should have been set.
  12819. + test -z "$generated_by_libtool_version" && \
  12820. + func_fatal_error "invalid libtool wrapper script '$wrapper'"
  12821. +
  12822. + finalize=:
  12823. + for lib in $notinst_deplibs; do
  12824. + # Check to see that each library is installed.
  12825. + libdir=
  12826. + if test -f "$lib"; then
  12827. + func_source "$lib"
  12828. + fi
  12829. + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
  12830. + if test -n "$libdir" && test ! -f "$libfile"; then
  12831. + func_warning "'$lib' has not been installed in '$libdir'"
  12832. + finalize=false
  12833. + fi
  12834. + done
  12835. +
  12836. + relink_command=
  12837. + func_source "$wrapper"
  12838. +
  12839. + outputname=
  12840. + if test no = "$fast_install" && test -n "$relink_command"; then
  12841. + $opt_dry_run || {
  12842. + if $finalize; then
  12843. + tmpdir=`func_mktempdir`
  12844. + func_basename "$file$stripped_ext"
  12845. + file=$func_basename_result
  12846. + outputname=$tmpdir/$file
  12847. + # Replace the output file specification.
  12848. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
  12849. +
  12850. + $opt_quiet || {
  12851. + func_quote_for_expand "$relink_command"
  12852. + eval "func_echo $func_quote_for_expand_result"
  12853. + }
  12854. + if eval "$relink_command"; then :
  12855. + else
  12856. + func_error "error: relink '$file' with the above command before installing it"
  12857. + $opt_dry_run || ${RM}r "$tmpdir"
  12858. + continue
  12859. + fi
  12860. + file=$outputname
  12861. + else
  12862. + func_warning "cannot relink '$file'"
  12863. + fi
  12864. + }
  12865. + else
  12866. + # Install the binary that we compiled earlier.
  12867. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
  12868. + fi
  12869. + fi
  12870. +
  12871. + # remove .exe since cygwin /usr/bin/install will append another
  12872. + # one anyway
  12873. + case $install_prog,$host in
  12874. + */usr/bin/install*,*cygwin*)
  12875. + case $file:$destfile in
  12876. + *.exe:*.exe)
  12877. + # this is ok
  12878. + ;;
  12879. + *.exe:*)
  12880. + destfile=$destfile.exe
  12881. + ;;
  12882. + *:*.exe)
  12883. + func_stripname '' '.exe' "$destfile"
  12884. + destfile=$func_stripname_result
  12885. + ;;
  12886. + esac
  12887. + ;;
  12888. + esac
  12889. + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  12890. + $opt_dry_run || if test -n "$outputname"; then
  12891. + ${RM}r "$tmpdir"
  12892. + fi
  12893. + ;;
  12894. + esac
  12895. + done
  12896. +
  12897. + for file in $staticlibs; do
  12898. + func_basename "$file"
  12899. + name=$func_basename_result
  12900. +
  12901. + # Set up the ranlib parameters.
  12902. + oldlib=$destdir/$name
  12903. + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  12904. + tool_oldlib=$func_to_tool_file_result
  12905. +
  12906. + func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  12907. +
  12908. + if test -n "$stripme" && test -n "$old_striplib"; then
  12909. + func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
  12910. + fi
  12911. +
  12912. + # Do each command in the postinstall commands.
  12913. + func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  12914. + done
  12915. +
  12916. + test -n "$future_libdirs" && \
  12917. + func_warning "remember to run '$progname --finish$future_libdirs'"
  12918. +
  12919. + if test -n "$current_libdirs"; then
  12920. + # Maybe just do a dry run.
  12921. + $opt_dry_run && current_libdirs=" -n$current_libdirs"
  12922. + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
  12923. + else
  12924. + exit $EXIT_SUCCESS
  12925. + fi
  12926. +}
  12927. +
  12928. +test install = "$opt_mode" && func_mode_install ${1+"$@"}
  12929. +
  12930. +
  12931. +# func_generate_dlsyms outputname originator pic_p
  12932. +# Extract symbols from dlprefiles and create ${outputname}S.o with
  12933. +# a dlpreopen symbol table.
  12934. +func_generate_dlsyms ()
  12935. +{
  12936. + $debug_cmd
  12937. +
  12938. + my_outputname=$1
  12939. + my_originator=$2
  12940. + my_pic_p=${3-false}
  12941. + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
  12942. + my_dlsyms=
  12943. +
  12944. + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  12945. + if test -n "$NM" && test -n "$global_symbol_pipe"; then
  12946. + my_dlsyms=${my_outputname}S.c
  12947. + else
  12948. + func_error "not configured to extract global symbols from dlpreopened files"
  12949. + fi
  12950. + fi
  12951. +
  12952. + if test -n "$my_dlsyms"; then
  12953. + case $my_dlsyms in
  12954. + "") ;;
  12955. + *.c)
  12956. + # Discover the nlist of each of the dlfiles.
  12957. + nlist=$output_objdir/$my_outputname.nm
  12958. +
  12959. + func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  12960. +
  12961. + # Parse the name list into a source file.
  12962. + func_verbose "creating $output_objdir/$my_dlsyms"
  12963. +
  12964. + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  12965. +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
  12966. +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
  12967. +
  12968. +#ifdef __cplusplus
  12969. +extern \"C\" {
  12970. +#endif
  12971. +
  12972. +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
  12973. +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
  12974. +#endif
  12975. +
  12976. +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
  12977. +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
  12978. +/* DATA imports from DLLs on WIN32 can't be const, because runtime
  12979. + relocations are performed -- see ld's documentation on pseudo-relocs. */
  12980. +# define LT_DLSYM_CONST
  12981. +#elif defined __osf__
  12982. +/* This system does not cope well with relocations in const data. */
  12983. +# define LT_DLSYM_CONST
  12984. +#else
  12985. +# define LT_DLSYM_CONST const
  12986. +#endif
  12987. +
  12988. +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  12989. +
  12990. +/* External symbol declarations for the compiler. */\
  12991. +"
  12992. +
  12993. + if test yes = "$dlself"; then
  12994. + func_verbose "generating symbol list for '$output'"
  12995. +
  12996. + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  12997. +
  12998. + # Add our own program objects to the symbol list.
  12999. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  13000. + for progfile in $progfiles; do
  13001. + func_to_tool_file "$progfile" func_convert_file_msys_to_w32
  13002. + func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
  13003. + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
  13004. + done
  13005. +
  13006. + if test -n "$exclude_expsyms"; then
  13007. + $opt_dry_run || {
  13008. + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  13009. + eval '$MV "$nlist"T "$nlist"'
  13010. + }
  13011. + fi
  13012. +
  13013. + if test -n "$export_symbols_regex"; then
  13014. + $opt_dry_run || {
  13015. + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  13016. + eval '$MV "$nlist"T "$nlist"'
  13017. + }
  13018. + fi
  13019. +
  13020. + # Prepare the list of exported symbols
  13021. + if test -z "$export_symbols"; then
  13022. + export_symbols=$output_objdir/$outputname.exp
  13023. + $opt_dry_run || {
  13024. + $RM $export_symbols
  13025. + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  13026. + case $host in
  13027. + *cygwin* | *mingw* | *cegcc* )
  13028. + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  13029. + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  13030. + ;;
  13031. + esac
  13032. + }
  13033. + else
  13034. + $opt_dry_run || {
  13035. + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  13036. + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  13037. + eval '$MV "$nlist"T "$nlist"'
  13038. + case $host in
  13039. + *cygwin* | *mingw* | *cegcc* )
  13040. + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  13041. + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  13042. + ;;
  13043. + esac
  13044. + }
  13045. + fi
  13046. + fi
  13047. +
  13048. + for dlprefile in $dlprefiles; do
  13049. + func_verbose "extracting global C symbols from '$dlprefile'"
  13050. + func_basename "$dlprefile"
  13051. + name=$func_basename_result
  13052. + case $host in
  13053. + *cygwin* | *mingw* | *cegcc* )
  13054. + # if an import library, we need to obtain dlname
  13055. + if func_win32_import_lib_p "$dlprefile"; then
  13056. + func_tr_sh "$dlprefile"
  13057. + eval "curr_lafile=\$libfile_$func_tr_sh_result"
  13058. + dlprefile_dlbasename=
  13059. + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
  13060. + # Use subshell, to avoid clobbering current variable values
  13061. + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
  13062. + if test -n "$dlprefile_dlname"; then
  13063. + func_basename "$dlprefile_dlname"
  13064. + dlprefile_dlbasename=$func_basename_result
  13065. + else
  13066. + # no lafile. user explicitly requested -dlpreopen <import library>.
  13067. + $sharedlib_from_linklib_cmd "$dlprefile"
  13068. + dlprefile_dlbasename=$sharedlib_from_linklib_result
  13069. + fi
  13070. + fi
  13071. + $opt_dry_run || {
  13072. + if test -n "$dlprefile_dlbasename"; then
  13073. + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
  13074. + else
  13075. + func_warning "Could not compute DLL name from $name"
  13076. + eval '$ECHO ": $name " >> "$nlist"'
  13077. + fi
  13078. + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  13079. + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
  13080. + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
  13081. + }
  13082. + else # not an import lib
  13083. + $opt_dry_run || {
  13084. + eval '$ECHO ": $name " >> "$nlist"'
  13085. + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  13086. + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  13087. + }
  13088. + fi
  13089. + ;;
  13090. + *)
  13091. + $opt_dry_run || {
  13092. + eval '$ECHO ": $name " >> "$nlist"'
  13093. + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  13094. + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  13095. + }
  13096. + ;;
  13097. + esac
  13098. + done
  13099. +
  13100. + $opt_dry_run || {
  13101. + # Make sure we have at least an empty file.
  13102. + test -f "$nlist" || : > "$nlist"
  13103. +
  13104. + if test -n "$exclude_expsyms"; then
  13105. + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  13106. + $MV "$nlist"T "$nlist"
  13107. + fi
  13108. +
  13109. + # Try sorting and uniquifying the output.
  13110. + if $GREP -v "^: " < "$nlist" |
  13111. + if sort -k 3 </dev/null >/dev/null 2>&1; then
  13112. + sort -k 3
  13113. + else
  13114. + sort +2
  13115. + fi |
  13116. + uniq > "$nlist"S; then
  13117. + :
  13118. + else
  13119. + $GREP -v "^: " < "$nlist" > "$nlist"S
  13120. + fi
  13121. +
  13122. + if test -f "$nlist"S; then
  13123. + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  13124. + else
  13125. + echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
  13126. + fi
  13127. +
  13128. + func_show_eval '$RM "${nlist}I"'
  13129. + if test -n "$global_symbol_to_import"; then
  13130. + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
  13131. + fi
  13132. +
  13133. + echo >> "$output_objdir/$my_dlsyms" "\
  13134. +
  13135. +/* The mapping between symbol names and symbols. */
  13136. +typedef struct {
  13137. + const char *name;
  13138. + void *address;
  13139. +} lt_dlsymlist;
  13140. +extern LT_DLSYM_CONST lt_dlsymlist
  13141. +lt_${my_prefix}_LTX_preloaded_symbols[];\
  13142. +"
  13143. +
  13144. + if test -s "$nlist"I; then
  13145. + echo >> "$output_objdir/$my_dlsyms" "\
  13146. +static void lt_syminit(void)
  13147. +{
  13148. + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
  13149. + for (; symbol->name; ++symbol)
  13150. + {"
  13151. + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
  13152. + echo >> "$output_objdir/$my_dlsyms" "\
  13153. + }
  13154. +}"
  13155. + fi
  13156. + echo >> "$output_objdir/$my_dlsyms" "\
  13157. +LT_DLSYM_CONST lt_dlsymlist
  13158. +lt_${my_prefix}_LTX_preloaded_symbols[] =
  13159. +{ {\"$my_originator\", (void *) 0},"
  13160. +
  13161. + if test -s "$nlist"I; then
  13162. + echo >> "$output_objdir/$my_dlsyms" "\
  13163. + {\"@INIT@\", (void *) &lt_syminit},"
  13164. + fi
  13165. +
  13166. + case $need_lib_prefix in
  13167. + no)
  13168. + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  13169. + ;;
  13170. + *)
  13171. + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  13172. + ;;
  13173. + esac
  13174. + echo >> "$output_objdir/$my_dlsyms" "\
  13175. + {0, (void *) 0}
  13176. +};
  13177. +
  13178. +/* This works around a problem in FreeBSD linker */
  13179. +#ifdef FREEBSD_WORKAROUND
  13180. +static const void *lt_preloaded_setup() {
  13181. + return lt_${my_prefix}_LTX_preloaded_symbols;
  13182. +}
  13183. +#endif
  13184. +
  13185. +#ifdef __cplusplus
  13186. +}
  13187. +#endif\
  13188. +"
  13189. + } # !$opt_dry_run
  13190. +
  13191. + pic_flag_for_symtable=
  13192. + case "$compile_command " in
  13193. + *" -static "*) ;;
  13194. + *)
  13195. + case $host in
  13196. + # compiling the symbol table file with pic_flag works around
  13197. + # a FreeBSD bug that causes programs to crash when -lm is
  13198. + # linked before any other PIC object. But we must not use
  13199. + # pic_flag when linking with -static. The problem exists in
  13200. + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  13201. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  13202. + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  13203. + *-*-hpux*)
  13204. + pic_flag_for_symtable=" $pic_flag" ;;
  13205. + *)
  13206. + $my_pic_p && pic_flag_for_symtable=" $pic_flag"
  13207. + ;;
  13208. + esac
  13209. + ;;
  13210. + esac
  13211. + symtab_cflags=
  13212. + for arg in $LTCFLAGS; do
  13213. + case $arg in
  13214. + -pie | -fpie | -fPIE) ;;
  13215. + *) func_append symtab_cflags " $arg" ;;
  13216. + esac
  13217. + done
  13218. +
  13219. + # Now compile the dynamic symbol file.
  13220. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  13221. +
  13222. + # Clean up the generated files.
  13223. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
  13224. +
  13225. + # Transform the symbol file into the correct name.
  13226. + symfileobj=$output_objdir/${my_outputname}S.$objext
  13227. + case $host in
  13228. + *cygwin* | *mingw* | *cegcc* )
  13229. + if test -f "$output_objdir/$my_outputname.def"; then
  13230. + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  13231. + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  13232. + else
  13233. + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  13234. + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  13235. + fi
  13236. + ;;
  13237. + *)
  13238. + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  13239. + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  13240. + ;;
  13241. + esac
  13242. + ;;
  13243. + *)
  13244. + func_fatal_error "unknown suffix for '$my_dlsyms'"
  13245. + ;;
  13246. + esac
  13247. + else
  13248. + # We keep going just in case the user didn't refer to
  13249. + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  13250. + # really was required.
  13251. +
  13252. + # Nullify the symbol file.
  13253. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
  13254. + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
  13255. + fi
  13256. +}
  13257. +
  13258. +# func_cygming_gnu_implib_p ARG
  13259. +# This predicate returns with zero status (TRUE) if
  13260. +# ARG is a GNU/binutils-style import library. Returns
  13261. +# with nonzero status (FALSE) otherwise.
  13262. +func_cygming_gnu_implib_p ()
  13263. +{
  13264. + $debug_cmd
  13265. +
  13266. + func_to_tool_file "$1" func_convert_file_msys_to_w32
  13267. + 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)$'`
  13268. + test -n "$func_cygming_gnu_implib_tmp"
  13269. +}
  13270. +
  13271. +# func_cygming_ms_implib_p ARG
  13272. +# This predicate returns with zero status (TRUE) if
  13273. +# ARG is an MS-style import library. Returns
  13274. +# with nonzero status (FALSE) otherwise.
  13275. +func_cygming_ms_implib_p ()
  13276. +{
  13277. + $debug_cmd
  13278. +
  13279. + func_to_tool_file "$1" func_convert_file_msys_to_w32
  13280. + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
  13281. + test -n "$func_cygming_ms_implib_tmp"
  13282. +}
  13283. +
  13284. +# func_win32_libid arg
  13285. +# return the library type of file 'arg'
  13286. +#
  13287. +# Need a lot of goo to handle *both* DLLs and import libs
  13288. +# Has to be a shell function in order to 'eat' the argument
  13289. +# that is supplied when $file_magic_command is called.
  13290. +# Despite the name, also deal with 64 bit binaries.
  13291. +func_win32_libid ()
  13292. +{
  13293. + $debug_cmd
  13294. +
  13295. + win32_libid_type=unknown
  13296. + win32_fileres=`file -L $1 2>/dev/null`
  13297. + case $win32_fileres in
  13298. + *ar\ archive\ import\ library*) # definitely import
  13299. + win32_libid_type="x86 archive import"
  13300. + ;;
  13301. + *ar\ archive*) # could be an import, or static
  13302. + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
  13303. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  13304. + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
  13305. + case $nm_interface in
  13306. + "MS dumpbin")
  13307. + if func_cygming_ms_implib_p "$1" ||
  13308. + func_cygming_gnu_implib_p "$1"
  13309. + then
  13310. + win32_nmres=import
  13311. + else
  13312. + win32_nmres=
  13313. + fi
  13314. + ;;
  13315. + *)
  13316. + func_to_tool_file "$1" func_convert_file_msys_to_w32
  13317. + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
  13318. + $SED -n -e '
  13319. + 1,100{
  13320. + / I /{
  13321. + s|.*|import|
  13322. + p
  13323. + q
  13324. + }
  13325. + }'`
  13326. + ;;
  13327. + esac
  13328. + case $win32_nmres in
  13329. + import*) win32_libid_type="x86 archive import";;
  13330. + *) win32_libid_type="x86 archive static";;
  13331. + esac
  13332. + fi
  13333. + ;;
  13334. + *DLL*)
  13335. + win32_libid_type="x86 DLL"
  13336. + ;;
  13337. + *executable*) # but shell scripts are "executable" too...
  13338. + case $win32_fileres in
  13339. + *MS\ Windows\ PE\ Intel*)
  13340. + win32_libid_type="x86 DLL"
  13341. + ;;
  13342. + esac
  13343. + ;;
  13344. + esac
  13345. + $ECHO "$win32_libid_type"
  13346. +}
  13347. +
  13348. +# func_cygming_dll_for_implib ARG
  13349. +#
  13350. +# Platform-specific function to extract the
  13351. +# name of the DLL associated with the specified
  13352. +# import library ARG.
  13353. +# Invoked by eval'ing the libtool variable
  13354. +# $sharedlib_from_linklib_cmd
  13355. +# Result is available in the variable
  13356. +# $sharedlib_from_linklib_result
  13357. +func_cygming_dll_for_implib ()
  13358. +{
  13359. + $debug_cmd
  13360. +
  13361. + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
  13362. +}
  13363. +
  13364. +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
  13365. +#
  13366. +# The is the core of a fallback implementation of a
  13367. +# platform-specific function to extract the name of the
  13368. +# DLL associated with the specified import library LIBNAME.
  13369. +#
  13370. +# SECTION_NAME is either .idata$6 or .idata$7, depending
  13371. +# on the platform and compiler that created the implib.
  13372. +#
  13373. +# Echos the name of the DLL associated with the
  13374. +# specified import library.
  13375. +func_cygming_dll_for_implib_fallback_core ()
  13376. +{
  13377. + $debug_cmd
  13378. +
  13379. + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
  13380. + $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
  13381. + $SED '/^Contents of section '"$match_literal"':/{
  13382. + # Place marker at beginning of archive member dllname section
  13383. + s/.*/====MARK====/
  13384. + p
  13385. + d
  13386. + }
  13387. + # These lines can sometimes be longer than 43 characters, but
  13388. + # are always uninteresting
  13389. + /:[ ]*file format pe[i]\{,1\}-/d
  13390. + /^In archive [^:]*:/d
  13391. + # Ensure marker is printed
  13392. + /^====MARK====/p
  13393. + # Remove all lines with less than 43 characters
  13394. + /^.\{43\}/!d
  13395. + # From remaining lines, remove first 43 characters
  13396. + s/^.\{43\}//' |
  13397. + $SED -n '
  13398. + # Join marker and all lines until next marker into a single line
  13399. + /^====MARK====/ b para
  13400. + H
  13401. + $ b para
  13402. + b
  13403. + :para
  13404. + x
  13405. + s/\n//g
  13406. + # Remove the marker
  13407. + s/^====MARK====//
  13408. + # Remove trailing dots and whitespace
  13409. + s/[\. \t]*$//
  13410. + # Print
  13411. + /./p' |
  13412. + # we now have a list, one entry per line, of the stringified
  13413. + # contents of the appropriate section of all members of the
  13414. + # archive that possess that section. Heuristic: eliminate
  13415. + # all those that have a first or second character that is
  13416. + # a '.' (that is, objdump's representation of an unprintable
  13417. + # character.) This should work for all archives with less than
  13418. + # 0x302f exports -- but will fail for DLLs whose name actually
  13419. + # begins with a literal '.' or a single character followed by
  13420. + # a '.'.
  13421. + #
  13422. + # Of those that remain, print the first one.
  13423. + $SED -e '/^\./d;/^.\./d;q'
  13424. +}
  13425. +
  13426. +# func_cygming_dll_for_implib_fallback ARG
  13427. +# Platform-specific function to extract the
  13428. +# name of the DLL associated with the specified
  13429. +# import library ARG.
  13430. +#
  13431. +# This fallback implementation is for use when $DLLTOOL
  13432. +# does not support the --identify-strict option.
  13433. +# Invoked by eval'ing the libtool variable
  13434. +# $sharedlib_from_linklib_cmd
  13435. +# Result is available in the variable
  13436. +# $sharedlib_from_linklib_result
  13437. +func_cygming_dll_for_implib_fallback ()
  13438. +{
  13439. + $debug_cmd
  13440. +
  13441. + if func_cygming_gnu_implib_p "$1"; then
  13442. + # binutils import library
  13443. + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
  13444. + elif func_cygming_ms_implib_p "$1"; then
  13445. + # ms-generated import library
  13446. + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
  13447. + else
  13448. + # unknown
  13449. + sharedlib_from_linklib_result=
  13450. + fi
  13451. +}
  13452. +
  13453. +
  13454. +# func_extract_an_archive dir oldlib
  13455. +func_extract_an_archive ()
  13456. +{
  13457. + $debug_cmd
  13458. +
  13459. + f_ex_an_ar_dir=$1; shift
  13460. + f_ex_an_ar_oldlib=$1
  13461. + if test yes = "$lock_old_archive_extraction"; then
  13462. + lockfile=$f_ex_an_ar_oldlib.lock
  13463. + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  13464. + func_echo "Waiting for $lockfile to be removed"
  13465. + sleep 2
  13466. + done
  13467. + fi
  13468. + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
  13469. + 'stat=$?; rm -f "$lockfile"; exit $stat'
  13470. + if test yes = "$lock_old_archive_extraction"; then
  13471. + $opt_dry_run || rm -f "$lockfile"
  13472. + fi
  13473. + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  13474. + :
  13475. + else
  13476. + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  13477. + fi
  13478. +}
  13479. +
  13480. +
  13481. +# func_extract_archives gentop oldlib ...
  13482. +func_extract_archives ()
  13483. +{
  13484. + $debug_cmd
  13485. +
  13486. + my_gentop=$1; shift
  13487. + my_oldlibs=${1+"$@"}
  13488. + my_oldobjs=
  13489. + my_xlib=
  13490. + my_xabs=
  13491. + my_xdir=
  13492. +
  13493. + for my_xlib in $my_oldlibs; do
  13494. + # Extract the objects.
  13495. + case $my_xlib in
  13496. + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
  13497. + *) my_xabs=`pwd`"/$my_xlib" ;;
  13498. + esac
  13499. + func_basename "$my_xlib"
  13500. + my_xlib=$func_basename_result
  13501. + my_xlib_u=$my_xlib
  13502. + while :; do
  13503. + case " $extracted_archives " in
  13504. + *" $my_xlib_u "*)
  13505. + func_arith $extracted_serial + 1
  13506. + extracted_serial=$func_arith_result
  13507. + my_xlib_u=lt$extracted_serial-$my_xlib ;;
  13508. + *) break ;;
  13509. + esac
  13510. + done
  13511. + extracted_archives="$extracted_archives $my_xlib_u"
  13512. + my_xdir=$my_gentop/$my_xlib_u
  13513. +
  13514. + func_mkdir_p "$my_xdir"
  13515. +
  13516. + case $host in
  13517. + *-darwin*)
  13518. + func_verbose "Extracting $my_xabs"
  13519. + # Do not bother doing anything if just a dry run
  13520. + $opt_dry_run || {
  13521. + darwin_orig_dir=`pwd`
  13522. + cd $my_xdir || exit $?
  13523. + darwin_archive=$my_xabs
  13524. + darwin_curdir=`pwd`
  13525. + func_basename "$darwin_archive"
  13526. + darwin_base_archive=$func_basename_result
  13527. + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  13528. + if test -n "$darwin_arches"; then
  13529. + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  13530. + darwin_arch=
  13531. + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  13532. + for darwin_arch in $darwin_arches; do
  13533. + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
  13534. + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
  13535. + cd "unfat-$$/$darwin_base_archive-$darwin_arch"
  13536. + func_extract_an_archive "`pwd`" "$darwin_base_archive"
  13537. + cd "$darwin_curdir"
  13538. + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
  13539. + done # $darwin_arches
  13540. + ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  13541. + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
  13542. + darwin_file=
  13543. + darwin_files=
  13544. + for darwin_file in $darwin_filelist; do
  13545. + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
  13546. + $LIPO -create -output "$darwin_file" $darwin_files
  13547. + done # $darwin_filelist
  13548. + $RM -rf unfat-$$
  13549. + cd "$darwin_orig_dir"
  13550. + else
  13551. + cd $darwin_orig_dir
  13552. + func_extract_an_archive "$my_xdir" "$my_xabs"
  13553. + fi # $darwin_arches
  13554. + } # !$opt_dry_run
  13555. + ;;
  13556. + *)
  13557. + func_extract_an_archive "$my_xdir" "$my_xabs"
  13558. + ;;
  13559. + esac
  13560. + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
  13561. + done
  13562. +
  13563. + func_extract_archives_result=$my_oldobjs
  13564. +}
  13565. +
  13566. +
  13567. +# func_emit_wrapper [arg=no]
  13568. +#
  13569. +# Emit a libtool wrapper script on stdout.
  13570. +# Don't directly open a file because we may want to
  13571. +# incorporate the script contents within a cygwin/mingw
  13572. +# wrapper executable. Must ONLY be called from within
  13573. +# func_mode_link because it depends on a number of variables
  13574. +# set therein.
  13575. +#
  13576. +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  13577. +# variable will take. If 'yes', then the emitted script
  13578. +# will assume that the directory where it is stored is
  13579. +# the $objdir directory. This is a cygwin/mingw-specific
  13580. +# behavior.
  13581. +func_emit_wrapper ()
  13582. +{
  13583. + func_emit_wrapper_arg1=${1-no}
  13584. +
  13585. + $ECHO "\
  13586. +#! $SHELL
  13587. +
  13588. +# $output - temporary wrapper script for $objdir/$outputname
  13589. +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  13590. +#
  13591. +# The $output program cannot be directly executed until all the libtool
  13592. +# libraries that it depends on are installed.
  13593. +#
  13594. +# This wrapper script should never be moved out of the build directory.
  13595. +# If it is, it will not operate correctly.
  13596. +
  13597. +# Sed substitution that helps us do robust quoting. It backslashifies
  13598. +# metacharacters that are still active within double-quoted strings.
  13599. +sed_quote_subst='$sed_quote_subst'
  13600. +
  13601. +# Be Bourne compatible
  13602. +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  13603. + emulate sh
  13604. + NULLCMD=:
  13605. + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  13606. + # is contrary to our usage. Disable this feature.
  13607. + alias -g '\${1+\"\$@\"}'='\"\$@\"'
  13608. + setopt NO_GLOB_SUBST
  13609. +else
  13610. + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  13611. +fi
  13612. +BIN_SH=xpg4; export BIN_SH # for Tru64
  13613. +DUALCASE=1; export DUALCASE # for MKS sh
  13614. +
  13615. +# The HP-UX ksh and POSIX shell print the target directory to stdout
  13616. +# if CDPATH is set.
  13617. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  13618. +
  13619. +relink_command=\"$relink_command\"
  13620. +
  13621. +# This environment variable determines our operation mode.
  13622. +if test \"\$libtool_install_magic\" = \"$magic\"; then
  13623. + # install mode needs the following variables:
  13624. + generated_by_libtool_version='$macro_version'
  13625. + notinst_deplibs='$notinst_deplibs'
  13626. +else
  13627. + # When we are sourced in execute mode, \$file and \$ECHO are already set.
  13628. + if test \"\$libtool_execute_magic\" != \"$magic\"; then
  13629. + file=\"\$0\""
  13630. +
  13631. + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
  13632. + $ECHO "\
  13633. +
  13634. +# A function that is used when there is no print builtin or printf.
  13635. +func_fallback_echo ()
  13636. +{
  13637. + eval 'cat <<_LTECHO_EOF
  13638. +\$1
  13639. +_LTECHO_EOF'
  13640. +}
  13641. + ECHO=\"$qECHO\"
  13642. + fi
  13643. +
  13644. +# Very basic option parsing. These options are (a) specific to
  13645. +# the libtool wrapper, (b) are identical between the wrapper
  13646. +# /script/ and the wrapper /executable/ that is used only on
  13647. +# windows platforms, and (c) all begin with the string "--lt-"
  13648. +# (application programs are unlikely to have options that match
  13649. +# this pattern).
  13650. +#
  13651. +# There are only two supported options: --lt-debug and
  13652. +# --lt-dump-script. There is, deliberately, no --lt-help.
  13653. +#
  13654. +# The first argument to this parsing function should be the
  13655. +# script's $0 value, followed by "$@".
  13656. +lt_option_debug=
  13657. +func_parse_lt_options ()
  13658. +{
  13659. + lt_script_arg0=\$0
  13660. + shift
  13661. + for lt_opt
  13662. + do
  13663. + case \"\$lt_opt\" in
  13664. + --lt-debug) lt_option_debug=1 ;;
  13665. + --lt-dump-script)
  13666. + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
  13667. + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
  13668. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
  13669. + cat \"\$lt_dump_D/\$lt_dump_F\"
  13670. + exit 0
  13671. + ;;
  13672. + --lt-*)
  13673. + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
  13674. + exit 1
  13675. + ;;
  13676. + esac
  13677. + done
  13678. +
  13679. + # Print the debug banner immediately:
  13680. + if test -n \"\$lt_option_debug\"; then
  13681. + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
  13682. + fi
  13683. +}
  13684. +
  13685. +# Used when --lt-debug. Prints its arguments to stdout
  13686. +# (redirection is the responsibility of the caller)
  13687. +func_lt_dump_args ()
  13688. +{
  13689. + lt_dump_args_N=1;
  13690. + for lt_arg
  13691. + do
  13692. + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
  13693. + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
  13694. + done
  13695. +}
  13696. +
  13697. +# Core function for launching the target application
  13698. +func_exec_program_core ()
  13699. +{
  13700. +"
  13701. + case $host in
  13702. + # Backslashes separate directories on plain windows
  13703. + *-*-mingw | *-*-os2* | *-cegcc*)
  13704. + $ECHO "\
  13705. + if test -n \"\$lt_option_debug\"; then
  13706. + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
  13707. + func_lt_dump_args \${1+\"\$@\"} 1>&2
  13708. + fi
  13709. + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  13710. +"
  13711. + ;;
  13712. +
  13713. + *)
  13714. + $ECHO "\
  13715. + if test -n \"\$lt_option_debug\"; then
  13716. + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
  13717. + func_lt_dump_args \${1+\"\$@\"} 1>&2
  13718. + fi
  13719. + exec \"\$progdir/\$program\" \${1+\"\$@\"}
  13720. +"
  13721. + ;;
  13722. + esac
  13723. + $ECHO "\
  13724. + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  13725. + exit 1
  13726. +}
  13727. +
  13728. +# A function to encapsulate launching the target application
  13729. +# Strips options in the --lt-* namespace from \$@ and
  13730. +# launches target application with the remaining arguments.
  13731. +func_exec_program ()
  13732. +{
  13733. + case \" \$* \" in
  13734. + *\\ --lt-*)
  13735. + for lt_wr_arg
  13736. + do
  13737. + case \$lt_wr_arg in
  13738. + --lt-*) ;;
  13739. + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
  13740. + esac
  13741. + shift
  13742. + done ;;
  13743. + esac
  13744. + func_exec_program_core \${1+\"\$@\"}
  13745. +}
  13746. +
  13747. + # Parse options
  13748. + func_parse_lt_options \"\$0\" \${1+\"\$@\"}
  13749. +
  13750. + # Find the directory that this script lives in.
  13751. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
  13752. + test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  13753. +
  13754. + # Follow symbolic links until we get to the real thisdir.
  13755. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
  13756. + while test -n \"\$file\"; do
  13757. + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
  13758. +
  13759. + # If there was a directory component, then change thisdir.
  13760. + if test \"x\$destdir\" != \"x\$file\"; then
  13761. + case \"\$destdir\" in
  13762. + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  13763. + *) thisdir=\"\$thisdir/\$destdir\" ;;
  13764. + esac
  13765. + fi
  13766. +
  13767. + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
  13768. + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
  13769. + done
  13770. +
  13771. + # Usually 'no', except on cygwin/mingw when embedded into
  13772. + # the cwrapper.
  13773. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
  13774. + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  13775. + # special case for '.'
  13776. + if test \"\$thisdir\" = \".\"; then
  13777. + thisdir=\`pwd\`
  13778. + fi
  13779. + # remove .libs from thisdir
  13780. + case \"\$thisdir\" in
  13781. + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
  13782. + $objdir ) thisdir=. ;;
  13783. + esac
  13784. + fi
  13785. +
  13786. + # Try to get the absolute directory name.
  13787. + absdir=\`cd \"\$thisdir\" && pwd\`
  13788. + test -n \"\$absdir\" && thisdir=\"\$absdir\"
  13789. +"
  13790. +
  13791. + if test yes = "$fast_install"; then
  13792. + $ECHO "\
  13793. + program=lt-'$outputname'$exeext
  13794. + progdir=\"\$thisdir/$objdir\"
  13795. +
  13796. + if test ! -f \"\$progdir/\$program\" ||
  13797. + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
  13798. + test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  13799. +
  13800. + file=\"\$\$-\$program\"
  13801. +
  13802. + if test ! -d \"\$progdir\"; then
  13803. + $MKDIR \"\$progdir\"
  13804. + else
  13805. + $RM \"\$progdir/\$file\"
  13806. + fi"
  13807. +
  13808. + $ECHO "\
  13809. +
  13810. + # relink executable if necessary
  13811. + if test -n \"\$relink_command\"; then
  13812. + if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  13813. + else
  13814. + \$ECHO \"\$relink_command_output\" >&2
  13815. + $RM \"\$progdir/\$file\"
  13816. + exit 1
  13817. + fi
  13818. + fi
  13819. +
  13820. + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  13821. + { $RM \"\$progdir/\$program\";
  13822. + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  13823. + $RM \"\$progdir/\$file\"
  13824. + fi"
  13825. + else
  13826. + $ECHO "\
  13827. + program='$outputname'
  13828. + progdir=\"\$thisdir/$objdir\"
  13829. +"
  13830. + fi
  13831. +
  13832. + $ECHO "\
  13833. +
  13834. + if test -f \"\$progdir/\$program\"; then"
  13835. +
  13836. + # fixup the dll searchpath if we need to.
  13837. + #
  13838. + # Fix the DLL searchpath if we need to. Do this before prepending
  13839. + # to shlibpath, because on Windows, both are PATH and uninstalled
  13840. + # libraries must come first.
  13841. + if test -n "$dllsearchpath"; then
  13842. + $ECHO "\
  13843. + # Add the dll search path components to the executable PATH
  13844. + PATH=$dllsearchpath:\$PATH
  13845. +"
  13846. + fi
  13847. +
  13848. + # Export our shlibpath_var if we have one.
  13849. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  13850. + $ECHO "\
  13851. + # Add our own library path to $shlibpath_var
  13852. + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  13853. +
  13854. + # Some systems cannot cope with colon-terminated $shlibpath_var
  13855. + # The second colon is a workaround for a bug in BeOS R4 sed
  13856. + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
  13857. +
  13858. + export $shlibpath_var
  13859. +"
  13860. + fi
  13861. +
  13862. + $ECHO "\
  13863. + if test \"\$libtool_execute_magic\" != \"$magic\"; then
  13864. + # Run the actual program with our arguments.
  13865. + func_exec_program \${1+\"\$@\"}
  13866. + fi
  13867. + else
  13868. + # The program doesn't exist.
  13869. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
  13870. + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  13871. + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  13872. + exit 1
  13873. + fi
  13874. +fi\
  13875. +"
  13876. +}
  13877. +
  13878. +
  13879. +# func_emit_cwrapperexe_src
  13880. +# emit the source code for a wrapper executable on stdout
  13881. +# Must ONLY be called from within func_mode_link because
  13882. +# it depends on a number of variable set therein.
  13883. +func_emit_cwrapperexe_src ()
  13884. +{
  13885. + cat <<EOF
  13886. +
  13887. +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  13888. + Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  13889. +
  13890. + The $output program cannot be directly executed until all the libtool
  13891. + libraries that it depends on are installed.
  13892. +
  13893. + This wrapper executable should never be moved out of the build directory.
  13894. + If it is, it will not operate correctly.
  13895. +*/
  13896. +EOF
  13897. + cat <<"EOF"
  13898. +#ifdef _MSC_VER
  13899. +# define _CRT_SECURE_NO_DEPRECATE 1
  13900. +#endif
  13901. +#include <stdio.h>
  13902. +#include <stdlib.h>
  13903. +#ifdef _MSC_VER
  13904. +# include <direct.h>
  13905. +# include <process.h>
  13906. +# include <io.h>
  13907. +#else
  13908. +# include <unistd.h>
  13909. +# include <stdint.h>
  13910. +# ifdef __CYGWIN__
  13911. +# include <io.h>
  13912. +# endif
  13913. +#endif
  13914. +#include <malloc.h>
  13915. +#include <stdarg.h>
  13916. +#include <assert.h>
  13917. +#include <string.h>
  13918. +#include <ctype.h>
  13919. +#include <errno.h>
  13920. +#include <fcntl.h>
  13921. +#include <sys/stat.h>
  13922. +
  13923. +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  13924. +
  13925. +/* declarations of non-ANSI functions */
  13926. +#if defined __MINGW32__
  13927. +# ifdef __STRICT_ANSI__
  13928. +int _putenv (const char *);
  13929. +# endif
  13930. +#elif defined __CYGWIN__
  13931. +# ifdef __STRICT_ANSI__
  13932. +char *realpath (const char *, char *);
  13933. +int putenv (char *);
  13934. +int setenv (const char *, const char *, int);
  13935. +# endif
  13936. +/* #elif defined other_platform || defined ... */
  13937. +#endif
  13938. +
  13939. +/* portability defines, excluding path handling macros */
  13940. +#if defined _MSC_VER
  13941. +# define setmode _setmode
  13942. +# define stat _stat
  13943. +# define chmod _chmod
  13944. +# define getcwd _getcwd
  13945. +# define putenv _putenv
  13946. +# define S_IXUSR _S_IEXEC
  13947. +#elif defined __MINGW32__
  13948. +# define setmode _setmode
  13949. +# define stat _stat
  13950. +# define chmod _chmod
  13951. +# define getcwd _getcwd
  13952. +# define putenv _putenv
  13953. +#elif defined __CYGWIN__
  13954. +# define HAVE_SETENV
  13955. +# define FOPEN_WB "wb"
  13956. +/* #elif defined other platforms ... */
  13957. +#endif
  13958. +
  13959. +#if defined PATH_MAX
  13960. +# define LT_PATHMAX PATH_MAX
  13961. +#elif defined MAXPATHLEN
  13962. +# define LT_PATHMAX MAXPATHLEN
  13963. +#else
  13964. +# define LT_PATHMAX 1024
  13965. +#endif
  13966. +
  13967. +#ifndef S_IXOTH
  13968. +# define S_IXOTH 0
  13969. +#endif
  13970. +#ifndef S_IXGRP
  13971. +# define S_IXGRP 0
  13972. +#endif
  13973. +
  13974. +/* path handling portability macros */
  13975. +#ifndef DIR_SEPARATOR
  13976. +# define DIR_SEPARATOR '/'
  13977. +# define PATH_SEPARATOR ':'
  13978. +#endif
  13979. +
  13980. +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
  13981. + defined __OS2__
  13982. +# define HAVE_DOS_BASED_FILE_SYSTEM
  13983. +# define FOPEN_WB "wb"
  13984. +# ifndef DIR_SEPARATOR_2
  13985. +# define DIR_SEPARATOR_2 '\\'
  13986. +# endif
  13987. +# ifndef PATH_SEPARATOR_2
  13988. +# define PATH_SEPARATOR_2 ';'
  13989. +# endif
  13990. +#endif
  13991. +
  13992. +#ifndef DIR_SEPARATOR_2
  13993. +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  13994. +#else /* DIR_SEPARATOR_2 */
  13995. +# define IS_DIR_SEPARATOR(ch) \
  13996. + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  13997. +#endif /* DIR_SEPARATOR_2 */
  13998. +
  13999. +#ifndef PATH_SEPARATOR_2
  14000. +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  14001. +#else /* PATH_SEPARATOR_2 */
  14002. +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  14003. +#endif /* PATH_SEPARATOR_2 */
  14004. +
  14005. +#ifndef FOPEN_WB
  14006. +# define FOPEN_WB "w"
  14007. +#endif
  14008. +#ifndef _O_BINARY
  14009. +# define _O_BINARY 0
  14010. +#endif
  14011. +
  14012. +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  14013. +#define XFREE(stale) do { \
  14014. + if (stale) { free (stale); stale = 0; } \
  14015. +} while (0)
  14016. +
  14017. +#if defined LT_DEBUGWRAPPER
  14018. +static int lt_debug = 1;
  14019. +#else
  14020. +static int lt_debug = 0;
  14021. +#endif
  14022. +
  14023. +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
  14024. +
  14025. +void *xmalloc (size_t num);
  14026. +char *xstrdup (const char *string);
  14027. +const char *base_name (const char *name);
  14028. +char *find_executable (const char *wrapper);
  14029. +char *chase_symlinks (const char *pathspec);
  14030. +int make_executable (const char *path);
  14031. +int check_executable (const char *path);
  14032. +char *strendzap (char *str, const char *pat);
  14033. +void lt_debugprintf (const char *file, int line, const char *fmt, ...);
  14034. +void lt_fatal (const char *file, int line, const char *message, ...);
  14035. +static const char *nonnull (const char *s);
  14036. +static const char *nonempty (const char *s);
  14037. +void lt_setenv (const char *name, const char *value);
  14038. +char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  14039. +void lt_update_exe_path (const char *name, const char *value);
  14040. +void lt_update_lib_path (const char *name, const char *value);
  14041. +char **prepare_spawn (char **argv);
  14042. +void lt_dump_script (FILE *f);
  14043. +EOF
  14044. +
  14045. + cat <<EOF
  14046. +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
  14047. +# define externally_visible volatile
  14048. +#else
  14049. +# define externally_visible __attribute__((externally_visible)) volatile
  14050. +#endif
  14051. +externally_visible const char * MAGIC_EXE = "$magic_exe";
  14052. +const char * LIB_PATH_VARNAME = "$shlibpath_var";
  14053. +EOF
  14054. +
  14055. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  14056. + func_to_host_path "$temp_rpath"
  14057. + cat <<EOF
  14058. +const char * LIB_PATH_VALUE = "$func_to_host_path_result";
  14059. +EOF
  14060. + else
  14061. + cat <<"EOF"
  14062. +const char * LIB_PATH_VALUE = "";
  14063. +EOF
  14064. + fi
  14065. +
  14066. + if test -n "$dllsearchpath"; then
  14067. + func_to_host_path "$dllsearchpath:"
  14068. + cat <<EOF
  14069. +const char * EXE_PATH_VARNAME = "PATH";
  14070. +const char * EXE_PATH_VALUE = "$func_to_host_path_result";
  14071. +EOF
  14072. + else
  14073. + cat <<"EOF"
  14074. +const char * EXE_PATH_VARNAME = "";
  14075. +const char * EXE_PATH_VALUE = "";
  14076. +EOF
  14077. + fi
  14078. +
  14079. + if test yes = "$fast_install"; then
  14080. + cat <<EOF
  14081. +const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  14082. +EOF
  14083. + else
  14084. + cat <<EOF
  14085. +const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  14086. +EOF
  14087. + fi
  14088. +
  14089. +
  14090. + cat <<"EOF"
  14091. +
  14092. +#define LTWRAPPER_OPTION_PREFIX "--lt-"
  14093. +
  14094. +static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  14095. +static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
  14096. +static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
  14097. +
  14098. +int
  14099. +main (int argc, char *argv[])
  14100. +{
  14101. + char **newargz;
  14102. + int newargc;
  14103. + char *tmp_pathspec;
  14104. + char *actual_cwrapper_path;
  14105. + char *actual_cwrapper_name;
  14106. + char *target_name;
  14107. + char *lt_argv_zero;
  14108. + int rval = 127;
  14109. +
  14110. + int i;
  14111. +
  14112. + program_name = (char *) xstrdup (base_name (argv[0]));
  14113. + newargz = XMALLOC (char *, (size_t) argc + 1);
  14114. +
  14115. + /* very simple arg parsing; don't want to rely on getopt
  14116. + * also, copy all non cwrapper options to newargz, except
  14117. + * argz[0], which is handled differently
  14118. + */
  14119. + newargc=0;
  14120. + for (i = 1; i < argc; i++)
  14121. + {
  14122. + if (STREQ (argv[i], dumpscript_opt))
  14123. + {
  14124. +EOF
  14125. + case $host in
  14126. + *mingw* | *cygwin* )
  14127. + # make stdout use "unix" line endings
  14128. + echo " setmode(1,_O_BINARY);"
  14129. + ;;
  14130. + esac
  14131. +
  14132. + cat <<"EOF"
  14133. + lt_dump_script (stdout);
  14134. + return 0;
  14135. + }
  14136. + if (STREQ (argv[i], debug_opt))
  14137. + {
  14138. + lt_debug = 1;
  14139. + continue;
  14140. + }
  14141. + if (STREQ (argv[i], ltwrapper_option_prefix))
  14142. + {
  14143. + /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  14144. + namespace, but it is not one of the ones we know about and
  14145. + have already dealt with, above (inluding dump-script), then
  14146. + report an error. Otherwise, targets might begin to believe
  14147. + they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  14148. + namespace. The first time any user complains about this, we'll
  14149. + need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  14150. + or a configure.ac-settable value.
  14151. + */
  14152. + lt_fatal (__FILE__, __LINE__,
  14153. + "unrecognized %s option: '%s'",
  14154. + ltwrapper_option_prefix, argv[i]);
  14155. + }
  14156. + /* otherwise ... */
  14157. + newargz[++newargc] = xstrdup (argv[i]);
  14158. + }
  14159. + newargz[++newargc] = NULL;
  14160. +
  14161. +EOF
  14162. + cat <<EOF
  14163. + /* The GNU banner must be the first non-error debug message */
  14164. + lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
  14165. +EOF
  14166. + cat <<"EOF"
  14167. + lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
  14168. + lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
  14169. +
  14170. + tmp_pathspec = find_executable (argv[0]);
  14171. + if (tmp_pathspec == NULL)
  14172. + lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
  14173. + lt_debugprintf (__FILE__, __LINE__,
  14174. + "(main) found exe (before symlink chase) at: %s\n",
  14175. + tmp_pathspec);
  14176. +
  14177. + actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  14178. + lt_debugprintf (__FILE__, __LINE__,
  14179. + "(main) found exe (after symlink chase) at: %s\n",
  14180. + actual_cwrapper_path);
  14181. + XFREE (tmp_pathspec);
  14182. +
  14183. + actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
  14184. + strendzap (actual_cwrapper_path, actual_cwrapper_name);
  14185. +
  14186. + /* wrapper name transforms */
  14187. + strendzap (actual_cwrapper_name, ".exe");
  14188. + tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  14189. + XFREE (actual_cwrapper_name);
  14190. + actual_cwrapper_name = tmp_pathspec;
  14191. + tmp_pathspec = 0;
  14192. +
  14193. + /* target_name transforms -- use actual target program name; might have lt- prefix */
  14194. + target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  14195. + strendzap (target_name, ".exe");
  14196. + tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  14197. + XFREE (target_name);
  14198. + target_name = tmp_pathspec;
  14199. + tmp_pathspec = 0;
  14200. +
  14201. + lt_debugprintf (__FILE__, __LINE__,
  14202. + "(main) libtool target name: %s\n",
  14203. + target_name);
  14204. +EOF
  14205. +
  14206. + cat <<EOF
  14207. + newargz[0] =
  14208. + XMALLOC (char, (strlen (actual_cwrapper_path) +
  14209. + strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  14210. + strcpy (newargz[0], actual_cwrapper_path);
  14211. + strcat (newargz[0], "$objdir");
  14212. + strcat (newargz[0], "/");
  14213. +EOF
  14214. +
  14215. + cat <<"EOF"
  14216. + /* stop here, and copy so we don't have to do this twice */
  14217. + tmp_pathspec = xstrdup (newargz[0]);
  14218. +
  14219. + /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  14220. + strcat (newargz[0], actual_cwrapper_name);
  14221. +
  14222. + /* DO want the lt- prefix here if it exists, so use target_name */
  14223. + lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  14224. + XFREE (tmp_pathspec);
  14225. + tmp_pathspec = NULL;
  14226. +EOF
  14227. +
  14228. + case $host_os in
  14229. + mingw*)
  14230. + cat <<"EOF"
  14231. + {
  14232. + char* p;
  14233. + while ((p = strchr (newargz[0], '\\')) != NULL)
  14234. + {
  14235. + *p = '/';
  14236. + }
  14237. + while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  14238. + {
  14239. + *p = '/';
  14240. + }
  14241. + }
  14242. +EOF
  14243. + ;;
  14244. + esac
  14245. +
  14246. + cat <<"EOF"
  14247. + XFREE (target_name);
  14248. + XFREE (actual_cwrapper_path);
  14249. + XFREE (actual_cwrapper_name);
  14250. +
  14251. + lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  14252. + lt_setenv ("DUALCASE", "1"); /* for MSK sh */
  14253. + /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
  14254. + be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
  14255. + because on Windows, both *_VARNAMEs are PATH but uninstalled
  14256. + libraries must come first. */
  14257. + lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  14258. + lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  14259. +
  14260. + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
  14261. + nonnull (lt_argv_zero));
  14262. + for (i = 0; i < newargc; i++)
  14263. + {
  14264. + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
  14265. + i, nonnull (newargz[i]));
  14266. + }
  14267. +
  14268. +EOF
  14269. +
  14270. + case $host_os in
  14271. + mingw*)
  14272. + cat <<"EOF"
  14273. + /* execv doesn't actually work on mingw as expected on unix */
  14274. + newargz = prepare_spawn (newargz);
  14275. + rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  14276. + if (rval == -1)
  14277. + {
  14278. + /* failed to start process */
  14279. + lt_debugprintf (__FILE__, __LINE__,
  14280. + "(main) failed to launch target \"%s\": %s\n",
  14281. + lt_argv_zero, nonnull (strerror (errno)));
  14282. + return 127;
  14283. + }
  14284. + return rval;
  14285. +EOF
  14286. + ;;
  14287. + *)
  14288. + cat <<"EOF"
  14289. + execv (lt_argv_zero, newargz);
  14290. + return rval; /* =127, but avoids unused variable warning */
  14291. +EOF
  14292. + ;;
  14293. + esac
  14294. +
  14295. + cat <<"EOF"
  14296. +}
  14297. +
  14298. +void *
  14299. +xmalloc (size_t num)
  14300. +{
  14301. + void *p = (void *) malloc (num);
  14302. + if (!p)
  14303. + lt_fatal (__FILE__, __LINE__, "memory exhausted");
  14304. +
  14305. + return p;
  14306. +}
  14307. +
  14308. +char *
  14309. +xstrdup (const char *string)
  14310. +{
  14311. + return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  14312. + string) : NULL;
  14313. +}
  14314. +
  14315. +const char *
  14316. +base_name (const char *name)
  14317. +{
  14318. + const char *base;
  14319. +
  14320. +#if defined HAVE_DOS_BASED_FILE_SYSTEM
  14321. + /* Skip over the disk name in MSDOS pathnames. */
  14322. + if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  14323. + name += 2;
  14324. +#endif
  14325. +
  14326. + for (base = name; *name; name++)
  14327. + if (IS_DIR_SEPARATOR (*name))
  14328. + base = name + 1;
  14329. + return base;
  14330. +}
  14331. +
  14332. +int
  14333. +check_executable (const char *path)
  14334. +{
  14335. + struct stat st;
  14336. +
  14337. + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
  14338. + nonempty (path));
  14339. + if ((!path) || (!*path))
  14340. + return 0;
  14341. +
  14342. + if ((stat (path, &st) >= 0)
  14343. + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  14344. + return 1;
  14345. + else
  14346. + return 0;
  14347. +}
  14348. +
  14349. +int
  14350. +make_executable (const char *path)
  14351. +{
  14352. + int rval = 0;
  14353. + struct stat st;
  14354. +
  14355. + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
  14356. + nonempty (path));
  14357. + if ((!path) || (!*path))
  14358. + return 0;
  14359. +
  14360. + if (stat (path, &st) >= 0)
  14361. + {
  14362. + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  14363. + }
  14364. + return rval;
  14365. +}
  14366. +
  14367. +/* Searches for the full path of the wrapper. Returns
  14368. + newly allocated full path name if found, NULL otherwise
  14369. + Does not chase symlinks, even on platforms that support them.
  14370. +*/
  14371. +char *
  14372. +find_executable (const char *wrapper)
  14373. +{
  14374. + int has_slash = 0;
  14375. + const char *p;
  14376. + const char *p_next;
  14377. + /* static buffer for getcwd */
  14378. + char tmp[LT_PATHMAX + 1];
  14379. + size_t tmp_len;
  14380. + char *concat_name;
  14381. +
  14382. + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
  14383. + nonempty (wrapper));
  14384. +
  14385. + if ((wrapper == NULL) || (*wrapper == '\0'))
  14386. + return NULL;
  14387. +
  14388. + /* Absolute path? */
  14389. +#if defined HAVE_DOS_BASED_FILE_SYSTEM
  14390. + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  14391. + {
  14392. + concat_name = xstrdup (wrapper);
  14393. + if (check_executable (concat_name))
  14394. + return concat_name;
  14395. + XFREE (concat_name);
  14396. + }
  14397. + else
  14398. + {
  14399. +#endif
  14400. + if (IS_DIR_SEPARATOR (wrapper[0]))
  14401. + {
  14402. + concat_name = xstrdup (wrapper);
  14403. + if (check_executable (concat_name))
  14404. + return concat_name;
  14405. + XFREE (concat_name);
  14406. + }
  14407. +#if defined HAVE_DOS_BASED_FILE_SYSTEM
  14408. + }
  14409. +#endif
  14410. +
  14411. + for (p = wrapper; *p; p++)
  14412. + if (*p == '/')
  14413. + {
  14414. + has_slash = 1;
  14415. + break;
  14416. + }
  14417. + if (!has_slash)
  14418. + {
  14419. + /* no slashes; search PATH */
  14420. + const char *path = getenv ("PATH");
  14421. + if (path != NULL)
  14422. + {
  14423. + for (p = path; *p; p = p_next)
  14424. + {
  14425. + const char *q;
  14426. + size_t p_len;
  14427. + for (q = p; *q; q++)
  14428. + if (IS_PATH_SEPARATOR (*q))
  14429. + break;
  14430. + p_len = (size_t) (q - p);
  14431. + p_next = (*q == '\0' ? q : q + 1);
  14432. + if (p_len == 0)
  14433. + {
  14434. + /* empty path: current directory */
  14435. + if (getcwd (tmp, LT_PATHMAX) == NULL)
  14436. + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  14437. + nonnull (strerror (errno)));
  14438. + tmp_len = strlen (tmp);
  14439. + concat_name =
  14440. + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  14441. + memcpy (concat_name, tmp, tmp_len);
  14442. + concat_name[tmp_len] = '/';
  14443. + strcpy (concat_name + tmp_len + 1, wrapper);
  14444. + }
  14445. + else
  14446. + {
  14447. + concat_name =
  14448. + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  14449. + memcpy (concat_name, p, p_len);
  14450. + concat_name[p_len] = '/';
  14451. + strcpy (concat_name + p_len + 1, wrapper);
  14452. + }
  14453. + if (check_executable (concat_name))
  14454. + return concat_name;
  14455. + XFREE (concat_name);
  14456. + }
  14457. + }
  14458. + /* not found in PATH; assume curdir */
  14459. + }
  14460. + /* Relative path | not found in path: prepend cwd */
  14461. + if (getcwd (tmp, LT_PATHMAX) == NULL)
  14462. + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  14463. + nonnull (strerror (errno)));
  14464. + tmp_len = strlen (tmp);
  14465. + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  14466. + memcpy (concat_name, tmp, tmp_len);
  14467. + concat_name[tmp_len] = '/';
  14468. + strcpy (concat_name + tmp_len + 1, wrapper);
  14469. +
  14470. + if (check_executable (concat_name))
  14471. + return concat_name;
  14472. + XFREE (concat_name);
  14473. + return NULL;
  14474. +}
  14475. +
  14476. +char *
  14477. +chase_symlinks (const char *pathspec)
  14478. +{
  14479. +#ifndef S_ISLNK
  14480. + return xstrdup (pathspec);
  14481. +#else
  14482. + char buf[LT_PATHMAX];
  14483. + struct stat s;
  14484. + char *tmp_pathspec = xstrdup (pathspec);
  14485. + char *p;
  14486. + int has_symlinks = 0;
  14487. + while (strlen (tmp_pathspec) && !has_symlinks)
  14488. + {
  14489. + lt_debugprintf (__FILE__, __LINE__,
  14490. + "checking path component for symlinks: %s\n",
  14491. + tmp_pathspec);
  14492. + if (lstat (tmp_pathspec, &s) == 0)
  14493. + {
  14494. + if (S_ISLNK (s.st_mode) != 0)
  14495. + {
  14496. + has_symlinks = 1;
  14497. + break;
  14498. + }
  14499. +
  14500. + /* search backwards for last DIR_SEPARATOR */
  14501. + p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  14502. + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  14503. + p--;
  14504. + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  14505. + {
  14506. + /* no more DIR_SEPARATORS left */
  14507. + break;
  14508. + }
  14509. + *p = '\0';
  14510. + }
  14511. + else
  14512. + {
  14513. + lt_fatal (__FILE__, __LINE__,
  14514. + "error accessing file \"%s\": %s",
  14515. + tmp_pathspec, nonnull (strerror (errno)));
  14516. + }
  14517. + }
  14518. + XFREE (tmp_pathspec);
  14519. +
  14520. + if (!has_symlinks)
  14521. + {
  14522. + return xstrdup (pathspec);
  14523. + }
  14524. +
  14525. + tmp_pathspec = realpath (pathspec, buf);
  14526. + if (tmp_pathspec == 0)
  14527. + {
  14528. + lt_fatal (__FILE__, __LINE__,
  14529. + "could not follow symlinks for %s", pathspec);
  14530. + }
  14531. + return xstrdup (tmp_pathspec);
  14532. +#endif
  14533. +}
  14534. +
  14535. +char *
  14536. +strendzap (char *str, const char *pat)
  14537. +{
  14538. + size_t len, patlen;
  14539. +
  14540. + assert (str != NULL);
  14541. + assert (pat != NULL);
  14542. +
  14543. + len = strlen (str);
  14544. + patlen = strlen (pat);
  14545. +
  14546. + if (patlen <= len)
  14547. + {
  14548. + str += len - patlen;
  14549. + if (STREQ (str, pat))
  14550. + *str = '\0';
  14551. + }
  14552. + return str;
  14553. +}
  14554. +
  14555. +void
  14556. +lt_debugprintf (const char *file, int line, const char *fmt, ...)
  14557. +{
  14558. + va_list args;
  14559. + if (lt_debug)
  14560. + {
  14561. + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
  14562. + va_start (args, fmt);
  14563. + (void) vfprintf (stderr, fmt, args);
  14564. + va_end (args);
  14565. + }
  14566. +}
  14567. +
  14568. +static void
  14569. +lt_error_core (int exit_status, const char *file,
  14570. + int line, const char *mode,
  14571. + const char *message, va_list ap)
  14572. +{
  14573. + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
  14574. + vfprintf (stderr, message, ap);
  14575. + fprintf (stderr, ".\n");
  14576. +
  14577. + if (exit_status >= 0)
  14578. + exit (exit_status);
  14579. +}
  14580. +
  14581. +void
  14582. +lt_fatal (const char *file, int line, const char *message, ...)
  14583. +{
  14584. + va_list ap;
  14585. + va_start (ap, message);
  14586. + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
  14587. + va_end (ap);
  14588. +}
  14589. +
  14590. +static const char *
  14591. +nonnull (const char *s)
  14592. +{
  14593. + return s ? s : "(null)";
  14594. +}
  14595. +
  14596. +static const char *
  14597. +nonempty (const char *s)
  14598. +{
  14599. + return (s && !*s) ? "(empty)" : nonnull (s);
  14600. +}
  14601. +
  14602. +void
  14603. +lt_setenv (const char *name, const char *value)
  14604. +{
  14605. + lt_debugprintf (__FILE__, __LINE__,
  14606. + "(lt_setenv) setting '%s' to '%s'\n",
  14607. + nonnull (name), nonnull (value));
  14608. + {
  14609. +#ifdef HAVE_SETENV
  14610. + /* always make a copy, for consistency with !HAVE_SETENV */
  14611. + char *str = xstrdup (value);
  14612. + setenv (name, str, 1);
  14613. +#else
  14614. + size_t len = strlen (name) + 1 + strlen (value) + 1;
  14615. + char *str = XMALLOC (char, len);
  14616. + sprintf (str, "%s=%s", name, value);
  14617. + if (putenv (str) != EXIT_SUCCESS)
  14618. + {
  14619. + XFREE (str);
  14620. + }
  14621. +#endif
  14622. + }
  14623. +}
  14624. +
  14625. +char *
  14626. +lt_extend_str (const char *orig_value, const char *add, int to_end)
  14627. +{
  14628. + char *new_value;
  14629. + if (orig_value && *orig_value)
  14630. + {
  14631. + size_t orig_value_len = strlen (orig_value);
  14632. + size_t add_len = strlen (add);
  14633. + new_value = XMALLOC (char, add_len + orig_value_len + 1);
  14634. + if (to_end)
  14635. + {
  14636. + strcpy (new_value, orig_value);
  14637. + strcpy (new_value + orig_value_len, add);
  14638. + }
  14639. + else
  14640. + {
  14641. + strcpy (new_value, add);
  14642. + strcpy (new_value + add_len, orig_value);
  14643. + }
  14644. + }
  14645. + else
  14646. + {
  14647. + new_value = xstrdup (add);
  14648. + }
  14649. + return new_value;
  14650. +}
  14651. +
  14652. +void
  14653. +lt_update_exe_path (const char *name, const char *value)
  14654. +{
  14655. + lt_debugprintf (__FILE__, __LINE__,
  14656. + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  14657. + nonnull (name), nonnull (value));
  14658. +
  14659. + if (name && *name && value && *value)
  14660. + {
  14661. + char *new_value = lt_extend_str (getenv (name), value, 0);
  14662. + /* some systems can't cope with a ':'-terminated path #' */
  14663. + size_t len = strlen (new_value);
  14664. + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  14665. + {
  14666. + new_value[--len] = '\0';
  14667. + }
  14668. + lt_setenv (name, new_value);
  14669. + XFREE (new_value);
  14670. + }
  14671. +}
  14672. +
  14673. +void
  14674. +lt_update_lib_path (const char *name, const char *value)
  14675. +{
  14676. + lt_debugprintf (__FILE__, __LINE__,
  14677. + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  14678. + nonnull (name), nonnull (value));
  14679. +
  14680. + if (name && *name && value && *value)
  14681. + {
  14682. + char *new_value = lt_extend_str (getenv (name), value, 0);
  14683. + lt_setenv (name, new_value);
  14684. + XFREE (new_value);
  14685. + }
  14686. +}
  14687. +
  14688. +EOF
  14689. + case $host_os in
  14690. + mingw*)
  14691. + cat <<"EOF"
  14692. +
  14693. +/* Prepares an argument vector before calling spawn().
  14694. + Note that spawn() does not by itself call the command interpreter
  14695. + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
  14696. + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  14697. + GetVersionEx(&v);
  14698. + v.dwPlatformId == VER_PLATFORM_WIN32_NT;
  14699. + }) ? "cmd.exe" : "command.com").
  14700. + Instead it simply concatenates the arguments, separated by ' ', and calls
  14701. + CreateProcess(). We must quote the arguments since Win32 CreateProcess()
  14702. + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
  14703. + special way:
  14704. + - Space and tab are interpreted as delimiters. They are not treated as
  14705. + delimiters if they are surrounded by double quotes: "...".
  14706. + - Unescaped double quotes are removed from the input. Their only effect is
  14707. + that within double quotes, space and tab are treated like normal
  14708. + characters.
  14709. + - Backslashes not followed by double quotes are not special.
  14710. + - But 2*n+1 backslashes followed by a double quote become
  14711. + n backslashes followed by a double quote (n >= 0):
  14712. + \" -> "
  14713. + \\\" -> \"
  14714. + \\\\\" -> \\"
  14715. + */
  14716. +#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"
  14717. +#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"
  14718. +char **
  14719. +prepare_spawn (char **argv)
  14720. +{
  14721. + size_t argc;
  14722. + char **new_argv;
  14723. + size_t i;
  14724. +
  14725. + /* Count number of arguments. */
  14726. + for (argc = 0; argv[argc] != NULL; argc++)
  14727. + ;
  14728. +
  14729. + /* Allocate new argument vector. */
  14730. + new_argv = XMALLOC (char *, argc + 1);
  14731. +
  14732. + /* Put quoted arguments into the new argument vector. */
  14733. + for (i = 0; i < argc; i++)
  14734. + {
  14735. + const char *string = argv[i];
  14736. +
  14737. + if (string[0] == '\0')
  14738. + new_argv[i] = xstrdup ("\"\"");
  14739. + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
  14740. + {
  14741. + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
  14742. + size_t length;
  14743. + unsigned int backslashes;
  14744. + const char *s;
  14745. + char *quoted_string;
  14746. + char *p;
  14747. +
  14748. + length = 0;
  14749. + backslashes = 0;
  14750. + if (quote_around)
  14751. + length++;
  14752. + for (s = string; *s != '\0'; s++)
  14753. + {
  14754. + char c = *s;
  14755. + if (c == '"')
  14756. + length += backslashes + 1;
  14757. + length++;
  14758. + if (c == '\\')
  14759. + backslashes++;
  14760. + else
  14761. + backslashes = 0;
  14762. + }
  14763. + if (quote_around)
  14764. + length += backslashes + 1;
  14765. +
  14766. + quoted_string = XMALLOC (char, length + 1);
  14767. +
  14768. + p = quoted_string;
  14769. + backslashes = 0;
  14770. + if (quote_around)
  14771. + *p++ = '"';
  14772. + for (s = string; *s != '\0'; s++)
  14773. + {
  14774. + char c = *s;
  14775. + if (c == '"')
  14776. + {
  14777. + unsigned int j;
  14778. + for (j = backslashes + 1; j > 0; j--)
  14779. + *p++ = '\\';
  14780. + }
  14781. + *p++ = c;
  14782. + if (c == '\\')
  14783. + backslashes++;
  14784. + else
  14785. + backslashes = 0;
  14786. + }
  14787. + if (quote_around)
  14788. + {
  14789. + unsigned int j;
  14790. + for (j = backslashes; j > 0; j--)
  14791. + *p++ = '\\';
  14792. + *p++ = '"';
  14793. + }
  14794. + *p = '\0';
  14795. +
  14796. + new_argv[i] = quoted_string;
  14797. + }
  14798. + else
  14799. + new_argv[i] = (char *) string;
  14800. + }
  14801. + new_argv[argc] = NULL;
  14802. +
  14803. + return new_argv;
  14804. +}
  14805. +EOF
  14806. + ;;
  14807. + esac
  14808. +
  14809. + cat <<"EOF"
  14810. +void lt_dump_script (FILE* f)
  14811. +{
  14812. +EOF
  14813. + func_emit_wrapper yes |
  14814. + $SED -n -e '
  14815. +s/^\(.\{79\}\)\(..*\)/\1\
  14816. +\2/
  14817. +h
  14818. +s/\([\\"]\)/\\\1/g
  14819. +s/$/\\n/
  14820. +s/\([^\n]*\).*/ fputs ("\1", f);/p
  14821. +g
  14822. +D'
  14823. + cat <<"EOF"
  14824. +}
  14825. +EOF
  14826. +}
  14827. +# end: func_emit_cwrapperexe_src
  14828. +
  14829. +# func_win32_import_lib_p ARG
  14830. +# True if ARG is an import lib, as indicated by $file_magic_cmd
  14831. +func_win32_import_lib_p ()
  14832. +{
  14833. + $debug_cmd
  14834. +
  14835. + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
  14836. + *import*) : ;;
  14837. + *) false ;;
  14838. + esac
  14839. +}
  14840. +
  14841. +# func_suncc_cstd_abi
  14842. +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
  14843. +# Several compiler flags select an ABI that is incompatible with the
  14844. +# Cstd library. Avoid specifying it if any are in CXXFLAGS.
  14845. +func_suncc_cstd_abi ()
  14846. +{
  14847. + $debug_cmd
  14848. +
  14849. + case " $compile_command " in
  14850. + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
  14851. + suncc_use_cstd_abi=no
  14852. + ;;
  14853. + *)
  14854. + suncc_use_cstd_abi=yes
  14855. + ;;
  14856. + esac
  14857. +}
  14858. +
  14859. +# func_mode_link arg...
  14860. +func_mode_link ()
  14861. +{
  14862. + $debug_cmd
  14863. +
  14864. + case $host in
  14865. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  14866. + # It is impossible to link a dll without this setting, and
  14867. + # we shouldn't force the makefile maintainer to figure out
  14868. + # what system we are compiling for in order to pass an extra
  14869. + # flag for every libtool invocation.
  14870. + # allow_undefined=no
  14871. +
  14872. + # FIXME: Unfortunately, there are problems with the above when trying
  14873. + # to make a dll that has undefined symbols, in which case not
  14874. + # even a static library is built. For now, we need to specify
  14875. + # -no-undefined on the libtool link line when we can be certain
  14876. + # that all symbols are satisfied, otherwise we get a static library.
  14877. + allow_undefined=yes
  14878. + ;;
  14879. + *)
  14880. + allow_undefined=yes
  14881. + ;;
  14882. + esac
  14883. + libtool_args=$nonopt
  14884. + base_compile="$nonopt $@"
  14885. + compile_command=$nonopt
  14886. + finalize_command=$nonopt
  14887. +
  14888. + compile_rpath=
  14889. + finalize_rpath=
  14890. + compile_shlibpath=
  14891. + finalize_shlibpath=
  14892. + convenience=
  14893. + old_convenience=
  14894. + deplibs=
  14895. + old_deplibs=
  14896. + compiler_flags=
  14897. + linker_flags=
  14898. + dllsearchpath=
  14899. + lib_search_path=`pwd`
  14900. + inst_prefix_dir=
  14901. + new_inherited_linker_flags=
  14902. +
  14903. + avoid_version=no
  14904. + bindir=
  14905. + dlfiles=
  14906. + dlprefiles=
  14907. + dlself=no
  14908. + export_dynamic=no
  14909. + export_symbols=
  14910. + export_symbols_regex=
  14911. + generated=
  14912. + libobjs=
  14913. + ltlibs=
  14914. + module=no
  14915. + no_install=no
  14916. + objs=
  14917. + os2dllname=
  14918. + non_pic_objects=
  14919. + precious_files_regex=
  14920. + prefer_static_libs=no
  14921. + preload=false
  14922. + prev=
  14923. + prevarg=
  14924. + release=
  14925. + rpath=
  14926. + xrpath=
  14927. + perm_rpath=
  14928. + temp_rpath=
  14929. + thread_safe=no
  14930. + vinfo=
  14931. + vinfo_number=no
  14932. + weak_libs=
  14933. + single_module=$wl-single_module
  14934. + func_infer_tag $base_compile
  14935. +
  14936. + # We need to know -static, to get the right output filenames.
  14937. + for arg
  14938. + do
  14939. + case $arg in
  14940. + -shared)
  14941. + test yes != "$build_libtool_libs" \
  14942. + && func_fatal_configuration "cannot build a shared library"
  14943. + build_old_libs=no
  14944. + break
  14945. + ;;
  14946. + -all-static | -static | -static-libtool-libs)
  14947. + case $arg in
  14948. + -all-static)
  14949. + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
  14950. + func_warning "complete static linking is impossible in this configuration"
  14951. + fi
  14952. + if test -n "$link_static_flag"; then
  14953. + dlopen_self=$dlopen_self_static
  14954. + fi
  14955. + prefer_static_libs=yes
  14956. + ;;
  14957. + -static)
  14958. + if test -z "$pic_flag" && test -n "$link_static_flag"; then
  14959. + dlopen_self=$dlopen_self_static
  14960. + fi
  14961. + prefer_static_libs=built
  14962. + ;;
  14963. + -static-libtool-libs)
  14964. + if test -z "$pic_flag" && test -n "$link_static_flag"; then
  14965. + dlopen_self=$dlopen_self_static
  14966. + fi
  14967. + prefer_static_libs=yes
  14968. + ;;
  14969. + esac
  14970. + build_libtool_libs=no
  14971. + build_old_libs=yes
  14972. + break
  14973. + ;;
  14974. + esac
  14975. + done
  14976. +
  14977. + # See if our shared archives depend on static archives.
  14978. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  14979. +
  14980. + # Go through the arguments, transforming them on the way.
  14981. + while test "$#" -gt 0; do
  14982. + arg=$1
  14983. + shift
  14984. + func_quote_for_eval "$arg"
  14985. + qarg=$func_quote_for_eval_unquoted_result
  14986. + func_append libtool_args " $func_quote_for_eval_result"
  14987. +
  14988. + # If the previous option needs an argument, assign it.
  14989. + if test -n "$prev"; then
  14990. + case $prev in
  14991. + output)
  14992. + func_append compile_command " @OUTPUT@"
  14993. + func_append finalize_command " @OUTPUT@"
  14994. + ;;
  14995. + esac
  14996. +
  14997. + case $prev in
  14998. + bindir)
  14999. + bindir=$arg
  15000. + prev=
  15001. + continue
  15002. + ;;
  15003. + dlfiles|dlprefiles)
  15004. + $preload || {
  15005. + # Add the symbol object into the linking commands.
  15006. + func_append compile_command " @SYMFILE@"
  15007. + func_append finalize_command " @SYMFILE@"
  15008. + preload=:
  15009. + }
  15010. + case $arg in
  15011. + *.la | *.lo) ;; # We handle these cases below.
  15012. + force)
  15013. + if test no = "$dlself"; then
  15014. + dlself=needless
  15015. + export_dynamic=yes
  15016. + fi
  15017. + prev=
  15018. + continue
  15019. + ;;
  15020. + self)
  15021. + if test dlprefiles = "$prev"; then
  15022. + dlself=yes
  15023. + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
  15024. + dlself=yes
  15025. + else
  15026. + dlself=needless
  15027. + export_dynamic=yes
  15028. + fi
  15029. + prev=
  15030. + continue
  15031. + ;;
  15032. + *)
  15033. + if test dlfiles = "$prev"; then
  15034. + func_append dlfiles " $arg"
  15035. + else
  15036. + func_append dlprefiles " $arg"
  15037. + fi
  15038. + prev=
  15039. + continue
  15040. + ;;
  15041. + esac
  15042. + ;;
  15043. + expsyms)
  15044. + export_symbols=$arg
  15045. + test -f "$arg" \
  15046. + || func_fatal_error "symbol file '$arg' does not exist"
  15047. + prev=
  15048. + continue
  15049. + ;;
  15050. + expsyms_regex)
  15051. + export_symbols_regex=$arg
  15052. + prev=
  15053. + continue
  15054. + ;;
  15055. + framework)
  15056. + case $host in
  15057. + *-*-darwin*)
  15058. + case "$deplibs " in
  15059. + *" $qarg.ltframework "*) ;;
  15060. + *) func_append deplibs " $qarg.ltframework" # this is fixed later
  15061. + ;;
  15062. + esac
  15063. + ;;
  15064. + esac
  15065. + prev=
  15066. + continue
  15067. + ;;
  15068. + inst_prefix)
  15069. + inst_prefix_dir=$arg
  15070. + prev=
  15071. + continue
  15072. + ;;
  15073. + mllvm)
  15074. + # Clang does not use LLVM to link, so we can simply discard any
  15075. + # '-mllvm $arg' options when doing the link step.
  15076. + prev=
  15077. + continue
  15078. + ;;
  15079. + objectlist)
  15080. + if test -f "$arg"; then
  15081. + save_arg=$arg
  15082. + moreargs=
  15083. + for fil in `cat "$save_arg"`
  15084. + do
  15085. +# func_append moreargs " $fil"
  15086. + arg=$fil
  15087. + # A libtool-controlled object.
  15088. +
  15089. + # Check to see that this really is a libtool object.
  15090. + if func_lalib_unsafe_p "$arg"; then
  15091. + pic_object=
  15092. + non_pic_object=
  15093. +
  15094. + # Read the .lo file
  15095. + func_source "$arg"
  15096. +
  15097. + if test -z "$pic_object" ||
  15098. + test -z "$non_pic_object" ||
  15099. + test none = "$pic_object" &&
  15100. + test none = "$non_pic_object"; then
  15101. + func_fatal_error "cannot find name of object for '$arg'"
  15102. + fi
  15103. +
  15104. + # Extract subdirectory from the argument.
  15105. + func_dirname "$arg" "/" ""
  15106. + xdir=$func_dirname_result
  15107. +
  15108. + if test none != "$pic_object"; then
  15109. + # Prepend the subdirectory the object is found in.
  15110. + pic_object=$xdir$pic_object
  15111. +
  15112. + if test dlfiles = "$prev"; then
  15113. + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  15114. + func_append dlfiles " $pic_object"
  15115. + prev=
  15116. + continue
  15117. + else
  15118. + # If libtool objects are unsupported, then we need to preload.
  15119. + prev=dlprefiles
  15120. + fi
  15121. + fi
  15122. +
  15123. + # CHECK ME: I think I busted this. -Ossama
  15124. + if test dlprefiles = "$prev"; then
  15125. + # Preload the old-style object.
  15126. + func_append dlprefiles " $pic_object"
  15127. + prev=
  15128. + fi
  15129. +
  15130. + # A PIC object.
  15131. + func_append libobjs " $pic_object"
  15132. + arg=$pic_object
  15133. + fi
  15134. +
  15135. + # Non-PIC object.
  15136. + if test none != "$non_pic_object"; then
  15137. + # Prepend the subdirectory the object is found in.
  15138. + non_pic_object=$xdir$non_pic_object
  15139. +
  15140. + # A standard non-PIC object
  15141. + func_append non_pic_objects " $non_pic_object"
  15142. + if test -z "$pic_object" || test none = "$pic_object"; then
  15143. + arg=$non_pic_object
  15144. + fi
  15145. + else
  15146. + # If the PIC object exists, use it instead.
  15147. + # $xdir was prepended to $pic_object above.
  15148. + non_pic_object=$pic_object
  15149. + func_append non_pic_objects " $non_pic_object"
  15150. + fi
  15151. + else
  15152. + # Only an error if not doing a dry-run.
  15153. + if $opt_dry_run; then
  15154. + # Extract subdirectory from the argument.
  15155. + func_dirname "$arg" "/" ""
  15156. + xdir=$func_dirname_result
  15157. +
  15158. + func_lo2o "$arg"
  15159. + pic_object=$xdir$objdir/$func_lo2o_result
  15160. + non_pic_object=$xdir$func_lo2o_result
  15161. + func_append libobjs " $pic_object"
  15162. + func_append non_pic_objects " $non_pic_object"
  15163. + else
  15164. + func_fatal_error "'$arg' is not a valid libtool object"
  15165. + fi
  15166. + fi
  15167. + done
  15168. + else
  15169. + func_fatal_error "link input file '$arg' does not exist"
  15170. + fi
  15171. + arg=$save_arg
  15172. + prev=
  15173. + continue
  15174. + ;;
  15175. + os2dllname)
  15176. + os2dllname=$arg
  15177. + prev=
  15178. + continue
  15179. + ;;
  15180. + precious_regex)
  15181. + precious_files_regex=$arg
  15182. + prev=
  15183. + continue
  15184. + ;;
  15185. + release)
  15186. + release=-$arg
  15187. + prev=
  15188. + continue
  15189. + ;;
  15190. + rpath | xrpath)
  15191. + # We need an absolute path.
  15192. + case $arg in
  15193. + [\\/]* | [A-Za-z]:[\\/]*) ;;
  15194. + *)
  15195. + func_fatal_error "only absolute run-paths are allowed"
  15196. + ;;
  15197. + esac
  15198. + if test rpath = "$prev"; then
  15199. + case "$rpath " in
  15200. + *" $arg "*) ;;
  15201. + *) func_append rpath " $arg" ;;
  15202. + esac
  15203. + else
  15204. + case "$xrpath " in
  15205. + *" $arg "*) ;;
  15206. + *) func_append xrpath " $arg" ;;
  15207. + esac
  15208. + fi
  15209. + prev=
  15210. + continue
  15211. + ;;
  15212. + shrext)
  15213. + shrext_cmds=$arg
  15214. + prev=
  15215. + continue
  15216. + ;;
  15217. + weak)
  15218. + func_append weak_libs " $arg"
  15219. + prev=
  15220. + continue
  15221. + ;;
  15222. + xcclinker)
  15223. + func_append linker_flags " $qarg"
  15224. + func_append compiler_flags " $qarg"
  15225. + prev=
  15226. + func_append compile_command " $qarg"
  15227. + func_append finalize_command " $qarg"
  15228. + continue
  15229. + ;;
  15230. + xcompiler)
  15231. + func_append compiler_flags " $qarg"
  15232. + prev=
  15233. + func_append compile_command " $qarg"
  15234. + func_append finalize_command " $qarg"
  15235. + continue
  15236. + ;;
  15237. + xlinker)
  15238. + func_append linker_flags " $qarg"
  15239. + func_append compiler_flags " $wl$qarg"
  15240. + prev=
  15241. + func_append compile_command " $wl$qarg"
  15242. + func_append finalize_command " $wl$qarg"
  15243. + continue
  15244. + ;;
  15245. + *)
  15246. + eval "$prev=\"\$arg\""
  15247. + prev=
  15248. + continue
  15249. + ;;
  15250. + esac
  15251. + fi # test -n "$prev"
  15252. +
  15253. + prevarg=$arg
  15254. +
  15255. + case $arg in
  15256. + -all-static)
  15257. + if test -n "$link_static_flag"; then
  15258. + # See comment for -static flag below, for more details.
  15259. + func_append compile_command " $link_static_flag"
  15260. + func_append finalize_command " $link_static_flag"
  15261. + fi
  15262. + continue
  15263. + ;;
  15264. +
  15265. + -allow-undefined)
  15266. + # FIXME: remove this flag sometime in the future.
  15267. + func_fatal_error "'-allow-undefined' must not be used because it is the default"
  15268. + ;;
  15269. +
  15270. + -avoid-version)
  15271. + avoid_version=yes
  15272. + continue
  15273. + ;;
  15274. +
  15275. + -bindir)
  15276. + prev=bindir
  15277. + continue
  15278. + ;;
  15279. +
  15280. + -dlopen)
  15281. + prev=dlfiles
  15282. + continue
  15283. + ;;
  15284. +
  15285. + -dlpreopen)
  15286. + prev=dlprefiles
  15287. + continue
  15288. + ;;
  15289. +
  15290. + -export-dynamic)
  15291. + export_dynamic=yes
  15292. + continue
  15293. + ;;
  15294. +
  15295. + -export-symbols | -export-symbols-regex)
  15296. + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  15297. + func_fatal_error "more than one -exported-symbols argument is not allowed"
  15298. + fi
  15299. + if test X-export-symbols = "X$arg"; then
  15300. + prev=expsyms
  15301. + else
  15302. + prev=expsyms_regex
  15303. + fi
  15304. + continue
  15305. + ;;
  15306. +
  15307. + -framework)
  15308. + prev=framework
  15309. + continue
  15310. + ;;
  15311. +
  15312. + -inst-prefix-dir)
  15313. + prev=inst_prefix
  15314. + continue
  15315. + ;;
  15316. +
  15317. + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  15318. + # so, if we see these flags be careful not to treat them like -L
  15319. + -L[A-Z][A-Z]*:*)
  15320. + case $with_gcc/$host in
  15321. + no/*-*-irix* | /*-*-irix*)
  15322. + func_append compile_command " $arg"
  15323. + func_append finalize_command " $arg"
  15324. + ;;
  15325. + esac
  15326. + continue
  15327. + ;;
  15328. +
  15329. + -L*)
  15330. + func_stripname "-L" '' "$arg"
  15331. + if test -z "$func_stripname_result"; then
  15332. + if test "$#" -gt 0; then
  15333. + func_fatal_error "require no space between '-L' and '$1'"
  15334. + else
  15335. + func_fatal_error "need path for '-L' option"
  15336. + fi
  15337. + fi
  15338. + func_resolve_sysroot "$func_stripname_result"
  15339. + dir=$func_resolve_sysroot_result
  15340. + # We need an absolute path.
  15341. + case $dir in
  15342. + [\\/]* | [A-Za-z]:[\\/]*) ;;
  15343. + *)
  15344. + absdir=`cd "$dir" && pwd`
  15345. + test -z "$absdir" && \
  15346. + func_fatal_error "cannot determine absolute directory name of '$dir'"
  15347. + dir=$absdir
  15348. + ;;
  15349. + esac
  15350. + case "$deplibs " in
  15351. + *" -L$dir "* | *" $arg "*)
  15352. + # Will only happen for absolute or sysroot arguments
  15353. + ;;
  15354. + *)
  15355. + # Preserve sysroot, but never include relative directories
  15356. + case $dir in
  15357. + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
  15358. + *) func_append deplibs " -L$dir" ;;
  15359. + esac
  15360. + func_append lib_search_path " $dir"
  15361. + ;;
  15362. + esac
  15363. + case $host in
  15364. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  15365. + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
  15366. + case :$dllsearchpath: in
  15367. + *":$dir:"*) ;;
  15368. + ::) dllsearchpath=$dir;;
  15369. + *) func_append dllsearchpath ":$dir";;
  15370. + esac
  15371. + case :$dllsearchpath: in
  15372. + *":$testbindir:"*) ;;
  15373. + ::) dllsearchpath=$testbindir;;
  15374. + *) func_append dllsearchpath ":$testbindir";;
  15375. + esac
  15376. + ;;
  15377. + esac
  15378. + continue
  15379. + ;;
  15380. +
  15381. + -l*)
  15382. + if test X-lc = "X$arg" || test X-lm = "X$arg"; then
  15383. + case $host in
  15384. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
  15385. + # These systems don't actually have a C or math library (as such)
  15386. + continue
  15387. + ;;
  15388. + *-*-os2*)
  15389. + # These systems don't actually have a C library (as such)
  15390. + test X-lc = "X$arg" && continue
  15391. + ;;
  15392. + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  15393. + # Do not include libc due to us having libc/libc_r.
  15394. + test X-lc = "X$arg" && continue
  15395. + ;;
  15396. + *-*-rhapsody* | *-*-darwin1.[012])
  15397. + # Rhapsody C and math libraries are in the System framework
  15398. + func_append deplibs " System.ltframework"
  15399. + continue
  15400. + ;;
  15401. + *-*-sco3.2v5* | *-*-sco5v6*)
  15402. + # Causes problems with __ctype
  15403. + test X-lc = "X$arg" && continue
  15404. + ;;
  15405. + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  15406. + # Compiler inserts libc in the correct place for threads to work
  15407. + test X-lc = "X$arg" && continue
  15408. + ;;
  15409. + esac
  15410. + elif test X-lc_r = "X$arg"; then
  15411. + case $host in
  15412. + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  15413. + # Do not include libc_r directly, use -pthread flag.
  15414. + continue
  15415. + ;;
  15416. + esac
  15417. + fi
  15418. + func_append deplibs " $arg"
  15419. + continue
  15420. + ;;
  15421. +
  15422. + -mllvm)
  15423. + prev=mllvm
  15424. + continue
  15425. + ;;
  15426. +
  15427. + -module)
  15428. + module=yes
  15429. + continue
  15430. + ;;
  15431. +
  15432. + # Tru64 UNIX uses -model [arg] to determine the layout of C++
  15433. + # classes, name mangling, and exception handling.
  15434. + # Darwin uses the -arch flag to determine output architecture.
  15435. + -model|-arch|-isysroot|--sysroot)
  15436. + func_append compiler_flags " $arg"
  15437. + func_append compile_command " $arg"
  15438. + func_append finalize_command " $arg"
  15439. + prev=xcompiler
  15440. + continue
  15441. + ;;
  15442. +
  15443. + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  15444. + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  15445. + func_append compiler_flags " $arg"
  15446. + func_append compile_command " $arg"
  15447. + func_append finalize_command " $arg"
  15448. + case "$new_inherited_linker_flags " in
  15449. + *" $arg "*) ;;
  15450. + * ) func_append new_inherited_linker_flags " $arg" ;;
  15451. + esac
  15452. + continue
  15453. + ;;
  15454. +
  15455. + -multi_module)
  15456. + single_module=$wl-multi_module
  15457. + continue
  15458. + ;;
  15459. +
  15460. + -no-fast-install)
  15461. + fast_install=no
  15462. + continue
  15463. + ;;
  15464. +
  15465. + -no-install)
  15466. + case $host in
  15467. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  15468. + # The PATH hackery in wrapper scripts is required on Windows
  15469. + # and Darwin in order for the loader to find any dlls it needs.
  15470. + func_warning "'-no-install' is ignored for $host"
  15471. + func_warning "assuming '-no-fast-install' instead"
  15472. + fast_install=no
  15473. + ;;
  15474. + *) no_install=yes ;;
  15475. + esac
  15476. + continue
  15477. + ;;
  15478. +
  15479. + -no-undefined)
  15480. + allow_undefined=no
  15481. + continue
  15482. + ;;
  15483. +
  15484. + -objectlist)
  15485. + prev=objectlist
  15486. + continue
  15487. + ;;
  15488. +
  15489. + -os2dllname)
  15490. + prev=os2dllname
  15491. + continue
  15492. + ;;
  15493. +
  15494. + -o) prev=output ;;
  15495. +
  15496. + -precious-files-regex)
  15497. + prev=precious_regex
  15498. + continue
  15499. + ;;
  15500. +
  15501. + -release)
  15502. + prev=release
  15503. + continue
  15504. + ;;
  15505. +
  15506. + -rpath)
  15507. + prev=rpath
  15508. + continue
  15509. + ;;
  15510. +
  15511. + -R)
  15512. + prev=xrpath
  15513. + continue
  15514. + ;;
  15515. +
  15516. + -R*)
  15517. + func_stripname '-R' '' "$arg"
  15518. + dir=$func_stripname_result
  15519. + # We need an absolute path.
  15520. + case $dir in
  15521. + [\\/]* | [A-Za-z]:[\\/]*) ;;
  15522. + =*)
  15523. + func_stripname '=' '' "$dir"
  15524. + dir=$lt_sysroot$func_stripname_result
  15525. + ;;
  15526. + *)
  15527. + func_fatal_error "only absolute run-paths are allowed"
  15528. + ;;
  15529. + esac
  15530. + case "$xrpath " in
  15531. + *" $dir "*) ;;
  15532. + *) func_append xrpath " $dir" ;;
  15533. + esac
  15534. + continue
  15535. + ;;
  15536. +
  15537. + -shared)
  15538. + # The effects of -shared are defined in a previous loop.
  15539. + continue
  15540. + ;;
  15541. +
  15542. + -shrext)
  15543. + prev=shrext
  15544. + continue
  15545. + ;;
  15546. +
  15547. + -static | -static-libtool-libs)
  15548. + # The effects of -static are defined in a previous loop.
  15549. + # We used to do the same as -all-static on platforms that
  15550. + # didn't have a PIC flag, but the assumption that the effects
  15551. + # would be equivalent was wrong. It would break on at least
  15552. + # Digital Unix and AIX.
  15553. + continue
  15554. + ;;
  15555. +
  15556. + -thread-safe)
  15557. + thread_safe=yes
  15558. + continue
  15559. + ;;
  15560. +
  15561. + -version-info)
  15562. + prev=vinfo
  15563. + continue
  15564. + ;;
  15565. +
  15566. + -version-number)
  15567. + prev=vinfo
  15568. + vinfo_number=yes
  15569. + continue
  15570. + ;;
  15571. +
  15572. + -weak)
  15573. + prev=weak
  15574. + continue
  15575. + ;;
  15576. +
  15577. + -Wc,*)
  15578. + func_stripname '-Wc,' '' "$arg"
  15579. + args=$func_stripname_result
  15580. + arg=
  15581. + save_ifs=$IFS; IFS=,
  15582. + for flag in $args; do
  15583. + IFS=$save_ifs
  15584. + func_quote_for_eval "$flag"
  15585. + func_append arg " $func_quote_for_eval_result"
  15586. + func_append compiler_flags " $func_quote_for_eval_result"
  15587. + done
  15588. + IFS=$save_ifs
  15589. + func_stripname ' ' '' "$arg"
  15590. + arg=$func_stripname_result
  15591. + ;;
  15592. +
  15593. + -Wl,*)
  15594. + func_stripname '-Wl,' '' "$arg"
  15595. + args=$func_stripname_result
  15596. + arg=
  15597. + save_ifs=$IFS; IFS=,
  15598. + for flag in $args; do
  15599. + IFS=$save_ifs
  15600. + func_quote_for_eval "$flag"
  15601. + func_append arg " $wl$func_quote_for_eval_result"
  15602. + func_append compiler_flags " $wl$func_quote_for_eval_result"
  15603. + func_append linker_flags " $func_quote_for_eval_result"
  15604. + done
  15605. + IFS=$save_ifs
  15606. + func_stripname ' ' '' "$arg"
  15607. + arg=$func_stripname_result
  15608. + ;;
  15609. +
  15610. + -Xcompiler)
  15611. + prev=xcompiler
  15612. + continue
  15613. + ;;
  15614. +
  15615. + -Xlinker)
  15616. + prev=xlinker
  15617. + continue
  15618. + ;;
  15619. +
  15620. + -XCClinker)
  15621. + prev=xcclinker
  15622. + continue
  15623. + ;;
  15624. +
  15625. + # -msg_* for osf cc
  15626. + -msg_*)
  15627. + func_quote_for_eval "$arg"
  15628. + arg=$func_quote_for_eval_result
  15629. + ;;
  15630. +
  15631. + # Flags to be passed through unchanged, with rationale:
  15632. + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
  15633. + # -r[0-9][0-9]* specify processor for the SGI compiler
  15634. + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
  15635. + # +DA*, +DD* enable 64-bit mode for the HP compiler
  15636. + # -q* compiler args for the IBM compiler
  15637. + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
  15638. + # -F/path path to uninstalled frameworks, gcc on darwin
  15639. + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
  15640. + # -fstack-protector* stack protector flags for GCC
  15641. + # @file GCC response files
  15642. + # -tp=* Portland pgcc target processor selection
  15643. + # --sysroot=* for sysroot support
  15644. + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
  15645. + # -specs=* GCC specs files
  15646. + # -stdlib=* select c++ std lib with clang
  15647. + # -fsanitize=* Clang/GCC memory and address sanitizer
  15648. + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  15649. + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
  15650. + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
  15651. + -specs=*|-fsanitize=*)
  15652. + func_quote_for_eval "$arg"
  15653. + arg=$func_quote_for_eval_result
  15654. + func_append compile_command " $arg"
  15655. + func_append finalize_command " $arg"
  15656. + func_append compiler_flags " $arg"
  15657. + continue
  15658. + ;;
  15659. +
  15660. + -Z*)
  15661. + if test os2 = "`expr $host : '.*\(os2\)'`"; then
  15662. + # OS/2 uses -Zxxx to specify OS/2-specific options
  15663. + compiler_flags="$compiler_flags $arg"
  15664. + func_append compile_command " $arg"
  15665. + func_append finalize_command " $arg"
  15666. + case $arg in
  15667. + -Zlinker | -Zstack)
  15668. + prev=xcompiler
  15669. + ;;
  15670. + esac
  15671. + continue
  15672. + else
  15673. + # Otherwise treat like 'Some other compiler flag' below
  15674. + func_quote_for_eval "$arg"
  15675. + arg=$func_quote_for_eval_result
  15676. + fi
  15677. + ;;
  15678. +
  15679. + # Some other compiler flag.
  15680. + -* | +*)
  15681. + func_quote_for_eval "$arg"
  15682. + arg=$func_quote_for_eval_result
  15683. + ;;
  15684. +
  15685. + *.$objext)
  15686. + # A standard object.
  15687. + func_append objs " $arg"
  15688. + ;;
  15689. +
  15690. + *.lo)
  15691. + # A libtool-controlled object.
  15692. +
  15693. + # Check to see that this really is a libtool object.
  15694. + if func_lalib_unsafe_p "$arg"; then
  15695. + pic_object=
  15696. + non_pic_object=
  15697. +
  15698. + # Read the .lo file
  15699. + func_source "$arg"
  15700. +
  15701. + if test -z "$pic_object" ||
  15702. + test -z "$non_pic_object" ||
  15703. + test none = "$pic_object" &&
  15704. + test none = "$non_pic_object"; then
  15705. + func_fatal_error "cannot find name of object for '$arg'"
  15706. + fi
  15707. +
  15708. + # Extract subdirectory from the argument.
  15709. + func_dirname "$arg" "/" ""
  15710. + xdir=$func_dirname_result
  15711. +
  15712. + test none = "$pic_object" || {
  15713. + # Prepend the subdirectory the object is found in.
  15714. + pic_object=$xdir$pic_object
  15715. +
  15716. + if test dlfiles = "$prev"; then
  15717. + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  15718. + func_append dlfiles " $pic_object"
  15719. + prev=
  15720. + continue
  15721. + else
  15722. + # If libtool objects are unsupported, then we need to preload.
  15723. + prev=dlprefiles
  15724. + fi
  15725. + fi
  15726. +
  15727. + # CHECK ME: I think I busted this. -Ossama
  15728. + if test dlprefiles = "$prev"; then
  15729. + # Preload the old-style object.
  15730. + func_append dlprefiles " $pic_object"
  15731. + prev=
  15732. + fi
  15733. +
  15734. + # A PIC object.
  15735. + func_append libobjs " $pic_object"
  15736. + arg=$pic_object
  15737. + }
  15738. +
  15739. + # Non-PIC object.
  15740. + if test none != "$non_pic_object"; then
  15741. + # Prepend the subdirectory the object is found in.
  15742. + non_pic_object=$xdir$non_pic_object
  15743. +
  15744. + # A standard non-PIC object
  15745. + func_append non_pic_objects " $non_pic_object"
  15746. + if test -z "$pic_object" || test none = "$pic_object"; then
  15747. + arg=$non_pic_object
  15748. + fi
  15749. + else
  15750. + # If the PIC object exists, use it instead.
  15751. + # $xdir was prepended to $pic_object above.
  15752. + non_pic_object=$pic_object
  15753. + func_append non_pic_objects " $non_pic_object"
  15754. + fi
  15755. + else
  15756. + # Only an error if not doing a dry-run.
  15757. + if $opt_dry_run; then
  15758. + # Extract subdirectory from the argument.
  15759. + func_dirname "$arg" "/" ""
  15760. + xdir=$func_dirname_result
  15761. +
  15762. + func_lo2o "$arg"
  15763. + pic_object=$xdir$objdir/$func_lo2o_result
  15764. + non_pic_object=$xdir$func_lo2o_result
  15765. + func_append libobjs " $pic_object"
  15766. + func_append non_pic_objects " $non_pic_object"
  15767. + else
  15768. + func_fatal_error "'$arg' is not a valid libtool object"
  15769. + fi
  15770. + fi
  15771. + ;;
  15772. +
  15773. + *.$libext)
  15774. + # An archive.
  15775. + func_append deplibs " $arg"
  15776. + func_append old_deplibs " $arg"
  15777. + continue
  15778. + ;;
  15779. +
  15780. + *.la)
  15781. + # A libtool-controlled library.
  15782. +
  15783. + func_resolve_sysroot "$arg"
  15784. + if test dlfiles = "$prev"; then
  15785. + # This library was specified with -dlopen.
  15786. + func_append dlfiles " $func_resolve_sysroot_result"
  15787. + prev=
  15788. + elif test dlprefiles = "$prev"; then
  15789. + # The library was specified with -dlpreopen.
  15790. + func_append dlprefiles " $func_resolve_sysroot_result"
  15791. + prev=
  15792. + else
  15793. + func_append deplibs " $func_resolve_sysroot_result"
  15794. + fi
  15795. + continue
  15796. + ;;
  15797. +
  15798. + # Some other compiler argument.
  15799. + *)
  15800. + # Unknown arguments in both finalize_command and compile_command need
  15801. + # to be aesthetically quoted because they are evaled later.
  15802. + func_quote_for_eval "$arg"
  15803. + arg=$func_quote_for_eval_result
  15804. + ;;
  15805. + esac # arg
  15806. +
  15807. + # Now actually substitute the argument into the commands.
  15808. + if test -n "$arg"; then
  15809. + func_append compile_command " $arg"
  15810. + func_append finalize_command " $arg"
  15811. + fi
  15812. + done # argument parsing loop
  15813. +
  15814. + test -n "$prev" && \
  15815. + func_fatal_help "the '$prevarg' option requires an argument"
  15816. +
  15817. + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
  15818. + eval arg=\"$export_dynamic_flag_spec\"
  15819. + func_append compile_command " $arg"
  15820. + func_append finalize_command " $arg"
  15821. + fi
  15822. +
  15823. + oldlibs=
  15824. + # calculate the name of the file, without its directory
  15825. + func_basename "$output"
  15826. + outputname=$func_basename_result
  15827. + libobjs_save=$libobjs
  15828. +
  15829. + if test -n "$shlibpath_var"; then
  15830. + # get the directories listed in $shlibpath_var
  15831. + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
  15832. + else
  15833. + shlib_search_path=
  15834. + fi
  15835. + eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  15836. + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  15837. +
  15838. + # Definition is injected by LT_CONFIG during libtool generation.
  15839. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
  15840. +
  15841. + func_dirname "$output" "/" ""
  15842. + output_objdir=$func_dirname_result$objdir
  15843. + func_to_tool_file "$output_objdir/"
  15844. + tool_output_objdir=$func_to_tool_file_result
  15845. + # Create the object directory.
  15846. + func_mkdir_p "$output_objdir"
  15847. +
  15848. + # Determine the type of output
  15849. + case $output in
  15850. + "")
  15851. + func_fatal_help "you must specify an output file"
  15852. + ;;
  15853. + *.$libext) linkmode=oldlib ;;
  15854. + *.lo | *.$objext) linkmode=obj ;;
  15855. + *.la) linkmode=lib ;;
  15856. + *) linkmode=prog ;; # Anything else should be a program.
  15857. + esac
  15858. +
  15859. + specialdeplibs=
  15860. +
  15861. + libs=
  15862. + # Find all interdependent deplibs by searching for libraries
  15863. + # that are linked more than once (e.g. -la -lb -la)
  15864. + for deplib in $deplibs; do
  15865. + if $opt_preserve_dup_deps; then
  15866. + case "$libs " in
  15867. + *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  15868. + esac
  15869. + fi
  15870. + func_append libs " $deplib"
  15871. + done
  15872. +
  15873. + if test lib = "$linkmode"; then
  15874. + libs="$predeps $libs $compiler_lib_search_path $postdeps"
  15875. +
  15876. + # Compute libraries that are listed more than once in $predeps
  15877. + # $postdeps and mark them as special (i.e., whose duplicates are
  15878. + # not to be eliminated).
  15879. + pre_post_deps=
  15880. + if $opt_duplicate_compiler_generated_deps; then
  15881. + for pre_post_dep in $predeps $postdeps; do
  15882. + case "$pre_post_deps " in
  15883. + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
  15884. + esac
  15885. + func_append pre_post_deps " $pre_post_dep"
  15886. + done
  15887. + fi
  15888. + pre_post_deps=
  15889. + fi
  15890. +
  15891. + deplibs=
  15892. + newdependency_libs=
  15893. + newlib_search_path=
  15894. + need_relink=no # whether we're linking any uninstalled libtool libraries
  15895. + notinst_deplibs= # not-installed libtool libraries
  15896. + notinst_path= # paths that contain not-installed libtool libraries
  15897. +
  15898. + case $linkmode in
  15899. + lib)
  15900. + passes="conv dlpreopen link"
  15901. + for file in $dlfiles $dlprefiles; do
  15902. + case $file in
  15903. + *.la) ;;
  15904. + *)
  15905. + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
  15906. + ;;
  15907. + esac
  15908. + done
  15909. + ;;
  15910. + prog)
  15911. + compile_deplibs=
  15912. + finalize_deplibs=
  15913. + alldeplibs=false
  15914. + newdlfiles=
  15915. + newdlprefiles=
  15916. + passes="conv scan dlopen dlpreopen link"
  15917. + ;;
  15918. + *) passes="conv"
  15919. + ;;
  15920. + esac
  15921. +
  15922. + for pass in $passes; do
  15923. + # The preopen pass in lib mode reverses $deplibs; put it back here
  15924. + # so that -L comes before libs that need it for instance...
  15925. + if test lib,link = "$linkmode,$pass"; then
  15926. + ## FIXME: Find the place where the list is rebuilt in the wrong
  15927. + ## order, and fix it there properly
  15928. + tmp_deplibs=
  15929. + for deplib in $deplibs; do
  15930. + tmp_deplibs="$deplib $tmp_deplibs"
  15931. + done
  15932. + deplibs=$tmp_deplibs
  15933. + fi
  15934. +
  15935. + if test lib,link = "$linkmode,$pass" ||
  15936. + test prog,scan = "$linkmode,$pass"; then
  15937. + libs=$deplibs
  15938. + deplibs=
  15939. + fi
  15940. + if test prog = "$linkmode"; then
  15941. + case $pass in
  15942. + dlopen) libs=$dlfiles ;;
  15943. + dlpreopen) libs=$dlprefiles ;;
  15944. + link)
  15945. + libs="$deplibs %DEPLIBS%"
  15946. + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
  15947. + ;;
  15948. + esac
  15949. + fi
  15950. + if test lib,dlpreopen = "$linkmode,$pass"; then
  15951. + # Collect and forward deplibs of preopened libtool libs
  15952. + for lib in $dlprefiles; do
  15953. + # Ignore non-libtool-libs
  15954. + dependency_libs=
  15955. + func_resolve_sysroot "$lib"
  15956. + case $lib in
  15957. + *.la) func_source "$func_resolve_sysroot_result" ;;
  15958. + esac
  15959. +
  15960. + # Collect preopened libtool deplibs, except any this library
  15961. + # has declared as weak libs
  15962. + for deplib in $dependency_libs; do
  15963. + func_basename "$deplib"
  15964. + deplib_base=$func_basename_result
  15965. + case " $weak_libs " in
  15966. + *" $deplib_base "*) ;;
  15967. + *) func_append deplibs " $deplib" ;;
  15968. + esac
  15969. + done
  15970. + done
  15971. + libs=$dlprefiles
  15972. + fi
  15973. + if test dlopen = "$pass"; then
  15974. + # Collect dlpreopened libraries
  15975. + save_deplibs=$deplibs
  15976. + deplibs=
  15977. + fi
  15978. +
  15979. + for deplib in $libs; do
  15980. + lib=
  15981. + found=false
  15982. + case $deplib in
  15983. + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  15984. + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  15985. + if test prog,link = "$linkmode,$pass"; then
  15986. + compile_deplibs="$deplib $compile_deplibs"
  15987. + finalize_deplibs="$deplib $finalize_deplibs"
  15988. + else
  15989. + func_append compiler_flags " $deplib"
  15990. + if test lib = "$linkmode"; then
  15991. + case "$new_inherited_linker_flags " in
  15992. + *" $deplib "*) ;;
  15993. + * ) func_append new_inherited_linker_flags " $deplib" ;;
  15994. + esac
  15995. + fi
  15996. + fi
  15997. + continue
  15998. + ;;
  15999. + -l*)
  16000. + if test lib != "$linkmode" && test prog != "$linkmode"; then
  16001. + func_warning "'-l' is ignored for archives/objects"
  16002. + continue
  16003. + fi
  16004. + func_stripname '-l' '' "$deplib"
  16005. + name=$func_stripname_result
  16006. + if test lib = "$linkmode"; then
  16007. + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  16008. + else
  16009. + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  16010. + fi
  16011. + for searchdir in $searchdirs; do
  16012. + for search_ext in .la $std_shrext .so .a; do
  16013. + # Search the libtool library
  16014. + lib=$searchdir/lib$name$search_ext
  16015. + if test -f "$lib"; then
  16016. + if test .la = "$search_ext"; then
  16017. + found=:
  16018. + else
  16019. + found=false
  16020. + fi
  16021. + break 2
  16022. + fi
  16023. + done
  16024. + done
  16025. + if $found; then
  16026. + # deplib is a libtool library
  16027. + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  16028. + # We need to do some special things here, and not later.
  16029. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  16030. + case " $predeps $postdeps " in
  16031. + *" $deplib "*)
  16032. + if func_lalib_p "$lib"; then
  16033. + library_names=
  16034. + old_library=
  16035. + func_source "$lib"
  16036. + for l in $old_library $library_names; do
  16037. + ll=$l
  16038. + done
  16039. + if test "X$ll" = "X$old_library"; then # only static version available
  16040. + found=false
  16041. + func_dirname "$lib" "" "."
  16042. + ladir=$func_dirname_result
  16043. + lib=$ladir/$old_library
  16044. + if test prog,link = "$linkmode,$pass"; then
  16045. + compile_deplibs="$deplib $compile_deplibs"
  16046. + finalize_deplibs="$deplib $finalize_deplibs"
  16047. + else
  16048. + deplibs="$deplib $deplibs"
  16049. + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  16050. + fi
  16051. + continue
  16052. + fi
  16053. + fi
  16054. + ;;
  16055. + *) ;;
  16056. + esac
  16057. + fi
  16058. + else
  16059. + # deplib doesn't seem to be a libtool library
  16060. + if test prog,link = "$linkmode,$pass"; then
  16061. + compile_deplibs="$deplib $compile_deplibs"
  16062. + finalize_deplibs="$deplib $finalize_deplibs"
  16063. + else
  16064. + deplibs="$deplib $deplibs"
  16065. + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  16066. + fi
  16067. + continue
  16068. + fi
  16069. + ;; # -l
  16070. + *.ltframework)
  16071. + if test prog,link = "$linkmode,$pass"; then
  16072. + compile_deplibs="$deplib $compile_deplibs"
  16073. + finalize_deplibs="$deplib $finalize_deplibs"
  16074. + else
  16075. + deplibs="$deplib $deplibs"
  16076. + if test lib = "$linkmode"; then
  16077. + case "$new_inherited_linker_flags " in
  16078. + *" $deplib "*) ;;
  16079. + * ) func_append new_inherited_linker_flags " $deplib" ;;
  16080. + esac
  16081. + fi
  16082. + fi
  16083. + continue
  16084. + ;;
  16085. + -L*)
  16086. + case $linkmode in
  16087. + lib)
  16088. + deplibs="$deplib $deplibs"
  16089. + test conv = "$pass" && continue
  16090. + newdependency_libs="$deplib $newdependency_libs"
  16091. + func_stripname '-L' '' "$deplib"
  16092. + func_resolve_sysroot "$func_stripname_result"
  16093. + func_append newlib_search_path " $func_resolve_sysroot_result"
  16094. + ;;
  16095. + prog)
  16096. + if test conv = "$pass"; then
  16097. + deplibs="$deplib $deplibs"
  16098. + continue
  16099. + fi
  16100. + if test scan = "$pass"; then
  16101. + deplibs="$deplib $deplibs"
  16102. + else
  16103. + compile_deplibs="$deplib $compile_deplibs"
  16104. + finalize_deplibs="$deplib $finalize_deplibs"
  16105. + fi
  16106. + func_stripname '-L' '' "$deplib"
  16107. + func_resolve_sysroot "$func_stripname_result"
  16108. + func_append newlib_search_path " $func_resolve_sysroot_result"
  16109. + ;;
  16110. + *)
  16111. + func_warning "'-L' is ignored for archives/objects"
  16112. + ;;
  16113. + esac # linkmode
  16114. + continue
  16115. + ;; # -L
  16116. + -R*)
  16117. + if test link = "$pass"; then
  16118. + func_stripname '-R' '' "$deplib"
  16119. + func_resolve_sysroot "$func_stripname_result"
  16120. + dir=$func_resolve_sysroot_result
  16121. + # Make sure the xrpath contains only unique directories.
  16122. + case "$xrpath " in
  16123. + *" $dir "*) ;;
  16124. + *) func_append xrpath " $dir" ;;
  16125. + esac
  16126. + fi
  16127. + deplibs="$deplib $deplibs"
  16128. + continue
  16129. + ;;
  16130. + *.la)
  16131. + func_resolve_sysroot "$deplib"
  16132. + lib=$func_resolve_sysroot_result
  16133. + ;;
  16134. + *.$libext)
  16135. + if test conv = "$pass"; then
  16136. + deplibs="$deplib $deplibs"
  16137. + continue
  16138. + fi
  16139. + case $linkmode in
  16140. + lib)
  16141. + # Linking convenience modules into shared libraries is allowed,
  16142. + # but linking other static libraries is non-portable.
  16143. + case " $dlpreconveniencelibs " in
  16144. + *" $deplib "*) ;;
  16145. + *)
  16146. + valid_a_lib=false
  16147. + case $deplibs_check_method in
  16148. + match_pattern*)
  16149. + set dummy $deplibs_check_method; shift
  16150. + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  16151. + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
  16152. + | $EGREP "$match_pattern_regex" > /dev/null; then
  16153. + valid_a_lib=:
  16154. + fi
  16155. + ;;
  16156. + pass_all)
  16157. + valid_a_lib=:
  16158. + ;;
  16159. + esac
  16160. + if $valid_a_lib; then
  16161. + echo
  16162. + $ECHO "*** Warning: Linking the shared library $output against the"
  16163. + $ECHO "*** static library $deplib is not portable!"
  16164. + deplibs="$deplib $deplibs"
  16165. + else
  16166. + echo
  16167. + $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  16168. + echo "*** I have the capability to make that library automatically link in when"
  16169. + echo "*** you link to this library. But I can only do this if you have a"
  16170. + echo "*** shared version of the library, which you do not appear to have"
  16171. + echo "*** because the file extensions .$libext of this argument makes me believe"
  16172. + echo "*** that it is just a static archive that I should not use here."
  16173. + fi
  16174. + ;;
  16175. + esac
  16176. + continue
  16177. + ;;
  16178. + prog)
  16179. + if test link != "$pass"; then
  16180. + deplibs="$deplib $deplibs"
  16181. + else
  16182. + compile_deplibs="$deplib $compile_deplibs"
  16183. + finalize_deplibs="$deplib $finalize_deplibs"
  16184. + fi
  16185. + continue
  16186. + ;;
  16187. + esac # linkmode
  16188. + ;; # *.$libext
  16189. + *.lo | *.$objext)
  16190. + if test conv = "$pass"; then
  16191. + deplibs="$deplib $deplibs"
  16192. + elif test prog = "$linkmode"; then
  16193. + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
  16194. + # If there is no dlopen support or we're linking statically,
  16195. + # we need to preload.
  16196. + func_append newdlprefiles " $deplib"
  16197. + compile_deplibs="$deplib $compile_deplibs"
  16198. + finalize_deplibs="$deplib $finalize_deplibs"
  16199. + else
  16200. + func_append newdlfiles " $deplib"
  16201. + fi
  16202. + fi
  16203. + continue
  16204. + ;;
  16205. + %DEPLIBS%)
  16206. + alldeplibs=:
  16207. + continue
  16208. + ;;
  16209. + esac # case $deplib
  16210. +
  16211. + $found || test -f "$lib" \
  16212. + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
  16213. +
  16214. + # Check to see that this really is a libtool archive.
  16215. + func_lalib_unsafe_p "$lib" \
  16216. + || func_fatal_error "'$lib' is not a valid libtool archive"
  16217. +
  16218. + func_dirname "$lib" "" "."
  16219. + ladir=$func_dirname_result
  16220. +
  16221. + dlname=
  16222. + dlopen=
  16223. + dlpreopen=
  16224. + libdir=
  16225. + library_names=
  16226. + old_library=
  16227. + inherited_linker_flags=
  16228. + # If the library was installed with an old release of libtool,
  16229. + # it will not redefine variables installed, or shouldnotlink
  16230. + installed=yes
  16231. + shouldnotlink=no
  16232. + avoidtemprpath=
  16233. +
  16234. +
  16235. + # Read the .la file
  16236. + func_source "$lib"
  16237. +
  16238. + # Convert "-framework foo" to "foo.ltframework"
  16239. + if test -n "$inherited_linker_flags"; then
  16240. + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
  16241. + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  16242. + case " $new_inherited_linker_flags " in
  16243. + *" $tmp_inherited_linker_flag "*) ;;
  16244. + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
  16245. + esac
  16246. + done
  16247. + fi
  16248. + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  16249. + if test lib,link = "$linkmode,$pass" ||
  16250. + test prog,scan = "$linkmode,$pass" ||
  16251. + { test prog != "$linkmode" && test lib != "$linkmode"; }; then
  16252. + test -n "$dlopen" && func_append dlfiles " $dlopen"
  16253. + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
  16254. + fi
  16255. +
  16256. + if test conv = "$pass"; then
  16257. + # Only check for convenience libraries
  16258. + deplibs="$lib $deplibs"
  16259. + if test -z "$libdir"; then
  16260. + if test -z "$old_library"; then
  16261. + func_fatal_error "cannot find name of link library for '$lib'"
  16262. + fi
  16263. + # It is a libtool convenience library, so add in its objects.
  16264. + func_append convenience " $ladir/$objdir/$old_library"
  16265. + func_append old_convenience " $ladir/$objdir/$old_library"
  16266. + tmp_libs=
  16267. + for deplib in $dependency_libs; do
  16268. + deplibs="$deplib $deplibs"
  16269. + if $opt_preserve_dup_deps; then
  16270. + case "$tmp_libs " in
  16271. + *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  16272. + esac
  16273. + fi
  16274. + func_append tmp_libs " $deplib"
  16275. + done
  16276. + elif test prog != "$linkmode" && test lib != "$linkmode"; then
  16277. + func_fatal_error "'$lib' is not a convenience library"
  16278. + fi
  16279. + continue
  16280. + fi # $pass = conv
  16281. +
  16282. +
  16283. + # Get the name of the library we link against.
  16284. + linklib=
  16285. + if test -n "$old_library" &&
  16286. + { test yes = "$prefer_static_libs" ||
  16287. + test built,no = "$prefer_static_libs,$installed"; }; then
  16288. + linklib=$old_library
  16289. + else
  16290. + for l in $old_library $library_names; do
  16291. + linklib=$l
  16292. + done
  16293. + fi
  16294. + if test -z "$linklib"; then
  16295. + func_fatal_error "cannot find name of link library for '$lib'"
  16296. + fi
  16297. +
  16298. + # This library was specified with -dlopen.
  16299. + if test dlopen = "$pass"; then
  16300. + test -z "$libdir" \
  16301. + && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
  16302. + if test -z "$dlname" ||
  16303. + test yes != "$dlopen_support" ||
  16304. + test no = "$build_libtool_libs"
  16305. + then
  16306. + # If there is no dlname, no dlopen support or we're linking
  16307. + # statically, we need to preload. We also need to preload any
  16308. + # dependent libraries so libltdl's deplib preloader doesn't
  16309. + # bomb out in the load deplibs phase.
  16310. + func_append dlprefiles " $lib $dependency_libs"
  16311. + else
  16312. + func_append newdlfiles " $lib"
  16313. + fi
  16314. + continue
  16315. + fi # $pass = dlopen
  16316. +
  16317. + # We need an absolute path.
  16318. + case $ladir in
  16319. + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
  16320. + *)
  16321. + abs_ladir=`cd "$ladir" && pwd`
  16322. + if test -z "$abs_ladir"; then
  16323. + func_warning "cannot determine absolute directory name of '$ladir'"
  16324. + func_warning "passing it literally to the linker, although it might fail"
  16325. + abs_ladir=$ladir
  16326. + fi
  16327. + ;;
  16328. + esac
  16329. + func_basename "$lib"
  16330. + laname=$func_basename_result
  16331. +
  16332. + # Find the relevant object directory and library name.
  16333. + if test yes = "$installed"; then
  16334. + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  16335. + func_warning "library '$lib' was moved."
  16336. + dir=$ladir
  16337. + absdir=$abs_ladir
  16338. + libdir=$abs_ladir
  16339. + else
  16340. + dir=$lt_sysroot$libdir
  16341. + absdir=$lt_sysroot$libdir
  16342. + fi
  16343. + test yes = "$hardcode_automatic" && avoidtemprpath=yes
  16344. + else
  16345. + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  16346. + dir=$ladir
  16347. + absdir=$abs_ladir
  16348. + # Remove this search path later
  16349. + func_append notinst_path " $abs_ladir"
  16350. + else
  16351. + dir=$ladir/$objdir
  16352. + absdir=$abs_ladir/$objdir
  16353. + # Remove this search path later
  16354. + func_append notinst_path " $abs_ladir"
  16355. + fi
  16356. + fi # $installed = yes
  16357. + func_stripname 'lib' '.la' "$laname"
  16358. + name=$func_stripname_result
  16359. +
  16360. + # This library was specified with -dlpreopen.
  16361. + if test dlpreopen = "$pass"; then
  16362. + if test -z "$libdir" && test prog = "$linkmode"; then
  16363. + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
  16364. + fi
  16365. + case $host in
  16366. + # special handling for platforms with PE-DLLs.
  16367. + *cygwin* | *mingw* | *cegcc* )
  16368. + # Linker will automatically link against shared library if both
  16369. + # static and shared are present. Therefore, ensure we extract
  16370. + # symbols from the import library if a shared library is present
  16371. + # (otherwise, the dlopen module name will be incorrect). We do
  16372. + # this by putting the import library name into $newdlprefiles.
  16373. + # We recover the dlopen module name by 'saving' the la file
  16374. + # name in a special purpose variable, and (later) extracting the
  16375. + # dlname from the la file.
  16376. + if test -n "$dlname"; then
  16377. + func_tr_sh "$dir/$linklib"
  16378. + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
  16379. + func_append newdlprefiles " $dir/$linklib"
  16380. + else
  16381. + func_append newdlprefiles " $dir/$old_library"
  16382. + # Keep a list of preopened convenience libraries to check
  16383. + # that they are being used correctly in the link pass.
  16384. + test -z "$libdir" && \
  16385. + func_append dlpreconveniencelibs " $dir/$old_library"
  16386. + fi
  16387. + ;;
  16388. + * )
  16389. + # Prefer using a static library (so that no silly _DYNAMIC symbols
  16390. + # are required to link).
  16391. + if test -n "$old_library"; then
  16392. + func_append newdlprefiles " $dir/$old_library"
  16393. + # Keep a list of preopened convenience libraries to check
  16394. + # that they are being used correctly in the link pass.
  16395. + test -z "$libdir" && \
  16396. + func_append dlpreconveniencelibs " $dir/$old_library"
  16397. + # Otherwise, use the dlname, so that lt_dlopen finds it.
  16398. + elif test -n "$dlname"; then
  16399. + func_append newdlprefiles " $dir/$dlname"
  16400. + else
  16401. + func_append newdlprefiles " $dir/$linklib"
  16402. + fi
  16403. + ;;
  16404. + esac
  16405. + fi # $pass = dlpreopen
  16406. +
  16407. + if test -z "$libdir"; then
  16408. + # Link the convenience library
  16409. + if test lib = "$linkmode"; then
  16410. + deplibs="$dir/$old_library $deplibs"
  16411. + elif test prog,link = "$linkmode,$pass"; then
  16412. + compile_deplibs="$dir/$old_library $compile_deplibs"
  16413. + finalize_deplibs="$dir/$old_library $finalize_deplibs"
  16414. + else
  16415. + deplibs="$lib $deplibs" # used for prog,scan pass
  16416. + fi
  16417. + continue
  16418. + fi
  16419. +
  16420. +
  16421. + if test prog = "$linkmode" && test link != "$pass"; then
  16422. + func_append newlib_search_path " $ladir"
  16423. + deplibs="$lib $deplibs"
  16424. +
  16425. + linkalldeplibs=false
  16426. + if test no != "$link_all_deplibs" || test -z "$library_names" ||
  16427. + test no = "$build_libtool_libs"; then
  16428. + linkalldeplibs=:
  16429. + fi
  16430. +
  16431. + tmp_libs=
  16432. + for deplib in $dependency_libs; do
  16433. + case $deplib in
  16434. + -L*) func_stripname '-L' '' "$deplib"
  16435. + func_resolve_sysroot "$func_stripname_result"
  16436. + func_append newlib_search_path " $func_resolve_sysroot_result"
  16437. + ;;
  16438. + esac
  16439. + # Need to link against all dependency_libs?
  16440. + if $linkalldeplibs; then
  16441. + deplibs="$deplib $deplibs"
  16442. + else
  16443. + # Need to hardcode shared library paths
  16444. + # or/and link against static libraries
  16445. + newdependency_libs="$deplib $newdependency_libs"
  16446. + fi
  16447. + if $opt_preserve_dup_deps; then
  16448. + case "$tmp_libs " in
  16449. + *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  16450. + esac
  16451. + fi
  16452. + func_append tmp_libs " $deplib"
  16453. + done # for deplib
  16454. + continue
  16455. + fi # $linkmode = prog...
  16456. +
  16457. + if test prog,link = "$linkmode,$pass"; then
  16458. + if test -n "$library_names" &&
  16459. + { { test no = "$prefer_static_libs" ||
  16460. + test built,yes = "$prefer_static_libs,$installed"; } ||
  16461. + test -z "$old_library"; }; then
  16462. + # We need to hardcode the library path
  16463. + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
  16464. + # Make sure the rpath contains only unique directories.
  16465. + case $temp_rpath: in
  16466. + *"$absdir:"*) ;;
  16467. + *) func_append temp_rpath "$absdir:" ;;
  16468. + esac
  16469. + fi
  16470. +
  16471. + # Hardcode the library path.
  16472. + # Skip directories that are in the system default run-time
  16473. + # search path.
  16474. + case " $sys_lib_dlsearch_path " in
  16475. + *" $absdir "*) ;;
  16476. + *)
  16477. + case "$compile_rpath " in
  16478. + *" $absdir "*) ;;
  16479. + *) func_append compile_rpath " $absdir" ;;
  16480. + esac
  16481. + ;;
  16482. + esac
  16483. + case " $sys_lib_dlsearch_path " in
  16484. + *" $libdir "*) ;;
  16485. + *)
  16486. + case "$finalize_rpath " in
  16487. + *" $libdir "*) ;;
  16488. + *) func_append finalize_rpath " $libdir" ;;
  16489. + esac
  16490. + ;;
  16491. + esac
  16492. + fi # $linkmode,$pass = prog,link...
  16493. +
  16494. + if $alldeplibs &&
  16495. + { test pass_all = "$deplibs_check_method" ||
  16496. + { test yes = "$build_libtool_libs" &&
  16497. + test -n "$library_names"; }; }; then
  16498. + # We only need to search for static libraries
  16499. + continue
  16500. + fi
  16501. + fi
  16502. +
  16503. + link_static=no # Whether the deplib will be linked statically
  16504. + use_static_libs=$prefer_static_libs
  16505. + if test built = "$use_static_libs" && test yes = "$installed"; then
  16506. + use_static_libs=no
  16507. + fi
  16508. + if test -n "$library_names" &&
  16509. + { test no = "$use_static_libs" || test -z "$old_library"; }; then
  16510. + case $host in
  16511. + *cygwin* | *mingw* | *cegcc* | *os2*)
  16512. + # No point in relinking DLLs because paths are not encoded
  16513. + func_append notinst_deplibs " $lib"
  16514. + need_relink=no
  16515. + ;;
  16516. + *)
  16517. + if test no = "$installed"; then
  16518. + func_append notinst_deplibs " $lib"
  16519. + need_relink=yes
  16520. + fi
  16521. + ;;
  16522. + esac
  16523. + # This is a shared library
  16524. +
  16525. + # Warn about portability, can't link against -module's on some
  16526. + # systems (darwin). Don't bleat about dlopened modules though!
  16527. + dlopenmodule=
  16528. + for dlpremoduletest in $dlprefiles; do
  16529. + if test "X$dlpremoduletest" = "X$lib"; then
  16530. + dlopenmodule=$dlpremoduletest
  16531. + break
  16532. + fi
  16533. + done
  16534. + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
  16535. + echo
  16536. + if test prog = "$linkmode"; then
  16537. + $ECHO "*** Warning: Linking the executable $output against the loadable module"
  16538. + else
  16539. + $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  16540. + fi
  16541. + $ECHO "*** $linklib is not portable!"
  16542. + fi
  16543. + if test lib = "$linkmode" &&
  16544. + test yes = "$hardcode_into_libs"; then
  16545. + # Hardcode the library path.
  16546. + # Skip directories that are in the system default run-time
  16547. + # search path.
  16548. + case " $sys_lib_dlsearch_path " in
  16549. + *" $absdir "*) ;;
  16550. + *)
  16551. + case "$compile_rpath " in
  16552. + *" $absdir "*) ;;
  16553. + *) func_append compile_rpath " $absdir" ;;
  16554. + esac
  16555. + ;;
  16556. + esac
  16557. + case " $sys_lib_dlsearch_path " in
  16558. + *" $libdir "*) ;;
  16559. + *)
  16560. + case "$finalize_rpath " in
  16561. + *" $libdir "*) ;;
  16562. + *) func_append finalize_rpath " $libdir" ;;
  16563. + esac
  16564. + ;;
  16565. + esac
  16566. + fi
  16567. +
  16568. + if test -n "$old_archive_from_expsyms_cmds"; then
  16569. + # figure out the soname
  16570. + set dummy $library_names
  16571. + shift
  16572. + realname=$1
  16573. + shift
  16574. + libname=`eval "\\$ECHO \"$libname_spec\""`
  16575. + # use dlname if we got it. it's perfectly good, no?
  16576. + if test -n "$dlname"; then
  16577. + soname=$dlname
  16578. + elif test -n "$soname_spec"; then
  16579. + # bleh windows
  16580. + case $host in
  16581. + *cygwin* | mingw* | *cegcc* | *os2*)
  16582. + func_arith $current - $age
  16583. + major=$func_arith_result
  16584. + versuffix=-$major
  16585. + ;;
  16586. + esac
  16587. + eval soname=\"$soname_spec\"
  16588. + else
  16589. + soname=$realname
  16590. + fi
  16591. +
  16592. + # Make a new name for the extract_expsyms_cmds to use
  16593. + soroot=$soname
  16594. + func_basename "$soroot"
  16595. + soname=$func_basename_result
  16596. + func_stripname 'lib' '.dll' "$soname"
  16597. + newlib=libimp-$func_stripname_result.a
  16598. +
  16599. + # If the library has no export list, then create one now
  16600. + if test -f "$output_objdir/$soname-def"; then :
  16601. + else
  16602. + func_verbose "extracting exported symbol list from '$soname'"
  16603. + func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  16604. + fi
  16605. +
  16606. + # Create $newlib
  16607. + if test -f "$output_objdir/$newlib"; then :; else
  16608. + func_verbose "generating import library for '$soname'"
  16609. + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  16610. + fi
  16611. + # make sure the library variables are pointing to the new library
  16612. + dir=$output_objdir
  16613. + linklib=$newlib
  16614. + fi # test -n "$old_archive_from_expsyms_cmds"
  16615. +
  16616. + if test prog = "$linkmode" || test relink != "$opt_mode"; then
  16617. + add_shlibpath=
  16618. + add_dir=
  16619. + add=
  16620. + lib_linked=yes
  16621. + case $hardcode_action in
  16622. + immediate | unsupported)
  16623. + if test no = "$hardcode_direct"; then
  16624. + add=$dir/$linklib
  16625. + case $host in
  16626. + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
  16627. + *-*-sysv4*uw2*) add_dir=-L$dir ;;
  16628. + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  16629. + *-*-unixware7*) add_dir=-L$dir ;;
  16630. + *-*-darwin* )
  16631. + # if the lib is a (non-dlopened) module then we cannot
  16632. + # link against it, someone is ignoring the earlier warnings
  16633. + if /usr/bin/file -L $add 2> /dev/null |
  16634. + $GREP ": [^:]* bundle" >/dev/null; then
  16635. + if test "X$dlopenmodule" != "X$lib"; then
  16636. + $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  16637. + if test -z "$old_library"; then
  16638. + echo
  16639. + echo "*** And there doesn't seem to be a static archive available"
  16640. + echo "*** The link will probably fail, sorry"
  16641. + else
  16642. + add=$dir/$old_library
  16643. + fi
  16644. + elif test -n "$old_library"; then
  16645. + add=$dir/$old_library
  16646. + fi
  16647. + fi
  16648. + esac
  16649. + elif test no = "$hardcode_minus_L"; then
  16650. + case $host in
  16651. + *-*-sunos*) add_shlibpath=$dir ;;
  16652. + esac
  16653. + add_dir=-L$dir
  16654. + add=-l$name
  16655. + elif test no = "$hardcode_shlibpath_var"; then
  16656. + add_shlibpath=$dir
  16657. + add=-l$name
  16658. + else
  16659. + lib_linked=no
  16660. + fi
  16661. + ;;
  16662. + relink)
  16663. + if test yes = "$hardcode_direct" &&
  16664. + test no = "$hardcode_direct_absolute"; then
  16665. + add=$dir/$linklib
  16666. + elif test yes = "$hardcode_minus_L"; then
  16667. + add_dir=-L$absdir
  16668. + # Try looking first in the location we're being installed to.
  16669. + if test -n "$inst_prefix_dir"; then
  16670. + case $libdir in
  16671. + [\\/]*)
  16672. + func_append add_dir " -L$inst_prefix_dir$libdir"
  16673. + ;;
  16674. + esac
  16675. + fi
  16676. + add=-l$name
  16677. + elif test yes = "$hardcode_shlibpath_var"; then
  16678. + add_shlibpath=$dir
  16679. + add=-l$name
  16680. + else
  16681. + lib_linked=no
  16682. + fi
  16683. + ;;
  16684. + *) lib_linked=no ;;
  16685. + esac
  16686. +
  16687. + if test yes != "$lib_linked"; then
  16688. + func_fatal_configuration "unsupported hardcode properties"
  16689. + fi
  16690. +
  16691. + if test -n "$add_shlibpath"; then
  16692. + case :$compile_shlibpath: in
  16693. + *":$add_shlibpath:"*) ;;
  16694. + *) func_append compile_shlibpath "$add_shlibpath:" ;;
  16695. + esac
  16696. + fi
  16697. + if test prog = "$linkmode"; then
  16698. + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  16699. + test -n "$add" && compile_deplibs="$add $compile_deplibs"
  16700. + else
  16701. + test -n "$add_dir" && deplibs="$add_dir $deplibs"
  16702. + test -n "$add" && deplibs="$add $deplibs"
  16703. + if test yes != "$hardcode_direct" &&
  16704. + test yes != "$hardcode_minus_L" &&
  16705. + test yes = "$hardcode_shlibpath_var"; then
  16706. + case :$finalize_shlibpath: in
  16707. + *":$libdir:"*) ;;
  16708. + *) func_append finalize_shlibpath "$libdir:" ;;
  16709. + esac
  16710. + fi
  16711. + fi
  16712. + fi
  16713. +
  16714. + if test prog = "$linkmode" || test relink = "$opt_mode"; then
  16715. + add_shlibpath=
  16716. + add_dir=
  16717. + add=
  16718. + # Finalize command for both is simple: just hardcode it.
  16719. + if test yes = "$hardcode_direct" &&
  16720. + test no = "$hardcode_direct_absolute"; then
  16721. + add=$libdir/$linklib
  16722. + elif test yes = "$hardcode_minus_L"; then
  16723. + add_dir=-L$libdir
  16724. + add=-l$name
  16725. + elif test yes = "$hardcode_shlibpath_var"; then
  16726. + case :$finalize_shlibpath: in
  16727. + *":$libdir:"*) ;;
  16728. + *) func_append finalize_shlibpath "$libdir:" ;;
  16729. + esac
  16730. + add=-l$name
  16731. + elif test yes = "$hardcode_automatic"; then
  16732. + if test -n "$inst_prefix_dir" &&
  16733. + test -f "$inst_prefix_dir$libdir/$linklib"; then
  16734. + add=$inst_prefix_dir$libdir/$linklib
  16735. + else
  16736. + add=$libdir/$linklib
  16737. + fi
  16738. + else
  16739. + # We cannot seem to hardcode it, guess we'll fake it.
  16740. + add_dir=-L$libdir
  16741. + # Try looking first in the location we're being installed to.
  16742. + if test -n "$inst_prefix_dir"; then
  16743. + case $libdir in
  16744. + [\\/]*)
  16745. + func_append add_dir " -L$inst_prefix_dir$libdir"
  16746. + ;;
  16747. + esac
  16748. + fi
  16749. + add=-l$name
  16750. + fi
  16751. +
  16752. + if test prog = "$linkmode"; then
  16753. + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  16754. + test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  16755. + else
  16756. + test -n "$add_dir" && deplibs="$add_dir $deplibs"
  16757. + test -n "$add" && deplibs="$add $deplibs"
  16758. + fi
  16759. + fi
  16760. + elif test prog = "$linkmode"; then
  16761. + # Here we assume that one of hardcode_direct or hardcode_minus_L
  16762. + # is not unsupported. This is valid on all known static and
  16763. + # shared platforms.
  16764. + if test unsupported != "$hardcode_direct"; then
  16765. + test -n "$old_library" && linklib=$old_library
  16766. + compile_deplibs="$dir/$linklib $compile_deplibs"
  16767. + finalize_deplibs="$dir/$linklib $finalize_deplibs"
  16768. + else
  16769. + compile_deplibs="-l$name -L$dir $compile_deplibs"
  16770. + finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  16771. + fi
  16772. + elif test yes = "$build_libtool_libs"; then
  16773. + # Not a shared library
  16774. + if test pass_all != "$deplibs_check_method"; then
  16775. + # We're trying link a shared library against a static one
  16776. + # but the system doesn't support it.
  16777. +
  16778. + # Just print a warning and add the library to dependency_libs so
  16779. + # that the program can be linked against the static library.
  16780. + echo
  16781. + $ECHO "*** Warning: This system cannot link to static lib archive $lib."
  16782. + echo "*** I have the capability to make that library automatically link in when"
  16783. + echo "*** you link to this library. But I can only do this if you have a"
  16784. + echo "*** shared version of the library, which you do not appear to have."
  16785. + if test yes = "$module"; then
  16786. + echo "*** But as you try to build a module library, libtool will still create "
  16787. + echo "*** a static module, that should work as long as the dlopening application"
  16788. + echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  16789. + if test -z "$global_symbol_pipe"; then
  16790. + echo
  16791. + echo "*** However, this would only work if libtool was able to extract symbol"
  16792. + echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  16793. + echo "*** not find such a program. So, this module is probably useless."
  16794. + echo "*** 'nm' from GNU binutils and a full rebuild may help."
  16795. + fi
  16796. + if test no = "$build_old_libs"; then
  16797. + build_libtool_libs=module
  16798. + build_old_libs=yes
  16799. + else
  16800. + build_libtool_libs=no
  16801. + fi
  16802. + fi
  16803. + else
  16804. + deplibs="$dir/$old_library $deplibs"
  16805. + link_static=yes
  16806. + fi
  16807. + fi # link shared/static library?
  16808. +
  16809. + if test lib = "$linkmode"; then
  16810. + if test -n "$dependency_libs" &&
  16811. + { test yes != "$hardcode_into_libs" ||
  16812. + test yes = "$build_old_libs" ||
  16813. + test yes = "$link_static"; }; then
  16814. + # Extract -R from dependency_libs
  16815. + temp_deplibs=
  16816. + for libdir in $dependency_libs; do
  16817. + case $libdir in
  16818. + -R*) func_stripname '-R' '' "$libdir"
  16819. + temp_xrpath=$func_stripname_result
  16820. + case " $xrpath " in
  16821. + *" $temp_xrpath "*) ;;
  16822. + *) func_append xrpath " $temp_xrpath";;
  16823. + esac;;
  16824. + *) func_append temp_deplibs " $libdir";;
  16825. + esac
  16826. + done
  16827. + dependency_libs=$temp_deplibs
  16828. + fi
  16829. +
  16830. + func_append newlib_search_path " $absdir"
  16831. + # Link against this library
  16832. + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  16833. + # ... and its dependency_libs
  16834. + tmp_libs=
  16835. + for deplib in $dependency_libs; do
  16836. + newdependency_libs="$deplib $newdependency_libs"
  16837. + case $deplib in
  16838. + -L*) func_stripname '-L' '' "$deplib"
  16839. + func_resolve_sysroot "$func_stripname_result";;
  16840. + *) func_resolve_sysroot "$deplib" ;;
  16841. + esac
  16842. + if $opt_preserve_dup_deps; then
  16843. + case "$tmp_libs " in
  16844. + *" $func_resolve_sysroot_result "*)
  16845. + func_append specialdeplibs " $func_resolve_sysroot_result" ;;
  16846. + esac
  16847. + fi
  16848. + func_append tmp_libs " $func_resolve_sysroot_result"
  16849. + done
  16850. +
  16851. + if test no != "$link_all_deplibs"; then
  16852. + # Add the search paths of all dependency libraries
  16853. + for deplib in $dependency_libs; do
  16854. + path=
  16855. + case $deplib in
  16856. + -L*) path=$deplib ;;
  16857. + *.la)
  16858. + func_resolve_sysroot "$deplib"
  16859. + deplib=$func_resolve_sysroot_result
  16860. + func_dirname "$deplib" "" "."
  16861. + dir=$func_dirname_result
  16862. + # We need an absolute path.
  16863. + case $dir in
  16864. + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
  16865. + *)
  16866. + absdir=`cd "$dir" && pwd`
  16867. + if test -z "$absdir"; then
  16868. + func_warning "cannot determine absolute directory name of '$dir'"
  16869. + absdir=$dir
  16870. + fi
  16871. + ;;
  16872. + esac
  16873. + if $GREP "^installed=no" $deplib > /dev/null; then
  16874. + case $host in
  16875. + *-*-darwin*)
  16876. + depdepl=
  16877. + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  16878. + if test -n "$deplibrary_names"; then
  16879. + for tmp in $deplibrary_names; do
  16880. + depdepl=$tmp
  16881. + done
  16882. + if test -f "$absdir/$objdir/$depdepl"; then
  16883. + depdepl=$absdir/$objdir/$depdepl
  16884. + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  16885. + if test -z "$darwin_install_name"; then
  16886. + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  16887. + fi
  16888. + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
  16889. + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
  16890. + path=
  16891. + fi
  16892. + fi
  16893. + ;;
  16894. + *)
  16895. + path=-L$absdir/$objdir
  16896. + ;;
  16897. + esac
  16898. + else
  16899. + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  16900. + test -z "$libdir" && \
  16901. + func_fatal_error "'$deplib' is not a valid libtool archive"
  16902. + test "$absdir" != "$libdir" && \
  16903. + func_warning "'$deplib' seems to be moved"
  16904. +
  16905. + path=-L$absdir
  16906. + fi
  16907. + ;;
  16908. + esac
  16909. + case " $deplibs " in
  16910. + *" $path "*) ;;
  16911. + *) deplibs="$path $deplibs" ;;
  16912. + esac
  16913. + done
  16914. + fi # link_all_deplibs != no
  16915. + fi # linkmode = lib
  16916. + done # for deplib in $libs
  16917. + if test link = "$pass"; then
  16918. + if test prog = "$linkmode"; then
  16919. + compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  16920. + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  16921. + else
  16922. + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  16923. + fi
  16924. + fi
  16925. + dependency_libs=$newdependency_libs
  16926. + if test dlpreopen = "$pass"; then
  16927. + # Link the dlpreopened libraries before other libraries
  16928. + for deplib in $save_deplibs; do
  16929. + deplibs="$deplib $deplibs"
  16930. + done
  16931. + fi
  16932. + if test dlopen != "$pass"; then
  16933. + test conv = "$pass" || {
  16934. + # Make sure lib_search_path contains only unique directories.
  16935. + lib_search_path=
  16936. + for dir in $newlib_search_path; do
  16937. + case "$lib_search_path " in
  16938. + *" $dir "*) ;;
  16939. + *) func_append lib_search_path " $dir" ;;
  16940. + esac
  16941. + done
  16942. + newlib_search_path=
  16943. + }
  16944. +
  16945. + if test prog,link = "$linkmode,$pass"; then
  16946. + vars="compile_deplibs finalize_deplibs"
  16947. + else
  16948. + vars=deplibs
  16949. + fi
  16950. + for var in $vars dependency_libs; do
  16951. + # Add libraries to $var in reverse order
  16952. + eval tmp_libs=\"\$$var\"
  16953. + new_libs=
  16954. + for deplib in $tmp_libs; do
  16955. + # FIXME: Pedantically, this is the right thing to do, so
  16956. + # that some nasty dependency loop isn't accidentally
  16957. + # broken:
  16958. + #new_libs="$deplib $new_libs"
  16959. + # Pragmatically, this seems to cause very few problems in
  16960. + # practice:
  16961. + case $deplib in
  16962. + -L*) new_libs="$deplib $new_libs" ;;
  16963. + -R*) ;;
  16964. + *)
  16965. + # And here is the reason: when a library appears more
  16966. + # than once as an explicit dependence of a library, or
  16967. + # is implicitly linked in more than once by the
  16968. + # compiler, it is considered special, and multiple
  16969. + # occurrences thereof are not removed. Compare this
  16970. + # with having the same library being listed as a
  16971. + # dependency of multiple other libraries: in this case,
  16972. + # we know (pedantically, we assume) the library does not
  16973. + # need to be listed more than once, so we keep only the
  16974. + # last copy. This is not always right, but it is rare
  16975. + # enough that we require users that really mean to play
  16976. + # such unportable linking tricks to link the library
  16977. + # using -Wl,-lname, so that libtool does not consider it
  16978. + # for duplicate removal.
  16979. + case " $specialdeplibs " in
  16980. + *" $deplib "*) new_libs="$deplib $new_libs" ;;
  16981. + *)
  16982. + case " $new_libs " in
  16983. + *" $deplib "*) ;;
  16984. + *) new_libs="$deplib $new_libs" ;;
  16985. + esac
  16986. + ;;
  16987. + esac
  16988. + ;;
  16989. + esac
  16990. + done
  16991. + tmp_libs=
  16992. + for deplib in $new_libs; do
  16993. + case $deplib in
  16994. + -L*)
  16995. + case " $tmp_libs " in
  16996. + *" $deplib "*) ;;
  16997. + *) func_append tmp_libs " $deplib" ;;
  16998. + esac
  16999. + ;;
  17000. + *) func_append tmp_libs " $deplib" ;;
  17001. + esac
  17002. + done
  17003. + eval $var=\"$tmp_libs\"
  17004. + done # for var
  17005. + fi
  17006. +
  17007. + # Add Sun CC postdeps if required:
  17008. + test CXX = "$tagname" && {
  17009. + case $host_os in
  17010. + linux*)
  17011. + case `$CC -V 2>&1 | sed 5q` in
  17012. + *Sun\ C*) # Sun C++ 5.9
  17013. + func_suncc_cstd_abi
  17014. +
  17015. + if test no != "$suncc_use_cstd_abi"; then
  17016. + func_append postdeps ' -library=Cstd -library=Crun'
  17017. + fi
  17018. + ;;
  17019. + esac
  17020. + ;;
  17021. +
  17022. + solaris*)
  17023. + func_cc_basename "$CC"
  17024. + case $func_cc_basename_result in
  17025. + CC* | sunCC*)
  17026. + func_suncc_cstd_abi
  17027. +
  17028. + if test no != "$suncc_use_cstd_abi"; then
  17029. + func_append postdeps ' -library=Cstd -library=Crun'
  17030. + fi
  17031. + ;;
  17032. + esac
  17033. + ;;
  17034. + esac
  17035. + }
  17036. +
  17037. + # Last step: remove runtime libs from dependency_libs
  17038. + # (they stay in deplibs)
  17039. + tmp_libs=
  17040. + for i in $dependency_libs; do
  17041. + case " $predeps $postdeps $compiler_lib_search_path " in
  17042. + *" $i "*)
  17043. + i=
  17044. + ;;
  17045. + esac
  17046. + if test -n "$i"; then
  17047. + func_append tmp_libs " $i"
  17048. + fi
  17049. + done
  17050. + dependency_libs=$tmp_libs
  17051. + done # for pass
  17052. + if test prog = "$linkmode"; then
  17053. + dlfiles=$newdlfiles
  17054. + fi
  17055. + if test prog = "$linkmode" || test lib = "$linkmode"; then
  17056. + dlprefiles=$newdlprefiles
  17057. + fi
  17058. +
  17059. + case $linkmode in
  17060. + oldlib)
  17061. + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  17062. + func_warning "'-dlopen' is ignored for archives"
  17063. + fi
  17064. +
  17065. + case " $deplibs" in
  17066. + *\ -l* | *\ -L*)
  17067. + func_warning "'-l' and '-L' are ignored for archives" ;;
  17068. + esac
  17069. +
  17070. + test -n "$rpath" && \
  17071. + func_warning "'-rpath' is ignored for archives"
  17072. +
  17073. + test -n "$xrpath" && \
  17074. + func_warning "'-R' is ignored for archives"
  17075. +
  17076. + test -n "$vinfo" && \
  17077. + func_warning "'-version-info/-version-number' is ignored for archives"
  17078. +
  17079. + test -n "$release" && \
  17080. + func_warning "'-release' is ignored for archives"
  17081. +
  17082. + test -n "$export_symbols$export_symbols_regex" && \
  17083. + func_warning "'-export-symbols' is ignored for archives"
  17084. +
  17085. + # Now set the variables for building old libraries.
  17086. + build_libtool_libs=no
  17087. + oldlibs=$output
  17088. + func_append objs "$old_deplibs"
  17089. + ;;
  17090. +
  17091. + lib)
  17092. + # Make sure we only generate libraries of the form 'libNAME.la'.
  17093. + case $outputname in
  17094. + lib*)
  17095. + func_stripname 'lib' '.la' "$outputname"
  17096. + name=$func_stripname_result
  17097. + eval shared_ext=\"$shrext_cmds\"
  17098. + eval libname=\"$libname_spec\"
  17099. + ;;
  17100. + *)
  17101. + test no = "$module" \
  17102. + && func_fatal_help "libtool library '$output' must begin with 'lib'"
  17103. +
  17104. + if test no != "$need_lib_prefix"; then
  17105. + # Add the "lib" prefix for modules if required
  17106. + func_stripname '' '.la' "$outputname"
  17107. + name=$func_stripname_result
  17108. + eval shared_ext=\"$shrext_cmds\"
  17109. + eval libname=\"$libname_spec\"
  17110. + else
  17111. + func_stripname '' '.la' "$outputname"
  17112. + libname=$func_stripname_result
  17113. + fi
  17114. + ;;
  17115. + esac
  17116. +
  17117. + if test -n "$objs"; then
  17118. + if test pass_all != "$deplibs_check_method"; then
  17119. + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
  17120. + else
  17121. + echo
  17122. + $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  17123. + $ECHO "*** objects $objs is not portable!"
  17124. + func_append libobjs " $objs"
  17125. + fi
  17126. + fi
  17127. +
  17128. + test no = "$dlself" \
  17129. + || func_warning "'-dlopen self' is ignored for libtool libraries"
  17130. +
  17131. + set dummy $rpath
  17132. + shift
  17133. + test 1 -lt "$#" \
  17134. + && func_warning "ignoring multiple '-rpath's for a libtool library"
  17135. +
  17136. + install_libdir=$1
  17137. +
  17138. + oldlibs=
  17139. + if test -z "$rpath"; then
  17140. + if test yes = "$build_libtool_libs"; then
  17141. + # Building a libtool convenience library.
  17142. + # Some compilers have problems with a '.al' extension so
  17143. + # convenience libraries should have the same extension an
  17144. + # archive normally would.
  17145. + oldlibs="$output_objdir/$libname.$libext $oldlibs"
  17146. + build_libtool_libs=convenience
  17147. + build_old_libs=yes
  17148. + fi
  17149. +
  17150. + test -n "$vinfo" && \
  17151. + func_warning "'-version-info/-version-number' is ignored for convenience libraries"
  17152. +
  17153. + test -n "$release" && \
  17154. + func_warning "'-release' is ignored for convenience libraries"
  17155. + else
  17156. +
  17157. + # Parse the version information argument.
  17158. + save_ifs=$IFS; IFS=:
  17159. + set dummy $vinfo 0 0 0
  17160. + shift
  17161. + IFS=$save_ifs
  17162. +
  17163. + test -n "$7" && \
  17164. + func_fatal_help "too many parameters to '-version-info'"
  17165. +
  17166. + # convert absolute version numbers to libtool ages
  17167. + # this retains compatibility with .la files and attempts
  17168. + # to make the code below a bit more comprehensible
  17169. +
  17170. + case $vinfo_number in
  17171. + yes)
  17172. + number_major=$1
  17173. + number_minor=$2
  17174. + number_revision=$3
  17175. + #
  17176. + # There are really only two kinds -- those that
  17177. + # use the current revision as the major version
  17178. + # and those that subtract age and use age as
  17179. + # a minor version. But, then there is irix
  17180. + # that has an extra 1 added just for fun
  17181. + #
  17182. + case $version_type in
  17183. + # correct linux to gnu/linux during the next big refactor
  17184. + darwin|freebsd-elf|linux|osf|windows|none)
  17185. + func_arith $number_major + $number_minor
  17186. + current=$func_arith_result
  17187. + age=$number_minor
  17188. + revision=$number_revision
  17189. + ;;
  17190. + freebsd-aout|qnx|sunos)
  17191. + current=$number_major
  17192. + revision=$number_minor
  17193. + age=0
  17194. + ;;
  17195. + irix|nonstopux)
  17196. + func_arith $number_major + $number_minor
  17197. + current=$func_arith_result
  17198. + age=$number_minor
  17199. + revision=$number_minor
  17200. + lt_irix_increment=no
  17201. + ;;
  17202. + *)
  17203. + func_fatal_configuration "$modename: unknown library version type '$version_type'"
  17204. + ;;
  17205. + esac
  17206. + ;;
  17207. + no)
  17208. + current=$1
  17209. + revision=$2
  17210. + age=$3
  17211. + ;;
  17212. + esac
  17213. +
  17214. + # Check that each of the things are valid numbers.
  17215. + case $current in
  17216. + 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]) ;;
  17217. + *)
  17218. + func_error "CURRENT '$current' must be a nonnegative integer"
  17219. + func_fatal_error "'$vinfo' is not valid version information"
  17220. + ;;
  17221. + esac
  17222. +
  17223. + case $revision in
  17224. + 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]) ;;
  17225. + *)
  17226. + func_error "REVISION '$revision' must be a nonnegative integer"
  17227. + func_fatal_error "'$vinfo' is not valid version information"
  17228. + ;;
  17229. + esac
  17230. +
  17231. + case $age in
  17232. + 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]) ;;
  17233. + *)
  17234. + func_error "AGE '$age' must be a nonnegative integer"
  17235. + func_fatal_error "'$vinfo' is not valid version information"
  17236. + ;;
  17237. + esac
  17238. +
  17239. + if test "$age" -gt "$current"; then
  17240. + func_error "AGE '$age' is greater than the current interface number '$current'"
  17241. + func_fatal_error "'$vinfo' is not valid version information"
  17242. + fi
  17243. +
  17244. + # Calculate the version variables.
  17245. + major=
  17246. + versuffix=
  17247. + verstring=
  17248. + case $version_type in
  17249. + none) ;;
  17250. +
  17251. + darwin)
  17252. + # Like Linux, but with the current version available in
  17253. + # verstring for coding it into the library header
  17254. + func_arith $current - $age
  17255. + major=.$func_arith_result
  17256. + versuffix=$major.$age.$revision
  17257. + # Darwin ld doesn't like 0 for these options...
  17258. + func_arith $current + 1
  17259. + minor_current=$func_arith_result
  17260. + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  17261. + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  17262. + # On Darwin other compilers
  17263. + case $CC in
  17264. + nagfor*)
  17265. + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  17266. + ;;
  17267. + *)
  17268. + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  17269. + ;;
  17270. + esac
  17271. + ;;
  17272. +
  17273. + freebsd-aout)
  17274. + major=.$current
  17275. + versuffix=.$current.$revision
  17276. + ;;
  17277. +
  17278. + freebsd-elf)
  17279. + func_arith $current - $age
  17280. + major=.$func_arith_result
  17281. + versuffix=$major.$age.$revision
  17282. + ;;
  17283. +
  17284. + irix | nonstopux)
  17285. + if test no = "$lt_irix_increment"; then
  17286. + func_arith $current - $age
  17287. + else
  17288. + func_arith $current - $age + 1
  17289. + fi
  17290. + major=$func_arith_result
  17291. +
  17292. + case $version_type in
  17293. + nonstopux) verstring_prefix=nonstopux ;;
  17294. + *) verstring_prefix=sgi ;;
  17295. + esac
  17296. + verstring=$verstring_prefix$major.$revision
  17297. +
  17298. + # Add in all the interfaces that we are compatible with.
  17299. + loop=$revision
  17300. + while test 0 -ne "$loop"; do
  17301. + func_arith $revision - $loop
  17302. + iface=$func_arith_result
  17303. + func_arith $loop - 1
  17304. + loop=$func_arith_result
  17305. + verstring=$verstring_prefix$major.$iface:$verstring
  17306. + done
  17307. +
  17308. + # Before this point, $major must not contain '.'.
  17309. + major=.$major
  17310. + versuffix=$major.$revision
  17311. + ;;
  17312. +
  17313. + linux) # correct to gnu/linux during the next big refactor
  17314. + func_arith $current - $age
  17315. + major=.$func_arith_result
  17316. + versuffix=$major.$age.$revision
  17317. + ;;
  17318. +
  17319. + osf)
  17320. + func_arith $current - $age
  17321. + major=.$func_arith_result
  17322. + versuffix=.$current.$age.$revision
  17323. + verstring=$current.$age.$revision
  17324. +
  17325. + # Add in all the interfaces that we are compatible with.
  17326. + loop=$age
  17327. + while test 0 -ne "$loop"; do
  17328. + func_arith $current - $loop
  17329. + iface=$func_arith_result
  17330. + func_arith $loop - 1
  17331. + loop=$func_arith_result
  17332. + verstring=$verstring:$iface.0
  17333. + done
  17334. +
  17335. + # Make executables depend on our current version.
  17336. + func_append verstring ":$current.0"
  17337. + ;;
  17338. +
  17339. + qnx)
  17340. + major=.$current
  17341. + versuffix=.$current
  17342. + ;;
  17343. +
  17344. + sco)
  17345. + major=.$current
  17346. + versuffix=.$current
  17347. + ;;
  17348. +
  17349. + sunos)
  17350. + major=.$current
  17351. + versuffix=.$current.$revision
  17352. + ;;
  17353. +
  17354. + windows)
  17355. + # Use '-' rather than '.', since we only want one
  17356. + # extension on DOS 8.3 file systems.
  17357. + func_arith $current - $age
  17358. + major=$func_arith_result
  17359. + versuffix=-$major
  17360. + ;;
  17361. +
  17362. + *)
  17363. + func_fatal_configuration "unknown library version type '$version_type'"
  17364. + ;;
  17365. + esac
  17366. +
  17367. + # Clear the version info if we defaulted, and they specified a release.
  17368. + if test -z "$vinfo" && test -n "$release"; then
  17369. + major=
  17370. + case $version_type in
  17371. + darwin)
  17372. + # we can't check for "0.0" in archive_cmds due to quoting
  17373. + # problems, so we reset it completely
  17374. + verstring=
  17375. + ;;
  17376. + *)
  17377. + verstring=0.0
  17378. + ;;
  17379. + esac
  17380. + if test no = "$need_version"; then
  17381. + versuffix=
  17382. + else
  17383. + versuffix=.0.0
  17384. + fi
  17385. + fi
  17386. +
  17387. + # Remove version info from name if versioning should be avoided
  17388. + if test yes,no = "$avoid_version,$need_version"; then
  17389. + major=
  17390. + versuffix=
  17391. + verstring=
  17392. + fi
  17393. +
  17394. + # Check to see if the archive will have undefined symbols.
  17395. + if test yes = "$allow_undefined"; then
  17396. + if test unsupported = "$allow_undefined_flag"; then
  17397. + if test yes = "$build_old_libs"; then
  17398. + func_warning "undefined symbols not allowed in $host shared libraries; building static only"
  17399. + build_libtool_libs=no
  17400. + else
  17401. + func_fatal_error "can't build $host shared library unless -no-undefined is specified"
  17402. + fi
  17403. + fi
  17404. + else
  17405. + # Don't allow undefined symbols.
  17406. + allow_undefined_flag=$no_undefined_flag
  17407. + fi
  17408. +
  17409. + fi
  17410. +
  17411. + func_generate_dlsyms "$libname" "$libname" :
  17412. + func_append libobjs " $symfileobj"
  17413. + test " " = "$libobjs" && libobjs=
  17414. +
  17415. + if test relink != "$opt_mode"; then
  17416. + # Remove our outputs, but don't remove object files since they
  17417. + # may have been created when compiling PIC objects.
  17418. + removelist=
  17419. + tempremovelist=`$ECHO "$output_objdir/*"`
  17420. + for p in $tempremovelist; do
  17421. + case $p in
  17422. + *.$objext | *.gcno)
  17423. + ;;
  17424. + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
  17425. + if test -n "$precious_files_regex"; then
  17426. + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  17427. + then
  17428. + continue
  17429. + fi
  17430. + fi
  17431. + func_append removelist " $p"
  17432. + ;;
  17433. + *) ;;
  17434. + esac
  17435. + done
  17436. + test -n "$removelist" && \
  17437. + func_show_eval "${RM}r \$removelist"
  17438. + fi
  17439. +
  17440. + # Now set the variables for building old libraries.
  17441. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
  17442. + func_append oldlibs " $output_objdir/$libname.$libext"
  17443. +
  17444. + # Transform .lo files to .o files.
  17445. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
  17446. + fi
  17447. +
  17448. + # Eliminate all temporary directories.
  17449. + #for path in $notinst_path; do
  17450. + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
  17451. + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
  17452. + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
  17453. + #done
  17454. +
  17455. + if test -n "$xrpath"; then
  17456. + # If the user specified any rpath flags, then add them.
  17457. + temp_xrpath=
  17458. + for libdir in $xrpath; do
  17459. + func_replace_sysroot "$libdir"
  17460. + func_append temp_xrpath " -R$func_replace_sysroot_result"
  17461. + case "$finalize_rpath " in
  17462. + *" $libdir "*) ;;
  17463. + *) func_append finalize_rpath " $libdir" ;;
  17464. + esac
  17465. + done
  17466. + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
  17467. + dependency_libs="$temp_xrpath $dependency_libs"
  17468. + fi
  17469. + fi
  17470. +
  17471. + # Make sure dlfiles contains only unique files that won't be dlpreopened
  17472. + old_dlfiles=$dlfiles
  17473. + dlfiles=
  17474. + for lib in $old_dlfiles; do
  17475. + case " $dlprefiles $dlfiles " in
  17476. + *" $lib "*) ;;
  17477. + *) func_append dlfiles " $lib" ;;
  17478. + esac
  17479. + done
  17480. +
  17481. + # Make sure dlprefiles contains only unique files
  17482. + old_dlprefiles=$dlprefiles
  17483. + dlprefiles=
  17484. + for lib in $old_dlprefiles; do
  17485. + case "$dlprefiles " in
  17486. + *" $lib "*) ;;
  17487. + *) func_append dlprefiles " $lib" ;;
  17488. + esac
  17489. + done
  17490. +
  17491. + if test yes = "$build_libtool_libs"; then
  17492. + if test -n "$rpath"; then
  17493. + case $host in
  17494. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
  17495. + # these systems don't actually have a c library (as such)!
  17496. + ;;
  17497. + *-*-rhapsody* | *-*-darwin1.[012])
  17498. + # Rhapsody C library is in the System framework
  17499. + func_append deplibs " System.ltframework"
  17500. + ;;
  17501. + *-*-netbsd*)
  17502. + # Don't link with libc until the a.out ld.so is fixed.
  17503. + ;;
  17504. + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  17505. + # Do not include libc due to us having libc/libc_r.
  17506. + ;;
  17507. + *-*-sco3.2v5* | *-*-sco5v6*)
  17508. + # Causes problems with __ctype
  17509. + ;;
  17510. + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  17511. + # Compiler inserts libc in the correct place for threads to work
  17512. + ;;
  17513. + *)
  17514. + # Add libc to deplibs on all other systems if necessary.
  17515. + if test yes = "$build_libtool_need_lc"; then
  17516. + func_append deplibs " -lc"
  17517. + fi
  17518. + ;;
  17519. + esac
  17520. + fi
  17521. +
  17522. + # Transform deplibs into only deplibs that can be linked in shared.
  17523. + name_save=$name
  17524. + libname_save=$libname
  17525. + release_save=$release
  17526. + versuffix_save=$versuffix
  17527. + major_save=$major
  17528. + # I'm not sure if I'm treating the release correctly. I think
  17529. + # release should show up in the -l (ie -lgmp5) so we don't want to
  17530. + # add it in twice. Is that correct?
  17531. + release=
  17532. + versuffix=
  17533. + major=
  17534. + newdeplibs=
  17535. + droppeddeps=no
  17536. + case $deplibs_check_method in
  17537. + pass_all)
  17538. + # Don't check for shared/static. Everything works.
  17539. + # This might be a little naive. We might want to check
  17540. + # whether the library exists or not. But this is on
  17541. + # osf3 & osf4 and I'm not really sure... Just
  17542. + # implementing what was already the behavior.
  17543. + newdeplibs=$deplibs
  17544. + ;;
  17545. + test_compile)
  17546. + # This code stresses the "libraries are programs" paradigm to its
  17547. + # limits. Maybe even breaks it. We compile a program, linking it
  17548. + # against the deplibs as a proxy for the library. Then we can check
  17549. + # whether they linked in statically or dynamically with ldd.
  17550. + $opt_dry_run || $RM conftest.c
  17551. + cat > conftest.c <<EOF
  17552. + int main() { return 0; }
  17553. +EOF
  17554. + $opt_dry_run || $RM conftest
  17555. + if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  17556. + ldd_output=`ldd conftest`
  17557. + for i in $deplibs; do
  17558. + case $i in
  17559. + -l*)
  17560. + func_stripname -l '' "$i"
  17561. + name=$func_stripname_result
  17562. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  17563. + case " $predeps $postdeps " in
  17564. + *" $i "*)
  17565. + func_append newdeplibs " $i"
  17566. + i=
  17567. + ;;
  17568. + esac
  17569. + fi
  17570. + if test -n "$i"; then
  17571. + libname=`eval "\\$ECHO \"$libname_spec\""`
  17572. + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  17573. + set dummy $deplib_matches; shift
  17574. + deplib_match=$1
  17575. + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  17576. + func_append newdeplibs " $i"
  17577. + else
  17578. + droppeddeps=yes
  17579. + echo
  17580. + $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  17581. + echo "*** I have the capability to make that library automatically link in when"
  17582. + echo "*** you link to this library. But I can only do this if you have a"
  17583. + echo "*** shared version of the library, which I believe you do not have"
  17584. + echo "*** because a test_compile did reveal that the linker did not use it for"
  17585. + echo "*** its dynamic dependency list that programs get resolved with at runtime."
  17586. + fi
  17587. + fi
  17588. + ;;
  17589. + *)
  17590. + func_append newdeplibs " $i"
  17591. + ;;
  17592. + esac
  17593. + done
  17594. + else
  17595. + # Error occurred in the first compile. Let's try to salvage
  17596. + # the situation: Compile a separate program for each library.
  17597. + for i in $deplibs; do
  17598. + case $i in
  17599. + -l*)
  17600. + func_stripname -l '' "$i"
  17601. + name=$func_stripname_result
  17602. + $opt_dry_run || $RM conftest
  17603. + if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  17604. + ldd_output=`ldd conftest`
  17605. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  17606. + case " $predeps $postdeps " in
  17607. + *" $i "*)
  17608. + func_append newdeplibs " $i"
  17609. + i=
  17610. + ;;
  17611. + esac
  17612. + fi
  17613. + if test -n "$i"; then
  17614. + libname=`eval "\\$ECHO \"$libname_spec\""`
  17615. + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  17616. + set dummy $deplib_matches; shift
  17617. + deplib_match=$1
  17618. + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  17619. + func_append newdeplibs " $i"
  17620. + else
  17621. + droppeddeps=yes
  17622. + echo
  17623. + $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  17624. + echo "*** I have the capability to make that library automatically link in when"
  17625. + echo "*** you link to this library. But I can only do this if you have a"
  17626. + echo "*** shared version of the library, which you do not appear to have"
  17627. + echo "*** because a test_compile did reveal that the linker did not use this one"
  17628. + echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  17629. + fi
  17630. + fi
  17631. + else
  17632. + droppeddeps=yes
  17633. + echo
  17634. + $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
  17635. + echo "*** make it link in! You will probably need to install it or some"
  17636. + echo "*** library that it depends on before this library will be fully"
  17637. + echo "*** functional. Installing it before continuing would be even better."
  17638. + fi
  17639. + ;;
  17640. + *)
  17641. + func_append newdeplibs " $i"
  17642. + ;;
  17643. + esac
  17644. + done
  17645. + fi
  17646. + ;;
  17647. + file_magic*)
  17648. + set dummy $deplibs_check_method; shift
  17649. + file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  17650. + for a_deplib in $deplibs; do
  17651. + case $a_deplib in
  17652. + -l*)
  17653. + func_stripname -l '' "$a_deplib"
  17654. + name=$func_stripname_result
  17655. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  17656. + case " $predeps $postdeps " in
  17657. + *" $a_deplib "*)
  17658. + func_append newdeplibs " $a_deplib"
  17659. + a_deplib=
  17660. + ;;
  17661. + esac
  17662. + fi
  17663. + if test -n "$a_deplib"; then
  17664. + libname=`eval "\\$ECHO \"$libname_spec\""`
  17665. + if test -n "$file_magic_glob"; then
  17666. + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
  17667. + else
  17668. + libnameglob=$libname
  17669. + fi
  17670. + test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
  17671. + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  17672. + if test yes = "$want_nocaseglob"; then
  17673. + shopt -s nocaseglob
  17674. + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  17675. + $nocaseglob
  17676. + else
  17677. + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  17678. + fi
  17679. + for potent_lib in $potential_libs; do
  17680. + # Follow soft links.
  17681. + if ls -lLd "$potent_lib" 2>/dev/null |
  17682. + $GREP " -> " >/dev/null; then
  17683. + continue
  17684. + fi
  17685. + # The statement above tries to avoid entering an
  17686. + # endless loop below, in case of cyclic links.
  17687. + # We might still enter an endless loop, since a link
  17688. + # loop can be closed while we follow links,
  17689. + # but so what?
  17690. + potlib=$potent_lib
  17691. + while test -h "$potlib" 2>/dev/null; do
  17692. + potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
  17693. + case $potliblink in
  17694. + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
  17695. + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
  17696. + esac
  17697. + done
  17698. + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  17699. + $SED -e 10q |
  17700. + $EGREP "$file_magic_regex" > /dev/null; then
  17701. + func_append newdeplibs " $a_deplib"
  17702. + a_deplib=
  17703. + break 2
  17704. + fi
  17705. + done
  17706. + done
  17707. + fi
  17708. + if test -n "$a_deplib"; then
  17709. + droppeddeps=yes
  17710. + echo
  17711. + $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  17712. + echo "*** I have the capability to make that library automatically link in when"
  17713. + echo "*** you link to this library. But I can only do this if you have a"
  17714. + echo "*** shared version of the library, which you do not appear to have"
  17715. + echo "*** because I did check the linker path looking for a file starting"
  17716. + if test -z "$potlib"; then
  17717. + $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  17718. + else
  17719. + $ECHO "*** with $libname and none of the candidates passed a file format test"
  17720. + $ECHO "*** using a file magic. Last file checked: $potlib"
  17721. + fi
  17722. + fi
  17723. + ;;
  17724. + *)
  17725. + # Add a -L argument.
  17726. + func_append newdeplibs " $a_deplib"
  17727. + ;;
  17728. + esac
  17729. + done # Gone through all deplibs.
  17730. + ;;
  17731. + match_pattern*)
  17732. + set dummy $deplibs_check_method; shift
  17733. + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  17734. + for a_deplib in $deplibs; do
  17735. + case $a_deplib in
  17736. + -l*)
  17737. + func_stripname -l '' "$a_deplib"
  17738. + name=$func_stripname_result
  17739. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  17740. + case " $predeps $postdeps " in
  17741. + *" $a_deplib "*)
  17742. + func_append newdeplibs " $a_deplib"
  17743. + a_deplib=
  17744. + ;;
  17745. + esac
  17746. + fi
  17747. + if test -n "$a_deplib"; then
  17748. + libname=`eval "\\$ECHO \"$libname_spec\""`
  17749. + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  17750. + potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  17751. + for potent_lib in $potential_libs; do
  17752. + potlib=$potent_lib # see symlink-check above in file_magic test
  17753. + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
  17754. + $EGREP "$match_pattern_regex" > /dev/null; then
  17755. + func_append newdeplibs " $a_deplib"
  17756. + a_deplib=
  17757. + break 2
  17758. + fi
  17759. + done
  17760. + done
  17761. + fi
  17762. + if test -n "$a_deplib"; then
  17763. + droppeddeps=yes
  17764. + echo
  17765. + $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  17766. + echo "*** I have the capability to make that library automatically link in when"
  17767. + echo "*** you link to this library. But I can only do this if you have a"
  17768. + echo "*** shared version of the library, which you do not appear to have"
  17769. + echo "*** because I did check the linker path looking for a file starting"
  17770. + if test -z "$potlib"; then
  17771. + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  17772. + else
  17773. + $ECHO "*** with $libname and none of the candidates passed a file format test"
  17774. + $ECHO "*** using a regex pattern. Last file checked: $potlib"
  17775. + fi
  17776. + fi
  17777. + ;;
  17778. + *)
  17779. + # Add a -L argument.
  17780. + func_append newdeplibs " $a_deplib"
  17781. + ;;
  17782. + esac
  17783. + done # Gone through all deplibs.
  17784. + ;;
  17785. + none | unknown | *)
  17786. + newdeplibs=
  17787. + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
  17788. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  17789. + for i in $predeps $postdeps; do
  17790. + # can't use Xsed below, because $i might contain '/'
  17791. + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
  17792. + done
  17793. + fi
  17794. + case $tmp_deplibs in
  17795. + *[!\ \ ]*)
  17796. + echo
  17797. + if test none = "$deplibs_check_method"; then
  17798. + echo "*** Warning: inter-library dependencies are not supported in this platform."
  17799. + else
  17800. + echo "*** Warning: inter-library dependencies are not known to be supported."
  17801. + fi
  17802. + echo "*** All declared inter-library dependencies are being dropped."
  17803. + droppeddeps=yes
  17804. + ;;
  17805. + esac
  17806. + ;;
  17807. + esac
  17808. + versuffix=$versuffix_save
  17809. + major=$major_save
  17810. + release=$release_save
  17811. + libname=$libname_save
  17812. + name=$name_save
  17813. +
  17814. + case $host in
  17815. + *-*-rhapsody* | *-*-darwin1.[012])
  17816. + # On Rhapsody replace the C library with the System framework
  17817. + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
  17818. + ;;
  17819. + esac
  17820. +
  17821. + if test yes = "$droppeddeps"; then
  17822. + if test yes = "$module"; then
  17823. + echo
  17824. + echo "*** Warning: libtool could not satisfy all declared inter-library"
  17825. + $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
  17826. + echo "*** a static module, that should work as long as the dlopening"
  17827. + echo "*** application is linked with the -dlopen flag."
  17828. + if test -z "$global_symbol_pipe"; then
  17829. + echo
  17830. + echo "*** However, this would only work if libtool was able to extract symbol"
  17831. + echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  17832. + echo "*** not find such a program. So, this module is probably useless."
  17833. + echo "*** 'nm' from GNU binutils and a full rebuild may help."
  17834. + fi
  17835. + if test no = "$build_old_libs"; then
  17836. + oldlibs=$output_objdir/$libname.$libext
  17837. + build_libtool_libs=module
  17838. + build_old_libs=yes
  17839. + else
  17840. + build_libtool_libs=no
  17841. + fi
  17842. + else
  17843. + echo "*** The inter-library dependencies that have been dropped here will be"
  17844. + echo "*** automatically added whenever a program is linked with this library"
  17845. + echo "*** or is declared to -dlopen it."
  17846. +
  17847. + if test no = "$allow_undefined"; then
  17848. + echo
  17849. + echo "*** Since this library must not contain undefined symbols,"
  17850. + echo "*** because either the platform does not support them or"
  17851. + echo "*** it was explicitly requested with -no-undefined,"
  17852. + echo "*** libtool will only create a static version of it."
  17853. + if test no = "$build_old_libs"; then
  17854. + oldlibs=$output_objdir/$libname.$libext
  17855. + build_libtool_libs=module
  17856. + build_old_libs=yes
  17857. + else
  17858. + build_libtool_libs=no
  17859. + fi
  17860. + fi
  17861. + fi
  17862. + fi
  17863. + # Done checking deplibs!
  17864. + deplibs=$newdeplibs
  17865. + fi
  17866. + # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  17867. + case $host in
  17868. + *-*-darwin*)
  17869. + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  17870. + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  17871. + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  17872. + ;;
  17873. + esac
  17874. +
  17875. + # move library search paths that coincide with paths to not yet
  17876. + # installed libraries to the beginning of the library search list
  17877. + new_libs=
  17878. + for path in $notinst_path; do
  17879. + case " $new_libs " in
  17880. + *" -L$path/$objdir "*) ;;
  17881. + *)
  17882. + case " $deplibs " in
  17883. + *" -L$path/$objdir "*)
  17884. + func_append new_libs " -L$path/$objdir" ;;
  17885. + esac
  17886. + ;;
  17887. + esac
  17888. + done
  17889. + for deplib in $deplibs; do
  17890. + case $deplib in
  17891. + -L*)
  17892. + case " $new_libs " in
  17893. + *" $deplib "*) ;;
  17894. + *) func_append new_libs " $deplib" ;;
  17895. + esac
  17896. + ;;
  17897. + *) func_append new_libs " $deplib" ;;
  17898. + esac
  17899. + done
  17900. + deplibs=$new_libs
  17901. +
  17902. + # All the library-specific variables (install_libdir is set above).
  17903. + library_names=
  17904. + old_library=
  17905. + dlname=
  17906. +
  17907. + # Test again, we may have decided not to build it any more
  17908. + if test yes = "$build_libtool_libs"; then
  17909. + # Remove $wl instances when linking with ld.
  17910. + # FIXME: should test the right _cmds variable.
  17911. + case $archive_cmds in
  17912. + *\$LD\ *) wl= ;;
  17913. + esac
  17914. + if test yes = "$hardcode_into_libs"; then
  17915. + # Hardcode the library paths
  17916. + hardcode_libdirs=
  17917. + dep_rpath=
  17918. + rpath=$finalize_rpath
  17919. + test relink = "$opt_mode" || rpath=$compile_rpath$rpath
  17920. + for libdir in $rpath; do
  17921. + if test -n "$hardcode_libdir_flag_spec"; then
  17922. + if test -n "$hardcode_libdir_separator"; then
  17923. + func_replace_sysroot "$libdir"
  17924. + libdir=$func_replace_sysroot_result
  17925. + if test -z "$hardcode_libdirs"; then
  17926. + hardcode_libdirs=$libdir
  17927. + else
  17928. + # Just accumulate the unique libdirs.
  17929. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  17930. + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  17931. + ;;
  17932. + *)
  17933. + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  17934. + ;;
  17935. + esac
  17936. + fi
  17937. + else
  17938. + eval flag=\"$hardcode_libdir_flag_spec\"
  17939. + func_append dep_rpath " $flag"
  17940. + fi
  17941. + elif test -n "$runpath_var"; then
  17942. + case "$perm_rpath " in
  17943. + *" $libdir "*) ;;
  17944. + *) func_append perm_rpath " $libdir" ;;
  17945. + esac
  17946. + fi
  17947. + done
  17948. + # Substitute the hardcoded libdirs into the rpath.
  17949. + if test -n "$hardcode_libdir_separator" &&
  17950. + test -n "$hardcode_libdirs"; then
  17951. + libdir=$hardcode_libdirs
  17952. + eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
  17953. + fi
  17954. + if test -n "$runpath_var" && test -n "$perm_rpath"; then
  17955. + # We should set the runpath_var.
  17956. + rpath=
  17957. + for dir in $perm_rpath; do
  17958. + func_append rpath "$dir:"
  17959. + done
  17960. + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  17961. + fi
  17962. + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  17963. + fi
  17964. +
  17965. + shlibpath=$finalize_shlibpath
  17966. + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
  17967. + if test -n "$shlibpath"; then
  17968. + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  17969. + fi
  17970. +
  17971. + # Get the real and link names of the library.
  17972. + eval shared_ext=\"$shrext_cmds\"
  17973. + eval library_names=\"$library_names_spec\"
  17974. + set dummy $library_names
  17975. + shift
  17976. + realname=$1
  17977. + shift
  17978. +
  17979. + if test -n "$soname_spec"; then
  17980. + eval soname=\"$soname_spec\"
  17981. + else
  17982. + soname=$realname
  17983. + fi
  17984. + if test -z "$dlname"; then
  17985. + dlname=$soname
  17986. + fi
  17987. +
  17988. + lib=$output_objdir/$realname
  17989. + linknames=
  17990. + for link
  17991. + do
  17992. + func_append linknames " $link"
  17993. + done
  17994. +
  17995. + # Use standard objects if they are pic
  17996. + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  17997. + test "X$libobjs" = "X " && libobjs=
  17998. +
  17999. + delfiles=
  18000. + if test -n "$export_symbols" && test -n "$include_expsyms"; then
  18001. + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  18002. + export_symbols=$output_objdir/$libname.uexp
  18003. + func_append delfiles " $export_symbols"
  18004. + fi
  18005. +
  18006. + orig_export_symbols=
  18007. + case $host_os in
  18008. + cygwin* | mingw* | cegcc*)
  18009. + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  18010. + # exporting using user supplied symfile
  18011. + func_dll_def_p "$export_symbols" || {
  18012. + # and it's NOT already a .def file. Must figure out
  18013. + # which of the given symbols are data symbols and tag
  18014. + # them as such. So, trigger use of export_symbols_cmds.
  18015. + # export_symbols gets reassigned inside the "prepare
  18016. + # the list of exported symbols" if statement, so the
  18017. + # include_expsyms logic still works.
  18018. + orig_export_symbols=$export_symbols
  18019. + export_symbols=
  18020. + always_export_symbols=yes
  18021. + }
  18022. + fi
  18023. + ;;
  18024. + esac
  18025. +
  18026. + # Prepare the list of exported symbols
  18027. + if test -z "$export_symbols"; then
  18028. + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
  18029. + func_verbose "generating symbol list for '$libname.la'"
  18030. + export_symbols=$output_objdir/$libname.exp
  18031. + $opt_dry_run || $RM $export_symbols
  18032. + cmds=$export_symbols_cmds
  18033. + save_ifs=$IFS; IFS='~'
  18034. + for cmd1 in $cmds; do
  18035. + IFS=$save_ifs
  18036. + # Take the normal branch if the nm_file_list_spec branch
  18037. + # doesn't work or if tool conversion is not needed.
  18038. + case $nm_file_list_spec~$to_tool_file_cmd in
  18039. + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
  18040. + try_normal_branch=yes
  18041. + eval cmd=\"$cmd1\"
  18042. + func_len " $cmd"
  18043. + len=$func_len_result
  18044. + ;;
  18045. + *)
  18046. + try_normal_branch=no
  18047. + ;;
  18048. + esac
  18049. + if test yes = "$try_normal_branch" \
  18050. + && { test "$len" -lt "$max_cmd_len" \
  18051. + || test "$max_cmd_len" -le -1; }
  18052. + then
  18053. + func_show_eval "$cmd" 'exit $?'
  18054. + skipped_export=false
  18055. + elif test -n "$nm_file_list_spec"; then
  18056. + func_basename "$output"
  18057. + output_la=$func_basename_result
  18058. + save_libobjs=$libobjs
  18059. + save_output=$output
  18060. + output=$output_objdir/$output_la.nm
  18061. + func_to_tool_file "$output"
  18062. + libobjs=$nm_file_list_spec$func_to_tool_file_result
  18063. + func_append delfiles " $output"
  18064. + func_verbose "creating $NM input file list: $output"
  18065. + for obj in $save_libobjs; do
  18066. + func_to_tool_file "$obj"
  18067. + $ECHO "$func_to_tool_file_result"
  18068. + done > "$output"
  18069. + eval cmd=\"$cmd1\"
  18070. + func_show_eval "$cmd" 'exit $?'
  18071. + output=$save_output
  18072. + libobjs=$save_libobjs
  18073. + skipped_export=false
  18074. + else
  18075. + # The command line is too long to execute in one step.
  18076. + func_verbose "using reloadable object file for export list..."
  18077. + skipped_export=:
  18078. + # Break out early, otherwise skipped_export may be
  18079. + # set to false by a later but shorter cmd.
  18080. + break
  18081. + fi
  18082. + done
  18083. + IFS=$save_ifs
  18084. + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
  18085. + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  18086. + func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  18087. + fi
  18088. + fi
  18089. + fi
  18090. +
  18091. + if test -n "$export_symbols" && test -n "$include_expsyms"; then
  18092. + tmp_export_symbols=$export_symbols
  18093. + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  18094. + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  18095. + fi
  18096. +
  18097. + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
  18098. + # The given exports_symbols file has to be filtered, so filter it.
  18099. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  18100. + # FIXME: $output_objdir/$libname.filter potentially contains lots of
  18101. + # 's' commands, which not all seds can handle. GNU sed should be fine
  18102. + # though. Also, the filter scales superlinearly with the number of
  18103. + # global variables. join(1) would be nice here, but unfortunately
  18104. + # isn't a blessed tool.
  18105. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  18106. + func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  18107. + export_symbols=$output_objdir/$libname.def
  18108. + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  18109. + fi
  18110. +
  18111. + tmp_deplibs=
  18112. + for test_deplib in $deplibs; do
  18113. + case " $convenience " in
  18114. + *" $test_deplib "*) ;;
  18115. + *)
  18116. + func_append tmp_deplibs " $test_deplib"
  18117. + ;;
  18118. + esac
  18119. + done
  18120. + deplibs=$tmp_deplibs
  18121. +
  18122. + if test -n "$convenience"; then
  18123. + if test -n "$whole_archive_flag_spec" &&
  18124. + test yes = "$compiler_needs_object" &&
  18125. + test -z "$libobjs"; then
  18126. + # extract the archives, so we have objects to list.
  18127. + # TODO: could optimize this to just extract one archive.
  18128. + whole_archive_flag_spec=
  18129. + fi
  18130. + if test -n "$whole_archive_flag_spec"; then
  18131. + save_libobjs=$libobjs
  18132. + eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  18133. + test "X$libobjs" = "X " && libobjs=
  18134. + else
  18135. + gentop=$output_objdir/${outputname}x
  18136. + func_append generated " $gentop"
  18137. +
  18138. + func_extract_archives $gentop $convenience
  18139. + func_append libobjs " $func_extract_archives_result"
  18140. + test "X$libobjs" = "X " && libobjs=
  18141. + fi
  18142. + fi
  18143. +
  18144. + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
  18145. + eval flag=\"$thread_safe_flag_spec\"
  18146. + func_append linker_flags " $flag"
  18147. + fi
  18148. +
  18149. + # Make a backup of the uninstalled library when relinking
  18150. + if test relink = "$opt_mode"; then
  18151. + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  18152. + fi
  18153. +
  18154. + # Do each of the archive commands.
  18155. + if test yes = "$module" && test -n "$module_cmds"; then
  18156. + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  18157. + eval test_cmds=\"$module_expsym_cmds\"
  18158. + cmds=$module_expsym_cmds
  18159. + else
  18160. + eval test_cmds=\"$module_cmds\"
  18161. + cmds=$module_cmds
  18162. + fi
  18163. + else
  18164. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  18165. + eval test_cmds=\"$archive_expsym_cmds\"
  18166. + cmds=$archive_expsym_cmds
  18167. + else
  18168. + eval test_cmds=\"$archive_cmds\"
  18169. + cmds=$archive_cmds
  18170. + fi
  18171. + fi
  18172. +
  18173. + if test : != "$skipped_export" &&
  18174. + func_len " $test_cmds" &&
  18175. + len=$func_len_result &&
  18176. + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  18177. + :
  18178. + else
  18179. + # The command line is too long to link in one step, link piecewise
  18180. + # or, if using GNU ld and skipped_export is not :, use a linker
  18181. + # script.
  18182. +
  18183. + # Save the value of $output and $libobjs because we want to
  18184. + # use them later. If we have whole_archive_flag_spec, we
  18185. + # want to use save_libobjs as it was before
  18186. + # whole_archive_flag_spec was expanded, because we can't
  18187. + # assume the linker understands whole_archive_flag_spec.
  18188. + # This may have to be revisited, in case too many
  18189. + # convenience libraries get linked in and end up exceeding
  18190. + # the spec.
  18191. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  18192. + save_libobjs=$libobjs
  18193. + fi
  18194. + save_output=$output
  18195. + func_basename "$output"
  18196. + output_la=$func_basename_result
  18197. +
  18198. + # Clear the reloadable object creation command queue and
  18199. + # initialize k to one.
  18200. + test_cmds=
  18201. + concat_cmds=
  18202. + objlist=
  18203. + last_robj=
  18204. + k=1
  18205. +
  18206. + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
  18207. + output=$output_objdir/$output_la.lnkscript
  18208. + func_verbose "creating GNU ld script: $output"
  18209. + echo 'INPUT (' > $output
  18210. + for obj in $save_libobjs
  18211. + do
  18212. + func_to_tool_file "$obj"
  18213. + $ECHO "$func_to_tool_file_result" >> $output
  18214. + done
  18215. + echo ')' >> $output
  18216. + func_append delfiles " $output"
  18217. + func_to_tool_file "$output"
  18218. + output=$func_to_tool_file_result
  18219. + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
  18220. + output=$output_objdir/$output_la.lnk
  18221. + func_verbose "creating linker input file list: $output"
  18222. + : > $output
  18223. + set x $save_libobjs
  18224. + shift
  18225. + firstobj=
  18226. + if test yes = "$compiler_needs_object"; then
  18227. + firstobj="$1 "
  18228. + shift
  18229. + fi
  18230. + for obj
  18231. + do
  18232. + func_to_tool_file "$obj"
  18233. + $ECHO "$func_to_tool_file_result" >> $output
  18234. + done
  18235. + func_append delfiles " $output"
  18236. + func_to_tool_file "$output"
  18237. + output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
  18238. + else
  18239. + if test -n "$save_libobjs"; then
  18240. + func_verbose "creating reloadable object files..."
  18241. + output=$output_objdir/$output_la-$k.$objext
  18242. + eval test_cmds=\"$reload_cmds\"
  18243. + func_len " $test_cmds"
  18244. + len0=$func_len_result
  18245. + len=$len0
  18246. +
  18247. + # Loop over the list of objects to be linked.
  18248. + for obj in $save_libobjs
  18249. + do
  18250. + func_len " $obj"
  18251. + func_arith $len + $func_len_result
  18252. + len=$func_arith_result
  18253. + if test -z "$objlist" ||
  18254. + test "$len" -lt "$max_cmd_len"; then
  18255. + func_append objlist " $obj"
  18256. + else
  18257. + # The command $test_cmds is almost too long, add a
  18258. + # command to the queue.
  18259. + if test 1 -eq "$k"; then
  18260. + # The first file doesn't have a previous command to add.
  18261. + reload_objs=$objlist
  18262. + eval concat_cmds=\"$reload_cmds\"
  18263. + else
  18264. + # All subsequent reloadable object files will link in
  18265. + # the last one created.
  18266. + reload_objs="$objlist $last_robj"
  18267. + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
  18268. + fi
  18269. + last_robj=$output_objdir/$output_la-$k.$objext
  18270. + func_arith $k + 1
  18271. + k=$func_arith_result
  18272. + output=$output_objdir/$output_la-$k.$objext
  18273. + objlist=" $obj"
  18274. + func_len " $last_robj"
  18275. + func_arith $len0 + $func_len_result
  18276. + len=$func_arith_result
  18277. + fi
  18278. + done
  18279. + # Handle the remaining objects by creating one last
  18280. + # reloadable object file. All subsequent reloadable object
  18281. + # files will link in the last one created.
  18282. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  18283. + reload_objs="$objlist $last_robj"
  18284. + eval concat_cmds=\"\$concat_cmds$reload_cmds\"
  18285. + if test -n "$last_robj"; then
  18286. + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  18287. + fi
  18288. + func_append delfiles " $output"
  18289. +
  18290. + else
  18291. + output=
  18292. + fi
  18293. +
  18294. + ${skipped_export-false} && {
  18295. + func_verbose "generating symbol list for '$libname.la'"
  18296. + export_symbols=$output_objdir/$libname.exp
  18297. + $opt_dry_run || $RM $export_symbols
  18298. + libobjs=$output
  18299. + # Append the command to create the export file.
  18300. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  18301. + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  18302. + if test -n "$last_robj"; then
  18303. + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  18304. + fi
  18305. + }
  18306. +
  18307. + test -n "$save_libobjs" &&
  18308. + func_verbose "creating a temporary reloadable object file: $output"
  18309. +
  18310. + # Loop through the commands generated above and execute them.
  18311. + save_ifs=$IFS; IFS='~'
  18312. + for cmd in $concat_cmds; do
  18313. + IFS=$save_ifs
  18314. + $opt_quiet || {
  18315. + func_quote_for_expand "$cmd"
  18316. + eval "func_echo $func_quote_for_expand_result"
  18317. + }
  18318. + $opt_dry_run || eval "$cmd" || {
  18319. + lt_exit=$?
  18320. +
  18321. + # Restore the uninstalled library and exit
  18322. + if test relink = "$opt_mode"; then
  18323. + ( cd "$output_objdir" && \
  18324. + $RM "${realname}T" && \
  18325. + $MV "${realname}U" "$realname" )
  18326. + fi
  18327. +
  18328. + exit $lt_exit
  18329. + }
  18330. + done
  18331. + IFS=$save_ifs
  18332. +
  18333. + if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  18334. + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  18335. + func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  18336. + fi
  18337. + fi
  18338. +
  18339. + ${skipped_export-false} && {
  18340. + if test -n "$export_symbols" && test -n "$include_expsyms"; then
  18341. + tmp_export_symbols=$export_symbols
  18342. + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  18343. + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  18344. + fi
  18345. +
  18346. + if test -n "$orig_export_symbols"; then
  18347. + # The given exports_symbols file has to be filtered, so filter it.
  18348. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  18349. + # FIXME: $output_objdir/$libname.filter potentially contains lots of
  18350. + # 's' commands, which not all seds can handle. GNU sed should be fine
  18351. + # though. Also, the filter scales superlinearly with the number of
  18352. + # global variables. join(1) would be nice here, but unfortunately
  18353. + # isn't a blessed tool.
  18354. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  18355. + func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  18356. + export_symbols=$output_objdir/$libname.def
  18357. + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  18358. + fi
  18359. + }
  18360. +
  18361. + libobjs=$output
  18362. + # Restore the value of output.
  18363. + output=$save_output
  18364. +
  18365. + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  18366. + eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  18367. + test "X$libobjs" = "X " && libobjs=
  18368. + fi
  18369. + # Expand the library linking commands again to reset the
  18370. + # value of $libobjs for piecewise linking.
  18371. +
  18372. + # Do each of the archive commands.
  18373. + if test yes = "$module" && test -n "$module_cmds"; then
  18374. + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  18375. + cmds=$module_expsym_cmds
  18376. + else
  18377. + cmds=$module_cmds
  18378. + fi
  18379. + else
  18380. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  18381. + cmds=$archive_expsym_cmds
  18382. + else
  18383. + cmds=$archive_cmds
  18384. + fi
  18385. + fi
  18386. + fi
  18387. +
  18388. + if test -n "$delfiles"; then
  18389. + # Append the command to remove temporary files to $cmds.
  18390. + eval cmds=\"\$cmds~\$RM $delfiles\"
  18391. + fi
  18392. +
  18393. + # Add any objects from preloaded convenience libraries
  18394. + if test -n "$dlprefiles"; then
  18395. + gentop=$output_objdir/${outputname}x
  18396. + func_append generated " $gentop"
  18397. +
  18398. + func_extract_archives $gentop $dlprefiles
  18399. + func_append libobjs " $func_extract_archives_result"
  18400. + test "X$libobjs" = "X " && libobjs=
  18401. + fi
  18402. +
  18403. + save_ifs=$IFS; IFS='~'
  18404. + for cmd in $cmds; do
  18405. + IFS=$sp$nl
  18406. + eval cmd=\"$cmd\"
  18407. + IFS=$save_ifs
  18408. + $opt_quiet || {
  18409. + func_quote_for_expand "$cmd"
  18410. + eval "func_echo $func_quote_for_expand_result"
  18411. + }
  18412. + $opt_dry_run || eval "$cmd" || {
  18413. + lt_exit=$?
  18414. +
  18415. + # Restore the uninstalled library and exit
  18416. + if test relink = "$opt_mode"; then
  18417. + ( cd "$output_objdir" && \
  18418. + $RM "${realname}T" && \
  18419. + $MV "${realname}U" "$realname" )
  18420. + fi
  18421. +
  18422. + exit $lt_exit
  18423. + }
  18424. + done
  18425. + IFS=$save_ifs
  18426. +
  18427. + # Restore the uninstalled library and exit
  18428. + if test relink = "$opt_mode"; then
  18429. + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  18430. +
  18431. + if test -n "$convenience"; then
  18432. + if test -z "$whole_archive_flag_spec"; then
  18433. + func_show_eval '${RM}r "$gentop"'
  18434. + fi
  18435. + fi
  18436. +
  18437. + exit $EXIT_SUCCESS
  18438. + fi
  18439. +
  18440. + # Create links to the real library.
  18441. + for linkname in $linknames; do
  18442. + if test "$realname" != "$linkname"; then
  18443. + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  18444. + fi
  18445. + done
  18446. +
  18447. + # If -module or -export-dynamic was specified, set the dlname.
  18448. + if test yes = "$module" || test yes = "$export_dynamic"; then
  18449. + # On all known operating systems, these are identical.
  18450. + dlname=$soname
  18451. + fi
  18452. + fi
  18453. + ;;
  18454. +
  18455. + obj)
  18456. + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  18457. + func_warning "'-dlopen' is ignored for objects"
  18458. + fi
  18459. +
  18460. + case " $deplibs" in
  18461. + *\ -l* | *\ -L*)
  18462. + func_warning "'-l' and '-L' are ignored for objects" ;;
  18463. + esac
  18464. +
  18465. + test -n "$rpath" && \
  18466. + func_warning "'-rpath' is ignored for objects"
  18467. +
  18468. + test -n "$xrpath" && \
  18469. + func_warning "'-R' is ignored for objects"
  18470. +
  18471. + test -n "$vinfo" && \
  18472. + func_warning "'-version-info' is ignored for objects"
  18473. +
  18474. + test -n "$release" && \
  18475. + func_warning "'-release' is ignored for objects"
  18476. +
  18477. + case $output in
  18478. + *.lo)
  18479. + test -n "$objs$old_deplibs" && \
  18480. + func_fatal_error "cannot build library object '$output' from non-libtool objects"
  18481. +
  18482. + libobj=$output
  18483. + func_lo2o "$libobj"
  18484. + obj=$func_lo2o_result
  18485. + ;;
  18486. + *)
  18487. + libobj=
  18488. + obj=$output
  18489. + ;;
  18490. + esac
  18491. +
  18492. + # Delete the old objects.
  18493. + $opt_dry_run || $RM $obj $libobj
  18494. +
  18495. + # Objects from convenience libraries. This assumes
  18496. + # single-version convenience libraries. Whenever we create
  18497. + # different ones for PIC/non-PIC, this we'll have to duplicate
  18498. + # the extraction.
  18499. + reload_conv_objs=
  18500. + gentop=
  18501. + # if reload_cmds runs $LD directly, get rid of -Wl from
  18502. + # whole_archive_flag_spec and hope we can get by with turning comma
  18503. + # into space.
  18504. + case $reload_cmds in
  18505. + *\$LD[\ \$]*) wl= ;;
  18506. + esac
  18507. + if test -n "$convenience"; then
  18508. + if test -n "$whole_archive_flag_spec"; then
  18509. + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  18510. + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
  18511. + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
  18512. + else
  18513. + gentop=$output_objdir/${obj}x
  18514. + func_append generated " $gentop"
  18515. +
  18516. + func_extract_archives $gentop $convenience
  18517. + reload_conv_objs="$reload_objs $func_extract_archives_result"
  18518. + fi
  18519. + fi
  18520. +
  18521. + # If we're not building shared, we need to use non_pic_objs
  18522. + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
  18523. +
  18524. + # Create the old-style object.
  18525. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
  18526. +
  18527. + output=$obj
  18528. + func_execute_cmds "$reload_cmds" 'exit $?'
  18529. +
  18530. + # Exit if we aren't doing a library object file.
  18531. + if test -z "$libobj"; then
  18532. + if test -n "$gentop"; then
  18533. + func_show_eval '${RM}r "$gentop"'
  18534. + fi
  18535. +
  18536. + exit $EXIT_SUCCESS
  18537. + fi
  18538. +
  18539. + test yes = "$build_libtool_libs" || {
  18540. + if test -n "$gentop"; then
  18541. + func_show_eval '${RM}r "$gentop"'
  18542. + fi
  18543. +
  18544. + # Create an invalid libtool object if no PIC, so that we don't
  18545. + # accidentally link it into a program.
  18546. + # $show "echo timestamp > $libobj"
  18547. + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  18548. + exit $EXIT_SUCCESS
  18549. + }
  18550. +
  18551. + if test -n "$pic_flag" || test default != "$pic_mode"; then
  18552. + # Only do commands if we really have different PIC objects.
  18553. + reload_objs="$libobjs $reload_conv_objs"
  18554. + output=$libobj
  18555. + func_execute_cmds "$reload_cmds" 'exit $?'
  18556. + fi
  18557. +
  18558. + if test -n "$gentop"; then
  18559. + func_show_eval '${RM}r "$gentop"'
  18560. + fi
  18561. +
  18562. + exit $EXIT_SUCCESS
  18563. + ;;
  18564. +
  18565. + prog)
  18566. + case $host in
  18567. + *cygwin*) func_stripname '' '.exe' "$output"
  18568. + output=$func_stripname_result.exe;;
  18569. + esac
  18570. + test -n "$vinfo" && \
  18571. + func_warning "'-version-info' is ignored for programs"
  18572. +
  18573. + test -n "$release" && \
  18574. + func_warning "'-release' is ignored for programs"
  18575. +
  18576. + $preload \
  18577. + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
  18578. + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
  18579. +
  18580. + case $host in
  18581. + *-*-rhapsody* | *-*-darwin1.[012])
  18582. + # On Rhapsody replace the C library is the System framework
  18583. + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
  18584. + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
  18585. + ;;
  18586. + esac
  18587. +
  18588. + case $host in
  18589. + *-*-darwin*)
  18590. + # Don't allow lazy linking, it breaks C++ global constructors
  18591. + # But is supposedly fixed on 10.4 or later (yay!).
  18592. + if test CXX = "$tagname"; then
  18593. + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  18594. + 10.[0123])
  18595. + func_append compile_command " $wl-bind_at_load"
  18596. + func_append finalize_command " $wl-bind_at_load"
  18597. + ;;
  18598. + esac
  18599. + fi
  18600. + # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  18601. + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  18602. + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  18603. + ;;
  18604. + esac
  18605. +
  18606. +
  18607. + # move library search paths that coincide with paths to not yet
  18608. + # installed libraries to the beginning of the library search list
  18609. + new_libs=
  18610. + for path in $notinst_path; do
  18611. + case " $new_libs " in
  18612. + *" -L$path/$objdir "*) ;;
  18613. + *)
  18614. + case " $compile_deplibs " in
  18615. + *" -L$path/$objdir "*)
  18616. + func_append new_libs " -L$path/$objdir" ;;
  18617. + esac
  18618. + ;;
  18619. + esac
  18620. + done
  18621. + for deplib in $compile_deplibs; do
  18622. + case $deplib in
  18623. + -L*)
  18624. + case " $new_libs " in
  18625. + *" $deplib "*) ;;
  18626. + *) func_append new_libs " $deplib" ;;
  18627. + esac
  18628. + ;;
  18629. + *) func_append new_libs " $deplib" ;;
  18630. + esac
  18631. + done
  18632. + compile_deplibs=$new_libs
  18633. +
  18634. +
  18635. + func_append compile_command " $compile_deplibs"
  18636. + func_append finalize_command " $finalize_deplibs"
  18637. +
  18638. + if test -n "$rpath$xrpath"; then
  18639. + # If the user specified any rpath flags, then add them.
  18640. + for libdir in $rpath $xrpath; do
  18641. + # This is the magic to use -rpath.
  18642. + case "$finalize_rpath " in
  18643. + *" $libdir "*) ;;
  18644. + *) func_append finalize_rpath " $libdir" ;;
  18645. + esac
  18646. + done
  18647. + fi
  18648. +
  18649. + # Now hardcode the library paths
  18650. + rpath=
  18651. + hardcode_libdirs=
  18652. + for libdir in $compile_rpath $finalize_rpath; do
  18653. + if test -n "$hardcode_libdir_flag_spec"; then
  18654. + if test -n "$hardcode_libdir_separator"; then
  18655. + if test -z "$hardcode_libdirs"; then
  18656. + hardcode_libdirs=$libdir
  18657. + else
  18658. + # Just accumulate the unique libdirs.
  18659. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  18660. + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  18661. + ;;
  18662. + *)
  18663. + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  18664. + ;;
  18665. + esac
  18666. + fi
  18667. + else
  18668. + eval flag=\"$hardcode_libdir_flag_spec\"
  18669. + func_append rpath " $flag"
  18670. + fi
  18671. + elif test -n "$runpath_var"; then
  18672. + case "$perm_rpath " in
  18673. + *" $libdir "*) ;;
  18674. + *) func_append perm_rpath " $libdir" ;;
  18675. + esac
  18676. + fi
  18677. + case $host in
  18678. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  18679. + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
  18680. + case :$dllsearchpath: in
  18681. + *":$libdir:"*) ;;
  18682. + ::) dllsearchpath=$libdir;;
  18683. + *) func_append dllsearchpath ":$libdir";;
  18684. + esac
  18685. + case :$dllsearchpath: in
  18686. + *":$testbindir:"*) ;;
  18687. + ::) dllsearchpath=$testbindir;;
  18688. + *) func_append dllsearchpath ":$testbindir";;
  18689. + esac
  18690. + ;;
  18691. + esac
  18692. + done
  18693. + # Substitute the hardcoded libdirs into the rpath.
  18694. + if test -n "$hardcode_libdir_separator" &&
  18695. + test -n "$hardcode_libdirs"; then
  18696. + libdir=$hardcode_libdirs
  18697. + eval rpath=\" $hardcode_libdir_flag_spec\"
  18698. + fi
  18699. + compile_rpath=$rpath
  18700. +
  18701. + rpath=
  18702. + hardcode_libdirs=
  18703. + for libdir in $finalize_rpath; do
  18704. + if test -n "$hardcode_libdir_flag_spec"; then
  18705. + if test -n "$hardcode_libdir_separator"; then
  18706. + if test -z "$hardcode_libdirs"; then
  18707. + hardcode_libdirs=$libdir
  18708. + else
  18709. + # Just accumulate the unique libdirs.
  18710. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  18711. + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  18712. + ;;
  18713. + *)
  18714. + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  18715. + ;;
  18716. + esac
  18717. + fi
  18718. + else
  18719. + eval flag=\"$hardcode_libdir_flag_spec\"
  18720. + func_append rpath " $flag"
  18721. + fi
  18722. + elif test -n "$runpath_var"; then
  18723. + case "$finalize_perm_rpath " in
  18724. + *" $libdir "*) ;;
  18725. + *) func_append finalize_perm_rpath " $libdir" ;;
  18726. + esac
  18727. + fi
  18728. + done
  18729. + # Substitute the hardcoded libdirs into the rpath.
  18730. + if test -n "$hardcode_libdir_separator" &&
  18731. + test -n "$hardcode_libdirs"; then
  18732. + libdir=$hardcode_libdirs
  18733. + eval rpath=\" $hardcode_libdir_flag_spec\"
  18734. + fi
  18735. + finalize_rpath=$rpath
  18736. +
  18737. + if test -n "$libobjs" && test yes = "$build_old_libs"; then
  18738. + # Transform all the library objects into standard objects.
  18739. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  18740. + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  18741. + fi
  18742. +
  18743. + func_generate_dlsyms "$outputname" "@PROGRAM@" false
  18744. +
  18745. + # template prelinking step
  18746. + if test -n "$prelink_cmds"; then
  18747. + func_execute_cmds "$prelink_cmds" 'exit $?'
  18748. + fi
  18749. +
  18750. + wrappers_required=:
  18751. + case $host in
  18752. + *cegcc* | *mingw32ce*)
  18753. + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
  18754. + wrappers_required=false
  18755. + ;;
  18756. + *cygwin* | *mingw* )
  18757. + test yes = "$build_libtool_libs" || wrappers_required=false
  18758. + ;;
  18759. + *)
  18760. + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
  18761. + wrappers_required=false
  18762. + fi
  18763. + ;;
  18764. + esac
  18765. + $wrappers_required || {
  18766. + # Replace the output file specification.
  18767. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  18768. + link_command=$compile_command$compile_rpath
  18769. +
  18770. + # We have no uninstalled library dependencies, so finalize right now.
  18771. + exit_status=0
  18772. + func_show_eval "$link_command" 'exit_status=$?'
  18773. +
  18774. + if test -n "$postlink_cmds"; then
  18775. + func_to_tool_file "$output"
  18776. + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  18777. + func_execute_cmds "$postlink_cmds" 'exit $?'
  18778. + fi
  18779. +
  18780. + # Delete the generated files.
  18781. + if test -f "$output_objdir/${outputname}S.$objext"; then
  18782. + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
  18783. + fi
  18784. +
  18785. + exit $exit_status
  18786. + }
  18787. +
  18788. + if test -n "$compile_shlibpath$finalize_shlibpath"; then
  18789. + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  18790. + fi
  18791. + if test -n "$finalize_shlibpath"; then
  18792. + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  18793. + fi
  18794. +
  18795. + compile_var=
  18796. + finalize_var=
  18797. + if test -n "$runpath_var"; then
  18798. + if test -n "$perm_rpath"; then
  18799. + # We should set the runpath_var.
  18800. + rpath=
  18801. + for dir in $perm_rpath; do
  18802. + func_append rpath "$dir:"
  18803. + done
  18804. + compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  18805. + fi
  18806. + if test -n "$finalize_perm_rpath"; then
  18807. + # We should set the runpath_var.
  18808. + rpath=
  18809. + for dir in $finalize_perm_rpath; do
  18810. + func_append rpath "$dir:"
  18811. + done
  18812. + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  18813. + fi
  18814. + fi
  18815. +
  18816. + if test yes = "$no_install"; then
  18817. + # We don't need to create a wrapper script.
  18818. + link_command=$compile_var$compile_command$compile_rpath
  18819. + # Replace the output file specification.
  18820. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  18821. + # Delete the old output file.
  18822. + $opt_dry_run || $RM $output
  18823. + # Link the executable and exit
  18824. + func_show_eval "$link_command" 'exit $?'
  18825. +
  18826. + if test -n "$postlink_cmds"; then
  18827. + func_to_tool_file "$output"
  18828. + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  18829. + func_execute_cmds "$postlink_cmds" 'exit $?'
  18830. + fi
  18831. +
  18832. + exit $EXIT_SUCCESS
  18833. + fi
  18834. +
  18835. + case $hardcode_action,$fast_install in
  18836. + relink,*)
  18837. + # Fast installation is not supported
  18838. + link_command=$compile_var$compile_command$compile_rpath
  18839. + relink_command=$finalize_var$finalize_command$finalize_rpath
  18840. +
  18841. + func_warning "this platform does not like uninstalled shared libraries"
  18842. + func_warning "'$output' will be relinked during installation"
  18843. + ;;
  18844. + *,yes)
  18845. + link_command=$finalize_var$compile_command$finalize_rpath
  18846. + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
  18847. + ;;
  18848. + *,no)
  18849. + link_command=$compile_var$compile_command$compile_rpath
  18850. + relink_command=$finalize_var$finalize_command$finalize_rpath
  18851. + ;;
  18852. + *,needless)
  18853. + link_command=$finalize_var$compile_command$finalize_rpath
  18854. + relink_command=
  18855. + ;;
  18856. + esac
  18857. +
  18858. + # Replace the output file specification.
  18859. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  18860. +
  18861. + # Delete the old output files.
  18862. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  18863. +
  18864. + func_show_eval "$link_command" 'exit $?'
  18865. +
  18866. + if test -n "$postlink_cmds"; then
  18867. + func_to_tool_file "$output_objdir/$outputname"
  18868. + 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'`
  18869. + func_execute_cmds "$postlink_cmds" 'exit $?'
  18870. + fi
  18871. +
  18872. + # Now create the wrapper script.
  18873. + func_verbose "creating $output"
  18874. +
  18875. + # Quote the relink command for shipping.
  18876. + if test -n "$relink_command"; then
  18877. + # Preserve any variables that may affect compiler behavior
  18878. + for var in $variables_saved_for_relink; do
  18879. + if eval test -z \"\${$var+set}\"; then
  18880. + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  18881. + elif eval var_value=\$$var; test -z "$var_value"; then
  18882. + relink_command="$var=; export $var; $relink_command"
  18883. + else
  18884. + func_quote_for_eval "$var_value"
  18885. + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  18886. + fi
  18887. + done
  18888. + relink_command="(cd `pwd`; $relink_command)"
  18889. + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
  18890. + fi
  18891. +
  18892. + # Only actually do things if not in dry run mode.
  18893. + $opt_dry_run || {
  18894. + # win32 will think the script is a binary if it has
  18895. + # a .exe suffix, so we strip it off here.
  18896. + case $output in
  18897. + *.exe) func_stripname '' '.exe' "$output"
  18898. + output=$func_stripname_result ;;
  18899. + esac
  18900. + # test for cygwin because mv fails w/o .exe extensions
  18901. + case $host in
  18902. + *cygwin*)
  18903. + exeext=.exe
  18904. + func_stripname '' '.exe' "$outputname"
  18905. + outputname=$func_stripname_result ;;
  18906. + *) exeext= ;;
  18907. + esac
  18908. + case $host in
  18909. + *cygwin* | *mingw* )
  18910. + func_dirname_and_basename "$output" "" "."
  18911. + output_name=$func_basename_result
  18912. + output_path=$func_dirname_result
  18913. + cwrappersource=$output_path/$objdir/lt-$output_name.c
  18914. + cwrapper=$output_path/$output_name.exe
  18915. + $RM $cwrappersource $cwrapper
  18916. + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  18917. +
  18918. + func_emit_cwrapperexe_src > $cwrappersource
  18919. +
  18920. + # The wrapper executable is built using the $host compiler,
  18921. + # because it contains $host paths and files. If cross-
  18922. + # compiling, it, like the target executable, must be
  18923. + # executed on the $host or under an emulation environment.
  18924. + $opt_dry_run || {
  18925. + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  18926. + $STRIP $cwrapper
  18927. + }
  18928. +
  18929. + # Now, create the wrapper script for func_source use:
  18930. + func_ltwrapper_scriptname $cwrapper
  18931. + $RM $func_ltwrapper_scriptname_result
  18932. + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  18933. + $opt_dry_run || {
  18934. + # note: this script will not be executed, so do not chmod.
  18935. + if test "x$build" = "x$host"; then
  18936. + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  18937. + else
  18938. + func_emit_wrapper no > $func_ltwrapper_scriptname_result
  18939. + fi
  18940. + }
  18941. + ;;
  18942. + * )
  18943. + $RM $output
  18944. + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  18945. +
  18946. + func_emit_wrapper no > $output
  18947. + chmod +x $output
  18948. + ;;
  18949. + esac
  18950. + }
  18951. + exit $EXIT_SUCCESS
  18952. + ;;
  18953. + esac
  18954. +
  18955. + # See if we need to build an old-fashioned archive.
  18956. + for oldlib in $oldlibs; do
  18957. +
  18958. + case $build_libtool_libs in
  18959. + convenience)
  18960. + oldobjs="$libobjs_save $symfileobj"
  18961. + addlibs=$convenience
  18962. + build_libtool_libs=no
  18963. + ;;
  18964. + module)
  18965. + oldobjs=$libobjs_save
  18966. + addlibs=$old_convenience
  18967. + build_libtool_libs=no
  18968. + ;;
  18969. + *)
  18970. + oldobjs="$old_deplibs $non_pic_objects"
  18971. + $preload && test -f "$symfileobj" \
  18972. + && func_append oldobjs " $symfileobj"
  18973. + addlibs=$old_convenience
  18974. + ;;
  18975. + esac
  18976. +
  18977. + if test -n "$addlibs"; then
  18978. + gentop=$output_objdir/${outputname}x
  18979. + func_append generated " $gentop"
  18980. +
  18981. + func_extract_archives $gentop $addlibs
  18982. + func_append oldobjs " $func_extract_archives_result"
  18983. + fi
  18984. +
  18985. + # Do each command in the archive commands.
  18986. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
  18987. + cmds=$old_archive_from_new_cmds
  18988. + else
  18989. +
  18990. + # Add any objects from preloaded convenience libraries
  18991. + if test -n "$dlprefiles"; then
  18992. + gentop=$output_objdir/${outputname}x
  18993. + func_append generated " $gentop"
  18994. +
  18995. + func_extract_archives $gentop $dlprefiles
  18996. + func_append oldobjs " $func_extract_archives_result"
  18997. + fi
  18998. +
  18999. + # POSIX demands no paths to be encoded in archives. We have
  19000. + # to avoid creating archives with duplicate basenames if we
  19001. + # might have to extract them afterwards, e.g., when creating a
  19002. + # static archive out of a convenience library, or when linking
  19003. + # the entirety of a libtool archive into another (currently
  19004. + # not supported by libtool).
  19005. + if (for obj in $oldobjs
  19006. + do
  19007. + func_basename "$obj"
  19008. + $ECHO "$func_basename_result"
  19009. + done | sort | sort -uc >/dev/null 2>&1); then
  19010. + :
  19011. + else
  19012. + echo "copying selected object files to avoid basename conflicts..."
  19013. + gentop=$output_objdir/${outputname}x
  19014. + func_append generated " $gentop"
  19015. + func_mkdir_p "$gentop"
  19016. + save_oldobjs=$oldobjs
  19017. + oldobjs=
  19018. + counter=1
  19019. + for obj in $save_oldobjs
  19020. + do
  19021. + func_basename "$obj"
  19022. + objbase=$func_basename_result
  19023. + case " $oldobjs " in
  19024. + " ") oldobjs=$obj ;;
  19025. + *[\ /]"$objbase "*)
  19026. + while :; do
  19027. + # Make sure we don't pick an alternate name that also
  19028. + # overlaps.
  19029. + newobj=lt$counter-$objbase
  19030. + func_arith $counter + 1
  19031. + counter=$func_arith_result
  19032. + case " $oldobjs " in
  19033. + *[\ /]"$newobj "*) ;;
  19034. + *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  19035. + esac
  19036. + done
  19037. + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  19038. + func_append oldobjs " $gentop/$newobj"
  19039. + ;;
  19040. + *) func_append oldobjs " $obj" ;;
  19041. + esac
  19042. + done
  19043. + fi
  19044. + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  19045. + tool_oldlib=$func_to_tool_file_result
  19046. + eval cmds=\"$old_archive_cmds\"
  19047. +
  19048. + func_len " $cmds"
  19049. + len=$func_len_result
  19050. + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  19051. + cmds=$old_archive_cmds
  19052. + elif test -n "$archiver_list_spec"; then
  19053. + func_verbose "using command file archive linking..."
  19054. + for obj in $oldobjs
  19055. + do
  19056. + func_to_tool_file "$obj"
  19057. + $ECHO "$func_to_tool_file_result"
  19058. + done > $output_objdir/$libname.libcmd
  19059. + func_to_tool_file "$output_objdir/$libname.libcmd"
  19060. + oldobjs=" $archiver_list_spec$func_to_tool_file_result"
  19061. + cmds=$old_archive_cmds
  19062. + else
  19063. + # the command line is too long to link in one step, link in parts
  19064. + func_verbose "using piecewise archive linking..."
  19065. + save_RANLIB=$RANLIB
  19066. + RANLIB=:
  19067. + objlist=
  19068. + concat_cmds=
  19069. + save_oldobjs=$oldobjs
  19070. + oldobjs=
  19071. + # Is there a better way of finding the last object in the list?
  19072. + for obj in $save_oldobjs
  19073. + do
  19074. + last_oldobj=$obj
  19075. + done
  19076. + eval test_cmds=\"$old_archive_cmds\"
  19077. + func_len " $test_cmds"
  19078. + len0=$func_len_result
  19079. + len=$len0
  19080. + for obj in $save_oldobjs
  19081. + do
  19082. + func_len " $obj"
  19083. + func_arith $len + $func_len_result
  19084. + len=$func_arith_result
  19085. + func_append objlist " $obj"
  19086. + if test "$len" -lt "$max_cmd_len"; then
  19087. + :
  19088. + else
  19089. + # the above command should be used before it gets too long
  19090. + oldobjs=$objlist
  19091. + if test "$obj" = "$last_oldobj"; then
  19092. + RANLIB=$save_RANLIB
  19093. + fi
  19094. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  19095. + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
  19096. + objlist=
  19097. + len=$len0
  19098. + fi
  19099. + done
  19100. + RANLIB=$save_RANLIB
  19101. + oldobjs=$objlist
  19102. + if test -z "$oldobjs"; then
  19103. + eval cmds=\"\$concat_cmds\"
  19104. + else
  19105. + eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  19106. + fi
  19107. + fi
  19108. + fi
  19109. + func_execute_cmds "$cmds" 'exit $?'
  19110. + done
  19111. +
  19112. + test -n "$generated" && \
  19113. + func_show_eval "${RM}r$generated"
  19114. +
  19115. + # Now create the libtool archive.
  19116. + case $output in
  19117. + *.la)
  19118. + old_library=
  19119. + test yes = "$build_old_libs" && old_library=$libname.$libext
  19120. + func_verbose "creating $output"
  19121. +
  19122. + # Preserve any variables that may affect compiler behavior
  19123. + for var in $variables_saved_for_relink; do
  19124. + if eval test -z \"\${$var+set}\"; then
  19125. + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  19126. + elif eval var_value=\$$var; test -z "$var_value"; then
  19127. + relink_command="$var=; export $var; $relink_command"
  19128. + else
  19129. + func_quote_for_eval "$var_value"
  19130. + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  19131. + fi
  19132. + done
  19133. + # Quote the link command for shipping.
  19134. + relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  19135. + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
  19136. + if test yes = "$hardcode_automatic"; then
  19137. + relink_command=
  19138. + fi
  19139. +
  19140. + # Only create the output if not a dry run.
  19141. + $opt_dry_run || {
  19142. + for installed in no yes; do
  19143. + if test yes = "$installed"; then
  19144. + if test -z "$install_libdir"; then
  19145. + break
  19146. + fi
  19147. + output=$output_objdir/${outputname}i
  19148. + # Replace all uninstalled libtool libraries with the installed ones
  19149. + newdependency_libs=
  19150. + for deplib in $dependency_libs; do
  19151. + case $deplib in
  19152. + *.la)
  19153. + func_basename "$deplib"
  19154. + name=$func_basename_result
  19155. + func_resolve_sysroot "$deplib"
  19156. + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
  19157. + test -z "$libdir" && \
  19158. + func_fatal_error "'$deplib' is not a valid libtool archive"
  19159. + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
  19160. + ;;
  19161. + -L*)
  19162. + func_stripname -L '' "$deplib"
  19163. + func_replace_sysroot "$func_stripname_result"
  19164. + func_append newdependency_libs " -L$func_replace_sysroot_result"
  19165. + ;;
  19166. + -R*)
  19167. + func_stripname -R '' "$deplib"
  19168. + func_replace_sysroot "$func_stripname_result"
  19169. + func_append newdependency_libs " -R$func_replace_sysroot_result"
  19170. + ;;
  19171. + *) func_append newdependency_libs " $deplib" ;;
  19172. + esac
  19173. + done
  19174. + dependency_libs=$newdependency_libs
  19175. + newdlfiles=
  19176. +
  19177. + for lib in $dlfiles; do
  19178. + case $lib in
  19179. + *.la)
  19180. + func_basename "$lib"
  19181. + name=$func_basename_result
  19182. + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  19183. + test -z "$libdir" && \
  19184. + func_fatal_error "'$lib' is not a valid libtool archive"
  19185. + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
  19186. + ;;
  19187. + *) func_append newdlfiles " $lib" ;;
  19188. + esac
  19189. + done
  19190. + dlfiles=$newdlfiles
  19191. + newdlprefiles=
  19192. + for lib in $dlprefiles; do
  19193. + case $lib in
  19194. + *.la)
  19195. + # Only pass preopened files to the pseudo-archive (for
  19196. + # eventual linking with the app. that links it) if we
  19197. + # didn't already link the preopened objects directly into
  19198. + # the library:
  19199. + func_basename "$lib"
  19200. + name=$func_basename_result
  19201. + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  19202. + test -z "$libdir" && \
  19203. + func_fatal_error "'$lib' is not a valid libtool archive"
  19204. + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
  19205. + ;;
  19206. + esac
  19207. + done
  19208. + dlprefiles=$newdlprefiles
  19209. + else
  19210. + newdlfiles=
  19211. + for lib in $dlfiles; do
  19212. + case $lib in
  19213. + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  19214. + *) abs=`pwd`"/$lib" ;;
  19215. + esac
  19216. + func_append newdlfiles " $abs"
  19217. + done
  19218. + dlfiles=$newdlfiles
  19219. + newdlprefiles=
  19220. + for lib in $dlprefiles; do
  19221. + case $lib in
  19222. + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  19223. + *) abs=`pwd`"/$lib" ;;
  19224. + esac
  19225. + func_append newdlprefiles " $abs"
  19226. + done
  19227. + dlprefiles=$newdlprefiles
  19228. + fi
  19229. + $RM $output
  19230. + # place dlname in correct position for cygwin
  19231. + # In fact, it would be nice if we could use this code for all target
  19232. + # systems that can't hard-code library paths into their executables
  19233. + # and that have no shared library path variable independent of PATH,
  19234. + # but it turns out we can't easily determine that from inspecting
  19235. + # libtool variables, so we have to hard-code the OSs to which it
  19236. + # applies here; at the moment, that means platforms that use the PE
  19237. + # object format with DLL files. See the long comment at the top of
  19238. + # tests/bindir.at for full details.
  19239. + tdlname=$dlname
  19240. + case $host,$output,$installed,$module,$dlname in
  19241. + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
  19242. + # If a -bindir argument was supplied, place the dll there.
  19243. + if test -n "$bindir"; then
  19244. + func_relative_path "$install_libdir" "$bindir"
  19245. + tdlname=$func_relative_path_result/$dlname
  19246. + else
  19247. + # Otherwise fall back on heuristic.
  19248. + tdlname=../bin/$dlname
  19249. + fi
  19250. + ;;
  19251. + esac
  19252. + $ECHO > $output "\
  19253. +# $outputname - a libtool library file
  19254. +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  19255. +#
  19256. +# Please DO NOT delete this file!
  19257. +# It is necessary for linking the library.
  19258. +
  19259. +# The name that we can dlopen(3).
  19260. +dlname='$tdlname'
  19261. +
  19262. +# Names of this library.
  19263. +library_names='$library_names'
  19264. +
  19265. +# The name of the static archive.
  19266. +old_library='$old_library'
  19267. +
  19268. +# Linker flags that cannot go in dependency_libs.
  19269. +inherited_linker_flags='$new_inherited_linker_flags'
  19270. +
  19271. +# Libraries that this one depends upon.
  19272. +dependency_libs='$dependency_libs'
  19273. +
  19274. +# Names of additional weak libraries provided by this library
  19275. +weak_library_names='$weak_libs'
  19276. +
  19277. +# Version information for $libname.
  19278. +current=$current
  19279. +age=$age
  19280. +revision=$revision
  19281. +
  19282. +# Is this an already installed library?
  19283. +installed=$installed
  19284. +
  19285. +# Should we warn about portability when linking against -modules?
  19286. +shouldnotlink=$module
  19287. +
  19288. +# Files to dlopen/dlpreopen
  19289. +dlopen='$dlfiles'
  19290. +dlpreopen='$dlprefiles'
  19291. +
  19292. +# Directory that this library needs to be installed in:
  19293. +libdir='$install_libdir'"
  19294. + if test no,yes = "$installed,$need_relink"; then
  19295. + $ECHO >> $output "\
  19296. +relink_command=\"$relink_command\""
  19297. + fi
  19298. + done
  19299. + }
  19300. +
  19301. + # Do a symbolic link so that the libtool archive can be found in
  19302. + # LD_LIBRARY_PATH before the program is installed.
  19303. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  19304. + ;;
  19305. + esac
  19306. + exit $EXIT_SUCCESS
  19307. +}
  19308. +
  19309. +if test link = "$opt_mode" || test relink = "$opt_mode"; then
  19310. + func_mode_link ${1+"$@"}
  19311. +fi
  19312. +
  19313. +
  19314. +# func_mode_uninstall arg...
  19315. +func_mode_uninstall ()
  19316. +{
  19317. + $debug_cmd
  19318. +
  19319. + RM=$nonopt
  19320. + files=
  19321. + rmforce=false
  19322. + exit_status=0
  19323. +
  19324. + # This variable tells wrapper scripts just to set variables rather
  19325. + # than running their programs.
  19326. + libtool_install_magic=$magic
  19327. +
  19328. + for arg
  19329. + do
  19330. + case $arg in
  19331. + -f) func_append RM " $arg"; rmforce=: ;;
  19332. + -*) func_append RM " $arg" ;;
  19333. + *) func_append files " $arg" ;;
  19334. + esac
  19335. + done
  19336. +
  19337. + test -z "$RM" && \
  19338. + func_fatal_help "you must specify an RM program"
  19339. +
  19340. + rmdirs=
  19341. +
  19342. + for file in $files; do
  19343. + func_dirname "$file" "" "."
  19344. + dir=$func_dirname_result
  19345. + if test . = "$dir"; then
  19346. + odir=$objdir
  19347. + else
  19348. + odir=$dir/$objdir
  19349. + fi
  19350. + func_basename "$file"
  19351. + name=$func_basename_result
  19352. + test uninstall = "$opt_mode" && odir=$dir
  19353. +
  19354. + # Remember odir for removal later, being careful to avoid duplicates
  19355. + if test clean = "$opt_mode"; then
  19356. + case " $rmdirs " in
  19357. + *" $odir "*) ;;
  19358. + *) func_append rmdirs " $odir" ;;
  19359. + esac
  19360. + fi
  19361. +
  19362. + # Don't error if the file doesn't exist and rm -f was used.
  19363. + if { test -L "$file"; } >/dev/null 2>&1 ||
  19364. + { test -h "$file"; } >/dev/null 2>&1 ||
  19365. + test -f "$file"; then
  19366. + :
  19367. + elif test -d "$file"; then
  19368. + exit_status=1
  19369. + continue
  19370. + elif $rmforce; then
  19371. + continue
  19372. + fi
  19373. +
  19374. + rmfiles=$file
  19375. +
  19376. + case $name in
  19377. + *.la)
  19378. + # Possibly a libtool archive, so verify it.
  19379. + if func_lalib_p "$file"; then
  19380. + func_source $dir/$name
  19381. +
  19382. + # Delete the libtool libraries and symlinks.
  19383. + for n in $library_names; do
  19384. + func_append rmfiles " $odir/$n"
  19385. + done
  19386. + test -n "$old_library" && func_append rmfiles " $odir/$old_library"
  19387. +
  19388. + case $opt_mode in
  19389. + clean)
  19390. + case " $library_names " in
  19391. + *" $dlname "*) ;;
  19392. + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
  19393. + esac
  19394. + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
  19395. + ;;
  19396. + uninstall)
  19397. + if test -n "$library_names"; then
  19398. + # Do each command in the postuninstall commands.
  19399. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
  19400. + fi
  19401. +
  19402. + if test -n "$old_library"; then
  19403. + # Do each command in the old_postuninstall commands.
  19404. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
  19405. + fi
  19406. + # FIXME: should reinstall the best remaining shared library.
  19407. + ;;
  19408. + esac
  19409. + fi
  19410. + ;;
  19411. +
  19412. + *.lo)
  19413. + # Possibly a libtool object, so verify it.
  19414. + if func_lalib_p "$file"; then
  19415. +
  19416. + # Read the .lo file
  19417. + func_source $dir/$name
  19418. +
  19419. + # Add PIC object to the list of files to remove.
  19420. + if test -n "$pic_object" && test none != "$pic_object"; then
  19421. + func_append rmfiles " $dir/$pic_object"
  19422. + fi
  19423. +
  19424. + # Add non-PIC object to the list of files to remove.
  19425. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then
  19426. + func_append rmfiles " $dir/$non_pic_object"
  19427. + fi
  19428. + fi
  19429. + ;;
  19430. +
  19431. + *)
  19432. + if test clean = "$opt_mode"; then
  19433. + noexename=$name
  19434. + case $file in
  19435. + *.exe)
  19436. + func_stripname '' '.exe' "$file"
  19437. + file=$func_stripname_result
  19438. + func_stripname '' '.exe' "$name"
  19439. + noexename=$func_stripname_result
  19440. + # $file with .exe has already been added to rmfiles,
  19441. + # add $file without .exe
  19442. + func_append rmfiles " $file"
  19443. + ;;
  19444. + esac
  19445. + # Do a test to see if this is a libtool program.
  19446. + if func_ltwrapper_p "$file"; then
  19447. + if func_ltwrapper_executable_p "$file"; then
  19448. + func_ltwrapper_scriptname "$file"
  19449. + relink_command=
  19450. + func_source $func_ltwrapper_scriptname_result
  19451. + func_append rmfiles " $func_ltwrapper_scriptname_result"
  19452. + else
  19453. + relink_command=
  19454. + func_source $dir/$noexename
  19455. + fi
  19456. +
  19457. + # note $name still contains .exe if it was in $file originally
  19458. + # as does the version of $file that was added into $rmfiles
  19459. + func_append rmfiles " $odir/$name $odir/${name}S.$objext"
  19460. + if test yes = "$fast_install" && test -n "$relink_command"; then
  19461. + func_append rmfiles " $odir/lt-$name"
  19462. + fi
  19463. + if test "X$noexename" != "X$name"; then
  19464. + func_append rmfiles " $odir/lt-$noexename.c"
  19465. + fi
  19466. + fi
  19467. + fi
  19468. + ;;
  19469. + esac
  19470. + func_show_eval "$RM $rmfiles" 'exit_status=1'
  19471. + done
  19472. +
  19473. + # Try to remove the $objdir's in the directories where we deleted files
  19474. + for dir in $rmdirs; do
  19475. + if test -d "$dir"; then
  19476. + func_show_eval "rmdir $dir >/dev/null 2>&1"
  19477. + fi
  19478. + done
  19479. +
  19480. + exit $exit_status
  19481. +}
  19482. +
  19483. +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
  19484. + func_mode_uninstall ${1+"$@"}
  19485. +fi
  19486. +
  19487. +test -z "$opt_mode" && {
  19488. + help=$generic_help
  19489. + func_fatal_help "you must specify a MODE"
  19490. +}
  19491. +
  19492. +test -z "$exec_cmd" && \
  19493. + func_fatal_help "invalid operation mode '$opt_mode'"
  19494. +
  19495. +if test -n "$exec_cmd"; then
  19496. + eval exec "$exec_cmd"
  19497. + exit $EXIT_FAILURE
  19498. +fi
  19499. +
  19500. +exit $exit_status
  19501. +
  19502. +
  19503. +# The TAGs below are defined such that we never get into a situation
  19504. +# where we disable both kinds of libraries. Given conflicting
  19505. +# choices, we go for a static library, that is the most portable,
  19506. +# since we can't tell whether shared libraries were disabled because
  19507. +# the user asked for that or because the platform doesn't support
  19508. +# them. This is particularly important on AIX, because we don't
  19509. +# support having both static and shared libraries enabled at the same
  19510. +# time on that platform, so we default to a shared-only configuration.
  19511. +# If a disable-shared tag is given, we'll fallback to a static-only
  19512. +# configuration. But we'll never go from static-only to shared-only.
  19513. +
  19514. +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  19515. +build_libtool_libs=no
  19516. +build_old_libs=yes
  19517. +# ### END LIBTOOL TAG CONFIG: disable-shared
  19518. +
  19519. +# ### BEGIN LIBTOOL TAG CONFIG: disable-static
  19520. +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  19521. +# ### END LIBTOOL TAG CONFIG: disable-static
  19522. +
  19523. +# Local Variables:
  19524. +# mode:shell-script
  19525. +# sh-indentation:2
  19526. +# End:
  19527. --- /dev/null
  19528. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/missing
  19529. @@ -0,0 +1,215 @@
  19530. +#! /bin/sh
  19531. +# Common wrapper for a few potentially missing GNU programs.
  19532. +
  19533. +scriptversion=2013-10-28.13; # UTC
  19534. +
  19535. +# Copyright (C) 1996-2014 Free Software Foundation, Inc.
  19536. +# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
  19537. +
  19538. +# This program is free software; you can redistribute it and/or modify
  19539. +# it under the terms of the GNU General Public License as published by
  19540. +# the Free Software Foundation; either version 2, or (at your option)
  19541. +# any later version.
  19542. +
  19543. +# This program is distributed in the hope that it will be useful,
  19544. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  19545. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19546. +# GNU General Public License for more details.
  19547. +
  19548. +# You should have received a copy of the GNU General Public License
  19549. +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  19550. +
  19551. +# As a special exception to the GNU General Public License, if you
  19552. +# distribute this file as part of a program that contains a
  19553. +# configuration script generated by Autoconf, you may include it under
  19554. +# the same distribution terms that you use for the rest of that program.
  19555. +
  19556. +if test $# -eq 0; then
  19557. + echo 1>&2 "Try '$0 --help' for more information"
  19558. + exit 1
  19559. +fi
  19560. +
  19561. +case $1 in
  19562. +
  19563. + --is-lightweight)
  19564. + # Used by our autoconf macros to check whether the available missing
  19565. + # script is modern enough.
  19566. + exit 0
  19567. + ;;
  19568. +
  19569. + --run)
  19570. + # Back-compat with the calling convention used by older automake.
  19571. + shift
  19572. + ;;
  19573. +
  19574. + -h|--h|--he|--hel|--help)
  19575. + echo "\
  19576. +$0 [OPTION]... PROGRAM [ARGUMENT]...
  19577. +
  19578. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
  19579. +to PROGRAM being missing or too old.
  19580. +
  19581. +Options:
  19582. + -h, --help display this help and exit
  19583. + -v, --version output version information and exit
  19584. +
  19585. +Supported PROGRAM values:
  19586. + aclocal autoconf autoheader autom4te automake makeinfo
  19587. + bison yacc flex lex help2man
  19588. +
  19589. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
  19590. +'g' are ignored when checking the name.
  19591. +
  19592. +Send bug reports to <bug-automake@gnu.org>."
  19593. + exit $?
  19594. + ;;
  19595. +
  19596. + -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
  19597. + echo "missing $scriptversion (GNU Automake)"
  19598. + exit $?
  19599. + ;;
  19600. +
  19601. + -*)
  19602. + echo 1>&2 "$0: unknown '$1' option"
  19603. + echo 1>&2 "Try '$0 --help' for more information"
  19604. + exit 1
  19605. + ;;
  19606. +
  19607. +esac
  19608. +
  19609. +# Run the given program, remember its exit status.
  19610. +"$@"; st=$?
  19611. +
  19612. +# If it succeeded, we are done.
  19613. +test $st -eq 0 && exit 0
  19614. +
  19615. +# Also exit now if we it failed (or wasn't found), and '--version' was
  19616. +# passed; such an option is passed most likely to detect whether the
  19617. +# program is present and works.
  19618. +case $2 in --version|--help) exit $st;; esac
  19619. +
  19620. +# Exit code 63 means version mismatch. This often happens when the user
  19621. +# tries to use an ancient version of a tool on a file that requires a
  19622. +# minimum version.
  19623. +if test $st -eq 63; then
  19624. + msg="probably too old"
  19625. +elif test $st -eq 127; then
  19626. + # Program was missing.
  19627. + msg="missing on your system"
  19628. +else
  19629. + # Program was found and executed, but failed. Give up.
  19630. + exit $st
  19631. +fi
  19632. +
  19633. +perl_URL=http://www.perl.org/
  19634. +flex_URL=http://flex.sourceforge.net/
  19635. +gnu_software_URL=http://www.gnu.org/software
  19636. +
  19637. +program_details ()
  19638. +{
  19639. + case $1 in
  19640. + aclocal|automake)
  19641. + echo "The '$1' program is part of the GNU Automake package:"
  19642. + echo "<$gnu_software_URL/automake>"
  19643. + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
  19644. + echo "<$gnu_software_URL/autoconf>"
  19645. + echo "<$gnu_software_URL/m4/>"
  19646. + echo "<$perl_URL>"
  19647. + ;;
  19648. + autoconf|autom4te|autoheader)
  19649. + echo "The '$1' program is part of the GNU Autoconf package:"
  19650. + echo "<$gnu_software_URL/autoconf/>"
  19651. + echo "It also requires GNU m4 and Perl in order to run:"
  19652. + echo "<$gnu_software_URL/m4/>"
  19653. + echo "<$perl_URL>"
  19654. + ;;
  19655. + esac
  19656. +}
  19657. +
  19658. +give_advice ()
  19659. +{
  19660. + # Normalize program name to check for.
  19661. + normalized_program=`echo "$1" | sed '
  19662. + s/^gnu-//; t
  19663. + s/^gnu//; t
  19664. + s/^g//; t'`
  19665. +
  19666. + printf '%s\n' "'$1' is $msg."
  19667. +
  19668. + configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
  19669. + case $normalized_program in
  19670. + autoconf*)
  19671. + echo "You should only need it if you modified 'configure.ac',"
  19672. + echo "or m4 files included by it."
  19673. + program_details 'autoconf'
  19674. + ;;
  19675. + autoheader*)
  19676. + echo "You should only need it if you modified 'acconfig.h' or"
  19677. + echo "$configure_deps."
  19678. + program_details 'autoheader'
  19679. + ;;
  19680. + automake*)
  19681. + echo "You should only need it if you modified 'Makefile.am' or"
  19682. + echo "$configure_deps."
  19683. + program_details 'automake'
  19684. + ;;
  19685. + aclocal*)
  19686. + echo "You should only need it if you modified 'acinclude.m4' or"
  19687. + echo "$configure_deps."
  19688. + program_details 'aclocal'
  19689. + ;;
  19690. + autom4te*)
  19691. + echo "You might have modified some maintainer files that require"
  19692. + echo "the 'autom4te' program to be rebuilt."
  19693. + program_details 'autom4te'
  19694. + ;;
  19695. + bison*|yacc*)
  19696. + echo "You should only need it if you modified a '.y' file."
  19697. + echo "You may want to install the GNU Bison package:"
  19698. + echo "<$gnu_software_URL/bison/>"
  19699. + ;;
  19700. + lex*|flex*)
  19701. + echo "You should only need it if you modified a '.l' file."
  19702. + echo "You may want to install the Fast Lexical Analyzer package:"
  19703. + echo "<$flex_URL>"
  19704. + ;;
  19705. + help2man*)
  19706. + echo "You should only need it if you modified a dependency" \
  19707. + "of a man page."
  19708. + echo "You may want to install the GNU Help2man package:"
  19709. + echo "<$gnu_software_URL/help2man/>"
  19710. + ;;
  19711. + makeinfo*)
  19712. + echo "You should only need it if you modified a '.texi' file, or"
  19713. + echo "any other file indirectly affecting the aspect of the manual."
  19714. + echo "You might want to install the Texinfo package:"
  19715. + echo "<$gnu_software_URL/texinfo/>"
  19716. + echo "The spurious makeinfo call might also be the consequence of"
  19717. + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
  19718. + echo "want to install GNU make:"
  19719. + echo "<$gnu_software_URL/make/>"
  19720. + ;;
  19721. + *)
  19722. + echo "You might have modified some files without having the proper"
  19723. + echo "tools for further handling them. Check the 'README' file, it"
  19724. + echo "often tells you about the needed prerequisites for installing"
  19725. + echo "this package. You may also peek at any GNU archive site, in"
  19726. + echo "case some other package contains this missing '$1' program."
  19727. + ;;
  19728. + esac
  19729. +}
  19730. +
  19731. +give_advice "$1" | sed -e '1s/^/WARNING: /' \
  19732. + -e '2,$s/^/ /' >&2
  19733. +
  19734. +# Propagate the correct exit status (expected to be 127 for a program
  19735. +# not found, 63 for a program that failed due to version mismatch).
  19736. +exit $st
  19737. +
  19738. +# Local variables:
  19739. +# eval: (add-hook 'write-file-hooks 'time-stamp)
  19740. +# time-stamp-start: "scriptversion="
  19741. +# time-stamp-format: "%:y-%02m-%02d.%02H"
  19742. +# time-stamp-time-zone: "UTC"
  19743. +# time-stamp-end: "; # UTC"
  19744. +# End:
  19745. --- /dev/null
  19746. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autoconf/test-driver
  19747. @@ -0,0 +1,148 @@
  19748. +#! /bin/sh
  19749. +# test-driver - basic testsuite driver script.
  19750. +
  19751. +scriptversion=2013-07-13.22; # UTC
  19752. +
  19753. +# Copyright (C) 2011-2014 Free Software Foundation, Inc.
  19754. +#
  19755. +# This program is free software; you can redistribute it and/or modify
  19756. +# it under the terms of the GNU General Public License as published by
  19757. +# the Free Software Foundation; either version 2, or (at your option)
  19758. +# any later version.
  19759. +#
  19760. +# This program is distributed in the hope that it will be useful,
  19761. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  19762. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19763. +# GNU General Public License for more details.
  19764. +#
  19765. +# You should have received a copy of the GNU General Public License
  19766. +# along with this program. If not, see <http://www.gnu.org/licenses/>.
  19767. +
  19768. +# As a special exception to the GNU General Public License, if you
  19769. +# distribute this file as part of a program that contains a
  19770. +# configuration script generated by Autoconf, you may include it under
  19771. +# the same distribution terms that you use for the rest of that program.
  19772. +
  19773. +# This file is maintained in Automake, please report
  19774. +# bugs to <bug-automake@gnu.org> or send patches to
  19775. +# <automake-patches@gnu.org>.
  19776. +
  19777. +# Make unconditional expansion of undefined variables an error. This
  19778. +# helps a lot in preventing typo-related bugs.
  19779. +set -u
  19780. +
  19781. +usage_error ()
  19782. +{
  19783. + echo "$0: $*" >&2
  19784. + print_usage >&2
  19785. + exit 2
  19786. +}
  19787. +
  19788. +print_usage ()
  19789. +{
  19790. + cat <<END
  19791. +Usage:
  19792. + test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
  19793. + [--expect-failure={yes|no}] [--color-tests={yes|no}]
  19794. + [--enable-hard-errors={yes|no}] [--]
  19795. + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
  19796. +The '--test-name', '--log-file' and '--trs-file' options are mandatory.
  19797. +END
  19798. +}
  19799. +
  19800. +test_name= # Used for reporting.
  19801. +log_file= # Where to save the output of the test script.
  19802. +trs_file= # Where to save the metadata of the test run.
  19803. +expect_failure=no
  19804. +color_tests=no
  19805. +enable_hard_errors=yes
  19806. +while test $# -gt 0; do
  19807. + case $1 in
  19808. + --help) print_usage; exit $?;;
  19809. + --version) echo "test-driver $scriptversion"; exit $?;;
  19810. + --test-name) test_name=$2; shift;;
  19811. + --log-file) log_file=$2; shift;;
  19812. + --trs-file) trs_file=$2; shift;;
  19813. + --color-tests) color_tests=$2; shift;;
  19814. + --expect-failure) expect_failure=$2; shift;;
  19815. + --enable-hard-errors) enable_hard_errors=$2; shift;;
  19816. + --) shift; break;;
  19817. + -*) usage_error "invalid option: '$1'";;
  19818. + *) break;;
  19819. + esac
  19820. + shift
  19821. +done
  19822. +
  19823. +missing_opts=
  19824. +test x"$test_name" = x && missing_opts="$missing_opts --test-name"
  19825. +test x"$log_file" = x && missing_opts="$missing_opts --log-file"
  19826. +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
  19827. +if test x"$missing_opts" != x; then
  19828. + usage_error "the following mandatory options are missing:$missing_opts"
  19829. +fi
  19830. +
  19831. +if test $# -eq 0; then
  19832. + usage_error "missing argument"
  19833. +fi
  19834. +
  19835. +if test $color_tests = yes; then
  19836. + # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
  19837. + red='' # Red.
  19838. + grn='' # Green.
  19839. + lgn='' # Light green.
  19840. + blu='' # Blue.
  19841. + mgn='' # Magenta.
  19842. + std='' # No color.
  19843. +else
  19844. + red= grn= lgn= blu= mgn= std=
  19845. +fi
  19846. +
  19847. +do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
  19848. +trap "st=129; $do_exit" 1
  19849. +trap "st=130; $do_exit" 2
  19850. +trap "st=141; $do_exit" 13
  19851. +trap "st=143; $do_exit" 15
  19852. +
  19853. +# Test script is run here.
  19854. +"$@" >$log_file 2>&1
  19855. +estatus=$?
  19856. +
  19857. +if test $enable_hard_errors = no && test $estatus -eq 99; then
  19858. + tweaked_estatus=1
  19859. +else
  19860. + tweaked_estatus=$estatus
  19861. +fi
  19862. +
  19863. +case $tweaked_estatus:$expect_failure in
  19864. + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
  19865. + 0:*) col=$grn res=PASS recheck=no gcopy=no;;
  19866. + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
  19867. + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
  19868. + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
  19869. + *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
  19870. +esac
  19871. +
  19872. +# Report the test outcome and exit status in the logs, so that one can
  19873. +# know whether the test passed or failed simply by looking at the '.log'
  19874. +# file, without the need of also peaking into the corresponding '.trs'
  19875. +# file (automake bug#11814).
  19876. +echo "$res $test_name (exit status: $estatus)" >>$log_file
  19877. +
  19878. +# Report outcome to console.
  19879. +echo "${col}${res}${std}: $test_name"
  19880. +
  19881. +# Register the test result, and other relevant metadata.
  19882. +echo ":test-result: $res" > $trs_file
  19883. +echo ":global-test-result: $res" >> $trs_file
  19884. +echo ":recheck: $recheck" >> $trs_file
  19885. +echo ":copy-in-global-log: $gcopy" >> $trs_file
  19886. +
  19887. +# Local Variables:
  19888. +# mode: shell-script
  19889. +# sh-indentation: 2
  19890. +# eval: (add-hook 'write-file-hooks 'time-stamp)
  19891. +# time-stamp-start: "scriptversion="
  19892. +# time-stamp-format: "%:y-%02m-%02d.%02H"
  19893. +# time-stamp-time-zone: "UTC"
  19894. +# time-stamp-end: "; # UTC"
  19895. +# End:
  19896. --- /dev/null
  19897. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/autogen.sh
  19898. @@ -0,0 +1,68 @@
  19899. +#!/bin/sh
  19900. +
  19901. +PATH=/usr/local/gnu-autotools/bin/:$PATH
  19902. +export PATH
  19903. +
  19904. +# Start from one level above the build directory
  19905. +if [ -f version ]; then
  19906. + cd ..
  19907. +fi
  19908. +
  19909. +if [ \! -f build/version ]; then
  19910. + echo "Can't find source directory"
  19911. + exit 1
  19912. +fi
  19913. +
  19914. +# BSD make's "OBJDIR" support freaks out the automake-generated
  19915. +# Makefile. Effectively disable it.
  19916. +export MAKEOBJDIRPREFIX=/junk
  19917. +
  19918. +# Start from the build directory, where the version file is located
  19919. +if [ -f build/version ]; then
  19920. + cd build
  19921. +fi
  19922. +
  19923. +if [ \! -f version ]; then
  19924. + echo "Can't find version file"
  19925. + exit 1
  19926. +fi
  19927. +
  19928. +# Update the build number in the 'version' file.
  19929. +# Separate number from additional alpha/beta/etc marker
  19930. +MARKER=`cat version | sed 's/[0-9.]//g'`
  19931. +# Bump the number
  19932. +VN=`cat version | sed 's/[^0-9.]//g'`
  19933. +# Build out the string.
  19934. +VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER"
  19935. +
  19936. +cd ..
  19937. +
  19938. +# Clean up the source dir as much as we can.
  19939. +/bin/sh build/clean.sh
  19940. +
  19941. +# Substitute the versions into Libarchive's archive.h and archive_entry.h
  19942. +perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive.h
  19943. +perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive_entry.h
  19944. +perl -p -i -e "s/^(#define\tARCHIVE_VERSION_ONLY_STRING).*/\$1 \"$VS\"/" libarchive/archive.h
  19945. +# Substitute versions into configure.ac as well
  19946. +perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' configure.ac
  19947. +perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' configure.ac
  19948. +
  19949. +# Remove developer CFLAGS if a release build is being made
  19950. +if [ -n "${MAKE_LIBARCHIVE_RELEASE}" ]; then
  19951. + perl -p -i -e "s/^(DEV_CFLAGS.*)/# \$1/" Makefile.am
  19952. + perl -p -i -e 's/CMAKE_BUILD_TYPE "[A-Za-z]*"/CMAKE_BUILD_TYPE "Release"/' CMakeLists.txt
  19953. +fi
  19954. +
  19955. +set -xe
  19956. +aclocal -I build/autoconf
  19957. +
  19958. +# Note: --automake flag needed only for libtoolize from
  19959. +# libtool 1.5.x; in libtool 2.2.x it is a synonym for --quiet
  19960. +case `uname` in
  19961. +Darwin) glibtoolize --automake -c;;
  19962. +*) libtoolize --automake -c;;
  19963. +esac
  19964. +autoconf
  19965. +autoheader
  19966. +automake -a -c
  19967. --- /dev/null
  19968. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/bump-version.sh
  19969. @@ -0,0 +1,36 @@
  19970. +#!/bin/sh +v
  19971. +
  19972. +# Start from the build directory, where the version file is located
  19973. +if [ -f build/version ]; then
  19974. + cd build
  19975. +fi
  19976. +
  19977. +if [ \! -f version ]; then
  19978. + echo "Can't find version file"
  19979. + exit 1
  19980. +fi
  19981. +
  19982. +# Update the build number in the 'version' file.
  19983. +# Separate number from additional alpha/beta/etc marker
  19984. +MARKER=`cat version | sed 's/[0-9.]//g'`
  19985. +# Bump the number
  19986. +VN=`cat version | sed 's/[^0-9.]//g'`
  19987. +# Reassemble and write back out
  19988. +VN=$(($VN + 1))
  19989. +rm -f version.old
  19990. +mv version version.old
  19991. +chmod +w version.old
  19992. +echo $VN$MARKER > version
  19993. +VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER"
  19994. +cd ..
  19995. +
  19996. +ANNOUNCE=`date +"%b %d, %Y:"`" libarchive $VS released"
  19997. +
  19998. +echo $ANNOUNCE
  19999. +
  20000. +# Add a version notice to NEWS
  20001. +mv NEWS NEWS.bak
  20002. +chmod +w NEWS.bak
  20003. +echo $ANNOUNCE >> NEWS
  20004. +echo >> NEWS
  20005. +cat NEWS.bak >> NEWS
  20006. --- /dev/null
  20007. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/clean.sh
  20008. @@ -0,0 +1,99 @@
  20009. +#!/bin/sh
  20010. +
  20011. +#
  20012. +# Attempt to remove as many generated files as we can.
  20013. +# Ideally, a well-used development sandbox would look like
  20014. +# a pristine checkout after running this script.
  20015. +#
  20016. +
  20017. +if [ \! -f build/version ]; then
  20018. + echo 'Must run the clean script from the top-level dir of the libarchive distribution' 1>&2
  20019. + exit 1
  20020. +fi
  20021. +
  20022. +# If we're on BSD, blow away the build dir under /usr/obj
  20023. +rm -rf /usr/obj`pwd`
  20024. +
  20025. +#
  20026. +# Try to clean up a bit more...
  20027. +#
  20028. +
  20029. +find . -name '*.So' | xargs rm -f
  20030. +find . -name '*.a' | xargs rm -f
  20031. +find . -name '*.la' | xargs rm -f
  20032. +find . -name '*.lo' | xargs rm -f
  20033. +find . -name '*.o' | xargs rm -f
  20034. +find . -name '*.orig' | xargs rm -f
  20035. +find . -name '*.po' | xargs rm -f
  20036. +find . -name '*.rej' | xargs rm -f
  20037. +find . -name '*~' | xargs rm -f
  20038. +find . -name '.depend' | xargs rm -f
  20039. +find . -name '.deps' | xargs rm -rf
  20040. +find . -name '.dirstamp' | xargs rm -f
  20041. +find . -name '.libs' | xargs rm -rf
  20042. +find . -name 'CMakeFiles' | xargs rm -rf
  20043. +find . -name 'cmake_install.cmake' | xargs rm -f
  20044. +find . -name 'CTestTestfile.cmake' | xargs rm -f
  20045. +
  20046. +rm -rf Testing
  20047. +rm -rf autom4te.cache
  20048. +rm -rf bin
  20049. +rm -rf cmake.tmp
  20050. +rm -rf libarchive/Testing
  20051. +
  20052. +rm -f CMakeCache.txt
  20053. +rm -f DartConfiguration.tcl
  20054. +rm -f Makefile
  20055. +rm -f Makefile.in
  20056. +rm -f aclocal.m4
  20057. +rm -f bsdcpio
  20058. +rm -f bsdcpio_test
  20059. +rm -f bsdtar
  20060. +rm -f bsdtar_test
  20061. +rm -f build/autoconf/compile
  20062. +rm -f build/autoconf/config.guess
  20063. +rm -f build/autoconf/config.sub
  20064. +rm -f build/autoconf/depcomp
  20065. +rm -f build/autoconf/install-sh
  20066. +rm -f build/autoconf/libtool.m4
  20067. +rm -f build/autoconf/ltmain.sh
  20068. +rm -f build/autoconf/ltoptions.m4
  20069. +rm -f build/autoconf/ltsugar.m4
  20070. +rm -f build/autoconf/ltversion.m4
  20071. +rm -f build/autoconf/lt~obsolete.m4
  20072. +rm -f build/autoconf/missing
  20073. +rm -f build/autoconf/test-driver
  20074. +rm -f build/pkgconfig/libarchive.pc
  20075. +rm -f build/version.old
  20076. +rm -f cat/test/list.h
  20077. +rm -f config.h
  20078. +rm -f config.h.in
  20079. +rm -f config.log
  20080. +rm -f config.status
  20081. +rm -f configure
  20082. +rm -f cpio/*.1.gz
  20083. +rm -f cpio/Makefile
  20084. +rm -f cpio/bsdcpio
  20085. +rm -f cpio/test/Makefile
  20086. +rm -f cpio/test/bsdcpio_test
  20087. +rm -f cpio/test/list.h
  20088. +rm -f doc/html/*
  20089. +rm -f doc/man/*
  20090. +rm -f doc/pdf/*
  20091. +rm -f doc/text/*
  20092. +rm -f doc/wiki/*
  20093. +rm -f libarchive/*.[35].gz
  20094. +rm -f libarchive/Makefile
  20095. +rm -f libarchive/libarchive.so*
  20096. +rm -f libarchive/test/Makefile
  20097. +rm -f libarchive/test/libarchive_test
  20098. +rm -f libarchive/test/list.h
  20099. +rm -f libarchive_test
  20100. +rm -f libtool
  20101. +rm -f stamp-h1
  20102. +rm -f tar/*.1.gz
  20103. +rm -f tar/Makefile
  20104. +rm -f tar/bsdtar
  20105. +rm -f tar/test/Makefile
  20106. +rm -f tar/test/bsdtar_test
  20107. +rm -f tar/test/list.h
  20108. --- /dev/null
  20109. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/CheckFileOffsetBits.c
  20110. @@ -0,0 +1,14 @@
  20111. +#include <sys/types.h>
  20112. +
  20113. +#define KB ((off_t)1024)
  20114. +#define MB ((off_t)1024 * KB)
  20115. +#define GB ((off_t)1024 * MB)
  20116. +#define TB ((off_t)1024 * GB)
  20117. +int t2[(((64 * GB -1) % 671088649) == 268434537)
  20118. + && (((TB - (64 * GB -1) + 255) % 1792151290) == 305159546)? 1: -1];
  20119. +
  20120. +int main()
  20121. +{
  20122. + ;
  20123. + return 0;
  20124. +}
  20125. --- /dev/null
  20126. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/CheckFileOffsetBits.cmake
  20127. @@ -0,0 +1,44 @@
  20128. +# - Check if _FILE_OFFSET_BITS macro needed for large files
  20129. +# CHECK_FILE_OFFSET_BITS ()
  20130. +#
  20131. +# The following variables may be set before calling this macro to
  20132. +# modify the way the check is run:
  20133. +#
  20134. +# CMAKE_REQUIRED_FLAGS = string of compile command line flags
  20135. +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
  20136. +# CMAKE_REQUIRED_INCLUDES = list of include directories
  20137. +# Copyright (c) 2009, Michihiro NAKAJIMA
  20138. +#
  20139. +# Redistribution and use is allowed according to the terms of the BSD license.
  20140. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  20141. +
  20142. +#INCLUDE(CheckCXXSourceCompiles)
  20143. +
  20144. +GET_FILENAME_COMPONENT(_selfdir_CheckFileOffsetBits
  20145. + "${CMAKE_CURRENT_LIST_FILE}" PATH)
  20146. +
  20147. +MACRO (CHECK_FILE_OFFSET_BITS)
  20148. + IF(NOT DEFINED _FILE_OFFSET_BITS)
  20149. + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files")
  20150. + TRY_COMPILE(__WITHOUT_FILE_OFFSET_BITS_64
  20151. + ${CMAKE_CURRENT_BINARY_DIR}
  20152. + ${_selfdir_CheckFileOffsetBits}/CheckFileOffsetBits.c
  20153. + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS})
  20154. + IF(NOT __WITHOUT_FILE_OFFSET_BITS_64)
  20155. + TRY_COMPILE(__WITH_FILE_OFFSET_BITS_64
  20156. + ${CMAKE_CURRENT_BINARY_DIR}
  20157. + ${_selfdir_CheckFileOffsetBits}/CheckFileOffsetBits.c
  20158. + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -D_FILE_OFFSET_BITS=64)
  20159. + ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64)
  20160. +
  20161. + IF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
  20162. + SET(_FILE_OFFSET_BITS 64 CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files")
  20163. + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - needed")
  20164. + ELSE(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
  20165. + SET(_FILE_OFFSET_BITS "" CACHE INTERNAL "_FILE_OFFSET_BITS macro needed for large files")
  20166. + MESSAGE(STATUS "Checking _FILE_OFFSET_BITS for large files - not needed")
  20167. + ENDIF(NOT __WITHOUT_FILE_OFFSET_BITS_64 AND __WITH_FILE_OFFSET_BITS_64)
  20168. + ENDIF(NOT DEFINED _FILE_OFFSET_BITS)
  20169. +
  20170. +ENDMACRO (CHECK_FILE_OFFSET_BITS)
  20171. +
  20172. --- /dev/null
  20173. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/CheckFuncs.cmake
  20174. @@ -0,0 +1,49 @@
  20175. +# Check if the system has the specified function; treat glibc "stub"
  20176. +# functions as nonexistent:
  20177. +# CHECK_FUNCTION_EXISTS_GLIBC (FUNCTION FUNCVAR)
  20178. +#
  20179. +# FUNCTION - the function(s) where the prototype should be declared
  20180. +# FUNCVAR - variable to define if the function does exist
  20181. +#
  20182. +# In particular, this understands the glibc convention of
  20183. +# defining macros __stub_XXXX or __stub___XXXX if the function
  20184. +# does appear in the library but is merely a stub that does nothing.
  20185. +# By detecting this case, we can select alternate behavior on
  20186. +# platforms that don't support this functionality.
  20187. +#
  20188. +# The following variables may be set before calling this macro to
  20189. +# modify the way the check is run:
  20190. +#
  20191. +# CMAKE_REQUIRED_FLAGS = string of compile command line flags
  20192. +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
  20193. +# CMAKE_REQUIRED_INCLUDES = list of include directories
  20194. +# Copyright (c) 2009, Michihiro NAKAJIMA
  20195. +#
  20196. +# Redistribution and use is allowed according to the terms of the BSD license.
  20197. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  20198. +
  20199. +INCLUDE(CheckFunctionExists)
  20200. +GET_FILENAME_COMPONENT(_selfdir_CheckFunctionExistsGlibc
  20201. + "${CMAKE_CURRENT_LIST_FILE}" PATH)
  20202. +
  20203. +MACRO (CHECK_FUNCTION_EXISTS_GLIBC _FUNC _FUNCVAR)
  20204. + IF(NOT DEFINED ${_FUNCVAR})
  20205. + SET(CHECK_STUB_FUNC_1 "__stub_${_FUNC}")
  20206. + SET(CHECK_STUB_FUNC_2 "__stub___${_FUNC}")
  20207. + CONFIGURE_FILE( ${_selfdir_CheckFunctionExistsGlibc}/CheckFuncs_stub.c.in
  20208. + ${CMAKE_CURRENT_BINARY_DIR}/cmake.tmp/CheckFuncs_stub.c IMMEDIATE)
  20209. + TRY_COMPILE(__stub
  20210. + ${CMAKE_CURRENT_BINARY_DIR}
  20211. + ${CMAKE_CURRENT_BINARY_DIR}/cmake.tmp/CheckFuncs_stub.c
  20212. + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
  20213. + CMAKE_FLAGS
  20214. + -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
  20215. + "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}")
  20216. + IF (__stub)
  20217. + SET("${_FUNCVAR}" "" CACHE INTERNAL "Have function ${_FUNC}")
  20218. + ELSE (__stub)
  20219. + CHECK_FUNCTION_EXISTS("${_FUNC}" "${_FUNCVAR}")
  20220. + ENDIF (__stub)
  20221. + ENDIF(NOT DEFINED ${_FUNCVAR})
  20222. +ENDMACRO (CHECK_FUNCTION_EXISTS_GLIBC)
  20223. +
  20224. --- /dev/null
  20225. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/CheckFuncs_stub.c.in
  20226. @@ -0,0 +1,16 @@
  20227. +#ifdef __STDC__
  20228. +#include <limits.h>
  20229. +#else
  20230. +#include <assert.h>
  20231. +#endif
  20232. +
  20233. +int
  20234. +main()
  20235. +{
  20236. +#if defined ${CHECK_STUB_FUNC_1} || defined ${CHECK_STUB_FUNC_2}
  20237. + return 0;
  20238. +#else
  20239. +this system have stub
  20240. + return 0;
  20241. +#endif
  20242. +}
  20243. --- /dev/null
  20244. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/CheckHeaderDirent.cmake
  20245. @@ -0,0 +1,32 @@
  20246. +# - Check if the system has the specified type
  20247. +# CHECK_HEADER_DIRENT (HEADER1 HEARDER2 ...)
  20248. +#
  20249. +# HEADER - the header(s) where the prototype should be declared
  20250. +#
  20251. +# The following variables may be set before calling this macro to
  20252. +# modify the way the check is run:
  20253. +#
  20254. +# CMAKE_REQUIRED_FLAGS = string of compile command line flags
  20255. +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
  20256. +# CMAKE_REQUIRED_INCLUDES = list of include directories
  20257. +# Copyright (c) 2009, Michihiro NAKAJIMA
  20258. +#
  20259. +# Redistribution and use is allowed according to the terms of the BSD license.
  20260. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  20261. +
  20262. +
  20263. +INCLUDE(CheckTypeExists)
  20264. +
  20265. +MACRO (CHECK_HEADER_DIRENT)
  20266. + CHECK_TYPE_EXISTS("DIR *" dirent.h HAVE_DIRENT_H)
  20267. + IF(NOT HAVE_DIRENT_H)
  20268. + CHECK_TYPE_EXISTS("DIR *" sys/ndir.h HAVE_SYS_NDIR_H)
  20269. + IF(NOT HAVE_SYS_NDIR_H)
  20270. + CHECK_TYPE_EXISTS("DIR *" ndir.h HAVE_NDIR_H)
  20271. + IF(NOT HAVE_NDIR_H)
  20272. + CHECK_TYPE_EXISTS("DIR *" sys/dir.h HAVE_SYS_DIR_H)
  20273. + ENDIF(NOT HAVE_NDIR_H)
  20274. + ENDIF(NOT HAVE_SYS_NDIR_H)
  20275. + ENDIF(NOT HAVE_DIRENT_H)
  20276. +ENDMACRO (CHECK_HEADER_DIRENT)
  20277. +
  20278. --- /dev/null
  20279. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/CheckTypeExists.cmake
  20280. @@ -0,0 +1,42 @@
  20281. +# - Check if the system has the specified type
  20282. +# CHECK_TYPE_EXISTS (TYPE HEADER VARIABLE)
  20283. +#
  20284. +# TYPE - the name of the type or struct or class you are interested in
  20285. +# HEADER - the header(s) where the prototype should be declared
  20286. +# VARIABLE - variable to store the result
  20287. +#
  20288. +# The following variables may be set before calling this macro to
  20289. +# modify the way the check is run:
  20290. +#
  20291. +# CMAKE_REQUIRED_FLAGS = string of compile command line flags
  20292. +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
  20293. +# CMAKE_REQUIRED_INCLUDES = list of include directories
  20294. +# Copyright (c) 2009, Michihiro NAKAJIMA
  20295. +# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
  20296. +#
  20297. +# Redistribution and use is allowed according to the terms of the BSD license.
  20298. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  20299. +
  20300. +
  20301. +INCLUDE(CheckCSourceCompiles)
  20302. +
  20303. +MACRO (CHECK_TYPE_EXISTS _TYPE _HEADER _RESULT)
  20304. + SET(_INCLUDE_FILES)
  20305. + FOREACH (it ${_HEADER})
  20306. + SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
  20307. + ENDFOREACH (it)
  20308. +
  20309. + SET(_CHECK_TYPE_EXISTS_SOURCE_CODE "
  20310. +${_INCLUDE_FILES}
  20311. +int main()
  20312. +{
  20313. + static ${_TYPE} tmp;
  20314. + if (sizeof(tmp))
  20315. + return 0;
  20316. + return 0;
  20317. +}
  20318. +")
  20319. + CHECK_C_SOURCE_COMPILES("${_CHECK_TYPE_EXISTS_SOURCE_CODE}" ${_RESULT})
  20320. +
  20321. +ENDMACRO (CHECK_TYPE_EXISTS)
  20322. +
  20323. --- /dev/null
  20324. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/CreatePkgConfigFile.cmake
  20325. @@ -0,0 +1,33 @@
  20326. +# - Generate a libarchive.pc like autotools for pkg-config
  20327. +#
  20328. +
  20329. +# Set the required variables (we use the same input file as autotools)
  20330. +SET(prefix ${CMAKE_INSTALL_PREFIX})
  20331. +SET(exec_prefix \${prefix})
  20332. +SET(libdir \${exec_prefix}/lib)
  20333. +SET(includedir \${prefix}/include)
  20334. +# Now, this is not particularly pretty, nor is it terribly accurate...
  20335. +# Loop over all our additional libs
  20336. +FOREACH(mylib ${ADDITIONAL_LIBS})
  20337. + # Extract the filename from the absolute path
  20338. + GET_FILENAME_COMPONENT(mylib_name ${mylib} NAME_WE)
  20339. + # Strip the lib prefix
  20340. + STRING(REGEX REPLACE "^lib" "" mylib_name ${mylib_name})
  20341. + # Append it to our LIBS string
  20342. + SET(LIBS "${LIBS} -l${mylib_name}")
  20343. +ENDFOREACH()
  20344. +# libxml2 is easier, since it's already using pkg-config
  20345. +FOREACH(mylib ${PC_LIBXML_STATIC_LDFLAGS})
  20346. + SET(LIBS "${LIBS} ${mylib}")
  20347. +ENDFOREACH()
  20348. +# FIXME: The order of the libraries doesn't take dependencies into account,
  20349. +# thus there's a good chance it'll make some binutils versions unhappy...
  20350. +# This only affects Libs.private (looked up for static builds) though.
  20351. +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc.in
  20352. + ${CMAKE_CURRENT_BINARY_DIR}/build/pkgconfig/libarchive.pc
  20353. + @ONLY)
  20354. +# And install it, of course ;).
  20355. +IF(ENABLE_INSTALL)
  20356. + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/build/pkgconfig/libarchive.pc
  20357. + DESTINATION "lib/pkgconfig")
  20358. +ENDIF()
  20359. --- /dev/null
  20360. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/FindLibGCC.cmake
  20361. @@ -0,0 +1,22 @@
  20362. +# - Find libgcc
  20363. +# Find the libgcc library.
  20364. +#
  20365. +# LIBGCC_LIBRARIES - List of libraries when using libgcc
  20366. +# LIBGCC_FOUND - True if libgcc found.
  20367. +
  20368. +IF (LIBGCC_LIBRARY)
  20369. + # Already in cache, be silent
  20370. + SET(LIBGCC_FIND_QUIETLY TRUE)
  20371. +ENDIF (LIBGCC_LIBRARY)
  20372. +
  20373. +FIND_LIBRARY(LIBGCC_LIBRARY NAMES gcc libgcc)
  20374. +
  20375. +# handle the QUIETLY and REQUIRED arguments and set LIBGCC_FOUND to TRUE if
  20376. +# all listed variables are TRUE
  20377. +INCLUDE(FindPackageHandleStandardArgs)
  20378. +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGCC DEFAULT_MSG LIBGCC_LIBRARY)
  20379. +
  20380. +IF(LIBGCC_FOUND)
  20381. + SET(LIBGCC_LIBRARIES ${LIBGCC_LIBRARY})
  20382. + SET(HAVE_LIBGCC 1)
  20383. +ENDIF(LIBGCC_FOUND)
  20384. --- /dev/null
  20385. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/FindMbedTLS.cmake
  20386. @@ -0,0 +1,13 @@
  20387. +find_path(MBEDTLS_INCLUDE_DIRS mbedtls/ssl.h)
  20388. +
  20389. +find_library(MBEDTLS_LIBRARY mbedtls)
  20390. +find_library(MBEDX509_LIBRARY mbedx509)
  20391. +find_library(MBEDCRYPTO_LIBRARY mbedcrypto)
  20392. +
  20393. +set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}")
  20394. +
  20395. +include(FindPackageHandleStandardArgs)
  20396. +find_package_handle_standard_args(MBEDTLS DEFAULT_MSG
  20397. + MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
  20398. +
  20399. +mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
  20400. --- /dev/null
  20401. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/FindNettle.cmake
  20402. @@ -0,0 +1,23 @@
  20403. +# - Find Nettle
  20404. +# Find the Nettle include directory and library
  20405. +#
  20406. +# NETTLE_INCLUDE_DIR - where to find <nettle/sha.h>, etc.
  20407. +# NETTLE_LIBRARIES - List of libraries when using libnettle.
  20408. +# NETTLE_FOUND - True if libnettle found.
  20409. +
  20410. +IF (NETTLE_INCLUDE_DIR)
  20411. + # Already in cache, be silent
  20412. + SET(NETTLE_FIND_QUIETLY TRUE)
  20413. +ENDIF (NETTLE_INCLUDE_DIR)
  20414. +
  20415. +FIND_PATH(NETTLE_INCLUDE_DIR nettle/md5.h nettle/ripemd160.h nettle/sha.h)
  20416. +FIND_LIBRARY(NETTLE_LIBRARY NAMES nettle libnettle)
  20417. +
  20418. +# handle the QUIETLY and REQUIRED arguments and set NETTLE_FOUND to TRUE if
  20419. +# all listed variables are TRUE
  20420. +INCLUDE(FindPackageHandleStandardArgs)
  20421. +FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETTLE DEFAULT_MSG NETTLE_LIBRARY NETTLE_INCLUDE_DIR)
  20422. +
  20423. +IF(NETTLE_FOUND)
  20424. + SET(NETTLE_LIBRARIES ${NETTLE_LIBRARY})
  20425. +ENDIF(NETTLE_FOUND)
  20426. --- /dev/null
  20427. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/FindPCREPOSIX.cmake
  20428. @@ -0,0 +1,34 @@
  20429. +# - Find pcreposix
  20430. +# Find the native PCRE and PCREPOSIX include and libraries
  20431. +#
  20432. +# PCRE_INCLUDE_DIR - where to find pcreposix.h, etc.
  20433. +# PCREPOSIX_LIBRARIES - List of libraries when using libpcreposix.
  20434. +# PCRE_LIBRARIES - List of libraries when using libpcre.
  20435. +# PCREPOSIX_FOUND - True if libpcreposix found.
  20436. +# PCRE_FOUND - True if libpcre found.
  20437. +
  20438. +IF (PCRE_INCLUDE_DIR)
  20439. + # Already in cache, be silent
  20440. + SET(PCRE_FIND_QUIETLY TRUE)
  20441. +ENDIF (PCRE_INCLUDE_DIR)
  20442. +
  20443. +FIND_PATH(PCRE_INCLUDE_DIR pcreposix.h)
  20444. +FIND_LIBRARY(PCREPOSIX_LIBRARY NAMES pcreposix libpcreposix)
  20445. +FIND_LIBRARY(PCRE_LIBRARY NAMES pcre libpcre)
  20446. +
  20447. +# handle the QUIETLY and REQUIRED arguments and set PCREPOSIX_FOUND to TRUE if
  20448. +# all listed variables are TRUE
  20449. +INCLUDE(FindPackageHandleStandardArgs)
  20450. +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCREPOSIX DEFAULT_MSG PCREPOSIX_LIBRARY PCRE_INCLUDE_DIR)
  20451. +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY)
  20452. +
  20453. +IF(PCREPOSIX_FOUND)
  20454. + SET(PCREPOSIX_LIBRARIES ${PCREPOSIX_LIBRARY})
  20455. + SET(HAVE_LIBPCREPOSIX 1)
  20456. + SET(HAVE_PCREPOSIX_H 1)
  20457. +ENDIF(PCREPOSIX_FOUND)
  20458. +
  20459. +IF(PCRE_FOUND)
  20460. + SET(PCRE_LIBRARIES ${PCRE_LIBRARY})
  20461. + SET(HAVE_LIBPCRE 1)
  20462. +ENDIF(PCRE_FOUND)
  20463. --- /dev/null
  20464. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/LibarchiveCodeCoverage.cmake
  20465. @@ -0,0 +1,68 @@
  20466. +#################################################################
  20467. +# Adds a build target called "coverage" for code coverage.
  20468. +#
  20469. +# This compiles the code using special GCC flags, run the tests,
  20470. +# and then generates a nice HTML output. This new "coverage" make
  20471. +# target will only be available if you build using GCC in Debug
  20472. +# mode. If any of the required programs (lcov and genhtml) were
  20473. +# not found, a FATAL_ERROR message is printed.
  20474. +#
  20475. +# If not already done, this code will set ENABLE_TEST to ON.
  20476. +#
  20477. +# To build the code coverage and open it in your browser do this:
  20478. +#
  20479. +# mkdir debug
  20480. +# cd debug
  20481. +# cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON ..
  20482. +# make -j4
  20483. +# make coverage
  20484. +# xdg-open coverage/index.html
  20485. +#################################################################
  20486. +
  20487. +# Find programs we need
  20488. +FIND_PROGRAM(LCOV_EXECUTABLE lcov DOC "Full path to lcov executable")
  20489. +FIND_PROGRAM(GENHTML_EXECUTABLE genhtml DOC "Full path to genhtml executable")
  20490. +MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE)
  20491. +
  20492. +# Check, compiler, build types and programs are available
  20493. +IF(NOT CMAKE_COMPILER_IS_GNUCC)
  20494. +MESSAGE(FATAL_ERROR "Coverage can only be built on GCC")
  20495. +ELSEIF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
  20496. +MESSAGE(FATAL_ERROR "Coverage can only be built in Debug mode")
  20497. +ELSEIF(NOT LCOV_EXECUTABLE)
  20498. +MESSAGE(FATAL_ERROR "lcov executable not found")
  20499. +ELSEIF(NOT GENHTML_EXECUTABLE)
  20500. +MESSAGE(FATAL_ERROR "genhtml executable not found")
  20501. +ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
  20502. +
  20503. +# Enable testing if not already done
  20504. +SET(ENABLE_TEST ON)
  20505. +
  20506. +#################################################################
  20507. +# Set special compiler and linker flags for test coverage
  20508. +#################################################################
  20509. +# 0. Enable debug: -g
  20510. +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
  20511. +# 1. Disable optimizations: -O0
  20512. +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
  20513. +# 2. Enable all kind of warnings:
  20514. +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W")
  20515. +# 3. Enable special coverage flag (HINT: --coverage is a synonym for -fprofile-arcs -ftest-coverage)
  20516. +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
  20517. +SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage")
  20518. +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
  20519. +#################################################################
  20520. +
  20521. +ADD_CUSTOM_TARGET(coverage
  20522. +COMMAND ${CMAKE_COMMAND} -E echo "Beginning test coverage. Output is written to coverage.log."
  20523. +COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-1/5: Reset all execution counts to zero"
  20524. +COMMAND ${LCOV_EXECUTABLE} --directory . --zerocounters > coverage.log 2>&1
  20525. +COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-2/5: Run testrunner"
  20526. +COMMAND ${CMAKE_CTEST_COMMAND} >> coverage.log 2>&1
  20527. +COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-3/5: Collect coverage data"
  20528. +COMMAND ${LCOV_EXECUTABLE} --capture --directory . --output-file "./coverage.info" >> coverage.log 2>&1
  20529. +COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-4/5: Generate HTML from coverage data"
  20530. +COMMAND ${GENHTML_EXECUTABLE} "coverage.info" --title="libarchive-${LIBARCHIVE_VERSION_STRING}" --show-details --legend --output-directory "./coverage" >> coverage.log 2>&1
  20531. +COMMAND ${CMAKE_COMMAND} -E echo "COVERAGE-STEP-5/5: Open test coverage HTML output in browser: xdg-open ./coverage/index.html"
  20532. +COMMENT "Runs testrunner and generates coverage output (formats: .info and .html)")
  20533. +
  20534. --- /dev/null
  20535. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/cmake/config.h.in
  20536. @@ -0,0 +1,1338 @@
  20537. +/* config.h. Generated from build/cmake/config.h.in by cmake configure */
  20538. +
  20539. +/*
  20540. + * Ensure we have C99-style int64_t, etc, all defined.
  20541. + */
  20542. +
  20543. +/* First, we need to know if the system has already defined them. */
  20544. +#cmakedefine HAVE_INT16_T
  20545. +#cmakedefine HAVE_INT32_T
  20546. +#cmakedefine HAVE_INT64_T
  20547. +#cmakedefine HAVE_INTMAX_T
  20548. +
  20549. +#cmakedefine HAVE_UINT8_T
  20550. +#cmakedefine HAVE_UINT16_T
  20551. +#cmakedefine HAVE_UINT32_T
  20552. +#cmakedefine HAVE_UINT64_T
  20553. +#cmakedefine HAVE_UINTMAX_T
  20554. +
  20555. +/* We might have the types we want under other spellings. */
  20556. +#cmakedefine HAVE___INT64
  20557. +#cmakedefine HAVE_U_INT64_T
  20558. +#cmakedefine HAVE_UNSIGNED___INT64
  20559. +
  20560. +/* The sizes of various standard integer types. */
  20561. +@SIZE_OF_SHORT_CODE@
  20562. +@SIZE_OF_INT_CODE@
  20563. +@SIZE_OF_LONG_CODE@
  20564. +@SIZE_OF_LONG_LONG_CODE@
  20565. +@SIZE_OF_UNSIGNED_SHORT_CODE@
  20566. +@SIZE_OF_UNSIGNED_CODE@
  20567. +@SIZE_OF_UNSIGNED_LONG_CODE@
  20568. +@SIZE_OF_UNSIGNED_LONG_LONG_CODE@
  20569. +
  20570. +/*
  20571. + * If we lack int64_t, define it to the first of __int64, int, long, and long long
  20572. + * that exists and is the right size.
  20573. + */
  20574. +#if !defined(HAVE_INT64_T) && defined(HAVE___INT64)
  20575. +typedef __int64 int64_t;
  20576. +#define HAVE_INT64_T
  20577. +#endif
  20578. +
  20579. +#if !defined(HAVE_INT64_T) && SIZE_OF_INT == 8
  20580. +typedef int int64_t;
  20581. +#define HAVE_INT64_T
  20582. +#endif
  20583. +
  20584. +#if !defined(HAVE_INT64_T) && SIZE_OF_LONG == 8
  20585. +typedef long int64_t;
  20586. +#define HAVE_INT64_T
  20587. +#endif
  20588. +
  20589. +#if !defined(HAVE_INT64_T) && SIZE_OF_LONG_LONG == 8
  20590. +typedef long long int64_t;
  20591. +#define HAVE_INT64_T
  20592. +#endif
  20593. +
  20594. +#if !defined(HAVE_INT64_T)
  20595. +#error No 64-bit integer type was found.
  20596. +#endif
  20597. +
  20598. +/*
  20599. + * Similarly for int32_t
  20600. + */
  20601. +#if !defined(HAVE_INT32_T) && SIZE_OF_INT == 4
  20602. +typedef int int32_t;
  20603. +#define HAVE_INT32_T
  20604. +#endif
  20605. +
  20606. +#if !defined(HAVE_INT32_T) && SIZE_OF_LONG == 4
  20607. +typedef long int32_t;
  20608. +#define HAVE_INT32_T
  20609. +#endif
  20610. +
  20611. +#if !defined(HAVE_INT32_T)
  20612. +#error No 32-bit integer type was found.
  20613. +#endif
  20614. +
  20615. +/*
  20616. + * Similarly for int16_t
  20617. + */
  20618. +#if !defined(HAVE_INT16_T) && SIZE_OF_INT == 2
  20619. +typedef int int16_t;
  20620. +#define HAVE_INT16_T
  20621. +#endif
  20622. +
  20623. +#if !defined(HAVE_INT16_T) && SIZE_OF_SHORT == 2
  20624. +typedef short int16_t;
  20625. +#define HAVE_INT16_T
  20626. +#endif
  20627. +
  20628. +#if !defined(HAVE_INT16_T)
  20629. +#error No 16-bit integer type was found.
  20630. +#endif
  20631. +
  20632. +/*
  20633. + * Similarly for uint64_t
  20634. + */
  20635. +#if !defined(HAVE_UINT64_T) && defined(HAVE_UNSIGNED___INT64)
  20636. +typedef unsigned __int64 uint64_t;
  20637. +#define HAVE_UINT64_T
  20638. +#endif
  20639. +
  20640. +#if !defined(HAVE_UINT64_T) && SIZE_OF_UNSIGNED == 8
  20641. +typedef unsigned uint64_t;
  20642. +#define HAVE_UINT64_T
  20643. +#endif
  20644. +
  20645. +#if !defined(HAVE_UINT64_T) && SIZE_OF_UNSIGNED_LONG == 8
  20646. +typedef unsigned long uint64_t;
  20647. +#define HAVE_UINT64_T
  20648. +#endif
  20649. +
  20650. +#if !defined(HAVE_UINT64_T) && SIZE_OF_UNSIGNED_LONG_LONG == 8
  20651. +typedef unsigned long long uint64_t;
  20652. +#define HAVE_UINT64_T
  20653. +#endif
  20654. +
  20655. +#if !defined(HAVE_UINT64_T)
  20656. +#error No 64-bit unsigned integer type was found.
  20657. +#endif
  20658. +
  20659. +
  20660. +/*
  20661. + * Similarly for uint32_t
  20662. + */
  20663. +#if !defined(HAVE_UINT32_T) && SIZE_OF_UNSIGNED == 4
  20664. +typedef unsigned uint32_t;
  20665. +#define HAVE_UINT32_T
  20666. +#endif
  20667. +
  20668. +#if !defined(HAVE_UINT32_T) && SIZE_OF_UNSIGNED_LONG == 4
  20669. +typedef unsigned long uint32_t;
  20670. +#define HAVE_UINT32_T
  20671. +#endif
  20672. +
  20673. +#if !defined(HAVE_UINT32_T)
  20674. +#error No 32-bit unsigned integer type was found.
  20675. +#endif
  20676. +
  20677. +/*
  20678. + * Similarly for uint16_t
  20679. + */
  20680. +#if !defined(HAVE_UINT16_T) && SIZE_OF_UNSIGNED == 2
  20681. +typedef unsigned uint16_t;
  20682. +#define HAVE_UINT16_T
  20683. +#endif
  20684. +
  20685. +#if !defined(HAVE_UINT16_T) && SIZE_OF_UNSIGNED_SHORT == 2
  20686. +typedef unsigned short uint16_t;
  20687. +#define HAVE_UINT16_T
  20688. +#endif
  20689. +
  20690. +#if !defined(HAVE_UINT16_T)
  20691. +#error No 16-bit unsigned integer type was found.
  20692. +#endif
  20693. +
  20694. +/*
  20695. + * Similarly for uint8_t
  20696. + */
  20697. +#if !defined(HAVE_UINT8_T)
  20698. +typedef unsigned char uint8_t;
  20699. +#define HAVE_UINT8_T
  20700. +#endif
  20701. +
  20702. +#if !defined(HAVE_UINT16_T)
  20703. +#error No 8-bit unsigned integer type was found.
  20704. +#endif
  20705. +
  20706. +/* Define intmax_t and uintmax_t if they are not already defined. */
  20707. +#if !defined(HAVE_INTMAX_T)
  20708. +typedef int64_t intmax_t;
  20709. +#endif
  20710. +
  20711. +#if !defined(HAVE_UINTMAX_T)
  20712. +typedef uint64_t uintmax_t;
  20713. +#endif
  20714. +
  20715. +/* Define ZLIB_WINAPI if zlib was built on Visual Studio. */
  20716. +#cmakedefine ZLIB_WINAPI 1
  20717. +
  20718. +/* Darwin ACL support */
  20719. +#cmakedefine ARCHIVE_ACL_DARWIN 1
  20720. +
  20721. +/* FreeBSD ACL support */
  20722. +#cmakedefine ARCHIVE_ACL_FREEBSD 1
  20723. +
  20724. +/* FreeBSD NFSv4 ACL support */
  20725. +#cmakedefine ARCHIVE_ACL_FREEBSD_NFS4 1
  20726. +
  20727. +/* Linux POSIX.1e ACL support via libacl */
  20728. +#cmakedefine ARCHIVE_ACL_LIBACL 1
  20729. +
  20730. +/* Linux NFSv4 ACL support via librichacl */
  20731. +#cmakedefine ARCHIVE_ACL_LIBRICHACL 1
  20732. +
  20733. +/* Solaris ACL support */
  20734. +#cmakedefine ARCHIVE_ACL_SUNOS 1
  20735. +
  20736. +/* Solaris NFSv4 ACL support */
  20737. +#cmakedefine ARCHIVE_ACL_SUNOS_NFS4 1
  20738. +
  20739. +/* MD5 via ARCHIVE_CRYPTO_MD5_LIBC supported. */
  20740. +#cmakedefine ARCHIVE_CRYPTO_MD5_LIBC 1
  20741. +
  20742. +/* MD5 via ARCHIVE_CRYPTO_MD5_LIBSYSTEM supported. */
  20743. +#cmakedefine ARCHIVE_CRYPTO_MD5_LIBSYSTEM 1
  20744. +
  20745. +/* MD5 via ARCHIVE_CRYPTO_MD5_NETTLE supported. */
  20746. +#cmakedefine ARCHIVE_CRYPTO_MD5_NETTLE 1
  20747. +
  20748. +/* MD5 via ARCHIVE_CRYPTO_MD5_OPENSSL supported. */
  20749. +#cmakedefine ARCHIVE_CRYPTO_MD5_OPENSSL 1
  20750. +
  20751. +/* MD5 via ARCHIVE_CRYPTO_MD5_WIN supported. */
  20752. +#cmakedefine ARCHIVE_CRYPTO_MD5_WIN 1
  20753. +
  20754. +/* RMD160 via ARCHIVE_CRYPTO_RMD160_LIBC supported. */
  20755. +#cmakedefine ARCHIVE_CRYPTO_RMD160_LIBC 1
  20756. +
  20757. +/* RMD160 via ARCHIVE_CRYPTO_RMD160_NETTLE supported. */
  20758. +#cmakedefine ARCHIVE_CRYPTO_RMD160_NETTLE 1
  20759. +
  20760. +/* RMD160 via ARCHIVE_CRYPTO_RMD160_OPENSSL supported. */
  20761. +#cmakedefine ARCHIVE_CRYPTO_RMD160_OPENSSL 1
  20762. +
  20763. +/* SHA1 via ARCHIVE_CRYPTO_SHA1_LIBC supported. */
  20764. +#cmakedefine ARCHIVE_CRYPTO_SHA1_LIBC 1
  20765. +
  20766. +/* SHA1 via ARCHIVE_CRYPTO_SHA1_LIBSYSTEM supported. */
  20767. +#cmakedefine ARCHIVE_CRYPTO_SHA1_LIBSYSTEM 1
  20768. +
  20769. +/* SHA1 via ARCHIVE_CRYPTO_SHA1_NETTLE supported. */
  20770. +#cmakedefine ARCHIVE_CRYPTO_SHA1_NETTLE 1
  20771. +
  20772. +/* SHA1 via ARCHIVE_CRYPTO_SHA1_OPENSSL supported. */
  20773. +#cmakedefine ARCHIVE_CRYPTO_SHA1_OPENSSL 1
  20774. +
  20775. +/* SHA1 via ARCHIVE_CRYPTO_SHA1_WIN supported. */
  20776. +#cmakedefine ARCHIVE_CRYPTO_SHA1_WIN 1
  20777. +
  20778. +/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBC supported. */
  20779. +#cmakedefine ARCHIVE_CRYPTO_SHA256_LIBC 1
  20780. +
  20781. +/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBC2 supported. */
  20782. +#cmakedefine ARCHIVE_CRYPTO_SHA256_LIBC2 1
  20783. +
  20784. +/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBC3 supported. */
  20785. +#cmakedefine ARCHIVE_CRYPTO_SHA256_LIBC3 1
  20786. +
  20787. +/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBSYSTEM supported. */
  20788. +#cmakedefine ARCHIVE_CRYPTO_SHA256_LIBSYSTEM 1
  20789. +
  20790. +/* SHA256 via ARCHIVE_CRYPTO_SHA256_NETTLE supported. */
  20791. +#cmakedefine ARCHIVE_CRYPTO_SHA256_NETTLE 1
  20792. +
  20793. +/* SHA256 via ARCHIVE_CRYPTO_SHA256_OPENSSL supported. */
  20794. +#cmakedefine ARCHIVE_CRYPTO_SHA256_OPENSSL 1
  20795. +
  20796. +/* SHA256 via ARCHIVE_CRYPTO_SHA256_WIN supported. */
  20797. +#cmakedefine ARCHIVE_CRYPTO_SHA256_WIN 1
  20798. +
  20799. +/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBC supported. */
  20800. +#cmakedefine ARCHIVE_CRYPTO_SHA384_LIBC 1
  20801. +
  20802. +/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBC2 supported. */
  20803. +#cmakedefine ARCHIVE_CRYPTO_SHA384_LIBC2 1
  20804. +
  20805. +/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBC3 supported. */
  20806. +#cmakedefine ARCHIVE_CRYPTO_SHA384_LIBC3 1
  20807. +
  20808. +/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBSYSTEM supported. */
  20809. +#cmakedefine ARCHIVE_CRYPTO_SHA384_LIBSYSTEM 1
  20810. +
  20811. +/* SHA384 via ARCHIVE_CRYPTO_SHA384_NETTLE supported. */
  20812. +#cmakedefine ARCHIVE_CRYPTO_SHA384_NETTLE 1
  20813. +
  20814. +/* SHA384 via ARCHIVE_CRYPTO_SHA384_OPENSSL supported. */
  20815. +#cmakedefine ARCHIVE_CRYPTO_SHA384_OPENSSL 1
  20816. +
  20817. +/* SHA384 via ARCHIVE_CRYPTO_SHA384_WIN supported. */
  20818. +#cmakedefine ARCHIVE_CRYPTO_SHA384_WIN 1
  20819. +
  20820. +/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBC supported. */
  20821. +#cmakedefine ARCHIVE_CRYPTO_SHA512_LIBC 1
  20822. +
  20823. +/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBC2 supported. */
  20824. +#cmakedefine ARCHIVE_CRYPTO_SHA512_LIBC2 1
  20825. +
  20826. +/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBC3 supported. */
  20827. +#cmakedefine ARCHIVE_CRYPTO_SHA512_LIBC3 1
  20828. +
  20829. +/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBSYSTEM supported. */
  20830. +#cmakedefine ARCHIVE_CRYPTO_SHA512_LIBSYSTEM 1
  20831. +
  20832. +/* SHA512 via ARCHIVE_CRYPTO_SHA512_NETTLE supported. */
  20833. +#cmakedefine ARCHIVE_CRYPTO_SHA512_NETTLE 1
  20834. +
  20835. +/* SHA512 via ARCHIVE_CRYPTO_SHA512_OPENSSL supported. */
  20836. +#cmakedefine ARCHIVE_CRYPTO_SHA512_OPENSSL 1
  20837. +
  20838. +/* SHA512 via ARCHIVE_CRYPTO_SHA512_WIN supported. */
  20839. +#cmakedefine ARCHIVE_CRYPTO_SHA512_WIN 1
  20840. +
  20841. +/* AIX xattr support */
  20842. +#cmakedefine ARCHIVE_XATTR_AIX 1
  20843. +
  20844. +/* Darwin xattr support */
  20845. +#cmakedefine ARCHIVE_XATTR_DARWIN 1
  20846. +
  20847. +/* FreeBSD xattr support */
  20848. +#cmakedefine ARCHIVE_XATTR_FREEBSD 1
  20849. +
  20850. +/* Linux xattr support */
  20851. +#cmakedefine ARCHIVE_XATTR_LINUX 1
  20852. +
  20853. +/* Version number of bsdcpio */
  20854. +#cmakedefine BSDCPIO_VERSION_STRING "${BSDCPIO_VERSION_STRING}"
  20855. +
  20856. +/* Version number of bsdtar */
  20857. +#cmakedefine BSDTAR_VERSION_STRING "${BSDTAR_VERSION_STRING}"
  20858. +
  20859. +/* Version number of bsdcat */
  20860. +#cmakedefine BSDCAT_VERSION_STRING "${BSDCAT_VERSION_STRING}"
  20861. +
  20862. +/* Define to 1 if you have the `acl_create_entry' function. */
  20863. +#cmakedefine HAVE_ACL_CREATE_ENTRY 1
  20864. +
  20865. +/* Define to 1 if you have the `acl_get_fd_np' function. */
  20866. +#cmakedefine HAVE_ACL_GET_FD_NP 1
  20867. +
  20868. +/* Define to 1 if you have the `acl_get_link' function. */
  20869. +#cmakedefine HAVE_ACL_GET_LINK 1
  20870. +
  20871. +/* Define to 1 if you have the `acl_get_link_np' function. */
  20872. +#cmakedefine HAVE_ACL_GET_LINK_NP 1
  20873. +
  20874. +/* Define to 1 if you have the `acl_get_perm' function. */
  20875. +#cmakedefine HAVE_ACL_GET_PERM 1
  20876. +
  20877. +/* Define to 1 if you have the `acl_get_perm_np' function. */
  20878. +#cmakedefine HAVE_ACL_GET_PERM_NP 1
  20879. +
  20880. +/* Define to 1 if you have the `acl_init' function. */
  20881. +#cmakedefine HAVE_ACL_INIT 1
  20882. +
  20883. +/* Define to 1 if you have the <acl/libacl.h> header file. */
  20884. +#cmakedefine HAVE_ACL_LIBACL_H 1
  20885. +
  20886. +/* Define to 1 if the system has the type `acl_permset_t'. */
  20887. +#cmakedefine HAVE_ACL_PERMSET_T 1
  20888. +
  20889. +/* Define to 1 if you have the `acl_set_fd' function. */
  20890. +#cmakedefine HAVE_ACL_SET_FD 1
  20891. +
  20892. +/* Define to 1 if you have the `acl_set_fd_np' function. */
  20893. +#cmakedefine HAVE_ACL_SET_FD_NP 1
  20894. +
  20895. +/* Define to 1 if you have the `acl_set_file' function. */
  20896. +#cmakedefine HAVE_ACL_SET_FILE 1
  20897. +
  20898. +/* Define to 1 if you have the `arc4random_buf' function. */
  20899. +#cmakedefine HAVE_ARC4RANDOM_BUF 1
  20900. +
  20901. +/* Define to 1 if you have the <attr/xattr.h> header file. */
  20902. +#cmakedefine HAVE_ATTR_XATTR_H 1
  20903. +
  20904. +/* Define to 1 if you have the <Bcrypt.h> header file. */
  20905. +#cmakedefine HAVE_BCRYPT_H 1
  20906. +
  20907. +/* Define to 1 if you have the <bsdxml.h> header file. */
  20908. +#cmakedefine HAVE_BSDXML_H 1
  20909. +
  20910. +/* Define to 1 if you have the <bzlib.h> header file. */
  20911. +#cmakedefine HAVE_BZLIB_H 1
  20912. +
  20913. +/* Define to 1 if you have the `chflags' function. */
  20914. +#cmakedefine HAVE_CHFLAGS 1
  20915. +
  20916. +/* Define to 1 if you have the `chown' function. */
  20917. +#cmakedefine HAVE_CHOWN 1
  20918. +
  20919. +/* Define to 1 if you have the `chroot' function. */
  20920. +#cmakedefine HAVE_CHROOT 1
  20921. +
  20922. +/* Define to 1 if you have the <copyfile.h> header file. */
  20923. +#cmakedefine HAVE_COPYFILE_H 1
  20924. +
  20925. +/* Define to 1 if you have the `ctime_r' function. */
  20926. +#cmakedefine HAVE_CTIME_R 1
  20927. +
  20928. +/* Define to 1 if you have the <ctype.h> header file. */
  20929. +#cmakedefine HAVE_CTYPE_H 1
  20930. +
  20931. +/* Define to 1 if you have the `cygwin_conv_path' function. */
  20932. +#cmakedefine HAVE_CYGWIN_CONV_PATH 1
  20933. +
  20934. +/* Define to 1 if you have the declaration of `ACE_GETACL', and to 0 if you
  20935. + don't. */
  20936. +#cmakedefine HAVE_DECL_ACE_GETACL 1
  20937. +
  20938. +/* Define to 1 if you have the declaration of `ACE_GETACLCNT', and to 0 if you
  20939. + don't. */
  20940. +#cmakedefine HAVE_DECL_ACE_GETACLCNT 1
  20941. +
  20942. +/* Define to 1 if you have the declaration of `ACE_SETACL', and to 0 if you
  20943. + don't. */
  20944. +#cmakedefine HAVE_DECL_ACE_SETACL 1
  20945. +
  20946. +/* Define to 1 if you have the declaration of `ACL_SYNCHRONIZE', and to 0 if
  20947. + you don't. */
  20948. +#cmakedefine HAVE_DECL_ACL_SYNCHRONIZE 1
  20949. +
  20950. +/* Define to 1 if you have the declaration of `ACL_TYPE_EXTENDED', and to 0 if
  20951. + you don't. */
  20952. +#cmakedefine HAVE_DECL_ACL_TYPE_EXTENDED 1
  20953. +
  20954. +/* Define to 1 if you have the declaration of `ACL_TYPE_NFS4', and to 0 if you
  20955. + don't. */
  20956. +#cmakedefine HAVE_DECL_ACL_TYPE_NFS4 1
  20957. +
  20958. +/* Define to 1 if you have the declaration of `ACL_USER', and to 0 if you
  20959. + don't. */
  20960. +#cmakedefine HAVE_DECL_ACL_USER 1
  20961. +
  20962. +/* Define to 1 if you have the declaration of `INT32_MAX', and to 0 if you
  20963. + don't. */
  20964. +#cmakedefine HAVE_DECL_INT32_MAX 1
  20965. +
  20966. +/* Define to 1 if you have the declaration of `INT32_MIN', and to 0 if you
  20967. + don't. */
  20968. +#cmakedefine HAVE_DECL_INT32_MIN 1
  20969. +
  20970. +/* Define to 1 if you have the declaration of `INT64_MAX', and to 0 if you
  20971. + don't. */
  20972. +#cmakedefine HAVE_DECL_INT64_MAX 1
  20973. +
  20974. +/* Define to 1 if you have the declaration of `INT64_MIN', and to 0 if you
  20975. + don't. */
  20976. +#cmakedefine HAVE_DECL_INT64_MIN 1
  20977. +
  20978. +/* Define to 1 if you have the declaration of `INTMAX_MAX', and to 0 if you
  20979. + don't. */
  20980. +#cmakedefine HAVE_DECL_INTMAX_MAX 1
  20981. +
  20982. +/* Define to 1 if you have the declaration of `INTMAX_MIN', and to 0 if you
  20983. + don't. */
  20984. +#cmakedefine HAVE_DECL_INTMAX_MIN 1
  20985. +
  20986. +/* Define to 1 if you have the declaration of `SETACL', and to 0 if you don't.
  20987. + */
  20988. +#cmakedefine HAVE_DECL_SETACL 1
  20989. +
  20990. +/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
  20991. + don't. */
  20992. +#cmakedefine HAVE_DECL_SIZE_MAX 1
  20993. +
  20994. +/* Define to 1 if you have the declaration of `SSIZE_MAX', and to 0 if you
  20995. + don't. */
  20996. +#cmakedefine HAVE_DECL_SSIZE_MAX 1
  20997. +
  20998. +/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
  20999. + don't. */
  21000. +#cmakedefine HAVE_DECL_STRERROR_R 1
  21001. +
  21002. +/* Define to 1 if you have the declaration of `UINT32_MAX', and to 0 if you
  21003. + don't. */
  21004. +#cmakedefine HAVE_DECL_UINT32_MAX 1
  21005. +
  21006. +/* Define to 1 if you have the declaration of `UINT64_MAX', and to 0 if you
  21007. + don't. */
  21008. +#cmakedefine HAVE_DECL_UINT64_MAX 1
  21009. +
  21010. +/* Define to 1 if you have the declaration of `UINTMAX_MAX', and to 0 if you
  21011. + don't. */
  21012. +#cmakedefine HAVE_DECL_UINTMAX_MAX 1
  21013. +
  21014. +/* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
  21015. + you don't. */
  21016. +#cmakedefine HAVE_DECL_XATTR_NOFOLLOW 1
  21017. +
  21018. +/* Define to 1 if you have the <direct.h> header file. */
  21019. +#cmakedefine HAVE_DIRECT_H 1
  21020. +
  21021. +/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
  21022. + */
  21023. +#cmakedefine HAVE_DIRENT_H 1
  21024. +
  21025. +/* Define to 1 if you have the `dirfd' function. */
  21026. +#cmakedefine HAVE_DIRFD 1
  21027. +
  21028. +/* Define to 1 if you have the <dlfcn.h> header file. */
  21029. +#cmakedefine HAVE_DLFCN_H 1
  21030. +
  21031. +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
  21032. +#cmakedefine HAVE_DOPRNT 1
  21033. +
  21034. +/* Define to 1 if nl_langinfo supports D_MD_ORDER */
  21035. +#cmakedefine HAVE_D_MD_ORDER 1
  21036. +
  21037. +/* A possible errno value for invalid file format errors */
  21038. +#cmakedefine HAVE_EFTYPE 1
  21039. +
  21040. +/* A possible errno value for invalid file format errors */
  21041. +#cmakedefine HAVE_EILSEQ 1
  21042. +
  21043. +/* Define to 1 if you have the <errno.h> header file. */
  21044. +#cmakedefine HAVE_ERRNO_H 1
  21045. +
  21046. +/* Define to 1 if you have the <expat.h> header file. */
  21047. +#cmakedefine HAVE_EXPAT_H 1
  21048. +
  21049. +/* Define to 1 if you have the <ext2fs/ext2_fs.h> header file. */
  21050. +#cmakedefine HAVE_EXT2FS_EXT2_FS_H 1
  21051. +
  21052. +/* Define to 1 if you have the `extattr_get_file' function. */
  21053. +#cmakedefine HAVE_EXTATTR_GET_FILE 1
  21054. +
  21055. +/* Define to 1 if you have the `extattr_list_file' function. */
  21056. +#cmakedefine HAVE_EXTATTR_LIST_FILE 1
  21057. +
  21058. +/* Define to 1 if you have the `extattr_set_fd' function. */
  21059. +#cmakedefine HAVE_EXTATTR_SET_FD 1
  21060. +
  21061. +/* Define to 1 if you have the `extattr_set_file' function. */
  21062. +#cmakedefine HAVE_EXTATTR_SET_FILE 1
  21063. +
  21064. +/* Define to 1 if EXTATTR_NAMESPACE_USER is defined in sys/extattr.h. */
  21065. +#cmakedefine HAVE_DECL_EXTATTR_NAMESPACE_USER 1
  21066. +
  21067. +/* Define to 1 if you have the declaration of `GETACL', and to 0 if you don't.
  21068. + */
  21069. +#cmakedefine HAVE_DECL_GETACL 1
  21070. +
  21071. +/* Define to 1 if you have the declaration of `GETACLCNT', and to 0 if you
  21072. + don't. */
  21073. +#cmakedefine HAVE_DECL_GETACLCNT 1
  21074. +
  21075. +/* Define to 1 if you have the `fchdir' function. */
  21076. +#cmakedefine HAVE_FCHDIR 1
  21077. +
  21078. +/* Define to 1 if you have the `fchflags' function. */
  21079. +#cmakedefine HAVE_FCHFLAGS 1
  21080. +
  21081. +/* Define to 1 if you have the `fchmod' function. */
  21082. +#cmakedefine HAVE_FCHMOD 1
  21083. +
  21084. +/* Define to 1 if you have the `fchown' function. */
  21085. +#cmakedefine HAVE_FCHOWN 1
  21086. +
  21087. +/* Define to 1 if you have the `fcntl' function. */
  21088. +#cmakedefine HAVE_FCNTL 1
  21089. +
  21090. +/* Define to 1 if you have the <fcntl.h> header file. */
  21091. +#cmakedefine HAVE_FCNTL_H 1
  21092. +
  21093. +/* Define to 1 if you have the `fdopendir' function. */
  21094. +#cmakedefine HAVE_FDOPENDIR 1
  21095. +
  21096. +/* Define to 1 if you have the `fgetea' function. */
  21097. +#cmakedefine HAVE_FGETEA 1
  21098. +
  21099. +/* Define to 1 if you have the `fgetxattr' function. */
  21100. +#cmakedefine HAVE_FGETXATTR 1
  21101. +
  21102. +/* Define to 1 if you have the `flistea' function. */
  21103. +#cmakedefine HAVE_FLISTEA 1
  21104. +
  21105. +/* Define to 1 if you have the `flistxattr' function. */
  21106. +#cmakedefine HAVE_FLISTXATTR 1
  21107. +
  21108. +/* Define to 1 if you have the `fork' function. */
  21109. +#cmakedefine HAVE_FORK 1
  21110. +
  21111. +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
  21112. +#cmakedefine HAVE_FSEEKO 1
  21113. +
  21114. +/* Define to 1 if you have the `fsetea' function. */
  21115. +#cmakedefine HAVE_FSETEA 1
  21116. +
  21117. +/* Define to 1 if you have the `fsetxattr' function. */
  21118. +#cmakedefine HAVE_FSETXATTR 1
  21119. +
  21120. +/* Define to 1 if you have the `fstat' function. */
  21121. +#cmakedefine HAVE_FSTAT 1
  21122. +
  21123. +/* Define to 1 if you have the `fstatat' function. */
  21124. +#cmakedefine HAVE_FSTATAT 1
  21125. +
  21126. +/* Define to 1 if you have the `fstatfs' function. */
  21127. +#cmakedefine HAVE_FSTATFS 1
  21128. +
  21129. +/* Define to 1 if you have the `fstatvfs' function. */
  21130. +#cmakedefine HAVE_FSTATVFS 1
  21131. +
  21132. +/* Define to 1 if you have the `ftruncate' function. */
  21133. +#cmakedefine HAVE_FTRUNCATE 1
  21134. +
  21135. +/* Define to 1 if you have the `futimens' function. */
  21136. +#cmakedefine HAVE_FUTIMENS 1
  21137. +
  21138. +/* Define to 1 if you have the `futimes' function. */
  21139. +#cmakedefine HAVE_FUTIMES 1
  21140. +
  21141. +/* Define to 1 if you have the `futimesat' function. */
  21142. +#cmakedefine HAVE_FUTIMESAT 1
  21143. +
  21144. +/* Define to 1 if you have the `getea' function. */
  21145. +#cmakedefine HAVE_GETEA 1
  21146. +
  21147. +/* Define to 1 if you have the `geteuid' function. */
  21148. +#cmakedefine HAVE_GETEUID 1
  21149. +
  21150. +/* Define to 1 if you have the `getgrgid_r' function. */
  21151. +#cmakedefine HAVE_GETGRGID_R 1
  21152. +
  21153. +/* Define to 1 if you have the `getgrnam_r' function. */
  21154. +#cmakedefine HAVE_GETGRNAM_R 1
  21155. +
  21156. +/* Define to 1 if you have the `getpid' function. */
  21157. +#cmakedefine HAVE_GETPID 1
  21158. +
  21159. +/* Define to 1 if you have the `getpwnam_r' function. */
  21160. +#cmakedefine HAVE_GETPWNAM_R 1
  21161. +
  21162. +/* Define to 1 if you have the `getpwuid_r' function. */
  21163. +#cmakedefine HAVE_GETPWUID_R 1
  21164. +
  21165. +/* Define to 1 if you have the `getvfsbyname' function. */
  21166. +#cmakedefine HAVE_GETVFSBYNAME 1
  21167. +
  21168. +/* Define to 1 if you have the `getxattr' function. */
  21169. +#cmakedefine HAVE_GETXATTR 1
  21170. +
  21171. +/* Define to 1 if you have the `gmtime_r' function. */
  21172. +#cmakedefine HAVE_GMTIME_R 1
  21173. +
  21174. +/* Define to 1 if you have the <grp.h> header file. */
  21175. +#cmakedefine HAVE_GRP_H 1
  21176. +
  21177. +/* Define to 1 if you have the `iconv' function. */
  21178. +#cmakedefine HAVE_ICONV 1
  21179. +
  21180. +/* Define to 1 if you have the <iconv.h> header file. */
  21181. +#cmakedefine HAVE_ICONV_H 1
  21182. +
  21183. +/* Define to 1 if you have the <inttypes.h> header file. */
  21184. +#cmakedefine HAVE_INTTYPES_H 1
  21185. +
  21186. +/* Define to 1 if you have the <io.h> header file. */
  21187. +#cmakedefine HAVE_IO_H 1
  21188. +
  21189. +/* Define to 1 if you have the <langinfo.h> header file. */
  21190. +#cmakedefine HAVE_LANGINFO_H 1
  21191. +
  21192. +/* Define to 1 if you have the `lchflags' function. */
  21193. +#cmakedefine HAVE_LCHFLAGS 1
  21194. +
  21195. +/* Define to 1 if you have the `lchmod' function. */
  21196. +#cmakedefine HAVE_LCHMOD 1
  21197. +
  21198. +/* Define to 1 if you have the `lchown' function. */
  21199. +#cmakedefine HAVE_LCHOWN 1
  21200. +
  21201. +/* Define to 1 if you have the `lgetea' function. */
  21202. +#cmakedefine HAVE_LGETEA 1
  21203. +
  21204. +/* Define to 1 if you have the `lgetxattr' function. */
  21205. +#cmakedefine HAVE_LGETXATTR 1
  21206. +
  21207. +/* Define to 1 if you have the `acl' library (-lacl). */
  21208. +#cmakedefine HAVE_LIBACL 1
  21209. +
  21210. +/* Define to 1 if you have the `attr' library (-lattr). */
  21211. +#cmakedefine HAVE_LIBATTR 1
  21212. +
  21213. +/* Define to 1 if you have the `bsdxml' library (-lbsdxml). */
  21214. +#cmakedefine HAVE_LIBBSDXML 1
  21215. +
  21216. +/* Define to 1 if you have the `bz2' library (-lbz2). */
  21217. +#cmakedefine HAVE_LIBBZ2 1
  21218. +
  21219. +/* Define to 1 if you have the `b2' library (-lb2). */
  21220. +#cmakedefine HAVE_LIBB2 1
  21221. +
  21222. +/* Define to 1 if you have the <blake2.h> header file. */
  21223. +#cmakedefine HAVE_BLAKE2_H 1
  21224. +
  21225. +/* Define to 1 if you have the `charset' library (-lcharset). */
  21226. +#cmakedefine HAVE_LIBCHARSET 1
  21227. +
  21228. +/* Define to 1 if you have the `crypto' library (-lcrypto). */
  21229. +#cmakedefine HAVE_LIBCRYPTO 1
  21230. +
  21231. +/* Define to 1 if you have the `expat' library (-lexpat). */
  21232. +#cmakedefine HAVE_LIBEXPAT 1
  21233. +
  21234. +/* Define to 1 if you have the `gcc' library (-lgcc). */
  21235. +#cmakedefine HAVE_LIBGCC 1
  21236. +
  21237. +/* Define to 1 if you have the `lz4' library (-llz4). */
  21238. +#cmakedefine HAVE_LIBLZ4 1
  21239. +
  21240. +/* Define to 1 if you have the `lzma' library (-llzma). */
  21241. +#cmakedefine HAVE_LIBLZMA 1
  21242. +
  21243. +/* Define to 1 if you have the `lzmadec' library (-llzmadec). */
  21244. +#cmakedefine HAVE_LIBLZMADEC 1
  21245. +
  21246. +/* Define to 1 if you have the `lzo2' library (-llzo2). */
  21247. +#cmakedefine HAVE_LIBLZO2 1
  21248. +
  21249. +/* Define to 1 if you have the `mbedcrypto' library (-lmbedcrypto). */
  21250. +#cmakedefine HAVE_LIBMBEDCRYPTO 1
  21251. +
  21252. +/* Define to 1 if you have the `nettle' library (-lnettle). */
  21253. +#cmakedefine HAVE_LIBNETTLE 1
  21254. +
  21255. +/* Define to 1 if you have the `pcre' library (-lpcre). */
  21256. +#cmakedefine HAVE_LIBPCRE 1
  21257. +
  21258. +/* Define to 1 if you have the `pcreposix' library (-lpcreposix). */
  21259. +#cmakedefine HAVE_LIBPCREPOSIX 1
  21260. +
  21261. +/* Define to 1 if you have the `xml2' library (-lxml2). */
  21262. +#cmakedefine HAVE_LIBXML2 1
  21263. +
  21264. +/* Define to 1 if you have the <libxml/xmlreader.h> header file. */
  21265. +#cmakedefine HAVE_LIBXML_XMLREADER_H 1
  21266. +
  21267. +/* Define to 1 if you have the <libxml/xmlwriter.h> header file. */
  21268. +#cmakedefine HAVE_LIBXML_XMLWRITER_H 1
  21269. +
  21270. +/* Define to 1 if you have the `z' library (-lz). */
  21271. +#cmakedefine HAVE_LIBZ 1
  21272. +
  21273. +/* Define to 1 if you have the `zstd' library (-lzstd). */
  21274. +#cmakedefine HAVE_LIBZSTD 1
  21275. +
  21276. +/* Define to 1 if you have the <limits.h> header file. */
  21277. +#cmakedefine HAVE_LIMITS_H 1
  21278. +
  21279. +/* Define to 1 if you have the `link' function. */
  21280. +#cmakedefine HAVE_LINK 1
  21281. +
  21282. +/* Define to 1 if you have the <linux/fiemap.h> header file. */
  21283. +#cmakedefine HAVE_LINUX_FIEMAP_H 1
  21284. +
  21285. +/* Define to 1 if you have the <linux/fs.h> header file. */
  21286. +#cmakedefine HAVE_LINUX_FS_H 1
  21287. +
  21288. +/* Define to 1 if you have the <linux/magic.h> header file. */
  21289. +#cmakedefine HAVE_LINUX_MAGIC_H 1
  21290. +
  21291. +/* Define to 1 if you have the <linux/types.h> header file. */
  21292. +#cmakedefine HAVE_LINUX_TYPES_H 1
  21293. +
  21294. +/* Define to 1 if you have the `listea' function. */
  21295. +#cmakedefine HAVE_LISTEA 1
  21296. +
  21297. +/* Define to 1 if you have the `listxattr' function. */
  21298. +#cmakedefine HAVE_LISTXATTR 1
  21299. +
  21300. +/* Define to 1 if you have the `llistea' function. */
  21301. +#cmakedefine HAVE_LLISTEA 1
  21302. +
  21303. +/* Define to 1 if you have the `llistxattr' function. */
  21304. +#cmakedefine HAVE_LLISTXATTR 1
  21305. +
  21306. +/* Define to 1 if you have the <localcharset.h> header file. */
  21307. +#cmakedefine HAVE_LOCALCHARSET_H 1
  21308. +
  21309. +/* Define to 1 if you have the `locale_charset' function. */
  21310. +#cmakedefine HAVE_LOCALE_CHARSET 1
  21311. +
  21312. +/* Define to 1 if you have the <locale.h> header file. */
  21313. +#cmakedefine HAVE_LOCALE_H 1
  21314. +
  21315. +/* Define to 1 if you have the `localtime_r' function. */
  21316. +#cmakedefine HAVE_LOCALTIME_R 1
  21317. +
  21318. +/* Define to 1 if the system has the type `long long int'. */
  21319. +#cmakedefine HAVE_LONG_LONG_INT 1
  21320. +
  21321. +/* Define to 1 if you have the `lsetea' function. */
  21322. +#cmakedefine HAVE_LSETEA 1
  21323. +
  21324. +/* Define to 1 if you have the `lsetxattr' function. */
  21325. +#cmakedefine HAVE_LSETXATTR 1
  21326. +
  21327. +/* Define to 1 if you have the `lstat' function. */
  21328. +#cmakedefine HAVE_LSTAT 1
  21329. +
  21330. +/* Define to 1 if `lstat' has the bug that it succeeds when given the
  21331. + zero-length file name argument. */
  21332. +#cmakedefine HAVE_LSTAT_EMPTY_STRING_BUG 1
  21333. +
  21334. +/* Define to 1 if you have the `lutimes' function. */
  21335. +#cmakedefine HAVE_LUTIMES 1
  21336. +
  21337. +/* Define to 1 if you have the <lz4hc.h> header file. */
  21338. +#cmakedefine HAVE_LZ4HC_H 1
  21339. +
  21340. +/* Define to 1 if you have the <lz4.h> header file. */
  21341. +#cmakedefine HAVE_LZ4_H 1
  21342. +
  21343. +/* Define to 1 if you have the <lzmadec.h> header file. */
  21344. +#cmakedefine HAVE_LZMADEC_H 1
  21345. +
  21346. +/* Define to 1 if you have the <lzma.h> header file. */
  21347. +#cmakedefine HAVE_LZMA_H 1
  21348. +
  21349. +/* Define to 1 if you have a working `lzma_stream_encoder_mt' function. */
  21350. +#cmakedefine HAVE_LZMA_STREAM_ENCODER_MT 1
  21351. +
  21352. +/* Define to 1 if you have the <lzo/lzo1x.h> header file. */
  21353. +#cmakedefine HAVE_LZO_LZO1X_H 1
  21354. +
  21355. +/* Define to 1 if you have the <lzo/lzoconf.h> header file. */
  21356. +#cmakedefine HAVE_LZO_LZOCONF_H 1
  21357. +
  21358. +/* Define to 1 if you have the `mbrtowc' function. */
  21359. +#cmakedefine HAVE_MBRTOWC 1
  21360. +
  21361. +/* Define to 1 if you have the <membership.h> header file. */
  21362. +#cmakedefine HAVE_MEMBERSHIP_H 1
  21363. +
  21364. +/* Define to 1 if you have the `memmove' function. */
  21365. +#cmakedefine HAVE_MEMMOVE 1
  21366. +
  21367. +/* Define to 1 if you have the <memory.h> header file. */
  21368. +#cmakedefine HAVE_MEMORY_H 1
  21369. +
  21370. +/* Define to 1 if you have the `mkdir' function. */
  21371. +#cmakedefine HAVE_MKDIR 1
  21372. +
  21373. +/* Define to 1 if you have the `mkfifo' function. */
  21374. +#cmakedefine HAVE_MKFIFO 1
  21375. +
  21376. +/* Define to 1 if you have the `mknod' function. */
  21377. +#cmakedefine HAVE_MKNOD 1
  21378. +
  21379. +/* Define to 1 if you have the `mkstemp' function. */
  21380. +#cmakedefine HAVE_MKSTEMP 1
  21381. +
  21382. +/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
  21383. +#cmakedefine HAVE_NDIR_H 1
  21384. +
  21385. +/* Define to 1 if you have the <nettle/aes.h> header file. */
  21386. +#cmakedefine HAVE_NETTLE_AES_H 1
  21387. +
  21388. +/* Define to 1 if you have the <nettle/hmac.h> header file. */
  21389. +#cmakedefine HAVE_NETTLE_HMAC_H 1
  21390. +
  21391. +/* Define to 1 if you have the <nettle/md5.h> header file. */
  21392. +#cmakedefine HAVE_NETTLE_MD5_H 1
  21393. +
  21394. +/* Define to 1 if you have the <nettle/pbkdf2.h> header file. */
  21395. +#cmakedefine HAVE_NETTLE_PBKDF2_H 1
  21396. +
  21397. +/* Define to 1 if you have the <nettle/ripemd160.h> header file. */
  21398. +#cmakedefine HAVE_NETTLE_RIPEMD160_H 1
  21399. +
  21400. +/* Define to 1 if you have the <nettle/sha.h> header file. */
  21401. +#cmakedefine HAVE_NETTLE_SHA_H 1
  21402. +
  21403. +/* Define to 1 if you have the `nl_langinfo' function. */
  21404. +#cmakedefine HAVE_NL_LANGINFO 1
  21405. +
  21406. +/* Define to 1 if you have the `openat' function. */
  21407. +#cmakedefine HAVE_OPENAT 1
  21408. +
  21409. +/* Define to 1 if you have the <paths.h> header file. */
  21410. +#cmakedefine HAVE_PATHS_H 1
  21411. +
  21412. +/* Define to 1 if you have the <pcreposix.h> header file. */
  21413. +#cmakedefine HAVE_PCREPOSIX_H 1
  21414. +
  21415. +/* Define to 1 if you have the `pipe' function. */
  21416. +#cmakedefine HAVE_PIPE 1
  21417. +
  21418. +/* Define to 1 if you have the `PKCS5_PBKDF2_HMAC_SHA1' function. */
  21419. +#cmakedefine HAVE_PKCS5_PBKDF2_HMAC_SHA1 1
  21420. +
  21421. +/* Define to 1 if you have the `poll' function. */
  21422. +#cmakedefine HAVE_POLL 1
  21423. +
  21424. +/* Define to 1 if you have the <poll.h> header file. */
  21425. +#cmakedefine HAVE_POLL_H 1
  21426. +
  21427. +/* Define to 1 if you have the `posix_spawnp' function. */
  21428. +#cmakedefine HAVE_POSIX_SPAWNP 1
  21429. +
  21430. +/* Define to 1 if you have the <process.h> header file. */
  21431. +#cmakedefine HAVE_PROCESS_H 1
  21432. +
  21433. +/* Define to 1 if you have the <pthread.h> header file. */
  21434. +#cmakedefine HAVE_PTHREAD_H 1
  21435. +
  21436. +/* Define to 1 if you have the <pwd.h> header file. */
  21437. +#cmakedefine HAVE_PWD_H 1
  21438. +
  21439. +/* Define to 1 if you have the `readdir_r' function. */
  21440. +#cmakedefine HAVE_READDIR_R 1
  21441. +
  21442. +/* Define to 1 if you have the `readlink' function. */
  21443. +#cmakedefine HAVE_READLINK 1
  21444. +
  21445. +/* Define to 1 if you have the `readlinkat' function. */
  21446. +#cmakedefine HAVE_READLINKAT 1
  21447. +
  21448. +/* Define to 1 if you have the `readpassphrase' function. */
  21449. +#cmakedefine HAVE_READPASSPHRASE 1
  21450. +
  21451. +/* Define to 1 if you have the <readpassphrase.h> header file. */
  21452. +#cmakedefine HAVE_READPASSPHRASE_H 1
  21453. +
  21454. +/* Define to 1 if you have the <regex.h> header file. */
  21455. +#cmakedefine HAVE_REGEX_H 1
  21456. +
  21457. +/* Define to 1 if you have the `select' function. */
  21458. +#cmakedefine HAVE_SELECT 1
  21459. +
  21460. +/* Define to 1 if you have the `setenv' function. */
  21461. +#cmakedefine HAVE_SETENV 1
  21462. +
  21463. +/* Define to 1 if you have the `setlocale' function. */
  21464. +#cmakedefine HAVE_SETLOCALE 1
  21465. +
  21466. +/* Define to 1 if you have the `sigaction' function. */
  21467. +#cmakedefine HAVE_SIGACTION 1
  21468. +
  21469. +/* Define to 1 if you have the <signal.h> header file. */
  21470. +#cmakedefine HAVE_SIGNAL_H 1
  21471. +
  21472. +/* Define to 1 if you have the <spawn.h> header file. */
  21473. +#cmakedefine HAVE_SPAWN_H 1
  21474. +
  21475. +/* Define to 1 if you have the `statfs' function. */
  21476. +#cmakedefine HAVE_STATFS 1
  21477. +
  21478. +/* Define to 1 if you have the `statvfs' function. */
  21479. +#cmakedefine HAVE_STATVFS 1
  21480. +
  21481. +/* Define to 1 if `stat' has the bug that it succeeds when given the
  21482. + zero-length file name argument. */
  21483. +#cmakedefine HAVE_STAT_EMPTY_STRING_BUG 1
  21484. +
  21485. +/* Define to 1 if you have the <stdarg.h> header file. */
  21486. +#cmakedefine HAVE_STDARG_H 1
  21487. +
  21488. +/* Define to 1 if you have the <stdint.h> header file. */
  21489. +#cmakedefine HAVE_STDINT_H 1
  21490. +
  21491. +/* Define to 1 if you have the <stdlib.h> header file. */
  21492. +#cmakedefine HAVE_STDLIB_H 1
  21493. +
  21494. +/* Define to 1 if you have the `strchr' function. */
  21495. +#cmakedefine HAVE_STRCHR 1
  21496. +
  21497. +/* Define to 1 if you have the `strdup' function. */
  21498. +#cmakedefine HAVE_STRDUP 1
  21499. +
  21500. +/* Define to 1 if you have the `strerror' function. */
  21501. +#cmakedefine HAVE_STRERROR 1
  21502. +
  21503. +/* Define to 1 if you have the `strerror_r' function. */
  21504. +#cmakedefine HAVE_STRERROR_R 1
  21505. +
  21506. +/* Define to 1 if you have the `strftime' function. */
  21507. +#cmakedefine HAVE_STRFTIME 1
  21508. +
  21509. +/* Define to 1 if you have the <strings.h> header file. */
  21510. +#cmakedefine HAVE_STRINGS_H 1
  21511. +
  21512. +/* Define to 1 if you have the <string.h> header file. */
  21513. +#cmakedefine HAVE_STRING_H 1
  21514. +
  21515. +/* Define to 1 if you have the `strrchr' function. */
  21516. +#cmakedefine HAVE_STRRCHR 1
  21517. +
  21518. +/* Define to 1 if `f_namemax' is a member of `struct statfs'. */
  21519. +#cmakedefine HAVE_STRUCT_STATFS_F_NAMEMAX 1
  21520. +
  21521. +/* Define to 1 if `f_iosize' is a member of `struct statvfs'. */
  21522. +#cmakedefine HAVE_STRUCT_STATVFS_F_IOSIZE 1
  21523. +
  21524. +/* Define to 1 if `st_birthtime' is a member of `struct stat'. */
  21525. +#cmakedefine HAVE_STRUCT_STAT_ST_BIRTHTIME 1
  21526. +
  21527. +/* Define to 1 if `st_birthtimespec.tv_nsec' is a member of `struct stat'. */
  21528. +#cmakedefine HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
  21529. +
  21530. +/* Define to 1 if `st_blksize' is a member of `struct stat'. */
  21531. +#cmakedefine HAVE_STRUCT_STAT_ST_BLKSIZE 1
  21532. +
  21533. +/* Define to 1 if `st_flags' is a member of `struct stat'. */
  21534. +#cmakedefine HAVE_STRUCT_STAT_ST_FLAGS 1
  21535. +
  21536. +/* Define to 1 if `st_mtimespec.tv_nsec' is a member of `struct stat'. */
  21537. +#cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
  21538. +
  21539. +/* Define to 1 if `st_mtime_n' is a member of `struct stat'. */
  21540. +#cmakedefine HAVE_STRUCT_STAT_ST_MTIME_N 1
  21541. +
  21542. +/* Define to 1 if `st_mtime_usec' is a member of `struct stat'. */
  21543. +#cmakedefine HAVE_STRUCT_STAT_ST_MTIME_USEC 1
  21544. +
  21545. +/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */
  21546. +#cmakedefine HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
  21547. +
  21548. +/* Define to 1 if `st_umtime' is a member of `struct stat'. */
  21549. +#cmakedefine HAVE_STRUCT_STAT_ST_UMTIME 1
  21550. +
  21551. +/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */
  21552. +#cmakedefine HAVE_STRUCT_TM_TM_GMTOFF 1
  21553. +
  21554. +/* Define to 1 if `__tm_gmtoff' is a member of `struct tm'. */
  21555. +#cmakedefine HAVE_STRUCT_TM___TM_GMTOFF 1
  21556. +
  21557. +/* Define to 1 if you have `struct vfsconf'. */
  21558. +#cmakedefine HAVE_STRUCT_VFSCONF 1
  21559. +
  21560. +/* Define to 1 if you have `struct xvfsconf'. */
  21561. +#cmakedefine HAVE_STRUCT_XVFSCONF 1
  21562. +
  21563. +/* Define to 1 if you have the `symlink' function. */
  21564. +#cmakedefine HAVE_SYMLINK 1
  21565. +
  21566. +/* Define to 1 if you have the <sys/acl.h> header file. */
  21567. +#cmakedefine HAVE_SYS_ACL_H 1
  21568. +
  21569. +/* Define to 1 if you have the <sys/cdefs.h> header file. */
  21570. +#cmakedefine HAVE_SYS_CDEFS_H 1
  21571. +
  21572. +/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
  21573. + */
  21574. +#cmakedefine HAVE_SYS_DIR_H 1
  21575. +
  21576. +/* Define to 1 if you have the <sys/ea.h> header file. */
  21577. +#cmakedefine HAVE_SYS_EA_H 1
  21578. +
  21579. +/* Define to 1 if you have the <sys/extattr.h> header file. */
  21580. +#cmakedefine HAVE_SYS_EXTATTR_H 1
  21581. +
  21582. +/* Define to 1 if you have the <sys/ioctl.h> header file. */
  21583. +#cmakedefine HAVE_SYS_IOCTL_H 1
  21584. +
  21585. +/* Define to 1 if you have the <sys/mkdev.h> header file. */
  21586. +#cmakedefine HAVE_SYS_MKDEV_H 1
  21587. +
  21588. +/* Define to 1 if you have the <sys/mount.h> header file. */
  21589. +#cmakedefine HAVE_SYS_MOUNT_H 1
  21590. +
  21591. +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
  21592. + */
  21593. +#cmakedefine HAVE_SYS_NDIR_H 1
  21594. +
  21595. +/* Define to 1 if you have the <sys/param.h> header file. */
  21596. +#cmakedefine HAVE_SYS_PARAM_H 1
  21597. +
  21598. +/* Define to 1 if you have the <sys/poll.h> header file. */
  21599. +#cmakedefine HAVE_SYS_POLL_H 1
  21600. +
  21601. +/* Define to 1 if you have the <sys/richacl.h> header file. */
  21602. +#cmakedefine HAVE_SYS_RICHACL_H 1
  21603. +
  21604. +/* Define to 1 if you have the <sys/select.h> header file. */
  21605. +#cmakedefine HAVE_SYS_SELECT_H 1
  21606. +
  21607. +/* Define to 1 if you have the <sys/statfs.h> header file. */
  21608. +#cmakedefine HAVE_SYS_STATFS_H 1
  21609. +
  21610. +/* Define to 1 if you have the <sys/statvfs.h> header file. */
  21611. +#cmakedefine HAVE_SYS_STATVFS_H 1
  21612. +
  21613. +/* Define to 1 if you have the <sys/stat.h> header file. */
  21614. +#cmakedefine HAVE_SYS_STAT_H 1
  21615. +
  21616. +
  21617. +/* Define to 1 if you have the <sys/sysmacros.h> header file. */
  21618. +#cmakedefine HAVE_SYS_SYSMACROS_H 1
  21619. +
  21620. +/* Define to 1 if you have the <sys/time.h> header file. */
  21621. +#cmakedefine HAVE_SYS_TIME_H 1
  21622. +
  21623. +/* Define to 1 if you have the <sys/types.h> header file. */
  21624. +#cmakedefine HAVE_SYS_TYPES_H 1
  21625. +
  21626. +/* Define to 1 if you have the <sys/utime.h> header file. */
  21627. +#cmakedefine HAVE_SYS_UTIME_H 1
  21628. +
  21629. +/* Define to 1 if you have the <sys/utsname.h> header file. */
  21630. +#cmakedefine HAVE_SYS_UTSNAME_H 1
  21631. +
  21632. +/* Define to 1 if you have the <sys/vfs.h> header file. */
  21633. +#cmakedefine HAVE_SYS_VFS_H 1
  21634. +
  21635. +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
  21636. +#cmakedefine HAVE_SYS_WAIT_H 1
  21637. +
  21638. +/* Define to 1 if you have the <sys/xattr.h> header file. */
  21639. +#cmakedefine HAVE_SYS_XATTR_H 1
  21640. +
  21641. +/* Define to 1 if you have the `timegm' function. */
  21642. +#cmakedefine HAVE_TIMEGM 1
  21643. +
  21644. +/* Define to 1 if you have the <time.h> header file. */
  21645. +#cmakedefine HAVE_TIME_H 1
  21646. +
  21647. +/* Define to 1 if you have the `tzset' function. */
  21648. +#cmakedefine HAVE_TZSET 1
  21649. +
  21650. +/* Define to 1 if you have the <unistd.h> header file. */
  21651. +#cmakedefine HAVE_UNISTD_H 1
  21652. +
  21653. +/* Define to 1 if you have the `unlinkat' function. */
  21654. +#cmakedefine HAVE_UNLINKAT 1
  21655. +
  21656. +/* Define to 1 if you have the `unsetenv' function. */
  21657. +#cmakedefine HAVE_UNSETENV 1
  21658. +
  21659. +/* Define to 1 if the system has the type `unsigned long long'. */
  21660. +#cmakedefine HAVE_UNSIGNED_LONG_LONG 1
  21661. +
  21662. +/* Define to 1 if the system has the type `unsigned long long int'. */
  21663. +#cmakedefine HAVE_UNSIGNED_LONG_LONG_INT 1
  21664. +
  21665. +/* Define to 1 if you have the `utime' function. */
  21666. +#cmakedefine HAVE_UTIME 1
  21667. +
  21668. +/* Define to 1 if you have the `utimensat' function. */
  21669. +#cmakedefine HAVE_UTIMENSAT 1
  21670. +
  21671. +/* Define to 1 if you have the `utimes' function. */
  21672. +#cmakedefine HAVE_UTIMES 1
  21673. +
  21674. +/* Define to 1 if you have the <utime.h> header file. */
  21675. +#cmakedefine HAVE_UTIME_H 1
  21676. +
  21677. +/* Define to 1 if you have the `vfork' function. */
  21678. +#cmakedefine HAVE_VFORK 1
  21679. +
  21680. +/* Define to 1 if you have the `vprintf' function. */
  21681. +#cmakedefine HAVE_VPRINTF 1
  21682. +
  21683. +/* Define to 1 if you have the <wchar.h> header file. */
  21684. +#cmakedefine HAVE_WCHAR_H 1
  21685. +
  21686. +/* Define to 1 if the system has the type `wchar_t'. */
  21687. +#cmakedefine HAVE_WCHAR_T 1
  21688. +
  21689. +/* Define to 1 if you have the `wcrtomb' function. */
  21690. +#cmakedefine HAVE_WCRTOMB 1
  21691. +
  21692. +/* Define to 1 if you have the `wcscmp' function. */
  21693. +#cmakedefine HAVE_WCSCMP 1
  21694. +
  21695. +/* Define to 1 if you have the `wcscpy' function. */
  21696. +#cmakedefine HAVE_WCSCPY 1
  21697. +
  21698. +/* Define to 1 if you have the `wcslen' function. */
  21699. +#cmakedefine HAVE_WCSLEN 1
  21700. +
  21701. +/* Define to 1 if you have the `wctomb' function. */
  21702. +#cmakedefine HAVE_WCTOMB 1
  21703. +
  21704. +/* Define to 1 if you have the <wctype.h> header file. */
  21705. +#cmakedefine HAVE_WCTYPE_H 1
  21706. +
  21707. +/* Define to 1 if you have the <wincrypt.h> header file. */
  21708. +#cmakedefine HAVE_WINCRYPT_H 1
  21709. +
  21710. +/* Define to 1 if you have the <windows.h> header file. */
  21711. +#cmakedefine HAVE_WINDOWS_H 1
  21712. +
  21713. +/* Define to 1 if you have the <winioctl.h> header file. */
  21714. +#cmakedefine HAVE_WINIOCTL_H 1
  21715. +
  21716. +/* Define to 1 if you have _CrtSetReportMode in <crtdbg.h> */
  21717. +#cmakedefine HAVE__CrtSetReportMode 1
  21718. +
  21719. +/* Define to 1 if you have the `wmemcmp' function. */
  21720. +#cmakedefine HAVE_WMEMCMP 1
  21721. +
  21722. +/* Define to 1 if you have the `wmemcpy' function. */
  21723. +#cmakedefine HAVE_WMEMCPY 1
  21724. +
  21725. +/* Define to 1 if you have the `wmemmove' function. */
  21726. +#cmakedefine HAVE_WMEMMOVE 1
  21727. +
  21728. +/* Define to 1 if you have a working EXT2_IOC_GETFLAGS */
  21729. +#cmakedefine HAVE_WORKING_EXT2_IOC_GETFLAGS 1
  21730. +
  21731. +/* Define to 1 if you have a working FS_IOC_GETFLAGS */
  21732. +#cmakedefine HAVE_WORKING_FS_IOC_GETFLAGS 1
  21733. +
  21734. +/* Define to 1 if you have the <zlib.h> header file. */
  21735. +#cmakedefine HAVE_ZLIB_H 1
  21736. +
  21737. +/* Define to 1 if you have the <zstd.h> header file. */
  21738. +#cmakedefine HAVE_ZSTD_H 1
  21739. +
  21740. +/* Define to 1 if you have the `_ctime64_s' function. */
  21741. +#cmakedefine HAVE__CTIME64_S 1
  21742. +
  21743. +/* Define to 1 if you have the `_fseeki64' function. */
  21744. +#cmakedefine HAVE__FSEEKI64 1
  21745. +
  21746. +/* Define to 1 if you have the `_get_timezone' function. */
  21747. +#cmakedefine HAVE__GET_TIMEZONE 1
  21748. +
  21749. +/* Define to 1 if you have the `_gmtime64_s' function. */
  21750. +#cmakedefine HAVE__GMTIME64_S 1
  21751. +
  21752. +/* Define to 1 if you have the `_localtime64_s' function. */
  21753. +#cmakedefine HAVE__LOCALTIME64_S 1
  21754. +
  21755. +/* Define to 1 if you have the `_mkgmtime64' function. */
  21756. +#cmakedefine HAVE__MKGMTIME64 1
  21757. +
  21758. +/* Define as const if the declaration of iconv() needs const. */
  21759. +#define ICONV_CONST ${ICONV_CONST}
  21760. +
  21761. +/* Version number of libarchive as a single integer */
  21762. +#cmakedefine LIBARCHIVE_VERSION_NUMBER "${LIBARCHIVE_VERSION_NUMBER}"
  21763. +
  21764. +/* Version number of libarchive */
  21765. +#cmakedefine LIBARCHIVE_VERSION_STRING "${LIBARCHIVE_VERSION_STRING}"
  21766. +
  21767. +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
  21768. + slash. */
  21769. +#cmakedefine LSTAT_FOLLOWS_SLASHED_SYMLINK 1
  21770. +
  21771. +/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
  21772. + */
  21773. +#cmakedefine MAJOR_IN_MKDEV 1
  21774. +
  21775. +/* Define to 1 if `major', `minor', and `makedev' are declared in
  21776. + <sysmacros.h>. */
  21777. +#cmakedefine MAJOR_IN_SYSMACROS 1
  21778. +
  21779. +/* Define to 1 if your C compiler doesn't accept -c and -o together. */
  21780. +#cmakedefine NO_MINUS_C_MINUS_O 1
  21781. +
  21782. +/* The size of `wchar_t', as computed by sizeof. */
  21783. +#cmakedefine SIZEOF_WCHAR_T ${SIZEOF_WCHAR_T}
  21784. +
  21785. +/* Define to 1 if strerror_r returns char *. */
  21786. +#cmakedefine STRERROR_R_CHAR_P 1
  21787. +
  21788. +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
  21789. +#cmakedefine TIME_WITH_SYS_TIME 1
  21790. +
  21791. +/*
  21792. + * Some platform requires a macro to use extension functions.
  21793. + */
  21794. +#cmakedefine SAFE_TO_DEFINE_EXTENSIONS 1
  21795. +#ifdef SAFE_TO_DEFINE_EXTENSIONS
  21796. +/* Enable extensions on AIX 3, Interix. */
  21797. +#ifndef _ALL_SOURCE
  21798. +# define _ALL_SOURCE 1
  21799. +#endif
  21800. +/* Enable GNU extensions on systems that have them. */
  21801. +#ifndef _GNU_SOURCE
  21802. +# define _GNU_SOURCE 1
  21803. +#endif
  21804. +/* Enable threading extensions on Solaris. */
  21805. +#ifndef _POSIX_PTHREAD_SEMANTICS
  21806. +# define _POSIX_PTHREAD_SEMANTICS 1
  21807. +#endif
  21808. +/* Enable extensions on HP NonStop. */
  21809. +#ifndef _TANDEM_SOURCE
  21810. +# define _TANDEM_SOURCE 1
  21811. +#endif
  21812. +/* Enable general extensions on Solaris. */
  21813. +#ifndef __EXTENSIONS__
  21814. +# define __EXTENSIONS__ 1
  21815. +#endif
  21816. +#endif /* SAFE_TO_DEFINE_EXTENSIONS */
  21817. +
  21818. +/* Version number of package */
  21819. +#cmakedefine VERSION "${VERSION}"
  21820. +
  21821. +/* Number of bits in a file offset, on hosts where this is settable. */
  21822. +#cmakedefine _FILE_OFFSET_BITS ${_FILE_OFFSET_BITS}
  21823. +
  21824. +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
  21825. +#cmakedefine _LARGEFILE_SOURCE 1
  21826. +
  21827. +/* Define for large files, on AIX-style hosts. */
  21828. +#cmakedefine _LARGE_FILES ${_LARGE_FILES}
  21829. +
  21830. +/* Define to control Windows SDK version */
  21831. +#ifndef NTDDI_VERSION
  21832. +#cmakedefine NTDDI_VERSION ${NTDDI_VERSION}
  21833. +#endif // NTDDI_VERSION
  21834. +
  21835. +#ifndef _WIN32_WINNT
  21836. +#cmakedefine _WIN32_WINNT ${_WIN32_WINNT}
  21837. +#endif // _WIN32_WINNT
  21838. +
  21839. +#ifndef WINVER
  21840. +#cmakedefine WINVER ${WINVER}
  21841. +#endif // WINVER
  21842. +
  21843. +/* Define to empty if `const' does not conform to ANSI C. */
  21844. +#cmakedefine const ${const}
  21845. +
  21846. +/* Define to `int' if <sys/types.h> doesn't define. */
  21847. +#cmakedefine gid_t ${gid_t}
  21848. +
  21849. +/* Define to `unsigned long' if <sys/types.h> does not define. */
  21850. +#cmakedefine id_t ${id_t}
  21851. +
  21852. +/* Define to `int' if <sys/types.h> does not define. */
  21853. +#cmakedefine mode_t ${mode_t}
  21854. +
  21855. +/* Define to `long long' if <sys/types.h> does not define. */
  21856. +#cmakedefine off_t ${off_t}
  21857. +
  21858. +/* Define to `int' if <sys/types.h> doesn't define. */
  21859. +#cmakedefine pid_t ${pid_t}
  21860. +
  21861. +/* Define to `unsigned int' if <sys/types.h> does not define. */
  21862. +#cmakedefine size_t ${size_t}
  21863. +
  21864. +/* Define to `int' if <sys/types.h> does not define. */
  21865. +#cmakedefine ssize_t ${ssize_t}
  21866. +
  21867. +/* Define to `int' if <sys/types.h> doesn't define. */
  21868. +#cmakedefine uid_t ${uid_t}
  21869. +
  21870. +/* Define to `int' if <sys/types.h> does not define. */
  21871. +#cmakedefine intptr_t ${intptr_t}
  21872. +
  21873. +/* Define to `unsigned int' if <sys/types.h> does not define. */
  21874. +#cmakedefine uintptr_t ${uintptr_t}
  21875. --- /dev/null
  21876. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/pkgconfig/libarchive.pc.in
  21877. @@ -0,0 +1,12 @@
  21878. +prefix=@prefix@
  21879. +exec_prefix=@exec_prefix@
  21880. +libdir=@libdir@
  21881. +includedir=@includedir@
  21882. +
  21883. +Name: libarchive
  21884. +Description: library that can create and read several streaming archive formats
  21885. +Version: @VERSION@
  21886. +Cflags: -I${includedir}
  21887. +Cflags.private: -DLIBARCHIVE_STATIC
  21888. +Libs: -L${libdir} -larchive
  21889. +Libs.private: @LIBS@
  21890. --- /dev/null
  21891. +++ cardinal-22.02/src/Rack/dep/libarchive-3.4.3/build/version
  21892. @@ -0,0 +1 @@
  21893. +3004003
  21894. --- /dev/null
  21895. +++ cardinal-22.02/src/Rack/dep/speexdsp-SpeexDSP-1.2rc3/SpeexDSP.kdevelop
  21896. @@ -0,0 +1,201 @@
  21897. +<?xml version = '1.0'?>
  21898. +<kdevelop>
  21899. + <general>
  21900. + <author>Jean-Marc Valin</author>
  21901. + <email>jean-marc.valin@usherbrooke.ca</email>
  21902. + <version>$VERSION$</version>
  21903. + <projectmanagement>KDevAutoProject</projectmanagement>
  21904. + <primarylanguage>C</primarylanguage>
  21905. + <ignoreparts/>
  21906. + <projectdirectory>.</projectdirectory>
  21907. + <absoluteprojectpath>false</absoluteprojectpath>
  21908. + <description/>
  21909. + <secondaryLanguages/>
  21910. + <versioncontrol>kdevsubversion</versioncontrol>
  21911. + <defaultencoding/>
  21912. + <projectname>Speex</projectname>
  21913. + </general>
  21914. + <kdevautoproject>
  21915. + <general>
  21916. + <activetarget>libspeex/libspeex.la</activetarget>
  21917. + <useconfiguration>float</useconfiguration>
  21918. + </general>
  21919. + <run>
  21920. + <mainprogram>src/Speex</mainprogram>
  21921. + <directoryradio>executable</directoryradio>
  21922. + <customdirectory>/</customdirectory>
  21923. + <programargs/>
  21924. + <terminal>false</terminal>
  21925. + <autocompile>true</autocompile>
  21926. + <envvars/>
  21927. + <autoinstall>false</autoinstall>
  21928. + <autokdesu>false</autokdesu>
  21929. + </run>
  21930. + <configurations>
  21931. + <float>
  21932. + <builddir>float</builddir>
  21933. + <ccompiler>kdevgccoptions</ccompiler>
  21934. + <cxxcompiler>kdevgppoptions</cxxcompiler>
  21935. + <f77compiler>kdevpgf77options</f77compiler>
  21936. + <cflags>-O2 -g -Wall</cflags>
  21937. + <envvars/>
  21938. + <configargs>--disable-shared</configargs>
  21939. + <topsourcedir/>
  21940. + <cppflags/>
  21941. + <ldflags/>
  21942. + <ccompilerbinary/>
  21943. + <cxxcompilerbinary/>
  21944. + <f77compilerbinary/>
  21945. + <cxxflags/>
  21946. + <f77flags/>
  21947. + </float>
  21948. + <fixed>
  21949. + <configargs>--enable-fixed-point --disable-shared</configargs>
  21950. + <builddir>fixed</builddir>
  21951. + <ccompiler>kdevgccoptions</ccompiler>
  21952. + <cxxcompiler>kdevgppoptions</cxxcompiler>
  21953. + <f77compiler>kdevpgf77options</f77compiler>
  21954. + <cflags>-O2 -g -Wall</cflags>
  21955. + <envvars/>
  21956. + <topsourcedir/>
  21957. + <cppflags/>
  21958. + <ldflags/>
  21959. + <ccompilerbinary/>
  21960. + <cxxcompilerbinary/>
  21961. + <f77compilerbinary/>
  21962. + <cxxflags/>
  21963. + <f77flags/>
  21964. + </fixed>
  21965. + <default>
  21966. + <envvars/>
  21967. + </default>
  21968. + </configurations>
  21969. + <make>
  21970. + <envvars>
  21971. + <envvar value="1" name="WANT_AUTOCONF_2_5" />
  21972. + <envvar value="1" name="WANT_AUTOMAKE_1_6" />
  21973. + </envvars>
  21974. + <abortonerror>false</abortonerror>
  21975. + <numberofjobs>4</numberofjobs>
  21976. + <dontact>false</dontact>
  21977. + <makebin/>
  21978. + <runmultiplejobs>true</runmultiplejobs>
  21979. + <prio>0</prio>
  21980. + </make>
  21981. + </kdevautoproject>
  21982. + <kdevdebugger>
  21983. + <general>
  21984. + <dbgshell>libtool</dbgshell>
  21985. + <programargs/>
  21986. + <gdbpath/>
  21987. + <configGdbScript/>
  21988. + <runShellScript/>
  21989. + <runGdbScript/>
  21990. + <breakonloadinglibs>true</breakonloadinglibs>
  21991. + <separatetty>false</separatetty>
  21992. + <floatingtoolbar>false</floatingtoolbar>
  21993. + </general>
  21994. + <display>
  21995. + <staticmembers>false</staticmembers>
  21996. + <demanglenames>true</demanglenames>
  21997. + <outputradix>10</outputradix>
  21998. + </display>
  21999. + </kdevdebugger>
  22000. + <kdevfilecreate>
  22001. + <filetypes/>
  22002. + <useglobaltypes>
  22003. + <type ext="c" />
  22004. + <type ext="h" />
  22005. + </useglobaltypes>
  22006. + </kdevfilecreate>
  22007. + <kdevcppsupport>
  22008. + <references/>
  22009. + <codecompletion>
  22010. + <includeGlobalFunctions>true</includeGlobalFunctions>
  22011. + <includeTypes>true</includeTypes>
  22012. + <includeEnums>true</includeEnums>
  22013. + <includeTypedefs>false</includeTypedefs>
  22014. + <automaticCodeCompletion>true</automaticCodeCompletion>
  22015. + <automaticArgumentsHint>true</automaticArgumentsHint>
  22016. + <automaticHeaderCompletion>true</automaticHeaderCompletion>
  22017. + <codeCompletionDelay>350</codeCompletionDelay>
  22018. + <argumentsHintDelay>400</argumentsHintDelay>
  22019. + <headerCompletionDelay>250</headerCompletionDelay>
  22020. + <showOnlyAccessibleItems>false</showOnlyAccessibleItems>
  22021. + <completionBoxItemOrder>0</completionBoxItemOrder>
  22022. + <howEvaluationContextMenu>true</howEvaluationContextMenu>
  22023. + <showCommentWithArgumentHint>true</showCommentWithArgumentHint>
  22024. + <statusBarTypeEvaluation>false</statusBarTypeEvaluation>
  22025. + <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
  22026. + <processPrimaryTypes>true</processPrimaryTypes>
  22027. + <processFunctionArguments>true</processFunctionArguments>
  22028. + <preProcessAllHeaders>false</preProcessAllHeaders>
  22029. + <parseMissingHeaders>false</parseMissingHeaders>
  22030. + <resolveIncludePaths>true</resolveIncludePaths>
  22031. + <alwaysParseInBackground>true</alwaysParseInBackground>
  22032. + <usePermanentCaching>true</usePermanentCaching>
  22033. + <alwaysIncludeNamespaces>true</alwaysIncludeNamespaces>
  22034. + <includePaths>.;</includePaths>
  22035. + <parseMissingHeadersExperimental>false</parseMissingHeadersExperimental>
  22036. + <resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
  22037. + </codecompletion>
  22038. + <qt>
  22039. + <used>false</used>
  22040. + <version>3</version>
  22041. + <root>/usr/share/qt3</root>
  22042. + <includestyle>3</includestyle>
  22043. + <designerintegration>EmbeddedKDevDesigner</designerintegration>
  22044. + <qmake>/usr/share/qt3/bin/qmake</qmake>
  22045. + <designer>/usr/bin/designer-qt3</designer>
  22046. + <designerpluginpaths/>
  22047. + </qt>
  22048. + <creategettersetter>
  22049. + <prefixGet/>
  22050. + <prefixSet>set</prefixSet>
  22051. + <prefixVariable>m_,_</prefixVariable>
  22052. + <parameterName>theValue</parameterName>
  22053. + <inlineGet>true</inlineGet>
  22054. + <inlineSet>true</inlineSet>
  22055. + </creategettersetter>
  22056. + <splitheadersource>
  22057. + <enabled>true</enabled>
  22058. + <synchronize>true</synchronize>
  22059. + <orientation>Horizontal</orientation>
  22060. + </splitheadersource>
  22061. + </kdevcppsupport>
  22062. + <kdevfileview>
  22063. + <groups>
  22064. + <hidenonprojectfiles>false</hidenonprojectfiles>
  22065. + <hidenonlocation>false</hidenonlocation>
  22066. + </groups>
  22067. + <tree>
  22068. + <hidepatterns>*.o,*.lo,CVS</hidepatterns>
  22069. + <hidenonprojectfiles>true</hidenonprojectfiles>
  22070. + <showvcsfields>false</showvcsfields>
  22071. + </tree>
  22072. + </kdevfileview>
  22073. + <kdevdoctreeview>
  22074. + <projectdoc>
  22075. + <userdocDir>html/</userdocDir>
  22076. + <apidocDir>html/</apidocDir>
  22077. + </projectdoc>
  22078. + <ignoreqt_xml/>
  22079. + <ignoredoxygen/>
  22080. + <ignorekdocs/>
  22081. + <ignoretocs/>
  22082. + <ignoredevhelp/>
  22083. + </kdevdoctreeview>
  22084. + <cppsupportpart>
  22085. + <filetemplates>
  22086. + <interfacesuffix>.h</interfacesuffix>
  22087. + <implementationsuffix>.cpp</implementationsuffix>
  22088. + </filetemplates>
  22089. + </cppsupportpart>
  22090. + <kdevdocumentation>
  22091. + <projectdoc>
  22092. + <docsystem/>
  22093. + <docurl/>
  22094. + <usermanualurl/>
  22095. + </projectdoc>
  22096. + </kdevdocumentation>
  22097. +</kdevelop>
  22098. --- /dev/null
  22099. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/.circleci/config.yml
  22100. @@ -0,0 +1,169 @@
  22101. +version: 2
  22102. +
  22103. +jobs:
  22104. + # the first half of the jobs are in this test
  22105. + short-tests-0:
  22106. + # TODO: Create a small custom docker image with all the dependencies we need
  22107. + # preinstalled to reduce installation time.
  22108. + docker:
  22109. + - image: fbopensource/zstd-circleci-primary:0.0.1
  22110. + steps:
  22111. + - checkout
  22112. + - run:
  22113. + name: Test
  22114. + command: |
  22115. + ./tests/test-license.py
  22116. + cc -v; CFLAGS="-O0 -Werror -pedantic" make all && make clean
  22117. + make c99build ; make clean
  22118. + make c11build ; make clean
  22119. + make aarch64build ; make clean
  22120. + make -j regressiontest; make clean
  22121. + make shortest ; make clean
  22122. + make cxxtest ; make clean
  22123. + # the second half of the jobs are in this test
  22124. + short-tests-1:
  22125. + docker:
  22126. + - image: fbopensource/zstd-circleci-primary:0.0.1
  22127. + steps:
  22128. + - checkout
  22129. + - run:
  22130. + name: Test
  22131. + command: |
  22132. + make gnu90build; make clean
  22133. + make gnu99build; make clean
  22134. + make ppc64build; make clean
  22135. + make ppcbuild ; make clean
  22136. + make armbuild ; make clean
  22137. + make -C tests test-legacy test-longmatch; make clean
  22138. + make -C lib libzstd-nomt; make clean
  22139. + # This step is only run on release tags.
  22140. + # It publishes the source tarball as artifacts and if the GITHUB_TOKEN
  22141. + # environment variable is set it will publish the source tarball to the
  22142. + # tagged release.
  22143. + publish-github-release:
  22144. + docker:
  22145. + - image: fbopensource/zstd-circleci-primary:0.0.1
  22146. + environment:
  22147. + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
  22148. + steps:
  22149. + - checkout
  22150. + - run:
  22151. + name: Publish
  22152. + command: |
  22153. + export VERSION=$(echo $CIRCLE_TAG | tail -c +2)
  22154. + export ZSTD_VERSION=zstd-$VERSION
  22155. + git archive $CIRCLE_TAG --prefix $ZSTD_VERSION/ --format tar \
  22156. + -o $ZSTD_VERSION.tar
  22157. + sha256sum $ZSTD_VERSION.tar > $ZSTD_VERSION.tar.sha256
  22158. + zstd -19 $ZSTD_VERSION.tar
  22159. + sha256sum $ZSTD_VERSION.tar.zst > $ZSTD_VERSION.tar.zst.sha256
  22160. + gzip -k -9 $ZSTD_VERSION.tar
  22161. + sha256sum $ZSTD_VERSION.tar.gz > $ZSTD_VERSION.tar.gz.sha256
  22162. + mkdir -p $CIRCLE_ARTIFACTS
  22163. + cp $ZSTD_VERSION.tar* $CIRCLE_ARTIFACTS
  22164. + - store_artifacts:
  22165. + path: /tmp/circleci-artifacts
  22166. + # This step should only be run in a cron job
  22167. + regression-test:
  22168. + docker:
  22169. + - image: fbopensource/zstd-circleci-primary:0.0.1
  22170. + environment:
  22171. + CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
  22172. + steps:
  22173. + - checkout
  22174. + # Restore the cached resources.
  22175. + - restore_cache:
  22176. + # We try our best to bust the cache when the data changes by hashing
  22177. + # data.c. If that doesn't work, simply update the version number here
  22178. + # and below. If we fail to bust the cache, the regression testing will
  22179. + # still work, since it has its own stamp, but will need to redownload
  22180. + # everything.
  22181. + keys:
  22182. + - regression-cache-{{ checksum "tests/regression/data.c" }}-v0
  22183. + - run:
  22184. + name: Regression Test
  22185. + command: |
  22186. + make -C programs zstd
  22187. + make -C tests/regression test
  22188. + mkdir -p $CIRCLE_ARTIFACTS
  22189. + ./tests/regression/test \
  22190. + --cache tests/regression/cache \
  22191. + --output $CIRCLE_ARTIFACTS/results.csv \
  22192. + --zstd programs/zstd
  22193. + echo "NOTE: The new results.csv is uploaded as an artifact to this job"
  22194. + echo " If this fails, go to the Artifacts pane in CircleCI, "
  22195. + echo " download /tmp/circleci-artifacts/results.csv, and if they "
  22196. + echo " are still good, copy it into the repo and commit it."
  22197. + echo "> diff tests/regression/results.csv $CIRCLE_ARTIFACTS/results.csv"
  22198. + diff tests/regression/results.csv $CIRCLE_ARTIFACTS/results.csv
  22199. + # Only save the cache on success (default), since if the failure happened
  22200. + # before we stamp the data cache, we will have a bad cache for this key.
  22201. + - save_cache:
  22202. + key: regression-cache-{{ checksum "tests/regression/data.c" }}-v0
  22203. + paths:
  22204. + - tests/regression/cache
  22205. + - store_artifacts:
  22206. + path: /tmp/circleci-artifacts
  22207. +
  22208. +
  22209. +workflows:
  22210. + version: 2
  22211. + commit:
  22212. + jobs:
  22213. + # Run the tests in parallel
  22214. + - short-tests-0:
  22215. + filters:
  22216. + tags:
  22217. + only: /.*/
  22218. + - short-tests-1:
  22219. + filters:
  22220. + tags:
  22221. + only: /.*/
  22222. + # Create a branch called regression and set it to dev to force a
  22223. + # regression test run
  22224. + - regression-test:
  22225. + filters:
  22226. + branches:
  22227. + only:
  22228. + - regression
  22229. + # Only run on release tags.
  22230. + - publish-github-release:
  22231. + requires:
  22232. + - short-tests-0
  22233. + - short-tests-1
  22234. + filters:
  22235. + branches:
  22236. + ignore: /.*/
  22237. + tags:
  22238. + only: /^v\d+\.\d+\.\d+$/
  22239. + nightly:
  22240. + triggers:
  22241. + - schedule:
  22242. + cron: "0 0 * * *"
  22243. + filters:
  22244. + branches:
  22245. + only:
  22246. + - master
  22247. + - dev
  22248. + jobs:
  22249. + # Run daily long regression tests
  22250. + - regression-test
  22251. +
  22252. +
  22253. +
  22254. + # Longer tests
  22255. + #- make -C tests test-zstd-nolegacy && make clean
  22256. + #- pyenv global 3.4.4; make -C tests versionsTest && make clean
  22257. + #- make zlibwrapper && make clean
  22258. + #- gcc -v; make -C tests test32 MOREFLAGS="-I/usr/include/x86_64-linux-gnu" && make clean
  22259. + #- make uasan && make clean
  22260. + #- make asan32 && make clean
  22261. + #- make -C tests test32 CC=clang MOREFLAGS="-g -fsanitize=address -I/usr/include/x86_64-linux-gnu"
  22262. + # Valgrind tests
  22263. + #- CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make clean
  22264. + #- make -C tests valgrindTest && make clean
  22265. + # ARM, AArch64, PowerPC, PowerPC64 tests
  22266. + #- make ppctest && make clean
  22267. + #- make ppc64test && make clean
  22268. + #- make armtest && make clean
  22269. + #- make aarch64test && make clean
  22270. --- /dev/null
  22271. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/.circleci/images/primary/Dockerfile
  22272. @@ -0,0 +1,9 @@
  22273. +FROM circleci/buildpack-deps:bionic
  22274. +
  22275. +RUN sudo dpkg --add-architecture i386
  22276. +RUN sudo apt-get -y -qq update
  22277. +RUN sudo apt-get -y install \
  22278. + gcc-multilib-powerpc-linux-gnu gcc-arm-linux-gnueabi \
  22279. + libc6-dev-armel-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross \
  22280. + libc6-dev-ppc64-powerpc-cross zstd gzip coreutils \
  22281. + libcurl4-openssl-dev
  22282. --- /dev/null
  22283. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/.cirrus.yml
  22284. @@ -0,0 +1,11 @@
  22285. +task:
  22286. + name: FreeBSD (shortest)
  22287. + freebsd_instance:
  22288. + matrix:
  22289. + image_family: freebsd-12-1
  22290. + # The stable 11.3 image causes "Agent is not responding" so use a snapshot
  22291. + image_family: freebsd-11-3-snap
  22292. + install_script: pkg install -y gmake coreutils
  22293. + script: |
  22294. + MOREFLAGS="-Werror" gmake -j all
  22295. + gmake shortest
  22296. --- /dev/null
  22297. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/.github/ISSUE_TEMPLATE/bug_report.md
  22298. @@ -0,0 +1,35 @@
  22299. +---
  22300. +name: Bug report
  22301. +about: Create a report to help us improve
  22302. +title: ''
  22303. +labels: ''
  22304. +assignees: ''
  22305. +
  22306. +---
  22307. +
  22308. +**Describe the bug**
  22309. +A clear and concise description of what the bug is.
  22310. +
  22311. +**To Reproduce**
  22312. +Steps to reproduce the behavior:
  22313. +1. Downloads data '...'
  22314. +2. Run '...' with flags '...'
  22315. +3. Scroll up on the log to '....'
  22316. +4. See error
  22317. +
  22318. +**Expected behavior**
  22319. +A clear and concise description of what you expected to happen.
  22320. +
  22321. +**Screenshots and charts**
  22322. +If applicable, add screenshots and charts to help explain your problem.
  22323. +
  22324. +**Desktop (please complete the following information):**
  22325. + - OS: [e.g. Mac]
  22326. + - Version [e.g. 22]
  22327. + - Compiler [e.g gcc]
  22328. + - Flags [e.g O2]
  22329. + - Other relevant hardware specs [e.g. Dual-core]
  22330. + - Build system [e.g. Makefile]
  22331. +
  22332. +**Additional context**
  22333. +Add any other context about the problem here.
  22334. --- /dev/null
  22335. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/.github/ISSUE_TEMPLATE/feature_request.md
  22336. @@ -0,0 +1,20 @@
  22337. +---
  22338. +name: Feature request
  22339. +about: Suggest an idea for this project
  22340. +title: ''
  22341. +labels: ''
  22342. +assignees: ''
  22343. +
  22344. +---
  22345. +
  22346. +**Is your feature request related to a problem? Please describe.**
  22347. +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
  22348. +
  22349. +**Describe the solution you'd like**
  22350. +A clear and concise description of what you want to happen.
  22351. +
  22352. +**Describe alternatives you've considered**
  22353. +A clear and concise description of any alternative solutions or features you've considered.
  22354. +
  22355. +**Additional context**
  22356. +Add any other context or screenshots about the feature request here.
  22357. --- /dev/null
  22358. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/.github/workflows/main.yml
  22359. @@ -0,0 +1,23 @@
  22360. +name: CIFuzz
  22361. +on: [pull_request]
  22362. +jobs:
  22363. + Fuzzing:
  22364. + runs-on: ubuntu-latest
  22365. + steps:
  22366. + - name: Build Fuzzers
  22367. + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
  22368. + with:
  22369. + oss-fuzz-project-name: 'zstd'
  22370. + dry-run: false
  22371. + - name: Run Fuzzers
  22372. + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
  22373. + with:
  22374. + oss-fuzz-project-name: 'zstd'
  22375. + fuzz-seconds: 600
  22376. + dry-run: false
  22377. + - name: Upload Crash
  22378. + uses: actions/upload-artifact@v1
  22379. + if: failure()
  22380. + with:
  22381. + name: artifacts
  22382. + path: ./out/artifacts
  22383. --- /dev/null
  22384. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/.travis.yml
  22385. @@ -0,0 +1,280 @@
  22386. +# Medium Tests: Run on all commits/PRs to dev branch
  22387. +
  22388. +language: c
  22389. +
  22390. +git:
  22391. + depth: 1
  22392. +
  22393. +branches:
  22394. + only:
  22395. + - dev
  22396. + - master
  22397. + - travisTest
  22398. +
  22399. +addons:
  22400. + apt:
  22401. + update: true
  22402. +
  22403. +env:
  22404. + global:
  22405. + - FUZZERTEST=-T2mn
  22406. + ZSTREAM_TESTTIME=-T2mn
  22407. + DECODECORPUS_TESTTIME=-T1mn
  22408. +
  22409. +
  22410. +matrix:
  22411. + fast_finish: true
  22412. + include:
  22413. + - name: icc
  22414. + compiler: icc
  22415. + env:
  22416. + - C_COMPILER=icc
  22417. + - CXX_COMPILER=icpc
  22418. + install:
  22419. + - source /opt/intel/inteloneapi/compiler/latest/env/vars.sh
  22420. + addons:
  22421. + apt:
  22422. + sources:
  22423. + - sourceline: 'deb https://apt.repos.intel.com/oneapi all main'
  22424. + key_url: 'https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB'
  22425. + packages:
  22426. + - intel-oneapi-icc
  22427. + script: make check
  22428. +
  22429. + - name: arm64 # ~2.5 mn
  22430. + os: linux
  22431. + arch: arm64
  22432. + script:
  22433. + - make check
  22434. +
  22435. + - name: make benchmarking
  22436. + script:
  22437. + - make benchmarking
  22438. +
  22439. + - name: make test (complete)
  22440. + script:
  22441. + # DEVNULLRIGHTS : will request sudo rights to test permissions on /dev/null
  22442. + - DEVNULLRIGHTS=test make test
  22443. +
  22444. + - name: gcc-6 + gcc-7 + libzstdmt compilation # ~ 6mn
  22445. + script:
  22446. + - make gcc6install gcc7install
  22447. + - CC=gcc-6 CFLAGS=-Werror make -j all
  22448. + - make clean
  22449. + - CC=gcc-7 CFLAGS=-Werror make -j all
  22450. + - make clean
  22451. + - LDFLAGS=-Wl,--no-undefined make -C lib libzstd-mt
  22452. + - make -C tests zbufftest-dll
  22453. + # LDFLAGS=-Wl,--no-undefined : will make the linker fail if dll is underlinked
  22454. + # zbufftest-dll : test that a user program can link to multi-threaded libzstd without specifying -pthread
  22455. +
  22456. + - name: gcc-8 + ASan + UBSan + Test Zstd # ~6.5mn
  22457. + script:
  22458. + - make gcc8install
  22459. + - CC=gcc-8 CFLAGS="-Werror" make -j all
  22460. + - make clean
  22461. + - CC=gcc-8 make -j uasan-test-zstd </dev/null # test when stdin is not a tty
  22462. +
  22463. + - name: gcc-6 + ASan + UBSan + Test Zstd, 32bit mode # ~4mn
  22464. + script:
  22465. + - make gcc6install libc6install
  22466. + - CC=gcc-6 CFLAGS="-Werror -m32" make -j all32
  22467. + - make clean
  22468. + - CC=gcc-6 make -j uasan-test-zstd32 # note : can complain about pointer overflow
  22469. +
  22470. + - name: clang-3.8 + MSan + Test Zstd # ~3.5mn
  22471. + script:
  22472. + - make clang38install
  22473. + # External libraries must be turned off when using MSAN tests,
  22474. + # because they are not msan-instrumented,
  22475. + # so any data coming from these libraries is always considered "uninitialized"
  22476. + - CC=clang-3.8 make clean msan-test-zstd HAVE_ZLIB=0 HAVE_LZ4=0 HAVE_LZMA=0
  22477. +
  22478. + - name: Minimal Decompressor Macros # ~5mn
  22479. + script:
  22480. + - make clean
  22481. + - make -j all check ZSTD_LIB_MINIFY=1 MOREFLAGS="-Werror"
  22482. + - make clean
  22483. + - make -j all check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X1 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT"
  22484. + - make clean
  22485. + - make -j all check MOREFLAGS="-Werror -DHUF_FORCE_DECOMPRESS_X2 -DZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG"
  22486. + - make clean
  22487. + - make -j all check MOREFLAGS="-Werror -DZSTD_NO_INLINE -DZSTD_STRIP_ERROR_STRINGS"
  22488. +
  22489. + - name: cmake build and test check # ~6mn
  22490. + script:
  22491. + - make cmakebuild
  22492. +
  22493. + - name: static analyzer scanbuild # ~26mn
  22494. + dist: trusty # note : it's important to pin down a version of static analyzer, since different versions report different false positives
  22495. + script:
  22496. + - make staticAnalyze
  22497. +
  22498. + - name: gcc-8 + ASan + UBSan + Fuzz Test # ~19mn
  22499. + script:
  22500. + - make gcc8install
  22501. + - CC=gcc-8 make clean uasan-fuzztest
  22502. +
  22503. + - name: gcc-6 + ASan + UBSan + Fuzz Test 32bit # ~15.5mn
  22504. + script:
  22505. + - make gcc6install libc6install
  22506. + - CC=gcc-6 CFLAGS="-O2 -m32" make uasan-fuzztest # can complain about pointer overflow
  22507. +
  22508. + - name: clang-3.8 + MSan + Fuzz Test # ~14.5mn
  22509. + script:
  22510. + - make clang38install
  22511. + - CC=clang-3.8 make clean msan-fuzztest
  22512. +
  22513. + - name: ASan + UBSan + MSan + Regression Test # ~ 4.5mn
  22514. + script:
  22515. + - make -j uasanregressiontest
  22516. + - make clean
  22517. + - make -j msanregressiontest
  22518. +
  22519. + - name: C++, gnu90 and c99 compatibility # ~3mn
  22520. + script:
  22521. + - make cxxtest
  22522. + - make clean
  22523. + - make gnu90build
  22524. + - make clean
  22525. + - make c99build
  22526. + - make clean
  22527. + - make travis-install # just ensures `make install` works
  22528. +
  22529. + - name: mingw cross-compilation
  22530. + script :
  22531. + - sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix;
  22532. + - CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ CFLAGS="-Werror -O1" make zstd
  22533. +
  22534. + - name: Valgrind + Fuzz Test Stack Mode # ~ 7mn
  22535. + script:
  22536. + - make valgrindinstall
  22537. + - make -C tests clean valgrindTest
  22538. + - make clean
  22539. + - make -C tests test-fuzzer-stackmode
  22540. +
  22541. + - name: Qemu ARM emulation + Fuzz Test # ~13.5mn
  22542. + script:
  22543. + - make arminstall
  22544. + - make armfuzz
  22545. +
  22546. + # Introduced to check compat with old toolchains, to prevent e.g. #1872
  22547. + - name: ARM Build Test (on Trusty)
  22548. + dist: trusty
  22549. + script:
  22550. + - make arminstall
  22551. + - make armbuild
  22552. +
  22553. + - name: Qemu PPC + Fuzz Test # ~13mn
  22554. + dist: trusty # it seems ppc cross-compilation fails on "current"
  22555. + script:
  22556. + - make ppcinstall
  22557. + - make ppcfuzz
  22558. +
  22559. + # check release number (release only)
  22560. + - name: Tag-Specific Test
  22561. + if: tag =~ ^v[0-9]\.[0-9]
  22562. + script:
  22563. + - make -C tests checkTag
  22564. + - tests/checkTag "$TRAVIS_BRANCH"
  22565. +
  22566. + # tests for master branch and cron job only
  22567. + - name: OS-X # ~13mn
  22568. + if: branch = master
  22569. + os: osx
  22570. + script:
  22571. + - make test
  22572. + - make -C lib all
  22573. +
  22574. + - name: zbuff test
  22575. + if: branch = master
  22576. + script:
  22577. + - make -C tests test-zbuff
  22578. +
  22579. + - name: Versions Compatibility Test # 11.5mn
  22580. + if: branch = master
  22581. + script:
  22582. + - make -C tests versionsTest
  22583. +
  22584. + - name: thread sanitizer # ~29mn
  22585. + if: branch = master
  22586. + script:
  22587. + - make clang38install
  22588. + - CC=clang-3.8 make tsan-test-zstream
  22589. + - CC=clang-3.8 make tsan-fuzztest
  22590. +
  22591. + - name: PPC64LE + Fuzz test # ~13mn
  22592. + if: branch = master
  22593. + arch: ppc64le
  22594. + script:
  22595. + - cat /proc/cpuinfo
  22596. + - make test
  22597. +
  22598. + - name: Qemu PPC64 + Fuzz test # ~13mn, presumed Big-Endian (?)
  22599. + dist: trusty # note : PPC64 cross-compilation for Qemu tests seems broken on Xenial
  22600. + if: branch = master
  22601. + script:
  22602. + - make ppcinstall
  22603. + - make ppc64fuzz
  22604. +
  22605. + # note : we already have aarch64 tests on hardware
  22606. + - name: Qemu aarch64 + Fuzz Test (on Xenial) # ~14mn
  22607. + if: branch = master
  22608. + dist: xenial
  22609. + script:
  22610. + - make arminstall
  22611. + - make aarch64fuzz
  22612. +
  22613. + - name: zlib wrapper test # ~7.5mn
  22614. + if: branch = master
  22615. + script:
  22616. + - make gpp6install valgrindinstall
  22617. + - make -C zlibWrapper test
  22618. + - make -C zlibWrapper valgrindTest
  22619. +
  22620. + - name: LZ4, thread pool, and partial libs tests # ~2mn
  22621. + if: branch = master
  22622. + script:
  22623. + - make lz4install
  22624. + - make -C tests test-lz4
  22625. + - make clean
  22626. + - make -C tests test-pool
  22627. + - make clean
  22628. + - bash tests/libzstd_partial_builds.sh
  22629. +
  22630. + # meson dedicated test
  22631. + - name: Xenial (Meson + clang) # ~15mn
  22632. + if: branch = master
  22633. + dist: xenial
  22634. + language: cpp
  22635. + compiler: clang
  22636. + install:
  22637. + - sudo apt-get install -qq liblz4-dev valgrind tree
  22638. + - |
  22639. + travis_retry curl -o ~/ninja.zip -L 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip' &&
  22640. + unzip ~/ninja.zip -d ~/.local/bin
  22641. + - |
  22642. + travis_retry curl -o ~/get-pip.py -L 'https://bootstrap.pypa.io/get-pip.py' &&
  22643. + python3 ~/get-pip.py --user &&
  22644. + pip3 install --user meson
  22645. + script:
  22646. + - |
  22647. + meson setup \
  22648. + --buildtype=debugoptimized \
  22649. + -Db_lundef=false \
  22650. + -Dauto_features=enabled \
  22651. + -Dbin_programs=true \
  22652. + -Dbin_tests=true \
  22653. + -Dbin_contrib=true \
  22654. + -Ddefault_library=both \
  22655. + build/meson builddir
  22656. + - pushd builddir
  22657. + - ninja
  22658. + - meson test --verbose --no-rebuild
  22659. + - DESTDIR=./staging ninja install
  22660. + - tree ./staging
  22661. + after_failure:
  22662. + - cat "$TRAVIS_BUILD_DIR"/builddir/meson-logs/testlog.txt
  22663. +
  22664. + allow_failures:
  22665. + - env: ALLOW_FAILURES=true
  22666. --- /dev/null
  22667. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/README.md
  22668. @@ -0,0 +1,56 @@
  22669. +Projects for various integrated development environments (IDE)
  22670. +==============================================================
  22671. +
  22672. +#### Included projects
  22673. +
  22674. +The following projects are included with the zstd distribution:
  22675. +- `cmake` - CMake project contributed by Artyom Dymchenko
  22676. +- `VS2005` - Visual Studio 2005 Project (this project has been moved to the contrib directory and will no longer be supported)
  22677. +- `VS2008` - Visual Studio 2008 project
  22678. +- `VS2010` - Visual Studio 2010 project (which also works well with Visual Studio 2012, 2013, 2015)
  22679. +- `VS_scripts` - command line scripts prepared for Visual Studio compilation without IDE
  22680. +
  22681. +
  22682. +#### How to compile zstd with Visual Studio
  22683. +
  22684. +1. Install Visual Studio e.g. VS 2015 Community Edition (it's free).
  22685. +2. Download the latest version of zstd from https://github.com/facebook/zstd/releases
  22686. +3. Decompress ZIP archive.
  22687. +4. Go to decompressed directory then to `projects` then `VS2010` and open `zstd.sln`
  22688. +5. Visual Studio will ask about converting VS2010 project to VS2015 and you should agree.
  22689. +6. Change `Debug` to `Release` and if you have 64-bit Windows change also `Win32` to `x64`.
  22690. +7. Press F7 on keyboard or select `BUILD` from the menu bar and choose `Build Solution`.
  22691. +8. If compilation will be fine a compiled executable will be in `projects\VS2010\bin\x64\Release\zstd.exe`
  22692. +
  22693. +
  22694. +#### Projects available within zstd.sln
  22695. +
  22696. +The Visual Studio solution file `visual\VS2010\zstd.sln` contains many projects that will be compiled to the
  22697. +`visual\VS2010\bin\$(Platform)_$(Configuration)` directory. For example `zstd` set to `x64` and
  22698. +`Release` will be compiled to `visual\VS2010\bin\x64_Release\zstd.exe`. The solution file contains the
  22699. +following projects:
  22700. +
  22701. +- `zstd` : Command Line Utility, supporting gzip-like arguments
  22702. +- `datagen` : Synthetic and parametrable data generator, for tests
  22703. +- `fullbench` : Precisely measure speed for each zstd inner functions
  22704. +- `fuzzer` : Test tool, to check zstd integrity on target platform
  22705. +- `libzstd` : A static ZSTD library compiled to `libzstd_static.lib`
  22706. +- `libzstd-dll` : A dynamic ZSTD library (DLL) compiled to `libzstd.dll` with the import library `libzstd.lib`
  22707. +- `fullbench-dll` : The fullbench program compiled with the import library; the executable requires ZSTD DLL
  22708. +
  22709. +
  22710. +#### Using ZSTD DLL with Microsoft Visual C++ project
  22711. +
  22712. +The header file `lib\zstd.h` and the import library
  22713. +`visual\VS2010\bin\$(Platform)_$(Configuration)\libzstd.lib` are required to compile
  22714. +a project using Visual C++.
  22715. +
  22716. +1. The path to header files should be added to `Additional Include Directories` that can
  22717. + be found in Project Properties of Visual Studio IDE in the `C/C++` Property Pages on the `General` page.
  22718. +2. The import library has to be added to `Additional Dependencies` that can
  22719. + be found in Project Properties in the `Linker` Property Pages on the `Input` page.
  22720. + If one will provide only the name `libzstd.lib` without a full path to the library
  22721. + then the directory has to be added to `Linker\General\Additional Library Directories`.
  22722. +
  22723. +The compiled executable will require ZSTD DLL which is available at
  22724. +`visual\VS2010\bin\$(Platform)_$(Configuration)\libzstd.dll`.
  22725. --- /dev/null
  22726. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/CMakeLists.txt
  22727. @@ -0,0 +1,203 @@
  22728. +# ################################################################
  22729. +# Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  22730. +# All rights reserved.
  22731. +#
  22732. +# This source code is licensed under both the BSD-style license (found in the
  22733. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  22734. +# in the COPYING file in the root directory of this source tree).
  22735. +# ################################################################
  22736. +
  22737. +cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
  22738. +
  22739. +# As of 2018-12-26 ZSTD has been validated to build with cmake version 3.13.2 new policies.
  22740. +# Set and use the newest cmake policies that are validated to work
  22741. +set(ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION "3")
  22742. +set(ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION "13") #Policies never changed at PATCH level
  22743. +if("${CMAKE_MAJOR_VERSION}" LESS 3)
  22744. + set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}")
  22745. +elseif( "${ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION}" EQUAL "${CMAKE_MAJOR_VERSION}" AND
  22746. + "${ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION}" GREATER "${CMAKE_MINOR_VERSION}")
  22747. + set(ZSTD_CMAKE_POLICY_VERSION "${CMAKE_VERSION}")
  22748. +else()
  22749. + set(ZSTD_CMAKE_POLICY_VERSION "${ZSTD_MAX_VALIDATED_CMAKE_MAJOR_VERSION}.${ZSTD_MAX_VALIDATED_CMAKE_MINOR_VERSION}.0")
  22750. +endif()
  22751. +cmake_policy(VERSION ${ZSTD_CMAKE_POLICY_VERSION})
  22752. +
  22753. +set(CMAKE_BUILD_WITH_INSTALL_RPATH on)
  22754. +
  22755. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
  22756. +set(ZSTD_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
  22757. +set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
  22758. +# Parse version
  22759. +include(GetZstdLibraryVersion)
  22760. +GetZstdLibraryVersion(${LIBRARY_DIR}/zstd.h zstd_VERSION_MAJOR zstd_VERSION_MINOR zstd_VERSION_PATCH)
  22761. +
  22762. +if( CMAKE_MAJOR_VERSION LESS 3 )
  22763. + ## Provide cmake 3+ behavior for older versions of cmake
  22764. + project(zstd)
  22765. + set(PROJECT_VERSION_MAJOR ${zstd_VERSION_MAJOR})
  22766. + set(PROJECT_VERSION_MINOR ${zstd_VERSION_MINOR})
  22767. + set(PROJECT_VERSION_PATCH ${zstd_VERSION_PATCH})
  22768. + set(PROJECT_VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}")
  22769. + enable_language(C) # Main library is in C
  22770. + enable_language(CXX) # Testing contributed code also utilizes CXX
  22771. +else()
  22772. + project(zstd
  22773. + VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}"
  22774. + LANGUAGES C # Main library is in C
  22775. + CXX # Testing contributed code also utilizes CXX
  22776. + )
  22777. +endif()
  22778. +message(STATUS "ZSTD VERSION: ${zstd_VERSION}")
  22779. +set(zstd_HOMEPAGE_URL "http://www.zstd.net")
  22780. +set(zstd_DESCRIPTION "Zstandard is a real-time compression algorithm, providing high compression ratios.")
  22781. +
  22782. +# Set a default build type if none was specified
  22783. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  22784. + message(STATUS "Setting build type to 'Release' as none was specified.")
  22785. + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
  22786. + # Set the possible values of build type for cmake-gui
  22787. + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
  22788. +endif()
  22789. +
  22790. +include(GNUInstallDirs)
  22791. +
  22792. +#-----------------------------------------------------------------------------
  22793. +# Add extra compilation flags
  22794. +#-----------------------------------------------------------------------------
  22795. +include(AddZstdCompilationFlags)
  22796. +ADD_ZSTD_COMPILATION_FLAGS()
  22797. +
  22798. +# Always hide XXHash symbols
  22799. +add_definitions(-DXXH_NAMESPACE=ZSTD_)
  22800. +
  22801. +#-----------------------------------------------------------------------------
  22802. +# Installation variables
  22803. +#-----------------------------------------------------------------------------
  22804. +message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
  22805. +message(STATUS "CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR}")
  22806. +
  22807. +#-----------------------------------------------------------------------------
  22808. +# Options
  22809. +#-----------------------------------------------------------------------------
  22810. +
  22811. +# Legacy support
  22812. +option(ZSTD_LEGACY_SUPPORT "LEGACY SUPPORT" OFF)
  22813. +
  22814. +if (ZSTD_LEGACY_SUPPORT)
  22815. + message(STATUS "ZSTD_LEGACY_SUPPORT defined!")
  22816. + add_definitions(-DZSTD_LEGACY_SUPPORT=5)
  22817. +else ()
  22818. + message(STATUS "ZSTD_LEGACY_SUPPORT not defined!")
  22819. + add_definitions(-DZSTD_LEGACY_SUPPORT=0)
  22820. +endif ()
  22821. +
  22822. +# Multi-threading support
  22823. +option(ZSTD_MULTITHREAD_SUPPORT "MULTITHREADING SUPPORT" ON)
  22824. +
  22825. +if (ZSTD_MULTITHREAD_SUPPORT)
  22826. + message(STATUS "ZSTD_MULTITHREAD_SUPPORT is enabled")
  22827. +else ()
  22828. + message(STATUS "ZSTD_MULTITHREAD_SUPPORT is disabled")
  22829. +endif ()
  22830. +
  22831. +option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" ON)
  22832. +option(ZSTD_BUILD_CONTRIB "BUILD CONTRIB" OFF)
  22833. +
  22834. +# Respect the conventional CMake option for enabling tests if it was specified on the first configure
  22835. +if (BUILD_TESTING)
  22836. + set(ZSTD_BUILD_TESTS_default ON)
  22837. +else()
  22838. + set(ZSTD_BUILD_TESTS_default OFF)
  22839. +endif()
  22840. +option(ZSTD_BUILD_TESTS "BUILD TESTS" ${ZSTD_BUILD_TESTS_default})
  22841. +if (MSVC)
  22842. + option(ZSTD_USE_STATIC_RUNTIME "LINK TO STATIC RUN-TIME LIBRARIES" OFF)
  22843. +endif ()
  22844. +
  22845. +#-----------------------------------------------------------------------------
  22846. +# External dependencies
  22847. +#-----------------------------------------------------------------------------
  22848. +if (ZSTD_MULTITHREAD_SUPPORT AND UNIX)
  22849. + set(THREADS_PREFER_PTHREAD_FLAG ON)
  22850. + find_package(Threads REQUIRED)
  22851. + if(CMAKE_USE_PTHREADS_INIT)
  22852. + set(THREADS_LIBS "${CMAKE_THREAD_LIBS_INIT}")
  22853. + else()
  22854. + message(SEND_ERROR "ZSTD currently does not support thread libraries other than pthreads")
  22855. + endif()
  22856. +endif ()
  22857. +
  22858. +#-----------------------------------------------------------------------------
  22859. +# Add source directories
  22860. +#-----------------------------------------------------------------------------
  22861. +add_subdirectory(lib)
  22862. +
  22863. +option(ZSTD_PROGRAMS_LINK_SHARED "PROGRAMS LINK SHARED" OFF)
  22864. +
  22865. +if (ZSTD_BUILD_PROGRAMS)
  22866. + if (NOT ZSTD_BUILD_STATIC AND NOT ZSTD_PROGRAMS_LINK_SHARED)
  22867. + message(SEND_ERROR "You need to build static library to build zstd CLI")
  22868. + elseif(NOT ZSTD_BUILD_SHARED AND ZSTD_PROGRAMS_LINK_SHARED)
  22869. + message(SEND_ERROR "You need to build shared library to build zstd CLI")
  22870. + endif ()
  22871. +
  22872. + add_subdirectory(programs)
  22873. +endif ()
  22874. +
  22875. +if (ZSTD_BUILD_TESTS)
  22876. + enable_testing()
  22877. + if (NOT ZSTD_BUILD_STATIC)
  22878. + message(SEND_ERROR "You need to build static library to build tests")
  22879. + endif ()
  22880. +
  22881. + add_subdirectory(tests)
  22882. +endif ()
  22883. +
  22884. +if (ZSTD_BUILD_CONTRIB)
  22885. + add_subdirectory(contrib)
  22886. +endif ()
  22887. +
  22888. +#-----------------------------------------------------------------------------
  22889. +# Add clean-all target
  22890. +#-----------------------------------------------------------------------------
  22891. +add_custom_target(clean-all
  22892. + COMMAND ${CMAKE_BUILD_TOOL} clean
  22893. + COMMAND rm -rf ${CMAKE_BINARY_DIR}/
  22894. +)
  22895. +
  22896. +#-----------------------------------------------------------------------------
  22897. +# Generate Package Config files
  22898. +#
  22899. +# This section is based on the boiler plate code from:
  22900. +# https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-packages
  22901. +#-----------------------------------------------------------------------------
  22902. +include(CMakePackageConfigHelpers)
  22903. +write_basic_package_version_file(
  22904. + "${CMAKE_CURRENT_BINARY_DIR}/zstdConfigVersion.cmake"
  22905. + VERSION ${zstd_VERSION}
  22906. + COMPATIBILITY SameMajorVersion
  22907. + )
  22908. +
  22909. +# A Package Config file that works from the build directory
  22910. +export(EXPORT zstdExports
  22911. + FILE "${CMAKE_CURRENT_BINARY_DIR}/zstdTargets.cmake"
  22912. + NAMESPACE zstd::
  22913. + )
  22914. +configure_file(zstdConfig.cmake
  22915. + "${CMAKE_CURRENT_BINARY_DIR}/zstdConfig.cmake"
  22916. + COPYONLY
  22917. + )
  22918. +
  22919. +# A Package Config file that works from the installation directory
  22920. +set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/zstd)
  22921. +install(EXPORT zstdExports
  22922. + FILE zstdTargets.cmake
  22923. + NAMESPACE zstd::
  22924. + DESTINATION ${ConfigPackageLocation}
  22925. + )
  22926. +install(FILES
  22927. + zstdConfig.cmake
  22928. + "${CMAKE_CURRENT_BINARY_DIR}/zstdConfigVersion.cmake"
  22929. + DESTINATION ${ConfigPackageLocation}
  22930. + )
  22931. --- /dev/null
  22932. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
  22933. @@ -0,0 +1,68 @@
  22934. +include(CheckCXXCompilerFlag)
  22935. +include(CheckCCompilerFlag)
  22936. +
  22937. +function(EnableCompilerFlag _flag _C _CXX)
  22938. + string(REGEX REPLACE "\\+" "PLUS" varname "${_flag}")
  22939. + string(REGEX REPLACE "[^A-Za-z0-9]+" "_" varname "${varname}")
  22940. + string(REGEX REPLACE "^_+" "" varname "${varname}")
  22941. + string(TOUPPER "${varname}" varname)
  22942. + if (_C)
  22943. + CHECK_C_COMPILER_FLAG(${_flag} C_FLAG_${varname})
  22944. + if (C_FLAG_${varname})
  22945. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}" PARENT_SCOPE)
  22946. + endif ()
  22947. + endif ()
  22948. + if (_CXX)
  22949. + CHECK_CXX_COMPILER_FLAG(${_flag} CXX_FLAG_${varname})
  22950. + if (CXX_FLAG_${varname})
  22951. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}" PARENT_SCOPE)
  22952. + endif ()
  22953. + endif ()
  22954. +endfunction()
  22955. +
  22956. +macro(ADD_ZSTD_COMPILATION_FLAGS)
  22957. + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" OR MINGW) #Not only UNIX but also WIN32 for MinGW
  22958. + #Set c++11 by default
  22959. + EnableCompilerFlag("-std=c++11" false true)
  22960. + #Set c99 by default
  22961. + EnableCompilerFlag("-std=c99" true false)
  22962. + EnableCompilerFlag("-Wall" true true)
  22963. + EnableCompilerFlag("-Wextra" true true)
  22964. + EnableCompilerFlag("-Wundef" true true)
  22965. + EnableCompilerFlag("-Wshadow" true true)
  22966. + EnableCompilerFlag("-Wcast-align" true true)
  22967. + EnableCompilerFlag("-Wcast-qual" true true)
  22968. + EnableCompilerFlag("-Wstrict-prototypes" true false)
  22969. + # Enable asserts in Debug mode
  22970. + if (CMAKE_BUILD_TYPE MATCHES "Debug")
  22971. + EnableCompilerFlag("-DDEBUGLEVEL=1" true true)
  22972. + endif ()
  22973. + elseif (MSVC) # Add specific compilation flags for Windows Visual
  22974. +
  22975. + set(ACTIVATE_MULTITHREADED_COMPILATION "ON" CACHE BOOL "activate multi-threaded compilation (/MP flag)")
  22976. + if (CMAKE_GENERATOR MATCHES "Visual Studio" AND ACTIVATE_MULTITHREADED_COMPILATION)
  22977. + EnableCompilerFlag("/MP" true true)
  22978. + endif ()
  22979. +
  22980. + # UNICODE SUPPORT
  22981. + EnableCompilerFlag("/D_UNICODE" true true)
  22982. + EnableCompilerFlag("/DUNICODE" true true)
  22983. + # Enable asserts in Debug mode
  22984. + if (CMAKE_BUILD_TYPE MATCHES "Debug")
  22985. + EnableCompilerFlag("/DDEBUGLEVEL=1" true true)
  22986. + endif ()
  22987. + endif ()
  22988. +
  22989. +
  22990. + if (MSVC AND ZSTD_USE_STATIC_RUNTIME)
  22991. + foreach (flag_var CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
  22992. + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
  22993. + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
  22994. + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
  22995. + if ( ${flag_var} )
  22996. + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
  22997. + endif()
  22998. + endforeach ()
  22999. + endif ()
  23000. +
  23001. +endmacro()
  23002. --- /dev/null
  23003. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/CMakeModules/FindLibLZ4.cmake
  23004. @@ -0,0 +1,49 @@
  23005. +# Find LibLZ4
  23006. +#
  23007. +# Find LibLZ4 headers and library
  23008. +#
  23009. +# Result Variables
  23010. +#
  23011. +# LIBLZ4_FOUND - True if lz4 is found
  23012. +# LIBLZ4_INCLUDE_DIRS - lz4 headers directories
  23013. +# LIBLZ4_LIBRARIES - lz4 libraries
  23014. +# LIBLZ4_VERSION_MAJOR - The major version of lz4
  23015. +# LIBLZ4_VERSION_MINOR - The minor version of lz4
  23016. +# LIBLZ4_VERSION_RELEASE - The release version of lz4
  23017. +# LIBLZ4_VERSION_STRING - version number string (e.g. 1.8.3)
  23018. +#
  23019. +# Hints
  23020. +#
  23021. +# Set ``LZ4_ROOT_DIR`` to the directory of lz4.h and lz4 library
  23022. +
  23023. +set(_LIBLZ4_ROOT_HINTS
  23024. + ENV LZ4_ROOT_DIR)
  23025. +
  23026. +find_path( LIBLZ4_INCLUDE_DIR lz4.h
  23027. + HINTS ${_LIBLZ4_ROOT_HINTS})
  23028. +find_library( LIBLZ4_LIBRARY NAMES lz4 liblz4 liblz4_static
  23029. + HINTS ${_LIBLZ4_ROOT_HINTS})
  23030. +
  23031. +if(LIBLZ4_INCLUDE_DIR)
  23032. + file(STRINGS "${LIBLZ4_INCLUDE_DIR}/lz4.h" LIBLZ4_HEADER_CONTENT REGEX "#define LZ4_VERSION_[A-Z]+ +[0-9]+")
  23033. +
  23034. + string(REGEX REPLACE ".*#define LZ4_VERSION_MAJOR +([0-9]+).*" "\\1" LIBLZ4_VERSION_MAJOR "${LIBLZ4_HEADER_CONTENT}")
  23035. + string(REGEX REPLACE ".*#define LZ4_VERSION_MINOR +([0-9]+).*" "\\1" LIBLZ4_VERSION_MINOR "${LIBLZ4_HEADER_CONTENT}")
  23036. + string(REGEX REPLACE ".*#define LZ4_VERSION_RELEASE +([0-9]+).*" "\\1" LIBLZ4_VERSION_RELEASE "${LIBLZ4_HEADER_CONTENT}")
  23037. +
  23038. + set(LIBLZ4_VERSION_STRING "${LIBLZ4_VERSION_MAJOR}.${LIBLZ4_VERSION_MINOR}.${LIBLZ4_VERSION_RELEASE}")
  23039. + unset(LIBLZ4_HEADER_CONTENT)
  23040. +endif()
  23041. +
  23042. +include(FindPackageHandleStandardArgs)
  23043. +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZ4 REQUIRED_VARS LIBLZ4_INCLUDE_DIR
  23044. + LIBLZ4_LIBRARY
  23045. + VERSION_VAR LIBLZ4_VERSION_STRING
  23046. + FAIL_MESSAGE "Could NOT find LZ4, try to set the paths to lz4.h and lz4 library in environment variable LZ4_ROOT_DIR")
  23047. +
  23048. +if (LIBLZ4_FOUND)
  23049. + set(LIBLZ4_LIBRARIES ${LIBLZ4_LIBRARY})
  23050. + set(LIBLZ4_INCLUDE_DIRS ${LIBLZ4_INCLUDE_DIR})
  23051. +endif ()
  23052. +
  23053. +mark_as_advanced( LIBLZ4_INCLUDE_DIR LIBLZ4_LIBRARY )
  23054. --- /dev/null
  23055. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/CMakeModules/GetZstdLibraryVersion.cmake
  23056. @@ -0,0 +1,10 @@
  23057. +function(GetZstdLibraryVersion _header _major _minor _patch)
  23058. + # Read file content
  23059. + file(READ ${_header} CONTENT)
  23060. +
  23061. + string(REGEX MATCH ".*define ZSTD_VERSION_MAJOR *([0-9]+).*define ZSTD_VERSION_MINOR *([0-9]+).*define ZSTD_VERSION_RELEASE *([0-9]+)" VERSION_REGEX "${CONTENT}")
  23062. + set(${_major} ${CMAKE_MATCH_1} PARENT_SCOPE)
  23063. + set(${_minor} ${CMAKE_MATCH_2} PARENT_SCOPE)
  23064. + set(${_patch} ${CMAKE_MATCH_3} PARENT_SCOPE)
  23065. +endfunction()
  23066. +
  23067. --- /dev/null
  23068. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/README.md
  23069. @@ -0,0 +1,104 @@
  23070. +# Cmake contributions
  23071. +
  23072. +Contributions to the cmake build configurations are welcome. Please
  23073. +use case sensitivity that matches modern (ie. cmake version 2.6 and above)
  23074. +conventions of using lower-case for commands, and upper-case for
  23075. +variables.
  23076. +
  23077. +## How to build
  23078. +
  23079. +As cmake doesn't support command like `cmake clean`, it's recommended to perform a "out of source build".
  23080. +To do this, you can create a new directory and build in it:
  23081. +```sh
  23082. +cd build/cmake
  23083. +mkdir builddir
  23084. +cd builddir
  23085. +cmake ..
  23086. +make
  23087. +```
  23088. +Then you can clean all cmake caches by simply delete the new directory:
  23089. +```sh
  23090. +rm -rf build/cmake/builddir
  23091. +```
  23092. +
  23093. +And of course, you can directly build in build/cmake:
  23094. +```sh
  23095. +cd build/cmake
  23096. +cmake
  23097. +make
  23098. +```
  23099. +
  23100. +To show cmake build options, you can:
  23101. +```sh
  23102. +cd build/cmake/builddir
  23103. +cmake -LH ..
  23104. +```
  23105. +
  23106. +Bool options can be set to `ON/OFF` with `-D[option]=[ON/OFF]`. You can configure cmake options like this:
  23107. +```sh
  23108. +cd build/cmake/builddir
  23109. +cmake -DZSTD_BUILD_TESTS=ON -DZSTD_LEGACY_SUPPORT=ON ..
  23110. +make
  23111. +```
  23112. +
  23113. +### referring
  23114. +[Looking for a 'cmake clean' command to clear up CMake output](https://stackoverflow.com/questions/9680420/looking-for-a-cmake-clean-command-to-clear-up-cmake-output)
  23115. +
  23116. +## CMake Style Recommendations
  23117. +
  23118. +### Indent all code correctly, i.e. the body of
  23119. +
  23120. + * if/else/endif
  23121. + * foreach/endforeach
  23122. + * while/endwhile
  23123. + * macro/endmacro
  23124. + * function/endfunction
  23125. +
  23126. +Use spaces for indenting, 2, 3 or 4 spaces preferably. Use the same amount of
  23127. +spaces for indenting as is used in the rest of the file. Do not use tabs.
  23128. +
  23129. +### Upper/lower casing
  23130. +
  23131. +Most important: use consistent upper- or lowercasing within one file !
  23132. +
  23133. +In general, the all-lowercase style is preferred.
  23134. +
  23135. +So, this is recommended:
  23136. +
  23137. +```
  23138. +add_executable(foo foo.c)
  23139. +```
  23140. +
  23141. +These forms are discouraged
  23142. +
  23143. +```
  23144. +ADD_EXECUTABLE(bar bar.c)
  23145. +Add_Executable(hello hello.c)
  23146. +aDd_ExEcUtAbLe(blub blub.c)
  23147. +```
  23148. +
  23149. +### End commands
  23150. +To make the code easier to read, use empty commands for endforeach(), endif(),
  23151. +endfunction(), endmacro() and endwhile(). Also, use empty else() commands.
  23152. +
  23153. +For example, do this:
  23154. +
  23155. +```
  23156. +if(FOOVAR)
  23157. + some_command(...)
  23158. +else()
  23159. + another_command(...)
  23160. +endif()
  23161. +```
  23162. +
  23163. +and not this:
  23164. +
  23165. +```
  23166. +if(BARVAR)
  23167. + some_other_command(...)
  23168. +endif(BARVAR)
  23169. +```
  23170. +
  23171. +### Other resources for best practices
  23172. +
  23173. +https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#modules
  23174. --- /dev/null
  23175. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/contrib/CMakeLists.txt
  23176. @@ -0,0 +1,13 @@
  23177. +# ################################################################
  23178. +# Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
  23179. +# All rights reserved.
  23180. +#
  23181. +# This source code is licensed under both the BSD-style license (found in the
  23182. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23183. +# in the COPYING file in the root directory of this source tree).
  23184. +# ################################################################
  23185. +
  23186. +project(contrib)
  23187. +
  23188. +add_subdirectory(pzstd)
  23189. +add_subdirectory(gen_html)
  23190. --- /dev/null
  23191. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/contrib/gen_html/CMakeLists.txt
  23192. @@ -0,0 +1,30 @@
  23193. +# ################################################################
  23194. +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
  23195. +# All rights reserved.
  23196. +#
  23197. +# This source code is licensed under both the BSD-style license (found in the
  23198. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23199. +# in the COPYING file in the root directory of this source tree).
  23200. +# ################################################################
  23201. +
  23202. +project(gen_html)
  23203. +include(GetZstdLibraryVersion)
  23204. +
  23205. +set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
  23206. +
  23207. +# Define programs directory, where sources and header files are located
  23208. +set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
  23209. +set(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
  23210. +set(GENHTML_DIR ${ZSTD_SOURCE_DIR}/contrib/gen_html)
  23211. +set(GENHTML_BINARY ${PROJECT_BINARY_DIR}/gen_html${CMAKE_EXECUTABLE_SUFFIX})
  23212. +include_directories(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${GENHTML_DIR})
  23213. +
  23214. +add_executable(gen_html ${GENHTML_DIR}/gen_html.cpp)
  23215. +
  23216. +GetZstdLibraryVersion(${LIBRARY_DIR}/zstd.h VMAJOR VMINOR VRELEASE)
  23217. +set(LIBVERSION "${VMAJOR}.${VMINOR}.${VRELEASE}")
  23218. +add_custom_target(zstd_manual.html ALL
  23219. + ${GENHTML_BINARY} "${LIBVERSION}" "${LIBRARY_DIR}/zstd.h" "${PROJECT_BINARY_DIR}/zstd_manual.html"
  23220. + DEPENDS gen_html COMMENT "Update zstd manual")
  23221. +
  23222. +install(FILES "${PROJECT_BINARY_DIR}/zstd_manual.html" DESTINATION "${CMAKE_INSTALL_DOCDIR}")
  23223. --- /dev/null
  23224. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/contrib/pzstd/CMakeLists.txt
  23225. @@ -0,0 +1,32 @@
  23226. +# ################################################################
  23227. +# Copyright (c) 2016-present, Facebook, Inc.
  23228. +# All rights reserved.
  23229. +#
  23230. +# This source code is licensed under both the BSD-style license (found in the
  23231. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23232. +# in the COPYING file in the root directory of this source tree).
  23233. +# ################################################################
  23234. +
  23235. +project(pzstd)
  23236. +
  23237. +set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
  23238. +
  23239. +# Define programs directory, where sources and header files are located
  23240. +set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
  23241. +set(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
  23242. +set(PZSTD_DIR ${ZSTD_SOURCE_DIR}/contrib/pzstd)
  23243. +include_directories(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${PZSTD_DIR})
  23244. +
  23245. +add_executable(pzstd ${PROGRAMS_DIR}/util.c ${PZSTD_DIR}/main.cpp ${PZSTD_DIR}/Options.cpp ${PZSTD_DIR}/Pzstd.cpp ${PZSTD_DIR}/SkippableFrame.cpp)
  23246. +set_property(TARGET pzstd APPEND PROPERTY COMPILE_DEFINITIONS "NDEBUG")
  23247. +set_property(TARGET pzstd APPEND PROPERTY COMPILE_OPTIONS "-Wno-shadow")
  23248. +
  23249. +set(THREADS_PREFER_PTHREAD_FLAG ON)
  23250. +find_package(Threads REQUIRED)
  23251. +if (CMAKE_USE_PTHREADS_INIT)
  23252. + target_link_libraries(pzstd libzstd_shared ${CMAKE_THREAD_LIBS_INIT})
  23253. +else()
  23254. + message(SEND_ERROR "ZSTD currently does not support thread libraries other than pthreads")
  23255. +endif()
  23256. +
  23257. +install(TARGETS pzstd RUNTIME DESTINATION "bin")
  23258. --- /dev/null
  23259. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/lib/CMakeLists.txt
  23260. @@ -0,0 +1,177 @@
  23261. +# ################################################################
  23262. +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
  23263. +# All rights reserved.
  23264. +#
  23265. +# This source code is licensed under both the BSD-style license (found in the
  23266. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23267. +# in the COPYING file in the root directory of this source tree).
  23268. +# ################################################################
  23269. +
  23270. +project(libzstd)
  23271. +
  23272. +set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
  23273. +option(ZSTD_BUILD_STATIC "BUILD STATIC LIBRARIES" ON)
  23274. +option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" ON)
  23275. +
  23276. +if(NOT ZSTD_BUILD_SHARED AND NOT ZSTD_BUILD_STATIC)
  23277. + message(SEND_ERROR "You need to build at least one flavor of libzstd")
  23278. +endif()
  23279. +
  23280. +# Define library directory, where sources and header files are located
  23281. +include_directories(${LIBRARY_DIR} ${LIBRARY_DIR}/common)
  23282. +
  23283. +file(GLOB CommonSources ${LIBRARY_DIR}/common/*.c)
  23284. +file(GLOB CompressSources ${LIBRARY_DIR}/compress/*.c)
  23285. +file(GLOB DecompressSources ${LIBRARY_DIR}/decompress/*.c)
  23286. +file(GLOB DictBuilderSources ${LIBRARY_DIR}/dictBuilder/*.c)
  23287. +file(GLOB DeprecatedSources ${LIBRARY_DIR}/deprecated/*.c)
  23288. +
  23289. +set(Sources
  23290. + ${CommonSources}
  23291. + ${CompressSources}
  23292. + ${DecompressSources}
  23293. + ${DictBuilderSources}
  23294. + ${DeprecatedSources})
  23295. +
  23296. +file(GLOB CommonHeaders ${LIBRARY_DIR}/common/*.h)
  23297. +file(GLOB CompressHeaders ${LIBRARY_DIR}/compress/*.h)
  23298. +file(GLOB DecompressHeaders ${LIBRARY_DIR}/decompress/*.h)
  23299. +file(GLOB DictBuilderHeaders ${LIBRARY_DIR}/dictBuilder/*.h)
  23300. +file(GLOB DeprecatedHeaders ${LIBRARY_DIR}/deprecated/*.h)
  23301. +
  23302. +set(Headers
  23303. + ${LIBRARY_DIR}/zstd.h
  23304. + ${CommonHeaders}
  23305. + ${CompressHeaders}
  23306. + ${DecompressHeaders}
  23307. + ${DictBuilderHeaders}
  23308. + ${DeprecatedHeaders})
  23309. +
  23310. +if (ZSTD_LEGACY_SUPPORT)
  23311. + set(LIBRARY_LEGACY_DIR ${LIBRARY_DIR}/legacy)
  23312. + include_directories(${LIBRARY_LEGACY_DIR})
  23313. +
  23314. + set(Sources ${Sources}
  23315. + ${LIBRARY_LEGACY_DIR}/zstd_v01.c
  23316. + ${LIBRARY_LEGACY_DIR}/zstd_v02.c
  23317. + ${LIBRARY_LEGACY_DIR}/zstd_v03.c
  23318. + ${LIBRARY_LEGACY_DIR}/zstd_v04.c
  23319. + ${LIBRARY_LEGACY_DIR}/zstd_v05.c
  23320. + ${LIBRARY_LEGACY_DIR}/zstd_v06.c
  23321. + ${LIBRARY_LEGACY_DIR}/zstd_v07.c)
  23322. +
  23323. + set(Headers ${Headers}
  23324. + ${LIBRARY_LEGACY_DIR}/zstd_legacy.h
  23325. + ${LIBRARY_LEGACY_DIR}/zstd_v01.h
  23326. + ${LIBRARY_LEGACY_DIR}/zstd_v02.h
  23327. + ${LIBRARY_LEGACY_DIR}/zstd_v03.h
  23328. + ${LIBRARY_LEGACY_DIR}/zstd_v04.h
  23329. + ${LIBRARY_LEGACY_DIR}/zstd_v05.h
  23330. + ${LIBRARY_LEGACY_DIR}/zstd_v06.h
  23331. + ${LIBRARY_LEGACY_DIR}/zstd_v07.h)
  23332. +endif ()
  23333. +
  23334. +if (MSVC)
  23335. + set(MSVC_RESOURCE_DIR ${ZSTD_SOURCE_DIR}/build/VS2010/libzstd-dll)
  23336. + set(PlatformDependResources ${MSVC_RESOURCE_DIR}/libzstd-dll.rc)
  23337. +endif ()
  23338. +
  23339. +# Split project to static and shared libraries build
  23340. +set(library_targets)
  23341. +if (ZSTD_BUILD_SHARED)
  23342. + add_library(libzstd_shared SHARED ${Sources} ${Headers} ${PlatformDependResources})
  23343. + list(APPEND library_targets libzstd_shared)
  23344. + if (ZSTD_MULTITHREAD_SUPPORT)
  23345. + set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
  23346. + if (UNIX)
  23347. + target_link_libraries(libzstd_shared ${THREADS_LIBS})
  23348. + endif ()
  23349. + endif()
  23350. +endif ()
  23351. +if (ZSTD_BUILD_STATIC)
  23352. + add_library(libzstd_static STATIC ${Sources} ${Headers})
  23353. + list(APPEND library_targets libzstd_static)
  23354. + if (ZSTD_MULTITHREAD_SUPPORT)
  23355. + set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
  23356. + if (UNIX)
  23357. + target_link_libraries(libzstd_static ${THREADS_LIBS})
  23358. + endif ()
  23359. + endif ()
  23360. +endif ()
  23361. +
  23362. +# Add specific compile definitions for MSVC project
  23363. +if (MSVC)
  23364. + if (ZSTD_BUILD_SHARED)
  23365. + set_property(TARGET libzstd_shared APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_DLL_EXPORT=1;ZSTD_HEAPMODE=0;_CONSOLE;_CRT_SECURE_NO_WARNINGS")
  23366. + endif ()
  23367. + if (ZSTD_BUILD_STATIC)
  23368. + set_property(TARGET libzstd_static APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_HEAPMODE=0;_CRT_SECURE_NO_WARNINGS")
  23369. + endif ()
  23370. +endif ()
  23371. +
  23372. +# With MSVC static library needs to be renamed to avoid conflict with import library
  23373. +if (MSVC)
  23374. + set(STATIC_LIBRARY_BASE_NAME zstd_static)
  23375. +else ()
  23376. + set(STATIC_LIBRARY_BASE_NAME zstd)
  23377. +endif ()
  23378. +
  23379. +# Define static and shared library names
  23380. +if (ZSTD_BUILD_SHARED)
  23381. + set_target_properties(
  23382. + libzstd_shared
  23383. + PROPERTIES
  23384. + OUTPUT_NAME zstd
  23385. + VERSION ${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}
  23386. + SOVERSION ${zstd_VERSION_MAJOR})
  23387. +endif ()
  23388. +
  23389. +if (ZSTD_BUILD_STATIC)
  23390. + set_target_properties(
  23391. + libzstd_static
  23392. + PROPERTIES
  23393. + POSITION_INDEPENDENT_CODE On
  23394. + OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME})
  23395. +endif ()
  23396. +
  23397. +if (UNIX)
  23398. + # pkg-config
  23399. + set(PREFIX "${CMAKE_INSTALL_PREFIX}")
  23400. + set(LIBDIR "${CMAKE_INSTALL_LIBDIR}")
  23401. + set(INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
  23402. + set(VERSION "${zstd_VERSION}")
  23403. + add_custom_target(libzstd.pc ALL
  23404. + ${CMAKE_COMMAND} -DIN="${LIBRARY_DIR}/libzstd.pc.in" -DOUT="libzstd.pc"
  23405. + -DPREFIX="${PREFIX}" -DLIBDIR="${LIBDIR}" -DINCLUDEDIR="${INCLUDEDIR}" -DVERSION="${VERSION}"
  23406. + -P "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake"
  23407. + COMMENT "Creating pkg-config file")
  23408. +
  23409. + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
  23410. +endif ()
  23411. +
  23412. +# install target
  23413. +install(FILES
  23414. + "${LIBRARY_DIR}/zstd.h"
  23415. + "${LIBRARY_DIR}/deprecated/zbuff.h"
  23416. + "${LIBRARY_DIR}/dictBuilder/zdict.h"
  23417. + "${LIBRARY_DIR}/dictBuilder/cover.h"
  23418. + "${LIBRARY_DIR}/common/zstd_errors.h"
  23419. + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
  23420. +
  23421. +install(TARGETS ${library_targets}
  23422. + EXPORT zstdExports
  23423. + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
  23424. + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
  23425. + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
  23426. + )
  23427. +
  23428. +# uninstall target
  23429. +if (NOT TARGET uninstall)
  23430. + configure_file(
  23431. + "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
  23432. + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  23433. + IMMEDIATE @ONLY)
  23434. +
  23435. + add_custom_target(uninstall
  23436. + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
  23437. +endif ()
  23438. --- /dev/null
  23439. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/lib/cmake_uninstall.cmake.in
  23440. @@ -0,0 +1,22 @@
  23441. +
  23442. +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
  23443. + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
  23444. +endif()
  23445. +
  23446. +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
  23447. +string(REGEX REPLACE "\n" ";" files "${files}")
  23448. +foreach(file ${files})
  23449. + message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
  23450. + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
  23451. + exec_program(
  23452. + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
  23453. + OUTPUT_VARIABLE rm_out
  23454. + RETURN_VALUE rm_retval
  23455. + )
  23456. + if(NOT "${rm_retval}" STREQUAL 0)
  23457. + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
  23458. + endif()
  23459. + else()
  23460. + message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
  23461. + endif()
  23462. +endforeach()
  23463. --- /dev/null
  23464. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/lib/pkgconfig.cmake
  23465. @@ -0,0 +1 @@
  23466. +configure_file("${IN}" "${OUT}" @ONLY)
  23467. --- /dev/null
  23468. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/programs/CMakeLists.txt
  23469. @@ -0,0 +1,135 @@
  23470. +# ################################################################
  23471. +# Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
  23472. +# All rights reserved.
  23473. +#
  23474. +# This source code is licensed under both the BSD-style license (found in the
  23475. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23476. +# in the COPYING file in the root directory of this source tree).
  23477. +# ################################################################
  23478. +
  23479. +project(programs)
  23480. +
  23481. +set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
  23482. +
  23483. +# Define programs directory, where sources and header files are located
  23484. +set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
  23485. +set(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
  23486. +include_directories(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${LIBRARY_DIR}/compress ${LIBRARY_DIR}/dictBuilder)
  23487. +
  23488. +if (ZSTD_LEGACY_SUPPORT)
  23489. + set(PROGRAMS_LEGACY_DIR ${PROGRAMS_DIR}/legacy)
  23490. + include_directories(${PROGRAMS_LEGACY_DIR} ${LIBRARY_DIR}/legacy)
  23491. +endif ()
  23492. +
  23493. +if (ZSTD_PROGRAMS_LINK_SHARED)
  23494. + set(PROGRAMS_ZSTD_LINK_TARGET libzstd_shared)
  23495. +else ()
  23496. + set(PROGRAMS_ZSTD_LINK_TARGET libzstd_static)
  23497. +endif ()
  23498. +
  23499. +if (MSVC)
  23500. + set(MSVC_RESOURCE_DIR ${ZSTD_SOURCE_DIR}/build/VS2010/zstd)
  23501. + set(PlatformDependResources ${MSVC_RESOURCE_DIR}/zstd.rc)
  23502. +endif ()
  23503. +
  23504. +add_executable(zstd ${PROGRAMS_DIR}/zstdcli.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${PROGRAMS_DIR}/fileio.c ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/dibio.c ${PlatformDependResources})
  23505. +target_link_libraries(zstd ${PROGRAMS_ZSTD_LINK_TARGET})
  23506. +if (CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)")
  23507. + target_link_libraries(zstd rt)
  23508. +endif ()
  23509. +install(TARGETS zstd RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
  23510. +
  23511. +if (UNIX)
  23512. + add_custom_target(zstdcat ALL ${CMAKE_COMMAND} -E create_symlink zstd zstdcat DEPENDS zstd COMMENT "Creating zstdcat symlink")
  23513. + add_custom_target(unzstd ALL ${CMAKE_COMMAND} -E create_symlink zstd unzstd DEPENDS zstd COMMENT "Creating unzstd symlink")
  23514. + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstdcat DESTINATION "${CMAKE_INSTALL_BINDIR}")
  23515. + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unzstd DESTINATION "${CMAKE_INSTALL_BINDIR}")
  23516. + install(PROGRAMS ${PROGRAMS_DIR}/zstdgrep DESTINATION "${CMAKE_INSTALL_BINDIR}")
  23517. + install(PROGRAMS ${PROGRAMS_DIR}/zstdless DESTINATION "${CMAKE_INSTALL_BINDIR}")
  23518. +
  23519. + add_custom_target(zstd.1 ALL
  23520. + ${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstd.1 .
  23521. + COMMENT "Copying manpage zstd.1")
  23522. + add_custom_target(zstdgrep.1 ALL
  23523. + ${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstdgrep.1 .
  23524. + COMMENT "Copying manpage zstdgrep.1")
  23525. + add_custom_target(zstdless.1 ALL
  23526. + ${CMAKE_COMMAND} -E copy ${PROGRAMS_DIR}/zstdless.1 .
  23527. + COMMENT "Copying manpage zstdless.1")
  23528. + add_custom_target(zstdcat.1 ALL ${CMAKE_COMMAND} -E create_symlink zstd.1 zstdcat.1 DEPENDS zstd.1 COMMENT "Creating zstdcat.1 symlink")
  23529. + add_custom_target(unzstd.1 ALL ${CMAKE_COMMAND} -E create_symlink zstd.1 unzstd.1 DEPENDS zstd.1 COMMENT "Creating unzstd.1 symlink")
  23530. +
  23531. + # Define MAN_INSTALL_DIR if necessary
  23532. + if (MAN_INSTALL_DIR)
  23533. + else ()
  23534. + set(MAN_INSTALL_DIR ${CMAKE_INSTALL_MANDIR}/man1)
  23535. + endif ()
  23536. +
  23537. + install(FILES
  23538. + ${CMAKE_CURRENT_BINARY_DIR}/zstd.1
  23539. + ${CMAKE_CURRENT_BINARY_DIR}/zstdcat.1
  23540. + ${CMAKE_CURRENT_BINARY_DIR}/unzstd.1
  23541. + ${CMAKE_CURRENT_BINARY_DIR}/zstdgrep.1
  23542. + ${CMAKE_CURRENT_BINARY_DIR}/zstdless.1
  23543. + DESTINATION "${MAN_INSTALL_DIR}")
  23544. +
  23545. + add_executable(zstd-frugal ${PROGRAMS_DIR}/zstdcli.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${PROGRAMS_DIR}/fileio.c)
  23546. + target_link_libraries(zstd-frugal ${PROGRAMS_ZSTD_LINK_TARGET})
  23547. + set_property(TARGET zstd-frugal APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_NOBENCH;ZSTD_NODICT")
  23548. +endif ()
  23549. +
  23550. +# Add multi-threading support definitions
  23551. +
  23552. +if (ZSTD_MULTITHREAD_SUPPORT)
  23553. + set_property(TARGET zstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_MULTITHREAD")
  23554. +
  23555. + if (UNIX)
  23556. + target_link_libraries(zstd ${THREADS_LIBS})
  23557. +
  23558. + add_custom_target(zstdmt ALL ${CMAKE_COMMAND} -E create_symlink zstd zstdmt DEPENDS zstd COMMENT "Creating zstdmt symlink")
  23559. + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/zstdmt DESTINATION "${CMAKE_INSTALL_BINDIR}")
  23560. + endif ()
  23561. +endif ()
  23562. +
  23563. +option(ZSTD_ZLIB_SUPPORT "ZLIB SUPPORT" OFF)
  23564. +option(ZSTD_LZMA_SUPPORT "LZMA SUPPORT" OFF)
  23565. +option(ZSTD_LZ4_SUPPORT "LZ4 SUPPORT" OFF)
  23566. +
  23567. +# Add gzip support
  23568. +if (ZSTD_ZLIB_SUPPORT)
  23569. + find_package(ZLIB REQUIRED)
  23570. +
  23571. + if (ZLIB_FOUND)
  23572. + include_directories(${ZLIB_INCLUDE_DIRS})
  23573. + target_link_libraries(zstd ${ZLIB_LIBRARIES})
  23574. + set_property(TARGET zstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_GZCOMPRESS;ZSTD_GZDECOMPRESS")
  23575. + else ()
  23576. + message(SEND_ERROR "zlib library is missing")
  23577. + endif ()
  23578. +endif ()
  23579. +
  23580. +# Add lzma support
  23581. +if (ZSTD_LZMA_SUPPORT)
  23582. + find_package(LibLZMA REQUIRED)
  23583. +
  23584. + if (LIBLZMA_FOUND)
  23585. + include_directories(${LIBLZMA_INCLUDE_DIRS})
  23586. + target_link_libraries(zstd ${LIBLZMA_LIBRARIES})
  23587. + set_property(TARGET zstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_LZMACOMPRESS;ZSTD_LZMADECOMPRESS")
  23588. + else ()
  23589. + message(SEND_ERROR "lzma library is missing")
  23590. + endif ()
  23591. +endif ()
  23592. +
  23593. +# Add lz4 support
  23594. +if (ZSTD_LZ4_SUPPORT)
  23595. + find_package(LibLZ4 REQUIRED)
  23596. +
  23597. + if (LIBLZ4_FOUND)
  23598. + include_directories(${LIBLZ4_INCLUDE_DIRS})
  23599. + target_link_libraries(zstd ${LIBLZ4_LIBRARIES})
  23600. + set_property(TARGET zstd APPEND PROPERTY COMPILE_DEFINITIONS "ZSTD_LZ4COMPRESS;ZSTD_LZ4DECOMPRESS")
  23601. + else ()
  23602. + message(SEND_ERROR "lz4 library is missing")
  23603. + endif ()
  23604. +endif ()
  23605. --- /dev/null
  23606. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/tests/CMakeLists.txt
  23607. @@ -0,0 +1,106 @@
  23608. +# ################################################################
  23609. +# zstd - Makefile
  23610. +# Copyright (C) Yann Collet 2014-present
  23611. +# All rights reserved.
  23612. +#
  23613. +# BSD license
  23614. +#
  23615. +# Redistribution and use in source and binary forms, with or without modification,
  23616. +# are permitted provided that the following conditions are met:
  23617. +#
  23618. +# * Redistributions of source code must retain the above copyright notice, this
  23619. +# list of conditions and the following disclaimer.
  23620. +#
  23621. +# * Redistributions in binary form must reproduce the above copyright notice, this
  23622. +# list of conditions and the following disclaimer in the documentation and/or
  23623. +# other materials provided with the distribution.
  23624. +#
  23625. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  23626. +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  23627. +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  23628. +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  23629. +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23630. +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23631. +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  23632. +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23633. +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23634. +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23635. +#
  23636. +# You can contact the author at :
  23637. +# - zstd homepage : http://www.zstd.net/
  23638. +# ################################################################
  23639. +
  23640. +project(tests)
  23641. +
  23642. +# name: Cache variable name. The value is expected to be a semicolon-separated
  23643. +# list of command line flags
  23644. +# default_value: Value to initialize the option with. Can be space separated.
  23645. +function(AddTestFlagsOption name default_value doc)
  23646. + string(STRIP "${default_value}" default_value)
  23647. + string(REGEX REPLACE " +" ";" default_value "${default_value}")
  23648. + set(${name} ${default_value} CACHE STRING "${doc}")
  23649. + mark_as_advanced(${name})
  23650. +endfunction()
  23651. +
  23652. +set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
  23653. +
  23654. +# Define programs directory, where sources and header files are located
  23655. +set(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
  23656. +set(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
  23657. +set(TESTS_DIR ${ZSTD_SOURCE_DIR}/tests)
  23658. +include_directories(${TESTS_DIR} ${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${LIBRARY_DIR}/compress ${LIBRARY_DIR}/dictBuilder)
  23659. +
  23660. +add_executable(datagen ${PROGRAMS_DIR}/datagen.c ${TESTS_DIR}/datagencli.c)
  23661. +target_link_libraries(datagen libzstd_static)
  23662. +
  23663. +#
  23664. +# fullbench
  23665. +#
  23666. +add_executable(fullbench ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${TESTS_DIR}/fullbench.c)
  23667. +target_link_libraries(fullbench libzstd_static)
  23668. +add_test(NAME fullbench COMMAND fullbench)
  23669. +
  23670. +#
  23671. +# fuzzer
  23672. +#
  23673. +add_executable(fuzzer ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/fuzzer.c)
  23674. +target_link_libraries(fuzzer libzstd_static)
  23675. +AddTestFlagsOption(ZSTD_FUZZER_FLAGS "$ENV{FUZZERTEST} $ENV{FUZZER_FLAGS}"
  23676. + "Semicolon-separated list of flags to pass to the fuzzer test (see `fuzzer -h` for usage)")
  23677. +add_test(NAME fuzzer COMMAND fuzzer ${ZSTD_FUZZER_FLAGS})
  23678. +# Disable the timeout since the run time is too long for the default timeout of
  23679. +# 1500 seconds and varies considerably between low-end and high-end CPUs.
  23680. +# set_tests_properties(fuzzer PROPERTIES TIMEOUT 0)
  23681. +
  23682. +#
  23683. +# zstreamtest
  23684. +#
  23685. +add_executable(zstreamtest ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/seqgen.c ${TESTS_DIR}/zstreamtest.c)
  23686. +target_link_libraries(zstreamtest libzstd_static)
  23687. +AddTestFlagsOption(ZSTD_ZSTREAM_FLAGS "$ENV{ZSTREAM_TESTTIME} $ENV{FUZZER_FLAGS}"
  23688. + "Semicolon-separated list of flags to pass to the zstreamtest test (see `zstreamtest -h` for usage)")
  23689. +add_test(NAME zstreamtest COMMAND zstreamtest ${ZSTD_ZSTREAM_FLAGS})
  23690. +
  23691. +#
  23692. +# playTests.sh
  23693. +#
  23694. +AddTestFlagsOption(ZSTD_PLAYTESTS_FLAGS "--test-large-data"
  23695. + "Semicolon-separated list of flags to pass to the playTests.sh test")
  23696. +add_test(NAME playTests COMMAND sh -c "${TESTS_DIR}/playTests.sh" ${ZSTD_PLAYTESTS_FLAGS})
  23697. +if (ZSTD_BUILD_PROGRAMS)
  23698. + set_property(TEST playTests APPEND PROPERTY ENVIRONMENT
  23699. + "ZSTD_BIN=$<TARGET_FILE:zstd>"
  23700. + "DATAGEN_BIN=$<TARGET_FILE:datagen>"
  23701. + )
  23702. +else()
  23703. + message(STATUS "Disabling playTests.sh test because ZSTD_BUILD_PROGRAMS is not enabled")
  23704. + set_tests_properties(playTests PROPERTIES DISABLED YES)
  23705. +endif()
  23706. +
  23707. +# Label the "Medium" set of tests (see TESTING.md)
  23708. +set_property(TEST fuzzer zstreamtest playTests APPEND PROPERTY LABELS Medium)
  23709. +
  23710. +if (UNIX)
  23711. + add_executable(paramgrill ${PROGRAMS_DIR}/benchfn.c ${PROGRAMS_DIR}/benchzstd.c ${PROGRAMS_DIR}/datagen.c ${PROGRAMS_DIR}/util.c ${PROGRAMS_DIR}/timefn.c ${TESTS_DIR}/paramgrill.c)
  23712. + target_link_libraries(paramgrill libzstd_static m) #m is math library
  23713. +endif ()
  23714. --- /dev/null
  23715. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/cmake/zstdConfig.cmake
  23716. @@ -0,0 +1 @@
  23717. +include("${CMAKE_CURRENT_LIST_DIR}/zstdTargets.cmake")
  23718. --- /dev/null
  23719. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/GetZstdLibraryVersion.py
  23720. @@ -0,0 +1,39 @@
  23721. +#!/usr/bin/env python3
  23722. +# #############################################################################
  23723. +# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
  23724. +# All rights reserved.
  23725. +#
  23726. +# This source code is licensed under both the BSD-style license (found in the
  23727. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23728. +# in the COPYING file in the root directory of this source tree).
  23729. +# #############################################################################
  23730. +import re
  23731. +
  23732. +
  23733. +def find_version_tuple(filepath):
  23734. + version_file_data = None
  23735. + with open(filepath) as fd:
  23736. + version_file_data = fd.read()
  23737. +
  23738. + patterns = r"""#\s*define\s+ZSTD_VERSION_MAJOR\s+([0-9]+)
  23739. +#\s*define\s+ZSTD_VERSION_MINOR\s+([0-9]+)
  23740. +#\s*define\s+ZSTD_VERSION_RELEASE\s+([0-9]+)
  23741. +"""
  23742. + regex = re.compile(patterns, re.MULTILINE)
  23743. + version_match = regex.search(version_file_data)
  23744. + if version_match:
  23745. + return version_match.groups()
  23746. + raise Exception("Unable to find version string")
  23747. +
  23748. +
  23749. +def main():
  23750. + import argparse
  23751. + parser = argparse.ArgumentParser(description='Print zstd version from lib/zstd.h')
  23752. + parser.add_argument('file', help='path to lib/zstd.h')
  23753. + args = parser.parse_args()
  23754. + version_tuple = find_version_tuple(args.file)
  23755. + print('.'.join(version_tuple))
  23756. +
  23757. +
  23758. +if __name__ == '__main__':
  23759. + main()
  23760. --- /dev/null
  23761. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/InstallSymlink.py
  23762. @@ -0,0 +1,55 @@
  23763. +#!/usr/bin/env python3
  23764. +# #############################################################################
  23765. +# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
  23766. +# All rights reserved.
  23767. +#
  23768. +# This source code is licensed under both the BSD-style license (found in the
  23769. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23770. +# in the COPYING file in the root directory of this source tree).
  23771. +# #############################################################################
  23772. +# This file should be synced with https://github.com/lzutao/meson-symlink
  23773. +
  23774. +import os
  23775. +import pathlib # since Python 3.4
  23776. +
  23777. +
  23778. +def install_symlink(src, dst, install_dir, dst_is_dir=False, dir_mode=0o777):
  23779. + if not install_dir.exists():
  23780. + install_dir.mkdir(mode=dir_mode, parents=True, exist_ok=True)
  23781. + if not install_dir.is_dir():
  23782. + raise NotADirectoryError(install_dir)
  23783. +
  23784. + new_dst = install_dir.joinpath(dst)
  23785. + if new_dst.is_symlink() and os.readlink(new_dst) == src:
  23786. + print('File exists: {!r} -> {!r}'.format(new_dst, src))
  23787. + return
  23788. + print('Installing symlink {!r} -> {!r}'.format(new_dst, src))
  23789. + new_dst.symlink_to(src, target_is_directory=dst_is_dir)
  23790. +
  23791. +
  23792. +def main():
  23793. + import argparse
  23794. + parser = argparse.ArgumentParser(description='Install a symlink',
  23795. + usage='{0} [-h] [-d] [-m MODE] source dest install_dir\n\n'
  23796. + 'example:\n'
  23797. + ' {0} dash sh /bin'.format(pathlib.Path(__file__).name))
  23798. + parser.add_argument('source', help='target to link')
  23799. + parser.add_argument('dest', help='link name')
  23800. + parser.add_argument('install_dir', help='installation directory')
  23801. + parser.add_argument('-d', '--isdir',
  23802. + action='store_true',
  23803. + help='dest is a directory')
  23804. + parser.add_argument('-m', '--mode',
  23805. + help='directory mode on creating if not exist',
  23806. + default='0o755')
  23807. + args = parser.parse_args()
  23808. +
  23809. + dir_mode = int(args.mode, 8)
  23810. +
  23811. + meson_destdir = os.environ.get('MESON_INSTALL_DESTDIR_PREFIX', default='')
  23812. + install_dir = pathlib.Path(meson_destdir, args.install_dir)
  23813. + install_symlink(args.source, args.dest, install_dir, args.isdir, dir_mode)
  23814. +
  23815. +
  23816. +if __name__ == '__main__':
  23817. + main()
  23818. --- /dev/null
  23819. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/README.md
  23820. @@ -0,0 +1,38 @@
  23821. +Meson build system for zstandard
  23822. +================================
  23823. +
  23824. +Meson is a build system designed to optimize programmer productivity.
  23825. +It aims to do this by providing simple, out-of-the-box support for
  23826. +modern software development tools and practices, such as unit tests,
  23827. +coverage reports, Valgrind, CCache and the like.
  23828. +
  23829. +This Meson build system is provided with no guarantee and maintained
  23830. +by Dima Krasner \<dima@dimakrasner.com\>.
  23831. +
  23832. +It outputs one `libzstd`, either shared or static, depending on
  23833. +`default_library` option.
  23834. +
  23835. +## How to build
  23836. +
  23837. +`cd` to this meson directory (`build/meson`)
  23838. +
  23839. +```sh
  23840. +meson setup -Dbin_programs=true -Dbin_contrib=true builddir
  23841. +cd builddir
  23842. +ninja # to build
  23843. +ninja install # to install
  23844. +```
  23845. +
  23846. +You might want to install it in staging directory:
  23847. +
  23848. +```sh
  23849. +DESTDIR=./staging ninja install
  23850. +```
  23851. +
  23852. +To configure build options, use:
  23853. +
  23854. +```sh
  23855. +meson configure
  23856. +```
  23857. +
  23858. +See [man meson(1)](https://manpages.debian.org/testing/meson/meson.1.en.html).
  23859. --- /dev/null
  23860. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/contrib/gen_html/meson.build
  23861. @@ -0,0 +1,30 @@
  23862. +# #############################################################################
  23863. +# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
  23864. +# All rights reserved.
  23865. +#
  23866. +# This source code is licensed under both the BSD-style license (found in the
  23867. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23868. +# in the COPYING file in the root directory of this source tree).
  23869. +# #############################################################################
  23870. +
  23871. +zstd_rootdir = '../../../..'
  23872. +
  23873. +gen_html_includes = include_directories(join_paths(zstd_rootdir, 'programs'),
  23874. + join_paths(zstd_rootdir, 'lib'),
  23875. + join_paths(zstd_rootdir, 'lib/common'),
  23876. + join_paths(zstd_rootdir, 'contrib/gen_html'))
  23877. +
  23878. +gen_html = executable('gen_html',
  23879. + join_paths(zstd_rootdir, 'contrib/gen_html/gen_html.cpp'),
  23880. + include_directories: gen_html_includes,
  23881. + native: true,
  23882. + install: false)
  23883. +
  23884. +# Update zstd manual
  23885. +zstd_manual_html = custom_target('zstd_manual.html',
  23886. + output : 'zstd_manual.html',
  23887. + command : [gen_html,
  23888. + zstd_version,
  23889. + join_paths(meson.current_source_dir(), zstd_rootdir, 'lib/zstd.h'),
  23890. + '@OUTPUT@'],
  23891. + install : false)
  23892. --- /dev/null
  23893. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/contrib/meson.build
  23894. @@ -0,0 +1,12 @@
  23895. +# #############################################################################
  23896. +# Copyright (c) 2018-present Dima Krasner <dima@dimakrasner.com>
  23897. +# lzutao <taolzu(at)gmail.com>
  23898. +# All rights reserved.
  23899. +#
  23900. +# This source code is licensed under both the BSD-style license (found in the
  23901. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23902. +# in the COPYING file in the root directory of this source tree).
  23903. +# #############################################################################
  23904. +
  23905. +subdir('pzstd')
  23906. +subdir('gen_html')
  23907. --- /dev/null
  23908. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/contrib/pzstd/meson.build
  23909. @@ -0,0 +1,24 @@
  23910. +# #############################################################################
  23911. +# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
  23912. +# All rights reserved.
  23913. +#
  23914. +# This source code is licensed under both the BSD-style license (found in the
  23915. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23916. +# in the COPYING file in the root directory of this source tree).
  23917. +# #############################################################################
  23918. +
  23919. +zstd_rootdir = '../../../..'
  23920. +
  23921. +pzstd_includes = include_directories(join_paths(zstd_rootdir, 'programs'),
  23922. + join_paths(zstd_rootdir, 'contrib/pzstd'))
  23923. +pzstd_sources = [join_paths(zstd_rootdir, 'programs/util.c'),
  23924. + join_paths(zstd_rootdir, 'contrib/pzstd/main.cpp'),
  23925. + join_paths(zstd_rootdir, 'contrib/pzstd/Options.cpp'),
  23926. + join_paths(zstd_rootdir, 'contrib/pzstd/Pzstd.cpp'),
  23927. + join_paths(zstd_rootdir, 'contrib/pzstd/SkippableFrame.cpp')]
  23928. +pzstd = executable('pzstd',
  23929. + pzstd_sources,
  23930. + cpp_args: [ '-DNDEBUG', '-Wno-shadow', '-pedantic' ],
  23931. + include_directories: pzstd_includes,
  23932. + dependencies: [ libzstd_dep, thread_dep ],
  23933. + install: true)
  23934. --- /dev/null
  23935. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/lib/meson.build
  23936. @@ -0,0 +1,132 @@
  23937. +# #############################################################################
  23938. +# Copyright (c) 2018-present Dima Krasner <dima@dimakrasner.com>
  23939. +# lzutao <taolzu(at)gmail.com>
  23940. +# All rights reserved.
  23941. +#
  23942. +# This source code is licensed under both the BSD-style license (found in the
  23943. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  23944. +# in the COPYING file in the root directory of this source tree).
  23945. +# #############################################################################
  23946. +
  23947. +zstd_rootdir = '../../..'
  23948. +
  23949. +libzstd_includes = [include_directories(join_paths(zstd_rootdir,'lib'),
  23950. + join_paths(zstd_rootdir, 'lib/common'),
  23951. + join_paths(zstd_rootdir, 'lib/compress'),
  23952. + join_paths(zstd_rootdir, 'lib/decompress'),
  23953. + join_paths(zstd_rootdir, 'lib/dictBuilder'),
  23954. + join_paths(zstd_rootdir, 'lib/deprecated'))]
  23955. +
  23956. +libzstd_sources = [join_paths(zstd_rootdir, 'lib/common/entropy_common.c'),
  23957. + join_paths(zstd_rootdir, 'lib/common/fse_decompress.c'),
  23958. + join_paths(zstd_rootdir, 'lib/common/threading.c'),
  23959. + join_paths(zstd_rootdir, 'lib/common/pool.c'),
  23960. + join_paths(zstd_rootdir, 'lib/common/zstd_common.c'),
  23961. + join_paths(zstd_rootdir, 'lib/common/error_private.c'),
  23962. + join_paths(zstd_rootdir, 'lib/common/xxhash.c'),
  23963. + join_paths(zstd_rootdir, 'lib/compress/hist.c'),
  23964. + join_paths(zstd_rootdir, 'lib/compress/fse_compress.c'),
  23965. + join_paths(zstd_rootdir, 'lib/compress/huf_compress.c'),
  23966. + join_paths(zstd_rootdir, 'lib/compress/zstd_compress.c'),
  23967. + join_paths(zstd_rootdir, 'lib/compress/zstd_compress_literals.c'),
  23968. + join_paths(zstd_rootdir, 'lib/compress/zstd_compress_sequences.c'),
  23969. + join_paths(zstd_rootdir, 'lib/compress/zstd_compress_superblock.c'),
  23970. + join_paths(zstd_rootdir, 'lib/compress/zstdmt_compress.c'),
  23971. + join_paths(zstd_rootdir, 'lib/compress/zstd_fast.c'),
  23972. + join_paths(zstd_rootdir, 'lib/compress/zstd_double_fast.c'),
  23973. + join_paths(zstd_rootdir, 'lib/compress/zstd_lazy.c'),
  23974. + join_paths(zstd_rootdir, 'lib/compress/zstd_opt.c'),
  23975. + join_paths(zstd_rootdir, 'lib/compress/zstd_ldm.c'),
  23976. + join_paths(zstd_rootdir, 'lib/decompress/huf_decompress.c'),
  23977. + join_paths(zstd_rootdir, 'lib/decompress/zstd_decompress.c'),
  23978. + join_paths(zstd_rootdir, 'lib/decompress/zstd_decompress_block.c'),
  23979. + join_paths(zstd_rootdir, 'lib/decompress/zstd_ddict.c'),
  23980. + join_paths(zstd_rootdir, 'lib/dictBuilder/cover.c'),
  23981. + join_paths(zstd_rootdir, 'lib/dictBuilder/fastcover.c'),
  23982. + join_paths(zstd_rootdir, 'lib/dictBuilder/divsufsort.c'),
  23983. + join_paths(zstd_rootdir, 'lib/dictBuilder/zdict.c'),
  23984. + join_paths(zstd_rootdir, 'lib/deprecated/zbuff_common.c'),
  23985. + join_paths(zstd_rootdir, 'lib/deprecated/zbuff_compress.c'),
  23986. + join_paths(zstd_rootdir, 'lib/deprecated/zbuff_decompress.c')]
  23987. +
  23988. +# Explicit define legacy support
  23989. +add_project_arguments('-DZSTD_LEGACY_SUPPORT=@0@'.format(legacy_level),
  23990. + language: 'c')
  23991. +
  23992. +if legacy_level == 0
  23993. + message('Legacy support: DISABLED')
  23994. +else
  23995. + # See ZSTD_LEGACY_SUPPORT of lib/README.md
  23996. + message('Enable legacy support back to version 0.@0@'.format(legacy_level))
  23997. +
  23998. + libzstd_includes += [ include_directories(join_paths(zstd_rootdir, 'lib/legacy')) ]
  23999. + foreach i : [1, 2, 3, 4, 5, 6, 7]
  24000. + if legacy_level <= i
  24001. + libzstd_sources += join_paths(zstd_rootdir, 'lib/legacy/zstd_v0@0@.c'.format(i))
  24002. + endif
  24003. + endforeach
  24004. +endif
  24005. +
  24006. +libzstd_deps = []
  24007. +if use_multi_thread
  24008. + message('Enable multi-threading support')
  24009. + add_project_arguments('-DZSTD_MULTITHREAD', language: 'c')
  24010. + libzstd_deps = [ thread_dep ]
  24011. +endif
  24012. +
  24013. +libzstd_c_args = []
  24014. +if cc_id == compiler_msvc
  24015. + if default_library_type != 'static'
  24016. + libzstd_sources += [windows_mod.compile_resources(
  24017. + join_paths(zstd_rootdir, 'build/VS2010/libzstd-dll/libzstd-dll.rc'))]
  24018. + libzstd_c_args += ['-DZSTD_DLL_EXPORT=1',
  24019. + '-DZSTD_HEAPMODE=0',
  24020. + '-D_CONSOLE',
  24021. + '-D_CRT_SECURE_NO_WARNINGS']
  24022. + else
  24023. + libzstd_c_args += ['-DZSTD_HEAPMODE=0',
  24024. + '-D_CRT_SECURE_NO_WARNINGS']
  24025. + endif
  24026. +endif
  24027. +
  24028. +mingw_ansi_stdio_flags = []
  24029. +if host_machine_os == os_windows and cc_id == compiler_gcc
  24030. + mingw_ansi_stdio_flags = [ '-D__USE_MINGW_ANSI_STDIO' ]
  24031. +endif
  24032. +libzstd_c_args += mingw_ansi_stdio_flags
  24033. +
  24034. +libzstd_debug_cflags = []
  24035. +if use_debug
  24036. + libzstd_c_args += '-DDEBUGLEVEL=@0@'.format(debug_level)
  24037. + if cc_id == compiler_gcc or cc_id == compiler_clang
  24038. + libzstd_debug_cflags = ['-Wstrict-aliasing=1', '-Wswitch-enum',
  24039. + '-Wdeclaration-after-statement', '-Wstrict-prototypes',
  24040. + '-Wundef', '-Wpointer-arith', '-Wvla',
  24041. + '-Wformat=2', '-Winit-self', '-Wfloat-equal', '-Wwrite-strings',
  24042. + '-Wredundant-decls', '-Wmissing-prototypes', '-Wc++-compat']
  24043. + endif
  24044. +endif
  24045. +libzstd_c_args += cc.get_supported_arguments(libzstd_debug_cflags)
  24046. +
  24047. +libzstd = library('zstd',
  24048. + libzstd_sources,
  24049. + include_directories: libzstd_includes,
  24050. + c_args: libzstd_c_args,
  24051. + dependencies: libzstd_deps,
  24052. + install: true,
  24053. + version: zstd_libversion)
  24054. +
  24055. +libzstd_dep = declare_dependency(link_with: libzstd,
  24056. + include_directories: libzstd_includes)
  24057. +
  24058. +pkgconfig.generate(libzstd,
  24059. + name: 'libzstd',
  24060. + filebase: 'libzstd',
  24061. + description: 'fast lossless compression algorithm library',
  24062. + version: zstd_libversion,
  24063. + url: 'http://www.zstd.net/')
  24064. +
  24065. +install_headers(join_paths(zstd_rootdir, 'lib/zstd.h'),
  24066. + join_paths(zstd_rootdir, 'lib/deprecated/zbuff.h'),
  24067. + join_paths(zstd_rootdir, 'lib/dictBuilder/zdict.h'),
  24068. + join_paths(zstd_rootdir, 'lib/common/zstd_errors.h'))
  24069. --- /dev/null
  24070. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/meson.build
  24071. @@ -0,0 +1,147 @@
  24072. +# #############################################################################
  24073. +# Copyright (c) 2018-present Dima Krasner <dima@dimakrasner.com>
  24074. +# lzutao <taolzu(at)gmail.com>
  24075. +# All rights reserved.
  24076. +#
  24077. +# This source code is licensed under both the BSD-style license (found in the
  24078. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  24079. +# in the COPYING file in the root directory of this source tree).
  24080. +# #############################################################################
  24081. +
  24082. +project('zstd',
  24083. + ['c', 'cpp'],
  24084. + license: ['BSD', 'GPLv2'],
  24085. + default_options : [
  24086. + 'c_std=gnu99',
  24087. + 'cpp_std=c++11',
  24088. + 'buildtype=release'
  24089. + ],
  24090. + version: 'DUMMY',
  24091. + meson_version: '>=0.47.0')
  24092. +
  24093. +cc = meson.get_compiler('c')
  24094. +cxx = meson.get_compiler('cpp')
  24095. +pkgconfig = import('pkgconfig')
  24096. +python3 = import('python').find_installation()
  24097. +windows_mod = import('windows')
  24098. +
  24099. +host_machine_os = host_machine.system()
  24100. +os_windows = 'windows'
  24101. +os_linux = 'linux'
  24102. +os_darwin = 'darwin'
  24103. +os_freebsd = 'freebsd'
  24104. +os_sun = 'sunos'
  24105. +
  24106. +cc_id = cc.get_id()
  24107. +compiler_gcc = 'gcc'
  24108. +compiler_clang = 'clang'
  24109. +compiler_msvc = 'msvc'
  24110. +
  24111. +zstd_version = meson.project_version()
  24112. +
  24113. +zstd_h_file = join_paths(meson.current_source_dir(), '../../lib/zstd.h')
  24114. +GetZstdLibraryVersion_py = files('GetZstdLibraryVersion.py')
  24115. +r = run_command(python3, GetZstdLibraryVersion_py, zstd_h_file)
  24116. +if r.returncode() == 0
  24117. + zstd_version = r.stdout().strip()
  24118. + message('Project version is now: @0@'.format(zstd_version))
  24119. +else
  24120. + error('Cannot find project version in @0@'.format(zstd_h_file))
  24121. +endif
  24122. +
  24123. +zstd_libversion = zstd_version
  24124. +
  24125. +# =============================================================================
  24126. +# Installation directories
  24127. +# =============================================================================
  24128. +
  24129. +zstd_prefix = get_option('prefix')
  24130. +zstd_bindir = get_option('bindir')
  24131. +zstd_datadir = get_option('datadir')
  24132. +zstd_mandir = get_option('mandir')
  24133. +zstd_docdir = join_paths(zstd_datadir, 'doc', meson.project_name())
  24134. +
  24135. +# =============================================================================
  24136. +# Project options
  24137. +# =============================================================================
  24138. +
  24139. +# Built-in options
  24140. +use_debug = get_option('debug')
  24141. +buildtype = get_option('buildtype')
  24142. +default_library_type = get_option('default_library')
  24143. +
  24144. +# Custom options
  24145. +debug_level = get_option('debug_level')
  24146. +legacy_level = get_option('legacy_level')
  24147. +use_backtrace = get_option('backtrace')
  24148. +use_static_runtime = get_option('static_runtime')
  24149. +
  24150. +bin_programs = get_option('bin_programs')
  24151. +bin_contrib = get_option('bin_contrib')
  24152. +bin_tests = get_option('bin_tests')
  24153. +
  24154. +feature_multi_thread = get_option('multi_thread')
  24155. +feature_zlib = get_option('zlib')
  24156. +feature_lzma = get_option('lzma')
  24157. +feature_lz4 = get_option('lz4')
  24158. +
  24159. +# =============================================================================
  24160. +# Dependencies
  24161. +# =============================================================================
  24162. +
  24163. +libm_dep = cc.find_library('m', required: bin_tests)
  24164. +thread_dep = dependency('threads', required: feature_multi_thread)
  24165. +use_multi_thread = thread_dep.found()
  24166. +# Arguments in dependency should be equivalent to those passed to pkg-config
  24167. +zlib_dep = dependency('zlib', required: feature_zlib)
  24168. +use_zlib = zlib_dep.found()
  24169. +lzma_dep = dependency('liblzma', required: feature_lzma)
  24170. +use_lzma = lzma_dep.found()
  24171. +lz4_dep = dependency('liblz4', required: feature_lz4)
  24172. +use_lz4 = lz4_dep.found()
  24173. +
  24174. +# =============================================================================
  24175. +# Compiler flags
  24176. +# =============================================================================
  24177. +
  24178. +add_project_arguments('-DXXH_NAMESPACE=ZSTD_', language: ['c'])
  24179. +
  24180. +if [compiler_gcc, compiler_clang].contains(cc_id)
  24181. + common_warning_flags = [ '-Wextra', '-Wundef', '-Wshadow', '-Wcast-align', '-Wcast-qual' ]
  24182. + if cc_id == compiler_clang
  24183. + # Should use Meson's own --werror build option
  24184. + #common_warning_flags += '-Werror'
  24185. + common_warning_flags += ['-Wconversion', '-Wno-sign-conversion', '-Wdocumentation']
  24186. + endif
  24187. + cc_compile_flags = cc.get_supported_arguments(common_warning_flags + ['-Wstrict-prototypes'])
  24188. + cxx_compile_flags = cxx.get_supported_arguments(common_warning_flags)
  24189. + add_project_arguments(cc_compile_flags, language : 'c')
  24190. + add_project_arguments(cxx_compile_flags, language : 'cpp')
  24191. +elif cc_id == compiler_msvc
  24192. + msvc_compile_flags = [ '/D_UNICODE', '/DUNICODE' ]
  24193. + if use_multi_thread
  24194. + msvc_compile_flags += '/MP'
  24195. + endif
  24196. + if use_static_runtime
  24197. + msvc_compile_flags += '/MT'
  24198. + endif
  24199. + add_project_arguments(msvc_compile_flags, language: ['c', 'cpp'])
  24200. +endif
  24201. +
  24202. +# =============================================================================
  24203. +# Subdirs
  24204. +# =============================================================================
  24205. +
  24206. +subdir('lib')
  24207. +
  24208. +if bin_programs
  24209. + subdir('programs')
  24210. +endif
  24211. +
  24212. +if bin_tests
  24213. + subdir('tests')
  24214. +endif
  24215. +
  24216. +if bin_contrib
  24217. + subdir('contrib')
  24218. +endif
  24219. --- /dev/null
  24220. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/meson_options.txt
  24221. @@ -0,0 +1,36 @@
  24222. +# #############################################################################
  24223. +# Copyright (c) 2018-present Dima Krasner <dima@dimakrasner.com>
  24224. +# lzutao <taolzu(at)gmail.com>
  24225. +# All rights reserved.
  24226. +#
  24227. +# This source code is licensed under both the BSD-style license (found in the
  24228. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  24229. +# in the COPYING file in the root directory of this source tree).
  24230. +# #############################################################################
  24231. +
  24232. +# Read guidelines from https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
  24233. +
  24234. +option('legacy_level', type: 'integer', min: 0, max: 7, value: '5',
  24235. + description: 'Support any legacy format: 7 to 1 for v0.7+ to v0.1+')
  24236. +option('debug_level', type: 'integer', min: 0, max: 9, value: 1,
  24237. + description: 'Enable run-time debug. See lib/common/debug.h')
  24238. +option('backtrace', type: 'boolean', value: false,
  24239. + description: 'Display a stack backtrace when execution generates a runtime exception')
  24240. +option('static_runtime', type: 'boolean', value: false,
  24241. + description: 'Link to static run-time libraries on MSVC')
  24242. +
  24243. +option('bin_programs', type: 'boolean', value: true,
  24244. + description: 'Enable programs build')
  24245. +option('bin_tests', type: 'boolean', value: false,
  24246. + description: 'Enable tests build')
  24247. +option('bin_contrib', type: 'boolean', value: false,
  24248. + description: 'Enable contrib build')
  24249. +
  24250. +option('multi_thread', type: 'feature', value: 'enabled',
  24251. + description: 'Enable multi-threading when pthread is detected')
  24252. +option('zlib', type: 'feature', value: 'auto',
  24253. + description: 'Enable zlib support')
  24254. +option('lzma', type: 'feature', value: 'auto',
  24255. + description: 'Enable lzma support')
  24256. +option('lz4', type: 'feature', value: 'auto',
  24257. + description: 'Enable lz4 support')
  24258. --- /dev/null
  24259. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/programs/meson.build
  24260. @@ -0,0 +1,104 @@
  24261. +# #############################################################################
  24262. +# Copyright (c) 2018-present Dima Krasner <dima@dimakrasner.com>
  24263. +# lzutao <taolzu(at)gmail.com>
  24264. +# All rights reserved.
  24265. +#
  24266. +# This source code is licensed under both the BSD-style license (found in the
  24267. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  24268. +# in the COPYING file in the root directory of this source tree).
  24269. +# #############################################################################
  24270. +
  24271. +zstd_rootdir = '../../..'
  24272. +
  24273. +zstd_programs_sources = [join_paths(zstd_rootdir, 'programs/zstdcli.c'),
  24274. + join_paths(zstd_rootdir, 'programs/util.c'),
  24275. + join_paths(zstd_rootdir, 'programs/timefn.c'),
  24276. + join_paths(zstd_rootdir, 'programs/fileio.c'),
  24277. + join_paths(zstd_rootdir, 'programs/benchfn.c'),
  24278. + join_paths(zstd_rootdir, 'programs/benchzstd.c'),
  24279. + join_paths(zstd_rootdir, 'programs/datagen.c'),
  24280. + join_paths(zstd_rootdir, 'programs/dibio.c')]
  24281. +
  24282. +zstd_c_args = libzstd_debug_cflags
  24283. +if use_multi_thread
  24284. + zstd_c_args += [ '-DZSTD_MULTITHREAD' ]
  24285. +endif
  24286. +
  24287. +zstd_deps = [ libzstd_dep ]
  24288. +if use_zlib
  24289. + zstd_deps += [ zlib_dep ]
  24290. + zstd_c_args += [ '-DZSTD_GZCOMPRESS', '-DZSTD_GZDECOMPRESS' ]
  24291. +endif
  24292. +
  24293. +if use_lzma
  24294. + zstd_deps += [ lzma_dep ]
  24295. + zstd_c_args += [ '-DZSTD_LZMACOMPRESS', '-DZSTD_LZMADECOMPRESS' ]
  24296. +endif
  24297. +
  24298. +if use_lz4
  24299. + zstd_deps += [ lz4_dep ]
  24300. + zstd_c_args += [ '-DZSTD_LZ4COMPRESS', '-DZSTD_LZ4DECOMPRESS' ]
  24301. +endif
  24302. +
  24303. +export_dynamic_on_windows = false
  24304. +# explicit backtrace enable/disable for Linux & Darwin
  24305. +if not use_backtrace
  24306. + zstd_c_args += '-DBACKTRACE_ENABLE=0'
  24307. +elif use_debug and host_machine_os == os_windows # MinGW target
  24308. + zstd_c_args += '-DBACKTRACE_ENABLE=1'
  24309. + export_dynamic_on_windows = true
  24310. +endif
  24311. +
  24312. +if cc_id == compiler_msvc
  24313. + if default_library_type != 'static'
  24314. + zstd_programs_sources += [windows_mod.compile_resources(
  24315. + join_paths(zstd_rootdir, 'build/VS2010/zstd/zstd.rc'))]
  24316. + endif
  24317. +endif
  24318. +
  24319. +zstd = executable('zstd',
  24320. + zstd_programs_sources,
  24321. + c_args: zstd_c_args,
  24322. + dependencies: zstd_deps,
  24323. + export_dynamic: export_dynamic_on_windows, # Since Meson 0.45.0
  24324. + install: true)
  24325. +
  24326. +zstd_frugal_sources = [join_paths(zstd_rootdir, 'programs/zstdcli.c'),
  24327. + join_paths(zstd_rootdir, 'programs/timefn.c'),
  24328. + join_paths(zstd_rootdir, 'programs/util.c'),
  24329. + join_paths(zstd_rootdir, 'programs/fileio.c')]
  24330. +
  24331. +# Minimal target, with only zstd compression and decompression.
  24332. +# No bench. No legacy.
  24333. +executable('zstd-frugal',
  24334. + zstd_frugal_sources,
  24335. + dependencies: libzstd_dep,
  24336. + c_args: [ '-DZSTD_NOBENCH', '-DZSTD_NODICT' ],
  24337. + install: true)
  24338. +
  24339. +install_data(join_paths(zstd_rootdir, 'programs/zstdgrep'),
  24340. + join_paths(zstd_rootdir, 'programs/zstdless'),
  24341. + install_dir: zstd_bindir)
  24342. +
  24343. +# =============================================================================
  24344. +# Programs and manpages installing
  24345. +# =============================================================================
  24346. +
  24347. +install_man(join_paths(zstd_rootdir, 'programs/zstd.1'),
  24348. + join_paths(zstd_rootdir, 'programs/zstdgrep.1'),
  24349. + join_paths(zstd_rootdir, 'programs/zstdless.1'))
  24350. +
  24351. +InstallSymlink_py = '../InstallSymlink.py'
  24352. +zstd_man1_dir = join_paths(zstd_mandir, 'man1')
  24353. +bin_EXT = host_machine_os == os_windows ? '.exe' : ''
  24354. +man1_EXT = meson.version().version_compare('>=0.49.0') ? '.1' : '.1.gz'
  24355. +
  24356. +foreach f : ['zstdcat', 'unzstd']
  24357. + meson.add_install_script(InstallSymlink_py, 'zstd' + bin_EXT, f + bin_EXT, zstd_bindir)
  24358. + meson.add_install_script(InstallSymlink_py, 'zstd' + man1_EXT, f + man1_EXT, zstd_man1_dir)
  24359. +endforeach
  24360. +
  24361. +if use_multi_thread
  24362. + meson.add_install_script(InstallSymlink_py, 'zstd' + bin_EXT, 'zstdmt' + bin_EXT, zstd_bindir)
  24363. + meson.add_install_script(InstallSymlink_py, 'zstd' + man1_EXT, 'zstdmt' + man1_EXT, zstd_man1_dir)
  24364. +endif
  24365. --- /dev/null
  24366. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/tests/meson.build
  24367. @@ -0,0 +1,206 @@
  24368. +# #############################################################################
  24369. +# Copyright (c) 2018-present Dima Krasner <dima@dimakrasner.com>
  24370. +# lzutao <taolzu(at)gmail.com>
  24371. +# All rights reserved.
  24372. +#
  24373. +# This source code is licensed under both the BSD-style license (found in the
  24374. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  24375. +# in the COPYING file in the root directory of this source tree).
  24376. +# #############################################################################
  24377. +
  24378. +zstd_rootdir = '../../..'
  24379. +
  24380. +tests_supported_oses = [os_linux, 'gnu/kfreebsd', os_darwin, 'gnu', 'openbsd',
  24381. + os_freebsd, 'netbsd', 'dragonfly', os_sun]
  24382. +
  24383. +# =============================================================================
  24384. +# Test flags
  24385. +# =============================================================================
  24386. +
  24387. +FUZZER_FLAGS = ['--no-big-tests']
  24388. +FUZZERTEST = '-T200s'
  24389. +ZSTREAM_TESTTIME = '-T90s'
  24390. +DECODECORPUS_TESTTIME = '-T30'
  24391. +ZSTDRTTEST = ['--test-large-data']
  24392. +
  24393. +# =============================================================================
  24394. +# Executables
  24395. +# =============================================================================
  24396. +
  24397. +test_includes = [ include_directories(join_paths(zstd_rootdir, 'programs')) ]
  24398. +
  24399. +datagen_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
  24400. + join_paths(zstd_rootdir, 'tests/datagencli.c')]
  24401. +datagen = executable('datagen',
  24402. + datagen_sources,
  24403. + c_args: [ '-DNDEBUG' ],
  24404. + include_directories: test_includes,
  24405. + dependencies: libzstd_dep,
  24406. + install: false)
  24407. +
  24408. +fullbench_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
  24409. + join_paths(zstd_rootdir, 'programs/util.c'),
  24410. + join_paths(zstd_rootdir, 'programs/timefn.c'),
  24411. + join_paths(zstd_rootdir, 'programs/benchfn.c'),
  24412. + join_paths(zstd_rootdir, 'programs/benchzstd.c'),
  24413. + join_paths(zstd_rootdir, 'tests/fullbench.c')]
  24414. +fullbench = executable('fullbench',
  24415. + fullbench_sources,
  24416. + include_directories: test_includes,
  24417. + dependencies: libzstd_dep,
  24418. + install: false)
  24419. +
  24420. +fuzzer_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
  24421. + join_paths(zstd_rootdir, 'programs/util.c'),
  24422. + join_paths(zstd_rootdir, 'programs/timefn.c'),
  24423. + join_paths(zstd_rootdir, 'tests/fuzzer.c')]
  24424. +fuzzer = executable('fuzzer',
  24425. + fuzzer_sources,
  24426. + include_directories: test_includes,
  24427. + dependencies: libzstd_dep,
  24428. + install: false)
  24429. +
  24430. +zstreamtest_sources = [join_paths(zstd_rootdir, 'programs/datagen.c'),
  24431. + join_paths(zstd_rootdir, 'programs/util.c'),
  24432. + join_paths(zstd_rootdir, 'programs/timefn.c'),
  24433. + join_paths(zstd_rootdir, 'tests/seqgen.c'),
  24434. + join_paths(zstd_rootdir, 'tests/zstreamtest.c')]
  24435. +zstreamtest = executable('zstreamtest',
  24436. + zstreamtest_sources,
  24437. + include_directories: test_includes,
  24438. + dependencies: libzstd_dep,
  24439. + install: false)
  24440. +
  24441. +paramgrill_sources = [join_paths(zstd_rootdir, 'programs/benchfn.c'),
  24442. + join_paths(zstd_rootdir, 'programs/timefn.c'),
  24443. + join_paths(zstd_rootdir, 'programs/benchzstd.c'),
  24444. + join_paths(zstd_rootdir, 'programs/datagen.c'),
  24445. + join_paths(zstd_rootdir, 'programs/util.c'),
  24446. + join_paths(zstd_rootdir, 'tests/paramgrill.c')]
  24447. +paramgrill = executable('paramgrill',
  24448. + paramgrill_sources,
  24449. + include_directories: test_includes,
  24450. + dependencies: [ libzstd_dep, libm_dep ],
  24451. + install: false)
  24452. +
  24453. +roundTripCrash_sources = [join_paths(zstd_rootdir, 'tests/roundTripCrash.c')]
  24454. +roundTripCrash = executable('roundTripCrash',
  24455. + roundTripCrash_sources,
  24456. + dependencies: [ libzstd_dep ],
  24457. + install: false)
  24458. +
  24459. +longmatch_sources = [join_paths(zstd_rootdir, 'tests/longmatch.c')]
  24460. +longmatch = executable('longmatch',
  24461. + longmatch_sources,
  24462. + dependencies: [ libzstd_dep ],
  24463. + install: false)
  24464. +
  24465. +invalidDictionaries_sources = [join_paths(zstd_rootdir, 'tests/invalidDictionaries.c')]
  24466. +invalidDictionaries = executable('invalidDictionaries',
  24467. + invalidDictionaries_sources,
  24468. + dependencies: [ libzstd_dep ],
  24469. + install: false)
  24470. +
  24471. +if 0 < legacy_level and legacy_level <= 4
  24472. + legacy_sources = [join_paths(zstd_rootdir, 'tests/legacy.c')]
  24473. + legacy = executable('legacy',
  24474. + legacy_sources,
  24475. + # Use -Dlegacy_level build option to control it
  24476. + #c_args: '-DZSTD_LEGACY_SUPPORT=4',
  24477. + dependencies: [ libzstd_dep ],
  24478. + install: false)
  24479. +endif
  24480. +
  24481. +decodecorpus_sources = [join_paths(zstd_rootdir, 'programs/util.c'),
  24482. + join_paths(zstd_rootdir, 'programs/timefn.c'),
  24483. + join_paths(zstd_rootdir, 'tests/decodecorpus.c')]
  24484. +decodecorpus = executable('decodecorpus',
  24485. + decodecorpus_sources,
  24486. + include_directories: test_includes,
  24487. + dependencies: [ libzstd_dep, libm_dep ],
  24488. + install: false)
  24489. +
  24490. +poolTests_sources = [join_paths(zstd_rootdir, 'programs/util.c'),
  24491. + join_paths(zstd_rootdir, 'programs/timefn.c'),
  24492. + join_paths(zstd_rootdir, 'tests/poolTests.c'),
  24493. + join_paths(zstd_rootdir, 'lib/common/pool.c'),
  24494. + join_paths(zstd_rootdir, 'lib/common/threading.c'),
  24495. + join_paths(zstd_rootdir, 'lib/common/zstd_common.c'),
  24496. + join_paths(zstd_rootdir, 'lib/common/error_private.c')]
  24497. +poolTests = executable('poolTests',
  24498. + poolTests_sources,
  24499. + include_directories: test_includes,
  24500. + dependencies: [ libzstd_dep, thread_dep ],
  24501. + install: false)
  24502. +
  24503. +checkTag_sources = [join_paths(zstd_rootdir, 'tests/checkTag.c')]
  24504. +checkTag = executable('checkTag',
  24505. + checkTag_sources,
  24506. + dependencies: [ libzstd_dep ],
  24507. + install: false)
  24508. +
  24509. +# =============================================================================
  24510. +# Tests (Use "meson test --list" to list all tests)
  24511. +# =============================================================================
  24512. +
  24513. +if tests_supported_oses.contains(host_machine_os)
  24514. + valgrind_prog = find_program('valgrind', ['/usr/bin/valgrind'], required: true)
  24515. + valgrindTest_py = files('valgrindTest.py')
  24516. + test('valgrindTest',
  24517. + valgrindTest_py,
  24518. + args: [valgrind_prog.path(), zstd, datagen, fuzzer, fullbench],
  24519. + depends: [zstd, datagen, fuzzer, fullbench],
  24520. + timeout: 600) # Timeout should work on HDD drive
  24521. +endif
  24522. +
  24523. +if host_machine_os != os_windows
  24524. + playTests_sh = find_program(join_paths(zstd_rootdir, 'tests/playTests.sh'), required: true)
  24525. + test('test-zstd',
  24526. + playTests_sh,
  24527. + args: ZSTDRTTEST,
  24528. + env: ['ZSTD_BIN=' + zstd.full_path(), 'DATAGEN_BIN=./datagen'],
  24529. + depends: [datagen],
  24530. + workdir: meson.current_build_dir(),
  24531. + timeout: 2800) # Timeout should work on HDD drive
  24532. +endif
  24533. +
  24534. +test('test-fullbench-1',
  24535. + fullbench,
  24536. + args: ['-i1'],
  24537. + depends: [datagen],
  24538. + timeout: 60)
  24539. +test('test-fullbench-2',
  24540. + fullbench,
  24541. + args: ['-i1', '-P0'],
  24542. + depends: [datagen],
  24543. + timeout: 60)
  24544. +
  24545. +if use_zlib
  24546. + test('test-fuzzer',
  24547. + fuzzer,
  24548. + args: ['-v', FUZZERTEST] + FUZZER_FLAGS,
  24549. + timeout: 480)
  24550. +endif
  24551. +
  24552. +test('test-zstream-1',
  24553. + zstreamtest,
  24554. + args: ['-v', ZSTREAM_TESTTIME] + FUZZER_FLAGS,
  24555. + timeout: 240)
  24556. +test('test-zstream-2',
  24557. + zstreamtest,
  24558. + args: ['-mt', '-t1', ZSTREAM_TESTTIME] + FUZZER_FLAGS,
  24559. + timeout: 120)
  24560. +test('test-zstream-3',
  24561. + zstreamtest,
  24562. + args: ['--newapi', '-t1', ZSTREAM_TESTTIME] + FUZZER_FLAGS,
  24563. + timeout: 120)
  24564. +test('test-longmatch', longmatch, timeout: 36)
  24565. +test('test-invalidDictionaries', invalidDictionaries) # should be fast
  24566. +if 0 < legacy_level and legacy_level <= 4
  24567. + test('test-legacy', legacy) # should be fast
  24568. +endif
  24569. +test('test-decodecorpus',
  24570. + decodecorpus,
  24571. + args: ['-t', DECODECORPUS_TESTTIME],
  24572. + timeout: 60)
  24573. +test('test-poolTests', poolTests) # should be fast
  24574. --- /dev/null
  24575. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/build/meson/tests/valgrindTest.py
  24576. @@ -0,0 +1,90 @@
  24577. +#!/usr/bin/env python3
  24578. +# #############################################################################
  24579. +# Copyright (c) 2018-present lzutao <taolzu(at)gmail.com>
  24580. +# All rights reserved.
  24581. +#
  24582. +# This source code is licensed under both the BSD-style license (found in the
  24583. +# LICENSE file in the root directory of this source tree) and the GPLv2 (found
  24584. +# in the COPYING file in the root directory of this source tree).
  24585. +# #############################################################################
  24586. +import os
  24587. +import subprocess
  24588. +import tempfile
  24589. +
  24590. +
  24591. +def valgrindTest(valgrind, datagen, fuzzer, zstd, fullbench):
  24592. + VALGRIND_ARGS = [valgrind, '--leak-check=full', '--show-leak-kinds=all', '--error-exitcode=1']
  24593. +
  24594. + print('\n ---- valgrind tests : memory analyzer ----')
  24595. +
  24596. + subprocess.check_call([*VALGRIND_ARGS, datagen, '-g50M'], stdout=subprocess.DEVNULL)
  24597. +
  24598. + if subprocess.call([*VALGRIND_ARGS, zstd],
  24599. + stdout=subprocess.DEVNULL) == 0:
  24600. + raise subprocess.CalledProcessError('zstd without argument should have failed')
  24601. +
  24602. + with subprocess.Popen([datagen, '-g80'], stdout=subprocess.PIPE) as p1, \
  24603. + subprocess.Popen([*VALGRIND_ARGS, zstd, '-', '-c'],
  24604. + stdin=p1.stdout,
  24605. + stdout=subprocess.DEVNULL) as p2:
  24606. + p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
  24607. + p2.communicate()
  24608. + if p2.returncode != 0:
  24609. + raise subprocess.CalledProcessError()
  24610. +
  24611. + with subprocess.Popen([datagen, '-g16KB'], stdout=subprocess.PIPE) as p1, \
  24612. + subprocess.Popen([*VALGRIND_ARGS, zstd, '-vf', '-', '-c'],
  24613. + stdin=p1.stdout,
  24614. + stdout=subprocess.DEVNULL) as p2:
  24615. + p1.stdout.close()
  24616. + p2.communicate()
  24617. + if p2.returncode != 0:
  24618. + raise subprocess.CalledProcessError()
  24619. +
  24620. + with tempfile.NamedTemporaryFile() as tmp_fd:
  24621. + with subprocess.Popen([datagen, '-g2930KB'], stdout=subprocess.PIPE) as p1, \
  24622. + subprocess.Popen([*VALGRIND_ARGS, zstd, '-5', '-vf', '-', '-o', tmp_fd.name],
  24623. + stdin=p1.stdout) as p2:
  24624. + p1.stdout.close()
  24625. + p2.communicate()
  24626. + if p2.returncode != 0:
  24627. + raise subprocess.CalledProcessError()
  24628. +
  24629. + subprocess.check_call([*VALGRIND_ARGS, zstd, '-vdf', tmp_fd.name, '-c'],
  24630. + stdout=subprocess.DEVNULL)
  24631. +
  24632. + with subprocess.Popen([datagen, '-g64MB'], stdout=subprocess.PIPE) as p1, \
  24633. + subprocess.Popen([*VALGRIND_ARGS, zstd, '-vf', '-', '-c'],
  24634. + stdin=p1.stdout,
  24635. + stdout=subprocess.DEVNULL) as p2:
  24636. + p1.stdout.close()
  24637. + p2.communicate()
  24638. + if p2.returncode != 0:
  24639. + raise subprocess.CalledProcessError()
  24640. +
  24641. + subprocess.check_call([*VALGRIND_ARGS, fuzzer, '-T1mn', '-t1'])
  24642. + subprocess.check_call([*VALGRIND_ARGS, fullbench, '-i1'])
  24643. +
  24644. +
  24645. +def main():
  24646. + import argparse
  24647. + parser = argparse.ArgumentParser(description='Valgrind tests : memory analyzer')
  24648. + parser.add_argument('valgrind', help='valgrind path')
  24649. + parser.add_argument('zstd', help='zstd path')
  24650. + parser.add_argument('datagen', help='datagen path')
  24651. + parser.add_argument('fuzzer', help='fuzzer path')
  24652. + parser.add_argument('fullbench', help='fullbench path')
  24653. +
  24654. + args = parser.parse_args()
  24655. +
  24656. + valgrind = args.valgrind
  24657. + zstd = args.zstd
  24658. + datagen = args.datagen
  24659. + fuzzer = args.fuzzer
  24660. + fullbench = args.fullbench
  24661. +
  24662. + valgrindTest(valgrind, datagen, fuzzer, zstd, fullbench)
  24663. +
  24664. +
  24665. +if __name__ == '__main__':
  24666. + main()
  24667. --- /dev/null
  24668. +++ cardinal-22.02/src/Rack/dep/zstd-1.4.5/contrib/linux-kernel/lib/zstd/.clang-format
  24669. @@ -0,0 +1,11 @@
  24670. +BasedOnStyle: LLVM
  24671. +IndentWidth: 8
  24672. +UseTab: Always
  24673. +BreakBeforeBraces: Linux
  24674. +AllowShortIfStatementsOnASingleLine: false
  24675. +IndentCaseLabels: false
  24676. +
  24677. +ColumnLimit: 160
  24678. +AlignEscapedNewlinesLeft: true
  24679. +ReflowComments: true
  24680. +AllowShortCaseLabelsOnASingleLine: true