From f7e3f1d8d0438f52e4f988a12318075cc1b43568 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 6 Apr 2014 22:36:16 -0400 Subject: [PATCH] Add option no-define to AM_INIT_AUTOMAKE No need to define all variables on the compiler command line since they are already defined in the config.h header file. --- configure.ac | 2 +- src/common/common.h | 4 ++++ src/gtk/app-config.c | 4 ++-- src/gtk/helpmenu.c | 2 +- src/gtk/main.c | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 1b28736..16a28b4 100644 --- a/configure.ac +++ b/configure.ac @@ -7,7 +7,7 @@ AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR(src/common/cpu8051.c) dnl Checking if the NEWS file has been updated to reflect the current version. -AM_INIT_AUTOMAKE(check-news -Wall std-options color-tests parallel-tests) +AM_INIT_AUTOMAKE(no-define check-news -Wall std-options color-tests parallel-tests) AM_SILENT_RULES([yes]) AM_CONFIG_HEADER(config.h:config-h.in) diff --git a/src/common/common.h b/src/common/common.h index 345a21a..e38f5b1 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -10,6 +10,10 @@ #ifndef COMMON_H #define COMMON_H 1 +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include diff --git a/src/gtk/app-config.c b/src/gtk/app-config.c index eccfc4d..487975f 100644 --- a/src/gtk/app-config.c +++ b/src/gtk/app-config.c @@ -103,7 +103,7 @@ app_config_get_dir_path(void) { char *dir_path; - dir_path = g_build_filename(g_get_user_config_dir(), PACKAGE, + dir_path = g_build_filename(g_get_user_config_dir(), PACKAGE_NAME, profile_name, NULL); return dir_path; @@ -116,7 +116,7 @@ app_config_get_file_path(void) char *dir_path; char file[MAX_FILENAME_LENGTH]; - sprintf(file, "%s.conf", PACKAGE); + sprintf(file, "%s.conf", PACKAGE_NAME); dir_path = app_config_get_dir_path(); diff --git a/src/gtk/helpmenu.c b/src/gtk/helpmenu.c index 9b9ac2e..90c9120 100644 --- a/src/gtk/helpmenu.c +++ b/src/gtk/helpmenu.c @@ -82,7 +82,7 @@ help_add_menu(GtkWidget *menu_bar) menu = gtk_menu_new(); /* Create the 'Help About' item. */ - item = gtk_menu_item_new_with_label("About " PACKAGE); + item = gtk_menu_item_new_with_label("About " PACKAGE_NAME); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); /* Attach the callback functions to the activate signal. */ g_signal_connect(item, "activate", G_CALLBACK(help_about_event), NULL); diff --git a/src/gtk/main.c b/src/gtk/main.c index 94b7ebe..d20d744 100644 --- a/src/gtk/main.c +++ b/src/gtk/main.c @@ -479,7 +479,7 @@ emugtk_window_init(void) emugtk_window_init_complete = false; mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); - gtk_window_set_title(GTK_WINDOW(mainwin), PACKAGE); + gtk_window_set_title(GTK_WINDOW(mainwin), PACKAGE_NAME); gtk_window_set_default_size(GTK_WINDOW(mainwin), cfg->win_width, cfg->win_height); gtk_container_set_border_width(GTK_CONTAINER(mainwin), 0); -- 2.20.1