diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 90 |
1 files changed, 17 insertions, 73 deletions
diff --git a/configure.ac b/configure.ac index 932b47c..cad1e36 100644 --- a/configure.ac +++ b/configure.ac @@ -20,82 +20,33 @@ AC_CANONICAL_HOST AC_PROG_CXX AC_LANG(C++) -# Check for threads. +# Required by subdir-objects. # -AC_ARG_ENABLE( - [threads], - AS_HELP_STRING([--disable-threads], [disable threads (enabled by default)]), - [AS_IF([test x"$enableval" = xno], [threads=none], [threads=check])], - [threads=check]) +AM_PROG_CC_C_O -# If thread support is not disabled by the user, figure out what we -# can use. +# Create the libtool executable so that we can use it in further tests. # -AS_IF( - [test x$threads = xcheck], - [ - case $host_os in - windows* | mingw*) - AC_DEFINE([ODB_THREADS_WIN32], [1], [Have Win32 threads.]) - case $host_os in - mingw*) - CXXFLAGS="$CXXFLAGS -mthreads" - ;; - esac - threads=win32 - ;; - *) - ACX_PTHREAD - AS_IF( - [test x$acx_pthread_ok = xyes], - [ - threads=posix - LIBS="$LIBS $PTHREAD_LIBS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CXXFLAGS" - AC_DEFINE([ODB_THREADS_POSIX], [1], [Have POSIX threads.]) - ]) - ;; - esac - ], - [AC_DEFINE([ODB_THREADS_NONE], [1], [Have no threads.])]) - -AM_CONDITIONAL([ODB_THREADS_NONE], [test x"$threads" = xnone]) -AM_CONDITIONAL([ODB_THREADS_WIN32], [test x"$threads" = xwin32]) -AM_CONDITIONAL([ODB_THREADS_POSIX], [test x"$threads" = xposix]) +LT_OUTPUT -# Check if we should disable rpath. +# Check for threads. # -AC_MSG_CHECKING([whether to use rpath]) -AC_ARG_ENABLE( - [rpath], - [AC_HELP_STRING([--disable-rpath], [patch libtool to not use rpath])], - [libtool_rpath="$enable_rpath"], - [libtool_rpath="yes"]) -AC_MSG_RESULT($libtool_rpath) +THREADS -# Allow the user to specify the pkgconfig directory. -# -AC_ARG_WITH( - [pkgconfigdir], - [AC_HELP_STRING([--with-pkgconfigdir=DIR],[location of pkgconfig dir (default is libdir/pkgconfig)])], - [pkgconfigdir=${withval}], - [pkgconfigdir='${libdir}/pkgconfig']) -AC_SUBST([pkgconfigdir]) +AM_CONDITIONAL([ODB_THREADS_NONE], [test x$threads = xnone]) +AM_CONDITIONAL([ODB_THREADS_WIN32], [test x$threads = xwin32]) +AM_CONDITIONAL([ODB_THREADS_POSIX], [test x$threads = xposix]) -# Required by subdir-objects. +AS_IF([test x$threads = xnone], AC_DEFINE([ODB_THREADS_NONE], [1], [Have no threads.])) +AS_IF([test x$threads = xwin32], AC_DEFINE([ODB_THREADS_WIN32], [1], [Have Win32 threads.])) +AS_IF([test x$threads = xposix], AC_DEFINE([ODB_THREADS_POSIX], [1], [Have POSIX threads.])) + +# Allow the user to specify the pkgconfig directory. # -AM_PROG_CC_C_O +PKGCONFIG -# Patch libtool to not use rpath if requested. +# Check if we should disable rpath. # -AC_CONFIG_COMMANDS( - [libtool-rpath-patch], - [if test "$libtool_use_rpath" = "no"; then - sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "/' - mv libtool-2 libtool - chmod 755 libtool - fi], - [libtool_use_rpath=$libtool_rpath]) +DISABLE_RPATH # Output. # @@ -104,10 +55,3 @@ AC_CONFIG_FILES([ __path__(config_files) ]) AC_OUTPUT - -AS_IF( - [test x$threads = xcheck], - [ - AC_MSG_NOTICE - AC_MSG_NOTICE([warning: thread support not available, building single-threaded]) - ]) |