diff --git a/configure.ac b/configure.ac index da5c94b..1db259f 100644 --- a/configure.ac +++ b/configure.ac @@ -189,6 +189,8 @@ AC_SUBST(PACKAGE_MINOR_VERSION,$app_vrs_minor) AC_ARG_WITH([release], [AS_HELP_STRING([--with-release], [Set release])], [ app_cv_release="$withval" ],[ app_cv_release="`date +%y`.`date +%m`.`date +%d`" ]) 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.]) ]) +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.]) ]) + app_rls_major=$(echo $app_cv_release.0.0 | cut -d. -f1) app_rls_minor=$(echo $app_cv_release.0.0 | cut -d. -f2) diff --git a/src/include/config.h.in b/src/include/config.h.in index 6757b7b..61b0a72 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -37,6 +37,7 @@ #undef PACKAGE_VERSION #undef PACKAGE_RELEASE #undef DEFAULT_SESSION_NAME + #undef APPLICATION_NAME #undef HAVE_GNUC_VISIBILITY #undef HAVE_LIBM diff --git a/src/pw3270/main.c b/src/pw3270/main.c index c2047e0..4cacf49 100644 --- a/src/pw3270/main.c +++ b/src/pw3270/main.c @@ -235,7 +235,11 @@ static gboolean startup(GtkWidget *toplevel) int main(int argc, char *argv[]) { const gchar * pluginpath = NULL; +#ifdef APPLICATION_NAME + const char * app_name = G_STRINGIFY(APPLICATION_NAME); +#else const char * app_name = NULL; +#endif // APPLICATION_NAME #ifdef DEFAULT_SESSION_NAME const gchar * session_name = G_STRINGIFY(DEFAULT_SESSION_NAME); @@ -365,7 +369,11 @@ int main(int argc, char *argv[]) { "autodisconnect", 'D', 0, G_OPTION_ARG_INT, &timer, N_( "Minutes for auto-disconnect" ), 0 }, { "pluginpath", 'P', 0, G_OPTION_ARG_STRING, &pluginpath, N_( "Path for plugin files" ), NULL }, +#ifdef APPLICATION_NAME + { "application-name", 'A', 0, G_OPTION_ARG_STRING, &app_name, N_( "Application name" ), G_STRINGIFY(APPLICATION_NAME) }, +#else { "application-name", 'A', 0, G_OPTION_ARG_STRING, &app_name, N_( "Application name" ), NULL }, +#endif // APPLICATION_NAME #if defined( HAVE_SYSLOG ) { "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[]) if(app_name) { g_set_application_name(app_name); + g_message("Application name set to \"%s\"",app_name); } #ifdef _WIN32 else -- libgit2 0.21.2