⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configure.in

📁 C++ web POSIX framewark
💻 IN
字号:
dnl Process this file with autoconf to produce a configure script.AC_PREREQ(2.59)AC_INIT([cppcms], [0.0.3], [artyomtnk@yahoo.com])AC_CONFIG_HEADER(config.h)AM_INIT_AUTOMAKE([1.9 foreign])AC_PROG_CXXAC_PROG_LIBTOOLAC_SUBST(LIBTOOL_DEPS)AC_LANG_CPLUSPLUSAC_CONFIG_FILES([Makefile transtext/Makefile])AC_ARG_ENABLE(forkcache,[AS_HELP_STRING([--disable-forkcache],[Disable shared memory cache])])AC_ARG_ENABLE(fastcgi,[AS_HELP_STRING([--disable-fastcgi],[Disable fastcgi interface])])AC_ARG_ENABLE(tcpcache,[AS_HELP_STRING([--disable-tcpcache],[Disable distributed cache system])])AC_ARG_ENABLE(crypt,[AS_HELP_STRING([--disable-crypt],[Disable encrypted sessions backend])])AC_ARG_ENABLE(sqlite,[AS_HELP_STRING([--disable-sqlite],[Disable sqlite sessions backend])])AC_ARG_ENABLE(boostsuffix,[AS_HELP_STRING([--enable-boostsuffix],[Specify custom suffix for boost libraries])])if test "x$enable_boostsuffix" != "xyes"  && test "x$enable_boostsuffix" != "xno"then	bsts="$enable_boostsuffix"fiCPPCMS_LIBS=""MY_SAVE_LIBS="$LIBS"case $host in	*solaris*)		echo "Adding -pthreads for Solaris host"		CXXFLAGS="-pthreads $CXXFLAGS" 		LDFLAGS="-pthreads $LDFLAGS" esacAC_SEARCH_LIBS(pthread_sigmask,thr kse pthread,[],[echo "Posix threads library not found" ; exit -1])AC_SEARCH_LIBS(clock_gettime,rt,[],[])AC_TRY_RUN([	#include <pthread.h>		int main()		{			pthread_rwlockattr_t attr;			pthread_rwlock_t lock;			return 			(	pthread_rwlockattr_init(&attr)==0				&& pthread_rwlockattr_setpshared(&attr,PTHREAD_PROCESS_SHARED)==0				&& pthread_rwlock_init(&lock,&attr)==0 )			? 0 : 1;		}		],		[AC_DEFINE([HAVE_PTHREADS_PSHARED],[],["Have Pshared"])			have_pthreads_pshared=yes			echo "Check: process shared mutex... ok"],[echo "Check: process shared mutex not supported"])if test "x$enable_forkcache" != "xno" ; then	AC_CHECK_LIB(mm,main,[		have_mm=yes		CPPCMS_LIBS="-lmm $CPPCMS_LIBS"		AC_DEFINE([EN_FORK_CACHE],[],["Enable fork cache"])		],		[	echo "======================================================================"			echo "               OSSP mm library (libmm) not installed" 			echo "               The fork cache backend is disabled "			echo "======================================================================" ]) fiAM_CONDITIONAL(EN_FORK_CACHE,[test "x$have_mm" = "xyes" ])if test "x$enable_fastcgi" != "xno" ; then	AC_CHECK_LIB(fcgi++,main,[		have_fcgi=yes		CPPCMS_LIBS="-lfcgi++ -lfcgi $CPPCMS_LIBS"		AC_DEFINE([EN_FCGI_BACKEND],[],["Enable fastcgi backend"])		],		[	echo "======================================================================"			echo "Fast CGI library not installed"  			echo "============== FastCGI API will be disabled ==========================" 			echo "You still have scgi and cgi API" ])fiAM_CONDITIONAL(EN_FCGI_BACKEND,[test "x$have_fcgi" = "xyes" ])if test "x$enable_crypt" != "xno" ; then	AC_CHECK_LIB(gcrypt,main,[		have_gcrypt=yes		CPPCMS_LIBS="-lgcrypt $CPPCMS_LIBS"		AC_DEFINE([EN_ENCR_SESSIONS],[],["Enable encrypted sessions"])		],		[	echo "====================================================================="			echo "libgcrypt not found, Encrypted Sessions backend is disabled"			echo "=====================================================================" ])fiAM_CONDITIONAL(EN_ENCR_SESSIONS,[test "x$have_gcrypt" = "xyes" ])if test "x$enable_sqlite" != "xno" ; then	AC_CHECK_LIB(sqlite3,sqlite3_open,[		have_sqlite3=yes		LIBS="-lsqlite3 $LIBS"		AC_DEFINE([EN_SQLITE_SESSIONS],[],["Enable sqlite sessions"])		],		[	echo "====================================================================="			echo "libsqlite3 not found, Sqlite sessions backend is disabled"			echo "=====================================================================" ])fiAM_CONDITIONAL(EN_SQLITE_SESSIONS,[test "x$have_sqlite3" = "xyes" ])have_auto_type_detection=noAC_TRY_COMPILE([#include <list>		],		[std::list<int> l; auto p=l.begin();],		[AC_DEFINE([HAVE_CPP_0X_AUTO],[],["Have C++0x auto"])			have_auto_type_detection=yes			echo "C++0x auto... ok"	],[echo "C++0x auto... not supported"])AC_TRY_COMPILE([#include <list>		],		[std::list<int> l; decltype(l.begin()) p=l.begin();],		[AC_DEFINE([HAVE_CPP_0X_DECLTYPE],[],["Have C++0x decltype"])			have_auto_type_detection=yes			echo "C++0x decltype... ok"],[echo "C++0x decltype... not supported"])AC_TRY_COMPILE([#include <list>		],		[std::list<int> l; typeof(l.begin()) p=l.begin();],		[AC_DEFINE([HAVE_GCC_TYPEOF],[],["Have g++ typeof"])			have_auto_type_detection=yes			echo "g++ typeof... ok"],[echo "g++ typeof... not supported"])AC_TRY_COMPILE([#include <list>		#include <vector>		#include <boost/typeof/typeof.hpp>		],		[	{std::list<int> l; BOOST_TYPEOF(l.begin()) p=l.begin(); BOOST_TYPEOF(*p) &refp=*p;}			{std::vector<int> l; BOOST_TYPEOF(l.begin()) p=l.begin(); BOOST_TYPEOF(*p) &refp=*p;}],		[AC_DEFINE([HAVE_WORKING_BOOST_TYPEOF],[],["Have working BOOST_TYPEOF"])			have_auto_type_detection=yes			echo "Useful BOOST_TYPEOF... ok"],[echo "Useful BOOST_TYPEOF... not supported"])if test x$have_auto_type_detection != xyes ; then	echo "No useful type detection method for this compiler found"	echo "Supported methods: C++0x auto, C++0x decltype, Boost.Typeof, GCC typeof"	exit -1fiAC_CHECK_HEADER(fastcgi/fcgiapp.h ,[AC_DEFINE([EN_FASTCGI_LONG_PATH],[],["Fastcgi headers in fastcgi dir"])],[])if test "x$enable_tcpcache" != "xno" ; then	store_flags="$CXXFLAGS"	case $host in		*cygwin*) CXXFLAGS="-D_WIN32_WINNT -D__USE_W32_SOCKETS $CXXFLAGS"	esac	AC_CHECK_HEADER([asio.hpp],[have_asio=yes			need_system=no],[AC_CHECK_HEADER([boost/asio.hpp],[					have_asio=yes					AC_DEFINE([USE_BOOST_ASIO],[],["Use boost::asio"])					need_system=yes],[					have_asio=no					need_system=no					echo "===================================================="					echo "ASIO library not found... TCP cache will be disabled"					echo "===================================================="  ])])	CXXFLAGS="$store_flags"fiif test "x$need_system" = "xyes" then	if test "x$bsts" = "x"	then	AC_CHECK_LIB(boost_system,main,		[ LIBS="-lboost_system $LIBS" ],		[	AC_CHECK_LIB(boost_system-gcc-mt,main,				[LIBS="-lboost_system-gcc-mt $LIBS"],				[	have_asio=no 				echo "boost::asio found however boost::system not found"				echo "     TCP cache disabled"])])	else		LIBS="-lboost_system-$bsts $LIBS"	fifiif test "x$have_asio" = "xyes" then	AC_DEFINE([EN_TCP_CACHE],[],["Enable tcp cache"])	case $host in 		*cygwin*) LIBS="-lws2_32 $LIBS"	esacfiAM_CONDITIONAL(EN_TCP_CACHE,[test "x$have_asio" = "xyes" ])AC_CHECK_LIB(cgicc,main,[CPPCMS_LIBS="-lcgicc $CPPCMS_LIBS"],[echo "cgicc not found" ; exit -1])AC_CHECK_LIB(dl,dlopen,[CPPCMS_LIBS="-ldl $CPPCMS_LIBS"],[])AC_SEARCH_LIBS(socket,socket)AC_SEARCH_LIBS(gethostbyname,nsl socket)if test "x$bsts" = "x"then	AC_CHECK_LIB(boost_regex,main,[		CPPCMS_LIBS="-lboost_regex $CPPCMS_LIBS"		],		[AC_CHECK_LIB(boost_regex-gcc-mt,main,[			CPPCMS_LIBS="-lboost_regex-gcc-mt $CPPCMS_LIBS"			],[ echo "boost::regex not found" ; exit -1])])	AC_CHECK_LIB(boost_iostreams,main,[		CPPCMS_LIBS="-lboost_iostreams $CPPCMS_LIBS"		],[AC_CHECK_LIB(boost_iostreams-gcc-mt,main,[			CPPCMS_LIBS="-lboost_iostreams-gcc-mt $CPPCMS_LIBS"			],[ echo "boost::iostreams not found" ; exit -1])])	AC_CHECK_LIB(boost_signals,main,[		CPPCMS_LIBS="-lboost_signals $CPPCMS_LIBS"		],[AC_CHECK_LIB(boost_signals-gcc-mt,main,[			CPPCMS_LIBS="-lboost_signals-gcc-mt $CPPCMS_LIBS"			],[ echo "boost::signals not found" ; exit -1])])else	CPPCMS_LIBS="-lboost_regex-$bsts -lboost_iostreams-$bsts -lboost_signals-$bsts $CPPCMS_LIBS"fiCPPCMS_LIBS="$CPPCMS_LIBS $LIBS"TCPSCALE_LIBS="$LIBS"LIBS="$SAVE_LIBS"AC_SUBST(TCPSCALE_LIBS)AC_SUBST(CPPCMS_LIBS)AC_OUTPUT

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -