diff --git a/CMakeLists.txt b/CMakeLists.txt index 9307cee..8c74a28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ set(CMAKE_BUILD_TYPE debug) find_package(DWARF REQUIRED) -_set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/usr/${__LIB}" "libdir") +_set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}${CMAKE_INSTALL_PREFIX}/${__LIB}" "libdir") set(dwarves_LIB_SRCS dwarves.c) add_library(dwarves SHARED ${dwarves_LIB_SRCS}) @@ -61,10 +61,11 @@ add_executable(prefcnt ${prefcnt_SRCS}) target_link_libraries(prefcnt dwarves) install(TARGETS codiff ctracer dtagnames pahole pdwtags - pfunct pglobal prefcnt RUNTIME DESTINATION /usr/bin) + pfunct pglobal prefcnt RUNTIME DESTINATION + ${CMAKE_INSTALL_PREFIX}/bin) install(TARGETS dwarves LIBRARY DESTINATION ${LIB_INSTALL_DIR}) -install(FILES dwarves.h DESTINATION /usr/include) -install(FILES ostra/ostra-cg DESTINATION /usr/bin) +install(FILES dwarves.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include) +install(FILES ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) install(FILES ostra/python/ostra.py DESTINATION ${LIB_INSTALL_DIR}/ctracer/python) install(FILES lib/Makefile lib/ctracer_jprobe.c lib/ctracer_relay.c lib/ctracer_relay.h diff --git a/README b/README index b164973..e711ba4 100644 --- a/README +++ b/README @@ -3,8 +3,11 @@ Build instructions: 1. install cmake 2. mkdir build 3. cd build -4. cmake .. -5. make +4. cmake -D__LIB=lib .. +5. make install + +Default is to be installed on /usr/local, see rpm spec file for +installing on other places. Known to work scenarios: @@ -17,3 +20,8 @@ Debian Unstable: cmake 2.4.5-1 libdw-dev 0.123-2 + +Fedora Core 6: + +cmake 2.4.5-2.fc6 +elfutils-devel 0.126-1.fc6 diff --git a/rpm/SPECS/dwarves.spec b/rpm/SPECS/dwarves.spec index 80a8b04..0a2ffd4 100644 --- a/rpm/SPECS/dwarves.spec +++ b/rpm/SPECS/dwarves.spec @@ -3,7 +3,7 @@ Name: dwarves Version: 0 -Release: 18 +Release: 19 License: GPL Summary: Dwarf Tools Group: Base @@ -48,7 +48,7 @@ DWARF processing library development files %setup -q -c -n %{name}-%{version} %build -cmake -D __LIB=%{_lib} . +cmake -D__LIB=%{_lib} -DCMAKE_INSTALL_PREFIX=/usr . make %install