Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
LDFLAGS oä. für stat. libs aus /opt/xy, ansonsten aus /usr?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
guru meditation
Tux's lil' helper
Tux's lil' helper


Joined: 18 Mar 2018
Posts: 140
Location: Planet Earth

PostPosted: Mon Apr 12, 2021 4:09 am    Post subject: LDFLAGS oä. für stat. libs aus /opt/xy, ansonsten aus /usr? Reply with quote

Es gibt immer mal Situationen, wo ich ein möglichst portables Programm mit integrierten Funktionen/Libs brauche, die auf einer anderen Linux-Kiste nicht installiert bzw. nicht aktuell sind oder nicht unterstützt werden.

Ich kompiliere diese Bibliotheken also fröhlich nach /opt/xy und gebe diesen Ort dann in LDFLAGS an – und wunder mich dann, daß der Linker das schön ignoriert.

Um es kurz zu machen: Wie teile ich dem Compiler/Linker mit:
1) Schau in /opt/xy nach, ob eine für ein Programm abhängige Bibliothel in /opt/xy gibt:
→ wenn ja, bau die ins Programm ein (statisch( oder verlinke das (dynamisch, .so)
→ wenn nein: benutze die Standard-Libs in /usr/.
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 4438
Location: Frankfurt, Germany

PostPosted: Mon Apr 12, 2021 12:38 pm    Post subject: Reply with quote

Warum schreibst Du den Ort nach LDFLAGS? Willst Du, dass emerge Dein Verzeichnis /opt/xy berücksichtigt?

Wenn ich GCC selbst aufrufe, verwende ich die Optionen "-l" und/oder "-L".
Back to top
View user's profile Send private message
guru meditation
Tux's lil' helper
Tux's lil' helper


Joined: 18 Mar 2018
Posts: 140
Location: Planet Earth

PostPosted: Sat Apr 17, 2021 3:07 am    Post subject: Reply with quote

Ich möchte unabhängig von emerge ein Programm kompilieren, das unabhängig von installierten Bibliotheken auf vielen Linux-Rechnern lauffähig ist.

In etc/portage/make.conf habe ich in USE= bereits static-libs stehen. Damit sollte fast jede Bibliothek auch statisch (.a) zur Verfügung stehen.

Soweit habe ich das mit Voranstellen von
PKG_CONFIG_LIBDIR="/opt/meinProgramm" ./configure …
das „Hauptprogramm“ auch dazu bekommen, meine eigenen kompilierten statischen Bibliotheken einzubinden.

Die Frage ist halt, wie man diesen Akt professionell, d.h. in der von gcc/ld vorgesehenen Art, durchführt. Bisher gibt es noch einige „kleine“ Probleme wie undefined symbol: BZ2_bzDecompress, d.h. libbzip2 wird nicht verlinkt.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum