1dnl Process this file with autoconf to produce a configure script.
2dnl
3dnl   Copyright (C) 2012-2024 Free Software Foundation, Inc.
4dnl
5dnl This file is free software; you can redistribute it and/or modify
6dnl it under the terms of the GNU General Public License as published by
7dnl the Free Software Foundation; either version 3 of the License, or
8dnl (at your option) any later version.
9dnl
10dnl This program is distributed in the hope that it will be useful,
11dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13dnl GNU General Public License for more details.
14dnl
15dnl You should have received a copy of the GNU General Public License
16dnl along with this program; see the file COPYING3.  If not see
17dnl <http://www.gnu.org/licenses/>.
18dnl
19m4_include([../bfd/version.m4])
20AC_INIT([gprof], BFD_VERSION)
21AC_CONFIG_SRCDIR([gprof.c])
22
23AC_CANONICAL_TARGET([])
24
25AM_INIT_AUTOMAKE
26AM_SILENT_RULES([yes])
27
28dnl For simplicity, we use the BFD configuration file for most
29dnl things.  However, we also need our own configuration file for
30dnl the automake PACKAGE and VERSION macros.  We don't name it
31dnl config.h, to avoid any possible confusion with the bfd config.h.
32AC_CONFIG_HEADERS([gconfig.h:gconfig.in])
33
34AC_PROG_CC
35AC_GNU_SOURCE
36AC_USE_SYSTEM_EXTENSIONS
37AC_PROG_INSTALL
38
39LT_INIT
40ACX_LARGEFILE
41
42# These are in addition to what is made available in bfd/.
43AC_CHECK_HEADERS(sys/time.h)
44AC_CHECK_FUNCS(setitimer)
45
46ALL_LINGUAS="bg da de eo es fi fr ga hu id it ja ms nl pt_BR ro ru rw sr sv tr uk vi"
47ZW_GNU_GETTEXT_SISTER_DIR
48AM_PO_SUBDIRS
49
50AM_MAINTAINER_MODE
51AM_CONDITIONAL(GENINSRC_NEVER, false)
52AC_EXEEXT
53
54AC_CHECK_HEADERS(sys/gmon_out.h)
55
56AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
57AC_CACHE_VAL(gprof_cv_decl_getopt_unistd_h,
58[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
59gprof_cv_decl_getopt_unistd_h=yes, gprof_cv_decl_getopt_unistd_h=no)])
60AC_MSG_RESULT($gprof_cv_decl_getopt_unistd_h)
61if test $gprof_cv_decl_getopt_unistd_h = yes; then
62  AC_DEFINE([HAVE_DECL_GETOPT], 1,
63	    [Is the prototype for getopt in <unistd.h> in the expected format?])
64fi
65
66# Some systems have fabs only in -lm, not in -lc.
67AC_SEARCH_LIBS(fabs, m)
68
69AM_BINUTILS_WARNINGS
70
71dnl Required by html, pdf, install-pdf and install-html
72AC_SUBST(datarootdir)
73AC_SUBST(docdir)
74AC_SUBST(htmldir)
75AC_SUBST(pdfdir)
76
77AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in])
78AC_OUTPUT
79
80GNU_MAKE_JOBSERVER
81