From 9d3a151310ac35c928534b734a1537637fcfd84b Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Wed, 19 Apr 2017 22:41:03 +0200 Subject: [PATCH 1/4] Use _DEFAULT_SOURCE insted of the deprecated _BSD_SOURCE --- src/CMakeModules/BaseConfig.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeModules/BaseConfig.cmake b/src/CMakeModules/BaseConfig.cmake index 467caf1..d521960 100644 --- a/src/CMakeModules/BaseConfig.cmake +++ b/src/CMakeModules/BaseConfig.cmake @@ -8,9 +8,9 @@ if (CMAKE_COMPILER_IS_GNUCC) if(APPLE) # Newer versions of OSX will spew a bunch of warnings about deprecated ssl functions, # this should be addressed at some point in time, but for now, just ignore them. - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE -Wno-deprecated-declarations") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_DEFAULT_SOURCE -Wno-deprecated-declarations") elseif(UNIX) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE -D_POSIX_C_SOURCE=200112") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112") endif(APPLE) endif(CMAKE_COMPILER_IS_GNUCC) From 6fb40ee2b95041829b088d2156cd6664cbcd4292 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Wed, 19 Apr 2017 22:50:39 +0200 Subject: [PATCH 2/4] Use pkgconfig to find system luajit --- src/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5f104f4..9b3fd34 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,8 +82,7 @@ endif() set (DEPS_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../deps") include_directories(${DEPS_SOURCE_DIR}) -set (LUAJIT_INCLUDE_DIR ${DEPS_SOURCE_DIR}/LuaJIT-2.0.3/src) -set (LUAJIT_LIBRARIES ${DEPS_SOURCE_DIR}/LuaJIT-2.0.3/src/libluajit.a) +pkg_check_modules (LUAJIT luajit lua REQUIRED) #set (ImageMagick_INCLUDE_DIRS "/Users/zippo/develop/linuxc/imagemagick-src") #set (ImageMagick_MagickCore_LIBRARY "/Users/zippo/develop/linuxc/imagemagick-src/magick/.libs/libMagickCore-Q16.a") From 5d4fef57b3a1e17134b43c563da9c326e7d8b2d6 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Wed, 19 Apr 2017 23:24:52 +0200 Subject: [PATCH 3/4] Fix incomplete reference for luaL_Reg --- src/main.c | 2 +- src/zlscale.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index d5637f2..56fede6 100644 --- a/src/main.c +++ b/src/main.c @@ -63,7 +63,7 @@ int main(int argc, char **argv); evbase_t *evbase; -extern const struct luaL_reg zimg_lib[]; +extern const struct luaL_Reg zimg_lib[]; extern const struct luaL_Reg loglib[]; const char *conf_file = NULL; diff --git a/src/zlscale.c b/src/zlscale.c index c547cf4..651d59e 100644 --- a/src/zlscale.c +++ b/src/zlscale.c @@ -150,7 +150,7 @@ static int zimg_ret(lua_State *L) return 0; } -const struct luaL_reg zimg_lib[] = { +const struct luaL_Reg zimg_lib[] = { //{"__gc", destroy_wi_image }, {"cols", get_wi_cols }, {"rows", get_wi_rows }, From ec5a8159440b971ac4728052c5b47fa69f0586da Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Wed, 19 Apr 2017 23:25:58 +0200 Subject: [PATCH 4/4] Disable weird link directories --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9b3fd34..04a2e32 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -148,7 +148,6 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wno-unused-function -Wno-deprecat message("Build Type: ${CMAKE_BUILD_TYPE}") message("Std CFLAGS: ${CMAKE_C_FLAGS}") -link_directories("/usr/lib" "/usr/local/lib") add_executable(zimg ${SOURCES}) target_link_libraries(zimg ${ZIMG_EXTERNAL_LIBS})