I've set up my environment like so :
( from 'env' )
Code: Select all
CFLAGS=-m32 --sysroot=/home/jdb2/sysroots
CXXFLAGS=-m32 --sysroot=/home/jdb2/sysroots
where 'ls -al ~/sysroots' produces :
Code: Select all
jdb2@aleph1 ~ $ ls -al ~/sysroots
total 12
drwxr-xr-x 3 jdb2 jdb2 4096 2010-11-29 05:52 .
drwxr-xr-x 84 jdb2 jdb2 4096 2010-11-29 05:11 ..
drwxr-xr-x 2 jdb2 jdb2 4096 2010-11-29 05:52 usr
Code: Select all
jdb2@aleph1 ~ $ ls -al ~/sysroots/usr
total 8
drwxr-xr-x 2 jdb2 jdb2 4096 2010-11-29 05:52 .
drwxr-xr-x 3 jdb2 jdb2 4096 2010-11-29 05:52 ..
lrwxrwxrwx 1 jdb2 jdb2 13 2010-11-29 04:58 include -> /usr/include/
lrwxrwxrwx 1 jdb2 jdb2 11 2010-11-29 04:58 lib -> /usr/lib32/
I had to modify the configure file for a 32-bit build. Here is the patch after issuing an 'autogen.sh --prefix=/usr/local/zsnes' in the virgin source tree :
Code: Select all
--- zsnes_1_51/src/configure 2010-11-29 05:30:58.642539735 -0600
+++ /home/jdb2/zsnes_1_51/src/configure 2010-11-27 15:35:45.717888218 -0600
@@ -2128,9 +2128,9 @@
VERSION=1.51
-CFLAGS="$CFLAGS -pipe -I. -I/usr/local/include -I/usr/include"
+CFLAGS="$CFLAGS -pipe -I. -I/usr/local/include -I/usr/include"
-LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib"
+LDFLAGS="$LDFLAGS -L/usr/lib32"
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -3655,7 +3655,8 @@
no_sdl=yes
else
SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
- SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
+ SDL_LIBS="-L/usr/lib32 -lSDL"
+ #SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
Now, one would think that ZSNES would now compile, or at least configure, but it doesn't.
Issuing a './autogen.sh --prefix=/usr/local/zsnes' in the modified source tree produces the following :
Code: Select all
jdb2@aleph1 ~/zsnes_1_51/src $ ./autogen.sh --prefix=/usr/local/zsnes
Generating build information using aclocal and autoconf...
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for nasm... nasm
checking for sdl-config... /usr/bin/sdl-config
checking for SDL - version >= 1.2.0... no
*** Could not run SDL test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means SDL was incorrectly installed
*** or that you have moved SDL since it was installed. In the latter case, you
*** may want to edit the sdl-config script: /usr/bin/sdl-config
configure: error: SDL >= 1.2.0 is required
Code: Select all
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --prefix=/usr/local/zsnes
## --------- ##
## Platform. ##
## --------- ##
hostname = aleph1
uname -m = x86_64
uname -r = 2.6.32-25-generic
uname -s = Linux
uname -v = #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2162: checking build system type
configure:2176: result: x86_64-unknown-linux-gnu
configure:2196: checking host system type
configure:2209: result: x86_64-unknown-linux-gnu
configure:2229: checking target system type
configure:2242: result: x86_64-unknown-linux-gnu
configure:2282: checking for a BSD-compatible install
configure:2350: result: /usr/bin/install -c
configure:2409: checking for gcc
configure:2425: found /usr/bin/gcc
configure:2436: result: gcc
configure:2665: checking for C compiler version
configure:2674: gcc --version >&5
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2685: $? = 0
configure:2674: gcc -v >&5
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
configure:2685: $? = 0
configure:2674: gcc -V >&5
gcc: '-V' option must have argument
configure:2685: $? = 1
configure:2674: gcc -qversion >&5
gcc: unrecognized option '-qversion'
gcc: no input files
configure:2685: $? = 1
configure:2705: checking whether the C compiler works
configure:2727: gcc -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include -L/usr/lib32 conftest.c >&5
configure:2731: $? = 0
configure:2780: result: yes
configure:2783: checking for C compiler default output file name
configure:2785: result: a.out
configure:2791: checking for suffix of executables
configure:2798: gcc -o conftest -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include -L/usr/lib32 conftest.c >&5
configure:2802: $? = 0
configure:2824: result:
configure:2846: checking whether we are cross compiling
configure:2854: gcc -o conftest -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include -L/usr/lib32 conftest.c >&5
configure:2858: $? = 0
configure:2865: ./conftest
configure:2869: $? = 0
configure:2884: result: no
configure:2889: checking for suffix of object files
configure:2911: gcc -c -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include conftest.c >&5
configure:2915: $? = 0
configure:2936: result: o
configure:2940: checking whether we are using the GNU C compiler
configure:2959: gcc -c -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include conftest.c >&5
configure:2959: $? = 0
configure:2968: result: yes
configure:2977: checking whether gcc accepts -g
configure:2997: gcc -c -g conftest.c >&5
configure:2997: $? = 0
configure:3038: result: yes
configure:3055: checking for gcc option to accept ISO C89
configure:3119: gcc -c -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include conftest.c >&5
configure:3119: $? = 0
configure:3132: result: none needed
configure:3210: checking for g++
configure:3226: found /usr/bin/g++
configure:3237: result: g++
configure:3264: checking for C++ compiler version
configure:3273: g++ --version >&5
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:3284: $? = 0
configure:3273: g++ -v >&5
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
configure:3284: $? = 0
configure:3273: g++ -V >&5
g++: '-V' option must have argument
configure:3284: $? = 1
configure:3273: g++ -qversion >&5
g++: unrecognized option '-qversion'
g++: no input files
configure:3284: $? = 1
configure:3288: checking whether we are using the GNU C++ compiler
configure:3307: g++ -c -m32 --sysroot=/home/jdb2/sysroots/libroot conftest.cpp >&5
configure:3307: $? = 0
configure:3316: result: yes
configure:3325: checking whether g++ accepts -g
configure:3345: g++ -c -g conftest.cpp >&5
configure:3345: $? = 0
configure:3386: result: yes
configure:3462: checking for nasm
configure:3479: found /usr/bin/nasm
configure:3490: result: nasm
configure:3610: checking for sdl-config
configure:3628: found /usr/bin/sdl-config
configure:3641: result: /usr/bin/sdl-config
configure:3651: checking for SDL - version >= 1.2.0
configure:3739: gcc -o conftest -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include -D__UNIXSDL__ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -L/usr/lib32 conftest.c -L/usr/lib32 -lSDL >&5
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.a when searching for -lSDL
/usr/bin/ld: cannot find -lSDL
collect2: ld returned 1 exit status
configure:3739: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| #include <stdio.h>
| #include <stdlib.h>
| #include <string.h>
| #include "SDL.h"
|
| char*
| my_strdup (char *str)
| {
| char *new_str;
|
| if (str)
| {
| new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
| strcpy (new_str, str);
| }
| else
| new_str = NULL;
|
| return new_str;
| }
|
| int main (int argc, char *argv[])
| {
| int major, minor, micro;
| char *tmp_version;
|
| /* This hangs on some systems (?)
| system ("touch conf.sdltest");
| */
| { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
|
| /* HP/UX 9 (%@#!) writes to sscanf strings */
| tmp_version = my_strdup("1.2.0");
| if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
| printf("%s, bad version string\n", "1.2.0");
| exit(1);
| }
|
| if ((1 > major) ||
| ((1 == major) && (2 > minor)) ||
| ((1 == major) && (2 == minor) && (14 >= micro)))
| {
| return 0;
| }
| else
| {
| printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", 1, 2, 14);
| printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
| printf("*** best to upgrade to the required version.\n");
| printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
| printf("*** to point to the correct copy of sdl-config, and remove the file\n");
| printf("*** config.cache before re-running configure\n");
| return 1;
| }
| }
|
|
configure:3758: result: no
configure:3792: gcc -o conftest -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include -D__UNIXSDL__ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -L/usr/lib32 conftest.c -L/usr/lib32 -lSDL >&5
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.a when searching for -lSDL
/usr/bin/ld: cannot find -lSDL
collect2: ld returned 1 exit status
configure:3792: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| #include <stdio.h>
| #include "SDL.h"
|
| int main(int argc, char *argv[])
| { return 0; }
| #undef main
| #define main K_and_R_C_main
|
| int
| main ()
| {
| return 0;
| ;
| return 0;
| }
configure:3817: error: SDL >= 1.2.0 is required
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-m32 --sysroot=/home/jdb2/sysroots/libroot'
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value='-m32 --sysroot=/home/jdb2/sysroots/libroot'
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_XMKMF_set=
ac_cv_env_XMKMF_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_force_arch_set=
ac_cv_env_force_arch_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_SDL_CONFIG=/usr/bin/sdl-config
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_NASMPATH=nasm
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
ac_cv_target=x86_64-unknown-linux-gnu
## ----------------- ##
## Output variables. ##
## ----------------- ##
ARCH_INFO=''
CC='gcc'
CFLAGS='-m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include -D__UNIXSDL__'
CPP=''
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-m32 --sysroot=/home/jdb2/sysroots/libroot'
DEBUGGER_FILES=''
DEFS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GL_DRAW=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
JMA_FILES=''
LDFLAGS=' -L/usr/lib32'
LIBOBJS=''
LIBPNG_CFLAGS=''
LIBPNG_LIBS=''
LIBPNG_VERSION=''
LIBS=''
LTLIBOBJS=''
MMLIB_FILES='$(MMLIB_D)/mm.o $(MMLIB_D)/linux.o'
NASMPATH='nasm'
NFLAGS=' -w-orphan-labels -D__UNIXSDL__ -f elf -DELF'
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PSRFLAGS=' -D__UNIXSDL__'
PSR_TEMP=''
SDL_CFLAGS=''
SDL_CONFIG='/usr/bin/sdl-config'
SDL_LIBS=''
SHELL='/bin/bash'
VERSION='1.51'
XMKMF=''
ZC=''
ZCFLAGS=''
ZLIB_CFLAGS=''
ZLIB_LIBS=''
ZLIB_VERSION=''
ZSNESEXE=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
force_arch=''
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local/zsnes'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='x86_64-unknown-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux-gnu'
target_vendor='unknown'
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
configure: exit 1
Code: Select all
configure:3739: gcc -o conftest -m32 --sysroot=/home/jdb2/sysroots/libroot -pipe -I. -I/usr/local/include -I/usr/include -D__UNIXSDL__ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -L/usr/lib32 conftest.c -L/usr/lib32 -lSDL >&5
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.a when searching for -lSDL
/usr/bin/ld: cannot find -lSDL
collect2: ld returned 1 exit status
Does anyone have any ideas?
Regards,
jdb2