2020-05-06 18:40:06 +03:00
|
|
|
set(LIBC_SOURCES
|
|
|
|
arpa/inet.cpp
|
|
|
|
assert.cpp
|
2020-10-17 14:39:36 +03:00
|
|
|
crt0_shared.cpp
|
2020-05-06 18:40:06 +03:00
|
|
|
ctype.cpp
|
2020-05-20 15:23:31 +03:00
|
|
|
cxxabi.cpp
|
2020-05-06 18:40:06 +03:00
|
|
|
dirent.cpp
|
|
|
|
dlfcn.cpp
|
|
|
|
fcntl.cpp
|
|
|
|
getopt.cpp
|
|
|
|
grp.cpp
|
|
|
|
ioctl.cpp
|
|
|
|
libcinit.cpp
|
|
|
|
libgen.cpp
|
|
|
|
locale.cpp
|
|
|
|
malloc.cpp
|
|
|
|
mman.cpp
|
|
|
|
mntent.cpp
|
|
|
|
netdb.cpp
|
|
|
|
poll.cpp
|
|
|
|
pwd.cpp
|
|
|
|
qsort.cpp
|
|
|
|
scanf.cpp
|
|
|
|
sched.cpp
|
|
|
|
serenity.cpp
|
|
|
|
setjmp.S
|
|
|
|
signal.cpp
|
2020-06-16 04:36:08 +03:00
|
|
|
spawn.cpp
|
2020-05-06 18:40:06 +03:00
|
|
|
stat.cpp
|
|
|
|
stdio.cpp
|
|
|
|
stdlib.cpp
|
|
|
|
string.cpp
|
|
|
|
strings.cpp
|
|
|
|
syslog.cpp
|
|
|
|
sys/ptrace.cpp
|
|
|
|
sys/select.cpp
|
|
|
|
sys/socket.cpp
|
|
|
|
sys/uio.cpp
|
|
|
|
sys/wait.cpp
|
|
|
|
termcap.cpp
|
|
|
|
termios.cpp
|
|
|
|
time.cpp
|
|
|
|
times.cpp
|
|
|
|
ulimit.cpp
|
|
|
|
unistd.cpp
|
|
|
|
utime.cpp
|
|
|
|
utsname.cpp
|
|
|
|
wchar.cpp
|
|
|
|
)
|
|
|
|
|
2020-10-28 22:01:29 +03:00
|
|
|
file(GLOB AK_SOURCES CONFIGURE_DEPENDS "../../AK/*.cpp")
|
|
|
|
file(GLOB ELF_SOURCES CONFIGURE_DEPENDS "../LibELF/*.cpp")
|
2020-05-06 18:40:06 +03:00
|
|
|
set(ELF_SOURCES ${ELF_SOURCES} ../LibELF/Arch/i386/plt_trampoline.S)
|
|
|
|
|
2020-09-01 12:59:55 +03:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -DSERENITY_LIBC_BUILD")
|
2020-05-20 15:23:31 +03:00
|
|
|
|
2020-07-09 00:57:51 +03:00
|
|
|
find_program(INSTALL_COMMAND ginstall)
|
|
|
|
if(NOT INSTALL_COMMAND)
|
|
|
|
set(INSTALL_COMMAND install)
|
|
|
|
endif()
|
|
|
|
|
2020-05-06 18:40:06 +03:00
|
|
|
add_library(crt0 STATIC crt0.cpp)
|
|
|
|
add_custom_command(
|
|
|
|
TARGET crt0
|
2020-07-09 00:57:51 +03:00
|
|
|
COMMAND ${INSTALL_COMMAND} -D $<TARGET_OBJECTS:crt0> ${CMAKE_INSTALL_PREFIX}/usr/lib/crt0.o
|
2020-05-06 18:40:06 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
set(SOURCES ${LIBC_SOURCES} ${AK_SOURCES} ${ELF_SOURCES})
|
2020-11-13 15:47:00 +03:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
|
2020-05-06 18:40:06 +03:00
|
|
|
serenity_libc(LibC c)
|
|
|
|
target_link_libraries(LibC crt0)
|
2020-05-20 15:23:31 +03:00
|
|
|
add_dependencies(LibC LibM)
|