Home | History | Annotate | Download | only in elfutils
      1 dnl Process this file with autoconf to produce a configure script. -*-m4-*-
      2 dnl Configure input file for elfutils.
      3 dnl
      4 dnl Copyright (C) 1996-2002, 2003, 2004 Red Hat, Inc.
      5 dnl
      6 dnl This program is free software; you can redistribute it and/or modify
      7 dnl it under the terms of the GNU General Public License as published by
      8 dnl the Free Software Foundation, version 2.
      9 dnl
     10 dnl This program is distributed in the hope that it will be useful,
     11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 dnl GNU General Public License for more details.
     14 dnl
     15 dnl You should have received a copy of the GNU General Public License
     16 dnl along with this program; if not, write to the Free Software Foundation,
     17 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     18 dnl
     19 AC_INIT([Red Hat elfutils],[0.97],[http://bugzilla.redhat.com/bugzilla/],
     20 	[elfutils])
     21 
     22 AC_CONFIG_AUX_DIR([config])
     23 AC_CONFIG_FILES([config/Makefile])
     24 
     25 AC_COPYRIGHT([Copyright (C) 1996-2003, 2004 Red Hat, Inc.])
     26 AC_REVISION($Revision: 1.30 $)
     27 AC_PREREQ(2.59)			dnl Minimum Autoconf version required.
     28 
     29 AM_INIT_AUTOMAKE([gnits 1.7 dist-bzip2])
     30 
     31 AC_CONFIG_SRCDIR([libelf/libelf.h])
     32 AC_CONFIG_FILES([Makefile])
     33 AC_CONFIG_HEADERS([config.h])
     34 
     35 AC_CONFIG_MACRO_DIR([m4])
     36 AC_CONFIG_FILES([m4/Makefile])
     37 
     38 dnl The RPM spec file.  We substitute a few values in the file.
     39 AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in])
     40 
     41 
     42 AC_CANONICAL_HOST
     43 
     44 AC_ARG_ENABLE([tls],
     45 AS_HELP_STRING([--enable-tls], [enable use of thread local storage]),
     46 AC_DEFINE(USE_TLS))
     47 AH_TEMPLATE([USE_TLS], [Defined if thread local storage should be used.])
     48 
     49 dnl Add all the languages for which translations are available.
     50 ALL_LINGUAS=
     51 
     52 AC_PROG_CC
     53 AC_PROG_CPP
     54 AC_PROG_GCC_TRADITIONAL
     55 AM_GNU_GETTEXT([external])
     56 AC_PROG_RANLIB
     57 AC_PROG_YACC
     58 AM_PROG_LEX
     59 
     60 AC_CACHE_CHECK([for gcc with C99 support], ac_cv_c99, [dnl
     61 old_CFLAGS="$CFLAGS"
     62 CFLAGS="$CFLAGS -std=gnu99"
     63 AC_COMPILE_IFELSE([dnl
     64 int foo (int a) { for (int i = 0; i < a; ++i) if (i % 4) break; int s = a; }],
     65 		  ac_cv_c99=yes, ac_cv_c99=no)
     66 CFLAGS="$old_CFLAGS"])
     67 AS_IF([test "x$ac_cv_c99" != xyes],
     68       AC_MSG_ERROR([gcc with C99 support required]))
     69 
     70 LOCALEDIR=$datadir
     71 AC_SUBST(LOCALEDIR)
     72 AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
     73 AH_TEMPLATE([LOCALEDIR], [Directory to place translation files in.])
     74 
     75 DATADIRNAME=$datadir
     76 AC_SUBST(DATADIRNAME)
     77 
     78 dnl This test must come as early as possible after the compiler configuration
     79 dnl tests, because the choice of the file model can (in principle) affect
     80 dnl whether functions and headers are available, whether they work, etc.
     81 AC_SYS_LARGEFILE
     82 
     83 dnl Enable the linker to be build as a native-only linker.  By default it
     84 dnl can handle all architectures but this comes at a cost.  A native
     85 dnl will be slightly faster, small, and has fewer dependencies.
     86 native_ld=no
     87 AC_ARG_ENABLE([generic],
     88 AS_HELP_STRING([--disable-generic], [do not build generic linker]), [dnl
     89 if test "$enable_generic" = no; then
     90   case "$host_cpu" in
     91    i?86)
     92     AC_DEFINE(NATIVE_ELF, 32)
     93     native_ld=yes
     94     base_cpu=i386
     95     ;;
     96    *)
     97     AC_MSG_ERROR([no machine-specific linker for this configuration available])
     98     ;;
     99   esac
    100 fi])
    101 AH_TEMPLATE([NATIVE_ELF],
    102 [Define to 32 or 64 if a specific implementation is wanted.])
    103 AM_CONDITIONAL(NATIVE_LD, test "$native_ld" = yes)
    104 dnl The automake generated Makefile cannot deal with macros in the name
    105 dnl of files if at any time there is no such file, even if the filename
    106 dnl would not be used.
    107 AS_IF([test -z "$base_cpu"], [base_cpu=none])
    108 AC_SUBST(base_cpu)
    109 
    110 dnl Enable debugging via mudflap.  This option will cause most libraries
    111 dnl to be built as archives which are statically linked into the applications.
    112 dnl All code, as far as possible, is compiled instrumented to catch all
    113 dnl the bugs valgrind is able to catch.
    114 use_mudflap=no
    115 AC_ARG_ENABLE([mudflap],
    116 AS_HELP_STRING([--enable-mudflap],
    117 [build binaries with mudflap instrumentation]), [dnl
    118 if test "x$enable_mudflap" = xyes; then
    119   # Check whether the compiler support -fmudflap.
    120   old_CFLAGS="$CFLAGS"
    121   CFLAGS="$CFLAGS -fmudflap"
    122   AC_TRY_COMPILE([], [], use_mudflap=yes, use_mudflap=fail)
    123   CFLAGS="$old_CFLAGS"
    124 fi])
    125 if test "$use_mudflap" = fail; then
    126   AC_MSG_FAILURE([--enable-mudflap requires a compiler which understands this option])
    127 fi
    128 AM_CONDITIONAL(MUDFLAP, test "$use_mudflap" = yes)
    129 
    130 
    131 dnl The directories with content.
    132 
    133 dnl Documentation.
    134 AC_CONFIG_FILES([doc/Makefile])
    135 
    136 dnl Support library.
    137 AC_CONFIG_FILES([lib/Makefile])
    138 
    139 dnl ELF library.
    140 AC_CONFIG_FILES([libelf/Makefile libelf-po/Makefile.in])
    141 
    142 dnl Higher-level ELF support library.
    143 AC_CONFIG_FILES([libebl/Makefile])
    144 
    145 dnl DWARF library.
    146 AC_CONFIG_FILES([libdw/Makefile])
    147 
    148 dnl CPU handling library.
    149 AC_CONFIG_FILES([libcpu/Makefile])
    150 
    151 dnl Assembler library.
    152 AC_CONFIG_FILES([libasm/Makefile])
    153 
    154 dnl Tools.
    155 AC_CONFIG_FILES([src/Makefile po/Makefile.in])
    156 
    157 dnl Test suite.
    158 AC_CONFIG_FILES([tests/Makefile])
    159 
    160 
    161 dnl Test of the config.h file.  We hide all kinds of configuration magic
    162 dnl in there.
    163 AH_BOTTOM([
    164 /* Eventually we will allow multi-threaded applications to use the
    165    libraries.  Therefore we will add the necessary locking although
    166    the macros used expand to nothing for now.  */
    167 #define lock_lock(lock) ((void) (lock))
    168 #define rwlock_define(class,name) class int name
    169 #define rwlock_init(lock) ((void) (lock))
    170 #define rwlock_fini(lock) ((void) (lock))
    171 #define rwlock_rdlock(lock) ((void) (lock))
    172 #define rwlock_wrlock(lock) ((void) (lock))
    173 #define rwlock_unlock(lock) ((void) (lock))
    174 #define tls_key_t void *
    175 #define key_create(keyp, freefct) (1)
    176 #define getspecific(key) key
    177 #define setspecific(key,val) key = val
    178 #define once_define(class,name) class int name
    179 #define once_execute(name,fct) \
    180   do {									      \
    181     if (name == 0)							      \
    182       fct ();								      \
    183     name = 1;								      \
    184   } while (0)
    185 
    186 /* gettext helper macro.  */
    187 #define N_(Str) Str
    188 
    189 /* Compiler-specific definitions.  */
    190 #define strong_alias(name, aliasname) \
    191   extern __typeof (name) aliasname __attribute__ ((alias (#name)));
    192 
    193 #ifdef __i386__
    194 # define internal_function_def __attribute__ ((regparm (3), stdcall))
    195 #else
    196 # define internal_function_def /* nothing */
    197 #endif
    198 
    199 # define internal_function \
    200   internal_function_def __attribute__ ((visibility ("internal")))
    201 # define internal_strong_alias(name, aliasname) \
    202   extern __typeof (name) aliasname __attribute__ ((alias (#name), visibility ("internal"))) internal_function_def;
    203 
    204 #define attribute_hidden \
    205   __attribute__ ((visibility ("hidden")))
    206 
    207 /* Define ALLOW_UNALIGNED if the architecture allows operations on
    208    unaligned memory locations.  */
    209 #if defined __i386__ || defined __alpha__ || defined __x86_64__ || defined __ia64__
    210 # define ALLOW_UNALIGNED	1
    211 #else
    212 # define ALLOW_UNALIGNED	0
    213 #endif
    214 
    215 #define unlikely(expr) __builtin_expect (expr, 0)
    216 #define likely(expr) __builtin_expect (expr, 1)
    217 
    218 #define obstack_calloc(ob, size) \
    219   ({ size_t _s = (size); memset (obstack_alloc (ob, _s), '\0', _s); })
    220 #define obstack_strdup(ob, str) \
    221   ({ const char *_s = (str); obstack_copy0 (ob, _s, strlen (_s)); })
    222 #define obstack_strndup(ob, str, n) \
    223   ({ const char *_s = (str); obstack_copy0 (ob, _s, strnlen (_s, n)); })
    224 
    225 #if __STDC_VERSION__ >= 199901L
    226 # define flexarr_size /* empty */
    227 #else
    228 # define flexarr_size 0
    229 #endif
    230 
    231 /* Calling conventions.  */
    232 #ifdef __i386__
    233 # define CALLING_CONVENTION regparm (3), stdcall
    234 # define AND_CALLING_CONVENTION , regparm (3), stdcall
    235 #else
    236 # define CALLING_CONVENTION
    237 # define AND_CALLING_CONVENTION
    238 #endif
    239 
    240 /* Avoid PLT entries.  */
    241 #ifdef PIC
    242 # define INTUSE(name) _INTUSE(name)
    243 # define _INTUSE(name) __##name##_internal
    244 # define INTDEF(name) _INTDEF(name)
    245 # define _INTDEF(name) \
    246   extern __typeof__ (name) __##name##_internal __attribute__ ((alias (#name)));
    247 #else
    248 # define INTUSE(name) name
    249 # define INTDEF(name) /* empty */
    250 #endif
    251 ])
    252 
    253 AC_OUTPUT
    254