Comments (7)
If I remember correctly, the reason we also have the avahi header check, is to also work on older distros which do not include the .pc file. Though, support for old distroes is not really a priority.
from liblxi.
You are trying to build search.c manually but I assume your current mission is to try create a brew lxi-tools formula?
If so, I think it will be easier if you just go straight to try building lxi-tools creating a brew formula because I expect it will be structured in much the same way as the existing liblxi brew formula. As liblxi/lxi-tools uses meson it will take care of many of the details that you have been struggling with:
Notice that pkg-config is a build dependency in this brew formula and that is what makes the build find the pkg-config configuration files etc.
To begin with you could just make a lxi-tools formula that does not build the lxi-gui tool by adding the meson argument -Dgui=false
. This would be a good start, then your formula only need to add the following dependencies: liblxi, readline, lua.
from liblxi.
Ok, that makes sense, I'll get onto that now.
If you're happy i'll leave this issue open for now and close once we've got a better solution documented.
from liblxi.
Ok, after some testing, the best option to get avahi running on Ubuntu 23.04 is to just install lxi-tools.
snap install lxi-tools
With regards to the brew formula, mentioned above, I hope to have this submitted soon. This will enable lxi-tools on macOS also (GUI disabled). It currently works, installing from source.
from liblxi.
You are missing some key options in your compile/linker line.
If you are on a very old Ubuntu system you may be missing the avahi-client.pc file which is the feature that meson is looking for when searching for libraries automatically.
In recent versions of Ubuntu, libavahi-client-dev comes with the following file:
/usr/lib/x86_64-linux-gnu/pkgconfig/avahi-client.pc
So you can ask via pkg-config for compilation and linking flags when using avahi:
$ pkg-config --cflags avahi-client
-D_REENTRANT
$ pkg-config --libs avahi-client
-lavahi-common -lavahi-client
from liblxi.
I just noticed you are running on Ubuntu 23.04 but I suspect you are running it in the brew environment so maybe it does not find the pkg-config configuration unless you specify pkg-config as a required build time dependency.
I'm also running Ubuntu 23.04 and in a native Ubuntu environment it finds the pkg-config avahi configuration just fine:
lundmar@wopr:~/projects/lxi-tools/liblxi$ meson setup build --prefix=$HOME/opt/liblxi --wipe
The Meson build system
Version: 1.0.1
Source dir: /home/lundmar/projects/lxi-tools/liblxi
Build dir: /home/lundmar/projects/lxi-tools/liblxi/build
Build type: native build
Project name: liblxi
Project version: 1.21
C compiler for the host machine: ccache cc (gcc 12.2.0 "cc (Ubuntu 12.2.0-17ubuntu1) 12.2.0")
C linker for the host machine: cc ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Run-time dependency avahi-client found: YES 0.8
Run-time dependency libxml-2.0 found: YES 2.9.14
Run-time dependency threads found: YES
Has header "avahi-client/client.h" : YES
Run-time dependency libtirpc found: YES 1.3.2
Configuring lxi_connect.3 using configuration
Configuring lxi_disconnect.3 using configuration
Configuring lxi_discover.3 using configuration
Configuring lxi_discover_if.3 using configuration
Configuring lxi_init.3 using configuration
Configuring lxi_receive.3 using configuration
Configuring lxi_send.3 using configuration
Build targets in project: 1
liblxi 1.21
User defined options
prefix: /home/lundmar/opt/liblxi
Found ninja-1.11.1 at /usr/bin/ninja
from liblxi.
Thanks, that helps. I suspect your right as I've been going between brew initially and then from source once I encountered issues. I did manage to get the search.c file to compile without the error and get it running with this command, late last night.
gcc $(pkg-config --cflags avahi-client) -I/home/linuxbrew/.linuxbrew/include test/search.c $(pkg-config --libs avahi-client) -llxi -ltirpc -o search
./search
But I had to env variables to get working and the linker directives seem overly complicated and likely a symptom of what I've done trying fix things.
This morning I plan to, retrace my steps, come up with a better/simpler process and document here for others.
I also have a need for mdns on an 18.04 Ubuntu server, so will double check that too. Stand by...
from liblxi.
Related Issues (20)
- build from source instructions? HOT 4
- Fresh build on OSX complains about avahi-client being missing HOT 9
- lxi-tools on Raspberry Pi HOT 1
- server code or client code ? HOT 1
- Use alternative RPC library? HOT 1
- Undefined reference error despite linking library HOT 1
- Request: iOS Compatibility HOT 1
- Build help on Ubuntu HOT 1
- Missing liblxi-1.14.tar.xz.asc HOT 2
- Publish mail address of signing public key of liblxi at keys.openpgp.org? HOT 2
- CMake Support HOT 3
- Refactor pthread_timedjoin_np usage? HOT 2
- warning: cast between incompatible function types HOT 1
- lxilua.c needs a change otherwise it may get conflict with other lua "connect" functions. HOT 2
- lib-tools support on windows? HOT 2
- MacOS (arm64) build support HOT 20
- MacOS mdns (Bonjour) backend and instrument discovery HOT 7
- gethostbyname() obsolete HOT 2
- liblxi.so should link against libtirpc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liblxi.