summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--configure.in4
-rw-r--r--src/getopt.c5
-rw-r--r--src/getopt1.c5
4 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 63b4a37..ab09f71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2001-09-05 shawn <sabetts@diggin.lamenet.tmp>
+ * configure.in: check for getopt and getopt_long.
+
+ * src/getopt.c: wrap the whole file in an #ifndef HAVE_GETOPT_LONG
+
+ * src/getopt1.c: wrap the whole file in an #ifndef HAVE_GETOPT_LONG
+
* src/messages.h (MESSAGE_WELCOME): The help keystroke is not
hardcoded.
diff --git a/configure.in b/configure.in
index f4f5ccf..7390649 100644
--- a/configure.in
+++ b/configure.in
@@ -17,7 +17,7 @@ dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
-dnl $Id: configure.in,v 1.19 2001/06/29 14:54:24 algernon Exp $
+dnl $Id: configure.in,v 1.20 2001/09/06 06:38:53 sabetts Exp $
AC_INIT(src/main.c)
AM_INIT_AUTOMAKE(ratpoison, 0.2.0-cvs)
@@ -75,5 +75,7 @@ dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_TYPE_SIGNAL
+AC_CHECK_FUNC(getopt)
+AC_CHECK_FUNC(getopt_long)
AC_OUTPUT(Makefile doc/Makefile src/Makefile)
diff --git a/src/getopt.c b/src/getopt.c
index 84faa8b..10d8b4e 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -26,6 +26,7 @@
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
+
#ifndef _NO_PROTO
#define _NO_PROTO
#endif
@@ -34,6 +35,8 @@
#include <config.h>
#endif
+#ifndef HAVE_GETOPT_LONG
+
#if !defined (__STDC__) || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
@@ -1043,3 +1046,5 @@ main (argc, argv)
}
#endif /* TEST */
+
+#endif /* HAVE_GETOPT_LONG */
diff --git a/src/getopt1.c b/src/getopt1.c
index af8e681..d872f65 100644
--- a/src/getopt1.c
+++ b/src/getopt1.c
@@ -19,10 +19,13 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#ifndef HAVE_GETOPT_LONG
+
#include "getopt.h"
#if !defined (__STDC__) || !__STDC__
@@ -187,3 +190,5 @@ main (argc, argv)
}
#endif /* TEST */
+
+#endif /* HAVE_GETOPT_LONG */