1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 17:04:47 +02:00

Reverting my last 2 commits in an attempt to fix my own screwball mistake.

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1873 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2008-12-29 09:02:03 +00:00
parent 6a2c0a7785
commit e0c10d684e
32 changed files with 111 additions and 13821 deletions
-5
View File
@@ -1,5 +0,0 @@
/autom4te.cache
Makefile
config.cache
config.log
config.status
+3 -8
View File
@@ -4,11 +4,6 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# If the Source dir and the Binary dir are the same, we are building in-source, which we will disallow due to Autotools being there (but only on non-Windows)
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32)
message(FATAL_ERROR "You can not use CMake to build Anope from the root of it's source tree! Remove the CMakeCache.txt file from this directory, then create a separate directory (either below this directory or elsewhere), and then re-run CMake from there.")
endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR} AND NOT WIN32)
# Detect is we are using CMake 2.6 or better, these versions include functions that require less work than CMake 2.4 does
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
set(CMAKE26_OR_BETTER TRUE)
@@ -291,9 +286,9 @@ find_program(PERL perl)
# If perl is included on the system and the user wants to use run-cc.pl, change the commands for compiling and linking
if(PERL AND USE_RUN_CC_PL)
set(CMAKE_CXX_COMPILE_OBJECT "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_COMPILE_OBJECT}")
set(CMAKE_CXX_LINK_EXECUTABLE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_LINK_EXECUTABLE}")
set(CMAKE_CXX_CREATE_SHARED_MODULE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl -q ${CMAKE_CXX_CREATE_SHARED_MODULE}")
set(CMAKE_CXX_COMPILE_OBJECT "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl ${CMAKE_CXX_COMPILE_OBJECT}")
set(CMAKE_CXX_LINK_EXECUTABLE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl ${CMAKE_CXX_LINK_EXECUTABLE}")
set(CMAKE_CXX_CREATE_SHARED_MODULE "${PERL} ${Anope_SOURCE_DIR}/run-cc.pl ${CMAKE_CXX_CREATE_SHARED_MODULE}")
endif(PERL AND USE_RUN_CC_PL)
# If a INSTDIR was passed in to CMake, use it as the install prefix, otherwise set the default install prefix to the services directory under the user's home directory
+27 -88
View File
@@ -36,7 +36,7 @@ Load_Cache () {
fi
}
Run_Build_System () {
Run_CMake () {
WITH_INST=""
WITH_RUN=""
WITH_PERM=""
@@ -44,77 +44,42 @@ Run_Build_System () {
RUN_CC_PL=""
GEN_TYPE=""
if [ "$INSTDIR" != "" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_INST="-DINSTDIR:STRING=$INSTDIR"
else
WITH_INST="--with-instdir=$INSTDIR"
fi
if [ "$INSTDEST" != "" ] ; then
WITH_INST="-DINSTDIR:STRING=$INSTDEST"
fi
if [ "$RUNGROUP" != "" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_RUN="-DRUNGROUP:STRING=$RUNGROUP"
else
WITH_RUN="--with-rungroup=$RUNGROUP"
fi
WITH_RUN="-DRUNGROUP:STRING=$RUNGROUP"
fi
if [ "$UMASK" != "" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_PERM="-DDEFUMASK:STRING=$UMASK"
else
WITH_PERM="--with-permissions=$UMASK"
fi
WITH_PERM="-DDEFUMASK:STRING=$UMASK"
fi
if [ "$DEBUG" = "yes" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=DEBUG"
else
BUILD_TYPE="--with-debugsym"
fi
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=DEBUG"
else
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
fi
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
fi
if [ "$USE_RUN_CC_PL" = "yes" ] ; then
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=ON"
else
pwdsave=`pwd`
cd "`dirname $SOURCE_DIR/run-cc.pl`"
RUN_CC_PL="--with-makebin=`pwd`/run-cc.pl"
cd "$pwdsave"
fi
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=ON"
else
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
else
RUN_CC_PL="--with-makebin="
fi
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
fi
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
case `uname -s` in
MINGW*)
GEN_TYPE="-G\"MSYS Makefiles\""
;;
esac
case `uname -s` in
MINGW*)
GEN_TYPE="-G\"MSYS Makefiles\""
;;
esac
echo "cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $SOURCE_DIR"
echo "cmake $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $SOURCE_DIR"
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $SOURCE_DIR
cmake $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $SOURCE_DIR
echo ""
echo "Now run make to build Anope."
else
echo "./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL"
./configure $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL
fi
echo ""
echo "Now run make to build Anope."
}
ECHO2SUF=''
@@ -134,11 +99,10 @@ export ECHO2 ECHO2SUF
# Init values
###########################################################################
BUILD_SYSTEM="cmake"
INSTDIR=$HOME/services
INSTDEST=$HOME/services
RUNGROUP=
UMASK=
DEBUG="yes"
DEBUG="no"
USE_RUN_CC_PL="no"
CAN_QUICK="no"
SOURCE_DIR=`dirname $0`
@@ -163,7 +127,7 @@ while [ $# -ge 1 ] ; do
elif [ $1 = "-quick" -o $1 = "-q" ] ; then
Load_Cache
if [ "$CAN_QUICK" = "yes" ] ; then
Run_Build_System
Run_CMake
else
echo ""
echo "Can't find cache file (config.cache), aborting..."
@@ -211,36 +175,12 @@ export ok INPUT
ok=0
echo "Note: press Return for the default, or enter a new value."
echo "Are you using configure or cmake?"
while [ $ok -eq 0 ] ; do
echo2 "[$BUILD_SYSTEM] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$BUILD_SYSTEM
fi
case $INPUT in
cmake)
ok=1
;;
configure)
ok=1
;;
*)
echo "That is not a valid choice!"
ok=0
;;
esac
done
BUILD_SYSTEM=$INPUT
echo ""
ok=0
echo "In what directory do you want the binaries to be installed?"
while [ $ok -eq 0 ] ; do
echo2 "[$INSTDIR] "
echo2 "[$INSTDEST] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$INSTDIR
INPUT=$INSTDEST
fi
if [ ! -d "$INPUT" ] ; then
if exists "$INPUT" ; then
@@ -261,7 +201,7 @@ while [ $ok -eq 0 ] ; do
ok=1
fi
done
INSTDIR=$INPUT
INSTDEST=$INPUT
echo ""
@@ -370,8 +310,7 @@ echo ""
echo2 "Saving configuration results in config.cache... "
cat <<EOT >$SOURCE_DIR/config.cache
BUILD_SYSTEM="$BUILD_SYSTEM"
INSTDIR="$INSTDIR"
INSTDEST="$INSTDEST"
RUNGROUP="$RUNGROUP"
UMASK=$UMASK
DEBUG="$DEBUG"
@@ -381,7 +320,7 @@ echo "done."
################################################################################
# Build the build system string
# Build the CMake string
################################################################################
Run_Build_System
Run_CMake
-102
View File
@@ -1,102 +0,0 @@
CC=g++ # probably wrong but oh well.
INCLUDEDIR=../include
ANOPELIBS=@ANOPELIBS@
CFLAGS=@CFLAGS@ -Wall -ansi -pedantic -Wshadow
PROFILE=-pg
LDPROFILE=
SHELL=/bin/sh
INSTDIR=@INSTDIR@
MAKEBIN=@MAKEBIN@
INSTALL=@INSTALL@
RM=@RM@
CP=@CP@
TOUCH=@TOUCH@
LDFLAGS=@LDFLAGS@
RUNGROUP=@RUNGROUP@
SHARED=@SHARED@
MODULEFLAGS=@MODULEFLAGS@
all: language headers build core protocols tools modules
profile: language headers profile_build profile_core profile_protocols profile_tools profile_modules
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' \
'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' \
'MAKEBIN=${MAKEBIN}'
build: language headers
@${MAKE} -C src ${MAKEARGS} all
profile_build:
@${MAKE} -C src ${MAKEARGS} 'CFLAGS=${CFLAGS} $(PROFILE)' 'LDFLAGS=${LDFLAGS} ${PROFILE}' all
modules: build
@src/modules/configure src/modules
@${MAKE} -C src/modules ${MAKEARGS} all
@echo "*** All done, now (g)make install to install Anope/Modules";
clean_modules:
@${MAKE} -C src ${MAKEARGS} clean_modules
distclean_modules:
@${MAKE} -C src ${MAKEARGS} distclean_modules
protocols: build
@echo "*** Building protocol support";
@src/protocol/configure src/protocol
@${MAKE} -C src/protocol ${MAKEARGS} all
profile_protocols: build
@echo "*** Building protocol support";
@src/protocol/configure src/protocol
@${MAKE} -C src/protocol ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' all
core: build
@echo "*** Building Core modules";
@${MAKE} -C src ${MAKEARGS} core
profile_core: build
@echo "*** Building Core modules";
@${MAKE} -C src ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' core
tools: build
@${MAKE} -C src/tools ${MAKEARGS} all
@echo "*** All done, now (g)make install to install Anope/Modules/Tools";
profile_tools: profile_build
@${MAKE} -C src/tools ${MAKEARGS} 'CFLAGS=${CFLAGS} $(PROFILE)' all
@echo "*** All done, now (g)make install to install Anope/Modules/Tools";
profile_modules: profile_build
@src/modules/configure src/modules
@${MAKE} -C src/modules ${MAKEARGS} 'CFLAGS=${CFLAGS} ${PROFILE}' 'PROFILE=${PROFILE}' all
@echo "*** All done, now (g)make install to install Anope/Modules";
language:
@$(MAKE) -C lang ${MAKEARGS} all language.h
headers:
@${MAKE} -C include ${MAKEARGS}
clean:
${MAKE} -C lang ${MAKEARGS} clean
${MAKE} -C include ${MAKEARGS} clean
${MAKE} -C src ${MAKEARGS} clean
${MAKE} -C src/tools ${MAKEARGS} clean
distclean: clean
${MAKE} -C lang ${MAKEARGS} distclean
${MAKE} -C include ${MAKEARGS} distclean
${MAKE} -C src ${MAKEARGS} distclean
${MAKE} -C src/tools ${MAKEARGS} distclean
rm -f config.log config.status config.cache Makefile src/bin/anoperc
install: DUMMY
${MAKE} -C src ${MAKEARGS} install
${MAKE} -C src/tools ${MAKEARGS} install
@echo "*** All done, Anope is now installed. Please read docs/INSTALL for details on what to do now.";
DUMMY:
Vendored
-871
View File
@@ -1,871 +0,0 @@
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# lib-prefix.m4 serial 4 (gettext-0.14.2)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl require excessive bracketing.
ifdef([AC_HELP_STRING],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
dnl with the same --prefix option.
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
dnl libraries, but is otherwise very convenient.
AC_DEFUN([AC_LIB_PREFIX],
[
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib-prefix],
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
--without-lib-prefix don't search for libraries in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/lib"
fi
fi
])
if test $use_additional = yes; then
dnl Potentially add $additional_includedir to $CPPFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's already present in $CPPFLAGS,
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
for x in $CPPFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $CPPFLAGS.
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
fi
fi
fi
fi
dnl Potentially add $additional_libdir to $LDFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's already present in $LDFLAGS,
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/lib"; then
haveit=
for x in $LDFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_libdir" = "X/usr/local/lib"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LDFLAGS.
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
fi
fi
fi
fi
fi
])
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
dnl acl_final_exec_prefix, containing the values to which $prefix and
dnl $exec_prefix will expand at the end of the configure script.
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
[
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
acl_final_prefix="$ac_default_prefix"
else
acl_final_prefix="$prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
acl_final_exec_prefix='${prefix}'
else
acl_final_exec_prefix="$exec_prefix"
fi
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
prefix="$acl_save_prefix"
])
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
dnl variables prefix and exec_prefix bound to the values they will have
dnl at the end of the configure script.
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
[
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
exec_prefix="$acl_final_exec_prefix"
$1
exec_prefix="$acl_save_exec_prefix"
prefix="$acl_save_prefix"
])
# lib-link.m4 serial 6 (gettext-0.14.3)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
AC_PREREQ(2.50)
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
dnl augments the CPPFLAGS variable.
AC_DEFUN([AC_LIB_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
define([Name],[translit([$1],[./-], [___])])
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
AC_LIB_LINKFLAGS_BODY([$1], [$2])
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
])
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
AC_SUBST([LIB]NAME)
AC_SUBST([LTLIB]NAME)
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
dnl results of this search when this library appears as a dependency.
HAVE_LIB[]NAME=yes
undefine([Name])
undefine([NAME])
])
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
dnl searches for libname and the libraries corresponding to explicit and
dnl implicit dependencies, together with the specified include files and
dnl the ability to compile and link the specified testcode. If found, it
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
define([Name],[translit([$1],[./-], [___])])
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([$1], [$2])
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
dnl because if the user has installed lib[]Name and not disabled its use
dnl via --without-lib[]Name-prefix, he wants to use it.
ac_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LIB[]NAME"
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
LIBS="$ac_save_LIBS"
])
if test "$ac_cv_lib[]Name" = yes; then
HAVE_LIB[]NAME=yes
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
AC_MSG_CHECKING([how to link with lib[]$1])
AC_MSG_RESULT([$LIB[]NAME])
else
HAVE_LIB[]NAME=no
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
dnl $INC[]NAME either.
CPPFLAGS="$ac_save_CPPFLAGS"
LIB[]NAME=
LTLIB[]NAME=
fi
AC_SUBST([HAVE_LIB]NAME)
AC_SUBST([LIB]NAME)
AC_SUBST([LTLIB]NAME)
undefine([Name])
undefine([NAME])
])
dnl Determine the platform dependent parameters needed to use rpath:
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
dnl hardcode_direct, hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
. ./conftest.sh
rm -f ./conftest.sh
acl_cv_rpath=done
])
wl="$acl_cv_wl"
libext="$acl_cv_libext"
shlibext="$acl_cv_shlibext"
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
hardcode_direct="$acl_cv_hardcode_direct"
hardcode_minus_L="$acl_cv_hardcode_minus_L"
dnl Determine whether the user wants rpath handling at all.
AC_ARG_ENABLE(rpath,
[ --disable-rpath do not hardcode runtime library paths],
:, enable_rpath=yes)
])
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib$1-prefix],
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/lib"
fi
fi
])
dnl Search the library and its dependencies in $additional_libdir and
dnl $LDFLAGS. Using breadth-first-seach.
LIB[]NAME=
LTLIB[]NAME=
INC[]NAME=
rpathdirs=
ltrpathdirs=
names_already_handled=
names_next_round='$1 $2'
while test -n "$names_next_round"; do
names_this_round="$names_next_round"
names_next_round=
for name in $names_this_round; do
already_handled=
for n in $names_already_handled; do
if test "$n" = "$name"; then
already_handled=yes
break
fi
done
if test -z "$already_handled"; then
names_already_handled="$names_already_handled $name"
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
dnl or AC_LIB_HAVE_LINKFLAGS call.
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then
if test "$value" = yes; then
eval value=\"\$LIB$uppername\"
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
eval value=\"\$LTLIB$uppername\"
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
else
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
dnl that this library doesn't exist. So just drop it.
:
fi
else
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
dnl and the already constructed $LIBNAME/$LTLIBNAME.
found_dir=
found_la=
found_so=
found_a=
if test $use_additional = yes; then
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
found_dir="$additional_libdir"
found_so="$additional_libdir/lib$name.$shlibext"
if test -f "$additional_libdir/lib$name.la"; then
found_la="$additional_libdir/lib$name.la"
fi
else
if test -f "$additional_libdir/lib$name.$libext"; then
found_dir="$additional_libdir"
found_a="$additional_libdir/lib$name.$libext"
if test -f "$additional_libdir/lib$name.la"; then
found_la="$additional_libdir/lib$name.la"
fi
fi
fi
fi
if test "X$found_dir" = "X"; then
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
case "$x" in
-L*)
dir=`echo "X$x" | sed -e 's/^X-L//'`
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
found_dir="$dir"
found_so="$dir/lib$name.$shlibext"
if test -f "$dir/lib$name.la"; then
found_la="$dir/lib$name.la"
fi
else
if test -f "$dir/lib$name.$libext"; then
found_dir="$dir"
found_a="$dir/lib$name.$libext"
if test -f "$dir/lib$name.la"; then
found_la="$dir/lib$name.la"
fi
fi
fi
;;
esac
if test "X$found_dir" != "X"; then
break
fi
done
fi
if test "X$found_dir" != "X"; then
dnl Found the library.
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
if test "X$found_so" != "X"; then
dnl Linking with a shared library. We attempt to hardcode its
dnl directory into the executable's runpath, unless it's the
dnl standard /usr/lib.
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
dnl Use an explicit option to hardcode DIR into the resulting
dnl binary.
dnl Potentially add DIR to ltrpathdirs.
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
haveit=
for x in $ltrpathdirs; do
if test "X$x" = "X$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
ltrpathdirs="$ltrpathdirs $found_dir"
fi
dnl The hardcoding into $LIBNAME is system dependent.
if test "$hardcode_direct" = yes; then
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
dnl resulting binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
dnl Use an explicit option to hardcode DIR into the resulting
dnl binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
dnl Potentially add DIR to rpathdirs.
dnl The rpathdirs will be appended to $LIBNAME at the end.
haveit=
for x in $rpathdirs; do
if test "X$x" = "X$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
rpathdirs="$rpathdirs $found_dir"
fi
else
dnl Rely on "-L$found_dir".
dnl But don't add it if it's already contained in the LDFLAGS
dnl or the already constructed $LIBNAME
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
fi
if test "$hardcode_minus_L" != no; then
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
dnl here, because this doesn't fit in flags passed to the
dnl compiler. So give up. No hardcoding. This affects only
dnl very old systems.
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
fi
fi
fi
fi
else
if test "X$found_a" != "X"; then
dnl Linking with a static library.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
else
dnl We shouldn't come here, but anyway it's good to have a
dnl fallback.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
fi
fi
dnl Assume the include files are nearby.
additional_includedir=
case "$found_dir" in
*/lib | */lib/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
additional_includedir="$basedir/include"
;;
esac
if test "X$additional_includedir" != "X"; then
dnl Potentially add $additional_includedir to $INCNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
dnl 3. if it's already present in $CPPFLAGS or the already
dnl constructed $INCNAME,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
for x in $CPPFLAGS $INC[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $INCNAME.
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
fi
fi
fi
fi
fi
dnl Look for dependencies.
if test -n "$found_la"; then
dnl Read the .la file. It defines the variables
dnl dlname, library_names, old_library, dependency_libs, current,
dnl age, revision, installed, dlopen, dlpreopen, libdir.
save_libdir="$libdir"
case "$found_la" in
*/* | *\\*) . "$found_la" ;;
*) . "./$found_la" ;;
esac
libdir="$save_libdir"
dnl We use only dependency_libs.
for dep in $dependency_libs; do
case "$dep" in
-L*)
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/lib"; then
haveit=
if test "X$additional_libdir" = "X/usr/local/lib"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LIBNAME.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
fi
fi
haveit=
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LTLIBNAME.
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
fi
fi
fi
fi
;;
-R*)
dir=`echo "X$dep" | sed -e 's/^X-R//'`
if test "$enable_rpath" != no; then
dnl Potentially add DIR to rpathdirs.
dnl The rpathdirs will be appended to $LIBNAME at the end.
haveit=
for x in $rpathdirs; do
if test "X$x" = "X$dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
rpathdirs="$rpathdirs $dir"
fi
dnl Potentially add DIR to ltrpathdirs.
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
haveit=
for x in $ltrpathdirs; do
if test "X$x" = "X$dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
ltrpathdirs="$ltrpathdirs $dir"
fi
fi
;;
-l*)
dnl Handle this in the next round.
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
;;
*.la)
dnl Handle this in the next round. Throw away the .la's
dnl directory; it is already contained in a preceding -L
dnl option.
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
;;
*)
dnl Most likely an immediate library name.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
;;
esac
done
fi
else
dnl Didn't find the library; assume it is in the system directories
dnl known to the linker and runtime loader. (All the system
dnl directories known to the linker should also be known to the
dnl runtime loader, otherwise the system is severely misconfigured.)
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
fi
fi
fi
done
done
if test "X$rpathdirs" != "X"; then
if test -n "$hardcode_libdir_separator"; then
dnl Weird platform: only the last -rpath option counts, the user must
dnl pass all path elements in one option. We can arrange that for a
dnl single library, but not when more than one $LIBNAMEs are used.
alldirs=
for found_dir in $rpathdirs; do
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
done
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
acl_save_libdir="$libdir"
libdir="$alldirs"
eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
else
dnl The -rpath options are cumulative.
for found_dir in $rpathdirs; do
acl_save_libdir="$libdir"
libdir="$found_dir"
eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
done
fi
fi
if test "X$ltrpathdirs" != "X"; then
dnl When using libtool, the option that works for both libraries and
dnl executables is -R. The -R options are cumulative.
for found_dir in $ltrpathdirs; do
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
done
fi
])
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
dnl unless already present in VAR.
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
dnl contains two or three consecutive elements that belong together.
AC_DEFUN([AC_LIB_APPENDTOVAR],
[
for element in [$2]; do
haveit=
for x in $[$1]; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X$element"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
[$1]="${[$1]}${[$1]:+ }$element"
fi
done
])
# lib-ld.m4 serial 3 (gettext-0.13)
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl Subroutines of libtool.m4,
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
dnl with libtool.m4.
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
AC_DEFUN([AC_LIB_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
acl_cv_prog_gnu_ld=yes ;;
*)
acl_cv_prog_gnu_ld=no ;;
esac])
with_gnu_ld=$acl_cv_prog_gnu_ld
])
dnl From libtool-1.4. Sets the variable LD.
AC_DEFUN([AC_LIB_PROG_LD],
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
# Prepare PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh
echo "exit 0" >>conf$$.sh
chmod +x conf$$.sh
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conf$$.sh
fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]* | [A-Za-z]:[\\/]*)]
[re_direlt='/[^/][^/]*/\.\./']
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(acl_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break ;;
*)
test "$with_gnu_ld" != yes && break ;;
esac
fi
done
IFS="$ac_save_ifs"
else
acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$acl_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])
dnl Macro: anope_CHECK_TYPE_SIZES
dnl
dnl Check the size of several types and define a valid int16_t and int32_t.
dnl
AC_DEFUN(anope_CHECK_TYPE_SIZES,
[dnl Check type sizes
dnl AC_CHECK_SIZEOF(short)
dnl AC_CHECK_SIZEOF(int)
dnl AC_CHECK_SIZEOF(long)
dnl if test "$ac_cv_sizeof_int" = 2 ; then
dnl AC_CHECK_TYPE(int16_t, int)
dnl AC_CHECK_TYPE(u_int16_t, unsigned int)
dnl elif test "$ac_cv_sizeof_short" = 2 ; then
dnl AC_CHECK_TYPE(int16_t, short)
dnl AC_CHECK_TYPE(u_int16_t, unsigned short)
dnl else
dnl AC_MSG_ERROR([Cannot find a type with size of 16 bits])
dnl fi
dnl if test "$ac_cv_sizeof_int" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, int)
dnl AC_CHECK_TYPE(u_int32_t, unsigned int)
dnl elif test "$ac_cv_sizeof_short" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, short)
dnl AC_CHECK_TYPE(u_int32_t, unsigned short)
dnl elif test "$ac_cv_sizeof_long" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, long)
dnl AC_CHECK_TYPE(u_int32_t, unsigned long)
dnl else
dnl AC_MSG_ERROR([Cannot find a type with size of 32 bits])
dnl fi
AC_CHECK_TYPE(uint8_t, AC_DEFINE(HAVE_UINT8_T, 1, "Has uint8_t type"))
AC_CHECK_TYPE(u_int8_t, AC_DEFINE(HAVE_U_INT8_T, 1, "Has u_int8_t type"))
AC_CHECK_TYPE(int16_t, AC_DEFINE(HAVE_INT16_T, 1, "Has int16_t type"))
AC_CHECK_TYPE(uint16_t, AC_DEFINE(HAVE_UINT16_T, 1, "Has uint16_t type"))
AC_CHECK_TYPE(u_int16_t, AC_DEFINE(HAVE_U_INT16_T, 1, "Has u_int16_t type"))
AC_CHECK_TYPE(int32_t, AC_DEFINE(HAVE_INT32_T, 1, "Has int32_t type"))
AC_CHECK_TYPE(uint32_t, AC_DEFINE(HAVE_UINT32_T, 1, "Has uint32_t type"))
AC_CHECK_TYPE(u_int32_t, AC_DEFINE(HAVE_U_INT32_T, 1, "Has u_int32_t type"))
])
-39
View File
@@ -1,39 +0,0 @@
dnl Macro: anope_CHECK_TYPE_SIZES
dnl
dnl Check the size of several types and define a valid int16_t and int32_t.
dnl
AC_DEFUN(anope_CHECK_TYPE_SIZES,
[dnl Check type sizes
dnl AC_CHECK_SIZEOF(short)
dnl AC_CHECK_SIZEOF(int)
dnl AC_CHECK_SIZEOF(long)
dnl if test "$ac_cv_sizeof_int" = 2 ; then
dnl AC_CHECK_TYPE(int16_t, int)
dnl AC_CHECK_TYPE(u_int16_t, unsigned int)
dnl elif test "$ac_cv_sizeof_short" = 2 ; then
dnl AC_CHECK_TYPE(int16_t, short)
dnl AC_CHECK_TYPE(u_int16_t, unsigned short)
dnl else
dnl AC_MSG_ERROR([Cannot find a type with size of 16 bits])
dnl fi
dnl if test "$ac_cv_sizeof_int" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, int)
dnl AC_CHECK_TYPE(u_int32_t, unsigned int)
dnl elif test "$ac_cv_sizeof_short" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, short)
dnl AC_CHECK_TYPE(u_int32_t, unsigned short)
dnl elif test "$ac_cv_sizeof_long" = 4 ; then
dnl AC_CHECK_TYPE(int32_t, long)
dnl AC_CHECK_TYPE(u_int32_t, unsigned long)
dnl else
dnl AC_MSG_ERROR([Cannot find a type with size of 32 bits])
dnl fi
AC_CHECK_TYPE(uint8_t, AC_DEFINE(HAVE_UINT8_T, 1, "Has uint8_t type"))
AC_CHECK_TYPE(u_int8_t, AC_DEFINE(HAVE_U_INT8_T, 1, "Has u_int8_t type"))
AC_CHECK_TYPE(int16_t, AC_DEFINE(HAVE_INT16_T, 1, "Has int16_t type"))
AC_CHECK_TYPE(uint16_t, AC_DEFINE(HAVE_UINT16_T, 1, "Has uint16_t type"))
AC_CHECK_TYPE(u_int16_t, AC_DEFINE(HAVE_U_INT16_T, 1, "Has u_int16_t type"))
AC_CHECK_TYPE(int32_t, AC_DEFINE(HAVE_INT32_T, 1, "Has int32_t type"))
AC_CHECK_TYPE(uint32_t, AC_DEFINE(HAVE_UINT32_T, 1, "Has uint32_t type"))
AC_CHECK_TYPE(u_int32_t, AC_DEFINE(HAVE_U_INT32_T, 1, "Has u_int32_t type"))
])
-13
View File
@@ -1,13 +0,0 @@
#!/bin/sh
echo "Generating build information using aclocal, autoheader, automake and autoconf."
echo
# Regerate configuration files
aclocal
autoheader
automake --gnu --add-missing --copy
autoconf
echo
echo "Now you are ready to run ./configure"
-1526
View File
File diff suppressed because it is too large Load Diff
Vendored
-1662
View File
File diff suppressed because it is too large Load Diff
Vendored
-8159
View File
File diff suppressed because it is too large Load Diff
-290
View File
@@ -1,290 +0,0 @@
dnl autoconf.in for Services.
dnl
dnl Anope (c) 2003-2008 Anope team
dnl Contact us at dev@anope.org
dnl This program is free but copyrighted software; see the file COPYING for
dnl details.
dnl Based heavily on the Unreal configure.in script, and extra thanks to
dnl codemastr from UnrealIRCD.
AC_INIT
# Clear out any CFLAGS (cept -g) the os is using, usually -g -O2
CFLAGS="-g"
# If no bindir, we tell him to run ./Config.
if test "${with_instdir+set}" != set; then
echo "You might want to run ./Config or provide some parameters to this script."
echo "./configure --help for information about this script"
exit 0
fi
AC_CONFIG_SRCDIR([src/actions.c])
AC_CONFIG_HEADER(include/sysconf.h)
AC_PROG_CC
if test "$ac_cv_c_compiler_gnu" = "yes"; then
# CFLAGS="$CFLAGS -funsigned-char"
AC_CACHE_CHECK(if gcc has a working -pipe, ac_cv_pipe, [
save_cflags="$CFLAGS"
CFLAGS="$CFLAGS -pipe"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[ac_cv_pipe="yes"],[ac_cv_pipe="no"])
CFLAGS="$save_cflags"
])
if test "$ac_cv_pipe" = "yes"; then
CFLAGS="-pipe $CFLAGS"
fi
fi
dnl CFLAGS="$CFLAGS -W -Wall"
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(CP,cp)
AC_PATH_PROG(TOUCH,touch)
AC_PATH_PROG(INSTALL,install)
AC_CHECK_LIB(nsl,inet_ntoa,ANOPELIBS="$ANOPELIBS-lnsl ")
AC_CHECK_LIB(socket, socket,ANOPELIBS="$ANOPELIBS-lsocket ")
AC_CHECK_LIB(resolv, res_query,ANOPELIBS="$ANOPELIBS-lresolv ")
AC_CHECK_LIB(bsd, revoke,ANOPELIBS="$ANOPELIBS-lbsd ")
dnl Does this platform require array notation to assign to a va_list?
dnl If cross-compiling, we assume va_list is "normal". If this breaks
dnl you, set ac_cv_valistisarray=true and maybe define HAVE_VA_LIST_AS_ARRAY
dnl also just to be sure.
dnl NOTE: this autoconf test is taken from mozilla: www.mozilla.org.
AC_MSG_CHECKING(whether va_list assignments need array notation)
AC_CACHE_VAL(ac_cv_valistisarray,
[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
#include <stdarg.h>
void foo(int i, ...) {
va_list ap1, ap2;
va_start(ap1, i);
ap2 = ap1;
if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123) { exit(1); }
va_end(ap1); va_end(ap2);
}
int main()
{ foo(0, 123); return(0); }]])],[ac_cv_valistisarray=false],[ac_cv_valistisarray=true],[ac_cv_valistisarray=false])])
if test "$ac_cv_valistisarray" = true ; then
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY,[1],[va_list as array])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
DIS_MYSQL=" MySQL: No"
AC_ARG_WITH(mysql, [ --without-mysql Do not use MySQL or attempt to find it],,[
AC_ARG_WITH(mysqlconfig-path, [ --with-mysqlconfig-path=PATH Complete path to the mysql_config executable],
mysql_config_path="$withval", mysql_config_path="")
MYSQLCONF=""
if test "$mysql_config_path" != ""; then
if test -x "$mysql_config_path"; then
MYSQLCONF="$mysql_config_path"
echo "checking for mysql_config... $MYSQLCONF" >&6
fi
fi
if test "$MYSQLCONF" = ""; then
AC_PATH_PROG(MYSQLCONF,mysql_config, "")
fi
if test "$MYSQLCONF" != ""; then
hold_cflags="$CFLAGS"
hold_ldflags="$LDFLAGS"
if test "$MYSQL_CFLAGS" = ""; then
MYSQL_CFLAGS="`$MYSQLCONF --cflags`"
fi
if test "$MYSQL_LDFLAGS" = ""; then
MYSQL_LDFLAGS="`$MYSQLCONF --libs`"
fi
CFLAGS="$CFLAGS $MYSQL_CFLAGS"
LDFLAGS="$LDFLAGS $MYSQL_LDFLAGS"
echo $ECHO_N "checking if mysql_config produces valid values... $ECHO_C" >&6
AC_TRY_RUN([
#include <mysql.h>
int main()
{
MYSQL *mysql = mysql_init(0);
return 0;
}
], ac_cv_mysql_valid=yes, ac_cv_mysql_valid=no)
echo $ac_cv_mysql_valid >&6
if test "$ac_cv_mysql_valid" = "yes"; then
DIS_MYSQL=" MySQL: Yes"
else
CFLAGS="$hold_cflags"
LDFLAGS="$hold_ldflags"
fi
fi
])
AC_MSG_CHECKING(whether this is a bit or little endian system)
AC_TRY_RUN([
int main()
{
short s = 1;
short* ptr = &s;
unsigned char c = *((char*)ptr);
return c;
}
]
, AC_DEFINE(BIG_ENDIAN)
AC_MSG_RESULT(big)
, AC_DEFINE(LITTLE_ENDIAN)
AC_MSG_RESULT(little)
)
AC_SUBST(ANOPELIBS)
AC_SUBST(LDFLAGS)
AC_CHECK_HEADER(sys/types.h,AC_DEFINE(HAS_SYS_TYPES_H,1,"Has sys/types.h"))
dnl module checking based on Unreal's module checking code
AC_DEFUN(AC_ENABLE_DYN,
[
AC_CHECK_FUNC(dlopen,, AC_CHECK_LIB(dl,dlopen,[
ANOPELIBS="$ANOPELIBS -ldl"
],
[
AC_ERROR("dlopen() is required for Anope to be compiled and used. Sorry.")
]))
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -export-dynamic"
AC_CACHE_CHECK(if we need the -export-dynamic flag, ac_cv_export_dynamic, [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],[ac_cv_export_dynamic=yes],[ac_cv_export_dynamic=no])])
if test "$ac_cv_export_dynamic" = "no"; then
CFLAGS=$hold_cflags
fi
AC_CACHE_CHECK(for compiler option to produce PIC,ac_cv_pic,[
if test "$ac_cv_c_compiler_gnu" = "yes"; then
ac_cv_pic="-fPIC -DPIC -shared"
case `uname -s` in
Darwin*[)]
ac_cv_pic="-bundle -flat_namespace -undefined suppress"
;;
HP-UX*[)]
ac_cv_pic="-fPIC"
;;
esac
else
case `uname -s` in
SunOS*[)]
ac_cv_pic="-KPIC -DPIC -G"
;;
esac
fi
])
if test "$ac_cv_c_compiler_gnu" = "yes"; then
case `uname -s` in
Darwin*[)]
SHARED="-bundle -flat_namespace -undefined suppress"
AC_SUBST(SHARED)
;;
*[)]
SHARED="-shared"
AC_SUBST(SHARED)
;;
esac
fi
AC_CACHE_CHECK(if your system prepends an underscore on symbols,ac_cv_underscore,[
cat >uscore.c << __EOF__
int main() {
return 0;
}
__EOF__
$CC -o uscore $CFLAGS uscore.c 1>&5
if test -z "`strings -a uscore |grep '^_main$'`"; then
ac_cv_underscore=no
else
ac_cv_underscore=yes
fi
rm -f uscore uscore.c
])
if test "$ac_cv_underscore" = "yes"; then
AC_DEFINE(DL_PREFIX,"_","Underscore needed for dlopen")
else
AC_DEFINE(DL_PREFIX,"","No prefix needed for dlopen")
fi
MODULEFLAGS=$ac_cv_pic
AC_SUBST(MODULEFLAGS)
])
AC_ENABLE_DYN
anope_CHECK_TYPE_SIZES
AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H,1,""))
AC_CHECK_HEADER(sys/select.h,AC_DEFINE(HAVE_SYS_SELECT_H,1,""))
AC_CHECK_FUNCS(backtrace,AC_DEFINE(HAVE_BACKTRACE,1))
AC_CHECK_FUNCS(stricmp,AC_DEFINE(HAVE_STRICMP,1))
AC_CHECK_FUNCS(strcasecmp,AC_DEFINE(HAVE_STRCASECMP,1))
AC_CHECK_FUNCS(gettimeofday,AC_DEFINE(HAVE_GETTIMEOFDAY,1))
AC_CHECK_FUNCS(setgrent,AC_DEFINE(HAVE_SETGRENT,1))
AC_CHECK_FUNCS(umask,AC_DEFINE(HAVE_UMASK,1))
AC_CHECK_FUNCS(fork,AC_DEFINE(HAVE_FORK,1))
AC_CHECK_FUNCS(gethostbyname,AC_DEFINE(HAVE_GETHOSTBYNAME,1))
AC_CHECK_FUNCS(gethostbyname_r,AC_DEFINE(HAVE_GETHOSTBYNAME_R,1))
AC_CHECK_FUNCS(strlcpy,AC_DEFINE(HAVE_STRLCPY,1))
AC_CHECK_FUNCS(strlcat,AC_DEFINE(HAVE_STRLCAT,1))
AC_ARG_WITH(rungroup, [ --with-rungroup=group Specify the rungroup for anope], [
AC_DEFINE_UNQUOTED(RUNGROUP,"$withval","Run group")
RUNGROUP=$withval
])
AC_SUBST(RUNGROUP)
dnl AC_DEFINE_UNQUOTED(MYOSNAME,"`uname -a`","uname")
AC_ARG_WITH(permissions, [ --with-permissions=permissions Specify the default permissions for anope], AC_DEFINE_UNQUOTED(DEFUMASK,$withval,"Default umask permissions"), AC_DEFINE(DEFUMASK, 007,"Default umask Permissions"))
AC_ARG_WITH(instdir, [ --with-instdir=instdir Specify the default install dir for anope], [
INSTDIR=$withval
])
MAKEBIN=`pwd`/run-cc.pl
AC_ARG_WITH(makebin, [--with-makebin=run-cc.pl Specify the default make binary to use],[MAKEBIN=$withval])
AC_SUBST(INSTDIR)
AC_SUBST(MAKEBIN)
AC_ARG_WITH(optimization, [ --with-optimization=1|2|3|4|5 Specify the optimization level], [
CFLAGS="$CFLAGS -O$withval"
])
AC_ARG_WITH(debugsym, [ --with-debugsym Include debugging symbols], [
CFLAGS="$CFLAGS -g"
])
AC_CONFIG_FILES( \
Makefile \
src/bin/anoperc \
)
AC_OUTPUT
cat <<EOT
$DIS_MODULES
$DIS_MYSQL
All done! Now run "make" (or possibly "gmake") to compile Anope.
See the INSTALL, README and FAQ files if you have any problems.
EOT
+9 -29
View File
@@ -6,7 +6,7 @@ Anope Installation Instructions
3) Setting up the IRCd
4) Starting Anope
5) Setting up a crontab
Note: You should also read the README and FAQ files!
1) Installing Anope
@@ -21,35 +21,15 @@ Note: You should also read the README and FAQ files!
http://www.anope.org/
Anope can be built one of two ways. The recommended way is to use CMake.
You can check if CMake is already installed on your system using the
command:
cmake --version
If it's installed, you will get a line that says something similar to
"cmake version 2.6-patch 1". If the version is less than 2.4 or you get
an error saying the command was not found, you will not be able to use
CMake unless you install it yourself into your home directory. CMake
can be downloaded from:
http://www.cmake.org/cmake/resources/software.html
If you are unable to install CMake yourself (either due to lack of space
or restrictions by your hosting provider), you still have the alternative
to use the provided configure script. This option is not recommended and
will eventually be phased out, but is provided for compatibility for those
lacking CMake.
Next, unpack the package in your home directory, and go into the created
directory.
Now type ./Config to start the configuration script. It will ask you a
few questions, and figure out how to compile Anope on your system. If
you are unsure about the answer to a question, use the default value.
The question to using configure or cmake depends on your decision from
above. If you have CMake and wish to use it, answer with cmake, otherwise
answer with configure.
you are unsure about the answer to a question, use the default value.
NOTE: although you may specify different binary and data paths, it is
RECOMMENDED that you use the same value for both.
You can now type make to compile Anope. If there are errors in the
Makefile, *try to use gmake* instead. If it still doesn't work, you (or
@@ -64,10 +44,10 @@ Note: You should also read the README and FAQ files!
the memos of any user.
If you see errors during this process, please mail us with the *complete*
error output, and don't forget to mention your OS, compiler and C++ library
versions.
error output, and don't forget to mention your OS, compiler and C library
versions.
Now go into the data directory (by default, ~/services/data). Copy the example
Now go into the data directory (by default, ~/services). Copy the example
configuration file (example.conf) to services.conf, and open the latter
with your favorite text editor. It contains all the configuration
directives Anope will use at startup. Read the instructions contained in
@@ -166,7 +146,7 @@ Note: You should also read the README and FAQ files!
If there are syntax errors in the configuration file they will be
displayed on the screen. Correct them until there are no errors anymore.
A successful startup won't generate any message.
A successful startup won't generate any message.
Give Services at least one minute to link to your network, as certain
IRCds on some OSes may be really slow for the link process. If nothing
+66 -80
View File
@@ -20,116 +20,82 @@ Anope for Windows
* Current Anope source:
http://sourceforge.net/project/showfiles.php?group_id=94081
* CMake:
http://www.cmake.org/cmake/resources/software.html
(NOTE: When installing, tell CMake to add itself to the PATH.)
If you have Visual C++ 6, 7 (.NET 2002/2003), 8 (2005), or 9 (2008) skip ahead to step 2, else you
If you have Visual C++ 6, 7 (.NET 2002/2003) or 8 (2005) skip ahead to step 2, else you
need to download the following free components from Microsoft. Once
downloaded, install these packages.
* Microsoft Visual C++ 2008 Express Edition:
http://www.microsoft.com/express/vc/
* Microsoft Visual C++ 2008 Express Edition:
http://www.microsoft.com/express/vc/
or
or
* Microsoft Visual C++ 2005 Express Edition:
http://www.microsoft.com/downloads/details.aspx?FamilyId=7B0B0339-613A-46E6-AB4D-080D4D4A8C4E&displaylang=en
http://msdn.microsoft.com/vstudio/express/visualc/download/
then download and install:
then download and install:
* Microsoft Windows PlatformSDK: (Requires WGA validation)
http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en
* Microsoft Windows 2008 SDK:
http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en
(NOTE: Although this says for Windows Server 2003, it does infact work on all supported
versions of Windows. When installing, you should select the Custom option, and ensure
that only the top selection, and the bottom selection are checked. This will cut down
install time dramatically)
or (if you prefer a smaller download)
* MySQL for Windows (only needed if building with MySQL enabled):
http://dev.mysql.com/
* Microsoft Windows 2003 Platform SDK: (Requires WGA validation)
http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en
(NOTE: Anope can be compiled against MySQL Version 3.23 and above)
(NOTE: Although they say for Windows Server 2003 or 2008, they do infact work on all supported
versions of Windows. When installing the 2003 SDK, you should select the Custom option, and only select
to have the Microsoft Windows Core SDK installed. When installing the 2008 SDK, you should select the
Custom option, and only select to have the Developer Tools installed, but also expand that and deselect
the Visual C++ Compilers as well as the Mobile Tools. Doing this will decrease the install time as well
as the space used by the SDK.)
If you chose to download the 2003 SDK, it will not work out-of-the-box on either Visual C++ 2005 Express or
Visual C++ 2008 Express. The 2008 SDK will work out-of-the-box with Visual C++ 2008 Express but not with
Visual C++ 2005 Express.
2) Unpack the Anope tarball with your favorite uncompression program
(WinZip or WinRAR, etc).
3) (Note before this step: If you fall under one of the situations at the end of Step 1 where it says that the
SDK will not work out of the box, do not bring up the Visual C++ Command Prompt by using the link in
the Windows Start Menu. Instead, edit vsvars32.bat in the directory where you unpacked the source code
in step 2, so the first line that says "@SET VSINSTALLDIR=<whatever>" has the directory where you installed
Visual C++ Express to, if different from the default. Save the file and then run it instead.)
Bring up the Visual C++ Command Prompt; This will launch a
3) Bring up the Visual C++ Command Prompt; This will launch a
DOS Command Prompt like window, which will set the environment
properties needed to make Anope.
Create a new directory, which will be used to hold the build files. You can make it
be a directory under the source directory unpacked in step 2, or somewhere else entirely.
Change directories to where you unpacked the source code in step 2, by typing:
Change directories to this new folder, by typing:
cd <path to build directory>
e.g.
cd c:\anope-build
cd <path to extracted source>
e.g.
cd c:\anope-trunk
4) You now need to configure Anope to your requirements. At the prompt type:
<path to source directory>\Config.bat
Config.bat
NOTE: If you run an Anti-Virus program such as McAfee or Norton, you may
be unable to run this command due to the protection in place. Some Anti-
Virus programs may detect the Anope Configuration Tool as a worm, however
this is not the case. If you are prompted to allow or deny execution of
this is not the case. If you are prompted to allow or deny execution of
the script, you should choose allow. If the script fails to run, and no
notice is displayed, please check your Anti-Virus settings before seeking
assistance.
An interactive configuration program should guide you through the install
options. You will be given a choice to use NMake or not. NMake will compile
inside the command prompt window you are in. If you want to build within
the Visual C++ IDE, say no to that option, and it'll create a Solution for
you to open up.
options, and then detect your Microsoft Visual C++ Library files. If it
fails to detect them, you should check you have everything installed.
If you cannot find whats causing the error, please visit our forums or
our IRC Support channel for assistance.
5) You are now ready to compile. At the prompt type:
5) You are now ready to compile. If you said you wanted to use NMake in step 4,
at the prompt type:
nmake
nmake -f Makefile.win32
Once you are back at the command prompt again, if there have been no
errors, you are ready to go.
If instead you decided to use the Visual C++ IDE, open up the Anope.sln
file. After the IDE has fully loaded, hit F7 to build everything.
errors, you are ready to go.
Should you encounter errors with the installation process, check the
messages displayed for advice on resolving them. If you are unable to
resolve the issues yourself, seek assistance on our forums or in our
IRC Support channel.
6) Finally you will need to install Anope. If you said you wanted to use NMake
in step 4, at the prompt type:
nmake install
Otherwise, if you decided to use the Visual C++ IDE, find the project called
INSTALL within the Solution Explorer. Right-click on INSTALL and choose Build.
When you have done this, all the files will be installed to where they belong.
The only thing you need to do is rename "data/example.conf" to be "data/services.conf",
and then follow the steps to set up Anope.
6) Anope will install the files where they belong. The only thing you need
to do is rename "data/example.conf" to be "data/services.conf".
You have now completed the building phase of Anope for Windows. You can
now move on to the next section, which is related to setting up Anope.
@@ -180,32 +146,52 @@ Anope for Windows
file to the end of the line. So if you have two files:
SRCS=file.c file2.c
If you are compiling a folder of module components, such as the example
"catserv", you will need to add/change the "SUBS=" line. If you were
compiling the "catserv" example, the line would look like this:
SUBS=catserv
B) When you've done this, use the same command prompt you set up in part
1, change directories to the src\modules folder, and type:
nmake -f Makefile.win32
followed afterwards, by:
nmake -f Makefile.win32 install
C) You should now be able to load your modules on IRC via OperServ, or via
the services.conf file.
4) Other compile options
A) If you have trouble recompiling Anope, you should delete all files and folders
within the build folder you created in step 3 of section 1. Afterwards, follow
the directions from step 4 of section 1 down.
A) If you have trouble recompiling Anope, you should try:
nmake -f Makefile.win32 distclean
This will clean up the source directory and allow for chages to be applied
to previously compiled files.
B) A list of valid options are:
install
distclean
clean
spotless
all
core
protocols
mypasql
languages
modules
The syntax for these options is:
nmake -f Makefile.win32 [option]
5) Credits
Anope is based on Epona and IRCServices. See CREDITS for more credits and
@@ -216,8 +202,8 @@ Anope for Windows
* Dominick Meglio <codemastr@unrealircd.com>
* Trystan Scott Lee <trystan@nomadirc.net>
* Chris Hogben <heinz@anope.org>
Anope's Windows Installer was made using:
* NSIS 2.20 <http://nsis.sourceforge.net>
-20
View File
@@ -1,20 +0,0 @@
all: services.h extern.h pseudo.h version.h
version.h: Makefile version.sh services.h pseudo.h messages.h $(SRCS)
sh version.sh ../version.log $@
services.h: sysconf.h config.h extern.h
touch $@
extern.h: slist.h
touch $@
pseudo.h: commands.h timeout.h encrypt.h datafiles.h slist.h
touch $@
clean:
(rm -f language.h)
distclean: clean
(rm -f sysconf.h version.h)
-122
View File
@@ -1,122 +0,0 @@
#ifndef _SYSCONF_H_
#define _SYSCONF_H_
#undef DEFUMASK
#undef HAVE_SYS_TYPES_H
#undef HAVE_STDINT_H
#undef HAVE_STDDEF_H
#undef HAVE_BACKTRACE
#undef HAVE_GETHOSTBYNAME
#undef HAVE_GETTIMEOFDAY
#undef HAVE_SETGRENT
#undef HAVE_STRCASECMP
#undef HAVE_STRICMP
#undef HAVE_STRINGS_H
#undef HAVE_STRLCAT
#undef HAVE_STRLCPY
#undef HAVE_SYS_SELECT_H
#undef HAVE_UMASK
#undef HAVE_VA_LIST_AS_ARRAY
#undef RUNGROUP
#define SERVICES_BIN "services"
#undef HAVE_UINT8_T
#undef HAVE_U_INT8_T
#undef HAVE_INT16_T
#undef HAVE_UINT16_T
#undef HAVE_U_INT16_T
#undef HAVE_INT32_T
#undef HAVE_UINT32_T
#undef HAVE_U_INT32_T
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
#ifdef HAVE_UINT8_T
typedef uint8_t uint8;
#else
# ifdef HAVE_U_INT8_T
typedef u_int8_t uint8;
# else
# ifdef _WIN32
typedef unsigned __int8 uint8;
# else
typedef unsigned short uint8;
# endif
# endif
#endif
#ifdef HAVE_INT16_T
typedef int16_t int16;
#else
# ifdef _WIN32
typedef signed __int16 int16;
# else
typedef int int16;
# endif
#endif
#ifdef HAVE_UINT16_T
typedef uint16_t uint16;
#else
# ifdef HAVE_U_INT16_T
typedef u_int16_t uint16;
# else
# ifdef _WIN32
typedef unsigned __int16 uint16;
# else
typedef unsigned int uint16;
# endif
# endif
#endif
#ifdef HAVE_INT32_T
typedef int32_t int32;
#else
# ifdef _WIN32
typedef signed __int32 int32;
# else
typedef long int32;
# endif
#endif
#ifdef HAVE_UINT32_T
typedef uint32_t uint32;
#else
# ifdef HAVE_U_INT32_T
typedef u_int32_t uint32;
# else
# ifdef _WIN32
typedef unsigned __int32 uint32;
# else
typedef unsigned long uint32;
# endif
# endif
#endif
#ifdef _WIN32
# ifdef MSVCPP
# define snprintf _snprintf
# endif
# define popen _popen
# define pclose _pclose
# define ftruncate _chsize
# ifdef MSVCPP
# define PATH_MAX MAX_PATH
# endif
# define MAXPATHLEN MAX_PATH
# define bzero(buf, size) memset(buf, 0, size)
# ifdef MSVCPP
# define strcasecmp stricmp
# endif
# define sleep(x) Sleep(x * 1000)
#endif
#endif
-29
View File
@@ -1,29 +0,0 @@
#!/bin/sh
SRC= ; DEST= ; MODE= ; USER= ; GROUP= ; export SRC DEST MODE USER GROUP
while [ $# -gt 0 ] ; do
case $1 in
-m) MODE=$2; shift; shift;;
-u) USER=$2; shift; shift;;
-g) GROUP=$2; shift; shift;;
-c) shift;;
*) SRC="$DEST"; DEST="$1"; shift;;
esac
done
if [ ! "$DEST" ] ; then
echo >&2 "Usage: $0 [-c] [-m mode] [-u user] [-g group] source dest"
exit 1
fi
if [ -d "$DEST" ] ; then
DEST="$DEST/$SRC"
fi
/bin/cp -p "$SRC" "$DEST"
if [ "$MODE" ] ; then
/bin/chmod $MODE "$DEST"
fi
if [ "$USER" ] ; then
/bin/chown "$USER" "$DEST"
fi
if [ "$GROUP" ] ; then
/bin/chgrp "$GROUP" "$DEST"
fi
View File
-82
View File
@@ -1,82 +0,0 @@
# Makefile for language module
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' 'MAKEBIN=${MAKEBIN}'
LANGOBJS = cat de en_us es fr gr hun it nl pl pt ru tr
LANGSRCS = cat.l de.l en_us.l es.l fr.l gr.l hun.l it.l nl.l pl.l pt.l ru.l tr.l
LANGCOMP = ./langcomp
#LANGCOMP = ./langcomp -w
all: $(LANGOBJS)
distclean: clean spotless
install: all
test -d $(INSTDIR)/data/languages || mkdir $(INSTDIR)/data/languages
@if [ "$(RUNGROUP)" ] ; then \
echo chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
echo chmod -R g+rw $(INSTDIR)/data/languages ; \
chmod -R g+rw $(INSTDIR)/data/languages ; \
$(CP) $(LANGOBJS) $(INSTDIR)/data/languages ; \
echo chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages ; \
chgrp -R $(RUNGROUP) $(INSTDIR)/data/languages/* ; \
echo chmod -R g+rw $(INSTDIR)/data/languages/* ; \
chmod -R g+rw $(INSTDIR)/data/languages/* ; \
fi
@if [ ! "$(RUNGROUP)" ] ; then \
chmod 700 $(INSTDIR)/data/languages/ ; \
$(CP) $(LANGOBJS) $(INSTDIR)/data/languages ; \
chmod 600 $(INSTDIR)/data/languages/* ; \
fi
clean:
rm -f $(LANGOBJS) langcomp language.h
spotless: clean
rm -f index
cat: cat.l langcomp index
@./langcomp $@.l $@
de: de.l langcomp index
@./langcomp $@.l $@
en_us: en_us.l langcomp index
@./langcomp $@.l $@
es: es.l langcomp index
@./langcomp $@.l $@
fr: fr.l langcomp index
@./langcomp $@.l $@
gr: gr.l langcomp index
@./langcomp $@.l $@
hun: hun.l langcomp index
@./langcomp $@.l $@
it: it.l langcomp index
@./langcomp $@.l $@
nl: nl.l langcomp index
@./langcomp $@.l $@
pl: pl.l langcomp index
@./langcomp $@.l $@
pt: pt.l langcomp index
@./langcomp $@.l $@
ru: ru.l langcomp index
@./langcomp $@.l $@
tr: tr.l langcomp index
@./langcomp $@.l $@
langcomp: langcomp.c
@$(MAKEBIN) $(CC) $(CFLAGS) langcomp.c -o $@
language.h: index Makefile
@perl -e <index >$@ 'print STDERR "Generating language.h... "; $$i=0; while (<>) { chop; printf "#define %-32s %d\n", $$_, $$i++; } print "\n#define NUM_STRINGS $$i\n"; print STDERR "$$i strings\n";'
@cp language.h ../include
index: en_us.l
@grep '^[A-Z]' en_us.l >index
+2 -15
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env perl
#!/usr/bin/perl
### THIS IS DESIGNED TO BE RUN BY MAKE! DO NOT RUN FROM THE SHELL (because it MIGHT sigterm the shell)! ###
@@ -16,16 +16,7 @@ use POSIX ();
# The subs are passed the message, and anything the regex captured.
my $flag = shift(@ARGV);
my $quiet = 0;
my $cc;
if ($flag eq "-q") {
$quiet = 1;
$cc = shift(@ARGV);
}
else {
$cc = $flag;
}
my $cc = shift(@ARGV);
my $showncmdline = 0;
@@ -160,10 +151,6 @@ die "Cannot fork to start $cc! $!\n" unless defined($pid);
if ($pid) {
if ($quiet == 0) {
printf "\t\e[1;32m%-20s\e[0m%s\n", $action . ":", $name unless $name eq "";
}
my $fail = 0;
# Parent - Close child-side pipes.
close $w_stderr;
-83
View File
@@ -1,83 +0,0 @@
# Find all the *.c and *.cpp files within the current source directory, and sort the list
file(GLOB SRC_SRCS_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
file(GLOB SRC_SRCS_CPP RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cpp")
set(SRC_SRCS ${SRC_SRCS_C} ${SRC_SRCS_CPP})
# If not using Visual Studio, don't include win32_memory.cpp, it's only required by Visual Studio to override it's override of the new/delete operators
if(NOT MSVC)
list(REMOVE_ITEM SRC_SRCS win32_memory.cpp)
endif(NOT MSVC)
# If not using Windows, don't include windows.cpp, as it's Windows-specific
if(NOT WIN32)
list(REMOVE_ITEM SRC_SRCS windows.cpp)
endif(NOT WIN32)
if(CMAKE244_OR_BETTER)
list(SORT SRC_SRCS)
endif(CMAKE244_OR_BETTER)
# Set all the files to use C++ as well as set their compile flags (use the module-specific compile flags, though)
set_source_files_properties(${SRC_SRCS} PROPERTIES LANGUAGE CXX COMPILE_FLAGS "${CXXFLAGS}")
# Iterate through all the source files
foreach(SRC ${SRC_SRCS})
# Calculate the header file dependencies for the given source file
calculate_depends(${SRC})
endforeach(SRC)
# Under Windows, we also include a resource file to the build
if(WIN32)
# Make sure that the resource file is seen as an RC file to be compiled with a resource compiler, not a C++ compiler
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc LANGUAGE RC)
# Add the resource file to the list of sources
append_to_list(SRC_SRCS ${CMAKE_CURRENT_BINARY_DIR}/win32.rc)
# For MinGW, we have to change the compile flags
if(MINGW)
set(RC_CFLAGS "-DMINGW -Ocoff -I${Anope_SOURCE_DIR}/include")
# If any sort of debugging is being enabled, add a _DEBUG define to the flags for the resource compiler
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
set(RC_CFLAGS "${RC_CFLAGS} -D_DEBUG")
endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc COMPILE_FLAGS "${RC_CFLAGS}")
# For anything else, assumingly Visual Studio at this point, use a different set of compile flags
else(MINGW)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/win32.rc COMPILE_FLAGS "/i\"${Anope_SOURCE_DIR}/include\"")
endif(MINGW)
if(IN_SOURCE)
# Add the resource file to the list of files for CPack to ignore
add_to_cpack_ignored_files("win32.rc$" TRUE)
endif(IN_SOURCE)
endif(WIN32)
# Generate the Anope executable and set it's linker flags, also set it to export it's symbols even though it's not a module
add_executable(${PROGRAM_NAME} ${SRC_SRCS})
set_target_properties(${PROGRAM_NAME} PROPERTIES LINKER_LANGUAGE CXX LINK_FLAGS "${LDFLAGS}" ENABLE_EXPORTS ON)
# On Windows, also link Anope to the wsock32 library, as well as set the version
if(WIN32)
target_link_libraries(${PROGRAM_NAME} wsock32)
set_target_properties(${PROGRAM_NAME} PROPERTIES VERSION "${VERSION_DOTTED}")
endif(WIN32)
# Building the Anope executable requires the language files to be compiled first as well as the version.h header to be generated
add_dependencies(${PROGRAM_NAME} language headers)
# Get the filename of the Anope executable as it is in on this system
get_target_property(SERVICES_BINARY ${PROGRAM_NAME} LOCATION)
get_filename_component(SERVICES_BINARY ${SERVICES_BINARY} NAME)
set(SERVICES_BIN "${SERVICES_BINARY}")
if(IN_SOURCE)
# Add the Anope executable to the list of files for CPack to ignore
add_to_cpack_ignored_files("${SERVICES_BINARY}$" TRUE)
endif(IN_SOURCE)
# Generate sysconf.h from the earlier configuration
configure_file(${Anope_SOURCE_DIR}/include/sysconf.h.cmake ${Anope_BINARY_DIR}/include/sysconf.h)
# Go into the following directories and run their CMakeLists.txt as well
add_subdirectory(bin)
add_subdirectory(core)
add_subdirectory(modules)
add_subdirectory(protocol)
add_subdirectory(tools)
# Set Anope to be installed to the bin directory
install(TARGETS ${PROGRAM_NAME}
DESTINATION .
)
-135
View File
@@ -1,135 +0,0 @@
OBJS = actions.o base64.o bots.o botserv.o channels.o chanserv.o commands.o compat.o \
config.o datafiles.o encrypt.o events.o hashcomp.o helpserv.o hostserv.o init.o ircd.o language.o log.o mail.o main.o \
memory.o memoserv.o messages.o misc.o modules.o news.o nickserv.o operserv.o \
process.o send.o servers.o sessions.o slist.o sockutil.o timeout.o users.o module.o modulemanager.o configreader.o
INCLUDES = ../include/commands.h ../include/defs.h ../include/language.h \
../include/pseudo.h ../include/sysconf.h ../include/config.h \
../include/encrypt.h ../include/messages.h ../include/services.h \
../include/timeout.h ../include/datafiles.h ../include/extern.h \
../include/modules.h ../include/slist.h ../include/hashcomp.h
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' \
'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' \
'MAKEBIN=${MAKEBIN}'
.c.o:
@$(MAKEBIN) $(CC) $(CFLAGS) -I../include/ -c $<
.cpp.o:
@$(MAKEBIN) $(CC) $(CFLAGS) -I../include/ -c $<
all: services
distclean: spotless
distclean_modules: clean_modules spotless
services: $(OBJS) mod_version
@$(MAKEBIN) $(CC) $(CFLAGS) $(OBJS) $(ANOPELIBS) $(MLIBS) -o $@ $(LDFLAGS)
$(OBJS): Makefile
actions.o: actions.c $(INCLUDES)
base64.o: base64.c $(INCLUDES)
bots.o: bots.cpp $(INCLUDES)
botserv.o: botserv.c $(INCLUDES)
channels.o: channels.c $(INCLUDES)
chanserv.o: chanserv.c $(INCLUDES)
commands.o: commands.c $(INCLUDES)
compat.o: compat.c $(INCLUDES)
config.o: config.c $(INCLUDES)
datafiles.o: datafiles.c $(INCLUDES)
encrypt.o: encrypt.c $(INCLUDES)
events.o: events.c $(INCLUDES)
init.o: init.c $(INCLUDES)
ircd.o: ircd.c $(INCLUDES)
helpserv.o: helpserv.c $(INCLUDES)
hostserv.o: hostserv.c $(INCLUDES)
language.o: language.c $(INCLUDES)
log.o: log.c $(INCLUDES)
mail.o: mail.c $(INCLUDES)
main.o: main.c $(INCLUDES)
memory.o: memory.c $(INCLUDES)
memoserv.o: memoserv.c $(INCLUDES)
messages.o: messages.c $(INCLUDES)
modules.o: modules.c $(INCLUDES)
module.o: module.cpp $(INCLUDES)
modulemanager.o: modulemanager.cpp $(INCLUDES)
misc.o: misc.c $(INCLUDES)
news.o: news.c $(INCLUDES)
nickserv.o: nickserv.c $(INCLUDES)
operserv.o: operserv.c $(INCLUDES)
process.o: process.c $(INCLUDES)
send.o: send.c $(INCLUDES)
servers.o: servers.c $(INCLUDES)
sessions.o: sessions.c $(INCLUDES)
slist.o: slist.c $(INCLUDES)
sockutil.o: sockutil.c $(INCLUDES)
timeout.o: timeout.c $(INCLUDES)
users.o: users.c $(INCLUDES)
vsnprintf.o: vsnprintf.c $(INCLUDES)
mod_version: mod_version.c $(INCLUDES)
@$(MAKEBIN) $(CC) $(CDEFS) $(CFLAGS) $(MODULEFLAGS) -I../include/ -c mod_version.c
modules: DUMMY
@modules/configure modules
@${MAKE} -C modules ${MAKEARGS} all
protocols: DUMMY
@protocol/configure protocol
@${MAKE} -C protocol ${MAKEARGS} all
core: DUMMY
@core/configure core
@${MAKE} -C core ${MAKEARGS} all
clean: clean_modules clean_protocols clean_core
rm -f *.o services a.out
clean_modules:
@touch modules/Makefile.inc # Horribly ugly...
@${MAKE} -C modules clean
clean_protocols:
@touch protocol/Makefile.inc
@${MAKE} -C protocol clean
clean_core:
@touch core/Makefile.inc
@${MAKE} -C core clean
spotless:
@${MAKE} -C modules distclean
@${MAKE} -C protocol distclean
@${MAKE} -C core distclean
install: services
test -d ${INSTDIR} || mkdir ${INSTDIR}
$(INSTALL) services $(INSTDIR)/services
$(INSTALL) bin/anoperc $(INSTDIR)/anoperc
(cd ../lang ; $(MAKE) install)
$(CP) ../data/* $(INSTDIR)/data
$(INSTALL) bin/mydbgen $(INSTDIR)/data/mydbgen
test -d $(INSTDIR)/data/backups || mkdir $(INSTDIR)/data/backups
test -d $(INSTDIR)/data/logs || mkdir $(INSTDIR)/data/logs
@if [ "$(INSTDIR)/data/modules" ] ; then \
test -d ${INSTDIR}/data/modules || mkdir ${INSTDIR}/data/modules ; \
test -d ${INSTDIR}/data/modules/runtime || mkdir ${INSTDIR}/data/modules/runtime ; \
(cd modules ; $(MAKE) install) ; \
(cd protocol ; ${MAKE} install) ; \
(cd core ; ${MAKE} install) ; \
fi
@if [ "$(RUNGROUP)" ] ; then \
echo chgrp -R $(RUNGROUP) $(INSTDIR)/data ; \
chgrp -R $(RUNGROUP) $(INSTDIR)/data ; \
echo chmod -R g+rw $(INSTDIR)/data ; \
chmod -R g+rw $(INSTDIR)/data ; \
echo find $(INSTDIR)/data -type d -exec chmod g+xs \'\{\}\' \\\; ; \
find $(INSTDIR)/data -type d -exec chmod g+xs '{}' \; ; \
fi
DUMMY:
+4 -4
View File
@@ -15,9 +15,9 @@
ANOPEPID="@INSTDIR@/data/services.pid"
ANOPROG="@INSTDIR@/services"
LOG="@INSTDIR@/data/logs/"
ANOPEPID="@DATADIR@/services.pid"
ANOPROG="@BINDIR@/services"
LOG="@DATADIR@/logs/"
ARCVERSION="1.2"
isAnopeRunning () {
@@ -134,7 +134,7 @@ elif [ "$1" = "help" ] ; then
echo "folder or make use of our extensive online support at"
echo "http://www.anope.org/"
fi
else
echo "Anope Remote Control ($ARCVERSION)"
echo "Usage: $0 [start|stop|status|restart|rehash|version|help]"
-46
View File
@@ -1,46 +0,0 @@
include ./Makefile.inc
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' \
'PROFILE=${PROFILE}' 'SHARED=${SHARED}' \
'MODULEFLAGS=${MODULEFLAGS}' 'MAKEBIN=${MAKEBIN}'
OBJECTS= $(SRCS:.c=.o)
SO_FILES=$(OBJECTS:.o=.s)
CDEFS= -rdynamic -Wall
all: modules subs
modules: $(OBJECTS) $(SO_FILES)
install:
$(CP) ./*.so $(INSTDIR)/data/modules
distclean: spotless
.c.o:
@$(MAKEBIN) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $<
.o.s:
@$(MAKEBIN) $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE}
@$(TOUCH) $*.s
subs:
@for i in $(SUBS); do \
echo "make all in $$i..."; \
(cd $$i; $(MAKE) $(MAKEARGS) all); done
subs_clean:
@for i in $(SUBS); do \
echo "cleaning in $$i..."; \
(cd $$i; $(MAKE) clean); done
clean: subs_clean
rm -f *.o *.s *.so *.c~ core
spotless: subs_clean
rm -f *.o *.s *.so *.c~ core Makefile.inc
-29
View File
@@ -1,29 +0,0 @@
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \
'RUNGROUP=${RUNGROUP}' \
'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}'
OBJECTS= $(SRCS:.c=.o)
SO_FILES=$(OBJECTS:.o=.s)
CDEFS= -rdynamic -Wall
all: module
module: $(OBJECTS) so
distclean: spotless
.c.o:
$(CC) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $<
so:
$(CC) ${SHARED} $(OBJECTS) -o ../$(TARGET).so ${PROFILE}
clean:
rm -f *.o *.so *.c~ core
spotless: clean
rm -f *~ *.o *.so *.c~ core
-60
View File
@@ -1,60 +0,0 @@
#!/bin/sh
oldpath=`pwd`
if [ $1 ]; then
cd $1
fi
echo2 () {
$ECHO2 "$*$ECHO2SUF" # these are defined later
}
ECHO2SUF=''
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
ECHO2='echo -n'
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
ECHO2='echo' ; ECHO2SUF='\c'
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
ECHO2='printf "%s"'
else
# oh well...
ECHO2='echo'
fi
export ECHO2 ECHO2SUF
echo2 "SRCS=" > ./Makefile.inc
FIRST=1
for oldfile in *.c
do
if [ "$FIRST" = 1 ] ; then
echo2 " "$oldfile >> ./Makefile.inc
else
echo "\\" >> ./Makefile.inc
echo2 " " $oldfile >> ./Makefile.inc
fi
FIRST=0
done
echo "" >> ./Makefile.inc
echo2 "SUBS=" >> ./Makefile.inc
FIRST=1
for dir in *
do
if [ -d $dir ] ; then
if [ -f $dir/Makefile ] ; then
if [ "$FIRST" = 1 ] ; then
echo2 " "$dir >> ./Makefile.inc
else
echo "\\" >> ./Makefile.inc
echo2 " " $dir >> ./Makefile.inc
fi
FIRST=0
fi
fi
done
cd $oldpath
exit 0
-49
View File
@@ -1,49 +0,0 @@
include ./Makefile.inc
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' \
'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}'\
'MAKEBIN=${MAKEBIN}'
OBJECTS= $(SRCS:.c=.o)
SO_FILES=$(OBJECTS:.o=.s)
CDEFS= -rdynamic -Wall
all: modules subs
modules: $(OBJECTS) $(SO_FILES)
install:
$(CP) ./*.so $(INSTDIR)/data/modules
@for i in $(SUBS); do \
echo "make install in $$i..."; \
(cd $$i; $(MAKE) $(MAKEARGS) install);done
distclean: spotless
.c.o:
@$(MAKEBIN) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $<
.o.s:
@$(MAKEBIN) $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE}
@$(TOUCH) $*.s
subs:
@for i in $(SUBS); do \
echo "make all in $$i..."; \
(cd $$i; $(MAKE) $(MAKEARGS) all); done
subs_clean:
@for i in $(SUBS); do \
echo "cleaning in $$i..."; \
(cd $$i; $(MAKE) $(MAKEARGS) clean); done
clean: subs_clean
rm -f *.o *.s *.so *.c~ core
spotless:
rm -f *.o *.s *.so *.c~ core *.so Makefile.inc
-28
View File
@@ -1,28 +0,0 @@
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \
'RUNGROUP=${RUNGROUP}' \
'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}'
OBJECTS= $(SRCS:.c=.o)
SO_FILES=$(OBJECTS:.o=.s)
CDEFS= -rdynamic -Wall
all: module
module: $(OBJECTS) so
distclean: spotless
.c.o:
$(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $<
so:
$(CC) ${SHARED} ../../mod_version.o $(OBJECTS) -o ../$(TARGET).so ${PROFILE}
clean:
rm -f *.o *.so *.c~ core
spotless:
rm -f *~ *.o *.so *.c~ core
-65
View File
@@ -1,65 +0,0 @@
#!/bin/sh
oldpath=`pwd`
if [ $1 ]; then
cd $1
fi
echo2 () {
$ECHO2 "$*$ECHO2SUF" # these are defined later
}
ECHO2SUF=''
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
ECHO2='echo -n'
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
ECHO2='echo' ; ECHO2SUF='\c'
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
ECHO2='printf "%s"'
else
# oh well...
ECHO2='echo'
fi
export ECHO2 ECHO2SUF
echo2 "SRCS=" > ./Makefile.inc
FIRST=1
for oldfile in *.c
do
if [ "$FIRST" = 1 ] ; then
echo2 " "$oldfile >> ./Makefile.inc
else
echo "\\" >> ./Makefile.inc
echo2 " " $oldfile >> ./Makefile.inc
fi
FIRST=0
done
echo "" >> ./Makefile.inc
echo2 "SUBS=" >> ./Makefile.inc
FIRST=1
for dir in *
do
if [ -d $dir ] ; then
if [ -f $dir/configure ] ; then
cd $dir
./configure
cd ..
fi
if [ -f $dir/Makefile ] ; then
if [ "$FIRST" = 1 ] ; then
echo2 " "$dir >> ./Makefile.inc
else
echo "\\" >> ./Makefile.inc
echo2 " " $dir >> ./Makefile.inc
fi
FIRST=0
fi
fi
done
cd $oldpath
exit 0
-51
View File
@@ -1,51 +0,0 @@
include ./Makefile.inc
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' \
'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}'\
'MAKEBIN=${MAKEBIN}'
OBJECTS= $(SRCS:.c=.o)
OBJECTS+= $(SRCS:.cpp=.o)
SO_FILES=$(OBJECTS:.o=.s)
CDEFS= -rdynamic -Wall
all: modules subs
modules: $(OBJECTS) $(SO_FILES)
install:
$(CP) ./*.so $(INSTDIR)/data/modules
distclean: clean spotless
.c.o:
@$(MAKEBIN) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $<
.cpp.o:
@$(MAKEBIN) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $<
.o.s:
@$(MAKEBIN) $(CC) ${SHARED} ../mod_version.o $< -o $*.so ${PROFILE}
@$(TOUCH) $*.s
subs:
@for i in $(SUBS); do \
echo "make all in $$i..."; \
(cd $$i; $(MAKE) $(MAKEARGS) all); done
subs_clean:
@for i in $(SUBS); do \
echo "cleaning in $$i..."; \
(cd $$i; $(MAKE) clean); done
clean: subs_clean
rm -f *.o *.s *.so *.c~ core
spotless: subs_clean
rm -f *.o *.s *.so *.c~ core *.so Makefile.inc
-32
View File
@@ -1,32 +0,0 @@
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \
'RUNGROUP=${RUNGROUP}' \
'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}'
OBJECTS= $(SRCS:.c=.o)
SO_FILES=$(OBJECTS:.o=.s)
CDEFS= -rdynamic -Wall
all: module
module: $(OBJECTS) so
distclean: spotless
.c.o:
$(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $<
.cpp.o:
$(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $<
so:
$(CC) ${SHARED} $(OBJECTS) -o ../$(TARGET).so ${PROFILE}
clean:
rm -f *.o *.so *.c~ core
spotless: clean
rm -f *~ *.o *.so *.c~ core
-60
View File
@@ -1,60 +0,0 @@
#!/bin/sh
oldpath=`pwd`
if [ $1 ]; then
cd $1
fi
echo2 () {
$ECHO2 "$*$ECHO2SUF" # these are defined later
}
ECHO2SUF=''
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
ECHO2='echo -n'
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
ECHO2='echo' ; ECHO2SUF='\c'
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
ECHO2='printf "%s"'
else
# oh well...
ECHO2='echo'
fi
export ECHO2 ECHO2SUF
echo2 "SRCS=" > ./Makefile.inc
FIRST=1
for oldfile in `ls -1 *.c *.cpp`
do
if [ "$FIRST" = 1 ] ; then
echo2 " "$oldfile >> ./Makefile.inc
else
echo "\\" >> ./Makefile.inc
echo2 " " $oldfile >> ./Makefile.inc
fi
FIRST=0
done
echo "" >> ./Makefile.inc
echo2 "SUBS=" >> ./Makefile.inc
FIRST=1
for dir in *
do
if [ -d $dir ] ; then
if [ -f $dir/Makefile ] ; then
if [ "$FIRST" = 1 ] ; then
echo2 " "$dir >> ./Makefile.inc
else
echo "\\" >> ./Makefile.inc
echo2 " " $dir >> ./Makefile.inc
fi
FIRST=0
fi
fi
done
cd $oldpath
exit 0
-39
View File
@@ -1,39 +0,0 @@
SRCS = anopesmtp.c db-merger.c db-convert.c
OBJS = $(SRCS:.c=.o)
INCLUDES = ../../include/services.h
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \
'LDFLAGS=${LDFLAGS}' 'INSTDIR=${INSTDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \
'TOUCH=${TOUCH}' 'SHELL=${SHELL}' \
'RUNGROUP=${RUNGROUP}' 'MAKEBIN=${MAKEBIN}'
.c.o:
@$(MAKEBIN) $(CC) $(CFLAGS) -I../../include/ -c $<
all: ${OBJS}
distclean: spotless
anopesmpt: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(ANOPELIBS) $(MLIBS) -o $@ $(LDFLAGS)
$(OBJS): Makefile
anopesmtp.o: anopesmtp.c $(INCLUDES)
db-merger.o: db-merger.c $(INCLUDES)
db-convert.o: db-convert.c $(INCLUDES)
clean:
rm -f *.o anopesmtp a.out db-merger db-convert
spotless: clean
install: anopesmtp db-merger db-convert
test -d ${INSTDIR} || mkdir ${INSTDIR}
test -d $(INSTDIR)/tools || mkdir $(INSTDIR)/tools
$(INSTALL) anopesmtp $(INSTDIR)/tools/anopesmtp
$(INSTALL) db-merger $(INSTDIR)/tools/db-merger
$(INSTALL) db-convert $(INSTDIR)/tools/db-convert
DUMMY: