changeset 9:48880e61ce5e

better autoconf, changes for solaris portability
author carl
date Wed, 03 Jan 2007 22:28:27 -0800
parents ed73e6361570
children f9e8bbf33a2a
files AUTHORS ChangeLog NEWS configure.in src/Makefile.am src/includes.h src/sm-archive.cpp
diffstat 7 files changed, 60 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/AUTHORS	Fri Mar 10 12:55:07 2006 -0800
+++ b/AUTHORS	Wed Jan 03 22:28:27 2007 -0800
@@ -1,2 +1,2 @@
 510 Software Group <carl@five-ten-sg.com>
-
+Sergey Shapovalov <shasn@reso.ru>
--- a/ChangeLog	Fri Mar 10 12:55:07 2006 -0800
+++ b/ChangeLog	Wed Jan 03 22:28:27 2007 -0800
@@ -1,4 +1,10 @@
     $Id$
 
+1.2 2007-01-03
+    Add patches to enable build on solaris.
+
+1.1 2006-12-22
+    Better autoconf setup for portability.
+
 1.0 2006-03-10
     First release
--- a/NEWS	Fri Mar 10 12:55:07 2006 -0800
+++ b/NEWS	Wed Jan 03 22:28:27 2007 -0800
@@ -1,3 +1,5 @@
     $Id$
 
+1.2  2007-01-03 patches to build on solaris
+1.1  2006-12-22 better autoconf setup for portability
 1.0  2006-03-10 initial version
--- a/configure.in	Fri Mar 10 12:55:07 2006 -0800
+++ b/configure.in	Wed Jan 03 22:28:27 2007 -0800
@@ -1,20 +1,40 @@
-AC_INIT(configure.in)
+AC_PREREQ(2.59)
+AC_INIT(sm-archive,1.2,carl@five-ten-sg.com)
+AC_CONFIG_SRCDIR([config.h.in])
+AC_CONFIG_HEADER([config.h])
+
+AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION)
 
-AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(sm-archive,1.0)
-AC_PATH_PROGS(BASH, bash)
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
 
-AC_LANG_CPLUSPLUS
-AC_PROG_CXX
-AC_PROG_LIBTOOL
+# Checks for header files.
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h syslog.h unistd.h])
 
-AC_OUTPUT(                  \
-    Makefile                \
-    sm-archive.spec         \
-    html/Makefile           \
-    info/Makefile           \
-    man/Makefile            \
-    src/Makefile            \
-    xml/Makefile            \
-    xml/sm-archive          \
-    )
+# Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_STDBOOL
+AC_C_CONST
+
+# Checks for library functions.
+AC_FUNC_FORK
+AC_FUNC_GETPGRP
+AC_HEADER_STDC
+AC_FUNC_STAT
+AC_CHECK_FUNCS([memset socket strchr strdup strncasecmp strtol daemon])
+
+AC_CONFIG_FILES([Makefile
+                 sm-archive.spec
+                 html/Makefile
+                 info/Makefile
+                 man/Makefile
+                 src/Makefile
+                 xml/Makefile
+                 xml/sm-archive])
+AC_OUTPUT
--- a/src/Makefile.am	Fri Mar 10 12:55:07 2006 -0800
+++ b/src/Makefile.am	Wed Jan 03 22:28:27 2007 -0800
@@ -1,12 +1,13 @@
 sbin_PROGRAMS = smarchive
-smarchive_SOURCES = sm-archive.cpp sm-archive.h context.cpp context.h tokenizer.cpp tokenizer.h includes.h
-EXTRA_DIST = test.cpp
+smarchive_SOURCES = sm-archive.cpp sm-archive.h context.cpp context.h tokenizer.cpp tokenizer.h includes.h daemon.h
+EXTRA_DIST = daemon.c test.cpp
 
 # set the include path found by configure
 INCLUDES= $(all_includes)
 
 # the library search path.
-smarchive_LDFLAGS = $(all_libraries) -lmilter -pthread
+smarchive_LDFLAGS = -pthread
+smarchive_LDADD   = $(all_libraries) -lmilter
 
 # default compile flags
 smarchive_CXXFLAGS = -pthread
--- a/src/includes.h	Fri Mar 10 12:55:07 2006 -0800
+++ b/src/includes.h	Wed Jan 03 22:28:27 2007 -0800
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+	#include "config.h"
+#endif
+
 #include "tokenizer.h"
 #include "context.h"
 #include "sm-archive.h"
--- a/src/sm-archive.cpp	Fri Mar 10 12:55:07 2006 -0800
+++ b/src/sm-archive.cpp	Wed Jan 03 22:28:27 2007 -0800
@@ -23,16 +23,6 @@
 #include <sysexits.h>
 #include <unistd.h>
 
-// needed for socket io
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-
 // needed for thread
 #include <pthread.h>
 
@@ -41,11 +31,6 @@
 #include <map>
 #include <list>
 
-// for the dns resolver
-#include <netinet/in.h>
-#include <arpa/nameser.h>
-#include <resolv.h>
-
 // misc stuff needed here
 #include <ctype.h>
 #include <syslog.h>
@@ -55,11 +40,16 @@
 
 #include "includes.h"
 
+#ifndef HAVE_DAEMON
+	#include "daemon.h"
+	#include "daemon.c"
+#endif
+
 static char* smarchive_version="$Id$";
 
 
 extern "C" {
-	#include "libmilter/mfapi.h"
+	#include <libmilter/mfapi.h>
 	sfsistat mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr);
 	sfsistat mlfi_envfrom(SMFICTX *ctx, char **argv);
 	sfsistat mlfi_envrcpt(SMFICTX *ctx, char **argv);