public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* configuration scripts
@ 1997-09-10  1:50 Smith, Eric
  1997-09-15 18:42 ` Mikey
  0 siblings, 1 reply; 3+ messages in thread
From: Smith, Eric @ 1997-09-10  1:50 UTC (permalink / raw)
  To: 'gnu-win32@cygnus.com'

To all,

Thank you for the responses.

I have resigned myself to the long and arduous task of using Borland's
FCONVERT.EXE to convert all of my configuration scripts from ANSI to OEM
format (strip out <CR>).  For the number of files I have, this appears
to be a long task.

This closes out one problem, but makes me wonder, why do the GNU scripts
from the .tar.gz files at the main ftp site have <CR><LF> in them
instead of just <LF>.  They are identified as UNIX scripts, but appear
to have a PC flavor to them.  Since I haven't edited them ("cat
{filename} | more" instead) I can't figure out where the <CR> came from
unless it is there to start.

Eric M. Smith
telephone               : (423) 229-2254
profs/officevision     : XGIB003
internet -- business : erics@eastman.com
internet -- personal  : burnsun@tricon.net

Do not meddle in the affairs of wizards, for they are quick to anger.
Do not meddle in the affairs of dragons, for you are crunchy and taste
good with ketchup.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: configuration scripts
  1997-09-10  1:50 configuration scripts Smith, Eric
@ 1997-09-15 18:42 ` Mikey
  0 siblings, 0 replies; 3+ messages in thread
From: Mikey @ 1997-09-15 18:42 UTC (permalink / raw)
  To: Smith, Eric, gnu-win32

[-- Attachment #1: Type: text/plain, Size: 2015 bytes --]

if you haven't done this yet stop,
remount all filesystems -b
and then reinstall from cdk.exe
and user.exe
the shell scripts/headers/sources  would only have cr\lf
if you were mounted without -b to start with
or if you used winzip to install.

attached is a utility to convert all the files in a dir to \n from \r\n and vica/versa
after building put in path and do
ln -s dtou.exe utod

to convert \r\n to \n do 
dtou * (under bash)
to convert \n to \r\n do
utod * (under bash)

no checking is done for utod so if you use it on the same file
multiple times you will get \r\r\r\r\r\n.

to recursively fix all files in a tree use dtoutree
WARNING
no check for binary files, this is meant for source trees
and include trees only

On Tue, 9 Sep 1997 12:21:47 -0400, you wrote:

>To all,
>
>Thank you for the responses.
>
>I have resigned myself to the long and arduous task of using Borland's
>FCONVERT.EXE to convert all of my configuration scripts from ANSI to OEM
>format (strip out <CR>).  For the number of files I have, this appears
>to be a long task.
>
>This closes out one problem, but makes me wonder, why do the GNU scripts
>from the .tar.gz files at the main ftp site have <CR><LF> in them
>instead of just <LF>.  They are identified as UNIX scripts, but appear
>to have a PC flavor to them.  Since I haven't edited them ("cat
>{filename} | more" instead) I can't figure out where the <CR> came from
>unless it is there to start.
>
>Eric M. Smith
>telephone               : (423) 229-2254
>profs/officevision     : XGIB003
>internet -- business : erics@eastman.com
>internet -- personal  : burnsun@tricon.net
>
>Do not meddle in the affairs of wizards, for they are quick to anger.
>Do not meddle in the affairs of dragons, for you are crunchy and taste
>good with ketchup.
>
>-
>For help on using this list (especially unsubscribing), send a message to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>

(jeffdbREMOVETHIS@netzone.com)
delete REMOVETHIS from the above to reply
         Mikey

[-- Attachment #2: dtou.c --]
[-- Type: text/x-c, Size: 2815 bytes --]

/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
/* modified for unixish paths, and direct conversion by
jeffdb@netzone.com Mikey */ 
#include <stdio.h>
#include <sys/types.h>
#include <utime.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#define BUFFSIZE 4096

#ifndef O_BINARY
#  define O_BINARY 0
#endif

static int
cvt(char *fname, int is_dtou)
{
  int sf, df, il, ol, end;
  register char *iptr, *optr;
  char ibuf[BUFFSIZE], obuf[BUFFSIZE * 2 + 1], ctrlz[1];
  char tfname[FILENAME_MAX];
  struct utimbuf ftime;
  struct stat *mystat, oldstat;

  mystat = &oldstat;
  if (*fname == '-')
    {
      sf = 0; 
      df = 1; 
    }
  else
    {

      sprintf(tfname, "cvt$$");
      sf = open(fname, O_RDONLY|O_BINARY); /* O_TEXT dosen't work in cygwin32 b17.1 w/binary mounted filesystems so we have to do it all ourselves. */
      if (sf < 1)
        {
          perror(fname);
          return 1;
        }
      df = open(tfname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644);
      if (df < 1)
        {
          perror(tfname);
          close(sf);
          return 1;
        }
    }
  end = 0;
  while (((il=read(sf, ibuf, BUFFSIZE)) > 0) && (!end))
    {
    iptr = &ibuf;
    optr = &obuf;
/*    if (is_dtou)
      il++; */

    ol = il;
    if (is_dtou)
      {
        while(il > 0)
	  {
	    switch (*iptr)
	    {
	      case '\r':
		*iptr++;
	        ol--;
		il--;
		break;
	      case '\032':
		*optr++ = '\n';
		ol -= il;
		il = 0;
		end++;
		break;
	      default:
		*optr++ = *iptr++;
	        il--;
		break;
	    }
	  }
      }
    else
      {
        while(il > 0)
	  {
	    while ((*iptr != '\n') && (il > 0))
	      {
		*optr++ = *iptr++;
	 	il--;
	      }
	      if (il)
		{
	          *optr++ = '\r';
	          *optr++ = *iptr++;
	          ol++;
	          il--;
		}
           }
      } 	
    write(df, obuf, ol);
    }
  if (*fname != '-')
    { 
	  fstat(sf, mystat);
	  ftime.actime = oldstat.st_atime;
	  ftime.modtime = oldstat.st_mtime;
	  utime(tfname, &ftime);
	  close(sf);
	  close(df);
	  remove(fname);
	  rename(tfname, fname);
    }
  return 0;
}

int
main(int argc, char **argv)
{
  int i;
  int is_dtou = 0;
  int rv = 0;
  char *temp, *progname;

  progname = argv[0];
  temp = strrchr(progname, '/');
  if (temp == NULL)
    {
    temp = progname;
    }
  else
    {
    ++temp;
    }
  if (strlen (temp) >= 4 && strcmp (temp + strlen (temp) - 4, ".exe") == 0)
    *(temp + strlen (temp) - 4) = '\0'; /* dump .exe suffix if necessary */ 

  if (strcmp (temp + strlen (temp) - 4, "dtou") == 0)
      is_dtou = 1;

  if (argc == 1)
	{
	rv += cvt((char *)"-\0", is_dtou);
	return rv;
	}

  for (argc--, argv++; argc; argc--, argv++)
    rv += cvt(*argv, is_dtou);
  return rv;
}

[-- Attachment #3: dtoutree --]
[-- Type: text/x-shellscript, Size: 124 bytes --]

#!/bin/sh
for file in *;do
  if [ -d $file ];then
    pushd $file
     dtoutree
    popd
  else
     dtou $file;
  fi;
done

^ permalink raw reply	[flat|nested] 3+ messages in thread

* configuration scripts.
@ 1997-09-08 16:54 Smith, Eric
  0 siblings, 0 replies; 3+ messages in thread
From: Smith, Eric @ 1997-09-08 16:54 UTC (permalink / raw)
  To: 'gnu-win32@cygnus.com'

To all:

Having just recently started with the GNU family of tools, hopefully
someone can provide me info on this.

I have just installed the entire cdk from Cygnus Solutions.  Following
research (and interpretation of included README to FAQ on WWW), I have
done the following additional steps.

1. Create shortcut of sh.exe in /bin.

2. Added the following to my environment:
   GCC_EXEC_PREFIX  =  C:\gnuwin32\b18\H-i386-cygwin32\lib\gcc-lib\
   PATH =
C:\gnuwin32\b18\H-i386-cygwin32\bin;C:\gnuwin32\b18\tcl\bin;...
   TCL_LIBRARY = C:/gnuwin32/b18/tcl/lib/tcl7.6
   GDBTK_LIBRARY = C:/gnuwin32/b18/share/gdbtcl

3. Created a /tmp directory.

After doing this, I have tried many times to execute configure scripts
for additional gnu tools (like gnat, hello-1.3, etc...).  The following
is the result.

bash$ ./configure: (null)

I have examined the scripts as best I can (I don't usually program shell
scripts), tried numerous parameters based on the file text, and yet I
cannot get the configuration files to generate the correct makefile from
makefile.in.

What do I still have to do to get the configuration scripts to run?

Eric M. Smith
telephone               : (423) 229-2254
profs/officevision     : XGIB003
internet -- business : erics@eastman.com
internet -- personal  : burnsun@tricon.net

Do not meddle in the affairs of wizards, for they are quick to anger.
Do not meddle in the affairs of dragons, for you are crunchy and taste
good with ketchup.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-09-15 18:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-10  1:50 configuration scripts Smith, Eric
1997-09-15 18:42 ` Mikey
  -- strict thread matches above, loose matches on Subject: below --
1997-09-08 16:54 Smith, Eric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).