blackberry / OpenTTD

OpenTTD is a cross-platform, open-source simulation game originally based on Transport Tycoon Deluxe.
17 stars 10 forks source link

Invalid recipe for lzma library build #3

Open phofman opened 12 years ago

phofman commented 12 years ago

Inside ther folder "3rdparty\lzma" one might find the README recipe, how to add liblzma to the OpenTTD project. However I have found following issues with this guide:

1) the mentioned "xz-5.0.3.tar.gz" won't unzip on Windows 7 using WinRar 4.01 nor TotalCommander 8; the "xz-5.0.3.tar.bzip2" looks much better and the "common" and "liblzma" folders are inside

2) the mentioned library won't build due to some C99 constructs used inside the source code and also sue to missing defines. At the end I was forced to manually add that switch to the qcc compiler plus some header search paths. Are you sure the .project for lzma is setup correctly? As then I ended up with some blocking errors preventing build of the final library...

MY WORKAROUND: Then my workaround was to completely remove the reference to that library from OpenTTD project (by removing the WITH_LZMA define from the compiler switches and lzma from linker library dependencies). Then it builds and runs on the device like a charm (with the "-b 32bpp-optimized -r 1024x600" of course).

jnicholl commented 12 years ago

It will change the save format and will prevent games saved with lzma encoding from being opened on playbook. Otherwise the workaround sounds fine. I'm not sure what's wrong with the lzma .project, but I'm not available to investigate at the moment. I will check it out when I get back. Thanks for letting me know.

----- Original Message ----- From: Pawel Hofman [mailto:reply@reply.github.com] Sent: Wednesday, December 28, 2011 09:08 PM To: Jeremy Nicholl Subject: [OpenTTD] Invalid recipe for lzma library build (#3)

Inside ther folder "3rdparty\lzma" one might find the README recipe, how to add liblzma to the OpenTTD project. However I have found following issues with this guide:

1) the mentioned "xz-5.0.3.tar.gz" won't unzip on Windows 7 using WinRar 4.01 nor TotalCommander 8; the "xz-5.0.3.tar.bzip2" looks much better and the "common" and "liblzma" folders are inside

2) the mentioned library won't build due to some C99 constructs used inside the source code and also sue to missing defines. At the end I was forced to manually add that switch to the qcc compiler plus some header search paths. Are you sure the .project for lzma is setup correctly? As then I ended up with some blocking errors preventing build of the final library...

MY WORKAROUND: Then my workaround was to completely remove the reference to that library from OpenTTD project (by removing the WITH_LZMA define from the compiler switches and lzma from linker library dependencies). Then it builds and runs on the device like a charm (with the "-b 32bpp-optimized -r 1024x600" of course).


Reply to this email directly or view it on GitHub: https://github.com/blackberry/OpenTTD/issues/3


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

phofman commented 12 years ago

No rush. I can wait for fix (or tip) till next year (no matter how funny it sounds :D).

cycletronic commented 12 years ago

I was able to get this running using the Native SDK v2.1 beta with the above mentioned workaround also. As jnicholl says, games saved with lzma do not load (including the "game" that is loaded for ambiance behind the opening menu).

The problem as mentioned in phofman's post #2 is related to a missing config.h file. This file can be found in the xz distribution under a "dos" folder. You can also get the config.h file to appear if you run the ./configure script inside the xz distribution (presumably it uses the dos config.h as a template and changes things depending on configure options). The problem is, I have no idea what the configure options need to be for the playbook environment. It appears that it would only change what is #define'd in the config.h file. I would be happy to make the necessary changes and commit them here, except I don't know how to determine the correct configure settings.

Is there a way to set proper environment variables so the configure script will automatically generate the correct values? I'm doing this in Ubuntu, and have no problem setting environment variables and such. I just don't know which ones to set and what values they need.

Edit: I just found this: Blackberry Native Porting Guide And I remember seeing the bbndk-env.sh script. Duh. I'll work on this more soon.

jnicholl commented 12 years ago

I've attached the config.h that I originally used. I'm not certain it has entirely correct values, but it seemed to work. I think it was actually generated from running configure on Linux and then changing a few values. Alternatively, you can look at the buildForPlaybook.sh script in SDL to see how configure could be run in a cross-compilation way on Linux for PlayBook.

-----Original Message----- From: cycletronic [mailto:reply@reply.github.com] Sent: Thursday, June 21, 2012 5:41 PM To: Jeremy Nicholl Subject: Re: [OpenTTD] Invalid recipe for lzma library build (#3)

I was able to get this running using the Native SDK v2.1 beta with the above mentioned workaround also. As jnicholl says, games saved with lzma do not load (including the "game" that is loaded for ambiance behind the opening menu).

The problem as mentioned in phofman's post #2 is related to a missing config.h file. This file can be found in the xz distribution under a "dos" folder. You can also get the config.h file to appear if you run the ./configure script inside the xz distribution (presumably it uses the dos config.h as a template and changes things depending on configure options). The problem is, I have no idea what the configure options need to be for the playbook environment. It appears that it would only change what is #define'd in the config.h file. I would be happy to make the necessary changes and commit them here, except I don't know how to determine the correct configure settings.

Is there a way to set proper environment variables so the configure script will automatically generate the correct values? I'm doing this in Ubuntu, and have no problem setting environment variables and such. I just don't know which ones to set and what values they need.


Reply to this email directly or view it on GitHub: https://github.com/blackberry/OpenTTD/issues/3#issuecomment-6495237


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

/* config.h. Generated from config.h.in by configure. / / config.h.in. Generated from configure.ac by autoheader. */

/* Define if building universal (internal helper macro) / / #undef AC_APPLE_UNIVERSAL_BUILD */

/* How many MiB of RAM to assume if the real amount cannot be determined. */

define ASSUME_RAM 1024

/* Define to 1 if translation of program messages to the user's native language is requested. / / #define ENABLE_NLS 1 */

/* Define to 1 if bswap16 is available. / /_ #define HAVE_BSWAP_16 1 */

/* Define to 1 if bswap32 is available. / /_ #define HAVE_BSWAP_32 1 */

/* Define to 1 if bswap64 is available. / /_#define HAVE_BSWAP_64 1*/

/* Define to 1 if you have the header file. / / #define HAVE_BYTESWAP_H 1 */

/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework. / / #undef HAVE_CFLOCALECOPYCURRENT */

/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework. / / #undef HAVE_CFPREFERENCESCOPYAPPVALUE */

/* Define to 1 if crc32 integrity check is enabled. */

define HAVE_CHECK_CRC32 1

/* Define to 1 if crc64 integrity check is enabled. */

define HAVE_CHECK_CRC64 1

/* Define to 1 if sha256 integrity check is enabled. */

define HAVE_CHECK_SHA256 1

/* Define if the GNU dcgettext() function is already present or preinstalled. */

define HAVE_DCGETTEXT 1

/* Define to 1 if you have the declaration of `program_invocationname', and to 0 if you don't. / /_#define HAVE_DECL_PROGRAM_INVOCATION_NAME 1*/

/* Define to 1 if arm decoder is enabled. */

define HAVE_DECODER_ARM 1

/* Define to 1 if armthumb decoder is enabled. */

define HAVE_DECODER_ARMTHUMB 1

/* Define to 1 if delta decoder is enabled. */

define HAVE_DECODER_DELTA 1

/* Define to 1 if ia64 decoder is enabled. */

define HAVE_DECODER_IA64 1

/* Define to 1 if lzma1 decoder is enabled. */

define HAVE_DECODER_LZMA1 1

/* Define to 1 if lzma2 decoder is enabled. */

define HAVE_DECODER_LZMA2 1

/* Define to 1 if powerpc decoder is enabled. */

define HAVE_DECODER_POWERPC 1

/* Define to 1 if sparc decoder is enabled. */

define HAVE_DECODER_SPARC 1

/* Define to 1 if x86 decoder is enabled. */

define HAVE_DECODER_X86 1

/* Define to 1 if you have the header file. */

define HAVE_DLFCN_H 1

/* Define to 1 if arm encoder is enabled. */

define HAVE_ENCODER_ARM 1

/* Define to 1 if armthumb encoder is enabled. */

define HAVE_ENCODER_ARMTHUMB 1

/* Define to 1 if delta encoder is enabled. */

define HAVE_ENCODER_DELTA 1

/* Define to 1 if ia64 encoder is enabled. */

define HAVE_ENCODER_IA64 1

/* Define to 1 if lzma1 encoder is enabled. */

define HAVE_ENCODER_LZMA1 1

/* Define to 1 if lzma2 encoder is enabled. */

define HAVE_ENCODER_LZMA2 1

/* Define to 1 if powerpc encoder is enabled. */

define HAVE_ENCODER_POWERPC 1

/* Define to 1 if sparc encoder is enabled. */

define HAVE_ENCODER_SPARC 1

/* Define to 1 if x86 encoder is enabled. */

define HAVE_ENCODER_X86 1

/* Define to 1 if you have the header file. */

define HAVE_FCNTL_H 1

/* Define to 1 if you have the `futimens' function. */

define HAVE_FUTIMENS 1

/* Define to 1 if you have the `futimes' function. / / #undef HAVE_FUTIMES */

/* Define to 1 if you have the `futimesat' function. / / #undef HAVE_FUTIMESAT */

/* Define to 1 if you have the header file. */

define HAVE_GETOPT_H 1

/* Define to 1 if you have the `getopt_long' function. */

define HAVE_GETOPT_LONG 1

/* Define if the GNU gettext() function is already present or preinstalled. */

define HAVE_GETTEXT 1

/* Define if you have the iconv() function. / / #undef HAVE_ICONV */

/* Define to 1 if you have the header file. */

define HAVE_INTTYPES_H 1

/* Define to 1 if you have the header file. */

define HAVE_LIMITS_H 1

/* Define to 1 if mbrtowc and mbstate_t are properly declared. */

define HAVE_MBRTOWC 1

/* Define to 1 if you have the header file. */

define HAVE_MEMORY_H 1

/* Define to 1 to enable bt2 match finder. */

define HAVE_MF_BT2 1

/* Define to 1 to enable bt3 match finder. */

define HAVE_MF_BT3 1

/* Define to 1 to enable bt4 match finder. */

define HAVE_MF_BT4 1

/* Define to 1 to enable hc3 match finder. */

define HAVE_MF_HC3 1

/* Define to 1 to enable hc4 match finder. */

define HAVE_MF_HC4 1

/* Define to 1 if getopt.h declares extern int optreset. / / #undef HAVE_OPTRESET */

/* Define if you have POSIX threads libraries and header files. */

define HAVE_PTHREAD 1

/* Define to 1 if optimizing for size. / / #undef HAVE_SMALL */

/* Define to 1 if stdbool.h conforms to C99. */

define HAVE_STDBOOL_H 1

/* Define to 1 if you have the header file. */

define HAVE_STDINT_H 1

/* Define to 1 if you have the header file. */

define HAVE_STDLIB_H 1

/* Define to 1 if you have the header file. */

define HAVE_STRINGS_H 1

/* Define to 1 if you have the header file. */

define HAVE_STRING_H 1

/* Define to 1 if st_atimensec' is a member ofstruct stat'. / / #undef HAVE_STRUCT_STAT_ST_ATIMENSEC */

/* Define to 1 if st_atimespec.tv_nsec' is a member ofstruct stat'. / / #undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC */

/* Define to 1 if st_atim.st__tim.tv_nsec' is a member ofstruct stat'. / / #undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC */

/* Define to 1 if st_atim.tv_nsec' is a member ofstruct stat'. */

define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1

/* Define to 1 if st_uatime' is a member ofstruct stat'. / / #undef HAVE_STRUCT_STAT_ST_UATIME */

/* Define to 1 if you have the <sys/byteorder.h> header file. / / #undef HAVE_SYS_BYTEORDER_H */

/* Define to 1 if you have the <sys/endian.h> header file. / / #undef HAVE_SYS_ENDIAN_H */

/* Define to 1 if you have the <sys/param.h> header file. */

define HAVE_SYS_PARAM_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */

define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/time.h> header file. */

define HAVE_SYS_TIME_H 1

/* Define to 1 if you have the <sys/types.h> header file. */

define HAVE_SYS_TYPES_H 1

/* Define to 1 if the system has the type `uintptr_t'. */

define HAVE_UINTPTR_T 1

/* Define to 1 if you have the header file. */

define HAVE_UNISTD_H 1

/* Define to 1 if you have the `utime' function. / / #undef HAVE_UTIME */

/* Define to 1 if you have the `utimes' function. / / #undef HAVE_UTIMES */

/* Define to 1 or 0, depending whether the compiler supports simple visibility declarations. */

define HAVE_VISIBILITY 1

/* Define to 1 if you have the `wcwidth' function. */

define HAVE_WCWIDTH 1

/* Define to 1 if the system has the type `_Bool'. */

define HAVE__BOOL 1

/* Define to the sub-directory in which libtool stores uninstalled libraries. */

define LT_OBJDIR ".libs/"

/* Define to 1 to disable debugging code. */

define NDEBUG 1

/* Define to 1 if your C compiler doesn't accept -c and -o together. / / #undef NO_MINUS_C_MINUS_O */

/* Name of package */

define PACKAGE "xz"

/* Define to the address where bug reports for this package should be sent. */

define PACKAGE_BUGREPORT "lasse.collin@tukaani.org"

/* Define to the full name of this package. */

define PACKAGE_NAME "XZ Utils"

/* Define to the full name and version of this package. */

define PACKAGE_STRING "XZ Utils 5.0.3"

/* Define to the one symbol short name of this package. */

define PACKAGE_TARNAME "xz"

/* Define to the home page for this package. */

define PACKAGE_URL "http://tukaani.org/xz/"

/* Define to the version of this package. */

define PACKAGE_VERSION "5.0.3"

/* Define to necessary symbol if this constant uses a non-standard name on your system. / / #undef PTHREAD_CREATE_JOINABLE */

/* The size of `size_t', as computed by sizeof. */

define SIZEOF_SIZE_T 4

/* Define to 1 if you have the ANSI C header files. */

define STDC_HEADERS 1

/* Define to 1 if the number of available CPU cores can be detected with pstatgetdynamic(). / /_ #undef TUKLIB_CPUCORES_PSTAT_GETDYNAMIC */

/* Define to 1 if the number of available CPU cores can be detected with sysconf(_SC_NPROCESSORS_ONLN) or sysconf(_SC_NPROCONLN). / /_ #define TUKLIB_CPUCORES_SYSCONF 1 */

/* Define to 1 if the number of available CPU cores can be detected with sysctl(). / / #undef TUKLIB_CPUCORES_SYSCTL */

/* Define to 1 if the system supports fast unaligned access to 16-bit and 32-bit integers. */

define TUKLIB_FAST_UNALIGNED_ACCESS 1

/* Define to 1 if the amount of physical memory can be detected with _systemconfiguration.physmem. / /_ #undef TUKLIB_PHYSMEM_AIX */

/* Define to 1 if the amount of physical memory can be detected with getinventr(). / /_ #undef TUKLIB_PHYSMEM_GETINVENT_R */

/* Define to 1 if the amount of physical memory can be detected with getsysinfo(). / / #undef TUKLIB_PHYSMEM_GETSYSINFO */

/* Define to 1 if the amount of physical memory can be detected with pstatgetstatic(). / /_ #undef TUKLIB_PHYSMEM_PSTAT_GETSTATIC */

/* Define to 1 if the amount of physical memory can be detected with sysconf(_SC_PAGESIZE) and sysconf(_SC_PHYSPAGES). / /_ #define TUKLIB_PHYSMEM_SYSCONF 1 */

/* Define to 1 if the amount of physical memory can be detected with sysctl(). / / #undef TUKLIB_PHYSMEM_SYSCTL */

/* Define to 1 if the amount of physical memory can be detected with Linux sysinfo(). / / #undef TUKLIB_PHYSMEM_SYSINFO */

/* Enable extensions on AIX 3, Interix. */

ifndef _ALL_SOURCE

define _ALL_SOURCE 1

endif

/* Enable GNU extensions on systems that have them. */

ifndef _GNU_SOURCE

define _GNU_SOURCE 1

endif

/* Enable threading extensions on Solaris. */

ifndef _POSIX_PTHREAD_SEMANTICS

define _POSIX_PTHREAD_SEMANTICS 1

endif

/* Enable extensions on HP NonStop. */

ifndef _TANDEM_SOURCE

define _TANDEM_SOURCE 1

endif

/* Enable general extensions on Solaris. */

ifndef EXTENSIONS

define EXTENSIONS 1

endif

/* Version number of package */

define VERSION "5.0.3"

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */

if defined AC_APPLE_UNIVERSAL_BUILD

if defined BIG_ENDIAN

define WORDS_BIGENDIAN 1

endif

else

ifndef WORDS_BIGENDIAN

/* # undef WORDS_BIGENDIAN */

endif

endif

/* Number of bits in a file offset, on hosts where this is settable. */

define _FILE_OFFSET_BITS 64

/* Define for large files, on AIX-style hosts. / / #undef _LARGE_FILES */

/* Define to 1 if on MINIX. / / #undef _MINIX */

/* Define to 2 if the system does not provide POSIX.1 features except with this defined. / / #undef _POSIX_1_SOURCE */

/* Define to 1 if you need to in order for `stat' and other things to work. / / #undef _POSIX_SOURCE */

/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,

, or is not used. If the typedef were allowed, the #define below would cause a syntax error. _/ /_ #undef _UINT32_T */ /\* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. _/ /_ #undef _UINT64_T */ /\* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. _/ /_ #undef _UINT8_T */ /\* Define to rpl_ if the getopt replacement functions and variables should be used. _/ /_ #undef __GETOPT_PREFIX */ /\* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. _/ /_ #undef int32_t */ /\* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. _/ /_ #undef int64_t */ /\* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. _/ /_ #undef uint16_t */ /\* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. _/ /_ #undef uint32_t */ /\* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. _/ /_ #undef uint64_t */ /\* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. _/ /_ #undef uint8_t */ /\* Define to the type of an unsigned integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. _/ /_ #undef uintptr_t */
cycletronic commented 12 years ago

I wrote a nice comment last night but I must have forgotten to click submit or something...

I actually did exactly that last night. The NDK porting guide I linked to above has a nice little section on exactly what to do to run configure scripts for a playbook environment. So I generated the config.h file, commented out #defines that led to errors (things related to using multiple cores, or tuklib), and it worked just fine.