From: Michael Snyder <msnyder@vmware.com>
To: "tromey@redhat.com" <tromey@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: RFA: shrink configure script
Date: Sat, 22 Nov 2008 12:16:00 -0000 [thread overview]
Message-ID: <492708BE.7060107@vmware.com> (raw)
In-Reply-To: <m3y6zdewk5.fsf@fleche.redhat.com>
Tom Tromey wrote:
> While looking at configure.ac for a different patch, I noticed many
> consecutive calls to AC_CHECK_FUNCS.
>
> This repetition unnecessarily bloats configure, because each such
> macro is expanded into some boilerplate sh code. Combining the
> arguments makes configure smaller, and IMO is not any less readable.
> I tried to combine calls only when appropriate. This shrank
> gdb/configure on my machine from 807k to 638k.
>
> Built and regtested on x86-64 (compile farm).
> Ok?
Seems like a win to me...
> 2008-11-20 Tom Tromey <tromey@redhat.com>
>
> * configure: Rebuild.
> * configure.ac: Merge calls to AC_CHECK_FUNCS, AC_CHECK_HEADERS,
> AC_CHECK_DECLS, and AC_CHECK_MEMBERS.
>
> diff --git a/gdb/configure.ac b/gdb/configure.ac
> index 054d5c2..8725aa6 100644
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -317,16 +317,14 @@ AC_ARG_WITH(libunwind,
> no) enable_libunwind=no ;;
> *) AC_MSG_ERROR(bad value ${withval} for GDB with-libunwind option) ;;
> esac],[
> - AC_CHECK_HEADERS(libunwind.h)
> - AC_CHECK_HEADERS(libunwind-ia64.h)
> + AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h)
> if test x"$ac_cv_header_libunwind_h" = xyes -a x"$ac_cv_header_libunwind_ia64_h" = xyes; then
> enable_libunwind=yes;
> fi
> ])
>
> if test x"$enable_libunwind" = xyes; then
> - AC_CHECK_HEADERS(libunwind.h)
> - AC_CHECK_HEADERS(libunwind-ia64.h)
> + AC_CHECK_HEADERS(libunwind.h libunwind-ia64.h)
> AC_DEFINE(HAVE_LIBUNWIND, 1, [Define if libunwind library is being used.])
> CONFIG_OBS="$CONFIG_OBS libunwind-frame.o"
> CONFIG_DEPS="$CONFIG_DEPS libunwind-frame.o"
> @@ -688,7 +686,17 @@ AC_SUBST(PYTHON_CFLAGS)
> AC_HEADER_DIRENT
> AC_HEADER_STAT
> AC_HEADER_STDC
> -AC_CHECK_HEADERS(nlist.h)
> +# elf_hp.h is for HP/UX 64-bit shared library support.
> +# FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h)
> +# unconditionally, so what's the point in checking these?
> +AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
> + thread_db.h gnu/libc-version.h signal.h stddef.h \
> + stdlib.h string.h memory.h strings.h sys/fault.h \
> + sys/file.h sys/filio.h sys/ioctl.h sys/param.h \
> + sys/resource.h sys/procfs.h sys/ptrace.h ptrace.h \
> + sys/reg.h sys/debugreg.h sys/select.h sys/syscall.h \
> + sys/types.h sys/wait.h wait.h termios.h termio.h \
> + sgtty.h unistd.h elf_hp.h ctype.h time.h])
> AC_CHECK_HEADERS(link.h, [], [],
> [#if HAVE_SYS_TYPES_H
> # include <sys/types.h>
> @@ -697,38 +705,16 @@ AC_CHECK_HEADERS(link.h, [], [],
> # include <nlist.h>
> #endif
> ])
> -AC_CHECK_HEADERS(machine/reg.h)
> -AC_CHECK_HEADERS(poll.h sys/poll.h)
> -AC_CHECK_HEADERS(proc_service.h thread_db.h gnu/libc-version.h)
> -AC_CHECK_HEADERS(signal.h)
> -AC_CHECK_HEADERS(stddef.h)
> -AC_CHECK_HEADERS(stdlib.h)
> -AC_CHECK_HEADERS(string.h memory.h strings.h)
> -AC_CHECK_HEADERS(sys/fault.h)
> -AC_CHECK_HEADERS(sys/file.h)
> -AC_CHECK_HEADERS(sys/filio.h)
> -AC_CHECK_HEADERS(sys/ioctl.h)
> -AC_CHECK_HEADERS(sys/param.h)
> -AC_CHECK_HEADERS(sys/resource.h)
> AC_CHECK_HEADERS(sys/proc.h, [], [],
> [#if HAVE_SYS_PARAM_H
> # include <sys/param.h>
> #endif
> ])
> -AC_CHECK_HEADERS(sys/procfs.h)
> -AC_CHECK_HEADERS(sys/ptrace.h ptrace.h)
> -AC_CHECK_HEADERS(sys/reg.h sys/debugreg.h)
> -AC_CHECK_HEADERS(sys/select.h)
> -AC_CHECK_HEADERS(sys/syscall.h)
> -AC_CHECK_HEADERS(sys/types.h)
> AC_CHECK_HEADERS(sys/user.h, [], [],
> [#if HAVE_SYS_PARAM_H
> # include <sys/param.h>
> #endif
> ])
> -AC_CHECK_HEADERS(sys/wait.h wait.h)
> -AC_CHECK_HEADERS(termios.h termio.h sgtty.h)
> -AC_CHECK_HEADERS(unistd.h)
>
> # On Solaris 2.[789], we need to define _MSE_INT_H to avoid a clash
> # between <widec.h> and <wchar.h> that would cause AC_CHECK_HEADERS to
> @@ -741,35 +727,25 @@ case $host_os in
> Solaris 2.[789] when using GCC. ])
> fi ;;
> esac
> -AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h)
> -AC_CHECK_HEADERS(ncurses/term.h)
> +AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h ncurses/term.h)
> AC_CHECK_HEADERS(term.h, [], [],
> [#if HAVE_CURSES_H
> # include <curses.h>
> #endif
> ])
>
> -# Check for HP/UX 64-bit shared library support
> -AC_CHECK_HEADERS(elf_hp.h)
> -
> -# FIXME: kettenis/20030102: In most cases we include these
> -# unconditionally, so what's the point in checking these?
> -AC_CHECK_HEADERS(ctype.h time.h)
> -
> # ------------------------- #
> # Checks for declarations. #
> # ------------------------- #
>
> -AC_CHECK_DECLS([free, malloc, realloc])
> -AC_CHECK_DECLS([strerror, strstr])
> -AC_CHECK_DECLS([getopt, snprintf, vsnprintf])
> +AC_CHECK_DECLS([free, malloc, realloc, strerror, strstr, getopt,
> + snprintf, vsnprintf])
>
> # ----------------------- #
> # Checks for structures. #
> # ----------------------- #
>
> -AC_CHECK_MEMBERS([struct stat.st_blocks])
> -AC_CHECK_MEMBERS([struct stat.st_blksize])
> +AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_blksize])
>
> # ------------------ #
> # Checks for types. #
> @@ -796,18 +772,10 @@ AC_C_BIGENDIAN
> AC_FUNC_ALLOCA
> AC_FUNC_MMAP
> AC_FUNC_VFORK
> -AC_CHECK_FUNCS(canonicalize_file_name realpath)
> -AC_CHECK_FUNCS(getrusage)
> -AC_CHECK_FUNCS(getuid getgid)
> -AC_CHECK_FUNCS(poll)
> -AC_CHECK_FUNCS(pread64)
> -AC_CHECK_FUNCS(sbrk)
> -AC_CHECK_FUNCS(setpgid setpgrp setsid)
> -AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask)
> -AC_CHECK_FUNCS(socketpair)
> -AC_CHECK_FUNCS(syscall)
> -AC_CHECK_FUNCS(ttrace)
> -AC_CHECK_FUNCS(wborder)
> +AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid \
> + getgid poll pread64 sbrk setpgid setpgrp setsid \
> + sigaction sigprocmask sigsetmask socketpair syscall \
> + ttrace wborder])
>
> # Check the return and argument types of ptrace. No canned test for
> # this, so roll our own.
next prev parent reply other threads:[~2008-11-21 19:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-21 16:42 Tom Tromey
2008-11-22 12:16 ` Michael Snyder [this message]
2008-11-22 17:49 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=492708BE.7060107@vmware.com \
--to=msnyder@vmware.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox