Skip to content

Commit

Permalink
Merge pull request #3 from proski/devel
Browse files Browse the repository at this point in the history
Big autotools clreanup, pkg-config support
  • Loading branch information
jsorg71 committed Oct 23, 2016
2 parents 845ee8c + f409b06 commit 2a90952
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 60 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Makefile.in
missing
NEWS
*.o
*.pc
README
stamp-h1
rfxcodectest
Expand Down
7 changes: 7 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = rfxcodec.pc

EXTRA_DIST = bootstrap readme.txt

SUBDIRS = \
src \
tests

include_HEADERS = \
include/rfxcodec_encode.h \
include/rfxcodec_decode.h \
include/rfxcodec_common.h
4 changes: 0 additions & 4 deletions bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,4 @@ then
fi

touch configure.ac
touch NEWS
touch AUTHORS
touch README
touch ChangeLog
autoreconf -fvi
8 changes: 2 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ AC_PROG_CC
AC_C_CONST
AC_PROG_LIBTOOL

AM_CONDITIONAL(GOT_PREFIX, test "x${prefix}" != "xNONE"])

if test "x${prefix}" = "xNONE" ; then
sysconfdir="/etc";
fi

# SIMD is optional
AC_ARG_WITH([simd],
AC_HELP_STRING([--without-simd],[Omit SIMD extensions.]))
Expand Down Expand Up @@ -49,6 +43,8 @@ AM_CONDITIONAL(WITH_SIMD_X86, [test x$simd_arch = xi386])
AC_CONFIG_FILES([Makefile
src/Makefile
tests/Makefile
rfxcodec.pc
rfxcodec-uninstalled.pc
])

AC_OUTPUT
Expand Down
5 changes: 5 additions & 0 deletions rfxcodec-uninstalled.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Name: rfxcodec
Description: Fast jpeg2000 codec compatible with MS RDP servers and xrdp
Version: @PACKAGE_VERSION@
Cflags: -I${pc_top_builddir}/${pcfiledir}/include
Libs: ${pc_top_builddir}/${pcfiledir}/src/librfxencode.la
10 changes: 10 additions & 0 deletions rfxcodec.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: rfxcodec
Description: Fast jpeg2000 codec compatible with MS RDP servers and xrdp
Version: @PACKAGE_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lrfxencode
68 changes: 35 additions & 33 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
EXTRA_DIST =
EXTRA_DIST = $(AMD64_ASM) $(X86_ASM) nasm_lt.sh

EXTRA_DEFINES =
EXTRA_INCLUDES =
EXTRA_LIBS =
EXTRA_FLAGS =
EXTRA_SRC =
EXTRA_ENCODE_SRC =

if WITH_SIMD_AMD64
EXTRA_ENCODE_SRC += amd64/cpuid_amd64.asm \
AMD64_ASM = \
amd64/cpuid_amd64.asm \
amd64/rfxcodec_encode_diff_rlgr1_amd64_sse2.asm \
amd64/rfxcodec_encode_diff_rlgr3_amd64_sse2.asm \
amd64/rfxcodec_encode_dwt_shift_amd64_sse2.asm \
amd64/rfxcodec_encode_dwt_shift_amd64_sse41.asm
EXTRA_DEFINES += -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_AMD64=1
endif

if WITH_SIMD_X86
EXTRA_ENCODE_SRC += x86/cpuid_x86.asm \
X86_ASM = \
x86/cpuid_x86.asm \
x86/rfxcodec_encode_diff_rlgr1_x86_sse2.asm \
x86/rfxcodec_encode_diff_rlgr3_x86_sse2.asm \
x86/rfxcodec_encode_dwt_shift_x86_sse2.asm \
x86/rfxcodec_encode_dwt_shift_x86_sse41.asm
EXTRA_DEFINES += -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_X86=1
endif

if GOT_PREFIX
EXTRA_INCLUDES += -I$(prefix)/include
EXTRA_FLAGS += -L$(prefix)/lib -Wl,-rpath -Wl,$(prefix)/lib
endif

AM_CFLAGS = -I../include $(EXTRA_DEFINES)
ASM_SOURCES =

INCLUDES = $(EXTRA_INCLUDES)
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I../include

lib_LTLIBRARIES = librfxencode.la
if WITH_SIMD_AMD64
ASM_SOURCES += $(AMD64_ASM)
AM_CPPFLAGS += -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_AMD64=1
endif

librfxencode_la_LDFLAGS = $(EXTRA_FLAGS)
if WITH_SIMD_X86
ASM_SOURCES += $(X86_ASM)
AM_CPPFLAGS += -DSIMD_USE_ACCEL=1 -DRFX_USE_ACCEL_X86=1
endif

noinst_HEADERS = \
rfx_bitstream.h \
rfxcommon.h \
rfxcompose.h \
rfxconstants.h \
rfxencode_alpha.h \
rfxencode_differential.h \
rfxencode_dwt.h \
rfxencode.h \
rfxencode_quantization.h \
rfxencode_rlgr1.h \
rfxencode_rlgr3.h \
rfxencode_tile.h \
amd64/funcs_amd64.h \
x86/funcs_x86.h

librfxencode_ladir = $(moduledir)
lib_LTLIBRARIES = librfxencode.la

librfxencode_la_SOURCES = rfxencode.c \
librfxencode_la_SOURCES = $(noinst_HEADERS) rfxencode.c \
rfxcompose.c rfxencode_tile.c rfxencode_dwt.c \
rfxencode_quantization.c rfxencode_differential.c \
rfxencode_rlgr1.c rfxencode_rlgr3.c rfxencode_alpha.c $(EXTRA_ENCODE_SRC)
rfxencode_rlgr1.c rfxencode_rlgr3.c rfxencode_alpha.c $(ASM_SOURCES)

.asm.lo:
$(LIBTOOL) --mode=compile --tag NASM $(srcdir)/nasm_lt.sh $(NASM) $(NAFLAGS) -I$(srcdir) -I. $< -o $@

librfxencode_la_LIBADD =

include_HEADERS = ../include/rfxcodec_encode.h

20 changes: 3 additions & 17 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@

EXTRA_DIST = readme.txt

EXTRA_INCLUDES =
EXTRA_LIBS =
EXTRA_FLAGS =

if GOT_PREFIX
EXTRA_INCLUDES += -I$(prefix)/include
EXTRA_FLAGS += -L$(prefix)/lib -Wl,-rpath -Wl,$(prefix)/lib
endif

INCLUDES = \
-I$(top_srcdir)/include \
$(EXTRA_INCLUDES)
AM_CPPFLAGS = \
-I$(top_srcdir)/include

bin_PROGRAMS = rfxcodectest

rfxcodectest_SOURCES = rfxcodectest.c

rfxcodectest_LDADD = \
$(top_builddir)/src/librfxencode.la $(EXTRA_LIBS)

rfxcodectest_LDFLAGS = $(EXTRA_FLAGS)

$(top_builddir)/src/librfxencode.la

0 comments on commit 2a90952

Please sign in to comment.