summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-10-01 13:11:03 +0200
committerraveit65 <[email protected]>2019-10-03 11:27:14 +0200
commit7d5048dcb46585fd4328ad1c2a4942aee02a22a0 (patch)
treeefe058b2ce2d06b47b111d0623f1dbbc30615126
parentf10463c3de365ebdeb073892f79331c35de4c601 (diff)
downloadengrampa-7d5048dcb46585fd4328ad1c2a4942aee02a22a0.tar.bz2
engrampa-7d5048dcb46585fd4328ad1c2a4942aee02a22a0.tar.xz
Set compiler debug flags using MATE_DEBUG_CHECK and update configure summary
test: $ ./autogen.sh --enable-debug=profile --prefix=/usr <cut> Configuration: Source code location: . Compiler: gcc Compiler flags: -g -pg Warning flags: -Wall -Wmissing-prototypes Linker flags: -pg Caja support: yes PackageKit support: yes Run in place no Use libmagic: no JSON support: yes Now type `make' to compile engrampa $ ./autogen.sh --enable-debug --prefix=/usr <cut> Configuration: Source code location: . Compiler: gcc Compiler flags: -g -O0 Warning flags: -Wall -Wmissing-prototypes Linker flags: Caja support: yes PackageKit support: yes Run in place no Use libmagic: no JSON support: yes Now type `make' to compile engrampa $ grep MATE_ENABLE_DEBUG config.h
-rw-r--r--caja/caja-engrampa.c4
-rw-r--r--configure.ac4
-rw-r--r--src/fr-archive.c8
-rw-r--r--src/fr-command-cfile.c4
-rw-r--r--src/fr-command.c8
-rw-r--r--src/fr-command.h5
-rw-r--r--src/fr-process.c5
-rw-r--r--src/fr-window.c16
-rw-r--r--src/glib-utils.c3
-rw-r--r--src/java-utils.c3
10 files changed, 39 insertions, 21 deletions
diff --git a/caja/caja-engrampa.c b/caja/caja-engrampa.c
index d262f49..b464192 100644
--- a/caja/caja-engrampa.c
+++ b/caja/caja-engrampa.c
@@ -60,7 +60,7 @@ extract_to_callback (CajaMenuItem *item,
g_free (quoted_uri);
}
-#ifdef DEBUG
+#ifdef MATE_ENABLE_DEBUG
g_print ("EXEC: %s\n", cmd->str);
#endif
@@ -96,7 +96,7 @@ extract_here_callback (CajaMenuItem *item,
g_spawn_command_line_async (cmd->str, NULL);
-#ifdef DEBUG
+#ifdef MATE_ENABLE_DEBUG
g_print ("EXEC: %s\n", cmd->str);
#endif
diff --git a/configure.ac b/configure.ac
index c221bc4..23d5a02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,6 +11,7 @@ AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
MATE_COMMON_INIT
+MATE_DEBUG_CHECK([no])
MATE_COMPILE_WARNINGS
AC_PROG_CC
@@ -198,6 +199,9 @@ Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
+ Compiler flags: ${CFLAGS}
+ Warning flags: ${WARN_CFLAGS}
+ Linker flags: ${LDFLAGS}
Caja support: ${enable_caja_actions}
PackageKit support: ${enable_packagekit}
Run in place ${enable_run_in_place}
diff --git a/src/fr-archive.c b/src/fr-archive.c
index 2bbf4fa..cb7b168 100644
--- a/src/fr-archive.c
+++ b/src/fr-archive.c
@@ -693,8 +693,8 @@ action_started (FrCommand *command,
FrAction action,
FrArchive *archive)
{
-#ifdef DEBUG
- debug (DEBUG_INFO, "%s [START] (FR::Archive)\n", action_names[action]);
+#ifdef MATE_ENABLE_DEBUG
+ debug (DEBUG_INFO, "%s [START] (FR::Archive)\n", get_action_name (action));
#endif
g_signal_emit (G_OBJECT (archive),
@@ -930,8 +930,8 @@ action_performed (FrCommand *command,
FrProcError *error,
FrArchive *archive)
{
-#ifdef DEBUG
- debug (DEBUG_INFO, "%s [DONE] (FR::Archive)\n", action_names[action]);
+#ifdef MATE_ENABLE_DEBUG
+ debug (DEBUG_INFO, "%s [DONE] (FR::Archive)\n", get_action_name (action));
#endif
switch (action) {
diff --git a/src/fr-command-cfile.c b/src/fr-command-cfile.c
index fff8bfb..697d8ab 100644
--- a/src/fr-command-cfile.c
+++ b/src/fr-command-cfile.c
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <config.h>
+
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
@@ -76,7 +78,7 @@ get_uncompressed_name_from_archive (FrCommand *comm,
while (g_input_stream_read (stream, buffer, 1, NULL, NULL) > 0) {
if (buffer[0] == '\0') {
filename = g_strdup (file_name_from_path (str->str));
-#ifdef DEBUG
+#ifdef MATE_ENABLE_DEBUG
g_message ("filename is: %s", filename);
#endif
break;
diff --git a/src/fr-command.c b/src/fr-command.c
index 9077d18..dc372b0 100644
--- a/src/fr-command.c
+++ b/src/fr-command.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <config.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
@@ -79,6 +80,13 @@ const char *action_names[] = { "NONE",
"CREATING_ARCHIVE",
"SAVING_REMOTE_ARCHIVE" };
+#if MATE_ENABLE_DEBUG
+const char * get_action_name (FrAction action)
+{
+ return action_names[action];
+}
+#endif
+
GType
fr_command_get_type ()
{
diff --git a/src/fr-command.h b/src/fr-command.h
index 772189b..2924a5d 100644
--- a/src/fr-command.h
+++ b/src/fr-command.h
@@ -23,6 +23,7 @@
#ifndef FR_COMMAND_H
#define FR_COMMAND_H
+#include <config.h>
#include <glib.h>
#include "file-data.h"
#include "fr-process.h"
@@ -59,8 +60,8 @@ typedef enum {
FR_ACTION_SAVING_REMOTE_ARCHIVE /* copying the archive to a remote location */
} FrAction;
-#ifdef DEBUG
-extern char *action_names[];
+#if MATE_ENABLE_DEBUG
+const char * get_action_name (FrAction action);
#endif
struct _FrCommand
diff --git a/src/fr-process.c b/src/fr-process.c
index d82bacd..73395ad 100644
--- a/src/fr-process.c
+++ b/src/fr-process.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <config.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -739,7 +740,7 @@ start_current_command (FrProcess *process)
argv[i] = NULL;
-#ifdef DEBUG
+#ifdef MATE_ENABLE_DEBUG
{
int j;
@@ -946,7 +947,7 @@ check_child (gpointer data)
if (continue_process) {
if (process->error.type != FR_PROC_ERROR_NONE) {
allow_sticky_processes_only (process, TRUE);
-#ifdef DEBUG
+#ifdef MATE_ENABLE_DEBUG
{
GList *scan;
diff --git a/src/fr-window.c b/src/fr-window.c
index 99dc120..fc94f2e 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -2901,8 +2901,8 @@ action_started (FrArchive *archive,
window->priv->action = action;
fr_window_start_activity_mode (window);
-#ifdef DEBUG
- debug (DEBUG_INFO, "%s [START] (FR::Window)\n", action_names[action]);
+#ifdef MATE_ENABLE_DEBUG
+ debug (DEBUG_INFO, "%s [START] (FR::Window)\n", get_action_name (action));
#endif
message = get_action_description (action, window->priv->pd_last_archive);
@@ -3163,8 +3163,8 @@ convert__action_performed (FrArchive *archive,
{
FrWindow *window = data;
-#ifdef DEBUG
- debug (DEBUG_INFO, "%s [CONVERT::DONE] (FR::Window)\n", action_names[action]);
+#ifdef MATE_ENABLE_DEBUG
+ debug (DEBUG_INFO, "%s [CONVERT::DONE] (FR::Window)\n", get_action_name (action));
#endif
if ((action == FR_ACTION_GETTING_FILE_LIST) || (action == FR_ACTION_ADDING_FILES)) {
@@ -3203,8 +3203,8 @@ action_performed (FrArchive *archive,
char *archive_dir;
gboolean temp_dir;
-#ifdef DEBUG
- debug (DEBUG_INFO, "%s [DONE] (FR::Window)\n", action_names[action]);
+#ifdef MATE_ENABLE_DEBUG
+ debug (DEBUG_INFO, "%s [DONE] (FR::Window)\n", get_action_name (action));
#endif
fr_window_stop_activity_mode (window);
@@ -8118,8 +8118,8 @@ copy_from_archive_action_performed_cb (FrArchive *archive,
FrWindow *window = data;
gboolean UNUSED_VARIABLE continue_batch = FALSE;
-#ifdef DEBUG
- debug (DEBUG_INFO, "%s [DONE] (FR::Window)\n", action_names[action]);
+#ifdef MATE_ENABLE_DEBUG
+ debug (DEBUG_INFO, "%s [DONE] (FR::Window)\n", get_action_name (action));
#endif
fr_window_stop_activity_mode (window);
diff --git a/src/glib-utils.c b/src/glib-utils.c
index 57298e4..cffa591 100644
--- a/src/glib-utils.c
+++ b/src/glib-utils.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <config.h>
#include <string.h>
#include <stdio.h>
#include <glib.h>
@@ -472,7 +473,7 @@ debug (const char *file,
const char *function,
const char *format, ...)
{
-#ifdef DEBUG
+#ifdef MATE_ENABLE_DEBUG
va_list args;
char *str;
diff --git a/src/java-utils.c b/src/java-utils.c
index 1aed8a5..1efcb3f 100644
--- a/src/java-utils.c
+++ b/src/java-utils.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <config.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
@@ -226,7 +227,7 @@ load_constant_pool_utfs (JavaClassFile *cfile)
i++;
}
-#ifdef DEBUG
+#ifdef MATE_ENABLE_DEBUG
g_print( "Number of Entries: %d\n", i );
#endif
}