]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
libnewt.pc: add data for static linking
authorAlexey Sheplyakov <asheplyakov@altlinux.org>
Mon, 16 Aug 2021 07:01:57 +0000 (07:01 +0000)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 16 Aug 2021 07:25:41 +0000 (09:25 +0200)
With this patch I can statically link a binary with libnewt without listing
the required libraries manually:

gcc -o test_static test.c `pkg-config --libs --cflags --static libnewt`

Without this patch static linking fails due to multiple undefined
references:

/usr/bin/ld: /tmp/test.AcRBJp.ltrans0.ltrans.o: in function `buttonDrawIt':
<artificial>:(.text+0x2f0): undefined reference to `SLsmg_set_color'
/usr/bin/ld: <artificial>:(.text+0x307): undefined reference to `SLtt_Use_Ansi_Colors'
/usr/bin/ld: <artificial>:(.text+0x31b): undefined reference to `SLsmg_set_color'
/usr/bin/ld: <artificial>:(.text+0x338): undefined reference to `SLsmg_write_char'
/usr/bin/ld: <artificial>:(.text+0x341): undefined reference to `SLsmg_write_string'
/usr/bin/ld: <artificial>:(.text+0x34b): undefined reference to `SLsmg_write_char'
/usr/bin/ld: <artificial>:(.text+0x3ae): undefined reference to `SLsmg_set_color'
/usr/bin/ld: <artificial>:(.text+0x3cd): undefined reference to `SLsmg_write_char'
/usr/bin/ld: <artificial>:(.text+0x3d5): undefined reference to `SLsmg_write_string'
/usr/bin/ld: <artificial>:(.text+0x3df): undefined reference to `SLsmg_write_char'
/usr/bin/ld: <artificial>:(.text+0x3f9): undefined reference to `SLsmg_set_color'
/usr/bin/ld: <artificial>:(.text+0x422): undefined reference to `SLsmg_set_color'
/usr/bin/ld: <artificial>:(.text+0x45d): undefined reference to `SLsmg_set_color'
/usr/bin/ld: <artificial>:(.text+0x476): undefined reference to `SLsmg_set_color'
/usr/bin/ld: <artificial>:(.text+0x486): undefined reference to `SLsmg_set_color'
/usr/bin/ld: /tmp/test.AcRBJp.ltrans0.ltrans.o:<artificial>:(.text+0x4d6): more undefined references to `SLsmg_set_color' follow
[287 lines skipped]
collect2: error: ld returned 1 exit status

Closes: #17
libnewt.pc.in

index 89dc934e66acb0fd6346eaaf6d2d21426ae49385..8ca79e16eb0305ca6e231df90335a82e2f4d780b 100644 (file)
@@ -6,5 +6,6 @@ includedir=@includedir@
 Name: libnewt
 Description: A development library for text mode user interfaces
 Version: @VERSION@
+Requires.private: slang
 Libs: -L${libdir} -lnewt
 Cflags: -I${includedir}