summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorAndrew Shadura <andrew@shadura.me>2014-01-28 15:21:50 +0100
committerAndrew Shadura <andrew@shadura.me>2014-01-28 15:21:50 +0100
commit51addbcf27d7b06dae80a0e39e5f5f83e94dd8ae (patch)
tree3d00bef2d26f97257ec6f4835505cd300054a1e3 /m4
parent1ed00f1a2893b43195f3fc747988da0bf6006797 (diff)
Update to libmowgli 2.0.0
Diffstat (limited to 'm4')
-rw-r--r--m4/acx_pthread.m4258
-rw-r--r--m4/ax_check_openssl.m4124
-rw-r--r--m4/buildsys.m4152
3 files changed, 459 insertions, 75 deletions
diff --git a/m4/acx_pthread.m4 b/m4/acx_pthread.m4
new file mode 100644
index 0000000..34b9a2d
--- /dev/null
+++ b/m4/acx_pthread.m4
@@ -0,0 +1,258 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/acx_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro figures out how to build C programs using POSIX threads. It
+# sets the PTHREAD_LIBS output variable to the threads library and linker
+# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+# flags that are needed. (The user can also force certain compiler
+# flags/libs to be tested by setting these environment variables.)
+#
+# NOTE: You are assumed to not only compile your program with these flags,
+# but also link it with them as well. e.g. you should link with
+# $CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+# If you are only building threads programs, you may wish to use these
+# variables in your default LIBS and CFLAGS:
+#
+# LIBS="$PTHREAD_LIBS $LIBS"
+# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#
+# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a threads library
+# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+# is not found. If ACTION-IF-FOUND is not specified, the default action
+# will define HAVE_PTHREAD.
+#
+# Please let the authors know if this macro fails on any platform, or if
+# you have any other suggestions or comments. This macro was based on work
+# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+# Alejandro Forero Cuervo to the autoconf macro repository. We are also
+# grateful for the helpful feedback of numerous users.
+#
+# LAST MODIFICATION
+#
+# 2008-04-12
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Macro Archive. When you make and
+# distribute a modified version of the Autoconf Macro, you may extend this
+# special exception to the GPL to apply to your modified version as well.
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test x"$acx_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+ *solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
+ ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ PTHREAD_LIBS="$flag"
+ ;;
+
+ pthread-config)
+ AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
+ if test x"$acx_pthread_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ [acx_pthread_ok=yes])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test "x$acx_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
+ [attr_name=$attr; break])
+ done
+ AC_MSG_RESULT($attr_name)
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case "${host_cpu}-${host_os}" in
+ *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ :
+else
+ acx_pthread_ok=no
+ $2
+fi
+])
diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4
new file mode 100644
index 0000000..a87c5a6
--- /dev/null
+++ b/m4/ax_check_openssl.m4
@@ -0,0 +1,124 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+# Look for OpenSSL in a number of default spots, or in a user-selected
+# spot (via --with-openssl). Sets
+#
+# OPENSSL_INCLUDES to the include directives required
+# OPENSSL_LIBS to the -l directives required
+# OPENSSL_LDFLAGS to the -L or -R flags required
+#
+# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# This macro sets OPENSSL_INCLUDES such that source files should use the
+# openssl/ directory in include directives:
+#
+# #include <openssl/hmac.h>
+#
+# LICENSE
+#
+# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 8
+
+AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
+AC_DEFUN([AX_CHECK_OPENSSL], [
+ found=false
+ AC_ARG_WITH([openssl],
+ [AS_HELP_STRING([--with-openssl=DIR],
+ [root of the OpenSSL directory])],
+ [
+ case "$withval" in
+ "" | y | ye | yes | n | no)
+ AC_MSG_ERROR([Invalid --with-openssl value])
+ ;;
+ *) ssldirs="$withval"
+ ;;
+ esac
+ ], [
+ # if pkg-config is installed and openssl has installed a .pc file,
+ # then use that information and don't search ssldirs
+ AC_PATH_PROG([PKG_CONFIG], [pkg-config])
+ if test x"$PKG_CONFIG" != x""; then
+ OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
+ if test $? = 0; then
+ OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
+ OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
+ found=true
+ fi
+ fi
+
+ # no such luck; use some default ssldirs
+ if ! $found; then
+ ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
+ fi
+ ]
+ )
+
+
+ # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
+ # an 'openssl' subdirectory
+
+ if ! $found; then
+ OPENSSL_INCLUDES=
+ for ssldir in $ssldirs; do
+ AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
+ if test -f "$ssldir/include/openssl/ssl.h"; then
+ OPENSSL_INCLUDES="-I$ssldir/include"
+ OPENSSL_LDFLAGS="-L$ssldir/lib"
+ OPENSSL_LIBS="-lssl -lcrypto"
+ found=true
+ AC_MSG_RESULT([yes])
+ break
+ else
+ AC_MSG_RESULT([no])
+ fi
+ done
+
+ # if the file wasn't found, well, go ahead and try the link anyway -- maybe
+ # it will just work!
+ fi
+
+ # try the preprocessor and linker with our new flags,
+ # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+ AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
+ echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
+ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
+
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+ save_CPPFLAGS="$CPPFLAGS"
+ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
+ LIBS="$OPENSSL_LIBS $LIBS"
+ CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
+ [
+ AC_MSG_RESULT([yes])
+ $1
+ ], [
+ AC_MSG_RESULT([no])
+ $2
+ ])
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+
+ AC_SUBST([OPENSSL_INCLUDES])
+ AC_SUBST([OPENSSL_LIBS])
+ AC_SUBST([OPENSSL_LDFLAGS])
+])
diff --git a/m4/buildsys.m4 b/m4/buildsys.m4
index bb5a955..43cebeb 100644
--- a/m4/buildsys.m4
+++ b/m4/buildsys.m4
@@ -1,7 +1,8 @@
dnl
-dnl Copyright (c) 2007 - 2009, Jonathan Schleifer <js@webkeks.org>
+dnl Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012
+dnl Jonathan Schleifer <js@webkeks.org>
dnl
-dnl https://webkeks.org/hg/buildsys/
+dnl https://webkeks.org/git/?p=buildsys.git
dnl
dnl Permission to use, copy, modify, and/or distribute this software for any
dnl purpose with or without fee is hereby granted, provided that the above
@@ -20,13 +21,51 @@ dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
dnl POSSIBILITY OF SUCH DAMAGE.
dnl
-AC_DEFUN([BUILDSYS_LIB], [
- AC_ARG_ENABLE(shared,
- AS_HELP_STRING([--disable-shared], [don't build shared libraries]))
+AC_DEFUN([BUILDSYS_INIT], [
+ AC_PATH_PROG(TPUT, tput)
- AS_IF([test x"$enable_shared" = x"no"],
- [BUILDSYS_STATIC_LIB_ONLY],
- [BUILDSYS_SHARED_LIB])
+ AS_IF([test x"$TPUT" != x""], [
+ if x=$($TPUT el 2>/dev/null); then
+ AC_SUBST(TERM_EL, "$x")
+ else
+ AC_SUBST(TERM_EL, "$($TPUT ce 2>/dev/null)")
+ fi
+
+ if x=$($TPUT sgr0 2>/dev/null); then
+ AC_SUBST(TERM_SGR0, "$x")
+ else
+ AC_SUBST(TERM_SGR0, "$($TPUT me 2>/dev/null)")
+ fi
+
+ if x=$($TPUT bold 2>/dev/null); then
+ AC_SUBST(TERM_BOLD, "$x")
+ else
+ AC_SUBST(TERM_BOLD, "$($TPUT md 2>/dev/null)")
+ fi
+
+ if x=$($TPUT setaf 1 2>/dev/null); then
+ AC_SUBST(TERM_SETAF1, "$x")
+ AC_SUBST(TERM_SETAF2, "$($TPUT setaf 2 2>/dev/null)")
+ AC_SUBST(TERM_SETAF3, "$($TPUT setaf 3 2>/dev/null)")
+ AC_SUBST(TERM_SETAF4, "$($TPUT setaf 4 2>/dev/null)")
+ AC_SUBST(TERM_SETAF6, "$($TPUT setaf 6 2>/dev/null)")
+ else
+ AC_SUBST(TERM_SETAF1, "$($TPUT AF 1 2>/dev/null)")
+ AC_SUBST(TERM_SETAF2, "$($TPUT AF 2 2>/dev/null)")
+ AC_SUBST(TERM_SETAF3, "$($TPUT AF 3 2>/dev/null)")
+ AC_SUBST(TERM_SETAF4, "$($TPUT AF 4 2>/dev/null)")
+ AC_SUBST(TERM_SETAF6, "$($TPUT AF 6 2>/dev/null)")
+ fi
+ ], [
+ AC_SUBST(TERM_EL, '\033\133K')
+ AC_SUBST(TERM_SGR0, '\033\133m')
+ AC_SUBST(TERM_BOLD, '\033\1331m')
+ AC_SUBST(TERM_SETAF1, '\033\13331m')
+ AC_SUBST(TERM_SETAF2, '\033\13332m')
+ AC_SUBST(TERM_SETAF3, '\033\13333m')
+ AC_SUBST(TERM_SETAF4, '\033\13334m')
+ AC_SUBST(TERM_SETAF6, '\033\13336m')
+ ])
])
AC_DEFUN([BUILDSYS_PROG_IMPLIB], [
@@ -55,93 +94,81 @@ AC_DEFUN([BUILDSYS_SHARED_LIB], [
case "$host_os" in
darwin*)
AC_MSG_RESULT(Darwin)
- LIB_CPPFLAGS='-DPIC'
- LIB_CFLAGS='-fPIC'
- LIB_LDFLAGS='-dynamiclib -flat_namespace'
+ LIB_CFLAGS='-fPIC -DPIC'
+ LIB_LDFLAGS='-dynamiclib -current_version ${LIB_MAJOR}.${LIB_MINOR} -compatibility_version ${LIB_MAJOR} -install_name ${libdir}/$$(i=${SHARED_LIB}; echo $${i%.dylib}).${LIB_MAJOR}.dylib'
LIB_PREFIX='lib'
LIB_SUFFIX='.dylib'
LDFLAGS_RPATH='-Wl,-rpath,${libdir}'
- PLUGIN_CPPFLAGS='-DPIC'
- PLUGIN_CFLAGS='-fPIC'
- PLUGIN_LDFLAGS='-bundle -flat_namespace -undefined suppress'
- PLUGIN_SUFFIX='.impl'
- INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i'
- UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib'
+ PLUGIN_CFLAGS='-fPIC -DPIC'
+ PLUGIN_LDFLAGS='-bundle -undefined dynamic_lookup'
+ PLUGIN_SUFFIX='.bundle'
+ INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i'
+ UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib'
CLEAN_LIB=''
;;
solaris*)
AC_MSG_RESULT(Solaris)
- LIB_CPPFLAGS='-DPIC'
- LIB_CFLAGS='-fPIC'
- LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}'
+ LIB_CFLAGS='-fPIC -DPIC'
+ LIB_LDFLAGS='-shared -Wl,-soname=${SHARED_LIB}.${LIB_MAJOR}.${LIB_MINOR}'
LIB_PREFIX='lib'
LIB_SUFFIX='.so'
LDFLAGS_RPATH='-Wl,-rpath,${libdir}'
- PLUGIN_CPPFLAGS='-DPIC'
- PLUGIN_CFLAGS='-fPIC'
- PLUGIN_LDFLAGS='-shared -fPIC'
+ PLUGIN_CFLAGS='-fPIC -DPIC'
+ PLUGIN_LDFLAGS='-shared'
PLUGIN_SUFFIX='.so'
- INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR} && rm -f ${DESTDIR}${libdir}/$$i && ${LN_S} $$i.${LIB_MAJOR}.${LIB_MINOR} ${DESTDIR}${libdir}/$$i'
- UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}'
+ INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR} && rm -f ${DESTDIR}${libdir}/$$i && ${LN_S} $$i.${LIB_MAJOR}.${LIB_MINOR} ${DESTDIR}${libdir}/$$i'
+ UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}'
CLEAN_LIB=''
;;
openbsd* | mirbsd*)
AC_MSG_RESULT(OpenBSD)
- LIB_CPPFLAGS='-DPIC'
- LIB_CFLAGS='-fPIC'
- LIB_LDFLAGS='-shared -fPIC'
+ LIB_CFLAGS='-fPIC -DPIC'
+ LIB_LDFLAGS='-shared'
LIB_PREFIX='lib'
LIB_SUFFIX='.so.${LIB_MAJOR}.${LIB_MINOR}'
LDFLAGS_RPATH='-Wl,-rpath,${libdir}'
- PLUGIN_CPPFLAGS='-DPIC'
- PLUGIN_CFLAGS='-fPIC'
- PLUGIN_LDFLAGS='-shared -fPIC'
+ PLUGIN_CFLAGS='-fPIC -DPIC'
+ PLUGIN_LDFLAGS='-shared'
PLUGIN_SUFFIX='.so'
- INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i'
- UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i'
+ INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i'
+ UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i'
CLEAN_LIB=''
;;
cygwin* | mingw*)
AC_MSG_RESULT(Win32)
- LIB_CPPFLAGS='-DPIC'
LIB_CFLAGS=''
- LIB_LDFLAGS='-shared -Wl,--out-implib,${LIB}.a'
+ LIB_LDFLAGS='-shared -Wl,--out-implib,${SHARED_LIB}.a'
LIB_PREFIX='lib'
LIB_SUFFIX='.dll'
LDFLAGS_RPATH='-Wl,-rpath,${libdir}'
- PLUGIN_CPPFLAGS=''
PLUGIN_CFLAGS=''
PLUGIN_LDFLAGS='-shared'
PLUGIN_SUFFIX='.dll'
- INSTALL_LIB='${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i && ${INSTALL} -m 755 $$i.a ${DESTDIR}${libdir}/$$i.a'
- UNINSTALL_LIB='rm -f ${DESTDIR}${bindir}/$$i ${DESTDIR}${libdir}/$$i.a'
- CLEAN_LIB='${LIB}.a'
+ INSTALL_LIB='&& ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i && ${INSTALL} -m 755 $$i.a ${DESTDIR}${libdir}/$$i.a'
+ UNINSTALL_LIB='&& rm -f ${DESTDIR}${bindir}/$$i ${DESTDIR}${libdir}/$$i.a'
+ CLEAN_LIB='${SHARED_LIB}.a'
;;
*)
AC_MSG_RESULT(GNU)
- LIB_CPPFLAGS='-DPIC'
- LIB_CFLAGS='-fPIC'
- LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}'
+ LIB_CFLAGS='-fPIC -DPIC'
+ LIB_LDFLAGS='-shared -Wl,-soname=${SHARED_LIB}.${LIB_MAJOR}'
LIB_PREFIX='lib'
LIB_SUFFIX='.so'
LDFLAGS_RPATH='-Wl,-rpath,${libdir}'
- PLUGIN_CPPFLAGS='-DPIC'
- PLUGIN_CFLAGS='-fPIC'
- PLUGIN_LDFLAGS='-shared -fPIC'
+ PLUGIN_CFLAGS='-fPIC -DPIC'
+ PLUGIN_LDFLAGS='-shared'
PLUGIN_SUFFIX='.so'
- INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i'
- UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0'
+ INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i'
+ UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0'
CLEAN_LIB=''
;;
esac
- AC_SUBST(LIB_CPPFLAGS)
AC_SUBST(LIB_CFLAGS)
AC_SUBST(LIB_LDFLAGS)
AC_SUBST(LIB_PREFIX)
AC_SUBST(LIB_SUFFIX)
AC_SUBST(LDFLAGS_RPATH)
- AC_SUBST(PLUGIN_CPPFLAGS)
AC_SUBST(PLUGIN_CFLAGS)
AC_SUBST(PLUGIN_LDFLAGS)
AC_SUBST(PLUGIN_SUFFIX)
@@ -150,33 +177,8 @@ AC_DEFUN([BUILDSYS_SHARED_LIB], [
AC_SUBST(CLEAN_LIB)
])
-AC_DEFUN([BUILDSYS_STATIC_LIB_ONLY], [
- AC_REQUIRE([AC_PROG_RANLIB])
- AC_PATH_TOOL(AR, ar)
-
- LIB_CPPFLAGS=''
- LIB_CFLAGS=''
- LIB_LDFLAGS=''
- LIB_PREFIX='lib'
- LIB_SUFFIX='.a'
- LDFLAGS_RPATH=''
- INSTALL_LIB='${INSTALL} -m 644 $$i ${DESTDIR}${libdir}/$$i'
- UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i'
- CLEAN_LIB=''
-
- AC_SUBST(LIB_CPPFLAGS)
- AC_SUBST(LIB_CFLAGS)
- AC_SUBST(LIB_LDFLAGS)
- AC_SUBST(LIB_PREFIX)
- AC_SUBST(LIB_SUFFIX)
- AC_SUBST(LDFLAGS_RPATH)
- AC_SUBST(INSTALL_LIB)
- AC_SUBST(UNINSTALL_LIB)
- AC_SUBST(CLEAN_LIB)
-])
-
AC_DEFUN([BUILDSYS_TOUCH_DEPS], [
- ${as_echo:="echo"} "${as_me:="configure"}: touching .deps files"
+ ${as_echo:="echo"} ${as_me:="configure"}": touching .deps files"
for i in $(find . -name Makefile); do
DEPSFILE="$(dirname $i)/.deps"
test -f "$DEPSFILE" && rm "$DEPSFILE"