namco
Member
Rather than spam the boards unnecessarily I'm combining 2 posts in one.
Firstly hi (it's been a while - and I made a post on the old gp32x boards but that's pretty dead nowadays).
Secondly I wanted to show off my dev setup that I got working by cobbling pieces together and using some of my old gp2x setup.
I started with this thread: http://www.gp32x.de/board/index.php?/topic/55711-getting-cross-compiling-up-and-running-on-windows/
and I followed:
Step 1 (with the exception of installing it to C:/ and not the program files folder - this was just personal preference).
Step 2 was partially followed - mostly by editing the old gp2x makefile. I'm still using the GP2X definitions because I'm too lazy to update!
PROJECT = test
# ---
ifdef GP2X
SYSTEM = gp2x
#EXT = gpe
else
SYSTEM = win32
EXT = exe
endif
BIN = $(PROJECT).$(EXT)
OBJS = $(patsubst _src/%.cpp, build/$(SYSTEM)/%.o, $(wildcard _src/*.cpp))
CFLAGS = -Wall
LDFLAGS = -Wl,--whole-archive -Wl,--no-whole-archive -Wl,--no-undefined -g -lstdc++ -lrt -Wl,-rpath=libs -lts -lSDLmain -lSDL -mwindows
ifdef GP2X
CFLAGS += -fsigned-char -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wno-deprecated -Wno-psabi
LIBDIRS = -L"C:/pandora-sdk/lib"
INCDIRS = -I"C:/pandora-sdk/include" -I"C:/pandora-sdk/include/SDL"
CXX = C:/CodeSourcery/"Sourcery G++ Lite"/bin/arm-none-linux-gnueabi-g++.exe
STRIP = C:/CodeSourcery/"Sourcery G++ Lite"/bin/arm-none-linux-gnueabi-strip
else
LIBDIRS = -L"C:/MinGW/lib" -L"C:/SDL-1.2.13/lib" -L"C:/SDL_ttf-2.0.9/lib"
INCDIRS = -I"C:/MinGW/include" -I"C:/SDL-1.2.13/include/SDL" -I"C:/SDL_ttf-2.0.9/"
CXX = C:/MinGW/bin/g++
STRIP = C:/MinGW/bin/strip
endif
ifdef DEBUG
CFLAGS += -D_DEBUG
else
CFLAGS += -fomit-frame-pointer -O3
endif
# ---
all : $(BIN)
$(BIN): $(OBJS)
$(CXX) -o $@ $^ $(LIBDIRS) $(LDFLAGS)
ifndef DEBUG
$(STRIP) $(BIN)
endif
build/$(SYSTEM)/%.o : _src/%.cpp
$(CXX) -o $@ $< $(INCDIRS) -c $(CFLAGS)
.PHONY clean:
@rm -rfv build/$(SYSTEM)/*
@rm -fv $(BIN)
Step 3 was followed but during a test compile it whinged about not finding libc.so.6 so I opened libc.so and amended as so:
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( ./lib/libc.so.6 ./libc_nonshared.a AS_NEEDED ( ./lib/ld-linux.so.3 ) )
and added the lib folder from \20100611-i686-linux-armv7a-linux-gnueabi-toolchain-openpandora\usr\local\angstrom\arm\arm-angstrom-linux-gnueabi\lib to the pandora-sdk\lib file.
After that I think it compiled quite nicely!
Oh and btw when I set up the pnd with PNDTools and uploaded it to the menu folder on the SD card, the menu doesn't display any of the other applications. Running the .pnd via run_pnd.sh works fine though. Any suggestions?
PXML file here:
<?xml version="1.0" encoding="UTF-8"?>
<PXML xmlns="http://openpandora.org/namespaces/PXML">
<package id="parallaxscrollingtest.jamesdunn">
<author name="James Dunn"/>
<version major="1" minor="0" release="0" build="0"/>
<titles>
<title lang="en_US">Parallax Scrolling Test</title>
</titles>
<descriptions>
<description lang="en_US"></description>
</descriptions>
<icon src="./assets/icon.png"/>
</package>
<application id="parallaxscrollingtest.jamesdunn">
<exec command="./test"/>
<author name="James Dunn"/>
<version major="1" minor="0" release="0" build="0"/>
<titles>
<title lang="en_US">Parallax Scrolling Test</title>
</titles>
<descriptions>
<description lang="en_US"></description>
</descriptions>
<!--Extra block for compatibility with OS versions before HF6-->
<title lang="en_US">Parallax Scrolling Test</title>
<description lang="en_US"></description>
<!--END Extra block-->
<icon src="./assets/icon.png"/>
<licenses>
<license name="none"/>
</licenses>
<icon src="./assets/icon.png"/>
<previewpics>
<pic src="./assets/parallax1.png"/>
</previewpics>
<categories>
<category name="Game">
<subcategory name="ActionGame"/>
</category>
</categories>
</application>
<!--Created with the PXMLCreator of PNDTools v.0.7.1-->
</PXML>
[edit]: Just editing this to show the file structure for the above makefile:
|-/_src
|-/build
| |
| - /gp2x
| - /win32
|- Makefile
I hope the above is self explanatory but essentially it's:
Project Folder -> _src [folder] (the underscore needs to be there)
Project Folder -> build [folder]
Project Folder -> build -> gp2x [folder]
Project Folder -> build -> win32 [folder]
Project Folder -> Makefile
Firstly hi (it's been a while - and I made a post on the old gp32x boards but that's pretty dead nowadays).
Secondly I wanted to show off my dev setup that I got working by cobbling pieces together and using some of my old gp2x setup.
I started with this thread: http://www.gp32x.de/board/index.php?/topic/55711-getting-cross-compiling-up-and-running-on-windows/
and I followed:
Step 1 (with the exception of installing it to C:/ and not the program files folder - this was just personal preference).
Step 2 was partially followed - mostly by editing the old gp2x makefile. I'm still using the GP2X definitions because I'm too lazy to update!
PROJECT = test
# ---
ifdef GP2X
SYSTEM = gp2x
#EXT = gpe
else
SYSTEM = win32
EXT = exe
endif
BIN = $(PROJECT).$(EXT)
OBJS = $(patsubst _src/%.cpp, build/$(SYSTEM)/%.o, $(wildcard _src/*.cpp))
CFLAGS = -Wall
LDFLAGS = -Wl,--whole-archive -Wl,--no-whole-archive -Wl,--no-undefined -g -lstdc++ -lrt -Wl,-rpath=libs -lts -lSDLmain -lSDL -mwindows
ifdef GP2X
CFLAGS += -fsigned-char -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wno-deprecated -Wno-psabi
LIBDIRS = -L"C:/pandora-sdk/lib"
INCDIRS = -I"C:/pandora-sdk/include" -I"C:/pandora-sdk/include/SDL"
CXX = C:/CodeSourcery/"Sourcery G++ Lite"/bin/arm-none-linux-gnueabi-g++.exe
STRIP = C:/CodeSourcery/"Sourcery G++ Lite"/bin/arm-none-linux-gnueabi-strip
else
LIBDIRS = -L"C:/MinGW/lib" -L"C:/SDL-1.2.13/lib" -L"C:/SDL_ttf-2.0.9/lib"
INCDIRS = -I"C:/MinGW/include" -I"C:/SDL-1.2.13/include/SDL" -I"C:/SDL_ttf-2.0.9/"
CXX = C:/MinGW/bin/g++
STRIP = C:/MinGW/bin/strip
endif
ifdef DEBUG
CFLAGS += -D_DEBUG
else
CFLAGS += -fomit-frame-pointer -O3
endif
# ---
all : $(BIN)
$(BIN): $(OBJS)
$(CXX) -o $@ $^ $(LIBDIRS) $(LDFLAGS)
ifndef DEBUG
$(STRIP) $(BIN)
endif
build/$(SYSTEM)/%.o : _src/%.cpp
$(CXX) -o $@ $< $(INCDIRS) -c $(CFLAGS)
.PHONY clean:
@rm -rfv build/$(SYSTEM)/*
@rm -fv $(BIN)
Step 3 was followed but during a test compile it whinged about not finding libc.so.6 so I opened libc.so and amended as so:
/* GNU ld script
Use the shared library, but some functions are only in
the static library, so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( ./lib/libc.so.6 ./libc_nonshared.a AS_NEEDED ( ./lib/ld-linux.so.3 ) )
and added the lib folder from \20100611-i686-linux-armv7a-linux-gnueabi-toolchain-openpandora\usr\local\angstrom\arm\arm-angstrom-linux-gnueabi\lib to the pandora-sdk\lib file.
After that I think it compiled quite nicely!
Oh and btw when I set up the pnd with PNDTools and uploaded it to the menu folder on the SD card, the menu doesn't display any of the other applications. Running the .pnd via run_pnd.sh works fine though. Any suggestions?
PXML file here:
<?xml version="1.0" encoding="UTF-8"?>
<PXML xmlns="http://openpandora.org/namespaces/PXML">
<package id="parallaxscrollingtest.jamesdunn">
<author name="James Dunn"/>
<version major="1" minor="0" release="0" build="0"/>
<titles>
<title lang="en_US">Parallax Scrolling Test</title>
</titles>
<descriptions>
<description lang="en_US"></description>
</descriptions>
<icon src="./assets/icon.png"/>
</package>
<application id="parallaxscrollingtest.jamesdunn">
<exec command="./test"/>
<author name="James Dunn"/>
<version major="1" minor="0" release="0" build="0"/>
<titles>
<title lang="en_US">Parallax Scrolling Test</title>
</titles>
<descriptions>
<description lang="en_US"></description>
</descriptions>
<!--Extra block for compatibility with OS versions before HF6-->
<title lang="en_US">Parallax Scrolling Test</title>
<description lang="en_US"></description>
<!--END Extra block-->
<icon src="./assets/icon.png"/>
<licenses>
<license name="none"/>
</licenses>
<icon src="./assets/icon.png"/>
<previewpics>
<pic src="./assets/parallax1.png"/>
</previewpics>
<categories>
<category name="Game">
<subcategory name="ActionGame"/>
</category>
</categories>
</application>
<!--Created with the PXMLCreator of PNDTools v.0.7.1-->
</PXML>
[edit]: Just editing this to show the file structure for the above makefile:
|-/_src
|-/build
| |
| - /gp2x
| - /win32
|- Makefile
I hope the above is self explanatory but essentially it's:
Project Folder -> _src [folder] (the underscore needs to be there)
Project Folder -> build [folder]
Project Folder -> build -> gp2x [folder]
Project Folder -> build -> win32 [folder]
Project Folder -> Makefile
Last edited by a moderator: