mac
This commit is contained in:
		@@ -1,7 +1,9 @@
 | 
				
			|||||||
ENABLE_VARS="clpbn|yes|WITH_CLPBN \
 | 
					ENABLE_VARS="brew|yes|WITH_BREW\
 | 
				
			||||||
 | 
					  clpbn|yes|WITH_CLPBN \
 | 
				
			||||||
  cplint|yes|WITH_CPLINT \
 | 
					  cplint|yes|WITH_CPLINT \
 | 
				
			||||||
  horus|yes|WITH_HORUS \
 | 
					  horus|yes|WITH_HORUS \
 | 
				
			||||||
  clpr|yes|WITH_CLPR \
 | 
					  clpr|yes|WITH_CLPR \
 | 
				
			||||||
 | 
					  macports|yes|WITH_MACPORTS\
 | 
				
			||||||
  problog|yes|WITH_PROBLOG \
 | 
					  problog|yes|WITH_PROBLOG \
 | 
				
			||||||
   jit|no|WITH_JIT \
 | 
					   jit|no|WITH_JIT \
 | 
				
			||||||
   chr|no|WITH_CHR \
 | 
					   chr|no|WITH_CHR \
 | 
				
			||||||
@@ -17,4 +19,4 @@ WITH_VARS="swig|yes|WITH_SWIG \
 | 
				
			|||||||
   python|yes|WITH_PYTHON \
 | 
					   python|yes|WITH_PYTHON \
 | 
				
			||||||
   openssl|yes|WITH_OPENSSL\
 | 
					   openssl|yes|WITH_OPENSSL\
 | 
				
			||||||
   readline|yes|WITH_READLINE \
 | 
					   readline|yes|WITH_READLINE \
 | 
				
			||||||
   gmp|yes|WITH_GMP " 
 | 
					   gmp|yes|WITH_GMP" 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -226,24 +226,58 @@ ADD_CUSTOM_TARGET(run_install COMMAND ${CMAKE_MAKE_PROGRAM} install)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (APPLE)
 | 
					if (APPLE)
 | 
				
			||||||
    set(MACOSX_RPATH ON)
 | 
					  set(MACOSX_RPATH ON)
 | 
				
			||||||
    if (NOT $ENV{CONDA_BUILD}x STREQUAL "1x")
 | 
					
 | 
				
			||||||
 | 
					      if (NOT $ENV{CONDA_BUILD}x STREQUAL "1x")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        set(PATH $ENV{PATH})
 | 
					        set(PATH $ENV{PATH})
 | 
				
			||||||
        list(FIND ${PATH} pos /usr/local)
 | 
					
 | 
				
			||||||
        if (pos EQUAL -1)
 | 
					    option(WITH_BREW "brew" ON)
 | 
				
			||||||
            set(pos 0)
 | 
						if (WITH_MACPORTS)
 | 
				
			||||||
        endif ()
 | 
					# Add MacPorts
 | 
				
			||||||
 | 
					# Detect if the "port" command is valid on this system; if so, return full path
 | 
				
			||||||
 | 
					EXECUTE_PROCESS(COMMAND which port RESULT_VARIABLE DETECT_MACPORTS OUTPUT_VARIABLE MACPORTS_PREFIX ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					IF (${DETECT_MACPORTS} EQUAL 0)
 | 
				
			||||||
 | 
					    # "/opt/local/bin/port" doesn't have libs, so we get the parent directory
 | 
				
			||||||
 | 
					    GET_FILENAME_COMPONENT(MACPORTS_PREFIX ${MACPORTS_PREFIX} DIRECTORY)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # "/opt/local/bin" doesn't have libs, so we get the parent directory
 | 
				
			||||||
 | 
					    GET_FILENAME_COMPONENT(MACPORTS_PREFIX ${MACPORTS_PREFIX} DIRECTORY)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # "/opt/local" is where MacPorts lives, add `/lib` suffix and link
 | 
				
			||||||
 | 
					    LINK_DIRECTORIES(${LINK DIRECTORIES} ${MACPORTS_PREFIX}/lib)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    MESSAGE("WINNING!: ${MACPORTS_PREFIX}/lib")
 | 
				
			||||||
 | 
					ENDIF()
 | 
				
			||||||
 | 
					ENDIF()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    option(WITH_BREW "brew" ON)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (WITH_BREW)
 | 
				
			||||||
 | 
					EXECUTE_PROCESS(COMMAND brew --prefix RESULT_VARIABLE DETECT_BREW OUTPUT_VARIABLE BREW_PREFIX ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					IF (${DETECT_BREW} EQUAL 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # "/opt/local" is where MacPorts lives, add `/lib` suffix and link
 | 
				
			||||||
 | 
					    LINK_DIRECTORIES( ${BREW_PREFIX}/lib)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    MESSAGE("BREW!: ${BREW_PREFIX}/lib")
 | 
				
			||||||
 | 
					ENDIF()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        list(INSERT CMAKE_PREFIX_PATH pos
 | 
					        list(INSERT CMAKE_PREFIX_PATH pos
 | 
				
			||||||
                /usr/local/opt/gmp
 | 
					                ${BREW_PREFIX}/opt/gmp
 | 
				
			||||||
                /usr/local/opt/libxml2
 | 
					                ${BREW_PREFIX}/opt/libxml2
 | 
				
			||||||
                /usr/local/opt/openmpi
 | 
					                ${BREW_PREFIX}/opt/openmpi
 | 
				
			||||||
                /usr/local/opt/openssl
 | 
					                ${BREW_PREFIX}/opt/openssl
 | 
				
			||||||
                /usr/local/opt/postgresql
 | 
					                ${BREW_PREFIX}/opt/postgresql
 | 
				
			||||||
                /usr/local/opt/python3
 | 
					                ${BREW_PREFIX}/opt/python3
 | 
				
			||||||
                /usr/local/opt/readline
 | 
					                ${BREW_PREFIX}/opt/readline
 | 
				
			||||||
                /usr/local/opt/swig
 | 
					                ${BREW_PREFIX}/opt/swig
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
    endif ()
 | 
						    endif ()
 | 
				
			||||||
 | 
						  endif()
 | 
				
			||||||
endif ()
 | 
					endif ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -306,6 +340,9 @@ if (GMP_FOUND)
 | 
				
			|||||||
    include_directories(${GMP_INCLUDE_DIRS})
 | 
					    include_directories(${GMP_INCLUDE_DIRS})
 | 
				
			||||||
endif (GMP_FOUND)
 | 
					endif (GMP_FOUND)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    option(WITH_READLINE "use readline or libedit" ON)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if (WITH_READLINE)
 | 
				
			||||||
include(FindReadline)
 | 
					include(FindReadline)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
List(APPEND YAP_SYSTEM_OPTIONS readline)
 | 
					List(APPEND YAP_SYSTEM_OPTIONS readline)
 | 
				
			||||||
@@ -320,7 +357,7 @@ if (READLINE_FOUND)
 | 
				
			|||||||
    list(APPEND CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARIES})
 | 
					    list(APPEND CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARIES})
 | 
				
			||||||
    list(APPEND CMAKE_REQUIRED_INCLUDES ${READLINE_INCLUDE_DIR})
 | 
					    list(APPEND CMAKE_REQUIRED_INCLUDES ${READLINE_INCLUDE_DIR})
 | 
				
			||||||
endif ()
 | 
					endif ()
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#MPI STUFF
 | 
					#MPI STUFF
 | 
				
			||||||
# library/mpi/mpi.c library/mpi/mpe.c
 | 
					# library/mpi/mpi.c library/mpi/mpe.c
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -390,6 +390,7 @@ git_describe(GIT_DESCRIBE)
 | 
				
			|||||||
#Test standard headers (mimics AC_HEADER_STDC)
 | 
					#Test standard headers (mimics AC_HEADER_STDC)
 | 
				
			||||||
include(TestSTDC)
 | 
					include(TestSTDC)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if (WITH_READLINE)
 | 
				
			||||||
                                                
 | 
					                                                
 | 
				
			||||||
check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H )
 | 
					check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H )
 | 
				
			||||||
check_include_files( "stdio.h;readline/history.h"  HAVE_READLINE_HISTORY_H )
 | 
					check_include_files( "stdio.h;readline/history.h"  HAVE_READLINE_HISTORY_H )
 | 
				
			||||||
@@ -413,7 +414,7 @@ check_symbol_exists( rl_readline_state stdio.h;readline/readline.h HAVE_DECL_RL_
 | 
				
			|||||||
check_function_exists( add_history HAVE_ADD_HISTORY)
 | 
					check_function_exists( add_history HAVE_ADD_HISTORY)
 | 
				
			||||||
check_function_exists( remove_history HAVE_REMOVE_HISTORY)
 | 
					check_function_exists( remove_history HAVE_REMOVE_HISTORY)
 | 
				
			||||||
check_function_exists( using_history HAVE_USING_HISTORY)
 | 
					check_function_exists( using_history HAVE_USING_HISTORY)
 | 
				
			||||||
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
configure_file(${CMAKE_SOURCE_DIR}/os/YapIOConfig.h.cmake ${CMAKE_BINARY_DIR}/YapIOConfig.h)
 | 
					configure_file(${CMAKE_SOURCE_DIR}/os/YapIOConfig.h.cmake ${CMAKE_BINARY_DIR}/YapIOConfig.h)
 | 
				
			||||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/../config.h.cmake
 | 
					configure_file(${CMAKE_CURRENT_LIST_DIR}/../config.h.cmake
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,38 +9,38 @@ if (WITH_READLINE)
 | 
				
			|||||||
      find_library(READLINE_tinfo_LIBRARY
 | 
					      find_library(READLINE_tinfo_LIBRARY
 | 
				
			||||||
        NAMES tinfo
 | 
					        NAMES tinfo
 | 
				
			||||||
     message(STATUS "tinfo DLL found at   ${READLINE_tinfo_LIBRARY}")
 | 
					     message(STATUS "tinfo DLL found at   ${READLINE_tinfo_LIBRARY}")
 | 
				
			||||||
       HINTS ${Readline_ROOT_DIR}/lib
 | 
					       HINTS ${READLINE_ROOT_DIR}/lib
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
      find_library(READLINE_tinfow_LIBRARY
 | 
					      find_library(READLINE_tinfow_LIBRARY
 | 
				
			||||||
        NAMES tinfow
 | 
					        NAMES tinfow
 | 
				
			||||||
        HINTS ${Readline_ROOT_DIR}/lib
 | 
					        HINTS ${READLINE_ROOT_DIR}/lib
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
  find_library(READLINE_ncurses_LIBRARY
 | 
					  find_library(READLINE_ncurses_LIBRARY
 | 
				
			||||||
essage(STATUS "tinfo DLL found at   ${READLINE_tinfo_LIBRARY}")
 | 
					essage(STATUS "tinfo DLL found at   ${READLINE_tinfo_LIBRARY}")
 | 
				
			||||||
       HINTS ${Readline_ROOT_DIR}/lib
 | 
					       HINTS ${READLINE_ROOT_DIR}/lib
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
      find_library(READLINE_tinfow_LIBRARY
 | 
					      find_library(READLINE_tinfow_LIBRARY
 | 
				
			||||||
        NAMES tinfow
 | 
					        NAMES tinfow
 | 
				
			||||||
        HINTS ${Readline_ROOT_DIR}/lib
 | 
					        HINTS ${READLINE_ROOT_DIR}/lib
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
  find_library(READLINE_ncurses_LIBRARY
 | 
					  find_library(READLINE_ncurses_LIBRARY
 | 
				
			||||||
    NAMES ncurses
 | 
					    NAMES ncurses
 | 
				
			||||||
    HINTS ${Readline_ROOT_DIR}/lib
 | 
					    HINTS ${READLINE_ROOT_DIR}/lib
 | 
				
			||||||
    message(STATUS "readline ncurses DLL found at   ${READLINE_ncurses_LIBRARY}")
 | 
					    message(STATUS "readline ncurses DLL found at   ${READLINE_ncurses_LIBRARY}")
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    find_library(READLINE_ncursesw_LIBRARY
 | 
					    find_library(READLINE_ncursesw_LIBRARY
 | 
				
			||||||
      NAMES ncursesw
 | 
					      NAMES ncursesw
 | 
				
			||||||
    message(STATUS "readline ncursesw DLL found at   ${READLINE_ncursesw_LIBRARY}")
 | 
					    message(STATUS "readline ncursesw DLL found at   ${READLINE_ncursesw_LIBRARY}")
 | 
				
			||||||
      HINTS ${Readline_ROOT_DIR}/lib
 | 
					      HINTS ${READLINE_ROOT_DIR}/lib
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  find_path(READLINE_INCLUDE_DIR
 | 
					  find_path(READLINE_INCLUDE_DIR
 | 
				
			||||||
    NAMES readline/readline.h
 | 
					    NAMES readline/readline.h
 | 
				
			||||||
    HINTS ${Readline_ROOT_DIR}/include
 | 
					    HINTS ${READLINE_ROOT_DIR}/include
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
  find_library(READLINE_readline_LIBRARY
 | 
					  find_library(READLINE_readline_LIBRARY
 | 
				
			||||||
    NAMES readline
 | 
					    NAMES readline
 | 
				
			||||||
    HINTS ${READLINE_INCLUDE_DIR/../lib} ${Readline_ROOT_DIR}/lib 
 | 
					    HINTS ${READLINE_INCLUDE_DIR/../lib} ${READLINE_ROOT_DIR}/lib 
 | 
				
			||||||
  if (READLINE_readline_LIBRARY)
 | 
					  if (READLINE_readline_LIBRARY)
 | 
				
			||||||
    set (HAVE_LIBREADLINE TRUE)
 | 
					    set (HAVE_LIBREADLINE TRUE)
 | 
				
			||||||
    if (READLINE_INCLUDE_DIR)
 | 
					    if (READLINE_INCLUDE_DIR)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -350,6 +350,7 @@ void Yap_DefaultStreamOps(StreamDesc *st) {
 | 
				
			|||||||
    st->stream_getc = Yap_popChar;
 | 
					    st->stream_getc = Yap_popChar;
 | 
				
			||||||
    st->stream_wgetc = Yap_popChar;
 | 
					    st->stream_wgetc = Yap_popChar;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					#if USE_READLINE
 | 
				
			||||||
  if (st->status & Readline_Stream_f) {
 | 
					  if (st->status & Readline_Stream_f) {
 | 
				
			||||||
      st->stream_peek = Yap_ReadlinePeekChar;
 | 
					      st->stream_peek = Yap_ReadlinePeekChar;
 | 
				
			||||||
      st->stream_wpeek = Yap_ReadlinePeekChar;
 | 
					      st->stream_wpeek = Yap_ReadlinePeekChar;
 | 
				
			||||||
@@ -362,7 +363,9 @@ void Yap_DefaultStreamOps(StreamDesc *st) {
 | 
				
			|||||||
    st->stream_peek = Yap_peekWithSeek;
 | 
					    st->stream_peek = Yap_peekWithSeek;
 | 
				
			||||||
    st->stream_wpeek = Yap_peekWideWithSeek;
 | 
					    st->stream_wpeek = Yap_peekWideWithSeek;
 | 
				
			||||||
    } */
 | 
					    } */
 | 
				
			||||||
  else {
 | 
					  else
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
    st->stream_peek = Yap_peekChar;
 | 
					    st->stream_peek = Yap_peekChar;
 | 
				
			||||||
    st->stream_wpeek = Yap_peekWide;
 | 
					    st->stream_wpeek = Yap_peekWide;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user