2016-04-10 14:21:17 +01:00
|
|
|
|
|
|
|
set (YAPOS_SOURCES
|
|
|
|
alias.c
|
2016-07-31 10:56:54 +01:00
|
|
|
assets.c
|
2016-04-10 14:21:17 +01:00
|
|
|
charsio.c
|
|
|
|
chartypes.c
|
|
|
|
console.c
|
|
|
|
files.c
|
2016-09-28 01:32:27 +01:00
|
|
|
fmem.c
|
2016-04-10 14:21:17 +01:00
|
|
|
fmemopen.c
|
|
|
|
format.c
|
|
|
|
iopreds.c
|
|
|
|
mem.c
|
|
|
|
open_memstream.c
|
|
|
|
pipes.c
|
|
|
|
readline.c
|
|
|
|
random.c
|
|
|
|
readterm.c
|
|
|
|
readutil.c
|
|
|
|
sig.c
|
|
|
|
sockets.c
|
|
|
|
streams.c
|
|
|
|
sysbits.c
|
|
|
|
time.c
|
|
|
|
writeterm.c
|
|
|
|
ypsocks.c
|
|
|
|
ypstdio.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set (YAPOS_HEADERS
|
|
|
|
encoding.h
|
|
|
|
iopreds.h
|
|
|
|
fmemopen.h
|
|
|
|
yapio.h
|
|
|
|
sysbits.h
|
2016-07-31 10:56:54 +01:00
|
|
|
VFS.h
|
2016-04-10 14:21:17 +01:00
|
|
|
)
|
|
|
|
|
2016-07-31 10:56:54 +01:00
|
|
|
include_directories (../H ../include ../OPTYap . ${GMP_INCLUDE_DIR} ${PROJECT_BINARY_DIR})
|
2016-04-10 14:21:17 +01:00
|
|
|
|
2016-07-31 10:56:54 +01:00
|
|
|
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
|
|
|
|
)
|
|
|
|
|
2016-08-30 14:29:40 +01:00
|
|
|
if (ANDROID)
|
|
|
|
file(INSTALL ${YAPOS_PL_SOURCES} DESTINATION ${libpl}/os)
|
|
|
|
else()
|
2016-07-31 10:56:54 +01:00
|
|
|
install (FILES ${YAPOS_PL_SOURCES}
|
|
|
|
DESTINATION ${libpl}/os )
|
2016-08-30 14:29:40 +01:00
|
|
|
endif()
|
2016-07-31 10:56:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
include(CheckFunctionExists)
|
|
|
|
include(CheckSymbolExists)
|
|
|
|
include(CheckVariableExists)
|
2016-04-10 14:21:17 +01:00
|
|
|
|
2016-08-01 12:54:28 +01:00
|
|
|
option (WITH_READLINE "GNU readline console" ON)
|
2016-04-10 14:21:17 +01:00
|
|
|
|
2016-08-01 12:54:28 +01:00
|
|
|
if (WIN32)
|
|
|
|
set (WITH_READLINE OFF)
|
|
|
|
endif (WIN32)
|
2016-08-30 14:29:40 +01:00
|
|
|
|
2016-08-01 12:54:28 +01:00
|
|
|
if (WITH_READLINE)
|
2016-04-10 14:21:17 +01:00
|
|
|
macro_optional_find_package (Readline ON)
|
|
|
|
macro_log_feature (READLINE_FOUND "libreadline"
|
|
|
|
"Readline line editing library"
|
|
|
|
"http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html")
|
|
|
|
|
|
|
|
if (READLINE_FOUND)
|
|
|
|
# - Find the readline library
|
|
|
|
# This module defines
|
|
|
|
# READLINE_INCLUDE_DIR, path to readline/readline.h, etc.
|
|
|
|
# READLINE_LIBRARIES, the libraries required to use READLINE.
|
|
|
|
# READLINE_FOUND, If false, do not try to use READLINE.
|
|
|
|
# also defined, but not for general use are
|
|
|
|
# READLINE_readline_LIBRARY, where to find the READLINE library.
|
|
|
|
# READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined]
|
|
|
|
include_directories (BEFORE ${READLINE_INCLUDE_DIR})
|
2016-08-01 12:54:28 +01:00
|
|
|
list( APPEND CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARIES} )
|
2016-07-31 10:56:54 +01:00
|
|
|
check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H )
|
2016-04-10 14:21:17 +01:00
|
|
|
check_include_files( "stdio.h;readline/history.h" HAVE_READLINE_HISTORY_H )
|
2016-07-31 10:56:54 +01:00
|
|
|
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 )
|
2016-04-10 14:21:17 +01:00
|
|
|
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)
|
|
|
|
check_function_exists( rl_discard_argument HAVE_RL_DISCARD_ARGUMENT)
|
|
|
|
check_function_exists( rl_filename_completion_function HAVE_RL_FILENAME_COMPLETION_FUNCTION)
|
|
|
|
check_function_exists( rl_free_line_state HAVE_RL_FREE_LINE_STATE )
|
|
|
|
check_function_exists( rl_insert_close HAVE_RL_INSERT_CLOSE )
|
|
|
|
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)
|
2016-10-16 23:18:51 +01:00
|
|
|
check_symbol_exists( rl_catch_signals "stdio.h;readline/readline.h" HAVE_DECL_RL_CATCH_SIGNALS )
|
2016-07-31 10:56:54 +01:00
|
|
|
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 )
|
2016-04-10 14:21:17 +01:00
|
|
|
check_symbol_exists( rl_event_hook stdio.h;readline/readline.h HAVE_DECL_RL_EVENT_HOOK )
|
2016-07-31 10:56:54 +01:00
|
|
|
check_symbol_exists( rl_readline_state stdio.h;readline/readline.h HAVE_DECL_RL_READLINE_STATE )
|
2016-04-10 14:21:17 +01:00
|
|
|
endif()
|
|
|
|
endif (READLINE_FOUND)
|
|
|
|
|
|
|
|
set( READLINE_LIBS ${READLINE_LIBRARIES} PARENT_SCOPE)
|
|
|
|
|
2016-08-01 12:54:28 +01:00
|
|
|
endif (WITH_READLINE)
|