ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I compile a 32-bit version of SDL so that 32-bit applications will use it? The reason I want to do this is because the version in the Arch repository isn't the newest, and doesn't directly support PulseAudio. I'm hoping that this will fix some issues I'm having.
Just to be clear, I'm not compiling for another 32-bit machine, I'm compiling them to run in this one (which has multilib installed) so that 32-bit applications running on it will use the library I compiled.
You may look at AlienBobs multilib-packages for Slackware. They provide to compile packages for 32-bit machines: http://alien.slackbook.org/dokuwiki/...kware:multilib
There may be explanations which point you in the right direction.
That doesn't explain how to compile 32-bit compatibility packages, but how to use Slackware-specific tools to convert 32-bit Slackware packages into 32-bit compatibility packages for a multilib system.
I guess I could modify the 32-bit Arch packages in a similar way, but Arch works differently: it has /usr/lib and /usr/lib32, not /usr/lib64 and /usr/lib.
Also, I see that SDL is split into multiple packages, such as sdl_image, sdl_mixer, etc.. When I compile the SDL package downloaded for the SDL website, does it come with all of these? Will just running "make install" install all of them?
I see that LD_LIBRARY_PATH contains paths to 64-bit libraries, but there is nothing that says where 32-bit libraries are. How does it know where to get the libraries if I start a 32-bit application that uses shared libraries?
When I look at the Arch-Wiki https://wiki.archlinux.org/index.php...side_Arch64.3F I understand that they have a similar approach as AlienBob's multilib for Slackware. I'm not a programmer, but hopfully you'll find an answer to your question in the link.
When I look at the Arch-Wiki https://wiki.archlinux.org/index.php...side_Arch64.3F I understand that they have a similar approach as AlienBob's multilib for Slackware. I'm not a programmer, but hopfully you'll find an answer to your question in the link.
While compiling is often part of writing s/w, it can also be part of the installation process. That is the case here. I don't think Programming is the right home for this thread, especially since you are getting answers here.
...
especially since you are getting answers here.
Well, he's only got answers from me, but I'm not a programmer and did not really get the question.
And I'm not sure as well if it is a programming-question or not. Actually it is more distribution-specific, but the Arch-forum here at LQ has not that much frequency. Maybe an Arch-only forum would be a better place for this question.
pkgname=lib32-sdl
pkgver=1.2.14
pkgrel=1
arch=(x86_64)
url="http://www.libsdl.org"
source=("http://www.libsdl.org/release/SDL-${pkgver}.tar.gz")
sha1sums=(ba625b4b404589b97e92d7acd165992debe576dd)
build() {
cd "$srcdir/SDL-$pkgver"
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 ./configure --prefix=/usr
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make
make DESTDIR="$pkgdir" install
# rename /usr/lib to /usr/lib32 and delete everything else
mv "$pkgdir/usr/lib" "$pkgdir/lib32"
rm -r "$pkgdir/usr/*"
mv "$pkgdir/lib32" "$pkgdir/usr"
}
But when I run makepkg, it prints this error message and quits:
Code:
./src/video/SDL_RLEaccel.c: Assembler messages:
./src/video/SDL_RLEaccel.c:831: Error: unsupported for `movq'
./src/video/SDL_RLEaccel.c:831: Error: unsupported for `movq'
./src/video/SDL_RLEaccel.c:831: Error: unsupported for `movq'
./src/video/SDL_RLEaccel.c:831: Error: unsupported for `movq'
./src/video/SDL_RLEaccel.c:930: Error: unsupported for `movq'
./src/video/SDL_RLEaccel.c:930: Error: unsupported for `movq'
./src/video/SDL_RLEaccel.c:930: Error: unsupported for `movq'
./src/video/SDL_RLEaccel.c:930: Error: unsupported for `movq'
make: *** [build/SDL_RLEaccel.lo] Error 1
==> ERROR: A failure occurred in build().
Aborting...
How do I fix it?
And two other questions:
How do I find out the dependencies so that I can put them in the PKGBUILD?
Will the package created by this PKGBUILD be equivanent to installing just the "sdl" package, or the "sdl" package and all of the "sdl_*" (i.e. sdl_image, sdl_mixer, etc.) packages?
I've installed x86_64 with multilib. I get the same error when using your PKGBUILD, but it compiles properly when using .configure && make in the sources. I suppose you have a mistake in the CFLAGS or LDFLAGS.
it compiles properly when using .configure && make in the sources. I suppose you have a mistake in the CFLAGS or LDFLAGS.
Do you mean this:
Code:
./configure
make
or this:
Code:
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 ./configure
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 make
?
Note that if I remove all those variables from the ./configure line (but still leave them on the make line), it compiles successfully, but file says that the resulting libraries are 64-bit.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.