1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-10 07:04:03 +00:00

- Fix build with gcc 4.2

PR:		118197
Submitted by:	Pietro Cerutti <gahr@gahr.ch>
Approved by:	portmgr (erwin)
This commit is contained in:
Martin Wilke 2007-11-22 13:33:06 +00:00
parent de06319d75
commit 7cc00b2ae5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=202792
7 changed files with 130 additions and 11 deletions

View File

@ -19,9 +19,9 @@ USE_ICONV= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-libiconv-prefix=${LOCALBASE} --without-unac
USE_LDCONFIG= yes
USE_AUTOTOOLS= libtool:15
USE_BISON= build
USE_GCC= 2.95
MAN1= htdb_dump.1 htdb_stat.1 htdb_load.1 mifluzdump.1 mifluzload.1 \
mifluzsearch.1 mifluzdict.1
@ -35,7 +35,9 @@ PKGMESSAGE= ${WRKDIR}/pkg-message
post-patch:
@${REINPLACE_CMD} 's|-D_THREAD_SAFE -pthread|${PTHREAD_CFLAGS}|g ; \
s|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
s|-lpthread|${PTHREAD_LIBS}|g ;\
s|echo aout|echo elf|g' \
${WRKSRC}/configure
post-install:
@${SED} -e "s:%%PREFIX%%:${PREFIX}:g" ${PKGDIR}/pkg-message > \
@ -44,10 +46,4 @@ post-install:
@${CAT} ${PKGMESSAGE}
@${ECHO_MSG}
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 700042
BROKEN= fails to install
.endif
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
--- configure.orig Mon Jul 23 21:55:39 2001
+++ configure Mon Jul 29 22:29:47 2002
--- configure.orig 2001-07-23 14:55:39.000000000 +0200
+++ configure 2007-11-22 11:39:14.000000000 +0100
@@ -5982,6 +5982,7 @@
# This can be used to rebuild libtool when needed
@ -8,3 +8,51 @@
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -6322,7 +6323,7 @@
LIBS="-lipc $LIBS";;
bsdi*) optimize_def="-O2";;
freebsd*) optimize_def="-O2"
- CPPFLAGS="-D_THREAD_SAFE -pthread $CPPFLAGS";;
+ CPPFLAGS=" $CPPFLAGS";;
hpux*) CPPFLAGS="-D_REENTRANT $CPPFLAGS";;
irix*) optimize_def="-O2"
CPPFLAGS="-D_SGI_MP_SOURCE $CPPFLAGS";;
@@ -7851,7 +7852,7 @@
fi
if test "$db_cv_mutex" = no; then
-LIBS="-lpthread $LIBS"
+LIBS="-pthread $LIBS"
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
@@ -8354,7 +8355,7 @@
#define HAVE_MUTEX_PTHREADS 1
EOF
;;
-POSIX/pthreads/library) LIBS="-lpthread $LIBS"
+POSIX/pthreads/library) LIBS="-pthread $LIBS"
cat >> confdefs.h <<\EOF
#define HAVE_MUTEX_PTHREAD 1
EOF
@@ -9702,16 +9703,16 @@
fi
done
-ac_safe=`echo "fstream.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for fstream.h""... $ac_c" 1>&6
-echo "configure:9708: checking for fstream.h" >&5
+ac_safe=`echo "fstream" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for fstream""... $ac_c" 1>&6
+echo "configure:9708: checking for fstream" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 9713 "configure"
#include "confdefs.h"
-#include <fstream.h>
+#include <fstream>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:9718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }

View File

@ -0,0 +1,15 @@
--- db/db_int.h.orig 2007-11-22 12:18:53.000000000 +0100
+++ db/db_int.h 2007-11-22 12:24:32.000000000 +0100
@@ -108,10 +108,10 @@
* an array.
*/
#undef SSZ
-#define SSZ(name, field) ((int)&(((name *)0)->field))
+#define SSZ(name, field) ((size_t)&(((name *)0)->field))
#undef SSZA
-#define SSZA(name, field) ((int)&(((name *)0)->field[0]))
+#define SSZA(name, field) ((size_t)&(((name *)0)->field[0]))
/*
* Print an address as a u_long (a u_long is the largest type we can print

View File

@ -0,0 +1,11 @@
--- mifluz/WordCursorOne.cc.orig 2007-11-22 11:41:12.000000000 +0100
+++ mifluz/WordCursorOne.cc 2007-11-22 11:41:27.000000000 +0100
@@ -44,7 +44,7 @@
}
// *****************************************************************************
-WordCursorOne::WordCursorOne(WordList *words, const WordKey &searchKey, int action = HTDIG_WORDLIST_WALKER) :
+WordCursorOne::WordCursorOne(WordList *words, const WordKey &searchKey, int action) :
WordCursor(words->GetContext()),
prefixKey(words->GetContext())
{

View File

@ -0,0 +1,13 @@
--- mifluz/WordDBCache.h.orig 2007-11-22 12:12:34.000000000 +0100
+++ mifluz/WordDBCache.h 2007-11-22 12:15:53.000000000 +0100
@@ -149,8 +149,8 @@
inline int Absolute() {
int i;
for(i = 0; i < entries_length; i++) {
- entries[i].key = pool + (int)(entries[i].key);
- entries[i].data = pool + (int)(entries[i].data);
+ entries[i].key = pool + (long)(entries[i].key);
+ entries[i].data = pool + (long)(entries[i].data);
}
return OK;
}

View File

@ -0,0 +1,11 @@
--- search/WordKeySemantic.cc.orig 2007-11-22 11:42:09.000000000 +0100
+++ search/WordKeySemantic.cc 2007-11-22 11:42:58.000000000 +0100
@@ -134,7 +134,7 @@
}
}
-int WordKeySemantic::LocationCompare(const WordKey& expected, const WordKey& actual, int proximity = 0)
+int WordKeySemantic::LocationCompare(const WordKey& expected, const WordKey& actual, int proximity)
{
int ret = 1;

View File

@ -0,0 +1,25 @@
--- search/WordResults.cc.orig 2007-11-22 12:37:28.000000000 +0100
+++ search/WordResults.cc 2007-11-22 12:39:52.000000000 +0100
@@ -25,11 +25,11 @@
static int wordResults_cmp(const DBT* a, const DBT* b)
{
- int length = (int)a->app_private;
+ size_t length = (size_t)a->app_private;
WordKeyNum* a_values = (WordKeyNum*)a->data;
WordKeyNum* b_values = (WordKeyNum*)b->data;
- for(int i = 0; i < length; i++) {
+ for(size_t i = 0; i < length; i++) {
if(a_values[i] != b_values[i]) {
return a_values[i] > b_values[i] ? 1 : -1;
}
@@ -198,7 +198,7 @@
}
if((error = ranked->set_re_len(ranked, sizeof(WordKeyNum) * document_length)) != 0) {
- fprintf(stderr, "WordResults::Open ranked->set_re_len(%d) failed: %s\n", sizeof(WordKeyNum) * document_length, CDB_db_strerror(error));
+ fprintf(stderr, "WordResults::Open ranked->set_re_len(%lu) failed: %s\n", sizeof(WordKeyNum) * document_length, CDB_db_strerror(error));
return NOTOK;
}