Shell script

Max wrote:
I’m not sure if this theme has been discussed here, but I was
unable to find it in the archives. The thing is, I can’t compile any
of the programs/games that I’ve found on the SDL site. But it is not
some linker problems or anything. I just can’t run configure file
which comes with the programs: ./configure simply nothing happens.
Then I try to run autoconf, but when I run ./configure again, I get
some errors.

What OS are you using? Where did you get the source from: compressed
tar-ball or CVS?

Most people use automake now-a-days so just running autoconf won’t
work. You usually have to do something like:

acloacl -I /usr/local/share/aclocal
automake --foriegn
autoconf

Most packages include a “autogen.sh” script to do all this for you.

-- David Snopek

/-- libksd –
| The C++ Cross-Platform Game Framework
| Only want to write it once??
| http://libksd.sourceforge.net
------------

Hi!

I'm not sure if this theme has been discussed here, but I was unable to find it in the archives. The thing is, I can't compile any of the programs/games that I've found on the SDL site. But it is not some linker problems or anything. I just can't run configure file which comes with the programs: ./configure simply nothing happens. Then I try to run autoconf, but when I run ./configure again, I get some errors. I had no problems running ./configure files before, but I can't run any configuration files from the SDL sample programs. I have RedHat6.1. Could somebody help? Do I maybe have some old version of something? What? Where to get it? 

And, I’ve succeeded compiling some SDL programs by myself, byut only those consisting of only one file. So, I think SDL is set up right.

Thanks,
Max
www.vault13.cjb.net

Could you give a specific example of which programs you have tried and haven’t
worked?

Also, what version of SDL, SDL_mixer, SDL_image, etc are you using? Are you
using the RPMs for them or trying to compile them from source?On Thu, 15 Mar 2001, you wrote:

Hi!

I'm not sure if this theme has been discussed here, but I was unable to find it in the archives. The thing is, I can't compile any of the programs/games that I've found on the SDL site. But it is not some linker problems or anything. I just can't run configure file which comes with the programs: ./configure simply nothing happens. Then I try to run autoconf, but when I run ./configure again, I get some errors. I had no problems running ./configure files before, but I can't run any configuration files from the SDL sample programs. I have RedHat6.1. Could somebody help? Do I maybe have some old version of something? What? Where to get it? 

And, I’ve succeeded compiling some SDL programs by myself, byut only those consisting of only one file. So, I think SDL is set up right.


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >

What OS are you using? Where did you get the source from: compressed
tar-ball or CVS?

I’m using RH6.1, and I’ve got the source as the .tar.gz file. The problem is
that it’s not only one program/demo, but all of them.

acloacl -I /usr/local/share/aclocal
automake --foriegn
autoconf

Thanks, I’ll try.

Most packages include a “autogen.sh” script to do all this for you.

I haven’t found this one. Maybe install.sh?
And under windows(MS VC++), it’s like the code is wrong. “undefined
variable”, “cannot type cast…”, blah, blah…
Max

Could you give a specific example of which programs you have tried and
haven’t
worked?

Circus linux
lbreakout
ltris
optimum demos
water demo
all others

Also, what version of SDL, SDL_mixer, SDL_image, etc are you using? Are
you
using the RPMs for them or trying to compile them from source?

I’m using SDL 1.1.8, and SDL_mixer and SDL_image the most recent version
downloadable as .tar.gz. I’ve installed SDL and those libraries from .rpms.
But, as I’ve said, I believe it’s not the SDL setup that causes this. For
example, if I compile the fireworks demo(which consists of only fire.c)
like:
gcc fire.c -o fire sdl-config --libs, it works. But not the configure
script. Is it maybe made for some other OS(not linux), or some newer version
or…? And how to fix it? Also, I can’t compile many of the examples in VC,
for example, the function is called ‘near’, and it’s a reserved word for
near pointer, so the compiler complains. I get hundreds of such errors.

Max

Max wrote:

Could you give a specific example of which programs you have tried and
haven’t
worked?

Circus linux
lbreakout
ltris
optimum demos
water demo
all others

I know that these work with RH 6.1 because I have it running on my other
machine. The RPM thing seems sketchy though, try installing SDL from
source.

-- David Snopek

/-- libksd –
| The C++ Cross-Platform Game Framework
| Only want to write it once??
| http://libksd.sourceforge.net
------------

In my experience, almost everything works better if installed from source
on GNU/Linux systems - even when using Red Hat distros. (Might be because I
tend to stuff my systems with all the latest beta libs and drivers, rather
than Red Hat’s official rpm canned stuff. :slight_smile:

Besides, binary packages are usually available in only a few builds, so you
don’t get to tweak all config settings. The trouble that this quite
frequently causes is why I always try the source tarball first nowadays - and
it works fine most of the time. (If not, it usually indicates that I’m
falling behind with the library upgrading. :wink:

//David

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------> http://www.linuxaudiodev.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Friday 16 March 2001 04:55, David Snopek wrote:

Max wrote:

Could you give a specific example of which programs you have tried and

haven’t

worked?

Circus linux
lbreakout
ltris
optimum demos
water demo
all others

I know that these work with RH 6.1 because I have it running on my other
machine. The RPM thing seems sketchy though, try installing SDL from
source.

Actually, he was working from the source. (Earlier post)

I have had SDL and all of the mentionned apps on my system back when it was
still RH 6.1 (that’s when I began Tux Typing). I never had any troubles (and I
was using the RPM).

Perhaps the original poster should try installing an older version of SDL on
their system (RPM or otherwise) and see if they get any troubles.

(Or perhaps upgrade or switch distros ;-)On Thu, 15 Mar 2001, you wrote:

Max wrote:

Could you give a specific example of which programs you have tried and
haven’t
worked?

Circus linux
lbreakout
ltris
optimum demos
water demo
all others

I know that these work with RH 6.1 because I have it running on my other
machine. The RPM thing seems sketchy though, try installing SDL from
source.


Sam “Criswell” Hart <@Sam_Hart> AIM, Yahoo!:
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Advogato: < http://advogato.org/person/criswell/ >

Thanks to all of you, but at the end, it seems it wasn’t SDL fault at all
I’ve downloaded .tar.gz files and uncompressed them to the windows partition
using winzip. Then I’ve copied them to the linux partition, but it seems
winzip has somehow altered files, so it didn’t work. When I uncompressed
them again from .tar.gz, it worked fine.
And I’ve even reinstalled Linux!!! :frowning:
Max

Max wrote:

I’ve downloaded .tar.gz files and uncompressed them to
the windows partition using winzip. Then I’ve copied
them to the linux partition, but it seems winzip has
somehow altered files, so it didn’t work. When I
uncompressed them again from .tar.gz, it worked fine.

Welcome to the CR/LF club! I use a utility to convert the CR/LF pairs in my
ASCII files (don’t convert the binaries :slight_smile: before I reboot into Linux. GCC
seems to have no problem but shell scripts are extremely sensitive to
carriage returns.

  • Randi

Regimental Command
Generic Armored Combat System
http://regcom.sourceforge.net

Max wrote:

I’ve downloaded .tar.gz files and uncompressed them to
the windows partition using winzip. Then I’ve copied
them to the linux partition, but it seems winzip has
somehow altered files, so it didn’t work. When I
uncompressed them again from .tar.gz, it worked fine.

Welcome to the CR/LF club! I use a utility to convert the CR/LF pairs in my
ASCII files (don’t convert the binaries :slight_smile: before I reboot into Linux. GCC
seems to have no problem but shell scripts are extremely sensitive to
carriage returns.

Just a little hard won safety-tip,

Even though GCC ignores spurious carrage-returns (it treats them as white
space), GCC can still have some trouble with DOS style end-of-line
indicators. Consider the following source code:

#define SomeMacro(x) do (DoSomething(x);
DoSomethingElse(x);
) while (0)

If you don’t convert CR/LF into plain LF for Linux GCC, this gives weird
errors, because the “” line continuation character is no longer the last
character on the line (as is required for it to join lines).

If you are using a “DOS aware” editor that hides the “^M” after the slash,
then the errors can seem quite perplexing.

If you use “unzip” to unzip .zip files under Linux, you can try the "-a"
option to automatically remove the ^M from text files (but keep a keen eye
for binary files that can be [rarely] mis-identified as text).

If you use tar, then its up to you to convert the text files.

One easy way to remove carrage returns from a (single) text file under
unix:

tr --delete ‘\r’ <dosfile_in.txt >unixfile_out.txt

This can get tedious on a directory full of source code, so you can try
something like this little script (which will convert any .c or .h file in
the current directory):

------cut------
#! /bin/sh
for f in *.[ch] ;
do
mv $f orig_$f
tr -d ‘\r’ <orig_$f >$f
done
------cut------

Like byte-order (big-endian vs little-endian), the end of line character
is a little detail, that can sometimes turn out to be a big pain. :slight_smile:

Take it easy,
Xark

P.S. No doubt there are probably a few hundred other utilities that can
also do this (better) on freshmeat. :)On Sat, 17 Mar 2001, Randi J. Relander wrote:

The Debian sysutil package has the tofromdos package, which contains a
couple of very useful utilities: dos2unix and unix2dos. I use these
regularly when moving source code to/from Windows.

I’ve downloaded .tar.gz files and uncompressed them to
the windows partition using winzip. Then I’ve copied
them to the linux partition, but it seems winzip has
somehow altered files, so it didn’t work. When I
uncompressed them again from .tar.gz, it worked fine.

Welcome to the CR/LF club! I use a utility to convert the CR/LF pairs in
my
ASCII files (don’t convert the binaries :slight_smile: before I reboot into Linux.
GCC> seems to have no problem but shell scripts are extremely sensitive to
carriage returns.