Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow cross compiling #17

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

devnull42
Copy link
Contributor

I modified the mame4all-pi build scripts to allow for cross-compilation. This was needed in my case, as that I used Buildroot to construct a custom MAME system.

Caution: I have not tried these changes on Raspbian. For someone using Raspbian, please check if my changes results in a still working mame binary, prior to accepting my pull request.

The Makefile already calls gcc to link together mame, so use $(CC)
instead of $(LD) for the final link step.
Within the Makefile, mame is first linked together and then stripped. If
the strip step fails, the end result is an unstripped mame binary.
Running 'make' again will not try to re-strip it because a file named
'mame' now exists.

Modify the final steps of the build process. Place the unstripped binary
into $(OBJ), and the stripped binary into $(PWD) as before.
So as to allow mame4all-pi to be built via cross-compilation, honor the
environment variable CROSS_COMPILE as a prefix to build tools. Then to
match autotools standards, rename the variable "CPP" to "CXX". All build
tools' names can now be overridden by the calling environment.
Attempt to detect if pkg-config is installed. If so, then use SDL's pc
file for its CFLAGS and LIBS. Otherwise, default back to the hard-coded
values that were previously within the Makefile.
If pkg-config is installed, use VideoCore Shared Memory (VCSM)'s pc file
for its CFLAGS and LIBS. Otherwise, default back to the hard-coded
values that were previously within the Makefile.
If pkg-config is installed, use EGL's pc file for its CFLAGS and LIBS.
Otherwise, default back to the hard-coded values that were previously
within the Makefile.
If pkg-config is installed, use glib-2.0's pc file for its CFLAGS and
LIBS. Otherwise, default back to the hard-coded values that were
previously within the Makefile.
If pkg-config is installed, use alsa's pc file for its CFLAGS and LIBS.
Otherwise, default back to the hard-coded values that were previously
within the Makefile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant