lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Errors during make on HPUX


From: pg
Subject: Re: lynx-dev Errors during make on HPUX
Date: Thu, 3 Dec 1998 14:22:49 -0700 (MST)

In a recent note, address@hidden said:

> Date: Thu, 3 Dec 1998 07:08:44 -0500 (EST)
> 
> > Hi, I am compiling on HPUX 10.20 with gcc & 
> > system default curses. 
> >  
> > As far as I know, I haven't changed 
> > anything too drastic in the userdefs.h 
> > file, just some options..... 
> >  
> > I get the following errors during make. 
> it looks like a problem with the sed script which generates cfg_defs.h
> 
> -- given the config.cache and config.status files I should be able to
>    see most of the problem (whether it's an unbalanced quote, or what).
> 
> > In file included from ./LYShowInfo.c:37: 
> > ../cfg_defs.h:117: `usr' undeclared (first use in this function) 

    [ snip! ]

I've been playing with cfg_defs.sh:

o Remove Band-Aid (Larry's, Tom's, mine, whoseever) from LyShowinfo.c

o Merge quote and apostrophe paths in cfg_defs.sh

o Factor some common code into a subroutine, QuoteIt()

o Add comments :-)

o Force two char[] members in each struct

o Entify any iternal '&', '<' or '>'

o Escape any internal '"' or '\' (Which may solve the problem at hand)

FWIW,
gil

(patch for dev.7)
=========================================================================
diff -brc ./orig/lynxsrc/cfg_defs.sh ./lynxsrc/cfg_defs.sh
*** ./orig/lynxsrc/cfg_defs.sh  Sat Oct 24 10:49:08 1998
--- ./lynxsrc/cfg_defs.sh       Tue Nov 24 11:41:15 1998
***************
*** 2,7 ****
--- 2,25 ----
  # Translate the lynx_cfg.h and config.cache data into a table, useful for
  # display at runtime.
  
+ QuoteIt() {
+     # Strip leading and trailing whitespace
+     # Escape any iternal '\'
+     # Escape any iternal '"'
+     # Entify any iternal '&', '<' or '>'
+     # Append a '=' if none present'
+     # Break into two strings at '='
+     # Prefix ' { "' and suffix '" },'
+     sort |
+     sed -e 's!^[      ]*!!' -e 's![   ]*$!!' \
+         -e 's!\\!\\\\!g'        \
+       -e 's!"!\\"!g'          \
+       -e 's!&!\&amp;!g' -e 's!<!\&lt;!g' -e 's!>!\&gt;!g' \
+       -e 's!^[^=]*$!&=!' \
+       -e 's!=!",      "!'     \
+       -e 's!^!        { "!' -e 's!$!" },!'
+ }
+ 
  cat <<EOF
  #ifndef CFG_DEFS_H
  #define CFG_DEFS_H 1
***************
*** 12,46 ****
  } config_cache[] = {
  EOF
  
! # Empirical test for format of config.cache.
! #     I'd welcome a better touchstone.
! # Ideally, "configure" should generate a uniform format config.cache.
! #     -- gil
! case `grep '^ac_cv_func_' config.cache | head -1` in
! 
!     # `set' quotes correctly as required by POSIX, so do not add quotes.
!   *{*'="'* )
!  sed \
        -e '/^#/d'     \
!       -e 's/^.[^=]*_cv_/      { "/' \
!       -e 's/=\${.*=/", /'           \
!       -e 's/}$/ },/'        \
!       config.cache | sort
!   ;;
!     # `set' does not quote correctly, so add quotes
!     #     ( cf. configure script's building config.cache )
!    * )
! sed   -e '/^#/d' \
!       -e 's/"/\\"/g' \
!       -e 's/=}$/=""}/' \
!       -e "s/'/\"/g" \
!       -e 's/^.[^=]*_cv_/      { "/' \
!       -e 's/=${[^=]*="/", "/' \
!       -e 's/=${[^=]*=/", "/' \
!       -e 's/"}$/}/' \
!       -e 's/}$/" },/' \
!       config.cache | sort
!   ;; esac
  
  cat <<EOF
  };
--- 30,41 ----
  } config_cache[] = {
  EOF
  
! sed \
        -e '/^#/d'           \
!       -e 's/^.[^=]*_cv_//' \
!       -e 's/=\${.*=/=/'  \
!       -e 's/}$//'          \
!       config.cache | QuoteIt
  
  cat <<EOF
  };
***************
*** 50,65 ****
        CONST char *value;
  } config_defines[] = {
  EOF
! fgrep '#define' lynx_cfg.h |sort |
  sed   -e 's@  @ @g' \
        -e 's@  @ @g' \
!       -e 'address@hidden ]*#define @@' \
        -e 'address@hidden ]*/\*.*\*/@@' \
!       -e 's@"$@@' \
!       -e 's@"@@' \
!       -e 's@ @", "@' \
!       -e 'address@hidden@     { "@' \
!       -e 'address@hidden@" },@'
  cat <<EOF
  };
  
--- 45,57 ----
        CONST char *value;
  } config_defines[] = {
  EOF
! fgrep '#define' lynx_cfg.h |
  sed   -e 's@  @ @g' \
        -e 's@  @ @g' \
!       -e 'address@hidden      ]*#define[      ]*@@' \
        -e 'address@hidden ]*/\*.*\*/@@' \
!       -e 'address@hidden      ][      address@hidden@' \
!     | QuoteIt
  cat <<EOF
  };
  
diff -brc ./orig/lynxsrc/src/LYShowInfo.c ./lynxsrc/src/LYShowInfo.c
*** ./orig/lynxsrc/src/LYShowInfo.c     Mon Nov 23 03:46:04 1998
--- ./lynxsrc/src/LYShowInfo.c  Tue Nov 24 10:04:01 1998
***************
*** 25,34 ****
  #if defined(HAVE_CONFIG_H) && !defined(NO_CONFIG_INFO)
  #define HAVE_CFG_DEFS_H
  
! #define PutDefs(table, N) \
!       fprintf(fp0, "%-35s %s\n", \
!                    table[N].name, \
!                    (table[N].value != 0) ? table[N].value : "")
  
  /*
   *  Compile-time definitions info, returns local url
--- 25,31 ----
  #if defined(HAVE_CONFIG_H) && !defined(NO_CONFIG_INFO)
  #define HAVE_CFG_DEFS_H
  
! #define PutDefs(table, N) fprintf(fp0, "%-35s %s\n", table[N].name, 
table[N].value)
  
  /*
   *  Compile-time definitions info, returns local url

reply via email to

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