Fix autoconf errors
--- a/Makefile.in
+++ b/Makefile.in
@@ -49,7 +49,7 @@
 	rm -rf *.o daemonize testdaemon *.ps
 
 distclean:	clean
-	rm -rf config.status config.log config.cache config.h Makefile autom?te.cache
+	rm -rf config.status config.log config.cache auto_config.h Makefile autom?te.cache
 
 # Copy stuff to the gh-pages directory. I doubt you want to use this target,
 # unless you're maintaining the web site (i.e., unless you're me).
--- /dev/null
+++ b/config.h
@@ -0,0 +1,103 @@
+/*---------------------------------------------------------------------------*\
+  Site-specific configuration file for run-as utility
+
+  Input to `autoheader'
+
+  This source code is released under a BSD-style license. See the LICENSE
+  file for details.
+\*---------------------------------------------------------------------------*/
+
+#ifndef _CONFIG_H_
+#define _CONFIG_H_
+
+#include <auto_config.h>
+#include <sys/types.h>
+
+#ifndef HAVE_BYTE_TYPE
+typedef unsigned char	byte;		     /* 8 bit unsigned critter */
+#endif /* HAVE_BYTE_TYPE */
+
+#ifndef HAVE_SIG_T
+typedef void __sighandler_t (int);
+typedef __sighandler_t  *sig_t;
+#endif /* HAVE_SIG_T */
+
+#ifndef HAVE_FALSE
+#define FALSE (0)
+#endif /* FALSE */
+
+#ifndef HAVE_TRUE
+#define TRUE (1)
+#endif /* TRUE */
+
+#ifndef HAVE_SETSID
+#define setsid() ((pid_t) -1)
+#endif /* HAVE_SETSID */
+
+#ifndef HAVE_SYSCONF
+#define sysconf(name) ((long) -1)
+#endif /* HAVE_SYSCONF */
+
+#ifndef HAVE_STRERROR
+extern char *strerror (int errnum);
+#endif /* HAVE_STRERROR */
+
+extern int x_getopt (int argc, char **argv, const char *opts);
+extern int x_opterr;
+extern int x_optind;
+extern int x_optopt;
+extern char *x_optarg;
+
+#ifndef HAVE_DAEMON
+extern int daemon (int nochdir, int noclose);
+#endif
+
+#ifdef HAVE_VFORK
+#ifdef HAVE_VFORK_H
+#include <vfork.h>
+#endif
+#else /* HAVE_VFORK */
+#undef vfork
+#define vfork fork
+#endif /* HAVE_VFORK */
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#else
+extern int errno;
+#endif
+
+#ifndef STDC_HEADERS
+#error "Must have standard C headers. Sorry."
+#endif
+
+/*
+  Password field: If only one of `pw_comment' and `pw_gecos' is present,
+  define the missing one in terms of the existing one. If neither is
+  present, define both in terms of `pw_name'.
+*/
+#if !defined(HAVE_PW_COMMENT) && !defined(HAVE_PW_GECOS)
+#define pw_comment pw_name
+#define pw_gecos   pw_name
+#else
+#if defined(HAVE_PW_COMMENT) && !defined(HAVE_PW_GECOS)
+#define pw_gecos pw_comment
+#else
+#if defined(HAVE_PW_GECOS) && !defined(HAVE_PW_COMMENT)
+#define pw_comment pw_gecos
+#endif
+#endif
+#endif
+
+#include <sys/types.h>
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+#endif /* _CONFIG_H_ */
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,287 @@
+dnl Copyright (c) 2003-2009 Brian M. Clapper.
+dnl All rights reserved.
+dnl 
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are permitted provided that the following conditions are met:
+dnl 
+dnl     * Redistributions of source code must retain the above copyright
+dnl       notice, this list of conditions and the following disclaimer.
+dnl 
+dnl     * Redistributions in binary form must reproduce the above copyright
+dnl       notice, this list of conditions and the following disclaimer in the
+dnl       documentation and/or other materials provided with the distribution.
+dnl 
+dnl     * Neither the name of the clapper.org nor the names of its
+dnl       contributors may be used to endorse or promote products derived from
+dnl       this software without specific prior written permission.
+dnl 
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+dnl AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+dnl ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+dnl POSSIBILITY OF SUCH DAMAGE.
+dnl ---------------------------------------------------------------------------
+
+
+dnl ---------------------------------------------------------------------------
+dnl Autoconf file for daemonize
+dnl
+dnl Process this file with autoconf to produce a configure script.
+dnl ---------------------------------------------------------------------------
+
+AC_INIT(daemonize.c)
+AC_CONFIG_HEADER(auto_config.h)
+
+dnl ---------------------------------------------------------------------------
+dnl Autoconf template
+dnl ---------------------------------------------------------------------------
+
+AH_TEMPLATE([HAVE_BASENAME])
+AH_TEMPLATE([HAVE_FLOCK])
+AH_TEMPLATE([HAVE_GETPGRP])
+AH_TEMPLATE([HAVE_INITGROUPS])
+AH_TEMPLATE([HAVE_PW_COMMENT])
+AH_TEMPLATE([HAVE_PW_GECOS])
+AH_TEMPLATE([HAVE_SETENV])
+AH_TEMPLATE([HAVE_SETPGRP])
+AH_TEMPLATE([bool])
+AH_TEMPLATE([HAVE_DAEMON])
+AH_TEMPLATE([HAVE_FALSE])
+AH_TEMPLATE([HAVE_SETSID])
+AH_TEMPLATE([HAVE_SIG_T])
+AH_TEMPLATE([HAVE_STRERROR])
+AH_TEMPLATE([HAVE_TRUE])
+
+dnl ---------------------------------------------------------------------------
+dnl Directories and package-specific vars
+dnl ---------------------------------------------------------------------------
+
+LOCAL_TOP_LEVEL=`pwd`
+
+dnl ---------------------------------------------------------------------------
+dnl Compiler- and language-specific programs.  Must precede the UNIX tests.
+dnl ---------------------------------------------------------------------------
+
+AC_PROG_CC
+AC_PROG_CPP
+
+AC_SUBST(CC)
+AC_SUBST(CPP)
+
+dnl ---------------------------------------------------------------------------
+dnl UNIX variant hacks
+dnl ---------------------------------------------------------------------------
+
+AC_AIX
+
+dnl ---------------------------------------------------------------------------
+dnl Checks for programs via standard macros.
+dnl ---------------------------------------------------------------------------
+
+AC_PROG_INSTALL
+
+dnl ---------------------------------------------------------------------------
+dnl Checks for header files.
+dnl ---------------------------------------------------------------------------
+
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(errno.h)
+AC_CHECK_HEADERS(libgen.h)
+
+export CPPFLAGS
+
+dnl ---------------------------------------------------------------------------
+dnl Checks for libraries.
+dnl ---------------------------------------------------------------------------
+
+dnl ---------------------------------------------------------------------------
+dnl Checks for typedefs, structures, and compiler characteristics.
+dnl ---------------------------------------------------------------------------
+
+AC_C_CONST
+
+AC_TYPE_UID_T
+AC_TYPE_MODE_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+
+AC_CHECK_TYPE(ssize_t, int)
+
+dnl ***
+dnl FreeBSD and some others define "sig_t" as the return type for a signal
+dnl handler.  Use it if it's there; #define it otherwise.
+
+AC_CACHE_CHECK([for 'sig_t' typedef], local_cv_have_sig_t,
+	       AC_EGREP_HEADER(sig_t, signal.h, 
+			       local_cv_have_sig_t=yes,
+			       local_cv_have_sig_t=no))
+if test "$local_cv_have_sig_t" = "yes" ; then
+    AC_DEFINE(HAVE_SIG_T)
+fi
+
+dnl ***
+dnl Password file stuff
+
+AC_CACHE_CHECK([for 'struct passwd'], local_cv_have_struct_pw, 
+	       AC_TRY_COMPILE([#include <pwd.h>], 
+			      [struct passwd *pw;],
+	                      local_cv_have_struct_pw=yes,
+			      local_cv_have_struct_pw=no))
+if test "$local_cv_have_struct_pw" = "no" ; then
+    AC_MSG_ERROR([Sorry, but I need 'struct passwd'.])
+else
+dnl pw_comment or pw_gecos? Neither is required by X/Open or POSIX.
+
+    AC_CACHE_CHECK([for 'pw_comment' field], wclib_cv_have_pw_comment,
+		   AC_TRY_COMPILE([#include <pwd.h>],
+				  [struct passwd *pw;
+				   char *s = (char *) pw->pw_comment;],
+				  wclib_cv_have_pw_comment=yes,
+				  wclib_cv_have_pw_comment=no))
+
+    AC_CACHE_CHECK([for 'pw_gecos' field], wclib_cv_have_pw_gecos,
+		   AC_TRY_COMPILE([#include <pwd.h>],
+				  [struct passwd *pw;
+				   char *s = (char *) pw->pw_gecos;],
+				  wclib_cv_have_pw_gecos=yes,
+				  wclib_cv_have_pw_gecos=no))
+
+    if test "$wclib_cv_have_pw_comment" = "yes" ; then
+	AC_DEFINE(HAVE_PW_COMMENT)
+    fi
+    if test "$wclib_cv_have_pw_gecos" = "yes" ; then
+	AC_DEFINE(HAVE_PW_GECOS)
+    fi
+fi
+
+
+dnl ***
+dnl Predefined `bool' type and various related constants
+
+AC_CACHE_CHECK([for predefined 'bool' type], local_cv_have_bool,
+	       AC_TRY_COMPILE([
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>],
+			      [bool flag;],
+                              local_cv_have_bool=yes,
+                              local_cv_have_bool=no))
+if test "$local_cv_have_bool" = "no" ; then
+    AC_DEFINE(bool, short)
+fi
+
+dnl ***
+dnl TRUE?
+
+AC_CACHE_CHECK([for TRUE constant in standard headers], local_cv_have_true,
+	       AC_TRY_COMPILE([
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>],
+			      [if (TRUE) ;],
+			      local_cv_have_true=yes,
+			      local_cv_have_true=no))
+if test "$local_cv_have_true" = "yes" ; then
+    AC_DEFINE(HAVE_TRUE)
+fi
+
+dnl ***
+dnl FALSE?
+
+AC_CACHE_CHECK([for FALSE constant in standard headers], local_cv_have_false,
+	       AC_TRY_COMPILE([
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>],
+			      [if (FALSE) ;],
+			      local_cv_have_false=yes,
+			      local_cv_have_false=no))
+if test "$local_cv_have_false" = "yes" ; then
+    AC_DEFINE(HAVE_FALSE)
+fi
+
+dnl ---------------------------------------------------------------------------
+dnl Checks for library functions.
+dnl ---------------------------------------------------------------------------
+
+AC_CHECK_FUNC(initgroups, AC_DEFINE(HAVE_INITGROUPS))
+AC_CHECK_FUNC(getpgrp, AC_DEFINE(HAVE_GETPGRP))
+AC_CHECK_FUNC(setpgrp, AC_DEFINE(HAVE_SETPGRP))
+
+dnl setsid(2) appears to be defined for all reasonable (and some unreasonable)
+dnl Unices.  Hell, even the Single Unix Specification (formerly X/Open, see
+dnl `http://www.rdg.opengroup.org/onlinepubs/7908799/toc.htm') has it.
+dnl If it isn't there, we define a macro that fails.
+
+AC_CHECK_FUNC(setsid, AC_DEFINE(HAVE_SETSID))
+
+dnl AC_FUNC_GETPGRP defines GETPGRP_VOID if getpgrp() takes no parameters.
+AC_FUNC_GETPGRP
+
+AC_FUNC_SETPGRP
+AC_FUNC_VPRINTF
+AC_CHECK_FUNC(vfork, AC_DEFINE(HAVE_VFORK))
+AC_FUNC_VFORK
+
+dnl ***
+dnl Generate a list of missing functions that we desperately require.
+dnl Any missing functions, below, will be replaced with emulators if 
+dnl necessary; the value of RUNAS_MISSING_SOURCES will be substituted into
+dnl the "portability" Makefile.
+
+AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR),
+	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} strerror.c")
+
+dnl Some Unices don't have a daemon(3) function. If it's missing, we
+dnl supply our own emulation version.
+
+AC_CHECK_FUNC(daemon, AC_DEFINE(HAVE_DAEMON),
+	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} daemon.c")
+
+AC_CHECK_FUNC(basename, AC_DEFINE(HAVE_BASENAME),
+	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} basename.c")
+
+AC_CHECK_FUNC(setenv, AC_DEFINE(HAVE_SETENV),
+	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} setenv.c")
+
+AC_CHECK_FUNC(flock, AC_DEFINE(HAVE_FLOCK),
+	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} flock.c")
+
+AC_SUBST(LOCAL_MISSING_SOURCES)
+
+dnl ---------------------------------------------------------------------------
+dnl System services
+dnl ---------------------------------------------------------------------------
+
+AC_SYS_LONG_FILE_NAMES
+
+dnl ---------------------------------------------------------------------------
+dnl Final configuration constants that depend on the previous stuff.
+dnl ---------------------------------------------------------------------------
+
+dnl ---------------------------------------------------------------------------
+dnl Output and variable substitutions
+dnl ---------------------------------------------------------------------------
+
+dnl ***
+dnl Individual Makefiles
+
+AC_OUTPUT(Makefile)
+
+dnl ---------------------------------------------------------------------------
+dnl Copyrights and such
+dnl ---------------------------------------------------------------------------
+
+echo ""
+echo "***"
+echo "*** daemonize is released under a BSD-style license."
+echo "*** See the LICENSE file distributed with the source code for details."
+echo "***"
+echo ""
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,7 @@
 *.o
 daemonize
 daemonize.html
-config.h
+auto_config.h
 config.log
 config.status
 config.cache
--- a/acconfig.h
+++ /dev/null
@@ -1,183 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  Site-specific configuration file for run-as utility
-
-  Input to `autoheader'
-
-  This source code is released under a BSD-style license. See the LICENSE
-  file for details.
-\*---------------------------------------------------------------------------*/
-
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-
-#include <sys/types.h>
-
-@@TOP@@
-
-/* define if your C compiler lacks a built-in `bool' type */
-#undef bool
-
-/* define to `int' if your system lacks `ssize_t' */
-#undef ssize_t
-
-/* define to `unsigned short' if your system lacks `ushort' */
-#undef ushort
-
-/*
-   Define if you have the `sig_t' type in <signal.h> or <sys/signal.h>
-   (e.g., FreeBSD)
-*/
-#undef HAVE_SIG_T
-
-/*
-  Define if your compiler supports a native "byte" type that holds at least
-  eight bits.
-*/
-#undef HAVE_BYTE_TYPE
-
-/* Define if you have the getpgrp() function. */
-#undef HAVE_GETPGRP
-
-/* Define if you have the setpgrp() function. */
-#undef HAVE_SETPGRP
-
-/* Define if you have the initgroups() function. */
-#undef HAVE_INITGROUPS
-
-/* Define if you have the setsid() function. Almost everyone does. */
-#undef HAVE_SETSID
-
-/* Define if you have the sysconf() function. */
-#undef HAVE_SYSCONF
-
-/* Define if you have the daemon() function. */
-#undef HAVE_DAEMON
-
-/* Define if you have the strerror() function. */
-#undef HAVE_STRERROR
-
-/* Define if you have vfork() */
-#undef HAVE_VFORK
-
-/* Define if you have vprintf() */
-#undef HAVE_VPRINTF
-
-/* Define if you have the `pw_comment' field in `struct passwd' (pwd.h) */
-#undef HAVE_PW_COMMENT
-
-/* Define if you have the `pw_gecos' field in `struct passwd' (pwd.h) */
-#undef HAVE_PW_GECOS
-
-/* Define to `long' if you don't have `off_t' */
-#undef off_t
-
-/* Define to `int' if you don't have `mode_t' */
-#undef mode_t
-
-/* Define to `int' if you don't have `pid_t' */
-#undef pid_t
-
-/* Define to `int' if you don't have `gid_t' and `uid_t' */
-#undef uid_t
-#undef gid_t
-
-/* Define to `unsigned' if you don't have `size_t' */
-#undef size_t
-
-/* Define if you have <errno.h> */
-#undef HAVE_ERRNO_H
-
-@@BOTTOM@@
-
-/*****************************************************************************\
-                     DON'T TOUCH ANYTHING BELOW HERE!
-\*****************************************************************************/
-
-#ifndef HAVE_BYTE_TYPE
-typedef unsigned char	byte;		     /* 8 bit unsigned critter */
-#endif /* HAVE_BYTE_TYPE */
-
-#ifndef HAVE_SIG_T
-typedef void __sighandler_t (int);
-typedef __sighandler_t  *sig_t;
-#endif /* HAVE_SIG_T */
-
-#ifndef HAVE_FALSE
-#define FALSE (0)
-#endif /* FALSE */
-
-#ifndef HAVE_TRUE
-#define TRUE (1)
-#endif /* TRUE */
-
-#ifndef HAVE_SETSID
-#define setsid() ((pid_t) -1)
-#endif /* HAVE_SETSID */
-
-#ifndef HAVE_SYSCONF
-#define sysconf(name) ((long) -1)
-#endif /* HAVE_SYSCONF */
-
-#ifndef HAVE_STRERROR
-extern char *strerror (int errnum);
-#endif /* HAVE_STRERROR */
-
-extern int x_getopt (int argc, char **argv, const char *opts);
-extern int x_opterr;
-extern int x_optind;
-extern int x_optopt;
-extern char *x_optarg;
-
-#ifndef HAVE_DAEMON
-extern int daemon (int nochdir, int noclose);
-#endif
-
-#ifdef HAVE_VFORK
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
-#endif
-#else /* HAVE_VFORK */
-#undef vfork
-#define vfork fork
-#endif /* HAVE_VFORK */
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#else
-extern int errno;
-#endif
-
-#ifndef STDC_HEADERS
-#error "Must have standard C headers. Sorry."
-#endif
-
-/*
-  Password field: If only one of `pw_comment' and `pw_gecos' is present,
-  define the missing one in terms of the existing one. If neither is
-  present, define both in terms of `pw_name'.
-*/
-#if !defined(HAVE_PW_COMMENT) && !defined(HAVE_PW_GECOS)
-#define pw_comment pw_name
-#define pw_gecos   pw_name
-#else
-#if defined(HAVE_PW_COMMENT) && !defined(HAVE_PW_GECOS)
-#define pw_gecos pw_comment
-#else
-#if defined(HAVE_PW_GECOS) && !defined(HAVE_PW_COMMENT)
-#define pw_comment pw_gecos
-#endif
-#endif
-#endif
-
-#include <sys/types.h>
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-
-#endif /* _CONFIG_H_ */
--- a/config.h.in
+++ /dev/null
@@ -1,254 +0,0 @@
-/* config.h.in.  Generated automatically from configure.in by autoheader.  */
-
-/*---------------------------------------------------------------------------*\
-  Site-specific configuration file for run-as utility
-
-  Input to `autoheader': $Id$
-\*---------------------------------------------------------------------------*/
-
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-
-#include <sys/types.h>
-
-
-/* Define if on AIX 3.
-   System headers sometimes define this.
-   We just want to avoid a redefinition error message.  */
-#ifndef _ALL_SOURCE
-#undef _ALL_SOURCE
-#endif
-
-/* Define to empty if the keyword does not work.  */
-#undef const
-
-/* Define if the `getpgrp' function takes no argument.  */
-#undef GETPGRP_VOID
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef gid_t
-
-/* Define if you don't have vprintf but do have _doprnt.  */
-#undef HAVE_DOPRNT
-
-/* Define if you support file names longer than 14 characters.  */
-#undef HAVE_LONG_FILE_NAMES
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
-#undef HAVE_SYS_WAIT_H
-
-/* Define if you have <vfork.h>.  */
-#undef HAVE_VFORK_H
-
-/* Define if you have the vprintf function.  */
-#undef HAVE_VPRINTF
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef mode_t
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef pid_t
-
-/* Define if the `setpgrp' function takes no argument.  */
-#undef SETPGRP_VOID
-
-/* Define to `unsigned' if <sys/types.h> doesn't define.  */
-#undef size_t
-
-/* Define if you have the ANSI C header files.  */
-#undef STDC_HEADERS
-
-/* Define to `int' if <sys/types.h> doesn't define.  */
-#undef uid_t
-
-/* Define vfork as fork if vfork does not work.  */
-#undef vfork
-
-/* define if your C compiler lacks a built-in `bool' type */
-#undef bool
-
-/* define to `int' if your system lacks `ssize_t' */
-#undef ssize_t
-
-/*
-   Define if you have the `sig_t' type in <signal.h> or <sys/signal.h>
-   (e.g., FreeBSD)
-*/
-#undef HAVE_SIG_T
-
-/*
-  Define if your compiler supports a native "byte" type that holds at least
-  eight bits.
-*/
-#undef HAVE_BYTE_TYPE
-
-/* Define if you have the getpgrp() function. */
-#undef HAVE_GETPGRP
-
-/* Define if you have the setpgrp() function. */
-#undef HAVE_SETPGRP
-
-/* Define if you have the setsid() function. Almost everyone does. */
-#undef HAVE_SETSID
-
-/* Define if you have the daemon() function. */
-#undef HAVE_DAEMON
-
-/* Define if you have the basename() function. */
-#undef HAVE_BASENAME
-
-/* Define if you have <libgen.h> */
-#undef HAVE_LIBGEN_H
-
-/* Define if you have the strerror() function. */
-#undef HAVE_STRERROR
-
-/* Define if you have initgroups() */
-#undef HAVE_INITGROUPS
-
-/* Define if you have vfork() */
-#undef HAVE_VFORK
-
-/* Define if you have vprintf() */
-#undef HAVE_VPRINTF
-
-/* Define if you have the `pw_comment' field in `struct passwd' (pwd.h) */
-#undef HAVE_PW_COMMENT
-
-/* Define if you have the `pw_gecos' field in `struct passwd' (pwd.h) */
-#undef HAVE_PW_GECOS
-
-/* Define to `int' if you don't have `mode_t' */
-#undef mode_t
-
-/* Define to `int' if you don't have `pid_t' */
-#undef pid_t
-
-/* Define to `int' if you don't have `gid_t' and `uid_t' */
-#undef uid_t
-#undef gid_t
-
-/* Define to `unsigned' if you don't have `size_t' */
-#undef size_t
-
-/* Define if you have the <errno.h> header file.  */
-#undef HAVE_ERRNO_H
-
-/* Define if you have the setenv(3) function. */
-#undef HAVE_SETENV
-
-/* Define if you have the flock(3) function. */
-#undef HAVE_FLOCK
-
-/*****************************************************************************\
-                     DON'T TOUCH ANYTHING BELOW HERE!
-\*****************************************************************************/
-
-#ifndef HAVE_BYTE_TYPE
-typedef unsigned char	byte;		     /* 8 bit unsigned critter */
-#endif /* HAVE_BYTE_TYPE */
-
-#ifndef HAVE_SIG_T
-typedef void __sighandler_t (int);
-typedef __sighandler_t  *sig_t;
-#endif /* HAVE_SIG_T */
-
-#ifndef HAVE_FALSE
-#define FALSE (0)
-#endif /* FALSE */
-
-#ifndef HAVE_TRUE
-#define TRUE (1)
-#endif /* TRUE */
-
-#ifndef HAVE_SETSID
-#define setsid() ((pid_t) -1)
-#endif /* HAVE_SETSID */
-
-#ifndef HAVE_SYSCONF
-#define sysconf(name) ((long) -1)
-#endif /* HAVE_SYSCONF */
-
-#ifndef HAVE_INITGROUPS
-#define initgroups(name, gid) (0)
-#endif
-
-#ifndef HAVE_STRERROR
-extern char *strerror (int errnum);
-#endif /* HAVE_STRERROR */
-
-extern int x_getopt (int argc, char **argv, const char *opts);
-extern int x_opterr;
-extern int x_optind;
-extern int x_optopt;
-extern char *x_optarg;
-
-#ifndef HAVE_DAEMON
-extern int daemon (int nochdir, int noclose);
-#endif
-
-#ifdef HAVE_VFORK
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
-#endif
-#else /* HAVE_VFORK */
-#undef vfork
-#define vfork fork
-#endif /* HAVE_VFORK */
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#else
-extern int errno;
-#endif
-
-#ifndef HAVE_SETENV
-extern int setenv(const char *name, const char *value, int overwrite);
-#endif
-
-#ifndef STDC_HEADERS
-#error "Must have standard C headers. Sorry."
-#endif
-
-/*
-  Password field: If only one of `pw_comment' and `pw_gecos' is present,
-  define the missing one in terms of the existing one. If neither is
-  present, define both in terms of `pw_name'.
-*/
-#if !defined(HAVE_PW_COMMENT) && !defined(HAVE_PW_GECOS)
-#define pw_comment pw_name
-#define pw_gecos   pw_name
-#else
-#if defined(HAVE_PW_COMMENT) && !defined(HAVE_PW_GECOS)
-#define pw_gecos pw_comment
-#else
-#if defined(HAVE_PW_GECOS) && !defined(HAVE_PW_COMMENT)
-#define pw_comment pw_gecos
-#endif
-#endif
-#endif
-
-#include <sys/types.h>
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-
-#ifndef HAVE_BASENAME
-extern char *basename (char *path);
-#endif
-
-#ifdef HAVE_LIBGEN_H
-#include <libgen.h>
-#endif
-
-#ifndef HAVE_FLOCK
-#include "flock.h"
-#endif
-
-#endif /* _CONFIG_H_ */
--- a/configure.in
+++ /dev/null
@@ -1,267 +0,0 @@
-dnl Copyright (c) 2003-2009 Brian M. Clapper.
-dnl All rights reserved.
-dnl 
-dnl Redistribution and use in source and binary forms, with or without
-dnl modification, are permitted provided that the following conditions are met:
-dnl 
-dnl     * Redistributions of source code must retain the above copyright
-dnl       notice, this list of conditions and the following disclaimer.
-dnl 
-dnl     * Redistributions in binary form must reproduce the above copyright
-dnl       notice, this list of conditions and the following disclaimer in the
-dnl       documentation and/or other materials provided with the distribution.
-dnl 
-dnl     * Neither the name of the clapper.org nor the names of its
-dnl       contributors may be used to endorse or promote products derived from
-dnl       this software without specific prior written permission.
-dnl 
-dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-dnl AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-dnl ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-dnl LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-dnl CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-dnl SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-dnl POSSIBILITY OF SUCH DAMAGE.
-dnl ---------------------------------------------------------------------------
-
-
-dnl ---------------------------------------------------------------------------
-dnl Autoconf file for daemonize
-dnl
-dnl Process this file with autoconf to produce a configure script.
-dnl ---------------------------------------------------------------------------
-
-AC_INIT(daemonize.c)
-AC_CONFIG_HEADER(config.h)
-
-dnl ---------------------------------------------------------------------------
-dnl Directories and package-specific vars
-dnl ---------------------------------------------------------------------------
-
-LOCAL_TOP_LEVEL=`pwd`
-
-dnl ---------------------------------------------------------------------------
-dnl Compiler- and language-specific programs.  Must precede the UNIX tests.
-dnl ---------------------------------------------------------------------------
-
-AC_PROG_CC
-AC_PROG_CPP
-
-AC_SUBST(CC)
-AC_SUBST(CPP)
-
-dnl ---------------------------------------------------------------------------
-dnl UNIX variant hacks
-dnl ---------------------------------------------------------------------------
-
-AC_AIX
-
-dnl ---------------------------------------------------------------------------
-dnl Checks for programs via standard macros.
-dnl ---------------------------------------------------------------------------
-
-AC_PROG_INSTALL
-
-dnl ---------------------------------------------------------------------------
-dnl Checks for header files.
-dnl ---------------------------------------------------------------------------
-
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(errno.h)
-AC_CHECK_HEADERS(libgen.h)
-
-export CPPFLAGS
-
-dnl ---------------------------------------------------------------------------
-dnl Checks for libraries.
-dnl ---------------------------------------------------------------------------
-
-dnl ---------------------------------------------------------------------------
-dnl Checks for typedefs, structures, and compiler characteristics.
-dnl ---------------------------------------------------------------------------
-
-AC_C_CONST
-
-AC_TYPE_UID_T
-AC_TYPE_MODE_T
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-
-AC_CHECK_TYPE(ssize_t, int)
-
-dnl ***
-dnl FreeBSD and some others define "sig_t" as the return type for a signal
-dnl handler.  Use it if it's there; #define it otherwise.
-
-AC_CACHE_CHECK([for 'sig_t' typedef], local_cv_have_sig_t,
-	       AC_EGREP_HEADER(sig_t, signal.h, 
-			       local_cv_have_sig_t=yes,
-			       local_cv_have_sig_t=no))
-if test "$local_cv_have_sig_t" = "yes" ; then
-    AC_DEFINE(HAVE_SIG_T)
-fi
-
-dnl ***
-dnl Password file stuff
-
-AC_CACHE_CHECK([for 'struct passwd'], local_cv_have_struct_pw, 
-	       AC_TRY_COMPILE([#include <pwd.h>], 
-			      [struct passwd *pw;],
-	                      local_cv_have_struct_pw=yes,
-			      local_cv_have_struct_pw=no))
-if test "$local_cv_have_struct_pw" = "no" ; then
-    AC_MSG_ERROR([Sorry, but I need 'struct passwd'.])
-else
-dnl pw_comment or pw_gecos? Neither is required by X/Open or POSIX.
-
-    AC_CACHE_CHECK([for 'pw_comment' field], wclib_cv_have_pw_comment,
-		   AC_TRY_COMPILE([#include <pwd.h>],
-				  [struct passwd *pw;
-				   char *s = (char *) pw->pw_comment;],
-				  wclib_cv_have_pw_comment=yes,
-				  wclib_cv_have_pw_comment=no))
-
-    AC_CACHE_CHECK([for 'pw_gecos' field], wclib_cv_have_pw_gecos,
-		   AC_TRY_COMPILE([#include <pwd.h>],
-				  [struct passwd *pw;
-				   char *s = (char *) pw->pw_gecos;],
-				  wclib_cv_have_pw_gecos=yes,
-				  wclib_cv_have_pw_gecos=no))
-
-    if test "$wclib_cv_have_pw_comment" = "yes" ; then
-	AC_DEFINE(HAVE_PW_COMMENT)
-    fi
-    if test "$wclib_cv_have_pw_gecos" = "yes" ; then
-	AC_DEFINE(HAVE_PW_GECOS)
-    fi
-fi
-
-
-dnl ***
-dnl Predefined `bool' type and various related constants
-
-AC_CACHE_CHECK([for predefined 'bool' type], local_cv_have_bool,
-	       AC_TRY_COMPILE([
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>],
-			      [bool flag;],
-                              local_cv_have_bool=yes,
-                              local_cv_have_bool=no))
-if test "$local_cv_have_bool" = "no" ; then
-    AC_DEFINE(bool, short)
-fi
-
-dnl ***
-dnl TRUE?
-
-AC_CACHE_CHECK([for TRUE constant in standard headers], local_cv_have_true,
-	       AC_TRY_COMPILE([
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>],
-			      [if (TRUE) ;],
-			      local_cv_have_true=yes,
-			      local_cv_have_true=no))
-if test "$local_cv_have_true" = "yes" ; then
-    AC_DEFINE(HAVE_TRUE)
-fi
-
-dnl ***
-dnl FALSE?
-
-AC_CACHE_CHECK([for FALSE constant in standard headers], local_cv_have_false,
-	       AC_TRY_COMPILE([
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>],
-			      [if (FALSE) ;],
-			      local_cv_have_false=yes,
-			      local_cv_have_false=no))
-if test "$local_cv_have_false" = "yes" ; then
-    AC_DEFINE(HAVE_FALSE)
-fi
-
-dnl ---------------------------------------------------------------------------
-dnl Checks for library functions.
-dnl ---------------------------------------------------------------------------
-
-AC_CHECK_FUNC(initgroups, AC_DEFINE(HAVE_INITGROUPS))
-AC_CHECK_FUNC(getpgrp, AC_DEFINE(HAVE_GETPGRP))
-AC_CHECK_FUNC(setpgrp, AC_DEFINE(HAVE_SETPGRP))
-
-dnl setsid(2) appears to be defined for all reasonable (and some unreasonable)
-dnl Unices.  Hell, even the Single Unix Specification (formerly X/Open, see
-dnl `http://www.rdg.opengroup.org/onlinepubs/7908799/toc.htm') has it.
-dnl If it isn't there, we define a macro that fails.
-
-AC_CHECK_FUNC(setsid, AC_DEFINE(HAVE_SETSID))
-
-dnl AC_FUNC_GETPGRP defines GETPGRP_VOID if getpgrp() takes no parameters.
-AC_FUNC_GETPGRP
-
-AC_FUNC_SETPGRP
-AC_FUNC_VPRINTF
-AC_CHECK_FUNC(vfork, AC_DEFINE(HAVE_VFORK))
-AC_FUNC_VFORK
-
-dnl ***
-dnl Generate a list of missing functions that we desperately require.
-dnl Any missing functions, below, will be replaced with emulators if 
-dnl necessary; the value of RUNAS_MISSING_SOURCES will be substituted into
-dnl the "portability" Makefile.
-
-AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR),
-	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} strerror.c")
-
-dnl Some Unices don't have a daemon(3) function. If it's missing, we
-dnl supply our own emulation version.
-
-AC_CHECK_FUNC(daemon, AC_DEFINE(HAVE_DAEMON),
-	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} daemon.c")
-
-AC_CHECK_FUNC(basename, AC_DEFINE(HAVE_BASENAME),
-	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} basename.c")
-
-AC_CHECK_FUNC(setenv, AC_DEFINE(HAVE_SETENV),
-	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} setenv.c")
-
-AC_CHECK_FUNC(flock, AC_DEFINE(HAVE_FLOCK),
-	      LOCAL_MISSING_SOURCES="${LOCAL_MISSING_SOURCES} flock.c")
-
-AC_SUBST(LOCAL_MISSING_SOURCES)
-
-dnl ---------------------------------------------------------------------------
-dnl System services
-dnl ---------------------------------------------------------------------------
-
-AC_SYS_LONG_FILE_NAMES
-
-dnl ---------------------------------------------------------------------------
-dnl Final configuration constants that depend on the previous stuff.
-dnl ---------------------------------------------------------------------------
-
-dnl ---------------------------------------------------------------------------
-dnl Output and variable substitutions
-dnl ---------------------------------------------------------------------------
-
-dnl ***
-dnl Individual Makefiles
-
-AC_OUTPUT(Makefile)
-
-dnl ---------------------------------------------------------------------------
-dnl Copyrights and such
-dnl ---------------------------------------------------------------------------
-
-echo ""
-echo "***"
-echo "*** daemonize is released under a BSD-style license."
-echo "*** See the LICENSE file distributed with the source code for details."
-echo "***"
-echo ""
