-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the correct way to build kterm with static libvte? #7
Comments
What happens if you use following configure options? It should automatically pick up static libvte (through pkg-config). Of course you should first install vte dev package which includes the static library. It should be available for your debian distro. |
Thanks for your timely reply. Sorry I did not provide detailed infomation in the first post. I already had libvte-dev installed which provides /usr/lib/libvte.a. Also my previous run of ./configure had already included those options. |
Thanks for detailed info! I should have mentioned it in the If it still doesn't work please post |
Sorry for the late reply due to timezone differences. I found out that I already had libtinfo-dev installed (again...)
...and config.log is indeed the right direction since even as a novice I can see some possible problems with my building environment, which I've been unable to debug further due to my knowledge limitations.
|
Thanks! Now it complains about Could you please try to apply following patch to diff --git a/configure.ac b/configure.ac
index fdd8042..1f6a6eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,12 +33,26 @@ AM_COND_IF([KINDLE],
AC_MSG_WARN([building for Kindle without ARM toolchain])])
dnl Libtermcap is needed for static builds with vte < 2.91
- TERMCAP_LIBS=-ltermcap
+ require_termcap=yes
AC_DEFINE([KINDLE], [1])
+ saved_PKG_CONFIG=$PKG_CONFIG
+ PKG_CONFIG="$PKG_CONFIG --static"
AM_COND_IF([GTK3],
- [PKG_CHECK_MODULES([VTE], [vte-2.91], [TERMCAP_LIBS=], [PKG_CHECK_MODULES([VTE], [vte-2.90])])],
+ [PKG_CHECK_MODULES([VTE], [vte-2.91], [require_termcap=no], [PKG_CHECK_MODULES([VTE], [vte-2.90])])],
[PKG_CHECK_MODULES([VTE], [vte])])
+ PKG_CONFIG=$saved_PKG_CONFIG
+
+ AM_CONDITIONAL([TERMCAP_NEEDED], [test "x$require_termcap" = "xyes"])
+ TERMCAP_LIBS=
+ AM_COND_IF([TERMCAP_NEEDED],
+ [saved_LIBS=$LIBS
+ LIBS=
+ AC_SEARCH_LIBS([tgetent],[termcap termlib curses ncurses],
+ [TERMCAP_LIBS=$LIBS],
+ [AC_MSG_WARN([libtermcap is needed for static build])])
+ LIBS=$saved_LIBS
+ ],[])
AC_MSG_CHECKING([whether libvte may be linked statically])
dnl This will only work with gnu linker |
Hi, |
Your problem is that you are building for a system with different library versions and dependencies. Depending on how big the differences are you may never be able to succeed. Let's check what happens if you provide just the minimal set of dependencies. Try following patch that only adds diff --git a/configure.ac b/configure.ac
index fdd8042..271996d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,16 +33,27 @@ AM_COND_IF([KINDLE],
AC_MSG_WARN([building for Kindle without ARM toolchain])])
dnl Libtermcap is needed for static builds with vte < 2.91
- TERMCAP_LIBS=-ltermcap
+ require_termcap=yes
AC_DEFINE([KINDLE], [1])
AM_COND_IF([GTK3],
- [PKG_CHECK_MODULES([VTE], [vte-2.91], [TERMCAP_LIBS=], [PKG_CHECK_MODULES([VTE], [vte-2.90])])],
+ [PKG_CHECK_MODULES([VTE], [vte-2.91], [require_termcap=no], [PKG_CHECK_MODULES([VTE], [vte-2.90])])],
[PKG_CHECK_MODULES([VTE], [vte])])
+ AM_CONDITIONAL([TERMCAP_NEEDED], [test "x$require_termcap" = "xyes"])
+ TERMCAP_LIBS=
+ AM_COND_IF([TERMCAP_NEEDED],
+ [saved_LIBS=$LIBS
+ LIBS=
+ AC_SEARCH_LIBS([tgetent],[termcap termlib curses ncurses],
+ [TERMCAP_LIBS=$LIBS],
+ [AC_MSG_WARN([libtermcap is needed for static build])])
+ LIBS=$saved_LIBS
+ ],[])
+
AC_MSG_CHECKING([whether libvte may be linked statically])
dnl This will only work with gnu linker
- [VTE_STATIC_LIBS=`echo "$VTE_LIBS" | sed -e "s/\(-lvte[-_.0-9]*\)/-Wl,-Bstatic \1 -Wl,-Bdynamic $TERMCAP_LIBS/g"`]
+ [VTE_STATIC_LIBS=`echo "$VTE_LIBS" | sed -e "s/\(-lvte[-_.0-9]*\)/-Wl,-Bstatic \1 -Wl,-Bdynamic $TERMCAP_LIBS -lm/g"`]
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
CFLAGS="$GTK_CFLAGS $VTE_CFLAGS" |
Hello, sorry for the late reply. I tested the above procedure. This time, after supplying one single libtinfo.so.5, all dependencies seemed to have been satisfied as reported by ldd. Then it complained about:
I guess this is due to libglib version mismatch(?) I tried building without libvte statically linked,(i.e. use the original configure.ac) and manually supplying libvte.so.9, libglib-2.0.so.0, libpcre.so.3, libtinfo.so.5 and the binary was then able to startup. So after all these attempts, I am convinced that the real reason behind all these hassle is because I did not set up the building environment properly. So I wonder what is the preferred way to set up a toolchain for kindle devices? Thanks! |
Thanks for testing. Could you please test one more configuration. I am looking for a way to use only really needed libraries out of all given by diff --git a/configure.ac b/configure.ac
index fdd8042..04ccd87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,16 +33,30 @@ AM_COND_IF([KINDLE],
AC_MSG_WARN([building for Kindle without ARM toolchain])])
dnl Libtermcap is needed for static builds with vte < 2.91
- TERMCAP_LIBS=-ltermcap
+ require_termcap=yes
AC_DEFINE([KINDLE], [1])
+ saved_PKG_CONFIG=$PKG_CONFIG
+ PKG_CONFIG="$PKG_CONFIG --static"
AM_COND_IF([GTK3],
- [PKG_CHECK_MODULES([VTE], [vte-2.91], [TERMCAP_LIBS=], [PKG_CHECK_MODULES([VTE], [vte-2.90])])],
+ [PKG_CHECK_MODULES([VTE], [vte-2.91], [require_termcap=no], [PKG_CHECK_MODULES([VTE], [vte-2.90])])],
[PKG_CHECK_MODULES([VTE], [vte])])
+ PKG_CONFIG=$saved_PKG_CONFIG
+
+ AM_CONDITIONAL([TERMCAP_NEEDED], [test "x$require_termcap" = "xyes"])
+ TERMCAP_LIBS=
+ AM_COND_IF([TERMCAP_NEEDED],
+ [saved_LIBS=$LIBS
+ LIBS=
+ AC_SEARCH_LIBS([tgetent],[curses ncurses readline termcap],
+ [TERMCAP_LIBS=$LIBS],
+ [AC_MSG_WARN([libtermcap is needed for static build])])
+ LIBS=$saved_LIBS
+ ],[])
AC_MSG_CHECKING([whether libvte may be linked statically])
dnl This will only work with gnu linker
- [VTE_STATIC_LIBS=`echo "$VTE_LIBS" | sed -e "s/\(-lvte[-_.0-9]*\)/-Wl,-Bstatic \1 -Wl,-Bdynamic $TERMCAP_LIBS/g"`]
+ [VTE_STATIC_LIBS=`echo "-Wl,--as-needed $VTE_LIBS -Wl,--no-as-needed" | sed -e "s/\(-lvte[-_.0-9]*\)/-Wl,-Bstatic \1 -Wl,-Bdynamic $TERMCAP_LIBS/g"`]
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
CFLAGS="$GTK_CFLAGS $VTE_CFLAGS" Regarding you question about building environment I don't have a simple answer. There are many different ways. I built my environment for Kindle years ago with scratchbox2, but this tool is not developed any more. If you manage to gather Kindle version libraries and headers into a separate tree on your machine you may be able to force your compiler to use it as its sysroot (eg. by creating gcc wrapper). |
Thanks for explaining about the building environment. I 'sort of' understand that building for kindle is a special case that cannot be covered by a generic method. |
Thanks for testing! Regarding your problem. Glib version on my Kindle is 2.29.18. On debian jessie it is 2.42.1. Either setup dedicated sysroot with Kindle libraries and development headers (at point it to your compiler) or maybe try with older version of debian (squeeze?). |
Hello, glad to see this fantastic project still in active development. Kterm has helped me immensely during my past ownership of a kindle device. I'm not sure if this is the right place to ask for help, especially when it involves asking newbie questions in a bug tracker.
I've skimmed through the file configure.ac and It seems that building for Kindle with static libvte involves correctly exporting VTE_LIBS. I've tried setting VTE_LIBS to 'libs/libvte.a' '-l:libs/libvte.a' '-llibs/libvte.a' to no avail. (source of static libvte.a : #2)
My building environment is an emulated armel debian jessie in qemu.
Thanks!
The text was updated successfully, but these errors were encountered: