Fix the src/deltas.cpp file by applying the diff attached (use 'patch' command).
Or get 1.2.9pre from our CVS (it should have all the latest fixes for FreeBSD).

cgi wrote:
> 
> Thanks!
> 
> I runned the following commands:
> 
> 1. CXXFLAGS="-D_PTHREADS"
> CFLAGS="$CFLAGS -D_THREAD_SAFE -pthread -D_PTHREADS"
>       ./configure  --prefix=/home/web/src
> 
> 2. CXXFLAGS="-D_PTHREADS"
> CFLAGS="$CFLAGS -D_THREAD_SAFE -pthread -D_PTHREADS"        gmake
> 
> But unfortunately I´m still getting some problems:
> 
> mkdir .libs
> rm -fr .libs/libaspseek.la .libs/libaspseek.* .libs/libaspseek.*
> (cd . && ln -s aspseek.lo aspseek.o)
> (cd . && ln -s logger.lo logger.o)
> (cd . && ln -s datasource.lo datasource.o)
> (cd . && ln -s templates.lo templates.o)
> (cd . && ln -s protocol.lo protocol.o)
> (cd . && ln -s charsets.lo charsets.o)
> (cd . && ln -s sock.lo sock.o)
> (cd . && ln -s datetime.lo datetime.o)
> (cd . && ln -s timer.lo timer.o)
> (cd . && ln -s crc32.lo crc32.o)
> (cd . && ln -s ucharset.lo ucharset.o)
> gcc -shared  aspseek.lo logger.lo datasource.lo templates.lo protocol.lo
> charsets.lo sock.lo datetime.lo timer.lo crc32.lo
> charset.lo  -lstdc++ -lc  -Wl,-soname -Wl,libaspseek.so.0 -o
> .libs/libaspseek.so.0
> (cd .libs && rm -f libaspseek.so && ln -s libaspseek.so.0 libaspseek.so)
> (cd .libs && rm -f libaspseek.so && ln -s libaspseek.so.0 libaspseek.so)
> creating libaspseek.la
> (cd .libs && rm -f libaspseek.la && ln -s ../libaspseek.la libaspseek.la)
> gcc -DHAVE_CONFIG_H -I. -I. -I../include     -D_THREAD_SAFE -pthread -D_PTHR
> EADS -D_THREAD_SAFE -pthread -D_PTHREADS -c sc.c
> /bin/sh ../libtool --mode=link
> gcc  -D_THREAD_SAFE -pthread -D_PTHREADS -D_THREAD_SAFE -pthread -D_PTHREADS
>   -o s.cgi  sc.o libaspseek.la
> gcc -D_THREAD_SAFE -pthread -D_PTHREADS -D_THREAD_SAFE -pthread -D_PTHREADS
> -o .libs/s.cgi sc.o
> 
> ./.libs/libaspseek.so -lstdc++ -Wl,--rpath -Wl,/home/web/standard/delfa/src/
> lib
> /usr/lib/libc.so.4: WARNING!  setkey(3) not present in the system!
> /usr/lib/libc.so.4: warning: this program uses gets(), which is unsafe.
> /usr/lib/libc.so.4: warning: mktemp() possibly used unsafely; consider using
> mkstemp()
> /usr/lib/libc.so.4: WARNING!  des_setkey(3) not present in the system!
> /usr/lib/libc.so.4: WARNING!  encrypt(3) not present in the system!
> /usr/lib/libc.so.4: warning: tmpnam() possibly used unsafely; consider using
> mkstemp()
> /usr/lib/libc.so.4: warning: this program uses f_prealloc(), which is
> stupid.
> /usr/lib/libc.so.4: WARNING!  des_cipher(3) not present in the system!
> /usr/lib/libc.so.4: warning: tempnam() possibly used unsafely; consider
> using mkstemp()
> creating s.cgi
> g++ -DHAVE_CONFIG_H -I. -I. -I../include     -D_THREAD_SAFE -pthread -D_PTHR
> EADS -c filters.cpp
> g++ -DHAVE_CONFIG_H -I. -I. -I../include     -D_THREAD_SAFE -pthread -D_PTHR
> EADS -c resolve.cpp
> g++ -DHAVE_CONFIG_H -I. -I. -I../include     -D_THREAD_SAFE -pthread -D_PTHR
> EADS -c deltas.cpp
> deltas.cpp: In method `void * CSyncBufferedFile::SyncFile()':
> deltas.cpp:2738: implicit declaration of function `int fdatasync(...)'
> gmake[2]: *** [deltas.o] Error 1
> gmake[2]: Leaving directory `/home/web/standard/delfa/aspseek-1.2.8/src'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/home/web/standard/delfa/aspseek-1.2.8/src'
> gmake: *** [all-recursive] Error 1
> 
> ----- Original Message -----
> From: "Kir Kolyshkin" <[EMAIL PROTECTED]>
> To: "cgi" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 06, 2002 11:17 AM
> Subject: Re: [aseek]: Bug report: Compilation problems on FreeBSD 5
> 
> > Please use aspseek-1.2.9pre from CVS, or fix configure.in so the fragment
> > will look like this:
> >
> >         *-*-freebsd*)
> >                 CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE -pthread -D_PTHREADS"
> >                 CFLAGS="$CFLAGS -D_THREAD_SAFE -pthread -D_PTHREADS"
> >                 echo "setting FreeBSD compilation options"
> >                 ;;
> >
> > So, you need to add -D_PTHREADS to CXXFLAGS and add the line with CFLAGS

-- 
[EMAIL PROTECTED]  http://kir.vtx.ru/    ICQ 7551596  Phone +7 903 6722750
Hi, I'm a signature virus: copy me to your .signature to help me spread!
--
Index: deltas.cpp
===================================================================
RCS file: /home/cvs/aspseek/src/deltas.cpp,v
retrieving revision 1.25
retrieving revision 1.28
diff -u -r1.25 -r1.28
--- deltas.cpp  2002/01/09 11:50:15     1.25
+++ deltas.cpp  2002/02/25 11:32:21     1.28
@@ -15,7 +15,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/*  $Id: deltas.cpp,v 1.25 2002/01/09 11:50:15 kir Exp $
+/*  $Id: deltas.cpp,v 1.28 2002/02/25 11:32:21 kir Exp $
     Author : Alexander F. Avdonkin
        Implemented classes: CDeltaFiles
 */
@@ -37,6 +37,8 @@
 #include <algorithm>
 #include "delmap.h"
 
+extern int thread_stack_size;
+
 using std::sort;
 
 CDeltaFiles* deltaFiles = NULL;
@@ -517,11 +519,20 @@
                }
        }
 
+       if (logger.getLevel() < L_DEBUG)
+       {
+               logger.log(CAT_ALL, L_INFO, "] done.\n");
+       }
+       else
+       {
+               logger.log(CAT_ALL, L_INFO, "Total read time: %8.2f, sort time: %8.2f, 
+max memory: %lu\n", totalReadTime, totalSortTime, maxMem);
+       }
+
 //     ::CheckDeltas(database);
 
        if (CompactStorage)
        {
-               logger.log(CAT_ALL, L_INFO, "Deleting 'deleted' records from 
urlword[s] ");
+               logger.log(CAT_ALL, L_INFO, "Deleting 'deleted' records from 
+urlword[s] ...");
                ULONG urlID1 = 0;
                char* param = new char[100000];
                int tcnt = 0;
@@ -598,17 +609,9 @@
                        urlID1 += (DEL_CHUNK_SIZE << 3);
                }
                delete param;
-               logger.log(CAT_ALL, L_INFO, "%i records deleted. Done\n", tcnt);
+               logger.log(CAT_ALL, L_INFO, " done. (%i records deleted)\n", tcnt);
        }
 
-       if (logger.getLevel() < L_DEBUG)
-       {
-               logger.log(CAT_ALL, L_INFO, "] done.\n");
-       }
-       else
-       {
-               logger.log(CAT_ALL, L_INFO, "Total read time: %8.2f, sort time: %8.2f, 
max memory: %lu\n", totalReadTime, totalSortTime, maxMem);
-       }
 
 }
 
@@ -2725,6 +2728,8 @@
        return newOffset;
 }
 
+#ifdef USE_CSYNC_BUFFERED_FILE
+
 void* SyncFile(void* param)
 {
        return ((CSyncBufferedFile*)param)->SyncFile();
@@ -2743,7 +2748,11 @@
 CSyncBufferedFile::CSyncBufferedFile()
 {
        m_finish = 0;
-       pthread_create(&m_thread, NULL, ::SyncFile, this);
+       pthread_attr_t attr;
+       pthread_attr_init(&attr);
+       if (thread_stack_size)
+               pthread_attr_setstacksize(&attr, thread_stack_size);
+       pthread_create(&m_thread, &attr, ::SyncFile, this);
 }
 
 CSyncBufferedFile::~CSyncBufferedFile()
@@ -2891,3 +2900,4 @@
        unlink(fw);
 }
 #endif /* TEST_CBUFFERFILE */
+#endif /* USE_CSYNC_BUFFERED_FILE */

Reply via email to