Fix build for gcc3:

* Work around an overzealous format check when looking for strftime().
* Add a missing #include.

Taken from the fluxbox CVS repository.
This commit is contained in:
naddy 2004-01-29 17:52:43 +00:00
parent 64c8efdf2d
commit eaeabf72f1
3 changed files with 53 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.24 2003/10/08 17:13:16 sturm Exp $
# $OpenBSD: Makefile,v 1.25 2004/01/29 17:52:43 naddy Exp $
COMMENT= "window manager based on the original Blackbox code"
@ -22,7 +22,8 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
CONFIGURE_STYLE= simple
CONFIGURE_STYLE= autoconf
AUTOCONF_VERSION= 2.54
CONFIGURE_ARGS= --enable-kde --enable-xinerama
USE_GMAKE= Yes
@ -32,6 +33,10 @@ MODGCC3_LANGS+= c++
USE_X11= Yes
SUBST_VARS= VERSION
# prevent cascading autotools rebuild
post-patch:
@touch -r ${WRKSRC}/aclocal.m4 ${WRKSRC}/configure.in
post-install:
${INSTALL_DATA} ${FILESDIR}/menu ${PREFIX}/share/fluxbox

View File

@ -0,0 +1,35 @@
$OpenBSD: patch-configure_in,v 1.3 2004/01/29 17:52:43 naddy Exp $
--- configure.in.orig 2004-01-29 18:00:33.000000000 +0100
+++ configure.in 2004-01-29 18:01:17.000000000 +0100
@@ -31,7 +31,30 @@ AC_HEADER_TIME
dnl Check for existance of basename(), setlocale() and strftime()
AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename, LIBS="$LIBS -lgen"))
-AC_CHECK_FUNCS(getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose)
+AC_CHECK_FUNCS(getpid setlocale sigaction strcasestr snprintf vsnprintf catopen catgets catclose)
+dnl The autoconf test for strftime is broken now (due to gcc 3.3 bug?):
+dnl Gcc 3.3 testprog = ``extern "C" char strftime;'', build with g++ test.cc
+dnl breaks with:
+dnl test.cc:1: error: nonnull argument with out-of-range operand number
+dnl (arg 1, operand 3)
+
+
+AC_MSG_CHECKING(for strftime)
+
+AC_COMPILE_IFELSE(
+[AC_LANG_PROGRAM([#include <time.h>],
+[[
+char * s;
+time_t t = time(NULL);
+size_t x = strftime(s, 5, "%a", localtime(&t));
+]]
+)],
+[
+ AC_DEFINE(HAVE_STRFTIME, 1, [Define to 1 if you have the 'strftime' function.])
+ AC_MSG_RESULT(yes)
+],
+[AC_MSG_RESULT(no)])
+
AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl")
AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-util_fbrun_FbRun_cc,v 1.1 2004/01/29 17:52:43 naddy Exp $
--- util/fbrun/FbRun.cc.orig 2004-01-29 18:27:18.000000000 +0100
+++ util/fbrun/FbRun.cc 2004-01-29 18:27:33.000000000 +0100
@@ -34,6 +34,7 @@
#include <iostream>
#include <fstream>
+#include <cassert>
using namespace std;
FbRun::FbRun(int x, int y, size_t width):