lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev MSDOS (DJGPP) port using configure [PATCH]


From: Doug Kaufman
Subject: lynx-dev MSDOS (DJGPP) port using configure [PATCH]
Date: Mon, 25 Jun 2001 18:30:46 -0700 (PDT)

It seemed to me that it might be easier to maintain the DOS port if
it used configure, instead of having to tweak makefiles when changes
are made to lynx. This might also make it easier for those who want
to compile with different options. The following patch seems to work
for both PDCurses and SLang, but this leads to many more defines for
the DOS port, which might cause subtle errors in cases that I haven't
yet tested. I hope that people who compile the DJGPP port can try this
to see if it can be improved. This may not be ready to add to the
main code yet, especially as we are in prerelease. It would certainly
require a rewrite of the DJGPP section of INSTALLATION.

The main problems addressed:
1. The configure script defines "UNIX", which caused some problems 
   with local addresses. I undefined it in www_tcp.h.
2. In PDCurses, pnoutrefresh is present, but "curses pads" doesn't work.
   I changed this in LYCurses. Should this be "!defined(__DJGPP__)"
   instead, or is this a problem for all versions of PDCurses?
3. DJGPP has "getgroups" for compatibility, but it always returns "0". 
   I defined NOUSERS to get around this.
4. PDCurses has cbreak, but only declares it within a typedef, so the
   test for cbreak fails in configure, with cbreak undeclared. I 
   defined this in www_tcp.h
5. For the SLang port, I made the DJGPP_KEYHANDLER the default. You can
   avoid this by defining NO_DJ_KEYHANDLER.
6. DJGPP gettext (as distributed precompiled) is dependent on
   libiconv.a. To configure with nls support, LIBS needs to specify
   -liconv, but this has to come AFTER -intl on the command line. I
   changed configure to do this. I don't think this breaks other ports.
7. Configure has an option to make "screen=pdcurses", but this only
   works with X11. Hence I configured with "screen=curses".
8. I defined WATT32 and put -lwatt in LIBS whenever using configure.
   This brings up the question of whether or not the WATT32 define is
   now redundant. This was put in when we switched from the old DGJPP
   port of WATTCP to WATT-32. I don't know if there is currently any
   other version to link against (aside from some old copies that I
   kept for historical interest). I doubt if the old version of WATTCP
   would give a functional binary. Does anyone beside me think that it
   is time to remove the WATT32 ifdef's from the code, and simply make
   them ifdef __DJGPP__?


This was tested by compiling from shell scripts. The script for
PDCurses that I used is:

#!/bin/sh
CFLAGS="-I/djgpp/pdcur24 -I/djgpp/watt32/inc" \
LIBS="-L/djgpp/pdcur24/lib -L/djgpp/watt32/lib -liconv -lwmemu" \
./configure --prefix=/dev/d/djgpp/lynx-pre2/lynx-conf \
--with-screen=curses \
--disable-full-paths \
--disable-dired-override \
--enable-addrlist-page \
--enable-change-exec \
--enable-cgi-links \
--enable-charset-choice \
--enable-default-colors \
--enable-exec-links \
--enable-externs \
--enable-file-upload \
--enable-gzip-help \
--enable-nls \
--enable-prettysrc \
--enable-read-eta \
--enable-source-cache \
--enable-nested-tables \
--libdir=/dev/d/djgpp/lynx-pre2/lynx-conf \
--with-zlib \
--with-ssl

The patch:


--- lynx2.8.4pre.2/lynx2-8-4/src/LYCurses.h.ori Fri Jun 22 22:14:36 2001
+++ lynx2.8.4pre.2/lynx2-8-4/src/LYCurses.h     Sun Jun 24 20:31:50 2001
@@ -236,7 +236,7 @@
 /*
  * If we have pads, use them to implement left/right scrolling.
  */
-#if defined(HAVE_NEWPAD) && defined(HAVE_PNOUTREFRESH)
+#if defined(HAVE_NEWPAD) && defined(HAVE_PNOUTREFRESH) && !defined(PDCURSES)
 #define USE_CURSES_PADS 1
 #endif
 
--- lynx2.8.4pre.2/lynx2-8-4/configure.ori      Fri Jun 22 22:14:20 2001
+++ lynx2.8.4pre.2/lynx2-8-4/configure  Sun Jun 24 23:39:06 2001
@@ -1715,6 +1715,11 @@
 linux*)
        TRY_CFLAGS="$TRY_CFLAGS -DLINUX"
        ;;
+msdosdjgpp*)
+       PROG_EXT=".exe"
+       LIBS="$LIBS -lwatt"
+       TRY_CFLAGS="$TRY_CFLAGS -DDOSPATH -DNOUSERS -DWATT32"
+       ;;
 next*)
        TRY_CFLAGS="$TRY_CFLAGS -DNEXT -DXMOSAIC_HACK"
        ;;
@@ -3060,7 +3065,7 @@
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
    gt_save_LIBS="$LIBS"
-                LIBS="$gt_save_LIBS -lintl"
+                LIBS="-lintl $gt_save_LIBS"
                 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
 echo "configure:3066: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
@@ -3095,7 +3100,7 @@
           fi
 
           if test "$gt_cv_func_gettext_libintl" = yes; then
-            LIBS="$LIBS -lintl"
+            LIBS="-lintl $LIBS"
           fi
 
           if test "$gt_cv_func_gettext_libc" = "yes" \
--- lynx2.8.4pre.2/lynx2-8-4/userdefs.h.ori     Fri Jun 22 22:14:52 2001
+++ lynx2.8.4pre.2/lynx2-8-4/userdefs.h Mon Jun 25 00:02:40 2001
@@ -1409,6 +1410,9 @@
 #endif
 #else
 /* have to define something... */
+#ifdef SYSTEM_MAIL
+#undef SYSTEM_MAIL
+#endif /* SYSTEM_MAIL */`
 #define SYSTEM_MAIL "sendmail"
 #define SYSTEM_MAIL_FLAGS "-t -oi"
 #endif
@@ -1432,6 +1436,7 @@
 **    WINDOWS/DOS
 **    ===========
 */
+#ifndef HAVE_CONFIG_H
 #define COMPRESS_PATH   "compress"
 #define UNCOMPRESS_PATH "uncompress"
 #define UUDECODE_PATH   "uudecode"
@@ -1452,6 +1457,7 @@
 #define TELNET_PATH     "telnet"
 #define TN3270_PATH     "tn3270"
 #define RLOGIN_PATH     "rlogin"
+#endif /* !HAVE_CONFIG_H */
 
 #else  /* Unix */
        /* Standard locations are defined via the configure script.  When
--- lynx2.8.4pre.2/lynx2-8-4/www_tcp.h.ori      Fri Jun 22 22:14:14 2001
+++ lynx2.8.4pre.2/lynx2-8-4/www_tcp.h  Sun Jun 24 22:13:42 2001
@@ -553,15 +553,17 @@
 #define DECL_ERRNO
 #include <errno.h>
 #include <sys/types.h>
-#include <socket.h>
 #include <io.h>
 #ifdef WATT32
+#include <sys/socket.h>
 #include <arpa/inet.h>
 #include <tcp.h>
 #ifdef word
 #undef word
 #endif /* word */
 #define select select_s
+#else
+#include <socket.h>
 #endif /* WATT32 */
 
 #undef NETWRITE
@@ -570,12 +572,21 @@
 #define NETREAD read_s
 #undef NETCLOSE
 #define NETCLOSE close_s
+#ifdef UNIX
+#undef UNIX
+#endif /* UNIX */
 #ifndef WATT32
 #define getsockname getsockname_s
 #endif /* !WATT32 */
 #ifdef HAVE_GETTEXT
 #define gettext gettext__
 #endif
+#if !defined(NCURSES) && !defined(USE_SLANG)
+#define HAVE_CBREAK 1
+#endif /* !NCURSES && !USE_SLANG */
+#if defined(USE_SLANG) && !defined(NO_DJ_KEYHANDLER)
+#define DJGPP_KEYHANDLER
+#endif /* USE_SLANG && !NO_DJ_KEYHANDLER */
 #endif /* DJGPP */
 
 #ifdef HAVE_UNISTD_H

__ 
Doug Kaufman
Internet: address@hidden


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]