Permalink
Browse files

Cleaned up autotooling: added more checks as hinted at by autoscan.

  • Loading branch information...
1 parent 39cfdf1 commit 88a3d1839c0ed847c437f60b152c5dc6f73d7ce4 @mschuerig committed Jan 22, 2009
Showing with 51 additions and 16 deletions.
  1. +2 −0 TODO
  2. +37 −12 configure.ac
  3. +2 −0 doc/tutorial.texi
  4. +10 −4 src/hangon.c
View
@@ -1,6 +1,8 @@
* Don't restart command if exited with a specific set of status codes
* Listen to multiple streams (stderr)?
+* Don't set CLAGS and LDFLAGS in configure.ac
+* USE the flags set in config.h!
Packaging
View
@@ -1,11 +1,12 @@
+AC_PREREQ(2.61)
AC_INIT([hangon],[0.1],[michael@schuerig.de])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall -Werror])
-AC_PROG_CC
+AC_CONFIG_SRCDIR([src/hangon.c])
+AC_CONFIG_HEADERS([config.h])
-gl_EARLY
-gl_INIT
+# Options
# -Wextra enables additional checks not included in -Wall
# AM_INIT_AUTOMAKE doesn't accept -Wextra so it is added
@@ -28,20 +29,42 @@ else
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
-# Use a libintl installed on the system.
+# Checks for programs.
+AC_PROG_CC
+
+## gnulib needs to be initialized before any further checks.
+gl_EARLY
+gl_INIT
+
+## Checks for libraries.
+## would go here
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([locale.h stdlib.h string.h sys/time.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+AC_TYPE_PID_T
+AC_TYPE_SSIZE_T
+
+# Checks for library functions.
+AC_FUNC_FORK
+AC_CHECK_FUNCS([atexit dup2 setlocale])
+
+# Checks for gettext.
+## Use a libintl installed on the system.
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_SRCDIR([src/hangon.c])
-AC_CONFIG_FILES([Makefile gnulib/lib/Makefile src/Makefile doc/Makefile po/Makefile.in])
-
+# Testing
AC_CONFIG_TESTDIR([tests], [tests:src])
-AC_CONFIG_FILES([tests/Makefile])
-# Define additional programs needed for hacking on this project,
-# but not required for simply building it.
-# autom4te: used for merging tests into a suite
+## Define additional programs needed for hacking on this project,
+## but not required for simply building it.
+## autom4te: used for merging tests into a suite
AM_MISSING_PROG([AUTOM4TE], [autom4te])
if test "x$cross_compiling" = "xno"; then
@@ -51,4 +74,6 @@ else
HELP2MAN=:
fi
+## Generate Output
+AC_CONFIG_FILES([Makefile gnulib/lib/Makefile src/Makefile doc/Makefile po/Makefile.in tests/Makefile])
AC_OUTPUT
View
@@ -36,6 +36,8 @@ Copyright © 2008 Michael Schürig
@node Nobody expects the autoconf-iscation
@section Nobody Expects the @t{autoconf}-iscation
+autoscan
+
@node Languages aplenty
@section Languages Aplenty
View
@@ -1,4 +1,10 @@
+/* config.h needs to included first for gnulib to work its magic */
+#include <config.h>
+
+/*
+ * standard includes
+ */
#include <errno.h>
#include <getopt.h>
#include <locale.h>
@@ -12,10 +18,10 @@
#include <sys/time.h>
#include <sys/wait.h>
-#include "config.h"
-
-#include "closeout.h"
-#include "gettext.h"
+/*
+ * gnulib utilities
+ */
+#include <closeout.h>
#define PROGRAM_NAME "hangon"

0 comments on commit 88a3d18

Please sign in to comment.