another directory rename: failstar -> fail
"failstar" sounds like a name for a cruise liner from the 80s. As "*" isn't a desirable part of directory names, just name the whole thing "fail/", the core parts being stored in "fail/core/". Additionally fixing two build system dependency issues: - missing jobserver -> protomessages dependency - broken bochs -> fail dependency (add_custom_target DEPENDS only allows plain file dependencies ... cmake for the win) git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@956 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
62
cmake/FindLibDwarf.cmake
Normal file
62
cmake/FindLibDwarf.cmake
Normal file
@ -0,0 +1,62 @@
|
||||
# - 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
|
||||
#find_path (LIBDW_INCLUDE_DIR
|
||||
# NAMES
|
||||
# elfutils/libdw.h
|
||||
# PATHS
|
||||
# /usr/include
|
||||
# /usr/local/include
|
||||
# /opt/local/include
|
||||
# /sw/include
|
||||
# ENV CPATH)
|
||||
if (DWARF_INCLUDE_DIR) # AND LIBDW_INCLUDE_DIR)
|
||||
set (LIBDWARF_INCLUDE_DIRS ${DWARF_INCLUDE_DIR} )
|
||||
endif (DWARF_INCLUDE_DIR)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
55
cmake/FindLibElf.cmake
Normal file
55
cmake/FindLibElf.cmake
Normal file
@ -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)
|
||||
66
cmake/compilerconfig.cmake
Normal file
66
cmake/compilerconfig.cmake
Normal file
@ -0,0 +1,66 @@
|
||||
|
||||
##### Verbose make ####
|
||||
option( VERBOSE_MAKE "Verbose Makefile output" OFF) # defaults to OFF
|
||||
set(CMAKE_VERBOSE_MAKEFILE ${VERBOSE_MAKE})
|
||||
|
||||
|
||||
##### Compilers.. #####
|
||||
SET( COMPILER "ag++" CACHE STRING "Use clang/gcc/ag++") # Defaults to ag++
|
||||
#SET( PARALLELBUILDS "4" CACHE STRING "Parallel builds forc compiling Bochs (-j N)")
|
||||
|
||||
if(${COMPILER} STREQUAL "clang")
|
||||
set(CMAKE_C_COMPILER "clang")
|
||||
set(CMAKE_CXX_COMPILER "clang++")
|
||||
|
||||
elseif(${COMPILER} STREQUAL "gcc")
|
||||
set(CMAKE_C_COMPILER "gcc")
|
||||
set(CMAKE_CXX_COMPILER "g++")
|
||||
|
||||
elseif(${COMPILER} STREQUAL "ag++")
|
||||
set(CMAKE_C_COMPILER "ag++")
|
||||
set(CMAKE_CXX_COMPILER "ag++")
|
||||
## Here we add the build dir holding the generated header files (protobuf)
|
||||
add_definitions("-p ${CMAKE_SOURCE_DIR} --real-instances --Xcompiler" )
|
||||
|
||||
else(${COMPILER} STREQUAL "clang")
|
||||
set(CMAKE_C_COMPILER "gcc")
|
||||
set(CMAKE_CXX_COMPILER "g++")
|
||||
|
||||
endif(${COMPILER} STREQUAL "clang")
|
||||
|
||||
message(STATUS "[${PROJECT_NAME}] Compiler: ${CMAKE_C_COMPILER}/${CMAKE_CXX_COMPILER}" )
|
||||
|
||||
#### Add some custom targets for the autoconf-based Bochs
|
||||
if(BUILD_BOCHS)
|
||||
|
||||
set(bochs_src_dir ${CMAKE_CURRENT_SOURCE_DIR}/bochs )
|
||||
|
||||
add_custom_target( bochsclean
|
||||
COMMAND +make -C ${bochs_src_dir} clean
|
||||
COMMENT "[${PROJECT_NAME}] Cleaning all up (clean in bochs)"
|
||||
)
|
||||
|
||||
add_custom_target( bochsallclean
|
||||
COMMAND +make -C ${bochs_src_dir} all-clean
|
||||
COMMENT "[${PROJECT_NAME}] Cleaning all up (all-clean in bochs)"
|
||||
)
|
||||
|
||||
add_custom_target( bochs
|
||||
COMMAND +make -C ${bochs_src_dir} CXX=\"ag++ -p ${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/core -I${CMAKE_BINARY_DIR}/core --real-instances --Xcompiler\" LIBTOOL=\"/bin/sh ./libtool --tag=CXX\"
|
||||
COMMENT "[${PROJECT_NAME}] Building Bochs"
|
||||
)
|
||||
add_dependencies(bochs fail)
|
||||
|
||||
|
||||
add_custom_target( bochsinstall
|
||||
COMMAND +make -C ${bochs_src_dir} CXX=\"ag++ -p ${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/core -I${CMAKE_BINARY_DIR}/core --real-instances --Xcompiler\" LIBTOOL=\"/bin/sh ./libtool --tag=CXX\" install
|
||||
COMMENT "[${PROJECT_NAME}] Installing Bochs..."
|
||||
)
|
||||
|
||||
add_custom_target( bochsuninstall
|
||||
COMMAND +make -C ${bochs_src_dir} uninstall
|
||||
COMMENT "[${PROJECT_NAME}] Uninstalling Bochs..."
|
||||
)
|
||||
|
||||
endif(BUILD_BOCHS)
|
||||
|
||||
19
cmake/config_failbochs.sh.in
Executable file
19
cmake/config_failbochs.sh.in
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
SOURCE_DIR=@CMAKE_SOURCE_DIR@
|
||||
BINARY_DIR=@CMAKE_BINARY_DIR@
|
||||
PREFIX_DIR=@BOCHS_PREFIX_DIR@
|
||||
|
||||
if [ ! -d "$SOURCE_DIR" ]; then
|
||||
echo Source directory does not exists! $SOURCE_DIR
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ ! -d "$PREFIX_DIR" ]; then
|
||||
echo Prefix directory does not exists! $BINARY_DIR
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
||||
./configure CXX="ag++ -p $SOURCE_DIR -I$SOURCE_DIR/core -I"$BINARY_DIR"/core --real-instances --Xcompiler" LIBTOOL="/bin/sh ./libtool --tag=CXX" --prefix=$PREFIX_DIR --enable-{a20-pin,x86-64,cpu-level=6,ne2000,acpi,pci,usb,repeat-speedups,trace-cache,fast-function-calls,host-specific-asms,disasm,all-optimizations,readline,clgd54xx,fpu,vmx=2,monitor-mwait,cdrom,sb16=linux,gdb-stub} --with-all-libs
|
||||
|
||||
30
cmake/mergelib.sh
Executable file
30
cmake/mergelib.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Merge all static (.a) libraries into $LIBFAIL, and avoid .o naming conflicts.
|
||||
#
|
||||
set -e
|
||||
|
||||
LIBFAIL=libfail.a
|
||||
|
||||
cd "$1"
|
||||
rm -f $LIBFAIL
|
||||
ar rc $LIBFAIL
|
||||
|
||||
for lib in *.a
|
||||
do
|
||||
[ "$lib" = "$LIBFAIL" ] && continue
|
||||
|
||||
echo "[FAIL*] Unpacking/merging: $lib ";
|
||||
# unpack .o files to cwd
|
||||
ar x "$lib"
|
||||
|
||||
# make sure the .o file names are unique
|
||||
for f in *.o
|
||||
do
|
||||
mv $f ${lib}_$f
|
||||
done
|
||||
|
||||
# move into merged library
|
||||
ar r $LIBFAIL *.o
|
||||
rm -f *.o
|
||||
done
|
||||
Reference in New Issue
Block a user