Menu

#143 Pkg-config see less libraries with windows path that unix path.

1.0
closed
nobody
None
2015-04-19
2015-03-23
O01eg
No

In the shell environment PKG_CONFIG_PATH equals to /mingw64/lib/pkgconfig:/mingw64/share/pkgconfig. When pkg-config called from other apllication it becomes to E:\msys64\mingw64\lib\pkgconfig;E:\msys64\mingw64\share\pkgconfig.

With second way pkg-config see /usr/lib/pkgconfig/autoopts.pc but don't see /mingw64/lib/pkgconfig/cairo.pc

This causes errors like https://github.com/alexcrichton/pkg-config-rs/issues/12

Discussion

  • Ray Donnelly

    Ray Donnelly - 2015-03-23

    Do you have MSYS2 installed to E:\msys64?

     
  • O01eg

    O01eg - 2015-03-23

    Yes, I've.

     
  • Ray Donnelly

    Ray Donnelly - 2015-03-23

    Can you give me some very detailed reproduction steps please, starting from a fresh installation of MSYS2.

     
  • O01eg

    O01eg - 2015-03-25

    I installed msys2-base-x86_64-20150202.tar.xz into D:\msys64. I installed there pkg-config and cairo. Next I get:

    $ export
    declare -x PKG_CONFIG_PATH="/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig"
    
    $ pkg-config --list-all
    cairo-win32           cairo-win32 - Microsoft Windows surface backend for cairo graphics library
    harfbuzz-gobject      harfbuzz - HarfBuzz text shaping library GObject integration
    cairo                 cairo - Multi-platform 2D graphics library
    cairo-tee             cairo-tee - tee surface backend for cairo graphics library
    cairo-script          cairo-script - script surface backend for cairo graphics library
    fontconfig            Fontconfig - Font configuration and customization library
    cairo-pdf             cairo-pdf - PDF surface backend for cairo graphics library
    ...
    
    $ PKG_CONFIG_PATH="D:\msys64\mingw64\lib\pkgconfig;D:\msys64\mingw64\share\pkgconfig"  pkg-config --list-all
    libalpm         libalpm - Arch Linux package management library
    bash-completion bash-completion - programmable completion for the bash shell
    
     
  • O01eg

    O01eg - 2015-03-25

    Also I can see that fresh installation doesn't convert path:

    Fresh installation:

    $ gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-msys/4.9.2/lto-wrapper.exe
    Target: x86_64-pc-msys
    Configured with: /build2/gcc/src/gcc-4.9.2/configure --build=x86_64-pc-msys --prefix=/usr --libexecdir=/usr/lib --enable-bootstrap --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --with-arch=x86-64 --disable-multilib --with-tune=generic --enable-__cxa_atexit --with-dwarf2 --enable-languages=c,c++,fortran,lto --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --disable-win32-registry --disable-symvers --with-gnu-ld --with-gnu-as --disable-isl-version-check --enable-checking=release --without-libiconv-prefix --without-libintl-prefix --with-system-zlib
    Thread model: posix
    gcc version 4.9.2 (GCC)
    

    Previous installation:

    $ gcc -v
    Using built-in specs.
    COLLECT_GCC=E:\msys64\mingw64\bin\gcc.exe
    COLLECT_LTO_WRAPPER=E:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/lto-wrapper.exe
    Target: x86_64-w64-mingw32
    Configured with: ../gcc-4.9.2/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --with-gxx-include-dir=/mingw64/include/c++/4.9.2 --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-cloog-backend=isl --enable-version-specific-runtime-libs --disable-cloog-version-check --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-cloog=/mingw64 --with-pkgversion='Rev5, Built by MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
    Thread model: posix
    gcc version 4.9.2 (Rev5, Built by MSYS2 project)
    
     
  • Ray Donnelly

    Ray Donnelly - 2015-03-25

    Those are two different GCCs, MSYS2 GCC (like Cygwin GCC) and MinGW-w64 GCC. Unless I am mistaken, you are running the wrong shell, using msys2_shell.bat instead of mingw64_shell.bat in one instance.

     
  • Matthieu Vachon

    Matthieu Vachon - 2015-03-25

    Your are not using the same GCC twice.

    The first time, you are using a MSYS2 GCC, as you can see in the target. This one will convert paths and is meant only to compile MSYS2 programs.

    The second time, you are using a MINGW GCC, as you can see in the target. This one will not covert paths and is meant to compile native windows program not depending on the msys2 subsystem.

    To use the msys2 GCC compiler suite, start the msys2_shell.bat otherwise, use mingw64_shell.bat. The two version of the bat scripts shares a lot of things, but main difference is that they tweak some environment variables for you so the toolchain used by default matches the name of the shell started.

    This misunderstanding between the two versions could be why you see less libraries. The introduction page on the wiki aims at helping understanding how everything is packaged: https://sourceforge.net/p/msys2/wiki/MSYS2%20introduction/.

    Regards,
    Matt

     
  • O01eg

    O01eg - 2015-03-26

    I use mingw64_shell.bat in both cases. I removed gcc and installed mingw-w64-x86_64-gcc, now it shows:

    $ gcc -v
    Using built-in specs.
    COLLECT_GCC=D:\msys64\mingw64\bin\gcc.exe
    COLLECT_LTO_WRAPPER=D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/lto-wrapper.exe
    Target: x86_64-w64-mingw32
    Configured with: ../gcc-4.9.2/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --with-gxx-include-dir=/mingw64/include/c++/4.9.2 --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-cloog-backend=isl --enable-version-specific-runtime-libs --disable-cloog-version-check --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-cloog=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=http://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
    Thread model: posix
    gcc version 4.9.2 (Rev2, Built by MSYS2 project)
    
     
  • O01eg

    O01eg - 2015-03-26

    It was fixed by installing mingw-w64-x86_64-pkg-config instead pkg-config, thanks.

     
  • Ray Donnelly

    Ray Donnelly - 2015-03-26

    Can you please update your original bug report on rust's github with this?

     
  • David Macek

    David Macek - 2015-04-19
    • status: open --> closed