From: Hugo Villeneuve Date: Wed, 2 Apr 2014 01:01:47 +0000 (-0400) Subject: Pass no-define to AM_INIT_AUTOMAKE in order not to define PACKAGE and VERSION X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=c6cd8ab8023a92c481cfbae3922f71dfa0f9ca4e;p=hvgrip.git Pass no-define to AM_INIT_AUTOMAKE in order not to define PACKAGE and VERSION --- diff --git a/configure.ac b/configure.ac index d78a628..dc66bdc 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ AC_INIT([hvgrip], [3.4.0], [hugo@hugovil.com], [hvgrip], AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR(src/main.c) -AM_INIT_AUTOMAKE(check-news -Wall std-options) +AM_INIT_AUTOMAKE([no-define check-news -Wall std-options]) AM_SILENT_RULES([yes]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.18.1]) diff --git a/src/cdplay.c b/src/cdplay.c index 5a30509..0399351 100644 --- a/src/cdplay.c +++ b/src/cdplay.c @@ -190,7 +190,7 @@ gboolean DiscDBLookupDisc(GripInfo *ginfo,DiscDBServer *server) DiscDBDiscid(disc)); strncpy(hello.hello_program,"Grip",256); - strncpy(hello.hello_version,VERSION,256); + strncpy(hello.hello_version,PACKAGE_VERSION,256); if(ginfo->db_use_freedb && !strcasecmp(ginfo->discdb_encoding,"UTF-8")) hello.proto_version=6; @@ -1749,7 +1749,7 @@ void UpdateDisplay(GripInfo *ginfo) gtk_label_set(GTK_LABEL(uinfo->play_time_label),buf); g_snprintf(icon_buf,sizeof(icon_buf),"%02d %s %s", - disc->curr_track,buf,PACKAGE); + disc->curr_track,buf,PACKAGE_NAME); gdk_window_set_icon_name(uinfo->app->window,icon_buf); } } @@ -1763,7 +1763,7 @@ void UpdateDisplay(GripInfo *ginfo) g_snprintf(buf,80,"%02d:%02d",disc->length.mins, disc->length.secs); g_snprintf(icon_buf, sizeof(icon_buf),"%02d %s %s", - disc->curr_track,buf,PACKAGE); + disc->curr_track,buf,PACKAGE_NAME); gtk_label_set(GTK_LABEL(uinfo->play_time_label),buf); @@ -1786,7 +1786,7 @@ void UpdateDisplay(GripInfo *ginfo) } else { gtk_label_set(GTK_LABEL(uinfo->play_time_label),"--:--"); - strncpy(icon_buf,PACKAGE,sizeof(icon_buf)); + strncpy(icon_buf,PACKAGE_NAME,sizeof(icon_buf)); SetCurrentTrack(ginfo,-1); } diff --git a/src/common.h b/src/common.h index bec7609..698d13d 100644 --- a/src/common.h +++ b/src/common.h @@ -28,6 +28,7 @@ #include #include +#include "config.h" #include "gettext.h" #define _(String) gettext(String) diff --git a/src/discdb.c b/src/discdb.c index 74233c7..31ca529 100644 --- a/src/discdb.c +++ b/src/discdb.c @@ -809,10 +809,10 @@ int DiscDBWriteDiscData(DiscInfo *disc,DiscData *ddata,FILE *outfile, #ifndef GRIPCD fprintf(discdb_data,"# xmcd CD database file generated by Grip %s\n", - VERSION); + PACKAGE_VERSION); #else fprintf(discdb_data,"# xmcd CD database file generated by GCD %s\n", - VERSION); + PACKAGE_VERSION); #endif fputs("# \n",discdb_data); fputs("# Track frame offsets:\n",discdb_data); @@ -828,7 +828,7 @@ int DiscDBWriteDiscData(DiscInfo *disc,DiscData *ddata,FILE *outfile, if(gripext) fprintf(discdb_data,"# Revision: %d\n",ddata->revision); else fprintf(discdb_data,"# Revision: %d\n",ddata->revision+1); - fprintf(discdb_data,"# Submitted via: Grip %s\n",VERSION); + fprintf(discdb_data,"# Submitted via: Grip %s\n",PACKAGE_VERSION); fputs("# \n",discdb_data); fprintf(discdb_data,"DISCID=%08x\n",ddata->data_id); diff --git a/src/grip.c b/src/grip.c index 1183d87..f0e2f2f 100644 --- a/src/grip.c +++ b/src/grip.c @@ -29,6 +29,8 @@ #include #include #include + +#include "config.h" #include "grip.h" #include "discdb.h" #include "cdplay.h" @@ -320,10 +322,10 @@ GtkWidget *GripNew(const gchar* geometry,char *device,char *scsi_device, CheckNewDisc(ginfo,FALSE); /* Check if we're running this version for the first time */ - if(strcmp(VERSION,ginfo->version)!=0) { - strcpy(ginfo->version,VERSION); + if (strcmp(PACKAGE_VERSION, ginfo->version) != 0) { + strcpy(ginfo->version, PACKAGE_VERSION); - sscanf(VERSION,"%d.%d.%d",&major,&minor,&point); + sscanf(PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &point); /* Check if we have a dev release */ if(minor%2) { @@ -585,7 +587,7 @@ void MakeAboutPage(GripGUI *uinfo) vbox2=gtk_vbox_new(TRUE,0); - sprintf(versionbuf,_("Version %s"),VERSION); + sprintf(versionbuf, _("Version %s"), PACKAGE_VERSION); label=gtk_label_new(versionbuf); gtk_widget_set_style(label,uinfo->style_wb); gtk_box_pack_start(GTK_BOX(vbox2),label,FALSE,FALSE,0);