How to compile

Games, Plugins, Utils, Tools, 3rdParty, etc...
the_moon
Einsteiger
Einsteiger
Beiträge: 223
Registriert: Samstag 25. Januar 2003, 11:18

How to compile

Beitrag von the_moon »

Hallo,

bitte entschuldigt mein sprach ich bin eben ein Auslender.

Also ich habe DBOX und ich bin Programmierer und wir machen gerade KA, daher habe ich viel Zeit frei. Deswegen wollte ich probieren ein Spielchen fuer DBox einprogrammieren.

Deswegen hab' ich ein paar Fragen an Developer.

Gibt es andere labels auser rel_1_0_0 oder es ist einzige offiziele release fon Entwicklergemeinde.

Wird es Probleme geben wenn ich mit current sources übersetzen werde die gesamte sources. Momentan ist mein solitär praktisch fertig und kompilierbar für PC variante aber nur wenn ich sources von tuxbox patch-e.

Ich frage darum, weil ich kein Linux Entwickler und ich will mir nicht das Spass verderben mit unsonstigen Kompilieren.

Kann jemand erzehlen was sollte er umkäpfen werend compilation

Danke
woglinde
Einsteiger
Einsteiger
Beiträge: 261
Registriert: Donnerstag 15. November 2001, 00:00

Beitrag von woglinde »

Hi,

I am trying it in English. Currently there are 4 label in the cdk. The release which was meant for stable releases, now
a placeholder for enigma because the dvb api 1 and dvb api3 conflict. The second is HEAD, the default label. It's mainly for all new, sometimes untested stuff. The we have 2 labels for slightly driver things they are alexw and lucgas.

If you want to programma game for the dbox I recommand to look at the games from fx2, which are located under $cdkdir/apps/tuxbox/plugins/fx2.

If you came from the windows world you have to read a lot of stuff and learn how the gcc is working.

Bye,

Woglinde
the_moon
Einsteiger
Einsteiger
Beiträge: 223
Registriert: Samstag 25. Januar 2003, 11:18

Beitrag von the_moon »

Hi,

danke fuer die hilfe.

Andere frage, ich habe sources in C++ und die sind nicht somain.c und board.c :)- Wie kann ich die sources einbeuen in makefiles fuer autoconf und so. Welchec dddddateien soll ich aendern? Ich habe zwei kandidaten gefunden. !makefile und Makefile.am aber ich bin mir nicht sicher.
Und noch was beim kompiliren starte ich ein perl script um Karten images zu erzeugen und komprimieren_ wo soll es rein?

Danke
Homar
Senior Member
Beiträge: 1278
Registriert: Mittwoch 5. September 2001, 00:00

Beitrag von Homar »

Hi the_moon,

may you write your question in english, ecause it es much better read the original text as a crippled german translation.
the_moon
Einsteiger
Einsteiger
Beiträge: 223
Registriert: Samstag 25. Januar 2003, 11:18

Beitrag von the_moon »

Sorry, but i don't very sure, that my english can be better,

i have some problems with integration of my new game (solitair game) into CDK. I'm novice in Linux world, therefore i don't know how the automake/autoconf works. i found a couple of manuals, but may be you can understand me if i say that i whant it now :) The game was written the solitair in C++ and I have mach more files and in addition, I start a perl script, which compresses card images with RLE and generates .c files with definitions it means there is a dinamic relation. The question is how can i intergate the solitair game into CDK. Can someone show me it on a simple sample.

For example I have some cpp files:

foo1.cpp
foo2.cpp
foo3.cpp

somain.c

and I have a subdir Cards with *pnm files

in order to integrate card images into project i go to the subdir and start a perl script like this

cd cards
build_c.pl >..\cards_res.c

then I jast compile and link all in a sol.so library.

There is my test Makefile by means of that I test my game on PC.

Code: Alles auswählen

#-fno-default-inline \

COMP_FLAGS=-c -fno-rtti \
-I../lib -DUSEX -D__i386__ -D_i386 \
-I./ -I../../include \
-include Hand.h




vor:: cards_res.cpp

	gcc ${COMP_FLAGS} Block.cpp -o Block.o
	gcc ${COMP_FLAGS} Buffer.cpp -o Buffer.o
	gcc ${COMP_FLAGS} Card.cpp -o Card.o
	gcc ${COMP_FLAGS} ErrorHandler.cpp -o ErrorHandler.o
	gcc ${COMP_FLAGS} Foundation.cpp -o Foundation.o
	gcc ${COMP_FLAGS} GameTable.cpp -o GameTable.o
	gcc ${COMP_FLAGS} Hand.cpp -o Hand.o
	gcc ${COMP_FLAGS} HandSlot.cpp -o HandSlot.o
	gcc ${COMP_FLAGS} Slot.cpp -o Slot.o
	gcc ${COMP_FLAGS} Table.cpp -o Table.o
	gcc ${COMP_FLAGS} TableSlot.cpp -o TableSlot.o
	gcc ${COMP_FLAGS} Tableau.cpp -o Tableau.o
	gcc ${COMP_FLAGS} Wastepile.cpp -o Wastepile.o
	gcc ${COMP_FLAGS} somain.cpp -o somain.o
	gcc ${COMP_FLAGS} cards.cpp -o cards.o
	gcc ${COMP_FLAGS} cards_res.cpp -o cards_res.o

	gcc -shared -lstdc++ -o sol.so -L/usr/X11R6/lib \
		Block.o \
		Buffer.o \
		Card.o \
		ErrorHandler.o \
		Foundation.o \
		GameTable.o \
		Hand.o \
		HandSlot.o \
		Slot.o \
		Table.o \
		TableSlot.o \
		Tableau.o \
		Wastepile.o \
		somain.o \
		cards.o \
		cards_res.o \
		../lib/draw.o \
		../lib/math.o \
		../lib/pig.o \
		../lib/rcinput.o \
		-lXt -lgcc_s #-lsupc++

cards_res.cpp::

	cd cards; perl ./build_c.pl >../cards_res.cpp; cd ..

clean::

	rm cards.h
	rm *.o
	rm sol.so
woglinde
Einsteiger
Einsteiger
Beiträge: 261
Registriert: Donnerstag 15. November 2001, 00:00

Beitrag von woglinde »

Hi,

- add in apps/tuxbox/plugins/configure.ac:

fx2/satfind/Makefile
fx2/vierg/Makefile
your-top-directoy/Makefile

- add in apps/tuxbox/plugins/Makefile.am:

SUBDIRS = \
include tuxmail tuxtxt fx2 your-top-directory

-add in apps/tuxbox/plugins/your-top-directory/Makefile.am

SUBDIRS = (for all your subdirectories)

INCLUDES = (includes if you use other the than standard)

noinst_LTLIBRARIES = yourlibname.la (dont install it the normal way)

yourlibname_la_SOURCES = board.c somain.c (the files you need for the lib)

mines_la_LDFLAGS = -rpath $(PLUGINDIR) -module -avoid-version (linker flags eg. -lXt -lgcc_s -L/usr/bla)

install-exec-local:
install -d $(PLUGINDIR)
$(LIBTOOL) install mines.la $(PLUGINDIR)
install -m 0644 $(srcdir)/mines.cfg $(PLUGINDIR)
(where we want to install it)

uninstall-local:
-rm $(PLUGINDIR)/mines.so
-rm $(PLUGINDIR)/mines.cfg
-rmdir $(PLUGINDIR)
(deinstallation stuff)

The example taken from apps/tuxbox/plugins/fx2/mines/Makefile.am
gcc ${COMP_FLAGS} HandSlot.cpp -o HandSlot.o
for c++ files better use g++ the autoconf/automake take care.

Bye for now

Woglinde
the_moon
Einsteiger
Einsteiger
Beiträge: 223
Registriert: Samstag 25. Januar 2003, 11:18

Beitrag von the_moon »

Thank you,
it was very helpfull, but now i have anoter stupid question. I tried yesterday to start "make clean" in ../cdk/ root folder. Now there is no headers of linux/.. therefore I get overall error message like "missing definition of KEY_RED, KEY_BLUE" and so on. If I start "make all" in
root cdk the sources are not generated. I think the linux sources should be patched, but how can i do it?

And may be someone know, why while compilation configure scripts search "ltconfig" script and all others in ./ folder. It means that i have to copy in all plugin folders the script.

Thanks

the_moon
the_moon
Einsteiger
Einsteiger
Beiträge: 223
Registriert: Samstag 25. Januar 2003, 11:18

Beitrag von the_moon »

Hi, it works! I compiled my game. Thanks
Homar
Senior Member
Beiträge: 1278
Registriert: Mittwoch 5. September 2001, 00:00

Beitrag von Homar »

congrats :wink:

if you want to make your game public, send your source to one of the developer-Team.

Or you can send it me directly per email or pm. I check it in the cvs.

best regards,
Homar
woglinde
Einsteiger
Einsteiger
Beiträge: 261
Registriert: Donnerstag 15. November 2001, 00:00

Beitrag von woglinde »

Hi,

grats. I hope you will now stay more with free-software.

Bye Woglinde
the_moon
Einsteiger
Einsteiger
Beiträge: 223
Registriert: Samstag 25. Januar 2003, 11:18

Beitrag von the_moon »

Thank you, Morpheus!