Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Thu, 23 Jan 2003 17:50:44 -0500 (EST) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: John McLean cc: cygwin AT cygwin DOT com Subject: Re: gnu make under cygwin In-Reply-To: <3E306BB5.6050404@techsol.ca> Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII John, There are different reasons for the two problems that you describe, but neither is a bug in GNU make. The answers to both of your questions are contained in , though in reverse order. The first error is related to your default shell being different on the two systems (Linux and Cygwin). Your default shell under Cygwin is bash (whatever the current version is), with the default options set at compile time. It seems that your Linux shell does not repeat the configuration (even if it also is bash). The one relevant bit of configuration is expanding null globs (i.e., when a glob doesn't match anything). Try setting 'shopt -s nullglob' in your .bashrc. That should get rid of the first error [*]. The second error is the result of a bug in your Makefile. The result of a shell substitution export LIST=`grep -lr ":gcrt1.o%s}" *` is not quoted. Thus, when grep matches *two* files, the shell treats the second file as another variable to export. You should change that line to export LIST="`grep -lr ":gcrt1.o%s}" *`" That should get rid of the second error. Igor [*] Provided you don't set SHELL in your Makefile -- you haven't provided enough of a snippet to ascertain that. If you set your SHELL to, for example, ksh, you may need a different way of turning on nullglob expansion -- see the ksh manpage for details. On Thu, 23 Jan 2003, John McLean wrote: > Hi, I'm having some problems with GNU make under cygwin. Everything > works fine under linux, but it breaks under cygwin. > > Below is the relevant snippit from my Makefile. > > > ############################################################# > # > # gcc1: uncompress and patch > # > ############################################################# > .gcc1: > rm -f .gcc1 > rm -rf ${GCC_PATH} > bzcat ${BASEDIR}/sources/${GCC_SOURCE} | tar ${VERBOSE_TAR} -x > # Apply all gcc patches in the source directory, named gcc-*.patch > for p in ${BASEDIR}/sources/gcc-*.patch ; do \ > cat $$p | patch ${VERBOSE_PATCH} -p1 -d ${GCC_PATH} ; \ > done > (cd ${GCC_PATH}; set -e; export LIST=`grep -lr ":gcrt1.o%s}" *`; \ > if [ -n "$$LIST" ] ; then \ > perl -i.orig -p -e "s,:gcrt1.o%s},:crt0.o%s},g;" \ > $$LIST; fi); > > > It runs fine under linux, but under cygwin I get > > > gcc-3.2.1/GNATS > gcc-3.2.1/.brik > # Apply all gcc patches in the source directory, named gcc-*.patch > for p in /home/david/tsi-tools-source/sources/gcc-*.patch ; do \ > cat $p | patch -p1 -d > "/home/david/tsi-tools-source/gcc-"3.2.1"" ; \ > done > cat: /home/david/tsi-tools-source/sources/gcc-*.patch: No such file or > directory > > (cd "/home/david/tsi-tools-source/gcc-"3.2.1""; set -e; export > LIST=`grep -lr " > :gcrt1.o%s}" *`; \ > if [ -n "$LIST" ] ; then \ > perl -i.orig -p -e "s,:gcrt1.o%s},:crt0.o%s},g;" \ > $LIST; fi); > export: gcc/config/arm/linux-elf.h: bad variable name > make: *** [.gcc1] Error 2 > > > > Now the wierd thing is if I copy this output and type it on the command > line everything works fine. > > FYI: gcc/config/arm/linux-elf.h is the second file it finds. And I'm > trying to make a cross compiler for an embedded target. > > All of the cygwin programs are from downloading them today Jan.23 > > Make is version 3.79.1 -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk! -- /usr/games/fortune -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/