IPB Style© Fisana

Jump to content


Working On Upgrade To Premake4


  • Please log in to reply
108 replies to this topic

#61 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,924 posts)

Posted 19 July 2011 - 06:20 AM

I'm exploring the xcode support (on 10.6.6 OS X). Interesting notes so far:

  • It won't compile with PCH enabled because there's a relative path issue - it can't find precompiled.h so the build fails
  • Running update-workspaces-new.sh using the --without-pch option allows the build to continue
  • source/lib/sysdep/arch/x86_64/topology.cpp fails to compile due to std::bitset not being defined. So I included <bitset> instead of <set> and it compiled, hopefully this works on other platforms?
  • There's a lot of annoying Boost warnings like these, but which don't seem to affect the build:

    /opt/local/include/boost/mpl/has_xxx.hpp:344:0 /opt/local/include/boost/mpl/has_xxx.hpp:344:9: warning: "BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION" is not defined
    /opt/local/include/boost/mpl/has_xxx.hpp:357:0 /opt/local/include/boost/mpl/has_xxx.hpp:357:9: warning: "BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES" is not defined
    /opt/local/include/boost/mpl/has_xxx.hpp:386:0 /opt/local/include/boost/mpl/has_xxx.hpp:386:9: warning: "BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION" is not defined
    /opt/local/include/boost/mpl/has_xxx.hpp:459:0 /opt/local/include/boost/mpl/has_xxx.hpp:459:8: warning: "BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE" is not defined
    /opt/local/include/boost/detail/container_fwd.hpp:71:0 /opt/local/include/boost/detail/container_fwd.hpp:71:9: warning: "BOOST_CLANG" is not defined
  • Next I ran into a few problems:
    • I get a fatal error from nasm about unrecognized output format 'macho64', which is strange but led me to this ticket (I'm running the 64-bit kernel)

      PhaseScriptExecution ../../../source/lib/sysdep/arch/amd64/amd64_asm.asm
      cd /Users/ben/0ad/build/workspaces/xcode3
      setenv ACTION build
      setenv ALTERNATE_GROUP staff
      setenv ALTERNATE_MODE u+w,go-w,a+rX
      setenv ALTERNATE_OWNER ben
      setenv ALWAYS_SEARCH_USER_PATHS NO
      setenv APPLE_INTERNAL_DEVELOPER_DIR /AppleInternal/Developer
      setenv APPLE_INTERNAL_DIR /AppleInternal
      setenv APPLE_INTERNAL_DOCUMENTATION_DIR /AppleInternal/Documentation
      setenv APPLE_INTERNAL_LIBRARY_DIR /AppleInternal/Library
      setenv APPLE_INTERNAL_TOOLS /AppleInternal/Developer/Tools
      setenv APPLY_RULES_IN_COPY_FILES NO
      setenv ARCHS x86_64
      setenv ARCHS_STANDARD_32_64_BIT "x86_64 i386"
      setenv ARCHS_STANDARD_32_BIT i386
      setenv ARCHS_STANDARD_64_BIT x86_64
      setenv BUILD_COMPONENTS "headers build"
      setenv BUILD_DIR /Users/ben/0ad/build/workspaces/xcode3/../../../binaries/system
      setenv BUILD_ROOT /Users/ben/0ad/build/workspaces/xcode3/../../../binaries/system
      setenv BUILD_STYLE Release
      setenv BUILD_VARIANTS normal
      setenv BUILT_PRODUCTS_DIR ../../../binaries/system
      setenv CACHE_ROOT /var/folders/Zm/ZmwMaQ8yEtKxnaAD0zWSBE+++TI/-Caches-/com.apple.Xcode.501
      setenv CCHROOT /var/folders/Zm/ZmwMaQ8yEtKxnaAD0zWSBE+++TI/-Caches-/com.apple.Xcode.501
      setenv CHMOD /bin/chmod
      setenv CHOWN /usr/sbin/chown
      setenv CLASS_FILE_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/JavaClasses
      setenv CLEAN_PRECOMPS YES
      setenv CLONE_HEADERS NO
      setenv CODESIGNING_FOLDER_PATH ../../../binaries/system/liblowlevel.a
      setenv CODE_SIGNING_ALLOWED NO
      setenv COMPOSITE_SDK_DIRS /var/folders/Zm/ZmwMaQ8yEtKxnaAD0zWSBE+++TI/-Caches-/com.apple.Xcode.501/CompositeSDKs
      setenv CONFIGURATION Release
      setenv CONFIGURATION_BUILD_DIR ../../../binaries/system
      setenv CONFIGURATION_TEMP_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release
      setenv COPYING_PRESERVES_HFS_DATA NO
      setenv COPY_PHASE_STRIP NO
      setenv COPY_RESOURCES_FROM_STATIC_FRAMEWORKS YES
      setenv CP /bin/cp
      setenv CURRENT_ARCH x86_64
      setenv CURRENT_VARIANT normal
      setenv DEAD_CODE_STRIPPING NO
      setenv DEBUGGING_SYMBOLS YES
      setenv DEBUG_INFORMATION_FORMAT dwarf
      setenv DEPLOYMENT_LOCATION NO
      setenv DEPLOYMENT_POSTPROCESSING NO
      setenv DERIVED_FILES_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/DerivedSources
      setenv DERIVED_FILE_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/DerivedSources
      setenv DERIVED_SOURCES_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/DerivedSources
      setenv DEVELOPER_APPLICATIONS_DIR /Developer/Applications
      setenv DEVELOPER_BIN_DIR /Developer/usr/bin
      setenv DEVELOPER_DIR /Developer
      setenv DEVELOPER_FRAMEWORKS_DIR /Developer/Library/Frameworks
      setenv DEVELOPER_FRAMEWORKS_DIR_QUOTED "\"/Developer/Library/Frameworks\""
      setenv DEVELOPER_LIBRARY_DIR /Developer/Library
      setenv DEVELOPER_SDK_DIR /Developer/SDKs
      setenv DEVELOPER_TOOLS_DIR /Developer/Tools
      setenv DEVELOPER_USR_DIR /Developer/usr
      setenv DEVELOPMENT_LANGUAGE English
      setenv DO_HEADER_SCANNING_IN_JAM NO
      setenv DSTROOT /tmp/lowlevel.dst
      setenv DWARF_DSYM_FILE_NAME liblowlevel.a.dSYM
      setenv DWARF_DSYM_FOLDER_PATH ../../../binaries/system
      setenv ENABLE_HEADER_DEPENDENCIES YES
      setenv ENABLE_OPENMP_SUPPORT NO
      setenv EXCLUDED_INSTALLSRC_SUBDIRECTORY_PATTERNS ".svn .git CVS"
      setenv EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES "*.nib *.lproj *.framework *.gch (*) CVS .svn .git *.xcodeproj *.xcode *.pbproj *.pbxproj"
      setenv EXECUTABLE_EXTENSION a
      setenv EXECUTABLE_NAME liblowlevel.a
      setenv EXECUTABLE_PATH liblowlevel.a
      setenv EXECUTABLE_PREFIX lib
      setenv EXECUTABLE_SUFFIX .a
      setenv FILE_LIST /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/Objects/LinkFileList
      setenv FIXED_FILES_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/FixedFiles
      setenv FRAMEWORK_FLAG_PREFIX -framework
      setenv FRAMEWORK_SEARCH_PATHS "\"../../../binaries/system\" "
      setenv FRAMEWORK_VERSION A
      setenv FULL_PRODUCT_NAME liblowlevel.a
      setenv GCC3_VERSION 3.3
      setenv GCC_C_LANGUAGE_STANDARD gnu99
      setenv GCC_DYNAMIC_NO_PIC NO
      setenv GCC_ENABLE_SYMBOL_SEPARATION NO
      setenv GCC_MODEL_TUNING G5
      setenv GCC_OPTIMIZATION_LEVEL 3
      setenv GCC_PFE_FILE_C_DIALECTS "c objective-c c++ objective-c++"
      setenv GCC_PREPROCESSOR_DEFINITIONS "NDEBUG CONFIG_FINAL=1 LIB_STATIC_LINK"
      setenv GCC_SYMBOLS_PRIVATE_EXTERN NO
      setenv GCC_TREAT_WARNINGS_AS_ERRORS NO
      setenv GCC_VERSION 4.2
      setenv GCC_VERSION_IDENTIFIER __2
      setenv GCC_WARN_ABOUT_RETURN_TYPE YES
      setenv GCC_WARN_UNUSED_VARIABLE YES
      setenv GENERATE_MASTER_OBJECT_FILE NO
      setenv GENERATE_PKGINFO_FILE NO
      setenv GENERATE_PROFILING_CODE NO
      setenv GID 20
      setenv GROUP staff
      setenv HEADERMAP_INCLUDES_FLAT_ENTRIES_FOR_TARGET_BEING_BUILT YES
      setenv HEADERMAP_INCLUDES_FRAMEWORK_ENTRIES_FOR_ALL_PRODUCT_TYPES YES
      setenv HEADERMAP_INCLUDES_NONPUBLIC_NONPRIVATE_HEADERS YES
      setenv HEADERMAP_INCLUDES_PROJECT_HEADERS YES
      setenv HEADER_SEARCH_PATHS "\"../../../binaries/system/include\" /usr/X11R6/include/X11 /usr/X11R6/include /usr/include/X11 ../../../source/pch/lowlevel ../../../source ../../../libraries/valgrind/include ../../../libraries/cxxtest/include /opt/local/include"
      setenv ICONV /usr/bin/iconv
      setenv INFOPLIST_EXPAND_BUILD_SETTINGS YES
      setenv INFOPLIST_OUTPUT_FORMAT same-as-input
      setenv INFOPLIST_PREPROCESS NO
      setenv INPUT_FILE_BASE amd64_asm
      setenv INPUT_FILE_DIR /Users/ben/0ad/build/workspaces/xcode3/../../../source/lib/sysdep/arch/amd64
      setenv INPUT_FILE_NAME amd64_asm.asm
      setenv INPUT_FILE_PATH /Users/ben/0ad/build/workspaces/xcode3/../../../source/lib/sysdep/arch/amd64/amd64_asm.asm
      setenv INPUT_FILE_REGION_PATH_COMPONENT
      setenv INPUT_FILE_SUFFIX .asm
      setenv INSTALL_DIR /tmp/lowlevel.dst/usr/local/lib
      setenv INSTALL_GROUP staff
      setenv INSTALL_MODE_FLAG u+w,go-w,a+rX
      setenv INSTALL_OWNER ben
      setenv INSTALL_PATH /usr/local/lib
      setenv INSTALL_ROOT /tmp/lowlevel.dst
      setenv JAVAC_DEFAULT_FLAGS "-J-Xms64m -J-XX:NewSize=4M -J-Dfile.encoding=UTF8"
      setenv JAVA_APP_STUB /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub
      setenv JAVA_ARCHIVE_CLASSES YES
      setenv JAVA_ARCHIVE_TYPE JAR
      setenv JAVA_COMPILER /usr/bin/javac
      setenv JAVA_FRAMEWORK_RESOURCES_DIRS Resources
      setenv JAVA_JAR_FLAGS cv
      setenv JAVA_SOURCE_SUBDIR .
      setenv JAVA_USE_DEPENDENCIES YES
      setenv JAVA_ZIP_FLAGS -urg
      setenv JIKES_DEFAULT_FLAGS "+E +OLDCSO"
      setenv KEEP_PRIVATE_EXTERNS NO
      setenv LD_GENERATE_MAP_FILE NO
      setenv LD_MAP_FILE_PATH /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/lowlevel-LinkMap-normal-x86_64.txt
      setenv LD_OPENMP_FLAGS -fopenmp
      setenv LEX /Developer/usr/bin/lex
      setenv LIBRARY_FLAG_NOSPACE YES
      setenv LIBRARY_FLAG_PREFIX -l
      setenv LIBRARY_SEARCH_PATHS "\"../../../binaries/system\" ../../../binaries/system /usr/X11R6/lib /opt/local/lib"
      setenv LINKER_DISPLAYS_MANGLED_NAMES NO
      setenv LINK_FILE_LIST_normal_x86_64 /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/Objects-normal/x86_64/lowlevel.LinkFileList
      setenv LINK_WITH_STANDARD_LIBRARIES YES
      setenv LOCAL_ADMIN_APPS_DIR /Applications/Utilities
      setenv LOCAL_APPS_DIR /Applications
      setenv LOCAL_DEVELOPER_DIR /Library/Developer
      setenv LOCAL_LIBRARY_DIR /Library
      setenv MACH_O_TYPE staticlib
      setenv MAC_OS_X_PRODUCT_BUILD_VERSION 10J567
      setenv MAC_OS_X_VERSION_ACTUAL 1066
      setenv MAC_OS_X_VERSION_MAJOR 1060
      setenv MAC_OS_X_VERSION_MINOR 0606
      setenv NATIVE_ARCH i386
      setenv NATIVE_ARCH_32_BIT i386
      setenv NATIVE_ARCH_64_BIT x86_64
      setenv NATIVE_ARCH_ACTUAL x86_64
      setenv NO_COMMON YES
      setenv OBJECT_FILE_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/Objects
      setenv OBJECT_FILE_DIR_normal /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/Objects-normal
      setenv OBJROOT /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release
      setenv ONLY_ACTIVE_ARCH NO
      setenv OPTIMIZATION_LEVEL 0
      setenv OS MACOS
      setenv OSAC /usr/bin/osacompile
      setenv OTHER_CFLAGS "-Wno-switch -Wno-reorder -Wno-invalid-offsetof -Wextra -Wno-missing-field-initializers -Wunused-parameter -Wredundant-decls -Wnon-virtual-dtor -Wundef -fstack-protector-all -D_FORTIFY_SOURCE=2 -fstrict-aliasing -fpch-preprocess -msse -fno-omit-frame-pointer -msse2 -fvisibility=hidden -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE"
      setenv OTHER_CPLUSPLUSFLAGS "-Wno-switch -Wno-reorder -Wno-invalid-offsetof -Wextra -Wno-missing-field-initializers -Wunused-parameter -Wredundant-decls -Wnon-virtual-dtor -Wundef -fstack-protector-all -D_FORTIFY_SOURCE=2 -fstrict-aliasing -fpch-preprocess -msse -fno-omit-frame-pointer -msse2 -fvisibility=hidden -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE"
      setenv OTHER_INPUT_FILE_FLAGS
      setenv PACKAGE_TYPE com.apple.package-type.static-library
      setenv PASCAL_STRINGS YES
      setenv PATH_PREFIXES_EXCLUDED_FROM_HEADER_DEPENDENCIES "/usr/include /usr/local/include /System/Library/Frameworks /System/Library/PrivateFrameworks /Developer/Headers /Developer/SDKs /Developer/Platforms"
      setenv PFE_FILE_C_DIALECTS c++
      setenv PKGINFO_FILE_PATH /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/PkgInfo
      setenv PLATFORM_DEVELOPER_APPLICATIONS_DIR /Developer/Applications
      setenv PLATFORM_DEVELOPER_BIN_DIR /Developer/usr/bin
      setenv PLATFORM_DEVELOPER_LIBRARY_DIR /Developer/Library
      setenv PLATFORM_DEVELOPER_SDK_DIR /Developer/SDKs
      setenv PLATFORM_DEVELOPER_TOOLS_DIR /Developer/Tools
      setenv PLATFORM_DEVELOPER_USR_DIR /Developer/usr
      setenv PLATFORM_NAME macosx
      setenv PLATFORM_PRODUCT_BUILD_VERSION 10M2518
      setenv PLIST_FILE_OUTPUT_FORMAT same-as-input
      setenv PREBINDING NO
      setenv PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR YES
      setenv PRECOMP_DESTINATION_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/PrefixHeaders
      setenv PRESERVE_DEAD_CODE_INITS_AND_TERMS NO
      setenv PRIVATE_HEADERS_FOLDER_PATH /usr/local/include
      setenv PRODUCT_NAME lowlevel
      setenv PRODUCT_SETTINGS_PATH
      setenv PRODUCT_TYPE com.apple.product-type.library.static
      setenv PROFILING_CODE NO
      setenv PROJECT lowlevel
      setenv PROJECT_DERIVED_FILE_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/DerivedSources
      setenv PROJECT_DIR /Users/ben/0ad/build/workspaces/xcode3
      setenv PROJECT_FILE_PATH /Users/ben/0ad/build/workspaces/xcode3/lowlevel.xcodeproj
      setenv PROJECT_NAME lowlevel
      setenv PROJECT_TEMP_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build
      setenv PUBLIC_HEADERS_FOLDER_PATH /usr/local/include
      setenv RECURSIVE_SEARCH_PATHS_FOLLOW_SYMLINKS YES
      setenv REMOVE_CVS_FROM_RESOURCES YES
      setenv REMOVE_GIT_FROM_RESOURCES YES
      setenv REMOVE_SVN_FROM_RESOURCES YES
      setenv REZ_COLLECTOR_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/ResourceManagerResources
      setenv REZ_EXECUTABLE YES
      setenv REZ_OBJECTS_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/ResourceManagerResources/Objects
      setenv REZ_SEARCH_PATHS "\"../../../binaries/system\" "
      setenv RUN_CLANG_STATIC_ANALYZER NO
      setenv SCAN_ALL_SOURCE_FILES_FOR_INCLUDES NO
      setenv SCRIPT_INPUT_FILE /Users/ben/0ad/build/workspaces/xcode3/../../../source/lib/sysdep/arch/amd64/amd64_asm.asm
      setenv SCRIPT_OUTPUT_FILE_0 /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/DerivedSources/amd64_asm.o
      setenv SCRIPT_OUTPUT_FILE_COUNT 1
      setenv SDKROOT
      setenv SDK_PRODUCT_BUILD_VERSION 10J567
      setenv SED /usr/bin/sed
      setenv SEPARATE_STRIP YES
      setenv SEPARATE_SYMBOL_EDIT NO
      setenv SET_DIR_MODE_OWNER_GROUP YES
      setenv SET_FILE_MODE_OWNER_GROUP NO
      setenv SHARED_DERIVED_FILE_DIR ../../../binaries/system/DerivedSources
      setenv SHARED_PRECOMPS_DIR /var/folders/Zm/ZmwMaQ8yEtKxnaAD0zWSBE+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders
      setenv SKIP_INSTALL NO
      setenv SOURCE_ROOT /Users/ben/0ad/build/workspaces/xcode3
      setenv SRCROOT /Users/ben/0ad/build/workspaces/xcode3
      setenv STANDARD_C_PLUS_PLUS_LIBRARY_TYPE dynamic
      setenv STRINGS_FILE_OUTPUT_ENCODING UTF-16
      setenv STRIP_INSTALLED_PRODUCT YES
      setenv STRIP_STYLE debugging
      setenv SYMBOL_REPOSITORY_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build/SymbolRepositories
      setenv SYMROOT /Users/ben/0ad/build/workspaces/xcode3/../../../binaries/system
      setenv SYSTEM_ADMIN_APPS_DIR /Applications/Utilities
      setenv SYSTEM_APPS_DIR /Applications
      setenv SYSTEM_CORE_SERVICES_DIR /System/Library/CoreServices
      setenv SYSTEM_DEMOS_DIR /Applications/Extras
      setenv SYSTEM_DEVELOPER_APPS_DIR /Developer/Applications
      setenv SYSTEM_DEVELOPER_BIN_DIR /Developer/usr/bin
      setenv SYSTEM_DEVELOPER_DEMOS_DIR "/Developer/Applications/Utilities/Built Examples"
      setenv SYSTEM_DEVELOPER_DIR /Developer
      setenv SYSTEM_DEVELOPER_DOC_DIR "/Developer/ADC Reference Library"
      setenv SYSTEM_DEVELOPER_GRAPHICS_TOOLS_DIR "/Developer/Applications/Graphics Tools"
      setenv SYSTEM_DEVELOPER_JAVA_TOOLS_DIR "/Developer/Applications/Java Tools"
      setenv SYSTEM_DEVELOPER_PERFORMANCE_TOOLS_DIR "/Developer/Applications/Performance Tools"
      setenv SYSTEM_DEVELOPER_RELEASENOTES_DIR "/Developer/ADC Reference Library/releasenotes"
      setenv SYSTEM_DEVELOPER_TOOLS /Developer/Tools
      setenv SYSTEM_DEVELOPER_TOOLS_DOC_DIR "/Developer/ADC Reference Library/documentation/DeveloperTools"
      setenv SYSTEM_DEVELOPER_TOOLS_RELEASENOTES_DIR "/Developer/ADC Reference Library/releasenotes/DeveloperTools"
      setenv SYSTEM_DEVELOPER_USR_DIR /Developer/usr
      setenv SYSTEM_DEVELOPER_UTILITIES_DIR /Developer/Applications/Utilities
      setenv SYSTEM_DOCUMENTATION_DIR /Library/Documentation
      setenv SYSTEM_LIBRARY_DIR /System/Library
      setenv TARGETNAME lowlevel
      setenv TARGET_BUILD_DIR ../../../binaries/system
      setenv TARGET_NAME lowlevel
      setenv TARGET_TEMP_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build
      setenv TEMP_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build
      setenv TEMP_FILES_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build
      setenv TEMP_FILE_DIR /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release/lowlevel.build
      setenv TEMP_ROOT /Users/ben/0ad/build/workspaces/xcode3/obj/lowlevel_Release
      setenv UID 501
      setenv UNSTRIPPED_PRODUCT NO
      setenv USER ben
      setenv USER_APPS_DIR /Users/ben/Applications
      setenv USER_LIBRARY_DIR /Users/ben/Library
      setenv USE_DYNAMIC_NO_PIC YES
      setenv USE_HEADERMAP YES
      setenv USE_HEADER_SYMLINKS NO
      setenv VALIDATE_PRODUCT NO
      setenv VALID_ARCHS "i386 ppc ppc64 ppc7400 ppc970 x86_64"
      setenv VERBOSE_PBXCP NO
      setenv VERSION_INFO_BUILDER ben
      setenv VERSION_INFO_FILE lowlevel_vers.c
      setenv VERSION_INFO_STRING "\"@(#)PROGRAM:lowlevel  PROJECT:lowlevel-\""
      setenv WARNING_CFLAGS -Wall
      setenv XCODE_APP_SUPPORT_DIR /Developer/Library/Xcode
      setenv XCODE_PRODUCT_BUILD_VERSION 10M2518
      setenv XCODE_VERSION_ACTUAL 0400
      setenv XCODE_VERSION_MAJOR 0400
      setenv XCODE_VERSION_MINOR 0400
      setenv YACC /Developer/usr/bin/yacc
      /bin/sh -c "nasm -D OS_UNIX=1 -i${INPUT_FILE_DIR}/ -f macho64 ${INPUT_FILE_PATH} -o ${DERIVED_FILES_DIR}/${INPUT_FILE_BASE}.o"
      
      nasm: fatal: unrecognised output format `macho64' - use -hf for a list
      type `nasm -h' for help
      Command /bin/sh failed with exit code 1
    • I tried upgrading nasm through MacPorts but already have the latest port (2.09.09)
    • In the process I upgraded all outdated ports. Boost was upgraded from @1.46.1_0 to @1.47.0_0 but this seems to have broken the build badly (many errors about random::rand48 being re-declared), so I had to revert back to 1.46. Safe to say, 1.47 should not be used until that's fixed. If you upgrade by accident, try "sudo port activate boost @1.46.1_0" or install it as needed.
  • And finally a linker error due to the above error in liblowlevel (but why would the build process continue?)

    Ld ../../../binaries/system/pyrogenesis.app/Contents/MacOS/pyrogenesis normal x86_64
    cd /Users/ben/0ad/build/workspaces/xcode3
    /Developer/usr/bin/g++-4.2 -arch x86_64 -L../../../binaries/system -L../../../binaries/system -L/usr/X11R6/lib -L../../../libraries/spidermonkey/lib -L../../../libraries/cxxtest/lib -L../../../libraries/enet/lib -L../../../libraries/valgrind/lib -L../../../libraries/nvtt/lib -L/opt/local/lib -F../../../binaries/system -filelist /Users/ben/0ad/build/workspaces/xcode3/obj/pyrogenesis_Release/pyrogenesis.build/Objects-normal/x86_64/pyrogenesis.LinkFileList -ljpeg -lpng -lz -lmozjs185-ps-release -lvorbisfile -lboost_signals-mt -lboost_filesystem-mt -lboost_system-mt -lenet -lcurl -lnvcore -lnvmath -lnvimage -lnvtt -lpthread -framework OpenGL -L/opt/local/lib -lSDLmain -lSDL -framework Cocoa -L/opt/local/lib -lxml2 -framework OpenAL /Users/ben/0ad/binaries/system/libmocks_real.a /Users/ben/0ad/binaries/system/libnetwork.a /Users/ben/0ad/binaries/system/libsimulation2.a /Users/ben/0ad/binaries/system/libscriptinterface.a /Users/ben/0ad/binaries/system/libengine.a /Users/ben/0ad/binaries/system/libgraphics.a /Users/ben/0ad/binaries/system/libatlas.a /Users/ben/0ad/binaries/system/libgui.a /Users/ben/0ad/binaries/system/liblowlevel.a -o ../../../binaries/system/pyrogenesis.app/Contents/MacOS/pyrogenesis
    
    i686-apple-darwin10-g++-4.2.1: /Users/ben/0ad/binaries/system/liblowlevel.a: No such file or directory
    Command /Developer/usr/bin/g++-4.2 failed with exit code 1

Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#62 janwas

janwas

  • 0 A.D. Department Leader

  • Primus Pilus
    (2,733 posts)

Posted 19 July 2011 - 06:56 AM

Quote

source/lib/sysdep/arch/x86_64/topology.cpp fails to compile due to std::bitset not being defined. So I included <bitset> instead of <set> and it compiled, hopefully
hm, Philip had already fixed this one by adding <bitset>.
I think <set> is no longer needed (there's certainly no std::set in there), so replacing <set> should be fine.
Unfortunately I can't help with the nasm problem, except to indicate that we're really close to stomping out the last of the asm.

I've been discussing this with Philip and the best guess at something GCC-palatable is:
#define __cpuid(level, index, a, b, c, d)                      \
  __asm__ ("cpuid\n\t"                                  \
           : "=a" (a), "=b" (B), "=c" ©, "=d" (d)     \
           : "0" (level), "2" (index))

This would be inserted into static void cpuid #if !HAVE_CPUIDEX, replacing the two asm calls.
level is the initial value of regs->eax, index is regs->ecx, and a,b,c,d are the output values that are to be written to regs->eax,ebx etc.
Would you like to give that a try?
If that compiles despite GCC -fPIC, then we're golden.
Jan Wassenberg [aka janwas]

Wildfire Games General Programming lead and code monkey
Contact me: jan@wildfiregames.com

#63 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,924 posts)

Posted 19 July 2011 - 07:13 AM

Well this is funny, I ran nasm manually on the command line and then tried building again and it succeeded (using the environment vars from the above error message). I wonder if there's something it doesn't like about the format of that string, maybe extra whitespace somewhere? Or more likely something in the environment that breaks it but what...

View Postjanwas, on 19 July 2011 - 06:56 AM, said:

hm, Philip had already fixed this one by adding <bitset>.
I think <set> is no longer needed (there's certainly no std::set in there), so replacing <set> should be fine.
Ah you're right, but somehow that wasn't updated even though I have the latest revision O.o

Quote

Unfortunately I can't help with the nasm problem, except to indicate that we're really close to stomping out the last of the asm.

I've been discussing this with Philip and the best guess at something GCC-palatable is:
#define __cpuid(level, index, a, b, c, d)                      \
  __asm__ ("cpuid\n\t"                                  \
           : "=a" (a), "=b" (B), "=c" ©, "=d" (d)     \
           : "0" (level), "2" (index))

This would be inserted into static void cpuid #if !HAVE_CPUIDEX, replacing the two asm calls.
level is the initial value of regs->eax, index is regs->ecx, and a,b,c,d are the output values that are to be written to regs->eax,ebx etc.
Would you like to give that a try?
If that compiles despite GCC -fPIC, then we're golden.
Umm I'll need a while to digest this, but sure I'll try it :P
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#64 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,924 posts)

Posted 19 July 2011 - 07:55 AM

Like this? If so, it did compile.

static void cpuid(x86_x64_CpuidRegs* regs)
{
#if HAVE_CPUIDEX
	cassert(sizeof(regs->eax) == sizeof(int));
	cassert(sizeof(*regs) == 4*sizeof(int));
	__cpuidex((int*)regs, regs->eax, regs->ecx);
#else
	#define __cpuid(level, index, a, b, c, d)                      \
	__asm__ ("cpuid\n\t"                                  \
			: "=a" (a), "=b" (B), "=c" ©, "=d" (d)     \
			: "0" (level), "2" (index))
#endif
}

Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#65 Yves

Yves

  • WFG Programming Team

  • Triplicarius
    (582 posts)

Posted 19 July 2011 - 11:42 AM

The nasm-problem is a known issue and should be documented in the build instructions.
XCode ships with an older version of nasm which does not support the macho64 flag.
I've solved it on my system by replacing the nasm-binary of Xcode with a symbolic link to the newer one installed via macports.
I'm not sure if that's a good solution though.

EDIT:
I can't reproduce ticket # 903.
When I change something, it rebuilds the file. Did somebody already fix it?

Ah I see, It's only when running make scriptinterface. It rebuilds properly if you just run make.

Edited by Yves, 19 July 2011 - 12:25 PM.


#66 janwas

janwas

  • 0 A.D. Department Leader

  • Primus Pilus
    (2,733 posts)

Posted 19 July 2011 - 01:31 PM

Quote

Like this? If so, it did compile.
We still need to add the actual macro invocation.
I'd suggest replacing the HAVE_CPUIDEX block with
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 150030729
// VC10+ and VC9 SP1: __cpuidex is already available
#elif GCC_VERSION
# define __cpuidex(regsArray, level, index)\
	__asm__ ("cpuid\n\t"\
	: "=a" (regsArray[0]), "=b" (regsArray[1]), "=c" (regsArray[2]), "=d" (regsArray[3])\
	: "0" (level), "2" (index))
#else
# error "compiler not supported"
#endif

Now cpuid() can just invoke __cpuidex without the need for any additional #if faff.
Does that work? :) *drumroll*
Jan Wassenberg [aka janwas]

Wildfire Games General Programming lead and code monkey
Contact me: jan@wildfiregames.com

#67 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 19 July 2011 - 03:09 PM

View Posthistoric_bruno, on 19 July 2011 - 07:55 AM, said:

Like this?
Not with the capital B and copyright symbol like that :P

View PostYves, on 19 July 2011 - 11:42 AM, said:

I can't reproduce ticket # 903.
When I change something, it rebuilds the file. Did somebody already fix it?

Ah I see, It's only when running make scriptinterface. It rebuilds properly if you just run make.
If I add a #error then run "make -k", it only recompiles (and fails for) mocks_*.cpp and status.cpp, it doesn't try rebuilding the .gch files or anything that depends on them (which it should).
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#68 Yves

Yves

  • WFG Programming Team

  • Triplicarius
    (582 posts)

Posted 19 July 2011 - 03:14 PM

View PostYkkrosh, on 19 July 2011 - 03:09 PM, said:

If I add a #error then run "make -k", it only recompiles (and fails for) mocks_*.cpp and status.cpp, it doesn't try rebuilding the .gch files or anything that depends on them (which it should).
Yes I've found the problem and I'm fixing it.

EDIT:
A patch is attached.
Please test it because I didn't have much time for tests.
It fixes ticket #903 and adds a command to clean-workspaces.sh for cleaning the premake4 environment.
For testing don't forget to run clean-workspaces.sh.

Question: Why do you even have a precompiled.cpp file? Shouldn't precompiled.h be sufficient?

Attached Files


Edited by Yves, 19 July 2011 - 04:36 PM.


#69 Yves

Yves

  • WFG Programming Team

  • Triplicarius
    (582 posts)

Posted 19 July 2011 - 07:47 PM

View Posthistoric_bruno, on 19 July 2011 - 06:20 AM, said:

I'm exploring the xcode support (on 10.6.6 OS X). Interesting notes so far:
...
  • It won't compile with PCH enabled because there's a relative path issue - it can't find precompiled.h so the build fails
...
Changing the type of pchheader from "string" to "path" in api.lua fixes the problem.
I'm wondering why premake uses "path" for pchsource and "string" for pchheader.

I'm going to integrate this change into the patch from the last post and add it as an attachment to this post.

EDIT: Done, the new patch is up.

Attached Files


Edited by Yves, 19 July 2011 - 07:56 PM.


#70 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 19 July 2011 - 08:02 PM

View PostYves, on 19 July 2011 - 03:14 PM, said:

Why do you even have a precompiled.cpp file? Shouldn't precompiled.h be sufficient?
I think precompiled.cpp is needed when compiling with MSVC (since that's what generates the PCH file), but not needed with GCC (since the PCH is generated directly from the .h), so preferably the .cpp should be ignored when using GCC.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#71 Yves

Yves

  • WFG Programming Team

  • Triplicarius
    (582 posts)

Posted 19 July 2011 - 08:07 PM

View PostYkkrosh, on 19 July 2011 - 08:02 PM, said:

I think precompiled.cpp is needed when compiling with MSVC (since that's what generates the PCH file), but not needed with GCC (since the PCH is generated directly from the .h), so preferably the .cpp should be ignored when using GCC.
Well then my patch probably won't work on Windows.
Changing pchheader from string to path also made some problems on linux. :(
It looks like there's more testing and more work required...

#72 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,924 posts)

Posted 19 July 2011 - 08:49 PM

Honestly, I find it quite a success that the game could be compiled successfully in XCode with just those two changes: build without PCH and manually run nasm!

View PostYves, on 19 July 2011 - 11:42 AM, said:

The nasm-problem is a known issue and should be documented in the build instructions.
XCode ships with an older version of nasm which does not support the macho64 flag.
I've solved it on my system by replacing the nasm-binary of Xcode with a symbolic link to the newer one installed via macports.
I'm not sure if that's a good solution though
That makes sense because the 64-bit OS X kernel is fairly new, surely they have fixed this for XCode 4? I could buy it from the App Store and see what fun awaits... I wouldn't call replacing XCode's binaries a good solution, maybe there's some setting or path variable we could override to force the newer MacPort nasm, assuming we still need it :P
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#73 Yves

Yves

  • WFG Programming Team

  • Triplicarius
    (582 posts)

Posted 19 July 2011 - 09:23 PM

View Posthistoric_bruno, on 19 July 2011 - 08:49 PM, said:

Honestly, I find it quite a success that the game could be compiled successfully in XCode with just those two changes: build without PCH and manually run nasm!
Thank you!

View Posthistoric_bruno, on 19 July 2011 - 08:49 PM, said:

I could buy it from the App Store and see what fun awaits...
Would be interesting to know. It only cost about 5$ if I remember correctly.
I would have done it if I had a "real" mac ;).


Ok I hope this is the last and successful try, version 3 of the patch.
It's quickly tested on Linux, Mac and Windows... if I wasn't too tired and made mistakes ;).
Further testing appreciated!

Attached Files



#74 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,924 posts)

Posted 19 July 2011 - 09:56 PM

View Postjanwas, on 19 July 2011 - 01:31 PM, said:

Now cpuid() can just invoke __cpuidex without the need for any additional #if faff.
Does that work? :) *drumroll*

Edit: Philip helped me with some things and it works now! :) Attaching system_info.txt to verify it does whatever it needs to do.

Attached File  system_info.txt   3.07K   48 downloads

And finally the patch for these changes:

Attached File  cpuid-patch.patch   1.35K   58 downloads
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#75 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,924 posts)

Posted 20 July 2011 - 04:07 AM

View PostYves, on 19 July 2011 - 09:23 PM, said:

Ok I hope this is the last and successful try, version 3 of the patch.
It's quickly tested on Linux, Mac and Windows... if I wasn't too tired and made mistakes ;).
Further testing appreciated!
Tested your patch on OS X, both gcc and xcode3 projects are working with PCH now :) That leaves the xcode3 test project, which fails to build:

/Users/ben/0ad/build/workspaces/xcode3/obj/test_Release/test.build/Script-9607AE1010C857E500CD1376.sh: line 58: ../../build/bin/cxxtestgen.pl: No such file or directory

Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com

#76 janwas

janwas

  • 0 A.D. Department Leader

  • Primus Pilus
    (2,733 posts)

Posted 20 July 2011 - 07:10 AM

Quote

Philip helped me with some things and it works now!
Great news, congratulations (y) and thanks, Philip, for the assist!
The patch looks good. Feel free to commit, as far as I'm concerned.

Quote

Attaching system_info.txt to verify it does whatever it needs to do.
Looks good except for the CPU frequency. Intel CPUs mention their
intended clock rate in the brand string, but it'd be nice to measure the
actual frequency (to detect over/underclocking) at runtime.
We actually have code to do that, it's just not being called.
I intend to fix that later today.
Jan Wassenberg [aka janwas]

Wildfire Games General Programming lead and code monkey
Contact me: jan@wildfiregames.com

#77 Yves

Yves

  • WFG Programming Team

  • Triplicarius
    (582 posts)

Posted 20 July 2011 - 09:00 AM

View Posthistoric_bruno, on 20 July 2011 - 04:07 AM, said:

Tested your patch on OS X, both gcc and xcode3 projects are working with PCH now :) That leaves the xcode3 test project, which fails to build:

/Users/ben/0ad/build/workspaces/xcode3/obj/test_Release/test.build/Script-9607AE1010C857E500CD1376.sh: line 58: ../../build/bin/cxxtestgen.pl: No such file or directory
Thank you for testing.
It seems to be a similar problem as the relative path issue with precompiled headers.
The directory structure was changed a little bit during the integration into svn (premake4.lua went up one level).
That seems to be the reason why we get problems with parts of the code that don't handle paths correctly.
I don't know if I have time to fix this one because I'm preparing for departure this evening. I'm going to be on holyday the next three weeks.

#78 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 20 July 2011 - 10:08 AM

View PostYves, on 20 July 2011 - 09:00 AM, said:

The directory structure was changed a little bit during the integration into svn (premake4.lua went up one level).
Yeah, I thought it was better to keep it where the old premake.lua was, and to keep the premake4/ directory a clean copy of the Premake 4 sources rather than mixing in our own files.
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#79 Ykkrosh

Ykkrosh

  • WFG Programming Team

  • Primus Pilus
    (4,869 posts)

Posted 21 July 2011 - 01:53 PM

Clang says
precompiled.h
clang: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated
which I think means it wants "-x c++-header" on the command-line when compiling the .h file. (Our old Premake PCH modifications did that.)
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#80 historic_bruno

historic_bruno

  • WFG Programming Team

  • Primus Pilus
    (1,924 posts)

Posted 21 July 2011 - 09:32 PM

OK, here's a patch (for SVN trunk) that fixes the XCode test project's shell script. VS and XCode need the same path adjustment so I combined the two.

Attached File  cxxtestgen-xcode.patch   1.85K   51 downloads
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben@wildfiregames.com




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users