HELP!!! Metaconfig expert needed!

Augustine Cano afc at shibaya.lonestar.org
Tue May 14 04:29:56 AEST 1991


I'm trying to write a package to be configured with metaconfig.  I did fix
metaconfig 2 to work with perl 3 (044) (I no longer get syntax errors, but
I might not have fixed everything that needed fixing.)

I created a test "package" consisting of just one *.U unit and one *.SH
file (included below).  Metaconfig runs to completion but then I'm left
with empty Configure and config.h.SH files.  This is the output of metaconfig:

$! nulled, predecessor circle
$! nulled, predecessor circle
$! nulled, predecessor circle
$! nulled, predecessor circle
$! nulled, predecessor circle
$! nulled, predecessor circle
$! nulled, predecessor circle
$! nulled, predecessor circle
$! nulled, predecessor circle

This is mytest.U:

?RCS:$Header: mytest.c.U,v 1.1 91/02/14 00:00:00 afc Exp $
?X: 
?X: Test unit.
?X:
?RCS: $Log:	mytest.c.U,v $
?RCS: 
?RCS: Revision 1.1  91/05/04  00:00:00  afc
?RCS: Baseline.
?RCS: 
?MAKE:mytest.c var1 var2 var3 c1 c2 : test cat echo n c Myread mansrc Mcc Guess Oldconfig Loc
?MAKE:	-pick add $@ %*
?S:var1:
?S:	Test variable # 1.
?S:.
?S:var2:
?S:	Test variable # 2.
?S:.
?S:var3:
?S:	Test variable # 3.
?S:.
?S:c1:
?S:	Test variable # 4.
?S:.
?S:c2:
?S:	Test variable # 5.
?S:.
:
q_no1="Input a number "
q_no2="Input yes/no "
q_no3="Enter a string "
q_no4="Enter another string "
q_no5="Enter another string "

$echo $n "$q_no1$c"
. myread var1

if test $var1 -gt 1; then
  var2=false
  dflt=n
  $echo $n "$q_no2 [$dflt] $c"
  . myread
  case "$ans" in
    y*) var2=true;;
  esac
fi

$echo $n "$q_no3$c"
. myread var3

$echo $n "$q_no4$c"
. myread c1

$echo $n "$q_no5$c"
. myread c2


And this is mytest.c.SH:

case $CONFIG in
'')
    if test ! -f config.sh; then
	ln ../config.sh . || \
	ln ../../config.sh . || \
	ln ../../../config.sh . || \
	(echo "Can't find config.sh."; exit 1)
    fi
    . config.sh
    ;;
esac
: This forces SH files to create target in same directory as SH file.
: This is so that make depend always knows where to find SH derivatives.
case "$0" in
*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac
echo "Extracting fdmtron.c (with variable substitutions)"
: This section of the file will have variable substitutions done on it.
: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
: Protect any dollar signs and backticks that you do not want interpreted
: by putting a backslash in front.  You may delete these comments.
$spitshell >mytest.c <<!GROK!THIS!
/*
 * MYTEST.C  Just a test of metaconfig
 */

/************************************************************************/

!GROK!THIS!
if test $var1 -eq 1 ; then
$spitshell >>mytest.c <<!GROK!THIS!
void mytest()

{
!GROK!THIS!
if test $var2 ; then
  $spitshell >>mytest.c <<!GROK!THIS!
  $c1 = $var3 |= $c2;
}
!GROK!THIS!
else
$spitshell >>mytest.c <<!GROK!THIS!
  $c1 |= $c2;
}
!GROK!THIS!
fi
: In the following dollars and backticks do not need the extra backslash.
$spitshell >>mytest.c <<'!NO!SUBS!'
!NO!SUBS!
chmod 755 mytest.c
$eunicefix mytest.c

Any solution, hint or even documentation for dist 3 would be most welcome.
What am I doing wrong?  This is driving me nuts!

Thanks in advance.  I'll post a summary of e-mail responses if there's
interest.

-- 
Augustine Cano		INTERNET: afc at shibaya.lonestar.org
			UUCP:     ...!{ernest,egsner}!shibaya!afc



More information about the Comp.unix.questions mailing list