Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Commit

Permalink
Fixed build system and fixed some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
kayahr committed Jan 2, 2012
1 parent 476dee6 commit eed4316
Show file tree
Hide file tree
Showing 36 changed files with 55 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
@@ -1,2 +1,2 @@
SUBDIRS = src
#ACLOCAL_AMFLAGS = -I m4
ACLOCAL_AMFLAGS = -I m4
6 changes: 3 additions & 3 deletions Makefile.scm
@@ -1,6 +1,6 @@
all:
autoreconf --install --force
mkdir -p m4
autoreconf --install --force -I m4

clean:
hg status -in | xargs -r rm -rf
find -type d -empty -print | xargs -r rmdir
rm -rf $$(cat .gitignore)
8 changes: 6 additions & 2 deletions config.h
Expand Up @@ -10,6 +10,9 @@
/* Authors email address */
#define EMAIL "k@ailis.de"

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you have the <gd.h> header file. */
#define HAVE_GD_H 1

Expand Down Expand Up @@ -52,8 +55,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define to 1 if you have the <wasteland.h> header file. */
#define HAVE_WASTELAND_H 1
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"

/* Name of package */
#define PACKAGE "wlsuite"
Expand Down
6 changes: 4 additions & 2 deletions configure.ac
@@ -1,13 +1,14 @@
AC_PREREQ([2.65])
AC_PREREQ([2.50])
AC_INIT([wlsuite], [0.1], [k@ailis.de])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])

AC_LANG_C
AM_PROG_LIBTOOL

AC_CHECK_HEADERS(gd.h,,echo "ERROR: gd.h not found"; exit 1;)
AC_CHECK_LIB(gd,gdImageCreate,,echo "ERROR: GD library not found"; exit 1;)
AC_CHECK_HEADERS(wasteland.h,,echo "ERROR: wasteland.h not found"; exit 1;)
AC_CHECK_HEADERS(kaytils/str.h,,echo "ERROR: kaytils/str.h not found"; exit 1;)
AC_CHECK_HEADERS(kaytils/list.h,,echo "ERROR: kaytils/list.h not found"; exit 1;)
AC_CHECK_LIB(kaytils,strCreate,,echo "ERROR: kaytils library not found"; exit 1;)
Expand All @@ -19,6 +20,7 @@ AC_DEFINE(COPYRIGHT,"Copyright (C) 2010 Klaus Reimer <k@ailis.de>",Copyright me
AC_CONFIG_FILES(
Makefile
src/Makefile
src/libwasteland/Makefile
src/decodehuffman/Makefile
src/encodehuffman/Makefile
src/decodepic/Makefile
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile.am
@@ -1,4 +1,5 @@
SUBDIRS = \
libwasteland \
decodehuffman \
encodehuffman \
decodepic \
Expand All @@ -14,4 +15,4 @@ SUBDIRS = \
decodecpa \
unpacktiles \
unpackpics

2 changes: 1 addition & 1 deletion src/decodecpa/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_decodecpa
wl_decodecpa_LDADD = -lwasteland
wl_decodecpa_LDADD = ../libwasteland/libwasteland.la
wl_decodecpa_SOURCES = \
decodecpa.c

Expand Down
2 changes: 1 addition & 1 deletion src/decodecpa/decodecpa.c
Expand Up @@ -14,7 +14,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"

#ifdef WIN32
Expand Down
2 changes: 1 addition & 1 deletion src/decodehuffman/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_decodehuffman
wl_decodehuffman_LDADD = -lwasteland
wl_decodehuffman_LDADD = ../libwasteland/libwasteland.la
wl_decodehuffman_SOURCES = \
decodehuffman.c

Expand Down
2 changes: 1 addition & 1 deletion src/decodehuffman/decodehuffman.c
Expand Up @@ -12,7 +12,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"

/** The maximum number of bytes to read. 0 = Infinite */
Expand Down
2 changes: 1 addition & 1 deletion src/decodepic/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_decodepic
wl_decodepic_LDADD = -lwasteland
wl_decodepic_LDADD = ../libwasteland/libwasteland.la
wl_decodepic_SOURCES = \
decodepic.c

Expand Down
2 changes: 1 addition & 1 deletion src/decodepic/decodepic.c
Expand Up @@ -11,7 +11,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"


Expand Down
2 changes: 1 addition & 1 deletion src/encodehuffman/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_encodehuffman
wl_encodehuffman_LDADD = -lwasteland
wl_encodehuffman_LDADD = ../libwasteland/libwasteland.la
wl_encodehuffman_SOURCES = \
encodehuffman.c

Expand Down
2 changes: 1 addition & 1 deletion src/encodehuffman/encodehuffman.c
Expand Up @@ -12,7 +12,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"


Expand Down
2 changes: 1 addition & 1 deletion src/encodepic/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_encodepic
wl_encodepic_LDADD = -lwasteland
wl_encodepic_LDADD = ../libwasteland/libwasteland.la
wl_encodepic_SOURCES = \
encodepic.c

Expand Down
5 changes: 2 additions & 3 deletions src/encodepic/encodepic.c
Expand Up @@ -11,7 +11,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"


Expand Down Expand Up @@ -115,14 +115,13 @@ static void writePic(char *filename, gdImagePtr image)
{
gdImagePtr output;
int x, y, i;
int palette[16];
wlImage pic;

/* Create a temporary second image for palette conversion */
output = gdImageCreate(288, 128);
for (i = 0; i < 16; i++)
{
palette[i] = gdImageColorAllocate(output, wlPalette[i].red,
gdImageColorAllocate(output, wlPalette[i].red,
wlPalette[i].green, wlPalette[i].blue);
}
for (i = 16; i < 256; i++) gdImageColorAllocate(output, 0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/libwasteland/huffman.c
Expand Up @@ -362,7 +362,7 @@ void wlHuffmanDumpNode(wlHuffmanNode *node, int indent)
}
else
{
printf(spaces);
printf("%s", spaces);
if (node->keyBits <= 0 || node->keyBits > 16)
{
printf("Invalid keybits on payload node!!!!");
Expand Down
2 changes: 1 addition & 1 deletion src/packcpa/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_packcpa
wl_packcpa_LDADD = -lwasteland
wl_packcpa_LDADD = ../libwasteland/libwasteland.la
wl_packcpa_SOURCES = \
packcpa.c

Expand Down
2 changes: 1 addition & 1 deletion src/packcpa/packcpa.c
Expand Up @@ -13,7 +13,7 @@
#include <gd.h>
#include <errno.h>
#include <dirent.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include <kaytils/str.h>
#include <kaytils/list.h>
#include "config.h"
Expand Down
2 changes: 1 addition & 1 deletion src/packcursors/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_packcursors
wl_packcursors_LDADD = -lwasteland
wl_packcursors_LDADD = ../libwasteland/libwasteland.la
wl_packcursors_SOURCES = \
packcursors.c

Expand Down
6 changes: 3 additions & 3 deletions src/packcursors/packcursors.c
Expand Up @@ -13,7 +13,7 @@
#include <gd.h>
#include <errno.h>
#include <dirent.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include <kaytils/str.h>
#include <kaytils/list.h>
#include "config.h"
Expand Down Expand Up @@ -132,13 +132,13 @@ static void storeCursor(wlImages cursors, int index, gdImagePtr image)
{
gdImagePtr output;
int x, y, i;
int palette[16], transparency, color;
int transparency, color;

/* Create a temporary second image for palette conversion */
output = gdImageCreate(16, 16);
for (i = 0; i < 16; i++)
{
palette[i] = gdImageColorAllocate(output, wlPalette[i].red,
gdImageColorAllocate(output, wlPalette[i].red,
wlPalette[i].green, wlPalette[i].blue);
}
transparency = gdImageColorAllocate(output, 0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/packfont/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_packfont
wl_packfont_LDADD = -lwasteland
wl_packfont_LDADD = ../libwasteland/libwasteland.la
wl_packfont_SOURCES = \
packfont.c

Expand Down
6 changes: 3 additions & 3 deletions src/packfont/packfont.c
Expand Up @@ -13,7 +13,7 @@
#include <gd.h>
#include <errno.h>
#include <dirent.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include <kaytils/str.h>
#include <kaytils/list.h>
#include "config.h"
Expand Down Expand Up @@ -132,13 +132,13 @@ static void storeFontGlyph(wlImages font, int index, gdImagePtr image)
{
gdImagePtr output;
int x, y, i;
int palette[16], transparency, color;
int transparency, color;

/* Create a temporary second image for palette conversion */
output = gdImageCreate(8, 8);
for (i = 0; i < 16; i++)
{
palette[i] = gdImageColorAllocate(output, wlPalette[i].red,
gdImageColorAllocate(output, wlPalette[i].red,
wlPalette[i].green, wlPalette[i].blue);
}
transparency = gdImageColorAllocate(output, 0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/packsprites/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_packsprites
wl_packsprites_LDADD = -lwasteland
wl_packsprites_LDADD = ../libwasteland/libwasteland.la
wl_packsprites_SOURCES = \
packsprites.c

Expand Down
6 changes: 3 additions & 3 deletions src/packsprites/packsprites.c
Expand Up @@ -13,7 +13,7 @@
#include <gd.h>
#include <errno.h>
#include <dirent.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include <kaytils/str.h>
#include <kaytils/list.h>
#include "config.h"
Expand Down Expand Up @@ -132,13 +132,13 @@ static void storeSprite(wlImages sprites, int index, gdImagePtr image)
{
gdImagePtr output;
int x, y, i;
int palette[16], transparency;
int transparency;

/* Create a temporary second image for palette conversion */
output = gdImageCreate(16, 16);
for (i = 0; i < 16; i++)
{
palette[i] = gdImageColorAllocate(output, wlPalette[i].red,
gdImageColorAllocate(output, wlPalette[i].red,
wlPalette[i].green, wlPalette[i].blue);
}
transparency = gdImageColorAllocate(output, 0, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/unpackcpa/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_unpackcpa
wl_unpackcpa_LDADD = -lwasteland
wl_unpackcpa_LDADD = ../libwasteland/libwasteland.la
wl_unpackcpa_SOURCES = \
unpackcpa.c

Expand Down
5 changes: 2 additions & 3 deletions src/unpackcpa/unpackcpa.c
Expand Up @@ -14,7 +14,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"

#ifdef WIN32
Expand Down Expand Up @@ -125,13 +125,12 @@ static void writePng(char *filename, wlImage image)
{
gdImagePtr output;
int x, y, i;
int palette[17];
FILE *file;

output = gdImageCreate(288, 128);
for (i = 0; i < 16; i++)
{
palette[i] = gdImageColorAllocate(output, wlPalette[i].red,
gdImageColorAllocate(output, wlPalette[i].red,
wlPalette[i].green, wlPalette[i].blue);
}
for (y = 0; y < 128; y++)
Expand Down
2 changes: 1 addition & 1 deletion src/unpackcursors/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_unpackcursors
wl_unpackcursors_LDADD = -lwasteland
wl_unpackcursors_LDADD = ../libwasteland/libwasteland.la
wl_unpackcursors_SOURCES = \
unpackcursors.c

Expand Down
2 changes: 1 addition & 1 deletion src/unpackcursors/unpackcursors.c
Expand Up @@ -14,7 +14,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"

#ifdef WIN32
Expand Down
2 changes: 1 addition & 1 deletion src/unpackfont/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_unpackfont
wl_unpackfont_LDADD = -lwasteland
wl_unpackfont_LDADD = ../libwasteland/libwasteland.la
wl_unpackfont_SOURCES = \
unpackfont.c

Expand Down
2 changes: 1 addition & 1 deletion src/unpackfont/unpackfont.c
Expand Up @@ -14,7 +14,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"

#ifdef WIN32
Expand Down
2 changes: 1 addition & 1 deletion src/unpackpics/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_unpackpics
wl_unpackpics_LDADD = -lwasteland
wl_unpackpics_LDADD = ../libwasteland/libwasteland.la
wl_unpackpics_SOURCES = \
unpackpics.c

Expand Down
2 changes: 1 addition & 1 deletion src/unpackpics/unpackpics.c
Expand Up @@ -14,7 +14,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include <math.h>
#include "config.h"

Expand Down
2 changes: 1 addition & 1 deletion src/unpacksprites/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_unpacksprites
wl_unpacksprites_LDADD = -lwasteland
wl_unpacksprites_LDADD = ../libwasteland/libwasteland.la
wl_unpacksprites_SOURCES = \
unpacksprites.c

Expand Down
2 changes: 1 addition & 1 deletion src/unpacksprites/unpacksprites.c
Expand Up @@ -14,7 +14,7 @@
#include <string.h>
#include <gd.h>
#include <errno.h>
#include <wasteland.h>
#include "../libwasteland/wasteland.h"
#include "config.h"

#ifdef WIN32
Expand Down
2 changes: 1 addition & 1 deletion src/unpacktiles/Makefile.am
@@ -1,5 +1,5 @@
bin_PROGRAMS = wl_unpacktiles
wl_unpacktiles_LDADD = -lwasteland
wl_unpacktiles_LDADD = ../libwasteland/libwasteland.la
wl_unpacktiles_SOURCES = \
unpacktiles.c

Expand Down

0 comments on commit eed4316

Please sign in to comment.