nv_pair_list_last: remove unused function
[oweals/opkg-lede.git] / CMakeLists.txt
index e657f54..30a5d44 100644 (file)
@@ -5,9 +5,12 @@ PROJECT(opkg C)
 SET(HOST_CPU "" CACHE STRING "Override Host CPU")
 SET(BUILD_CPU "" CACHE STRING "Override Host CPU")
 SET(LOCK_FILE "/var/lock/opkg.lock" CACHE STRING "Override lock file path")
+SET(PATH_SPEC "/usr/sbin:/usr/bin:/sbin:/bin" CACHE STRING "Override default PATH value")
+SET(VERSION "" CACHE STRING "Override version")
 
 OPTION(STATIC_UBOX "Statically link libubox" OFF)
 OPTION(BUILD_TESTS "Build test programs" ON)
+OPTION(ENABLE_USIGN "Enable usign support" ON)
 
 IF(NOT HOST_CPU)
        SET(HOST_CPU "${CMAKE_HOST_SYSTEM_PROCESSOR}")
@@ -17,13 +20,15 @@ IF(NOT BUILD_CPU)
        SET(BUILD_CPU "${CMAKE_SYSTEM_PROCESSOR}")
 ENDIF()
 
-EXECUTE_PROCESS(COMMAND git log -1 "--format=%h (%ci)"
-       OUTPUT_VARIABLE GIT_VERSION
-       OUTPUT_STRIP_TRAILING_WHITESPACE
-)
+IF(NOT VERSION)
+       EXECUTE_PROCESS(COMMAND git log -1 "--format=%h (%ci)"
+               OUTPUT_VARIABLE VERSION
+               OUTPUT_STRIP_TRAILING_WHITESPACE
+       )
+ENDIF()
 
-IF(NOT GIT_VERSION)
-       SET(GIT_VERSION "unknown")
+IF(NOT VERSION)
+       SET(VERSION "unknown")
 ENDIF()
 
 ADD_DEFINITIONS(-Os -Wall --std=gnu99 -g3 -Wmissing-declarations
@@ -33,10 +38,14 @@ ADD_DEFINITIONS(-Os -Wall --std=gnu99 -g3 -Wmissing-declarations
        -DOPKGLIBDIR="/usr/lib"
        -DHOST_CPU_STR="${HOST_CPU}"
        -DBUILD_CPU=${BUILD_CPU}
-       -DVERSION="${GIT_VERSION}"
-       -DHAVE_SHA256
+       -DPATH_SPEC="${PATH_SPEC}"
+       -DVERSION="${VERSION}"
 )
 
+IF(ENABLE_USIGN)
+       ADD_DEFINITIONS(-DHAVE_USIGN)
+ENDIF()
+
 ADD_SUBDIRECTORY(libbb)
 ADD_SUBDIRECTORY(libopkg)
 ADD_SUBDIRECTORY(src)