From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22442 invoked by alias); 21 Nov 2008 00:46:27 -0000 Received: (qmail 22301 invoked by uid 22791); 21 Nov 2008 00:46:26 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Nov 2008 00:45:35 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mAL0jXC8025657 for ; Thu, 20 Nov 2008 19:45:33 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mAL0jWAs027324; Thu, 20 Nov 2008 19:45:32 -0500 Received: from opsy.redhat.com (vpn-13-160.rdu.redhat.com [10.11.13.160]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mAL0jVxJ008509; Thu, 20 Nov 2008 19:45:31 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id CF0F93787AB; Thu, 20 Nov 2008 17:45:30 -0700 (MST) To: gdb-patches@sourceware.org Subject: RFA: shrink configure script From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Fri, 21 Nov 2008 16:42:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00571.txt.bz2 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? Tom 2008-11-20 Tom Tromey * 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 @@ -697,38 +705,16 @@ AC_CHECK_HEADERS(link.h, [], [], # include #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 #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 #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 and 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 #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.