1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 14:23:14 +02:00

Modifications to the Autotools build system to try to make it work with the changes made from CMake, still untested (again, don't use this commit).

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1877 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
cyberbotx
2008-12-29 20:07:55 +00:00
parent d6bb55476c
commit bd2cb095aa
17 changed files with 2417 additions and 1830 deletions
+76 -20
View File
@@ -36,7 +36,7 @@ Load_Cache () {
fi
}
Run_CMake () {
Run_Build_System () {
WITH_INST=""
WITH_RUN=""
WITH_PERM=""
@@ -45,41 +45,73 @@ Run_CMake () {
GEN_TYPE=""
if [ "$INSTDEST" != "" ] ; then
WITH_INST="-DINSTDIR:STRING=$INSTDEST"
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_INST="-DINSTDIR:STRING=$INSTDEST"
else
WITH_INST="--with-instdir=$INSTDIR"
fi
fi
if [ "$RUNGROUP" != "" ] ; then
WITH_RUN="-DRUNGROUP:STRING=$RUNGROUP"
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_RUN="-DRUNGROUP:STRING=$RUNGROUP"
else
WITH_RUN="--with-rungroup=$RUNGROUP"
fi
fi
if [ "$UMASK" != "" ] ; then
WITH_PERM="-DDEFUMASK:STRING=$UMASK"
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
WITH_PERM="-DDEFUMASK:STRING=$UMASK"
else
WITH_PERM="--with-permissions=$UMASK"
fi
fi
if [ "$DEBUG" = "yes" ] ; then
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=DEBUG"
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=DEBUG"
else
BUILD_TYPE="--with-debugsym"
fi
else
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
BUILD_TYPE="-DCMAKE_BUILD_TYPE:STRING=RELEASE"
fi
fi
if [ "$USE_RUN_CC_PL" = "yes" ] ; then
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=ON"
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=ON"
else
RUN_CC_PL="--with-makebin=run-cc.pl"
fi
else
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
RUN_CC_PL="-DUSE_RUN_CC_PL:BOOLEAN=OFF"
else
RUN_CC_PL="--with-makebin="
fi
fi
case `uname -s` in
MINGW*)
GEN_TYPE="-G\"MSYS Makefiles\""
;;
esac
if [ "$BUILD_SYSTEM" = "cmake" ] ; then
case `uname -s` in
MINGW*)
GEN_TYPE="-G\"MSYS Makefiles\""
;;
esac
echo "cmake $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $SOURCE_DIR"
echo "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
cmake $GEN_TYPE $WITH_INST $WITH_RUN $WITH_PERM $BUILD_TYPE $RUN_CC_PL $SOURCE_DIR
echo ""
echo "Now run make to build Anope."
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
}
ECHO2SUF=''
@@ -99,6 +131,7 @@ export ECHO2 ECHO2SUF
# Init values
###########################################################################
BUILD_SYSTEM="cmake"
INSTDEST=$HOME/services
RUNGROUP=
UMASK=
@@ -127,7 +160,7 @@ while [ $# -ge 1 ] ; do
elif [ $1 = "-quick" -o $1 = "-q" ] ; then
Load_Cache
if [ "$CAN_QUICK" = "yes" ] ; then
Run_CMake
Run_Build_System
else
echo ""
echo "Can't find cache file (config.cache), aborting..."
@@ -175,6 +208,28 @@ 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 -qe 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
ok=0
echo "In what directory do you want the binaries to be installed?"
while [ $ok -eq 0 ] ; do
echo2 "[$INSTDEST] "
@@ -310,6 +365,7 @@ echo ""
echo2 "Saving configuration results in config.cache... "
cat <<EOT >$SOURCE_DIR/config.cache
BUILD_SYSTEM="$BUILD_SYSTEM"
INSTDEST="$INSTDEST"
RUNGROUP="$RUNGROUP"
UMASK=$UMASK
@@ -320,7 +376,7 @@ echo "done."
################################################################################
# Build the CMake string
# Build the build system string
################################################################################
Run_CMake
Run_Build_System