Changed: #1109 archlinux libwww linker error

This commit is contained in:
kervala 2010-10-03 11:39:04 +02:00
parent 04ba071785
commit f2ebf0b626

View file

@ -9,10 +9,10 @@
SET(LIBWWW_FIND_QUIETLY ${Libwww_FIND_QUIETLY}) SET(LIBWWW_FIND_QUIETLY ${Libwww_FIND_QUIETLY})
# also defined, but not for general use are # also defined, but not for general use are
IF(LIBWWW_LIBRARY AND LIBWWW_INCLUDE_DIR) IF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
# in cache already # in cache already
SET(LIBWWW_FIND_QUIETLY TRUE) SET(LIBWWW_FIND_QUIETLY TRUE)
ENDIF(LIBWWW_LIBRARY AND LIBWWW_INCLUDE_DIR) ENDIF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
FIND_PATH(LIBWWW_INCLUDE_DIR FIND_PATH(LIBWWW_INCLUDE_DIR
WWWInit.h WWWInit.h
@ -45,7 +45,7 @@ IF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
ENDIF(LIBWWW_ADDITIONAL_INCLUDE_DIR) ENDIF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
# helper to find all the libwww sub libraries # helper to find all the libwww sub libraries
MACRO(FIND_WWW_LIBRARY MYLIBRARY) MACRO(FIND_WWW_LIBRARY MYLIBRARY OPTION)
FIND_LIBRARY(${MYLIBRARY} FIND_LIBRARY(${MYLIBRARY}
NAMES ${ARGN} NAMES ${ARGN}
PATHS PATHS
@ -59,77 +59,89 @@ MACRO(FIND_WWW_LIBRARY MYLIBRARY)
/opt/lib /opt/lib
/usr/freeware/lib64 /usr/freeware/lib64
) )
IF(${MYLIBRARY}) IF(${MYLIBRARY})
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}}) IF(${OPTION} STREQUAL REQUIRED)
ELSE(${MYLIBRARY}) SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}})
ENDIF(${OPTION} STREQUAL REQUIRED)
ELSE(${MYIBRARY})
IF(NOT LIBWWW_FIND_QUIETLY) IF(NOT LIBWWW_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Libwww: Library not found: ${MYLIBRARY}") MESSAGE(STATUS "Warning: Libwww: Library not found: ${MYLIBRARY}")
ENDIF(NOT LIBWWW_FIND_QUIETLY) ENDIF(NOT LIBWWW_FIND_QUIETLY)
ENDIF(${MYLIBRARY}) ENDIF(${MYLIBRARY})
MARK_AS_ADVANCED(${MYLIBRARY}) MARK_AS_ADVANCED(${MYLIBRARY})
ENDMACRO(FIND_WWW_LIBRARY MYLIBRARY) ENDMACRO(FIND_WWW_LIBRARY)
# on eg. mac os x and arch linux, libwww sub libraries are not "inter-linked" MACRO(LINK_WWW_LIBRARY MYLIBRARY OTHERLIBRARY SYMBOL)
# we need to link them all manually LINK_DEPENDS(LIBWWW_LIBRARIES ${MYLIBRARY} ${OTHERLIBRARY} ${SYMBOL})
ENDMACRO(LINK_WWW_LIBRARY)
FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY wwwapp) # Find and link required libs for static or dynamic
FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY wwwcore) FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY REQUIRED wwwapp) # cache core file ftp gopher html http mime news stream telnet trans utils zip xml xmlparse
FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY wwwdir) FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY REQUIRED wwwcore) # utils
FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY wwwfile) FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY REQUIRED wwwfile) # core trans utils html
FIND_WWW_LIBRARY(LIBWWWFTP_LIBRARY wwwftp) FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY REQUIRED wwwhtml) # core utils
FIND_WWW_LIBRARY(LIBWWWGOPHER_LIBRARY wwwgopher) FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY REQUIRED wwwhttp) # md5 core mime stream utils
FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY wwwhtml) FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY REQUIRED wwwmime) # core cache stream utils
FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY wwwhttp) FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY REQUIRED wwwtrans) # core utils
FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY wwwinit) FIND_WWW_LIBRARY(LIBWWWUTILS_LIBRARY REQUIRED wwwutils)
FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY wwwmime)
FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY wwwcache)
FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY wwwmux)
FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY wwwnews)
FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY wwwstream)
FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY wwwtelnet)
FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY wwwtrans)
FIND_WWW_LIBRARY(LIBWWWUTILS_LIBRARY wwwutils)
FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY wwwxml)
FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY wwwzip)
FIND_WWW_LIBRARY(LIBMD5_LIBRARY md5)
# Windows libwww version needs GNU Regex # Required for static or if underlinking
IF(WIN32 AND WITH_STATIC) FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY OPTIONAL wwwcache) # core trans utils
FIND_PATH(LIBWWW_REGEX_INCLUDE_DIR FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY OPTIONAL wwwstream) # core file utils
regex.h
PATHS
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include
)
# combine both include directories into one variable # Required only if underlinking
IF(LIBWWW_REGEX_INCLUDE_DIR)
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_REGEX_INCLUDE_DIR})
FIND_WWW_LIBRARY(LIBREGEX_LIBRARY gnu_regex)
ENDIF(LIBWWW_REGEX_INCLUDE_DIR)
ENDIF(WIN32 AND WITH_STATIC)
IF(WITH_STATIC) # Unused protocols
# If compiled with expat support FIND_WWW_LIBRARY(LIBWWWFTP_LIBRARY OPTIONAL wwwftp) # core file utils
FIND_PACKAGE(EXPAT QUIET) FIND_WWW_LIBRARY(LIBWWWGOPHER_LIBRARY OPTIONAL wwwgopher) # core html utils file
IF(EXPAT_FOUND) FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY OPTIONAL wwwnews) # core html mime stream utils
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${EXPAT_INCLUDE_DIRS}) FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY OPTIONAL wwwtelnet) # core utils
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${EXPAT_LIBRARIES})
ENDIF(EXPAT_FOUND)
# If compiled with OpenSSL support # Other used by app
FIND_PACKAGE(OpenSSL QUIET) FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY OPTIONAL wwwdir) # file
IF(OPENSSL_FOUND) FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY OPTIONAL wwwinit) # app cache core file html utils
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}) FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY OPTIONAL wwwmux) # core stream trans utils
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${OPENSSL_LIBRARIES}) FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY OPTIONAL wwwxml) # core utils xmlparse
ENDIF(OPENSSL_FOUND) FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY OPTIONAL wwwzip) # core utils
ENDIF(WITH_STATIC) FIND_WWW_LIBRARY(LIBXMLPARSE_LIBRARY OPTIONAL xmlparse) # xmltok
# Other used by other
FIND_WWW_LIBRARY(LIBXMLTOK_LIBRARY OPTIONAL xmltok)
FIND_WWW_LIBRARY(LIBWWWSSL_LIBRARY OPTIONAL wwwssl)
FIND_WWW_LIBRARY(LIBMD5_LIBRARY OPTIONAL md5)
FIND_WWW_LIBRARY(LIBPICS_LIBRARY OPTIONAL pics)
# Other external libraries
FIND_PACKAGE(EXPAT QUIET)
FIND_PACKAGE(OpenSSL QUIET)
FIND_WWW_LIBRARY(LIBREGEX_LIBRARY OPTIONAL gnu_regex)
# Now link all libs together
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTLoadCache)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTLoadStream)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWFTP_LIBRARY HTLoadFTP)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWGOPHER_LIBRARY HTLoadGopher)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWNEWS_LIBRARY HTLoadNews)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWTELNET_LIBRARY HTLoadTelnet)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWDIR_LIBRARY HTDir_new)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWINIT_LIBRARY HTProtocolInit) # HTProfile_delete
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWXML_LIBRARY HTXML_new)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWZIP_LIBRARY HTZLib_inflate)
# libwwwxml can be linked to xmlparse or expat
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY LIBXMLPARSE_LIBRARY XML_ParserCreate)
IF(NOT LIBXMLPARSE_LIBRARY_LINKED)
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY EXPAT_LIBRARY XML_ParserCreate)
ENDIF(NOT LIBXMLPARSE_LIBRARY_LINKED)
LINK_WWW_LIBRARY(LIBWWWHTTP_LIBRARY LIBMD5_LIBRARY MD5Init)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBREGEX_LIBRARY regexec)
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY OPENSSL_LIBRARIES SSL_new)
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibWWW DEFAULT_MSG FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibWWW DEFAULT_MSG