]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | dnl Process this file with autoconf to produce a configure script. |
6bf9431b BE |
2 | AC_PREREQ(2.59) |
3 | AC_INIT | |
4 | AC_CONFIG_SRCDIR([gprof.c]) | |
252b5132 | 5 | |
6bf9431b | 6 | AC_CANONICAL_TARGET([]) |
5d64ca4e | 7 | AC_ISC_POSIX |
252b5132 | 8 | |
27b7e12d AM |
9 | changequote(,)dnl |
10 | BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` | |
11 | changequote([,])dnl | |
12 | AM_INIT_AUTOMAKE(gprof, ${BFD_VERSION}) | |
252b5132 RH |
13 | |
14 | AM_PROG_LIBTOOL | |
15 | ||
16 | dnl For simplicity, we use the BFD configuration file for most | |
17 | dnl things. However, we also need our own configuration file for | |
18 | dnl the automake PACKAGE and VERSION macros. We don't name it | |
19 | dnl config.h, to avoid any possible confusion with the bfd config.h. | |
6bf9431b | 20 | AC_CONFIG_HEADERS([gconfig.h:gconfig.in]) |
252b5132 RH |
21 | |
22 | AC_PROG_CC | |
23 | AC_PROG_INSTALL | |
24 | ||
5af11cab | 25 | AC_CHECK_FUNCS(setmode) |
252b5132 | 26 | |
e87b2913 | 27 | ALL_LINGUAS="fr tr sv es id da pt_BR de vi" |
252b5132 RH |
28 | CY_GNU_GETTEXT |
29 | ||
30 | AM_MAINTAINER_MODE | |
31 | AC_EXEEXT | |
32 | ||
0eee5820 AM |
33 | AC_CHECK_HEADERS(sys/gmon_out.h) |
34 | ||
34875e64 NC |
35 | AC_MSG_CHECKING(for a known getopt prototype in unistd.h) |
36 | AC_CACHE_VAL(gprof_cv_decl_getopt_unistd_h, | |
37 | [AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);], | |
38 | gprof_cv_decl_getopt_unistd_h=yes, gprof_cv_decl_getopt_unistd_h=no)]) | |
39 | AC_MSG_RESULT($gprof_cv_decl_getopt_unistd_h) | |
40 | if test $gprof_cv_decl_getopt_unistd_h = yes; then | |
41 | AC_DEFINE([HAVE_DECL_GETOPT], 1, | |
42 | [Is the prototype for getopt in <unistd.h> in the expected format?]) | |
43 | fi | |
44 | ||
66477e87 | 45 | build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" |
1ad12f97 | 46 | |
569acd2c NC |
47 | AC_ARG_ENABLE(werror, |
48 | [ --enable-werror treat compile warnings as errors], | |
1ad12f97 NC |
49 | [case "${enableval}" in |
50 | yes | y) ERROR_ON_WARNING="yes" ;; | |
51 | no | n) ERROR_ON_WARNING="no" ;; | |
569acd2c | 52 | *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;; |
1ad12f97 NC |
53 | esac]) |
54 | ||
569acd2c | 55 | # Enable -Werror by default, suppressing it only for --disable-werror |
1ad12f97 NC |
56 | # or --disable-build-warnings. |
57 | if test "${ERROR_ON_WARNING}" != no | |
58 | then | |
59 | build_warnings="$build_warnings -Werror" | |
60 | fi | |
569acd2c | 61 | |
a2d91340 AC |
62 | AC_ARG_ENABLE(build-warnings, |
63 | [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], | |
64 | [case "${enableval}" in | |
65 | yes) ;; | |
66 | no) build_warnings="-w";; | |
67 | ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` | |
68 | build_warnings="${build_warnings} ${t}";; | |
69 | *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` | |
70 | build_warnings="${t} ${build_warnings}";; | |
71 | *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; | |
72 | esac | |
73 | if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then | |
74 | echo "Setting warning flags = $build_warnings" 6>&1 | |
75 | fi])dnl | |
76 | WARN_CFLAGS="" | |
77 | if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then | |
78 | WARN_CFLAGS="${build_warnings}" | |
79 | fi | |
80 | AC_SUBST(WARN_CFLAGS) | |
81 | ||
6bf9431b BE |
82 | AC_CONFIG_FILES([Makefile po/Makefile.in:po/Make-in]) |
83 | AC_CONFIG_COMMANDS([default],[[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile]],[[]]) | |
84 | AC_OUTPUT |