Re: htdig: Porting to Windows 95/NT


Andrei Iliev (andre-i@akdi.ru)
Mon, 20 Oct 1997 19:13:32 +0300


-----Original Message-----
>Hello Andrei!
>
>I read that you "are porting" htdig to Win32 platform! This is great! :)
>
>I wonder if you have any version avaliable for me to test, since this
>seems to be a very good product.
>
>I haven't tested htdig not even on an UNIX, but I need "search"
>functionality on out Intranet (running on IIS 2.0 on Windows NT 4.0). I
>think you will recommend htdig to do the job, if you have any other
>suggestions or comments, please tell me! :)
>
>--
>Ernesto,
Hi Ernesto,
Sorry for delay in reply (weekend :) ). Re. porting to Win32.
1. First of all, you need GNU-WIN32 developing system, which is available
   from Cygnus Software ( http://www.cygnus.com/misc/gnu-win32/ ).
   It ports UNIX shell 'bash, sh ' and many useful
   UNIX utils like GNU 'make'. It comes with GNU c/c++ compiler. The
   following is an excerpt from "The GNU-Win32 Project Page":
>>----------------------------
"The GNU-Win32 tools are ports of the popular GNU development tools to
Windows NT/95 for the x86 and PowerPC processors. Applications built with
these tools have access to the Microsoft Win32 API as well as the Cygwin32
API which provides additional UNIX-like functionality including UNIX
sockets,
process control with a working fork and select, etc...
With these tools installed, it is now possible to:
  - Write Win32 console or GUI applications that make use of the standard
    Microsoft Win32 API and/or the Cygwin32 API
  - Easily configure and build many GNU tools from source (including
    rebuilding the GNU-Win32 development tools themselves
    under x86 NT) -Port many other significant UNIX programs to Windows
NT/95
    without making significant changes to the source code
  - Have a fairly full UNIX-like environment to work in, with access to many
    of the common UNIX utilities (from both the bash shell and
    command.com) "
>>----------------------------
Using this software you can install ht://Dig without considerable efforts.
Before compiling the ht://Dig, some minor changes in the source
code should be done. Remember, that default file's opening mode
is O_TEXT. So, either you have to add the flag O_BINARY in each
call of 'open' function, or add the following:
  extern int _fmode;
 _fmode = O_BINARY;
2. After installing cygnus you can run
   sh ./configure
3. Cygnus version of gnu compiler doesn't have flock function. So after
    running ./configure the HAVE_FLOCK will be 0, that means use the fcntl
    function (see systems.h in GDBM... subdirectory). The function doesn't
    work for flock.l_len = 0 as defined in system.h. You have to change the
    value to something else (I use flock.l_len = 1).
4. Then run
     make
       and
   make install
That's it.
BTW, as far as i get from your message you are running IIS. So did you try
the Microsoft Index Server? It's free (can be downloaded from
www.microsoft.com) and support 7 languages (german as well). Unfortunately
currently it doesn't support russian, so I didn't try it. If you will try
it,
please write me your comments.
If you are looking for search engine for local file system, try the
DTSearch.
(www.dtsearch.com). I highly recommend it. It can index and search plain
text,
html files, PDF- files , Miscrosoft Office files, zip files. It has several
search mode: exact matching, fuzzy search, boolean search etc.
It is really great. You can try the fully functional evaluation version.
Bye for now,
Andrei Iliev.
P.S.
I forgot that in order to compile htdig you required the function
'rresvport'
that is missing in Cygnus software. I has found it somewhere in the WEB.
Here is it
/*
 * Copyright (c) 1983 Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * by the University of California, Berkeley. The name of the
 * University may not be used to endorse or promote products derived
 * from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */
/*
 * From the file: "@(#)rcmd.c 5.20 (Berkeley) 1/24/89";
 */
/*
 * Obtain a reserved TCP port.
 *
 * Note that we only create the socket and bind a local reserved port
 * to it. It is the caller's responsibility to then connect the socket.
 */
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
extern int errno;
int /* return socket descriptor, or -1 on error */
rresvport(alport)
int *alport; /* value-result; on entry = first port# to try */
   /* on return = actual port# we were able to bind */
{
 struct sockaddr_in my_addr;
 int sockfd;
 bzero((char *) &my_addr, sizeof(my_addr));
 my_addr.sin_family = AF_INET;
 my_addr.sin_addr.s_addr = INADDR_ANY;
 if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
  return(-1);
 for ( ; ; ) {
  my_addr.sin_port = htons((u_short) *alport);
  if (bind(sockfd, (struct sockaddr *) &my_addr, sizeof(my_addr)) >= 0)
   break; /* OK, all done */
  if (errno != EADDRINUSE) { /* some other error */
   close(sockfd);
   return(-1);
  }
  (*alport)--; /* port already in use, try the next one */
  if (*alport == IPPORT_RESERVED / 2) {
   close(sockfd);
   errno = EAGAIN;
   return(-1);
  }
 }
 return(sockfd);
}

----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:25:11 PST