lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Autoconf EBCDIC test simplification [PATCH]


From: pg
Subject: lynx-dev Autoconf EBCDIC test simplification [PATCH]
Date: Mon, 1 Jan 2001 11:38:48 -0700 (MST)

Hello, Lyncei,

It occurred to me suddenly, however belatedly, how Rube Goldbergian it is
to have a couple dozen lines in aclocal.m4 which expand to more lines
in configure which cause a compilation to be performed which merely
succeeds or fails depending on a #if so that configure can set a flag
in config.cache so code in config.hin can cause configure to later test
that flag and possibly cause a couple macros to be defined in lynx_cfg.h.

(I know how I got to this point, but no matter.)  It's simpler, of course
to put the #if's and macro definitions directly in a header file.
I'm biased, of course, by the extreme expense of a compilation on OS/390.
Patch (attached) simplifies aclocal.m4 and config.hin and puts the #if's
and #define's directly in HTUtils.h.

Subject as always to editorial discretion, lest the editor(s) decide
that this technique reduces portability, or merely that HTUtils.h is
not the optimum place to put this code.

-- gil
-- 
StorageTek
INFORMATION made POWERFUL
########################################################################
%%% Created Mon Jan  1 11:08:43 MST 2001 by target lynx.patch. %%%
diff -bru orig/lynx2-8-4/WWW/Library/Implementation/HTUtils.h 
lynx2-8-4/WWW/Library/Implementation/HTUtils.h
--- orig/lynx2-8-4/WWW/Library/Implementation/HTUtils.h Thu Dec 21 19:44:11 2000
+++ lynx2-8-4/WWW/Library/Implementation/HTUtils.h      Mon Jan  1 10:45:24 2001
@@ -17,7 +17,7 @@
 #include <sys/types.h>
 #include <stdio.h>
 
-#else
+#else  /* HAVE_CONFIG_H */
 
 #ifdef DJGPP
 #include <sys/config.h>        /* pseudo-autoconf values for DJGPP 
libc/headers */
@@ -101,6 +101,14 @@
 #endif
 
 #endif /* HAVE_CONFIG_H */
+
+#if '0' != 48
+#define NOT_ASCII
+#endif
+
+#if '0' == 240
+#define EBCDIC
+#endif
 
 #ifndef LY_MAXPATH
 #define LY_MAXPATH 256
diff -bru orig/lynx2-8-4/aclocal.m4 lynx2-8-4/aclocal.m4
--- orig/lynx2-8-4/aclocal.m4   Wed Oct 25 10:35:28 2000
+++ lynx2-8-4/aclocal.m4        Mon Jan  1 10:31:01 2001
@@ -1057,32 +1057,6 @@
 AC_SUBST(ECHO_CC)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl Check whether character set is EBCDIC.
-AC_DEFUN([CF_EBCDIC],[
-AC_MSG_CHECKING(if character set is EBCDIC)
-AC_CACHE_VAL(cf_cv_ebcdic,[
-       AC_TRY_COMPILE([ ],
-[ /* TryCompile function for CharSet.
-   Treat any failure as ASCII for compatibility with existing art.
-   Use compile-time rather than run-time tests for cross-compiler
-   tolerance.  */
-#if '0'!=240
-make an error "Character set is not EBCDIC"
-#endif ],
-[ # TryCompile action if true
-cf_cv_ebcdic=yes ],
-[ # TryCompile action if false
-cf_cv_ebcdic=no])
-# end of TryCompile ])
-# end of CacheVal CvEbcdic
-AC_MSG_RESULT($cf_cv_ebcdic)
-case "$cf_cv_ebcdic" in  #(vi
-    yes) AC_DEFINE(EBCDIC)
-         AC_DEFINE(NOT_ASCII);; #(vi
-    *)   ;;
-esac
-])dnl
-dnl ---------------------------------------------------------------------------
 dnl Check if 'errno' is declared in <errno.h>
 AC_DEFUN([CF_ERRNO],
 [
diff -bru orig/lynx2-8-4/config.hin lynx2-8-4/config.hin
--- orig/lynx2-8-4/config.hin   Wed Oct 25 10:35:28 2000
+++ lynx2-8-4/config.hin        Mon Jan  1 10:43:46 2001
@@ -27,7 +27,6 @@
 #undef DISABLE_NEWS            /* CF_ARG_DISABLE(news) */
 #undef DISP_PARTIAL            /* CF_ARG_ENABLE(partial) */
 #undef DONT_TRACK_INTERNAL_LINKS /* CF_ARG_DISABLE(internal-links) */
-#undef EBCDIC                  /* CF_EBCDIC */
 #undef ENABLE_IPV6             /* CF_CHECK_IPV6 */
 #undef ENABLE_NLS              /* defined if NLS is requested */
 #undef ENABLE_OPTS_CHANGE_EXEC /* CF_ARG_ENABLE(change-exec) */
@@ -163,7 +162,6 @@
 #undef NEED_PTEM_H             /* defined by CF_SIZECHANGE */
 #undef NEED_REMOVE             /* defined by CF_REMOVE_BROKEN */
 #undef NGROUPS                 /* defined by CF_NGROUPS */
-#undef NOT_ASCII               /* CF_NOT_ASCII */
 #undef NO_CHANGE_EXECUTE_PERMS /* CF_ARG_DISABLE(dired-xpermit) */
 #undef NO_CONFIG_INFO          /* CF_ARG_DISABLE(config-info) */
 #undef NO_EXTENDED_HTMLDTD     /* CF_ARG_DISABLE(extended-dtd) */

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

reply via email to

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