Commit e68ebd304f1a0c6d7e8b92e68988a679d0f989ad
1 parent
08889eb4
Exists in
master
and in
5 other branches
Fixing the application name with ./configure option.
Showing
3 changed files
with
12 additions
and
0 deletions
Show diff stats
configure.ac
| @@ -189,6 +189,8 @@ AC_SUBST(PACKAGE_MINOR_VERSION,$app_vrs_minor) | @@ -189,6 +189,8 @@ AC_SUBST(PACKAGE_MINOR_VERSION,$app_vrs_minor) | ||
| 189 | 189 | ||
| 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`" ]) | 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 | 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.]) ]) | 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 | app_rls_major=$(echo $app_cv_release.0.0 | cut -d. -f1) | 195 | app_rls_major=$(echo $app_cv_release.0.0 | cut -d. -f1) |
| 194 | app_rls_minor=$(echo $app_cv_release.0.0 | cut -d. -f2) | 196 | app_rls_minor=$(echo $app_cv_release.0.0 | cut -d. -f2) |
src/include/config.h.in
| @@ -37,6 +37,7 @@ | @@ -37,6 +37,7 @@ | ||
| 37 | #undef PACKAGE_VERSION | 37 | #undef PACKAGE_VERSION |
| 38 | #undef PACKAGE_RELEASE | 38 | #undef PACKAGE_RELEASE |
| 39 | #undef DEFAULT_SESSION_NAME | 39 | #undef DEFAULT_SESSION_NAME |
| 40 | + #undef APPLICATION_NAME | ||
| 40 | 41 | ||
| 41 | #undef HAVE_GNUC_VISIBILITY | 42 | #undef HAVE_GNUC_VISIBILITY |
| 42 | #undef HAVE_LIBM | 43 | #undef HAVE_LIBM |
src/pw3270/main.c
| @@ -235,7 +235,11 @@ static gboolean startup(GtkWidget *toplevel) | @@ -235,7 +235,11 @@ static gboolean startup(GtkWidget *toplevel) | ||
| 235 | int main(int argc, char *argv[]) | 235 | int main(int argc, char *argv[]) |
| 236 | { | 236 | { |
| 237 | const gchar * pluginpath = NULL; | 237 | const gchar * pluginpath = NULL; |
| 238 | +#ifdef APPLICATION_NAME | ||
| 239 | + const char * app_name = G_STRINGIFY(APPLICATION_NAME); | ||
| 240 | +#else | ||
| 238 | const char * app_name = NULL; | 241 | const char * app_name = NULL; |
| 242 | +#endif // APPLICATION_NAME | ||
| 239 | 243 | ||
| 240 | #ifdef DEFAULT_SESSION_NAME | 244 | #ifdef DEFAULT_SESSION_NAME |
| 241 | const gchar * session_name = G_STRINGIFY(DEFAULT_SESSION_NAME); | 245 | const gchar * session_name = G_STRINGIFY(DEFAULT_SESSION_NAME); |
| @@ -365,7 +369,11 @@ int main(int argc, char *argv[]) | @@ -365,7 +369,11 @@ int main(int argc, char *argv[]) | ||
| 365 | { "autodisconnect", 'D', 0, G_OPTION_ARG_INT, &timer, N_( "Minutes for auto-disconnect" ), 0 }, | 369 | { "autodisconnect", 'D', 0, G_OPTION_ARG_INT, &timer, N_( "Minutes for auto-disconnect" ), 0 }, |
| 366 | { "pluginpath", 'P', 0, G_OPTION_ARG_STRING, &pluginpath, N_( "Path for plugin files" ), NULL }, | 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 | { "application-name", 'A', 0, G_OPTION_ARG_STRING, &app_name, N_( "Application name" ), NULL }, | 375 | { "application-name", 'A', 0, G_OPTION_ARG_STRING, &app_name, N_( "Application name" ), NULL }, |
| 376 | +#endif // APPLICATION_NAME | ||
| 369 | 377 | ||
| 370 | #if defined( HAVE_SYSLOG ) | 378 | #if defined( HAVE_SYSLOG ) |
| 371 | { "syslog", 'l', 0, G_OPTION_ARG_NONE, &log_to_syslog, N_( "Send messages to syslog" ), NULL }, | 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,6 +424,7 @@ int main(int argc, char *argv[]) | ||
| 416 | if(app_name) | 424 | if(app_name) |
| 417 | { | 425 | { |
| 418 | g_set_application_name(app_name); | 426 | g_set_application_name(app_name); |
| 427 | + g_message("Application name set to \"%s\"",app_name); | ||
| 419 | } | 428 | } |
| 420 | #ifdef _WIN32 | 429 | #ifdef _WIN32 |
| 421 | else | 430 | else |