From fe037171d6c2b5e9d28ac10a015a13ca5e011cee Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Sun, 6 Mar 2016 03:49:27 -0600 Subject: [PATCH] Change all leftover libratbox stuff to librb. --- authd/authd.h | 2 +- authd/res.c | 2 +- bandb/bandb.c | 2 +- extensions/sno_channelcreate.c | 2 +- include/send.h | 2 +- include/stdinc.h | 2 +- ircd/authd.c | 2 +- ircd/bandbi.c | 2 +- ircd/dns.c | 2 +- ircd/ircd.c | 12 +- ircd/operhash.c | 2 +- ircd/sslproc.c | 2 +- librb/aclocal.m4 | 299 ++++++++++-------- librb/configure | 51 +-- librb/configure.ac | 16 +- ...ibratbox_config.h.in => librb_config.h.in} | 4 +- ...ratbox_config.h_vms => librb_config.h_vms} | 0 librb/include/{ratbox_lib.h => rb_lib.h} | 4 - librb/ltmain.sh | 77 ++++- librb/src/Makefile.am | 2 +- librb/src/arc4random.c | 4 +- librb/src/balloc.c | 4 +- librb/src/commio.c | 4 +- librb/src/crypt.c | 4 +- librb/src/descrip.mms | 2 +- librb/src/devpoll.c | 4 +- librb/src/epoll.c | 4 +- librb/src/event.c | 4 +- librb/src/gnutls.c | 6 +- librb/src/helper.c | 4 +- librb/src/kqueue.c | 4 +- librb/src/linebuf.c | 4 +- librb/src/mbedtls.c | 6 +- librb/src/nossl.c | 6 +- librb/src/openssl.c | 22 +- librb/src/patricia.c | 6 +- librb/src/poll.c | 4 +- librb/src/ports.c | 4 +- librb/src/rawbuf.c | 4 +- librb/src/{ratbox_lib.c => rb_lib.c} | 12 +- librb/src/rb_memory.c | 4 +- librb/src/select.c | 4 +- librb/src/sigio.c | 4 +- librb/src/tools.c | 4 +- librb/src/unix.c | 4 +- librb/src/version.c.SH | 10 +- librb/src/win32.c | 4 +- tools/mkpasswd.c | 2 +- 48 files changed, 361 insertions(+), 274 deletions(-) rename librb/include/{libratbox_config.h.in => librb_config.h.in} (98%) rename librb/include/{libratbox_config.h_vms => librb_config.h_vms} (100%) rename librb/include/{ratbox_lib.h => rb_lib.h} (98%) rename librb/src/{ratbox_lib.c => rb_lib.c} (96%) diff --git a/authd/authd.h b/authd/authd.h index c94c534c8..08cd6c173 100644 --- a/authd/authd.h +++ b/authd/authd.h @@ -21,7 +21,7 @@ #ifndef _AUTHD_H #define _AUTHD_H -#include +#include #include #include "setup.h" diff --git a/authd/res.c b/authd/res.c index b2313d9d7..4deafb5f3 100644 --- a/authd/res.c +++ b/authd/res.c @@ -32,7 +32,7 @@ * January 2016 --kaniini */ -#include +#include #include "setup.h" #include "res.h" #include "reslib.h" diff --git a/bandb/bandb.c b/bandb/bandb.c index 2a0f1a048..1936b4160 100644 --- a/bandb/bandb.c +++ b/bandb/bandb.c @@ -28,7 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "setup.h" -#include +#include #include #include "rsdb.h" #include "common.h" diff --git a/extensions/sno_channelcreate.c b/extensions/sno_channelcreate.c index b39d06c0a..d9f9259af 100644 --- a/extensions/sno_channelcreate.c +++ b/extensions/sno_channelcreate.c @@ -10,7 +10,7 @@ #include "send.h" #include "s_conf.h" #include "snomask.h" -#include "ratbox_lib.h" +#include "rb_lib.h" static int _modinit(void); static void _moddeinit(void); diff --git a/include/send.h b/include/send.h index eaf1eb1e1..6cb5df7bb 100644 --- a/include/send.h +++ b/include/send.h @@ -25,7 +25,7 @@ #ifndef INCLUDED_send_h #define INCLUDED_send_h -#include "ratbox_lib.h" +#include "rb_lib.h" #include "ircd_defs.h" #include "config.h" /* HAVE_STDARG_H */ diff --git a/include/stdinc.h b/include/stdinc.h index 166d44d7b..ca5a1e9ee 100644 --- a/include/stdinc.h +++ b/include/stdinc.h @@ -21,7 +21,7 @@ * */ -#include "ratbox_lib.h" +#include "rb_lib.h" #include "config.h" /* Gotta pull in the autoconf stuff */ #include "ircd_defs.h" /* Needed for some reasons here -- dwr */ diff --git a/ircd/authd.c b/ircd/authd.c index 534e2b17e..7fbdab632 100644 --- a/ircd/authd.c +++ b/ircd/authd.c @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include #include diff --git a/ircd/bandbi.c b/ircd/bandbi.c index 698989038..aa9410d29 100644 --- a/ircd/bandbi.c +++ b/ircd/bandbi.c @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "stdinc.h" -#include "ratbox_lib.h" +#include "rb_lib.h" #include "client.h" #include "s_conf.h" #include "logger.h" diff --git a/ircd/dns.c b/ircd/dns.c index 855775a6c..ed6cd57ed 100644 --- a/ircd/dns.c +++ b/ircd/dns.c @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include #include diff --git a/ircd/ircd.c b/ircd/ircd.c index 73c523516..109c5f058 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -23,7 +23,7 @@ * USA */ -#include "ratbox_lib.h" +#include "rb_lib.h" #include "stdinc.h" #include "setup.h" #include "config.h" @@ -448,13 +448,13 @@ setup_corefile(void) static void ircd_log_cb(const char *str) { - ilog(L_MAIN, "libratbox reports: %s", str); + ilog(L_MAIN, "librb reports: %s", str); } static void ircd_restart_cb(const char *str) { - inotice("libratbox has called the restart callback: %s", str); + inotice("librb has called the restart callback: %s", str); restart(str); } @@ -471,11 +471,11 @@ ircd_die_cb(const char *str) if(str != NULL) { /* Try to get the message out to currently logged in operators. */ - sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "libratbox has called the die callback..aborting: %s", str); - inotice("libratbox has called the die callback..aborting: %s", str); + sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "librb has called the die callback..aborting: %s", str); + inotice("librb has called the die callback..aborting: %s", str); } else - inotice("libratbox has called the die callback..aborting"); + inotice("librb has called the die callback..aborting"); unlink(pidFileName); exit(EXIT_FAILURE); diff --git a/ircd/operhash.c b/ircd/operhash.c index 920542e1d..874d08cd6 100644 --- a/ircd/operhash.c +++ b/ircd/operhash.c @@ -30,7 +30,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include "stdinc.h" #include "match.h" #include "hash.h" diff --git a/ircd/sslproc.c b/ircd/sslproc.c index 448461508..f9f26eafe 100644 --- a/ircd/sslproc.c +++ b/ircd/sslproc.c @@ -19,7 +19,7 @@ * USA */ -#include +#include #include "stdinc.h" diff --git a/librb/aclocal.m4 b/librb/aclocal.m4 index 8d8e29063..1344c4bca 100644 --- a/librb/aclocal.m4 +++ b/librb/aclocal.m4 @@ -2680,7 +2680,14 @@ freebsd* | dragonfly*) *) objformat=elf ;; esac fi - version_type=freebsd-$objformat + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' @@ -2692,6 +2699,12 @@ freebsd* | dragonfly*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in @@ -9049,63 +9062,32 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) -dnl -dnl Copyright © 2004 Scott James Remnant . -dnl Copyright © 2012-2015 Dan Nicholson -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -dnl 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that -dnl program. +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. -dnl PKG_PREREQ(MIN-VERSION) -dnl ----------------------- -dnl Since: 0.29 -dnl -dnl Verify that the version of the pkg-config macros are at least -dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's -dnl installed version of pkg-config, this checks the developer's version -dnl of pkg.m4 when generating configure. -dnl -dnl To ensure that this macro is defined, also add: -dnl m4_ifndef([PKG_PREREQ], -dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) -dnl -dnl See the "Since" comment for each macro you use to see what version -dnl of the macros you require. -m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) -m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, - [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) -])dnl PKG_PREREQ - -dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) -dnl ---------------------------------- -dnl Since: 0.16 -dnl -dnl Search for the pkg-config tool and set the PKG_CONFIG variable to -dnl first found in the path. Checks that the version of pkg-config found -dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is -dnl used since that's the first version where most current features of -dnl pkg-config existed. +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -9127,19 +9109,18 @@ if test -n "$PKG_CONFIG"; then PKG_CONFIG="" fi fi[]dnl -])dnl PKG_PROG_PKG_CONFIG +])# PKG_PROG_PKG_CONFIG -dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------------------------------- -dnl Since: 0.18 -dnl -dnl Check to see whether a particular set of modules exists. Similar to -dnl PKG_CHECK_MODULES(), but does not set variables or print errors. -dnl -dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place -dnl it's called might be skipped (such as if it is within an "if", you -dnl have to call PKG_CHECK_EXISTS manually +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ @@ -9149,10 +9130,8 @@ m4_ifvaln([$3], [else $3])dnl fi]) -dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -dnl --------------------------------------------- -dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting -dnl pkg_failed based on the result. +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" @@ -9164,11 +9143,10 @@ m4_define([_PKG_CONFIG], else pkg_failed=untried fi[]dnl -])dnl _PKG_CONFIG +])# _PKG_CONFIG -dnl _PKG_SHORT_ERRORS_SUPPORTED -dnl --------------------------- -dnl Internal check to see if pkg-config supports short errors. +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -9176,17 +9154,19 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then else _pkg_short_errors_supported=no fi[]dnl -])dnl _PKG_SHORT_ERRORS_SUPPORTED +])# _PKG_SHORT_ERRORS_SUPPORTED -dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl -------------------------------------------------------------- -dnl Since: 0.4.0 -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES might not happen, you should be sure to include an -dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl @@ -9240,40 +9220,15 @@ else AC_MSG_RESULT([yes]) $3 fi[]dnl -])dnl PKG_CHECK_MODULES +])# PKG_CHECK_MODULES - -dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl --------------------------------------------------------------------- -dnl Since: 0.29 -dnl -dnl Checks for existence of MODULES and gathers its build flags with -dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags -dnl and VARIABLE-PREFIX_LIBS from --libs. -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to -dnl include an explicit call to PKG_PROG_PKG_CONFIG in your -dnl configure.ac. -AC_DEFUN([PKG_CHECK_MODULES_STATIC], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -_save_PKG_CONFIG=$PKG_CONFIG -PKG_CONFIG="$PKG_CONFIG --static" -PKG_CHECK_MODULES($@) -PKG_CONFIG=$_save_PKG_CONFIG[]dnl -])dnl PKG_CHECK_MODULES_STATIC - - -dnl PKG_INSTALLDIR([DIRECTORY]) -dnl ------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable pkgconfigdir as the location where a module -dnl should install pkg-config .pc files. By default the directory is -dnl $libdir/pkgconfig, but the default can be changed by passing -dnl DIRECTORY. The user can override through the --with-pkgconfigdir -dnl parameter. +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -9284,18 +9239,16 @@ AC_ARG_WITH([pkgconfigdir], AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -])dnl PKG_INSTALLDIR +]) dnl PKG_INSTALLDIR -dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) -dnl -------------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable noarch_pkgconfigdir as the location where a -dnl module should install arch-independent pkg-config .pc files. By -dnl default the directory is $datadir/pkgconfig, but the default can be -dnl changed by passing DIRECTORY. The user can override through the -dnl --with-noarch-pkgconfigdir parameter. +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], @@ -9306,15 +9259,13 @@ AC_ARG_WITH([noarch-pkgconfigdir], AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) -])dnl PKG_NOARCH_INSTALLDIR +]) dnl PKG_NOARCH_INSTALLDIR -dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------- -dnl Since: 0.28 -dnl -dnl Retrieves the value of the pkg-config variable for the given module. +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl @@ -9323,7 +9274,81 @@ _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl -])dnl PKG_CHECK_VAR +])# PKG_CHECK_VAR + +# PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +# [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +# [DESCRIPTION], [DEFAULT]) +# +# Prepare a "--with-" configure option using the lowercase [VARIABLE-PREFIX] +# name, merging the behaviour of AC_ARG_WITH and PKG_CHECK_MODULES in a single +# macro +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +]) dnl PKG_WITH_MODULES + +# PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +# [DESCRIPTION], [DEFAULT]) +# +# Convenience macro to trigger AM_CONDITIONAL after +# PKG_WITH_MODULES check. +# +# HAVE_[VARIABLE-PREFIX] is exported as make variable. +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +]) + +# PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +# [DESCRIPTION], [DEFAULT]) +# +# Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +# PKG_WITH_MODULES check. +# +# HAVE_[VARIABLE-PREFIX] is exported as make and preprocessor variable. +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +]) # Copyright (C) 2002-2014 Free Software Foundation, Inc. # diff --git a/librb/configure b/librb/configure index be0d8aa9a..5d2bcd085 100755 --- a/librb/configure +++ b/librb/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libratbox devel. +# Generated by GNU Autoconf 2.69 for librb devel. # # $Id: configure.ac 26260 2008-12-10 04:08:39Z androsyn $ # @@ -587,14 +587,14 @@ MFLAGS= MAKEFLAGS= # Identity of this package. -PACKAGE_NAME='libratbox' -PACKAGE_TARNAME='libratbox' +PACKAGE_NAME='librb' +PACKAGE_TARNAME='librb' PACKAGE_VERSION='devel' -PACKAGE_STRING='libratbox devel' +PACKAGE_STRING='librb devel' PACKAGE_BUGREPORT='' PACKAGE_URL='' -ac_default_prefix=/usr/local/libratbox +ac_default_prefix=/usr/local/librb # Factoring default headers for most tests. ac_includes_default="\ #include @@ -1350,7 +1350,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libratbox devel to adapt to many kinds of systems. +\`configure' configures librb devel to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1398,7 +1398,7 @@ Fine tuning of the installation directories: --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/libratbox] + --docdir=DIR documentation root [DATAROOTDIR/doc/librb] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] @@ -1420,7 +1420,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libratbox devel:";; + short | recursive ) echo "Configuration of librb devel:";; esac cat <<\_ACEOF @@ -1552,7 +1552,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libratbox configure devel +librb configure devel generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2030,7 +2030,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libratbox $as_me devel, which was +It was created by librb $as_me devel, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2895,7 +2895,7 @@ fi # Define the identity of the package. - PACKAGE='libratbox' + PACKAGE='librb' VERSION='devel' @@ -3029,7 +3029,7 @@ fi AM_BACKSLASH='\' -ac_config_headers="$ac_config_headers include/libratbox_config.h" +ac_config_headers="$ac_config_headers include/librb_config.h" @@ -4712,7 +4712,7 @@ fi if test x"$ac_cv_prog_cc_c99" = "xno"; then - as_fn_error $? "ircd-ratbox requires a C99 capable compiler" "$LINENO" 5 + as_fn_error $? "charybdis requires a C99 capable compiler" "$LINENO" 5 fi @@ -12106,7 +12106,14 @@ freebsd* | dragonfly*) *) objformat=elf ;; esac fi - version_type=freebsd-$objformat + # Handle Gentoo/FreeBSD as it was Linux + case $host_vendor in + gentoo) + version_type=linux ;; + *) + version_type=freebsd-$objformat ;; + esac + case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' @@ -12118,6 +12125,12 @@ freebsd* | dragonfly*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; + linux) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + need_lib_prefix=no + need_version=no + ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in @@ -13936,7 +13949,7 @@ ac_fn_c_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_i if test "x$ac_cv_header_stdarg_h" = xyes; then : else - as_fn_error $? "** stdarg.h could not be found - libratbox will not compile without it **" "$LINENO" 5 + as_fn_error $? "** stdarg.h could not be found - librb will not compile without it **" "$LINENO" 5 fi @@ -15959,7 +15972,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libratbox $as_me devel, which was +This file was extended by librb $as_me devel, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16025,7 +16038,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libratbox config.status devel +librb config.status devel configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -16517,7 +16530,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 for ac_config_target in $ac_config_targets do case $ac_config_target in - "include/libratbox_config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/libratbox_config.h" ;; + "include/librb_config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/librb_config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "include/librb-config.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/librb-config.h" ;; @@ -17759,7 +17772,7 @@ ltmain=$ac_aux_dir/ltmain.sh outfile=include/librb-config.h.tmp cat > $outfile <<\_______EOF /* - * librb-config.h: libratbox config file. Please modify configure.ac + * librb-config.h: librb config file. Please modify configure.ac */ #ifndef __LIBRB_CONFIG_H diff --git a/librb/configure.ac b/librb/configure.ac index b1f4c484a..511ab467d 100644 --- a/librb/configure.ac +++ b/librb/configure.ac @@ -9,20 +9,20 @@ AC_PREREQ(2.63) AUTOMAKE_OPTIONS = 1.10 dnl Sneaky way to get an Id tag into the configure script AC_COPYRIGHT([$Id: configure.ac 26260 2008-12-10 04:08:39Z androsyn $]) -AC_INIT([libratbox],[devel]) +AC_INIT([librb],[devel]) AM_INIT_AUTOMAKE([subdir-objects]) AM_SILENT_RULES([yes]) -AM_CONFIG_HEADER(include/libratbox_config.h) +AM_CONFIG_HEADER(include/librb_config.h) -AC_PREFIX_DEFAULT(/usr/local/libratbox) +AC_PREFIX_DEFAULT(/usr/local/librb) AC_GNU_SOURCE dnl Checks for programs. AC_PROG_CC_C99 if test x"$ac_cv_prog_cc_c99" = "xno"; then - AC_ERROR([ircd-ratbox requires a C99 capable compiler]) + AC_ERROR([charybdis requires a C99 capable compiler]) fi @@ -203,7 +203,7 @@ AC_CHECK_TYPES([struct sockaddr_storage],[ dnl Check for stdarg.h - if we cant find it, halt configure -AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - libratbox will not compile without it **])]) +AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - librb will not compile without it **])]) AC_CHECK_TYPE([sa_family_t], [], [AC_DEFINE(sa_family_t, [u_int16_t], [If system does not define sa_family_t, define it here.])], @@ -463,7 +463,7 @@ AC_SUBST(MBEDTLS_CFLAGS) AC_SUBST(MBEDTLS_LIBS) if test "$prefix" = "NONE"; then - AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where libratbox is installed.]) + AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where librb is installed.]) else @@ -471,7 +471,7 @@ dnl Don't get bitten by Cygwin's stupidity if the user specified dnl a custom prefix with a trailing slash prefix=`echo $prefix | sed 's/\/$//'` - AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where libratbox is installed.]) + AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where librb is installed.]) fi @@ -482,7 +482,7 @@ AC_CONFIG_COMMANDS([include/librb-config.h], outfile=include/librb-config.h.tmp cat > $outfile <<\_______EOF /* - * librb-config.h: libratbox config file. Please modify configure.ac + * librb-config.h: librb config file. Please modify configure.ac */ #ifndef __LIBRB_CONFIG_H diff --git a/librb/include/libratbox_config.h.in b/librb/include/librb_config.h.in similarity index 98% rename from librb/include/libratbox_config.h.in rename to librb/include/librb_config.h.in index 83fb52eec..289ab03a1 100644 --- a/librb/include/libratbox_config.h.in +++ b/librb/include/librb_config.h.in @@ -1,4 +1,4 @@ -/* include/libratbox_config.h.in. Generated from configure.ac by autoheader. */ +/* include/librb_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD @@ -267,7 +267,7 @@ /* Defined to mark profiling is enabled */ #undef RATBOX_PROFILE -/* Prefix where libratbox is installed. */ +/* Prefix where librb is installed. */ #undef RB_PREFIX /* Define to 1 if sockaddr has a 'sa_len' member. */ diff --git a/librb/include/libratbox_config.h_vms b/librb/include/librb_config.h_vms similarity index 100% rename from librb/include/libratbox_config.h_vms rename to librb/include/librb_config.h_vms diff --git a/librb/include/ratbox_lib.h b/librb/include/rb_lib.h similarity index 98% rename from librb/include/ratbox_lib.h rename to librb/include/rb_lib.h index d99a229c8..c7ad3e29e 100644 --- a/librb/include/ratbox_lib.h +++ b/librb/include/rb_lib.h @@ -1,7 +1,3 @@ -/* - * $Id: ratbox_lib.h 26256 2008-12-10 04:05:26Z androsyn $ - */ - #ifndef RB_LIB_H #define RB_LIB_H 1 diff --git a/librb/ltmain.sh b/librb/ltmain.sh index 0f0a2da3f..b2549eeb0 100644 --- a/librb/ltmain.sh +++ b/librb/ltmain.sh @@ -64,7 +64,7 @@ package_revision=2.4.6 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-01-20.17; # UTC +scriptversion=2015-10-04.22; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 @@ -1091,6 +1091,57 @@ func_relative_path () } +# func_quote ARG +# -------------- +# Aesthetically quote one ARG, store the result into $func_quote_result. Note +# that we keep attention to performance here (so far O(N) complexity as long as +# func_append is O(1)). +func_quote () +{ + $debug_cmd + + func_quote_result=$1 + + case $func_quote_result in + *[\\\`\"\$]*) + case $func_quote_result in + *[\[\*\?]*) + func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` + return 0 + ;; + esac + + func_quote_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_result + do + case $1 in + quote) + func_append func_quote_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + IFS=$func_quote_old_IFS + done + ;; + *) ;; + esac +} + + # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. @@ -1107,12 +1158,8 @@ func_quote_for_eval () func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac + func_quote "$1" + _G_unquoted_arg=$func_quote_result if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else @@ -5258,7 +5305,8 @@ else if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + func_quote "$ECHO" + qECHO=$func_quote_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -7272,10 +7320,14 @@ func_mode_link () # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" @@ -10506,8 +10558,8 @@ EOF relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote "(cd `pwd`; $relink_command)" + relink_command=$func_quote_result fi # Only actually do things if not in dry run mode. @@ -10753,7 +10805,8 @@ EOF done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + func_quote "$relink_command" + relink_command=$func_quote_result if test yes = "$hardcode_automatic"; then relink_command= fi diff --git a/librb/src/Makefile.am b/librb/src/Makefile.am index fb6c97b5c..684e234bc 100644 --- a/librb/src/Makefile.am +++ b/librb/src/Makefile.am @@ -24,7 +24,7 @@ librb_la_SOURCES = \ gnutls.c \ nossl.c \ event.c \ - ratbox_lib.c \ + rb_lib.c \ rb_memory.c \ linebuf.c \ tools.c \ diff --git a/librb/src/arc4random.c b/librb/src/arc4random.c index c69374bb0..f65bab1be 100644 --- a/librb/src/arc4random.c +++ b/librb/src/arc4random.c @@ -28,8 +28,8 @@ */ -#include -#include +#include +#include #if !defined(HAVE_OPENSSL) && !defined(HAVE_GNUTLS) && !defined(HAVE_MBEDTLS) && !defined(HAVE_ARC4RANDOM) diff --git a/librb/src/balloc.c b/librb/src/balloc.c index f6d6ad598..b7b036445 100644 --- a/librb/src/balloc.c +++ b/librb/src/balloc.c @@ -56,8 +56,8 @@ * * */ -#include -#include +#include +#include static uintptr_t offset_pad; diff --git a/librb/src/commio.c b/librb/src/commio.c index 35cf809bd..b3f1c1824 100644 --- a/librb/src/commio.c +++ b/librb/src/commio.c @@ -23,8 +23,8 @@ * * $Id: commio.c 26254 2008-12-10 04:04:38Z androsyn $ */ -#include -#include +#include +#include #include #include #include diff --git a/librb/src/crypt.c b/librb/src/crypt.c index f2b09efdc..15c40a0bb 100644 --- a/librb/src/crypt.c +++ b/librb/src/crypt.c @@ -27,8 +27,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include +#include static char *rb_md5_crypt(const char *pw, const char *salt); static char *rb_des_crypt(const char *pw, const char *salt); diff --git a/librb/src/descrip.mms b/librb/src/descrip.mms index 1c61ad7df..20d7dacb1 100644 --- a/librb/src/descrip.mms +++ b/librb/src/descrip.mms @@ -1,7 +1,7 @@ CFLAGS= /INCLUDE=([-.INCLUDE])/ERROR_LIMIT=5/DEFINE=(_XOPEN_SOURCE_EXTENDED)/NOANSI_ALIAS OBJECTS= balloc.obj, commio.obj, crypt.obj, event.obj, - helper.obj, linebuf.obj, nossl.obj, patricia.obj, - - poll.obj, ratbox_lib.obj, rawbuf.obj, rb_memory.obj, - + poll.obj, rb_libb.obj, rawbuf.obj, rb_memory.obj, - snprintf.obj, tools.obj, unix.obj DEFAULT : RATBOX.OLB($(OBJECTS)) diff --git a/librb/src/devpoll.c b/librb/src/devpoll.c index 41ac3ed68..2e99c092b 100644 --- a/librb/src/devpoll.c +++ b/librb/src/devpoll.c @@ -24,8 +24,8 @@ * * $Id: devpoll.c 26254 2008-12-10 04:04:38Z androsyn $ */ -#include -#include +#include +#include #include #include diff --git a/librb/src/epoll.c b/librb/src/epoll.c index b45b61b12..ac7c6be52 100644 --- a/librb/src/epoll.c +++ b/librb/src/epoll.c @@ -27,8 +27,8 @@ */ #define _GNU_SOURCE 1 -#include -#include +#include +#include #include #include #if defined(HAVE_EPOLL_CTL) && (HAVE_SYS_EPOLL_H) diff --git a/librb/src/event.c b/librb/src/event.c index fb56cacd7..1e1248305 100644 --- a/librb/src/event.c +++ b/librb/src/event.c @@ -42,8 +42,8 @@ * $Id: event.c 26272 2008-12-10 05:55:10Z androsyn $ */ -#include -#include +#include +#include #include #include diff --git a/librb/src/gnutls.c b/librb/src/gnutls.c index b50960848..3bd65f80f 100644 --- a/librb/src/gnutls.c +++ b/librb/src/gnutls.c @@ -1,5 +1,5 @@ /* - * libratbox: a library used by ircd-ratbox and other things + * librb: a library used by charybdis and other things * gnutls.c: gnutls related code * * Copyright (C) 2007-2008 ircd-ratbox development team @@ -23,8 +23,8 @@ * $Id: gnutls.c 26296 2008-12-13 03:36:00Z androsyn $ */ -#include -#include +#include +#include #include #include #ifdef HAVE_GNUTLS diff --git a/librb/src/helper.c b/librb/src/helper.c index 62fe55a4c..a41fa8794 100644 --- a/librb/src/helper.c +++ b/librb/src/helper.c @@ -21,8 +21,8 @@ * * $Id: helper.c 26092 2008-09-19 15:13:52Z androsyn $ */ -#include -#include +#include +#include #include struct _rb_helper diff --git a/librb/src/kqueue.c b/librb/src/kqueue.c index 3c3c23342..7ab9cd72f 100644 --- a/librb/src/kqueue.c +++ b/librb/src/kqueue.c @@ -25,8 +25,8 @@ * $Id: kqueue.c 26092 2008-09-19 15:13:52Z androsyn $ */ -#include -#include +#include +#include #include #include diff --git a/librb/src/linebuf.c b/librb/src/linebuf.c index 36fdfe331..51c97cd95 100644 --- a/librb/src/linebuf.c +++ b/librb/src/linebuf.c @@ -24,8 +24,8 @@ * $Id: linebuf.c 26092 2008-09-19 15:13:52Z androsyn $ */ -#include -#include +#include +#include #include static rb_bh *rb_linebuf_heap; diff --git a/librb/src/mbedtls.c b/librb/src/mbedtls.c index 2d928195d..a31b12e8e 100644 --- a/librb/src/mbedtls.c +++ b/librb/src/mbedtls.c @@ -1,5 +1,5 @@ /* - * libratbox: a library used by ircd-ratbox and other things + * librb: a library used by ircd-ratbox and other things * mbedtls.c: mbedtls related code * * Copyright (C) 2007-2008 ircd-ratbox development team @@ -24,8 +24,8 @@ * $Id$ */ -#include -#include +#include +#include #include #include diff --git a/librb/src/nossl.c b/librb/src/nossl.c index fd6e085b8..4cc9a06ef 100644 --- a/librb/src/nossl.c +++ b/librb/src/nossl.c @@ -1,5 +1,5 @@ /* - * libratbox: a library used by ircd-ratbox and other things + * librb: a library used by ircd-ratbox and other things * nossl.c: ssl stub code * * Copyright (C) 2007-2008 ircd-ratbox development team @@ -24,8 +24,8 @@ */ -#include -#include +#include +#include #if !defined(HAVE_OPENSSL) && !defined(HAVE_GNUTLS) && !defined(HAVE_MBEDTLS) #include "arc4random.h" diff --git a/librb/src/openssl.c b/librb/src/openssl.c index 48ae2f8c5..9898bf80d 100644 --- a/librb/src/openssl.c +++ b/librb/src/openssl.c @@ -1,5 +1,5 @@ /* - * libratbox: a library used by ircd-ratbox and other things + * librb: a library used by ircd-ratbox and other things * openssl.c: openssl related code * * Copyright (C) 2007-2008 ircd-ratbox development team @@ -23,8 +23,8 @@ * $Id: commio.c 24808 2008-01-02 08:17:05Z androsyn $ */ -#include -#include +#include +#include #ifdef HAVE_OPENSSL @@ -51,7 +51,7 @@ static SSL_CTX *ssl_server_ctx; static SSL_CTX *ssl_client_ctx; -static int libratbox_index = -1; +static int librb_index = -1; static unsigned long get_last_err(void) @@ -109,7 +109,7 @@ rb_ssl_info_callback(SSL * ssl, int where, int ret) { if(where & SSL_CB_HANDSHAKE_START) { - rb_fde_t *F = SSL_get_ex_data(ssl, libratbox_index); + rb_fde_t *F = SSL_get_ex_data(ssl, librb_index); if(F == NULL) return; F->handshake_count++; @@ -119,7 +119,7 @@ rb_ssl_info_callback(SSL * ssl, int where, int ret) static void rb_setup_ssl_cb(rb_fde_t *F) { - SSL_set_ex_data(F->ssl, libratbox_index, (char *)F); + SSL_set_ex_data(F->ssl, librb_index, (char *)F); SSL_set_info_callback((SSL *) F->ssl, (void (*)(const SSL *,int,int))rb_ssl_info_callback); } @@ -314,11 +314,11 @@ int rb_init_ssl(void) { int ret = 1; - char libratbox_data[] = "libratbox data"; - const char libratbox_ciphers[] = "kEECDH+HIGH:kEDH+HIGH:HIGH:!RC4:!aNULL"; + char librb_data[] = "librb data"; + const char librb_ciphers[] = "kEECDH+HIGH:kEDH+HIGH:HIGH:!RC4:!aNULL"; SSL_load_error_strings(); SSL_library_init(); - libratbox_index = SSL_get_ex_new_index(0, libratbox_data, NULL, NULL, NULL); + librb_index = SSL_get_ex_new_index(0, librb_data, NULL, NULL, NULL); #ifndef LRB_HAVE_TLS_METHOD_API ssl_server_ctx = SSL_CTX_new(SSLv23_server_method()); @@ -357,7 +357,7 @@ rb_init_ssl(void) SSL_CTX_set_options(ssl_server_ctx, server_options); SSL_CTX_set_verify(ssl_server_ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, verify_accept_all_cb); SSL_CTX_set_session_cache_mode(ssl_server_ctx, SSL_SESS_CACHE_OFF); - SSL_CTX_set_cipher_list(ssl_server_ctx, libratbox_ciphers); + SSL_CTX_set_cipher_list(ssl_server_ctx, librb_ciphers); /* Set ECDHE on OpenSSL 1.00+, but make sure it's actually available because redhat are dicks and bastardise their OpenSSL for stupid reasons... */ @@ -390,7 +390,7 @@ rb_init_ssl(void) SSL_CTX_set_options(ssl_client_ctx, SSL_OP_NO_TICKET); #endif - SSL_CTX_set_cipher_list(ssl_client_ctx, libratbox_ciphers); + SSL_CTX_set_cipher_list(ssl_client_ctx, librb_ciphers); return ret; } diff --git a/librb/src/patricia.c b/librb/src/patricia.c index 3b577020e..88f22077a 100644 --- a/librb/src/patricia.c +++ b/librb/src/patricia.c @@ -2,7 +2,7 @@ * Yanked out of Net::Patricia by Aaron Sethman * * This was then yanked out of the ratbox/devel/src tree and stuffed into - * libratbox and had function names changed, but otherwise not really altered. + * librb and had function names changed, but otherwise not really altered. * * $Id: patricia.c 24244 2007-08-22 19:04:55Z androsyn $ * Dave Plonka @@ -20,8 +20,8 @@ * Network, Inc., and their contributors. * */ -#include -#include +#include +#include /* Enable both of these to debug patricia.c * #define NOTYET 1 diff --git a/librb/src/poll.c b/librb/src/poll.c index f4b0dcf08..f53851b51 100644 --- a/librb/src/poll.c +++ b/librb/src/poll.c @@ -24,8 +24,8 @@ * * $Id: poll.c 26092 2008-09-19 15:13:52Z androsyn $ */ -#include -#include +#include +#include #include #if defined(HAVE_POLL) && (HAVE_SYS_POLL_H) diff --git a/librb/src/ports.c b/librb/src/ports.c index 505ff4819..af0257189 100644 --- a/librb/src/ports.c +++ b/librb/src/ports.c @@ -26,8 +26,8 @@ * $Id: ports.c 26286 2008-12-10 23:28:53Z androsyn $ */ -#include -#include +#include +#include #include #include #if defined(HAVE_PORT_H) && (HAVE_PORT_CREATE) diff --git a/librb/src/rawbuf.c b/librb/src/rawbuf.c index 72e83c89b..29b06fbfd 100644 --- a/librb/src/rawbuf.c +++ b/librb/src/rawbuf.c @@ -22,8 +22,8 @@ * * $Id$ */ -#include -#include +#include +#include #include #define RAWBUF_SIZE 1024 diff --git a/librb/src/ratbox_lib.c b/librb/src/rb_lib.c similarity index 96% rename from librb/src/ratbox_lib.c rename to librb/src/rb_lib.c index 099107e23..54fe3bf52 100644 --- a/librb/src/ratbox_lib.c +++ b/librb/src/rb_lib.c @@ -1,6 +1,6 @@ /* * ircd-ratbox: A slightly useful ircd. - * ratbox_lib.c: libircd initialization functions at the like + * rb_lib.c: libircd initialization functions at the like * * Copyright (C) 2005,2006 ircd-ratbox development team * Copyright (C) 2005,2006 Aaron Sethman @@ -20,11 +20,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA * - * $Id: ratbox_lib.c 26282 2008-12-10 20:33:21Z androsyn $ + * $Id: rb_lib.c 26282 2008-12-10 20:33:21Z androsyn $ */ -#include -#include +#include +#include #include #include @@ -184,7 +184,7 @@ rb_set_time(void) memcpy(&rb_time, &newtime, sizeof(struct timeval)); } -extern const char *libratbox_serno; +extern const char *librb_serno; const char * rb_lib_version(void) @@ -192,7 +192,7 @@ rb_lib_version(void) static char version_info[512]; char ssl_info[512]; rb_get_ssl_info(ssl_info, sizeof(ssl_info)); - snprintf(version_info, sizeof(version_info), "libratbox version: %s - %s", libratbox_serno, ssl_info); + snprintf(version_info, sizeof(version_info), "librb version: %s - %s", librb_serno, ssl_info); return version_info; } diff --git a/librb/src/rb_memory.c b/librb/src/rb_memory.c index 0322419ae..3caa06ca9 100644 --- a/librb/src/rb_memory.c +++ b/librb/src/rb_memory.c @@ -23,8 +23,8 @@ * * $Id: rb_memory.c 26092 2008-09-19 15:13:52Z androsyn $ */ -#include -#include +#include +#include void rb_outofmemory(void) diff --git a/librb/src/select.c b/librb/src/select.c index c0b736c29..6425e49d2 100644 --- a/librb/src/select.c +++ b/librb/src/select.c @@ -25,8 +25,8 @@ * $Id: select.c 26092 2008-09-19 15:13:52Z androsyn $ */ #define FD_SETSIZE 65535 -#include -#include +#include +#include #include #if defined(HAVE_SELECT) || defined(_WIN32) diff --git a/librb/src/sigio.c b/librb/src/sigio.c index 2419dd813..b847d0b02 100644 --- a/librb/src/sigio.c +++ b/librb/src/sigio.c @@ -30,8 +30,8 @@ #define _GNU_SOURCE 1 /* Needed for F_SETSIG */ #endif -#include -#include +#include +#include #include #include #include /* Yes this needs to be before the ifdef */ diff --git a/librb/src/tools.c b/librb/src/tools.c index 71f5e9c9b..0f4b68c14 100644 --- a/librb/src/tools.c +++ b/librb/src/tools.c @@ -33,8 +33,8 @@ * on supported compilers */ #define _GNU_SOURCE 1 -#include -#include +#include +#include #include diff --git a/librb/src/unix.c b/librb/src/unix.c index c4ba29160..31ecac352 100644 --- a/librb/src/unix.c +++ b/librb/src/unix.c @@ -23,8 +23,8 @@ * * $Id: unix.c 26180 2008-11-11 00:00:12Z androsyn $ */ -#include -#include +#include +#include #ifndef _WIN32 diff --git a/librb/src/version.c.SH b/librb/src/version.c.SH index 9fed74b30..51f977b86 100644 --- a/librb/src/version.c.SH +++ b/librb/src/version.c.SH @@ -3,7 +3,7 @@ # $Id: version.c.SH 24870 2008-01-10 16:51:01Z androsyn $ spitshell=cat -package=libratbox +package=librb echo "Extracting $package/src/version.c..." @@ -19,7 +19,7 @@ generation=`expr $generation + 1` $spitshell >version.c <version.c < -#include +#include +#include #include #ifdef _WIN32 diff --git a/tools/mkpasswd.c b/tools/mkpasswd.c index f5d2bbfe8..de1ccc1bd 100644 --- a/tools/mkpasswd.c +++ b/tools/mkpasswd.c @@ -16,7 +16,7 @@ #include #include #include -#include "ratbox_lib.h" +#include "rb_lib.h" #ifndef __MINGW32__ #include #endif