1
0
mirror of https://github.com/kakwa/uts-server synced 2025-01-10 05:34:29 +01:00

add some dynamic optional linkage for FreeBSD on gcc_s

This commit is contained in:
kakwa 2017-01-29 17:44:45 +01:00
parent 4abe7a0f3d
commit e701cd7211
2 changed files with 10 additions and 7 deletions

View File

@ -10,6 +10,7 @@ option(BUNDLE_CIVETWEB "bundle civetweb with uts-server" OFF)
option(STATIC "static linked binary" OFF) option(STATIC "static linked binary" OFF)
option(LINKDL "dynamicaly link dl" OFF) option(LINKDL "dynamicaly link dl" OFF)
option(LINKDL "dynamicaly link gcc_s" OFF)
IF(STATIC) IF(STATIC)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
@ -24,6 +25,10 @@ IF(LINK_DL)
set(DL_LIBRARIES 'dl') set(DL_LIBRARIES 'dl')
ENDIF(LINK_DL) ENDIF(LINK_DL)
IF(LINK_GCC_S)
set(GCC_S_LIBRARIES 'gcc_s')
ENDIF(LINK_GCC_S)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700")
if(DEBUG) if(DEBUG)
@ -104,6 +109,7 @@ target_link_libraries(uts-server
${LIBCIVETWEB_LIBRARIES} ${LIBCIVETWEB_LIBRARIES}
${ARGP_LIBRARIES} ${ARGP_LIBRARIES}
${DL_LIBRARIES} ${DL_LIBRARIES}
${GCC_S_LIBRARIES}
) )
INSTALL(TARGETS uts-server INSTALL(TARGETS uts-server

View File

@ -38,11 +38,8 @@ uts-server is compiled using cmake:
$ make $ make
# Compile statically # Compile statically
$ cmake . -DSTATIC=ON # (in some cases, it might be necessary to still
$ make # link some libraries like dl or gcc_s, if necessary,
# add -DDL_LINK=ON and/or -DGCC_S_LINK=ON)
# Sometimes it might be necessary to link against glibc/dl. $ cmake . -DSTATIC=ON # -DDL_LINK=ON -DGCC_S_LINK=ON
# In that case, the resulting binary is only partially static,
# but it's not possible to do better than that.
$ cmake . -DSTATIC=ON -DLINK_DL=ON
$ make $ make