ibarwick / libfq

A wrapper library for Firebird's C API, loosely based on PostgreSQL's libpq.
https://libfq.sql-info.de/
8 stars 2 forks source link

Add Ubuntu/debian note for configure script #5

Open mkgrgis opened 1 year ago

ibarwick commented 1 year ago

I don't understand the need to provide this oddly specific information for a particular distribution family at this point.

As a general note, if you are sending in PRs and realise changes are needed, please rebase into a single commit nd force-push; it's much easier to review that way.

mkgrgis commented 1 year ago

I think default configuration of make is suitable for Fedora/RHEL family. So Ubuntu/Debian is popular family of GNU/Linux too, but not covered by makefile defaults, it's problem.

ibarwick commented 1 year ago

The default value for --prefix is /usr/local, which has been standard practice pretty much for ever on Unix-like systems for locally-built applications/libraries; this keeps such files away from system-installed packages etc. I don't see why Debian/Ubuntu is any different in that respect; I always build with the default /usr/local prefix on Debian/Ubuntu and don't have any issues.

mkgrgis commented 1 year ago

Excuse me, @ibarwick, but what about https://github.com/ibarwick/firebird_fdw/commit/4ce1f1a2bbd66f120432ee4b16cda937cb58a70e ? No problem with separate libfq, yes. But in complex there is problems on Ubuntu/Debian family. Some problems were fixed for Ubuntu/Debian https://github.com/ibarwick/firebird_fdw/blob/master/doc/INSTALL-debian-ubuntu.md , but there were no changes for libfq make process. For example for Ubuntu

ls /usr/local/
bin  etc  games  lib  man  sbin  share  src

lib is empty and no include . For

ls /usr
bin      games lib       lib64   libx32  share
include  lib32 libexec   local   sbin    src

both include and lib are full of files.

For Debian there is something similar

ls /usr/local
bin  etc  games  man  sbin  share  src

but

ls /usr
bin      games    lib32    libx32      sbin
include  lib64    local    share       lib
libexec  src

I don't know why Debian and Ubuntu not stick to the usual practice of Unix filesystems.

ibarwick commented 1 year ago

I still don't understand what problem you are trying to solve here.

It's normal for directories under /usr/local to be empty, because the whole point is that user-generated files can be placed there. That's the case both on RedHat and Ubuntu distributions, and probably most Unix-derived systems.

You can, if you wish, configure libfq to install the generated files somewhere else, that's the whole point of having options like --prefix.

mkgrgis commented 1 year ago

I still don't understand what problem you are trying to solve here.

Maybe real problem is near search paths (LD_LIBRARY_PATH ?) for libfq. See https://github.com/ibarwick/libfq/issues/3 for details. OK, sudo experiment with Ubuntu default environment.

  1. Before
    find /usr -iname "*libfq*"
    /usr/lib/libfq-0.5.0.so
    /usr/lib/libfq.so
    /usr/lib/libfq.a
    /usr/lib/libfq.la
    /usr/include/libfq.h
    /usr/include/libfq-expbuffer.h
    /usr/include/libfq-int.h
  2. Move libfq to usual location
    mkdir /usr/local/include /usr/local/lib;
    chmod og+r-w+x -v /usr/local/include /usr/local/lib;
    mv -v /usr/lib/libfq* /usr/local/lib
  3. Check fbsql or firebird_fdw
    fbsql -d localhost:/tmp/テスト.fdb -u sysdba -p masterkey
    fbsql: error while loading shared libraries: libfq-0.5.0.so: cannot open shared object file: No such file or directory
  4. Revert for success .so call: mv -v /usr/local/lib/libfq* /usr/lib
mkgrgis commented 1 year ago

Other form of problem of search addresses is described here https://github.com/ibarwick/libfq/blob/master/INSTALL.md#known-ibaseh-locations