libevent 编译安装

http://libevent.org/
下载源码:



1,CMake Error at /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.13/Modules/FindOpenSSL.cmake:412 (find_package_handle_standard_args)
CMakeLists.txt:814 (find_package)
解决办法:
设置openssl环境:/Applications/CMake.app/Contents/bin/cmake -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2k/ -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2k/lib

2,没有configure只有 configure.ac
aclocal



autoconf



autoheader



automake –add-missing



./configure



make



sudo make install



3,config.status: error: cannot find input file: `Makefile.in’



automake 会根据你写的Makefile.am 来自动生成Makefile.in 。
运行automake



4,configure.ac:129: error: required file ‘./ltmain.sh’ not found
解决方案(libtoolize配置即可):



$libtoolize –version
-libtoolize (GNU libtool) 1.4.2
…..
$libtoolize –automake –copy –debug –force



libtoolize: this copies/links a few support scripts, including ltmain.sh (which is the main component of libtool).
5,libtoolize 安装失败
locate libtool
它似乎安装得很好
/usr/local/share/libtool
/usr/local/share/man/man1/glibtool.1
/usr/local/share/man/man1/glibtoolize.1
/usr/local/var/homebrew/linked/libtool
/usr/local/var/homebrew/locks/libtool.formula.lock
/usr/share/apr-1/build-1/libtool



您通常需要使用glibtool和glibtoolize,因为libtool已经存在于OS X上,作为创建Mach-O动态库的二进制工具。所以,这是MacPorts如何安装它,使用程序名称转换,虽然端口本身仍然命名为“libtool”。
一些autogen.sh脚本(或它们的等价物)将遵循LIBTOOL / LIBTOOLIZE环境变量。



我有一行在我自己的autogen.sh脚本:



case uname in Darwin*) glibtoolize –copy ;;
*) libtoolize –copy ;; esac
你可能需要–copy标志。



注意:如果你已经使用MacPorts安装了autotools,一个正确写的configure.ac与Makefile.am文件应该只需要autoreconf -fvi。它应该像预期的那样调用glibtoolize等。否则,一些软件包将分发一个autogen.sh或类似的脚本。



autoreconf -fvi
automake
$ls Makefile
Makefile Makefile.am Makefile.in



./configure
make
make install
安装成功



Category linux