summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@users.sourceforge.net>2005-02-15 16:13:06 +0000
committerJosé Fonseca <jrfonseca@users.sourceforge.net>2005-02-15 16:13:06 +0000
commit5482ddc6be9ab5e1bdf9d7fb78208190a8c74f8b (patch)
tree88bc0ac7b1d1845ee1223c85e69fe6be8a756ba5
parent07fb1fb09c7f83d723aeb370ccf4e10254ddf583 (diff)
Don't require getopt_long (based on SASAJIMA and Dirk Tilger patches).
-rw-r--r--NEWS4
-rw-r--r--acinclude.m428
-rw-r--r--configure.ac2
-rw-r--r--main.c4
4 files changed, 30 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 6613986..13d47c9 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,10 @@ News
* A 'postconnect' keyword to execute a command after closing a SMTP
connection.
+
+ * Do not attempt to authenticate if no username/password is given.
+
+ * Several configuration enhancements (SASAJIMA, Dirk Tilger).
* Version 0.5.0 (2003-11-14):
diff --git a/acinclude.m4 b/acinclude.m4
index 31892aa..0b6f63a 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -3,19 +3,20 @@ dnl
dnl Check for getopt_long support.
dnl
dnl This assume that the standard getopt.h file (from GNU libc) is
-dnl available as lib/gnugetopt.h. If needed, this file will be linked
+dnl available as lib/gnugetopt.h. If needed, this file will be linked
dnl as getopt.h, but we want to default to the system's getopt.h file.
dnl (See http://sources.redhat.com/ml/automake/2000-09/msg00041.html
-dnl for an explanation about why using the system's getopt.h file
-dnl is important.)
+dnl for an explanation about why using the system's getopt.h file is
+dnl important.)
dnl
-dnl @version $Id: acinclude.m4,v 1.2 2003/11/16 23:33:38 jrfonseca Exp $
+dnl @category InstalledPackages
dnl @author Alexandre Duret-Lutz <adl@gnu.org>
-
-AC_PREREQ(2.49)
+dnl @version 2003-10-29
+dnl @license GPLWithACException
AC_DEFUN([adl_FUNC_GETOPT_LONG],
- [# clean out junk possibly left behind by a previous configuration
+ [AC_PREREQ(2.49)dnl
+ # clean out junk possibly left behind by a previous configuration
rm -f lib/getopt.h
# Check for getopt_long support
AC_CHECK_HEADERS([getopt.h])
@@ -26,3 +27,16 @@ AC_DEFUN([adl_FUNC_GETOPT_LONG],
AC_LIBOBJ(getopt)
AC_LIBOBJ(getopt1)
AC_CONFIG_LINKS([lib/getopt.h:lib/gnugetopt.h])])])])
+
+
+dnl Same as above, but we don't need getopt_long -- just plain getopt --,
+dnl and weren't including a GNU replacement .
+
+AC_DEFUN([jrf_FUNC_GETOPT],
+ [AC_PREREQ(2.49)dnl
+ # Check for getopt_long support
+ AC_CHECK_HEADERS([getopt.h])
+ AC_CHECK_FUNCS([getopt],,
+ [# FreeBSD has a gnugetopt library for this
+ AC_CHECK_LIB([gnugetopt],[getopt],[AC_DEFINE([HAVE_GETOPT])],
+ [])])])
diff --git a/configure.ac b/configure.ac
index 6eeaba9..a752f73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,7 @@ fi
AC_SUBST( sysconfdir )
-adl_FUNC_GETOPT_LONG
+jrf_FUNC_GETOPT
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/main.c b/main.c
index 08f094b..d1f47e6 100644
--- a/main.c
+++ b/main.c
@@ -4,10 +4,14 @@
*/
+#include "config.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef HAVE_GETOPT_H
#include <getopt.h>
+#endif
#include "main.h"
#include "message.h"