1dnl Process this file with autoconf to produce a configure script.
2dnl
3dnl   Copyright (C) 2012-2017 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
19AC_PREREQ(2.59)
20m4_include([../bfd/version.m4])
21AC_INIT([gprof], BFD_VERSION)
22AC_CONFIG_SRCDIR([gprof.c])
23
24AC_CANONICAL_TARGET([])
25AC_ISC_POSIX
26
27AM_INIT_AUTOMAKE
28
29dnl For simplicity, we use the BFD configuration file for most
30dnl things.  However, we also need our own configuration file for
31dnl the automake PACKAGE and VERSION macros.  We don't name it
32dnl config.h, to avoid any possible confusion with the bfd config.h.
33AC_CONFIG_HEADERS([gconfig.h:gconfig.in])
34
35AC_PROG_CC
36AC_GNU_SOURCE
37AC_USE_SYSTEM_EXTENSIONS
38AC_PROG_INSTALL
39
40LT_INIT
41ACX_LARGEFILE
42
43AC_CHECK_FUNCS(setmode)
44
45ALL_LINGUAS="fr tr sv es id da pt_BR de vi rw ga ms fi nl bg eo ja sr hu"
46ZW_GNU_GETTEXT_SISTER_DIR
47AM_PO_SUBDIRS
48
49AM_MAINTAINER_MODE
50AM_CONDITIONAL(GENINSRC_NEVER, false)
51AC_EXEEXT
52
53AC_CHECK_HEADERS(sys/gmon_out.h)
54
55AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
56AC_CACHE_VAL(gprof_cv_decl_getopt_unistd_h,
57[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
58gprof_cv_decl_getopt_unistd_h=yes, gprof_cv_decl_getopt_unistd_h=no)])
59AC_MSG_RESULT($gprof_cv_decl_getopt_unistd_h)
60if test $gprof_cv_decl_getopt_unistd_h = yes; then
61  AC_DEFINE([HAVE_DECL_GETOPT], 1,
62	    [Is the prototype for getopt in <unistd.h> in the expected format?])
63fi
64
65# Some systems have fabs only in -lm, not in -lc.
66AC_SEARCH_LIBS(fabs, m)
67
68AM_BINUTILS_WARNINGS
69
70dnl Required by html, pdf, install-pdf and install-html
71AC_SUBST(datarootdir)
72AC_SUBST(docdir)
73AC_SUBST(htmldir)
74AC_SUBST(pdfdir)
75
76AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in])
77AC_OUTPUT
78