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