diff --git a/Makefile.am b/Makefile.am index a3890f7..a8a74e2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,8 @@ # Daniel Stone disowns all copyright on this file; no warranty is given as to its # suitability or otherwise. -SUBDIRS = src sxpm cxpm +SUBDIRS = intl po src sxpm cxpm +ACLOCAL_AMFLAGS = -I m4 --install pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xpm.pc diff --git a/configure.ac b/configure.ac index 2f56e4d..2b2d97d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,13 +1,17 @@ # $Id$ -AC_PREREQ(2.57) +AC_PREREQ([2.57]) AC_INIT([libXpm], 3.5.7, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXpm) AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([dist-bzip2]) +AC_GNU_SOURCE +AM_GNU_GETTEXT +AM_GNU_GETTEXT_VERSION([0.16]) + AM_MAINTAINER_MODE -AM_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_LIBTOOL @@ -70,8 +74,5 @@ AM_CONDITIONAL(BUILD_SXPM, test x$build_sxpm = xtrue) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION -AC_OUTPUT([Makefile - src/Makefile - sxpm/Makefile - cxpm/Makefile - xpm.pc]) +AC_CONFIG_FILES([Makefile src/Makefile sxpm/Makefile cxpm/Makefile]) +AC_OUTPUT([intl/Makefile po/Makefile.in xpm.pc]) diff --git a/cxpm/Makefile.am b/cxpm/Makefile.am index 097a640..30069f9 100644 --- a/cxpm/Makefile.am +++ b/cxpm/Makefile.am @@ -1,7 +1,9 @@ bin_PROGRAMS = cxpm -AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include/X11 +AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include/X11 \ + -DLOCALEDIR=\"$(localedir)\" -I../intl -I$(top_srcdir)/intl AM_CFLAGS = $(XPM_CFLAGS) +cxpm_LDADD = $(LIBINTL) cxpm_SOURCES = cxpm.c @@ -46,3 +48,6 @@ cxpm.po: $(cxpm_SOURCES:%=$(srcdir)/%) CLEANFILES += cxpm.po endif + +esto: + echo "es: " $(LIBINTL) \ No newline at end of file diff --git a/cxpm/cxpm.c b/cxpm/cxpm.c index 3b5e603..2f997e8 100644 --- a/cxpm/cxpm.c +++ b/cxpm/cxpm.c @@ -51,14 +51,14 @@ #define Ungetc sUngetc +void ErrorMessage (int ErrorStatus, xpmData *data); + /* * special getc and ungetc counting read lines and characters * note that 's' could stand both for "special" and "slow" ;-) */ static int -sGetc(data, file) - xpmData *data; - FILE *file; +sGetc(xpmData *data, FILE *file) { int c = getc(data->stream.file); if (c == '\n') { @@ -71,10 +71,7 @@ sGetc(data, file) } static void -sUngetc(data, c, file) - xpmData *data; - int c; - FILE *file; +sUngetc (xpmData *data, int c, FILE *file) { ungetc(c, data->stream.file); if (c == '\n') { @@ -95,10 +92,7 @@ sUngetc(data, c, file) #include "Image.c" void -ErrorMessage( - int ErrorStatus, - xpmData *data) - +ErrorMessage (int ErrorStatus, xpmData *data) { char *error = NULL; @@ -143,9 +137,7 @@ ErrorMessage( } int -main(argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { XpmImage image; char *filename; diff --git a/src/Makefile.am b/src/Makefile.am index 5dcdf03..ee6bb77 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,11 +2,12 @@ lib_LTLIBRARIES=libXpm.la -AM_CPPFLAGS = -I. -I$(top_srcdir)/include/X11/ -AM_CFLAGS = $(XPM_CFLAGS) +AM_CPPFLAGS = -I. -I$(top_srcdir)/include/X11/ \ + -DLOCALEDIR=\"$(localedir)\" -I../intl -I$(top_srcdir)/intl +AM_CFLAGS = $(XPM_CFLAGS) -libXpm_la_LDFLAGS = -version-number 4:11:0 -no-undefined -libXpm_la_LIBADD = $(XPM_LIBS) +libXpm_la_LDFLAGS = -version-number "4:11:0" -no-undefined +libXpm_la_LIBADD = $(LIBINTL) $(XPM_LIBS) libXpm_la_SOURCES = \ Attrib.c \ diff --git a/src/RdFToI.c b/src/RdFToI.c index 60db54a..0970690 100644 --- a/src/RdFToI.c +++ b/src/RdFToI.c @@ -53,6 +53,12 @@ LFUNC(OpenReadFile, int, (char *filename, xpmData *mdata)); LFUNC(xpmDataClose, void, (xpmData *mdata)); +#ifndef NO_ZPIPE +/* Do not depend on errno after read_through */ +FILE * +xpmPipeThrough (int fd, const char *cmd, const char *arg1, const char *mode); +#endif /* NO_ZPIPE */ + #ifndef CXPMPROG int XpmReadFileToImage(display, filename, @@ -127,12 +133,8 @@ XpmReadFileToXpmImage(filename, image, info) #ifndef NO_ZPIPE /* Do not depend on errno after read_through */ -FILE* -xpmPipeThrough(fd, cmd, arg1, mode) - int fd; - const char* cmd; - const char* arg1; - const char* mode; +FILE * +xpmPipeThrough (int fd, const char *cmd, const char *arg1, const char *mode) { FILE* fp; int status, fds[2], in = 0, out = 1; diff --git a/sxpm/Makefile.am b/sxpm/Makefile.am index 7780bd8..4116c68 100644 --- a/sxpm/Makefile.am +++ b/sxpm/Makefile.am @@ -4,11 +4,13 @@ bin_PROGRAMS = sxpm AM_CFLAGS = $(SXPM_CFLAGS) -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include \ + -DLOCALEDIR=\"$(localedir)\" -I../intl -I$(top_srcdir)/intl sxpm_SOURCES = sxpm.c -sxpm_LDADD = $(XPM_LIBS) $(SXPM_LIBS) $(top_builddir)/src/libXpm.la +sxpm_LDADD = $(LIBINTL) $(XPM_LIBS) $(SXPM_LIBS) \ + $(top_builddir)/src/libXpm.la # Man page appmandir = $(APP_MAN_DIR) diff --git a/sxpm/sxpm.c b/sxpm/sxpm.c index a43d441..735e57d 100644 --- a/sxpm/sxpm.c +++ b/sxpm/sxpm.c @@ -110,10 +110,13 @@ static char *plaid[] = { #define xrdb XtDatabase(dpy) static Colormap colormap; -void Usage(); -void ErrorMessage(); -void Punt(); -void VersionInfo(); +void Usage (void); +void ErrorMessage(int ErrorStatus, char *tag); +void Punt(int i); +void VersionInfo (void); + +void GetNumbers(int num, int *format_return, int *libmajor_return, + char *libminor_return); #ifdef __STDC__ void kinput(Widget widget, char *tag, XEvent *xe, Boolean *b); @@ -139,9 +142,7 @@ static XrmOptionDescRec options[] = { }; int -main(argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int ErrorStatus; unsigned int verbose = 0; /* performs verbose output */ @@ -578,7 +579,7 @@ main(argc, argv) } void -Usage() +Usage(void) { /* L10N_Comments : Usage message (sxpm -h) in two parts. In the first part %s is replaced by the command name. */ @@ -721,11 +722,8 @@ kinput(widget, tag, xe, b) * number (following the rule described in xpm.h). */ void -GetNumbers(num, format_return, libmajor_return, libminor_return) - int num; - int *format_return; - int *libmajor_return; - char *libminor_return; +GetNumbers(int num, int *format_return, int *libmajor_return, + char *libminor_return) { *format_return = num / 10000; *libmajor_return = (num % 10000) / 100; @@ -733,7 +731,7 @@ GetNumbers(num, format_return, libmajor_return, libminor_return) } void -VersionInfo() +VersionInfo (void) { int format, libmajor; char libminor;