From: Hugo Villeneuve Date: Mon, 24 Nov 2014 13:32:08 +0000 (-0500) Subject: Cleanup configure.ac X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=061d3f1a34c959e80c0cf72d43373b9778bfafbe;p=dockapps%2Fhvclock.git Cleanup configure.ac --- diff --git a/configure.ac b/configure.ac index 9e44596..28892cc 100644 --- a/configure.ac +++ b/configure.ac @@ -2,12 +2,13 @@ dnl Initialization stuff. AC_INIT(hvclock, 1.1.2) -AC_CONFIG_AUX_DIR(build-aux) +AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR(src/hvclock.c) -AM_CONFIG_HEADER(config.h:config-h.in) -dnl Checking if the NEWS file has been updated to reflect the current version. -AM_INIT_AUTOMAKE(check-news) + +AM_INIT_AUTOMAKE([no-define gnits dist-bzip2 + -Wall -Wno-extra-portability]) AM_SILENT_RULES([yes]) +AM_CONFIG_HEADER(config.h:config-h.in) dnl Testing the C compiler. AC_PROG_CC @@ -18,8 +19,8 @@ AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T -dnl Basic CFLAGS values -CFLAGS="${CFLAGS} -Wall" +dnl Basic warning CFLAGS values +WARNINGCFLAGS="-Wall -Wextra -Wformat -Wformat-security" dnl Trying to locate the X window system's includes and libraries, and sets the dnl variables x_includes and x_libraries to their locations. Also adds the @@ -43,6 +44,7 @@ dnl Checking for math library AC_CHECK_LIB(m, sin, LIBS="${LIBS} -lm",dnl echo "Can't find math library" ; exit 1, "${X_LIBS}") +AC_SUBST(WARNINGCFLAGS) AC_SUBST(CFLAGS) AC_SUBST(LIBS) AC_SUBST(ac_aux_dir) diff --git a/src/Makefile.am b/src/Makefile.am index bde3b7b..a7203f3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,25 +1,20 @@ # This file is processed by GNU automake to generate Makefile.in -bin_PROGRAMS = hvclock - -hvclock_SOURCES = hvclock.c hvclock.h clock.c clock.h \ - options.c options.h dockapp.c dockapp.h \ - common.h - -hvclock_CPPFLAGS = \ - -I$(top_srcdir) \ +AM_CPPFLAGS = \ + $(WARNINGCFLAGS) \ -I$(top_srcdir)/pixmaps \ - $(GTK_CFLAGS) \ - $(AM_CPPFLAGS) + $(GTK_CFLAGS) -hvclock_LDADD = $(GTK_LIBS) +bin_PROGRAMS = hvclock -# These headers will be included in the distribution tarball, but will not be -# installed by 'make install' -noinst_HEADERS = +hvclock_SOURCES = \ + hvclock.c hvclock.h \ + clock.c clock.h \ + options.c options.h \ + dockapp.c dockapp.h \ + common.h -# we want these in the dist tarball -EXTRA_DIST = +LDADD = $(GTK_LIBS) CLEANFILES = *~ diff --git a/src/clock.c b/src/clock.c index f20748c..1701fff 100644 --- a/src/clock.c +++ b/src/clock.c @@ -418,17 +418,17 @@ static gboolean hvclock_button_release(GtkWidget *clock, GdkEventButton *event) { if (hvclock_infos.debug) - printf("%s: button released\n", PACKAGE); + printf("%s: button released\n", PACKAGE_NAME); /* single-click --> changing viewing mode */ if (hvclock_mode == CLOCK_MODE) { hvclock_mode = CALENDAR_MODE; if (hvclock_infos.debug) - printf("%s: switching to calendar mode\n", PACKAGE); + printf("%s: switching to calendar mode\n", PACKAGE_NAME); } else { hvclock_mode = CLOCK_MODE; if (hvclock_infos.debug) - printf("%s: switching to clock mode\n", PACKAGE); + printf("%s: switching to clock mode\n", PACKAGE_NAME); } /* Update clock/calendar... */ diff --git a/src/options.c b/src/options.c index a55326d..a3ac0ee 100644 --- a/src/options.c +++ b/src/options.c @@ -29,7 +29,7 @@ ******************************************************************************/ static void DisplayUsage(void) { - printf("Usage: %s [OPTIONS]...\n", PACKAGE); + printf("Usage: %s [OPTIONS]...\n", PACKAGE_NAME); printf("Dockable analog clock and calendar.\n\n"); printf (" -d display debugging messages.\n"); @@ -46,18 +46,18 @@ static void DisplayUsage(void) static void DisplayVersion(void) { printf("\n"); - printf(" %s, version %s\n", PACKAGE, VERSION); + printf(" %s, version %s\n", PACKAGE_NAME, PACKAGE_VERSION); printf(" Written by Hugo Villeneuve\n\n"); } static void InvalidOption(char *message, /*@null@ */ char *string) { if (string == NULL) - fprintf(stderr, "%s: %s\n", PACKAGE, message); + fprintf(stderr, "%s: %s\n", PACKAGE_NAME, message); else - fprintf(stderr, "%s: %s %s\n", PACKAGE, message, string); + fprintf(stderr, "%s: %s %s\n", PACKAGE_NAME, message, string); - fprintf(stderr, "Try `%s -h' for more information.\n", PACKAGE); + fprintf(stderr, "Try `%s -h' for more information.\n", PACKAGE_NAME); exit(EXIT_FAILURE); }