diff --git a/.hgignore b/.hgignore
index 4a0311dcc..1fbad60fd 100644
--- a/.hgignore
+++ b/.hgignore
@@ -144,6 +144,8 @@ external
external_stlport
3rdParty
.svn
+thumbs.db
+Thumbs.db
# build
code/nel/build/*
@@ -206,3 +208,5 @@ code/ryzom/server/src/ryzom_admin_service/ryzom_admin_service
code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service
code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service
code/ryzom/server/src/tick_service/tick_service
+# WebTT temp dir
+code/ryzom/tools/server/www/webtt/app/tmp
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index 4d429e693..b73545d14 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -91,6 +91,7 @@ NL_CONFIGURE_CHECKS()
#Platform specifics
SETUP_EXTERNAL()
+NL_GEN_REVISION_H()
IF(WIN32)
SET(WINSOCK2_LIB ws2_32.lib)
@@ -256,7 +257,7 @@ IF(WIN32)
IF(WITH_TOOLS)
SET(CMAKE_INSTALL_MFC_LIBRARIES TRUE)
ENDIF(WITH_TOOLS)
- INCLUDE(InstallRequiredSystemLibraries)
+ #INCLUDE(InstallRequiredSystemLibraries)
ENDIF(WIN32)
INCLUDE(CPack)
diff --git a/code/CMakeModules/FindDirectXSDK.cmake b/code/CMakeModules/FindDirectXSDK.cmake
index 1f832cf95..9947778db 100644
--- a/code/CMakeModules/FindDirectXSDK.cmake
+++ b/code/CMakeModules/FindDirectXSDK.cmake
@@ -14,17 +14,22 @@ FIND_PATH(DXSDK_DIR
"Include/dxsdkver.h"
PATHS
"$ENV{DXSDK_DIR}"
+ "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)"
+ "C:/Program Files/Microsoft DirectX SDK (June 2010)"
+ "C:/Program Files (x86)/Microsoft DirectX SDK (February 2010)"
+ "C:/Program Files/Microsoft DirectX SDK (February 2010)"
+ "C:/Program Files (x86)/Microsoft DirectX SDK (November 2007)"
+ "C:/Program Files/Microsoft DirectX SDK (November 2007)"
+ "C:/Program Files (x86)/Microsoft DirectX SDK"
+ "C:/Program Files/Microsoft DirectX SDK"
)
MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
PATHS
- "${DXSDK_LIBRARY_DIR}"
- "$ENV{DXSDK_DIR}"
- "$ENV{DXSDK_DIR}/Lib"
- "$ENV{DXSDK_DIR}/Lib/x86"
- )
+ "${DXSDK_LIBRARY_DIR}"
+ )
ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
IF(DXSDK_DIR)
diff --git a/code/CMakeModules/FindFreeType.cmake b/code/CMakeModules/FindFreeType.cmake
index b9d00d96a..4f3c84cbe 100644
--- a/code/CMakeModules/FindFreeType.cmake
+++ b/code/CMakeModules/FindFreeType.cmake
@@ -57,6 +57,13 @@ FIND_LIBRARY(FREETYPE_LIBRARY
IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
SET(FREETYPE_FOUND "YES")
+ IF(WITH_STATIC_EXTERNAL AND APPLE)
+ FIND_PACKAGE(BZip2)
+ IF(BZIP2_FOUND)
+ SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR})
+ SET(FREETYPE_LIBRARY ${FREETYPE_LIBRARY} ${BZIP2_LIBRARIES})
+ ENDIF(BZIP2_FOUND)
+ ENDIF(WITH_STATIC_EXTERNAL AND APPLE)
IF(NOT FREETYPE_FIND_QUIETLY)
MESSAGE(STATUS "Found FreeType: ${FREETYPE_LIBRARY}")
ENDIF(NOT FREETYPE_FIND_QUIETLY)
diff --git a/code/CMakeModules/FindGTK2.cmake b/code/CMakeModules/FindGTK2.cmake
index 7aa65e100..e3e91ed21 100644
--- a/code/CMakeModules/FindGTK2.cmake
+++ b/code/CMakeModules/FindGTK2.cmake
@@ -66,6 +66,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
/usr/lib64/glib-2.0/include
/usr/lib/glib-2.0/include
/sw/lib/glib-2.0/include
+ /usr/lib/x86_64-linux-gnu/glib-2.0/include
)
gtk2_debug_message("GTK2_GLIBCONFIG_INCLUDE_DIR is ${GTK2_GLIBCONFIG_INCLUDE_DIR}")
@@ -95,9 +96,25 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
/usr/lib/gtk-2.0/include
/usr/lib64/gtk-2.0/include
/sw/lib/gtk-2.0/include
+ /usr/lib/x86_64-linux-gnu/gtk-2.0/include
)
gtk2_debug_message("GTK2_GDK_INCLUDE_DIR is ${GTK2_GDK_INCLUDE_DIR}")
+ find_path(GTK2_GDK_PIXBUF_INCLUDE_DIR
+ NAMES
+ gdk-pixbuf/gdk-pixbuf.h
+ PATHS
+ ${_GDK2IncDir}
+ /opt/gnome/lib/gtk-2.0/include
+ /opt/gnome/lib64/gtk-2.0/include
+ /opt/lib/gtk-2.0/include
+ /usr/lib/gtk-2.0/include
+ /usr/lib64/gtk-2.0/include
+ /sw/lib/gtk-2.0/include
+ /usr/include/gdk-pixbuf-2.0
+ )
+ gtk2_debug_message("GTK2_GDK_PIXBUF_INCLUDE_DIR is ${GTK2_GDK_PIXBUF_INCLUDE_DIR}")
+
find_path(GTK2_GTKGL_INCLUDE_DIR
NAMES
gtkgl/gtkglarea.h
@@ -357,6 +374,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
${GTK2_GLIBCONFIG_INCLUDE_DIR}
${GTK2_GLIB_INCLUDE_DIR}
${GTK2_GDK_INCLUDE_DIR}
+ ${GTK2_GDK_PIXBUF_INCLUDE_DIR}
${GTK2_GLADE_INCLUDE_DIR}
${GTK2_PANGO_INCLUDE_DIR}
${GTK2_CAIRO_INCLUDE_DIR}
@@ -364,7 +382,7 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
)
if (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
- if (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
+ if (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR AND GTK2_GDK_PIXBUF_INCLUDE_DIR)
if (GTK2_GMODULE_LIBRARY)
if (GTK2_GTHREAD_LIBRARY)
if (GTK2_GOBJECT_LIBRARY)
@@ -423,9 +441,9 @@ else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
else (GTK2_GMODULE_LIBRARY)
message(SEND_ERROR "Could not find GMODULE")
endif (GTK2_GMODULE_LIBRARY)
- else (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
+ else (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR AND GTK2_GDK_PIXBUF_INCLUDE_DIR)
message(SEND_ERROR "Could not find GDK (GDK_PIXBUF)")
- endif (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
+ endif (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR AND GTK2_GDK_PIXBUF_INCLUDE_DIR)
else (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
message(SEND_ERROR "Could not find GTK2-X11")
endif (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
diff --git a/code/CMakeModules/FindMercurial.cmake b/code/CMakeModules/FindMercurial.cmake
new file mode 100644
index 000000000..9c252ad17
--- /dev/null
+++ b/code/CMakeModules/FindMercurial.cmake
@@ -0,0 +1,108 @@
+# - Extract information from a subversion working copy
+# The module defines the following variables:
+# Mercurial_HG_EXECUTABLE - path to hg command line client
+# Mercurial_VERSION_HG - version of hg command line client
+# Mercurial_FOUND - true if the command line client was found
+# MERCURIAL_FOUND - same as Mercurial_FOUND, set for compatiblity reasons
+#
+# The minimum required version of Mercurial can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Mercurial 1.4)
+#
+# If the command line client executable is found two macros are defined:
+# Mercurial_WC_INFO(
)
+# Mercurial_WC_LOG( )
+# Mercurial_WC_INFO extracts information of a subversion working copy at
+# a given location. This macro defines the following variables:
+# _WC_URL - url of the repository (at )
+# _WC_ROOT - root url of the repository
+# _WC_REVISION - current revision
+# _WC_LAST_CHANGED_AUTHOR - author of last commit
+# _WC_LAST_CHANGED_DATE - date of last commit
+# _WC_LAST_CHANGED_REV - revision of last commit
+# _WC_INFO - output of command `hg info '
+# Mercurial_WC_LOG retrieves the log message of the base revision of a
+# subversion working copy at a given location. This macro defines the
+# variable:
+# _LAST_CHANGED_LOG - last log of base revision
+# Example usage:
+# FIND_PACKAGE(Mercurial)
+# IF(MERCURIAL_FOUND)
+# Mercurial_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+# MESSAGE("Current revision is ${Project_WC_REVISION}")
+# Mercurial_WC_LOG(${PROJECT_SOURCE_DIR} Project)
+# MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
+# ENDIF(MERCURIAL_FOUND)
+
+#=============================================================================
+# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2006 Tristan Carel
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+FIND_PROGRAM(Mercurial_HG_EXECUTABLE hg
+ DOC "mercurial command line client")
+MARK_AS_ADVANCED(Mercurial_HG_EXECUTABLE)
+
+IF(Mercurial_HG_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} --version
+ OUTPUT_VARIABLE Mercurial_VERSION_HG
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ STRING(REGEX REPLACE ".*version ([\\.0-9]+).*"
+ "\\1" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}")
+
+ MACRO(Mercurial_WC_INFO dir prefix)
+ EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip
+ WORKING_DIRECTORY ${dir}
+ OUTPUT_VARIABLE ${prefix}_WC_INFO
+ ERROR_VARIABLE Mercurial_hg_info_error
+ RESULT_VARIABLE Mercurial_hg_info_result
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ IF(NOT ${Mercurial_hg_info_result} EQUAL 0)
+ MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} tip\" failed with output:\n${Mercurial_hg_info_error}")
+ ELSE(NOT ${Mercurial_hg_info_result} EQUAL 0)
+
+ STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
+ "\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?changeset: *([0-9]+).*"
+ "\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
+ "\\2" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*"
+ "\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*"
+ "\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}")
+
+ ENDIF(NOT ${Mercurial_hg_info_result} EQUAL 0)
+
+ ENDMACRO(Mercurial_WC_INFO)
+
+ MACRO(Mercurial_WC_LOG dir prefix)
+ # This macro can block if the certificate is not signed:
+ # hg ask you to accept the certificate and wait for your answer
+ # This macro requires a hg server network access (Internet most of the time)
+ # and can also be slow since it access the hg server
+ EXECUTE_PROCESS(COMMAND
+ ${Mercurial_HG_EXECUTABLE} --non-interactive log -r BASE ${dir}
+ OUTPUT_VARIABLE ${prefix}_LAST_CHANGED_LOG
+ ERROR_VARIABLE Mercurial_hg_log_error
+ RESULT_VARIABLE Mercurial_hg_log_result
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ IF(NOT ${Mercurial_hg_log_result} EQUAL 0)
+ MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} log -r BASE ${dir}\" failed with output:\n${Mercurial_hg_log_error}")
+ ENDIF(NOT ${Mercurial_hg_log_result} EQUAL 0)
+ ENDMACRO(Mercurial_WC_LOG)
+ENDIF(Mercurial_HG_EXECUTABLE)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Mercurial DEFAULT_MSG Mercurial_HG_EXECUTABLE)
diff --git a/code/CMakeModules/FindMySQL.cmake b/code/CMakeModules/FindMySQL.cmake
index b9970f63c..a00e36992 100644
--- a/code/CMakeModules/FindMySQL.cmake
+++ b/code/CMakeModules/FindMySQL.cmake
@@ -54,10 +54,14 @@ ELSE(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
IF(MYSQL_INCLUDE_DIR)
IF(MYSQL_LIBRARY_RELEASE)
- SET(MYSQL_LIBRARIES "optimized;${MYSQL_LIBRARY_RELEASE}")
+ SET(MYSQL_LIBRARIES optimized ${MYSQL_LIBRARY_RELEASE})
IF(MYSQL_LIBRARY_DEBUG)
- SET(MYSQL_LIBRARIES "${MYSQL_LIBRARIES};debug;${MYSQL_LIBRARY_DEBUG}")
+ SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} debug ${MYSQL_LIBRARY_DEBUG})
ENDIF(MYSQL_LIBRARY_DEBUG)
+ FIND_PACKAGE(OpenSSL)
+ IF(OPENSSL_FOUND)
+ SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES})
+ ENDIF(OPENSSL_FOUND)
ENDIF(MYSQL_LIBRARY_RELEASE)
ENDIF(MYSQL_INCLUDE_DIR)
diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake
new file mode 100644
index 000000000..d38215aba
--- /dev/null
+++ b/code/CMakeModules/GetRevision.cmake
@@ -0,0 +1,60 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
+
+# ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory)
+# SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt)
+
+# Replace spaces by semi-columns
+IF(CMAKE_MODULE_PATH)
+ STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
+ENDIF(CMAKE_MODULE_PATH)
+
+SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH})
+
+IF(NOT ROOT_DIR AND SOURCE_DIR)
+ SET(ROOT_DIR ${SOURCE_DIR})
+ENDIF(NOT ROOT_DIR AND SOURCE_DIR)
+
+IF(NOT SOURCE_DIR AND ROOT_DIR)
+ SET(SOURCE_DIR ${ROOT_DIR})
+ENDIF(NOT SOURCE_DIR AND ROOT_DIR)
+
+MACRO(NOW RESULT)
+ IF (WIN32)
+ EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME)
+ IF(NOT DATETIME MATCHES "ERROR")
+ STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}")
+ ENDIF(NOT DATETIME MATCHES "ERROR")
+ ELSEIF(UNIX)
+ EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME)
+ STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}")
+ ELSE (WIN32)
+ MESSAGE(SEND_ERROR "date not implemented")
+ SET(${RESULT} "0000-00-00 00:00:00")
+ ENDIF (WIN32)
+ENDMACRO(NOW)
+
+IF(EXISTS "${ROOT_DIR}/.svn/")
+ FIND_PACKAGE(Subversion)
+
+ IF(SUBVERSION_FOUND)
+ Subversion_WC_INFO(${ROOT_DIR} ER)
+ SET(REVISION ${ER_WC_REVISION})
+ ENDIF(SUBVERSION_FOUND)
+ENDIF(EXISTS "${ROOT_DIR}/.svn/")
+
+IF(EXISTS "${ROOT_DIR}/.hg/")
+ FIND_PACKAGE(Mercurial)
+
+ IF(MERCURIAL_FOUND)
+ Mercurial_WC_INFO(${ROOT_DIR} ER)
+ SET(REVISION ${ER_WC_REVISION})
+ ENDIF(MERCURIAL_FOUND)
+ENDIF(EXISTS "${ROOT_DIR}/.hg/")
+
+IF(REVISION)
+ IF(EXISTS ${SOURCE_DIR}/revision.h.in)
+ NOW(BUILD_DATE)
+ CONFIGURE_FILE(${SOURCE_DIR}/revision.h.in revision.h.txt)
+ EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy revision.h.txt revision.h) # copy_if_different
+ ENDIF(EXISTS ${SOURCE_DIR}/revision.h.in)
+ENDIF(REVISION)
diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake
index bb34aebfe..ae5b30ee2 100644
--- a/code/CMakeModules/PCHSupport.cmake
+++ b/code/CMakeModules/PCHSupport.cmake
@@ -8,44 +8,40 @@
# ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use
# ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp
-IF(CMAKE_COMPILER_IS_GNUCXX)
+IF(MSVC)
+ SET(PCHSupport_FOUND TRUE)
+ SET(_PCH_include_prefix "/I")
+ELSE(MSVC)
+ IF(CMAKE_COMPILER_IS_GNUCXX)
+ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+ ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
+ OUTPUT_VARIABLE gcc_compiler_version)
- EXEC_PROGRAM(
- ${CMAKE_CXX_COMPILER}
- ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
- OUTPUT_VARIABLE gcc_compiler_version)
-
- IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
- SET(PCHSupport_FOUND TRUE)
- ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
- IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
+ IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
- ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
- ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+ ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+ IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
+ SET(PCHSupport_FOUND TRUE)
+ ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
+ ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
+ ELSE(CMAKE_COMPILER_IS_GNUCXX)
+ # TODO: make tests for other compilers than GCC
+ SET(PCHSupport_FOUND TRUE)
+ ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET(_PCH_include_prefix "-I")
-
-ELSE(CMAKE_COMPILER_IS_GNUCXX)
-
- IF(WIN32)
- SET(PCHSupport_FOUND TRUE) # for experimental msvc support
- SET(_PCH_include_prefix "/I")
- ELSE(WIN32)
- SET(PCHSupport_FOUND FALSE)
- ENDIF(WIN32)
-
-ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+ENDIF(MSVC)
MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(${_out_compile_flags} ${${_flags_var_name}} )
- IF(CMAKE_COMPILER_IS_GNUCXX)
+ IF(NOT MSVC)
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
LIST(APPEND ${_out_compile_flags} "-fPIC")
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+ ENDIF(NOT MSVC)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
FOREACH(item ${DIRINC})
@@ -100,17 +96,13 @@ MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output)
SET(pchsupport_compiler_cxx_arg1 "")
ENDIF(CMAKE_CXX_COMPILER_ARG1)
- IF(CMAKE_COMPILER_IS_GNUCXX)
- SET(${out_command}
- ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input}
- )
- ELSE(CMAKE_COMPILER_IS_GNUCXX)
+ IF(MSVC)
_PCH_GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target})
- SET(${out_command}
- ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\"
- )
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-ENDMACRO(_PCH_GET_COMPILE_COMMAND )
+ SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\")
+ ELSE(MSVC)
+ SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x c++-header -o ${_output} -c ${_input})
+ ENDIF(MSVC)
+ENDMACRO(_PCH_GET_COMPILE_COMMAND)
MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output)
IF(MSVC)
@@ -128,7 +120,9 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
- IF(CMAKE_COMPILER_IS_GNUCXX)
+ IF(MSVC)
+ SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"")
+ ELSE(MSVC)
# to do: test whether compiler flags match between target _targetName
# and _pch_output_to_use
FILE(TO_NATIVE_PATH ${_pch_output_to_use} _native_pch_path)
@@ -137,11 +131,7 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
# on all remote machines set
# PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch")
- ELSE(CMAKE_COMPILER_IS_GNUCXX)
- IF(MSVC)
- SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"")
- ENDIF(MSVC)
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+ ENDIF(MSVC)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags})
IF(oldProps)
@@ -184,8 +174,31 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_inputh} ${_output})
ENDMACRO(ADD_PRECOMPILED_HEADER)
+# Macro to move PCH creation file to the front of files list
+MACRO(FIX_PRECOMPILED_HEADER _files _pch)
+ # Remove .cpp creating PCH from the list
+ LIST(REMOVE_ITEM ${_files} ${_pch})
+ # Prepend .cpp creating PCH to the list
+ LIST(INSERT ${_files} 0 ${_pch})
+ENDMACRO(FIX_PRECOMPILED_HEADER)
+
MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
- IF(CMAKE_GENERATOR MATCHES Visual*)
+ SET(PCH_METHOD 0)
+
+ # 0 => creating a new target for PCH, works for all makefiles
+ # 1 => setting PCH for VC++ project, works for VC++ projects
+ # 2 => setting PCH for XCode project, works for XCode projects
+ IF(CMAKE_GENERATOR MATCHES "Visual Studio")
+ SET(PCH_METHOD 1)
+ ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles" AND MFC_FOUND AND CMAKE_MFC_FLAG)
+ # To fix a bug with MFC
+ # Don't forget to use FIX_PRECOMPILED_HEADER before creating the target
+# SET(PCH_METHOD 1)
+ ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
+ SET(PCH_METHOD 2)
+ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")
+
+ IF(PCH_METHOD EQUAL 1)
# Auto include the precompile (useful for moc processing, since the use of
# precompiled is specified at the target level
# and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt)
@@ -200,26 +213,24 @@ MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
#also inlude ${oldProps} to have the same compile options
SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"")
- ELSE(CMAKE_GENERATOR MATCHES Visual*)
- IF(CMAKE_GENERATOR MATCHES Xcode)
- # For Xcode, cmake needs my patch to process
- # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
+ ELSEIF(PCH_METHOD EQUAL 2)
+ # For Xcode, cmake needs my patch to process
+ # GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
- GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
- IF(${oldProps} MATCHES NOTFOUND)
- SET(oldProps "")
- ENDIF(${oldProps} MATCHES NOTFOUND)
+ GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
+ IF(${oldProps} MATCHES NOTFOUND)
+ SET(oldProps "")
+ ENDIF(${oldProps} MATCHES NOTFOUND)
- # When buiding out of the tree, precompiled may not be located
- # Use full path instead.
- GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE)
+ # When buiding out of the tree, precompiled may not be located
+ # Use full path instead.
+ GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE)
- SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
- SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
- ELSE(CMAKE_GENERATOR MATCHES Xcode)
- #Fallback to the "old" precompiled suppport
- ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
- ENDIF(CMAKE_GENERATOR MATCHES Xcode)
- ENDIF(CMAKE_GENERATOR MATCHES Visual*)
+ SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
+ SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
+ ELSE(PCH_METHOD EQUAL 1)
+ #Fallback to the "old" precompiled suppport
+ ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
+ ENDIF(PCH_METHOD EQUAL 1)
ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)
diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake
index 5c5efc4a9..e6bf57101 100644
--- a/code/CMakeModules/nel.cmake
+++ b/code/CMakeModules/nel.cmake
@@ -1,3 +1,11 @@
+# Force Release configuration for compiler checks
+SET(CMAKE_TRY_COMPILE_CONFIGURATION "Release")
+
+# Force Release configuration by default
+IF(NOT CMAKE_BUILD_TYPE)
+ SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
###
# Helper macro that generates .pc and installs it.
# Argument: name - the name of the .pc package, e.g. "nel-pacs.pc"
@@ -5,10 +13,41 @@
MACRO(NL_GEN_PC name)
IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
- INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig)
+ IF(CMAKE_LIBRARY_ARCHITECTURE)
+ INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig)
+ ELSE(CMAKE_LIBRARY_ARCHITECTURE)
+ INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION lib/pkgconfig)
+ ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
ENDMACRO(NL_GEN_PC)
+###
+# Helper macro that generates revision.h from revision.h.in
+###
+MACRO(NL_GEN_REVISION_H)
+ IF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
+ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
+ ADD_DEFINITIONS(-DHAVE_REVISION_H)
+ SET(HAVE_REVISION_H ON)
+
+ # a custom target that is always built
+ ADD_CUSTOM_TARGET(revision ALL
+ DEPENDS ${CMAKE_BINARY_DIR}/revision.h)
+
+ # creates revision.h using cmake script
+ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_BINARY_DIR}/revision.h
+ COMMAND ${CMAKE_COMMAND}
+ -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
+ -DROOT_DIR=${CMAKE_SOURCE_DIR}/..
+ -P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake)
+
+ # revision.h is a generated file
+ SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/revision.h
+ PROPERTIES GENERATED TRUE
+ HEADER_FILE_ONLY TRUE)
+ ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/revision.h.in)
+ENDMACRO(NL_GEN_REVISION_H)
+
###
#
###
@@ -37,7 +76,10 @@ ENDMACRO(NL_TARGET_DRIVER)
# Argument:
###
MACRO(NL_DEFAULT_PROPS name label)
- SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${label})
+ # Note: This is just a workaround for a CMake bug generating VS10 files with a colon in the project name.
+ # CMake Bug ID: http://www.cmake.org/Bug/view.php?id=11819
+ STRING(REGEX REPLACE "\\:" " -" proj_label ${label})
+ SET_TARGET_PROPERTIES(${name} PROPERTIES PROJECT_LABEL ${proj_label})
GET_TARGET_PROPERTY(type ${name} TYPE)
IF(${type} STREQUAL SHARED_LIBRARY)
# Set versions only if target is a shared library
@@ -156,7 +198,7 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.:
rm CMakeCache.txt
mkdir cmake
cd cmake
- cmake -G \"Unix Makefiles\" ..
+ cmake ..
")
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
@@ -201,6 +243,17 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
###
# Optional support
###
+
+ # Check if CMake is launched from a Debian packaging script
+ SET(DEB_HOST_GNU_CPU $ENV{DEB_HOST_GNU_CPU})
+
+ # Don't strip if generating a .deb
+ IF(DEB_HOST_GNU_CPU)
+ OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" ON )
+ ELSE(DEB_HOST_GNU_CPU)
+ OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF)
+ ENDIF(DEB_HOST_GNU_CPU)
+
IF(WIN32)
OPTION(WITH_STLPORT "With STLport support." ON )
ELSE(WIN32)
@@ -302,27 +355,80 @@ MACRO(NL_SETUP_BUILD)
ENDIF(CMAKE_BUILD_TYPE MATCHES "Release")
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
+ SET(HOST_CPU ${CMAKE_SYSTEM_PROCESSOR})
+
+ IF(HOST_CPU MATCHES "amd64")
+ SET(HOST_CPU "x86_64")
+ ELSEIF(HOST_CPU MATCHES "i.86")
+ SET(HOST_CPU "x86")
+ ENDIF(HOST_CPU MATCHES "amd64")
+
# Determine target CPU
-# IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
- IF(NOT CMAKE_SIZEOF_VOID_P)
- INCLUDE (CheckTypeSize)
- CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
- ENDIF(NOT CMAKE_SIZEOF_VOID_P)
+ IF(NOT TARGET_CPU)
+ SET(TARGET_CPU $ENV{DEB_HOST_GNU_CPU})
+ ENDIF(NOT TARGET_CPU)
- # Using 32 or 64 bits libraries
+ # If not specified, use the same CPU as host
+ IF(NOT TARGET_CPU)
+ SET(TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR})
+ ENDIF(NOT TARGET_CPU)
+
+ IF(TARGET_CPU MATCHES "amd64")
+ SET(TARGET_CPU "x86_64")
+ ELSEIF(TARGET_CPU MATCHES "i.86")
+ SET(TARGET_CPU "x86")
+ ENDIF(TARGET_CPU MATCHES "amd64")
+
+ # DEB_HOST_ARCH_ENDIAN is 'little' or 'big'
+ # DEB_HOST_ARCH_BITS is '32' or '64'
+
+ # If target and host CPU are the same
+ IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
+ # x86-compatible CPU
+ IF(HOST_CPU MATCHES "x86")
+ IF(NOT CMAKE_SIZEOF_VOID_P)
+ INCLUDE (CheckTypeSize)
+ CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
+ ENDIF(NOT CMAKE_SIZEOF_VOID_P)
+
+ # Using 32 or 64 bits libraries
+ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(TARGET_CPU "x86_64")
+ ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ SET(TARGET_CPU "x86")
+ ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ ENDIF(HOST_CPU MATCHES "x86")
+ # TODO: add checks for ARM and PPC
+ ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
+ MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
+ ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
+
+ IF(TARGET_CPU STREQUAL "x86_64")
+ SET(TARGET_X64 1)
+ SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_X86_64")
+ ELSEIF(TARGET_CPU STREQUAL "x86")
SET(TARGET_X86 1)
- IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- SET(ARCH "x86_64")
- SET(TARGET_X64 1)
- ADD_DEFINITIONS(-DHAVE_X86_64)
- ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
- SET(ARCH "x86")
- ADD_DEFINITIONS(-DHAVE_X86)
- ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
-# ADD_DEFINITIONS(-DHAVE_IA64)
-# ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
+ SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DHAVE_X86")
+ ENDIF(TARGET_CPU STREQUAL "x86_64")
- IF(WIN32)
+ # Fix library paths suffixes for Debian MultiArch
+ SET(DEBIAN_MULTIARCH $ENV{DEB_HOST_MULTIARCH})
+
+ IF(DEBIAN_MULTIARCH)
+ SET(CMAKE_LIBRARY_ARCHITECTURE ${DEBIAN_MULTIARCH})
+ ENDIF(DEBIAN_MULTIARCH)
+
+ IF(CMAKE_LIBRARY_ARCHITECTURE)
+ SET(CMAKE_LIBRARY_PATH /lib/${CMAKE_LIBRARY_ARCHITECTURE} /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_PATH})
+ IF(TARGET_X64)
+ SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64)
+ ENDIF(TARGET_X64)
+ IF(TARGET_X86)
+ SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32)
+ ENDIF(TARGET_X86)
+ ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
+
+ IF(MSVC)
IF(MSVC10)
# /Ox is working with VC++ 2010, but custom optimizations don't exist
SET(SPEED_OPTIMIZATIONS "/Ox /GF /GS-")
@@ -342,10 +448,10 @@ MACRO(NL_SETUP_BUILD)
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
ENDIF(MSVC10)
- SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zi /Zm1000 /MP /Gy-")
+ SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /W3 /Zm1000 /MP /Gy-")
# Common link flags
- SET(PLATFORM_LINKFLAGS "-DEBUG")
+ SET(PLATFORM_LINKFLAGS "")
IF(TARGET_X64)
# Fix a bug with Intellisense
@@ -360,12 +466,32 @@ MACRO(NL_SETUP_BUILD)
# Exceptions are only set for C++
SET(PLATFORM_CXXFLAGS "${PLATFORM_CFLAGS} /EHa")
- SET(NL_DEBUG_CFLAGS "/MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS}")
- SET(NL_RELEASE_CFLAGS "/MD /D NDEBUG ${SPEED_OPTIMIZATIONS}")
- SET(NL_DEBUG_LINKFLAGS "/NODEFAULTLIB:msvcrt /INCREMENTAL:YES")
- SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO")
- ELSE(WIN32)
- SET(PLATFORM_CFLAGS "-g -pipe -ftemplate-depth-48 -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
+ IF(WITH_SYMBOLS)
+ SET(NL_RELEASE_CFLAGS "/Zi ${NL_RELEASE_CFLAGS}")
+ SET(NL_RELEASE_LINKFLAGS "/DEBUG ${NL_RELEASE_LINKFLAGS}")
+ ELSE(WITH_SYMBOLS)
+ SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
+ ENDIF(WITH_SYMBOLS)
+
+ SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${MIN_OPTIMIZATIONS} ${NL_DEBUG_CFLAGS}")
+ SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${SPEED_OPTIMIZATIONS} ${NL_RELEASE_CFLAGS}")
+ SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt /INCREMENTAL:YES ${NL_DEBUG_LINKFLAGS}")
+ SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}")
+ ELSE(MSVC)
+ IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
+ SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m32 -march=i686")
+ ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
+
+ IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
+ SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -m64")
+ ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
+
+ SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -D_REENTRANT -pipe -ftemplate-depth-48 -Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused -fno-strict-aliasing")
+
+ IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -ansi")
+ ENDIF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+
IF(WITH_COVERAGE)
SET(PLATFORM_CFLAGS "-fprofile-arcs -ftest-coverage ${PLATFORM_CFLAGS}")
ENDIF(WITH_COVERAGE)
@@ -382,12 +508,20 @@ MACRO(NL_SETUP_BUILD)
SET(PLATFORM_CXXFLAGS ${PLATFORM_CFLAGS})
IF(NOT APPLE)
- SET(PLATFORM_LINKFLAGS "-Wl,--no-undefined -Wl,--as-needed")
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
ENDIF(NOT APPLE)
- SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG")
- SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O6")
- ENDIF(WIN32)
+ IF(WITH_SYMBOLS)
+ SET(NL_RELEASE_CFLAGS "${NL_RELEASE_CFLAGS} -g")
+ ELSE(WITH_SYMBOLS)
+ IF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ SET(NL_RELEASE_LINKFLAGS "-Wl,-s ${NL_RELEASE_LINKFLAGS}")
+ ENDIF(NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+ ENDIF(WITH_SYMBOLS)
+
+ SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}")
+ SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3 ${NL_RELEASE_CFLAGS}")
+ ENDIF(MSVC)
ENDMACRO(NL_SETUP_BUILD)
MACRO(NL_SETUP_BUILD_FLAGS)
@@ -451,7 +585,11 @@ MACRO(NL_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(NL_LIB_PREFIX "../lib" CACHE PATH "Installation path for libraries.")
ELSE(WIN32)
- SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.")
+ IF(CMAKE_LIBRARY_ARCHITECTURE)
+ SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
+ ELSE(CMAKE_LIBRARY_ARCHITECTURE)
+ SET(NL_LIB_PREFIX "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation path for libraries.")
+ ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
ENDIF(WIN32)
ENDIF(NOT NL_LIB_PREFIX)
@@ -460,7 +598,11 @@ MACRO(NL_SETUP_PREFIX_PATHS)
IF(WIN32)
SET(NL_DRIVER_PREFIX "../lib" CACHE PATH "Installation path for drivers.")
ELSE(WIN32)
- SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.")
+ IF(CMAKE_LIBRARY_ARCHITECTURE)
+ SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
+ ELSE(CMAKE_LIBRARY_ARCHITECTURE)
+ SET(NL_DRIVER_PREFIX "${CMAKE_INSTALL_PREFIX}/lib/nel" CACHE PATH "Installation path for drivers.")
+ ENDIF(CMAKE_LIBRARY_ARCHITECTURE)
ENDIF(WIN32)
ENDIF(NOT NL_DRIVER_PREFIX)
@@ -529,50 +671,67 @@ MACRO(SETUP_EXTERNAL)
ENDIF(WITH_EXTERNAL)
IF(WIN32)
- INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
+ FIND_PACKAGE(External REQUIRED)
+
IF(MSVC10)
IF(NOT MSVC10_REDIST_DIR)
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF(NOT MSVC10_REDIST_DIR)
- GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\10.0_Config;InstallDir]" ABSOLUTE)
- # VC_ROOT_DIR is set to "registry" when a key is not found
- IF(VC_ROOT_DIR MATCHES "registry")
- GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\10.0_Config;InstallDir]" ABSOLUTE)
- IF(VC_ROOT_DIR MATCHES "registry")
- MESSAGE(FATAL_ERROR "Unable to find VC++ 2010 directory!")
- ENDIF(VC_ROOT_DIR MATCHES "registry")
- ENDIF(VC_ROOT_DIR MATCHES "registry")
- # convert IDE fullpath to VC++ path
- STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR})
- ELSE(MSVC10)
- IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
+
+ IF(NOT VC_DIR)
+ IF(NOT VC_ROOT_DIR)
+ GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\10.0_Config;InstallDir]" ABSOLUTE)
+ # VC_ROOT_DIR is set to "registry" when a key is not found
+ IF(VC_ROOT_DIR MATCHES "registry")
+ GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VCExpress\\10.0_Config;InstallDir]" ABSOLUTE)
+ IF(VC_ROOT_DIR MATCHES "registry")
+ FILE(TO_CMAKE_PATH $ENV{VS100COMNTOOLS} VC_ROOT_DIR)
+ IF(NOT VC_ROOT_DIR)
+ MESSAGE(FATAL_ERROR "Unable to find VC++ 2010 directory!")
+ ENDIF(NOT VC_ROOT_DIR)
+ ENDIF(VC_ROOT_DIR MATCHES "registry")
+ ENDIF(VC_ROOT_DIR MATCHES "registry")
+ ENDIF(NOT VC_ROOT_DIR)
# convert IDE fullpath to VC++ path
- STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${CMAKE_MAKE_PROGRAM})
- ELSE(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
- # convert compiler fullpath to VC++ path
- STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER})
- ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
+ STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR})
+ ENDIF(NOT VC_DIR)
+ ELSE(MSVC10)
+ IF(NOT VC_DIR)
+ IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
+ # convert IDE fullpath to VC++ path
+ STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${CMAKE_MAKE_PROGRAM})
+ ELSE(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
+ # convert compiler fullpath to VC++ path
+ STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER})
+ ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
+ ENDIF(NOT VC_DIR)
ENDIF(MSVC10)
ELSE(WIN32)
- IF(CMAKE_FIND_LIBRARY_SUFFIXES AND NOT APPLE)
+ IF(APPLE)
IF(WITH_STATIC_EXTERNAL)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .dylib .so)
ELSE(WITH_STATIC_EXTERNAL)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a)
ENDIF(WITH_STATIC_EXTERNAL)
- ENDIF(CMAKE_FIND_LIBRARY_SUFFIXES AND NOT APPLE)
+ ELSE(APPLE)
+ IF(WITH_STATIC_EXTERNAL)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .so)
+ ELSE(WITH_STATIC_EXTERNAL)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .so .a)
+ ENDIF(WITH_STATIC_EXTERNAL)
+ ENDIF(APPLE)
ENDIF(WIN32)
IF(WITH_STLPORT)
FIND_PACKAGE(STLport REQUIRED)
INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR})
- IF(WIN32)
+ IF(MSVC)
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
FIND_PACKAGE(WindowsSDK REQUIRED)
# use VC++ and Windows SDK include paths
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIR})
- ENDIF(WIN32)
+ ENDIF(MSVC)
ENDIF(WITH_STLPORT)
ENDMACRO(SETUP_EXTERNAL)
diff --git a/code/acinclude.m4 b/code/acinclude.m4
deleted file mode 100644
index 1f9286bf9..000000000
--- a/code/acinclude.m4
+++ /dev/null
@@ -1,1396 +0,0 @@
-# =========================================================================
-#
-# Macros used by Nevrax in configure.in files.
-#
-# $Id: acinclude.m4,v 1.20 2005-04-04 10:07:29 cado Exp $
-#
-# =========================================================================
-
-# =========================================================================
-# WARNING: The original version of this file is placed in the $CVSROOT/code
-# directory.
-# There is links in the $CVSROOT/code sub-directories to that file
-# (ex: $CVSROOT/code/nel), so be careful of the consequences of
-# any modification of that file.
-# =========================================================================
-
-# =========================================================================
-# Macros available in that file.
-#
-#
-# AM_NEL_DEBUG
-#
-# Option: none.
-# Description: manage the different debug and the release mode by setting
-# correctly the CFLAGS and CXXFLAGS variables.
-#
-#
-# AM_PATH_NEL
-#
-# Option: none.
-# Description: check the instalation of the NeL library and set the
-# CXXFLAGS and LIBS variables to use it.
-#
-#
-# AM_PATH_STLPORT
-#
-# Option: none.
-# Description: check the instalation of the STLPort library and set the
-# CXXFLAGS and LIBS variables to use it.
-#
-#
-# AM_PATH_OPENGL
-#
-# Option: "yes" if the use of the OpenGL library is mandatory.
-# Description: check the instalation of the OpenGL library and set the
-# OPENGL_CFLAGS and OPENGL_LIBS variables to use it.
-#
-#
-# AM_PATH_FREETYPE
-#
-# Option: "yes" if the use of the Freetype library is mandatory.
-# Description: check the instalation of the OpenGL library and set the
-# FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it.
-#
-#
-# AM_PATH_XF86VIDMODE
-#
-# Option: none.
-# Description: check the instalation of the OpenGL library and set the
-# XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it.
-#
-#
-# AM_PATH_OPENAL
-#
-# Option: "yes" if the use of the OpenAL library is mandatory.
-# Description: check the instalation of the OpenGL library and set the
-# OPENAL_CFLAGS and OPENAL_LIBS variables to use it.
-#
-#
-# AM_PATH_PYTHON
-#
-# Option: "yes" if the use of the Python library is mandatory.
-# Description: check the instalation of the OpenGL library and set the
-# PYTHON_CFLAGS and PYTHON_LIBS variables to use it.
-#
-# AM_PATH_CCACHE
-#
-# Option: none.
-# Description: check the instalation of the Ccache utility.
-#
-# =========================================================================
-
-
-# =========================================================================
-# AM_NEL_DEBUG
-
-AC_DEFUN([AM_NEL_DEBUG],
-[
-
-MAX_C_OPTIMIZE="-O6"
-
-STL_DEBUG="-D__STL_DEBUG"
-
-NL_DEBUG="-DNL_DEBUG"
-NL_DEBUG_FAST="-DNL_DEBUG_FAST"
-NL_RELEASE_DEBUG="-DNL_RELEASE_DEBUG"
-NL_RELEASE="-DNL_RELEASE_DEBUG"
-
-AC_ARG_WITH(debug,
- [ --with-debug[=full|medium|fast]
- Build a debug version (huge libraries).
- Full mode set only NeL and STL debug flags.
- Medium mode set NeL debug flags with inline
- optimization (default mode).
- Fast mode is like the Medium mode with some basic
- optimization.
- --without-debug Build without debugging code (default)],
- [with_debug=$withval],
- [with_debug=no])
-
-# Build optimized or debug version ?
-# First check for gcc and g++
-if test "$ac_cv_prog_gcc" = "yes"
-then
- DEBUG_CFLAGS="-g"
- DEBUG_OPTIMIZE_CC="-O"
- OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
-else
- DEBUG_CFLAGS="-g"
- DEBUG_OPTIMIZE_CC=""
- OPTIMIZE_CFLAGS=""
-fi
-
-if test "$ac_cv_prog_cxx_g" = "yes"
-then
- DEBUG_CXXFLAGS="-g"
- DEBUG_OPTIMIZE_CXX="-O"
- OPTIMIZE_CXXFLAGS="-O3"
- OPTIMIZE_INLINE_CXXFLAGS="-finline-functions"
-else
- DEBUG_CXXFLAGS="-g"
- DEBUG_OPTIMIZE_CXX=""
- OPTIMIZE_CXXFLAGS=""
- OPTIMIZE_INLINE_CXXFLAGS=""
-fi
-
-if test "$with_debug" = "yes" -o "$with_debug" = "medium"
-then
- # Medium debug. Inline optimization
- CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $NL_DEBUG_FAST $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $NL_DEBUG_FAST $CXXFLAGS"
-else
- if test "$with_debug" = "full"
- then
- # Full debug. Very slow in some cases
- CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $STL_DEBUG $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $STL_DEBUG $CXXFLAGS"
- else
- if test "$with_debug" = "fast"
- then
- # Fast debug.
- CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS"
- else
- # Optimized version. No debug
- CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE_DEBUG $CFLAGS"
- CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE_DEBUG $CXXFLAGS"
- fi
- fi
-fi
-
-# AC_MSG_RESULT([CFLAGS = $CFLAGS])
-# AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS])
-
-])
-
-
-# =========================================================================
-# MY_NEL_HEADER_CHK : NeL header files checking macros
-
-AC_DEFUN([MY_NEL_HEADER_CHK],
-[ AC_REQUIRE_CPP()
-
-chk_message_obj="$1"
-header="$2"
-macro="$3"
-is_mandatory="$4"
-
-if test $is_mandatory = "yes"
-then
-
- _CPPFLAGS="$CPPFLAGS"
-
- CPPFLAGS="$CXXFLAGS $NEL_CFLAGS"
-
- AC_MSG_CHECKING(for $header)
-
- AC_EGREP_CPP( yo_header,
-[#include <$header>
-#ifdef $macro
- yo_header
-#endif],
- have_header="yes",
- have_header="no")
-
- CPPFLAGS="$_CPPFLAGS"
-
- if test "$have_header" = "yes"
- then
- AC_MSG_RESULT(yes)
- else
- if test "$is_mandatory" = "yes"
- then
- AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])
- else
- AC_MSG_RESULT(no)
- fi
- fi
-fi
-
-
-])
-
-
-# =========================================================================
-# MY_NEL_LIB_CHK : NeL library checking macros
-
-AC_DEFUN([MY_NEL_LIB_CHK],
-[ AC_REQUIRE_CPP()
-
-chk_message_obj="$1"
-nel_test_lib="$2"
-is_mandatory="$3"
-
-if test $is_mandatory = "yes"
-then
-
- AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://www.nevrax.org).])])
-fi
-])
-
-
-# =========================================================================
-# AM_PATH_NEL : NeL checking macros
-AC_DEFUN([AM_PATH_NEL],
-[ AC_REQUIRE_CPP()
-
-AC_ARG_WITH( nel,
- [ --with-nel= path to the NeL install files directory.
- e.g. /usr/local/nel])
-
-AC_ARG_WITH( nel-include,
- [ --with-nel-include=
- path to the NeL header files directory.
- e.g. /usr/local/nel/include])
-
-AC_ARG_WITH( nel-lib,
- [ --with-nel-lib=
- path to the NeL library files directory.
- e.g. /usr/local/nel/lib])
-
-
-nelmisc_is_mandatory="$1"
-nelnet_is_mandatory="$2"
-nel3d_is_mandatory="$3"
-nelpacs_is_mandatory="$4"
-nelsound_is_mandatory="$5"
-nelai_is_mandatory="$6"
-nelgeorges_is_mandatory="$7"
-
-# Check for nel-config
-AC_PATH_PROG(NEL_CONFIG, nel-config, no)
-
-#
-# Configure options (--with-nel*) have precendence
-# over nel-config only set variables if they are not
-# specified
-#
-if test "$NEL_CONFIG" != "no"
-then
- if test -z "$with_nel" -a -z "$with_nel_include"
- then
- CXXFLAGS="$CXXFLAGS `nel-config --cflags`"
- fi
-
- if test -z "$with_nel" -a -z "$with_nel_lib"
- then
- LDFLAGS="`nel-config --ldflags` $LDFLAGS"
- fi
-fi
-
-#
-# Set nel_libraries and nel_includes according to
-# user specification (--with-nel*) if any.
-# --with-nel-include and --with-nel-lib have precendence
-# over --with-nel
-#
-if test "$with_nel" = "no"
-then
- # The user explicitly disabled the use of the NeL
- AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel])
-else
- if test "$with_nel" -a "$with_nel" != "yes"
- then
- nel_includes="$with_nel/include"
- nel_libraries="$with_nel/lib"
- fi
-fi
-
-if test "$with_nel_include"
-then
- nel_includes="$with_nel_include"
-fi
-
-if test "$with_nel_lib"
-then
- nel_libraries="$with_nel_lib"
-fi
-
-#
-# Set compilation variables
-#
-if test "$nel_includes"
-then
- CXXFLAGS="$CXXFLAGS -I$nel_includes"
-fi
-
-if test "$nel_libraries"
-then
- LDFLAGS="-L$nel_libraries $LDFLAGS"
-fi
-
-#
-# Collect headers information and bark if missing and
-# mandatory
-#
-
-MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory)
-MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory)
-MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory)
-MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory)
-MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory)
-MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory)
-MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory)
-
-#
-# Collect libraries information and bark if missing and
-# mandatory
-#
-
-MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory)
-MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory)
-MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory)
-MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory)
-MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory)
-MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory)
-MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory)
-
-])
-
-
-# =========================================================================
-# AM_PATH_STLPORT : STLPort checking macros
-
-AC_DEFUN([AM_PATH_STLPORT],
-[ AC_REQUIRE_CPP()
-
-AC_ARG_WITH( stlport,
- [ --with-stlport= path to the STLPort install files directory.
- e.g. /usr/local/stlport])
-
-AC_ARG_WITH( stlport-include,
- [ --with-stlport-include=
- path to the STLPort header files directory.
- e.g. /usr/local/stlport/stlport])
-
-AC_ARG_WITH( stlport-lib,
- [ --with-stlport-lib=
- path to the STLPort library files directory.
- e.g. /usr/local/stlport/lib])
-
-if test "$with_debug" = "full"
-then
- stlport_lib="stlport_gcc_debug"
-else
- stlport_lib="stlport_gcc"
-fi
-
-if test "$with_debug" = "full"
-then
- stlport_lib2="stlport_gcc_debug"
-else
- stlport_lib2="stlport_gcc"
-fi
-
-if test "$with_stlport" = no
-then
- # The user explicitly disabled the use of the STLPorts
- AC_MSG_ERROR([STLPort is mandatory: do not specify --without-stlport])
-else
- stlport_includes="/usr/include/stlport"
- if test "$with_stlport" -a "$with_stlport" != yes
- then
- stlport_includes="$with_stlport/stlport"
- stlport_libraries="$with_stlport/lib"
-
- if test ! -d "$stlport_includes"
- then
- stlport_includes="$with_stlport/include/stlport"
- fi
- fi
-fi
-
-if test "$with_stlport_include"
-then
- stlport_includes="$with_stlport_include"
-fi
-
-if test "$with_stlport_lib"
-then
- stlport_libraries="$with_stlport_lib"
-fi
-
-# Check for the 'pthread' library. SLTPort needs it.
-AC_CHECK_LIB(pthread, main, , [AC_MSG_ERROR([cannot find the pthread library.])])
-AC_CHECK_LIB(dl, dlopen, , [AC_MSG_ERROR([cannot find the dl library.])])
-
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-
-# Put STLPorts includes in CXXFLAGS
-if test "$stlport_includes"
-then
- CXXFLAGS="$CXXFLAGS -I$stlport_includes"
-fi
-
-# Put STLPorts libraries directory in LIBS
-if test "$stlport_libraries"
-then
- LIBS="-L$stlport_libraries $LIBS"
-else
- stlport_libraries='default'
-fi
-
-# Put STLPort GCC libraries directory in LIBS
-if test "$stlport_libraries2"
-then
- LIBS="-L$stlport_libraries2 $LIBS"
-else
- stlport_libraries2='default'
-fi
-
-# Test the headers
-
-AC_CHECK_HEADER(algorithm,
- have_stlport_headers="yes",
- have_stlport_headers="no" )
-
-AC_MSG_CHECKING(for STLPort headers)
-
-if test "$have_stlport_headers" = "yes"
-then
- AC_MSG_RESULT([$stlport_includes])
-else
- AC_MSG_RESULT(no)
-fi
-
-AC_CHECK_LIB($stlport_lib, main,, have_stlport_libraries="no")
-
-AC_MSG_CHECKING(for STLPort library)
-
-if test "$have_stlport_libraries" != "no"
-then
- AC_MSG_RESULT([$stlport_libraries])
-else
- AC_MSG_RESULT(no)
-fi
-
-AC_CHECK_LIB($stlport_lib2, main,, have_stlport_libraries="no")
-
-AC_MSG_CHECKING(for STLPort GCC library)
-
-if test "$have_stlport_libraries2" != "no"
-then
- AC_MSG_RESULT([$stlport_libraries2])
-else
- AC_MSG_RESULT(no)
-fi
-
-if test "$have_stlport_headers" = "yes" &&
- (test "$have_stlport_libraries" != "no" || test "$have_stlport_libraries2" != "no")
-then
- have_stlport="yes"
-else
- have_stlport="no"
-fi
-
-if test "$have_stlport" = "no"
-then
- AC_MSG_ERROR([STLPort must be installed (http://www.stlport.org).])
-fi
-
-AC_LANG_RESTORE
-
-])
-
-
-# =========================================================================
-# AM_PATH_OPENGL : OpenGL checking macros
-
-AC_DEFUN([AM_PATH_OPENGL],
-[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2)
-
-is_mandatory="$1"
-
-AC_REQUIRE_CPP()
-
-AC_ARG_WITH( opengl,
- [ --with-opengl= path to the OpenGL install files directory.
- e.g. /usr/local])
-
-AC_ARG_WITH( opengl-include,
- [ --with-opengl-include=
- path to the OpenGL header files directory.
- e.g. /usr/local/include])
-
-AC_ARG_WITH( opengl-lib,
- [ --with-opengl-lib=
- path to the OpenGL library files directory.
- e.g. /usr/local/lib])
-
-opengl_lib="GL"
-
-if test "$with_opengl"
-then
- opengl_includes="$with_opengl/include"
- opengl_libraries="$with_opengl/lib"
-fi
-
-if test "$with_opengl_include"
-then
- opengl_includes="$with_opengl_include"
-fi
-
-if test "$with_opengl_lib"
-then
- opengl_libraries="$with_opengl_lib"
-fi
-
-# Set OPENGL_CFLAGS
-if test "$opengl_includes"
-then
- OPENGL_CFLAGS="-I$opengl_includes"
-fi
-
-# Set OPENGL_LIBS
-if test "$opengl_libraries"
-then
- OPENGL_LIBS="-L$opengl_libraries"
-fi
-OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib"
-
-# Test the headers
-_CPPFLAGS="$CPPFLAGS"
-
-CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS"
-
-AC_EGREP_CPP( yo_opengl,
-[#include
-#if defined(GL_VERSION_1_2)
- yo_opengl
-#endif],
- have_opengl_headers="yes",
- have_opengl_headers="no" )
-
-if test "$have_opengl_headers" = "yes"
-then
- if test "$opengl_includes"
- then
- AC_MSG_RESULT([$opengl_includes])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-# Checking the GLEXT version >= 7
-AC_MSG_CHECKING(for and GLEXT version >= 7)
-
-AC_EGREP_CPP( yo_glext_version,
-[#include
-#ifdef GL_GLEXT_VERSION
-#if GL_GLEXT_VERSION >= 7
- yo_glext_version
-#endif
-#endif],
- have_glext="yes",
- have_glext="no" )
-
-if test "$have_glext" = "yes"
-then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT([no, can be downloaded from http://oss.sgi.com/projects/ogl-sample/ABI/])
-fi
-
-# Test the libraries
-AC_MSG_CHECKING(for OpenGL libraries)
-
-CPPFLAGS="$CXXFLAGS $OPENGL_LIBS"
-
-AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no")
-
-CPPFLAGS="$_CPPFLAGS"
-
-if test "$have_opengl_libraries" = "yes"
-then
- if test "$opengl_libraries"
- then
- AC_MSG_RESULT([$opengl_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-opengl_libraries="$opengl_libraries"
-
-if test "$have_opengl_headers" = "yes" \
- -a "$have_glext" = "yes" \
- -a "$have_opengl_libraries" = "yes"
-then
- have_opengl="yes"
-else
- have_opengl="no"
-fi
-
-if test "$have_opengl" = "no" -a "$is_mandatory" = "yes"
-then
- AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)])
-fi
-
-AC_SUBST(OPENGL_CFLAGS)
-AC_SUBST(OPENGL_LIBS)
-
-])
-
-
-# =========================================================================
-# AM_PATH_FREETYPE : FreeType checking macros
-
-AC_DEFUN([AM_PATH_FREETYPE],
-[ is_mandatory="$1"
-
-AC_REQUIRE_CPP()
-
-AC_ARG_WITH( freetype,
- [ --with-freetype= path to the FreeType install files directory.
- e.g. /usr/local/freetype])
-
-AC_ARG_WITH( freetype-include,
- [ --with-freetype-include=
- path to the FreeType header files directory.
- e.g. /usr/local/freetype/include])
-
-AC_ARG_WITH( freetype-lib,
- [ --with-freetype-lib=
- path to the FreeType library files directory.
- e.g. /usr/local/freetype/lib])
-
-freetype_lib="freetype"
-
-
-AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
-
-if test "$FREETYPE_CONFIG" = "no"
-then
- have_freetype_config="no"
-else
- FREETYPE_CFLAGS=`freetype-config --cflags`
- FREETYPE_LIBS=`freetype-config --libs`
- have_freetype_config="yes"
-fi
-
-if test "$with_freetype"
-then
- freetype_includes="$with_freetype/include"
- freetype_libraries="$with_freetype/lib"
-fi
-
-if test "$with_freetype_include"
-then
- freetype_includes="$with_freetype_include"
-fi
-
-if test "$with_freetype_lib"
-then
- freetype_libraries="$with_freetype_lib"
-fi
-
-if test "$freetype_includes"
-then
- FREETYPE_CFLAGS="-I$freetype_includes"
-fi
-
-# Checking the FreeType 2 instalation
-_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS"
-
-AC_MSG_CHECKING(for FreeType version = 2)
-
-AC_EGREP_CPP( yo_freetype2,
-[#include
-#if FREETYPE_MAJOR == 2
- yo_freetype2
-#endif],
- have_freetype2="yes",
- have_freetype2="no")
-
-if test "$have_freetype2" = "yes"
-then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-
-# Test the libraries
-AC_MSG_CHECKING(for FreeType libraries)
-
-if test $freetype_libraries
-then
- FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib"
-fi
-
-CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS"
-
-AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no")
-
-CPPFLAGS="$_CPPFLAGS"
-
-if test "$have_freetype_libraries" = "yes"
-then
- if test "$freetype_libraries"
- then
- AC_MSG_RESULT([$freetype_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes"
-then
- have_freetype="yes"
-else
- have_freetype="no"
-fi
-
-if test "$have_freetype" = "no" && test "$is_mandatory" = "yes"
-then
- AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)])
-fi
-
-AC_SUBST(FREETYPE_CFLAGS)
-AC_SUBST(FREETYPE_LIBS)
-
-])
-
-
-# =========================================================================
-# AM_PATH_XF86VIDMODE : XF86VidMode checking macros
-
-AC_DEFUN([AM_PATH_XF86VIDMODE],
-[ AC_MSG_CHECKING(for XF86VidMode extension)
-
-AC_REQUIRE_CPP()
-
-AC_ARG_WITH( xf86vidmode-lib,
- [ --with-xf86vidmode-lib=
- path to the XF86VidMode library.
- e.g. /usr/X11R6/lib] )
-
-xf86vidmode_lib="Xxf86vm"
-
-if test "$with_xf86vidmode_lib" = no
-then
- # The user explicitly disabled the use of XF86VidMode
- have_xf86vidmode="disabled"
- AC_MSG_RESULT(disabled)
-else
- if test "$with_xf86vidmode_lib"
- then
- xf86vidmode_libraries="$with_xf86vidmode_lib"
- fi
-
- XF86VIDMODE_CFLAGS="-DXF86VIDMODE"
-fi
-
-if test -z "$have_xf86vidmode"
-# -a "$with_xf86vidmode_lib"
-then
- if test "$xf86vidmode_libraries"
- then
- XF86VIDMODE_LIBS="-L$xf86vidmode_libraries"
- fi
-
- XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib"
-
- _CPPFLAGS="$CPPFLAGS"
-
- CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS"
-
- AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no")
-
- CPPFLAGS="$_CPPFLAGS"
-
- if test "$have_xf86vidmode_libraries" = "yes"
- then
- have_xf86vidmode="yes"
- if test "$xf86vidmode_libraries"
- then
- AC_MSG_RESULT($xf86vidmode_libraries)
- else
- AC_MSG_RESULT(yes)
- fi
- else
- have_xf86vidmode="no"
- AC_MSG_RESULT(no, no fullscreen support available.)
- fi
-
- xf86vidmode_libraries="$xf86vidmode_libraries"
-
-fi
-
-AC_SUBST(XF86VIDMODE_CFLAGS)
-AC_SUBST(XF86VIDMODE_LIBS)
-
-])
-
-
-# =========================================================================
-# AM_PATH_OPENAL : OpenAL checking macros
-
-AC_DEFUN([AM_PATH_OPENAL],
-[ is_mandatory="$1"
-
-AC_REQUIRE_CPP()
-
-# Get from the user option the path to the OpenAL files location
-AC_ARG_WITH( openal,
- [ --with-openal= path to the OpenAL install files directory.
- e.g. /usr/local])
-
-AC_ARG_WITH( openal-include,
- [ --with-openal-include=
- path to the OpenAL header files directory.
- e.g. /usr/local/include])
-
-AC_ARG_WITH( openal-lib,
- [ --with-openal-lib=
- path to the OpenAL library files directory.
- e.g. /usr/local/lib])
-
-openal_lib="openal"
-
-if test $with_openal
-then
- openal_includes="$with_openal/include"
- openal_libraries="$with_openal/lib"
-fi
-
-if test "$with_openal_include"
-then
- openal_includes="$with_openal_include"
-fi
-
-if test "$with_openal_lib"
-then
- openal_libraries="$with_openal_lib"
-fi
-
-
-# Set OPENAL_CFLAGS
-if test "$openal_includes"
-then
- OPENAL_CFLAGS="-I$openal_includes"
-fi
-
-# Set OPENAL_LIBS
-if test "$openal_libraries"
-then
- OPENAL_LIBS="-L$openal_libraries"
-fi
-OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib"
-
-_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS"
-
-AC_MSG_CHECKING(for OpenAL headers)
-AC_EGREP_CPP( yo_openal,
-[#include
-#ifdef AL_VERSION
- yo_openal
-#endif],
- have_openal_headers="yes",
- have_openal_headers="no" )
-
-if test "$have_openal_headers" = "yes"
-then
- if test "$openal_includes"
- then
- AC_MSG_RESULT([$openal_includes])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-# Test the libraries
-AC_MSG_CHECKING(for OpenAL libraries)
-
-CPPFLAGS="$CXXFLAGS $OPENAL_LIBS"
-
-AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no")
-
-CPPFLAGS="$_CPPFLAGS"
-
-if test "$have_openal_libraries" = "yes"
-then
- if test "$openal_libraries"
- then
- AC_MSG_RESULT([$openal_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-openal_libraries="$openal_libraries"
-
-if test "$have_openal_headers" = "yes" \
- && test "$have_openal_libraries" = "yes"
-then
- have_openal="yes"
-else
- have_openal="no"
-fi
-
-if test "$have_openal" = "no" -a "$is_mandatory" = "yes"
-then
- AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).])
-fi
-
-AC_SUBST(OPENAL_CFLAGS)
-AC_SUBST(OPENAL_LIBS)
-
-
-])
-
-
-# =========================================================================
-# AM_PATH_PYTHON : Python checking macros
-
-AC_DEFUN([AM_PATH_PYTHON],
-[ python_version_required="$1"
-
-is_mandatory="$2"
-
-AC_REQUIRE_CPP()
-
-# Get from the user option the path to the Python files location
-AC_ARG_WITH( python,
- [ --with-python= path to the Python prefix installation directory.
- e.g. /usr/local],
- [ PYTHON_PREFIX=$with_python ]
-)
-
-AC_ARG_WITH( python-version,
- [ --with-python-version=
- Python version to use, e.g. 1.5],
- [ PYTHON_VERSION=$with_python_version ]
-)
-
-if test ! "$PYTHON_PREFIX" = ""
-then
- PATH="$PYTHON_PREFIX/bin:$PATH"
-fi
-
-if test ! "$PYTHON_VERSION" = ""
-then
- PYTHON_EXEC="python$PYTHON_VERSION"
-else
- PYTHON_EXEC="python python2.1 python2.0 python1.5"
-fi
-
-AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH)
-
-if test "$PYTHON" != "no"
-then
- PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'`
- PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'`
-
- is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION`
-fi
-
-
-if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1"
-then
-
- if test "$is_mandatory" = "yes"
- then
- AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)])
- else
- have_python="no"
- fi
-
-else
-
- python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION"
- python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config"
- python_lib="python$PYTHON_VERSION"
-
- PYTHON_CFLAGS="-I$python_includes"
- PYTHON_LIBS="-L$python_libraries -l$python_lib"
-
- _CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}"
-
- # Test the headers
- AC_MSG_CHECKING(for Python headers)
-
- AC_EGREP_CPP( yo_python,
- [#include
- yo_python
- ],
- have_python_headers="yes",
- have_python_headers="no" )
-
- if test "$have_python_headers" = "yes"
- then
- AC_MSG_RESULT([$python_includes])
- else
- AC_MSG_RESULT(no)
- fi
-
- # Test the libraries
- AC_MSG_CHECKING(for Python libraries)
-
- CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS"
-
- AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no")
-
- CPPFLAGS="$_CPPFLAGS"
-
- if test "$have_python_libraries" = "yes"
- then
- if test "$python_libraries"
- then
- AC_MSG_RESULT([$python_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
- else
- AC_MSG_RESULT(no)
- fi
-
- if test "$have_python_headers" = "yes" \
- && test "$have_python_libraries" = "yes"
- then
- have_python="yes"
- else
- have_python="no"
- fi
-
- if test "$have_python" = "no" -a "$is_mandatory" = "yes"
- then
- AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).])
- fi
-
- AC_SUBST(PYTHON_CFLAGS)
- AC_SUBST(PYTHON_LIBS)
-
-fi
-
-])
-
-
-# =========================================================================
-# AM_PATH_CCACHE : Ccache checking macros
-
-AC_DEFUN([AM_PATH_CCACHE],
-[
-
-AC_ARG_WITH( ccache,
- [ --with-ccache use ccache for compiling.],
- [ using_ccache=$with_ccache ]
-)
-
-AC_PATH_PROG(CCACHE, ccache)
-if test "$CCACHE" -a "$using_ccache" = "yes"
-then
- CC="ccache $CC"
- CXX="ccache $CXX"
-fi
-
-])
-
-# =========================================================================
-# AM_PATH_MYSQL : MySQL library
-
-# AM_PATH_MYSQL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-# Test for MYSQL, and define MYSQL_CFLAGS and MYSQL_LIBS
-#
-AC_DEFUN([AM_PATH_MYSQL],
-[#
-# Get the cflags and libraries from the mysql_config script
-#
-AC_ARG_WITH(mysql-prefix,[ --with-mysql-prefix=PFX Prefix where MYSQL is installed (optional)],
- mysql_prefix="$withval", mysql_prefix="")
-AC_ARG_WITH(mysql-exec-prefix,[ --with-mysql-exec-prefix=PFX Exec prefix where MYSQL is installed (optional)],
- mysql_exec_prefix="$withval", mysql_exec_prefix="")
-AC_ARG_ENABLE(mysqltest, [ --disable-mysqltest Do not try to compile and run a test MYSQL program],
- , enable_mysqltest=yes)
-
- if test x$mysql_exec_prefix != x ; then
- mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix"
- if test x${MYSQL_CONFIG+set} != xset ; then
- MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config
- fi
- fi
- if test x$mysql_prefix != x ; then
- mysql_args="$mysql_args --prefix=$mysql_prefix"
- if test x${MYSQL_CONFIG+set} != xset ; then
- MYSQL_CONFIG=$mysql_prefix/bin/mysql_config
- fi
- fi
-
- AC_REQUIRE([AC_CANONICAL_TARGET])
- AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
- min_mysql_version=ifelse([$1], ,0.11.0,$1)
- AC_MSG_CHECKING(for MYSQL - version >= $min_mysql_version)
- no_mysql=""
- if test "$MYSQL_CONFIG" = "no" ; then
- no_mysql=yes
- else
- MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags | sed -e "s/'//g"`
- MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs | sed -e "s/'//g"`
-
- mysql_major_version=`$MYSQL_CONFIG $mysql_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- mysql_minor_version=`$MYSQL_CONFIG $mysql_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- mysql_micro_version=`$MYSQL_CONFIG $mysql_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x$enable_mysqltest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $MYSQL_CFLAGS"
- LIBS="$LIBS $MYSQL_LIBS"
-#
-# Now check if the installed MYSQL is sufficiently new. (Also sanity
-# checks the results of mysql_config to some extent
-#
- rm -f conf.mysqltest
- AC_TRY_RUN([
-#include
-#include
-#include
-#include
-
-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.mysqltest");
- */
- { FILE *fp = fopen("conf.mysqltest", "a"); if ( fp ) fclose(fp); }
-
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = my_strdup("$min_mysql_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
- printf("%s, bad version string\n", "$min_mysql_version");
- exit(1);
- }
-
- if (($mysql_major_version > major) ||
- (($mysql_major_version == major) && ($mysql_minor_version > minor)) ||
- (($mysql_major_version == major) && ($mysql_minor_version == minor) && ($mysql_micro_version >= micro)))
- {
- return 0;
- }
- else
- {
- printf("\n*** 'mysql_config --version' returned %d.%d.%d, but the minimum version\n", $mysql_major_version, $mysql_minor_version, $mysql_micro_version);
- printf("*** of MYSQL required is %d.%d.%d. If mysql_config is correct, then it is\n", major, minor, micro);
- printf("*** best to upgrade to the required version.\n");
- printf("*** If mysql_config was wrong, set the environment variable MYSQL_CONFIG\n");
- printf("*** to point to the correct copy of mysql_config, and remove the file\n");
- printf("*** config.cache before re-running configure\n");
- return 1;
- }
-}
-
-],, no_mysql=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- if test "x$no_mysql" = x ; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
- else
- AC_MSG_RESULT(no)
- if test "$MYSQL_CONFIG" = "no" ; then
- echo "*** The mysql_config script installed by MYSQL could not be found"
- echo "*** If MYSQL was installed in PREFIX, make sure PREFIX/bin is in"
- echo "*** your path, or set the MYSQL_CONFIG environment variable to the"
- echo "*** full path to mysql_config."
- else
- if test -f conf.mysqltest ; then
- :
- else
- echo "*** Could not run MYSQL test program, checking why..."
- CFLAGS="$CFLAGS $MYSQL_CFLAGS"
- LIBS="$LIBS $MYSQL_LIBS"
- AC_TRY_LINK([
-#include
-#include
-
-int main(int argc, char *argv[])
-{ return 0; }
-#undef main
-#define main K_and_R_C_main
-], [ return 0; ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding MYSQL or finding the wrong"
- echo "*** version of MYSQL. If it is not finding MYSQL, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means MYSQL was incorrectly installed"
- echo "*** or that you have moved MYSQL since it was installed. In the latter case, you"
- echo "*** may want to edit the mysql_config script: $MYSQL_CONFIG" ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- MYSQL_CFLAGS=""
- MYSQL_LIBS=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(MYSQL_CFLAGS)
- AC_SUBST(MYSQL_LIBS)
- rm -f conf.mysqltest
-])
-
-# =========================================================================
-# AM_PATH_FMOD : FMOD checking macros
-
-AC_DEFUN([AM_PATH_FMOD],
-[ is_mandatory="$1"
-
-AC_REQUIRE_CPP()
-
-# Get from the user option the path to the FMOD files location
-AC_ARG_WITH( fmod,
- [ --with-fmod= path to the FMOD install files directory.
- e.g. /usr/local])
-
-AC_ARG_WITH( fmod-include,
- [ --with-fmod-include=
- path to the FMOD header files directory.
- e.g. /usr/local/include])
-
-AC_ARG_WITH( fmod-lib,
- [ --with-fmod-lib=
- path to the FMOD library files directory.
- e.g. /usr/local/lib])
-
-fmod_lib="fmod"
-
-if test $with_fmod
-then
- fmod_includes="$with_fmod/include"
- fmod_libraries="$with_fmod/lib"
-fi
-
-if test "$with_fmod_include"
-then
- fmod_includes="$with_fmod_include"
-fi
-
-if test "$with_fmod_lib"
-then
- fmod_libraries="$with_fmod_lib"
-fi
-
-
-# Set FMOD_CFLAGS
-if test "$fmod_includes"
-then
- FMOD_CFLAGS="-I$fmod_includes"
-fi
-
-# Set FMOD_LIBS
-if test "$fmod_libraries"
-then
- FMOD_LIBS="-L$fmod_libraries"
-fi
-FMOD_LIBS="$FMOD_LIBS -l$fmod_lib"
-
-_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CXXFLAGS $FMOD_CFLAGS"
-
-AC_MSG_CHECKING(for FMOD headers)
-AC_EGREP_CPP( yo_fmod,
-[#include
-#ifdef FMOD_VERSION
- yo_fmod
-#endif],
- have_fmod_headers="yes",
- have_fmod_headers="no" )
-
-if test "$have_fmod_headers" = "yes"
-then
- if test "$fmod_includes"
- then
- AC_MSG_RESULT([$fmod_includes])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-# Test the libraries
-AC_MSG_CHECKING(for FMOD libraries)
-
-CPPFLAGS="$CXXFLAGS $FMOD_LIBS"
-
-AC_TRY_LINK( , , have_fmod_libraries="yes", have_fmod_libraries="no")
-
-CPPFLAGS="$_CPPFLAGS"
-
-if test "$have_fmod_libraries" = "yes"
-then
- if test "$fmod_libraries"
- then
- AC_MSG_RESULT([$fmod_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-fmod_libraries="$fmod_libraries"
-
-if test "$have_fmod_headers" = "yes" \
- && test "$have_fmod_libraries" = "yes"
-then
- have_fmod="yes"
-else
- have_fmod="no"
-fi
-
-if test "$have_fmod" = "no" -a "$is_mandatory" = "yes"
-then
- AC_MSG_ERROR([FMOD is needed to compile NeL (http://www.fmod.org).])
-fi
-
-AC_SUBST(FMOD_CFLAGS)
-AC_SUBST(FMOD_LIBS)
-
-])
-
-# =========================================================================
-# End of file
-
diff --git a/code/nel/Makefile.am b/code/nel/Makefile.am
deleted file mode 100644
index f2af0b6d0..000000000
--- a/code/nel/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in \
- configure \
- libtool \
- config.guess \
- config.sub \
- ltconfig \
- aclocal.m4 \
- config.h.in \
- install-sh \
- missing \
- mkinstalldirs \
- ltmain.sh \
- include/nelconfig.h \
- include/nelconfig.h.in \
- include/nel/nelconfig.h
-
-DISTCLEANFILES = include/stamp-h \
- include/stamp-h.in
-
-SUBDIRS = include src @TOOLS_SUBDIR@ @SAMPLE_SUBDIR@
-
-bin_SCRIPTS = nel-config
-
-EXTRA_DIST = nel.dsw \
- nel.sln \
- nel_8.sln \
- autogen.sh \
- nel.m4 \
- automacros \
- doc \
- kdevelop \
- tools \
- samples
-
-dist-hook:
- find $(distdir) -name CVS -print | xargs rm -fr
- find $(distdir) -name .svn -print | xargs rm -fr
-
-m4datadir = $(datadir)/aclocal
-m4data_DATA = nel.m4
-
-# End of Makefile.am
-
diff --git a/code/nel/acinclude.m4 b/code/nel/acinclude.m4
deleted file mode 100644
index 7a6655bff..000000000
--- a/code/nel/acinclude.m4
+++ /dev/null
@@ -1,1214 +0,0 @@
-# =========================================================================
-#
-# Macros used by Nevrax in configure.in files.
-#
-#
-# =========================================================================
-
-# =========================================================================
-# WARNING: The original version of this file is placed in the $CVSROOT/code
-# directory.
-# There is links in the $CVSROOT/code sub-directories to that file
-# (ex: $CVSROOT/code/nel), so be careful of the consequences of
-# any modification of that file.
-# =========================================================================
-
-# =========================================================================
-# Macros available in that file.
-#
-#
-# AM_NEL_DEBUG
-#
-# Option: none.
-# Description: manage the different debug and the release mode by setting
-# correctly the CFLAGS and CXXFLAGS variables.
-#
-#
-# AM_PATH_NEL
-#
-# Option: none.
-# Description: check the instalation of the NeL library and set the
-# CXXFLAGS and LIBS variables to use it.
-#
-#
-# AM_PATH_OPENGL
-#
-# Option: "yes" if the use of the OpenGL library is mandatory.
-# Description: check the instalation of the OpenGL library and set the
-# OPENGL_CFLAGS and OPENGL_LIBS variables to use it.
-#
-#
-# AM_PATH_FREETYPE
-#
-# Option: "yes" if the use of the Freetype library is mandatory.
-# Description: check the instalation of the OpenGL library and set the
-# FREETYPE_CFLAGS and FREETYPE_LIBS variables to use it.
-#
-#
-# AM_PATH_XF86VIDMODE
-#
-# Option: none.
-# Description: check the instalation of the OpenGL library and set the
-# XF86VIDMODE_CFLAGS and XF86VIDMODE_LIBS variables to use it.
-#
-#
-# AM_PATH_OPENAL
-#
-# Option: "yes" if the use of the OpenAL library is mandatory.
-# Description: check the instalation of the OpenGL library and set the
-# OPENAL_CFLAGS and OPENAL_LIBS variables to use it.
-#
-#
-# AM_PATH_PYTHON
-#
-# Option: "yes" if the use of the Python library is mandatory.
-# Description: check the instalation of the OpenGL library and set the
-# PYTHON_CFLAGS and PYTHON_LIBS variables to use it.
-#
-# =========================================================================
-
-
-# =========================================================================
-# AM_NEL_DEBUG
-
-AC_DEFUN([AM_NEL_DEBUG],
-[
-
-MAX_C_OPTIMIZE="-O6"
-
-NL_DEBUG="-DNL_DEBUG"
-NL_RELEASE="-DNL_RELEASE"
-
-AC_ARG_WITH(debug,
- [ --with-debug[=full|medium|fast]
- Build a debug version (huge libraries).
- Full mode set no optimization.
- Medium mode set NeL debug flags with inline
- optimization (default mode).
- Fast mode is like the Medium mode with some basic
- optimization.
- --without-debug Build without debugging code (default)],
- [with_debug=$withval],
- [with_debug=no])
-
-# Build optimized or debug version ?
-# First check for gcc and g++
-if test "$ac_cv_prog_gcc" = "yes"
-then
- DEBUG_CFLAGS="-g -O0"
- DEBUG_OPTIMIZE_CC="-O"
- OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE"
-else
- DEBUG_CFLAGS=""
- DEBUG_OPTIMIZE_CC=""
- OPTIMIZE_CFLAGS=""
-fi
-
-if test "$ac_cv_prog_cxx_g" = "yes"
-then
- DEBUG_CXXFLAGS="-g -O0"
- DEBUG_OPTIMIZE_CXX="-O"
- OPTIMIZE_CXXFLAGS="-O3"
- OPTIMIZE_INLINE_CXXFLAGS="-finline-functions"
-else
- DEBUG_CXXFLAGS=""
- DEBUG_OPTIMIZE_CXX=""
- OPTIMIZE_CXXFLAGS=""
- OPTIMIZE_INLINE_CXXFLAGS=""
-fi
-
-if test "$with_debug" = "yes" -o "$with_debug" = "medium"
-then
- # Medium debug. Inline optimization
- CFLAGS="$DEBUG_CFLAGS $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS"
-else
- if test "$with_debug" = "full"
- then
- # Full debug. Very slow in some cases
- CFLAGS="$DEBUG_CFLAGS $NL_DEBUG $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $NL_DEBUG $CXXFLAGS"
- else
- if test "$with_debug" = "fast"
- then
- # Fast debug.
- CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC $OPTIMIZE_INLINE_CFLAGS $NL_DEBUG $CFLAGS"
- CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX $OPTIMIZE_INLINE_CXXFLAGS $NL_DEBUG $CXXFLAGS"
- else
- # Optimized version. No debug
- CFLAGS="$OPTIMIZE_CFLAGS $NL_RELEASE $CFLAGS"
- CXXFLAGS="$OPTIMIZE_CXXFLAGS $NL_RELEASE $CXXFLAGS"
- fi
- fi
-fi
-
-# AC_MSG_RESULT([CFLAGS = $CFLAGS])
-# AC_MSG_RESULT([CXXGLAGS = $CXXFLAGS])
-
-])
-
-
-# =========================================================================
-# MY_NEL_HEADER_CHK : NeL header files checking macros
-
-AC_DEFUN([MY_NEL_HEADER_CHK],
-[ AC_REQUIRE_CPP()
-
-chk_message_obj="$1"
-header="$2"
-macro="$3"
-is_mandatory="$4"
-
-if test $is_mandatory = "yes"
-then
-
- _CPPFLAGS="$CPPFLAGS"
-
- CPPFLAGS="$CXXFLAGS $NEL_CFLAGS"
-
- AC_MSG_CHECKING(for $header)
-
- AC_EGREP_CPP( yo_header,
-[#include <$header>
-#ifdef $macro
- yo_header
-#endif],
- have_header="yes",
- have_header="no")
-
- CPPFLAGS="$_CPPFLAGS"
-
- if test "$have_header" = "yes"
- then
- AC_MSG_RESULT(yes)
- else
- if test "$is_mandatory" = "yes"
- then
- AC_MSG_ERROR([$chk_message_obj must be installed (http://dev.ryzom.com).])
- else
- AC_MSG_RESULT(no)
- fi
- fi
-fi
-
-
-])
-
-
-# =========================================================================
-# MY_NEL_LIB_CHK : NeL library checking macros
-
-AC_DEFUN([MY_NEL_LIB_CHK],
-[ AC_REQUIRE_CPP()
-
-chk_message_obj="$1"
-nel_test_lib="$2"
-is_mandatory="$3"
-
-if test $is_mandatory = "yes"
-then
-
- AC_CHECK_LIB($nel_test_lib, main,,[AC_MSG_ERROR([$chk_message_obj must be installed (http://dev.ryzom.com).])])
-fi
-])
-
-
-# =========================================================================
-# AM_PATH_NEL : NeL checking macros
-AC_DEFUN([AM_PATH_NEL],
-[ AC_REQUIRE_CPP()
-
-AC_ARG_WITH( nel,
- [ --with-nel= path to the NeL install files directory.
- e.g. /usr/local/nel])
-
-AC_ARG_WITH( nel-include,
- [ --with-nel-include=
- path to the NeL header files directory.
- e.g. /usr/local/nel/include])
-
-AC_ARG_WITH( nel-lib,
- [ --with-nel-lib=
- path to the NeL library files directory.
- e.g. /usr/local/nel/lib])
-
-
-nelmisc_is_mandatory="$1"
-nelnet_is_mandatory="$2"
-nel3d_is_mandatory="$3"
-nelpacs_is_mandatory="$4"
-nelsound_is_mandatory="$5"
-nelai_is_mandatory="$6"
-nelgeorges_is_mandatory="$7"
-
-# Check for nel-config
-AC_PATH_PROG(NEL_CONFIG, nel-config, no)
-
-#
-# Configure options (--with-nel*) have precendence
-# over nel-config only set variables if they are not
-# specified
-#
-if test "$NEL_CONFIG" != "no"
-then
- if test -z "$with_nel" -a -z "$with_nel_include"
- then
- CXXFLAGS="$CXXFLAGS `nel-config --cflags`"
- fi
-
- if test -z "$with_nel" -a -z "$with_nel_lib"
- then
- LDFLAGS="`nel-config --ldflags` $LDFLAGS"
- fi
-fi
-
-#
-# Set nel_libraries and nel_includes according to
-# user specification (--with-nel*) if any.
-# --with-nel-include and --with-nel-lib have precendence
-# over --with-nel
-#
-if test "$with_nel" = "no"
-then
- # The user explicitly disabled the use of the NeL
- AC_MSG_ERROR([NeL is mandatory: do not specify --without-nel])
-else
- if test "$with_nel" -a "$with_nel" != "yes"
- then
- nel_includes="$with_nel/include"
- nel_libraries="$with_nel/lib"
- fi
-fi
-
-if test "$with_nel_include"
-then
- nel_includes="$with_nel_include"
-fi
-
-if test "$with_nel_lib"
-then
- nel_libraries="$with_nel_lib"
-fi
-
-#
-# Set compilation variables
-#
-if test "$nel_includes"
-then
- CXXFLAGS="$CXXFLAGS -I$nel_includes"
-fi
-
-if test "$nel_libraries"
-then
- LDFLAGS="-L$nel_libraries $LDFLAGS"
-fi
-
-#
-# Collect headers information and bark if missing and
-# mandatory
-#
-
-MY_NEL_HEADER_CHK([NeL Misc], [nel/misc/types_nl.h], [NL_TYPES_H], $nelmisc_is_mandatory)
-MY_NEL_HEADER_CHK([NeL Network], [nel/net/sock.h], [NL_SOCK_H], $nelnet_is_mandatory)
-MY_NEL_HEADER_CHK([NeL 3D], [nel/3d/u_camera.h], [NL_U_CAMERA_H], $nel3d_is_mandatory)
-MY_NEL_HEADER_CHK([NeL PACS], [nel/pacs/u_global_position.h], [NL_U_GLOBAL_POSITION_H], $nelpacs_is_mandatory)
-MY_NEL_HEADER_CHK([NeL Sound], [nel/sound/u_source.h], [NL_U_SOURCE_H], $nelsound_is_mandatory)
-MY_NEL_HEADER_CHK([NeL AI], [nel/ai/nl_ai.h], [_IA_NEL_H], $nelai_is_mandatory)
-MY_NEL_HEADER_CHK([NeL Georges], [nel/georges/common.h], [NLGEORGES_COMMON_H], $nelgeorges_is_mandatory)
-
-#
-# Collect libraries information and bark if missing and
-# mandatory
-#
-
-MY_NEL_LIB_CHK([NeL Misc], [nelmisc], $nelmisc_is_mandatory)
-MY_NEL_LIB_CHK([NeL Network], [nelnet], $nelnet_is_mandatory)
-MY_NEL_LIB_CHK([NeL 3D], [nel3d], $nel3d_is_mandatory)
-MY_NEL_LIB_CHK([NeL PACS], [nelpacs], $nelpacs_is_mandatory)
-MY_NEL_LIB_CHK([NeL Sound], [nelsnd], $nelsound_is_mandatory)
-MY_NEL_LIB_CHK([NeL AI], [nelai], $nelai_is_mandatory)
-MY_NEL_LIB_CHK([NeL Georges], [nelgeorges], $nelgeorges_is_mandatory)
-
-])
-
-# =========================================================================
-# AM_PATH_OPENGL : OpenGL checking macros
-
-AC_DEFUN([AM_PATH_OPENGL],
-[ AC_MSG_CHECKING(for OpenGL headers and GL Version >= 1.2)
-
-is_mandatory="$1"
-
-AC_REQUIRE_CPP()
-
-AC_ARG_WITH( opengl,
- [ --with-opengl= path to the OpenGL install files directory.
- e.g. /usr/local])
-
-AC_ARG_WITH( opengl-include,
- [ --with-opengl-include=
- path to the OpenGL header files directory.
- e.g. /usr/local/include])
-
-AC_ARG_WITH( opengl-lib,
- [ --with-opengl-lib=
- path to the OpenGL library files directory.
- e.g. /usr/local/lib])
-
-opengl_lib="GL"
-
-if test "$with_opengl"
-then
- opengl_includes="$with_opengl/include"
- opengl_libraries="$with_opengl/lib"
-fi
-
-if test "$with_opengl_include"
-then
- opengl_includes="$with_opengl_include"
-fi
-
-if test "$with_opengl_lib"
-then
- opengl_libraries="$with_opengl_lib"
-fi
-
-# Set OPENGL_CFLAGS
-if test "$opengl_includes"
-then
- OPENGL_CFLAGS="-I$opengl_includes"
-fi
-
-# Set OPENGL_LIBS
-if test "$opengl_libraries"
-then
- OPENGL_LIBS="-L$opengl_libraries"
-fi
-OPENGL_LIBS="$OPENGL_LIBS -l$opengl_lib"
-
-# Test the headers
-_CPPFLAGS="$CPPFLAGS"
-
-CPPFLAGS="$CXXFLAGS $OPENGL_CFLAGS"
-
-AC_EGREP_CPP( yo_opengl,
-[#include
-#if defined(GL_VERSION_1_2)
- yo_opengl
-#endif],
- have_opengl_headers="yes",
- have_opengl_headers="no" )
-
-if test "$have_opengl_headers" = "yes"
-then
- if test "$opengl_includes"
- then
- AC_MSG_RESULT([$opengl_includes])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-# Checking the GLEXT version >= 7
-AC_MSG_CHECKING(for and GLEXT version >= 7)
-
-AC_EGREP_CPP( yo_glext_version,
-[#include
-#ifdef GL_GLEXT_VERSION
-#if GL_GLEXT_VERSION >= 7
- yo_glext_version
-#endif
-#endif],
- have_glext="yes",
- have_glext="no" )
-
-if test "$have_glext" = "yes"
-then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT([no, can be downloaded from http://www.opengl.org/registry/])
-fi
-
-# Test the libraries
-AC_MSG_CHECKING(for OpenGL libraries)
-
-CPPFLAGS="$CXXFLAGS $OPENGL_LIBS"
-
-AC_TRY_LINK( , , have_opengl_libraries="yes", have_opengl_libraries="no")
-
-CPPFLAGS="$_CPPFLAGS"
-
-if test "$have_opengl_libraries" = "yes"
-then
- if test "$opengl_libraries"
- then
- AC_MSG_RESULT([$opengl_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-opengl_libraries="$opengl_libraries"
-
-if test "$have_opengl_headers" = "yes" \
- -a "$have_glext" = "yes" \
- -a "$have_opengl_libraries" = "yes"
-then
- have_opengl="yes"
-else
- have_opengl="no"
-fi
-
-if test "$have_opengl" = "no" -a "$is_mandatory" = "yes"
-then
- AC_MSG_ERROR([OpenGL >= 1.2 must be installed (http://www.mesa3d.org)])
-fi
-
-AC_SUBST(OPENGL_CFLAGS)
-AC_SUBST(OPENGL_LIBS)
-
-])
-
-
-# =========================================================================
-# AM_PATH_FREETYPE : FreeType checking macros
-
-AC_DEFUN([AM_PATH_FREETYPE],
-[ is_mandatory="$1"
-
-AC_REQUIRE_CPP()
-
-AC_ARG_WITH( freetype,
- [ --with-freetype= path to the FreeType install files directory.
- e.g. /usr/local/freetype])
-
-AC_ARG_WITH( freetype-include,
- [ --with-freetype-include=
- path to the FreeType header files directory.
- e.g. /usr/local/freetype/include])
-
-AC_ARG_WITH( freetype-lib,
- [ --with-freetype-lib=
- path to the FreeType library files directory.
- e.g. /usr/local/freetype/lib])
-
-freetype_lib="freetype"
-
-
-AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
-
-if test "$FREETYPE_CONFIG" = "no"
-then
- have_freetype_config="no"
-else
- FREETYPE_CFLAGS=`freetype-config --cflags`
- FREETYPE_LIBS=`freetype-config --libs`
- have_freetype_config="yes"
-fi
-
-if test "$with_freetype"
-then
- freetype_includes="$with_freetype/include"
- freetype_libraries="$with_freetype/lib"
-fi
-
-if test "$with_freetype_include"
-then
- freetype_includes="$with_freetype_include"
-fi
-
-if test "$with_freetype_lib"
-then
- freetype_libraries="$with_freetype_lib"
-fi
-
-if test "$freetype_includes"
-then
- FREETYPE_CFLAGS="-I$freetype_includes"
-fi
-
-# Checking the FreeType 2 instalation
-_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS=" $FREETYPE_CFLAGS $CXXFLAGS"
-
-AC_MSG_CHECKING(for FreeType version = 2)
-
-AC_EGREP_CPP( yo_freetype2,
-[#include
-#if FREETYPE_MAJOR == 2
- yo_freetype2
-#endif],
- have_freetype2="yes",
- have_freetype2="no")
-
-if test "$have_freetype2" = "yes"
-then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-
-# Test the libraries
-AC_MSG_CHECKING(for FreeType libraries)
-
-if test $freetype_libraries
-then
- FREETYPE_LIBS="-L$freetype_libraries -l$freetype_lib"
-fi
-
-CPPFLAGS="$FREETYPE_LIBS $CXXFLAGS"
-
-AC_TRY_LINK( , , have_freetype_libraries="yes", have_freetype_libraries="no")
-
-CPPFLAGS="$_CPPFLAGS"
-
-if test "$have_freetype_libraries" = "yes"
-then
- if test "$freetype_libraries"
- then
- AC_MSG_RESULT([$freetype_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-if test "$have_freetype2" = "yes" && test "$have_freetype_libraries" = "yes"
-then
- have_freetype="yes"
-else
- have_freetype="no"
-fi
-
-if test "$have_freetype" = "no" && test "$is_mandatory" = "yes"
-then
- AC_MSG_ERROR([FreeType 2 must be installed (http://freetype.sourceforge.net)])
-fi
-
-AC_SUBST(FREETYPE_CFLAGS)
-AC_SUBST(FREETYPE_LIBS)
-
-])
-
-
-# =========================================================================
-# AM_PATH_XF86VIDMODE : XF86VidMode checking macros
-
-AC_DEFUN([AM_PATH_XF86VIDMODE],
-[ AC_MSG_CHECKING(for XF86VidMode extension)
-
-AC_REQUIRE_CPP()
-
-AC_ARG_WITH( xf86vidmode-lib,
- [ --with-xf86vidmode-lib=
- path to the XF86VidMode library.
- e.g. /usr/X11R6/lib] )
-
-xf86vidmode_lib="Xxf86vm"
-
-if test "$with_xf86vidmode_lib" = no
-then
- # The user explicitly disabled the use of XF86VidMode
- have_xf86vidmode="disabled"
- AC_MSG_RESULT(disabled)
-else
- if test "$with_xf86vidmode_lib"
- then
- xf86vidmode_libraries="$with_xf86vidmode_lib"
- fi
-
- XF86VIDMODE_CFLAGS="-DXF86VIDMODE"
-fi
-
-if test -z "$have_xf86vidmode"
-# -a "$with_xf86vidmode_lib"
-then
- if test "$xf86vidmode_libraries"
- then
- XF86VIDMODE_LIBS="-L$xf86vidmode_libraries"
- fi
-
- XF86VIDMODE_LIBS="$XF86VIDMODE_LIBS -l$xf86vidmode_lib"
-
- _CPPFLAGS="$CPPFLAGS"
-
- CPPFLAGS="$CXXFLAGS $XF86VIDMODE_LIBS"
-
- AC_TRY_LINK( , , have_xf86vidmode_libraries="yes", have_xf86vidmode_libraries="no")
-
- CPPFLAGS="$_CPPFLAGS"
-
- if test "$have_xf86vidmode_libraries" = "yes"
- then
- have_xf86vidmode="yes"
- if test "$xf86vidmode_libraries"
- then
- AC_MSG_RESULT($xf86vidmode_libraries)
- else
- AC_MSG_RESULT(yes)
- fi
- else
- have_xf86vidmode="no"
- AC_MSG_RESULT(no, no fullscreen support available.)
- fi
-
- xf86vidmode_libraries="$xf86vidmode_libraries"
-
-fi
-
-AC_SUBST(XF86VIDMODE_CFLAGS)
-AC_SUBST(XF86VIDMODE_LIBS)
-
-])
-
-
-# =========================================================================
-# AM_PATH_OPENAL : OpenAL checking macros
-
-AC_DEFUN([AM_PATH_OPENAL],
-[ is_mandatory="$1"
-
-AC_REQUIRE_CPP()
-
-# Get from the user option the path to the OpenAL files location
-AC_ARG_WITH( openal,
- [ --with-openal= path to the OpenAL install files directory.
- e.g. /usr/local])
-
-AC_ARG_WITH( openal-include,
- [ --with-openal-include=
- path to the OpenAL header files directory.
- e.g. /usr/local/include])
-
-AC_ARG_WITH( openal-lib,
- [ --with-openal-lib=
- path to the OpenAL library files directory.
- e.g. /usr/local/lib])
-
-openal_lib="openal"
-alut_lib="alut"
-
-if test $with_openal
-then
- openal_includes="$with_openal/include"
- openal_libraries="$with_openal/lib"
-fi
-
-if test "$with_openal_include"
-then
- openal_includes="$with_openal_include"
-fi
-
-if test "$with_openal_lib"
-then
- openal_libraries="$with_openal_lib"
-fi
-
-
-# Set OPENAL_CFLAGS
-if test "$openal_includes"
-then
- OPENAL_CFLAGS="-I$openal_includes"
-fi
-
-# Set OPENAL_LIBS
-if test "$openal_libraries"
-then
- OPENAL_LIBS="-L$openal_libraries"
-fi
-OPENAL_LIBS="$OPENAL_LIBS -l$openal_lib -l$alut_lib"
-
-_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CXXFLAGS $OPENAL_CFLAGS"
-
-AC_MSG_CHECKING(for OpenAL headers)
-AC_EGREP_CPP( yo_openal,
-[#include
-#include
-#ifdef AL_VERSION
- yo_openal
-#endif],
- have_openal_headers="yes",
- have_openal_headers="no" )
-
-if test "$have_openal_headers" = "yes"
-then
- if test "$openal_includes"
- then
- AC_MSG_RESULT([$openal_includes])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-# Test the libraries
-AC_MSG_CHECKING(for OpenAL libraries)
-
-CPPFLAGS="$CXXFLAGS $OPENAL_LIBS"
-
-AC_TRY_LINK( , , have_openal_libraries="yes", have_openal_libraries="no")
-
-CPPFLAGS="$_CPPFLAGS"
-
-if test "$have_openal_libraries" = "yes"
-then
- if test "$openal_libraries"
- then
- AC_MSG_RESULT([$openal_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-openal_libraries="$openal_libraries"
-
-if test "$have_openal_headers" = "yes" \
- && test "$have_openal_libraries" = "yes"
-then
- have_openal="yes"
-else
- have_openal="no"
-fi
-
-if test "$have_openal" = "no" -a "$is_mandatory" = "yes"
-then
- AC_MSG_ERROR([OpenAL is needed to compile NeL (http://www.openal.org).])
-fi
-
-AC_SUBST(OPENAL_CFLAGS)
-AC_SUBST(OPENAL_LIBS)
-AC_SUBST([have_openal])
-
-])
-
-
-# =========================================================================
-# AM_PATH_PYTHON : Python checking macros
-
-AC_DEFUN([AM_PATH_PYTHON],
-[ python_version_required="$1"
-
-is_mandatory="$2"
-
-AC_REQUIRE_CPP()
-
-# Get from the user option the path to the Python files location
-AC_ARG_WITH( python,
- [ --with-python= path to the Python prefix installation directory.
- e.g. /usr/local],
- [ PYTHON_PREFIX=$with_python ]
-)
-
-AC_ARG_WITH( python-version,
- [ --with-python-version=
- Python version to use, e.g. 1.5],
- [ PYTHON_VERSION=$with_python_version ]
-)
-
-if test ! "$PYTHON_PREFIX" = ""
-then
- PATH="$PYTHON_PREFIX/bin:$PATH"
-fi
-
-if test ! "$PYTHON_VERSION" = ""
-then
- PYTHON_EXEC="python$PYTHON_VERSION"
-else
- PYTHON_EXEC="python python2.1 python2.0 python1.5"
-fi
-
-AC_PATH_PROGS(PYTHON, $PYTHON_EXEC, no, $PATH)
-
-if test "$PYTHON" != "no"
-then
- PYTHON_PREFIX=`$PYTHON -c 'import sys; print "%s" % (sys.prefix)'`
- PYTHON_VERSION=`$PYTHON -c 'import sys; print "%s" % (sys.version[[:3]])'`
-
- is_python_version_enough=`expr $python_version_required \<= $PYTHON_VERSION`
-fi
-
-
-if test "$PYTHON" = "no" || test "$is_python_version_enough" != "1"
-then
-
- if test "$is_mandatory" = "yes"
- then
- AC_MSG_ERROR([Python $python_version_required must be installed (http://www.python.org)])
- else
- have_python="no"
- fi
-
-else
-
- python_includes="$PYTHON_PREFIX/include/python$PYTHON_VERSION"
- python_libraries="$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config"
- python_lib="python$PYTHON_VERSION"
-
- PYTHON_CFLAGS="-I$python_includes"
- PYTHON_LIBS="-L$python_libraries -l$python_lib"
-
- _CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CXXFLAGS ${PYTHON_CFLAGS}"
-
- # Test the headers
- AC_MSG_CHECKING(for Python headers)
-
- AC_EGREP_CPP( yo_python,
- [#include
- yo_python
- ],
- have_python_headers="yes",
- have_python_headers="no" )
-
- if test "$have_python_headers" = "yes"
- then
- AC_MSG_RESULT([$python_includes])
- else
- AC_MSG_RESULT(no)
- fi
-
- # Test the libraries
- AC_MSG_CHECKING(for Python libraries)
-
- CPPFLAGS="$CXXFLAGS $PYTHON_CFLAGS"
-
- AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no")
-
- CPPFLAGS="$_CPPFLAGS"
-
- if test "$have_python_libraries" = "yes"
- then
- if test "$python_libraries"
- then
- AC_MSG_RESULT([$python_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
- else
- AC_MSG_RESULT(no)
- fi
-
- if test "$have_python_headers" = "yes" \
- && test "$have_python_libraries" = "yes"
- then
- have_python="yes"
- else
- have_python="no"
- fi
-
- if test "$have_python" = "no" -a "$is_mandatory" = "yes"
- then
- AC_MSG_ERROR([Python is needed to compile NeL (http://www.python.org).])
- fi
-
- AC_SUBST(PYTHON_CFLAGS)
- AC_SUBST(PYTHON_LIBS)
-
-fi
-
-])
-
-# =========================================================================
-# AM_PATH_MYSQL : MySQL library
-
-# AM_PATH_MYSQL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-# Test for MYSQL, and define MYSQL_CFLAGS and MYSQL_LIBS
-#
-AC_DEFUN([AM_PATH_MYSQL],
-[#
-# Get the cflags and libraries from the mysql_config script
-#
-AC_ARG_WITH(mysql-prefix,[ --with-mysql-prefix=PFX Prefix where MYSQL is installed (optional)],
- mysql_prefix="$withval", mysql_prefix="")
-AC_ARG_WITH(mysql-exec-prefix,[ --with-mysql-exec-prefix=PFX Exec prefix where MYSQL is installed (optional)],
- mysql_exec_prefix="$withval", mysql_exec_prefix="")
-AC_ARG_ENABLE(mysqltest, [ --disable-mysqltest Do not try to compile and run a test MYSQL program],
- , enable_mysqltest=yes)
-
- if test x$mysql_exec_prefix != x ; then
- mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix"
- if test x${MYSQL_CONFIG+set} != xset ; then
- MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config
- fi
- fi
- if test x$mysql_prefix != x ; then
- mysql_args="$mysql_args --prefix=$mysql_prefix"
- if test x${MYSQL_CONFIG+set} != xset ; then
- MYSQL_CONFIG=$mysql_prefix/bin/mysql_config
- fi
- fi
-
- AC_REQUIRE([AC_CANONICAL_TARGET])
- AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
- min_mysql_version=ifelse([$1], ,0.11.0,$1)
- AC_MSG_CHECKING(for MYSQL - version >= $min_mysql_version)
- no_mysql=""
- if test "$MYSQL_CONFIG" = "no" ; then
- no_mysql=yes
- else
- MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags | sed -e "s/'//g"`
- MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs | sed -e "s/'//g"`
-
- mysql_major_version=`$MYSQL_CONFIG $mysql_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- mysql_minor_version=`$MYSQL_CONFIG $mysql_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- mysql_micro_version=`$MYSQL_CONFIG $mysql_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x$enable_mysqltest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $MYSQL_CFLAGS"
- LIBS="$LIBS $MYSQL_LIBS"
-#
-# Now check if the installed MYSQL is sufficiently new. (Also sanity
-# checks the results of mysql_config to some extent
-#
- rm -f conf.mysqltest
- AC_TRY_RUN([
-#include
-#include
-#include
-#include
-
-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.mysqltest");
- */
- { FILE *fp = fopen("conf.mysqltest", "a"); if ( fp ) fclose(fp); }
-
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = my_strdup("$min_mysql_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
- printf("%s, bad version string\n", "$min_mysql_version");
- exit(1);
- }
-
- if (($mysql_major_version > major) ||
- (($mysql_major_version == major) && ($mysql_minor_version > minor)) ||
- (($mysql_major_version == major) && ($mysql_minor_version == minor) && ($mysql_micro_version >= micro)))
- {
- return 0;
- }
- else
- {
- printf("\n*** 'mysql_config --version' returned %d.%d.%d, but the minimum version\n", $mysql_major_version, $mysql_minor_version, $mysql_micro_version);
- printf("*** of MYSQL required is %d.%d.%d. If mysql_config is correct, then it is\n", major, minor, micro);
- printf("*** best to upgrade to the required version.\n");
- printf("*** If mysql_config was wrong, set the environment variable MYSQL_CONFIG\n");
- printf("*** to point to the correct copy of mysql_config, and remove the file\n");
- printf("*** config.cache before re-running configure\n");
- return 1;
- }
-}
-
-],, no_mysql=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- if test "x$no_mysql" = x ; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
- else
- AC_MSG_RESULT(no)
- if test "$MYSQL_CONFIG" = "no" ; then
- echo "*** The mysql_config script installed by MYSQL could not be found"
- echo "*** If MYSQL was installed in PREFIX, make sure PREFIX/bin is in"
- echo "*** your path, or set the MYSQL_CONFIG environment variable to the"
- echo "*** full path to mysql_config."
- else
- if test -f conf.mysqltest ; then
- :
- else
- echo "*** Could not run MYSQL test program, checking why..."
- CFLAGS="$CFLAGS $MYSQL_CFLAGS"
- LIBS="$LIBS $MYSQL_LIBS"
- AC_TRY_LINK([
-#include
-#include
-
-int main(int argc, char *argv[])
-{ return 0; }
-#undef main
-#define main K_and_R_C_main
-], [ return 0; ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding MYSQL or finding the wrong"
- echo "*** version of MYSQL. If it is not finding MYSQL, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means MYSQL was incorrectly installed"
- echo "*** or that you have moved MYSQL since it was installed. In the latter case, you"
- echo "*** may want to edit the mysql_config script: $MYSQL_CONFIG" ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- MYSQL_CFLAGS=""
- MYSQL_LIBS=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(MYSQL_CFLAGS)
- AC_SUBST(MYSQL_LIBS)
- rm -f conf.mysqltest
-])
-
-# =========================================================================
-# AM_PATH_FMOD : FMOD checking macros
-
-AC_DEFUN([AM_PATH_FMOD],
-[ is_mandatory="$1"
-
-AC_REQUIRE_CPP()
-
-# Get from the user option the path to the FMOD files location
-AC_ARG_WITH( fmod,
- [ --with-fmod= path to the FMOD install files directory.
- e.g. /usr/local])
-
-AC_ARG_WITH( fmod-include,
- [ --with-fmod-include=
- path to the FMOD header files directory.
- e.g. /usr/local/include])
-
-AC_ARG_WITH( fmod-lib,
- [ --with-fmod-lib=
- path to the FMOD library files directory.
- e.g. /usr/local/lib])
-
-fmod_lib="fmod"
-
-if test $with_fmod
-then
- fmod_includes="$with_fmod/include"
- fmod_libraries="$with_fmod/lib"
-fi
-
-if test "$with_fmod_include"
-then
- fmod_includes="$with_fmod_include"
-fi
-
-if test "$with_fmod_lib"
-then
- fmod_libraries="$with_fmod_lib"
-fi
-
-
-# Set FMOD_CFLAGS
-if test "$fmod_includes"
-then
- FMOD_CFLAGS="-I$fmod_includes"
-fi
-
-# Set FMOD_LIBS
-if test "$fmod_libraries"
-then
- FMOD_LIBS="-L$fmod_libraries"
-fi
-FMOD_LIBS="$FMOD_LIBS -l$fmod_lib"
-
-_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CXXFLAGS $FMOD_CFLAGS"
-
-AC_MSG_CHECKING(for FMOD headers)
-AC_EGREP_CPP( yo_fmod,
-[#include
-#ifdef FMOD_VERSION
- yo_fmod
-#endif],
- have_fmod_headers="yes",
- have_fmod_headers="no" )
-
-if test "$have_fmod_headers" = "yes"
-then
- if test "$fmod_includes"
- then
- AC_MSG_RESULT([$fmod_includes])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-# Test the libraries
-AC_MSG_CHECKING(for FMOD libraries)
-
-CPPFLAGS="$CXXFLAGS $FMOD_LIBS"
-
-AC_TRY_LINK( , , have_fmod_libraries="yes", have_fmod_libraries="no")
-
-CPPFLAGS="$_CPPFLAGS"
-
-if test "$have_fmod_libraries" = "yes"
-then
- if test "$fmod_libraries"
- then
- AC_MSG_RESULT([$fmod_libraries])
- else
- AC_MSG_RESULT(yes)
- fi
-else
- AC_MSG_RESULT(no)
-fi
-
-fmod_libraries="$fmod_libraries"
-
-if test "$have_fmod_headers" = "yes" \
- && test "$have_fmod_libraries" = "yes"
-then
- have_fmod="yes"
-else
- have_fmod="no"
-fi
-
-if test "$have_fmod" = "no" -a "$is_mandatory" = "yes"
-then
- AC_MSG_ERROR([FMOD is needed to compile NeL (http://www.fmod.org).])
-fi
-
-AC_SUBST(FMOD_CFLAGS)
-AC_SUBST(FMOD_LIBS)
-AC_SUBST([have_fmod])
-
-])
-
-# =========================================================================
-# End of file
-
diff --git a/code/nel/autogen.sh b/code/nel/autogen.sh
deleted file mode 100755
index b863e1067..000000000
--- a/code/nel/autogen.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh -
-
-WANT_AUTOMAKE="1.6"
-
-case `uname -s` in
-Darwin)
- LIBTOOLIZE=glibtoolize
- ;;
-*)
- LIBTOOLIZE=libtoolize
- ;;
-esac
-
-# be able to customize the aclocal (for example to add extra param)
-if test "x$ACLOCAL" = "x"
-then
- ACLOCAL=aclocal
-fi
-
-echo "Creating macros..." && \
-$ACLOCAL -I automacros/ && \
-echo "Creating library tools..." && \
-$LIBTOOLIZE --force && \
-echo "Creating header templates..." && \
-autoheader && \
-echo "Creating Makefile templates..." && \
-automake --gnu --add-missing && \
-echo "Creating 'configure'..." && \
-autoconf && \
-echo "" && \
-echo "Run: ./configure; make; make install" && \
-echo ""
diff --git a/code/nel/automacros/gtk-2.0.m4 b/code/nel/automacros/gtk-2.0.m4
deleted file mode 100644
index 3deba01be..000000000
--- a/code/nel/automacros/gtk-2.0.m4
+++ /dev/null
@@ -1,196 +0,0 @@
-# Configure paths for GTK+
-# Owen Taylor 1997-2001
-
-dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
-dnl pass to pkg-config
-dnl
-AC_DEFUN([AM_PATH_GTK_2_0],
-[dnl
-dnl Get the cflags and libraries from pkg-config
-dnl
-AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
- , enable_gtktest=yes)
-
- pkg_config_args=gtk+-2.0
- for module in . $4
- do
- case "$module" in
- gthread)
- pkg_config_args="$pkg_config_args gthread-2.0"
- ;;
- esac
- done
-
- no_gtk=""
-
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-
- if test x$PKG_CONFIG != xno ; then
- if pkg-config --atleast-pkgconfig-version 0.7 ; then
- :
- else
- echo "*** pkg-config too old; version 0.7 or better required."
- no_gtk=yes
- PKG_CONFIG=no
- fi
- else
- no_gtk=yes
- fi
-
- min_gtk_version=ifelse([$1], ,2.0.0,$1)
- AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
-
- if test x$PKG_CONFIG != xno ; then
- ## don't try to run the test against uninstalled libtool libs
- if $PKG_CONFIG --uninstalled $pkg_config_args; then
- echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
- enable_gtktest=no
- fi
-
- if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
- :
- else
- no_gtk=yes
- fi
- fi
-
- if test x"$no_gtk" = x ; then
- GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
- GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
- gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x$enable_gtktest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $GTK_CFLAGS"
- LIBS="$GTK_LIBS $LIBS"
-dnl
-dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
-dnl checks the results of pkg-config to some extent)
-dnl
- rm -f conf.gtktest
- AC_TRY_RUN([
-#include
-#include
-#include
-
-int
-main ()
-{
- int major, minor, micro;
- char *tmp_version;
-
- system ("touch conf.gtktest");
-
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = g_strdup("$min_gtk_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
- printf("%s, bad version string\n", "$min_gtk_version");
- exit(1);
- }
-
- if ((gtk_major_version != $gtk_config_major_version) ||
- (gtk_minor_version != $gtk_config_minor_version) ||
- (gtk_micro_version != $gtk_config_micro_version))
- {
- printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
- $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
- gtk_major_version, gtk_minor_version, gtk_micro_version);
- printf ("*** was found! If pkg-config was correct, then it is best\n");
- printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
- printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
- printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
- printf("*** required on your system.\n");
- printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
- printf("*** to point to the correct configuration files\n");
- }
- else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
- (gtk_minor_version != GTK_MINOR_VERSION) ||
- (gtk_micro_version != GTK_MICRO_VERSION))
- {
- printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
- GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
- printf("*** library (version %d.%d.%d)\n",
- gtk_major_version, gtk_minor_version, gtk_micro_version);
- }
- else
- {
- if ((gtk_major_version > major) ||
- ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
- ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
- {
- return 0;
- }
- else
- {
- printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
- gtk_major_version, gtk_minor_version, gtk_micro_version);
- printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
- major, minor, micro);
- printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
- printf("***\n");
- printf("*** If you have already installed a sufficiently new version, this error\n");
- printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
- printf("*** being found. The easiest way to fix this is to remove the old version\n");
- printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
- printf("*** correct copy of pkg-config. (In this case, you will have to\n");
- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
- printf("*** so that the correct libraries are found at run-time))\n");
- }
- }
- return 1;
-}
-],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- if test "x$no_gtk" = x ; then
- AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
- ifelse([$2], , :, [$2])
- else
- AC_MSG_RESULT(no)
- if test "$PKG_CONFIG" = "no" ; then
- echo "*** A new enough version of pkg-config was not found."
- echo "*** See http://pkgconfig.sourceforge.net"
- else
- if test -f conf.gtktest ; then
- :
- else
- echo "*** Could not run GTK+ test program, checking why..."
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $GTK_CFLAGS"
- LIBS="$LIBS $GTK_LIBS"
- AC_TRY_LINK([
-#include
-#include
-], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
- echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- GTK_CFLAGS=""
- GTK_LIBS=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(GTK_CFLAGS)
- AC_SUBST(GTK_LIBS)
- rm -f conf.gtktest
-])
diff --git a/code/nel/automacros/ogg.m4 b/code/nel/automacros/ogg.m4
deleted file mode 100644
index 0e1f1abf5..000000000
--- a/code/nel/automacros/ogg.m4
+++ /dev/null
@@ -1,102 +0,0 @@
-# Configure paths for libogg
-# Jack Moffitt 10-21-2000
-# Shamelessly stolen from Owen Taylor and Manish Singh
-
-dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
-dnl
-AC_DEFUN([XIPH_PATH_OGG],
-[dnl
-dnl Get the cflags and libraries
-dnl
-AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
-AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
-AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
-AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
-
- if test "x$ogg_libraries" != "x" ; then
- OGG_LIBS="-L$ogg_libraries"
- elif test "x$ogg_prefix" != "x" ; then
- OGG_LIBS="-L$ogg_prefix/lib"
- elif test "x$prefix" != "xNONE" ; then
- OGG_LIBS="-L$prefix/lib"
- fi
-
- OGG_LIBS="$OGG_LIBS -logg"
-
- if test "x$ogg_includes" != "x" ; then
- OGG_CFLAGS="-I$ogg_includes"
- elif test "x$ogg_prefix" != "x" ; then
- OGG_CFLAGS="-I$ogg_prefix/include"
- elif test "x$prefix" != "xNONE"; then
- OGG_CFLAGS="-I$prefix/include"
- fi
-
- AC_MSG_CHECKING(for Ogg)
- no_ogg=""
-
-
- if test "x$enable_oggtest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $OGG_CFLAGS"
- LIBS="$LIBS $OGG_LIBS"
-dnl
-dnl Now check if the installed Ogg is sufficiently new.
-dnl
- rm -f conf.oggtest
- AC_TRY_RUN([
-#include
-#include
-#include
-#include
-
-int main ()
-{
- system("touch conf.oggtest");
- return 0;
-}
-
-],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
-
- if test "x$no_ogg" = "x" ; then
- AC_MSG_RESULT(yes)
- ifelse([$1], , :, [$1])
- else
- AC_MSG_RESULT(no)
- if test -f conf.oggtest ; then
- :
- else
- echo "*** Could not run Ogg test program, checking why..."
- CFLAGS="$CFLAGS $OGG_CFLAGS"
- LIBS="$LIBS $OGG_LIBS"
- AC_TRY_LINK([
-#include
-#include
-], [ return 0; ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding Ogg or finding the wrong"
- echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
- echo "*** or that you have moved Ogg since it was installed." ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- OGG_CFLAGS=""
- OGG_LIBS=""
- ifelse([$2], , :, [$2])
- fi
- AC_SUBST(OGG_CFLAGS)
- AC_SUBST(OGG_LIBS)
- rm -f conf.oggtest
-])
diff --git a/code/nel/automacros/pkg.m4 b/code/nel/automacros/pkg.m4
deleted file mode 100644
index c29b6c057..000000000
--- a/code/nel/automacros/pkg.m4
+++ /dev/null
@@ -1,157 +0,0 @@
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-#
-# Copyright © 2004 Scott James Remnant .
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=m4_default([$1], [0.9.0])
- AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- PKG_CONFIG=""
- fi
-
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
-
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-#
-# Similar to PKG_CHECK_MODULES, make sure that the first instance of
-# this or PKG_CHECK_MODULES is called, or make sure to call
-# PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
- AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
- m4_ifval([$2], [$2], [:])
-m4_ifvaln([$3], [else
- $3])dnl
-fi])
-
-
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$PKG_CONFIG"; then
- if test -n "$$1"; then
- pkg_cv_[]$1="$$1"
- else
- PKG_CHECK_EXISTS([$3],
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
- [pkg_failed=yes])
- fi
-else
- pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
-
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
-
-
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
-
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
-
-if test $pkg_failed = yes; then
- _PKG_SHORT_ERRORS_SUPPORTED
- if test $_pkg_short_errors_supported = yes; then
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
- else
- $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-
- ifelse([$4], , [AC_MSG_ERROR(dnl
-[Package requirements ($2) were not met:
-
-$$1_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-_PKG_TEXT
-])],
- [AC_MSG_RESULT([no])
- $4])
-elif test $pkg_failed = untried; then
- ifelse([$4], , [AC_MSG_FAILURE(dnl
-[The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-_PKG_TEXT
-
-To get pkg-config, see .])],
- [$4])
-else
- $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
- $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
- AC_MSG_RESULT([yes])
- ifelse([$3], , :, [$3])
-fi[]dnl
-])# PKG_CHECK_MODULES
diff --git a/code/nel/automacros/vorbis.m4 b/code/nel/automacros/vorbis.m4
deleted file mode 100644
index 300cc6c7d..000000000
--- a/code/nel/automacros/vorbis.m4
+++ /dev/null
@@ -1,122 +0,0 @@
-# Configure paths for libvorbis
-# Jack Moffitt 10-21-2000
-# Shamelessly stolen from Owen Taylor and Manish Singh
-# thomasvs added check for vorbis_bitrate_addblock which is new in rc3
-
-dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
-dnl
-AC_DEFUN([XIPH_PATH_VORBIS],
-[dnl
-dnl Get the cflags and libraries
-dnl
-AC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
-AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="")
-AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="")
-AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
-
- if test "x$vorbis_libraries" != "x" ; then
- VORBIS_LIBS="-L$vorbis_libraries"
- elif test "x$vorbis_prefix" != "x" ; then
- VORBIS_LIBS="-L$vorbis_prefix/lib"
- elif test "x$prefix" != "xNONE"; then
- VORBIS_LIBS="-L$prefix/lib"
- fi
-
- VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"
- VORBISFILE_LIBS="-lvorbisfile"
- VORBISENC_LIBS="-lvorbisenc"
-
- if test "x$vorbis_includes" != "x" ; then
- VORBIS_CFLAGS="-I$vorbis_includes"
- elif test "x$vorbis_prefix" != "x" ; then
- VORBIS_CFLAGS="-I$vorbis_prefix/include"
- elif test "x$prefix" != "xNONE"; then
- VORBIS_CFLAGS="-I$prefix/include"
- fi
-
-
- AC_MSG_CHECKING(for Vorbis)
- no_vorbis=""
-
-
- if test "x$enable_vorbistest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS"
- LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
-dnl
-dnl Now check if the installed Vorbis is sufficiently new.
-dnl
- rm -f conf.vorbistest
- AC_TRY_RUN([
-#include
-#include
-#include
-#include
-#include
-
-int main ()
-{
- vorbis_block vb;
- vorbis_dsp_state vd;
- vorbis_info vi;
-
- vorbis_info_init (&vi);
- vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1);
- vorbis_analysis_init (&vd, &vi);
- vorbis_block_init (&vd, &vb);
- /* this function was added in 1.0rc3, so this is what we're testing for */
- vorbis_bitrate_addblock (&vb);
-
- system("touch conf.vorbistest");
- return 0;
-}
-
-],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
-
- if test "x$no_vorbis" = "x" ; then
- AC_MSG_RESULT(yes)
- ifelse([$1], , :, [$1])
- else
- AC_MSG_RESULT(no)
- if test -f conf.vorbistest ; then
- :
- else
- echo "*** Could not run Vorbis test program, checking why..."
- CFLAGS="$CFLAGS $VORBIS_CFLAGS"
- LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
- AC_TRY_LINK([
-#include
-#include
-], [ return 0; ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
- echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means Vorbis was incorrectly installed"
- echo "*** or that you have moved Vorbis since it was installed." ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- VORBIS_CFLAGS=""
- VORBIS_LIBS=""
- VORBISFILE_LIBS=""
- VORBISENC_LIBS=""
- ifelse([$2], , :, [$2])
- fi
- AC_SUBST(VORBIS_CFLAGS)
- AC_SUBST(VORBIS_LIBS)
- AC_SUBST(VORBISFILE_LIBS)
- AC_SUBST(VORBISENC_LIBS)
- rm -f conf.vorbistest
-])
diff --git a/code/nel/configure.ac b/code/nel/configure.ac
deleted file mode 100644
index 84edccc05..000000000
--- a/code/nel/configure.ac
+++ /dev/null
@@ -1,599 +0,0 @@
-# ====================================================================
-# Configuration script for NeL
-# ====================================================================
-#
-# $Id: configure.ac,v 1.8 2005/04/14 15:54:32 cado Exp $
-#
-
-# ====================================================================
-# Process this file with autoconf to produce a configure script.
-# ====================================================================
-
-# If you want to change the version, must must change AC_INIT
-# *and* AC_SUBST(LIBTOOL_VERSION)
-
-AC_PREREQ(2.57)
-AC_INIT([nel],[0.8.0],[nel-all@nevrax.org])
-AM_INIT_AUTOMAKE([tar-ustar])
-
-AC_CONFIG_SRCDIR(include/nel/misc/types_nl.h)
-AM_CONFIG_HEADER(include/nelconfig.h)
-
-AC_SUBST(LIBTOOL_VERSION, [0:7:0])
-
-# Checks for programs.
-AC_CANONICAL_HOST
-AC_PROG_CXX
-AC_PROG_CPP
-AC_PROG_YACC
-AC_PROG_LEX
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-AC_PROG_LIBTOOL
-AM_PROG_LIBTOOL
-AM_SANITY_CHECK
-
-AC_SYS_LARGEFILE
-
-AM_MAINTAINER_MODE
-
-
-# Template needed to generate the nelconfig.h.in
-AH_TEMPLATE([NEL_DEFAULT_DISPLAYER],[Define to 1 if you want log on standard output])
-AH_TEMPLATE([NEL_LOG_IN_FILE],[Define to 1 if you want a debug log.log file in the current directory])
-AH_TEMPLATE([HAVE_X86],[Define to 1 if you are on a INTEL compatible processor])
-AH_TEMPLATE([HAVE_X86_64],[Define to 1 if you are on AMD opteron 64bits processor])
-AH_TEMPLATE([NL_USE_GTK], [Define to 1 if you want GTK support])
-
-# Get host type info
-if test "$host_cpu" = "i386" -o "$host_cpu" = "i486" -o "$host_cpu" = "i586" \
- -o "$host_cpu" = "i686" -o "$host_cpu" = "i786" -o "$host_cpu" = "x86_64"
-then
- AC_DEFINE([HAVE_X86])
-fi
-
-if test "$host_cpu" = "x86_64"
-then
- AC_DEFINE([HAVE_X86_64])
-fi
-
-# The following hack should ensure that configure doesnt add optimizing
-# or debugging flags to CFLAGS or CXXFLAGS
-CXXFLAGS="$CXXFLAGS -fno-strict-aliasing -ftemplate-depth-24 -fno-stack-protector"
-
-
-# ====================================================================
-# Checks NeL modules (net, 3d) to install / Disable
-# ====================================================================
-
-# The misc is mandatory, it is use by the other modules.
-
-NEL_SUBDIRS="misc"
-
-# NeL libraries that are enabled by default
-
-# Network library
-AC_ARG_ENABLE([net],
- AC_HELP_STRING([--disable-net],
- [disable compilation and install of NeL Network]),
- [],
- [enable_net=yes])
-
-if test "$enable_net" = "no"
-then
- AC_MSG_RESULT([disable NeL Network])
-else
- NEL_SUBDIRS="$NEL_SUBDIRS net"
-fi
-
-# 3D library
-AC_ARG_ENABLE([3d],
- AC_HELP_STRING([--disable-3d],
- [disable compilation and install of NeL 3D]),
- [],
- [enable_3d=yes])
-
-if test "$enable_3d" = "no"
-then
- AC_MSG_RESULT([disable NeL 3D])
-else
- NEL_SUBDIRS="$NEL_SUBDIRS 3d"
-fi
-
-# PACS library
-AC_ARG_ENABLE([pacs],
- AC_HELP_STRING([--disable-pacs],
- [disable compilation and install of NeL PACS]),
- [],
- [enable_pacs=yes])
-
-if test "$enable_pacs" = "no"
-then
- AC_MSG_RESULT([disable NeL PACS])
-else
- NEL_SUBDIRS="$NEL_SUBDIRS pacs"
-fi
-
-# Georges library
-AC_ARG_ENABLE([georges],
- AC_HELP_STRING([--disable-georges],
- [disable compilation and install of NeL Georges]),
- [],
- [enable_georges=yes])
-
-if test "$enable_georges" = "no"
-then
- AC_MSG_RESULT([disable NeL Georges])
-else
- NEL_SUBDIRS="$NEL_SUBDIRS georges"
-fi
-
-# Ligo library
-AC_ARG_ENABLE([ligo],
- AC_HELP_STRING([--disable-ligo],
- [disable compilation and install of NeL Ligo]),
- [],
- [enable_ligo=yes])
-
-if test "$enable_ligo" = "no"
-then
- AC_MSG_RESULT([disable NeL Ligo])
-else
- NEL_SUBDIRS="$NEL_SUBDIRS ligo"
-fi
-
-
-# NeL libraries that are disabled by default
-
-# Sound library
-AC_ARG_ENABLE([sound],
- AC_HELP_STRING([--enable-sound],
- [enable compilation and install of NeL Sound]),
- [],
- [enable_sound=no])
-
-if test "$enable_sound" = "yes"
-then
- AC_MSG_RESULT([enable NeL Sound])
- NEL_SUBDIRS="$NEL_SUBDIRS sound"
-fi
-
-# CEGUI Renderer library
-AC_ARG_ENABLE([cegui],
- AC_HELP_STRING([--enable-cegui],
- [enable compilation and install of NeL CEGUI Renderer]),
- [],
- [enable_cegui=no])
-
-CEGUI_SUBDIR=""
-if test "$enable_cegui" = "yes"
-then
- AC_MSG_RESULT([enable NeL CEGUI Renderer])
- NEL_SUBDIRS="$NEL_SUBDIRS cegui"
- CEGUI_SUBDIR="cegui"
-fi
-
-# Unit Tests
-AC_ARG_ENABLE([tests],
- AC_HELP_STRING([--enable-tests],
- [enable unit tests of NeL]),
- [],
- [enable_tests=no])
-
-if test "$enable_tests" = "yes"
-then
- AC_MSG_RESULT([enable NeL Unit Tests])
-fi
-
-# Code Coverage
-AC_ARG_ENABLE([coverage],
- AC_HELP_STRING([--enable-coverage],
- [enable code coverage generation]),
- []
- [enable_coverage=no])
-
-if test "$enable_coverage" = "yes"
-then
- AC_MSG_RESULT([enable Code Coverage generation])
-
- CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
-fi
-
-# Enable/disable samples compilation.
-AC_ARG_ENABLE([samples],
- AC_HELP_STRING([--disable-samples],
- [disable sample code]),
- [],
- [enable_samples="yes"])
-
-if test "$enable_samples" = "no"
-then
- AC_MSG_RESULT([disable sample code.])
- SAMPLE_SUBDIR=""
-else
- SAMPLE_SUBDIR="samples"
-fi
-
-# Enable/disable tools compilation.
-AC_ARG_ENABLE([tools],
- AC_HELP_STRING([--disable-tools],
- [disable tools code]),
- [],
- [enable_tools="yes"])
-
-if test "$enable_tools" = "no"
-then
- AC_MSG_RESULT([disable tools code.])
- TOOLS_SUBDIR=""
-else
- TOOLS_SUBDIR="tools"
-fi
-
-AC_SUBST([enable_net])
-AC_SUBST([enable_3d])
-AC_SUBST([enable_pacs])
-AC_SUBST([enable_sound])
-AC_SUBST([enable_georges])
-AC_SUBST([enable_ligo])
-AC_SUBST([enable_cegui])
-
-AC_SUBST([NEL_SUBDIRS])
-AC_SUBST([SAMPLE_SUBDIR])
-AC_SUBST([TOOLS_SUBDIR])
-AC_SUBST([CEGUI_SUBDIR])
-
-# ====================================================================
-# Checks for programs.
-# ====================================================================
-
-# ====================================================================
-# Configure Settings
-# ====================================================================
-
-# Disable the static linking by default
-# AC_DISABLE_STATIC
-
-# Use C++ compiler as a default for the compilation tests.
-AC_LANG([C++])
-
-
-# ====================================================================
-# Debug/optimized compilation mode
-# ====================================================================
-
-AM_NEL_DEBUG
-
-AC_ARG_WITH([logging],
- AC_HELP_STRING([--without-logging],
- [be silent on stdout and in no log.log]),
- [],
- [with_logging=yes])
-
-if test "$with_logging" = "yes"
-then
- AC_DEFINE([NEL_DEFAULT_DISPLAYER], 1)
- AC_DEFINE([NEL_LOG_IN_FILE], 1)
-fi
-
-# ====================================================================
-# Checks for typedefs, structures, and compiler characteristics.
-# ====================================================================
-
-# Test endianness
-AC_C_BIGENDIAN
-
-# Supress GCC "multi-character character constant" warnings.
-if test "$ac_cv_cxx_compiler_gnu" = "yes";
-then
- if test "$with_debug" = "yes"
- then
- #
- # When debugging variables are declared for the sole purpose of
- # inspecting their content with a debugger. They are not used
- # in the code itself and this is legitimate, hence the -Wno-unused
- #
- CXXFLAGS="$CXXFLAGS -Wno-unused"
- fi
-fi
-
-# Add some common define
-if test "$ac_cv_cxx_compiler_gnu" = "yes";
-then
- CXXFLAGS="$CXXFLAGS -D_REENTRANT -Wall -ansi -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-long-long -Wno-unused"
-fi
-
-
-# ====================================================================
-# Checks for header and lib files.
-# ====================================================================
-
-AC_FUNC_ALLOCA
-AC_HEADER_DIRENT
-AC_HEADER_STDC
-AC_HEADER_TIME
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h malloc.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h sys/time.h])
-AC_CHECK_LIB([pthread], [pthread_create])
-AC_CHECK_LIB([dl], [dlopen])
-
-
-# ====================================================================
-# Checks for typedefs, structures, and compiler characteristics.
-# ====================================================================
-
-AC_HEADER_STDBOOL
-AC_C_CONST
-AC_C_INLINE
-AC_TYPE_SIZE_T
-AC_HEADER_TIME
-AC_STRUCT_TM
-AC_C_VOLATILE
-AC_CHECK_TYPES([ptrdiff_t])
-AC_CHECK_TYPES([size_t])
-AC_CHECK_TYPES([uintptr_t])
-
-
-# ====================================================================
-# Checks for library functions.
-# ====================================================================
-
-AC_FUNC_CLOSEDIR_VOID
-AC_FUNC_ERROR_AT_LINE
-AC_PROG_GCC_TRADITIONAL
-AC_FUNC_MALLOC
-AC_FUNC_MEMCMP
-AC_FUNC_REALLOC
-AC_FUNC_SELECT_ARGTYPES
-AC_TYPE_SIGNAL
-AC_FUNC_STAT
-AC_FUNC_STRFTIME
-AC_FUNC_FORK
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([floor getcwd gethostbyaddr gethostbyname gethostname gettimeofday inet_ntoa memmove memset mkdir pow select socket sqrt strcasecmp strchr strdup strerror strrchr strstr strtoul sys/time.h])
-
-
-# ====================================================================
-# X11
-
-AC_PATH_X
-
-if test ! "$no_x" = "yes"
-then
- if test ! X"$x_libraries" = X
- then
- LIBS="$LIBS -L$x_libraries"
- fi
-
- if test ! X"$x_includes" = X
- then
- CXXFLAGS="$CXXFLAGS -I$x_includes"
- fi
-else
- if test "$enable_3d" = "yes"
- then
- AC_MSG_ERROR([X11 must be installed for NeL 3d library, use --disable-3d if you don't need NeL 3d library])
- fi
-fi
-
-# ====================================================================
-# LibXML
-
-# Use C compiler as a default for the libxml tests.
-AC_LANG([C])
-
-AM_PATH_XML2([2.0.0], [], [AC_MSG_ERROR([libxml2 must be installed])])
-
-CXXFLAGS="$CXXFLAGS $XML_CFLAGS $XML_CPPFLAGS"
-
-LIBS="$LIBS $XML_LIBS"
-
-# Use C++ compiler as a default for the compilation tests.
-AC_LANG([C++])
-
-# ====================================================================
-# libpng
-
-AC_CHECK_HEADER(png.h, [], AC_MSG_ERROR([libpng must be installed]))
-
-# ====================================================================
-# libjpeg
-
-AC_CHECK_HEADER(jpeglib.h, [], AC_MSG_ERROR([libjpeg must be installed]))
-
-# ====================================================================
-# Checks for libraries.
-# ====================================================================
-
-# ====================================================================
-# GTK 2.0+
-
-AC_ARG_WITH([gtk],
- AC_HELP_STRING([--with-gtk],
- [add GTK dependent code like GTK displayer]),
- [],
- [with_gtk=no])
-
-if test "$with_gtk" = "yes"
-then
- AC_LANG([C])
-
- AM_PATH_GTK_2_0([2.0.0],
- CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
- LIBS="$LIBS $GTK_LIBS"
- AC_DEFINE(NL_USE_GTK, [], [Undef if you don't want to use anything GTK based like the GTK Displayer]
-)
- )
-
- AC_LANG([C++])
-
- AC_SUBST([with_gtk])
-fi
-
-# ====================================================================
-# CEGUI
-
-if test "$enable_cegui" = "yes"
-then
- PKG_CHECK_MODULES(CEGUI, CEGUI >= 0.4,
- [],
- [
- AC_MSG_ERROR([Couldn't find CEGUI or tests failed:
-$CEGUI_PKG_ERRORS
-Please go to http://crayzedsgui.sourceforge.net to get the latest, or check
-config.log to see why the tests failed, and fix it.])
- ])
-fi
-
-# ====================================================================
-# FreeType 2
-
-AM_PATH_FREETYPE($enable_3d)
-
-
-# ====================================================================
-# OpenGL
-
-AM_PATH_OPENGL($enable_3d)
-
-
-# ====================================================================
-# Check for XF86VidMode extension (-lXxf86vm)
-
-AM_PATH_XF86VIDMODE
-
-
-# ====================================================================
-# FMOD, OpenAL
-
-if test "$enable_sound" = "yes"
-then
- AM_PATH_FMOD("no")
- AM_PATH_OPENAL("no")
- if test "$have_fmod" = "no" -a "$have_openal" = "no"
- then
- AC_MSG_ERROR([Either FMod or OpenAL must be installed to use sound.])
- fi
- if test "$have_fmod" = "yes"
- then
- SOUND_SUBDIRS="fmod"
- else
- SOUND_SUBDIRS=""
- fi
- if test "$have_openal" = "yes"
- then
- SOUND_SUBDIRS="$SOUND_SUBDIRS openal"
-
- XIPH_PATH_OGG([], AC_MSG_ERROR([Driver OpenAL Requires libogg!]))
- XIPH_PATH_VORBIS([], AC_MSG_ERROR([Driver OpenAL Requires libvorbis!]))
- fi
- AC_SUBST([SOUND_SUBDIRS])
-fi
-
-
-# ====================================================================
-# CppTest
-
-#AM_PATH_CPPTEST($enable_tests)
-
-# ====================================================================
-# Arrange for the include directory to be in the search path even when
-# build is done outside the source tree
-# Put the nelconfig.h define
-CXXFLAGS="$CXXFLAGS -I\${top_srcdir}/include -DHAVE_NELCONFIG_H"
-
-# ====================================================================
-# Checks for library functions.
-# ====================================================================
-
-
-# ====================================================================
-# Output files to generate.
-# ====================================================================
-
-AC_CONFIG_FILES([Makefile \
- include/Makefile \
- include/nel/Makefile \
- include/nel/ligo/Makefile \
- include/nel/misc/Makefile \
- include/nel/net/Makefile \
- include/nel/3d/Makefile \
- include/nel/pacs/Makefile \
- include/nel/sound/Makefile \
- include/nel/georges/Makefile \
- include/nel/cegui/Makefile \
- src/Makefile \
- src/misc/Makefile \
- src/misc/nel-misc.pc \
- src/misc/config_file/Makefile \
- src/net/Makefile \
- src/3d/Makefile \
- src/3d/nel-3d.pc \
- src/3d/driver/Makefile \
- src/3d/driver/opengl/Makefile \
- src/3d/driver/opengl/nel-driverogl.pc \
- src/pacs/Makefile \
- src/sound/Makefile \
- src/sound/driver/Makefile \
- src/sound/driver/fmod/Makefile \
- src/sound/driver/openal/Makefile \
- src/georges/Makefile \
- src/ligo/Makefile \
- src/cegui/Makefile \
- tools/Makefile \
- tools/3d/Makefile \
- tools/3d/build_coarse_mesh/Makefile \
- tools/3d/build_far_bank/Makefile \
- tools/3d/build_smallbank/Makefile \
- tools/3d/ig_lighter/Makefile \
- tools/3d/ig_lighter_lib/Makefile \
- tools/3d/panoply_maker/Makefile \
- tools/3d/zone_dependencies/Makefile \
- tools/3d/zone_ig_lighter/Makefile \
- tools/3d/zone_lib/Makefile \
- tools/3d/zone_lighter/Makefile \
- tools/3d/zone_welder/Makefile \
- tools/misc/Makefile \
- tools/misc/bnp_make/Makefile \
- tools/misc/disp_sheet_id/Makefile \
- tools/misc/make_sheet_id/Makefile \
- tools/misc/xml_packer/Makefile \
- tools/pacs/Makefile \
- tools/pacs/build_ig_boxes/Makefile \
- tools/pacs/build_indoor_rbank/Makefile \
- tools/pacs/build_rbank/Makefile \
- samples/Makefile \
- samples/sound_sources/Makefile \
- samples/pacs/Makefile \
- samples/georges/Makefile \
- samples/3d/Makefile \
- samples/3d/font/Makefile \
- samples/3d/cluster_viewer/Makefile \
- samples/3d/cluster_viewer/shapes/Makefile \
- samples/3d/cluster_viewer/groups/Makefile \
- samples/3d/cluster_viewer/fonts/Makefile \
- samples/3d/cegui/Makefile \
- samples/misc/Makefile \
- samples/misc/command/Makefile \
- samples/misc/configfile/Makefile \
- samples/misc/debug/Makefile \
- samples/misc/i18n/Makefile \
- samples/misc/log/Makefile \
- samples/misc/strings/Makefile \
- samples/misc/types_check/Makefile \
- samples/net/Makefile \
- samples/net/chat/Makefile \
- samples/net/udp/Makefile \
- samples/net/login_system/Makefile \
- nel-config
-
-])
-AC_OUTPUT
-
-# samples/net/class_transport/Makefile \
-# tools/nel_unit_test/Makefile \
-# tools/nel_unit_test/misc_ut/Makefile \
-# tools/nel_unit_test/ligo_ut/Makefile \
-# tools/nel_unit_test/net_ut/Makefile \
-# tools/nel_unit_test/net_ut/net_service_lib_test/Makefile \
-# tools/nel_unit_test/net_ut/net_module_lib_test/Makefile \
-# End of configure.in
diff --git a/code/nel/include/Makefile.am b/code/nel/include/Makefile.am
deleted file mode 100644
index 193d2e405..000000000
--- a/code/nel/include/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-SUBDIRS = nel
-
-pkginclude_HEADERS = nelconfig.h
-
-# End of Makefile.am
diff --git a/code/nel/include/nel/3d/Makefile.am b/code/nel/include/nel/3d/Makefile.am
deleted file mode 100644
index 8118d8348..000000000
--- a/code/nel/include/nel/3d/Makefile.am
+++ /dev/null
@@ -1,343 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-includedir = ${prefix}/include/nel/3d
-
-include_HEADERS = \
-animatable.h \
-animated_lightmap.h \
-animated_material.h \
-animated_morph.h \
-animated_value.h \
-animation.h \
-animation_optimizer.h \
-animation_playlist.h \
-animation_set.h \
-animation_set_user.h \
-animation_time.h \
-anim_ctrl.h \
-anim_detail_trav.h \
-async_file_manager_3d.h \
-async_texture_block.h \
-async_texture_manager.h \
-bezier_patch.h \
-bloom_effect.h \
-bone.h \
-bsp_tree.h \
-camera_col.h \
-camera.h \
-channel_mixer.h \
-clip_trav.h \
-cloud.h \
-cloud_scape.h \
-cloud_scape_user.h \
-cluster.h \
-coarse_mesh_build.h \
-coarse_mesh_manager.h \
-computed_string.h \
-cube_grid.h \
-cube_map_builder.h \
-debug_vb.h \
-deform_2d.h \
-driver.h \
-driver_material_inline.h \
-driver_user.h \
-dru.h \
-event_mouse_listener.h \
-fasthls_modifier.h \
-fast_ptr_list.h \
-flare_model.h \
-flare_shape.h \
-font_generator.h \
-font_manager.h \
-frustum.h \
-heat_haze.h \
-height_map.h \
-hls_color_texture.h \
-hls_texture_bank.h \
-hls_texture_manager.h \
-hrc_trav.h \
-ig_surface_light_build.h \
-ig_surface_light.h \
-index_buffer.h \
-init_3d.h \
-instance_group_user.h \
-instance_lighter.h \
-key.h \
-landscape_collision_grid.h \
-landscape_def.h \
-landscape_face_vector_manager.h \
-landscape.h \
-landscapeig_manager.h \
-landscape_model.h \
-landscape_profile.h \
-landscape_user.h \
-landscapevb_allocator.h \
-landscapevb_info.h \
-landscape_vegetable_block.h \
-layered_ordering_table.h \
-light_contribution.h \
-light.h \
-light_influence_interpolator.h \
-lighting_manager.h \
-light_trav.h \
-light_user.h \
-load_balancing_trav.h \
-lod_character_builder.h \
-lod_character_instance.h \
-lod_character_manager.h \
-lod_character_shape_bank.h \
-lod_character_shape.h \
-lod_character_texture.h \
-logic_info.h \
-material.h \
-matrix_3x4.h \
-mesh_base.h \
-mesh_base_instance.h \
-mesh_blender.h \
-mesh_block_manager.h \
-mesh_geom.h \
-mesh.h \
-mesh_instance.h \
-mesh_morpher.h \
-mesh_mrm.h \
-mesh_mrm_instance.h \
-mesh_mrm_skinned.h \
-mesh_mrm_skinned_instance.h \
-mesh_multi_lod.h \
-mesh_multi_lod_instance.h \
-mesh_vertex_program.h \
-meshvp_per_pixel_light.h \
-meshvp_wind_tree.h \
-mini_col.h \
-motion_blur.h \
-mrm_builder.h \
-mrm_internal.h \
-mrm_level_detail.h \
-mrm_mesh.h \
-mrm_parameters.h \
-nelu.h \
-noise_3d.h \
-occlusion_query.h \
-ordering_table.h \
-packed_world.h \
-packed_zone.h \
-particle_system.h \
-particle_system_manager.h \
-particle_system_model.h \
-particle_system_process.h \
-particle_system_shape.h \
-patchdlm_context.h \
-patch.h \
-patch_rdr_pass.h \
-patchuv_locator.h \
-play_list_manager.h \
-play_list_manager_user.h \
-play_list_user.h \
-point_light.h \
-point_light_influence.h \
-point_light_model.h \
-point_light_named_array.h \
-point_light_named.h \
-portal.h \
-primitive_profile.h \
-ps_allocator.h \
-ps_attrib.h \
-ps_attrib_maker_bin_op.h \
-ps_attrib_maker_bin_op_inline.h \
-ps_attrib_maker.h \
-ps_attrib_maker_helper.h \
-ps_attrib_maker_iterators.h \
-ps_attrib_maker_template.h \
-ps_color.h \
-ps_direction.h \
-ps_dot.h \
-ps_edit.h \
-ps_emitter.h \
-ps_face.h \
-ps_face_look_at.h \
-ps_fan_light.h \
-ps_float.h \
-ps_force.h \
-ps_int.h \
-ps_iterator.h \
-ps_light.h \
-ps_located.h \
-ps_lod.h \
-ps_macro.h \
-ps_mesh.h \
-ps_misc.h \
-ps_particle2.h \
-ps_particle_basic.h \
-ps_particle.h \
-ps_plane_basis.h \
-ps_plane_basis_maker.h \
-ps_quad.h \
-ps_register_color_attribs.h \
-ps_register_float_attribs.h \
-ps_register_int_attribs.h \
-ps_register_plane_basis_attribs.h \
-ps_ribbon_base.h \
-ps_ribbon.h \
-ps_ribbon_look_at.h \
-ps_shockwave.h \
-ps_sound.h \
-ps_spawn_info.h \
-ps_tail_dot.h \
-ps_util.h \
-ps_zone.h \
-ptr_set.h \
-quad_effect.h \
-quad_grid_clip_cluster.h \
-quad_grid_clip_manager.h \
-quad_grid.h \
-quad_tree.h \
-radix_sort.h \
-raw_skin.h \
-raw_skinned.h \
-ray_mesh.h \
-register_3d.h \
-render_trav.h \
-root_model.h \
-scene_group.h \
-scene.h \
-scene_user.h \
-scissor.h \
-seg_remanence.h \
-seg_remanence_shape.h \
-shader.h \
-shadow_map.h \
-shadow_map_manager.h \
-shadow_poly_receiver.h \
-shadow_skin.h \
-shape_bank.h \
-shape_bank_user.h \
-shape.h \
-shape_info.h \
-shifted_triangle_cache.h \
-skeleton_model.h \
-skeleton_shape.h \
-skeleton_spawn_script.h \
-skeleton_weight.h \
-static_quad_grid.h \
-stripifier.h \
-surface_light_grid.h \
-tangent_space_build.h \
-target_anim_ctrl.h \
-tess_block.h \
-tessellation.h \
-tess_face_priority_list.h \
-tess_list.h \
-text_context.h \
-text_context_user.h \
-texture_blank.h \
-texture_blend.h \
-texture_bloom.h \
-texture_bump.h \
-texture_cube.h \
-texture_dlm.h \
-texture_emboss.h \
-texture_far.h \
-texture_file.h \
-texture_font.h \
-texture_grouped.h \
-texture.h \
-texture_mem.h \
-texture_multi_file.h \
-texture_near.h \
-texture_user.h \
-tile_bank.h \
-tile_color.h \
-tile_element.h \
-tile_far_bank.h \
-tile_light_influence.h \
-tile_lumel.h \
-tile_noise_map.h \
-tile_vegetable_desc.h \
-track_bezier.h \
-track.h \
-track_keyframer.h \
-track_sampled_common.h \
-track_sampled_quat.h \
-track_sampled_quat_small_header.h \
-track_sampled_vector.h \
-track_tcb.h \
-transformable.h \
-transform.h \
-transform_shape.h \
-trav_scene.h \
-u_3d_mouse_listener.h \
-u_animation.h \
-u_animation_set.h \
-u_bone.h \
-u_camera.h \
-u_cloud_scape.h \
-u_driver.h \
-u_instance_group.h \
-u_instance.h \
-u_instance_material.h \
-u_landscape.h \
-u_light.h \
-u_material.h \
-u_particle_system_instance.h \
-u_particle_system_sound.h \
-u_play_list.h \
-u_play_list_manager.h \
-u_point_light.h \
-u_ps_sound_impl.h \
-u_ps_sound_interface.h \
-u_scene.h \
-u_shape_bank.h \
-u_shape.h \
-u_skeleton.h \
-u_text_context.h \
-u_texture.h \
-u_track.h \
-u_transformable.h \
-u_transform.h \
-u_visual_collision_entity.h \
-u_visual_collision_manager.h \
-u_visual_collision_mesh.h \
-u_water_env_map.h \
-u_water.h \
-vegetable_blend_layer_model.h \
-vegetable_clip_block.h \
-vegetable_def.h \
-vegetable.h \
-vegetable_instance_group.h \
-vegetable_light_ex.h \
-vegetable_manager.h \
-vegetable_quadrant.h \
-vegetable_shape.h \
-vegetable_sort_block.h \
-vegetable_uv8.h \
-vegetablevb_allocator.h \
-vertex_buffer.h \
-vertex_buffer_heap.h \
-vertex_program.h \
-vertex_program_parse.h \
-vertex_stream_manager.h \
-viewport.h \
-visual_collision_entity.h \
-visual_collision_entity_user.h \
-visual_collision_manager.h \
-visual_collision_manager_user.h \
-visual_collision_mesh.h \
-water_env_map.h \
-water_env_map_user.h \
-water_height_map.h \
-water_model.h \
-water_pool_manager.h \
-water_shape.h \
-zone_corner_smoother.h \
-zone.h \
-zone_lighter.h \
-zone_manager.h \
-zone_search.h \
-zone_smoother.h \
-zone_symmetrisation.h \
-zone_tgt_smoother.h
-
-# End of Makefile.am
diff --git a/code/nel/include/nel/3d/computed_string.h b/code/nel/include/nel/3d/computed_string.h
index 16fe70fcb..914fa324e 100644
--- a/code/nel/include/nel/3d/computed_string.h
+++ b/code/nel/include/nel/3d/computed_string.h
@@ -27,12 +27,16 @@
#include
#include
+namespace NLMISC {
+
+class CMatrix;
+
+}
namespace NL3D {
class CTextureFont;
-class CMatrix;
struct CComputedString;
// ***************************************************************************
diff --git a/code/nel/include/nel/3d/cube_grid.h b/code/nel/include/nel/3d/cube_grid.h
index 427aed624..483ea8000 100644
--- a/code/nel/include/nel/3d/cube_grid.h
+++ b/code/nel/include/nel/3d/cube_grid.h
@@ -227,7 +227,7 @@ void CCubeGrid::compile()
// build the _StaticGrid
_StaticGrids[i].build(_Grids[i]);
// And reset the grid. contReset is necessary to clean the CBlockMemory.
- contReset(_Grids[i]);
+ NLMISC::contReset(_Grids[i]);
}
// done
diff --git a/code/nel/include/nel/3d/index_buffer.h b/code/nel/include/nel/3d/index_buffer.h
index 320a06020..7beaafe0b 100644
--- a/code/nel/include/nel/3d/index_buffer.h
+++ b/code/nel/include/nel/3d/index_buffer.h
@@ -782,7 +782,7 @@ inline void CIndexBuffer::lock (CIndexBufferRead &accessor, uint first, uint las
// ***************************************************************************
-inline void CIndexBuffer::unlock (uint first, uint end)
+inline void CIndexBuffer::unlock (uint /* first */, uint /* end */)
{
nlassertex (_LockCounter!=0, ("Index buffer not locked"));
nlassert (_LockedBuffer || (!isResident() && _NonResidentIndexes.empty()));
diff --git a/code/nel/include/nel/3d/instance_lighter.h b/code/nel/include/nel/3d/instance_lighter.h
index 7b1dbb6e7..8b1ccf80a 100644
--- a/code/nel/include/nel/3d/instance_lighter.h
+++ b/code/nel/include/nel/3d/instance_lighter.h
@@ -147,7 +147,7 @@ public:
static void addTriangles (const IShape &shape, const NLMISC::CMatrix& modelMT, std::vector& triangleArray, sint instanceId);
// Progress callback
- virtual void progress (const char *message, float progress) {}
+ virtual void progress (const char * /* message */, float /* progress */) {}
/// \name Static PointLights mgt.
diff --git a/code/nel/include/nel/3d/ps_attrib.h b/code/nel/include/nel/3d/ps_attrib.h
index fc17dc787..83549a7b0 100644
--- a/code/nel/include/nel/3d/ps_attrib.h
+++ b/code/nel/include/nel/3d/ps_attrib.h
@@ -96,7 +96,7 @@ public:
try
{
newStart = new uint8[sizeof(T) * capacity + (1 << snapPower)];
- T *newTab = (T *) ( (uint) (newStart + (1 << snapPower)) & ~((1 << snapPower) - 1)); // snap to a page
+ T *newTab = (T *) ( (size_t) (newStart + (1 << snapPower)) & ~((1 << snapPower) - 1)); // snap to a page
diff --git a/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h b/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h
index 4370fdeaa..285fa9b26 100644
--- a/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h
+++ b/code/nel/include/nel/3d/ps_attrib_maker_bin_op.h
@@ -157,7 +157,7 @@ public:
}
/// return true if an operation is supported. The default support all ops
- bool supportOp(CPSBinOp::BinOp op) { return true; }
+ bool supportOp(CPSBinOp::BinOp /* op */) { return true; }
/// get the current operator
CPSBinOp::BinOp getOp(void) const { return _Op; }
diff --git a/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h b/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h
index c25c051a5..8d98a1544 100644
--- a/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h
+++ b/code/nel/include/nel/3d/ps_attrib_maker_bin_op_inline.h
@@ -57,13 +57,13 @@ inline CPlaneBasis PSBinOpModulate(CPlaneBasis p1, CPlaneBasis p2)
}
template <>
-inline CPlaneBasis PSBinOpAdd(CPlaneBasis p1, CPlaneBasis p2)
+inline CPlaneBasis PSBinOpAdd(CPlaneBasis /* p1 */, CPlaneBasis /* p2 */)
{
nlassert(0); // not allowed for now
return CPlaneBasis(NLMISC::CVector::Null);
}
template <>
-inline CPlaneBasis PSBinOpSubtract(CPlaneBasis p1, CPlaneBasis p2)
+inline CPlaneBasis PSBinOpSubtract(CPlaneBasis /* p1 */, CPlaneBasis /* p2 */)
{
nlassert(0); // not allowed for now
return CPlaneBasis(NLMISC::CVector::Null);
diff --git a/code/nel/include/nel/3d/ps_attrib_maker_iterators.h b/code/nel/include/nel/3d/ps_attrib_maker_iterators.h
index 8729ffb10..d9cfbcdd3 100644
--- a/code/nel/include/nel/3d/ps_attrib_maker_iterators.h
+++ b/code/nel/include/nel/3d/ps_attrib_maker_iterators.h
@@ -60,7 +60,7 @@ namespace NL3D
{
GET_INLINE float get() const { return float(rand() * (1 / double(RAND_MAX))); } // this may be optimized with a table...
void advance() {}
- void advance(uint quantity) {}
+ void advance(uint /* quantity */) {}
};
/// this iterator just return the same value
@@ -69,7 +69,7 @@ namespace NL3D
float Value;
GET_INLINE float get() const { return Value; }
void advance() {}
- void advance(uint quantity) {}
+ void advance(uint /* quantity */) {}
};
/// iterator that use dist to compute the value
diff --git a/code/nel/include/nel/3d/ps_direction.h b/code/nel/include/nel/3d/ps_direction.h
index 609278a80..eb8bbd827 100644
--- a/code/nel/include/nel/3d/ps_direction.h
+++ b/code/nel/include/nel/3d/ps_direction.h
@@ -38,7 +38,7 @@ public :
/** The direction is taken from a global vector defined in the particle system
* NULL or an empty string as a name disable the use of a global value
*/
- virtual void enableGlobalVectorValue(const std::string &name) {}
+ virtual void enableGlobalVectorValue(const std::string &/* name */) {}
virtual std::string getGlobalVectorValueName() const { return ""; }
};
diff --git a/code/nel/include/nel/3d/ps_edit.h b/code/nel/include/nel/3d/ps_edit.h
index d3e1a53de..8342868f8 100644
--- a/code/nel/include/nel/3d/ps_edit.h
+++ b/code/nel/include/nel/3d/ps_edit.h
@@ -65,13 +65,13 @@ struct IPSMover
virtual bool supportNonUniformScaling(void) const { NL_PS_FUNC(supportNonUniformScaling); return false ; }
// set the scale of the object (uniform scale). The default does nothing
- virtual void setScale(uint32 index, float scale) {} ;
+ virtual void setScale(uint32 /* index */, float /* scale */) {}
// set a non uniform scale (if supported)
- virtual void setScale(uint32 index, const NLMISC::CVector &s) { NL_PS_FUNC(setScale); }
+ virtual void setScale(uint32 /* index */, const NLMISC::CVector &/* s */) { NL_PS_FUNC(setScale); }
// get the scale of the object
- virtual NLMISC::CVector getScale(uint32 index) const { NL_PS_FUNC(getScale); return NLMISC::CVector(1.f, 1.f, 1.f) ; }
+ virtual NLMISC::CVector getScale(uint32 /* index */) const { NL_PS_FUNC(getScale); return NLMISC::CVector(1.f, 1.f, 1.f) ; }
/** some object may not store a whole matrix (e.g planes)
* this return true if only a normal is needed to set the orientation of the object
@@ -79,10 +79,10 @@ struct IPSMover
virtual bool onlyStoreNormal(void) const { NL_PS_FUNC(onlyStoreNormal); return false ; }
/// if the object only needs a normal, this return the normal. If not, is return (0, 0, 0)
- virtual NLMISC::CVector getNormal(uint32 index) { NL_PS_FUNC(getNormal); return NLMISC::CVector::Null ; }
+ virtual NLMISC::CVector getNormal(uint32 /* index */) { NL_PS_FUNC(getNormal); return NLMISC::CVector::Null ; }
/// if the object only stores a normal, this set the normal of the object. Otherwise it has no effect
- virtual void setNormal(uint32 index, NLMISC::CVector n) { NL_PS_FUNC(setNormal); }
+ virtual void setNormal(uint32 /* index */, NLMISC::CVector /* n */) { NL_PS_FUNC(setNormal); }
// set a new orthogonal matrix for the object
virtual void setMatrix(uint32 index, const NLMISC::CMatrix &m) = 0 ;
diff --git a/code/nel/include/nel/3d/ps_force.h b/code/nel/include/nel/3d/ps_force.h
index 5e961dc43..15e28948a 100644
--- a/code/nel/include/nel/3d/ps_force.h
+++ b/code/nel/include/nel/3d/ps_force.h
@@ -87,9 +87,9 @@ public:
* 'accumulate' set to false.
* NB : works only with integrable forces
*/
- virtual void integrate(float date, CPSLocated *src, uint32 startIndex, uint32 numObjects, NLMISC::CVector *destPos = NULL, NLMISC::CVector *destSpeed = NULL,
- bool accumulate = false,
- uint posStride = sizeof(NLMISC::CVector), uint speedStride = sizeof(NLMISC::CVector)
+ virtual void integrate(float /* date */, CPSLocated * /* src */, uint32 /* startIndex */, uint32 /* numObjects */, NLMISC::CVector * /* destPos */ = NULL, NLMISC::CVector * /* destSpeed */ = NULL,
+ bool /* accumulate */ = false,
+ uint /* posStride */ = sizeof(NLMISC::CVector), uint /* speedStride */ = sizeof(NLMISC::CVector)
) const
{
nlassert(0); // not an integrable force
@@ -100,11 +100,11 @@ public:
* If the start date is lower than the creation date, the initial position is used
* NB : works only with integrable forces
*/
- virtual void integrateSingle(float startDate, float deltaT, uint numStep,
- const CPSLocated *src, uint32 indexInLocated,
- NLMISC::CVector *destPos,
- bool accumulate = false,
- uint posStride = sizeof(NLMISC::CVector)) const
+ virtual void integrateSingle(float /* startDate */, float /* deltaT */, uint /* numStep */,
+ const CPSLocated * /* src */, uint32 /* indexInLocated */,
+ NLMISC::CVector * /* destPos */,
+ bool /* accumulate */ = false,
+ uint /* posStride */ = sizeof(NLMISC::CVector)) const
{
nlassert(0); // not an integrable force
}
@@ -170,7 +170,7 @@ public:
virtual void setIntensityScheme(CPSAttribMaker *scheme);
// deriver have here the opportunity to setup the functor object. The default does nothing
- virtual void setupFunctor(uint32 indexInLocated) { }
+ virtual void setupFunctor(uint32 /* indexInLocated */) { }
/// get the attribute maker for a non constant intensity
CPSAttribMaker *getIntensityScheme(void) { return _IntensityScheme; }
@@ -493,22 +493,22 @@ public:
#ifdef NL_OS_WINDOWS
__forceinline
#endif
- void operator() (const NLMISC::CVector &pos, NLMISC::CVector &speed, float invMass)
- {
+ void operator() (const NLMISC::CVector &/* pos */, NLMISC::CVector &speed, float invMass)
+ {
speed -= (CParticleSystem::EllapsedTime * _K * invMass * speed);
- }
+ }
- virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
- {
- f.serialVersion(1);
- // we don't save intensity info : it is saved by the owning object (and set before each use of this functor)
- }
+ virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
+ {
+ f.serialVersion(1);
+ // we don't save intensity info : it is saved by the owning object (and set before each use of this functor)
+ }
- // get the friction coefficient
- float getK(void) const { return _K; }
+ // get the friction coefficient
+ float getK(void) const { return _K; }
- // set the friction coefficient
- void setK(float coeff) { _K = coeff; }
+ // set the friction coefficient
+ void setK(float coeff) { _K = coeff; }
protected:
// the friction coeff
float _K;
@@ -630,7 +630,7 @@ struct CPSTurbulForceFunc
#ifdef NL_OS_WINDOWS
__forceinline
#endif
- void operator() (const NLMISC::CVector &pos, NLMISC::CVector &speed, float invMass)
+ void operator() (const NLMISC::CVector &/* pos */, NLMISC::CVector &/* speed */, float /* invMass */)
{
nlassert(0);
diff --git a/code/nel/include/nel/3d/static_quad_grid.h b/code/nel/include/nel/3d/static_quad_grid.h
index 7890e12f4..5a0383c9e 100644
--- a/code/nel/include/nel/3d/static_quad_grid.h
+++ b/code/nel/include/nel/3d/static_quad_grid.h
@@ -172,7 +172,7 @@ template
void CStaticQuadGrid::build(CQuadGrid &quadGrid)
{
clear();
- contReset(_Grid);
+ NLMISC::contReset(_Grid);
// Copy from quadGrid, and init quads
_Size= quadGrid.getSize();
diff --git a/code/nel/include/nel/3d/track_tcb.h b/code/nel/include/nel/3d/track_tcb.h
index 8daf5cc2a..fc9c227e4 100644
--- a/code/nel/include/nel/3d/track_tcb.h
+++ b/code/nel/include/nel/3d/track_tcb.h
@@ -218,7 +218,7 @@ protected:
date*= previous->OODeltaTime;
NLMISC::clamp(date, 0,1);
- date = ease(previous, date);
+ date = this->ease(previous, date);
float hb[4];
this->computeHermiteBasis(date, hb);
@@ -242,7 +242,7 @@ protected:
ITrackKeyFramer::compile();
// Ease Precompute.
- compileTCBEase(this->_MapKey, this->getLoopMode());
+ this->compileTCBEase(this->_MapKey, this->getLoopMode());
// Tangents Precompute.
@@ -314,7 +314,7 @@ private:
float ksm,ksp,kdm,kdp;
// compute tangents factors.
- computeTCBFactors(key, timeBefore, time, timeAfter, rangeDelta, firstKey, endKey, isLoop, ksm,ksp,kdm,kdp);
+ this->computeTCBFactors(key, timeBefore, time, timeAfter, rangeDelta, firstKey, endKey, isLoop, ksm,ksp,kdm,kdp);
// Delta.
TKeyValueType delm, delp;
@@ -413,7 +413,7 @@ public:
ITrackKeyFramer::compile();
// Ease Precompute.
- compileTCBEase(_MapKey, getLoopMode());
+ this->compileTCBEase(_MapKey, getLoopMode());
TMapTimeCKey::iterator it;
TMapTimeCKey::iterator itNext;
diff --git a/code/nel/include/nel/3d/vertex_buffer.h b/code/nel/include/nel/3d/vertex_buffer.h
index 83b2b90ea..a64ec0c2c 100644
--- a/code/nel/include/nel/3d/vertex_buffer.h
+++ b/code/nel/include/nel/3d/vertex_buffer.h
@@ -1223,7 +1223,7 @@ inline void CVertexBuffer::lock (CVertexBufferRead &accessor, uint first, uint l
// --------------------------------------------------
-inline void CVertexBuffer::unlock (uint first, uint end)
+inline void CVertexBuffer::unlock (uint /* first */, uint /* end */)
{
nlassertex (_LockCounter!=0, ("Vertex buffer not locked"));
nlassert (_LockedBuffer || (!isResident() && _NonResidentVertices.empty()));
diff --git a/code/nel/include/nel/Makefile.am b/code/nel/include/nel/Makefile.am
deleted file mode 100644
index 7e4686f14..000000000
--- a/code/nel/include/nel/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-DIST_SUBDIRS = net 3d pacs sound misc georges ligo
-
-SUBDIRS = @NEL_SUBDIRS@
-
-includedir = ${prefix}/include/nel
-
-# End of Makefile.am
-
diff --git a/code/nel/include/nel/cegui/Makefile.am b/code/nel/include/nel/cegui/Makefile.am
deleted file mode 100644
index ba2530dff..000000000
--- a/code/nel/include/nel/cegui/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# $Id: Makefile.am,v 1.1 2001-08-01 08:45:06 valignat Exp $
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-includedir = ${prefix}/include/nel/cegui
-
-include_HEADERS = nelrenderer.h nelresourceprovider.h neltexture.h
-
-# End of Makefile.am
diff --git a/code/nel/include/nel/georges/Makefile.am b/code/nel/include/nel/georges/Makefile.am
deleted file mode 100644
index 153e9b102..000000000
--- a/code/nel/include/nel/georges/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-includedir = ${prefix}/include/nel/georges
-
-include_HEADERS = load_form.h \
- u_form_dfn.h \
- u_form_elm.h \
- u_form.h \
- u_form_loader.h \
- u_type.h
-
-# End of Makefile.am
diff --git a/code/nel/include/nel/ligo/Makefile.am b/code/nel/include/nel/ligo/Makefile.am
deleted file mode 100644
index 48fb3c54b..000000000
--- a/code/nel/include/nel/ligo/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-includedir = ${prefix}/include/nel/ligo
-
-include_HEADERS = ligo_config.h \
- primitive_class.h \
- primitive_configuration.h \
- primitive.h \
- primitive_utils.h
-
-# End of Makefile.am
diff --git a/code/nel/include/nel/misc/Makefile.am b/code/nel/include/nel/misc/Makefile.am
deleted file mode 100644
index 75bde6b95..000000000
--- a/code/nel/include/nel/misc/Makefile.am
+++ /dev/null
@@ -1,143 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-includedir = ${prefix}/include/nel/misc
-
-include_HEADERS = aabbox.h \
- algo.h \
- app_context.h \
- array_2d.h \
- async_file_manager.h \
- big_file.h \
- bitmap.h \
- bit_mem_stream.h \
- bit_set.h \
- block_memory.h \
- bsphere.h \
- buf_fifo.h \
- check_fpu.h \
- class_id.h \
- class_registry.h \
- command.h \
- common.h \
- config_file.h \
- contiguous_block_allocator.h \
- co_task.h \
- cpu_time_stat.h \
- debug.h \
- di_event_emitter.h \
- diff_tool.h \
- displayer.h \
- dummy_window.h \
- dynloadlib.h \
- eid_translator.h \
- entity_id.h \
- enum_bitset.h \
- eval_num_expr.h \
- event_emitter.h \
- event_emitter_multi.h \
- event_listener.h \
- event_server.h \
- events.h \
- factory.h \
- fast_floor.h \
- fast_mem.h \
- file.h \
- fixed_size_allocator.h \
- game_device_events.h \
- game_device.h \
- geom_ext.h \
- grid_traversal.h \
- gtk_displayer.h \
- heap_memory.h \
- hierarchical_timer.h \
- historic.h \
- i18n.h \
- input_device.h \
- input_device_manager.h \
- input_device_server.h \
- inter_window_msg_queue.h \
- i_xml.h \
- keyboard_device.h \
- line.h \
- log.h \
- matrix.h \
- md5.h \
- mem_displayer.h \
- mem_stream.h \
- mouse_device.h \
- mouse_smoother.h \
- mutable_container.h \
- mutex.h \
- noise_value.h \
- object_arena_allocator.h \
- object_vector.h \
- o_xml.h \
- path.h \
- plane.h \
- plane_inline.h \
- polygon.h \
- pool_memory.h \
- progress_callback.h \
- p_thread.h \
- quad.h \
- quat.h \
- random.h \
- reader_writer.h \
- rect.h \
- report.h \
- resource_ptr.h \
- resource_ptr_inline.h \
- rgba.h \
- sha1.h \
- shared_memory.h \
- sheet_id.h \
- singleton.h \
- smart_ptr.h \
- smart_ptr_inline.h \
- speaker_listener.h \
- sstring.h \
- static_map.h \
- stl_block_allocator.h \
- stl_block_list.h \
- stop_watch.h \
- stream.h \
- stream_inline.h \
- string_common.h \
- string_conversion.h \
- string_id_array.h \
- string_mapper.h \
- string_stream.h \
- system_info.h \
- task_manager.h \
- tds.h \
- thread.h \
- time_nl.h \
- timeout_assertion_thread.h \
- traits_nl.h \
- triangle.h \
- twin_map.h \
- types_nl.h \
- ucstring.h \
- uv.h \
- value_smoother.h \
- variable.h \
- vector_2d.h \
- vector_2f.h \
- vectord.h \
- vectord_inline.h \
- vector.h \
- vector_h.h \
- vector_inline.h \
- win32_util.h \
- win_displayer.h \
- window_displayer.h \
- win_event_emitter.h \
- win_thread.h \
- win_tray.h \
- words_dictionary.h \
- xml_pack.h
-
-# End of Makefile.am
diff --git a/code/nel/include/nel/misc/bit_mem_stream.h b/code/nel/include/nel/misc/bit_mem_stream.h
index 8a1af34cc..b294d5454 100644
--- a/code/nel/include/nel/misc/bit_mem_stream.h
+++ b/code/nel/include/nel/misc/bit_mem_stream.h
@@ -209,6 +209,8 @@ public:
{
#ifdef NL_DEBUG
std::swap(_DbgData, other._DbgData);
+#else
+ nlunreferenced(other);
#endif
}
@@ -225,6 +227,10 @@ public:
TBMSSerialInfo serialItem( bitpos, size, type, _DbgData->NextSymbol );
_DbgData->List.push_back( serialItem );
_DbgData->NextSymbol = NULL;
+#else
+ nlunreferenced(bitpos);
+ nlunreferenced(size);
+ nlunreferenced(type);
#endif
}
@@ -258,6 +264,10 @@ public:
nlwarning( "Missing reserve() corresponding to poke()" );
}
_DbgData->NextSymbol = NULL;
+#else
+ nlunreferenced(bitpos);
+ nlunreferenced(size);
+ nlunreferenced(type);
#endif
}
@@ -266,6 +276,8 @@ public:
{
#ifdef NL_DEBUG
_DbgData->NextSymbol = symbol;
+#else
+ nlunreferenced(symbol);
#endif
}
@@ -308,6 +320,8 @@ public:
}
//nlassert( bitpos < (*_List)[_CurrentBrowsedItem].BitPos ); // occurs if stream overflow
}
+#else
+ nlunreferenced(bitpos);
#endif
*eventId = -1;
return std::string();
@@ -380,7 +394,7 @@ public:
* If you are using the stream only in output mode, you can use this method as a faster version
* of clear() *if you don't serialize pointers*.
*/
- void resetBufPos()
+ virtual void resetBufPos()
{
// This is ensured in CMemStream::CMemStream() and CMemStream::clear()
//if ( (!isReading()) && _Buffer.empty() )
@@ -463,7 +477,7 @@ public:
}
/// See doc in CMemStream::bufferToFill()
- uint8 *bufferToFill( uint32 msgsize )
+ virtual uint8 *bufferToFill( uint32 msgsize )
{
_FreeBits = 8;
_DbgInfo.clear();
@@ -640,7 +654,7 @@ public:
virtual void serial(ucstring &b);
virtual void serial(CBitMemStream &b) { serialMemStream(b); }
- virtual void serialMemStream(CBitMemStream &b);
+ virtual void serialMemStream(CMemStream &b);
//@}
@@ -787,11 +801,7 @@ void displayBitStream( const CBitMemStream& msg, sint beginbitpos, sint endbitpo
inline std::string CBMSDbgInfo::getEventLegendAtBitPos( CBitMemStream& bms, sint32 eventId )
{
#ifdef NL_DEBUG
- if ( eventId == -1 )
- {
- return std::string();
- }
- else
+ if ( eventId != -1 )
{
nlassert( eventId < (sint32)_DbgData->List.size() );
TBMSSerialInfo& serialItem = _DbgData->List[eventId]; // works only with a vector!
@@ -800,8 +810,11 @@ inline std::string CBMSDbgInfo::getEventLegendAtBitPos( CBitMemStream& bms, sint
bms.getSerialItem( serialItem ).c_str(), (serialItem.Symbol!=NULL)?serialItem.Symbol:"" );
}
#else
- return std::string();
+ nlunreferenced(bms);
+ nlunreferenced(eventId);
#endif
+
+ return std::string();
}
diff --git a/code/ryzom/client/src/cdb.h b/code/nel/include/nel/misc/cdb.h
similarity index 83%
rename from code/ryzom/client/src/cdb.h
rename to code/nel/include/nel/misc/cdb.h
index 24c2dd5eb..d23986b0c 100644
--- a/code/ryzom/client/src/cdb.h
+++ b/code/nel/include/nel/misc/cdb.h
@@ -20,20 +20,20 @@
#define CDB_H
// misc
-#include "nel/misc/types_nl.h"
-#include "nel/misc/smart_ptr.h"
-#include "nel/misc/string_mapper.h"
+#include "types_nl.h"
+#include "smart_ptr.h"
+#include "string_mapper.h"
+#include "sstring.h"
#include
namespace NLMISC
{
- class IProgressCallback;
- class CBitMemStream;
-}
-
+class IProgressCallback;
+class CBitMemStream;
class CCDBNodeLeaf;
class CCDBNodeBranch;
+class CCDBBankHandler;
///global bool, must be set to true if we want to display database modification. See displayDBModifs in commands.cpp
extern bool VerboseDatabase;
@@ -48,7 +48,7 @@ extern bool VerboseDatabase;
* \date 2002
*/
-class ICDBNode : public NLMISC::CRefCount
+class ICDBNode : public CRefCount
{
//-----------------------------------------------------------------------
// end of IDBNode interface
@@ -78,7 +78,7 @@ public:
* \author Nevrax France
* \date 2002
*/
- class IPropertyObserver : public NLMISC::CRefCount
+ class IPropertyObserver : public CRefCount
{
public :
virtual ~IPropertyObserver() {}
@@ -198,7 +198,7 @@ public :
* Build the structure of the database from a file
* \param f is the stream
*/
- virtual void init( xmlNodePtr node, NLMISC::IProgressCallback &progressCallBack, bool mapBanks=false ) = 0;
+ virtual void init( xmlNodePtr node, IProgressCallback &progressCallBack, bool mapBanks=false, CCDBBankHandler *bankHandler = NULL ) = 0;
/**
* Save a backup of the database
@@ -212,7 +212,7 @@ public :
* \param gc the server gameCycle of this update. Any outdated update are aborted
* \param f : the stream.
*/
- virtual void readDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream & f ) = 0;
+ virtual void readDelta( TGameCycle gc, CBitMemStream & f ) = 0;
/**
* Get a node . Create it if it does not exist yet
@@ -252,7 +252,7 @@ public :
virtual bool setProp( CTextId& id, sint64 value ) = 0;
/// Reset all leaf data from this point
- virtual void resetData(NLMISC::TGameCycle gc, bool forceReset=false) = 0;
+ virtual void resetData(TGameCycle gc, bool forceReset=false) = 0;
/**
* Clear the node and his children
@@ -302,10 +302,10 @@ public :
virtual CCDBNodeLeaf *findLeafAtCount( uint& count ) = 0;
/// Set the atomic branch flag (when all the modified nodes of a branch should be tranmitted at the same time)
- void setAtomic( bool atomicBranch ) { _Atomic = atomicBranch; }
+ void setAtomic( bool atomicBranch ) { _AtomicFlag = atomicBranch; }
/// Return true if the branch has the atomic flag
- bool isAtomic() const { return _Atomic; }
+ bool isAtomic() const { return _AtomicFlag; }
// test if the node is a leaf
virtual bool isLeaf() const = 0;
@@ -314,16 +314,16 @@ public :
virtual void display (const std::string &/* prefix */){}
/// Return the string id corresponding to the argument
- static NLMISC::TStringId getStringId(const std::string& nodeName)
+ static TStringId getStringId(const std::string& nodeName)
{
- if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper();
+ if (_DBSM == NULL) _DBSM = CStringMapper::createLocalMapper();
return _DBSM->localMap(nodeName);
}
/// Return a pointer to the string corresponding to the argument
- static const std::string *getStringFromId(NLMISC::TStringId nodeStringId)
+ static const std::string *getStringFromId(TStringId nodeStringId)
{
- if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper();
+ if (_DBSM == NULL) _DBSM = CStringMapper::createLocalMapper();
return &_DBSM->localUnmap(nodeStringId);
}
@@ -333,34 +333,36 @@ public :
protected:
/// Constructor
- ICDBNode() : _Atomic(false)
+ ICDBNode() : _AtomicFlag(false)
{
- if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper();
- _Name = NLMISC::CStringMapper::emptyId();
+ if (_DBSM == NULL) _DBSM = CStringMapper::createLocalMapper();
+ _Name = CStringMapper::emptyId();
}
/// Constructor
- ICDBNode (const std::string &name) : _Atomic(false)
+ ICDBNode (const std::string &name) : _AtomicFlag(false)
{
- if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper();
+ if (_DBSM == NULL) _DBSM = CStringMapper::createLocalMapper();
_Name = _DBSM->localMap(name);
//_NameDbg = name;
}
// utility to build full name efficiently (without reallocating the string at each parent level)
- void _buildFullName(NLMISC::CSString &fullName);
+ void _buildFullName(CSString &fullName);
/// Atomic flag: is the branch an atomic group, or is the leaf a member of an atomic group
- bool _Atomic : 1;
+ bool _AtomicFlag : 1;
/// Name of the node
- NLMISC::TStringId _Name;
+ TStringId _Name;
//std::string _NameDbg;
- static NLMISC::CStringMapper *_DBSM;
+ static CStringMapper *_DBSM;
};
+}
+
#endif // CDB_H
diff --git a/code/nel/include/nel/misc/cdb_bank_handler.h b/code/nel/include/nel/misc/cdb_bank_handler.h
new file mode 100644
index 000000000..102026f4d
--- /dev/null
+++ b/code/nel/include/nel/misc/cdb_bank_handler.h
@@ -0,0 +1,139 @@
+// Ryzom - MMORPG Framework
+// Copyright (C) 2010 Winch Gate Property Limited
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see .
+
+#ifndef CDB_BANK_HANDLER
+#define CDB_BANK_HANDLER
+
+#include
+#include "nel/misc/types_nl.h"
+
+namespace NLMISC{
+
+/**
+ @brief Manages the bank names and mappings of the CDB it's associated with
+
+ Banks are numeric identifiers for the top-level branches of the CDB.
+ They are used for saving bandwidth, because the local CDBs are updated with deltas,
+ that identify the updatable top-level branch with this id.
+ The CCDBBankHandler manages the mapping of banks to their names, unified (node) index,
+ and the other way around.
+
+ */
+class CCDBBankHandler{
+public:
+ /**
+ @brief The class' constructor
+ @param maxbanks the maximum number of banks we need to handle
+ */
+ CCDBBankHandler( uint maxbanks );
+
+ /// Very surprisingly this is the destructor
+ ~CCDBBankHandler(){}
+
+ /**
+ @brief Returns the unified (node) index for the specified bank Id.
+ @param bank The bank whose uid we need.
+ @return Returns an uid or static_cast< uint >( -1 ) on failure.
+ */
+ uint getUIDForBank( uint bank ) const;
+
+ /**
+ @brief Returns the bank Id for the specified unified (node) index.
+ @param uid The unified (node) index we need to translate to bank Id.
+ @return Returns a bank Id.
+ */
+ uint getBankForUID( uint uid ) const{ return _UnifiedIndexToBank[ uid ]; }
+
+ /// Returns the last unified (node) index we mapped.
+ uint getLastUnifiedIndex() const{ return _CDBLastUnifiedIndex; }
+
+ /**
+ @brief Returns the number of bits used to store the number of nodes that belong to this bank.
+ @param bank The banks whose id bits we need.
+ @return Returns the number of bits used to store the number of nodes that belong to this bank.
+ */
+ uint getFirstLevelIdBits( uint bank ) const{ return _FirstLevelIdBitsByBank[ bank ]; }
+
+ /**
+ @brief Returns the name of the specified bank.
+ @param bank The id of the bank we need the name of.
+ @return Returns the name of the specified bank.
+ */
+ std::string getBankName( uint bank ) const{ return _CDBBankNames[ bank ]; }
+
+ /**
+ @brief Looks up the bank Id of the bank name specified.
+ @param name The name of the bank whose Id we need.
+ @return Returns the id of the bank, or static_cast< uint >( -1 ) on fail.
+ */
+ uint getBankByName( const std::string &name ) const;
+
+ /**
+ @brief Maps the specified bank name to a unified (node) index and vica versa.
+ @param bankName Name of the bank to map.
+ */
+ void mapNodeByBank( const std::string &bankName );
+
+ /**
+ @brief Loads the known bank names from an array ( the order decides the bank Id ).
+ @param strings The array of the banks names.
+ @param size The size of the array.
+ */
+ void fillBankNames( const char **strings, uint size );
+
+ /// Resets the node to bank mapping vector
+ void resetNodeBankMapping(){ _UnifiedIndexToBank.clear(); }
+
+ /// Resets all maps, and sets _CDBLastUnifiedIndex to 0.
+ void reset();
+
+ uint getUnifiedIndexToBankSize() const{ return _UnifiedIndexToBank.size(); }
+
+ /// Calculates the number of bits used to store the number of nodes that belong to the banks.
+ void calcIdBitsByBank();
+
+ /**
+ @brief Looks up the unified (node) index of a bank node.
+ @param bank The bank id of the node we are looking up.
+ @param index The index of the node within the bank.
+ @return Returns the unified (node) index of the specified bank node.
+ */
+ uint getServerToClientUIDMapping( uint bank, uint index ) const{ return _CDBBankToUnifiedIndexMapping[ bank ][ index ]; }
+
+private:
+ /// Mapping from server database index to client database index (first-level nodes)
+ std::vector< std::vector< uint > > _CDBBankToUnifiedIndexMapping;
+
+ /// Mapping from client database index to bank IDs (first-level nodes)
+ std::vector< uint > _UnifiedIndexToBank;
+
+ /// Last index mapped
+ uint _CDBLastUnifiedIndex;
+
+ /// Number of bits for first-level branches, by bank
+ std::vector< uint > _FirstLevelIdBitsByBank;
+
+ /// Names of the CDB banks
+ std::vector< std::string > _CDBBankNames;
+
+ /// The number of banks used
+ uint maxBanks;
+};
+
+}
+
+#endif
+
diff --git a/code/ryzom/client/src/cdb_branch.h b/code/nel/include/nel/misc/cdb_branch.h
similarity index 53%
rename from code/ryzom/client/src/cdb_branch.h
rename to code/nel/include/nel/misc/cdb_branch.h
index 405c7c479..a2255ca09 100644
--- a/code/ryzom/client/src/cdb_branch.h
+++ b/code/nel/include/nel/misc/cdb_branch.h
@@ -20,7 +20,8 @@
#define CDB_BRANCH_H
#include "cdb.h"
-#include "game_share/ryzom_database_banks.h"
+
+namespace NLMISC{
/**
* Database Node which contains a set of properties
@@ -32,6 +33,21 @@ class CCDBNodeBranch : public ICDBNode
{
public:
+ class ICDBDBBranchObserverHandle
+ {
+ public:
+ virtual ~ICDBDBBranchObserverHandle(){}
+
+ virtual ICDBNode* owner() = 0;
+ virtual IPropertyObserver* observer() = 0;
+ virtual bool observesLeaf( const std::string &leafName ) = 0;
+ virtual bool inList( uint list ) = 0;
+ virtual void addToFlushableList() = 0;
+ virtual void removeFromFlushableList( uint list ) = 0;
+ virtual void removeFromFlushableList() = 0;
+
+ };
+
// default constructor
CCDBNodeBranch(const std::string &name) : ICDBNode(name)
{
@@ -44,7 +60,7 @@ public:
* Build the structure of the database from a file
* \param f is the stream
*/
- void init( xmlNodePtr node, class NLMISC::IProgressCallback &progressCallBack, bool mapBanks=false );
+ void init( xmlNodePtr node, class IProgressCallback &progressCallBack, bool mapBanks=false, CCDBBankHandler *bankHandler = NULL );
/**
* Add a new sub node
@@ -93,10 +109,10 @@ public:
void write( CTextId& id, FILE * f);
/// Update the database from the delta, but map the first level with the bank mapping (see _CDBBankToUnifiedIndexMapping)
- void readAndMapDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream& s, TCDBBank bank );
+ void readAndMapDelta( TGameCycle gc, CBitMemStream& s, uint bank, CCDBBankHandler *bankHandler );
/// Update the database from a stream coming from the FE
- void readDelta( NLMISC::TGameCycle gc, NLMISC::CBitMemStream & f );
+ void readDelta( TGameCycle gc, CBitMemStream & f );
/**
* Return the value of a property (the update flag is set to false)
@@ -118,19 +134,16 @@ public:
/// Clear the node and his children
void clear();
- /// Reset the data corresponding to the bank (works only on top level node)
- void resetBank( NLMISC::TGameCycle gc, TCDBBank bank)
+ void resetNode( TGameCycle gc, uint node )
{
- //nlassert( getParent() == NULL );
- for ( uint i=0; i!=_Nodes.size(); ++i )
- {
- if ( _UnifiedIndexToBank[i] == bank )
- _Nodes[i]->resetData(gc);
- }
+ if( node > _Nodes.size() )
+ return;
+
+ _Nodes[ node ]->resetData( gc );
}
/// Reset all leaf data from this point
- void resetData(NLMISC::TGameCycle gc, bool forceReset=false)
+ void resetData(TGameCycle gc, bool forceReset=false)
{
for ( uint i=0; i!=_Nodes.size(); ++i )
{
@@ -165,7 +178,7 @@ public:
virtual void display (const std::string &prefix);
- void removeNode (CTextId& id);
+ void removeNode (const CTextId& id);
/**
* add an observer to a property
@@ -190,7 +203,7 @@ public:
* and setting a branch observer on it, except you don't need to change your database paths
* and update large amounts of code!).
*/
- void addBranchObserver(IPropertyObserver* observer, const std::vector& positiveLeafNameFilter=std::vector());
+ void addBranchObserver( ICDBDBBranchObserverHandle* handle, const std::vector& positiveLeafNameFilter=std::vector());
/**
* Easy version of addBranchObserver() (see above).
@@ -198,7 +211,7 @@ public:
* "" -> this node
* "FOO:BAR" -> sub-branch "BAR" of "FOO" which is a sub-branch of this node
*/
- void addBranchObserver(const char *dbPathFromThisNode, ICDBNode::IPropertyObserver& observer, const char **positiveLeafNameFilter=NULL, uint positiveLeafNameFilterSize=0);
+ void addBranchObserver( ICDBDBBranchObserverHandle *handle, const char *dbPathFromThisNode, const char **positiveLeafNameFilter=NULL, uint positiveLeafNameFilterSize=0);
// Remove observer from all sub-leaves
bool removeBranchObserver(IPropertyObserver* observer);
@@ -208,82 +221,14 @@ public:
virtual bool isLeaf() const { return false; }
- /** Update all observers of branchs that have been modified
- */
- static void flushObserversCalls();
-
// mark this branch and parent branch as 'modified'. This is usually called by sub-leaves
- void linkInModifiedNodeList(NLMISC::TStringId modifiedLeafName);
+ void onLeafChanged( TStringId leafName );
/// Find a subnode at this level
ICDBNode * find (const std::string &nodeName);
- /// Main init
- static void resetNodeBankMapping() { _UnifiedIndexToBank.clear(); }
-
- // reset all static mappings
- static void reset();
-
- /// Internal use only
- static void mapNodeByBank( ICDBNode *node, const std::string& bankStr, bool clientOnly, uint nodeIndex );
-
protected:
-
-
- /** Struct identifying an observer of a db branch
- * This struct can be linked in a list so that we can update observers only once per pass.
- * An observer that watch a whole branch can be updated once and only once after each element of the branch has been modified
- */
- class CDBBranchObsInfo
- {
- public:
- NLMISC::CRefPtr Observer;
- // 2 linked list are required : while the observer is notified, it can triger one other observer, so we must link it in another list
- bool Touched[2];
- CDBBranchObsInfo *PrevNotifiedObserver[2]; // NULL means this is the head
- CDBBranchObsInfo *NextNotifiedObserver[2];
- ICDBNode *Owner;
-
- // If non-empty, only a leaf whose name is found here will notify something
- // This is equivalent to creating a sub-branch containing only the specified leaves
- // and setting a branch observer on it, except you don't need to change your database paths
- // and update large amounts of code and script!
- std::vector PositiveLeafNameFilter;
-
- public:
-
- /// Constructor. See above for usage of positiveLeafNameFilter.
- CDBBranchObsInfo(IPropertyObserver *obs = NULL, ICDBNode *owner = NULL, const std::vector& positiveLeafNameFilter=std::vector())
- {
- Owner = owner;
- Observer = obs;
- Touched[0] = Touched[1] = false;
- PrevNotifiedObserver[0] = PrevNotifiedObserver[1] = NULL;
- NextNotifiedObserver[0] = NextNotifiedObserver[1] = NULL;
- for (std::vector::const_iterator ipf=positiveLeafNameFilter.begin(); ipf!=positiveLeafNameFilter.end(); ++ipf)
- {
- PositiveLeafNameFilter.push_back(ICDBNode::getStringId(*ipf)); // the ids are also mapped at database init, we don't need to unmap them in destructor
- }
- }
- ~CDBBranchObsInfo()
- {
- // should have been unlinked
- nlassert(Touched[0] == false);
- nlassert(Touched[1] == false);
- nlassert(PrevNotifiedObserver[0] == NULL);
- nlassert(PrevNotifiedObserver[1] == NULL);
- nlassert(NextNotifiedObserver[0] == NULL);
- nlassert(NextNotifiedObserver[1] == NULL);
- }
- // Unlink from the given list. This also clear the '_Touched' flag
- void unlink(uint list);
- void link(uint list, NLMISC::TStringId modifiedLeafName);
- };
-
- typedef std::list TObsList; // must use a list because pointers on CDBObserverInfo instances must remains valids
-
-protected:
-
+ typedef std::list< ICDBDBBranchObserverHandle* > TObserverHandleList;
CCDBNodeBranch *_Parent;
@@ -298,34 +243,13 @@ protected:
bool _Sorted : 1;
// observers for this node or branch
- TObsList _Observers;
-
- friend class CDBBranchObsInfo;
- // Global list of modified nodes
- static CDBBranchObsInfo *_FirstNotifiedObs[2];
- static CDBBranchObsInfo *_LastNotifiedObs[2];
- static uint _CurrNotifiedObsList; // 0 or 1 => tell in which list observers of modified values must be added
- // current & next observers being notified : if such observer if removed during notification, pointer will be valids
- static CDBBranchObsInfo *_CurrNotifiedObs;
- static CDBBranchObsInfo *_NextNotifiedObs;
-
- /// Mapping from server database index to client database index (first-level nodes)
- static std::vector _CDBBankToUnifiedIndexMapping [NB_CDB_BANKS];
-
- // Mapping from client database index to TCDBBank (first-level nodes)
- static std::vector _UnifiedIndexToBank;
-
- /// Last index mapped
- static uint _CDBLastUnifiedIndex;
-
- /// Number of bits for first-level branches, by bank
- static uint _FirstLevelIdBitsByBank [NB_CDB_BANKS];
+ TObserverHandleList observerHandles;
/// called by clear
void removeAllBranchObserver();
- void removeBranchInfoIt(TObsList::iterator it);
};
+}
#endif // CDB_BRANCH_H
diff --git a/code/nel/include/nel/misc/cdb_branch_observing_handler.h b/code/nel/include/nel/misc/cdb_branch_observing_handler.h
new file mode 100644
index 000000000..d7ec508af
--- /dev/null
+++ b/code/nel/include/nel/misc/cdb_branch_observing_handler.h
@@ -0,0 +1,128 @@
+// Ryzom - MMORPG Framework
+// Copyright (C) 2010 Winch Gate Property Limited
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see .
+
+#ifndef CDB_BRANCH_OBS_HNDLR
+#define CDB_BRANCH_OBS_HNDLR
+
+#include "nel/misc/cdb_branch.h"
+
+namespace NLMISC{
+
+ /**
+ @brief Manages the CDB branch observers.
+
+ When a leaf's data changes, it notifies the branch, which then marks the observers as notifiable.
+ The marked observers can then be notified and flushed on request.
+
+ */
+ class CCDBBranchObservingHandler{
+
+ enum{
+ MAX_OBS_LST = 2
+ };
+
+ public:
+ CCDBBranchObservingHandler();
+
+ ~CCDBBranchObservingHandler();
+
+ /// Notifies the observers, and flushes the list
+ void flushObserverCalls();
+
+ void reset();
+
+ void addBranchObserver( CCDBNodeBranch *branch, ICDBNode::IPropertyObserver *observer, const std::vector< std::string >& positiveLeafNameFilter );
+
+ void addBranchObserver( CCDBNodeBranch *branch, const char *dbPathFromThisNode, ICDBNode::IPropertyObserver &observer, const char **positiveLeafNameFilter, uint positiveLeafNameFilterSize );
+
+ void removeBranchObserver( CCDBNodeBranch *branch, ICDBNode::IPropertyObserver* observer );
+
+ void removeBranchObserver( CCDBNodeBranch *branch, const char *dbPathFromThisNode, ICDBNode::IPropertyObserver &observer );
+
+
+ ///Observer for branch observer flush events.
+ class IBranchObserverCallFlushObserver : public CRefCount{
+ public:
+ virtual ~IBranchObserverCallFlushObserver(){}
+ virtual void onObserverCallFlush() = 0;
+ };
+
+ private:
+ void triggerFlushObservers();
+
+ public:
+ void addFlushObserver( IBranchObserverCallFlushObserver *observer );
+ void removeFlushObserver( IBranchObserverCallFlushObserver *observer );
+
+ private:
+
+ /**
+ @brief Handle to a branch observer.
+
+ The handle stores the owner branch, the observer and remembers if it's marked for notifying the observer.
+ Also it manages adding/removing itself to/from the marked observer handles list, which is handled by CCDBBranchObservingHandler.
+
+ */
+ class CCDBDBBranchObserverHandle : public CCDBNodeBranch::ICDBDBBranchObserverHandle{
+
+ public:
+
+ CCDBDBBranchObserverHandle( ICDBNode::IPropertyObserver *observer, CCDBNodeBranch *owner, CCDBBranchObservingHandler *handler );
+
+ ~CCDBDBBranchObserverHandle();
+
+ ICDBNode* owner(){ return _owner; }
+
+ ICDBNode::IPropertyObserver* observer(){ return _observer; }
+
+ bool observesLeaf( const std::string &leafName );
+
+ bool inList( uint list );
+
+ void addToFlushableList();
+
+ void removeFromFlushableList( uint list );
+
+ void removeFromFlushableList();
+
+ private:
+
+ bool _inList[ MAX_OBS_LST ];
+
+ std::vector< std::string > _observedLeaves;
+
+ CCDBNodeBranch *_owner;
+
+ NLMISC::CRefPtr< ICDBNode::IPropertyObserver > _observer;
+
+ CCDBBranchObservingHandler *_handler;
+
+ };
+
+ std::list< CCDBNodeBranch::ICDBDBBranchObserverHandle* > flushableObservers[ MAX_OBS_LST ];
+
+ CCDBNodeBranch::ICDBDBBranchObserverHandle *currentHandle;
+
+ uint currentList;
+
+ std::vector< IBranchObserverCallFlushObserver* > flushObservers;
+
+ };
+}
+
+#endif
+
+
diff --git a/code/ryzom/client/src/cdb_check_sum.h b/code/nel/include/nel/misc/cdb_check_sum.h
similarity index 93%
rename from code/ryzom/client/src/cdb_check_sum.h
rename to code/nel/include/nel/misc/cdb_check_sum.h
index df0cf3959..02ce8f18b 100644
--- a/code/ryzom/client/src/cdb_check_sum.h
+++ b/code/nel/include/nel/misc/cdb_check_sum.h
@@ -19,8 +19,9 @@
#ifndef NL_CDB_CHECK_SUM_H
#define NL_CDB_CHECK_SUM_H
-#include "nel/misc/types_nl.h"
+#include "types_nl.h"
+namespace NLMISC{
/**
* class implementing check sum for the client database
@@ -81,6 +82,7 @@ private:
};
+}
#endif // NL_CDB_CHECK_SUM_H
diff --git a/code/ryzom/client/src/cdb_leaf.h b/code/nel/include/nel/misc/cdb_leaf.h
similarity index 88%
rename from code/ryzom/client/src/cdb_leaf.h
rename to code/nel/include/nel/misc/cdb_leaf.h
index d28cff2c2..566394d97 100644
--- a/code/ryzom/client/src/cdb_leaf.h
+++ b/code/nel/include/nel/misc/cdb_leaf.h
@@ -21,7 +21,10 @@
#include "cdb.h"
#include "cdb_branch.h"
-#include "nel/misc/time_nl.h"
+#include "time_nl.h"
+#include "rgba.h"
+
+namespace NLMISC{
/**
* Database node which contains a unique property
@@ -50,16 +53,16 @@ public:
void setValue8 (sint8 prop);
inline bool getValueBool() { return (_Property!=(sint64)0 ); }
void setValueBool (bool prop);
- inline NLMISC::CRGBA getValueRGBA()
+ inline CRGBA getValueRGBA()
{
- NLMISC::CRGBA col;
+ CRGBA col;
col.R = (uint8)(_Property&0xff);
col.G = (uint8)((_Property>>8)&0xff);
col.B = (uint8)((_Property>>16)&0xff);
col.A = (uint8)((_Property>>24)&0xff);
return col;
}
- void setValueRGBA (const NLMISC::CRGBA &color);
+ void setValueRGBA (const CRGBA &color);
/// Return the value of the property before the database change
inline sint64 getOldValue64() { return _oldProperty; }
@@ -98,7 +101,7 @@ public:
* Build the structure of the database from a file
* \param f is the stream
*/
- void init( xmlNodePtr node, NLMISC::IProgressCallback &progressCallBack, bool mapBanks=false );
+ void init( xmlNodePtr node, IProgressCallback &progressCallBack, bool mapBanks=false, CCDBBankHandler *bankHandler = NULL );
/**
* Get a node
@@ -132,7 +135,7 @@ public:
* Update the database from a stream coming from the FE
* \param f : the stream.
*/
- void readDelta(NLMISC::TGameCycle gc, NLMISC::CBitMemStream & f );
+ void readDelta(TGameCycle gc, CBitMemStream & f );
/**
* Return the value of a property (the update flag is set to false)
@@ -154,10 +157,10 @@ public:
/**
* Set the value of a property, only if gc>=_LastChangeGC
*/
- bool setPropCheckGC(NLMISC::TGameCycle gc, sint64 value);
+ bool setPropCheckGC(TGameCycle gc, sint64 value);
/// Reset all leaf data from this point
- void resetData(NLMISC::TGameCycle gc, bool forceReset=false);
+ void resetData(TGameCycle gc, bool forceReset=false);
/**
* Clear the node and his children
@@ -215,7 +218,7 @@ public:
/// get the last change GameCycle (server tick) for this value
- NLMISC::TGameCycle getLastChangeGC() const {return _LastChangeGC;}
+ TGameCycle getLastChangeGC() const {return _LastChangeGC;}
private:
@@ -234,7 +237,7 @@ private:
/// gamecycle (servertick) of the last change for this value.
/// change are made in readDelta only for change >= _LastChangeGC
- NLMISC::TGameCycle _LastChangeGC;
+ TGameCycle _LastChangeGC;
/// observers to call when the value really change
std::vector _Observers;
@@ -249,7 +252,7 @@ private:
////////////////////
-
+}
#endif // CDB_LEAF_H
diff --git a/code/nel/include/nel/misc/cdb_manager.h b/code/nel/include/nel/misc/cdb_manager.h
new file mode 100644
index 000000000..de6ccd20f
--- /dev/null
+++ b/code/nel/include/nel/misc/cdb_manager.h
@@ -0,0 +1,184 @@
+// Ryzom - MMORPG Framework
+// Copyright (C) 2010 Winch Gate Property Limited
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as
+// published by the Free Software Foundation, either version 3 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see .
+
+
+#ifndef CDB_MANAGER_H
+#define CDB_MANAGER_H
+
+#include "nel/misc/cdb_branch.h"
+#include "nel/misc/cdb_leaf.h"
+#include "nel/misc/cdb_bank_handler.h"
+#include "nel/misc/cdb_branch_observing_handler.h"
+
+namespace NLMISC{
+
+ /// Class that encapsulates the separate CDB components
+ class CCDBManager{
+
+ public:
+ /**
+ The constructor
+ @param maxBanks - The maximum number of banks to be used
+
+ */
+ CCDBManager( const char *rootNodeName, uint maxBanks );
+
+ ~CCDBManager();
+
+
+ /**
+ Returns the specified leaf node from the database.
+ @param name The name of the leaf node.
+ @param create Specifies if the node should be created if it doesn't exist yet.
+
+ */
+ CCDBNodeLeaf* getDbLeaf( const std::string &name, bool create = true );
+
+
+
+ /**
+ Returns the specified branch node from the database.
+ @param name The name of the branch.
+
+ */
+ CCDBNodeBranch* getDbBranch( const std::string &name );
+
+
+ /**
+ Deletes the specified database node.
+ @param name The name of the database node.
+
+ */
+ void delDbNode( const std::string &name );
+
+ /**
+ Adds an observer to a branch of the database.
+ @param branchName The name of the branch we want to observe
+ @param observer The observer we want to add
+ @param positiveLeafNameFilter A vector of strings containing the names of the leaves we want to observe
+
+ */
+ void addBranchObserver( const char *branchName, ICDBNode::IPropertyObserver *observer, const std::vector< std::string >& positiveLeafNameFilter = std::vector< std::string >() );
+
+ /**
+ Adds an observer to a branch of the database.
+ @param branch The branch we want to observe
+ @param observer The observer we want to add
+ @param positiveLeafNameFilter A vector of strings containing the names of the leaves we want to observe
+
+ */
+ void addBranchObserver( CCDBNodeBranch *branch, ICDBNode::IPropertyObserver *observer, const std::vector< std::string >& positiveLeafNameFilter = std::vector< std::string >() );
+
+
+ /**
+ Adds an observer to a branch of the database.
+ @param branchName The name of the branch we start from
+ @param dbPathFromThisNode The path to the branch we want to observe
+ @param observer The observer we want to add
+ @param positiveLeafNameFilter An array of strings containing the names of the leaves we want to observe
+ @param positiveLeafNameFilterSize The size of the array
+
+ */
+ void addBranchObserver( const char *branchName, const char *dbPathFromThisNode, ICDBNode::IPropertyObserver &observer, const char **positiveLeafNameFilter = NULL, uint positiveLeafNameFilterSize = 0 );
+
+
+ /**
+ Adds an observer to a branch of the database.
+ @param branch The branch we start from
+ @param dbPathFromThisNode The path to the branch we want to observe
+ @param observer The observer we want to add
+ @param positiveLeafNameFilter An array of strings containing the names of the leaves we want to observe
+ @param positiveLeafNameFilterSize The size of the array
+
+ */
+ void addBranchObserver( CCDBNodeBranch *branch, const char *dbPathFromThisNode, ICDBNode::IPropertyObserver &observer, const char **positiveLeafNameFilter, uint positiveLeafNameFilterSize );
+
+
+ /**
+ Removes an observer from a branch in the database.
+ @param branchName The name of the branch
+ @param observer The observer we want to remove
+
+ */
+ void removeBranchObserver( const char *branchName, ICDBNode::IPropertyObserver* observer );
+
+
+ /**
+ Removes an observer from a branch in the database.
+ @param branch The branch
+ @param observer The observer we want to remove
+
+ */
+ void removeBranchObserver( CCDBNodeBranch *branch, ICDBNode::IPropertyObserver* observer );
+
+
+ /**
+ Removes an observer from a branch in the database.
+ @param branchName The name of the branch we start from
+ @param dbPathFromThisNode The path to the branch we want to observe from the starting branch
+ @param observer The observer we want to remove
+
+ */
+ void removeBranchObserver( const char *branchName, const char *dbPathFromThisNode, ICDBNode::IPropertyObserver &observer );
+
+
+ /**
+ Removes an observer from a branch in the database.
+ @param branchName The name of the branch we start from
+ @param dbPathFromThisNode The path to the branch we want to observe from the starting branch
+ @param observer The observer we want to remove
+
+ */
+ void removeBranchObserver( CCDBNodeBranch *branch, const char *dbPathFromThisNode, ICDBNode::IPropertyObserver &observer );
+
+
+ /**
+ Adds a branch observer call flush observer. ( These are notified after the branch observers are notified )
+ @param observer The observer
+
+ */
+ void addFlushObserver( CCDBBranchObservingHandler::IBranchObserverCallFlushObserver *observer );
+
+
+ /**
+ Removes a branch observer call flush observer.
+ @param observer The observer
+ */
+ void removeFlushObserver( CCDBBranchObservingHandler::IBranchObserverCallFlushObserver *observer );
+
+ /**
+ Notifies the observers whose observed branches were updated.
+ */
+ void flushObserverCalls();
+
+ /**
+ Resets the specified bank.
+ @param gc GameCycle ( no idea what it is exactly, probably some time value )
+ @param bank The banks we want to reset
+
+ */
+ void resetBank( uint gc, uint bank );
+
+ protected:
+ CCDBBankHandler bankHandler;
+ CCDBBranchObservingHandler branchObservingHandler;
+ CRefPtr< CCDBNodeBranch > _Database;
+ };
+
+}
+
+#endif
+
diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h
index 42bf56d3b..fa9272386 100644
--- a/code/nel/include/nel/misc/common.h
+++ b/code/nel/include/nel/misc/common.h
@@ -342,6 +342,8 @@ std::string secondsToHumanReadable (uint32 time);
/// Get a bytes or time in string format and convert it in seconds or bytes
uint32 fromHumanReadable (const std::string &str);
+/// Add digit grouping seperator to if value >= 10 000. Assumes input is numerical string.
+std::string formatThousands(const std::string& s);
/// This function executes a program in the background and returns instantly (used for example to launch services in AES).
/// The program will be launched in the current directory
diff --git a/code/nel/include/nel/misc/diff_tool.h b/code/nel/include/nel/misc/diff_tool.h
index 64989fcaf..2f291c6a0 100644
--- a/code/nel/include/nel/misc/diff_tool.h
+++ b/code/nel/include/nel/misc/diff_tool.h
@@ -501,8 +501,8 @@ namespace STRING_MANAGER
// callback->onSwap(it - context.Reference.begin(), refCount, context);
callback->onSwap(index, refCount, context);
-// swap(*it, context.Reference[refCount]);
- swap(context.Reference[index], context.Reference[refCount]);
+// std::swap(*it, context.Reference[refCount]);
+ std::swap(context.Reference[index], context.Reference[refCount]);
}
}
else if (getHashValue(context.Addition, addCount) != getHashValue(context.Reference, refCount))
diff --git a/code/nel/include/nel/misc/eid_translator.h b/code/nel/include/nel/misc/eid_translator.h
index 695f7724e..9937b72fd 100644
--- a/code/nel/include/nel/misc/eid_translator.h
+++ b/code/nel/include/nel/misc/eid_translator.h
@@ -146,6 +146,8 @@ public:
TAdditionalInfoCb EntityInfoCallback;
+ static void removeShardFromName(ucstring& name);
+
private:
// get all eid for a user using the user name or the user id
void getByUser (uint32 uid, std::vector &res);
diff --git a/code/nel/include/nel/misc/event_emitter.h b/code/nel/include/nel/misc/event_emitter.h
index e678c2674..5c547d07f 100644
--- a/code/nel/include/nel/misc/event_emitter.h
+++ b/code/nel/include/nel/misc/event_emitter.h
@@ -49,7 +49,7 @@ public:
* \param server
*/
virtual void submitEvents(CEventServer & server, bool allWindows) = 0;
-
+
/**
* Instruct the event emitter to send CGDMouseMove instead of CEventMouseMove.
*
diff --git a/code/nel/include/nel/misc/fast_id_map.h b/code/nel/include/nel/misc/fast_id_map.h
new file mode 100644
index 000000000..dbd05bc76
--- /dev/null
+++ b/code/nel/include/nel/misc/fast_id_map.h
@@ -0,0 +1,151 @@
+/**
+ * \file fast_id_map.h
+ * \brief CFastIdMap
+ * \date 2012-04-10 19:28GMT
+ * \author Jan Boon (Kaetemi)
+ * CFastIdMap
+ */
+
+/*
+ * Copyright (C) 2012 by authors
+ *
+ * This file is part of RYZOM CORE.
+ * RYZOM CORE is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * RYZOM CORE is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with RYZOM CORE. If not, see
+ * .
+ */
+
+#ifndef NLMISC_FAST_ID_MAP_H
+#define NLMISC_FAST_ID_MAP_H
+#include
+
+// STL includes
+
+// NeL includes
+#include
+
+// Project includes
+
+namespace NLMISC {
+
+/**
+ * \brief CFastIdMap
+ * \date 2012-04-10 19:28GMT
+ * \author Jan Boon (Kaetemi)
+ * This template allows for assigning unique uint32 identifiers to pointers.
+ * Useful when externally only exposing an identifier, when pointers may have been deleted.
+ * The identifier is made from two uint16's, one being the direct index in the identifier vector,
+ * and the other being a verification value that is increased when the identifier index is re-used.
+ * TId must be a typedef of uint32.
+ * TValue should be a pointer.
+ */
+template
+class CFastIdMap
+{
+protected:
+ struct CIdInfo
+ {
+ CIdInfo() { }
+ CIdInfo(uint16 verification, uint16 next, TValue value) :
+ Verification(verification), Next(next), Value(value) { }
+ uint16 Verification;
+ uint16 Next;
+ TValue Value;
+ };
+ /// ID memory
+ std::vector m_Ids;
+ /// Nb of assigned IDs
+ uint m_Size;
+ /// Assigned IDs
+ uint16 m_Next;
+
+public:
+ CFastIdMap(TValue defaultValue) : m_Size(0), m_Next(0)
+ {
+ // Id 0 will contain the last available unused id, and be 0 if no more unused id's are available
+ // defaultValue will be returned when the ID is not found
+ m_Ids.push_back(CIdInfo(0, 0, defaultValue));
+ }
+
+ virtual ~CFastIdMap() { }
+
+ void clear()
+ {
+ m_Ids.resize(1);
+ m_Ids[0].Next = 0;
+ }
+
+ TId insert(TValue value)
+ {
+ // get next unused index
+ uint16 idx = m_Ids[0].Next;
+ if (idx == 0)
+ {
+ // size of used elements must be equal to the vector size minus one, when everything is allocated
+ nlassert((m_Ids.size() - 1) == m_Size);
+
+ idx = m_Ids.size();
+ uint16 verification = rand();
+ m_Ids.push_back(CIdInfo(verification, m_Next, value));
+ m_Next = idx;
+ return (TId)(((uint32)verification) << 16) & idx;
+ }
+ else
+ {
+ m_Ids[0].Next = m_Ids[idx].Next; // restore the last unused id
+ m_Ids[idx].Value = value;
+ return (TId)(((uint32)m_Ids[idx].Verification) << 16) & idx;
+ }
+ }
+
+ void erase(TId id)
+ {
+ uint32 idx = ((uint32)id) & 0xFFFF;
+ uint16 verification = (uint16)(((uint32)id) >> 16);
+ if (m_Ids[idx].Verification == verification)
+ {
+ m_Ids[idx].Value = m_Ids[0].Value; // clean value for safety
+ m_Ids[idx].Verification = (uint16)(((uint32)m_Ids[idx].Verification + 1) & 0xFFFF); // change verification value, allow overflow :)
+ m_Ids[idx].Next = m_Ids[0].Next; // store the last unused id
+ m_Ids[0].Next = (uint16)idx; // set this as last unused id
+ }
+ else
+ {
+ nlwarning("Invalid ID");
+ }
+ }
+
+ TValue get(TId id)
+ {
+ uint32 idx = ((uint32)id) & 0xFFFF;
+ uint16 verification = (uint16)(((uint32)id) >> 16);
+ if (m_Ids[idx].Verification == verification)
+ {
+ return m_Ids[idx].Value;
+ }
+ else
+ {
+ nldebug("Invalid ID");
+ return m_Ids[0].Value;
+ }
+ }
+
+ inline uint size() { return m_Size; }
+
+}; /* class CFastIdMap */
+
+} /* namespace NLMISC */
+
+#endif /* #ifndef NLMISC_FAST_ID_MAP_H */
+
+/* end of file */
diff --git a/code/nel/include/nel/misc/mem_stream.h b/code/nel/include/nel/misc/mem_stream.h
index 2102129dd..1da99a48d 100644
--- a/code/nel/include/nel/misc/mem_stream.h
+++ b/code/nel/include/nel/misc/mem_stream.h
@@ -301,7 +301,7 @@ public:
* If you are using the stream only in output mode, you can use this method as a faster version
* of clear() *if you don't serialize pointers*.
*/
- void resetBufPos() { _Buffer.Pos = 0; }
+ virtual void resetBufPos() { _Buffer.Pos = 0; }
/**
* Resize the message buffer and fill data at position 0.
@@ -340,7 +340,7 @@ public:
* fill it with raw data using any filling function (warning: don't fill more than 'msgsize'
* bytes!), then you are ready to read, using serial(), the data you've just filled.
*/
- uint8 *bufferToFill( uint32 msgsize )
+ virtual uint8 *bufferToFill( uint32 msgsize )
{
#ifdef NL_DEBUG
nlassert( isReading() );
diff --git a/code/nel/include/nel/misc/mutex.h b/code/nel/include/nel/misc/mutex.h
index e2205d666..1c01a6134 100644
--- a/code/nel/include/nel/misc/mutex.h
+++ b/code/nel/include/nel/misc/mutex.h
@@ -717,11 +717,11 @@ class CAutoMutex
TMutex &_Mutex;
// forbeden copy or assignent
- CAutoMutex(const CAutoMutex &other)
+ CAutoMutex(const CAutoMutex &/* other */)
{
}
- CAutoMutex &operator = (const CAutoMutex &other)
+ CAutoMutex &operator = (const CAutoMutex &/* other */)
{
return *this;
}
diff --git a/code/nel/include/nel/misc/p_thread.h b/code/nel/include/nel/misc/p_thread.h
index cd027aa37..7e6a4d5a5 100644
--- a/code/nel/include/nel/misc/p_thread.h
+++ b/code/nel/include/nel/misc/p_thread.h
@@ -36,6 +36,12 @@ namespace NLMISC {
class CPThread : public IThread
{
public:
+ enum TThreadState
+ {
+ ThreadStateNone,
+ ThreadStateRunning,
+ ThreadStateFinished,
+ };
/// Constructor
CPThread( IRunnable *runnable, uint32 stackSize);
@@ -48,6 +54,7 @@ public:
virtual void wait();
virtual bool setCPUMask(uint64 cpuMask);
virtual uint64 getCPUMask();
+ virtual void setPriority(TThreadPriority priority);
virtual std::string getUserName();
virtual IRunnable *getRunnable()
@@ -58,10 +65,11 @@ public:
/// Internal use
IRunnable *Runnable;
-private:
- uint8 _State; // 0=not created, 1=started, 2=finished
- uint32 _StackSize;
+ TThreadState _State;
pthread_t _ThreadHandle;
+
+private:
+ uint32 _StackSize;
};
/**
diff --git a/code/nel/include/nel/misc/speaker_listener.h b/code/nel/include/nel/misc/speaker_listener.h
index 7481e12c8..5f9f86352 100644
--- a/code/nel/include/nel/misc/speaker_listener.h
+++ b/code/nel/include/nel/misc/speaker_listener.h
@@ -118,7 +118,7 @@ namespace NLMISC
_Speaker->registerListener(this);
}
- void unregisterListener(ISpeaker *speaker)
+ void unregisterListener(ISpeaker * /* speaker */)
{
nlassert(_Speaker != NULL);
_Speaker->unregisterListener(this);
diff --git a/code/nel/include/nel/misc/sstring.h b/code/nel/include/nel/misc/sstring.h
index 513c681c9..fc17d67f5 100644
--- a/code/nel/include/nel/misc/sstring.h
+++ b/code/nel/include/nel/misc/sstring.h
@@ -55,7 +55,7 @@ public:
/// ctor
CSString(int i,const char *fmt="%d");
/// ctor
- CSString(unsigned u,const char *fmt="%u");
+ CSString(uint32 u,const char *fmt="%u");
/// ctor
CSString(double d,const char *fmt="%f");
/// ctor
@@ -76,14 +76,14 @@ public:
char back() const;
/// Return the n left hand most characters of a string
- CSString left(unsigned count) const;
+ CSString left(uint32 count) const;
/// Return the n right hand most characters of a string
- CSString right(unsigned count) const;
+ CSString right(uint32 count) const;
/// Return the string minus the n left hand most characters of a string
- CSString leftCrop(unsigned count) const;
+ CSString leftCrop(uint32 count) const;
/// Return the string minus the n right hand most characters of a string
- CSString rightCrop(unsigned count) const;
+ CSString rightCrop(uint32 count) const;
/// Return sub string up to but not including first instance of given character, starting at 'iterator'
/// on exit 'iterator' indexes first character after extracted string segment
@@ -116,9 +116,9 @@ public:
/// Return sub string remaining after the first word
CSString tailFromFirstWord() const;
/// Count the number of words in a string
- unsigned countWords() const;
+ uint32 countWords() const;
/// Extract the given word
- CSString word(unsigned idx) const;
+ CSString word(uint32 idx) const;
/// Return first word or quote-encompassed sub-string - can remove extracted sub-string from source string
CSString firstWordOrWords(bool truncateThis=false,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true);
@@ -127,9 +127,9 @@ public:
/// Return sub string following first word (or quote-encompassed sub-string)
CSString tailFromFirstWordOrWords(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const;
/// Count the number of words (or quote delimited sub-strings) in a string
- unsigned countWordOrWords(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const;
+ uint32 countWordOrWords(bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const;
/// Extract the given words (or quote delimited sub-strings)
- CSString wordOrWords(unsigned idx,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const;
+ CSString wordOrWords(uint32 idx,bool useSlashStringEscape=true,bool useRepeatQuoteStringEscape=true) const;
/// Return first line - can remove extracted line from source string
CSString firstLine(bool truncateThis=false);
@@ -138,9 +138,9 @@ public:
/// Return sub string remaining after the first line
CSString tailFromFirstLine() const;
/// Count the number of lines in a string
- unsigned countLines() const;
+ uint32 countLines() const;
/// Extract the given line
- CSString line(unsigned idx) const;
+ CSString line(uint32 idx) const;
/// A handy utility routine for knowing if a character is a white space character or not (' ','\t','\n','\r',26)
static bool isWhiteSpace(char c);
@@ -377,7 +377,7 @@ public:
/// assignment operator
CSString& operator=(int i);
/// assignment operator
- CSString& operator=(unsigned u);
+ CSString& operator=(uint32 u);
/// assignment operator
CSString& operator=(double d);
@@ -561,7 +561,7 @@ inline CSString::CSString(int i,const char *fmt)
*this=buf;
}
-inline CSString::CSString(unsigned u,const char *fmt)
+inline CSString::CSString(uint32 u,const char *fmt)
{
char buf[1024];
sprintf(buf,fmt,u);
@@ -611,26 +611,26 @@ inline char CSString::back() const
return (*this)[size()-1];
}
-inline CSString CSString::right(unsigned count) const
+inline CSString CSString::right(uint32 count) const
{
if (count>=size())
return *this;
return substr(size()-count);
}
-inline CSString CSString::rightCrop(unsigned count) const
+inline CSString CSString::rightCrop(uint32 count) const
{
if (count>=size())
return CSString();
return substr(0,size()-count);
}
-inline CSString CSString::left(unsigned count) const
+inline CSString CSString::left(uint32 count) const
{
return substr(0,count);
}
-inline CSString CSString::leftCrop(unsigned count) const
+inline CSString CSString::leftCrop(uint32 count) const
{
if (count>=size())
return CSString();
@@ -639,7 +639,7 @@ inline CSString CSString::leftCrop(unsigned count) const
inline CSString CSString::splitToWithIterator(char c,uint32& iterator) const
{
- unsigned i;
+ uint32 i;
CSString result;
for (i=iterator;i !!!
- CSTLBlockAllocator(CBlockMemory *bm)
+ CSTLBlockAllocator(CBlockMemory * /* bm */)
{
}
/// copy ctor
diff --git a/code/nel/include/nel/misc/thread.h b/code/nel/include/nel/misc/thread.h
index 82ef78a13..983e6b12a 100644
--- a/code/nel/include/nel/misc/thread.h
+++ b/code/nel/include/nel/misc/thread.h
@@ -68,6 +68,16 @@ public:
}
};
+/// Thread priorities, numbering follows Win32 for now
+enum TThreadPriority
+{
+ ThreadPriorityLowest = -2,
+ ThreadPriorityLow = -1,
+ ThreadPriorityNormal = 0,
+ ThreadPriorityHigh = 1,
+ ThreadPriorityHighest = 2,
+};
+
/**
* Thread base interface, must be implemented for all OS
* \author Vianney Lecroart
@@ -119,6 +129,9 @@ public:
*/
virtual uint64 getCPUMask()=0;
+ /// Set the thread priority. Thread must have been started before.
+ virtual void setPriority(TThreadPriority priority) = 0;
+
/**
* Get the thread user name.
* Under Linux return thread owner, under windows return the name of the logon user.
diff --git a/code/nel/include/nel/misc/win_thread.h b/code/nel/include/nel/misc/win_thread.h
index a2e8b5389..628942dde 100644
--- a/code/nel/include/nel/misc/win_thread.h
+++ b/code/nel/include/nel/misc/win_thread.h
@@ -49,6 +49,7 @@ public:
virtual void wait();
virtual bool setCPUMask(uint64 cpuMask);
virtual uint64 getCPUMask();
+ virtual void setPriority(TThreadPriority priority);
virtual std::string getUserName();
virtual IRunnable *getRunnable()
@@ -69,8 +70,7 @@ public:
void suspend();
// Resume the thread. No-op if already resumed
void resume();
- // set priority as defined by "SetThreadpriority"
- void setPriority(int priority);
+ // Priority boost
void enablePriorityBoost(bool enabled);
/// private use
diff --git a/code/nel/include/nel/net/Makefile.am b/code/nel/include/nel/net/Makefile.am
deleted file mode 100644
index 7a5dfe1be..000000000
--- a/code/nel/include/nel/net/Makefile.am
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-includedir = ${prefix}/include/nel/net
-
-include_HEADERS = admin.h \
- buf_client.h \
- buf_net_base.h \
- buf_server.h \
- buf_sock.h \
- callback_client.h \
- callback_net_base.h \
- callback_server.h \
- cvar_log_filter.h \
- dummy_tcp_sock.h \
- email.h \
- inet_address.h \
- listen_sock.h \
- login_client.h \
- login_cookie.h \
- login_server.h \
- message.h \
- message_recorder.h \
- module_builder_parts.h \
- module_common.h \
- module_gateway.h \
- module.h \
- module_manager.h \
- module_message.h \
- module_socket.h \
- naming_client.h \
- net_displayer.h \
- net_log.h \
- net_manager.h \
- pacs_client.h \
- service.h \
- sock.h \
- tcp_sock.h \
- transport_class.h \
- udp_sim_sock.h \
- udp_sock.h \
- unified_network.h \
- unitime.h \
- varpath.h
-
-# End of Makefile.am
diff --git a/code/nel/include/nel/net/module_builder_parts.h b/code/nel/include/nel/net/module_builder_parts.h
index b080e521f..d2e653315 100644
--- a/code/nel/include/nel/net/module_builder_parts.h
+++ b/code/nel/include/nel/net/module_builder_parts.h
@@ -188,8 +188,8 @@ namespace NLNET
// unused interceptors
std::string fwdBuildModuleManifest() const { return std::string(); }
- void fwdOnModuleSecurityChange(NLNET::IModuleProxy *moduleProxy) {}
- bool fwdOnProcessModuleMessage(NLNET::IModuleProxy *sender, const NLNET::CMessage &message) {return false;}
+ void fwdOnModuleSecurityChange(NLNET::IModuleProxy * /* moduleProxy */) {}
+ bool fwdOnProcessModuleMessage(NLNET::IModuleProxy * /* sender */, const NLNET::CMessage &/* message */) {return false;}
// check module up
void fwdOnModuleUp(NLNET::IModuleProxy *moduleProxy)
diff --git a/code/nel/include/nel/net/transport_class.h b/code/nel/include/nel/net/transport_class.h
index 11161d7cd..f1110e492 100644
--- a/code/nel/include/nel/net/transport_class.h
+++ b/code/nel/include/nel/net/transport_class.h
@@ -75,7 +75,7 @@ public:
enum TProp {
PropUInt8, PropUInt16, PropUInt32, PropUInt64,
PropSInt8, PropSInt16, PropSInt32, PropSInt64,
- PropBool, PropFloat, PropDouble, PropString, PropDataSetRow, PropSheetId, PropUKN };
+ PropBool, PropFloat, PropDouble, PropString, PropDataSetRow, PropSheetId, PropUCString, PropUKN };
// PropBool, PropFloat, PropDouble, PropString, PropDataSetRow, PropEntityId, PropSheetId, PropUKN };
@@ -160,6 +160,7 @@ public:
case PropString: nlassert(sizeof(T) == sizeof (std::string)); break;
// case PropEntityId: nlassert(sizeof(T) == sizeof (NLMISC::CEntityId)); break;
case PropSheetId: nlassert(sizeof(T) == sizeof (NLMISC::CSheetId)); break;
+ case PropUCString: nlassert(sizeof(T) == sizeof (ucstring)); break;
default: nlerror ("property %s have unknown type %d", name.c_str(), type);
}
@@ -334,7 +335,7 @@ protected:
T *Value;
- virtual void serialDefaultValue (NLMISC::IStream &f)
+ virtual void serialDefaultValue (NLMISC::IStream &/* f */)
{
// nothing
}
diff --git a/code/nel/include/nel/pacs/Makefile.am b/code/nel/include/nel/pacs/Makefile.am
deleted file mode 100644
index 7160ec65c..000000000
--- a/code/nel/include/nel/pacs/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-includedir = ${prefix}/include/nel/pacs
-
-include_HEADERS = u_collision_desc.h \
- u_global_position.h \
- u_global_retriever.h \
- u_move_container.h \
- u_move_primitive.h \
- u_primitive_block.h \
- u_retriever_bank.h
-
-# End of Makefile.am
-
diff --git a/code/nel/include/nel/sound/Makefile.am b/code/nel/include/nel/sound/Makefile.am
deleted file mode 100644
index 77dd246a6..000000000
--- a/code/nel/include/nel/sound/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-#
-
-MAINTAINERCLEANFILES = Makefile.in
-
-includedir = ${prefix}/include/nel/sound
-
-include_HEADERS = sound_animation.h \
- sound_anim_manager.h \
- sound_anim_marker.h \
- u_audio_mixer.h \
- u_listener.h \
- u_source.h
-
-# End of Makefile.am
diff --git a/code/nel/include/nel/sound/audio_decoder.h b/code/nel/include/nel/sound/audio_decoder.h
new file mode 100644
index 000000000..3babc1de1
--- /dev/null
+++ b/code/nel/include/nel/sound/audio_decoder.h
@@ -0,0 +1,107 @@
+/**
+ * \file audio_decoder.h
+ * \brief IAudioDecoder
+ * \date 2012-04-11 09:34GMT
+ * \author Jan Boon (Kaetemi)
+ * IAudioDecoder
+ */
+
+/*
+ * Copyright (C) 2008-2012 by authors
+ *
+ * This file is part of RYZOM CORE.
+ * RYZOM CORE is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * RYZOM CORE is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with RYZOM CORE. If not, see
+ * .
+ */
+
+#ifndef NLSOUND_AUDIO_DECODER_H
+#define NLSOUND_AUDIO_DECODER_H
+#include
+
+// STL includes
+
+// NeL includes
+
+// Project includes
+
+namespace NLSOUND {
+
+/**
+ * \brief IAudioDecoder
+ * \date 2008-08-30 11:38GMT
+ * \author Jan Boon (Kaetemi)
+ * IAudioDecoder is only used by the driver implementation to stream
+ * music files into a readable format (it's a simple decoder interface).
+ * You should not call these functions (getSongTitle) on nlsound or user level,
+ * as a driver might have additional music types implemented.
+ * TODO: Split IAudioDecoder into IAudioDecoder (actual decoding) and IMediaDemuxer (stream splitter), and change the interface to make more sense.
+ * TODO: Allow user application to register more decoders.
+ * TODO: Look into libavcodec for decoding audio?
+ */
+class IAudioDecoder
+{
+private:
+ // pointers
+ /// Stream from file created by IAudioDecoder
+ NLMISC::IStream *_InternalStream;
+
+public:
+ IAudioDecoder();
+ virtual ~IAudioDecoder();
+
+ /// Create a new music buffer, may return NULL if unknown type, destroy with delete. Filepath lookup done here. If async is true, it will stream from hd, else it will load in memory first.
+ static IAudioDecoder *createAudioDecoder(const std::string &filepath, bool async, bool loop);
+
+ /// Create a new music buffer from a stream, type is file extension like "ogg" etc.
+ static IAudioDecoder *createAudioDecoder(const std::string &type, NLMISC::IStream *stream, bool loop);
+
+ /// Get information on a music file (only artist and title at the moment).
+ static bool getInfo(const std::string &filepath, std::string &artist, std::string &title);
+
+ /// Get audio/container extensions that are currently supported by the nel sound library.
+ static void getMusicExtensions(std::vector &extensions);
+
+ /// Return if a music extension is supported by the nel sound library.
+ static bool isMusicExtensionSupported(const std::string &extension);
+
+ /// Get how many bytes the music buffer requires for output minimum.
+ virtual uint32 getRequiredBytes() = 0;
+
+ /// Get an amount of bytes between minimum and maximum (can be lower than minimum if at end).
+ virtual uint32 getNextBytes(uint8 *buffer, uint32 minimum, uint32 maximum) = 0;
+
+ /// Get the amount of channels (2 is stereo) in output.
+ virtual uint8 getChannels() = 0;
+
+ /// Get the samples per second (often 44100) in output.
+ virtual uint getSamplesPerSec() = 0;
+
+ /// Get the bits per sample (often 16) in output.
+ virtual uint8 getBitsPerSample() = 0;
+
+ /// Get if the music has ended playing (never true if loop).
+ virtual bool isMusicEnded() = 0;
+
+ /// Get the total time in seconds.
+ virtual float getLength() = 0;
+
+ /// Set looping
+ virtual void setLooping(bool loop) = 0;
+}; /* class IAudioDecoder */
+
+} /* namespace NLSOUND */
+
+#endif /* #ifndef NLSOUND_AUDIO_DECODER_H */
+
+/* end of file */
diff --git a/code/nel/include/nel/sound/driver/music_buffer_vorbis.h b/code/nel/include/nel/sound/audio_decoder_vorbis.h
similarity index 50%
rename from code/nel/include/nel/sound/driver/music_buffer_vorbis.h
rename to code/nel/include/nel/sound/audio_decoder_vorbis.h
index 978f393da..bd7e45019 100644
--- a/code/nel/include/nel/sound/driver/music_buffer_vorbis.h
+++ b/code/nel/include/nel/sound/audio_decoder_vorbis.h
@@ -1,21 +1,33 @@
-// NeL - MMORPG Framework
-// Copyright (C) 2010 Winch Gate Property Limited
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Affero General Public License as
-// published by the Free Software Foundation, either version 3 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Affero General Public License for more details.
-//
-// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see .
+/**
+ * \file audio_decoder_vorbis.h
+ * \brief CAudioDecoderVorbis
+ * \date 2012-04-11 09:35GMT
+ * \author Jan Boon (Kaetemi)
+ * CAudioDecoderVorbis
+ */
-#ifndef NLSOUND_MUSIC_BUFFER_VORBIS_H
-#define NLSOUND_MUSIC_BUFFER_VORBIS_H
+/*
+ * Copyright (C) 2008-2012 by authors
+ *
+ * This file is part of RYZOM CORE.
+ * RYZOM CORE is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * RYZOM CORE is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with RYZOM CORE. If not, see
+ * .
+ */
+
+#ifndef NLSOUND_AUDIO_DECODER_VORBIS_H
+#define NLSOUND_AUDIO_DECODER_VORBIS_H
+#include
// STL includes
@@ -30,21 +42,20 @@
#endif
// NeL includes
+#include
// Project includes
-#include "music_buffer.h"
-namespace NLSOUND
-{
+namespace NLSOUND {
/**
- * \brief CMusicBufferVorbis
+ * \brief CAudioDecoderVorbis
* \date 2008-08-30 11:38GMT
* \author Jan Boon (Kaetemi)
- * CMusicBufferVorbis
- * Create trough IMusicBuffer, type "ogg"
+ * CAudioDecoderVorbis
+ * Create trough IAudioDecoder, type "ogg"
*/
-class CMusicBufferVorbis : public IMusicBuffer
+class CAudioDecoderVorbis : public IAudioDecoder
{
protected:
// outside pointers
@@ -59,8 +70,8 @@ protected:
sint32 _StreamOffset;
sint32 _StreamSize;
public:
- CMusicBufferVorbis(NLMISC::IStream *stream, bool loop);
- virtual ~CMusicBufferVorbis();
+ CAudioDecoderVorbis(NLMISC::IStream *stream, bool loop);
+ virtual ~CAudioDecoderVorbis();
inline NLMISC::IStream *getStream() { return _Stream; }
inline sint32 getStreamSize() { return _StreamSize; }
inline sint32 getStreamOffset() { return _StreamOffset; }
@@ -78,7 +89,7 @@ public:
virtual uint8 getChannels();
/// Get the samples per second (often 44100) in output.
- virtual uint32 getSamplesPerSec();
+ virtual uint getSamplesPerSec();
/// Get the bits per sample (often 16) in output.
virtual uint8 getBitsPerSample();
@@ -89,12 +100,12 @@ public:
/// Get the total time in seconds.
virtual float getLength();
- /// Get the size of uncompressed data in bytes.
- virtual uint getUncompressedSize();
-}; /* class CMusicBufferVorbis */
+ /// Set looping
+ virtual void setLooping(bool loop);
+}; /* class CAudioDecoderVorbis */
} /* namespace NLSOUND */
-#endif /* #ifndef NLSOUND_MUSIC_BUFFER_VORBIS_H */
+#endif /* #ifndef NLSOUND_AUDIO_DECODER_VORBIS_H */
/* end of file */
diff --git a/code/nel/include/nel/sound/audio_mixer_user.h b/code/nel/include/nel/sound/audio_mixer_user.h
index 7cd0de051..9c9fd5c86 100644
--- a/code/nel/include/nel/sound/audio_mixer_user.h
+++ b/code/nel/include/nel/sound/audio_mixer_user.h
@@ -34,6 +34,11 @@
#include "nel/sound/mixing_track.h"
#include "nel/sound/sound.h"
#include "nel/sound/music_channel_fader.h"
+#include "nel/sound/group_controller_root.h"
+
+// Current version is 2, Ryzom Live uses 1
+// Provided to allow compatibility with old binary files
+#define NLSOUND_SHEET_VERSION_BUILT 1
namespace NLLIGO {
class CLigoConfig;
@@ -51,26 +56,6 @@ namespace NLSOUND {
class CMusicSoundManager;
class IReverbEffect;
-/// Hasher functor for hashed container with pointer key.
-template
-struct THashPtr : public std::unary_function
-{
- static const size_t bucket_size = 4;
- static const size_t min_buckets = 8;
- size_t operator () (const Pointer &ptr) const
- {
- //CHashSet::hasher h;
- // transtype the pointer into int then hash it
- //return h.operator()(uint(uintptr_t(ptr)));
- return (size_t)(uintptr_t)ptr;
- }
- inline bool operator() (const Pointer &ptr1, const Pointer &ptr2) const
- {
- // delegate the work to someone else as well?
- return (uintptr_t)ptr1 < (uintptr_t)ptr2;
- }
-};
-
/**
* Implementation of UAudioMixer
*
@@ -197,6 +182,9 @@ public:
/// Get a TSoundId from a name (returns NULL if not found)
virtual TSoundId getSoundId( const NLMISC::TStringId &name );
+ /// Gets the group controller for the given group tree path with separator '/', if it doesn't exist yet it will be created.
+ /// Examples: "music", "effects", "dialog", "music/background", "music/loading", "music/player", etcetera
+ virtual UGroupController *getGroupController(const std::string &path);
/** Add a logical sound source (returns NULL if name not found).
* If spawn is true, the source will auto-delete after playing. If so, the return USource* pointer
@@ -204,9 +192,9 @@ public:
* pass a callback function that will be called (if not NULL) just before deleting the spawned
* source.
*/
- virtual USource *createSource( const NLMISC::TStringId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0 );
+ virtual USource *createSource( const NLMISC::TStringId &name, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL);
/// Add a logical sound source (by sound id). To remove a source, just delete it. See createSource(const char*)
- virtual USource *createSource( TSoundId id, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0 );
+ virtual USource *createSource( TSoundId id, bool spawn=false, TSpawnEndCallback cb=NULL, void *cbUserParam = NULL, NL3D::CCluster *cluster = 0, CSoundContext *context = 0, UGroupController *groupController = NULL);
/// Add a source which was created by an EnvSound
void addSource( CSourceCommon *source );
/** Delete a logical sound source. If you don't call it, the source will be auto-deleted
@@ -242,6 +230,8 @@ public:
virtual uint getSourcesInstanceCount() const { return (uint)_Sources.size(); }
/// Return the number of playing sources (slow)
virtual uint getPlayingSourcesCount() const;
+ uint countPlayingSimpleSources() const; // debug
+ uint countSimpleSources() const; // debug
/// Return the number of available tracks
virtual uint getAvailableTracksCount() const;
/// Return the number of used tracks
@@ -415,6 +405,7 @@ public:
/// Add a source for play as possible (for non discadable sound)
void addSourceWaitingForPlay(CSourceCommon *source);
+ void removeSourceWaitingForPlay(CSourceCommon *source);
/// Read all user controled var sheets
void initUserVar();
@@ -431,8 +422,6 @@ private:
// utility function for automatic sample bank loading.
bool tryToLoadSampleBank(const std::string &sampleName);
-
- typedef CHashSet > TSourceContainer;
typedef CHashSet > TMixerUpdateContainer;
typedef CHashMap, THashPtr > TBufferToSourceContainer;
// typedef std::multimap TTimedEventContainer;
@@ -565,6 +554,9 @@ private:
// Instance of the background music manager
CMusicSoundManager *_BackgroundMusicManager;
+ /// Group controller
+ CGroupControllerRoot _GroupController;
+
public:
struct TSampleBankHeader
{
diff --git a/code/nel/include/nel/sound/background_source.h b/code/nel/include/nel/sound/background_source.h
index cdf044776..14ea1cf53 100644
--- a/code/nel/include/nel/sound/background_source.h
+++ b/code/nel/include/nel/sound/background_source.h
@@ -36,7 +36,7 @@ class CBackgroundSource : public CSourceCommon , public CAudioMixerUser::IMixerU
{
public:
/// Constructor
- CBackgroundSource (CBackgroundSound *backgroundSound=NULL, bool spawn=false, TSpawnEndCallback cb=0, void *cbUserParam = 0, NL3D::CCluster *cluster = 0);
+ CBackgroundSource (CBackgroundSound *backgroundSound=NULL, bool spawn=false, TSpawnEndCallback cb=0, void *cbUserParam = 0, NL3D::CCluster *cluster = 0, CGroupController *groupController = NULL);
/// Destructor
~CBackgroundSource ();
diff --git a/code/nel/include/nel/sound/complex_source.h b/code/nel/include/nel/sound/complex_source.h
index d27b5af5b..d1135b1ad 100644
--- a/code/nel/include/nel/sound/complex_source.h
+++ b/code/nel/include/nel/sound/complex_source.h
@@ -34,7 +34,7 @@ class CComplexSource : public CSourceCommon, public CAudioMixerUser::IMixerEvent
{
public:
/// Constructor
- CComplexSource (CComplexSound *soundPattern=NULL, bool spawn=false, TSpawnEndCallback cb=0, void *cbUserParam = 0, NL3D::CCluster *cluster = 0);
+ CComplexSource (CComplexSound *soundPattern=NULL, bool spawn=false, TSpawnEndCallback cb=0, void *cbUserParam = 0, NL3D::CCluster *cluster = 0, CGroupController *groupController = NULL);
/// Destructor
~CComplexSource ();
diff --git a/code/nel/include/nel/sound/containers.h b/code/nel/include/nel/sound/containers.h
new file mode 100644
index 000000000..bd4fe7fb9
--- /dev/null
+++ b/code/nel/include/nel/sound/containers.h
@@ -0,0 +1,67 @@
+/**
+ * \file containers.h
+ * \brief CContainers
+ * \date 2012-04-10 13:57GMT
+ * \author Unknown (Unknown)
+ * CContainers
+ */
+
+/*
+ * Copyright (C) 2012 by authors
+ *
+ * This file is part of RYZOM CORE.
+ * RYZOM CORE is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * RYZOM CORE is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with RYZOM CORE. If not, see
+ * .
+ */
+
+#ifndef NLSOUND_CONTAINERS_H
+#define NLSOUND_CONTAINERS_H
+#include
+
+// STL includes
+
+// NeL includes
+
+// Project includes
+
+namespace NLSOUND {
+ class CSourceCommon;
+
+/// Hasher functor for hashed container with pointer key.
+template
+struct THashPtr : public std::unary_function
+{
+ static const size_t bucket_size = 4;
+ static const size_t min_buckets = 8;
+ size_t operator () (const Pointer &ptr) const
+ {
+ //CHashSet::hasher h;
+ // transtype the pointer into int then hash it
+ //return h.operator()(uint(uintptr_t(ptr)));
+ return (size_t)(uintptr_t)ptr;
+ }
+ inline bool operator() (const Pointer &ptr1, const Pointer &ptr2) const
+ {
+ // delegate the work to someone else as well?
+ return (uintptr_t)ptr1 < (uintptr_t)ptr2;
+ }
+};
+
+typedef CHashSet > TSourceContainer;
+
+} /* namespace NLSOUND */
+
+#endif /* #ifndef NLSOUND_CONTAINERS_H */
+
+/* end of file */
diff --git a/code/nel/include/nel/sound/driver/buffer.h b/code/nel/include/nel/sound/driver/buffer.h
index 5d488f1c7..27a8d9f00 100644
--- a/code/nel/include/nel/sound/driver/buffer.h
+++ b/code/nel/include/nel/sound/driver/buffer.h
@@ -48,6 +48,8 @@ public:
/// Intel/DVI ADPCM format, only available for 1 channel at 16 bits per sample, encoded at 4 bits per sample.
/// This is only implemented in the DSound and XAudio2 driver.
FormatDviAdpcm = 11,
+ /// No format set. Used when a TBufferFormat value has not been set to any value yet.
+ FormatNotSet = (~0),
};
/// The storage mode of this buffer. Also controls the X-RAM extension of OpenAL.
enum TStorageMode
diff --git a/code/nel/include/nel/sound/driver/music_buffer.h b/code/nel/include/nel/sound/driver/music_buffer.h
deleted file mode 100644
index 571e27a31..000000000
--- a/code/nel/include/nel/sound/driver/music_buffer.h
+++ /dev/null
@@ -1,119 +0,0 @@
-// NeL - MMORPG Framework
-// Copyright (C) 2010 Winch Gate Property Limited
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Affero General Public License as
-// published by the Free Software Foundation, either version 3 of the
-// License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Affero General Public License for more details.
-//
-// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see .
-
-#ifndef NLSOUND_MUSIC_BUFFER_H
-#define NLSOUND_MUSIC_BUFFER_H
-
-namespace NLMISC
-{
- class IStream;
- class CIFile;
-}
-
-namespace NLSOUND
-{
-
- /*
- * TODO: Streaming
- * Some kind of decent streaming functionality, to get rid of the current music implementation. Audio decoding should be done on nlsound level. IBuffer needs a writable implementation, it allocates and owns the data memory, which can be written to by nlsound. When buffer is written, a function needs to be called to 'finalize' the buffer (so it can be submitted to OpenAL for example).
- * Required interface functions, IBuffer:
- * /// Allocate a new writable buffer. If this buffer was already allocated, the previous data is released.
- * /// May return NULL if the format or frequency is not supported by the driver.
- * uint8 *IBuffer::openWritable(uint size, TBufferFormat bufferFormat, uint8 channels, uint8 bitsPerSample, uint32 frequency);
- * /// Tell that you are done writing to this buffer, so it can be copied over to hardware if needed.
- * /// If keepLocal is true, a local copy of the buffer will be kept (so allocation can be re-used later).
- * /// keepLocal overrides the OptionLocalBufferCopy flag. The buffer can use this function internally.
- * void IBuffer::lockWritable(bool keepLocal);
- * Required interface functions, ISource:
- * /// Enable or disable the streaming facilities.
- * void ISource::setStreaming(bool streaming);
- * /// Submits a new buffer to the stream. A buffer of 100ms length is optimal for streaming.
- * /// Should be called by a thread which checks countStreamingBuffers every 100ms
- * void ISource::submitStreamingBuffer(IBuffer *buffer);
- * /// Returns the number of buffers that are queued (includes playing buffer). 3 buffers is optimal.
- * uint ISource::countStreamingBuffers();
- * Other required interface functions, ISource:
- * /// Enable or disable 3d calculations (to send directly to speakers).
- * void ISource::set3DMode(bool enable);
- * For compatibility with music trough fmod, ISoundDriver:
- * /// Returns true if the sound driver has a native implementation of IMusicChannel (bad!).
- * /// If this returns false, use the nlsound music channel, which goes trough Ctrack/ISource,
- * /// The nlsound music channel requires support for IBuffer/ISource streaming.
- * bool ISoundDriver::hasMusicChannel();
- */
-
-/**
- * \brief IMusicBuffer
- * \date 2008-08-30 11:38GMT
- * \author Jan Boon (Kaetemi)
- * IMusicBuffer is only used by the driver implementation to stream
- * music files into a readable format (it's a simple decoder interface).
- * You should not call these functions (getSongTitle) on nlsound or user level,
- * as a driver might have additional music types implemented.
- * TODO: Change IMusicBuffer to IAudioDecoder, and change the interface to make more sense.
- * TODO: Allow user application to register more decoders.
- * TODO: Look into libavcodec for decoding audio.
- */
-class IMusicBuffer
-{
-private:
- // pointers
- /// Stream from file created by IMusicBuffer
- NLMISC::IStream *_InternalStream;
-
-public:
- IMusicBuffer();
- virtual ~IMusicBuffer();
-
- /// Create a new music buffer, may return NULL if unknown type, destroy with delete. Filepath lookup done here. If async is true, it will stream from hd, else it will load in memory first.
- static IMusicBuffer *createMusicBuffer(const std::string &filepath, bool async, bool loop);
-
- /// Create a new music buffer from a stream, type is file extension like "ogg" etc.
- static IMusicBuffer *createMusicBuffer(const std::string &type, NLMISC::IStream *stream, bool loop);
-
- /// Get information on a music file (only artist and title at the moment).
- static bool getInfo(const std::string &filepath, std::string &artist, std::string &title);
-
- /// Get how many bytes the music buffer requires for output minimum.
- virtual uint32 getRequiredBytes() =0;
-
- /// Get an amount of bytes between minimum and maximum (can be lower than minimum if at end).
- virtual uint32 getNextBytes(uint8 *buffer, uint32 minimum, uint32 maximum) =0;
-
- /// Get the amount of channels (2 is stereo) in output.
- virtual uint8 getChannels() =0;
-
- /// Get the samples per second (often 44100) in output.
- virtual uint32 getSamplesPerSec() =0;
-
- /// Get the bits per sample (often 16) in output.
- virtual uint8 getBitsPerSample() =0;
-
- /// Get if the music has ended playing (never true if loop).
- virtual bool isMusicEnded() =0;
-
- /// Get the total time in seconds.
- virtual float getLength() =0;
-
- /// Get the size of uncompressed data in bytes.
- virtual uint getUncompressedSize() =0;
-}; /* class IMusicBuffer */
-
-} /* namespace NLSOUND */
-
-#endif /* #ifndef NLSOUND_MUSIC_BUFFER_H */
-
-/* end of file */
diff --git a/code/nel/include/nel/sound/driver/music_channel.h b/code/nel/include/nel/sound/driver/music_channel.h
index 9878744c5..116865628 100644
--- a/code/nel/include/nel/sound/driver/music_channel.h
+++ b/code/nel/include/nel/sound/driver/music_channel.h
@@ -45,6 +45,9 @@ public:
/// Stop the music previously loaded and played (the Memory is also freed)
virtual void stop() =0;
+ /// Makes sure any resources are freed, but keeps available for next play call
+ virtual void reset() =0;
+
/// Pause the music previously loaded and played (the Memory is not freed)
virtual void pause() =0;
diff --git a/code/nel/include/nel/sound/driver/sound_driver.h b/code/nel/include/nel/sound/driver/sound_driver.h
index 193026a42..c9551f16b 100644
--- a/code/nel/include/nel/sound/driver/sound_driver.h
+++ b/code/nel/include/nel/sound/driver/sound_driver.h
@@ -39,9 +39,11 @@ namespace NLSOUND
#endif
/*
- * Sound sample format
+ * Deprecated sound sample format.
+ * For compatibility with old code.
+ * Do not modify.
*/
-enum TSampleFormat { SampleFormatUnknown, Mono8, Mono16ADPCM, Mono16, Stereo8, Stereo16 };
+enum TSampleFormat { Mono8, Mono16ADPCM, Mono16, Stereo8, Stereo16, SampleFormatUnknown = (~0) };
/**
* Abstract sound driver (implemented in sound driver dynamic library)
diff --git a/code/nel/include/nel/sound/driver/source.h b/code/nel/include/nel/sound/driver/source.h
index 1858e6f24..b43c83914 100644
--- a/code/nel/include/nel/sound/driver/source.h
+++ b/code/nel/include/nel/sound/driver/source.h
@@ -353,7 +353,7 @@ public:
* In streaming mode, the time spent during buffer outruns is not
* counted towards the playback time, and the playback time is
* be the current time position in the entire submitted queue.
- * When using static buffers, the result is the tot time that the
+ * When using static buffers, the result is the total time that the
* attached buffer has been playing. If the source is looping, the
* time will be the total of all playbacks of the buffer.
* When the source is stopped, this will return the time where the
@@ -397,7 +397,7 @@ public:
virtual void setSourceRelativeMode(bool mode = true) = 0;
/// Get the source relative mode
virtual bool getSourceRelativeMode() const = 0;
- /// Set the min and max distances (default: 1, MAX_FLOAT) (3D mode only)
+ /// Set the min and max distances (default: 1, sqrt(MAX_FLOAT)) (3D mode only)
virtual void setMinMaxDistances(float mindist, float maxdist, bool deferred = true) = 0;
/// Get the min and max distances
virtual void getMinMaxDistances(float& mindist, float& maxdist) const = 0;
diff --git a/code/nel/include/nel/sound/group_controller.h b/code/nel/include/nel/sound/group_controller.h
new file mode 100644
index 000000000..25b7034b6
--- /dev/null
+++ b/code/nel/include/nel/sound/group_controller.h
@@ -0,0 +1,102 @@
+/**
+ * \file group_controller.h
+ * \brief CGroupController
+ * \date 2012-04-10 09:29GMT
+ * \author Jan Boon (Kaetemi)
+ * CGroupController
+ */
+
+/*
+ * Copyright (C) 2012 by authors
+ *
+ * This file is part of RYZOM CORE.
+ * RYZOM CORE is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * RYZOM CORE is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with RYZOM CORE. If not, see
+ * .
+ */
+
+#ifndef NLSOUND_GROUP_CONTROLLER_H
+#define NLSOUND_GROUP_CONTROLLER_H
+#include
+
+// STL includes
+#include
+#include