Ticket #1322: fix-kfreebsd-ftbfs-v3.patch

File fix-kfreebsd-ftbfs-v3.patch, 6.3 KB (added by Vincent Cheng, 12 years ago)
  • build/premake/premake4.lua

    Description: Fix FTBFS on Debian GNU/kFreeBSD
     Add defined(__FreeBSD_kernel__) for every instance of a FreeBSD preprocessor
     directive in order to detect kfreebsd, and avoid linking with execinfo on
     kfreebsd.
    Forwarded: http://trac.wildfiregames.com/ticket/1322
    Author: Vincent Cheng <Vincentc1208@gmail.com>
    Last-Update: 2012-04-26
    
    a b  
    781781        elseif os.is("bsd") then
    782782            links {
    783783                -- Needed for backtrace* on FreeBSD
    784                 "execinfo",
     784                -- "execinfo",
    785785            }
    786786        end
    787787
     
    11831183        elseif os.is("bsd") then
    11841184            links {
    11851185                -- Needed for backtrace* on FreeBSD
    1186                 "execinfo",
     1186                -- "execinfo",
    11871187            }
    11881188        end
    11891189
  • build/premake/premake4/src/host/premake.h

    a b  
    1515#if defined(__linux__)
    1616#define PLATFORM_LINUX    (1)
    1717#define PLATFORM_STRING   "linux"
    18 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
     18#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
    1919#define PLATFORM_BSD      (1)
    2020#define PLATFORM_STRING   "bsd"
    2121#elif defined(__APPLE__) && defined(__MACH__)
  • source/lib/sysdep/os.h

    a b  
    6666# define OS_MACOSX 0
    6767#endif
    6868// BSD
    69 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
     69#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
    7070# define OS_BSD 1
    7171#else
    7272# define OS_BSD 0
  • libraries/fcollada/src/FCollada/FUtils/FUCriticalSection.h

    a b  
    3333#elif defined (__APPLE__)
    3434    //Do something here.
    3535    MPCriticalRegionID criticalSection;
    36 #elif defined (LINUX) || defined(__FreeBSD__)
     36#elif defined (LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
    3737#else
    3838#warning "FUCriticalSection: Critical section not implemented for other platforms."
    3939#endif
  • libraries/fcollada/src/FCollada/FUtils/Platforms.h

    a b  
    7474#include <wchar.h>
    7575#include <stdint.h>
    7676#else // __APPLE__
    77 #if defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__)
     77#if defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
    7878#include <ctype.h>
    7979#include <wctype.h>
    8080#include <unistd.h>
     
    127127#endif // PLATFORMS
    128128
    129129// Important functions that some OSes have missing!
    130 #if defined(__APPLE__) || defined (LINUX) || defined (__FreeBSD__)
     130#if defined(__APPLE__) || defined (LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
    131131inline char* strlower(char* str) { char* it = str; while (*it != 0) { *it = tolower(*it); ++it; } return str; }
    132132inline wchar_t* wcslwr(wchar_t* str) { wchar_t* it = str; while (*it != 0) { *it = towlower(*it); ++it; } return str; }
    133133inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2 = *s2; while (c1 != 0 && c2 != 0) { if (c1 >= 'a' && c1 <= 'z') c1 -= 'a' + 'A'; if (c2 >= 'a' && c2 <= 'z') c2 -= 'a' + 'A'; if (c2 < c1) return -1; else if (c2 > c1) return 1; c1 = *(++s1); c2 = *(++s2); } return 0; }
  • libraries/fcollada/include/FUtils/FUCriticalSection.h

    a b  
    3333#elif defined (__APPLE__)
    3434    //Do something here.
    3535    MPCriticalRegionID criticalSection;
    36 #elif defined (LINUX) || defined(__FreeBSD__)
     36#elif defined (LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
    3737#else
    3838#warning "FUCriticalSection: Critical section not implemented for other platforms."
    3939#endif
  • libraries/fcollada/include/FUtils/Platforms.h

    a b  
    7474#include <wchar.h>
    7575#include <stdint.h>
    7676#else // __APPLE__
    77 #if defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__)
     77#if defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
    7878#include <ctype.h>
    7979#include <wctype.h>
    8080#include <unistd.h>
     
    127127#endif // PLATFORMS
    128128
    129129// Important functions that some OSes have missing!
    130 #if defined(__APPLE__) || defined (LINUX) || defined (__FreeBSD__)
     130#if defined(__APPLE__) || defined (LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
    131131inline char* strlower(char* str) { char* it = str; while (*it != 0) { *it = tolower(*it); ++it; } return str; }
    132132inline wchar_t* wcslwr(wchar_t* str) { wchar_t* it = str; while (*it != 0) { *it = towlower(*it); ++it; } return str; }
    133133inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2 = *s2; while (c1 != 0 && c2 != 0) { if (c1 >= 'a' && c1 <= 'z') c1 -= 'a' + 'A'; if (c2 >= 'a' && c2 <= 'z') c2 -= 'a' + 'A'; if (c2 < c1) return -1; else if (c2 > c1) return 1; c1 = *(++s1); c2 = *(++s2); } return 0; }
  • libraries/fcollada/src/FCollada/FCDocument/FCDocument.h

    a b  
    3030#if defined(WIN32)
    3131template <class T> class FCOLLADA_EXPORT FCDLibrary; /**< Trick Doxygen. */
    3232template <class T> class FCOLLADA_EXPORT FUUniqueStringMapT; /**< Trick Doxygen. */
    33 #elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__)
     33#elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
    3434template <class T> class FCDLibrary; /**< Trick Doxygen. */
    3535template <class T> class FUUniqueStringMapT; /**< Trick Doxygen. */
    3636#endif // LINUX
  • libraries/fcollada/include/FCDocument/FCDocument.h

    a b  
    3030#if defined(WIN32)
    3131template <class T> class FCOLLADA_EXPORT FCDLibrary; /**< Trick Doxygen. */
    3232template <class T> class FCOLLADA_EXPORT FUUniqueStringMapT; /**< Trick Doxygen. */
    33 #elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__)
     33#elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
    3434template <class T> class FCDLibrary; /**< Trick Doxygen. */
    3535template <class T> class FUUniqueStringMapT; /**< Trick Doxygen. */
    3636#endif // LINUX
  • source/third_party/mongoose/mongoose.cpp

    a b  
    3737
    3838#undef DEBUG
    3939
    40 #if defined(__FreeBSD__)
     40#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
    4141// Fix undefined PF_INET on FreeBSD
    4242#include <sys/socket.h>
    4343#endif