diff options
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | baltisot-config.in | 54 | ||||
-rw-r--r-- | baltisot.m4 | 54 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | include/Makefile.am | 3 | ||||
-rw-r--r-- | lib/Handle.cc | 28 | ||||
-rw-r--r-- | m4/Makefile | 21 | ||||
-rw-r--r-- | po/fr.po | 26 | ||||
-rw-r--r-- | src/Makefile.am | 2 |
9 files changed, 144 insertions, 54 deletions
diff --git a/Makefile.am b/Makefile.am index fa2672c..c474c14 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,4 +6,6 @@ INCLUDES = -I$(includedir) ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = config.rpath mkinstalldirs +bin_SCRIPTS = baltisot-config + +EXTRA_DIST = config.rpath mkinstalldirs baltisot.m4 diff --git a/baltisot-config.in b/baltisot-config.in new file mode 100644 index 0000000..c9e846d --- /dev/null +++ b/baltisot-config.in @@ -0,0 +1,54 @@ +#!/bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +exec_prefix_set=no + +usage="\ +Usage: baltisot-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]" + +if test $# -eq 0; then + echo "${usage}" 1>&2 + exit 1 +fi + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo $prefix + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo $exec_prefix + ;; + --version) + echo @VERSION@ + ;; + --cflags) + echo -I@includedir@/Baltisot + ;; + --libs) + libdirs="-L@libdir@" + echo $libdirs -lBaltisot @LIBS@ + ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done diff --git a/baltisot.m4 b/baltisot.m4 new file mode 100644 index 0000000..320e194 --- /dev/null +++ b/baltisot.m4 @@ -0,0 +1,54 @@ +# Configure paths for Baltisot +# Nicolas Noble 2002-12-06 +# stolen from Sam Lantinga +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for BALTISOT, and define BALTISOT_CFLAGS and BALTISOT_LIBS +dnl +AC_DEFUN(AM_PATH_BALTISOT, +[dnl +dnl Get the cflags and libraries from the baltisot-config script +dnl +AC_ARG_WITH(baltisot-prefix,[ --with-baltisot-prefix=PFX Prefix where Baltisot is installed (optional)], + baltisot_prefix="$withval", baltisot_prefix="") +AC_ARG_WITH(baltisot-exec-prefix,[ --with-baltisot-exec-prefix=PFX Exec prefix where Baltisot is installed (optional)], + baltisot_exec_prefix="$withval", baltisot_exec_prefix="") + + if test x$baltisot_exec_prefix != x ; then + baltisot_args="$baltisot_args --exec-prefix=$baltisot_exec_prefix" + if test x${baltisot_CONFIG+set} != xset ; then + baltisot_CONFIG=$baltisot_exec_prefix/bin/baltisot-config + fi + fi + if test x$baltisot_prefix != x ; then + baltisot_args="$baltisot_args --prefix=$baltisot_prefix" + if test x${baltisot_CONFIG+set} != xset ; then + baltisot_CONFIG=$baltisot_prefix/bin/baltisot-config + fi + fi + + AC_REQUIRE([AC_CANONICAL_TARGET]) + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + AC_PATH_PROG(BALTISOT_CONFIG, baltisot-config, no, [$PATH]) + no_baltisot="" + if test "$BALTISOT_CONFIG" = "no" ; then + no_baltisot=yes + else + BALTISOT_CFLAGS=`$BALTISOT_CONFIG $baltisotconf_args --cflags` + BALTISOT_LIBS=`$BALTISOT_CONFIG $baltisotconf_args --libs` + fi + + if test "x$no_baltisot" = x ; then + ifelse([$1], , :, [$1]) + else + BALTISOT_CFLAGS="" + BALTISOT_LIBS="" + ifelse([$2], , :, [$2]) + fi + AC_SUBST(BALTISOT_CFLAGS) + AC_SUBST(BALTISOT_LIBS) +]) diff --git a/configure.ac b/configure.ac index c8940c4..d2cebdf 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,6 @@ AC_SEARCH_LIBS(gethostbyname, nsl) AC_SEARCH_LIBS(deflate, z) if test x$ac_cv_search_deflate != xno ; then - AC_DEFINE([HAVE_ZLIB], 1, [Have the ZLIB]) OLDCPPFLAGS=$CPPFLAGS CPPFLAGS="-Werror" AC_CACHE_CHECK([for well defined gzwrite in zlib.h], ac_cv_wd_gzwrite, @@ -101,7 +100,8 @@ AC_ARG_ENABLE([debug], [ --enable-debug enable verbose debugging], AC_DEFINE(DEBUG, 1, [Enable verbose debugging])) -AC_CONFIG_FILES([Makefile +AC_CONFIG_FILES([baltisot-config + Makefile doc/Makefile include/Makefile intl/Makefile @@ -109,7 +109,7 @@ AC_CONFIG_FILES([Makefile m4/Makefile po/Makefile.in src/Makefile - src/datas/Makefile]) + src/datas/Makefile], [ chmod +x baltisot-config ]) AC_OUTPUT diff --git a/include/Makefile.am b/include/Makefile.am index d50604f..46f0bc0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,6 @@ -#includedir = $(prefix)/include/@PACKAGE@ pkginclude_HEADERS = \ Exceptions.h Handle.h String.h Output.h Socket.h HttpServ.h Variables.h Menu.h \ Action.h Message.h Form.h Confirm.h Table.h IRC.h Task.h Buffer.h \ CopyJob.h ReadJob.h Regex.h TaskMan.h InPipe.h OutPipe.h Input.h Image.h Main.h + +noinst_HEADERS = gettext.h diff --git a/lib/Handle.cc b/lib/Handle.cc index 0470929..27426ab 100644 --- a/lib/Handle.cc +++ b/lib/Handle.cc @@ -9,17 +9,12 @@ #include "Handle.h" #include "gettext.h" -Handle::Handle(const Handle & nh) : itell(0), h(nh.h >= 0 ? dup(nh.h) : nh.h), closed(nh.closed), nonblock(nh.closed) -#ifdef HAVE_ZLIB -, zfile(0), z(0) -#endif +Handle::Handle(const Handle & nh) : itell(0), h(nh.h >= 0 ? dup(nh.h) : nh.h), closed(nh.closed), nonblock(nh.closed), zfile(0), z(0) { // cerr << "Duplication of handle " << nh.h << " to " << h << endl; -#ifdef HAVE_ZLIB if ((h >= 0) && (nh.z)) { SetZ(nh.z); } -#endif } Handle::~Handle() { @@ -27,10 +22,7 @@ Handle::~Handle() { close(); } -Handle::Handle(int nh) : h(nh), closed(false), nonblock(false) -#ifdef HAVE_ZLIB -, zfile(0), z(0) -#endif +Handle::Handle(int nh) : h(nh), closed(false), nonblock(false), zfile(0), z(0) { // cerr << "Initialising handle " << h << endl; } @@ -162,7 +154,6 @@ void Handle::close() throw (GeneralException) { } if (h >= 0) { -#ifdef HAVE_ZLIB if (z) { // cerr << "Performing gzclose on handle " << h << endl; int err = gzclose(zfile); @@ -175,9 +166,6 @@ void Handle::close() throw (GeneralException) { } } } else { -#else - { -#endif int err = ::close(h); if (err) { throw GeneralException(String(_("Error during close: ")) + strerror(errno)); @@ -221,7 +209,6 @@ void Handle::Dup(const Handle & H) { } } -#ifdef HAVE_ZLIB void Handle::SetZ(int az) throw (GeneralException) { if (z) { throw GeneralException(_("Can't SetZ a Handle twice.")); @@ -247,14 +234,12 @@ void Handle::SetZ(int az) throw (GeneralException) { z = az; } } -#endif ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException) { -#ifdef HAVE_ZLIB if (z) { itell += count; // cerr << "Performing gzwrite of " << count << " byte for handle " << h << endl; -#ifdef HAVE_CLEAN_ZLIB +#ifdef HAVE_WD_ZLIB int err = gzwrite(zfile, buf, count); #else int err = gzwrite(zfile, (char *) buf, count); @@ -270,16 +255,12 @@ ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException) } return err; } else { -#else - { -#endif itell += count = ::write(h, buf, count); return count; } } ssize_t Handle::uread(void * buf, size_t count) { -#ifdef HAVE_ZLIB if (z) { itell += count; // cerr << "Performing gzread of " << count << " byte for handle " << h << endl; @@ -295,9 +276,6 @@ ssize_t Handle::uread(void * buf, size_t count) { } return err; } else { -#else - { -#endif itell += count = ::read(h, buf, count); return count; } diff --git a/m4/Makefile b/m4/Makefile index 6b12467..68733a1 100644 --- a/m4/Makefile +++ b/m4/Makefile @@ -16,7 +16,7 @@ SHELL = /bin/sh srcdir = . top_srcdir = .. -prefix = /usr/local +prefix = /usr exec_prefix = ${prefix} bindir = ${exec_prefix}/bin @@ -34,16 +34,16 @@ oldincludedir = /usr/include DESTDIR = -pkgdatadir = $(datadir)/ -pkglibdir = $(libdir)/ -pkgincludedir = $(includedir)/ +pkgdatadir = $(datadir)/Balisot +pkglibdir = $(libdir)/Balisot +pkgincludedir = $(includedir)/Balisot top_builddir = .. -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ +ACLOCAL = aclocal-1.4 +AUTOCONF = autoconf +AUTOMAKE = automake-1.4 +AUTOHEADER = autoheader INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) @@ -87,16 +87,17 @@ LTLIB = @LTLIB@ LTLIBICONV = LTLIBINTL = MAINT = # +MAKEINFO = makeinfo MKINSTALLDIRS = ./mkinstalldirs OBJDUMP = @OBJDUMP@ OBJEXT = o -PACKAGE = +PACKAGE = Balisot POSUB = po RANLIB = ranlib STRIP = strip USE_INCLUDED_LIBINTL = no USE_NLS = yes -VERSION = +VERSION = 0.1.0 YACC = bison -y gmakepath = unamepath = /bin/uname @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Baltisot 1.0.0\n" -"POT-Creation-Date: 2002-11-29 02:12+0100\n" +"POT-Creation-Date: 2002-12-06 01:46+0100\n" "PO-Revision-Date: 2001-10-29 08:26GMT\n" "Last-Translator: Nicolas Noble <nicolas@nobis-crew.org>\n" "Language-Team: French <fr@li.org>\n" @@ -14,11 +14,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 0.8\n" -#: lib/CopyJob.cc:71 +#: lib/CopyJob.cc:70 msgid "CopyJob from " msgstr "CopyJob depuis " -#: lib/CopyJob.cc:71 lib/ReadJob.cc:51 +#: lib/CopyJob.cc:70 lib/ReadJob.cc:51 msgid " to " msgstr " vers " @@ -64,32 +64,32 @@ msgstr "Erreur en créant un tube: " msgid "Was not able to fork().\n" msgstr "N'a pu faire de fork().\n" -#: lib/Handle.cc:172 lib/Handle.cc:183 +#: lib/Handle.cc:163 lib/Handle.cc:171 msgid "Error during close: " msgstr "Erreur pendant close: " -#: lib/Handle.cc:174 +#: lib/Handle.cc:165 msgid "Error in zlib during gzclose." msgstr "Erreur dans la zlib pendant gzclose." -#: lib/Handle.cc:202 +#: lib/Handle.cc:190 msgid "Bare Handle - should not happend" msgstr "Handle pur - ne devrait pas arriver" -#: lib/Handle.cc:227 +#: lib/Handle.cc:214 msgid "Can't SetZ a Handle twice." msgstr "Ne peut faire SetZ sur un Handle deux fois." -#: lib/Handle.cc:230 +#: lib/Handle.cc:217 msgid "Can't SetZ a virtual Handle." msgstr "Ne peut SetZ sur un Handle virtuel." -#: lib/Handle.cc:245 +#: lib/Handle.cc:232 #, fuzzy msgid "Was not able to gzdopen." msgstr "N'a pu faire de gzdopen.\n" -#: lib/Handle.cc:268 +#: lib/Handle.cc:253 msgid "Error in zlib during gzwrite: " msgstr "Erreur dans la zlib pendant gzwrite: " @@ -181,14 +181,14 @@ msgstr "Erreur avec poll, handle " msgid " invalid." msgstr " invalide." -#: lib/InPipe.cc:40 +#: lib/InPipe.cc:41 msgid "Input pipe from stdout (" msgstr "Tube d'entrée depuis stdout (" -#: lib/InPipe.cc:40 lib/OutPipe.cc:40 +#: lib/InPipe.cc:41 lib/OutPipe.cc:40 msgid "not " msgstr "non " -#: lib/InPipe.cc:40 lib/OutPipe.cc:40 +#: lib/InPipe.cc:41 lib/OutPipe.cc:40 msgid "hooked)" msgstr "détourné)" diff --git a/src/Makefile.am b/src/Makefile.am index e923faa..1754324 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,7 @@ AM_CFLAGS = -O3 -Wall -Wstrict-prototypes -g AM_CXXFLAGS = -O3 -Wall -Wstrict-prototypes -g INCLUDES = -I.. -I../include -I$(includedir) -bin_PROGRAMS = Baltisot +noinst_PROGRAMS = Baltisot #noinst_JAVA = TestApplet.java |