Need help for first build macOS High Sierra

Hi everyone,

I have been trying to build libreoffice on my machine. I tried to fix it by reading the documentation available and use google to see if anyone ever had a similar issue to mine and I seem to be unable to find anything that may help me fix the error I receive from autotools.

Here is the error I got from :

checking for bogus pkg-config... configure: error: yes, from unknown origin. This *will* break the build. Please modify your PATH variable so that /usr/local/bin/pkg-config is no longer found by configure scripts.
Error running configure at ./ line 293.

and here is the build verbose :

Running ./configure with '--srcdir=/Users/jefflabonte/Documents/Development/FOSS/core --enable-option-checking=fatal'
*   Running LibreOffice build configuration.

checking build system type... x86_64-apple-darwin17.3.0
checking host system type... x86_64-apple-darwin17.3.0
checking for product name... LibreOfficeDev
checking for package version...
checking for product version... 6.1
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for grep... (cached) /usr/bin/grep
checking for GNU Make... /usr/bin/make
checking for sed... /usr/bin/sed
checking whether to use link-time optimization... no
checking for explicit AFLAGS... no
checking for explicit CFLAGS... no
checking for explicit CXXFLAGS... no
checking for explicit OBJCFLAGS... no
checking for explicit OBJCXXFLAGS... no
checking for explicit LDFLAGS... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for library containing dlsym... none required
checking whether build target is Release Build... no
checking whether to sign windows build... no
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for awk... /usr/bin/awk
checking for bash... /bin/sh
checking for GNU or BSD tar... gnutar
checking for tar's option to strip components... --strip-components
checking how to build and package galleries... internal src images for desktop
checking for ccache... not found
checking gcc home... /usr
checking for gcc... /usr/bin/gcc
checking whether to build with Java support... yes
checking what Mac OS X SDK to use... SDK 10.13 at /Applications/
checking what compiler to use... /Applications/ -m64  -mmacosx-version-min=10.9 -isysroot /Applications/ and /Applications/ -m64  -stdlib=libc++ -mmacosx-version-min=10.9 -isysroot /Applications/
checking that macosx-version-min-required is coherent with macosx-version-max-allowed... ok
checking that macosx-version-max-allowed is coherent with macos-with-sdk... ok
configure: MAC_OS_X_VERSION_MAX_ALLOWED=101300
checking whether to do code signing... no
checking whether to create a Mac App Store package... no
checking whether to sandbox the application... no
checking what OS X app bundle identifier to use... org.libreoffice.script
checking whether to treat the installation as read-only... no
checking for -Bsymbolic-functions linker support... not found 
checking for -isystem ... yes
checking whether the compiler is actually Clang... yes
checking the Clang version... Clang "9.0.0 (clang-900.0.39.2)", 90000
checking whether /Applications/ -m64  -mmacosx-version-min=10.9 -isysroot /Applications/ supports -ggdb2... yes
checking whether /Applications/ -m64  -mmacosx-version-min=10.9 -isysroot /Applications/ supports -finline-limit=0... no
checking whether /Applications/ -m64  -mmacosx-version-min=10.9 -isysroot /Applications/ supports -fno-inline... yes
checking whether to build with additional debug utilities... no
checking whether to do a debug build... no
checking whether to generate debug information... no
checking whether to compile with optimization flags... yes
checking which package format to use... none
checking how to run the C preprocessor... /Applications/ -m64  -mmacosx-version-min=10.9 -isysroot /Applications/ -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking whether to turn warnings to errors... no
checking whether to have assert() failures abort even without --enable-debug... no
checking whether to enable CUPS support... no
checking whether we want to fetch tarballs... yes, if we use them
checking whether to build help... no
checking whether to include MySpell dictionaries... no
checking whether to use dicts from external paths... no
checking whether to enable pch feature... no
checking the GNU Make version... /usr/bin/make 3.81
checking for sha1sum... no
checking for sha1... no
checking for shasum... shasum
checking for GNU Make bug 20033... no, keep parallelism enabled
checking whether GNU Make supports the 'file' function... no
checking for --hash-style gcc linker support... no 
checking for perl... /usr/local/bin/perl
checking the Perl version... Perl 5
checking for required Perl modules... all modules found
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ar... /Applications/
checking for nm... /Applications/
checking for ranlib... /Applications/
checking for objdump... objdump
checking for readelf... no
checking for strip... /Applications/
checking for bogus pkg-config... 

Thank you for your help in advance.

In a terminal window, enter the command “which pkg-config”. bash will search the PATH directories for a pkg-config file, and on my system it found one in /usr/local/bin. My guess is that it will find one there on your system, too. It’s probably a remnant of another package installation, possibly one for Python.

Note: depending on the owner of the /usr/local/bin/pkg-config file, you may need to use sudo or chown to handle any ownership issues as part of performing the steps suggested below.

You could use the “mv” command to temporarily rename the pkg-config file in /usr/local/bin to some other name or to another directory that’s NOT in the PATH list. Use the command “echo $PATH” to see the colon delimited list of directories in PATH. After the build, you can again use “mv” to reinstate that file. For instance

jsmith$ mv /usr/local/bin/pkg-config /usr/local/bin/pkg-config.restore-after-build

After the build, you would rename it back:

jsmith$ mv /usr/local/bin/pkg-config.restore-after-build /usr/local/bin/pkg-config

A riskier approach would be to use the “export” command to redefine the PATH setting in the terminal window where you are running, and eventually the build. Your new PATH setting would not include “/usr/local/bin:”. That directory typically contains products you’ve installed, so it’s possible but unlikely the LibreOffice build will need them. For instance:

jsmith$ echo $PATH


Note the presence of /usr/local/bin: in the setting. In the following export command, /usr/local/bin: has been removed.

jsmith$ export PATH=/Users/jsmith/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware

jsmith$ echo $PATH


Changes to the PATH setting are only known to that terminal window and processes started from that window. If that window is closed, or if that setting is needed in another terminal window, the steps to alter the PATH setting will need to be repeated.

Thank you for your quick answer. It worked.