| 1 |
dnl -*- Autoconf -*- |
| 2 |
dnl Process this file with autoconf to produce a configure script. |
| 3 |
dnl |
| 4 |
dnl Copyright (C) 2022-2025 Free Software Foundation, Inc. |
| 5 |
dnl |
| 6 |
dnl This file is free software; you can redistribute it and/or modify |
| 7 |
dnl it under the terms of the GNU General Public License as published by |
| 8 |
dnl the Free Software Foundation; either version 2 of the License, or |
| 9 |
dnl (at your option) any later version. |
| 10 |
dnl |
| 11 |
dnl This program is distributed in the hope that it will be useful, |
| 12 |
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
dnl GNU General Public License for more details. |
| 15 |
dnl |
| 16 |
dnl You should have received a copy of the GNU General Public License |
| 17 |
dnl along with this program; see the file COPYING. If not see |
| 18 |
dnl <http://www.gnu.org/licenses/>. |
| 19 |
dnl |
| 20 |
|
| 21 |
AC_INIT([libsframe], [BFD_VERSION]) |
| 22 |
AC_CONFIG_SRCDIR(sframe.c) |
| 23 |
|
| 24 |
AC_CANONICAL_TARGET |
| 25 |
|
| 26 |
AC_USE_SYSTEM_EXTENSIONS |
| 27 |
AM_INIT_AUTOMAKE |
| 28 |
AM_SILENT_RULES([yes]) |
| 29 |
|
| 30 |
# Checks for programs. |
| 31 |
AC_PROG_MAKE_SET |
| 32 |
AC_PROG_CC |
| 33 |
AC_PROG_RANLIB |
| 34 |
AM_PROG_AR |
| 35 |
|
| 36 |
dnl Default to a non shared library. This may be overridden by the |
| 37 |
dnl configure option --enable-shared. |
| 38 |
AC_DISABLE_SHARED |
| 39 |
|
| 40 |
LT_INIT |
| 41 |
AC_SYS_LARGEFILE |
| 42 |
|
| 43 |
MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing |
| 44 |
AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal]) |
| 45 |
AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf]) |
| 46 |
AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader]) |
| 47 |
|
| 48 |
dnl Figure out what compiler warnings we can enable. |
| 49 |
dnl See config/warnings.m4 for details. |
| 50 |
|
| 51 |
ACX_PROG_CC_WARNING_OPTS([-Wall -Wextra -Wwrite-strings \ |
| 52 |
-Wmissing-format-attribute \ |
| 53 |
-Wstrict-prototypes -Wmissing-prototypes], |
| 54 |
[ac_libsframe_warn_cflags]) |
| 55 |
|
| 56 |
dnl The libsframe testsuite uses dejagnu.h. |
| 57 |
dnl If the version of dejagnu and gcc are incompatible then the libsframe |
| 58 |
dnl testsuite is not built. |
| 59 |
|
| 60 |
DEJAGNU_CHECK_VERSION |
| 61 |
AM_CONDITIONAL([HAVE_COMPAT_DEJAGNU], [test "x$ac_cv_dejagnu_compat" = "xyes"]) |
| 62 |
|
| 63 |
COMPAT_DEJAGNU=$ac_cv_dejagnu_compat |
| 64 |
AC_SUBST(COMPAT_DEJAGNU) |
| 65 |
|
| 66 |
dnl Check for makeinfo for building documentation |
| 67 |
build_info= |
| 68 |
AC_CHECK_PROGS([MAKEINFO], makeinfo, makeinfo, ) |
| 69 |
if test "x$MAKEINFO" = "x"; then |
| 70 |
MAKEINFO="@echo makeinfo missing; true" |
| 71 |
build_info= |
| 72 |
else |
| 73 |
BUILD_INFO=info |
| 74 |
case "$MAKEINFO" in |
| 75 |
*/missing\ makeinfo*) |
| 76 |
build_info= |
| 77 |
AC_MSG_WARN([ |
| 78 |
*** Makeinfo is missing. Info documentation will not be built.]) |
| 79 |
;; |
| 80 |
*) |
| 81 |
build_info=yes |
| 82 |
;; |
| 83 |
esac |
| 84 |
fi |
| 85 |
AM_CONDITIONAL(BUILD_INFO, test "${build_info}" = yes) |
| 86 |
|
| 87 |
dnl Determine if using Solaris linker |
| 88 |
AC_MSG_CHECKING([if using Solaris linker]) |
| 89 |
SLD=`$LD --version 2>&1 | grep Solaris` |
| 90 |
if test "$SLD"; then |
| 91 |
have_solaris_ld=yes |
| 92 |
AC_MSG_RESULT(yes) |
| 93 |
else |
| 94 |
have_solaris_ld=no |
| 95 |
AC_MSG_RESULT(no) |
| 96 |
fi |
| 97 |
AM_CONDITIONAL(HAVE_SOLARIS_LD, test "$have_solaris_ld" = "yes") |
| 98 |
|
| 99 |
if test "$have_solaris_ld" = "yes"; then |
| 100 |
GLD=`$LD --help < /dev/null 2>&1 | grep 'M mapfile'` |
| 101 |
else |
| 102 |
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` |
| 103 |
fi |
| 104 |
|
| 105 |
if test "$GLD"; then |
| 106 |
have_ld_version_script=yes |
| 107 |
AC_MSG_RESULT(yes) |
| 108 |
else |
| 109 |
have_ld_version_script=no |
| 110 |
AC_MSG_RESULT(no) |
| 111 |
AC_MSG_WARN(*** Versioned symbols not enabled.) |
| 112 |
fi |
| 113 |
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") |
| 114 |
|
| 115 |
AM_MAINTAINER_MODE |
| 116 |
AM_INSTALL_LIBBFD |
| 117 |
|
| 118 |
GCC_AC_FUNC_MMAP |
| 119 |
AC_CHECK_HEADERS(byteswap.h endian.h) |
| 120 |
|
| 121 |
dnl Check for bswap_{16,32,64} |
| 122 |
AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64], [], [], [[#include <byteswap.h>]]) |
| 123 |
|
| 124 |
AC_CONFIG_FILES(Makefile) |
| 125 |
AC_CONFIG_HEADERS(config.h) |
| 126 |
AC_OUTPUT |
| 127 |
|
| 128 |
GNU_MAKE_JOBSERVER |