Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Mon, 22 Aug 2016 18:03:18 UTC
Commit: 095d88958296200ee890dc2b45e0123f1559705b
https://github.com/geany/geany/commit/095d88958296200ee890dc2b45e0123f15597…
Log Message:
-----------
VTE: Fix crash when trying to change VTE directory at startup
2150302fe6e88f88e5eba78502b478be2b78c662 introduced a bug, because
configuration_load_session_files() calls VTE code if vte_info.have_vte
is non-FALSE, before vte_init() has been called. So, it relied in the
implicit 0-initialization of the vte_info global, which the above
commit changed carelessly.
So, instead of altering vte_info.have_vte early, add a specific flag
for whether VTE is disabled on the command line.
Also, explicitly initialize vte_info to suggest to the reader the
default values does matter.
Modified Paths:
--------------
src/keyfile.c
src/libmain.c
src/vte.c
src/vte.h
Modified: src/keyfile.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -859,7 +859,7 @@ static void load_dialog_prefs(GKeyFile *config)
/* VTE */
#ifdef HAVE_VTE
vte_info.load_vte = utils_get_setting_boolean(config, "VTE", "load_vte", TRUE);
- if (vte_info.load_vte && vte_info.have_vte /* not disabled on the cmdline */)
+ if (vte_info.load_vte && vte_info.load_vte_cmdline /* not disabled on the cmdline */)
{
StashGroup *group;
struct passwd *pw = getpwuid(getuid());
Modified: src/libmain.c
6 lines changed, 2 insertions(+), 4 deletions(-)
===================================================================
@@ -877,14 +877,12 @@ static void load_session_project_file(void)
static void load_settings(void)
{
#ifdef HAVE_VTE
- /* initially assume we'll have VTE unless it's disabled by cmdline, to allow configuration
- * loading to be notified about disabled VTE on the cmdline */
- vte_info.have_vte = !no_vte;
+ vte_info.load_vte_cmdline = !no_vte;
#endif
configuration_load();
/* let cmdline options overwrite configuration settings */
#ifdef HAVE_VTE
- vte_info.have_vte = (no_vte) ? FALSE : vte_info.load_vte;
+ vte_info.have_vte = vte_info.load_vte && vte_info.load_vte_cmdline;
#endif
if (no_msgwin)
ui_prefs.msgwindow_visible = FALSE;
Modified: src/vte.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -56,7 +56,7 @@
#include <errno.h>
-VteInfo vte_info;
+VteInfo vte_info = { FALSE, FALSE, FALSE, NULL, NULL };
VteConfig *vc;
static pid_t pid = 0;
Modified: src/vte.h
5 lines changed, 3 insertions(+), 2 deletions(-)
===================================================================
@@ -31,8 +31,9 @@ G_BEGIN_DECLS
typedef struct
{
- gboolean load_vte; /* this is the preference, NOT the current instance VTE state */
- gboolean have_vte; /* use this field to check if the current instance has VTE */
+ gboolean load_vte; /* this is the preference, NOT the current instance VTE state */
+ gboolean load_vte_cmdline; /* this is the command line option */
+ gboolean have_vte; /* use this field to check if the current instance has VTE */
gchar *lib_vte;
gchar *dir;
} VteInfo;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sat, 30 Jul 2016 22:54:56 UTC
Commit: e3f7d256c32307d211b728582fb688512cddfb24
https://github.com/geany/geany/commit/e3f7d256c32307d211b728582fb688512cddf…
Log Message:
-----------
Test whether the C++ compiler works by compiling a test program
This is more reliable than using `which`, which doesn't work if the CXX
environment variable is set to something else than an executable (e.g
contains options), and is apparently less portable on some systems.
See:
* http://lists.geany.org/pipermail/devel/2009-September/001367.html,
which lead to 5bb28825aadb43ea8ba536c34970d53860b50759.
* https://sourceforge.net/p/geany/bugs/455/, which lead to a revert
of the above, 5b9605a9d6d799629b8ed3163596069c8c948b06.
Fixes #829.
Modified Paths:
--------------
configure.ac
m4/geany-prog-cxx.m4
Modified: configure.ac
6 lines changed, 1 insertions(+), 5 deletions(-)
===================================================================
@@ -30,11 +30,7 @@ AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_CXX
-# check for C++ compiler explicitly and fail if none is found, do this check
-# after AC_PROG_CXX has set the CXX environment variable
-if ! which $CXX >/dev/null 2>&1; then
- AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
-fi
+GEANY_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
Modified: m4/geany-prog-cxx.m4
20 lines changed, 20 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,20 @@
+dnl GEANY_PROG_CXX
+dnl Check for a working C++ compiler.
+dnl like AC_PROG_CXX, but makes sure the compiler actually works instead of
+dnl falling back on a reasonable default only.
+dnl
+dnl You must call AC_PROG_CXX yourself before this macro.
+AC_DEFUN([GEANY_PROG_CXX],
+[
+ AC_REQUIRE([AC_PROG_CXX])
+
+ AC_LANG_PUSH([C++])
+ AC_MSG_CHECKING([whether the C++ compiler works])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[class Test {public: static int main() {return 0;}};]],
+ [[Test::main();]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([The C++ compiler $CXX does not work. Please install a working C++ compiler or define CXX to the appropriate value.])])
+ AC_LANG_POP([C++])
+])
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sat, 20 Aug 2016 17:55:26 UTC
Commit: 42c02db149391e32801543f3b6dbebcf43b4ff3b
https://github.com/geany/geany/commit/42c02db149391e32801543f3b6dbebcf43b4f…
Log Message:
-----------
Merge pull request #1155 from b4n/cxx-check
Test whether the C++ compiler works by compiling a test program
Modified Paths:
--------------
configure.ac
m4/geany-prog-cxx.m4
Modified: configure.ac
6 lines changed, 1 insertions(+), 5 deletions(-)
===================================================================
@@ -30,11 +30,7 @@ AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_CXX
-# check for C++ compiler explicitly and fail if none is found, do this check
-# after AC_PROG_CXX has set the CXX environment variable
-if ! which $CXX >/dev/null 2>&1; then
- AC_MSG_ERROR([No C++ compiler found. Please install a C++ compiler.])
-fi
+GEANY_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
Modified: m4/geany-prog-cxx.m4
20 lines changed, 20 insertions(+), 0 deletions(-)
===================================================================
@@ -0,0 +1,20 @@
+dnl GEANY_PROG_CXX
+dnl Check for a working C++ compiler.
+dnl like AC_PROG_CXX, but makes sure the compiler actually works instead of
+dnl falling back on a reasonable default only.
+dnl
+dnl You must call AC_PROG_CXX yourself before this macro.
+AC_DEFUN([GEANY_PROG_CXX],
+[
+ AC_REQUIRE([AC_PROG_CXX])
+
+ AC_LANG_PUSH([C++])
+ AC_MSG_CHECKING([whether the C++ compiler works])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[class Test {public: static int main() {return 0;}};]],
+ [[Test::main();]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([The C++ compiler $CXX does not work. Please install a working C++ compiler or define CXX to the appropriate value.])])
+ AC_LANG_POP([C++])
+])
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).