Skip to content

Commit c3838c6

Browse files
susnuxwangqr
authored andcommitted
Updates AX_BOOST files to detect current boost versions
1 parent 3bae7fa commit c3838c6

6 files changed

+54
-28
lines changed

m4macros/ax_boost_base.m4

+6-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# and this notice are preserved. This file is offered as-is, without any
3434
# warranty.
3535

36-
#serial 42
36+
#serial 49
3737

3838
# example boost program (need to pass version)
3939
m4_define([_AX_BOOST_BASE_PROGRAM],
@@ -113,15 +113,17 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
113113
dnl are found, e.g. when only header-only libraries are installed!
114114
AS_CASE([${host_cpu}],
115115
[x86_64],[libsubdirs="lib64 libx32 lib lib64"],
116-
[ppc64|s390x|sparc64|aarch64|ppc64le],[libsubdirs="lib64 lib lib64"],
117-
[libsubdirs="lib"],
116+
[mips*64*],[libsubdirs="lib64 lib32 lib lib64"],
117+
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64|e2k],[libsubdirs="lib64 lib lib64"],
118+
[libsubdirs="lib"]
118119
)
119120
120121
dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
121122
dnl them priority over the other paths since, if libs are found there, they
122123
dnl are almost assuredly the ones desired.
123124
AS_CASE([${host_cpu}],
124125
[i?86],[multiarch_libsubdir="lib/i386-${host_os}"],
126+
[armv7l],[multiarch_libsubdir="lib/arm-${host_os}"],
125127
[multiarch_libsubdir="lib/${host_cpu}-${host_os}"]
126128
)
127129
@@ -298,4 +300,4 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
298300
CPPFLAGS="$CPPFLAGS_SAVED"
299301
LDFLAGS="$LDFLAGS_SAVED"
300302
301-
])
303+
])

m4macros/ax_boost_chrono.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# and this notice are preserved. This file is offered as-is, without any
3030
# warranty.
3131

32-
#serial 4
32+
#serial 5
3333

3434
AC_DEFUN([AX_BOOST_CHRONO],
3535
[
@@ -105,7 +105,7 @@ AC_DEFUN([AX_BOOST_CHRONO],
105105
106106
fi
107107
if test "x$ax_lib" = "x"; then
108-
AC_MSG_ERROR(Could not find a version of the library!)
108+
AC_MSG_ERROR(Could not find a version of the Boost::Chrono library!)
109109
fi
110110
if test "x$link_chrono" = "xno"; then
111111
AC_MSG_ERROR(Could not link against $ax_lib !)

m4macros/ax_boost_filesystem.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# and this notice are preserved. This file is offered as-is, without any
3232
# warranty.
3333

34-
#serial 27
34+
#serial 28
3535

3636
AC_DEFUN([AX_BOOST_FILESYSTEM],
3737
[
@@ -104,7 +104,7 @@ AC_DEFUN([AX_BOOST_FILESYSTEM],
104104
105105
fi
106106
if test "x$ax_lib" = "x"; then
107-
AC_MSG_ERROR(Could not find a version of the library!)
107+
AC_MSG_ERROR(Could not find a version of the Boost::Filesystem library!)
108108
fi
109109
if test "x$link_filesystem" != "xyes"; then
110110
AC_MSG_ERROR(Could not link against $ax_lib !)

m4macros/ax_boost_locale.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# and this notice are preserved. This file is offered as-is, without any
3030
# warranty.
3131

32-
#serial 2
32+
#serial 3
3333

3434
AC_DEFUN([AX_BOOST_LOCALE],
3535
[
@@ -106,7 +106,7 @@ AC_DEFUN([AX_BOOST_LOCALE],
106106
107107
fi
108108
if test "x$ax_lib" = "x"; then
109-
AC_MSG_ERROR(Could not find a version of the library!)
109+
AC_MSG_ERROR(Could not find a version of the Boost::Locale library!)
110110
fi
111111
if test "x$link_locale" = "xno"; then
112112
AC_MSG_ERROR(Could not link against $ax_lib !)

m4macros/ax_boost_system.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# and this notice are preserved. This file is offered as-is, without any
3232
# warranty.
3333

34-
#serial 19
34+
#serial 20
3535

3636
AC_DEFUN([AX_BOOST_SYSTEM],
3737
[
@@ -108,7 +108,7 @@ AC_DEFUN([AX_BOOST_SYSTEM],
108108
109109
fi
110110
if test "x$ax_lib" = "x"; then
111-
AC_MSG_ERROR(Could not find a version of the library!)
111+
AC_MSG_ERROR(Could not find a version of the Boost::System library!)
112112
fi
113113
if test "x$link_system" = "xno"; then
114114
AC_MSG_ERROR(Could not link against $ax_lib !)

m4macros/ax_boost_thread.m4

+40-16
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
# and this notice are preserved. This file is offered as-is, without any
3131
# warranty.
3232

33-
#serial 31
33+
#serial 33
3434

3535
AC_DEFUN([AX_BOOST_THREAD],
3636
[
@@ -67,13 +67,24 @@ AC_DEFUN([AX_BOOST_THREAD],
6767
[AC_LANG_PUSH([C++])
6868
CXXFLAGS_SAVE=$CXXFLAGS
6969
70-
if test "x$host_os" = "xsolaris" ; then
71-
CXXFLAGS="-pthreads $CXXFLAGS"
72-
elif test "x$host_os" = "xmingw32" ; then
73-
CXXFLAGS="-mthreads $CXXFLAGS"
74-
else
75-
CXXFLAGS="-pthread $CXXFLAGS"
76-
fi
70+
case "x$host_os" in
71+
xsolaris )
72+
CXXFLAGS="-pthreads $CXXFLAGS"
73+
break;
74+
;;
75+
xmingw32 )
76+
CXXFLAGS="-mthreads $CXXFLAGS"
77+
break;
78+
;;
79+
*android* )
80+
break;
81+
;;
82+
* )
83+
CXXFLAGS="-pthread $CXXFLAGS"
84+
break;
85+
;;
86+
esac
87+
7788
AC_COMPILE_IFELSE([
7889
AC_LANG_PROGRAM(
7990
[[@%:@include <boost/thread/thread.hpp>]],
@@ -84,13 +95,23 @@ AC_DEFUN([AX_BOOST_THREAD],
8495
AC_LANG_POP([C++])
8596
])
8697
if test "x$ax_cv_boost_thread" = "xyes"; then
87-
if test "x$host_os" = "xsolaris" ; then
88-
BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
89-
elif test "x$host_os" = "xmingw32" ; then
90-
BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
91-
else
92-
BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
93-
fi
98+
case "x$host_os" in
99+
xsolaris )
100+
BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
101+
break;
102+
;;
103+
xmingw32 )
104+
BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
105+
break;
106+
;;
107+
*android* )
108+
break;
109+
;;
110+
* )
111+
BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
112+
break;
113+
;;
114+
esac
94115
95116
AC_SUBST(BOOST_CPPFLAGS)
96117
@@ -130,7 +151,7 @@ AC_DEFUN([AX_BOOST_THREAD],
130151
131152
fi
132153
if test "x$ax_lib" = "x"; then
133-
AC_MSG_ERROR(Could not find a version of the library!)
154+
AC_MSG_ERROR(Could not find a version of the Boost::Thread library!)
134155
fi
135156
if test "x$link_thread" = "xno"; then
136157
AC_MSG_ERROR(Could not link against $ax_lib !)
@@ -148,6 +169,9 @@ AC_DEFUN([AX_BOOST_THREAD],
148169
xmingw32 )
149170
break;
150171
;;
172+
*android* )
173+
break;
174+
;;
151175
* )
152176
BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
153177
break;

0 commit comments

Comments
 (0)