Projects
openEuler:Mainline
pkgconf
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 10
View file
_service:tar_scm:pkgconf.spec
Changed
@@ -1,16 +1,14 @@ %global pkgconf_libdirs %{_libdir}/pkgconfig:%{_datadir}/pkgconfig Name: pkgconf -Version: 1.8.0 -Release: 3 +Version: 1.9.5 +Release: 1 Summary: Package compiler and linker metadata toolkit License: ISC URL: http://pkgconf.org/ Source0: https://distfiles.dereferenced.org/%{name}/%{name}-%{version}.tar.xz -Patch6000: backport-CVE-2023-24056.patch - BuildRequires: gcc, make, autoconf, automake, libtool #tests BuildRequires: kyua, atf-tests @@ -45,6 +43,14 @@ %package_help +%package bomtool +Summary: Simple SBOM generator using pc(5) files +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description bomtool +bomtool is a program which helps generate a Software Bill of Materials +manifest using data from installed .pc files. + %prep %autosetup -p1 @@ -105,7 +111,13 @@ %files help %{_mandir}/*/* +%files bomtool +%{_bindir}/bomtool + %changelog +* Mon Jul 24 2023 dongyuzhen <dongyuzhen@h-partners.com> - 1.9.5-1 +- upgrade version to 1.9.5 + * Sun Jan 29 2023 dongyuzhen <dongyuzhen@h-partners.com> - 1.8.0-3 - fix CVE-2023-24056
View file
_service:tar_scm:backport-CVE-2023-24056.patch
Deleted
@@ -1,71 +0,0 @@ -From 628b2b2bafa5d3a2017193ddf375093e70666059 Mon Sep 17 00:00:00 2001 -From: Ariadne Conill <ariadne@dereferenced.org> -Date: Fri, 20 Jan 2023 22:07:03 +0000 -Subject: PATCH tuple: test for, and stop string processing, on truncation - -otherwise a buffer overflow occurs. -this has been a bug in pkgconf since the beginning, it seems. -instead of disclosing the bug correctly, a "hotshot" developer -decided to blog about it instead. sigh. - -https://nullprogram.com/blog/2023/01/18/ ---- - libpkgconf/tuple.c | 28 +++++++++++++++++++++++----- - 1 file changed, 23 insertions(+), 5 deletions(-) - -diff --git a/libpkgconf/tuple.c b/libpkgconf/tuple.c -index 2d550d8..b831070 100644 ---- a/libpkgconf/tuple.c -+++ b/libpkgconf/tuple.c -@@ -293,12 +293,21 @@ pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const - } - } - -+ size_t remain = PKGCONF_BUFSIZE - (bptr - buf); - ptr += (pptr - ptr); - kv = pkgconf_tuple_find_global(client, varname); - if (kv != NULL) - { -- strncpy(bptr, kv, PKGCONF_BUFSIZE - (bptr - buf)); -- bptr += strlen(kv); -+ size_t nlen = pkgconf_strlcpy(bptr, kv, remain); -+ if (nlen > remain) -+ { -+ pkgconf_warn(client, "warning: truncating very long variable to 64KB\n"); -+ -+ bptr = buf + (PKGCONF_BUFSIZE - 1); -+ break; -+ } -+ -+ bptr += nlen; - } - else - { -@@ -306,12 +315,21 @@ pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const - - if (kv != NULL) - { -+ size_t nlen; -+ - parsekv = pkgconf_tuple_parse(client, vars, kv); -+ nlen = pkgconf_strlcpy(bptr, parsekv, remain); -+ free(parsekv); - -- strncpy(bptr, parsekv, PKGCONF_BUFSIZE - (bptr - buf)); -- bptr += strlen(parsekv); -+ if (nlen > remain) -+ { -+ pkgconf_warn(client, "warning: truncating very long variable to 64KB\n"); - -- free(parsekv); -+ bptr = buf + (PKGCONF_BUFSIZE - 1); -+ break; -+ } -+ -+ bptr += nlen; - } - } - } --- -2.33.0 -
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/Makefile.am -> _service:tar_scm:pkgconf-1.9.5.tar.xz/Makefile.am
Changed
@@ -11,7 +11,7 @@ AM_CFLAGS = -DPERSONALITY_PATH=\"$(personality_dir)\" -DPKG_DEFAULT_PATH=\"$(pkg_default_dir)\" -DSYSTEM_INCLUDEDIR=\"$(system_includedir)\" -DSYSTEM_LIBDIR=\"$(system_libdir)\" -bin_PROGRAMS = pkgconf +bin_PROGRAMS = pkgconf bomtool lib_LTLIBRARIES = libpkgconf.la EXTRA_DIST = pkg.m4 \ @@ -22,6 +22,7 @@ libpkgconf/win-dirent.h \ tests/lib-relocatable/lib/pkgconfig/foo.pc \ tests/lib1/argv-parse-2.pc \ + tests/lib1/billion-laughs.pc \ tests/lib1/dos-lineendings.pc \ tests/lib1/paren-quoting.pc \ tests/lib1/argv-parse-3.pc \ @@ -61,6 +62,7 @@ tests/lib3/bar.pc \ tests/lib1/conflicts.pc \ tests/lib1/omg-uninstalled.pc \ + tests/lib1/omg-sysroot-uninstalled.pc \ tests/lib1/isystem.pc \ tests/lib1/idirafter.pc \ tests/lib1/idirafter-ordering.pc \ @@ -88,6 +90,9 @@ tests/lib1/malformed-1.pc \ tests/lib1/malformed-quoting.pc \ tests/lib1/malformed-version.pc \ + tests/lib1/metapackage.pc \ + tests/lib1/metapackage-1.pc \ + tests/lib1/metapackage-2.pc \ tests/lib1/explicit-sysroot.pc \ tests/lib1/escaped-backslash.pc \ tests/lib1/cflags-internal.pc \ @@ -98,6 +103,10 @@ tests/lib1/tuple-quoting.pc \ tests/lib1/empty-tuple.pc \ tests/lib1/orphaned-requires-private.pc \ + tests/lib1/sysroot-dir-2.pc \ + tests/lib1/sysroot-dir-3.pc \ + tests/lib1/sysroot-dir-4.pc \ + tests/lib1/sysroot-dir-5.pc \ $(test_scripts) \ doc/conf.py \ doc/extract.py \ @@ -126,7 +135,8 @@ tests/sysroot.sh \ tests/version.sh -check_SCRIPTS= $(test_scripts:.sh=) +test_sh = $(filter-out tests/meson.build, $(test_scripts)) +check_SCRIPTS = $(test_sh:.sh=) SUFFIXES= .sh @@ -146,7 +156,7 @@ libpkgconf/path.c \ libpkgconf/personality.c \ libpkgconf/parser.c -libpkgconf_la_LDFLAGS = -no-undefined -version-info 3:0:0 -export-symbols-regex '^pkgconf_' +libpkgconf_la_LDFLAGS = -no-undefined -version-info 4:0:0 -export-symbols-regex '^pkgconf_' dist_man_MANS = \ man/pkgconf.1 \ @@ -159,11 +169,17 @@ cli/main.c \ cli/getopt_long.c \ cli/renderer-msvc.c -pkgconf_CPPFLAGS = -Ilibpkgconf -Icli +pkgconf_CPPFLAGS = -I$(top_srcdir)/libpkgconf -I$(top_srcdir)/cli noinst_HEADERS = \ cli/getopt_long.h \ cli/renderer-msvc.h +bomtool_LDADD = libpkgconf.la +bomtool_SOURCES = \ + cli/bomtool/main.c \ + cli/getopt_long.c +bomtool_CPPFLAGS = -I$(top_srcdir)/libpkgconf -I$(top_srcdir)/cli -I$(top_srcdir)/cli/bomtool + dist_doc_DATA = README.md AUTHORS m4datadir = $(datadir)/aclocal
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/Makefile.in -> _service:tar_scm:pkgconf-1.9.5.tar.xz/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.3 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -91,7 +91,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -bin_PROGRAMS = pkgconf$(EXEEXT) +bin_PROGRAMS = pkgconf$(EXEEXT) bomtool$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ @@ -162,6 +162,10 @@ libpkgconf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libpkgconf_la_LDFLAGS) $(LDFLAGS) -o $@ +am_bomtool_OBJECTS = cli/bomtool/bomtool-main.$(OBJEXT) \ + cli/bomtool-getopt_long.$(OBJEXT) +bomtool_OBJECTS = $(am_bomtool_OBJECTS) +bomtool_DEPENDENCIES = libpkgconf.la am_pkgconf_OBJECTS = cli/pkgconf-main.$(OBJEXT) \ cli/pkgconf-getopt_long.$(OBJEXT) \ cli/pkgconf-renderer-msvc.$(OBJEXT) @@ -182,9 +186,11 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libpkgconf depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = cli/$(DEPDIR)/pkgconf-getopt_long.Po \ +am__depfiles_remade = cli/$(DEPDIR)/bomtool-getopt_long.Po \ + cli/$(DEPDIR)/pkgconf-getopt_long.Po \ cli/$(DEPDIR)/pkgconf-main.Po \ cli/$(DEPDIR)/pkgconf-renderer-msvc.Po \ + cli/bomtool/$(DEPDIR)/bomtool-main.Po \ libpkgconf/$(DEPDIR)/argvsplit.Plo \ libpkgconf/$(DEPDIR)/audit.Plo \ libpkgconf/$(DEPDIR)/bsdstubs.Plo \ @@ -215,8 +221,10 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libpkgconf_la_SOURCES) $(pkgconf_SOURCES) -DIST_SOURCES = $(libpkgconf_la_SOURCES) $(pkgconf_SOURCES) +SOURCES = $(libpkgconf_la_SOURCES) $(bomtool_SOURCES) \ + $(pkgconf_SOURCES) +DIST_SOURCES = $(libpkgconf_la_SOURCES) $(bomtool_SOURCES) \ + $(pkgconf_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -246,17 +254,14 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Kyuafile.in \ $(srcdir)/Makefile.in $(srcdir)/libpkgconf.pc.in \ $(top_srcdir)/libpkgconf/config.h.in \ $(top_srcdir)/tests/Kyuafile.in \ $(top_srcdir)/tests/test_env.sh.in AUTHORS COPYING NEWS \ - compile config.guess config.sub depcomp install-sh ltmain.sh \ - missing + README.md compile config.guess config.sub depcomp install-sh \ + ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -289,6 +294,8 @@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ @@ -299,8 +306,10 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -412,6 +421,7 @@ libpkgconf/win-dirent.h \ tests/lib-relocatable/lib/pkgconfig/foo.pc \ tests/lib1/argv-parse-2.pc \ + tests/lib1/billion-laughs.pc \ tests/lib1/dos-lineendings.pc \ tests/lib1/paren-quoting.pc \ tests/lib1/argv-parse-3.pc \ @@ -451,6 +461,7 @@ tests/lib3/bar.pc \ tests/lib1/conflicts.pc \ tests/lib1/omg-uninstalled.pc \ + tests/lib1/omg-sysroot-uninstalled.pc \ tests/lib1/isystem.pc \ tests/lib1/idirafter.pc \ tests/lib1/idirafter-ordering.pc \ @@ -478,6 +489,9 @@ tests/lib1/malformed-1.pc \ tests/lib1/malformed-quoting.pc \ tests/lib1/malformed-version.pc \ + tests/lib1/metapackage.pc \ + tests/lib1/metapackage-1.pc \ + tests/lib1/metapackage-2.pc \ tests/lib1/explicit-sysroot.pc \ tests/lib1/escaped-backslash.pc \ tests/lib1/cflags-internal.pc \ @@ -488,6 +502,10 @@ tests/lib1/tuple-quoting.pc \ tests/lib1/empty-tuple.pc \ tests/lib1/orphaned-requires-private.pc \ + tests/lib1/sysroot-dir-2.pc \ + tests/lib1/sysroot-dir-3.pc \ + tests/lib1/sysroot-dir-4.pc \ + tests/lib1/sysroot-dir-5.pc \ $(test_scripts) \ doc/conf.py \ doc/extract.py \ @@ -516,7 +534,8 @@ tests/sysroot.sh \ tests/version.sh -check_SCRIPTS = $(test_scripts:.sh=) +test_sh = $(filter-out tests/meson.build, $(test_scripts)) +check_SCRIPTS = $(test_sh:.sh=) SUFFIXES = .sh nobase_pkginclude_HEADERS = libpkgconf/bsdstubs.h libpkgconf/iter.h libpkgconf/libpkgconf.h libpkgconf/stdinc.h libpkgconf/libpkgconf-api.h libpkgconf_la_SOURCES = \ @@ -535,7 +554,7 @@ libpkgconf/personality.c \ libpkgconf/parser.c -libpkgconf_la_LDFLAGS = -no-undefined -version-info 3:0:0 -export-symbols-regex '^pkgconf_' +libpkgconf_la_LDFLAGS = -no-undefined -version-info 4:0:0 -export-symbols-regex '^pkgconf_' dist_man_MANS = \ man/pkgconf.1 \ man/pkg.m4.7 \ @@ -548,11 +567,17 @@ cli/getopt_long.c \ cli/renderer-msvc.c -pkgconf_CPPFLAGS = -Ilibpkgconf -Icli +pkgconf_CPPFLAGS = -I$(top_srcdir)/libpkgconf -I$(top_srcdir)/cli noinst_HEADERS = \ cli/getopt_long.h \ cli/renderer-msvc.h +bomtool_LDADD = libpkgconf.la +bomtool_SOURCES = \ + cli/bomtool/main.c \ + cli/getopt_long.c + +bomtool_CPPFLAGS = -I$(top_srcdir)/libpkgconf -I$(top_srcdir)/cli -I$(top_srcdir)/cli/bomtool dist_doc_DATA = README.md AUTHORS m4datadir = $(datadir)/aclocal m4data_DATA = pkg.m4 @@ -740,12 +765,26 @@ libpkgconf.la: $(libpkgconf_la_OBJECTS) $(libpkgconf_la_DEPENDENCIES) $(EXTRA_libpkgconf_la_DEPENDENCIES) $(AM_V_CCLD)$(libpkgconf_la_LINK) -rpath $(libdir) $(libpkgconf_la_OBJECTS) $(libpkgconf_la_LIBADD) $(LIBS) +cli/bomtool/$(am__dirstamp): + @$(MKDIR_P) cli/bomtool + @: > cli/bomtool/$(am__dirstamp) +cli/bomtool/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cli/bomtool/$(DEPDIR) + @: > cli/bomtool/$(DEPDIR)/$(am__dirstamp) +cli/bomtool/bomtool-main.$(OBJEXT): cli/bomtool/$(am__dirstamp) \ + cli/bomtool/$(DEPDIR)/$(am__dirstamp) cli/$(am__dirstamp): @$(MKDIR_P) cli @: > cli/$(am__dirstamp) cli/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) cli/$(DEPDIR) @: > cli/$(DEPDIR)/$(am__dirstamp) +cli/bomtool-getopt_long.$(OBJEXT): cli/$(am__dirstamp) \ + cli/$(DEPDIR)/$(am__dirstamp) + +bomtool$(EXEEXT): $(bomtool_OBJECTS) $(bomtool_DEPENDENCIES) $(EXTRA_bomtool_DEPENDENCIES) + @rm -f bomtool$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bomtool_OBJECTS) $(bomtool_LDADD) $(LIBS) cli/pkgconf-main.$(OBJEXT): cli/$(am__dirstamp) \ cli/$(DEPDIR)/$(am__dirstamp) cli/pkgconf-getopt_long.$(OBJEXT): cli/$(am__dirstamp) \ @@ -760,15 +799,18 @@ mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f cli/*.$(OBJEXT) + -rm -f cli/bomtool/*.$(OBJEXT) -rm -f libpkgconf/*.$(OBJEXT) -rm -f libpkgconf/*.lo distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@cli/$(DEPDIR)/bomtool-getopt_long.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cli/$(DEPDIR)/pkgconf-getopt_long.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cli/$(DEPDIR)/pkgconf-main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@cli/$(DEPDIR)/pkgconf-renderer-msvc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@cli/bomtool/$(DEPDIR)/bomtool-main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libpkgconf/$(DEPDIR)/argvsplit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libpkgconf/$(DEPDIR)/audit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@libpkgconf/$(DEPDIR)/bsdstubs.Plo@am__quote@ # am--include-marker @@ -814,6 +856,34 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +cli/bomtool/bomtool-main.o: cli/bomtool/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bomtool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cli/bomtool/bomtool-main.o -MD -MP -MF cli/bomtool/$(DEPDIR)/bomtool-main.Tpo -c -o cli/bomtool/bomtool-main.o `test -f 'cli/bomtool/main.c' || echo '$(srcdir)/'`cli/bomtool/main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cli/bomtool/$(DEPDIR)/bomtool-main.Tpo cli/bomtool/$(DEPDIR)/bomtool-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cli/bomtool/main.c' object='cli/bomtool/bomtool-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bomtool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cli/bomtool/bomtool-main.o `test -f 'cli/bomtool/main.c' || echo '$(srcdir)/'`cli/bomtool/main.c + +cli/bomtool/bomtool-main.obj: cli/bomtool/main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bomtool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cli/bomtool/bomtool-main.obj -MD -MP -MF cli/bomtool/$(DEPDIR)/bomtool-main.Tpo -c -o cli/bomtool/bomtool-main.obj `if test -f 'cli/bomtool/main.c'; then $(CYGPATH_W) 'cli/bomtool/main.c'; else $(CYGPATH_W) '$(srcdir)/cli/bomtool/main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cli/bomtool/$(DEPDIR)/bomtool-main.Tpo cli/bomtool/$(DEPDIR)/bomtool-main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cli/bomtool/main.c' object='cli/bomtool/bomtool-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bomtool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cli/bomtool/bomtool-main.obj `if test -f 'cli/bomtool/main.c'; then $(CYGPATH_W) 'cli/bomtool/main.c'; else $(CYGPATH_W) '$(srcdir)/cli/bomtool/main.c'; fi` + +cli/bomtool-getopt_long.o: cli/getopt_long.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bomtool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cli/bomtool-getopt_long.o -MD -MP -MF cli/$(DEPDIR)/bomtool-getopt_long.Tpo -c -o cli/bomtool-getopt_long.o `test -f 'cli/getopt_long.c' || echo '$(srcdir)/'`cli/getopt_long.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cli/$(DEPDIR)/bomtool-getopt_long.Tpo cli/$(DEPDIR)/bomtool-getopt_long.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cli/getopt_long.c' object='cli/bomtool-getopt_long.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bomtool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cli/bomtool-getopt_long.o `test -f 'cli/getopt_long.c' || echo '$(srcdir)/'`cli/getopt_long.c + +cli/bomtool-getopt_long.obj: cli/getopt_long.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bomtool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cli/bomtool-getopt_long.obj -MD -MP -MF cli/$(DEPDIR)/bomtool-getopt_long.Tpo -c -o cli/bomtool-getopt_long.obj `if test -f 'cli/getopt_long.c'; then $(CYGPATH_W) 'cli/getopt_long.c'; else $(CYGPATH_W) '$(srcdir)/cli/getopt_long.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cli/$(DEPDIR)/bomtool-getopt_long.Tpo cli/$(DEPDIR)/bomtool-getopt_long.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cli/getopt_long.c' object='cli/bomtool-getopt_long.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bomtool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cli/bomtool-getopt_long.obj `if test -f 'cli/getopt_long.c'; then $(CYGPATH_W) 'cli/getopt_long.c'; else $(CYGPATH_W) '$(srcdir)/cli/getopt_long.c'; fi` + cli/pkgconf-main.o: cli/main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pkgconf_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cli/pkgconf-main.o -MD -MP -MF cli/$(DEPDIR)/pkgconf-main.Tpo -c -o cli/pkgconf-main.o `test -f 'cli/main.c' || echo '$(srcdir)/'`cli/main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cli/$(DEPDIR)/pkgconf-main.Tpo cli/$(DEPDIR)/pkgconf-main.Po @@ -1140,7 +1210,6 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -1351,6 +1420,8 @@ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f cli/$(DEPDIR)/$(am__dirstamp) -rm -f cli/$(am__dirstamp) + -rm -f cli/bomtool/$(DEPDIR)/$(am__dirstamp) + -rm -f cli/bomtool/$(am__dirstamp) -rm -f libpkgconf/$(DEPDIR)/$(am__dirstamp) -rm -f libpkgconf/$(am__dirstamp) @@ -1364,9 +1435,11 @@ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f cli/$(DEPDIR)/pkgconf-getopt_long.Po + -rm -f cli/$(DEPDIR)/bomtool-getopt_long.Po + -rm -f cli/$(DEPDIR)/pkgconf-getopt_long.Po -rm -f cli/$(DEPDIR)/pkgconf-main.Po -rm -f cli/$(DEPDIR)/pkgconf-renderer-msvc.Po + -rm -f cli/bomtool/$(DEPDIR)/bomtool-main.Po -rm -f libpkgconf/$(DEPDIR)/argvsplit.Plo -rm -f libpkgconf/$(DEPDIR)/audit.Plo -rm -f libpkgconf/$(DEPDIR)/bsdstubs.Plo @@ -1429,9 +1502,11 @@ maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -f cli/$(DEPDIR)/pkgconf-getopt_long.Po + -rm -f cli/$(DEPDIR)/bomtool-getopt_long.Po + -rm -f cli/$(DEPDIR)/pkgconf-getopt_long.Po -rm -f cli/$(DEPDIR)/pkgconf-main.Po -rm -f cli/$(DEPDIR)/pkgconf-renderer-msvc.Po + -rm -f cli/bomtool/$(DEPDIR)/bomtool-main.Po -rm -f libpkgconf/$(DEPDIR)/argvsplit.Plo -rm -f libpkgconf/$(DEPDIR)/audit.Plo -rm -f libpkgconf/$(DEPDIR)/bsdstubs.Plo
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/NEWS -> _service:tar_scm:pkgconf-1.9.5.tar.xz/NEWS
Changed
@@ -1,6 +1,111 @@ Changes from previous version of pkgconf ======================================== +Changes from 1.9.4 to 1.9.5: +---------------------------- + +* Fix incorrect assumptions involving the use of ctype(3) functions. + Patch by Taylor R Campbell. + +* Fix detection of provided functions on autoconf. + Patches by Harmen Stoppels. + +* Fix deletion of tests/meson.build by the autoconf build system. + Patch by h30032433. + +* Fix quoting rules in argvsplit.c. + Patch by huyubiao. + +* Update libpkgconf documentation and documentation building scripts. + Patches by Andrew Shadura. + +* Enforce maximum package count correctly for --modversion. + +Changes from 1.9.3 to 1.9.4: +---------------------------- + +* Fix a buffer overflow vulnerability involving very large variable expansions. + CVE-2023-24056 + +* Fix a bunch of minor regressions with the solver. + +* Create separate solutions for `--cflags` and `--libs` when `--static` is not + used. + +* Remove final trailing whitespace in pkgconf_fragment_render_buf(). + +* Revert broken pkg.m4 change involving querying module versions in + PKG_CHECK_MODULES. + +* Fix handling of tildes in version strings. + +* Various C99 formatting string fixes involving SIZE_FMT_SPECIFIER. + +Changes from 1.9.2 to 1.9.3: +---------------------------- + +* Fix a bunch of minor code issues pointed out using Clang static analyzer. + +* New API: pkgconf_solution_free(), which frees a compiled solution graph. + +* Fix behavior when overriding global variables with `--define-variable`. + +Changes from 1.9.1 to 1.9.2: +---------------------------- + +* Do not try to break dependency cycles across dependency lists. This causes + the solved graph to sometimes miss required dependency nodes because the + solver detected an incorrect dependency cycle. + +* New API: pkgconf_queue_solve(), which replaces pkgconf_queue_apply(). + pkgconf_queue_apply is now deprecated and should not be used in new code. + +Changes from 1.9.0 to 1.9.1: +---------------------------- + +* Skip graph flattening and traversal for query types which only make sense + for a single pkg-config module. + + The old solver walked these graphs with --maximum-traverse-depth=1 in + these cases, but this is no longer helpful because the graph is flattened + by the new solver. + +Changes from 1.8.0 to 1.9.0: +---------------------------- + +* pkgconf 1.9.0 is the first testing release in the pkgconf 2.0 development + series. While it is believed to be suitable for production, there may be + bugs due to the overall redesign of the solver and other initiatives. + Additionally, a future release of pkgconf plans will have additional ABI + breaks for the libpkgconf library before the pkgconf 2.0 release is cut. + +* There is now a new solver that is designed to provide higher performance + with complicated graphs, which works by flattening the dependency graph + into a smaller set of dependencies. This graph can then be evaluated + instead of the original dependency graph without having to visit every + edge in the graph. + + NOTE: This solver, while providing significant performance improvements, + does so, at the cost of changed behavior for some edge cases (such as + circular dependencies). + +* Bug fixes: + - Resolved several memory leaks with edge cases when using libpkgconf + directly. + - pkgconf CLI now consistently frees libpkgconf resources under all + circumstances. + - SYSROOT rules are no longer applied to `-uninstalled` packages by + default. Use `PKG_CONFIG_PKGCONF1_SYSROOT_RULES` for legacy behavior. + +* A new `--license` selector has been added to the pkgconf CLI. This uses + SPDX expressions which can be set as the `License` field in `.pc` files. + See the `pc(5)` manpage for more information. + +* The canonical location for pkgconf maintenance going forward is + <https://gitea.treehouse.systems/ariadne/pkgconf>. This is presently + mirrored to GitHub for user convenience, but that mirroring will + be terminated at some point (due to GitHub Copilot). + Changes from 1.7.4 to 1.8.0: ----------------------------
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/README.md -> _service:tar_scm:pkgconf-1.9.5.tar.xz/README.md
Changed
@@ -3,9 +3,9 @@ `pkgconf` is a program which helps to configure compiler and linker flags for development libraries. It is similar to pkg-config from freedesktop.org. -`libpkgconf` is a library which provides access to most of `pkgconf`'s functionality, to allow -other tooling such as compilers and IDEs to discover and use libraries configured by -pkgconf. +`libpkgconf` is a library which provides access to most of `pkgconf`'s functionality, +to allow other tooling such as compilers and IDEs to discover and use libraries +configured by pkgconf. ## using `pkgconf` with autotools @@ -41,7 +41,7 @@ As of the 1.1 series, pkgconf also fully implements support for `Provides` rules, while pkg-config does not. pkg-config only provides the `--print-provides` functionality as a stub. There are other intentional implementation differences in pkgconf's dependency -resolver verses pkg-config's dependency resolver in terms of completeness and correctness, +resolver versus pkg-config's dependency resolver in terms of completeness and correctness, such as, for example, how `Conflicts` rules are processed. ## linker flags optimization @@ -71,16 +71,25 @@ the pkg-config tutorialfd-tut, as most likely fixing them to follow the specified rules will solve the problem. -Additionally, **we do not consider pkgconf doing what you tell it to do, when pkg-config -fails to do so, to be a bug**. +Additionally, **we do not consider pkgconf doing what you tell it to do, in cases for +which pkg-config fails to do so, to be a bug**. If, for example, you use environment variables such as `PKG_CONFIG_SYSTEM_INCLUDE|LIBRARY_PATH` and then find yourself surprised that `pkgconf` is stripping `-I` and `-L` flags relating -to those paths, it's not a `pkgconf` problem -- `pkgconf` is doing exactly what you told +to those paths, it is not a `pkgconf` problem -- `pkgconf` is doing exactly what you told it to do. -We will reject bugs like this, and if you choose to violate our Code of Conduct(CODE_OF_CONDUCT.md) -by demanding we fix your non-bug, we will fix the problem by banning you from the repo instead. +We will reject bugs like this, and if someone insists on fixing such a non-bug, this +constitutes a violation of our Code of Conduct(CODE_OF_CONDUCT.md), which may be +addressed by banning from this repository. + +## debug output + +Please use only the stable interfaces to query pkg-config. Do not screen-scrape the +output from `--debug`: this is sent to `stderr` for a reason, it is not intended to be +scraped. The `--debug` output is **not** a stable interface, and should **never** be +depended on as a source of information. If you need a stable interface to query pkg-config +which is not covered, please get in touch. ## compiling `pkgconf` and `libpkgconf` on UNIX @@ -103,17 +112,16 @@ $ make $ sudo make install -## compiling `pkgconf` and `libpkgconf` with CMake (usually for Windows) +## compiling `pkgconf` and `libpkgconf` with Meson (usually for Windows) -pkgconf is compiled using CMake on Windows. In theory, you could also use CMake to build -on UNIX, but this is not recommended at this time as it pkgconf is typically built much earlier -than CMake. - $ mkdir build - $ cd build - $ cmake .. - $ make - $ sudo make install +pkgconf is compiled using Meson(https://mesonbuild.com) on Windows. In theory, you could also use +Meson to build on UNIX, but this is not recommended at this time as it pkgconf is typically built +much earlier than Meson. + + $ meson setup build -Dtests=disabled + $ meson compile -C build + $ meson install -C build There are a few defines such as SYSTEM_LIBDIR, PKGCONFIGDIR and SYSTEM_INCLUDEDIR. However, on Windows, the default PKGCONFIGDIR value is usually overridden at runtime based
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/aclocal.m4 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/aclocal.m4
Changed
@@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.3 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.)) -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if($1, 1.16.3, , +m4_if($1, 1.16.5, , AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl ) @@ -51,14 +51,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN(AM_SET_CURRENT_AUTOMAKE_VERSION, -AM_AUTOMAKE_VERSION(1.16.3)dnl +AM_AUTOMAKE_VERSION(1.16.5)dnl m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl _AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION))) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ Usually this means the macro was only invoked conditionally.) fi)) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,7 +332,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -400,7 +400,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -428,6 +428,10 @@ # release and drop the old call support. AC_DEFUN(AM_INIT_AUTOMAKE, AC_PREREQ(2.65)dnl +m4_ifdef(_$0_ALREADY_INIT, + m4_fatal($0 expanded multiple times +m4_defn(_$0_ALREADY_INIT)), + m4_define(_$0_ALREADY_INIT, m4_expansion_stack))dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow(^AM_A-Z+FLAGS$)dnl @@ -464,7 +468,7 @@ _AM_SET_OPTIONS($1)dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef(AC_PACKAGE_NAME, ok):m4_ifdef(AC_PACKAGE_VERSION, ok), + m4_ifset(AC_PACKAGE_NAME, ok):m4_ifset(AC_PACKAGE_VERSION, ok), ok:ok,, m4_fatal(AC_INIT should be called with package and version arguments))dnl AC_SUBST(PACKAGE, 'AC_PACKAGE_TARNAME')dnl @@ -516,6 +520,20 @@ m4_define(AC_PROG_OBJCXX, m4_defn(AC_PROG_OBJCXX)_AM_DEPENDENCIES(OBJCXX)))dnl ) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST(CTAGS) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST(ETAGS) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST(CSCOPE) + AC_REQUIRE(AM_SILENT_RULES)dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -597,7 +615,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME("$_am_arg")`/stamp-h$_am_stamp_count) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -618,7 +636,7 @@ fi AC_SUBST(install_sh)) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -639,7 +657,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -682,7 +700,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -716,7 +734,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -745,7 +763,7 @@ AC_DEFUN(_AM_IF_OPTION, m4_ifset(_AM_MANGLE_OPTION($1), $2, $3)) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -792,7 +810,7 @@ # For backward compatibility. AC_DEFUN_ONCE(AM_PROG_CC_C_O, AC_REQUIRE(AC_PROG_CC)) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -811,7 +829,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -892,7 +910,7 @@ rm -f conftest.file ) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -952,7 +970,7 @@ _AM_SUBST_NOTMAKE(AM_BACKSLASH)dnl ) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -980,7 +998,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST(INSTALL_STRIP_PROGRAM)) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -999,7 +1017,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it,
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/cli/bomtool
Added
+(directory)
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/cli/bomtool/main.c
Added
@@ -0,0 +1,365 @@ +/* + * bomtool/main.c + * main() routine, printer functions + * + * Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 + * pkgconf authors (see AUTHORS). + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * This software is provided 'as is' and without any warranty, express or + * implied. In no event shall the authors be liable for any damages arising + * from the use of this software. + */ + +#include "libpkgconf/config.h" +#include <libpkgconf/stdinc.h> +#include <libpkgconf/libpkgconf.h> +#include "getopt_long.h" + +#define PKG_VERSION (((uint64_t) 1) << 1) +#define PKG_ABOUT (((uint64_t) 1) << 2) +#define PKG_HELP (((uint64_t) 1) << 3) + +static const char *spdx_version = "SPDX-2.2"; +static const char *bom_license = "CC0-1.0"; +static const char *document_ref = "SPDXRef-DOCUMENT"; + +static pkgconf_client_t pkg_client; +static uint64_t want_flags; +static size_t maximum_package_count = 0; +static int maximum_traverse_depth = 2000; +FILE *error_msgout = NULL; + +static bool +error_handler(const char *msg, const pkgconf_client_t *client, void *data) +{ + (void) client; + (void) data; + fprintf(error_msgout, "%s", msg); + return true; +} + +static const char * +sbom_spdx_identity(pkgconf_pkg_t *pkg) +{ + static char bufPKGCONF_ITEM_SIZE; + + snprintf(buf, sizeof buf, "%sC64%s", pkg->id, pkg->version); + + return buf; +} + +static const char * +sbom_name(pkgconf_pkg_t *world) +{ + static char bufPKGCONF_BUFSIZE; + pkgconf_node_t *node; + + pkgconf_strlcpy(buf, "SBOM-SPDX", sizeof buf); + + PKGCONF_FOREACH_LIST_ENTRY(world->required.head, node) + { + pkgconf_dependency_t *dep = node->data; + pkgconf_pkg_t *match = dep->match; + + if (!dep->match) + continue; + + pkgconf_strlcat(buf, "-", sizeof buf); + pkgconf_strlcat(buf, sbom_spdx_identity(match), sizeof buf); + } + + return buf; +} + +static void +write_sbom_header(pkgconf_client_t *client, pkgconf_pkg_t *world) +{ + (void) client; + (void) world; + + printf("SPDXVersion: %s\n", spdx_version); + printf("DataLicense: %s\n", bom_license); + printf("SPDXID: %s\n", document_ref); + printf("DocumentName: %s\n", sbom_name(world)); + printf("DocumentNamespace: https://spdx.org/spdxdocs/bomtool-%s\n", PACKAGE_VERSION); + printf("Creator: Tool: bomtool %s\n", PACKAGE_VERSION); + + printf("\n\n"); +} + +static const char * +sbom_identity(pkgconf_pkg_t *pkg) +{ + static char bufPKGCONF_ITEM_SIZE; + + snprintf(buf, sizeof buf, "%s@%s", pkg->id, pkg->version); + + return buf; +} + +static void +write_sbom_package(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *unused) +{ + (void) client; + (void) unused; + + if (pkg->flags & PKGCONF_PKG_PROPF_VIRTUAL) + return; + + printf("##### Package: %s\n\n", sbom_identity(pkg)); + + printf("PackageName: %s\n", sbom_identity(pkg)); + printf("SPDXID: SPDXRef-Package-%s\n", sbom_spdx_identity(pkg)); + printf("PackageVersion: %s\n", pkg->version); + printf("PackageDownloadLocation: NOASSERTION\n"); + printf("PackageVerificationCode: NOASSERTION\n"); + + /* XXX: What about projects? */ + if (pkg->maintainer != NULL) + printf("PackageSupplier: Person: %s\n", pkg->maintainer); + + if (pkg->url != NULL) + printf("PackageHomePage: %s\n", pkg->url); + + printf("PackageLicenseDeclared: %s\n", pkg->license != NULL ? pkg->license : "NOASSERTION"); + + if (pkg->copyright != NULL) + printf("PackageCopyrightText: <text>%s</text>\n", pkg->copyright); + + if (pkg->description != NULL) + printf("PackageSummary: <text>%s</text>\n", pkg->description); + + printf("\n\n"); +} + +static void +write_sbom_relationships(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *unused) +{ + (void) client; + (void) unused; + + char baserefPKGCONF_ITEM_SIZE; + pkgconf_node_t *node; + + if (pkg->flags & PKGCONF_PKG_PROPF_VIRTUAL) + return; + + snprintf(baseref, sizeof baseref, "SPDXRef-Package-%sC64%s", pkg->id, pkg->version); + + PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node) + { + pkgconf_dependency_t *dep = node->data; + pkgconf_pkg_t *match = dep->match; + + if (!dep->match) + continue; + + printf("Relationship: %s DEPENDS_ON SPDXRef-Package-%s\n", baseref, sbom_spdx_identity(match)); + printf("Relationship: SPDXRef-Package-%s DEPENDENCY_OF %s\n", sbom_spdx_identity(match), baseref); + } + + PKGCONF_FOREACH_LIST_ENTRY(pkg->requires_private.head, node) + { + pkgconf_dependency_t *dep = node->data; + pkgconf_pkg_t *match = dep->match; + + if (!dep->match) + continue; + + printf("Relationship: %s DEPENDS_ON SPDXRef-Package-%s\n", baseref, sbom_spdx_identity(match)); + printf("Relationship: SPDXRef-Package-%s DEV_DEPENDENCY_OF %s\n", sbom_spdx_identity(match), baseref); + } + + if (pkg->required.head != NULL || pkg->requires_private.head != NULL) + printf("\n\n"); +} + +static bool +generate_sbom_from_world(pkgconf_client_t *client, pkgconf_pkg_t *world) +{ + int eflag; + pkgconf_node_t *node; + + write_sbom_header(client, world); + + eflag = pkgconf_pkg_traverse(client, world, write_sbom_package, NULL, maximum_traverse_depth, 0); + if (eflag != PKGCONF_PKG_ERRF_OK) + return false; + + eflag = pkgconf_pkg_traverse(client, world, write_sbom_relationships, NULL, maximum_traverse_depth, 0); + if (eflag != PKGCONF_PKG_ERRF_OK) + return false; + + PKGCONF_FOREACH_LIST_ENTRY(world->required.head, node) + { + pkgconf_dependency_t *dep = node->data; + pkgconf_pkg_t *match = dep->match; + + if (!dep->match) + continue; + + printf("Relationship: %s DESCRIBES SPDXRef-Package-%s\n", document_ref, sbom_spdx_identity(match)); + } + + return true; +} + +static int +version(void) +{ + printf("bomtool %s\n", PACKAGE_VERSION); + return EXIT_SUCCESS; +} + +static int +about(void) +{ + printf("bomtool (%s %s)\n", PACKAGE_NAME, PACKAGE_VERSION); + printf("Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021\n"); + printf(" pkgconf authors (see AUTHORS in documentation directory).\n\n"); + printf("Permission to use, copy, modify, and/or distribute this software for any\n"); + printf("purpose with or without fee is hereby granted, provided that the above\n"); + printf("copyright notice and this permission notice appear in all copies.\n\n"); + printf("This software is provided 'as is' and without any warranty, express or\n"); + printf("implied. In no event shall the authors be liable for any damages arising\n"); + printf("from the use of this software.\n\n"); + printf("Report bugs at <%s>.\n", PACKAGE_BUGREPORT); + return EXIT_SUCCESS; +} + +static int +usage(void) +{ + printf("usage: bomtool --flags modules\n"); + + printf("\nbasic options:\n\n"); + + printf(" --help this message\n"); + printf(" --about print bomtool version and license to stdout\n"); + printf(" --version print bomtool version to stdout\n"); + + return EXIT_SUCCESS; +} + +int +main(int argc, char *argv) +{ + int ret = EXIT_SUCCESS; + pkgconf_list_t pkgq = PKGCONF_LIST_INITIALIZER; + unsigned int want_client_flags = PKGCONF_PKG_PKGF_SEARCH_PRIVATE; + pkgconf_cross_personality_t *personality = pkgconf_cross_personality_default(); + pkgconf_pkg_t world = { + .id = "virtual:world", + .realname = "virtual world package", + .flags = PKGCONF_PKG_PROPF_STATIC | PKGCONF_PKG_PROPF_VIRTUAL, + }; + + error_msgout = stderr; + + struct pkg_option options = { + { "version", no_argument, &want_flags, PKG_VERSION, }, + { "about", no_argument, &want_flags, PKG_ABOUT, }, + { "help", no_argument, &want_flags, PKG_HELP, }, + { NULL, 0, NULL, 0 } + }; + + while ((ret = pkg_getopt_long_only(argc, argv, "", options, NULL)) != -1) + { + switch (ret) + { + case '?': + case ':': + return EXIT_FAILURE; + default: + break; + } + } + + pkgconf_client_init(&pkg_client, error_handler, NULL, personality); + + /* we have determined what features we want most likely. in some cases, we override later. */ + pkgconf_client_set_flags(&pkg_client, want_client_flags); + + /* at this point, want_client_flags should be set, so build the dir list */ + pkgconf_client_dir_list_build(&pkg_client, personality); + + if ((want_flags & PKG_ABOUT) == PKG_ABOUT) + return about(); + + if ((want_flags & PKG_VERSION) == PKG_VERSION) + return version(); + + if ((want_flags & PKG_HELP) == PKG_HELP) + return usage(); + + while (1) + { + const char *package = argvpkg_optind; + + if (package == NULL) + break; + + /* check if there is a limit to the number of packages allowed to be included, if so and we have hit + * the limit, stop adding packages to the queue. + */ + if (maximum_package_count > 0 && pkgq.length > maximum_package_count) + break; + + while (isspace((unsigned char)package0)) + package++; + + /* skip empty packages */ + if (package0 == '\0') { + pkg_optind++; + continue; + } + + if (argvpkg_optind + 1 == NULL || !PKGCONF_IS_OPERATOR_CHAR(*(argvpkg_optind + 1))) + { + pkgconf_queue_push(&pkgq, package); + pkg_optind++; + } + else + { + char packagebufPKGCONF_BUFSIZE; + + snprintf(packagebuf, sizeof packagebuf, "%s %s %s", package, argvpkg_optind + 1, argvpkg_optind + 2); + pkg_optind += 3; + + pkgconf_queue_push(&pkgq, packagebuf); + } + } + + if (pkgq.head == NULL) + { + fprintf(stderr, "Please specify at least one package name on the command line.\n"); + ret = EXIT_FAILURE; + goto out; + } + + ret = EXIT_SUCCESS; + + if (!pkgconf_queue_solve(&pkg_client, &pkgq, &world, maximum_traverse_depth)) + { + ret = EXIT_FAILURE; + goto out; + } + + if (!generate_sbom_from_world(&pkg_client, &world)) + { + ret = EXIT_FAILURE; + goto out; + } + +out: + pkgconf_solution_free(&pkg_client, &world); + pkgconf_queue_free(&pkgq); + pkgconf_cross_personality_deinit(personality); + pkgconf_client_deinit(&pkg_client); + + return ret; +}
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/cli/main.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/cli/main.c
Changed
@@ -70,6 +70,7 @@ #define PKG_INTERNAL_CFLAGS (((uint64_t) 1) << 42) #define PKG_DUMP_PERSONALITY (((uint64_t) 1) << 43) #define PKG_SHARED (((uint64_t) 1) << 44) +#define PKG_DUMP_LICENSE (((uint64_t) 1) << 45) static pkgconf_client_t pkg_client; static const pkgconf_fragment_render_ops_t *want_render_ops = NULL; @@ -85,7 +86,7 @@ FILE *logfile_out = NULL; static bool -error_handler(const char *msg, const pkgconf_client_t *client, const void *data) +error_handler(const char *msg, const pkgconf_client_t *client, void *data) { (void) client; (void) data; @@ -346,16 +347,6 @@ return true; } -static void -print_variable(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *variable) -{ - const char *var; - - var = pkgconf_tuple_find(client, &pkg->vars, variable); - if (var != NULL) - printf("%s", var); -} - static bool apply_variable(pkgconf_client_t *client, pkgconf_pkg_t *world, void *variable, int maxdepth) { @@ -366,11 +357,12 @@ { pkgconf_dependency_t *dep = iter->data; pkgconf_pkg_t *pkg = dep->match; + const char *var; - if (iter->prev != NULL) - printf(" "); + var = pkgconf_tuple_find(client, &pkg->vars, variable); - print_variable(client, pkg, variable); + if (var != NULL) + printf("%s%s", iter->prev != NULL ? " " : "", var); } printf("\n"); @@ -415,7 +407,8 @@ char workbufPKGCONF_ITEM_SIZE; for (it = want_env_prefix; *it != '\0'; it++) - if (!isalpha(*it) && !isdigit(*it)) + if (!isalpha((unsigned char)*it) && + !isdigit((unsigned char)*it)) return false; snprintf(workbuf, sizeof workbuf, "%s_CFLAGS", want_env_prefix); @@ -594,6 +587,32 @@ #endif static void +print_license(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *data) +{ + (void) client; + (void) data; + + if (pkg->flags & PKGCONF_PKG_PROPF_VIRTUAL) + return; + + /* NOASSERTION is the default when the license is unknown, per SPDX spec § 3.15 */ + printf("%s: %s\n", pkg->id, pkg->license != NULL ? pkg->license : "NOASSERTION"); +} + +static bool +apply_license(pkgconf_client_t *client, pkgconf_pkg_t *world, void *data, int maxdepth) +{ + int eflag; + + eflag = pkgconf_pkg_traverse(client, world, print_license, data, maxdepth, 0); + + if (eflag != PKGCONF_PKG_ERRF_OK) + return false; + + return true; +} + +static void version(void) { printf("%s\n", PACKAGE_VERSION); @@ -696,6 +715,7 @@ printf(" --path show the exact filenames for any matching .pc files\n"); printf(" --modversion print the specified module's version to stdout\n"); printf(" --internal-cflags do not filter 'internal' cflags from output\n"); + printf(" --license print the specified module's license to stdout if known\n"); printf("\nfiltering output:\n\n"); #ifndef PKGCONF_LITE @@ -801,8 +821,13 @@ char *logfile_arg = NULL; char *want_env_prefix = NULL; unsigned int want_client_flags = PKGCONF_PKG_PKGF_NONE; - pkgconf_cross_personality_t *personality; + pkgconf_cross_personality_t *personality = NULL; bool opened_error_msgout = false; + pkgconf_pkg_t world = { + .id = "virtual:world", + .realname = "virtual world package", + .flags = PKGCONF_PKG_PROPF_STATIC | PKGCONF_PKG_PROPF_VIRTUAL, + }; want_flags = 0; @@ -883,6 +908,7 @@ { "dump-personality", no_argument, &want_flags, PKG_DUMP_PERSONALITY }, { "personality", required_argument, NULL, 53 }, #endif + { "license", no_argument, &want_flags, PKG_DUMP_LICENSE }, { NULL, 0, NULL, 0 } }; @@ -894,12 +920,6 @@ } #endif -#ifndef PKGCONF_LITE - personality = deduce_personality(argv); -#else - personality = pkgconf_cross_personality_default(); -#endif - while ((ret = pkg_getopt_long_only(argc, argv, "", options, NULL)) != -1) { switch (ret) @@ -950,13 +970,21 @@ #endif case '?': case ':': - return EXIT_FAILURE; - break; + ret = EXIT_FAILURE; + goto out; default: break; } } + if (personality == NULL) { +#ifndef PKGCONF_LITE + personality = deduce_personality(argv); +#else + personality = pkgconf_cross_personality_default(); +#endif + } + pkgconf_path_copy_list(&personality->dir_list, &dir_list); pkgconf_path_free(&dir_list); @@ -1001,24 +1029,33 @@ if ((want_flags & PKG_ABOUT) == PKG_ABOUT) { about(); - return EXIT_SUCCESS; + + ret = EXIT_SUCCESS; + goto out; } if ((want_flags & PKG_VERSION) == PKG_VERSION) { version(); - return EXIT_SUCCESS; + + ret = EXIT_SUCCESS; + goto out; } if ((want_flags & PKG_HELP) == PKG_HELP) { usage(); - return EXIT_SUCCESS; + + ret = EXIT_SUCCESS; + goto out; } if (getenv("PKG_CONFIG_FDO_SYSROOT_RULES")) want_client_flags |= PKGCONF_PKG_PKGF_FDO_SYSROOT_RULES; + if (getenv("PKG_CONFIG_PKGCONF1_SYSROOT_RULES")) + want_client_flags |= PKGCONF_PKG_PKGF_PKGCONF1_SYSROOT_RULES; + if ((want_flags & PKG_SHORT_ERRORS) == PKG_SHORT_ERRORS) want_client_flags |= PKGCONF_PKG_PKGF_SIMPLIFY_ERRORS; @@ -1074,17 +1111,11 @@ if ((want_flags & PKG_INTERNAL_CFLAGS) == PKG_INTERNAL_CFLAGS) want_client_flags |= PKGCONF_PKG_PKGF_DONT_FILTER_INTERNAL_CFLAGS; -#ifdef XXX_NOTYET /* if these selectors are used, it means that we are inquiring about a single package. * so signal to libpkgconf that we do not want to use the dependency resolver for more than one level, * and also limit the SAT problem to a single package. - * - * i disabled this because too many upstream maintainers are still invoking pkg-config correctly to have - * the more sane behaviour as default. use --maximum-traverse-depth=1 or PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH - * environment variable to get the same results in meantime. */ - if ((want_flags & PKG_EXISTS) == 0 && - ((want_flags & PKG_REQUIRES) == PKG_REQUIRES || + if (((want_flags & PKG_REQUIRES) == PKG_REQUIRES || (want_flags & PKG_REQUIRES_PRIVATE) == PKG_REQUIRES_PRIVATE || (want_flags & PKG_PROVIDES) == PKG_PROVIDES || (want_flags & PKG_VARIABLES) == PKG_VARIABLES || @@ -1095,7 +1126,6 @@ maximum_package_count = 1; maximum_traverse_depth = 1; } -#endif if (getenv("PKG_CONFIG_ALLOW_SYSTEM_CFLAGS") != NULL) want_flags |= PKG_KEEP_SYSTEM_CFLAGS; @@ -1106,6 +1136,12 @@ if ((builddir = getenv("PKG_CONFIG_TOP_BUILD_DIR")) != NULL) pkgconf_client_set_buildroot_dir(&pkg_client, builddir); + if ((want_flags & PKG_REQUIRES_PRIVATE) == PKG_REQUIRES_PRIVATE || + (want_flags & PKG_CFLAGS)) + { + want_client_flags |= PKGCONF_PKG_PKGF_SEARCH_PRIVATE; + } + if ((sysroot_dir = getenv("PKG_CONFIG_SYSROOT_DIR")) != NULL) { const char *destdir; @@ -1128,21 +1164,25 @@ if (required_pkgconfig_version != NULL) { if (pkgconf_compare_version(PACKAGE_VERSION, required_pkgconfig_version) >= 0) - return EXIT_SUCCESS; + ret = EXIT_SUCCESS; + else + ret = EXIT_FAILURE; - return EXIT_FAILURE; + goto out; } if ((want_flags & PKG_LIST) == PKG_LIST) { pkgconf_scan_all(&pkg_client, NULL, print_list_entry); - return EXIT_SUCCESS; + ret = EXIT_SUCCESS; + goto out; } if ((want_flags & PKG_LIST_PACKAGE_NAMES) == PKG_LIST_PACKAGE_NAMES) { pkgconf_scan_all(&pkg_client, NULL, print_package_entry); - return EXIT_SUCCESS; + ret = EXIT_SUCCESS; + goto out; } if (logfile_arg == NULL) @@ -1156,7 +1196,7 @@ if (required_module_version != NULL) { - pkgconf_pkg_t *pkg; + pkgconf_pkg_t *pkg = NULL; pkgconf_node_t *node; pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER; @@ -1175,18 +1215,28 @@ { if (want_flags & PKG_PRINT_ERRORS) pkgconf_error(&pkg_client, "Package '%s' was not found\n", pkgiter->package); - return EXIT_FAILURE; + + ret = EXIT_FAILURE; + goto cleanup; } if (pkgconf_compare_version(pkg->version, required_module_version) >= 0) - return EXIT_SUCCESS; + { + ret = EXIT_SUCCESS; + goto cleanup; + } } - return EXIT_FAILURE; + ret = EXIT_FAILURE; +cleanup: + if (pkg != NULL) + pkgconf_pkg_unref(&pkg_client, pkg); + pkgconf_dependency_free(&deplist); + goto out; } else if (required_exact_module_version != NULL) { - pkgconf_pkg_t *pkg; + pkgconf_pkg_t *pkg = NULL; pkgconf_node_t *node; pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER; @@ -1205,18 +1255,28 @@ { if (want_flags & PKG_PRINT_ERRORS) pkgconf_error(&pkg_client, "Package '%s' was not found\n", pkgiter->package); - return EXIT_FAILURE; + + ret = EXIT_FAILURE; + goto cleanup2; } if (pkgconf_compare_version(pkg->version, required_exact_module_version) == 0) - return EXIT_SUCCESS; + { + ret = EXIT_SUCCESS; + goto cleanup2; + } } - return EXIT_FAILURE; + ret = EXIT_FAILURE; +cleanup2: + if (pkg != NULL) + pkgconf_pkg_unref(&pkg_client, pkg); + pkgconf_dependency_free(&deplist); + goto out; } else if (required_max_module_version != NULL) { - pkgconf_pkg_t *pkg; + pkgconf_pkg_t *pkg = NULL; pkgconf_node_t *node; pkgconf_list_t deplist = PKGCONF_LIST_INITIALIZER; @@ -1235,14 +1295,24 @@ { if (want_flags & PKG_PRINT_ERRORS) pkgconf_error(&pkg_client, "Package '%s' was not found\n", pkgiter->package); - return EXIT_FAILURE; + + ret = EXIT_FAILURE; + goto cleanup3; } if (pkgconf_compare_version(pkg->version, required_max_module_version) <= 0) - return EXIT_SUCCESS; + { + ret = EXIT_SUCCESS; + goto cleanup3; + } } - return EXIT_FAILURE; + ret = EXIT_FAILURE; +cleanup3: + if (pkg != NULL) + pkgconf_pkg_unref(&pkg_client, pkg); + pkgconf_dependency_free(&deplist); + goto out; } while (1) @@ -1255,10 +1325,10 @@ /* check if there is a limit to the number of packages allowed to be included, if so and we have hit * the limit, stop adding packages to the queue. */ - if (maximum_package_count > 0 && pkgq.length > maximum_package_count) + if (maximum_package_count > 0 && pkgq.length >= maximum_package_count) break; - while (isspace((unsigned int)package0)) + while (isspace((unsigned char)package0)) package++; /* skip empty packages */ @@ -1286,85 +1356,68 @@ if (pkgq.head == NULL) { fprintf(stderr, "Please specify at least one package name on the command line.\n"); - return EXIT_FAILURE; + ret = EXIT_FAILURE; + goto out; } ret = EXIT_SUCCESS; + if (!pkgconf_queue_solve(&pkg_client, &pkgq, &world, maximum_traverse_depth)) + { + ret = EXIT_FAILURE; + goto out; + } + #ifndef PKGCONF_LITE if ((want_flags & PKG_SIMULATE) == PKG_SIMULATE) { want_flags &= ~(PKG_CFLAGS|PKG_LIBS); pkgconf_client_set_flags(&pkg_client, want_client_flags | PKGCONF_PKG_PKGF_SKIP_ERRORS); - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_simulate, -1, NULL)) - { - ret = EXIT_FAILURE; - goto out; - } + apply_simulate(&pkg_client, &world, NULL, -1); } #endif - if (!pkgconf_queue_validate(&pkg_client, &pkgq, maximum_traverse_depth)) + if ((want_flags & PKG_VALIDATE) == PKG_VALIDATE) + goto out; + + if ((want_flags & PKG_DUMP_LICENSE) == PKG_DUMP_LICENSE) { - ret = EXIT_FAILURE; + apply_license(&pkg_client, &world, &ret, 2); goto out; } - if ((want_flags & PKG_VALIDATE) == PKG_VALIDATE) - return 0; - if ((want_flags & PKG_UNINSTALLED) == PKG_UNINSTALLED) { ret = EXIT_FAILURE; - pkgconf_queue_apply(&pkg_client, &pkgq, apply_uninstalled, maximum_traverse_depth, &ret); + apply_uninstalled(&pkg_client, &world, &ret, 2); goto out; } if (want_env_prefix != NULL) { - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_env, maximum_traverse_depth, want_env_prefix)) - { - ret = EXIT_FAILURE; - goto out; - } - + apply_env(&pkg_client, &world, want_env_prefix, 2); want_flags = 0; } if ((want_flags & PKG_PROVIDES) == PKG_PROVIDES) { want_flags &= ~(PKG_CFLAGS|PKG_LIBS); - - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_provides, maximum_traverse_depth, NULL)) - { - ret = EXIT_FAILURE; - goto out; - } + apply_provides(&pkg_client, &world, NULL, 2); } #ifndef PKGCONF_LITE if ((want_flags & PKG_DIGRAPH) == PKG_DIGRAPH) { want_flags &= ~(PKG_CFLAGS|PKG_LIBS); - - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_digraph, maximum_traverse_depth, NULL)) - { - ret = EXIT_FAILURE; - goto out; - } + apply_digraph(&pkg_client, &world, NULL, 2); } #endif if ((want_flags & PKG_MODVERSION) == PKG_MODVERSION) { want_flags &= ~(PKG_CFLAGS|PKG_LIBS); - - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_modversion, maximum_traverse_depth, NULL)) - { - ret = EXIT_FAILURE; - goto out; - } + apply_modversion(&pkg_client, &world, NULL, 2); } if ((want_flags & PKG_PATH) == PKG_PATH) @@ -1372,22 +1425,13 @@ want_flags &= ~(PKG_CFLAGS|PKG_LIBS); pkgconf_client_set_flags(&pkg_client, want_client_flags | PKGCONF_PKG_PKGF_SKIP_ROOT_VIRTUAL); - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_path, maximum_traverse_depth, NULL)) - { - ret = EXIT_FAILURE; - goto out; - } + apply_path(&pkg_client, &world, NULL, 2); } if ((want_flags & PKG_VARIABLES) == PKG_VARIABLES) { want_flags &= ~(PKG_CFLAGS|PKG_LIBS); - - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_variables, maximum_traverse_depth, NULL)) - { - ret = EXIT_FAILURE; - goto out; - } + apply_variables(&pkg_client, &world, NULL, 2); } if (want_variable) @@ -1395,68 +1439,56 @@ want_flags &= ~(PKG_CFLAGS|PKG_LIBS); pkgconf_client_set_flags(&pkg_client, want_client_flags | PKGCONF_PKG_PKGF_SKIP_ROOT_VIRTUAL); - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_variable, maximum_traverse_depth, want_variable)) - { - ret = EXIT_FAILURE; - goto out; - } + apply_variable(&pkg_client, &world, want_variable, 2); } if ((want_flags & PKG_REQUIRES) == PKG_REQUIRES) { want_flags &= ~(PKG_CFLAGS|PKG_LIBS); - - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_requires, maximum_traverse_depth, NULL)) - { - ret = EXIT_FAILURE; - goto out; - } + apply_requires(&pkg_client, &world, NULL, 2); } if ((want_flags & PKG_REQUIRES_PRIVATE) == PKG_REQUIRES_PRIVATE) { want_flags &= ~(PKG_CFLAGS|PKG_LIBS); - pkgconf_client_set_flags(&pkg_client, want_client_flags | PKGCONF_PKG_PKGF_SEARCH_PRIVATE); - - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_requires_private, maximum_traverse_depth, NULL)) - { - ret = EXIT_FAILURE; - goto out; - } - - pkgconf_client_set_flags(&pkg_client, want_client_flags); + apply_requires_private(&pkg_client, &world, NULL, 2); } if ((want_flags & PKG_CFLAGS)) { - pkgconf_client_set_flags(&pkg_client, want_client_flags | PKGCONF_PKG_PKGF_SEARCH_PRIVATE); - - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_cflags, maximum_traverse_depth, NULL)) - { - ret = EXIT_FAILURE; - goto out_println; - } - - pkgconf_client_set_flags(&pkg_client, want_client_flags); + apply_cflags(&pkg_client, &world, NULL, 2); } if ((want_flags & PKG_LIBS)) { - if (!pkgconf_queue_apply(&pkg_client, &pkgq, apply_libs, maximum_traverse_depth, NULL)) + if (want_flags & PKG_CFLAGS) + printf(" "); + + if (!(want_flags & PKG_STATIC)) { - ret = EXIT_FAILURE; - goto out_println; + pkgconf_client_set_flags(&pkg_client, pkg_client.flags & ~PKGCONF_PKG_PKGF_SEARCH_PRIVATE); + + /* redo the solution for the library set: free the solution itself, and any cached graph nodes */ + pkgconf_solution_free(&pkg_client, &world); + pkgconf_cache_free(&pkg_client); + + if (!pkgconf_queue_solve(&pkg_client, &pkgq, &world, maximum_traverse_depth)) + { + ret = EXIT_FAILURE; + goto out; + } } - } - pkgconf_queue_free(&pkgq); + apply_libs(&pkg_client, &world, NULL, 2); + } -out_println: if (want_flags & (PKG_CFLAGS|PKG_LIBS)) printf("\n"); out: + pkgconf_solution_free(&pkg_client, &world); + pkgconf_queue_free(&pkgq); pkgconf_cross_personality_deinit(personality); pkgconf_client_deinit(&pkg_client);
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/cli/renderer-msvc.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/cli/renderer-msvc.c
Changed
@@ -149,7 +149,6 @@ { cnt = pkgconf_strlcpy(bptr, ".lib", buf_remaining); bptr += cnt; - buf_remaining -= cnt; } if (escape)
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/compile -> _service:tar_scm:pkgconf-1.9.5.tar.xz/compile
Changed
@@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/config.guess -> _service:tar_scm:pkgconf-1.9.5.tar.xz/config.guess
Changed
@@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2015-01-01' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,7 +17,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. +# along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,11 +29,19 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to <config-patches@gnu.org>. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -39,7 +49,7 @@ Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +60,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,7 +94,8 @@ exit 1 fi -trap 'exit 1' 1 2 15 +# Just in case it came from the environment. +GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -96,66 +107,90 @@ # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include <stdarg.h> + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if "$LIBC" = unknown && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if "$LIBC" = unknown ; then + LIBC=gnu + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -167,22 +202,32 @@ # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv0-9\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in + # to ELF recently (or will in the future) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -197,45 +242,80 @@ os=netbsd ;; esac + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv0-9/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/-_.*/\./'` + release=`echo "$UNAME_RELEASE" | sed -e 's/-_.*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -249,163 +329,158 @@ # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^PVTX//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^PVTX//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:AamigaOoSs:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:MmorphOoSs:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.012*:*|arm:riscix:1.012*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + set_cc_for_build + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if "$CC_FOR_BUILD" != 'no_compiler_found' ; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -415,44 +490,44 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atariste:*MiNT:*:* | atariste:*mint:*:* | atariste:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atariste:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv) { @@ -461,95 +536,96 @@ #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv1); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv1); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv1); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv1); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv1); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv1); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\(0-9*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\(0-9*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if $UNAME_PROCESSOR = mc88100 || $UNAME_PROCESSOR = mc88110 + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx || \ - ${TARGET_BINARY_INTERFACE}x = x + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux${UNAME_RELEASE} + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux${UNAME_RELEASE} + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek430-90-9:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:12.1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if -x /usr/bin/oslevel ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include <sys/systemcfg.h> main() @@ -560,77 +636,77 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:4567) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if -x /usr/bin/lslpp ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/0-9*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/34??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/34??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/34678??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/^.*.0B*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/34?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/^.*.0B*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/34??) HP_ARCH=m68k ;; 9000/6780-90-9) - if -x /usr/bin/getconf ; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case $sc_cpu_version in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case $sc_kernel_bits in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if "${HP_ARCH}" = "" ; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include <stdlib.h> @@ -663,13 +739,13 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if ${HP_ARCH} = "hppa2.0w" + if test "$HP_ARCH" = hppa2.0w then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -680,23 +756,23 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/^.*.0B*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/^.*.0B*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include <unistd.h> int main () @@ -721,38 +797,38 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?79:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?79:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?79:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?79:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if -x /usr/sbin/sysversion ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -760,139 +836,148 @@ fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*A-Z90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\(A-Z90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.^.*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F3001:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case $UNAME_PROCESSOR in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case $UNAME_MACHINE in x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; - 34586:Windows_95:* | 34586:Windows_98:* | 34586:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,-/.*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,-/.*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^^/*/,,' | tr 'A-Z' 'a-z'``echo ${UNAME_RELEASE}|sed -e 's/-(.*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^^/*/,,' | tr ":upper:" ":lower:"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -902,172 +987,226 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu^a-z*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.01*:* | i*86:LynxOS:4.02*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:678*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1075,12 +1214,12 @@ *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1090,43 +1229,43 @@ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V5678*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3345??:*:4.0:3.0 | 334??A:*:4.0:3.0 | 334??,*:*:4.0:3.0 | 334??/*:*: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) @@ -1134,9 +1273,9 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/^ * ^ * \(0-90-9\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 334??:*:4.0:* | 334??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1145,248 +1284,441 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/^ * ^ * \(0-90-9\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.01*:* | PowerPC:LynxOS:4.02*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SMBES:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R34000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if -d /usr/nec ; then - echo mips-nec-sysv${UNAME_RELEASE} + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv${UNAME_RELEASE} + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if "$CC_FOR_BUILD" != 'no_compiler_found' ; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:0123456789*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" <<EOF +#ifdef _SEQUENT_ +#include <sys/types.h> +#include <sys/utsname.h> +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include <signal.h> +#if defined(_SIZE_T_) || defined(SIGLOST) +#include <sys/utsname.h> +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \(0-9*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include <sys/param.h> +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <<EOF + +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize +the system type. Please install a C compiler and try again. +EOF + ;; esac cat >&2 <<EOF -$0: unable to guess system type -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from +This script (version $timestamp), has failed to recognize the +operating system you are using. If your script is old, overwrite *all* +copies of config.guess and config.sub with the latest versions from: - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + https://git.savannah.gnu.org/cgit/config.git/plain/config.guess and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + https://git.savannah.gnu.org/cgit/config.git/plain/config.sub +EOF -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. +our_year=`echo $timestamp | sed 's,-.*,,'` +thisyear=`date +%Y` +# shellcheck disable=SC2003 +script_age=`expr "$thisyear" - "$our_year"` +if test "$script_age" -lt 3 ; then + cat >&2 <<EOF + +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1405,16 +1737,17 @@ /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'"
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/config.sub -> _service:tar_scm:pkgconf-1.9.5.tar.xz/config.sub
Changed
@@ -1,12 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2015-01-01' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2021-12-25' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -15,7 +17,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. +# along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +35,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,15 +52,21 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 OPTION CPU-MFR-OPSYS - $0 OPTION ALIAS +Usage: $0 OPTION CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -68,7 +76,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -90,12 +98,12 @@ - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -111,1228 +119,1186 @@ exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-^-*$//'` - if $basic_machine != $1 - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <<EOF +$1 +EOF +IFS=$saved_IFS -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun234* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c123* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.4-9*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v4-9*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos +# Separate into logical components for further validation +case $1 in + *-*-*-*-*) + echo Invalid configuration \`"$1"\': more than four components >&2 + exit 1 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun234* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c123* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint0-9*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh45000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev4-8 | alphaev56 | alphaev678 | alphapca567 \ - | alpha64 | alpha64ev4-8 | alpha64ev56 | alpha64ev678 | alpha64pca567 \ - | am33_2.0 \ - | arc | arceb \ - | arm | armble | armelb | armv2-8 | armv3-8lb | armv7arm \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.01 | hppa2.0 | hppa2.0nw | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh1234 | sh24a | sh24aeb | sh23e | sh34eb | sheb | shbe | shle | sh1234le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon3-9) - basic_machine=sparc-$basic_machine + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + op50n) + cpu=hppa1.1 + vendor=oki ;; - m88110 | m680123460 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op60c) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev4-8-* | alphaev56-* | alphaev678-* \ - | alpha64-* | alpha64ev4-8-* | alpha64ev56-* | alpha64ev678-* \ - | alphapca567-* | alpha64pca567-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c123* | c30-* | cjt90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f3001-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.01-* | hppa2.0-* | hppa2.0nw-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m6800123460-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh1234-* | sh24a-* | sh24aeb-* | sh23e-* | sh34eb-* | sheb-* | shbe-* \ - | shle-* | sh1234le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^^-*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^^-*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^^-*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^^-*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^^-*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + basic_os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + basic_os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 + cpu=m68k + vendor=motorola ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; hp3k90-90-9 | hp90-90-9) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k20-90-9 | hp9k310-9) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k32-90-9) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k60-90-9 | hp60-90-9) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k70-790-9 | hp70-790-9) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k780-9 | hp780-9) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8671 | hp8671 | hp9k8024 | hp8024 | hp9k8789 | hp8789 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k80-913679 | hp80-913679) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k80-90-9 | hp80-90-9) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) + cpu=mips + vendor=sgi + case $basic_os in + irix*) ;; *) - os=-irix4 + basic_os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon3-9-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^^-*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint0-9* | *MiNT | *MiNT0-9*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl + cpu=m68000 + vendor=convergent ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint0-9* | *MiNT | *MiNT0-9*) + cpu=m68k + vendor=atari + basic_os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) ;; - -ns2*) - os=-nextstep2 + ns2*) + basic_os=nextstep2 ;; *) - os=-nextstep3 + basic_os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh45000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + basic_os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^^-*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc + cpu=m68k + vendor=tti ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^^-*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^^-*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^^-*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^^-*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^^-*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm + cpu=pn + vendor=gould ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^^-*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^^-*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^^-*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^^-*-//'` + power) + cpu=power + vendor=ibm ;; ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff + cpu=i386 + vendor=ibm ;; rm4600) - basic_machine=mips-siemens + cpu=mips + vendor=siemens ;; rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm + cpu=romp + vendor=ibm ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} ;; - sb1) - basic_machine=mipsisa64sb1-unknown + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown + tower | tower-32) + cpu=m68k + vendor=ncr ;; - sde) - basic_machine=mipsisa32-sde - os=-elf + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - sei) - basic_machine=mips-sei - os=-seiux + w65) + cpu=w65 + vendor=wdc ;; - sequent) - basic_machine=i386-sequent + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf ;; - sh) - basic_machine=sh-hitachi - os=-hms + none) + cpu=none + vendor=none ;; - sh5el) - basic_machine=sh5le-unknown + leon|leon3-9) + cpu=sparc + vendor=$basic_machine ;; - sh64) - basic_machine=sh64-unknown + leon-*|leon3-9-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <<EOF +$basic_machine +EOF + IFS=$saved_IFS ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + cpu=$basic_machine + vendor=pc ;; - spur) - basic_machine=spur-unknown + # These rules are duplicated from below for sake of the special case above; + # i.e. things that normalized to x86 arches should also default to "pc" + pc98) + cpu=i386 + vendor=pc ;; - st2000) - basic_machine=m68k-tandem + x64 | amd64) + cpu=x86_64 + vendor=pc ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 + # Recognize the basic CPU types without company name. + *) + cpu=$basic_machine + vendor=unknown ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^^-*-//'` +esac + +unset -v basic_machine + +# Decode basic machines in the full and proper CPU-Company form. +case $cpu-$vendor in + # Here we handle the default manufacturer of certain CPU types in canonical form. It is in + # some cases the only manufacturer, in others, it is the most popular. + craynv-unknown) + vendor=cray + basic_os=${basic_os:-unicosmp} ;; - sun2) - basic_machine=m68000-sun + c90-unknown | c90-cray) + vendor=cray + basic_os=${Basic_os:-unicos} ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 + fx80-unknown) + vendor=alliant ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 + romp-unknown) + vendor=ibm ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 + mmix-unknown) + vendor=knuth ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 + microblaze-unknown | microblazeel-unknown) + vendor=xilinx ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 + rs6000-unknown) + vendor=ibm ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 + vax-unknown) + vendor=dec ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 + pdp11-unknown) + vendor=dec ;; - sun3 | sun3-*) - basic_machine=m68k-sun + we32k-unknown) + vendor=att ;; - sun4) - basic_machine=sparc-sun + cydra-unknown) + vendor=cydrome ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun + i370-ibm*) + vendor=ibm ;; - sv1) - basic_machine=sv1-cray - os=-unicos + orion-unknown) + vendor=highlevel ;; - symmetry) - basic_machine=i386-sequent - os=-dynix + xps-unknown | xps100-unknown) + cpu=xps100 + vendor=honeywell ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos + + # Here we normalize CPU types with a missing or matching vendor + armh-unknown | armh-alt) + cpu=armv7l + vendor=alt + basic_os=${basic_os:-linux-gnueabihf} ;; - t90) - basic_machine=t90-cray - os=-unicos + dpx20-unknown | dpx20-bull) + cpu=rs6000 + vendor=bull + basic_os=${basic_os:-bosx} ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu + + # Here we normalize CPU types irrespective of the vendor + amd64-*) + cpu=x86_64 ;; - tx39) - basic_machine=mipstx39-unknown + blackfin-*) + cpu=bfin + basic_os=linux ;; - tx39el) - basic_machine=mipstx39el-unknown + c54x-*) + cpu=tic54x ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 + c55x-*) + cpu=tic55x ;; - tower | tower-32) - basic_machine=m68k-ncr + c6x-*) + cpu=tic6x ;; - tpf) - basic_machine=s390x-ibm - os=-tpf + e500v12-*) + cpu=powerpc + basic_os=${basic_os}"spe" ;; - udi29k) - basic_machine=a29k-amd - os=-udi + mips3*-*) + cpu=mips64 ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 + ms1-*) + cpu=mt ;; - v810 | necv810) - basic_machine=v810-nec - os=-none + m68knommu-*) + cpu=m68k + basic_os=linux ;; - vaxv) - basic_machine=vax-dec - os=-sysv + m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) + cpu=s12z ;; - vms) - basic_machine=vax-dec - os=-vms + openrisc-*) + cpu=or32 ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu + parisc-*) + cpu=hppa + basic_os=linux ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + cpu=i586 ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks + pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + cpu=i686 ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + cpu=i686 ;; - w65*) - basic_machine=w65-wdc - os=-none + pentium4-*) + cpu=i786 ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf + pc98-*) + cpu=i386 ;; - xbox) - basic_machine=i686-pc - os=-mingw32 + ppc-* | ppcbe-*) + cpu=powerpc ;; - xps | xps100) - basic_machine=xps100-honeywell + ppcle-* | powerpclittle-*) + cpu=powerpcle ;; - xscale-* | xscaleebl-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ppc64-*) + cpu=powerpc64 ;; - ymp) - basic_machine=ymp-cray - os=-unicos + ppc64le-* | powerpc64little-*) + cpu=powerpc64le ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim + sb1-*) + cpu=mipsisa64sb1 ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim + sb1el-*) + cpu=mipsisa64sb1el ;; - none) - basic_machine=none-none - os=-none + sh5elb-*) + cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond + spur-*) + cpu=spur ;; - op50n) - basic_machine=hppa1.1-oki + strongarm-* | thumb-*) + cpu=arm ;; - op60c) - basic_machine=hppa1.1-oki + tx39-*) + cpu=mipstx39 ;; - romp) - basic_machine=romp-ibm + tx39el-*) + cpu=mipstx39el ;; - mmix) - basic_machine=mmix-knuth + x64-*) + cpu=x86_64 ;; - rs6000) - basic_machine=rs6000-ibm + xscale-* | xscaleebl-*) + cpu=`echo "$cpu" | sed 's/^xscale/arm/'` ;; - vax) - basic_machine=vax-dec + arm64-* | aarch64le-*) + cpu=aarch64 ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown + + # Recognize the canonical CPU Types that limit and/or modify the + # company names they are paired with. + cr16-*) + basic_os=${basic_os:-elf} ;; - pdp11) - basic_machine=pdp11-dec + crisv32-* | etraxfs*-*) + cpu=crisv32 + vendor=axis ;; - we32k) - basic_machine=we32k-att + cris-* | etrax*-*) + cpu=cris + vendor=axis ;; - sh1234 | sh24a | sh24aeb | sh34eb | sh1234le | sh23ele) - basic_machine=sh-unknown + crx-*) + basic_os=${basic_os:-elf} ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun + neo-tandem) + cpu=neo + vendor=tandem ;; - cydra) - basic_machine=cydra-cydrome + nse-tandem) + cpu=nse + vendor=tandem ;; - orion) - basic_machine=orion-highlevel + nsr-tandem) + cpu=nsr + vendor=tandem ;; - orion105) - basic_machine=clipper-highlevel + nsv-tandem) + cpu=nsv + vendor=tandem ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple + nsx-tandem) + cpu=nsx + vendor=tandem ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple + mipsallegrexel-sony) + cpu=mipsallegrexel + vendor=sony ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. + tile*-*) + basic_os=${basic_os:-linux-gnu} ;; + *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev4-8 | alphaev56 | alphaev678 \ + | alpha64 | alpha64ev4-8 | alpha64ev56 | alpha64ev678 \ + | alphapca567 | alpha64pca567 \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb | arc32 | arc64 \ + | arm | armlbe | armelb | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c123* | c30 | cjt90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f3001 | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.01 | hppa2.0 | hppa2.0nw | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m6800123460 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r3 | mipsisa32r3el \ + | mipsisa32r5 | mipsisa32r5el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r3 | mipsisa64r3el \ + | mipsisa64r5 | mipsisa64r5el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh1234 | sh24a | sh24aelb | sh23e | shelb | shlbe \ + | sh1234elb | sh12345lbe | sh23ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1340,200 +1306,215 @@ # Decode manufacturer-specific aliases for certain operating systems. -if x"$os" != x"" +if test x$basic_os != x then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <<EOF +$basic_os +EOF + IFS=$saved_IFS + ;; + # Default OS when just kernel was specified + nto*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto|qnx|'` + ;; + linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|linux|gnu|'` + ;; + *) + kernel= + os=$basic_os + ;; +esac + +# Now, normalize the OS (knowing we just have one component, it's not a kernel, +# etc.) case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` + bluegene*) + os=cnk ;; - -solaris) - os=-solaris2 + solaris1 | solaris1.*) + os=`echo "$os" | sed -e 's|solaris1|sunos4|'` ;; - -svr4*) - os=-sysv4 + solaris) + os=solaris2 ;; - -unixware*) - os=-sysv4.2uw + unixware*) + os=sysv4.2uw ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos34*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac + # Some version numbers need modification + chorusos*) + os=chorusos ;; - -nto-qnx*) + isc) + os=isc2.2 ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` + sco6) + os=sco5v6 ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + sco5) + os=sco3.2v5 ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + sco4) + os=sco3.2v4 ;; - -linux-dietlibc) - os=-linux-dietlibc + sco3.2.4-9*) + os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'` ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` + sco*v* | scout) + # Don't match below ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + sco*) + os=sco3.2v2 ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + psos*) + os=psos ;; - -opened*) - os=-openedition + qnx*) + os=qnx ;; - -os400*) - os=-os400 + hiux*) + os=hiuxwe2 ;; - -wince*) - os=-wince + lynx*178) + os=lynxos178 ;; - -osfrose*) - os=-osfrose + lynx*5) + os=lynxos5 ;; - -osf*) - os=-osf + lynxos*) + # don't get caught up in next wildcard ;; - -utek*) - os=-bsd + lynx*) + os=lynxos ;; - -dynix*) - os=-bsd + mac0-9*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -acis*) - os=-aos + opened*) + os=openedition ;; - -atheos*) - os=-atheos + os400*) + os=os400 ;; - -syllable*) - os=-syllable + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -386bsd) - os=-bsd + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -ctix* | -uts*) - os=-sysv + wince*) + os=wince ;; - -nova*) - os=-rtmk-nova + utek*) + os=bsd ;; - -ns2 ) - os=-nextstep2 + dynix*) + os=bsd ;; - -nsk*) - os=-nsk + acis*) + os=aos ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` + atheos*) + os=atheos ;; - -sinix*) - os=-sysv4 + syllable*) + os=syllable ;; - -tpf*) - os=-tpf + 386bsd) + os=bsd ;; - -triton*) - os=-sysv3 + ctix* | uts*) + os=sysv ;; - -oss*) - os=-sysv3 + nova*) + os=rtmk-nova ;; - -svr4) - os=-sysv4 + ns2) + os=nextstep2 ;; - -svr3) - os=-sysv3 + # Preserve the version number of sinix5. + sinix5.*) + os=`echo "$os" | sed -e 's|sinix|sysv|'` ;; - -sysvr4) - os=-sysv4 + sinix*) + os=sysv4 ;; - # This must come after -sysvr4. - -sysv*) + tpf*) + os=tpf ;; - -ose*) - os=-ose + triton*) + os=sysv3 ;; - -es1800*) - os=-ose + oss*) + os=sysv3 ;; - -xenix) - os=-xenix + svr4*) + os=sysv4 ;; - -*mint | -mint0-9* | -*MiNT | -MiNT0-9*) - os=-mint + svr3) + os=sysv3 ;; - -aros*) - os=-aros + sysvr4) + os=sysv4 ;; - -zvmoe) - os=-zvmoe + ose*) + os=ose ;; - -dicos*) - os=-dicos + *mint | mint0-9* | *MiNT | MiNT0-9*) + os=mint ;; - -nacl*) + dicos*) + os=dicos ;; - -none) + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $cpu in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/^-*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1546,261 +1527,363 @@ # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; - *-be) - os=-beos + pru-*) + os=elf ;; - *-haiku) - os=-haiku + *-be) + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; - *-next ) - os=-nextstep + *-next) + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f3001-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos34* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v4-9* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - -os400*) + s390-* | s390x-*) vendor=ibm ;; - -ptx*) + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint0-9* | -*MiNT | -MiNT0-9*) + *-*mint | *-mint0-9* | *-*MiNT | *-MiNT0-9*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'"
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/configure -> _service:tar_scm:pkgconf-1.9.5.tar.xz/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for pkgconf 1.8.0. +# Generated by GNU Autoconf 2.71 for pkgconf 1.9.5. # # Report bugs to <https://github.com/pkgconf/pkgconf/issues/new>. # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='pkgconf' PACKAGE_TARNAME='pkgconf' -PACKAGE_VERSION='1.8.0' -PACKAGE_STRING='pkgconf 1.8.0' +PACKAGE_VERSION='1.9.5' +PACKAGE_STRING='pkgconf 1.9.5' PACKAGE_BUGREPORT='https://github.com/pkgconf/pkgconf/issues/new' PACKAGE_URL='' @@ -680,6 +680,7 @@ AR DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN @@ -702,6 +703,9 @@ AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -1358,7 +1362,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures pkgconf 1.8.0 to adapt to many kinds of systems. +\`configure' configures pkgconf 1.9.5 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1429,7 +1433,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pkgconf 1.8.0:";; + short | recursive ) echo "Configuration of pkgconf 1.9.5:";; esac cat <<\_ACEOF @@ -1549,7 +1553,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pkgconf configure 1.8.0 +pkgconf configure 1.9.5 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1602,6 +1606,91 @@ } # ac_fn_c_try_compile +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -1711,39 +1800,6 @@ } # ac_fn_c_check_func -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -printf %s "checking for $2... " >&6; } -if eval test \${$3+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - eval "$3=yes" -else $as_nop - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -eval ac_res=\$$3 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -printf "%s\n" "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -1805,7 +1861,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pkgconf $as_me 1.8.0, which was +It was created by pkgconf $as_me 1.9.5, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3817,24 +3873,113 @@ ac_config_headers="$ac_config_headers libpkgconf/config.h" -ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" -if test "x$ac_cv_func_strlcpy" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} then : - printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" -if test "x$ac_cv_func_strlcat" = xyes +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" then : - printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h -fi -ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" -if test "x$ac_cv_func_strndup" = xyes +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +#include <limits.h> +#include <stdarg.h> +#include <stddef.h> +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x then : - printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac +ac_fn_check_decl "$LINENO" "strlcpy" "ac_cv_have_decl_strlcpy" "#include <string.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strlcpy" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_STRLCPY $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "strlcat" "ac_cv_have_decl_strlcat" "#include <string.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strlcat" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 fi +printf "%s\n" "#define HAVE_DECL_STRLCAT $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "#include <string.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_strndup" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_STRNDUP $ac_have_decl" >>confdefs.h ac_header= ac_cache= for ac_item in $ac_header_c_list @@ -3865,6 +4010,15 @@ printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi +ac_fn_check_decl "$LINENO" "reallocarray" "ac_cv_have_decl_reallocarray" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_reallocarray" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_REALLOCARRAY $ac_have_decl" >>confdefs.h + ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" if test "x$ac_cv_header_sys_stat_h" = xyes then : @@ -4445,7 +4599,7 @@ # Define the identity of the package. PACKAGE='pkgconf' - VERSION='1.8.0' + VERSION='1.9.5' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -4620,6 +4774,20 @@ fi +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -4712,8 +4880,8 @@ -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' @@ -5341,13 +5509,13 @@ mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5485,7 +5653,7 @@ fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -5589,7 +5757,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5632,7 +5800,7 @@ sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.* //'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.* //'` else lt_cv_sys_max_cmd_len=32768 fi @@ -5838,6 +6006,114 @@ if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + +if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -5980,7 +6256,7 @@ bsdi45*) lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -6014,14 +6290,14 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i3-986 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -6035,7 +6311,7 @@ ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s0-90-90-9|ELF-0-90-9) shared object file - IA64' @@ -6082,7 +6358,7 @@ newos6*) lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -6455,13 +6731,29 @@ fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + @@ -6878,7 +7170,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -6896,20 +7188,20 @@ # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -6933,7 +7225,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -6951,9 +7243,9 @@ " s1~prfx {split(s1,t,\"@\"); print f,t1,substr(t1,length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($symcode$symcode*\) *$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.* \($symcode$symcode*\) *$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -7156,7 +7448,7 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -7281,7 +7573,7 @@ ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -7302,7 +7594,7 @@ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -7314,7 +7606,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -7340,7 +7632,7 @@ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -7348,7 +7640,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -7356,7 +7648,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -7380,14 +7672,14 @@ ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -7495,7 +7787,7 @@ ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -8278,8 +8570,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF @@ -8306,17 +8598,12 @@ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin91*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.012,.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.012,*|,*powerpc*-darwin5-8*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -8675,8 +8962,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -9188,7 +9475,7 @@ lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ 1-7.* | *Sun*Fortran*\ 8.0-3*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -9611,15 +9898,15 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -9671,7 +9958,7 @@ whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ 01.* | *\ 2.0-9.* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -9783,6 +10070,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix3-9*) @@ -9797,7 +10085,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -9840,7 +10128,7 @@ compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -9852,7 +10140,7 @@ if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -9868,7 +10156,7 @@ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -10000,7 +10288,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10271,12 +10559,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10317,7 +10605,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -10358,8 +10646,8 @@ output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10393,7 +10681,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -10644,6 +10932,7 @@ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -11336,7 +11625,7 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; @@ -11346,14 +11635,14 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -11372,7 +11661,7 @@ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\(a-zA-Z\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\(a-zA-Z\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -11409,7 +11698,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -11442,7 +11731,7 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -12595,30 +12884,41 @@ old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - fi - ;; - *) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - ;; - esac + ;; + esac + fi fi @@ -14423,7 +14723,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pkgconf $as_me 1.8.0, which was +This file was extended by pkgconf $as_me 1.9.5, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14491,7 +14791,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -pkgconf config.status 1.8.0 +pkgconf config.status 1.9.5 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -14654,6 +14954,7 @@ lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' @@ -14662,6 +14963,7 @@ DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -14782,6 +15084,7 @@ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ @@ -14790,7 +15093,6 @@ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -15737,6 +16039,9 @@ # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # An object symbol dumper. OBJDUMP=$lt_OBJDUMP @@ -15761,8 +16066,11 @@ # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -16138,7 +16446,7 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" ||
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/configure.ac -> _service:tar_scm:pkgconf-1.9.5.tar.xz/configure.ac
Changed
@@ -11,8 +11,8 @@ dnl implied. In no event shall the authors be liable for any damages arising dnl from the use of this software. -AC_PREREQ(2.68) -AC_INIT(pkgconf, 1.8.0, https://github.com/pkgconf/pkgconf/issues/new) +AC_PREREQ(2.71) +AC_INIT(pkgconf,1.9.5,https://github.com/pkgconf/pkgconf/issues/new) AC_CONFIG_SRCDIR(cli/main.c) AC_CONFIG_MACRO_DIR(m4) AX_CHECK_COMPILE_FLAG(-Wall, CFLAGS="$CFLAGS -Wall") @@ -22,7 +22,8 @@ AX_CHECK_COMPILE_FLAG(-std=c99, CFLAGS="$CFLAGS -std=c99") ) AC_CONFIG_HEADERS(libpkgconf/config.h) -AC_CHECK_FUNCS(strlcpy strlcat strndup) +AC_CHECK_DECLS(strlcpy, strlcat, strndup, , , #include <string.h>) +AC_CHECK_DECLS(reallocarray) AC_CHECK_HEADERS(sys/stat.h) AM_INIT_AUTOMAKE(foreign dist-xz subdir-objects) AM_SILENT_RULES(yes) @@ -30,26 +31,26 @@ AC_SYS_LARGEFILE -AC_ARG_WITH(personality-dir,AC_HELP_STRING(--with-personality-dir,specify +AC_ARG_WITH(personality-dir,AS_HELP_STRING(--with-personality-dir,specify the place where cross-compile personality files will be found), PERSONALITY_PATH="$withval", PERSONALITY_PATH="${datadir}/pkgconfig/personality.d:${sysconfdir}/pkgconfig/personality.d") AC_SUBST(PERSONALITY_PATH) -AC_ARG_WITH(pkg-config-dir,AC_HELP_STRING(--with-pkg-config-dir,specify +AC_ARG_WITH(pkg-config-dir,AS_HELP_STRING(--with-pkg-config-dir,specify the place where pc files will be found),PKG_DEFAULT_PATH="$withval", PKG_DEFAULT_PATH="${libdir}/pkgconfig:${datadir}/pkgconfig") AC_SUBST(PKG_DEFAULT_PATH) -AC_ARG_WITH(system-libdir,AC_HELP_STRING(--with-system-libdir,specify the +AC_ARG_WITH(system-libdir,AS_HELP_STRING(--with-system-libdir,specify the system library directory (default LIBDIR)), SYSTEM_LIBDIR="$withval", SYSTEM_LIBDIR="${libdir}") AC_SUBST(SYSTEM_LIBDIR) -AC_ARG_WITH(system-includedir,AC_HELP_STRING(--with-system-includedir,specify the +AC_ARG_WITH(system-includedir,AS_HELP_STRING(--with-system-includedir,specify the system include directory (default INCLUDEDIR)), SYSTEM_INCLUDEDIR="$withval", SYSTEM_INCLUDEDIR="${includedir}")
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/depcomp -> _service:tar_scm:pkgconf-1.9.5.tar.xz/depcomp
Changed
@@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/extract.py -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/extract.py
Changed
@@ -70,21 +70,21 @@ while True: char = source_file.read(1) if not char: - if state is 3 or state is 4: + if state == 3 or state == 4: raise UnterminatedCommentError() - if state is 2: + if state == 2: # Was in single line comment. Create comment. comment = Comment(current_comment, line_counter, False) comments.append(comment) return comments - if state is 0: + if state == 0: # Waiting for comment start character or beginning of # string. if char == '/': state = 1 elif char == '"': state = 5 - elif state is 1: + elif state == 1: # Found comment start character, classify next character and # determine if single or multiline comment. if char == '/': @@ -94,7 +94,7 @@ state = 3 else: state = 0 - elif state is 2: + elif state == 2: # In single line comment, read characters until EOL. if char == '\n': comment = Comment(current_comment, line_counter, False) @@ -103,14 +103,14 @@ state = 0 else: current_comment += char - elif state is 3: + elif state == 3: # In multi-line comment, add characters until '*' # encountered. if char == '*': state = 4 else: current_comment += char - elif state is 4: + elif state == 4: # In multi-line comment with asterisk found. Determine if # comment is ending. if char == '/': @@ -125,13 +125,13 @@ if char != '*': current_comment += char state = 3 - elif state is 5: + elif state == 5: # In string literal, expect literal end or escape char. if char == '"': state = 0 elif char == '\\': state = 6 - elif state is 6: + elif state == 6: # In string literal, escaping current char. state = 5 if char == '\n':
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/libpkgconf-client.rst -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/libpkgconf-client.rst
Changed
@@ -9,21 +9,32 @@ Client objects are not thread safe, in other words, a client object should not be shared across thread boundaries. -.. c:function:: void pkgconf_client_init(pkgconf_client_t *client, pkgconf_error_handler_func_t error_handler) +.. c:function:: void pkgconf_client_dir_list_build(pkgconf_client_t *client) + + Bootstraps the package search paths. If the ``PKGCONF_PKG_PKGF_ENV_ONLY`` `flag` is set on the client, + then only the ``PKG_CONFIG_PATH`` environment variable will be used, otherwise both the + ``PKG_CONFIG_PATH`` and ``PKG_CONFIG_LIBDIR`` environment variables will be used. + + :param pkgconf_client_t* client: The pkgconf client object to bootstrap. + :return: nothing + +.. c:function:: void pkgconf_client_init(pkgconf_client_t *client, pkgconf_error_handler_func_t error_handler, void *error_handler_data, const pkgconf_cross_personality_t *personality) Initialise a pkgconf client object. :param pkgconf_client_t* client: The client to initialise. :param pkgconf_error_handler_func_t error_handler: An optional error handler to use for logging errors. :param void* error_handler_data: user data passed to optional error handler + :param pkgconf_cross_personality_t* personality: the cross-compile personality to use for defaults :return: nothing -.. c:function:: pkgconf_client_t* pkgconf_client_new(pkgconf_error_handler_func_t error_handler) +.. c:function:: pkgconf_client_t* pkgconf_client_new(pkgconf_error_handler_func_t error_handler, void *error_handler_data, const pkgconf_cross_personality_t *personality) Allocate and initialise a pkgconf client object. :param pkgconf_error_handler_func_t error_handler: An optional error handler to use for logging errors. :param void* error_handler_data: user data passed to optional error handler + :param pkgconf_cross_personality_t* personality: cross-compile personality to use :return: A pkgconf client object. :rtype: pkgconf_client_t* @@ -97,11 +108,14 @@ :return: true if the warn handler processed the message, else false. :rtype: bool -.. c:function:: bool pkgconf_trace(const pkgconf_client_t *client, const char *format, ...) +.. c:function:: bool pkgconf_trace(const pkgconf_client_t *client, const char *filename, size_t len, const char *funcname, const char *format, ...) Report a message to a client-registered trace handler. :param pkgconf_client_t* client: The pkgconf client object to report the trace message to. + :param char* filename: The file the function is in. + :param size_t lineno: The line number currently being executed. + :param char* funcname: The function name to use. :param char* format: A printf-style format string to use for formatting the trace message. :return: true if the trace handler processed the message, else false. :rtype: bool
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/libpkgconf-dependency.rst -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/libpkgconf-dependency.rst
Changed
@@ -14,6 +14,7 @@ :param char* package: The package `atom` to set on the dependency node. :param char* version: The package `version` to set on the dependency node. :param pkgconf_pkg_comparator_t compare: The comparison operator to set on the dependency node. + :param uint flags: Any flags to attach to the dependency node. :return: A dependency node. :rtype: pkgconf_dependency_t * @@ -25,6 +26,29 @@ :param pkgconf_dependency_t* tail: The dependency node to add to the tail of the dependency list. :return: nothing +.. c:function:: void pkgconf_dependency_free_one(pkgconf_dependency_t *dep) + + Frees a dependency node. + + :param pkgconf_dependency_t* dep: The dependency node to free. + :return: nothing + +.. c:function:: pkgconf_dependency_t *pkgconf_dependency_ref(pkgconf_client_t *owner, pkgconf_dependency_t *dep) + + Increases a dependency node's refcount. + + :param pkgconf_client_t* owner: The client object which owns the memory of this dependency node. + :param pkgconf_dependency_t* dep: The dependency to increase the refcount of. + :return: the dependency node on success, else NULL + +.. c:function:: void pkgconf_dependency_unref(pkgconf_client_t *owner, pkgconf_dependency_t *dep) + + Decreases a dependency node's refcount and frees it if necessary. + + :param pkgconf_client_t* owner: The client object which owns the memory of this dependency node. + :param pkgconf_dependency_t* dep: The dependency to decrease the refcount of. + :return: nothing + .. c:function:: void pkgconf_dependency_free(pkgconf_list_t *list) Release a dependency list and it's child dependency nodes. @@ -41,6 +65,7 @@ :param pkgconf_client_t* client: The client object that owns the package this dependency list belongs to. :param pkgconf_list_t* deplist_head: The dependency list to populate with dependency nodes. :param char* depends: The dependency data to parse. + :param uint flags: Any flags to attach to the dependency nodes. :return: nothing .. c:function:: void pkgconf_dependency_parse(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist, const char *depends) @@ -53,4 +78,13 @@ :param pkgconf_pkg_t* pkg: The package object that owns this dependency list. :param pkgconf_list_t* deplist: The dependency list to populate with dependency nodes. :param char* depends: The dependency data to parse. + :param uint flags: Any flags to attach to the dependency nodes. :return: nothing + +.. c:function:: pkgconf_dependency_t *pkgconf_dependency_copy(pkgconf_client_t *client, const pkgconf_dependency_t *dep) + + Copies a dependency node to a new one. + + :param pkgconf_client_t* client: The client object that will own this dependency. + :param pkgconf_dependency_t* dep: The dependency node to copy. + :return: a pointer to a new dependency node, else NULL
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/libpkgconf-fragment.rst -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/libpkgconf-fragment.rst
Changed
@@ -6,13 +6,14 @@ `fragment list` contains various `fragments` of text (such as ``-I /usr/include``) in a matter which is composable, mergeable and reorderable. -.. c:function:: void pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string) +.. c:function:: void pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string, unsigned int flags) Adds a `fragment` of text to a `fragment list`, possibly modifying the fragment if a sysroot is set. :param pkgconf_client_t* client: The pkgconf client being accessed. :param pkgconf_list_t* list: The fragment list. :param char* string: The string of text to add as a fragment to the fragment list. + :param uint flags: Parsing-related flags for the package. :return: nothing .. c:function:: bool pkgconf_fragment_has_system_dir(const pkgconf_client_t *client, const pkgconf_fragment_t *frag) @@ -110,5 +111,6 @@ :param pkgconf_client_t* client: The pkgconf client being accessed. :param pkgconf_list_t* list: The `fragment list` to add the fragment entries to. :param pkgconf_list_t* vars: A list of variables to use for variable substitution. + :param uint flags: Any parsing flags to be aware of. :param char* value: The string to parse into fragments. :return: true on success, false on parse error
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/libpkgconf-path.rst -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/libpkgconf-path.rst
Changed
@@ -25,12 +25,12 @@ :return: number of path nodes added to the path list :rtype: size_t -.. c:function:: size_t pkgconf_path_build_from_environ(const char *environ, const char *fallback, pkgconf_list_t *dirlist) +.. c:function:: size_t pkgconf_path_build_from_environ(const char *envvarname, const char *fallback, pkgconf_list_t *dirlist) Adds the paths specified in an environment variable to a path list. If the environment variable is not set, an optional default set of paths is added. - :param char* environ: The environment variable to look up. + :param char* envvarname: The environment variable to look up. :param char* fallback: The fallback paths to use if the environment variable is not set. :param pkgconf_list_t* dirlist: The path list to add the path nodes to. :param bool filter: Whether to perform duplicate filtering. @@ -46,6 +46,14 @@ :return: true if the path list has a matching prefix, otherwise false :rtype: bool +.. c:function:: void pkgconf_path_copy_list(pkgconf_list_t *dst, const pkgconf_list_t *src) + + Copies a path list to another path list. + + :param pkgconf_list_t* dst: The path list to copy to. + :param pkgconf_list_t* src: The path list to copy from. + :return: nothing + .. c:function:: void pkgconf_path_free(pkgconf_list_t *dirlist) Releases any path nodes attached to the given path list.
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/libpkgconf-pkg.rst -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/libpkgconf-pkg.rst
Changed
@@ -5,22 +5,14 @@ The `pkg` module provides dependency resolution services and the overall `.pc` file parsing routines. -.. c:function:: void pkgconf_pkg_dir_list_build(pkgconf_client_t *client) - - Bootstraps the package search paths. If the ``PKGCONF_PKG_PKGF_ENV_ONLY`` `flag` is set on the client, - then only the ``PKG_CONFIG_PATH`` environment variable will be used, otherwise both the - ``PKG_CONFIG_PATH`` and ``PKG_CONFIG_LIBDIR`` environment variables will be used. - - :param pkgconf_client_t* client: The pkgconf client object to bootstrap. - :return: nothing - -.. c:function:: pkgconf_pkg_t *pkgconf_pkg_new_from_file(const pkgconf_client_t *client, const char *filename, FILE *f) +.. c:function:: pkgconf_pkg_t *pkgconf_pkg_new_from_file(const pkgconf_client_t *client, const char *filename, FILE *f, unsigned int flags) Parse a .pc file into a pkgconf_pkg_t object structure. :param pkgconf_client_t* client: The pkgconf client object to use for dependency resolution. :param char* filename: The filename of the package file (including full path). :param FILE* f: The file object to read from. + :param uint flags: The flags to use when parsing. :returns: A ``pkgconf_pkg_t`` object which contains the package data. :rtype: pkgconf_pkg_t * @@ -76,7 +68,7 @@ :param char* a: The first version to compare in the pair. :param char* b: The second version to compare in the pair. - :return: -1 if the first version is greater, 0 if both versions are equal, 1 if the second version is greater. + :return: -1 if the first version is less than, 0 if both versions are equal, 1 if the second version is less than. :rtype: int .. c:function:: pkgconf_pkg_t *pkgconf_builtin_pkg_get(const char *name) @@ -126,7 +118,7 @@ :return: On success, ``PKGCONF_PKG_ERRF_OK`` (0), else an error code. :rtype: unsigned int -.. c:function:: unsigned int pkgconf_pkg_traverse(pkgconf_client_t *client, pkgconf_pkg_t *root, pkgconf_pkg_traverse_func_t func, void *data, int maxdepth) +.. c:function:: unsigned int pkgconf_pkg_traverse(pkgconf_client_t *client, pkgconf_pkg_t *root, pkgconf_pkg_traverse_func_t func, void *data, int maxdepth, unsigned int skip_flags) Walk and resolve the dependency graph up to `maxdepth` levels. @@ -135,6 +127,7 @@ :param pkgconf_pkg_traverse_func_t func: A traversal function to call for each resolved node in the dependency graph. :param void* data: An opaque pointer to data to be passed to the traversal function. :param int maxdepth: The maximum depth to walk the dependency graph for. -1 means infinite recursion. + :param uint skip_flags: Skip over dependency nodes containing the specified flags. A setting of 0 skips no dependency nodes. :return: ``PKGCONF_PKG_ERRF_OK`` on success, else an error code. :rtype: unsigned int
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/libpkgconf-queue.rst -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/libpkgconf-queue.rst
Changed
@@ -33,11 +33,32 @@ :param pkgconf_list_t* list: The dependency resolution queue to release. :return: nothing +.. c:function:: void pkgconf_solution_free(pkgconf_client_t *client, pkgconf_pkg_t *world, int maxdepth) + + Removes references to package nodes contained in a solution. + + :param pkgconf_client_t* client: The pkgconf client object to use for dependency resolution. + :param pkgconf_pkg_t* world: The root for the generated dependency graph. Should have PKGCONF_PKG_PROPF_VIRTUAL flag. + :returns: nothing + +.. c:function:: bool pkgconf_queue_solve(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_pkg_t *world, int maxdepth) + + Solves and flattens the dependency graph for the supplied dependency list. + + :param pkgconf_client_t* client: The pkgconf client object to use for dependency resolution. + :param pkgconf_list_t* list: The list of dependency requests to consider. + :param pkgconf_pkg_t* world: The root for the generated dependency graph, provided by the caller. Should have PKGCONF_PKG_PROPF_VIRTUAL flag. + :param int maxdepth: The maximum allowed depth for the dependency resolver. A depth of -1 means unlimited. + :returns: true if the dependency resolver found a solution, otherwise false. + :rtype: bool + .. c:function:: void pkgconf_queue_apply(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_queue_apply_func_t func, int maxdepth, void *data) Attempt to compile a dependency resolution queue into a dependency resolution problem, then attempt to solve the problem and feed the solution to a callback function if a complete dependency graph is found. + This function should not be used in new code. Use pkgconf_queue_solve instead. + :param pkgconf_client_t* client: The pkgconf client object to use for dependency resolution. :param pkgconf_list_t* list: The list of dependency requests to consider. :param pkgconf_queue_apply_func_t func: The callback function to call if a solution is found by the dependency resolver.
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/libpkgconf-tuple.rst -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/libpkgconf-tuple.rst
Changed
@@ -64,13 +64,14 @@ :return: the value of the variable or ``NULL`` :rtype: char * -.. c:function:: char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value) +.. c:function:: char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value, unsigned int flags) Parse an expression for variable substitution. :param pkgconf_client_t* client: The pkgconf client object to access. :param pkgconf_list_t* list: The variable list to search for variables (along side the global variable list). :param char* value: The ``key=value`` string to parse. + :param uint flags: Any flags to consider while parsing. :return: the variable data with any variables substituted :rtype: char *
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/doc/libpkgconf.rst -> _service:tar_scm:pkgconf-1.9.5.tar.xz/doc/libpkgconf.rst
Changed
@@ -11,6 +11,7 @@ libpkgconf-dependency libpkgconf-fragment libpkgconf-path + libpkgconf-personality libpkgconf-pkg libpkgconf-queue libpkgconf-tuple
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/install-sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/install-sh
Changed
@@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-12-25.23; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -271,15 +295,18 @@ fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else dstdir=`dirname "$dst"` @@ -288,27 +315,16 @@ fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *23672367) mkdir_umask=$umask;; - .*00202 | .0202 | .02) mkdir_umask=22;; - - *0-7) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -318,43 +334,49 @@ fi posix_mkdir=false - case $umask in - *1235670-70-7) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -365,7 +387,7 @@ then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -394,7 +416,7 @@ prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -427,14 +449,25 @@ else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -460,6 +493,13 @@ then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -474,9 +514,9 @@ # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 @@ -493,9 +533,9 @@ done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End:
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf.pc.in -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf.pc.in
Changed
@@ -5,7 +5,8 @@ Name: libpkgconf Description: a library for accessing and manipulating development framework configuration -URL: http://github.com/pkgconf/pkgconf +URL: https://gitea.treehouse.systems/ariadne/pkgconf +License: ISC Version: @PACKAGE_VERSION@ CFlags: -I${includedir}/pkgconf Libs: -L${libdir} -lpkgconf
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/argvsplit.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/argvsplit.c
Changed
@@ -80,7 +80,7 @@ if (escaped) { /* POSIX: only \CHAR is special inside a double quote if CHAR is {$, `, ", \, newline}. */ - if (quote == '\"') + if (quote == '"') { if (!(*src_iter == '$' || *src_iter == '`' || *src_iter == '"' || *src_iter == '\\')) *dst_iter++ = '\\'; @@ -88,7 +88,9 @@ *dst_iter++ = *src_iter; } else + { *dst_iter++ = *src_iter; + } escaped = false; } @@ -101,7 +103,7 @@ else *dst_iter++ = *src_iter; } - else if (isspace((unsigned int)*src_iter)) + else if (isspace((unsigned char)*src_iter)) { if ((*argv)argc_count != NULL) { @@ -118,11 +120,9 @@ } else switch(*src_iter) { -#ifndef _WIN32 case '\\': escaped = true; break; -#endif case '\"': case '\'':
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/bsdstubs.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/bsdstubs.c
Changed
@@ -20,11 +20,12 @@ #include <stdlib.h> #include <sys/types.h> #include <string.h> +#include <errno.h> #include <libpkgconf/bsdstubs.h> #include <libpkgconf/config.h> -#ifndef HAVE_STRLCPY +#if !HAVE_DECL_STRLCPY /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). @@ -57,7 +58,7 @@ } #endif -#ifndef HAVE_STRLCAT +#if !HAVE_DECL_STRLCAT /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters @@ -106,7 +107,7 @@ * from the use of this software. */ -#ifndef HAVE_STRNDUP +#if !HAVE_DECL_STRNDUP /* * Creates a memory buffer and copies at most 'len' characters to it. * If 'len' is less than the length of the source string, truncation occured. @@ -137,3 +138,23 @@ { return strndup(src, len); } + +#if !HAVE_DECL_REALLOCARRAY +void * +reallocarray(void *ptr, size_t m, size_t n) +{ + if (n && m > -1 / n) + { + errno = ENOMEM; + return 0; + } + + return realloc(ptr, m * n); +} +#endif + +void * +pkgconf_reallocarray(void *ptr, size_t m, size_t n) +{ + return reallocarray(ptr, m, n); +}
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/bsdstubs.h -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/bsdstubs.h
Changed
@@ -25,6 +25,7 @@ PKGCONF_API extern size_t pkgconf_strlcpy(char *dst, const char *src, size_t siz); PKGCONF_API extern size_t pkgconf_strlcat(char *dst, const char *src, size_t siz); PKGCONF_API extern char *pkgconf_strndup(const char *src, size_t len); +PKGCONF_API extern void *pkgconf_reallocarray(void *ptr, size_t m, size_t n); #ifdef __cplusplus }
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/cache.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/cache.c
Changed
@@ -16,6 +16,8 @@ #include <libpkgconf/stdinc.h> #include <libpkgconf/libpkgconf.h> +#include <assert.h> + /* * !doc * @@ -29,6 +31,46 @@ * be shared across threads. */ +static int +cache_member_cmp(const void *a, const void *b) +{ + const char *key = a; + const pkgconf_pkg_t *pkg = *(void **) b; + + return strcmp(key, pkg->id); +} + +static int +cache_member_sort_cmp(const void *a, const void *b) +{ + const pkgconf_pkg_t *pkgA = *(void **) a; + const pkgconf_pkg_t *pkgB = *(void **) b; + + if (pkgA == NULL) + return 1; + + if (pkgB == NULL) + return -1; + + return strcmp(pkgA->id, pkgB->id); +} + +static void +cache_dump(const pkgconf_client_t *client) +{ + size_t i; + + PKGCONF_TRACE(client, "dumping package cache contents"); + + for (i = 0; i < client->cache_count; i++) + { + const pkgconf_pkg_t *pkg = client->cache_tablei; + + PKGCONF_TRACE(client, SIZE_FMT_SPECIFIER": %p(%s)", + i, pkg, pkg == NULL ? "NULL" : pkg->id); + } +} + /* * !doc * @@ -46,17 +88,19 @@ pkgconf_pkg_t * pkgconf_cache_lookup(pkgconf_client_t *client, const char *id) { - pkgconf_node_t *node; + if (client->cache_table == NULL) + return NULL; - PKGCONF_FOREACH_LIST_ENTRY(client->pkg_cache.head, node) - { - pkgconf_pkg_t *pkg = node->data; + pkgconf_pkg_t **pkg; + + pkg = bsearch(id, client->cache_table, + client->cache_count, sizeof (void *), + cache_member_cmp); - if (!strcmp(pkg->id, id)) - { - PKGCONF_TRACE(client, "found: %s @%p", id, pkg); - return pkgconf_pkg_ref(client, pkg); - } + if (pkg != NULL) + { + PKGCONF_TRACE(client, "found: %s @%p", id, *pkg); + return pkgconf_pkg_ref(client, *pkg); } PKGCONF_TRACE(client, "miss: %s", id); @@ -82,12 +126,19 @@ return; pkgconf_pkg_ref(client, pkg); - pkgconf_node_insert(&pkg->cache_iter, pkg, &client->pkg_cache); PKGCONF_TRACE(client, "added @%p to cache", pkg); /* mark package as cached */ pkg->flags |= PKGCONF_PKG_PROPF_CACHED; + + ++client->cache_count; + client->cache_table = pkgconf_reallocarray(client->cache_table, + client->cache_count, sizeof (void *)); + client->cache_tableclient->cache_count - 1 = pkg; + + qsort(client->cache_table, client->cache_count, + sizeof(void *), cache_member_sort_cmp); } /* @@ -104,6 +155,9 @@ void pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg) { + if (client->cache_table == NULL) + return; + if (pkg == NULL) return; @@ -112,7 +166,41 @@ PKGCONF_TRACE(client, "removed @%p from cache", pkg); - pkgconf_node_delete(&pkg->cache_iter, &client->pkg_cache); + pkgconf_pkg_t **slot; + + slot = bsearch(pkg->id, client->cache_table, + client->cache_count, sizeof (void *), + cache_member_cmp); + + if (slot == NULL) + return; + + (*slot)->flags &= ~PKGCONF_PKG_PROPF_CACHED; + pkgconf_pkg_unref(client, *slot); + *slot = NULL; + + qsort(client->cache_table, client->cache_count, + sizeof(void *), cache_member_sort_cmp); + + if (client->cache_tableclient->cache_count - 1 != NULL) + { + PKGCONF_TRACE(client, "end of cache table refers to %p, not NULL", + client->cache_tableclient->cache_count - 1); + cache_dump(client); + abort(); + } + + client->cache_count--; + if (client->cache_count > 0) + { + client->cache_table = pkgconf_reallocarray(client->cache_table, + client->cache_count, sizeof(void *)); + } + else + { + free(client->cache_table); + client->cache_table = NULL; + } } /* @@ -129,15 +217,15 @@ void pkgconf_cache_free(pkgconf_client_t *client) { - pkgconf_node_t *iter, *iter2; + if (client->cache_table == NULL) + return; - PKGCONF_FOREACH_LIST_ENTRY_SAFE(client->pkg_cache.head, iter2, iter) - { - pkgconf_pkg_t *pkg = iter->data; - pkgconf_pkg_unref(client, pkg); - } + while (client->cache_count > 0) + pkgconf_cache_remove(client, client->cache_table0); - memset(&client->pkg_cache, 0, sizeof client->pkg_cache); + free(client->cache_table); + client->cache_table = NULL; + client->cache_count = 0; PKGCONF_TRACE(client, "cleared package cache"); }
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/client.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/client.c
Changed
@@ -98,6 +98,8 @@ client->error_handler_data = error_handler_data; client->error_handler = error_handler; client->auditf = NULL; + client->cache_table = NULL; + client->cache_count = 0; #ifndef PKGCONF_LITE if (client->trace_handler == NULL) @@ -401,7 +403,7 @@ * :rtype: bool */ bool -pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, const void *data) +pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, void *data) { (void) msg; (void) client;
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/config.h.in -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/config.h.in
Changed
@@ -1,5 +1,21 @@ /* libpkgconf/config.h.in. Generated from configure.ac by autoheader. */ +/* Define to 1 if you have the declaration of `reallocarray', and to 0 if you + don't. */ +#undef HAVE_DECL_REALLOCARRAY + +/* Define to 1 if you have the declaration of `strlcat', and to 0 if you + don't. */ +#undef HAVE_DECL_STRLCAT + +/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you + don't. */ +#undef HAVE_DECL_STRLCPY + +/* Define to 1 if you have the declaration of `strndup', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNDUP + /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H @@ -21,15 +37,6 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H -/* Define to 1 if you have the `strlcat' function. */ -#undef HAVE_STRLCAT - -/* Define to 1 if you have the `strlcpy' function. */ -#undef HAVE_STRLCPY - -/* Define to 1 if you have the `strndup' function. */ -#undef HAVE_STRNDUP - /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/config.h.meson -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/config.h.meson
Changed
@@ -9,6 +9,21 @@ /* Define to 1 if you have the `strndup' function. */ #mesondefine HAVE_STRNDUP +/* Define to 1 if you have the `reallocarray' function. */ +#mesondefine HAVE_REALLOCARRAY + +/* Define to 1 if you have the `strlcat' function. */ +#mesondefine HAVE_DECL_STRLCAT + +/* Define to 1 if you have the `strlcpy' function. */ +#mesondefine HAVE_DECL_STRLCPY + +/* Define to 1 if you have the `strndup' function. */ +#mesondefine HAVE_DECL_STRNDUP + +/* Define to 1 if you have the `reallocarray' function. */ +#mesondefine HAVE_DECL_REALLOCARRAY + /* Name of package */ #mesondefine PACKAGE
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/dependency.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/dependency.c
Changed
@@ -73,7 +73,7 @@ } static inline pkgconf_dependency_t * -add_or_replace_dependency_node(const pkgconf_client_t *client, pkgconf_dependency_t *dep, pkgconf_list_t *list) +add_or_replace_dependency_node(pkgconf_client_t *client, pkgconf_dependency_t *dep, pkgconf_list_t *list) { char depbufPKGCONF_ITEM_SIZE; pkgconf_dependency_t *dep2 = find_colliding_dependency(dep, list); @@ -92,7 +92,7 @@ { PKGCONF_TRACE(client, "dropping dependency %s@%p because of collision", depbuf, dep); - free(dep); + pkgconf_dependency_unref(dep->owner, dep); return NULL; } else if (dep2->flags && dep->flags == 0) @@ -100,7 +100,7 @@ PKGCONF_TRACE(client, "dropping dependency %s@%p because of collision", depbuf2, dep2); pkgconf_node_delete(&dep2->iter, list); - free(dep2); + pkgconf_dependency_unref(dep2->owner, dep2); } else /* If both dependencies have equal strength, we keep both, because of situations like: @@ -113,13 +113,20 @@ } PKGCONF_TRACE(client, "added dependency %s to list @%p; flags=%x", dependency_to_str(dep, depbuf, sizeof depbuf), list, dep->flags); - pkgconf_node_insert_tail(&dep->iter, dep, list); - + pkgconf_node_insert_tail(&dep->iter, pkgconf_dependency_ref(dep->owner, dep), list); + + /* This dependency is intentionally unowned. + * + * Internally we have no use for the returned type, and usually just + * discard it. However, there is a publig pkgconf_dependency_add + * function, which references this return value before returning it, + * giving ownership at that point. + */ return dep; } static inline pkgconf_dependency_t * -pkgconf_dependency_addraw(const pkgconf_client_t *client, pkgconf_list_t *list, const char *package, size_t package_sz, const char *version, size_t version_sz, pkgconf_pkg_comparator_t compare, unsigned int flags) +pkgconf_dependency_addraw(pkgconf_client_t *client, pkgconf_list_t *list, const char *package, size_t package_sz, const char *version, size_t version_sz, pkgconf_pkg_comparator_t compare, unsigned int flags) { pkgconf_dependency_t *dep; @@ -131,6 +138,8 @@ dep->compare = compare; dep->flags = flags; + dep->owner = client; + dep->refcount = 0; return add_or_replace_dependency_node(client, dep, list); } @@ -152,12 +161,12 @@ * :rtype: pkgconf_dependency_t * */ pkgconf_dependency_t * -pkgconf_dependency_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare, unsigned int flags) +pkgconf_dependency_add(pkgconf_client_t *client, pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare, unsigned int flags) { - if (version != NULL) - return pkgconf_dependency_addraw(client, list, package, strlen(package), version, strlen(version), compare, flags); - - return pkgconf_dependency_addraw(client, list, package, strlen(package), NULL, 0, compare, flags); + pkgconf_dependency_t *dep; + dep = pkgconf_dependency_addraw(client, list, package, strlen(package), version, + version != NULL ? strlen(version) : 0, compare, flags); + return pkgconf_dependency_ref(dep->owner, dep); } /* @@ -180,6 +189,77 @@ /* * !doc * + * .. c:function:: void pkgconf_dependency_free_one(pkgconf_dependency_t *dep) + * + * Frees a dependency node. + * + * :param pkgconf_dependency_t* dep: The dependency node to free. + * :return: nothing + */ +void +pkgconf_dependency_free_one(pkgconf_dependency_t *dep) +{ + if (dep->match != NULL) + pkgconf_pkg_unref(dep->match->owner, dep->match); + + if (dep->package != NULL) + free(dep->package); + + if (dep->version != NULL) + free(dep->version); + + free(dep); +} + +/* + * !doc + * + * .. c:function:: pkgconf_dependency_t *pkgconf_dependency_ref(pkgconf_client_t *owner, pkgconf_dependency_t *dep) + * + * Increases a dependency node's refcount. + * + * :param pkgconf_client_t* owner: The client object which owns the memory of this dependency node. + * :param pkgconf_dependency_t* dep: The dependency to increase the refcount of. + * :return: the dependency node on success, else NULL + */ +pkgconf_dependency_t * +pkgconf_dependency_ref(pkgconf_client_t *client, pkgconf_dependency_t *dep) +{ + if (client != dep->owner) + return NULL; + + dep->refcount++; + PKGCONF_TRACE(client, "%s refcount@%p: %d", dep->package, dep, dep->refcount); + return dep; +} + +/* + * !doc + * + * .. c:function:: void pkgconf_dependency_unref(pkgconf_client_t *owner, pkgconf_dependency_t *dep) + * + * Decreases a dependency node's refcount and frees it if necessary. + * + * :param pkgconf_client_t* owner: The client object which owns the memory of this dependency node. + * :param pkgconf_dependency_t* dep: The dependency to decrease the refcount of. + * :return: nothing + */ +void +pkgconf_dependency_unref(pkgconf_client_t *client, pkgconf_dependency_t *dep) +{ + if (client != dep->owner) + return; + + --dep->refcount; + PKGCONF_TRACE(client, "%s refcount@%p: %d", dep->package, dep, dep->refcount); + + if (dep->refcount <= 0) + pkgconf_dependency_free_one(dep); +} + +/* + * !doc + * * .. c:function:: void pkgconf_dependency_free(pkgconf_list_t *list) * * Release a dependency list and it's child dependency nodes. @@ -196,17 +276,11 @@ { pkgconf_dependency_t *dep = node->data; - if (dep->match != NULL) - pkgconf_pkg_unref(NULL, dep->match); - - if (dep->package != NULL) - free(dep->package); - - if (dep->version != NULL) - free(dep->version); - - free(dep); + pkgconf_node_delete(&dep->iter, list); + pkgconf_dependency_unref(dep->owner, dep); } + + pkgconf_list_zero(list); } /* @@ -225,7 +299,7 @@ * :return: nothing */ void -pkgconf_dependency_parse_str(const pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags) +pkgconf_dependency_parse_str(pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags) { parse_state_t state = OUTSIDE_MODULE; pkgconf_pkg_comparator_t compare = PKGCONF_CMP_ANY; @@ -255,11 +329,11 @@ break; case INSIDE_MODULE_NAME: - if (isspace((unsigned int)*ptr)) + if (isspace((unsigned char)*ptr)) { const char *sptr = ptr; - while (*sptr && isspace((unsigned int)*sptr)) + while (*sptr && isspace((unsigned char)*sptr)) sptr++; if (*sptr == '\0') @@ -323,7 +397,7 @@ break; case AFTER_OPERATOR: - if (!isspace((unsigned int)*ptr)) + if (!isspace((unsigned char)*ptr)) { vstart = ptr; state = INSIDE_VERSION; @@ -371,10 +445,43 @@ * :return: nothing */ void -pkgconf_dependency_parse(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist, const char *depends, unsigned int flags) +pkgconf_dependency_parse(pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist, const char *depends, unsigned int flags) { - char *kvdepends = pkgconf_tuple_parse(client, &pkg->vars, depends); + char *kvdepends = pkgconf_tuple_parse(client, &pkg->vars, depends, pkg->flags); pkgconf_dependency_parse_str(client, deplist, kvdepends, flags); free(kvdepends); } + +/* + * !doc + * + * .. c:function:: pkgconf_dependency_t *pkgconf_dependency_copy(pkgconf_client_t *client, const pkgconf_dependency_t *dep) + * + * Copies a dependency node to a new one. + * + * :param pkgconf_client_t* client: The client object that will own this dependency. + * :param pkgconf_dependency_t* dep: The dependency node to copy. + * :return: a pointer to a new dependency node, else NULL + */ +pkgconf_dependency_t * +pkgconf_dependency_copy(pkgconf_client_t *client, const pkgconf_dependency_t *dep) +{ + pkgconf_dependency_t *new_dep; + + new_dep = calloc(sizeof(pkgconf_dependency_t), 1); + new_dep->package = strdup(dep->package); + + if (dep->version != NULL) + new_dep->version = strdup(dep->version); + + new_dep->compare = dep->compare; + new_dep->flags = dep->flags; + new_dep->owner = client; + new_dep->refcount = 0; + + if (dep->match != NULL) + new_dep->match = pkgconf_pkg_ref(client, dep->match); + + return pkgconf_dependency_ref(client, new_dep); +}
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/fragment.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/fragment.c
Changed
@@ -93,15 +93,18 @@ } static inline void -pkgconf_fragment_munge(const pkgconf_client_t *client, char *buf, size_t buflen, const char *source, const char *sysroot_dir) +pkgconf_fragment_munge(const pkgconf_client_t *client, char *buf, size_t buflen, const char *source, const char *sysroot_dir, unsigned int flags) { *buf = '\0'; - if (sysroot_dir == NULL) - sysroot_dir = pkgconf_tuple_find_global(client, "pc_sysrootdir"); + if (!(flags & PKGCONF_PKG_PROPF_UNINSTALLED) || (client->flags & PKGCONF_PKG_PKGF_PKGCONF1_SYSROOT_RULES)) + { + if (sysroot_dir == NULL) + sysroot_dir = pkgconf_tuple_find_global(client, "pc_sysrootdir"); - if (sysroot_dir != NULL && pkgconf_fragment_should_munge(source, sysroot_dir)) - pkgconf_strlcat(buf, sysroot_dir, buflen); + if (sysroot_dir != NULL && pkgconf_fragment_should_munge(source, sysroot_dir)) + pkgconf_strlcat(buf, sysroot_dir, buflen); + } pkgconf_strlcat(buf, source, buflen); @@ -110,27 +113,28 @@ } static inline char * -pkgconf_fragment_copy_munged(const pkgconf_client_t *client, const char *source) +pkgconf_fragment_copy_munged(const pkgconf_client_t *client, const char *source, unsigned int flags) { char mungebufPKGCONF_ITEM_SIZE; - pkgconf_fragment_munge(client, mungebuf, sizeof mungebuf, source, client->sysroot_dir); + pkgconf_fragment_munge(client, mungebuf, sizeof mungebuf, source, client->sysroot_dir, flags); return strdup(mungebuf); } /* * !doc * - * .. c:function:: void pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string) + * .. c:function:: void pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string, unsigned int flags) * * Adds a `fragment` of text to a `fragment list`, possibly modifying the fragment if a sysroot is set. * * :param pkgconf_client_t* client: The pkgconf client being accessed. * :param pkgconf_list_t* list: The fragment list. * :param char* string: The string of text to add as a fragment to the fragment list. + * :param uint flags: Parsing-related flags for the package. * :return: nothing */ void -pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string) +pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string, unsigned int flags) { pkgconf_fragment_t *frag; @@ -142,7 +146,7 @@ frag = calloc(sizeof(pkgconf_fragment_t), 1); frag->type = *(string + 1); - frag->data = pkgconf_fragment_copy_munged(client, string + 2); + frag->data = pkgconf_fragment_copy_munged(client, string + 2, flags); PKGCONF_TRACE(client, "added fragment {%c, '%s'} to list @%p", frag->type, frag->data, list); } @@ -156,12 +160,12 @@ pkgconf_fragment_t *parent = list->tail->data; /* only attempt to merge 'special' fragments together */ - if (!parent->type && pkgconf_fragment_is_unmergeable(parent->data)) + if (!parent->type && parent->data != NULL && pkgconf_fragment_is_unmergeable(parent->data)) { size_t len; char *newdata; - pkgconf_fragment_munge(client, mungebuf, sizeof mungebuf, string, NULL); + pkgconf_fragment_munge(client, mungebuf, sizeof mungebuf, string, NULL, flags); len = strlen(parent->data) + strlen(mungebuf) + 2; newdata = malloc(len); @@ -527,7 +531,8 @@ free(quoted); } - *bptr++ = ' '; + if (node->next != NULL) + *bptr++ = ' '; } *bptr = '\0'; @@ -663,15 +668,16 @@ * :param pkgconf_client_t* client: The pkgconf client being accessed. * :param pkgconf_list_t* list: The `fragment list` to add the fragment entries to. * :param pkgconf_list_t* vars: A list of variables to use for variable substitution. + * :param uint flags: Any parsing flags to be aware of. * :param char* value: The string to parse into fragments. * :return: true on success, false on parse error */ bool -pkgconf_fragment_parse(const pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_list_t *vars, const char *value) +pkgconf_fragment_parse(const pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_list_t *vars, const char *value, unsigned int flags) { int i, ret, argc; char **argv; - char *repstr = pkgconf_tuple_parse(client, vars, value); + char *repstr = pkgconf_tuple_parse(client, vars, value, flags); PKGCONF_TRACE(client, "post-subst: %s -> %s", value, repstr); @@ -685,6 +691,8 @@ for (i = 0; i < argc; i++) { + PKGCONF_TRACE(client, "processing %s", argvi); + if (argvi == NULL) { PKGCONF_TRACE(client, "parsed fragment string is inconsistent: argc = %d while argv%d == NULL", argc, i); @@ -693,7 +701,7 @@ return false; } - pkgconf_fragment_add(client, list, argvi); + pkgconf_fragment_add(client, list, argvi, flags); } pkgconf_argv_free(argv);
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/iter.h -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/iter.h
Changed
@@ -35,6 +35,14 @@ #define PKGCONF_LIST_INITIALIZER { NULL, NULL, 0 } static inline void +pkgconf_list_zero(pkgconf_list_t *list) +{ + list->head = NULL; + list->tail = NULL; + list->length = 0; +} + +static inline void pkgconf_node_insert(pkgconf_node_t *node, void *data, pkgconf_list_t *list) { pkgconf_node_t *tnode;
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/libpkgconf-api.h -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/libpkgconf-api.h
Changed
@@ -2,8 +2,7 @@ #define LIBPKGCONF_LIBPKGCONF_API_H /* Makefile.am specifies visibility using the libtool option -export-symbols-regex '^pkgconf_' - * Unfortunately, that is not available when building with cmake, so use attributes instead, - * in a way that doesn't depend on any cmake magic. + * Unfortunately, that is not available when building with meson, so use attributes instead. */ #if defined(PKGCONFIG_IS_STATIC) # define PKGCONF_API
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/libpkgconf.h -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/libpkgconf.h
Changed
@@ -20,6 +20,7 @@ #include <stdarg.h> #include <stddef.h> #include <stdbool.h> +#include <stdint.h> #include <libpkgconf/libpkgconf-api.h> #include <libpkgconf/iter.h> #include <libpkgconf/bsdstubs.h> @@ -78,8 +79,8 @@ #define PKGCONF_FOREACH_LIST_ENTRY_REVERSE(tail, value) \ for ((value) = (tail); (value) != NULL; (value) = (value)->prev) -#define LIBPKGCONF_VERSION 10700 -#define LIBPKGCONF_VERSION_STR "1.7.0" +#define LIBPKGCONF_VERSION 10905 +#define LIBPKGCONF_VERSION_STR "1.9.5" struct pkgconf_fragment_ { pkgconf_node_t iter; @@ -100,6 +101,9 @@ pkgconf_pkg_t *match; unsigned int flags; + + int refcount; + pkgconf_client_t *owner; }; struct pkgconf_tuple_ { @@ -107,8 +111,12 @@ char *key; char *value; + + unsigned int flags; }; +#define PKGCONF_PKG_TUPLEF_OVERRIDE 0x1 + struct pkgconf_path_ { pkgconf_node_t lnode; @@ -120,13 +128,10 @@ #define PKGCONF_PKG_PROPF_NONE 0x00 #define PKGCONF_PKG_PROPF_STATIC 0x01 #define PKGCONF_PKG_PROPF_CACHED 0x02 -#define PKGCONF_PKG_PROPF_SEEN 0x04 #define PKGCONF_PKG_PROPF_UNINSTALLED 0x08 #define PKGCONF_PKG_PROPF_VIRTUAL 0x10 struct pkgconf_pkg_ { - pkgconf_node_t cache_iter; - int refcount; char *id; char *filename; @@ -135,6 +140,9 @@ char *description; char *url; char *pc_filedir; + char *license; + char *maintainer; + char *copyright; pkgconf_list_t libs; pkgconf_list_t libs_private; @@ -157,16 +165,19 @@ */ pkgconf_tuple_t *orig_prefix; pkgconf_tuple_t *prefix; + + uint64_t serial; + + size_t hits; }; typedef bool (*pkgconf_pkg_iteration_func_t)(const pkgconf_pkg_t *pkg, void *data); typedef void (*pkgconf_pkg_traverse_func_t)(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *data); typedef bool (*pkgconf_queue_apply_func_t)(pkgconf_client_t *client, pkgconf_pkg_t *world, void *data, int maxdepth); -typedef bool (*pkgconf_error_handler_func_t)(const char *msg, const pkgconf_client_t *client, const void *data); +typedef bool (*pkgconf_error_handler_func_t)(const char *msg, const pkgconf_client_t *client, void *data); struct pkgconf_client_ { pkgconf_list_t dir_list; - pkgconf_list_t pkg_cache; pkgconf_list_t filter_libdirs; pkgconf_list_t filter_includedirs; @@ -191,6 +202,11 @@ char *prefix_varname; bool already_sent_notice; + + uint64_t serial; + + pkgconf_pkg_t **cache_table; + size_t cache_count; }; struct pkgconf_cross_personality_ { @@ -233,7 +249,7 @@ PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_find(const char *triplet); PKGCONF_API void pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *personality); -#define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((unsigned int)(c))) +#define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((unsigned char)(c))) #define PKGCONF_IS_OPERATOR_CHAR(c) ((c) == '<' || (c) == '>' || (c) == '!' || (c) == '=') #define PKGCONF_PKG_PKGF_NONE 0x0000 @@ -253,8 +269,10 @@ #define PKGCONF_PKG_PKGF_DONT_FILTER_INTERNAL_CFLAGS 0x2000 #define PKGCONF_PKG_PKGF_DONT_MERGE_SPECIAL_FRAGMENTS 0x4000 #define PKGCONF_PKG_PKGF_FDO_SYSROOT_RULES 0x8000 +#define PKGCONF_PKG_PKGF_PKGCONF1_SYSROOT_RULES 0x10000 #define PKGCONF_PKG_DEPF_INTERNAL 0x1 +#define PKGCONF_PKG_DEPF_PRIVATE 0x2 #define PKGCONF_PKG_ERRF_OK 0x0 #define PKGCONF_PKG_ERRF_PACKAGE_NOT_FOUND 0x1 @@ -282,17 +300,17 @@ PKGCONF_API bool pkgconf_error(const pkgconf_client_t *client, const char *format, ...) PRINTFLIKE(2, 3); PKGCONF_API bool pkgconf_warn(const pkgconf_client_t *client, const char *format, ...) PRINTFLIKE(2, 3); PKGCONF_API bool pkgconf_trace(const pkgconf_client_t *client, const char *filename, size_t lineno, const char *funcname, const char *format, ...) PRINTFLIKE(5, 6); -PKGCONF_API bool pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, const void *data); +PKGCONF_API bool pkgconf_default_error_handler(const char *msg, const pkgconf_client_t *client, void *data); #ifndef PKGCONF_LITE #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define PKGCONF_TRACE(client, ...) do { \ pkgconf_trace(client, __FILE__, __LINE__, __PRETTY_FUNCTION__, __VA_ARGS__); \ - } while (0); + } while (0) #else #define PKGCONF_TRACE(client, ...) do { \ pkgconf_trace(client, __FILE__, __LINE__, __func__, __VA_ARGS__); \ - } while (0); + } while (0) #endif #else #define PKGCONF_TRACE(client, ...) @@ -315,12 +333,16 @@ PKGCONF_API pkgconf_pkg_t *pkgconf_scan_all(pkgconf_client_t *client, void *ptr, pkgconf_pkg_iteration_func_t func); /* parse.c */ -PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *path, FILE *f); -PKGCONF_API void pkgconf_dependency_parse_str(const pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags); -PKGCONF_API void pkgconf_dependency_parse(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags); +PKGCONF_API pkgconf_pkg_t *pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *path, FILE *f, unsigned int flags); +PKGCONF_API void pkgconf_dependency_parse_str(pkgconf_client_t *client, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags); +PKGCONF_API void pkgconf_dependency_parse(pkgconf_client_t *client, pkgconf_pkg_t *pkg, pkgconf_list_t *deplist_head, const char *depends, unsigned int flags); PKGCONF_API void pkgconf_dependency_append(pkgconf_list_t *list, pkgconf_dependency_t *tail); PKGCONF_API void pkgconf_dependency_free(pkgconf_list_t *list); -PKGCONF_API pkgconf_dependency_t *pkgconf_dependency_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare, unsigned int flags); +PKGCONF_API void pkgconf_dependency_free_one(pkgconf_dependency_t *dep); +PKGCONF_API pkgconf_dependency_t *pkgconf_dependency_add(pkgconf_client_t *client, pkgconf_list_t *list, const char *package, const char *version, pkgconf_pkg_comparator_t compare, unsigned int flags); +PKGCONF_API pkgconf_dependency_t *pkgconf_dependency_ref(pkgconf_client_t *client, pkgconf_dependency_t *dep); +PKGCONF_API void pkgconf_dependency_unref(pkgconf_client_t *client, pkgconf_dependency_t *dep); +PKGCONF_API pkgconf_dependency_t *pkgconf_dependency_copy(pkgconf_client_t *client, const pkgconf_dependency_t *dep); /* argvsplit.c */ PKGCONF_API int pkgconf_argv_split(const char *src, int *argc, char ***argv); @@ -333,8 +355,8 @@ } pkgconf_fragment_render_ops_t; typedef bool (*pkgconf_fragment_filter_func_t)(const pkgconf_client_t *client, const pkgconf_fragment_t *frag, void *data); -PKGCONF_API bool pkgconf_fragment_parse(const pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_list_t *vars, const char *value); -PKGCONF_API void pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string); +PKGCONF_API bool pkgconf_fragment_parse(const pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_list_t *vars, const char *value, unsigned int flags); +PKGCONF_API void pkgconf_fragment_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *string, unsigned int flags); PKGCONF_API void pkgconf_fragment_copy(const pkgconf_client_t *client, pkgconf_list_t *list, const pkgconf_fragment_t *base, bool is_private); PKGCONF_API void pkgconf_fragment_copy_list(const pkgconf_client_t *client, pkgconf_list_t *list, const pkgconf_list_t *base); PKGCONF_API void pkgconf_fragment_delete(pkgconf_list_t *list, pkgconf_fragment_t *node); @@ -349,9 +371,9 @@ PKGCONF_API char *pkgconf_fgetline(char *line, size_t size, FILE *stream); /* tuple.c */ -PKGCONF_API pkgconf_tuple_t *pkgconf_tuple_add(const pkgconf_client_t *client, pkgconf_list_t *parent, const char *key, const char *value, bool parse); +PKGCONF_API pkgconf_tuple_t *pkgconf_tuple_add(const pkgconf_client_t *client, pkgconf_list_t *parent, const char *key, const char *value, bool parse, unsigned int flags); PKGCONF_API char *pkgconf_tuple_find(const pkgconf_client_t *client, pkgconf_list_t *list, const char *key); -PKGCONF_API char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *list, const char *value); +PKGCONF_API char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *list, const char *value, unsigned int flags); PKGCONF_API void pkgconf_tuple_free(pkgconf_list_t *list); PKGCONF_API void pkgconf_tuple_free_entry(pkgconf_tuple_t *tuple, pkgconf_list_t *list); PKGCONF_API void pkgconf_tuple_add_global(pkgconf_client_t *client, const char *key, const char *value); @@ -362,9 +384,11 @@ /* queue.c */ PKGCONF_API void pkgconf_queue_push(pkgconf_list_t *list, const char *package); PKGCONF_API bool pkgconf_queue_compile(pkgconf_client_t *client, pkgconf_pkg_t *world, pkgconf_list_t *list); +PKGCONF_API bool pkgconf_queue_solve(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_pkg_t *world, int maxdepth); PKGCONF_API void pkgconf_queue_free(pkgconf_list_t *list); PKGCONF_API bool pkgconf_queue_apply(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_queue_apply_func_t func, int maxdepth, void *data); PKGCONF_API bool pkgconf_queue_validate(pkgconf_client_t *client, pkgconf_list_t *list, int maxdepth); +PKGCONF_API void pkgconf_solution_free(pkgconf_client_t *client, pkgconf_pkg_t *world); /* cache.c */ PKGCONF_API pkgconf_pkg_t *pkgconf_cache_lookup(pkgconf_client_t *client, const char *id);
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/parser.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/parser.c
Changed
@@ -44,14 +44,23 @@ lineno++; p = readbuf; - while (*p && (isalpha((unsigned int)*p) || isdigit((unsigned int)*p) || *p == '_' || *p == '.')) + while (*p && isspace((unsigned char)*p)) + p++; + if (*p && p != readbuf) + { + warnfunc(data, "%s:" SIZE_FMT_SPECIFIER ": warning: whitespace encountered while parsing key section\n", + filename, lineno); + warned_key_whitespace = true; + } + key = p; + while (*p && (isalpha((unsigned char)*p) || isdigit((unsigned char)*p) || *p == '_' || *p == '.')) p++; - key = readbuf; - if (!isalpha((unsigned int)*key) && !isdigit((unsigned int)*p)) + if (!isalpha((unsigned char)*key) && + !isdigit((unsigned char)*p)) continue; - while (*p && isspace((unsigned int)*p)) + while (*p && isspace((unsigned char)*p)) { if (!warned_key_whitespace) { @@ -72,12 +81,12 @@ p++; } - while (*p && isspace((unsigned int)*p)) + while (*p && isspace((unsigned char)*p)) p++; value = p; p = value + (strlen(value) - 1); - while (*p && isspace((unsigned int) *p) && p > value) + while (*p && isspace((unsigned char) *p) && p > value) { if (!warned_value_whitespace && op == '=') { @@ -89,7 +98,6 @@ *p = '\0'; p--; } - if (ops(unsigned char) op) ops(unsigned char) op(data, lineno, key, value); }
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/path.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/path.c
Changed
@@ -268,6 +268,8 @@ free(pnode->path); free(pnode); } + + pkgconf_list_zero(dirlist); } static char *
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/personality.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/personality.c
Changed
@@ -17,11 +17,24 @@ #include <libpkgconf/stdinc.h> #include <libpkgconf/libpkgconf.h> +/* + * !doc + * + * libpkgconf `personality` module + * ========================= + */ + #ifdef _WIN32 # define strcasecmp _stricmp #endif -static bool default_personality_init = false; +/* + * Increment each time the default personality is inited, decrement each time + * it's deinited. Whenever it is 0, then the deinit frees the personality. In + * that case an additional call to init will create it anew. + */ +static unsigned default_personality_init = 0; + static pkgconf_cross_personality_t default_personality = { .name = "default", #ifdef _WIN32 @@ -85,30 +98,47 @@ * * Returns the default cross-compile personality. * + * Not thread safe. + * * :rtype: pkgconf_cross_personality_t* * :return: the default cross-compile personality */ pkgconf_cross_personality_t * pkgconf_cross_personality_default(void) { - if (default_personality_init) + if (default_personality_init) { + ++default_personality_init; return &default_personality; + } build_default_search_path(&default_personality.dir_list); pkgconf_path_split(SYSTEM_LIBDIR, &default_personality.filter_libdirs, false); pkgconf_path_split(SYSTEM_INCLUDEDIR, &default_personality.filter_includedirs, false); - default_personality_init = true; + ++default_personality_init; return &default_personality; } +/* + * !doc + * + * .. c:function:: void pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *) + * + * Decrements the count of default cross personality instances. + * + * Not thread safe. + * + * :rtype: void + */ void pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *personality) { - pkgconf_path_free(&personality->dir_list); - pkgconf_path_free(&personality->filter_libdirs); - pkgconf_path_free(&personality->filter_includedirs); + if (--default_personality_init == 0) { + pkgconf_path_free(&personality->dir_list); + pkgconf_path_free(&personality->filter_libdirs); + pkgconf_path_free(&personality->filter_includedirs); + } } #ifndef PKGCONF_LITE @@ -118,7 +148,7 @@ const char *c = triplet; for (; *c; c++) - if (!isalnum(*c) && *c != '-' && *c != '_') + if (!isalnum((unsigned char)*c) && *c != '-' && *c != '_') return false; return true;
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/pkg.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/pkg.c
Changed
@@ -37,6 +37,14 @@ #define PKG_CONFIG_EXT ".pc" +static unsigned int +pkgconf_pkg_traverse_main(pkgconf_client_t *client, + pkgconf_pkg_t *root, + pkgconf_pkg_traverse_func_t func, + void *data, + int maxdepth, + unsigned int skip_flags); + static inline bool str_has_suffix(const char *str, const char *suffix) { @@ -64,7 +72,7 @@ return strdup(buf); } -typedef void (*pkgconf_pkg_parser_keyword_func_t)(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value); +typedef void (*pkgconf_pkg_parser_keyword_func_t)(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value); typedef struct { const char *keyword; const pkgconf_pkg_parser_keyword_func_t func; @@ -78,17 +86,17 @@ } static void -pkgconf_pkg_parser_tuple_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) +pkgconf_pkg_parser_tuple_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) { (void) keyword; (void) lineno; char **dest = (char **)((char *) pkg + offset); - *dest = pkgconf_tuple_parse(client, &pkg->vars, value); + *dest = pkgconf_tuple_parse(client, &pkg->vars, value, pkg->flags); } static void -pkgconf_pkg_parser_version_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) +pkgconf_pkg_parser_version_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) { (void) keyword; (void) lineno; @@ -97,7 +105,7 @@ char **dest = (char **)((char *) pkg + offset); /* cut at any detected whitespace */ - p = pkgconf_tuple_parse(client, &pkg->vars, value); + p = pkgconf_tuple_parse(client, &pkg->vars, value, pkg->flags); len = strcspn(p, " \t"); if (len != strlen(p)) @@ -113,10 +121,10 @@ } static void -pkgconf_pkg_parser_fragment_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) +pkgconf_pkg_parser_fragment_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) { pkgconf_list_t *dest = (pkgconf_list_t *)((char *) pkg + offset); - bool ret = pkgconf_fragment_parse(client, dest, &pkg->vars, value); + bool ret = pkgconf_fragment_parse(client, dest, &pkg->vars, value, pkg->flags); if (!ret) { @@ -126,7 +134,7 @@ } static void -pkgconf_pkg_parser_dependency_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) +pkgconf_pkg_parser_dependency_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) { (void) keyword; (void) lineno; @@ -137,7 +145,7 @@ /* a variant of pkgconf_pkg_parser_dependency_func which colors the dependency node as an "internal" dependency. */ static void -pkgconf_pkg_parser_internal_dependency_func(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) +pkgconf_pkg_parser_internal_dependency_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) { (void) keyword; (void) lineno; @@ -146,19 +154,34 @@ pkgconf_dependency_parse(client, pkg, dest, value, PKGCONF_PKG_DEPF_INTERNAL); } +/* a variant of pkgconf_pkg_parser_dependency_func which colors the dependency node as a "private" dependency. */ +static void +pkgconf_pkg_parser_private_dependency_func(pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, const char *value) +{ + (void) keyword; + (void) lineno; + + pkgconf_list_t *dest = (pkgconf_list_t *)((char *) pkg + offset); + pkgconf_dependency_parse(client, pkg, dest, value, PKGCONF_PKG_DEPF_PRIVATE); +} + /* keep this in alphabetical order */ static const pkgconf_pkg_parser_keyword_pair_t pkgconf_pkg_parser_keyword_funcs = { {"CFLAGS", pkgconf_pkg_parser_fragment_func, offsetof(pkgconf_pkg_t, cflags)}, {"CFLAGS.private", pkgconf_pkg_parser_fragment_func, offsetof(pkgconf_pkg_t, cflags_private)}, {"Conflicts", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, conflicts)}, + {"Copyright", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, copyright)}, {"Description", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, description)}, {"LIBS", pkgconf_pkg_parser_fragment_func, offsetof(pkgconf_pkg_t, libs)}, {"LIBS.private", pkgconf_pkg_parser_fragment_func, offsetof(pkgconf_pkg_t, libs_private)}, + {"License", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, license)}, + {"Maintainer", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, maintainer)}, {"Name", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, realname)}, {"Provides", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, provides)}, {"Requires", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, required)}, {"Requires.internal", pkgconf_pkg_parser_internal_dependency_func, offsetof(pkgconf_pkg_t, requires_private)}, - {"Requires.private", pkgconf_pkg_parser_dependency_func, offsetof(pkgconf_pkg_t, requires_private)}, + {"Requires.private", pkgconf_pkg_parser_private_dependency_func, offsetof(pkgconf_pkg_t, requires_private)}, + {"URL", pkgconf_pkg_parser_tuple_func, offsetof(pkgconf_pkg_t, url)}, {"Version", pkgconf_pkg_parser_version_func, offsetof(pkgconf_pkg_t, version)}, }; @@ -297,19 +320,17 @@ * which is broken when redefining the prefix. We try to outsmart the * file and rewrite any directory that starts with the same prefix. */ - if (strcmp(keyword, pkg->owner->prefix_varname) || !(pkg->owner->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX)) - { - pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, value, true); - } - else if (pkg->owner->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX && pkg->orig_prefix + if (pkg->owner->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX && pkg->orig_prefix && is_path_prefix_equal(canonicalized_value, pkg->orig_prefix->value, strlen(pkg->orig_prefix->value))) { char newvaluePKGCONF_ITEM_SIZE; pkgconf_strlcpy(newvalue, pkg->prefix->value, sizeof newvalue); pkgconf_strlcat(newvalue, canonicalized_value + strlen(pkg->orig_prefix->value), sizeof newvalue); - pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, newvalue, false); + pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, newvalue, false, pkg->flags); } + else if (strcmp(keyword, pkg->owner->prefix_varname) || !(pkg->owner->flags & PKGCONF_PKG_PKGF_REDEFINE_PREFIX)) + pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, value, true, pkg->flags); else { char pathbufPKGCONF_ITEM_SIZE; @@ -318,12 +339,12 @@ if (relvalue != NULL) { char *prefix_value = convert_path_to_value(relvalue); - pkg->orig_prefix = pkgconf_tuple_add(pkg->owner, &pkg->vars, "orig_prefix", canonicalized_value, true); - pkgconf_tuple_add_global(pkg->owner, keyword, prefix_value); + pkg->orig_prefix = pkgconf_tuple_add(pkg->owner, &pkg->vars, "orig_prefix", canonicalized_value, true, pkg->flags); + pkg->prefix = pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, prefix_value, false, pkg->flags); free(prefix_value); } else - pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, value, true); + pkgconf_tuple_add(pkg->owner, &pkg->vars, keyword, value, true, pkg->flags); } } @@ -381,18 +402,19 @@ /* * !doc * - * .. c:function:: pkgconf_pkg_t *pkgconf_pkg_new_from_file(const pkgconf_client_t *client, const char *filename, FILE *f) + * .. c:function:: pkgconf_pkg_t *pkgconf_pkg_new_from_file(const pkgconf_client_t *client, const char *filename, FILE *f, unsigned int flags) * * Parse a .pc file into a pkgconf_pkg_t object structure. * * :param pkgconf_client_t* client: The pkgconf client object to use for dependency resolution. * :param char* filename: The filename of the package file (including full path). * :param FILE* f: The file object to read from. + * :param uint flags: The flags to use when parsing. * :returns: A ``pkgconf_pkg_t`` object which contains the package data. * :rtype: pkgconf_pkg_t * */ pkgconf_pkg_t * -pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *f) +pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *f, unsigned int flags) { pkgconf_pkg_t *pkg; char *idptr; @@ -401,20 +423,18 @@ pkg->owner = client; pkg->filename = strdup(filename); pkg->pc_filedir = pkg_get_parent_dir(pkg); + pkg->flags = flags; char *pc_filedir_value = convert_path_to_value(pkg->pc_filedir); - pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pc_filedir_value, true); + pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pc_filedir_value, true, pkg->flags); free(pc_filedir_value); - /* If pc_filedir is outside of sysroot_dir, clear pc_filedir + /* If pc_filedir is outside of sysroot_dir, override sysroot_dir for this + * package. * See https://github.com/pkgconf/pkgconf/issues/213 */ if (client->sysroot_dir && strncmp(pkg->pc_filedir, client->sysroot_dir, strlen(client->sysroot_dir))) - { - free(client->sysroot_dir); - client->sysroot_dir = NULL; - pkgconf_client_set_sysroot_dir(client, NULL); - } + pkgconf_tuple_add(client, &pkg->vars, "pc_sysrootdir", "", false, pkg->flags); /* make module id */ if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL) @@ -446,7 +466,8 @@ return NULL; } - pkgconf_dependency_add(client, &pkg->provides, pkg->id, pkg->version, PKGCONF_CMP_EQUAL, 0); + pkgconf_dependency_t *dep = pkgconf_dependency_add(client, &pkg->provides, pkg->id, pkg->version, PKGCONF_CMP_EQUAL, 0); + pkgconf_dependency_unref(dep->owner, dep); return pkgconf_pkg_ref(client, pkg); } @@ -509,6 +530,15 @@ if (pkg->pc_filedir != NULL) free(pkg->pc_filedir); + if (pkg->license != NULL) + free(pkg->license); + + if (pkg->maintainer != NULL) + free(pkg->maintainer); + + if (pkg->copyright != NULL) + free(pkg->copyright); + free(pkg); } @@ -531,7 +561,7 @@ PKGCONF_TRACE(client, "WTF: client %p refers to package %p owned by other client %p", client, pkg, pkg->owner); pkg->refcount++; - PKGCONF_TRACE(client, "refcount@%p: %d", pkg, pkg->refcount); + PKGCONF_TRACE(client, "%s refcount@%p: %d", pkg->id, pkg, pkg->refcount); return pkg; } @@ -554,7 +584,7 @@ PKGCONF_TRACE(client, "WTF: client %p unrefs package %p owned by other client %p", client, pkg, pkg->owner); pkg->refcount--; - PKGCONF_TRACE(pkg->owner, "refcount@%p: %d", pkg, pkg->refcount); + PKGCONF_TRACE(pkg->owner, "%s refcount@%p: %d", pkg->id, pkg, pkg->refcount); if (pkg->refcount <= 0) pkgconf_pkg_free(pkg->owner, pkg); @@ -576,14 +606,12 @@ if (!(client->flags & PKGCONF_PKG_PKGF_NO_UNINSTALLED) && (f = fopen(uninst_locbuf, "r")) != NULL) { PKGCONF_TRACE(client, "found (uninstalled): %s", uninst_locbuf); - pkg = pkgconf_pkg_new_from_file(client, uninst_locbuf, f); - if (pkg != NULL) - pkg->flags |= PKGCONF_PKG_PROPF_UNINSTALLED; + pkg = pkgconf_pkg_new_from_file(client, uninst_locbuf, f, PKGCONF_PKG_PROPF_UNINSTALLED); } else if ((f = fopen(locbuf, "r")) != NULL) { PKGCONF_TRACE(client, "found: %s", locbuf); - pkg = pkgconf_pkg_new_from_file(client, locbuf, f); + pkg = pkgconf_pkg_new_from_file(client, locbuf, f, 0); } return pkg; @@ -621,7 +649,7 @@ if (f == NULL) continue; - pkg = pkgconf_pkg_new_from_file(client, filebuf, f); + pkg = pkgconf_pkg_new_from_file(client, filebuf, f, 0); if (pkg != NULL) { if (func(pkg, data)) @@ -741,7 +769,7 @@ PKGCONF_TRACE(client, "%s is a file", name); - pkg = pkgconf_pkg_new_from_file(client, name, f); + pkg = pkgconf_pkg_new_from_file(client, name, f, 0); if (pkg != NULL) { pkgconf_path_add(pkg->pc_filedir, &client->dir_list, true); @@ -798,7 +826,7 @@ * * :param char* a: The first version to compare in the pair. * :param char* b: The second version to compare in the pair. - * :return: -1 if the first version is greater, 0 if both versions are equal, 1 if the second version is greater. + * :return: -1 if the first version is less than, 0 if both versions are equal, 1 if the second version is less than. * :rtype: int */ int @@ -813,10 +841,10 @@ /* optimization: if version matches then it's the same version. */ if (a == NULL) - return 1; + return -1; if (b == NULL) - return -1; + return 1; if (!strcasecmp(a, b)) return 0; @@ -824,22 +852,22 @@ pkgconf_strlcpy(buf1, a, sizeof buf1); pkgconf_strlcpy(buf2, b, sizeof buf2); - one = str1 = buf1; - two = str2 = buf2; + one = buf1; + two = buf2; while (*one || *two) { - while (*one && !isalnum((unsigned int)*one) && *one != '~') + while (*one && !isalnum((unsigned char)*one) && *one != '~') one++; - while (*two && !isalnum((unsigned int)*two) && *two != '~') + while (*two && !isalnum((unsigned char)*two) && *two != '~') two++; if (*one == '~' || *two == '~') { if (*one != '~') - return -1; - if (*two != '~') return 1; + if (*two != '~') + return -1; one++; two++; @@ -852,22 +880,22 @@ str1 = one; str2 = two; - if (isdigit((unsigned int)*str1)) + if (isdigit((unsigned char)*str1)) { - while (*str1 && isdigit((unsigned int)*str1)) + while (*str1 && isdigit((unsigned char)*str1)) str1++; - while (*str2 && isdigit((unsigned int)*str2)) + while (*str2 && isdigit((unsigned char)*str2)) str2++; isnum = true; } else { - while (*str1 && isalpha((unsigned int)*str1)) + while (*str1 && isalpha((unsigned char)*str1)) str1++; - while (*str2 && isalpha((unsigned int)*str2)) + while (*str2 && isalpha((unsigned char)*str2)) str2++; isnum = false; @@ -960,6 +988,7 @@ .description = "virtual package defining pkgconf API version supported", .url = PACKAGE_BUGREPORT, .version = PACKAGE_VERSION, + .license = "ISC", .flags = PKGCONF_PKG_PROPF_STATIC, .vars = { .head = &(pkgconf_node_t){ @@ -1441,9 +1470,9 @@ unsigned int skip_flags) { unsigned int eflags = PKGCONF_PKG_ERRF_OK; - pkgconf_node_t *node; + pkgconf_node_t *node, *next; - PKGCONF_FOREACH_LIST_ENTRY(deplist->head, node) + PKGCONF_FOREACH_LIST_ENTRY_SAFE(deplist->head, next, node) { unsigned int eflags_local = PKGCONF_PKG_ERRF_OK; pkgconf_dependency_t *depnode = node->data; @@ -1463,23 +1492,41 @@ if (pkgdep == NULL) continue; - if (pkgdep->flags & PKGCONF_PKG_PROPF_SEEN) + if (pkgdep->serial == client->serial && !(parent->flags & PKGCONF_PKG_PROPF_VIRTUAL)) { - pkgconf_pkg_unref(client, pkgdep); - continue; + pkgdep->hits++; + + /* In this case we have a circular reference. + * We break that by deleteing the circular node from the + * the list, so that we dont create a situation where + * memory is leaked due to circular ownership. + * i.e: A owns B owns A + * + * TODO(ariadne): Breaking circular references between Requires and Requires.private + * lists causes problems. Find a way to refactor the Requires.private list out. + */ + if (!(depnode->flags & PKGCONF_PKG_DEPF_PRIVATE) && + !(parent->flags & PKGCONF_PKG_PROPF_VIRTUAL)) + { + pkgconf_warn(client, "%s: breaking circular reference (%s -> %s -> %s)\n", + parent->id, parent->id, pkgdep->id, parent->id); + + pkgconf_node_delete(node, deplist); + pkgconf_dependency_unref(client, depnode); + } + + goto next; } if (skip_flags && (depnode->flags & skip_flags) == skip_flags) - { - pkgconf_pkg_unref(client, pkgdep); - continue; - } + goto next; pkgconf_audit_log_dependency(client, pkgdep, depnode); - pkgdep->flags |= PKGCONF_PKG_PROPF_SEEN; - eflags |= pkgconf_pkg_traverse(client, pkgdep, func, data, depth - 1, skip_flags); - pkgdep->flags &= ~PKGCONF_PKG_PROPF_SEEN; + pkgdep->hits++; + pkgdep->serial = client->serial; + eflags |= pkgconf_pkg_traverse_main(client, pkgdep, func, data, depth - 1, skip_flags); +next: pkgconf_pkg_unref(client, pkgdep); } @@ -1549,8 +1596,8 @@ * :return: ``PKGCONF_PKG_ERRF_OK`` on success, else an error code. * :rtype: unsigned int */ -unsigned int -pkgconf_pkg_traverse(pkgconf_client_t *client, +static unsigned int +pkgconf_pkg_traverse_main(pkgconf_client_t *client, pkgconf_pkg_t *root, pkgconf_pkg_traverse_func_t func, void *data, @@ -1562,7 +1609,7 @@ if (maxdepth == 0) return eflags; - PKGCONF_TRACE(client, "%s: level %d", root->id, maxdepth); + PKGCONF_TRACE(client, "%s: level %d, serial %lu", root->id, maxdepth, client->serial); if ((root->flags & PKGCONF_PKG_PROPF_VIRTUAL) != PKGCONF_PKG_PROPF_VIRTUAL || (client->flags & PKGCONF_PKG_PKGF_SKIP_ROOT_VIRTUAL) != PKGCONF_PKG_PKGF_SKIP_ROOT_VIRTUAL) { @@ -1598,6 +1645,20 @@ return eflags; } +unsigned int +pkgconf_pkg_traverse(pkgconf_client_t *client, + pkgconf_pkg_t *root, + pkgconf_pkg_traverse_func_t func, + void *data, + int maxdepth, + unsigned int skip_flags) +{ + if (root->flags & PKGCONF_PKG_PROPF_VIRTUAL) + client->serial++; + + return pkgconf_pkg_traverse_main(client, root, func, data, maxdepth, skip_flags); +} + static void pkgconf_pkg_cflags_collect(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *data) {
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/queue.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/queue.c
Changed
@@ -51,7 +51,7 @@ pkgconf_queue_t *pkgq = calloc(sizeof(pkgconf_queue_t), 1); pkgq->package = strdup(package); - pkgconf_node_insert_tail(&pkgq->iter, pkgq, list); + pkgconf_node_insert(&pkgq->iter, pkgq, list); } /* @@ -107,13 +107,199 @@ } } +static void +pkgconf_queue_collect_dependents(pkgconf_client_t *client, pkgconf_pkg_t *pkg, void *data) +{ + pkgconf_node_t *node; + pkgconf_pkg_t *world = data; + + if (pkg == world) + return; + + PKGCONF_FOREACH_LIST_ENTRY(pkg->required.head, node) + { + pkgconf_dependency_t *flattened_dep; + + flattened_dep = pkgconf_dependency_copy(client, node->data); + + pkgconf_node_insert(&flattened_dep->iter, flattened_dep, &world->required); + } + + if (client->flags & PKGCONF_PKG_PKGF_SEARCH_PRIVATE) + { + PKGCONF_FOREACH_LIST_ENTRY(pkg->requires_private.head, node) + { + pkgconf_dependency_t *flattened_dep; + + flattened_dep = pkgconf_dependency_copy(client, node->data); + + pkgconf_node_insert(&flattened_dep->iter, flattened_dep, &world->requires_private); + } + } +} + +static int +dep_sort_cmp(const void *a, const void *b) +{ + const pkgconf_dependency_t *depA = *(void **) a; + const pkgconf_dependency_t *depB = *(void **) b; + + return depB->match->hits - depA->match->hits; +} + +static inline void +flatten_dependency_set(pkgconf_client_t *client, pkgconf_list_t *list) +{ + pkgconf_node_t *node, *next; + pkgconf_dependency_t **deps = NULL; + size_t dep_count = 0, i; + + PKGCONF_FOREACH_LIST_ENTRY_SAFE(list->head, next, node) + { + pkgconf_dependency_t *dep = node->data; + pkgconf_pkg_t *pkg = pkgconf_pkg_verify_dependency(client, dep, NULL); + + if (pkg == NULL) + continue; + + if (pkg->serial == client->serial) + { + pkgconf_node_delete(node, list); + pkgconf_dependency_unref(client, dep); + goto next; + } + + if (dep->match == NULL) + { + PKGCONF_TRACE(client, "WTF: unmatched dependency %p <%s>", dep, dep->package); + abort(); + } + + /* for virtuals, we need to check to see if there are dupes */ + for (i = 0; i < dep_count; i++) + { + pkgconf_dependency_t *other_dep = depsi; + + PKGCONF_TRACE(client, "dedup %s = %s?", dep->package, other_dep->package); + + if (!strcmp(dep->package, other_dep->package)) + { + PKGCONF_TRACE(client, "skipping, "SIZE_FMT_SPECIFIER" deps", dep_count); + goto next; + } + } + + pkg->serial = client->serial; + + /* copy to the deps table */ + dep_count++; + deps = pkgconf_reallocarray(deps, dep_count, sizeof (void *)); + depsdep_count - 1 = dep; + + PKGCONF_TRACE(client, "added %s to dep table", dep->package); +next: + pkgconf_pkg_unref(client, pkg); + } + + if (deps == NULL) + return; + + qsort(deps, dep_count, sizeof (void *), dep_sort_cmp); + + /* zero the list and start readding */ + pkgconf_list_zero(list); + + for (i = 0; i < dep_count; i++) + { + pkgconf_dependency_t *dep = depsi; + + if (dep->match == NULL) + continue; + + memset(&dep->iter, '\0', sizeof (dep->iter)); + pkgconf_node_insert(&dep->iter, dep, list); + + PKGCONF_TRACE(client, "slot "SIZE_FMT_SPECIFIER": dep %s matched to %p<%s> hits "SIZE_FMT_SPECIFIER, i, dep->package, dep->match, dep->match->id, dep->match->hits); + } + + free(deps); +} + static inline unsigned int pkgconf_queue_verify(pkgconf_client_t *client, pkgconf_pkg_t *world, pkgconf_list_t *list, int maxdepth) { + unsigned int result; + if (!pkgconf_queue_compile(client, world, list)) return PKGCONF_PKG_ERRF_DEPGRAPH_BREAK; - return pkgconf_pkg_verify_graph(client, world, maxdepth); + /* collect all the dependencies */ + result = pkgconf_pkg_traverse(client, world, pkgconf_queue_collect_dependents, world, maxdepth, 0); + if (result != PKGCONF_PKG_ERRF_OK) + return result; + + /* flatten the dependency set using serials. + * we copy the dependencies to a vector, and then erase the list. + * then we copy them back to the list. + */ + ++client->serial; + + PKGCONF_TRACE(client, "flattening requires deps"); + flatten_dependency_set(client, &world->required); + + ++client->serial; + + PKGCONF_TRACE(client, "flattening requires.private deps"); + flatten_dependency_set(client, &world->requires_private); + + return PKGCONF_PKG_ERRF_OK; +} + +/* + * !doc + * + * .. c:function:: void pkgconf_solution_free(pkgconf_client_t *client, pkgconf_pkg_t *world, int maxdepth) + * + * Removes references to package nodes contained in a solution. + * + * :param pkgconf_client_t* client: The pkgconf client object to use for dependency resolution. + * :param pkgconf_pkg_t* world: The root for the generated dependency graph. Should have PKGCONF_PKG_PROPF_VIRTUAL flag. + * :returns: nothing + */ +void +pkgconf_solution_free(pkgconf_client_t *client, pkgconf_pkg_t *world) +{ + (void) client; + + if (world->flags & PKGCONF_PKG_PROPF_VIRTUAL) + { + pkgconf_dependency_free(&world->required); + pkgconf_dependency_free(&world->requires_private); + } +} + +/* + * !doc + * + * .. c:function:: bool pkgconf_queue_solve(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_pkg_t *world, int maxdepth) + * + * Solves and flattens the dependency graph for the supplied dependency list. + * + * :param pkgconf_client_t* client: The pkgconf client object to use for dependency resolution. + * :param pkgconf_list_t* list: The list of dependency requests to consider. + * :param pkgconf_pkg_t* world: The root for the generated dependency graph, provided by the caller. Should have PKGCONF_PKG_PROPF_VIRTUAL flag. + * :param int maxdepth: The maximum allowed depth for the dependency resolver. A depth of -1 means unlimited. + * :returns: true if the dependency resolver found a solution, otherwise false. + * :rtype: bool + */ +bool +pkgconf_queue_solve(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_pkg_t *world, int maxdepth) +{ + /* if maxdepth is one, then we will not traverse deeper than our virtual package. */ + if (!maxdepth) + maxdepth = -1; + + return pkgconf_queue_verify(client, world, list, maxdepth) == PKGCONF_PKG_ERRF_OK; } /* @@ -124,6 +310,8 @@ * Attempt to compile a dependency resolution queue into a dependency resolution problem, then attempt to solve the problem and * feed the solution to a callback function if a complete dependency graph is found. * + * This function should not be used in new code. Use pkgconf_queue_solve instead. + * * :param pkgconf_client_t* client: The pkgconf client object to use for dependency resolution. * :param pkgconf_list_t* list: The list of dependency requests to consider. * :param pkgconf_queue_apply_func_t func: The callback function to call if a solution is found by the dependency resolver. @@ -135,6 +323,7 @@ bool pkgconf_queue_apply(pkgconf_client_t *client, pkgconf_list_t *list, pkgconf_queue_apply_func_t func, int maxdepth, void *data) { + bool ret = false; pkgconf_pkg_t world = { .id = "virtual:world", .realname = "virtual world package", @@ -145,18 +334,18 @@ if (!maxdepth) maxdepth = -1; - if (pkgconf_queue_verify(client, &world, list, maxdepth) != PKGCONF_PKG_ERRF_OK) - return false; + if (!pkgconf_queue_solve(client, list, &world, maxdepth)) + goto cleanup; + /* the world dependency set is flattened after it is returned from pkgconf_queue_verify */ if (!func(client, &world, data, maxdepth)) - { - pkgconf_pkg_free(client, &world); - return false; - } + goto cleanup; - pkgconf_pkg_free(client, &world); + ret = true; - return true; +cleanup: + pkgconf_pkg_free(client, &world); + return ret; } /*
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/stdinc.h -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/stdinc.h
Changed
@@ -59,6 +59,7 @@ # include <dirent.h> # include <unistd.h> # include <limits.h> +# include <strings.h> # ifdef PATH_MAX # define PKGCONF_ITEM_SIZE (PATH_MAX + 1024) # else
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/tuple.c -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/tuple.c
Changed
@@ -45,7 +45,23 @@ void pkgconf_tuple_add_global(pkgconf_client_t *client, const char *key, const char *value) { - pkgconf_tuple_add(client, &client->global_vars, key, value, false); + pkgconf_tuple_add(client, &client->global_vars, key, value, false, 0); +} + +static pkgconf_tuple_t * +lookup_global_tuple(const pkgconf_client_t *client, const char *key) +{ + pkgconf_node_t *node; + + PKGCONF_FOREACH_LIST_ENTRY(client->global_vars.head, node) + { + pkgconf_tuple_t *tuple = node->data; + + if (!strcmp(tuple->key, key)) + return tuple; + } + + return NULL; } /* @@ -63,17 +79,13 @@ char * pkgconf_tuple_find_global(const pkgconf_client_t *client, const char *key) { - pkgconf_node_t *node; + pkgconf_tuple_t *tuple; - PKGCONF_FOREACH_LIST_ENTRY(client->global_vars.head, node) - { - pkgconf_tuple_t *tuple = node->data; + tuple = lookup_global_tuple(client, key); + if (tuple == NULL) + return NULL; - if (!strcmp(tuple->key, key)) - return tuple->value; - } - - return NULL; + return tuple->value; } /* @@ -108,13 +120,18 @@ { char *workbuf = strdup(kv); char *value; + pkgconf_tuple_t *tuple; value = strchr(workbuf, '='); if (value == NULL) goto out; *value++ = '\0'; - pkgconf_tuple_add_global(client, workbuf, value); + + tuple = pkgconf_tuple_add(client, &client->global_vars, workbuf, value, false, 0); + if (tuple != NULL) + tuple->flags = PKGCONF_PKG_TUPLEF_OVERRIDE; + out: free(workbuf); } @@ -161,6 +178,45 @@ return buf; } +static const char * +find_sysroot(const pkgconf_client_t *client, pkgconf_list_t *vars) +{ + const char *sysroot_dir; + + sysroot_dir = pkgconf_tuple_find(client, vars, "pc_sysrootdir"); + if (sysroot_dir == NULL) + sysroot_dir = client->sysroot_dir; + + return sysroot_dir; +} + +static bool +should_rewrite_sysroot(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *buf, unsigned int flags) +{ + const char *sysroot_dir; + + if (flags & PKGCONF_PKG_PROPF_UNINSTALLED && !(client->flags & PKGCONF_PKG_PKGF_FDO_SYSROOT_RULES)) + return false; + + sysroot_dir = find_sysroot(client, vars); + if (sysroot_dir == NULL) + return false; + + if (*buf != '/') + return false; + + if (!strcmp(sysroot_dir, "/")) + return false; + + if (strlen(buf) <= strlen(sysroot_dir)) + return false; + + if (strstr(buf + strlen(sysroot_dir), sysroot_dir) == NULL) + return false; + + return true; +} + /* * !doc * @@ -177,7 +233,7 @@ * :rtype: pkgconf_tuple_t * */ pkgconf_tuple_t * -pkgconf_tuple_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *key, const char *value, bool parse) +pkgconf_tuple_add(const pkgconf_client_t *client, pkgconf_list_t *list, const char *key, const char *value, bool parse, unsigned int flags) { char *dequote_value; pkgconf_tuple_t *tuple = calloc(sizeof(pkgconf_tuple_t), 1); @@ -186,14 +242,14 @@ dequote_value = dequote(value); - PKGCONF_TRACE(client, "adding tuple to @%p: %s => %s (parsed? %d)", list, key, dequote_value, parse); - tuple->key = strdup(key); if (parse) - tuple->value = pkgconf_tuple_parse(client, list, dequote_value); + tuple->value = pkgconf_tuple_parse(client, list, dequote_value, flags); else tuple->value = strdup(dequote_value); + PKGCONF_TRACE(client, "adding tuple to @%p: %s => %s (parsed? %d)", list, key, tuple->value, parse); + pkgconf_node_insert(&tuple->iter, tuple, list); free(dequote_value); @@ -218,10 +274,11 @@ pkgconf_tuple_find(const pkgconf_client_t *client, pkgconf_list_t *list, const char *key) { pkgconf_node_t *node; - char *res; + pkgconf_tuple_t *global_tuple; - if ((res = pkgconf_tuple_find_global(client, key)) != NULL) - return res; + global_tuple = lookup_global_tuple(client, key); + if (global_tuple != NULL && global_tuple->flags & PKGCONF_PKG_TUPLEF_OVERRIDE) + return global_tuple->value; PKGCONF_FOREACH_LIST_ENTRY(list->head, node) { @@ -231,30 +288,35 @@ return tuple->value; } + if (global_tuple != NULL) + return global_tuple->value; + return NULL; } /* * !doc * - * .. c:function:: char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value) + * .. c:function:: char *pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value, unsigned int flags) * * Parse an expression for variable substitution. * * :param pkgconf_client_t* client: The pkgconf client object to access. * :param pkgconf_list_t* list: The variable list to search for variables (along side the global variable list). * :param char* value: The ``key=value`` string to parse. + * :param uint flags: Any flags to consider while parsing. * :return: the variable data with any variables substituted * :rtype: char * */ char * -pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value) +pkgconf_tuple_parse(const pkgconf_client_t *client, pkgconf_list_t *vars, const char *value, unsigned int flags) { char bufPKGCONF_BUFSIZE; const char *ptr; char *bptr = buf; - if (!(client->flags & PKGCONF_PKG_PKGF_FDO_SYSROOT_RULES)) + if (!(client->flags & PKGCONF_PKG_PKGF_FDO_SYSROOT_RULES) && + (!(flags & PKGCONF_PKG_PROPF_UNINSTALLED) || (client->flags & PKGCONF_PKG_PKGF_PKGCONF1_SYSROOT_RULES))) { if (*value == '/' && client->sysroot_dir != NULL && strncmp(value, client->sysroot_dir, strlen(client->sysroot_dir))) bptr += pkgconf_strlcpy(buf, client->sysroot_dir, sizeof buf); @@ -293,12 +355,23 @@ } } + PKGCONF_TRACE(client, "lookup tuple %s", varname); + + size_t remain = PKGCONF_BUFSIZE - (bptr - buf); ptr += (pptr - ptr); kv = pkgconf_tuple_find_global(client, varname); if (kv != NULL) { - strncpy(bptr, kv, PKGCONF_BUFSIZE - (bptr - buf)); - bptr += strlen(kv); + size_t nlen = pkgconf_strlcpy(bptr, kv, remain); + if (nlen > remain) + { + pkgconf_warn(client, "warning: truncating very long variable to 64KB\n"); + + bptr = buf + (PKGCONF_BUFSIZE - 1); + break; + } + + bptr += nlen; } else { @@ -306,12 +379,21 @@ if (kv != NULL) { - parsekv = pkgconf_tuple_parse(client, vars, kv); - - strncpy(bptr, parsekv, PKGCONF_BUFSIZE - (bptr - buf)); - bptr += strlen(parsekv); + size_t nlen; + parsekv = pkgconf_tuple_parse(client, vars, kv, flags); + nlen = pkgconf_strlcpy(bptr, parsekv, remain); free(parsekv); + + if (nlen > remain) + { + pkgconf_warn(client, "warning: truncating very long variable to 64KB\n"); + + bptr = buf + (PKGCONF_BUFSIZE - 1); + break; + } + + bptr += nlen; } } } @@ -333,16 +415,15 @@ * safe to skip ahead in the string to scan for our sysroot dir. * * Finally, we call pkgconf_path_relocate() to clean the path of spurious elements. + * + * New in 1.9: Only attempt to rewrite the sysroot if we are not processing an uninstalled package. */ - if (*buf == '/' && - client->sysroot_dir != NULL && - strcmp(client->sysroot_dir, "/") != 0 && - strlen(buf) > strlen(client->sysroot_dir) && - strstr(buf + strlen(client->sysroot_dir), client->sysroot_dir) != NULL) + if (should_rewrite_sysroot(client, vars, buf, flags)) { char cleanpathPKGCONF_ITEM_SIZE; + const char *sysroot_dir = find_sysroot(client, vars); - pkgconf_strlcpy(cleanpath, buf + strlen(client->sysroot_dir), sizeof cleanpath); + pkgconf_strlcpy(cleanpath, buf + strlen(sysroot_dir), sizeof cleanpath); pkgconf_path_relocate(cleanpath, sizeof cleanpath); return strdup(cleanpath); @@ -390,4 +471,6 @@ PKGCONF_FOREACH_LIST_ENTRY_SAFE(list->head, next, node) pkgconf_tuple_free_entry(node->data, list); + + pkgconf_list_zero(list); }
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/libpkgconf/win-dirent.h -> _service:tar_scm:pkgconf-1.9.5.tar.xz/libpkgconf/win-dirent.h
Changed
@@ -1,21 +1,29 @@ /* * Dirent interface for Microsoft Visual Studio - * Version 1.21 * - * Copyright (C) 2006-2012 Toni Ronkko + * Copyright (C) 1998-2019 Toni Ronkko * This file is part of dirent. Dirent may be freely distributed * under the MIT license. For all details and documentation, see * https://github.com/tronkko/dirent */ -#ifndef LIBPKGCONF_DIRENT_H -#define LIBPKGCONF_DIRENT_H +#ifndef DIRENT_H +#define DIRENT_H + +/* Hide warnings about unreferenced local functions */ +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wunused-function" +#elif defined(_MSC_VER) +# pragma warning(disable:4505) +#elif defined(__GNUC__) +# pragma GCC diagnostic ignored "-Wunused-function" +#endif /* * Include windows.h without Windows Sockets 1.1 to prevent conflicts with * Windows Sockets 2.0. */ #ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN #endif #include <windows.h> @@ -28,6 +36,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <errno.h> +#include <ctype.h> /* Indicates that d_type field is available in dirent structure */ #define _DIRENT_HAVE_D_TYPE @@ -37,123 +46,123 @@ /* Entries missing from MSVC 6.0 */ #if !defined(FILE_ATTRIBUTE_DEVICE) -# define FILE_ATTRIBUTE_DEVICE 0x40 +# define FILE_ATTRIBUTE_DEVICE 0x40 #endif /* File type and permission flags for stat(), general mask */ #if !defined(S_IFMT) -# define S_IFMT _S_IFMT +# define S_IFMT _S_IFMT #endif /* Directory bit */ #if !defined(S_IFDIR) -# define S_IFDIR _S_IFDIR +# define S_IFDIR _S_IFDIR #endif /* Character device bit */ #if !defined(S_IFCHR) -# define S_IFCHR _S_IFCHR +# define S_IFCHR _S_IFCHR #endif /* Pipe bit */ #if !defined(S_IFFIFO) -# define S_IFFIFO _S_IFFIFO +# define S_IFFIFO _S_IFFIFO #endif /* Regular file bit */ #if !defined(S_IFREG) -# define S_IFREG _S_IFREG +# define S_IFREG _S_IFREG #endif /* Read permission */ #if !defined(S_IREAD) -# define S_IREAD _S_IREAD +# define S_IREAD _S_IREAD #endif /* Write permission */ #if !defined(S_IWRITE) -# define S_IWRITE _S_IWRITE +# define S_IWRITE _S_IWRITE #endif /* Execute permission */ #if !defined(S_IEXEC) -# define S_IEXEC _S_IEXEC +# define S_IEXEC _S_IEXEC #endif /* Pipe */ #if !defined(S_IFIFO) -# define S_IFIFO _S_IFIFO +# define S_IFIFO _S_IFIFO #endif /* Block device */ #if !defined(S_IFBLK) -# define S_IFBLK 0 +# define S_IFBLK 0 #endif /* Link */ #if !defined(S_IFLNK) -# define S_IFLNK 0 +# define S_IFLNK 0 #endif /* Socket */ #if !defined(S_IFSOCK) -# define S_IFSOCK 0 +# define S_IFSOCK 0 #endif /* Read user permission */ #if !defined(S_IRUSR) -# define S_IRUSR S_IREAD +# define S_IRUSR S_IREAD #endif /* Write user permission */ #if !defined(S_IWUSR) -# define S_IWUSR S_IWRITE +# define S_IWUSR S_IWRITE #endif /* Execute user permission */ #if !defined(S_IXUSR) -# define S_IXUSR 0 +# define S_IXUSR 0 #endif /* Read group permission */ #if !defined(S_IRGRP) -# define S_IRGRP 0 +# define S_IRGRP 0 #endif /* Write group permission */ #if !defined(S_IWGRP) -# define S_IWGRP 0 +# define S_IWGRP 0 #endif /* Execute group permission */ #if !defined(S_IXGRP) -# define S_IXGRP 0 +# define S_IXGRP 0 #endif /* Read others permission */ #if !defined(S_IROTH) -# define S_IROTH 0 +# define S_IROTH 0 #endif /* Write others permission */ #if !defined(S_IWOTH) -# define S_IWOTH 0 +# define S_IWOTH 0 #endif /* Execute others permission */ #if !defined(S_IXOTH) -# define S_IXOTH 0 +# define S_IXOTH 0 #endif /* Maximum length of file name */ #if !defined(PATH_MAX) -# define PATH_MAX MAX_PATH +# define PATH_MAX MAX_PATH #endif #if !defined(FILENAME_MAX) -# define FILENAME_MAX MAX_PATH +# define FILENAME_MAX MAX_PATH #endif #if !defined(NAME_MAX) -# define NAME_MAX FILENAME_MAX +# define NAME_MAX FILENAME_MAX #endif /* File type flags for d_type */ @@ -177,32 +186,32 @@ * on Windows. */ #if !defined(S_ISFIFO) -# define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) +# define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) #endif #if !defined(S_ISDIR) -# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #endif #if !defined(S_ISREG) -# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) +# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) #endif #if !defined(S_ISLNK) -# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) +# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK) #endif #if !defined(S_ISSOCK) -# define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK) +# define S_ISSOCK(mode) (((mode) & S_IFMT) == S_IFSOCK) #endif #if !defined(S_ISCHR) -# define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR) +# define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR) #endif #if !defined(S_ISBLK) -# define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK) +# define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK) #endif -/* Return the exact length of d_namlen without zero terminator */ +/* Return the exact length of the file name without zero terminator */ #define _D_EXACT_NAMLEN(p) ((p)->d_namlen) -/* Return number of bytes needed to store d_namlen */ -#define _D_ALLOC_NAMLEN(p) (PATH_MAX) +/* Return the maximum size of a file name */ +#define _D_ALLOC_NAMLEN(p) ((PATH_MAX)+1) #ifdef __cplusplus @@ -212,279 +221,302 @@ /* Wide-character version */ struct _wdirent { - /* Always zero */ - long d_ino; + /* Always zero */ + long d_ino; + + /* File position within stream */ + long d_off; - /* Structure size */ - unsigned short d_reclen; + /* Structure size */ + unsigned short d_reclen; - /* Length of name without \0 */ - size_t d_namlen; + /* Length of name without \0 */ + size_t d_namlen; - /* File type */ - int d_type; + /* File type */ + int d_type; - /* File name */ - wchar_t d_namePATH_MAX; + /* File name */ + wchar_t d_namePATH_MAX+1; }; typedef struct _wdirent _wdirent; struct _WDIR { - /* Current directory entry */ - struct _wdirent ent; + /* Current directory entry */ + struct _wdirent ent; - /* Private file data */ - WIN32_FIND_DATAW data; + /* Private file data */ + WIN32_FIND_DATAW data; - /* True if data is valid */ - int cached; + /* True if data is valid */ + int cached; - /* Win32 search handle */ - HANDLE handle; + /* Win32 search handle */ + HANDLE handle; - /* Initial directory name */ - wchar_t *patt; + /* Initial directory name */ + wchar_t *patt; }; typedef struct _WDIR _WDIR; -static _WDIR *_wopendir (const wchar_t *dirname); -static struct _wdirent *_wreaddir (_WDIR *dirp); -static int _wclosedir (_WDIR *dirp); -static void _wrewinddir (_WDIR* dirp); - - -/* For compatibility with Symbian */ -#define wdirent _wdirent -#define WDIR _WDIR -#define wopendir _wopendir -#define wreaddir _wreaddir -#define wclosedir _wclosedir -#define wrewinddir _wrewinddir - - -/* Multi-byte character versions */ +/* Multi-byte character version */ struct dirent { - /* Always zero */ - long d_ino; + /* Always zero */ + long d_ino; - /* Structure size */ - unsigned short d_reclen; + /* File position within stream */ + long d_off; - /* Length of name without \0 */ - size_t d_namlen; + /* Structure size */ + unsigned short d_reclen; - /* File type */ - int d_type; + /* Length of name without \0 */ + size_t d_namlen; - /* File name */ - char d_namePATH_MAX; + /* File type */ + int d_type; + + /* File name */ + char d_namePATH_MAX+1; }; typedef struct dirent dirent; struct DIR { - struct dirent ent; - struct _WDIR *wdirp; + struct dirent ent; + struct _WDIR *wdirp; }; typedef struct DIR DIR; -static DIR *opendir (const char *dirname); -static struct dirent *readdir (DIR *dirp); -static int closedir (DIR *dirp); -static void rewinddir (DIR* dirp); + +/* Dirent functions */ +static DIR *opendir(const char *dirname); +static _WDIR *_wopendir(const wchar_t *dirname); + +static struct dirent *readdir(DIR *dirp); +static struct _wdirent *_wreaddir(_WDIR *dirp); + +static int readdir_r( + DIR *dirp, struct dirent *entry, struct dirent **result); +static int _wreaddir_r( + _WDIR *dirp, struct _wdirent *entry, struct _wdirent **result); + +static int closedir(DIR *dirp); +static int _wclosedir(_WDIR *dirp); + +static void rewinddir(DIR* dirp); +static void _wrewinddir(_WDIR* dirp); + +static int scandir(const char *dirname, struct dirent ***namelist, + int (*filter)(const struct dirent*), + int (*compare)(const struct dirent**, const struct dirent**)); + +static int alphasort(const struct dirent **a, const struct dirent **b); + +static int versionsort(const struct dirent **a, const struct dirent **b); + +static int strverscmp(const char *a, const char *b); + +/* For compatibility with Symbian */ +#define wdirent _wdirent +#define WDIR _WDIR +#define wopendir _wopendir +#define wreaddir _wreaddir +#define wclosedir _wclosedir +#define wrewinddir _wrewinddir + +/* Compatibility with older Microsoft compilers and non-Microsoft compilers */ +#if !defined(_MSC_VER) || _MSC_VER < 1400 +# define wcstombs_s dirent_wcstombs_s +# define mbstowcs_s dirent_mbstowcs_s +#endif + +/* Optimize dirent_set_errno() away on modern Microsoft compilers */ +#if defined(_MSC_VER) && _MSC_VER >= 1400 +# define dirent_set_errno _set_errno +#endif /* Internal utility functions */ -static WIN32_FIND_DATAW *dirent_first (_WDIR *dirp); -static WIN32_FIND_DATAW *dirent_next (_WDIR *dirp); +static WIN32_FIND_DATAW *dirent_first(_WDIR *dirp); +static WIN32_FIND_DATAW *dirent_next(_WDIR *dirp); +#if !defined(_MSC_VER) || _MSC_VER < 1400 static int dirent_mbstowcs_s( - size_t *pReturnValue, - wchar_t *wcstr, - size_t sizeInWords, - const char *mbstr, - size_t count); + size_t *pReturnValue, wchar_t *wcstr, size_t sizeInWords, + const char *mbstr, size_t count); +#endif +#if !defined(_MSC_VER) || _MSC_VER < 1400 static int dirent_wcstombs_s( - size_t *pReturnValue, - char *mbstr, - size_t sizeInBytes, - const wchar_t *wcstr, - size_t count); + size_t *pReturnValue, char *mbstr, size_t sizeInBytes, + const wchar_t *wcstr, size_t count); +#endif + +#if !defined(_MSC_VER) || _MSC_VER < 1400 +static void dirent_set_errno(int error); +#endif -static void dirent_set_errno (int error); /* * Open directory stream DIRNAME for read and return a pointer to the * internal working area that is used to retrieve individual directory * entries. */ -static _WDIR* -_wopendir( - const wchar_t *dirname) +static _WDIR *_wopendir(const wchar_t *dirname) +{ + wchar_t *p; + + /* Must have directory name */ + if (dirname == NULL || dirname0 == '\0') { + dirent_set_errno(ENOENT); + return NULL; + } + + /* Allocate new _WDIR structure */ + _WDIR *dirp = (_WDIR*) malloc(sizeof(struct _WDIR)); + if (!dirp) + return NULL; + + /* Reset _WDIR structure */ + dirp->handle = INVALID_HANDLE_VALUE; + dirp->patt = NULL; + dirp->cached = 0; + + /* + * Compute the length of full path plus zero terminator + * + * Note that on WinRT there's no way to convert relative paths + * into absolute paths, so just assume it is an absolute path. + */ +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + /* Desktop */ + DWORD n = GetFullPathNameW(dirname, 0, NULL, NULL); +#else + /* WinRT */ + size_t n = wcslen(dirname); +#endif + + /* Allocate room for absolute directory name and search pattern */ + dirp->patt = (wchar_t*) malloc(sizeof(wchar_t) * n + 16); + if (dirp->patt == NULL) + goto exit_closedir; + + /* + * Convert relative directory name to an absolute one. This + * allows rewinddir() to function correctly even when current + * working directory is changed between opendir() and rewinddir(). + * + * Note that on WinRT there's no way to convert relative paths + * into absolute paths, so just assume it is an absolute path. + */ +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) + /* Desktop */ + n = GetFullPathNameW(dirname, n, dirp->patt, NULL); + if (n <= 0) + goto exit_closedir; +#else + /* WinRT */ + wcsncpy_s(dirp->patt, n+1, dirname, n); +#endif + + /* Append search pattern \* to the directory name */ + p = dirp->patt + n; + switch (p-1) { + case '\\': + case '/': + case ':': + /* Directory ends in path separator, e.g. c:\temp\ */ + /*NOP*/; + break; + + default: + /* Directory name doesn't end in path separator */ + *p++ = '\\'; + } + *p++ = '*'; + *p = '\0'; + + /* Open directory stream and retrieve the first entry */ + if (!dirent_first(dirp)) + goto exit_closedir; + + /* Success */ + return dirp; + + /* Failure */ +exit_closedir: + _wclosedir(dirp); + return NULL; +} + +/* + * Read next directory entry. + * + * Returns pointer to static directory entry which may be overwritten by + * subsequent calls to _wreaddir(). + */ +static struct _wdirent *_wreaddir(_WDIR *dirp) { - _WDIR *dirp = NULL; - int error; - - /* Must have directory name */ - if (dirname == NULL || dirname0 == '\0') { - dirent_set_errno (ENOENT); - return NULL; - } - - /* Allocate new _WDIR structure */ - dirp = (_WDIR*) malloc (sizeof (struct _WDIR)); - if (dirp != NULL) { - DWORD n; - - /* Reset _WDIR structure */ - dirp->handle = INVALID_HANDLE_VALUE; - dirp->patt = NULL; - dirp->cached = 0; - - /* Compute the length of full path plus zero terminator - * - * Note that on WinRT there's no way to convert relative paths - * into absolute paths, so just assume its an absolute path. - */ -# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - n = wcslen(dirname); -# else - n = GetFullPathNameW (dirname, 0, NULL, NULL); -# endif - - /* Allocate room for absolute directory name and search pattern */ - dirp->patt = (wchar_t*) malloc (sizeof (wchar_t) * n + 16); - if (dirp->patt) { - - /* - * Convert relative directory name to an absolute one. This - * allows rewinddir() to function correctly even when current - * working directory is changed between opendir() and rewinddir(). - * - * Note that on WinRT there's no way to convert relative paths - * into absolute paths, so just assume its an absolute path. - */ -# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) - wcsncpy_s(dirp->patt, n+1, dirname, n); -# else - n = GetFullPathNameW (dirname, n, dirp->patt, NULL); -# endif - if (n > 0) { - wchar_t *p; - - /* Append search pattern \* to the directory name */ - p = dirp->patt + n; - if (dirp->patt < p) { - switch (p-1) { - case '\\': - case '/': - case ':': - /* Directory ends in path separator, e.g. c:\temp\ */ - /*NOP*/; - break; - - default: - /* Directory name doesn't end in path separator */ - *p++ = '\\'; - } - } - *p++ = '*'; - *p = '\0'; - - /* Open directory stream and retrieve the first entry */ - if (dirent_first (dirp)) { - /* Directory stream opened successfully */ - error = 0; - } else { - /* Cannot retrieve first entry */ - error = 1; - dirent_set_errno (ENOENT); - } - - } else { - /* Cannot retrieve full path name */ - dirent_set_errno (ENOENT); - error = 1; - } - - } else { - /* Cannot allocate memory for search pattern */ - error = 1; - } - - } else { - /* Cannot allocate _WDIR structure */ - error = 1; - } - - /* Clean up in case of error */ - if (error && dirp) { - _wclosedir (dirp); - dirp = NULL; - } - - return dirp; + /* + * Read directory entry to buffer. We can safely ignore the return + * value as entry will be set to NULL in case of error. + */ + struct _wdirent *entry; + (void) _wreaddir_r(dirp, &dirp->ent, &entry); + + /* Return pointer to statically allocated directory entry */ + return entry; } /* - * Read next directory entry. The directory entry is returned in dirent - * structure in the d_name field. Individual directory entries returned by - * this function include regular files, sub-directories, pseudo-directories - * "." and ".." as well as volume labels, hidden files and system files. + * Read next directory entry. + * + * Returns zero on success. If end of directory stream is reached, then sets + * result to NULL and returns zero. */ -static struct _wdirent* -_wreaddir( - _WDIR *dirp) +static int _wreaddir_r( + _WDIR *dirp, struct _wdirent *entry, struct _wdirent **result) { - WIN32_FIND_DATAW *datap; - struct _wdirent *entp; - - /* Read next directory entry */ - datap = dirent_next (dirp); - if (datap) { - size_t n; - DWORD attr; - - /* Pointer to directory entry to return */ - entp = &dirp->ent; - - /* - * Copy file name as wide-character string. If the file name is too - * long to fit in to the destination buffer, then truncate file name - * to PATH_MAX characters and zero-terminate the buffer. - */ - n = 0; - while (n + 1 < PATH_MAX && datap->cFileNamen != 0) { - entp->d_namen = datap->cFileNamen; - n++; - } - dirp->ent.d_namen = 0; - - /* Length of file name excluding zero terminator */ - entp->d_namlen = n; - - /* File type */ - attr = datap->dwFileAttributes; - if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) { - entp->d_type = DT_CHR; - } else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) { - entp->d_type = DT_DIR; - } else { - entp->d_type = DT_REG; - } - - /* Reset dummy fields */ - entp->d_ino = 0; - entp->d_reclen = sizeof (struct _wdirent); - - } else { - - /* Last directory entry read */ - entp = NULL; - - } - - return entp; + /* Read next directory entry */ + WIN32_FIND_DATAW *datap = dirent_next(dirp); + if (!datap) { + /* Return NULL to indicate end of directory */ + *result = NULL; + return /*OK*/0; + } + + /* + * Copy file name as wide-character string. If the file name is too + * long to fit in to the destination buffer, then truncate file name + * to PATH_MAX characters and zero-terminate the buffer. + */ + size_t n = 0; + while (n < PATH_MAX && datap->cFileNamen != 0) { + entry->d_namen = datap->cFileNamen; + n++; + } + entry->d_namen = 0; + + /* Length of file name excluding zero terminator */ + entry->d_namlen = n; + + /* File type */ + DWORD attr = datap->dwFileAttributes; + if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) + entry->d_type = DT_CHR; + else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) + entry->d_type = DT_DIR; + else + entry->d_type = DT_REG; + + /* Reset dummy fields */ + entry->d_ino = 0; + entry->d_off = 0; + entry->d_reclen = sizeof(struct _wdirent); + + /* Set result address */ + *result = entry; + return /*OK*/0; } /* @@ -492,438 +524,505 @@ * DIR structure as well as any directory entry read previously by * _wreaddir(). */ -static int -_wclosedir( - _WDIR *dirp) +static int _wclosedir(_WDIR *dirp) { - int ok; - if (dirp) { - - /* Release search handle */ - if (dirp->handle != INVALID_HANDLE_VALUE) { - FindClose (dirp->handle); - dirp->handle = INVALID_HANDLE_VALUE; - } - - /* Release search pattern */ - if (dirp->patt) { - free (dirp->patt); - dirp->patt = NULL; - } - - /* Release directory structure */ - free (dirp); - ok = /*success*/0; - - } else { - /* Invalid directory stream */ - dirent_set_errno (EBADF); - ok = /*failure*/-1; - } - return ok; + if (!dirp) { + dirent_set_errno(EBADF); + return /*failure*/-1; + } + + /* Release search handle */ + if (dirp->handle != INVALID_HANDLE_VALUE) + FindClose(dirp->handle); + + /* Release search pattern */ + free(dirp->patt); + + /* Release directory structure */ + free(dirp); + return /*success*/0; } /* * Rewind directory stream such that _wreaddir() returns the very first * file name again. */ -static void -_wrewinddir( - _WDIR* dirp) +static void _wrewinddir(_WDIR* dirp) { - if (dirp) { - /* Release existing search handle */ - if (dirp->handle != INVALID_HANDLE_VALUE) { - FindClose (dirp->handle); - } - - /* Open new search handle */ - dirent_first (dirp); - } -} - -/* Get first directory entry (internal) */ -static WIN32_FIND_DATAW* -dirent_first( - _WDIR *dirp) -{ - WIN32_FIND_DATAW *datap; - - /* Open directory and retrieve the first entry */ - dirp->handle = FindFirstFileExW( - dirp->patt, FindExInfoStandard, &dirp->data, - FindExSearchNameMatch, NULL, 0); - if (dirp->handle != INVALID_HANDLE_VALUE) { + if (!dirp) + return; - /* a directory entry is now waiting in memory */ - datap = &dirp->data; - dirp->cached = 1; + /* Release existing search handle */ + if (dirp->handle != INVALID_HANDLE_VALUE) + FindClose(dirp->handle); - } else { - - /* Failed to re-open directory: no directory entry in memory */ - dirp->cached = 0; - datap = NULL; - - } - return datap; + /* Open new search handle */ + dirent_first(dirp); } -/* Get next directory entry (internal) */ -static WIN32_FIND_DATAW* -dirent_next( - _WDIR *dirp) +/* Get first directory entry */ +static WIN32_FIND_DATAW *dirent_first(_WDIR *dirp) { - WIN32_FIND_DATAW *p; - - /* Get next directory entry */ - if (dirp->cached != 0) { - - /* A valid directory entry already in memory */ - p = &dirp->data; - dirp->cached = 0; - - } else if (dirp->handle != INVALID_HANDLE_VALUE) { - - /* Get the next directory entry from stream */ - if (FindNextFileW (dirp->handle, &dirp->data) != FALSE) { - /* Got a file */ - p = &dirp->data; - } else { - /* The very last entry has been processed or an error occured */ - FindClose (dirp->handle); - dirp->handle = INVALID_HANDLE_VALUE; - p = NULL; - } - - } else { - - /* End of directory stream reached */ - p = NULL; - - } - - return p; + if (!dirp) + return NULL; + + /* Open directory and retrieve the first entry */ + dirp->handle = FindFirstFileExW( + dirp->patt, FindExInfoStandard, &dirp->data, + FindExSearchNameMatch, NULL, 0); + if (dirp->handle == INVALID_HANDLE_VALUE) + goto error; + + /* A directory entry is now waiting in memory */ + dirp->cached = 1; + return &dirp->data; + +error: + /* Failed to open directory: no directory entry in memory */ + dirp->cached = 0; + + /* Set error code */ + DWORD errorcode = GetLastError(); + switch (errorcode) { + case ERROR_ACCESS_DENIED: + /* No read access to directory */ + dirent_set_errno(EACCES); + break; + + case ERROR_DIRECTORY: + /* Directory name is invalid */ + dirent_set_errno(ENOTDIR); + break; + + case ERROR_PATH_NOT_FOUND: + default: + /* Cannot find the file */ + dirent_set_errno(ENOENT); + } + return NULL; } -/* - * Open directory stream using plain old C-string. - */ -static DIR* -opendir( - const char *dirname) +/* Get next directory entry */ +static WIN32_FIND_DATAW *dirent_next(_WDIR *dirp) { - struct DIR *dirp; - int error; - - /* Must have directory name */ - if (dirname == NULL || dirname0 == '\0') { - dirent_set_errno (ENOENT); - return NULL; - } - - /* Allocate memory for DIR structure */ - dirp = (DIR*) malloc (sizeof (struct DIR)); - if (dirp) { - wchar_t wnamePATH_MAX; - size_t n; - - /* Convert directory name to wide-character string */ - error = dirent_mbstowcs_s (&n, wname, PATH_MAX, dirname, PATH_MAX); - if (!error) { - - /* Open directory stream using wide-character name */ - dirp->wdirp = _wopendir (wname); - if (dirp->wdirp) { - /* Directory stream opened */ - error = 0; - } else { - /* Failed to open directory stream */ - error = 1; - } - - } else { - /* - * Cannot convert file name to wide-character string. This - * occurs if the string contains invalid multi-byte sequences or - * the output buffer is too small to contain the resulting - * string. - */ - error = 1; - } - - } else { - /* Cannot allocate DIR structure */ - error = 1; - } - - /* Clean up in case of error */ - if (error && dirp) { - free (dirp); - dirp = NULL; - } - - return dirp; + /* Is the next directory entry already in cache? */ + if (dirp->cached) { + /* Yes, a valid directory entry found in memory */ + dirp->cached = 0; + return &dirp->data; + } + + /* No directory entry in cache */ + if (dirp->handle == INVALID_HANDLE_VALUE) + return NULL; + + /* Read the next directory entry from stream */ + if (FindNextFileW(dirp->handle, &dirp->data) == FALSE) + goto exit_close; + + /* Success */ + return &dirp->data; + + /* Failure */ +exit_close: + FindClose(dirp->handle); + dirp->handle = INVALID_HANDLE_VALUE; + return NULL; } -/* - * Read next directory entry. - * - * When working with text consoles, please note that file names returned by - * readdir() are represented in the default ANSI code page while any output to - * console is typically formatted on another code page. Thus, non-ASCII - * characters in file names will not usually display correctly on console. The - * problem can be fixed in two ways: (1) change the character set of console - * to 1252 using chcp utility and use Lucida Console font, or (2) use - * _cprintf function when writing to console. The _cprinf() will re-encode - * ANSI strings to the console code page so many non-ASCII characters will - * display correcly. - */ -static struct dirent* -readdir( - DIR *dirp) +/* Open directory stream using plain old C-string */ +static DIR *opendir(const char *dirname) { - WIN32_FIND_DATAW *datap; - struct dirent *entp; - - /* Read next directory entry */ - datap = dirent_next (dirp->wdirp); - if (datap) { - size_t n; - int error; - - /* Attempt to convert file name to multi-byte string */ - error = dirent_wcstombs_s( - &n, dirp->ent.d_name, PATH_MAX, datap->cFileName, PATH_MAX); - - /* - * If the file name cannot be represented by a multi-byte string, - * then attempt to use old 8+3 file name. This allows traditional - * Unix-code to access some file names despite of unicode - * characters, although file names may seem unfamiliar to the user. - * - * Be ware that the code below cannot come up with a short file - * name unless the file system provides one. At least - * VirtualBox shared folders fail to do this. - */ - if (error && datap->cAlternateFileName0 != '\0') { - error = dirent_wcstombs_s( - &n, dirp->ent.d_name, PATH_MAX, - datap->cAlternateFileName, PATH_MAX); - } - - if (!error) { - DWORD attr; - - /* Initialize directory entry for return */ - entp = &dirp->ent; - - /* Length of file name excluding zero terminator */ - entp->d_namlen = n - 1; - - /* File attributes */ - attr = datap->dwFileAttributes; - if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) { - entp->d_type = DT_CHR; - } else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) { - entp->d_type = DT_DIR; - } else { - entp->d_type = DT_REG; - } - - /* Reset dummy fields */ - entp->d_ino = 0; - entp->d_reclen = sizeof (struct dirent); - - } else { - /* - * Cannot convert file name to multi-byte string so construct - * an errornous directory entry and return that. Note that - * we cannot return NULL as that would stop the processing - * of directory entries completely. - */ - entp = &dirp->ent; - entp->d_name0 = '?'; - entp->d_name1 = '\0'; - entp->d_namlen = 1; - entp->d_type = DT_UNKNOWN; - entp->d_ino = 0; - entp->d_reclen = 0; - } - - } else { - /* No more directory entries */ - entp = NULL; - } - - return entp; + /* Must have directory name */ + if (dirname == NULL || dirname0 == '\0') { + dirent_set_errno(ENOENT); + return NULL; + } + + /* Allocate memory for DIR structure */ + struct DIR *dirp = (DIR*) malloc(sizeof(struct DIR)); + if (!dirp) + return NULL; + + /* Convert directory name to wide-character string */ + wchar_t wnamePATH_MAX + 1; + size_t n; + int error = mbstowcs_s(&n, wname, PATH_MAX + 1, dirname, PATH_MAX+1); + if (error) + goto exit_failure; + + /* Open directory stream using wide-character name */ + dirp->wdirp = _wopendir(wname); + if (!dirp->wdirp) + goto exit_failure; + + /* Success */ + return dirp; + + /* Failure */ +exit_failure: + free(dirp); + return NULL; } -/* - * Close directory stream. - */ -static int -closedir( - DIR *dirp) +/* Read next directory entry */ +static struct dirent *readdir(DIR *dirp) { - int ok; - if (dirp) { - - /* Close wide-character directory stream */ - ok = _wclosedir (dirp->wdirp); - dirp->wdirp = NULL; - - /* Release multi-byte character version */ - free (dirp); - - } else { - - /* Invalid directory stream */ - dirent_set_errno (EBADF); - ok = /*failure*/-1; - - } - return ok; + /* + * Read directory entry to buffer. We can safely ignore the return + * value as entry will be set to NULL in case of error. + */ + struct dirent *entry; + (void) readdir_r(dirp, &dirp->ent, &entry); + + /* Return pointer to statically allocated directory entry */ + return entry; } /* - * Rewind directory stream to beginning. + * Read next directory entry into called-allocated buffer. + * + * Returns zero on success. If the end of directory stream is reached, then + * sets result to NULL and returns zero. */ -static void -rewinddir( - DIR* dirp) +static int readdir_r( + DIR *dirp, struct dirent *entry, struct dirent **result) { - /* Rewind wide-character string directory stream */ - _wrewinddir (dirp->wdirp); + /* Read next directory entry */ + WIN32_FIND_DATAW *datap = dirent_next(dirp->wdirp); + if (!datap) { + /* No more directory entries */ + *result = NULL; + return /*OK*/0; + } + + /* Attempt to convert file name to multi-byte string */ + size_t n; + int error = wcstombs_s( + &n, entry->d_name, PATH_MAX + 1, + datap->cFileName, PATH_MAX + 1); + + /* + * If the file name cannot be represented by a multi-byte string, then + * attempt to use old 8+3 file name. This allows the program to + * access files although file names may seem unfamiliar to the user. + * + * Be ware that the code below cannot come up with a short file name + * unless the file system provides one. At least VirtualBox shared + * folders fail to do this. + */ + if (error && datap->cAlternateFileName0 != '\0') { + error = wcstombs_s( + &n, entry->d_name, PATH_MAX + 1, + datap->cAlternateFileName, PATH_MAX + 1); + } + + if (!error) { + /* Length of file name excluding zero terminator */ + entry->d_namlen = n - 1; + + /* File attributes */ + DWORD attr = datap->dwFileAttributes; + if ((attr & FILE_ATTRIBUTE_DEVICE) != 0) + entry->d_type = DT_CHR; + else if ((attr & FILE_ATTRIBUTE_DIRECTORY) != 0) + entry->d_type = DT_DIR; + else + entry->d_type = DT_REG; + + /* Reset dummy fields */ + entry->d_ino = 0; + entry->d_off = 0; + entry->d_reclen = sizeof(struct dirent); + } else { + /* + * Cannot convert file name to multi-byte string so construct + * an erroneous directory entry and return that. Note that + * we cannot return NULL as that would stop the processing + * of directory entries completely. + */ + entry->d_name0 = '?'; + entry->d_name1 = '\0'; + entry->d_namlen = 1; + entry->d_type = DT_UNKNOWN; + entry->d_ino = 0; + entry->d_off = -1; + entry->d_reclen = 0; + } + + /* Return pointer to directory entry */ + *result = entry; + return /*OK*/0; } -/* Convert multi-byte string to wide character string */ -static int -dirent_mbstowcs_s( - size_t *pReturnValue, - wchar_t *wcstr, - size_t sizeInWords, - const char *mbstr, - size_t count) +/* Close directory stream */ +static int closedir(DIR *dirp) { - int error; - -#if defined(_MSC_VER) && _MSC_VER >= 1400 - - /* Microsoft Visual Studio 2005 or later */ - error = mbstowcs_s (pReturnValue, wcstr, sizeInWords, mbstr, count); - -#else - - /* Older Visual Studio or non-Microsoft compiler */ - size_t n; + int ok; - /* Convert to wide-character string (or count characters) */ - n = mbstowcs (wcstr, mbstr, sizeInWords); - if (!wcstr || n < count) { + if (!dirp) + goto exit_failure; - /* Zero-terminate output buffer */ - if (wcstr && sizeInWords) { - if (n >= sizeInWords) { - n = sizeInWords - 1; - } - wcstrn = 0; - } + /* Close wide-character directory stream */ + ok = _wclosedir(dirp->wdirp); + dirp->wdirp = NULL; - /* Length of resuting multi-byte string WITH zero terminator */ - if (pReturnValue) { - *pReturnValue = n + 1; - } + /* Release multi-byte character version */ + free(dirp); + return ok; - /* Success */ - error = 0; - - } else { - - /* Could not convert string */ - error = 1; - - } - -#endif - - return error; +exit_failure: + /* Invalid directory stream */ + dirent_set_errno(EBADF); + return /*failure*/-1; } -/* Convert wide-character string to multi-byte string */ -static int -dirent_wcstombs_s( - size_t *pReturnValue, - char *mbstr, - size_t sizeInBytes, /* max size of mbstr */ - const wchar_t *wcstr, - size_t count) +/* Rewind directory stream to beginning */ +static void rewinddir(DIR* dirp) { - int error; - -#if defined(_MSC_VER) && _MSC_VER >= 1400 + if (!dirp) + return; - /* Microsoft Visual Studio 2005 or later */ - error = wcstombs_s (pReturnValue, mbstr, sizeInBytes, wcstr, count); - -#else - - /* Older Visual Studio or non-Microsoft compiler */ - size_t n; - - /* Convert to multi-byte string (or count the number of bytes needed) */ - n = wcstombs (mbstr, wcstr, sizeInBytes); - if (!mbstr || n < count) { - - /* Zero-terminate output buffer */ - if (mbstr && sizeInBytes) { - if (n >= sizeInBytes) { - n = sizeInBytes - 1; - } - mbstrn = '\0'; - } - - /* Length of resulting multi-bytes string WITH zero-terminator */ - if (pReturnValue) { - *pReturnValue = n + 1; - } + /* Rewind wide-character string directory stream */ + _wrewinddir(dirp->wdirp); +} - /* Success */ - error = 0; +/* Scan directory for entries */ +static int scandir( + const char *dirname, struct dirent ***namelist, + int (*filter)(const struct dirent*), + int (*compare)(const struct dirent**, const struct dirent**)) +{ + int result; + + /* Open directory stream */ + DIR *dir = opendir(dirname); + if (!dir) { + /* Cannot open directory */ + return /*Error*/ -1; + } + + /* Read directory entries to memory */ + struct dirent *tmp = NULL; + struct dirent **files = NULL; + size_t size = 0; + size_t allocated = 0; + while (1) { + /* Allocate room for a temporary directory entry */ + if (!tmp) { + tmp = (struct dirent*) malloc(sizeof(struct dirent)); + if (!tmp) + goto exit_failure; + } + + /* Read directory entry to temporary area */ + struct dirent *entry; + if (readdir_r(dir, tmp, &entry) != /*OK*/0) + goto exit_failure; + + /* Stop if we already read the last directory entry */ + if (entry == NULL) + goto exit_success; + + /* Determine whether to include the entry in results */ + if (filter && !filter(tmp)) + continue; + + /* Enlarge pointer table to make room for another pointer */ + if (size >= allocated) { + /* Compute number of entries in the new table */ + size_t num_entries = size * 2 + 16; + + /* Allocate new pointer table or enlarge existing */ + void *p = realloc(files, sizeof(void*) * num_entries); + if (!p) + goto exit_failure; + + /* Got the memory */ + files = (dirent**) p; + allocated = num_entries; + } + + /* Store the temporary entry to ptr table */ + filessize++ = tmp; + tmp = NULL; + } + +exit_failure: + /* Release allocated file entries */ + for (size_t i = 0; i < size; i++) { + free(filesi); + } + + /* Release the pointer table */ + free(files); + files = NULL; + + /* Exit with error code */ + result = /*error*/ -1; + goto exit_status; + +exit_success: + /* Sort directory entries */ + qsort(files, size, sizeof(void*), + (int (*) (const void*, const void*)) compare); + + /* Pass pointer table to caller */ + if (namelist) + *namelist = files; + + /* Return the number of directory entries read */ + result = (int) size; + +exit_status: + /* Release temporary directory entry, if we had one */ + free(tmp); + + /* Close directory stream */ + closedir(dir); + return result; +} - } else { +/* Alphabetical sorting */ +static int alphasort(const struct dirent **a, const struct dirent **b) +{ + return strcoll((*a)->d_name, (*b)->d_name); +} - /* Cannot convert string */ - error = 1; +/* Sort versions */ +static int versionsort(const struct dirent **a, const struct dirent **b) +{ + return strverscmp((*a)->d_name, (*b)->d_name); +} - } +/* Compare strings */ +static int strverscmp(const char *a, const char *b) +{ + size_t i = 0; + size_t j; + + /* Find first difference */ + while (ai == bi) { + if (ai == '\0') { + /* No difference */ + return 0; + } + ++i; + } + + /* Count backwards and find the leftmost digit */ + j = i; + while (j > 0 && isdigit((unsigned char)aj-1)) { + --j; + } + + /* Determine mode of comparison */ + if (aj == '0' || bj == '0') { + /* Find the next non-zero digit */ + while (aj == '0' && aj == bj) { + j++; + } + + /* String with more digits is smaller, e.g 002 < 01 */ + if (isdigit((unsigned char)aj)) { + if (!isdigit((unsigned char)bj)) { + return -1; + } + } else if ((unsigned char)isdigit(bj)) { + return 1; + } + } else if ((unsigned char)isdigit(aj) && + isdigit((unsigned char)bj)) { + /* Numeric comparison */ + size_t k1 = j; + size_t k2 = j; + + /* Compute number of digits in each string */ + while (isdigit((unsigned char)ak1)) { + k1++; + } + while (isdigit((unsigned char)bk2)) { + k2++; + } + + /* Number with more digits is bigger, e.g 999 < 1000 */ + if (k1 < k2) + return -1; + else if (k1 > k2) + return 1; + } + + /* Alphabetical comparison */ + return (int) ((unsigned char) ai) - ((unsigned char) bi); +} +/* Convert multi-byte string to wide character string */ +#if !defined(_MSC_VER) || _MSC_VER < 1400 +static int dirent_mbstowcs_s( + size_t *pReturnValue, wchar_t *wcstr, + size_t sizeInWords, const char *mbstr, size_t count) +{ + /* Older Visual Studio or non-Microsoft compiler */ + size_t n = mbstowcs(wcstr, mbstr, sizeInWords); + if (wcstr && n >= count) + return /*error*/ 1; + + /* Zero-terminate output buffer */ + if (wcstr && sizeInWords) { + if (n >= sizeInWords) + n = sizeInWords - 1; + wcstrn = 0; + } + + /* Length of multi-byte string with zero terminator */ + if (pReturnValue) { + *pReturnValue = n + 1; + } + + /* Success */ + return 0; +} #endif - return error; +/* Convert wide-character string to multi-byte string */ +#if !defined(_MSC_VER) || _MSC_VER < 1400 +static int dirent_wcstombs_s( + size_t *pReturnValue, char *mbstr, + size_t sizeInBytes, const wchar_t *wcstr, size_t count) +{ + /* Older Visual Studio or non-Microsoft compiler */ + size_t n = wcstombs(mbstr, wcstr, sizeInBytes); + if (mbstr && n >= count) + return /*error*/1; + + /* Zero-terminate output buffer */ + if (mbstr && sizeInBytes) { + if (n >= sizeInBytes) { + n = sizeInBytes - 1; + } + mbstrn = '\0'; + } + + /* Length of resulting multi-bytes string WITH zero-terminator */ + if (pReturnValue) { + *pReturnValue = n + 1; + } + + /* Success */ + return 0; } +#endif /* Set errno variable */ -static void -dirent_set_errno( - int error) +#if !defined(_MSC_VER) || _MSC_VER < 1400 +static void dirent_set_errno(int error) { -#if defined(_MSC_VER) && _MSC_VER >= 1400 - - /* Microsoft Visual Studio 2005 and later */ - _set_errno (error); - -#else - - /* Non-Microsoft compiler or older Microsoft compiler */ - errno = error; - -#endif + /* Non-Microsoft compiler or older Microsoft compiler */ + errno = error; } - +#endif #ifdef __cplusplus } #endif #endif /*DIRENT_H*/ -
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/ltmain.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/ltmain.sh
Changed
@@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.4.7 +package_revision=2.4.7 ## ------ ## @@ -64,34 +64,25 @@ # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# <https://opensource.org/license/MIT>, and GPL version 2 or later +# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# <https://github.com/gnulib-modules/bootstrap/issues> ## ------ ## @@ -139,9 +130,12 @@ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -159,6 +153,26 @@ fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ s/\\(^$_G_bs\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,85 +1134,203 @@ } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *\\\`\"\$*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break fi - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *\\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ *|**|"") - _G_quoted_arg=\"$_G_unquoted_arg\" + # Quote for eval. + case $func_quote_portable_result in + *\\\`\"\$*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*\\*\?*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; + *) ;; esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift + break done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *\\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ *|**|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac } -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - case $1 in - *\\\`\"*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *\\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ *|**|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} - func_quote_for_expand_result=$_G_arg + +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1215,8 +1376,8 @@ _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1241,8 +1402,8 @@ _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1369,30 +1530,26 @@ # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# <https://opensource.org/license/MIT>, and GPL version 2 or later +# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. +# Please report bugs or propose patches to: +# <https://github.com/gnulib-modules/bootstrap/issues> -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1415,7 +1572,7 @@ # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1427,7 +1584,7 @@ # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1476,8 +1633,8 @@ ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1510,7 +1667,8 @@ # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1519,10 +1677,28 @@ } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME ARG... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1532,22 +1708,19 @@ case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1557,10 +1730,18 @@ ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '<hooked_function_name>_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '<hooked_function_name>_result', escaped +# suitably for 'eval'. +# +# The '<hooked_function_name>_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1570,9 +1751,8 @@ # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1581,25 +1761,36 @@ # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1610,17 +1801,26 @@ # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish ARG... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options ARG... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1630,17 +1830,27 @@ { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1649,9 +1859,8 @@ # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1662,9 +1871,7 @@ opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1676,25 +1883,32 @@ { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1704,7 +1918,10 @@ ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1757,15 +1974,24 @@ shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1782,12 +2008,10 @@ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1843,8 +2067,8 @@ # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1859,8 +2083,9 @@ func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1870,7 +2095,7 @@ func_split_equals_lhs=`expr "x$1" : 'x\(^=*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x^=*=\(.*\)$'` } fi #func_split_equals @@ -1896,7 +2121,7 @@ { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -1938,31 +2163,44 @@ # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\) 0-9,-* ,-\(1-90-9* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\) 0-9,-* ,-\(1-90-9* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -1972,12 +2210,12 @@ # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... @@ -2068,7 +2306,7 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` @@ -2124,7 +2362,7 @@ # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2270,6 +2508,8 @@ nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2293,11 +2533,16 @@ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2309,9 +2554,12 @@ { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2386,15 +2634,20 @@ func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2451,8 +2704,8 @@ } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -3418,8 +3671,8 @@ esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '~#^*{};<>?"'"'"' &()|`$' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3492,8 +3745,8 @@ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3648,7 +3901,8 @@ -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3754,6 +4008,8 @@ -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4096,8 +4352,8 @@ case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4107,8 +4363,8 @@ # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *\\\ /cp\ *) install_cp=: ;; @@ -4165,12 +4421,12 @@ esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4181,8 +4437,8 @@ if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4478,8 +4734,8 @@ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -5258,7 +5514,8 @@ if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5268,7 +5525,7 @@ \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -6611,9 +6868,9 @@ while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6849,6 +7106,13 @@ prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7019,7 +7283,7 @@ # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7039,7 +7303,7 @@ esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7069,8 +7333,20 @@ prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" @@ -7211,9 +7487,9 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7227,16 +7503,21 @@ save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7254,8 +7535,8 @@ # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7272,12 +7553,17 @@ # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -Wa,* Pass flags directly to the assembler -64|-mips0-9|-r0-90-9*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t45*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7298,15 +7584,15 @@ continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7426,8 +7712,8 @@ *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg @@ -8632,7 +8918,7 @@ test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8805,7 +9091,7 @@ # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor @@ -8896,7 +9182,7 @@ versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9122,7 +9408,7 @@ *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -9935,8 +10221,8 @@ for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10029,8 +10315,8 @@ eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? @@ -10508,12 +10794,13 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. @@ -10753,13 +11040,15 @@ elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/m4/libtool.m4 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/m4/libtool.m4
Changed
@@ -1,6 +1,7 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -31,7 +32,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. ) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -181,6 +182,7 @@ m4_require(_LT_CHECK_SHELL_FEATURES)dnl m4_require(_LT_PATH_CONVERSION_FUNCTIONS)dnl m4_require(_LT_CMD_RELOAD)dnl +m4_require(_LT_DECL_FILECMD)dnl m4_require(_LT_CHECK_MAGIC_METHOD)dnl m4_require(_LT_CHECK_SHAREDLIB_FROM_LINKLIB)dnl m4_require(_LT_CMD_OLD_ARCHIVE)dnl @@ -219,8 +221,8 @@ ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -778,7 +780,7 @@ # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1042,8 +1044,8 @@ _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1067,17 +1069,12 @@ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin91*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.012,.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.012,*|,*powerpc*-darwin5-8*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1126,12 +1123,12 @@ output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if($1, CXX, if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ,) else @@ -1245,7 +1242,8 @@ # _LT_WITH_SYSROOT # ---------------- AC_DEFUN(_LT_WITH_SYSROOT, -AC_MSG_CHECKING(for sysroot) +m4_require(_LT_DECL_SED)dnl +AC_MSG_CHECKING(for sysroot) AC_ARG_WITH(sysroot, AS_HELP_STRING(--with-sysroot@<:@=DIR@:>@, Search for dependent libraries within DIR (or the compiler's sysroot @@ -1262,7 +1260,7 @@ fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1292,7 +1290,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1309,7 +1307,7 @@ echo '#line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1321,7 +1319,7 @@ ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1343,7 +1341,7 @@ echo '#line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1351,7 +1349,7 @@ emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1359,7 +1357,7 @@ emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1379,14 +1377,14 @@ # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1454,7 +1452,7 @@ # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1493,9 +1491,22 @@ m4_defun(_LT_PROG_AR, AC_CHECK_TOOLS(AR, ar, false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL(, AR, 1, The archiver) -_LT_DECL(, AR_FLAGS, 1, Flags to create an archive) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL(, lt_ar_flags, 0, Flags to create an archive (by configure)) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL(, AR_FLAGS, \@S|@{ARFLAGS-"\@S|@lt_ar_flags"}, + Flags to create an archive) AC_CACHE_CHECK(for archiver @FILE support, lt_cv_ar_at_file, lt_cv_ar_at_file=no @@ -1714,7 +1725,7 @@ lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1757,7 +1768,7 @@ sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.* //'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.* //'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2207,26 +2218,35 @@ striplib= old_striplib= AC_MSG_CHECKING(whether stripping libraries is possible) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT(yes) +if test -z "$STRIP"; then + AC_MSG_RESULT(no) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT(yes) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT(yes) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + ;; + *) AC_MSG_RESULT(no) - fi - ;; - *) - AC_MSG_RESULT(no) - ;; - esac + ;; + esac + fi fi _LT_DECL(, old_striplib, 1, Commands to strip libraries) _LT_DECL(, striplib, 1) @@ -2549,7 +2569,7 @@ case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' m4_if($1, , sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api") ;; @@ -2559,14 +2579,14 @@ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2585,7 +2605,7 @@ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\(a-zA-Z\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\(a-zA-Z\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2622,7 +2642,7 @@ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/./-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2655,7 +2675,7 @@ shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3454,7 +3474,7 @@ bsdi45*) lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3488,14 +3508,14 @@ lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i3-986 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3509,7 +3529,7 @@ ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s0-90-90-9|ELF-0-90-9) shared object file - IA64' @@ -3556,7 +3576,7 @@ newos6*) lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3683,13 +3703,13 @@ mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3715,7 +3735,7 @@ # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, dumpbin "link -dump", :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3955,7 +3975,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3973,20 +3993,20 @@ # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4010,7 +4030,7 @@ if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -4028,9 +4048,9 @@ " s1~prfx {split(s1,t,\"@\"); print f,t1,substr(t1,length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.* \($symcode$symcode*\) *$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.* \($symcode$symcode*\) *$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4317,7 +4337,7 @@ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4400,7 +4420,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4736,7 +4756,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ 1-7.* | *Sun*Fortran*\ 8.0-3*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4919,7 +4939,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4927,7 +4947,7 @@ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4984,15 +5004,15 @@ case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5044,7 +5064,7 @@ _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ 01.* | *\ 2.0-9.* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5156,6 +5176,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix3-9*) @@ -5170,7 +5191,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5213,7 +5234,7 @@ _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5225,7 +5246,7 @@ if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -5241,7 +5262,7 @@ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5373,7 +5394,7 @@ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\(^B*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5556,12 +5577,12 @@ cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5602,7 +5623,7 @@ fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5650,7 +5671,7 @@ ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5861,6 +5882,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6631,8 +6653,8 @@ cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6730,6 +6752,7 @@ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6760,7 +6783,7 @@ _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6897,7 +6920,7 @@ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7037,13 +7060,13 @@ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8189,6 +8212,14 @@ AC_SUBST(DLLTOOL) ) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun(_LT_DECL_FILECMD, +AC_CHECK_TOOL(FILECMD, file, :) +_LT_DECL(, FILECMD, 1, A file(cmd) program that detects file types) +)# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/m4/ltoptions.m4 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/m4/ltoptions.m4
Changed
@@ -1,7 +1,7 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/m4/ltsugar.m4 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/m4/ltsugar.m4
Changed
@@ -1,6 +1,6 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 #
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/m4/ltversion.m4 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/m4/ltversion.m4
Changed
@@ -1,6 +1,7 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +10,15 @@ # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define(LT_PACKAGE_VERSION, 2.4.6) -m4_define(LT_PACKAGE_REVISION, 2.4.6) +m4_define(LT_PACKAGE_VERSION, 2.4.7) +m4_define(LT_PACKAGE_REVISION, 2.4.7) AC_DEFUN(LTVERSION_VERSION, -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, Which release of libtool.m4 was used?) _LT_DECL(, macro_revision, 0) )
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/m4/lt~obsolete.m4 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/m4/lt~obsolete.m4
Changed
@@ -1,7 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/man/pc.5 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/man/pc.5
Changed
@@ -99,6 +99,9 @@ .It Cflags.private Required compiler flags for static compilation. (optional; fragment list; pkgconf extension) +.It Copyright +A copyright attestation statement. +(optional; literal; pkgconf extension) .It Libs Required linking flags for this package. Libraries this package depends on for linking against it, which are not @@ -110,6 +113,13 @@ Libraries this package depends on for linking against it statically, which are not described as dependencies should be specified here. (optional; fragment list) +.It License +The asserted SPDX license tag that should be applied to the given package. +(optional; literal; pkgconf extension) +.It Maintainer +The preferred contact for the maintainer. This should be in the format of a +name followed by an e-mail address or website. +(optional; literal; pkgconf extension) .It Requires Required dependencies that must be met for the package to be usable. All dependencies must be satisfied or the pkg-config implementation must not use @@ -151,6 +161,9 @@ Name: libfoo # human-readable name Description: an example library called libfoo # human-readable description +Copyright: Copyright (c) 2022 pkgconf project authors +License: Apache-2.0 +Maintainer: the pkgconf project <http://www.pkgconf.org> Version: 1.0 URL: http://www.pkgconf.org Requires: libbar > 2.0.0
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/man/pkgconf-personality.5 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/man/pkgconf-personality.5
Changed
@@ -36,7 +36,7 @@ by a colon (:) and then the value the property should be set to. Variable substitution is always performed regardless of property type. .Pp -There are two types of property: +There are three types of property: .\" .Bl -tag -width indent .\"
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/meson.build -> _service:tar_scm:pkgconf-1.9.5.tar.xz/meson.build
Changed
@@ -1,23 +1,41 @@ project('pkgconf', 'c', - version : '1.8.0', + version : '1.9.5', license : 'ISC', - meson_version : '>=0.47') - + meson_version : '>=0.49', + default_options : 'c_std=c99', +) cc = meson.get_compiler('c') +add_project_arguments( + '-D_BSD_SOURCE', + '-D_DEFAULT_SOURCE', + cc.get_supported_arguments( + '-Wimplicit-function-declaration', + '-Wmisleading-indentation', + ), + language : 'c', +) cdata = configuration_data() check_functions = - 'HAVE_STRLCAT', 'strlcat', 'string.h', - 'HAVE_STRLCPY', 'strlcpy', 'string.h', - 'HAVE_STRNDUP', 'strndup', 'string.h', + 'strlcat', 'string.h', + 'strlcpy', 'string.h', + 'strndup', 'string.h', + 'strdup', 'string.h', + 'strncasecmp', 'strings.h', + 'strcasecmp', 'strings.h', + 'reallocarray', 'stdlib.h', foreach f : check_functions - if cc.has_function(f.get(1), prefix : '#include <' + f.get(2) + '>') and cc.has_header_symbol(f.get(2), f.get(1)) - cdata.set(f.get(0), 1) + name = f0.to_upper().underscorify() + if cc.has_function(f0, prefix : '#define _BSD_SOURCE\n#include <@0@>'.format(f1)) and cc.has_header_symbol(f1, f0, prefix : '#define _BSD_SOURCE') + cdata.set('HAVE_@0@'.format(name), 1) + cdata.set('HAVE_DECL_@0@'.format(name), 1) + else + cdata.set('HAVE_DECL_@0@'.format(name), 0) endif endforeach @@ -38,8 +56,8 @@ cdata.set_quoted('PACKAGE_NAME', meson.project_name()) cdata.set_quoted('PACKAGE_VERSION', meson.project_version()) cdata.set_quoted('PACKAGE_BUGREPORT', 'https://todo.sr.ht/~kaniini/pkgconf') -cdata.set('abs_top_srcdir', meson.source_root()) -cdata.set('abs_top_builddir', meson.build_root()) +cdata.set('abs_top_srcdir', meson.current_source_dir()) +cdata.set('abs_top_builddir', meson.current_build_dir()) subdir('libpkgconf') @@ -68,10 +86,22 @@ 'libpkgconf/tuple.c', c_args: '-DLIBPKGCONF_EXPORT', build_static, install : true, - version : '3.0.0', - soversion : '3', + version : '4.0.0', + soversion : '4', +) + +# For other projects using libpkgconfig as a subproject +dep_libpkgconf = declare_dependency( + link_with : libpkgconf, + include_directories : include_directories('.'), ) +# If we have a new enough meson override the dependency so that only +# `dependency('libpkgconf')` is required from the consumer +if meson.version().version_compare('>= 0.54.0') + meson.override_dependency('libpkgconf', dep_libpkgconf) +endif + pkg = import('pkgconfig') pkg.generate(libpkgconf, name : 'libpkgconf', @@ -91,15 +121,12 @@ c_args: build_static, install : true) -if get_option('tests') - kyua_exe = find_program('kyua') - atf_sh_exe = find_program('atf-sh') - test('kyua', kyua_exe, args : '--config=none', 'test', '--kyuafile=' + join_paths(meson.build_root(), 'Kyuafile'), '--build-root=' + meson.build_root()) - - - configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata) - subdir('tests') -endif +with_tests = get_option('tests') +kyua_exe = find_program('kyua', required : with_tests, disabler : true) +atf_sh_exe = find_program('atf-sh', required : with_tests, disabler : true) +kyuafile = configure_file(input : 'Kyuafile.in', output : 'Kyuafile', configuration : cdata) +test('kyua', kyua_exe, args : '--config=none', 'test', '--kyuafile', kyuafile, '--build-root', meson.current_build_dir()) +subdir('tests') install_man('man/pkgconf.1') install_man('man/pkg.m4.7') @@ -107,4 +134,4 @@ install_man('man/pkgconf-personality.5') install_data('pkg.m4', install_dir: 'share/aclocal') install_data('AUTHORS', install_dir: 'share/doc/pkgconf') -install_data('README.md', install_dir: 'share/doc/pkgconf') \ No newline at end of file +install_data('README.md', install_dir: 'share/doc/pkgconf')
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/meson_options.txt -> _service:tar_scm:pkgconf-1.9.5.tar.xz/meson_options.txt
Changed
@@ -1,3 +1,5 @@ -option('tests', type: 'boolean', value: true, - description: 'Build tests which depends upon the kyua framework' -) \ No newline at end of file +option( + 'tests', + type: 'feature', + description: 'Build tests which depends upon the kyua framework', +)
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/missing -> _service:tar_scm:pkgconf-1.9.5.tar.xz/missing
Changed
@@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/pkg.m4 -> _service:tar_scm:pkgconf-1.9.5.tar.xz/pkg.m4
Changed
@@ -1,5 +1,5 @@ -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 11 (pkg-config-0.29.1) +# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> @@ -41,7 +41,7 @@ dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun(PKG_PREREQ, -m4_define(PKG_MACROS_VERSION, 0.29.1) +m4_define(PKG_MACROS_VERSION, 0.29.2) m4_if(m4_version_compare(PKG_MACROS_VERSION, $1), -1, m4_fatal(pkg.m4 version $1 or higher is required but PKG_MACROS_VERSION found)) )dnl PKG_PREREQ @@ -86,7 +86,7 @@ dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE(PKG_PROG_PKG_CONFIG) -dnl only at the first occurence in configure.ac, so if the first place +dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN(PKG_CHECK_EXISTS, @@ -142,7 +142,7 @@ AC_ARG_VAR($1_LIBS, linker flags for $1, overriding pkg-config)dnl pkg_failed=no -AC_MSG_CHECKING(for $1) +AC_MSG_CHECKING(for $2) _PKG_CONFIG($1_CFLAGS, cflags, $2) _PKG_CONFIG($1_LIBS, libs, $2) @@ -152,17 +152,17 @@ See the pkg-config man page for more details.) if test $pkg_failed = yes; then - AC_MSG_RESULT(no) + AC_MSG_RESULT(no) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + $1_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$$1_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + # Put the nasty error message in config.log where it belongs + echo "$$1_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - m4_default($4, AC_MSG_ERROR( + m4_default($4, AC_MSG_ERROR( Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -173,8 +173,8 @@ _PKG_TEXT)dnl ) elif test $pkg_failed = untried; then - AC_MSG_RESULT(no) - m4_default($4, AC_MSG_FAILURE( + AC_MSG_RESULT(no) + m4_default($4, AC_MSG_FAILURE( The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. @@ -184,10 +184,10 @@ To get pkg-config, see <http://pkg-config.freedesktop.org/>.)dnl ) else - $1_CFLAGS=$pkg_cv_$1_CFLAGS - $1_LIBS=$pkg_cv_$1_LIBS + $1_CFLAGS=$pkg_cv_$1_CFLAGS + $1_LIBS=$pkg_cv_$1_LIBS AC_MSG_RESULT(yes) - $3 + $3 fidnl )dnl PKG_CHECK_MODULES
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/basic.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/basic.sh
Changed
@@ -29,6 +29,9 @@ libs_circular_directpc \ libs_static \ libs_static_ordering \ + license_isc \ + license_noassertion \ + modversion_noflatten \ pkg_config_path \ nolibs \ nocflags \ @@ -47,7 +50,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -lfoo \n" \ + -o inline:"-L/test/lib -lfoo\n" \ pkgconf --libs foo } @@ -55,7 +58,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo \n" \ + -o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo\n" \ pkgconf --cflags --libs foo } @@ -64,7 +67,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo \n" \ + -o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo\n" \ pkgconf --cflags --libs 'foo > 1.2' } @@ -72,7 +75,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-I/test/include/foo -fPIC -L/test/lib -lbar -lfoo \n" \ + -o inline:"-fPIC -I/test/include/foo -L/test/lib -lbar -lfoo\n" \ pkgconf --cflags --libs 'foo > 1.2 bar >= 1.3' } @@ -80,7 +83,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-I/test/include/foo -fPIC -L/test/lib -lbar -lfoo \n" \ + -o inline:"-fPIC -I/test/include/foo -L/test/lib -lbar -lfoo\n" \ pkgconf --cflags --libs 'foo > 1.2,bar >= 1.3' } @@ -88,7 +91,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo \n" \ + -o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo\n" \ pkgconf --cflags --libs 'foo' '>' '1.2' } @@ -96,7 +99,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo \n" \ + -o inline:"-fPIC -I/test/include/foo -L/test/lib -lfoo\n" \ pkgconf --cflags --libs 'foo' '!=' '1.3.0' } @@ -176,7 +179,7 @@ export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ -s exit:1 \ - pkgconf --exists 'tilde <= 1.0.0' + pkgconf --exists 'tilde >= 1.0.0' } exists_body() @@ -190,7 +193,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - pkgconf --exists 'tilde >= 1.0.0' + pkgconf --exists 'tilde <= 1.0.0' } exists3_body() @@ -204,30 +207,30 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-lintermediary-1 -lintermediary-2 -lfoo -lbar -lbaz \n" \ + -o inline:"-lintermediary-1 -lintermediary-2 -lfoo -lbar -lbaz\n" \ pkgconf --libs intermediary-1 intermediary-2 } -libs_circular1_body() +libs_circular2_body() { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-lcircular-1 -lcircular-2 -lcircular-3 \n" \ - pkgconf --libs circular-1 + -o inline:"circular-1: breaking circular reference (circular-1 -> circular-2 -> circular-1)\n" \ + pkgconf circular-2 --validate } -libs_circular2_body() +libs_circular1_body() { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-lcircular-3 -lcircular-1 -lcircular-2 \n" \ - pkgconf --libs circular-3 + -o inline:"circular-3: breaking circular reference (circular-3 -> circular-1 -> circular-3)\n" \ + pkgconf circular-1 --validate } libs_circular_directpc_body() { atf_check \ - -o inline:"-lcircular-1 -lcircular-2 -lcircular-3 \n" \ + -o inline:"-lcircular-2 -lcircular-3 -lcircular-1\n" \ pkgconf --libs ${selfdir}/lib1/circular-3.pc } @@ -235,7 +238,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"/libfoo.a -pthread \n" \ + -o inline:"/libfoo.a -pthread\n" \ pkgconf --libs static-archive-libs } @@ -243,7 +246,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -lbar -lfoo \n" \ + -o inline:"-L/test/lib -lbar -lfoo\n" \ pkgconf --libs foo bar } @@ -251,20 +254,20 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1${PATH_SEP}${selfdir}/lib2" atf_check \ - -o inline:"-L/test/lib -lfoo \n" \ + -o inline:"-L/test/lib -lfoo\n" \ pkgconf --libs foo atf_check \ - -o inline:"-L/test/lib -lbar -lfoo \n" \ + -o inline:"-L/test/lib -lbar -lfoo\n" \ pkgconf --libs bar } with_path_body() { atf_check \ - -o inline:"-L/test/lib -lfoo \n" \ + -o inline:"-L/test/lib -lfoo\n" \ pkgconf --with-path=${selfdir}/lib1 --with-path=${selfdir}/lib2 --libs foo atf_check \ - -o inline:"-L/test/lib -lbar -lfoo \n" \ + -o inline:"-L/test/lib -lbar -lfoo\n" \ pkgconf --with-path=${selfdir}/lib1 --with-path=${selfdir}/lib2 --libs bar } @@ -288,7 +291,7 @@ { cp ${selfdir}/lib1/foo.pc . atf_check \ - -o inline:"-L/test/lib -lfoo \n" \ + -o inline:"-L/test/lib -lfoo\n" \ pkgconf --libs foo.pc } @@ -307,3 +310,24 @@ -o inline:"foo\n" \ pkgconf --with-path=${selfdir}/lib3 --print-requires bar } + +license_isc_body() +{ + atf_check \ + -o inline:"foo: ISC\n" \ + pkgconf --with-path=${selfdir}/lib1 --license foo +} + +license_noassertion_body() +{ + atf_check \ + -o inline:"bar: NOASSERTION\nfoo: ISC\n" \ + pkgconf --with-path=${selfdir}/lib1 --license bar +} + +modversion_noflatten_body() +{ + atf_check \ + -o inline:"1.3\n" \ + pkgconf --with-path=${selfdir}/lib1 --modversion bar +}
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/conflicts.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/conflicts.sh
Changed
@@ -10,7 +10,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -lconflicts \n" \ + -o inline:"-L/test/lib -lconflicts\n" \ pkgconf --libs conflicts } @@ -18,6 +18,6 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -lconflicts \n" \ + -o inline:"-L/test/lib -lconflicts\n" \ pkgconf --ignore-conflicts --libs conflicts }
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/framework.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/framework.sh
Changed
@@ -9,12 +9,12 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-F/test/lib -framework framework-1 \n" \ + -o inline:"-F/test/lib -framework framework-1\n" \ pkgconf --libs framework-1 atf_check \ - -o inline:"-F/test/lib -framework framework-2 -framework framework-1 \n" \ + -o inline:"-F/test/lib -framework framework-2 -framework framework-1\n" \ pkgconf --libs framework-2 atf_check \ - -o inline:"-F/test/lib -framework framework-2 -framework framework-1 \n" \ + -o inline:"-F/test/lib -framework framework-2 -framework framework-1\n" \ pkgconf --libs framework-1 framework-2 }
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/billion-laughs.pc
Added
@@ -0,0 +1,13 @@ +v9=lol +v8=${v9}${v9}${v9}${v9}${v9}${v9}${v9}${v9}${v9}${v9} +v7=${v8}${v8}${v8}${v8}${v8}${v8}${v8}${v8}${v8}${v8} +v6=${v7}${v7}${v7}${v7}${v7}${v7}${v7}${v7}${v7}${v7} +v5=${v6}${v6}${v6}${v6}${v6}${v6}${v6}${v6}${v6}${v6} +v4=${v5}${v5}${v5}${v5}${v5}${v5}${v5}${v5}${v5}${v5} +v3=${v4}${v4}${v4}${v4}${v4}${v4}${v4}${v4}${v4}${v4} +v2=${v3}${v3}${v3}${v3}${v3}${v3}${v3}${v3}${v3}${v3} +v1=${v2}${v2}${v2}${v2}${v2}${v2}${v2}${v2}${v2}${v2} +v0=${v1}${v1}${v1}${v1}${v1}${v1}${v1}${v1}${v1}${v1} +Name: One Billion Laughs +Version: ${v0} +Description: Don't install this!
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/lib1/foo.pc -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/foo.pc
Changed
@@ -9,3 +9,4 @@ Libs: -L${libdir} -lfoo Cflags: -fPIC -I${includedir}/foo Cflags.private: -DFOO_STATIC +License: ISC
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/metapackage-1.pc
Added
@@ -0,0 +1,6 @@ +Name: metapackage-1 +Version: 0.1 +Description: metapackage for testing purposes +Requires.private: metapackage-2 +Libs: -lmetapackage-1 +Cflags: -I/metapackage-1
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/metapackage-2.pc
Added
@@ -0,0 +1,5 @@ +Name: metapackage-2 +Version: 0.1 +Description: metapackage for testing purposes +Libs: -lmetapackage-2 +Cflags: -I/metapackage-2
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/metapackage.pc
Added
@@ -0,0 +1,4 @@ +Name: metapackage +Version: 0.1 +Description: metapackage for testing purposes +Requires: metapackage-1, metapackage-2
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/omg-sysroot-uninstalled.pc
Added
@@ -0,0 +1,10 @@ +prefix=${pc_sysrootdir}/test +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: omg-sysroot +Description: A testing pkg-config file +Version: 1.2.3 +Libs: -L${libdir} -lomg +Cflags: -fPIC -I${includedir}/omg
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/lib1/quotes.pc -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/quotes.pc
Changed
@@ -7,4 +7,4 @@ Description: A testing pkg-config file Version: 1.2.3 Libs: -L${libdir} -lfoo -Cflags: -DQUOTED=\"bla\" +Cflags: -DQUOTED=\"bla\" -DA=\"escaped\ string\'\ \literal\" -DB="\1\$" -DC='bla'
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/sysroot-dir-2.pc
Added
@@ -0,0 +1,7 @@ +prefix=${pc_sysrootdir}/usr + +Name: sysroot-dir +Description: Package for testing whether sysroot dirs are repeated or not +Version: 1 +CFlags: -I${prefix}/include +Libs: -L${prefix}/lib -lfoo
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/sysroot-dir-3.pc
Added
@@ -0,0 +1,9 @@ +prefix=/sysroot/usr +includedir=${prefix}/include +libdir=${prefix}/lib + +Name: sysroot-dir +Description: Package for testing whether sysroot dirs are repeated or not +Version: 1 +CFlags: -I${includedir} +Libs: -L${libdir} -lfoo
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/sysroot-dir-4.pc
Added
@@ -0,0 +1,9 @@ +prefix=${pc_sysrootdir}/usr +includedir=${prefix}/include +libdir=${prefix}/lib + +Name: sysroot-dir +Description: Package for testing whether sysroot dirs are repeated or not +Version: 1 +CFlags: -I${includedir} +Libs: -L${libdir} -lfoo
View file
_service:tar_scm:pkgconf-1.9.5.tar.xz/tests/lib1/sysroot-dir-5.pc
Added
@@ -0,0 +1,9 @@ +prefix=/sysroot/usr +includedir=${prefix}/include +libdir=${prefix}/lib + +Name: sysroot-dir +Description: Package for testing whether sysroot dirs are repeated or not +Version: 1 +CFlags: -I${includedir} +Libs: -L${libdir} -lfoo
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/meson.build -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/meson.build
Changed
@@ -18,6 +18,5 @@ # yuck foreach test : tests - configure_file(input: test + '.sh', output: test, copy: true) - run_command('chmod', '755', join_paths(meson.build_root(), 'tests', test)) + test_file = configure_file(input: test + '.sh', output: test, copy: true) endforeach
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/parser.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/parser.sh
Changed
@@ -41,7 +41,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-lfoo \n" \ + -o inline:"-lfoo\n" \ pkgconf --libs comments } @@ -49,7 +49,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-lfoo \n" \ + -o inline:"-lfoo\n" \ pkgconf --libs comments-in-fields } @@ -57,7 +57,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib/dos-lineendings -ldos-lineendings \n" \ + -o inline:"-L/test/lib/dos-lineendings -ldos-lineendings\n" \ pkgconf --libs dos-lineendings } @@ -65,7 +65,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-I/test/include/no-trailing-newline \n" \ + -o inline:"-I/test/include/no-trailing-newline\n" \ pkgconf --cflags no-trailing-newline } @@ -73,7 +73,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-llib-3 -llib-1 -llib-2 -lpthread \n" \ + -o inline:"-llib-3 -llib-1 -llib-2 -lpthread\n" \ pkgconf --libs argv-parse } @@ -90,7 +90,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-llib-1 -pthread /test/lib/lib2.so \n" \ + -o inline:"-llib-1 -pthread /test/lib/lib2.so\n" \ pkgconf --libs argv-parse-3 } @@ -98,10 +98,10 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L~ -ltilde \n" \ + -o inline:"-L~ -ltilde\n" \ pkgconf --libs tilde-quoting atf_check \ - -o inline:"-I~ \n" \ + -o inline:"-I~\n" \ pkgconf --cflags tilde-quoting } @@ -109,7 +109,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L\$(libdir) -ltilde \n" \ + -o inline:"-L\$(libdir) -ltilde\n" \ pkgconf --libs paren-quoting } @@ -134,7 +134,7 @@ { atf_check \ -e ignore \ - -o inline:"-IC:\\\\\\\\A \n" \ + -o inline:"-IC:\\\\\\\\A\n" \ pkgconf --with-path=${selfdir}/lib1 --cflags escaped-backslash } @@ -142,7 +142,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-DQUOTED=\\\"bla\\\" \n" \ + -o inline:"-DQUOTED=\\\"bla\\\" -DA=\\\"escaped\\ string\\\'\\ literal\\\" -DB=\\\\\\1\$ -DC=bla\n" \ pkgconf --cflags quotes } @@ -150,7 +150,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -Bdynamic -lfoo -Bstatic -lbar \n" \ + -o inline:"-L/test/lib -Bdynamic -lfoo -Bstatic -lbar\n" \ pkgconf --libs flag-order-1 } @@ -158,7 +158,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -Bdynamic -lfoo -Bstatic -lbar -lfoo \n" \ + -o inline:"-L/test/lib -Bdynamic -lfoo -Bstatic -lbar -lfoo\n" \ pkgconf --libs flag-order-1 foo } @@ -166,7 +166,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -Wl,--start-group -lfoo -lbar -Wl,--end-group \n" \ + -o inline:"-L/test/lib -Wl,--start-group -lfoo -lbar -Wl,--end-group\n" \ pkgconf --libs flag-order-3 } @@ -174,7 +174,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -Wl,--start-group -lfoo -lbar -Wl,--end-group -lfoo \n" \ + -o inline:"-L/test/lib -Wl,--start-group -lfoo -lbar -Wl,--end-group -lfoo\n" \ pkgconf --libs flag-order-3 foo } @@ -182,7 +182,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-I/test/include \n" \ + -o inline:"-I/test/include\n" \ pkgconf --cflags variable-whitespace } @@ -190,7 +190,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -DQUOTED=\\\"/test/share/doc\\\" \n" \ + -o inline:"-fPIC -I/test/include/foo -DQUOTED=\\\"/test/share/doc\\\"\n" \ pkgconf --cflags fragment-quoting } @@ -198,7 +198,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -DQUOTED=/test/share/doc \n" \ + -o inline:"-fPIC -I/test/include/foo -DQUOTED=/test/share/doc\n" \ pkgconf --cflags fragment-quoting-2 } @@ -206,7 +206,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -DQUOTED=\\\"/test/share/doc\\\" \n" \ + -o inline:"-fPIC -I/test/include/foo -DQUOTED=\\\"/test/share/doc\\\"\n" \ pkgconf --cflags fragment-quoting-3 } @@ -214,7 +214,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -DQUOTED=/test/share/doc \n" \ + -o inline:"-fPIC -I/test/include/foo -DQUOTED=/test/share/doc\n" \ pkgconf --cflags fragment-quoting-5 } @@ -222,28 +222,28 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\\ world \n" \ + -o inline:"-Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\\ world\n" \ pkgconf --cflags fragment-quoting-7 } fragment_escaping_1_body() { atf_check \ - -o inline:"-IC:\\\\\\\\D\\ E \n" \ + -o inline:"-IC:\\\\\\\\D\\ E\n" \ pkgconf --with-path="${selfdir}/lib1" --cflags fragment-escaping-1 } fragment_escaping_2_body() { atf_check \ - -o inline:"-IC:\\\\\\\\D\\ E \n" \ + -o inline:"-IC:\\\\\\\\D\\ E\n" \ pkgconf --with-path="${selfdir}/lib1" --cflags fragment-escaping-2 } fragment_escaping_3_body() { atf_check \ - -o inline:"-IC:\\\\\\\\D\\ E \n" \ + -o inline:"-IC:\\\\\\\\D\\ E\n" \ pkgconf --with-path="${selfdir}/lib1" --cflags fragment-escaping-3 } @@ -269,7 +269,7 @@ fragment_comment_body() { atf_check \ - -o inline:'kuku=\#ttt \n' \ + -o inline:'kuku=\#ttt\n' \ pkgconf --with-path="${selfdir}/lib1" --cflags fragment-comment } @@ -292,7 +292,7 @@ tuple_dequote_body() { atf_check \ - -o inline:'-L/test/lib -lfoo \n' \ + -o inline:'-L/test/lib -lfoo\n' \ pkgconf --with-path="${selfdir}/lib1" --libs tuple-quoting }
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/provides.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/provides.sh
Changed
@@ -27,7 +27,7 @@ -o inline:"${OUTPUT}" \ pkgconf --print-provides provides atf_check \ - -o inline:"-lfoo \n" \ + -o inline:"-lfoo\n" \ pkgconf --libs provides-request-simple atf_check \ -e ignore \
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/regress.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/regress.sh
Changed
@@ -8,6 +8,7 @@ depgraph_break_2 \ depgraph_break_3 \ define_variable \ + define_variable_override \ variable \ keep_system_libs \ libs \ @@ -28,7 +29,10 @@ malformed_1 \ malformed_quoting \ explicit_sysroot \ - empty_tuple + empty_tuple \ + solver_requires_private_debounce \ + billion_laughs \ + maximum_package_depth_off_by_one # sysroot_munge \ @@ -71,6 +75,13 @@ pkgconf --variable=typelibdir --define-variable='libdir=\${libdir}' typelibdir } +define_variable_override_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check -o inline:"/test\n" \ + pkgconf --variable=prefix --define-variable='prefix=/test' typelibdir +} + variable_body() { export PKG_CONFIG_PATH="${selfdir}/lib1" @@ -88,7 +99,7 @@ pkgconf --libs-only-L cflags-libs-only atf_check \ - -o inline:"-L/test/local/lib \n" \ + -o inline:"-L/test/local/lib\n" \ pkgconf --libs-only-L --keep-system-libs cflags-libs-only } @@ -96,7 +107,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/local/lib -lfoo \n" \ + -o inline:"-L/test/local/lib -lfoo\n" \ pkgconf --libs cflags-libs-only } @@ -104,7 +115,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/local/lib -lfoo \n" \ + -o inline:"-L/test/local/lib -lfoo\n" \ pkgconf --libs-only-L --libs-only-l cflags-libs-only } @@ -112,10 +123,10 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/bar/lib -lfoo1 \n" \ + -o inline:"-L/test/bar/lib -lfoo1\n" \ pkgconf --libs prefix-foo1 atf_check \ - -o inline:"-L/test/bar/lib -lfoo1 -lfoo2 \n" \ + -o inline:"-L/test/bar/lib -lfoo1 -lfoo2\n" \ pkgconf --libs prefix-foo1 prefix-foo2 } @@ -123,7 +134,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-I/test/local/include/foo \n" \ + -o inline:"-I/test/local/include/foo\n" \ pkgconf --cflags-only-I --cflags-only-other cflags-libs-only } @@ -131,7 +142,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-I/test/bar/include/foo -DBAR -fPIC -DFOO \n" \ + -o inline:"-I/test/bar/include/foo -DBAR -fPIC -DFOO\n" \ pkgconf --cflags prefix-foo1 prefix-foo2 } @@ -155,7 +166,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-isystem /opt/bad/include -isystem /opt/bad2/include \n" \ + -o inline:"-isystem /opt/bad/include -isystem /opt/bad2/include\n" \ pkgconf --cflags isystem } @@ -171,7 +182,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-idirafter /opt/bad/include -idirafter /opt/bad2/include \n" \ + -o inline:"-idirafter /opt/bad/include -idirafter /opt/bad2/include\n" \ pkgconf --cflags idirafter } @@ -187,7 +198,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-I/opt/bad/include1 -idirafter -I/opt/bad/include2 -I/opt/bad/include3 \n" \ + -o inline:"-I/opt/bad/include1 -idirafter -I/opt/bad/include2 -I/opt/bad/include3\n" \ pkgconf --cflags idirafter-ordering } @@ -195,7 +206,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib2" atf_check \ - -o inline:"-fPIC -I/test/include/foo \n" \ + -o inline:"-fPIC -I/test/include/foo\n" \ pkgconf --cflags ${selfdir}/lib3/bar.pc } @@ -204,7 +215,7 @@ sed "s|/sysroot/|${selfdir}/|g" ${selfdir}/lib1/sysroot-dir.pc > ${selfdir}/lib1/sysroot-dir-selfdir.pc export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="${selfdir}" atf_check \ - -o inline:"-L${selfdir}/lib -lfoo \n" \ + -o inline:"-L${selfdir}/lib -lfoo\n" \ pkgconf --libs sysroot-dir-selfdir } @@ -223,7 +234,7 @@ fragment_collision_body() { - atf_check -o inline:"-D_BAZ -D_BAR -D_FOO -D_THREAD_SAFE -pthread \n" \ + atf_check -o inline:"-D_BAZ -D_BAR -D_FOO -D_THREAD_SAFE -pthread\n" \ pkgconf --with-path="${selfdir}/lib1" --cflags fragment-collision } @@ -251,3 +262,21 @@ atf_check -o inline:"\n" \ pkgconf --with-path="${selfdir}/lib1" --cflags empty-tuple } + +solver_requires_private_debounce_body() +{ + atf_check -o inline:"-I/metapackage-1 -I/metapackage-2 -lmetapackage-1 -lmetapackage-2\n" \ + pkgconf --with-path="${selfdir}/lib1" --cflags --libs metapackage +} + +billion_laughs_body() +{ + atf_check -o inline:"warning: truncating very long variable to 64KB\nwarning: truncating very long variable to 64KB\nwarning: truncating very long variable to 64KB\nwarning: truncating very long variable to 64KB\nwarning: truncating very long variable to 64KB\n" \ + pkgconf --with-path="${selfdir}/lib1" --validate billion-laughs +} + +maximum_package_depth_off_by_one_body() +{ + atf_check -o inline:"1.2.3\n" \ + pkgconf --with-path="${selfdir}/lib1" --modversion foo bar baz +}
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/requires.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/requires.sh
Changed
@@ -21,7 +21,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -lbar -lfoo \n" \ + -o inline:"-L/test/lib -lbar -lfoo\n" \ pkgconf --libs bar } @@ -29,7 +29,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -L/test/lib -lbaz \n" \ + -o inline:"-fPIC -I/test/include/foo -L/test/lib -lbaz\n" \ pkgconf --libs --cflags baz } @@ -37,7 +37,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -lbaz -L/test/lib -lzee -L/test/lib -lfoo \n" \ + -o inline:"-L/test/lib -lbaz -L/test/lib -lzee -L/test/lib -lfoo\n" \ pkgconf --static --libs baz } @@ -45,7 +45,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-L/test/lib -lbaz -L/test/lib -lfoo \n" \ + -o inline:"-L/test/lib -lbaz -L/test/lib -lfoo\n" \ pkgconf --static --pure --libs baz } @@ -53,7 +53,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-llib-1 -pthread /test/lib/lib2.so \n" \ + -o inline:"-llib-1 -pthread /test/lib/lib2.so\n" \ pkgconf --static --libs argv-parse-2 } @@ -61,7 +61,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-fPIC -I/test/include/foo -DFOO_STATIC \n" \ + -o inline:"-fPIC -I/test/include/foo -DFOO_STATIC\n" \ pkgconf --static --cflags baz } @@ -69,7 +69,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-lprivate -lfoo -lbaz -lzee -lbar -lfoo \n" \ + -o inline:"-lprivate -lbaz -lzee -lbar -lfoo -lfoo\n" \ pkgconf --static --libs-only-l private-libs-duplication } @@ -77,7 +77,7 @@ { export PKG_CONFIG_PATH="${selfdir}/lib1" atf_check \ - -o inline:"-lbar -lbar-private -L/test/lib -lfoo \n" \ + -o inline:"-lbar -lbar-private -L/test/lib -lfoo\n" \ pkgconf --static --libs static-libs } @@ -87,14 +87,14 @@ atf_check \ -s exit:1 \ -e ignore \ - -o inline:"\n" \ + -o ignore \ pkgconf --cflags missing-require } requires_internal_body() { atf_check \ - -o inline:"-lbar -lbar-private -L/test/lib -lfoo \n" \ + -o inline:"-lbar -lbar-private -L/test/lib -lfoo\n" \ pkgconf --with-path="${selfdir}/lib1" --static --libs requires-internal } @@ -110,7 +110,7 @@ requires_internal_collision_body() { atf_check \ - -o inline:"-I/test/local/include/foo \n" \ + -o inline:"-I/test/local/include/foo\n" \ pkgconf --with-path="${selfdir}/lib1" --cflags requires-internal-collision }
View file
_service:tar_scm:pkgconf-1.8.0.tar.xz/tests/sysroot.sh -> _service:tar_scm:pkgconf-1.9.5.tar.xz/tests/sysroot.sh
Changed
@@ -6,13 +6,18 @@ cflags \ variable \ do_not_eat_slash \ + do_not_duplicate_sysroot_dir \ + uninstalled \ + uninstalled_pkgconf1 \ + uninstalled_fdo \ + uninstalled_fdo_pc_sysrootdir do_not_eat_slash_body() { export PKG_CONFIG_PATH="${selfdir}/lib1" export PKG_CONFIG_SYSROOT_DIR="/" atf_check \ - -o inline:"-fPIC -I/test/include/foo \n" \ + -o inline:"-fPIC -I/test/include/foo\n" \ pkgconf --cflags baz } @@ -21,7 +26,7 @@ export PKG_CONFIG_PATH="${selfdir}/lib1" export PKG_CONFIG_SYSROOT_DIR="${SYSROOT_DIR}" atf_check \ - -o inline:"-fPIC -I${SYSROOT_DIR}/test/include/foo \n" \ + -o inline:"-fPIC -I${SYSROOT_DIR}/test/include/foo\n" \ pkgconf --cflags baz } @@ -36,3 +41,70 @@ -o inline:"${SYSROOT_DIR}/test/include\n" \ pkgconf --variable=includedir foo } + +do_not_duplicate_sysroot_dir_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + export PKG_CONFIG_SYSROOT_DIR="/sysroot" + + atf_check \ + -o inline:"-I/sysroot/usr/include\n" \ + pkgconf --cflags sysroot-dir-2 + + atf_check \ + -o inline:"-I/sysroot/usr/include\n" \ + pkgconf --cflags sysroot-dir-3 + + atf_check \ + -o inline:"-I/sysroot/usr/include\n" \ + pkgconf --cflags sysroot-dir-5 + + export PKG_CONFIG_SYSROOT_DIR="${SYSROOT_DIR}" + + atf_check \ + -o inline:"-I${SYSROOT_DIR}/usr/include\n" \ + pkgconf --cflags sysroot-dir-4 +} + +uninstalled_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + export PKG_CONFIG_SYSROOT_DIR="/sysroot" + + atf_check \ + -o inline:"-L/test/lib -lomg\n" \ + pkgconf --libs omg +} + +uninstalled_pkgconf1_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + export PKG_CONFIG_SYSROOT_DIR="/sysroot" + export PKG_CONFIG_PKGCONF1_SYSROOT_RULES="1" + + atf_check \ + -o inline:"-L/sysroot/test/lib -lomg\n" \ + pkgconf --libs omg +} + +uninstalled_fdo_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + export PKG_CONFIG_SYSROOT_DIR="/sysroot" + export PKG_CONFIG_FDO_SYSROOT_RULES="1" + + atf_check \ + -o inline:"-L/test/lib -lomg\n" \ + pkgconf --libs omg +} + +uninstalled_fdo_pc_sysrootdir_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + export PKG_CONFIG_SYSROOT_DIR="/sysroot" + export PKG_CONFIG_FDO_SYSROOT_RULES="1" + + atf_check \ + -o inline:"-L/sysroot/test/lib -lomg\n" \ + pkgconf --libs omg-sysroot +}
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2