Re: [Flightgear-devel] Capturing warnings
Curtis L. Olson wrote: > > David Luff writes: > > Unfortunately, when ./configure gets run automatically after typing > > make, the configure switches after ./configure get remembered, but > > the flags in front of ./configure don't (this is using Cygwin Bash). Is > > there any way round this? > > I've been catching this situation manually and rerunning autogen.sh > and configure my self. Me too. I have a script that runs: (optionally) autogen and configure (with variable assignments prefixed) make make install (for plib and SimGear only) in each of plib, SimGear, Atlas, FlightGear in turn. I tend to run this after each CVS update. - Julian ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
David Luff writes: > Unfortunately, when ./configure gets run automatically after typing > make, the configure switches after ./configure get remembered, but > the flags in front of ./configure don't (this is using Cygwin Bash). Is > there any way round this? I've been catching this situation manually and rerunning autogen.sh and configure my self. Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities[EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
On 02/07/02 at 10:07 [EMAIL PROTECTED] wrote: >Jonathan Polley wrote: >> >> Along the lines of adding the -pedantic option, I would like to add an >> ability (probably at ./configure time) to specify additional compile >> options. Since one of my platforms is a Mac, I would like to be able to >> add -wno_long_double, as it keeps telling me that their size is >> non-portable. > >You have this ability already. You just need to set the "CFLAGS" and >"CXXFLAGS" environment variables while running "configure". Have a look >at the make files first to see what the default value is. For GCC it is >"-g -O2" for both, so you could do: > >[In Bash] > > GCCFLAGS="-g -O2 -wno_long_double" > CFLAGS="$GCCFLAGS" CXXFLAGS="$GCCFLAGS" ./configure > Unfortunately, when ./configure gets run automatically after typing make, the configure switches after ./configure get remembered, but the flags in front of ./configure don't (this is using Cygwin Bash). Is there any way round this? Cheers - Dave ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
What I would prefer is something similar to --prefix=, so that I could just add to the list, rather than replacing it. I.e., ./configure --prefix=/sw --with-GL=/sw --add_switches="-wno_long_double" this way I don't have to know what the current configuration is. Just a thought, Jonathan Polley On Tuesday, July 2, 2002, at 04:07 AM, [EMAIL PROTECTED] wrote: > Jonathan Polley wrote: >> >> Along the lines of adding the -pedantic option, I would like to add an >> ability (probably at ./configure time) to specify additional compile >> options. Since one of my platforms is a Mac, I would like to be able to >> add -wno_long_double, as it keeps telling me that their size is >> non-portable. > > You have this ability already. You just need to set the "CFLAGS" and > "CXXFLAGS" environment variables while running "configure". Have a look > at the make files first to see what the default value is. For GCC it is > "-g -O2" for both, so you could do: > > [In Bash] > > GCCFLAGS="-g -O2 -wno_long_double" > CFLAGS="$GCCFLAGS" CXXFLAGS="$GCCFLAGS" ./configure > > [In csh? (I'm not sure about this)] > > env CFLAGS="-g -O2 -wno_long_double" CXXFLAGS="-g -O2 -wno_long_double" > ./configure > > - Julian > > > ___ > Flightgear-devel mailing list > [EMAIL PROTECTED] > http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
Jonathan Polley wrote: > > Along the lines of adding the -pedantic option, I would like to add an > ability (probably at ./configure time) to specify additional compile > options. Since one of my platforms is a Mac, I would like to be able to > add -wno_long_double, as it keeps telling me that their size is > non-portable. You have this ability already. You just need to set the "CFLAGS" and "CXXFLAGS" environment variables while running "configure". Have a look at the make files first to see what the default value is. For GCC it is "-g -O2" for both, so you could do: [In Bash] GCCFLAGS="-g -O2 -wno_long_double" CFLAGS="$GCCFLAGS" CXXFLAGS="$GCCFLAGS" ./configure [In csh? (I'm not sure about this)] env CFLAGS="-g -O2 -wno_long_double" CXXFLAGS="-g -O2 -wno_long_double" ./configure - Julian ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
Along the lines of adding the -pedantic option, I would like to add an ability (probably at ./configure time) to specify additional compile options. Since one of my platforms is a Mac, I would like to be able to add -wno_long_double, as it keeps telling me that their size is non-portable. Thanks, Jonathan Polley On Monday, July 1, 2002, at 05:43 PM, Julian Foad wrote: > I now have a practical solution for saving the compiler warnings: a > wrapper script replacement for the compiler. > > rm config.cache # Otherwise it keeps the previous values of CC and CXX. > GCCFLAGS="-Wall -pedantic -Wpointer-arith" > CC="saveoutp gcc" CXX="saveoutp c++" CFLAGS="$GCCFLAGS" > CXXFLAGS="$GCCFLAGS" ./configure > > where ~/bin/saveoutp contains: > > #!/bin/bash > > # Run a program, also capturing stderr to a file. > # > # Usage: saveoutp ... > # > # Treat the argument list as a shell command. Run the command, > displaying > # stderr but also capturing it into a file named ".deps/.err" > . > # (Bug: the command's exit status is reduced to just true or false.) > > if [ -d .deps ] ; then > > # Make name of error file from last positional argument. > ERRFILE=.deps/${!#}.err > > # Execute program; save stderr; display stderr; return true/false > exit code. > { $* 2> $ERRFILE && cat $ERRFILE >&2; } || { cat $ERRFILE >&2; false; > } > > else > > $* > > fi > > This wrapper script is specific to Bash, but it would be possible to > write one for any shell that can redirect stderr, or even write a > compiled program. > > Then you will always have the last warnings available for each C file and > can run (e.g.) > > cat src/*/.deps/*.err > > to see them. > > > [ > My previous attempt was no good. I wrote: >> >> 2. Save the error output for each C file as (e.g.) ".deps/*.err". E.g. >> in each Makefile.in: > ... >> + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< 2> .deps/$(*F).err > ... > > But if the compilation fails, 'make' will quit before displaying the > error output file. That's no good. It needs to be done within a single > command. What I really need is one of these: > > gcc 2| tee file.err# No: stderr->pipe not available AFAIK, > and exit status is lost. > gcc 2> file.err 2> /dev/con# No: in Bash the first output file has > nothing written to it. > gcc 2>(tee file.err) # No, though Bash can _almost_ do this > on _some_ systems. > gcc 2> file.err || { cat file.err; false; } # This might just about > work! > > ... but I don't know if I can get automake to put stuff like this in the > generated make files. > ] > > > - Julian > > ___ > Flightgear-devel mailing list > [EMAIL PROTECTED] > http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
I now have a practical solution for saving the compiler warnings: a wrapper script replacement for the compiler. rm config.cache # Otherwise it keeps the previous values of CC and CXX. GCCFLAGS="-Wall -pedantic -Wpointer-arith" CC="saveoutp gcc" CXX="saveoutp c++" CFLAGS="$GCCFLAGS" CXXFLAGS="$GCCFLAGS" ./configure where ~/bin/saveoutp contains: #!/bin/bash # Run a program, also capturing stderr to a file. # # Usage: saveoutp ... # # Treat the argument list as a shell command. Run the command, displaying # stderr but also capturing it into a file named ".deps/.err". # (Bug: the command's exit status is reduced to just true or false.) if [ -d .deps ] ; then # Make name of error file from last positional argument. ERRFILE=.deps/${!#}.err # Execute program; save stderr; display stderr; return true/false exit code. { $* 2> $ERRFILE && cat $ERRFILE >&2; } || { cat $ERRFILE >&2; false; } else $* fi This wrapper script is specific to Bash, but it would be possible to write one for any shell that can redirect stderr, or even write a compiled program. Then you will always have the last warnings available for each C file and can run (e.g.) cat src/*/.deps/*.err to see them. [ My previous attempt was no good. I wrote: > > 2. Save the error output for each C file as (e.g.) ".deps/*.err". E.g. in each >Makefile.in: ... > + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< 2> .deps/$(*F).err ... But if the compilation fails, 'make' will quit before displaying the error output file. That's no good. It needs to be done within a single command. What I really need is one of these: gcc 2| tee file.err# No: stderr->pipe not available AFAIK, and exit status is lost. gcc 2> file.err 2> /dev/con# No: in Bash the first output file has nothing written to it. gcc 2>(tee file.err) # No, though Bash can _almost_ do this on _some_ systems. gcc 2> file.err || { cat file.err; false; } # This might just about work! ... but I don't know if I can get automake to put stuff like this in the generated make files. ] - Julian ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
On Tuesday, June 25, 2002, at 03:46 AM, James Turner wrote: > > On Tuesday, June 25, 2002, at 01:31 am, Andy Ross wrote: > >> Jonathan Polley wrote: >>> I cannot redirect stderr via 'command 2> file' on my Mac, so the easy >>> solution was out. I did find that the following command works: >> >> Rubbish. Sure you can. You just have to run a real shell. :) >> >> Seriously, I'd be shocked beyond measure if bash didn't build and >> install just fine on OS X. Use it, it's vastly better than csh. >> > Actually, it's even easier. Install Fink, and select the bash package. Oh, > and change your shell selection from 'csh' to /sw/bin/bash in > Terminal.app 's preferences. The idea that anyone doing development under > OS-X would *not* have Fink installed doesn't bear thinking about :-) I think this should be added to the OS X build instructions. I have some updated instructions that I got from Dave McMahon, which is an updated version of Darrell's instructions. I can update the appropriate README if anyone is interested. > > [note for non-mac people: Fink is a Unix ports tree for OS-X, which uses > apt / dselect as the packaging and distribution system] I don't think any open source development can take place without fink. > Goodbye csh! > I'll miss ya! > Rumor has it that Apple desperately wants to switch to bash as the > default shell for 10.2, it seems very few people out there enjoy using > csh :-) > > > > ___ > Flightgear-devel mailing list > [EMAIL PROTECTED] > http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
On Tuesday, June 25, 2002, at 01:31 am, Andy Ross wrote: > Jonathan Polley wrote: >> I cannot redirect stderr via 'command 2> file' on my Mac, so the easy >> solution was out. I did find that the following command works: > > Rubbish. Sure you can. You just have to run a real shell. :) > > Seriously, I'd be shocked beyond measure if bash didn't build and > install just fine on OS X. Use it, it's vastly better than csh. > Actually, it's even easier. Install Fink, and select the bash package. Oh, and change your shell selection from 'csh' to /sw/bin/bash in Terminal.app 's preferences. The idea that anyone doing development under OS-X would *not* have Fink installed doesn't bear thinking about :-) [note for non-mac people: Fink is a Unix ports tree for OS-X, which uses apt / dselect as the packaging and distribution system] Goodbye csh! Rumor has it that Apple desperately wants to switch to bash as the default shell for 10.2, it seems very few people out there enjoy using csh :-) ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
Jonathan Polley wrote: > I cannot redirect stderr via 'command 2> file' on my Mac, so the easy > solution was out. I did find that the following command works: Rubbish. Sure you can. You just have to run a real shell. :) Basically, this is a long-standing misfeature of csh, which never existed in the original bourne shell and which happily has never been emulated. There is no syntax for redirecting stderr any differently from stdout. Bill Joy apparently never needed it, and no one else (over 20 years!) ever bothered to add it. I have no idea -- none whatsoever -- why Unix vendors insist on shipping this dinosaur as the default shell when there are *so* many better options available as free software. I guess Apple decided not to buck the trend and try to fix the command line they were trying so hard to hide. :) Seriously, I'd be shocked beyond measure if bash didn't build and install just fine on OS X. Use it, it's vastly better than csh. Andy -- Andrew J. RossNextBus Information Systems Senior Software Engineer Emeryville, CA [EMAIL PROTECTED] http://www.nextbus.com "Men go crazy in conflagrations. They only get better one by one." - Sting (misquoted) ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Capturing warnings
I cannot redirect stderr via 'command 2> file' on my Mac, so the easy solution was out. I did find that the following command works: (make > /dev/null) >& make.txt The reason for this can be found at: http://www.faqs.org/faqs/unix-faq/faq/part2/section-9.html I don't know if this will work on bash or other shells, but it might be worth a try. Jonathan Polley On Monday, June 24, 2002, at 06:27 PM, Julian Foad wrote: > Making all in Main > c++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src > -I/usr/local/include -DPKGLIBDIR=\"/usr/local/lib/FlightGear\" -g -O1 > -finline-limit-6 -finline-functions -Wall -pedantic -Wpointer-arith -c > main.cxx > main.cxx: In function `void fgUpdateTimeDepCalcs()': > main.cxx:766: warning: unused variable `int i' > main.cxx: In function `void fgLoadDCS()': > main.cxx:1742: warning: unused variable `class ssgVertexArray * lights' > main.cxx:1746: warning: `int light_type' might be used uninitialized in > this function > > ... and there are many others in other files. > > I have realised that in order for warnings to be useful, it is no good > for them just to scroll past and then be lost until after the next "make > clean". At work, I capture the compiler output for each file and then > display all the warnings and errors at the end of the build. Not just > those from the files that were compiled during the last run of "make", > but for all source files. I don't want to force everyone to see the > warnings if they don't want to, but I think we should provide a set-up > that makes it easy to do so. > > Three things are needed: > > 1. Enable warnings. e.g. > > GCCFLAGS="-g -O1 -Wall -pedantic -Wpointer-arith" > CFLAGS="$GCCFLAGS" CXXFLAGS="$GCCFLAGS" ./configure > > 2. Save the error output for each C file as (e.g.) ".deps/*.err". E.g. > in each Makefile.in: > > %.o: %.cxx > @echo '$(CXXCOMPILE) -c $<'; \ > - $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< 2> .deps/$(*F).err > + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< 2> .deps/$(*F).err > @-cp .deps/$(*F).pp .deps/$(*F).P; \ > tr ' ' '\012' < .deps/$(*F).pp \ > | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' > \ >>> .deps/$(*F).P; \ > - rm .deps/$(*F).pp > + rm .deps/$(*F).pp; \ > + cat .deps/$(*F).err > > 3. Display the results (when?). e.g. > > find . -type d -name .deps -exec cat {}/*.err \; > > So, can anyone suggest good ways of doing each of these steps, especially > step 2: how do I get that change into every Makefile.in, or what would be > a better way? > > - Julian > > ___ > Flightgear-devel mailing list > [EMAIL PROTECTED] > http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Capturing warnings
Making all in Main c++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src -I/usr/local/include -DPKGLIBDIR=\"/usr/local/lib/FlightGear\" -g -O1 -finline-limit-6 -finline-functions -Wall -pedantic -Wpointer-arith -c main.cxx main.cxx: In function `void fgUpdateTimeDepCalcs()': main.cxx:766: warning: unused variable `int i' main.cxx: In function `void fgLoadDCS()': main.cxx:1742: warning: unused variable `class ssgVertexArray * lights' main.cxx:1746: warning: `int light_type' might be used uninitialized in this function ... and there are many others in other files. I have realised that in order for warnings to be useful, it is no good for them just to scroll past and then be lost until after the next "make clean". At work, I capture the compiler output for each file and then display all the warnings and errors at the end of the build. Not just those from the files that were compiled during the last run of "make", but for all source files. I don't want to force everyone to see the warnings if they don't want to, but I think we should provide a set-up that makes it easy to do so. Three things are needed: 1. Enable warnings. e.g. GCCFLAGS="-g -O1 -Wall -pedantic -Wpointer-arith" CFLAGS="$GCCFLAGS" CXXFLAGS="$GCCFLAGS" ./configure 2. Save the error output for each C file as (e.g.) ".deps/*.err". E.g. in each Makefile.in: %.o: %.cxx @echo '$(CXXCOMPILE) -c $<'; \ - $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< 2> .deps/$(*F).err + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< 2> .deps/$(*F).err @-cp .deps/$(*F).pp .deps/$(*F).P; \ tr ' ' '\012' < .deps/$(*F).pp \ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ >> .deps/$(*F).P; \ - rm .deps/$(*F).pp + rm .deps/$(*F).pp; \ + cat .deps/$(*F).err 3. Display the results (when?). e.g. find . -type d -name .deps -exec cat {}/*.err \; So, can anyone suggest good ways of doing each of these steps, especially step 2: how do I get that change into every Makefile.in, or what would be a better way? - Julian ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel