Add option no-define to AM_INIT_AUTOMAKE
authorHugo Villeneuve <hugo@hugovil.com>
Mon, 7 Apr 2014 02:36:16 +0000 (22:36 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Mon, 7 Apr 2014 02:36:16 +0000 (22:36 -0400)
No need to define all variables on the compiler command line since
they are already defined in the config.h header file.

configure.ac
src/common/common.h
src/gtk/app-config.c
src/gtk/helpmenu.c
src/gtk/main.c

index 1b28736..16a28b4 100644 (file)
@@ -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)
 
index 345a21a..e38f5b1 100644 (file)
 #ifndef COMMON_H
 #define COMMON_H 1
 
+#if HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
index eccfc4d..487975f 100644 (file)
@@ -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();
 
index 9b9ac2e..90c9120 100644 (file)
@@ -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);
index 94b7ebe..d20d744 100644 (file)
@@ -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);