Commit 527ce886 authored by Tudor Bosman's avatar Tudor Bosman Committed by Dave Watson

Some opensource build fixes

Summary:
- switch to new versions of ax_boost_*.m4
- versioning in libtool
- better checks in configure.ac

Test Plan: built in an Ubuntu VM

Reviewed By: davejwatson@fb.com

Subscribers: folly@lists

FB internal diff: D1338957
parent 2ff7b237
*.o *.o
*.lo *.lo
*.la *.la
.dirstamp
Makefile Makefile
Makefile.in Makefile.in
.libs .libs
......
...@@ -46,6 +46,9 @@ Dependencies ...@@ -46,6 +46,9 @@ Dependencies
- libgoogle-glog-dev - libgoogle-glog-dev
- libgflags-dev - libgflags-dev
- scons (for double-conversion) - scons (for double-conversion)
- binutils-dev (optional)
- libiberty-dev (optional)
- libjemalloc-dev (optional)
Fedora 17 64-bit Fedora 17 64-bit
- gcc - gcc
......
...@@ -238,6 +238,8 @@ if !HAVE_BITS_FUNCTEXCEPT ...@@ -238,6 +238,8 @@ if !HAVE_BITS_FUNCTEXCEPT
libfolly_la_SOURCES += detail/FunctionalExcept.cpp libfolly_la_SOURCES += detail/FunctionalExcept.cpp
endif endif
libfolly_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
FingerprintTables.cpp: generate_fingerprint_tables FingerprintTables.cpp: generate_fingerprint_tables
./generate_fingerprint_tables ./generate_fingerprint_tables
CLEANFILES += FingerprintTables.cpp CLEANFILES += FingerprintTables.cpp
...@@ -245,9 +247,13 @@ CLEANFILES += FingerprintTables.cpp ...@@ -245,9 +247,13 @@ CLEANFILES += FingerprintTables.cpp
libfollyfingerprint_la_SOURCES = \ libfollyfingerprint_la_SOURCES = \
FingerprintTables.cpp FingerprintTables.cpp
libfollyfingerprint_la_LIBADD = libfolly.la libfollyfingerprint_la_LIBADD = libfolly.la
libfollyfingerprint_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
libfollybenchmark_la_SOURCES = Benchmark.cpp libfollybenchmark_la_SOURCES = Benchmark.cpp
libfollybenchmark_la_LIBADD = libfolly.la libfollybenchmark_la_LIBADD = libfolly.la
libfollybenchmark_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
libfollytimeout_queue_la_SOURCES = TimeoutQueue.cpp libfollytimeout_queue_la_SOURCES = TimeoutQueue.cpp
libfollytimeout_queue_la_LIBADD = libfolly.la libfollytimeout_queue_la_LIBADD = libfolly.la
libfollytimeout_queue_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
...@@ -4,12 +4,19 @@ ...@@ -4,12 +4,19 @@
AC_PREREQ(2.59) AC_PREREQ(2.59)
AC_INIT(folly, 0.1, folly@fb.com) AC_INIT(folly, 0.1, folly@fb.com)
m4_define([folly_libtool_current], [1])
# We assume all revisions are backwards incompatible.
LT_VERSION=folly_libtool_current:0:0
AC_SUBST(LT_VERSION)
AC_CONFIG_SRCDIR([Likely.h]) AC_CONFIG_SRCDIR([Likely.h])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AX_PREFIX_CONFIG_H([folly-config.h], [folly], [config.h]) AX_PREFIX_CONFIG_H([folly-config.h], [folly], [config.h])
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign dist-bzip2 nostdinc]) AM_INIT_AUTOMAKE([foreign dist-bzip2 nostdinc subdir-objects])
AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_MACRO_DIR([m4])
...@@ -63,6 +70,8 @@ AC_CHECK_LIB([double-conversion],[ceil],[],[AC_MSG_ERROR( ...@@ -63,6 +70,8 @@ AC_CHECK_LIB([double-conversion],[ceil],[],[AC_MSG_ERROR(
AC_CHECK_LIB([event], [event_set], [], [AC_MSG_ERROR([Unable to find libevent])]) AC_CHECK_LIB([event], [event_set], [], [AC_MSG_ERROR([Unable to find libevent])])
AC_CHECK_LIB([jemalloc], [rallocm])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL AC_HEADER_STDBOOL
AC_C_CONST AC_C_CONST
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 20 #serial 23
AC_DEFUN([AX_BOOST_BASE], AC_DEFUN([AX_BOOST_BASE],
[ [
...@@ -91,9 +91,23 @@ if test "x$want_boost" = "xyes"; then ...@@ -91,9 +91,23 @@ if test "x$want_boost" = "xyes"; then
dnl are found, e.g. when only header-only libraries are installed! dnl are found, e.g. when only header-only libraries are installed!
libsubdirs="lib" libsubdirs="lib"
ax_arch=`uname -m` ax_arch=`uname -m`
if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then case $ax_arch in
x86_64|ppc64|s390x|sparc64|aarch64)
libsubdirs="lib64 lib lib64" libsubdirs="lib64 lib lib64"
fi ;;
esac
dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
dnl them priority over the other paths since, if libs are found there, they
dnl are almost assuredly the ones desired.
AC_REQUIRE([AC_CANONICAL_HOST])
libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
case ${host_cpu} in
i?86)
libsubdirs="lib/i386-${host_os} $libsubdirs"
;;
esac
dnl first we check the system location for boost libraries dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option dnl this location ist chosen if boost libraries are installed with the --layout=system option
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 20 #serial 22
AC_DEFUN([AX_BOOST_REGEX], AC_DEFUN([AX_BOOST_REGEX],
[ [
...@@ -75,14 +75,14 @@ AC_DEFUN([AX_BOOST_REGEX], ...@@ -75,14 +75,14 @@ AC_DEFUN([AX_BOOST_REGEX],
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available]) AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_regex_lib" = "x"; then if test "x$ax_boost_user_regex_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.a*$;\1;'` ; do for libextension in `ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.dylib* $BOOSTLIBDIR/libboost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.dylib.*;\1;' -e 's;^lib\(boost_regex.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension} ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"]) [link_regex="no"])
done done
if test "x$link_regex" != "xyes"; then if test "x$link_regex" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_regex*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a*$;\1;'` ; do for libextension in `ls $BOOSTLIBDIR/boost_regex*.dll* $BOOSTLIBDIR/boost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a.*$;\1;'` ; do
ax_lib=${libextension} ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
# and this notice are preserved. This file is offered as-is, without any # and this notice are preserved. This file is offered as-is, without any
# warranty. # warranty.
#serial 23 #serial 27
AC_DEFUN([AX_BOOST_THREAD], AC_DEFUN([AX_BOOST_THREAD],
[ [
...@@ -104,14 +104,14 @@ AC_DEFUN([AX_BOOST_THREAD], ...@@ -104,14 +104,14 @@ AC_DEFUN([AX_BOOST_THREAD],
;; ;;
esac esac
if test "x$ax_boost_user_thread_lib" = "x"; then if test "x$ax_boost_user_thread_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_thread*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.so.*$;\1;'` `ls $BOOSTLIBDIR/libboost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_thread.*\)\.a*$;\1;'`; do for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do
ax_lib=${libextension} ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
[link_thread="no"]) [link_thread="no"])
done done
if test "x$link_thread" != "xyes"; then if test "x$link_thread" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_thread*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.dll.*$;\1;'` `ls $BOOSTLIBDIR/boost_thread*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_thread.*\)\.a*$;\1;'` ; do for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do
ax_lib=${libextension} ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break], [BOOST_THREAD_LIB="-l$ax_lib"; AC_SUBST(BOOST_THREAD_LIB) link_thread="yes"; break],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment