Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compiling in Linux
#1
Well, I have started down the road of being a GNU Geek. I have Redhat 8.0 installed on a dual boot computer with Win2000. I am getting the feel of the KDE GUI and thought I was ready to play with the C++ compiler to get kermit's and my changes onto GRITS servers, thought being the operative word.

Here is the short version. Apparently to compile any half-life, an old version of the GCC compiler is required. I have found and d/l and now need to install. Next I will start trying to compile the Makefile but from talking to other coders on the HLCoder email list it will not be easy. I have yet to hear from anyone who has actually done it...not to say they aren't out there, they obviously are but it will not be a quick an easy process.

Just wanted to keep everyone up on what I was doing. Other than any server/admin fires, this is my number one focus.

desNotes
#2
hmm. If you want, provide me with the links to what you have used, and I will see how bad it actually is... I am interested in this as I want to make sure that the script I've done will actually compile before I send it over... and I wouldn't mind locally testing it first.:)
#3
Here is what Valve says about compiling in Linux:

HL SDK 2.3

Linux compile notes
-------------------

The source code distributed with the HL SDK contains two
portions that may be compiled under Linux: the game DLL and the
server launcher. The game DLL code is located in the dlls/
directory and the server launcher code is located in the
dedicated/ directory. A Makefile has been provided for each of
these.

One issue that needs to be addressed before compiling under Linux
is DOS style carriage return (^M) characters. DOS (and hence
MS Windows) text files contain this carriage return character at
the end of every line, in addition to the standard linefeed
character. Most compilers, preprocessors, and make utilities that
are used under Linux are confused by these characters, emitting
strange warning and error messages when compiling is attempted.
The solution is to remove these characters from all source,
header, and makefile files. One way to do this is to use an FTP
utility to transfer each source, header, and makefile file
individually in ASCII transfer mode (as opposed to binary mode,
which is often the default) to the Linux development machine.
Another way of removing these unwanted characters is using an
application designed specifically to remove them. Many people
have written programs to do this. A simple search on any major
Internet search site (such as http://www.google.com) for
'dos2unix' or other related keywords should turn up useful
information about obtaining one of these programs.

The other area of concern when compiling under Linux is the
compiler itself. The Half-Life source code seems to be
problematic for many compiler versions. The recommended compiler
to use is EGCS 1.1.2, or a GCC version based on EGCS 1.1.2 (if
using gcc, try 'gcc -v' to see version information). Newer and/or
older versions of GCC/EGCS (or other compilers) may or may not
work. If problems are encountered with another compiler version,
the EGCS 1.1.2 compiler can be found on the GCC project's FTP
server, or on any of its mirrors. A mirror list can be found at
http://gcc.gnu.org/mirrors.html. EGCS 1.1.2 will be located in an
'old-releases' section on any mirror site.
#4
:heartbeat::wub::heartbeat:
#5
Keep on talkin Evil....I'm gettin hot now...:P
#6
Not nice to pick on the Queen.:P
#7
who's pickin on j00?? Shop talk gives me............
#8
That's quite useful, thanks pix..:)
#9
You should be welcome...I just saved my post from being edited.:P
#10
you ever saw the movie "airplane". anyways, i'm going to paraphrase leslie nielson and say the following regarding the urgent need to compile a working server .dll in linux:

"i just wanted to let you guys know...good luck and that we are all counting on you" ^_^

anytime you get frustrated w/ the whole thing...remember that!
#11
"A HOSPITAL...what is it doctor???? "

"It's a big building with lots of patients, but that's not important right now."

One of my favorite movies. OJ was a great actor in it....he wasn't even killing anybody.
#12
Smoking or non-smoking?
#13
Ok I am getting ready to split this topic to "off topic"

I wanna see some real answers here please
#14
Ok, seriously, I am going to have to check disk space usage, etc, as I only have a 1GB hard drive... so I don't get to install all the necesities of KDE, etc. Now, though, I'm wondering if that is actually a requirement... gonna read up on all the SDK stuff tonight.
#15
TuxPortal is an interseting website, and Slack ( [email protected] ) has a few things to say about compiling, most of which are repeated from all the readme's actually, but I think I might fire an email off and see if I can get any other info about what's going on.

I did notice, however, that he said he had to go back to an older compiler under Slackware after upgrading from 7.1 and as I have 9... then I guess that means I'll have to too...

Out of interest evil, what happens when you do gcc -v?
#16
I will have to give you the details when I get home but when I did that the version is much higher than the readme's are saying to use.

Since I am such a newbie at this I am having trouble just installing the older
version of the gcc compiler.
#17
Have you tried to edit the code manually with Notepad and NO NO NO DON'T use wordpad. Word pad will put in those carrage returns, notepad wont. Can you not physically edit these flaws and then upload in ASCII mode using ftp client. Can you not do the editing ON the linux box using Pico or vi. I always prefer to do my edits and Makefile fine tuning right on the box. I guess the key is you have a windows based SDK and you are making all changes through that. Then you are uploading the source to the linux box for compiling. Do they make a SDK for linux?? Lemme check something. BRB.

I'm putting this on to our development engineers here to see wut they think also. We'll get a brotha hooked up G. lol


I was told that the dos2unix program is what you need. plain and simple.
#18
Nooooo... simply upload all the source files to your server in ASCII mode. Provided that is done, the extra ^m characters are stripped automatically. Now, as for editing on windows a file that's on there, I'd suggest textpad since it can do color coding, etc.

And if you need a *cough* key *cough* let me know....:)
#19
Oh, I forgot to mention that Textpad will recognise UNIX style formatting (ie, without the ^m characters). FTP in ascii mode is the way to go. I'm firing up Slackware now... give me an hour and I'll see what I've got onto the box.:)
#20
Ok, I would have, but even to get something simple on my system seems to require half a dozen stuff I didn't bother, so I have a feeling I am going to have to reinstall, which means in turn that it won't be tonight nor tomorrow.... :/

I really do need to see if I can find a larger HD too...
#21
Steps I took on Windows:
[*]Downloaded SDK and installed to C:\HalfLife\SDK
[*]Uploaded the Multiplayer Sources to Slackware 9 using FTP in ASCII mode (I use LeechFTP)

Steps I took on Slackware 9:
[*]Downloaded egcs-1.1.2.tar.gz
[*]unpackaged using: tar -zvxf egcs-1.1.2.tar.gz
[*]configured using: ./configure
[*]compiled using: make

My next step was to:
[*]get dressed as it was 9:30
[*]head to work as it's now past 9:30 :-D
[*]long to do more as I was getting somewhere
#22
Did you get:

Code:
/root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO indstream.cc
indstream.cc: In method `struct streampos indirectbuf::seekoff(streamoff, enum _seek_dir, int = 3)':
indstream.cc:82: `struct streampos' used where a `int' was expected
indstream.cc:85: `struct streampos' used where a `int' was expected
indstream.cc:87: `struct streampos' used where a `int' was expected
indstream.cc:89: conversion from `int' to non-scalar type `streampos' requested
indstream.cc: In method `struct streampos indirectbuf::seekpos(struct streampos, int = 3)':
indstream.cc:99: `struct streampos' used where a `int' was expected
indstream.cc:102: `struct streampos' used where a `int' was expected
indstream.cc:104: `struct streampos' used where a `int' was expected
indstream.cc:106: conversion from `int' to non-scalar type `streampos' requested
make[1]: *** [indstream.o] Error 1
make[1]: Leaving directory `/root/egcs-1.1.2/i586-pc-linux-gnubio'
make: *** [all-target-libio] Error 2
#23
Having done a bit of a google search on the above errors, I found that Tim Price had something to say about this... though I think he overlooked that some software requires it for legacy's sake.... tried that.. gonne check on it shortly to see how it got on.
#24
Code:
make[2]: Entering directory `/root/egcs-1.1.2/i586-pc-linux-gnubio'
if [ x"no" = xyes ] && [ ! -d pic ]; then \
 mkdir pic; \
else true; fi
touch stamp-picdir
test x"no" != xyes ||\
 /root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -I. -I. -D_IO_MTSAFE_IO  iogetline.c -o pic/iogetline.o
/root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -I. -I. -D_IO_MTSAFE_IO iogetline.c
rm -rf libio.a
ar rc libio.a iogetline.o
ranlib libio.a
test x"no" != xyes || \
 /root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO  builtinbuf.cc -o pic/builtinbuf.o
/root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO builtinbuf.cc
test x"no" != xyes || \
 /root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO  filebuf.cc -o pic/filebuf.o
/root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO filebuf.cc
test x"no" != xyes || \
 /root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO  fstream.cc -o pic/fstream.o
/root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO fstream.cc
test x"no" != xyes || \
 /root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO  indstream.cc -o pic/indstream.o
/root/egcs-1.1.2/gcc/xgcc -B/root/egcs-1.1.2/gcc/ -c -g -O2 -fvtable-thunks -D_GNU_SOURCE -fno-implicit-templates -I. -I. -nostdinc++ -D_IO_MTSAFE_IO indstream.cc
indstream.cc: In method `struct streampos indirectbuf::seekoff(streamoff, enum _seek_dir, int = 3)':
indstream.cc:82: `struct streampos' used where a `int' was expected
indstream.cc:85: `struct streampos' used where a `int' was expected
indstream.cc:87: `struct streampos' used where a `int' was expected
indstream.cc:89: conversion from `int' to non-scalar type `streampos' requested
indstream.cc: In method `struct streampos indirectbuf::seekpos(struct streampos, int = 3)':
indstream.cc:99: `struct streampos' used where a `int' was expected
indstream.cc:102: `struct streampos' used where a `int' was expected
indstream.cc:104: `struct streampos' used where a `int' was expected
indstream.cc:106: conversion from `int' to non-scalar type `streampos' requested
make[2]: *** [indstream.o] Error 1
make[2]: Leaving directory `/root/egcs-1.1.2/i586-pc-linux-gnubio'
make[1]: *** [all-target-libio] Error 2
make[1]: Leaving directory `/root/egcs-1.1.2'
make: *** [bootstrap-lean] Error 2

Still seems to be a problem with libio... Time to read the documentation in full me thinks.
#25
found some useful Configuration and Build FAQ's that are under the INSTALL directory. Reading the specific configuration page, it suggests that for NeXT's OS, you should be doing:
[*]cd objdir
[*]make all-texinfo all-bison all-byacc all-binutils all-gas all-ld
[*]cd gcc
[*]make bootstrap
[*]make install-headers-tar
[*]cd ..
[*]make bootstrap3

The same *might* be true for backwards compatibility... testing now.
#26
And guess what.......
#27
FASTER......FASTER NetIV......work faster !!!!;)
#28
Whose this NetIV guy? A fourth incarnation of me? Anyway, it didn't work :/
#29
sorry old chap....i just type faster than i think. Comes with the age ya know. ;)
#30
I know, I'm getting there, sometimes words and even whole sentences disappear and I haven't a clue what I did with them...


Forum Jump:


Users browsing this thread: 3 Guest(s)