Add PC files for library#517
Conversation
| Requires.private: libssl, libcrypto libiconv | ||
| Cflags: -I${includedir}/freetds | ||
| Libs: -L${libdir} -lct | ||
| Libs.private: -ladvapi32 -lkernel32 -lshell32 -lcrypt32 -lws2_32 -lsecur32 |
There was a problem hiding this comment.
I would put these files in CMakeLists.txt within a if(WIN32)...endif(WIN32) condition, they are only useful and working for Windows.
There was a problem hiding this comment.
the pkg-config file works for Linux/macOS/MINGW(Windows), not windows only.
There was a problem hiding this comment.
the Libs.private should update with the build tool, because it will change with the operating system.
|
Looking at initial issue and https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-freetds/PKGBUILD I suppose we should first address Autoconf instead of CMake (not saying CMake should not be supported!). |
|
@taozuhong how is the state of this PR? |
|
For CMake, it's OK to be merged. autotool not yet. |
|
I tried to test it but it does not work. I compiled installed and tested, something like # cleanup
$ rm -rf cmake
$ rm -rf "$HOME/ftds_install"
# build and install cmake
$ mkdir cmake
$ cd cmake
$ cmake "-DCMAKE_INSTALL_PREFIX:PATH=$HOME/ftds_install" ..
$ make install
# prepare test program
$ cat <<EOF > test.c
#include <stdio.h>
#include <sqldb.h>
int main(void)
{
printf("login is %p\n", dblogin());
}
EOF
$ export PKG_CONFIG_PATH=$HOME/ftds_install/lib64/pkgconfig
$ gcc -O2 -Wall $(pkg-config --cflags --libs dblib)compilation fails with after removing iconv from dependency (only for Windows) checking what $ pkg-config --cflags --libs dblib
-I/home/fziglio/ftds_install/include/freetds -L/home/fziglio/ftds_install/lib/ -lsybdb however includes are not there $ find /home/fziglio/ftds_install/include/freetds
/home/fziglio/ftds_install/include/freetds
/home/fziglio/ftds_install/include/freetds/version.hIf I pass a specific directory to cmake -DCMAKE_INSTALL_INCLUDEDIR=inc/ftds "-DCMAKE_INSTALL_PREFIX:PATH=$HOME/ftds_install" ..Trying to understand how to better produce PC files with CMake, it's not that easy. Maybe better to start with Autoconf? |
|
I managed to reproduce your settings. Yes, it works, but because you installed on default directory so you don't need |
|
U r right, it's not the final solution, it need be update with new plan(ctlib/dblib/etc). BTW, could export libtds library directly(libtds.pc)? |
|
This commit improves a bit, at least if you set different defaults freddy77@2fe6778. |

No description provided.