mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
added autoconf stuff for guesing correct values on certain systems
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@5 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
|||||||
|
ifneq ($(MAKE),gmake)
|
||||||
|
# If you got an ERROR on the previous line, then you aren't using gmake
|
||||||
|
endif
|
||||||
|
|
||||||
|
CXX=g++
|
||||||
|
CXXFLAGS=@CXXFLAGS@
|
||||||
|
INCLUDES=@INCLUDES@
|
||||||
|
LIBS=@LIBS@
|
||||||
|
|
||||||
|
OBJS=main.o znc.o User.o IRCSock.o UserSock.o DCCBounce.o DCCSock.o Chan.o Nick.o Server.o Modules.o md5.o Buffer.o Utils.o
|
||||||
|
SRCS=main.cpp znc.cpp User.cpp IRCSock.cpp UserSock.cpp DCCBounce.cpp DCCSock.cpp Chan.cpp Nick.cpp Server.cpp Modules.cpp md5.cpp Buffer.cpp Utils.cpp
|
||||||
|
|
||||||
|
all: znc
|
||||||
|
|
||||||
|
depend::
|
||||||
|
cat /dev/null >.depend
|
||||||
|
g++ -M $(CXXFLAGS) $(SRCS) $(INCLUDES) >.depend
|
||||||
|
|
||||||
|
znc: $(OBJS)
|
||||||
|
$(CXX) $(CXXFLAGS) $(INCLUDES) -o $@ $(LIBS) $(OBJS)
|
||||||
|
|
||||||
|
znc-static: $(OBJS)
|
||||||
|
$(CXX) $(CXXFLAGS) -static -o $@ $(INCLUDES) $(OBJS) $(LIBS)
|
||||||
|
strip $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf znc znc-static *.o core core.*
|
||||||
|
|
||||||
|
include .depend
|
||||||
|
|
||||||
|
.cpp.o:
|
||||||
|
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $*.o $*.cpp
|
||||||
+1360
File diff suppressed because it is too large
Load Diff
+1375
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
|||||||
|
AC_INIT
|
||||||
|
AC_PROG_CXX
|
||||||
|
AC_CANONICAL_HOST
|
||||||
|
CXXFLAGS=""
|
||||||
|
INCLUDES=""
|
||||||
|
LIBS=""
|
||||||
|
function appendLib {
|
||||||
|
if test "$LIBS" != ""; then
|
||||||
|
LIBS="$LIBS $*"
|
||||||
|
else
|
||||||
|
LIBS=$*
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function appendInc {
|
||||||
|
if test "$INCLUDES" != ""; then
|
||||||
|
INCLUDES="$INCLUDES $*"
|
||||||
|
else
|
||||||
|
INCLUDES=$*
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function appendCXX {
|
||||||
|
if test "$CXXFLAGS" != ""; then
|
||||||
|
CXXFLAGS="$CXXFLAGS $*"
|
||||||
|
else
|
||||||
|
CXXFLAGS=$*
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
if `echo $host_os | grep -qi 'freebsd'`; then
|
||||||
|
appendInc -I/usr/local/include
|
||||||
|
appendLib -L/usr/local/lib -lcompat
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_ARG_WITH( openssl, [ --with-openssl=/path/to/openssl], OPENSSL=$withval,)
|
||||||
|
AC_ARG_ENABLE( debug, [ --enable-debug enable debuging], appendCXX -Wall -ggdb -D_DEBUG, appendCXX -Wall -s -O2 -fomit-frame-pointer )
|
||||||
|
AC_ARG_ENABLE( modules, [ --disable-modules disable modules], MODULES="no", MODULES="yes")
|
||||||
|
|
||||||
|
if test -n "$OPENSSL"; then
|
||||||
|
appendLib -L${OPENSSL}/lib
|
||||||
|
appendInc -I${OPENSSL}/include
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CHECK_LIB( crypto, BIO_new,,NOSSL=1, )
|
||||||
|
AC_CHECK_LIB( ssl, SSL_shutdown,,NOSSL=1, )
|
||||||
|
|
||||||
|
if test -z "$NOSSL"; then
|
||||||
|
appendCXX -DHAVE_LIBSSL
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$MODULES" = "yes"; then
|
||||||
|
AC_CHECK_LIB( dl, dlopen, appendCXX -D_MODULES -rdynamic,, )
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Auto detect modules
|
||||||
|
|
||||||
|
AC_SUBST([CXXFLAGS])
|
||||||
|
AC_SUBST([INCLUDES])
|
||||||
|
AC_SUBST([LIBS])
|
||||||
|
AC_CONFIG_FILES([Makefile])
|
||||||
|
AC_OUTPUT
|
||||||
|
|
||||||
|
touch .depend
|
||||||
Reference in New Issue
Block a user