From 451a041d0a7aca004073988ee6bfca35bd8d514c Mon Sep 17 00:00:00 2001 From: William Robinet Date: Fri, 28 Aug 2020 10:12:47 +0200 Subject: [PATCH] Improve lib detection and .gitignore --- .gitignore | 23 +++++++++++++++++++++++ configure.ac | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 70 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 94f66fa..f3a297a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,26 @@ config.log config.status dist autom4te.cache +Makefile.in +aclocal.m4 +base/.deps/ +base/.dirstamp +base/Makefile.in +common/Makefile.in +common/lib/.deps/ +common/lib/.dirstamp +common/lib/Makefile.in +compile +config.h +config.h.in +configure +depcomp +install-sh +missing +null/.deps/ +null/.dirstamp +null/Makefile.in +ssl/.deps/ +ssl/.dirstamp +ssl/Makefile.in +stamp-h1 diff --git a/configure.ac b/configure.ac index 11642b5..0f88124 100644 --- a/configure.ac +++ b/configure.ac @@ -13,15 +13,59 @@ AM_PROG_CC_C_O AC_PROG_MAKE_SET AC_PROG_INSTALL -AC_CHECK_LIB([pcap],[pcap_create]) -AC_CHECK_LIB([ssl], [SSL_library_init]) # Checks for header files. AC_FUNC_ALLOCA -AC_CHECK_HEADERS([arpa/inet.h malloc.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h pcap.h pcap-bpf.h],,[AC_MSG_ERROR([Missing header.])]) +AC_CHECK_HEADERS([arpa/inet.h malloc.h memory.h netdb.h netinet/in.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h],,[AC_MSG_ERROR([Missing header.])]) AC_HEADER_STDC AC_HEADER_TIME +have_pcap=no +AC_SEARCH_LIBS([pcap_create], [pcap], [have_pcap=yes]) + +if test "x${have_pcap}" = xyes; then + AC_CHECK_HEADERS([pcap.h pcap-bpf.h], [], [have_pcap=no]) +fi + +if test "x${have_pcap}" = xno; then + AC_MSG_ERROR([ +--------------------------------------- +Unable to find libpcap on this system +Check 'config.log' for more information + +On Debian and Ubuntu systems you can +install the required library and header +files with + apt install libpcap-dev +--------------------------------------- + ]) +fi + +AC_CHECK_LIB([pcap],[pcap_create]) + +have_ssl=no +AC_SEARCH_LIBS([OPENSSL_init_ssl], [ssl], [have_ssl=yes]) + +if test "x${have_ssl}" = xyes; then + AC_CHECK_HEADERS([openssl/ssl.h], [], [have_ssl=no]) +fi + +if test "x${have_ssl}" = xno; then + AC_MSG_ERROR([ +--------------------------------------- +Unable to find libssl on this system +Check 'config.log' for more information + +On Debian and Ubuntu systems you can +install the required library and header +files with + apt install libssl-dev +--------------------------------------- + ]) +fi + +AC_CHECK_LIB([ssl], [OPENSSL_init_ssl]) + # Checks for typedefs, structures, and compiler characteristics. AC_CHECK_SIZEOF([unsigned short]) AC_CHECK_SIZEOF([unsigned int])