Android support
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
set (YAPOS_SOURCES
|
||||
alias.c
|
||||
assets.c
|
||||
charsio.c
|
||||
chartypes.c
|
||||
console.c
|
||||
@@ -31,10 +32,40 @@ set (YAPOS_HEADERS
|
||||
fmemopen.h
|
||||
yapio.h
|
||||
sysbits.h
|
||||
VFS.h
|
||||
)
|
||||
|
||||
include_directories (../H ../include ../OPTYap . ${GMP_INCLUDE_DIR} ${PROJECT_BINARY_DIR})
|
||||
|
||||
include_directories (../H ../include ../OPTYap . ${GMP_INCLUDE_DIR} ${PROJECT_BINARY_DIR})
|
||||
set (POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
add_component (libYAPOs
|
||||
${YAPOS_SOURCES}
|
||||
)
|
||||
|
||||
MY_set_target_properties(libYAPOs
|
||||
PROPERTIES
|
||||
# RPATH ${libdir} VERSION ${LIBYAPTAI_FULL_VERSION}
|
||||
# SOVERSION ${LIBYAPTAI_MAJOR_VERSION}.${LIBYAPTAI_MINOR_VERSION}
|
||||
POSITION_INDEPENDENT_CODE TRUE
|
||||
)
|
||||
|
||||
|
||||
#set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GMP_LIBRARIES} )
|
||||
|
||||
set (YAPOS_PL_SOURCES
|
||||
edio.yap
|
||||
chartypes.yap
|
||||
)
|
||||
|
||||
install (FILES ${YAPOS_PL_SOURCES}
|
||||
DESTINATION ${libpl}/os )
|
||||
|
||||
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckVariableExists)
|
||||
|
||||
option (READLINE "GNU readline console" ON)
|
||||
|
||||
@@ -55,15 +86,14 @@ include_directories (../H ../include ../OPTYap . ${GMP_INCLUDE_DIR} ${PROJECT_B
|
||||
# READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined]
|
||||
|
||||
include_directories (BEFORE ${READLINE_INCLUDE_DIR})
|
||||
|
||||
set(YAP_SYSTEM_OPTIONS "readline " ${YAP_SYSTEM_OPTIONS} PARENT_SCOPE)
|
||||
set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${READLINE_LIBRARIES} )
|
||||
check_library_exists( readline readline "" HAVE_LIBREADLINE )
|
||||
|
||||
check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H )
|
||||
set_property( TARGET libYap APPEND PROPERTY LINK_LIBRARIES ${READLINE_LIBRARIES} )
|
||||
list( APPEND CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARIES} )
|
||||
check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H )
|
||||
check_include_files( "stdio.h;readline/history.h" HAVE_READLINE_HISTORY_H )
|
||||
if (HAVE_READLINE_READLINE_H)
|
||||
SET ( USE_READLINE ON )
|
||||
if (HAVE_READLINE_READLINE_H)
|
||||
SET ( USE_READLINE ON PARENT_SCOPE)
|
||||
set(YAP_SYSTEM_OPTIONS "readline" ${YAP_SYSTEM_OPTIONS} PARENT_SCOPE)
|
||||
check_library_exists( readline readline "${READLINE_LIBRARIES}" HAVE_LIBREADLINE )
|
||||
check_function_exists( add_history HAVE_ADD_HISTORY )
|
||||
check_function_exists( rl_begin_undo_group HAVE_RL_BEGIN_UNDO_GROUP)
|
||||
check_function_exists( rl_clear_pending_input HAVE_RL_CLEAR_PENDING_INPUT)
|
||||
@@ -74,37 +104,18 @@ include_directories (../H ../include ../OPTYap . ${GMP_INCLUDE_DIR} ${PROJECT_B
|
||||
check_function_exists( rl_reset_after_signal HAVE_RL_RESET_AFTER_SIGNAL )
|
||||
check_function_exists( rl_set_keyboard_input_timeout HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT )
|
||||
check_function_exists( rl_set_prompt HAVE_RL_SET_PROMPT)
|
||||
check_variable_exists( rl_catch_signals "readline/readline.h" HAVE_DECL_RL_CATCH_SIGNALS )
|
||||
check_symbol_exists( rl_completion_func_t stdio.h;readline/readline.h HAVE_DECL_RL_COMPLETION_FUNC_T )
|
||||
check_variable_exists( rl_done stdio.h;readline/readline.h HAVE_DECL_RL_DONE )
|
||||
check_symbol_exists( rl_hook_func_t stdio.h;readline/readline.h HAVE_DECL_RL_HOOK_FUNC_T )
|
||||
check_symbol_exists( rl_catch_signals "readline/readline.h" HAVE_DECL_RL_CATCH_SIGNALS )
|
||||
check_type_size( rl_completion_func_t RL_COMPLETION_FUNC_T )
|
||||
check_symbol_exists( rl_done stdio.h;readline/readline.h HAVE_DECL_RL_DONE )
|
||||
CHECK_TYPE_SIZE( rl_hook_func_t RL_HOOK_FUNC_T )
|
||||
check_symbol_exists( rl_event_hook stdio.h;readline/readline.h HAVE_DECL_RL_EVENT_HOOK )
|
||||
check_variable_exists( rl_readline_state stdio.h;readline/readline.h HAVE_DECL_RL_READLINE_STATE )
|
||||
check_symbol_exists( rl_readline_state stdio.h;readline/readline.h HAVE_DECL_RL_READLINE_STATE )
|
||||
endif()
|
||||
endif (READLINE_FOUND)
|
||||
|
||||
endif (READLINE)
|
||||
|
||||
set (POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
add_library (libYAPOs OBJECT
|
||||
${YAPOS_SOURCES}
|
||||
)
|
||||
|
||||
set_target_properties(libYAPOs
|
||||
PROPERTIES
|
||||
|
||||
# RPATH ${libdir} VERSION ${LIBYAPTAI_FULL_VERSION}
|
||||
# SOVERSION ${LIBYAPTAI_MAJOR_VERSION}.${LIBYAPTAI_MINOR_VERSION}
|
||||
POSITION_INDEPENDENT_CODE TRUE
|
||||
OUTPUT_NAME YAPOs
|
||||
depends dheap
|
||||
)
|
||||
|
||||
configure_file ("${PROJECT_SOURCE_DIR}/os/YapIOConfig.h.cmake"
|
||||
"${PROJECT_BINARY_DIR}/os/YapIOConfig.h" )
|
||||
|
||||
set( READLINE_LIBS ${READLINE_LIBRARIES} PARENT_SCOPE)
|
||||
|
||||
endif (READLINE)
|
||||
|
||||
#set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GMP_LIBRARIES} )
|
||||
|
||||
Reference in New Issue
Block a user