diff options
-rw-r--r-- | 3rdparty/cmake/FindFunctionLibrary.cmake | 47 | ||||
-rw-r--r-- | 3rdparty/cmake/FindMYSQL.cmake | 37 | ||||
-rw-r--r-- | 3rdparty/cmake/FindPCRE.cmake | 36 | ||||
-rw-r--r-- | 3rdparty/cmake/tests/HAVE_MONOTONIC_CLOCK.c | 8 | ||||
-rwxr-xr-x | tools/item_db.pl | 116 |
5 files changed, 0 insertions, 244 deletions
diff --git a/3rdparty/cmake/FindFunctionLibrary.cmake b/3rdparty/cmake/FindFunctionLibrary.cmake deleted file mode 100644 index f1d32001e..000000000 --- a/3rdparty/cmake/FindFunctionLibrary.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# - Check which library is needed to link a C function -# find_function_library( <function> <variable> [<library> ...] ) -# -# Check which library provides the <function>. -# Sets <variable> to 0 if found in the global libraries. -# Sets <variable> to the library path if found in the provided libraries. -# Raises a FATAL_ERROR if not found. -# -# The following variables may be set before calling this macro to -# modify the way the check is run: -# -# CMAKE_REQUIRED_FLAGS = string of compile command line flags -# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) -# CMAKE_REQUIRED_INCLUDES = list of include directories -# CMAKE_REQUIRED_LIBRARIES = list of libraries to link -include( CheckFunctionExists ) - -macro( find_function_library FUNC VAR ) - if( "${VAR}" MATCHES "^${VAR}$" ) - CHECK_FUNCTION_EXISTS( ${FUNC} ${VAR} ) - if( ${VAR} ) - message( STATUS "Found ${FUNC} in global libraries" ) - set( ${VAR} 0 CACHE INTERNAL "Found ${FUNC} in global libraries" )# global - else() - foreach( LIB IN ITEMS ${ARGN} ) - message( STATUS "Looking for ${FUNC} in ${LIB}" ) - find_library( ${LIB}_LIBRARY ${LIB} ) - mark_as_advanced( ${LIB}_LIBRARY ) - if( ${LIB}_LIBRARY ) - unset( ${VAR} CACHE ) - set( CMAKE_REQUIRED_LIBRARIES ${${LIB}_LIBRARY} ) - CHECK_FUNCTION_EXISTS( ${FUNC} ${VAR} ) - set( CMAKE_REQUIRED_LIBRARIES ) - if( ${VAR} ) - message( STATUS "Found ${FUNC} in ${LIB}: ${${LIB}_LIBRARY}" ) - set( ${VAR} ${${LIB}_LIBRARY} CACHE INTERNAL "Found ${FUNC} in ${LIB}" )# lib - break() - endif() - endif() - endforeach() - if( NOT ${VAR} ) - message( FATAL_ERROR "Function ${FUNC} not found" ) - endif() - endif() - endif() -endmacro( find_function_library ) - diff --git a/3rdparty/cmake/FindMYSQL.cmake b/3rdparty/cmake/FindMYSQL.cmake deleted file mode 100644 index 9da72073a..000000000 --- a/3rdparty/cmake/FindMYSQL.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# - Find libmysql/mysqlclient -# Find the native MySQL includes and library -# -# MYSQL_INCLUDE_DIRS - where to find mysql.h, etc. -# MYSQL_LIBRARIES - mysqlclient library. -# MYSQL_FOUND - True if mysqlclient is found. -# - -find_path( MYSQL_INCLUDE_DIRS "mysql.h" - PATHS - "/usr/include/mysql" - "/usr/local/include/mysql" - "/usr/mysql/include/mysql" - "$ENV{PROGRAMFILES}/MySQL/*/include" - "$ENV{SYSTEMDRIVE}/MySQL/*/include" ) - -find_library( MYSQL_LIBRARIES - NAMES "libmysql" "mysqlclient" "mysqlclient_r" - PATHS - "/usr/lib/mysql" - "/usr/local/lib/mysql" - "/usr/mysql/lib/mysql" - "$ENV{PROGRAMFILES}/MySQL/*/lib" - "$ENV{SYSTEMDRIVE}/MySQL/*/lib" ) -mark_as_advanced( MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS ) - -if( MYSQL_INCLUDE_DIRS AND EXISTS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" ) - file( STRINGS "${MYSQL_INCLUDE_DIRS}/mysql_version.h" MYSQL_VERSION_H REGEX "^#define[ \t]+MYSQL_SERVER_VERSION[ \t]+\"[^\"]+\".*$" ) - string( REGEX REPLACE "^.*MYSQL_SERVER_VERSION[ \t]+\"([^\"]+)\".*$" "\\1" MYSQL_VERSION_STRING "${MYSQL_VERSION_H}" ) -endif() - -# handle the QUIETLY and REQUIRED arguments and set MYSQL_FOUND to TRUE if -# all listed variables are TRUE -include( FindPackageHandleStandardArgs ) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( MYSQL - REQUIRED_VARS MYSQL_LIBRARIES MYSQL_INCLUDE_DIRS - VERSION_VAR MYSQL_VERSION_STRING ) diff --git a/3rdparty/cmake/FindPCRE.cmake b/3rdparty/cmake/FindPCRE.cmake deleted file mode 100644 index 2215451d1..000000000 --- a/3rdparty/cmake/FindPCRE.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# - Find pcre -# Find the native PCRE includes and library -# -# PCRE_INCLUDE_DIRS - where to find pcre.h -# PCRE_LIBRARIES - List of libraries when using pcre. -# PCRE_FOUND - True if pcre found. - - -find_path( PCRE_INCLUDE_DIR pcre.h - PATHS - "/usr/include/pcre" ) -set( PCRE_NAMES pcre ) -find_library( PCRE_LIBRARY NAMES ${PCRE_NAMES} ) -mark_as_advanced( PCRE_LIBRARY PCRE_INCLUDE_DIR ) - -if( PCRE_INCLUDE_DIR AND EXISTS "${PCRE_INCLUDE_DIR}/pcre.h" ) - file( STRINGS "${PCRE_INCLUDE_DIR}/pcre.h" PCRE_H REGEX "^#define[ \t]+PCRE_M[A-Z]+[ \t]+[0-9]+.*$" ) - string( REGEX REPLACE "^.*PCRE_MAJOR[ \t]+([0-9]+).*$" "\\1" PCRE_MAJOR "${PCRE_H}" ) - string( REGEX REPLACE "^.*PCRE_MINOR[ \t]+([0-9]+).*$" "\\1" PCRE_MINOR "${PCRE_H}" ) - - set( PCRE_VERSION_STRING "${PCRE_MAJOR}.${PCRE_MINOR}" ) - set( PCRE_VERSION_MAJOR "${PCRE_MAJOR}" ) - set( PCRE_VERSION_MINOR "${PCRE_MINOR}" ) -endif() - -# handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if -# all listed variables are TRUE -include( FindPackageHandleStandardArgs ) -FIND_PACKAGE_HANDLE_STANDARD_ARGS( PCRE - REQUIRED_VARS PCRE_LIBRARY PCRE_INCLUDE_DIR - VERSION_VAR PCRE_VERSION_STRING ) - -if( PCRE_FOUND ) - set( PCRE_LIBRARIES ${PCRE_LIBRARY} ) - set( PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR} ) -endif() diff --git a/3rdparty/cmake/tests/HAVE_MONOTONIC_CLOCK.c b/3rdparty/cmake/tests/HAVE_MONOTONIC_CLOCK.c deleted file mode 100644 index ad460a1af..000000000 --- a/3rdparty/cmake/tests/HAVE_MONOTONIC_CLOCK.c +++ /dev/null @@ -1,8 +0,0 @@ -#include <sys/time.h> -#include <time.h> -#include <unistd.h> -int main(int argc, char** argv) -{ - struct timespec tval; - return clock_gettime(CLOCK_MONOTONIC, &tval); -} diff --git a/tools/item_db.pl b/tools/item_db.pl deleted file mode 100755 index a2b443de9..000000000 --- a/tools/item_db.pl +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/perl -$db = "item_db"; -$nb_columns = 22; -@str_col = (1,2,7,19,20,21); -$line_format = "([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),([^\,]*),(\{.*\}),(\{.*\}),(\{.*\})"; -#$line_format = ; -$create_table = "# -# Table structure for table `item_db` -# - -DROP TABLE IF EXISTS `item_db`; -CREATE TABLE `item_db` ( - `id` smallint(5) unsigned NOT NULL default '0', - `name_english` varchar(50) NOT NULL default '', - `name_japanese` varchar(50) NOT NULL default '', - `type` tinyint(2) unsigned NOT NULL default '0', - `price_buy` mediumint(10) unsigned default NULL, - `price_sell` mediumint(10) unsigned default NULL, - `weight` smallint(5) unsigned NOT NULL default '0', - `attack` smallint(3) unsigned default NULL, - `defence` tinyint(3) unsigned default NULL, - `range` tinyint(2) unsigned default NULL, - `slots` tinyint(2) unsigned default NULL, - `equip_jobs` int(12) unsigned default NULL, - `equip_upper` tinyint(8) unsigned default NULL, - `equip_genders` tinyint(2) unsigned default NULL, - `equip_locations` smallint(4) unsigned default NULL, - `weapon_level` tinyint(2) unsigned default NULL, - `equip_level` tinyint(3) unsigned default NULL, - `refineable` tinyint(1) unsigned default NULL, - `view` smallint(3) unsigned default NULL, - `script` text, - `equip_script` text, - `unequip_script` text, - PRIMARY KEY (`id`) -) ENGINE=MyISAM; -"; -printf("%s\n",$create_table); -while ($ligne=<STDIN>) -{ - if ($ligne =~ /[^\r\n]+/) - { - $ligne = $&; - if ($ligne =~ /^\/\//) - { - printf("# "); - $ligne = substr($ligne, 2); - } - if ($ligne =~ $line_format) { - @champ = ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22); - } else { - @champ = (); - } - if ($#champ != $nb_columns - 1) - { - # Can't parse, it's a real comment - printf ("%s\n", $ligne); - } else { - printf("REPLACE INTO `%s` VALUES (", $db); - for ($i=0; $i<$#champ; $i++) - { - printField($champ[$i],",",$i); - } - printField($champ[$#champ],");\n",$#champ); - } - } -} -print("\n"); - - -sub printField { - my ($str, $suffix, $idCol) = @_; - # Remove first { and last } - if ($str =~ /{.*}/) - { - $str = substr($&,1,-1); - } - # If nothing, put NULL - if ($str eq "") { - printf("NULL%s", $suffix); - } else { - my $flag = 0; - # Search if it's a string column ? - foreach $col (@str_col) - { - if ($col == $idCol) - { - $flag = 1; - break; - } - } - if ($flag == 1) - { - # String column, so escape and add '' - printf("'%s'%s", escape($str), $suffix); - } else { - # Not a string column - printf("%s%s", $str,$suffix); - } - } -} - -sub escape { - my ($str) = @_; - my @str_splitted = split("'", $str); - my $result = ""; - for (my $i=0; $i<=$#str_splitted; $i++) - { - if ($i == 0) { - $result = @str_splitted[0]; - } else { - $result = $result."\\'".@str_splitted[$i]; - } - } - return $result -} |