Menu

Patch to compile makedict on Cygwin

2010-11-29
2021-05-15
  • Aliaksandr Autayeu

    Here is a patch to compile makedict on Cygwin:

    %<====================patch.txt=================================
    diff -git a/trunk/CMakeLists.txt b/trunk/CMakeLists.txt
    index d417cd9..2670bbf 100644
    -- a/trunk/CMakeLists.txt
    +++ b/trunk/CMakeLists.txt
    @@ -19,6 +19,13 @@ IF(CMAKE_COMPILER_2005)
       ADD_DEFINITIONS(-D_SCL_SECURE_NO_DEPRECATE)
    ENDIF(CMAKE_COMPILER_2005)

    +SET(ZLIB_FIND_REQUIRED True)
    +INCLUDE(FindZLIB)
    +
    +SET(GETTEXT_FIND_REQUIRED True)
    +INCLUDE(FindGettext)
    +
    +
    SET(GLIB2_REQ "'glib-2.0 >= 2.6.0'")
    #INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindPackageHandleStandardArgs.cmake")
    # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
    @@ -30,11 +37,21 @@ IF (NOT GLIB2_FOUND)
    "make sure that you install it")
    ENDIF(NOT GLIB2_FOUND)

    -SET(ZLIB_FIND_REQUIRED True)
    -INCLUDE(FindZLIB)
    +INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindIconv.cmake")
    +IF (NOT ICONV_FOUND)
    + MESSAGE(FATAL_ERROR "makedict require Iconv, "
    + "make sure that you install it")
    +ENDIF(NOT ICONV_FOUND)
    +
    +INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindLibintl.cmake")
    +IF (NOT LIBINTL_FOUND)
    + MESSAGE(FATAL_ERROR "makedict require Libintl, "
    + "make sure that you install it")
    +ENDIF(NOT LIBINTL_FOUND)
    +

    SET(EXPAT_FIND_REQUIRED True)
    -SET(EXPAT_FIND_QUIETLY True)
    +#SET(EXPAT_FIND_QUIETLY True)
    INCLUDE(FindEXPAT)

    INCLUDE(CheckFunctionExists)
    @@ -44,10 +61,13 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
    ${CMAKE_CURRENT_BINARY_DIR}/config.h)

    INCLUDE_DIRECTORIES(
    + ${ZLIB_INCLUDE_DIR}
    +        ${ICONV_INCLUDE_DIR}
    +        ${GETTEXT_INCLUDE_DIR}
    +        ${LIBINTL_INCLUDE_DIR}
    ${GLIB2_INCLUDE_DIR}
    ${GLIBCONFIG_INCLUDE_DIR}
    ${EXPAT_INCLUDE_DIRS}
    - ${ZLIB_INCLUDE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
    )

    @@ -115,8 +135,7 @@ ADD_EXECUTABLE(makedict
    ${makedict_HDRS}
    )
    TARGET_LINK_LIBRARIES(makedict
    - ${GLIB2_LIBRARIES} ${EXPAT_LIBRARIES}
    - ${ZLIB_LIBRARIES})
    + ${ZLIB_LIBRARIES} ${GETTEXT_LIBRARIES} ${LIBINTL_LIBRARIES} ${ICONV_LIBRARIES} ${GLIB2_LIBRARIES} ${EXPAT_LIBRARIES} )

    INSTALL(TARGETS makedict RUNTIME DESTINATION bin)
    INSTALL(FILES docs/makedict.1 DESTINATION share/man/man1)
    @@ -135,7 +154,7 @@ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Converter from any dictionary format to a
    SET(CPACK_PACKAGE_VENDOR "Evgeniy Dushistov <dushistov@mail.ru>")
    SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
    SET(CPACK_PACKAGE_VERSION_MAJOR "0")
    -SET(CPACK_PACKAGE_VERSION_MINOR "3")
    +SET(CPACK_PACKAGE_VERSION_MINOR "4")
    SET(CPACK_PACKAGE_VERSION_PATCH "1-beta1")
    #SET(CPACK_PACKAGE_EXECUTABLES "lua" "lua")

    diff -git a/trunk/cmake/FindIconv.cmake b/trunk/cmake/FindIconv.cmake
    new file mode 100755
    index 0000000..092b357
    -- /dev/null
    +++ b/trunk/cmake/FindIconv.cmake
    @@ -0,0 +1,64 @@
    +# - Try to find Iconv
    +# Once done this will define
    +#
    +#  ICONV_FOUND - system has Iconv
    +#  ICONV_INCLUDE_DIR - the Iconv include directory
    +#  ICONV_LIBRARIES - Link these to use Iconv
    +#  ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
    +#
    +include(CheckCCompilerFlag)
    +include(CheckCSourceCompiles)
    +
    +IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
    +  # Already in cache, be silent
    +  SET(ICONV_FIND_QUIETLY TRUE)
    +ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
    +
    +FIND_PATH(ICONV_INCLUDE_DIR iconv.h HINTS /sw/include/ PATHS /opt/local)
    +
    +FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c PATHS /opt/local)
    +
    +IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
    +   SET(ICONV_FOUND TRUE)
    +ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
    +
    +set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
    +set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
    +IF(ICONV_FOUND)
    +  check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR)
    +  set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}")
    +  if(ICONV_HAVE_WERROR)
    +    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
    +  endif(ICONV_HAVE_WERROR)
    +  check_c_source_compiles("
    +  #include <iconv.h>
    +  int main(){
    +    iconv_t conv = 0;
    +    const char* in = 0;
    +    size_t ilen = 0;
    +    char* out = 0;
    +    size_t olen = 0;
    +    iconv(conv, &in, &ilen, &out, &olen);
    +    return 0;
    +  }
    +" ICONV_SECOND_ARGUMENT_IS_CONST )
    +  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
    +ENDIF(ICONV_FOUND)
    +set(CMAKE_REQUIRED_INCLUDES)
    +set(CMAKE_REQUIRED_LIBRARIES)
    +
    +IF(ICONV_FOUND)
    +  IF(NOT ICONV_FIND_QUIETLY)
    +    MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
    +  ENDIF(NOT ICONV_FIND_QUIETLY)
    +ELSE(ICONV_FOUND)
    +  IF(Iconv_FIND_REQUIRED)
    +    MESSAGE(FATAL_ERROR "Could not find Iconv")
    +  ENDIF(Iconv_FIND_REQUIRED)
    +ENDIF(ICONV_FOUND)
    +
    +MARK_AS_ADVANCED(
    +  ICONV_INCLUDE_DIR
    +  ICONV_LIBRARIES
    +  ICONV_SECOND_ARGUMENT_IS_CONST
    +)
    diff -git a/trunk/cmake/FindLibintl.cmake b/trunk/cmake/FindLibintl.cmake
    new file mode 100755
    index 0000000..bfa0d45
    -- /dev/null
    +++ b/trunk/cmake/FindLibintl.cmake
    @@ -0,0 +1,46 @@
    +# Try to find the libintl library. Explicit searching is currently
    +# only required for Win32, though it might be useful for some UNIX
    +# variants, too. Therefore code for searching common UNIX include
    +# directories is included, too.
    +#
    +# Once done this will define
    +#
    +#  LIBINTL_FOUND - system has libintl
    +#  LIBINTL_LIBRARIES - the library needed for linking
    +
    +IF (LibIntl_LIBRARY)
    +   SET(LibIntl_FIND_QUIETLY TRUE)
    +ENDIF ()
    +
    +# for Windows we rely on the environement variables
    +# %INCLUDE% and %LIB%; FIND_LIBRARY checks %LIB%
    +# automatically on Windows
    +IF(WIN32)
    +    FIND_LIBRARY(LibIntl_LIBRARY
    +        NAMES intl
    +    )
    +ELSE()
    +    FIND_LIBRARY(LibIntl_LIBRARY
    +        NAMES intl
    +        PATHS /usr/lib /usr/local/lib
    +    )
    +ENDIF()
    +
    +IF (LibIntl_LIBRARY)
    +    SET(LIBINTL_FOUND TRUE)
    +    SET(LIBINTL_LIBRARIES ${LibIntl_LIBRARY})
    +ELSE ()
    +    SET(LIBINTL_FOUND FALSE)
    +ENDIF ()
    +
    +IF (LIBINTL_FOUND)
    +    IF (NOT LibIntl_FIND_QUIETLY)
    +        MESSAGE(STATUS "Found libintl: ${LibIntl_LIBRARY}")
    +    ENDIF ()
    +ELSE ()
    +    IF (LibIntl_FIND_REQUIRED)
    +        MESSAGE(FATAL_ERROR "Could NOT find libintl")
    +    ENDIF ()
    +ENDIF ()
    +
    +MARK_AS_ADVANCED(LibIntl_LIBRARY)
    \ No newline at end of file
    diff -git a/trunk/config.h.in b/trunk/config.h.in
    deleted file mode 100644
    index 953df05..0000000
    -- a/trunk/config.h.in
    +++ /dev/null
    @@ -1,61 +0,0 @@
    -/* config.h.in.  Generated from configure.ac by autoheader.  */
    -
    -/* Define to 1 if you have the <expat.h> header file. */
    -#undef HAVE_EXPAT_H
    -
    -/* Define to 1 if you have the `getpagesize' function. */
    -#undef HAVE_GETPAGESIZE
    -
    -/* Define to 1 if you have the <inttypes.h> header file. */
    -#undef HAVE_INTTYPES_H
    -
    -/* Define to 1 if you have the <memory.h> header file. */
    -#undef HAVE_MEMORY_H
    -
    -/* Define to 1 if you have a working `mmap' system call. */
    -#undef HAVE_MMAP
    -
    -/* Define to 1 if you have the <stdint.h> header file. */
    -#undef HAVE_STDINT_H
    -
    -/* Define to 1 if you have the <stdlib.h> header file. */
    -#undef HAVE_STDLIB_H
    -
    -/* Define to 1 if you have the <strings.h> header file. */
    -#undef HAVE_STRINGS_H
    -
    -/* Define to 1 if you have the <string.h> header file. */
    -#undef HAVE_STRING_H
    -
    -/* Define to 1 if you have the <sys/stat.h> header file. */
    -#undef HAVE_SYS_STAT_H
    -
    -/* Define to 1 if you have the <sys/types.h> header file. */
    -#undef HAVE_SYS_TYPES_H
    -
    -/* Define to 1 if you have the <unistd.h> header file. */
    -#undef HAVE_UNISTD_H
    -
    -/* Name of package */
    -#undef PACKAGE
    -
    -/* Define to the address where bug reports for this package should be sent. */
    -#undef PACKAGE_BUGREPORT
    -
    -/* Define to the full name of this package. */
    -#undef PACKAGE_NAME
    -
    -/* Define to the full name and version of this package. */
    -#undef PACKAGE_STRING
    -
    -/* Define to the one symbol short name of this package. */
    -#undef PACKAGE_TARNAME
    -
    -/* Define to the version of this package. */
    -#undef PACKAGE_VERSION
    -
    -/* Define to 1 if you have the ANSI C header files. */
    -#undef STDC_HEADERS
    -
    -/* Version number of package */
    -#undef VERSION
    %<====================patch.txt=================================

     
  • Aliaksandr Autayeu

    It applies to SVN revision 104.

     
  • gfdsf gfdsf

    gfdsf gfdsf - 2021-05-15

    I am working on a coffee website and on that project we need a dictionary exchange feature software and this looks very nice choice guide me about it please.

     

Log in to post a comment.