1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-10 03:25:01 -05:00
pacman/acinclude.m4
Dan McGee f489e969f0 Update build system (automake, autoconf, libtool)
Unfortunately this patch is hard to split up into smaller chunks. Our build
system and the associated automake/autoconf/libtool macros has been left
untouched for a while, and could use a refresher.

* Upgrade ltmain.sh to the latest version
* Move away from a huge acinclude.m4 directory to using individual files in
  the m4/ subdirectory, suggested by upstream automake documentation
* Update all macros to their latest available version
* Adjust Makefile.am and autogen.sh to accommodate m4/ subdirectory

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-23 09:10:53 -05:00

81 lines
2.8 KiB
Plaintext

dnl acinclude.m4 - configure macros used by pacman and libalpm
dnl Add some custom macros for pacman and libalpm
dnl GCC_STACK_PROTECT_LIB
dnl adds -lssp to LIBS if it is available
dnl ssp is usually provided as part of libc, but was previously a separate lib
dnl It does not hurt to add -lssp even if libc provides SSP - in that case
dnl libssp will simply be ignored.
AC_DEFUN([GCC_STACK_PROTECT_LIB],[
AC_CACHE_CHECK([whether libssp exists], ssp_cv_lib,
[ssp_old_libs="$LIBS"
LIBS="$LIBS -lssp"
AC_TRY_LINK(,, ssp_cv_lib=yes, ssp_cv_lib=no)
LIBS="$ssp_old_libs"
])
if test $ssp_cv_lib = yes; then
LIBS="$LIBS -lssp"
fi
])
dnl GCC_STACK_PROTECT_CC
dnl checks -fstack-protector-all with the C compiler, if it exists then updates
dnl CFLAGS and defines ENABLE_SSP_CC
AC_DEFUN([GCC_STACK_PROTECT_CC],[
AC_LANG_ASSERT(C)
if test "X$CC" != "X"; then
AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-all],
ssp_cv_cc,
[ssp_old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector-all"
AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
CFLAGS="$ssp_old_cflags"
])
if test $ssp_cv_cc = yes; then
CFLAGS="$CFLAGS -fstack-protector-all"
AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
fi
fi
])
dnl GCC_VISIBILITY_CC
dnl checks -fvisibility=internal with the C compiler, if it exists then
dnl defines ENABLE_VISIBILITY_CC in both configure script and Makefiles
AC_DEFUN([GCC_VISIBILITY_CC],[
AC_LANG_ASSERT(C)
if test "X$CC" != "X"; then
AC_CACHE_CHECK([whether ${CC} accepts -fvisibility=internal],
visibility_cv_cc,
[visibility_old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=internal"
AC_TRY_COMPILE(,, visibility_cv_cc=yes, visibility_cv_cc=no)
CFLAGS="$visibility_old_cflags"
])
if test $visibility_cv_cc = yes; then
AC_DEFINE([ENABLE_VISIBILITY_CC], 1, [Define if symbol visibility C support is enabled.])
fi
AM_CONDITIONAL([ENABLE_VISIBILITY_CC], test "x$visibility_cv_cc" = "xyes")
fi
])
dnl GCC_GNU89_INLINE_CC
dnl checks -fgnu89-inline with the C compiler, if it exists then defines
dnl ENABLE_GNU89_INLINE_CC in both configure script and Makefiles
AC_DEFUN([GCC_GNU89_INLINE_CC],[
AC_LANG_ASSERT(C)
if test "X$CC" != "X"; then
AC_CACHE_CHECK([for -fgnu89-inline],
gnu89_inline_cv_cc,
[ gnu89_inline_old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -fgnu89-inline"
AC_TRY_COMPILE(,, gnu89_inline_cv_cc=yes, gnu89_inline_cv_cc=no)
CFLAGS="$gnu89_inline_old_cflags"
])
if test $gnu89_inline_cv_cc = yes; then
AC_DEFINE([ENABLE_GNU89_INLINE_CC], 1, [Define if gnu89 inlining semantics should be used.])
fi
AM_CONDITIONAL([ENABLE_GNU89_INLINE_CC], test "x$gnu89_inline_cv_cc" = "xyes")
fi
])