Skip to content

Commit

Permalink
Modernize build
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Zemek committed Oct 27, 2018
2 parents ad5e3db + 478364d commit 124c939
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 224 deletions.
40 changes: 15 additions & 25 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
# Ignore libtoolize artifacts
ltmain.sh
m4/

# Ignore autoreconf artifacts
/autom4te.cache
/autoconf
aclocal.m4
autom4te.cache/
configure
Makefile.in

# Ignore automake --add-missing artifacts
ar-lib
compile
config.guess
config.sub
install-sh
missing
depcomp
*.o
*.lo
*.a
*.la
.dirstamp
*.pc

# Ignore configure artifacts
Makefile
.deps
.libs

Makefile.in
configure
config.log
config.status
libtool
.deps/
Makefile

# Ignore make artifacts
*.o
*.lo
*.la
.libs
src/hqx
/hqx
321 changes: 162 additions & 159 deletions INSTALL

Large diffs are not rendered by default.

24 changes: 22 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
ACLOCAL_AMFLAGS = -I m4
ACLOCAL_AMFLAGS = -I autoconf/m4

SUBDIRS = src
pkgconfigdir = ${libdir}/pkgconfig
pkgconfig_DATA = hqx.pc

EXTRA_DIST = README.md

bin_PROGRAMS = hqx
lib_LTLIBRARIES = libhqx.la

libhqx_la_SOURCES = \
src/init.c \
src/hq2x.c \
src/hq3x.c \
src/hq4x.c \
src/common.h
libhqx_la_LDFLAGS = -no-undefined -version-info @HQX_LTVERSION@

include_HEADERS = src/hqx.h

hqx_SOURCES = src/hqx.c
hqx_CFLAGS = $(IL_CFLAGS) -I.
hqx_LDADD = libhqx.la $(IL_LIBS)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hqx ("hq" stands for "high quality" and "x" stands for magnification) is one of
autoreconf -vi

# Install
NOTE: DevIL library and development headers are required.
NOTE: [DevIL](http://openil.sf.net/) library and development headers are required.

./configure
make && make install
Expand Down
43 changes: 19 additions & 24 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
AC_INIT([hqx], [1.0], [grom@zeminvaders.net])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
AC_INIT([hqx], [1.2], [https://github.com/grom358/hqx/issues],
[hqx], [https://github.com/grom358/hqx])
AC_CONFIG_AUX_DIR([autoconf])
AC_CONFIG_MACRO_DIR([autoconf/m4])
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects -Wall])
AM_SILENT_RULES([yes])

AC_LANG([C])
AC_PROG_CPP
AC_PROG_CC
AM_PROG_AR
AC_C_INLINE
AC_C_BIGENDIAN
AM_INIT_AUTOMAKE([-Wall -Werror])
AM_PROG_CC_C_O
AM_PROG_AR

AC_CHECK_HEADER([IL/il.h],,AC_MSG_ERROR("DevIL il.h required"))

AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Compile a debug version of the library])],
[CFLAGS="-Wall -g -O0"],
[CFLAGS="-O3"])

AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
LT_INIT([win32-dll])
HQX_LTVERSION=1:0:0
AC_SUBST([HQX_LTVERSION])

dnl Win32
AS_CASE([$host],
[*mingw32*], [PLATFORM="MINGW32"],
[*cygwin*], [PLATFORM="CYGWIN"],
[*darwin*], [PLATFORM="OSX"])
AC_SUBST([PLATFORM])
PKG_CHECK_MODULES([IL], [IL], ,
AC_MSG_ERROR([DevIL (http://openil.sf.net) is required.]))

AM_CONDITIONAL([WINDOWS_BUILD],
[test "x$PLATFORM" = "xMINGW32" -o "x$PLATFORM" = "xCYGWIN"])
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [Compile a debug version of the library]))
AS_IF([test "x$enable_debug" = "xyes"],
[CFLAGS="-Wall -g -O0"],
[CFLAGS="-O3"])

AC_CONFIG_FILES([Makefile src/Makefile])
AC_CONFIG_FILES([Makefile hqx.pc])
AC_OUTPUT
12 changes: 12 additions & 0 deletions hqx.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@

Name: @PACKAGE_TARNAME@
Description: Fast, high-quality magnification filter designed for pixel art
Version: @PACKAGE_VERSION@
URL: @PACKAGE_URL@
Requires.private: IL
Cflags: -I${includedir}
Libs: -L${libdir} -lhqx
12 changes: 0 additions & 12 deletions src/Makefile.am

This file was deleted.

2 changes: 1 addition & 1 deletion src/hqx.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include <hqx.h>
#include "hqx.h"
#include <IL/il.h>

static inline uint32_t swapByteOrder(uint32_t ui)
Expand Down

0 comments on commit 124c939

Please sign in to comment.