Commit e68ebd304f1a0c6d7e8b92e68988a679d0f989ad

Authored by Perry Werneck
1 parent 08889eb4

Fixing the application name with ./configure option.

configure.ac
... ... @@ -189,6 +189,8 @@ AC_SUBST(PACKAGE_MINOR_VERSION,$app_vrs_minor)
189 189  
190 190 AC_ARG_WITH([release], [AS_HELP_STRING([--with-release], [Set release])], [ app_cv_release="$withval" ],[ app_cv_release="`date +%y`.`date +%m`.`date +%d`" ])
191 191 AC_ARG_WITH([session-name], [AS_HELP_STRING([--with-session-name], [Set default session name])], [ AC_DEFINE_UNQUOTED(DEFAULT_SESSION_NAME, $withval) ],[ AC_MSG_NOTICE([No default session name.]) ])
  192 +AC_ARG_WITH([application-name], [AS_HELP_STRING([--with-application-name], [Set application name])], [ AC_DEFINE_UNQUOTED(APPLICATION_NAME, $withval) ],[ AC_MSG_NOTICE([No default application name.]) ])
  193 +
192 194  
193 195 app_rls_major=$(echo $app_cv_release.0.0 | cut -d. -f1)
194 196 app_rls_minor=$(echo $app_cv_release.0.0 | cut -d. -f2)
... ...
src/include/config.h.in
... ... @@ -37,6 +37,7 @@
37 37 #undef PACKAGE_VERSION
38 38 #undef PACKAGE_RELEASE
39 39 #undef DEFAULT_SESSION_NAME
  40 + #undef APPLICATION_NAME
40 41  
41 42 #undef HAVE_GNUC_VISIBILITY
42 43 #undef HAVE_LIBM
... ...
src/pw3270/main.c
... ... @@ -235,7 +235,11 @@ static gboolean startup(GtkWidget *toplevel)
235 235 int main(int argc, char *argv[])
236 236 {
237 237 const gchar * pluginpath = NULL;
  238 +#ifdef APPLICATION_NAME
  239 + const char * app_name = G_STRINGIFY(APPLICATION_NAME);
  240 +#else
238 241 const char * app_name = NULL;
  242 +#endif // APPLICATION_NAME
239 243  
240 244 #ifdef DEFAULT_SESSION_NAME
241 245 const gchar * session_name = G_STRINGIFY(DEFAULT_SESSION_NAME);
... ... @@ -365,7 +369,11 @@ int main(int argc, char *argv[])
365 369 { "autodisconnect", 'D', 0, G_OPTION_ARG_INT, &timer, N_( "Minutes for auto-disconnect" ), 0 },
366 370 { "pluginpath", 'P', 0, G_OPTION_ARG_STRING, &pluginpath, N_( "Path for plugin files" ), NULL },
367 371  
  372 +#ifdef APPLICATION_NAME
  373 + { "application-name", 'A', 0, G_OPTION_ARG_STRING, &app_name, N_( "Application name" ), G_STRINGIFY(APPLICATION_NAME) },
  374 +#else
368 375 { "application-name", 'A', 0, G_OPTION_ARG_STRING, &app_name, N_( "Application name" ), NULL },
  376 +#endif // APPLICATION_NAME
369 377  
370 378 #if defined( HAVE_SYSLOG )
371 379 { "syslog", 'l', 0, G_OPTION_ARG_NONE, &log_to_syslog, N_( "Send messages to syslog" ), NULL },
... ... @@ -416,6 +424,7 @@ int main(int argc, char *argv[])
416 424 if(app_name)
417 425 {
418 426 g_set_application_name(app_name);
  427 + g_message("Application name set to \"%s\"",app_name);
419 428 }
420 429 #ifdef _WIN32
421 430 else
... ...