Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add readline code so debugger works

  • Loading branch information...
commit f939558d4ea141abe116e49b24fbb17a09ebd810 1 parent 78e6b89
@scottmac scottmac authored
Showing with 41 additions and 0 deletions.
  1. +29 −0 CMake/FindReadline.cmake
  2. +12 −0 CMake/HPHPFindLibs.cmake
View
29 CMake/FindReadline.cmake
@@ -0,0 +1,29 @@
+# from http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/FindReadline.cmake
+# http://websvn.kde.org/trunk/KDE/kdeedu/cmake/modules/COPYING-CMAKE-SCRIPTS
+# --> BSD licensed
+#
+# GNU Readline library finder
+if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
+ set(READLINE_FOUND TRUE)
+else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
+ FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h
+ /usr/include/readline
+ )
+
+# 2008-04-22 The next clause used to read like this:
+#
+# FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
+# FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses )
+# include(FindPackageHandleStandardArgs)
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY )
+#
+# I was advised to modify it such that it will find an ncurses library if
+# required, but not if one was explicitly given, that is, it allows the
+# default to be overridden. PH
+
+ FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
+ include(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY )
+
+ MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
+endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY)
View
12 CMake/HPHPFindLibs.cmake
@@ -169,6 +169,14 @@ include_directories(${ONIGURUMA_INCLUDE_DIRS})
find_package(Ldap REQUIRED)
include_directories(${LDAP_INCLUDE_DIR})
+# ncuses, readline and history
+find_package(Curses REQUIRED)
+include_directories(${CURSES_INCLUDE_PATH})
+
+find_package(Readline REQUIRED)
+include_directories(${READLINE_INCLUDE_DIR})
+
+
FIND_LIBRARY (CRYPT_LIB crypt)
FIND_LIBRARY (RESOLV_LIB resolv)
@@ -251,4 +259,8 @@ macro(hphp_link target)
target_link_libraries(${target} afdt)
target_link_libraries(${target} mbfl)
+
+ target_link_libraries(${target} ${READLINE_LIBRARY})
+ target_link_libraries(${target} ${CURSES_LIBRARIES})
+
endmacro()
Please sign in to comment.
Something went wrong with that request. Please try again.