cvs: gd /libgd/cmake/modules AC_HEADER_STDC.cmake CheckDIRSymbolExists.cmake CheckPrototypeExists.cmake FindFontconfig.cmake FindFreetype.cmake FindGD.cmake FindPNG.cmake FindPTHREAD.cmake FindXPM.cmake TestForHighBitCharacters.c TestForHighBitCharacters.cmake TestForStandardHeaderwait.cmake gd.cmake
[email protected] ("Pierre-Alain Joye")
| Newsgroups | php.gd.cvs |
|---|---|
| Message-ID | <cvspajoye1169677228@cvsserver> |
pajoye Wed Jan 24 22:20:28 2007 UTC
Added files:
/gd/libgd/cmake/modules AC_HEADER_STDC.cmake
CheckDIRSymbolExists.cmake
CheckPrototypeExists.cmake
FindFontconfig.cmake FindFreetype.cmake
FindGD.cmake FindPNG.cmake
FindPTHREAD.cmake FindXPM.cmake
TestForHighBitCharacters.c
TestForHighBitCharacters.cmake
TestForStandardHeaderwait.cmake gd.cmake
Log:
- add missing cmake macros/modules
pajoye-20070124222028.txt
(text/plain, 24.4 KB)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/AC_HEADER_STDC.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/AC_HEADER_STDC.cmake
+++ gd/libgd/cmake/modules/AC_HEADER_STDC.cmake
message(STATUS "Checking whether system has ANSI C header files")
include(CheckPrototypeExists)
include(CheckPrototypeExists)
check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" StandardHeadersExist)
if(StandardHeadersExist)
check_prototype_exists(memchr string.h memchrExists)
if(memchrExists)
check_prototype_exists(free stdlib.h freeExists)
if(freeExists)
message(STATUS "ANSI C header files - found")
set(STDC_HEADERS 1 CACHE INTERNAL "System has ANSI C header files")
set(HAVE_STRINGS_H 1)
set(HAVE_STRING_H 1)
set(HAVE_FLOAT_H 1)
set(HAVE_STDLIB_H 1)
set(HAVE_STDDEF_H 1)
set(HAVE_STDINT_H 1)
set(HAVE_INTTYPES_H 1)
set(HAVE_DLFCN_H 1)
endif(freeExists)
endif(memchrExists)
endif(StandardHeadersExist)
if(NOT STDC_HEADERS)
message(STATUS "ANSI C header files - not found")
set(STDC_HEADERS 0 CACHE INTERNAL "System has ANSI C header files")
endif(NOT STDC_HEADERS)
check_include_files(unistd.h HAVE_UNISTD_H)
include(CheckDIRSymbolExists)
check_dirsymbol_exists("sys/stat.h;sys/types.h;dirent.h" HAVE_DIRENT_H)
if (HAVE_DIRENT_H)
set(HAVE_SYS_STAT_H 1)
set(HAVE_SYS_TYPES_H 1)
endif (HAVE_DIRENT_H)
check_include_files("dlfcn.h;stdint.h;stddef.h;inttypes.h;stdlib.h;strings.h;string.h;float.h" StandardHeadersExist)
set(HAVE_LIBM 1)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/CheckDIRSymbolExists.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/CheckDIRSymbolExists.cmake
+++ gd/libgd/cmake/modules/CheckDIRSymbolExists.cmake
# - Check if the DIR symbol exists like in AC_HEADER_DIRENT.
# CHECK_DIRSYMBOL_EXISTS(FILES VARIABLE)
#
# FILES - include files to check
# VARIABLE - variable to return result
#
# This module is a small but important variation on CheckSymbolExists.cmake.
# The symbol always searched for is DIR, and the test programme follows
# the AC_HEADER_DIRENT test programme rather than the CheckSymbolExists.cmake
# test programme which always fails since DIR tends to be typedef'd
# rather than #define'd.
#
# 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
MACRO(CHECK_DIRSYMBOL_EXISTS FILES VARIABLE)
IF(NOT DEFINED ${VARIABLE})
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
SET(MACRO_CHECK_DIRSYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_DIRSYMBOL_EXISTS_LIBS
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_DIRSYMBOL_EXISTS_LIBS)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CMAKE_DIRSYMBOL_EXISTS_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CMAKE_DIRSYMBOL_EXISTS_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
FOREACH(FILE ${FILES})
SET(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
ENDFOREACH(FILE)
SET(CMAKE_CONFIGURABLE_FILE_CONTENT
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\nint main()\n{if ((DIR *) 0) return 0;}\n")
CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c" @ONLY)
MESSAGE(STATUS "Looking for DIR in ${FILES}")
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_DIRSYMBOL_EXISTS_FLAGS}
"${CHECK_DIRSYMBOL_EXISTS_LIBS}"
"${CMAKE_DIRSYMBOL_EXISTS_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
MESSAGE(STATUS "Looking for DIR in ${FILES} - found")
SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol DIR")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining if the DIR symbol is defined as in AC_HEADER_DIRENT "
"passed with the following output:\n"
"${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
ELSE(${VARIABLE})
MESSAGE(STATUS "Looking for DIR in ${FILES} - not found.")
SET(${VARIABLE} "" CACHE INTERNAL "Have symbol DIR")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining if the DIR symbol is defined as in AC_HEADER_DIRENT "
"failed with the following output:\n"
"${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckDIRSymbolExists.c:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
ENDIF(${VARIABLE})
ENDIF(NOT DEFINED ${VARIABLE})
ENDMACRO(CHECK_DIRSYMBOL_EXISTS)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/CheckPrototypeExists.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/CheckPrototypeExists.cmake
+++ gd/libgd/cmake/modules/CheckPrototypeExists.cmake
# AWI, downloaded from KDE repository since has not yet been transferred
# to cmake repository as of 2006-07-31.
# http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/CheckPrototypeExists.cmake?rev=505849&view=markup
#
# - Check if the prototype for a function exists.
# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE)
#
# FUNCTION - the name of the function you are looking for
# HEADER - the header(s) where the prototype should be declared
# VARIABLE - variable to store the result
#
INCLUDE(CheckCXXSourceCompiles)
MACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
SET(_INCLUDE_FILES)
FOREACH(it ${_HEADER})
SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
ENDFOREACH(it)
SET(_CHECK_PROTO_EXISTS_SOURCE_CODE "
${_INCLUDE_FILES}
void cmakeRequireSymbol(int dummy,...){(void)dummy;}
int main()
{
#ifndef ${_SYMBOL}
#ifndef _MSC_VER
cmakeRequireSymbol(0,&${_SYMBOL});
#else
char i = sizeof(&${_SYMBOL});
#endif
#endif
return 0;
}
")
CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
ENDMACRO(CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/FindFontconfig.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/FindFontconfig.cmake
+++ gd/libgd/cmake/modules/FindFontconfig.cmake
# - Try to find the Fontconfig
# Once done this will define
#
# FONTCONFIG_FOUND - system has Fontconfig
# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG
# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG
# FONTCONFIG_INCLUDE_DIR - FontConfig include dir
# Copyright (c) 2006, Laurent Montel, <[email protected]>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (FONTCONFIG_LIBRARIES AND FONTCONFIG_DEFINITIONS)
# in cache already
set(FONTCONFIG_FOUND TRUE)
else (FONTCONFIG_LIBRARIES AND FONTCONFIG_DEFINITIONS)
IF (NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
INCLUDE(UsePkgConfig)
PKGCONFIG(fontconfig _FONTCONFIGIncDir _FONTCONFIGLinkDir _FONTCONFIGLinkFlags _FONTCONFIGCflags)
set(FONTCONFIG_DEFINITIONS ${_FONTCONFIGCflags} CACHE INTERNAL "The compilation flags for fontconfig")
ENDIF (NOT WIN32)
find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
PATHS
${_FONTCONFIGIncDir}
/usr/include
/usr/local/include
/usr/X11/include
)
find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
PATHS
${_FONTCONFIGLinkDir}
/usr/lib
/usr/local/lib
)
if (FONTCONFIG_LIBRARIES)
set(FONTCONFIG_FOUND TRUE)
endif (FONTCONFIG_LIBRARIES)
if (FONTCONFIG_FOUND)
if (NOT FONTCONFIG_FIND_QUIETLY)
message(STATUS "Found FONTCONFIG: ${FONTCONFIG_LIBRARIES}")
endif (NOT FONTCONFIG_FIND_QUIETLY)
else (FONTCONFIG_FOUND)
if (FONTCONFIG_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find FONTCONFIG")
endif (FONTCONFIG_FIND_REQUIRED)
endif (FONTCONFIG_FOUND)
MARK_AS_ADVANCED(FONTCONFIG_LIBRARIES)
endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_DEFINITIONS)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/FindFreetype.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/FindFreetype.cmake
+++ gd/libgd/cmake/modules/FindFreetype.cmake
#
# Find the native FREETYPE includes and library
#
# This module defines
# FREETYPE_INCLUDE_DIR, where to find ft2build.h, ftheader.h, ...
# FREETYPE_LIBRARIES, the libraries to link against to use FREETYPE.
# FREETYPE_FOUND, If false, do not try to use FREETYPE.
# also defined, but not for general use are
# FREETYPE_LIBRARY, where to find the FREETYPE library.
FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h
/usr/include/
/usr/local/include/
)
FIND_PATH(FREETYPE_INCLUDE_DIR_FTHEADER freetype/config/ftheader.h
/usr/include/freetype2
/usr/local/include/freetype2
)
FIND_LIBRARY(FREETYPE_LIBRARY freetype
/usr/lib
/usr/local/lib
)
IF (FREETYPE_LIBRARY)
IF (FREETYPE_INCLUDE_DIR_FTHEADER AND FREETYPE_INCLUDE_DIR_FT2BUILD)
SET( FREETYPE_FOUND "YES" )
SET( FREETYPE_INCLUDE_DIR
${FREETYPE_INCLUDE_DIR_FT2BUILD}
${FREETYPE_INCLUDE_DIR_FTHEADER} )
SET( FREETYPE_LIBRARIES ${FREETYPE_LIBRARY} )
ENDIF (FREETYPE_INCLUDE_DIR_FTHEADER AND FREETYPE_INCLUDE_DIR_FT2BUILD)
ENDIF (FREETYPE_LIBRARY)
MARK_AS_ADVANCED(
FREETYPE_INCLUDE_DIR_FT2BUILD
FREETYPE_INCLUDE_DIR_FTHEADER
)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/FindGD.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/FindGD.cmake
+++ gd/libgd/cmake/modules/FindGD.cmake
# - Find GD
# Find the native GD includes and library
# This module defines
# GD_INCLUDE_DIR, where to find gd.h, etc.
# GD_LIBRARIES, the libraries needed to use GD.
# GD_FOUND, If false, do not try to use GD.
# also defined, but not for general use are
# GD_LIBRARY, where to find the GD library.
# GD_SUPPORTS_PNG, GD_SUPPORTS_JPEG, GD_SUPPORTS_GIF, test
# support for image formats in GD.
FIND_PATH(GD_INCLUDE_DIR gd.h
/usr/local/include
/usr/include
)
if(WIN32 AND NOT CYGWIN)
SET(GD_NAMES ${GD_NAMES} bgd)
else(WIN32)
SET(GD_NAMES ${GD_NAMES} gd)
endif(WIN32 AND NOT CYGWIN)
FIND_LIBRARY(GD_LIBRARY
NAMES ${GD_NAMES}
PATHS /usr/lib /usr/local/lib
)
IF (GD_LIBRARY AND GD_INCLUDE_DIR)
SET(GD_LIBRARIES ${GD_LIBRARY})
SET(GD_FOUND "YES")
ELSE (GD_LIBRARY AND GD_INCLUDE_DIR)
SET(GD_FOUND "NO")
ENDIF (GD_LIBRARY AND GD_INCLUDE_DIR)
message("Found GD: ${GD_FOUND}")
IF (GD_FOUND)
IF (WIN32 AND NOT CYGWIN)
SET(GD_SUPPORTS_PNG ON)
SET(GD_SUPPORTS_JPEG ON)
SET(GD_SUPPORTS_GIF ON)
get_filename_component(GD_LIBRARY_DIR ${GD_LIBRARY} PATH)
ELSE (WIN32 AND NOT CYGWIN)
INCLUDE(CheckLibraryExists)
GET_FILENAME_COMPONENT(GD_LIB_PATH ${GD_LIBRARY} PATH)
GET_FILENAME_COMPONENT(GD_LIB ${GD_LIBRARY} NAME)
CHECK_LIBRARY_EXISTS("${GD_LIBRARY}" "gdImagePng" "${GD_LIB_PATH}" GD_SUPPORTS_PNG)
IF (GD_SUPPORTS_PNG)
find_package(PNG)
IF (PNG_FOUND)
SET(GD_LIBRARIES ${GD_LIBRARIES} ${PNG_LIBRARIES})
SET(GD_INCLUDE_DIR ${GD_INCLUDE_DIR} ${PNG_INCLUDE_DIR})
ELSE (PNG_FOUND)
SET(GD_SUPPORTS_PNG "NO")
ENDIF (PNG_FOUND)
ENDIF (GD_SUPPORTS_PNG)
CHECK_LIBRARY_EXISTS("${GD_LIBRARY}" "gdImageJpeg" "${GD_LIB_PATH}" GD_SUPPORTS_JPEG)
IF (GD_SUPPORTS_JPEG)
find_package(JPEG)
IF (JPEG_FOUND)
SET(GD_LIBRARIES ${GD_LIBRARIES} ${JPEG_LIBRARIES})
SET(GD_INCLUDE_DIR ${GD_INCLUDE_DIR} ${JPEG_INCLUDE_DIR})
ELSE (JPEG_FOUND)
SET(GD_SUPPORTS_JPEG "NO")
ENDIF (JPEG_FOUND)
ENDIF (GD_SUPPORTS_JPEG)
CHECK_LIBRARY_EXISTS("${GD_LIBRARY}" "gdImageGif" "${GD_LIB_PATH}" GD_SUPPORTS_GIF)
# Trim the list of include directories
SET(GDINCTRIM)
FOREACH(GD_DIR ${GD_INCLUDE_DIR})
SET(GD_TMP_FOUND OFF)
FOREACH(GD_TRIMMED ${GDINCTRIM})
IF ("${GD_DIR}" STREQUAL "${GD_TRIMMED}")
SET(GD_TMP_FOUND ON)
ENDIF ("${GD_DIR}" STREQUAL "${GD_TRIMMED}")
ENDFOREACH(GD_TRIMMED ${GDINCTRIM})
IF (NOT GD_TMP_FOUND)
SET(GDINCTRIM "${GDINCTRIM}" "${GD_DIR}")
ENDIF (NOT GD_TMP_FOUND)
ENDFOREACH(GD_DIR ${GD_INCLUDE_DIR})
SET(GD_INCLUDE_DIR ${GDINCTRIM})
SET(GD_LIBRARY_DIR)
# Generate trimmed list of library directories and list of libraries
FOREACH(GD_LIB ${GD_LIBRARIES})
GET_FILENAME_COMPONENT(GD_NEXTLIBDIR ${GD_LIB} PATH)
SET(GD_TMP_FOUND OFF)
FOREACH(GD_LIBDIR ${GD_LIBRARY_DIR})
IF ("${GD_NEXTLIBDIR}" STREQUAL "${GD_LIBDIR}")
SET(GD_TMP_FOUND ON)
ENDIF ("${GD_NEXTLIBDIR}" STREQUAL "${GD_LIBDIR}")
ENDFOREACH(GD_LIBDIR ${GD_LIBRARIES})
IF (NOT GD_TMP_FOUND)
SET(GD_LIBRARY_DIR "${GD_LIBRARY_DIR}" "${GD_NEXTLIBDIR}")
ENDIF (NOT GD_TMP_FOUND)
ENDFOREACH(GD_LIB ${GD_LIBRARIES})
ENDIF (WIN32 AND NOT CYGWIN)
ENDIF (GD_FOUND)
IF (GD_FOUND)
IF (NOT GD_FIND_QUIETLY)
MESSAGE(STATUS "Found GD: ${GD_LIBRARY}")
ENDIF (NOT GD_FIND_QUIETLY)
ELSE (GD_FOUND)
IF (GD_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find GD library")
ENDIF (GD_FIND_REQUIRED)
ENDIF (GD_FOUND)
MARK_AS_ADVANCED(
GD_LIBRARY
GD_LIBRARIES
GD_INCLUDE_DIR
GD_LIBRARY_DIR
GD_SUPPORTS_PNG
GD_SUPPORTS_JPEG
GD_SUPPORTS_GIF
)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/FindPNG.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/FindPNG.cmake
+++ gd/libgd/cmake/modules/FindPNG.cmake
# - Find the native PNG includes and library
#
# This module defines
# PNG_INCLUDE_DIR, where to find png.h, etc.
# PNG_LIBRARIES, the libraries to link against to use PNG.
# PNG_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
# PNG_FOUND, If false, do not try to use PNG.
# also defined, but not for general use are
# PNG_LIBRARY, where to find the PNG library.
# None of the above will be defined unles zlib can be found.
# PNG depends on Zlib
#
# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
INCLUDE(FindZLIB)
SET(PNG_FOUND "NO")
IF(ZLIB_FOUND)
FIND_PATH(PNG_PNG_INCLUDE_DIR png.h
/usr/local/include
/usr/include
/usr/local/include/libpng # OpenBSD
)
SET(PNG_NAMES ${PNG_NAMES} png libpng)
FIND_LIBRARY(PNG_LIBRARY
NAMES ${PNG_NAMES}
PATHS /usr/lib /usr/local/lib
)
IF (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
# png.h includes zlib.h. Sigh.
SET(PNG_INCLUDE_DIR ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
SET(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
SET(PNG_FOUND "YES")
SET(HAVE_PNG_H)
IF (CYGWIN)
IF(BUILD_SHARED_LIBS)
# No need to define PNG_USE_DLL here, because it's default for Cygwin.
ELSE(BUILD_SHARED_LIBS)
SET (PNG_DEFINITIONS -DPNG_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF (CYGWIN)
ENDIF (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
ENDIF(ZLIB_FOUND)
IF (PNG_FOUND)
IF (NOT PNG_FIND_QUIETLY)
MESSAGE(STATUS "Found PNG: ${PNG_LIBRARY}")
ENDIF (NOT PNG_FIND_QUIETLY)
ELSE (PNG_FOUND)
IF (PNG_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find PNG library")
ENDIF (PNG_FIND_REQUIRED)
ENDIF (PNG_FOUND)
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/FindPTHREAD.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/FindPTHREAD.cmake
+++ gd/libgd/cmake/modules/FindPTHREAD.cmake
#############################################################################
#
# $Id: FindPTHREAD.cmake,v 1.1 2007/01/24 22:20:28 pajoye Exp $
#
# Copyright (C) 1998-2006 Inria. All rights reserved.
#
# This software was developed at:
# IRISA/INRIA Rennes
# Projet Lagadic
# Campus Universitaire de Beaulieu
# 35042 Rennes Cedex
# http://www.irisa.fr/lagadic
#
# This file is part of the ViSP toolkit.
#
# This file may be distributed under the terms of the Q Public License
# as defined by Trolltech AS of Norway and appearing in the file
# LICENSE included in the packaging of this file.
#
# Licensees holding valid ViSP Professional Edition licenses may
# use this file in accordance with the ViSP Commercial License
# Agreement provided with the Software.
#
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# Contact [email protected] if any conditions of this licensing are
# not clear to you.
#
# Description:
# Try to find pthread library.
# Once run this will define:
#
# PTHREAD_FOUND
# PTHREAD_INCLUDE_DIR
# PTHREAD_LIBRARIES
#
# Authors:
# Fabien Spindler
#
#############################################################################
#IF(NOT UNIX AND NOT WIN32)
# SET(PTHREAD_FOUND FALSE)
#ELSE(NOT UNIX AND NOT WIN32)
FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h
/usr/include
$ENV{PTHREAD_INCLUDE_PATH}
)
#MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}")
# pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web
FIND_LIBRARY(PTHREAD_LIBRARY
NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2
PATHS
/usr/lib
/usr/local/lib
/lib
$ENV{PTHREAD_LIBRARY_PATH}
)
#MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}")
## --------------------------------
IF(PTHREAD_LIBRARY)
SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
ELSE(PTHREAD_LIBRARY)
#MESSAGE(SEND_ERROR "pthread library not found.")
ENDIF(PTHREAD_LIBRARY)
IF(NOT PTHREAD_INCLUDE_DIR)
#MESSAGE(SEND_ERROR "pthread include dir not found.")
ENDIF(NOT PTHREAD_INCLUDE_DIR)
IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
SET(PTHREAD_FOUND TRUE)
ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
SET(PTHREAD_FOUND FALSE)
ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR)
#MARK_AS_ADVANCED(
# PTHREAD_INCLUDE_DIR
# PTHREAD_LIBRARIES
# )
#MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}")
#ENDIF(NOT UNIX AND NOT WIN32)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/FindXPM.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/FindXPM.cmake
+++ gd/libgd/cmake/modules/FindXPM.cmake
# - Find the native PNG includes and library
#
# This module defines
# XPM_INCLUDE_DIR, where to find png.h, etc.
# XPM_LIBRARIES, the libraries to link against to use PNG.
# XPM_DEFINITIONS - You should ADD_DEFINITONS(${PNG_DEFINITIONS}) before compiling code that includes png library files.
# XPM_FOUND, If false, do not try to use PNG.
# also defined, but not for general use are
# XPM_LIBRARY, where to find the PNG library.
# None of the above will be defined unles zlib can be found.
# PNG depends on Zlib
#
# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
INCLUDE(FindZLIB)
SET(XPM_FOUND "NO")
FIND_PATH(XPM_XPM_INCLUDE_DIR xpm.h
/usr/local/include/X11
/usr/include/X11
)
SET(XPM_NAMES ${XPM_NAMES} Xpm libXpm)
FIND_LIBRARY(XPM_LIBRARY
NAMES ${XPM_NAMES}
PATHS /usr/lib /usr/local/lib
)
IF (XPM_LIBRARY AND XPM_XPM_INCLUDE_DIR)
SET(XPM_INCLUDE_DIR ${XPM_XPM_INCLUDE_DIR})
SET(XPM_LIBRARIES ${XPM_LIBRARY})
SET(XPM_FOUND "YES")
IF (CYGWIN)
IF(BUILD_SHARED_LIBS)
# No need to define XPM_USE_DLL here, because it's default for Cygwin.
ELSE(BUILD_SHARED_LIBS)
SET (XPM_DEFINITIONS -DXPM_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF (CYGWIN)
ENDIF (XPM_LIBRARY AND XPM_XPM_INCLUDE_DIR)
IF (XPM_FOUND)
IF (NOT XPM_FIND_QUIETLY)
MESSAGE(STATUS "Found XPM: ${XPM_LIBRARY}")
ENDIF (NOT XPM_FIND_QUIETLY)
ELSE (XPM_FOUND)
IF (XPM_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find XPM library")
ENDIF (XPM_FIND_REQUIRED)
ENDIF (XPM_FOUND)
MARK_AS_ADVANCED(XPM_XPM_INCLUDE_DIR XPM_LIBRARY )
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/TestForHighBitCharacters.c?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/TestForHighBitCharacters.c
+++ gd/libgd/cmake/modules/TestForHighBitCharacters.c
#include <ctype.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
(('a' <= (c) && (c) <= 'i') \
|| ('j' <= (c) && (c) <= 'r') \
|| ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i))
exit(1);
exit (0);
}
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/TestForHighBitCharacters.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/TestForHighBitCharacters.cmake
+++ gd/libgd/cmake/modules/TestForHighBitCharacters.cmake
# cmake/modules/TestForHighBitCharacters.cmake
#
# Copyright (C) 2006 Alan W. Irwin
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; version 2 of the License.
#
# PLplot 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 Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with the file PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# Check if ctype.h macros work on characters with the high bit set.
if(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS)
message(STATUS
"Check for whether ctype.h macros work on characters with the\n"
" high bit set."
)
try_compile(CMAKE_HIGH_BIT_CHARACTERS
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/CMakeModules/TestForHighBitCharacters.c
OUTPUT_VARIABLE OUTPUT)
if(CMAKE_HIGH_BIT_CHARACTERS)
message(STATUS "High-bit characters - work")
set(HIGH_BIT_CHARACTERS 1 CACHE INTERNAL
"Do ctype.h macros work on high-bit characters")
file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining if ctype.h macros work on high-bit characters passed with "
"the following output:\n${OUTPUT}\n\n")
else(CMAKE_HIGH_BIT_CHARACTERS)
message(STATUS "High-bit characters - don't work")
set(HIGH_BIT_CHARACTERS 0 CACHE INTERNAL
"Do ctype.h macros work on high-bit characters")
file(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining if ctype.h macros work on high-bit characters failed with "
"the following output:\n${OUTPUT}\n\n")
endif(CMAKE_HIGH_BIT_CHARACTERS)
endif(NOT DEFINED CMAKE_HIGH_BIT_CHARACTERS)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/TestForStandardHeaderwait.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/TestForStandardHeaderwait.cmake
+++ gd/libgd/cmake/modules/TestForStandardHeaderwait.cmake
# cmake/modules/CheckHEADER_SYS_WAIT.cmake
#
# Copyright (C) 2006 Alan W. Irwin
#
# This file is part of PLplot.
#
# PLplot is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; version 2 of the License.
#
# PLplot 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 Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with the file PLplot; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# - Check for sys/wait.h that is POSIX.1 compatible following autotools
# AC_HEADER_SYS_WAIT
include(CheckCSourceCompiles)
set(_CHECK_HEADER_SYS_WAIT_SOURCE_CODE "
#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
#endif
int
main ()
{
int s;
wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
;
return 0;
}
")
check_c_source_compiles(
"${_CHECK_HEADER_SYS_WAIT_SOURCE_CODE}"
HAVE_SYS_WAIT_H)
http://cvs.php.net/viewvc.cgi/gd/libgd/cmake/modules/gd.cmake?view=markup&rev=1.1
Index: gd/libgd/cmake/modules/gd.cmake
+++ gd/libgd/cmake/modules/gd.cmake
option(BUILD_TEST "Compile examples in the build tree and enable ctest" OFF)