Permalink
Browse files

Initial VM branch -code

  • Loading branch information...
1 parent cf9b612 commit 3b481737e968ead9eb56efef5d7861be1c729553 @scottmac scottmac committed Dec 8, 2011
Showing with 3,782 additions and 10 deletions.
  1. +54 −0 CMake/FindLibDwarf.cmake
  2. +55 −0 CMake/FindLibElf.cmake
  3. +3 −3 CMake/FindLibEvent.cmake
  4. +9 −0 CMake/HPHPFindLibs.cmake
  5. +1 −1 CMake/HPHPSetup.cmake
  6. +5 −5 doc/Makefile
  7. +3,654 −0 doc/bytecode.specification
  8. +1 −1 src/CMakeLists.txt
View
54 CMake/FindLibDwarf.cmake
@@ -0,0 +1,54 @@
+# - Try to find libdwarf
+# Once done this will define
+#
+# LIBDWARF_FOUND - system has libdwarf
+# LIBDWARF_INCLUDE_DIRS - the libdwarf include directory
+# LIBDWARF_LIBRARIES - Link these to use libdwarf
+# LIBDWARF_DEFINITIONS - Compiler switches required for using libdwarf
+#
+
+# Locate libelf library at first
+if (NOT LIBELF_FOUND)
+ find_package (LibElf REQUIRED)
+endif (NOT LIBELF_FOUND)
+
+if (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS)
+ set (LibDwarf_FIND_QUIETLY TRUE)
+endif (LIBDWARF_LIBRARIES AND LIBDWARF_INCLUDE_DIRS)
+
+find_path (DWARF_INCLUDE_DIR
+ NAMES
+ dwarf.h
+ PATHS
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ ENV CPATH) # PATH and INCLUDE will also work
+
+if (DWARF_INCLUDE_DIR)
+ set (LIBDWARF_INCLUDE_DIRS ${DWARF_INCLUDE_DIR})
+endif ()
+
+find_library (LIBDWARF_LIBRARIES
+ NAMES
+ dwarf
+ PATHS
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ ENV LIBRARY_PATH # PATH and LIB will also work
+ ENV LD_LIBRARY_PATH)
+message(${LIBDWARF_LIBRARIES})
+include (FindPackageHandleStandardArgs)
+
+
+# handle the QUIETLY and REQUIRED arguments and set LIBDWARF_FOUND to TRUE
+# if all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibDwarf DEFAULT_MSG
+ LIBDWARF_LIBRARIES
+ LIBDWARF_INCLUDE_DIRS)
+
+mark_as_advanced(LIBDW_INCLUDE_DIR DWARF_INCLUDE_DIR)
+mark_as_advanced(LIBDWARF_INCLUDE_DIRS LIBDWARF_LIBRARIES)
View
55 CMake/FindLibElf.cmake
@@ -0,0 +1,55 @@
+# - Try to find libelf
+# Once done this will define
+#
+# LIBELF_FOUND - system has libelf
+# LIBELF_INCLUDE_DIRS - the libelf include directory
+# LIBELF_LIBRARIES - Link these to use libelf
+# LIBELF_DEFINITIONS - Compiler switches required for using libelf
+#
+# Copyright (c) 2008 Bernhard Walle <bernhard.walle@gmx.de>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+if (LIBELF_LIBRARIES AND LIBELF_INCLUDE_DIRS)
+ set (LibElf_FIND_QUIETLY TRUE)
+endif (LIBELF_LIBRARIES AND LIBELF_INCLUDE_DIRS)
+
+find_path (LIBELF_INCLUDE_DIRS
+ NAMES
+ libelf.h
+ PATHS
+ /usr/include
+ /usr/include/libelf
+ /usr/local/include
+ /usr/local/include/libelf
+ /opt/local/include
+ /opt/local/include/libelf
+ /sw/include
+ /sw/include/libelf
+ ENV CPATH)
+
+find_library (LIBELF_LIBRARIES
+ NAMES
+ elf
+ PATHS
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ ENV LIBRARY_PATH
+ ENV LD_LIBRARY_PATH)
+
+include (FindPackageHandleStandardArgs)
+
+
+# handle the QUIETLY and REQUIRED arguments and set LIBELF_FOUND to TRUE if all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibElf DEFAULT_MSG
+ LIBELF_LIBRARIES
+ LIBELF_INCLUDE_DIRS)
+
+
+mark_as_advanced(LIBELF_INCLUDE_DIRS LIBELF_LIBRARIES)
View
6 CMake/FindLibEvent.cmake
@@ -12,14 +12,14 @@ endforeach()
find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LibEvent_INCLUDE_PATHS})
find_library(LIBEVENT_LIB NAMES event PATHS ${LibEvent_LIB_PATHS})
-
+
if (LIBEVENT_LIB AND LIBEVENT_INCLUDE_DIR)
set(LibEvent_FOUND TRUE)
set(LIBEVENT_LIB ${LIBEVENT_LIB})
else ()
set(LibEvent_FOUND FALSE)
endif ()
-
+
if (LibEvent_FOUND)
if (NOT LibEvent_FIND_QUIETLY)
message(STATUS "Found libevent: ${LIBEVENT_LIB}")
@@ -30,7 +30,7 @@ else ()
endif ()
message(STATUS "libevent NOT found.")
endif ()
-
+
mark_as_advanced(
LIBEVENT_LIB
LIBEVENT_INCLUDE_DIR
View
9 CMake/HPHPFindLibs.cmake
@@ -247,6 +247,12 @@ include_directories(${READLINE_INCLUDE_DIR})
find_package(CClient REQUIRED)
include_directories(${CCLIENT_INCLUDE_PATH})
+find_package(LibDwarf REQUIRED)
+include_directories(${LIBDWARF_INCLUDE_DIRS})
+
+find_package(LibElf REQUIRED)
+include_directories(${LIBELF_INCLUDE_DIRS})
+
CONTAINS_STRING("${CCLIENT_INCLUDE_PATH}/utf8.h" U8T_DECOMPOSE RECENT_CCLIENT)
if (NOT RECENT_CCLIENT)
unset(RECENT_CCLIENT CACHE)
@@ -398,4 +404,7 @@ endif()
target_link_libraries(${target} ${PAM_LIBRARY})
endif()
+ target_link_libraries(${target} ${LIBDWARF_LIBRARIES})
+ target_link_libraries(${target} ${LIBELF_LIBRARIES})
+
endmacro()
View
2 CMake/HPHPSetup.cmake
@@ -114,7 +114,7 @@ IF($ENV{CXX} MATCHES "icpc")
set(CMAKE_CXX_FLAGS "-no-ipo -fp-model precise -wd584 -wd1418 -wd1918 -wd383 -wd869 -wd981 -wd424 -wd1419 -wd444 -wd271 -wd2259 -wd1572 -wd1599 -wd82 -wd177 -wd593 -fno-omit-frame-pointer -ftemplate-depth-60 -Wall -Woverloaded-virtual -Wno-deprecated -w1 -Wno-strict-aliasing -Wno-write-strings -Wno-invalid-offsetof -fno-operator-names")
else()
set(CMAKE_C_FLAGS "-w")
- set(CMAKE_CXX_FLAGS "-fno-gcse -fno-omit-frame-pointer -ftemplate-depth-60 -Wall -Woverloaded-virtual -Wno-deprecated -Wno-parentheses -Wno-strict-aliasing -Wno-write-strings -Wno-invalid-offsetof -fno-operator-names")
+ set(CMAKE_CXX_FLAGS "-fno-gcse -fno-omit-frame-pointer -ftemplate-depth-60 -Wall -Woverloaded-virtual -Wno-deprecated -Wno-parentheses -Wno-strict-aliasing -Wno-write-strings -Wno-invalid-offsetof -fno-operator-names -Wno-error=array-bounds -Wno-error=switch")
endif()
IF(CMAKE_COMPILER_IS_GNUCC)
View
10 doc/Makefile
@@ -5,18 +5,18 @@ help:
@echo "'make clobber' to clean up directory"
daemon:
- sudo ../src/hphpi/hphpi -m daemon -v "Server.DefaultDocument=index.php" -v "Server.SourceRoot=`pwd`"
+ sudo ../src/hhvm/hhvm -m daemon -v "Server.DefaultDocument=index.php" -v "Server.SourceRoot=`pwd`"
server:
- sudo ../src/hphpi/hphpi -m server -v "Server.DefaultDocument=index.php"
+ sudo ../src/hhvm/hhvm -m server -v "Server.DefaultDocument=index.php"
DEBUGGER_CMDS = a b c d e f g h i j k l m n o p q r step thread u v w x y z "\&" "!"
# update debugger docs
debugger:
- @../src/hphpi/hphpi -m debug --debug-cmd "help start" > debugger.start
- @../src/hphpi/hphpi -m debug --debug-cmd "help" > debugger.cmds
- @../src/hphpi/hphpi -m debug \
+ @../src/hhvm/hhvm -m debug --debug-cmd "help start" > debugger.start
+ @../src/hhvm/hhvm -m debug --debug-cmd "help" > debugger.cmds
+ @../src/hhvm/hhvm -m debug \
$(patsubst %, --debug-cmd "'h %'", $(DEBUGGER_CMDS)) > debugger.refs
clean: clobber
View
3,654 doc/bytecode.specification
3,654 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
2 src/CMakeLists.txt
@@ -18,7 +18,7 @@
include(HPHPSetup)
# find all the source files
-set(RECURSIVE_SOURCE_SUBDIRS runtime/base runtime/eval runtime/ext system/gen system/lib util)
+set(RECURSIVE_SOURCE_SUBDIRS runtime/base runtime/eval runtime/ext runtime/vm system/gen system/lib util)
foreach (dir ${RECURSIVE_SOURCE_SUBDIRS})
auto_sources(files "*.cpp" "RECURSE" "${CMAKE_CURRENT_SOURCE_DIR}/${dir}")

0 comments on commit 3b48173

Please sign in to comment.