Skip to content

Commit

Permalink
Add build system for Unix
Browse files Browse the repository at this point in the history
  • Loading branch information
cantabile committed Nov 4, 2014
1 parent 7cb2cd3 commit 5c4d81f
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Expand Up @@ -11,3 +11,26 @@ Resize/Release/
x64/
Debug/
Release/
*.o
*.la
*.lo
*.so
*.dll
.libs
.deps/
.dirstamp
Makefile
Makefile.in
aclocal.m4
autom4te.cache
compile
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
68 changes: 68 additions & 0 deletions Makefile.am
@@ -0,0 +1,68 @@
commonflags = -O2 -Wall -Wextra -Wno-unused-parameter
AM_CXXFLAGS = -std=c++11 $(commonflags)
AM_CFLAGS = $(commonflags)

lib_LTLIBRARIES = libzimg.la

pkglib_LTLIBRARIES = vszimg.la

libzimg_la_SOURCES = API/zimg.cpp \
Colorspace/colorspace.cpp \
Colorspace/colorspace_param.cpp \
Colorspace/graph.cpp \
Colorspace/matrix3.cpp \
Colorspace/operation.cpp \
Colorspace/operation_impl.cpp \
Depth/depth_convert.cpp \
Depth/depth.cpp \
Depth/dither.cpp \
Depth/dither_impl.cpp \
Depth/error_diffusion.cpp \
Resize/filter.cpp \
Resize/resize.cpp \
Resize/resize_impl.cpp

include_HEADERS = API/zimg.h \
API/zimg++.hpp


libzimg_la_LDFLAGS = -no-undefined -version-info 0


vszimg_la_SOURCES = vszimg/vszimg.c

vszimg_la_CFLAGS = $(AM_CFLAGS) -IAPI

vszimg_la_LIBADD = libzimg.la

vszimg_la_LDFLAGS = -no-undefined -avoid-version -module

vszimg_la_LIBTOOLFLAGS = --tag=disable-static


if X86SIMD
noinst_LTLIBRARIES = libsse2.la libavx2.la libf16c.la

libzimg_la_SOURCES += Colorspace/operation_impl_x86.cpp \
Resize/resize_impl_x86.cpp


libsse2_la_SOURCES = Colorspace/operation_impl_sse2.cpp \
Resize/resize_impl_sse2.cpp

libsse2_la_CXXFLAGS = $(AM_CXXFLAGS) -msse2


libavx2_la_SOURCES = Colorspace/operation_impl_avx2.cpp \
Resize/resize_impl_avx2.cpp

libavx2_la_CXXFLAGS = $(AM_CXXFLAGS) -mavx2 -mfma -mf16c


libf16c_la_SOURCES = Colorspace/operation_impl_f16c.cpp

libf16c_la_CXXFLAGS = $(AM_CXXFLAGS) -mf16c


libzimg_la_LIBADD = libsse2.la libavx2.la libf16c.la
endif
3 changes: 3 additions & 0 deletions autogen.sh
@@ -0,0 +1,3 @@
#!/bin/sh

autoreconf --verbose --install --force
46 changes: 46 additions & 0 deletions configure.ac
@@ -0,0 +1,46 @@
AC_INIT([zimg], [1], [https://github.com/sekrit-twc/zimg/pulls], [zimg], [https://github.com/sekrit-twc/zimg])

AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz subdir-objects no-define])
AM_SILENT_RULES([yes])

LT_INIT([win32-dll])

AC_PROG_CXX

AC_CANONICAL_HOST


AC_ARG_ENABLE([x86simd], AS_HELP_STRING([--enable-x86simd], [Enable optimisations for x86 CPUs.]))

AS_IF([test "x$enable_x86simd" = "xyes"], [AC_DEFINE([ZIMG_X86])])

AM_CONDITIONAL([X86SIMD], [test "x$enable_x86simd" = "xyes"])


AS_CASE(
[$host_cpu],
[i?86], [BITS="32"],
[x86_64], [BITS="64"],
[AS_IF([test "x$enable_x86simd" = "xyes"], [AC_MSG_ERROR([--enable_x86simd was passed but host CPU type is not x86.])])]
)

AS_CASE(
[$host_os],
[cygwin*],
[
AS_IF(
[test "x$BITS" = "x32"],
[LDFLAGS="-Wl,--kill-at"]
)
],
[mingw*],
[
AS_IF(
[test "x$BITS" = "x32"],
[LDFLAGS="-Wl,--kill-at"]
)
]
)

AC_CONFIG_FILES([Makefile])
AC_OUTPUT

0 comments on commit 5c4d81f

Please sign in to comment.