X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=CMakeLists.txt;h=cf7ee96ef5da97ffec7e8213a5106c8807e7843a;hp=a6f12719c6c1c5d2c797f39cdf46333f8320186c;hb=73805dcc03e242fe5e25c9764ed33456acebdb95;hpb=7b63363c22a62e14d05f41c418b98fe4b45db9c3 diff --git a/CMakeLists.txt b/CMakeLists.txt index a6f1271..cf7ee96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 2.6) PROJECT(firewall3 C) ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations) +SET(iptc_libs ip4tc) + SET(sed_match "^[[:space:]]*__ipt_module(\\(.*\\)).*") SET(sed_replace "-Wl,--undefined=libxt_\\1_init -Wl,--undefined=libipt_\\1_init -Wl,--undefined=libip6t_\\1_init") @@ -24,14 +26,19 @@ IF (EXISTS "${CMAKE_SOURCE_DIR}/libext4.a") LIST(APPEND ext_libs ext4) ENDIF() -IF (EXISTS "${CMAKE_SOURCE_DIR}/libext6.a") - ADD_LIBRARY(ext6 STATIC IMPORTED) - SET_PROPERTY(TARGET ext6 PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libext6.a") - LIST(APPEND ext_libs ext6) +IF (NOT DISABLE_IPV6) + IF (EXISTS "${CMAKE_SOURCE_DIR}/libext6.a") + ADD_LIBRARY(ext6 STATIC IMPORTED) + SET_PROPERTY(TARGET ext6 PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libext6.a") + LIST(APPEND ext_libs ext6) + ENDIF() + LIST(APPEND iptc_libs ip6tc) +ELSE() + ADD_DEFINITIONS(-DDISABLE_IPV6) ENDIF() ADD_EXECUTABLE(firewall3 main.c options.c defaults.c zones.c forwards.c rules.c redirects.c utils.c ubus.c ipsets.c includes.c iptables.c) -TARGET_LINK_LIBRARIES(firewall3 uci ubox ubus ip4tc ip6tc xtables m ${ext_libs}) +TARGET_LINK_LIBRARIES(firewall3 uci ubox ubus xtables m ${iptc_libs} ${ext_libs}) SET(CMAKE_INSTALL_PREFIX /usr)