diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-02-05 21:14:14 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-02-05 21:14:14 +0000 |
commit | 44f795f7feef198729a978ff84c4c2dc9efbc1b3 (patch) | |
tree | 3a602f4dcd09c9cb6352484478e64d4daa4ec844 /bfd/configure.in | |
parent | fc71ad23ddd09cfc590e487eb3be266a11837465 (diff) | |
download | gdb-44f795f7feef198729a978ff84c4c2dc9efbc1b3.zip gdb-44f795f7feef198729a978ff84c4c2dc9efbc1b3.tar.gz gdb-44f795f7feef198729a978ff84c4c2dc9efbc1b3.tar.bz2 |
Support for building as a shared library, based on patches from
Alan Modra <alan@spri.levels.unisa.edu.au>:
* configure.in: Add AC_ARG_ENABLE for shared and commonbfdlib.
New substitutions: ALLLIBS, PICFLAG, SHLIB, SHLIB_CC,
SHLIB_CFLAGS, COMMON_SHLIB, PICLIST, SHLINK.
* configure: Rebuild.
* configure.host: If --enable-shared, adjust shared library stuff
based on the host. If the host is SunOS, and the linker supports
-rpath, set HLDFLAGS to use it.
* Makefile.in (ALLLIBS): New variable.
(PICFLAG, SHLIB, SHLIB_CC, SHLIB_CFLAGS): New variables.
(COMMON_SHLIB, SHLINK): New variables.
(.c.o): If PICFLAG is set, compile twice, once PIC, once normal.
(STAGESTUFF): Remove variable.
(all): Depend upon $(ALLLIBS) and @PICLIST@ rather than
$(TARGETLIB).
(stamp-ofiles): New target, like old ofiles target, but build
using a temporary file and move-if-change, and touch stamp-ofiles
when done.
(ofiles): Just depend upon stamp-ofiles.
(stamp-piclist, piclist): New targets.
($(SHLIB), $(SHLINK)): New targets.
(targets.o, archures.o): Build twice if PICFLAG is set.
(do_mostlyclean): Remove pic/*.o.
(do_clean): Remove stamp-ofiles, $(SHLIB), $(SHLINK), piclist, and
stamp-piclist.
(do_distclean): Remove pic and stamp-picdir.
(install): Install shared libraries.
($(OFILES)): Depend upon stamp-picdir.
(stamp-picdir): New target.
Diffstat (limited to 'bfd/configure.in')
-rw-r--r-- | bfd/configure.in | 109 |
1 files changed, 75 insertions, 34 deletions
diff --git a/bfd/configure.in b/bfd/configure.in index 8b18868..f18017b 100644 --- a/bfd/configure.in +++ b/bfd/configure.in @@ -18,6 +18,27 @@ AC_ARG_ENABLE(targets, no) enable_targets= ;; *) enable_targets=$enableval ;; esac])dnl +AC_ARG_ENABLE(shared, +[ --enable-shared build shared BFD library], +[case "${enableval}" in + yes) shared=true ;; + no) shared=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for BFD shared option]) ;; +esac])dnl +AC_ARG_ENABLE(commonbfdlib, +[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], +[case "${enableval}" in + yes) commonbfdlib=true ;; + no) commonbfdlib=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;; +esac])dnl +AC_ARG_WITH(mmap, +[ --with-mmap try using mmap for BFD input files if available], +[case "${withval}" in + yes) want_mmap=true ;; + no) want_mmap=false ;; + *) AC_MSG_ERROR(bad value ${withval} for BFD with-mmap option) ;; +esac],[want_mmap=false])dnl AC_CONFIG_HEADER(config.h:config.in) @@ -33,6 +54,23 @@ target64=false # host stuff: +ALLLIBS='$(TARGETLIB)' +PICFLAG= +SHLIB= +SHLINK= +if test "${shared}" = "true"; then + PICFLAG=-fpic + if test "${commonbfdlib}" = "true"; then + ALLLIBS='$(TARGETLIB)' + else + ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)' +changequote(,)dnl + SHLIB=libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/VERSION` +changequote([,])dnl + SHLINK=libbfd.so + fi +fi + # Permit host specific settings. . ${srcdir}/configure.host @@ -43,6 +81,31 @@ AC_CHECK_PROG(AR, ar, ar, :) AC_PROG_RANLIB AC_PROG_INSTALL +if test "${shared}" = "true"; then + if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then + AC_MSG_WARN([BFD --enable-shared only supported when using gcc]) + shared=false + PICFLAG= + SHLIB= + fi +fi + +AC_SUBST(ALLLIBS) +AC_SUBST(PICFLAG) +AC_SUBST(SHLIB) +AC_SUBST(SHLIB_CC) +AC_SUBST(SHLIB_CFLAGS) +if test "${commonbfdlib}" = "true"; then + COMMON_SHLIB=yes + PICLIST=piclist +else + COMMON_SHLIB= + PICLIST= +fi +AC_SUBST(COMMON_SHLIB) +AC_SUBST(PICLIST) +AC_SUBST(SHLINK) + HOST_64BIT_LONG=0 if test "x${HOST_64BIT_TYPE}" = "xlong"; then HOST_64BIT_LONG=1 @@ -57,39 +120,8 @@ AC_CHECK_FUNCS(fcntl getpagesize) BFD_BINARY_FOPEN -AC_MSG_CHECKING([whether malloc must be declared]) -AC_CACHE_VAL(bfd_cv_decl_needed_malloc, -[AC_TRY_COMPILE([ -#include <stdio.h> -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif], -[char *(*pfn) = (char *(*)) malloc], -bfd_cv_decl_needed_malloc=no, bfd_cv_decl_needed_malloc=yes)]) -AC_MSG_RESULT($bfd_cv_decl_needed_malloc) -if test $bfd_cv_decl_needed_malloc = yes; then - AC_DEFINE(NEED_DECLARATION_MALLOC) -fi - -AC_MSG_CHECKING([whether free must be declared]) -AC_CACHE_VAL(bfd_cv_decl_needed_free, -[AC_TRY_COMPILE([ -#include <stdio.h> -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif], -[int (*pfn) = (int (*)) free], -bfd_cv_decl_needed_free=no, bfd_cv_decl_needed_free=yes)]) -AC_MSG_RESULT($bfd_cv_decl_needed_free) -if test $bfd_cv_decl_needed_free = yes; then - AC_DEFINE(NEED_DECLARATION_FREE) -fi +BFD_NEED_DECLARATION(malloc) +BFD_NEED_DECLARATION(free) # If we are configured native, pick a core file support file. COREFILE= @@ -215,6 +247,10 @@ changequote([,])dnl COREFILE=trad-core.o AC_DEFINE(TRAD_HEADER,"hosts/m68knbsd.h") ;; + m68*-apple-aux*) + COREFILE=trad-core.o + AC_DEFINE(TRAD_HEADER,"hosts/m68kaux.h") + ;; m88*-*-sysv4*) ;; m88*-motorola-sysv*) COREFILE=ptrace-core.o ;; m88*-*-mach3*) @@ -411,8 +447,9 @@ do hp300hpux_vec) tb="$tb hp300hpux.o aout32.o stab-syms.o" ;; i386aout_vec) tb="$tb i386aout.o aout32.o stab-syms.o" ;; i386bsd_vec) tb="$tb i386bsd.o aout32.o stab-syms.o" ;; - i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;; i386coff_vec) tb="$tb coff-i386.o cofflink.o" ;; + i386dynix_vec) tb="$tb i386dynix.o aout32.o stab-syms.o" ;; + i386freebsd_vec) tb="$tb i386freebsd.o aout32.o stab-syms.o" ;; i386msdos_vec) tb="$tb i386msdos.o" ;; i386pe_vec) tb="$tb pe-i386.o cofflink.o " ;; i386pei_vec) tb="$tb pei-i386.o cofflink.o" ;; @@ -432,6 +469,7 @@ do m68klynx_coff_vec) tb="$tb cf-m68klynx.o coff-m68k.o cofflink.o lynx-core.o stab-syms.o" ;; m68knetbsd_vec) tb="$tb m68knetbsd.o aout32.o stab-syms.o" ;; m68k4knetbsd_vec) tb="$tb m68k4knetbsd.o aout32.o stab-syms.o" ;; + m68kaux_coff_vec) tb="$tb coff-aux.o coff-m68k.o cofflink.o" ;; m88kbcs_vec) tb="$tb coff-m88k.o" ;; newsos3_vec) tb="$tb newsos3.o aout32.o stab-syms.o" ;; nlm32_i386_vec) tb="$tb nlm32-i386.o nlm32.o nlm.o" ;; @@ -535,6 +573,9 @@ AC_SUBST(tdefaults) dnl AC_CHECK_HEADERS(sys/mman.h) AC_FUNC_MMAP AC_CHECK_FUNCS(madvise mprotect) +case ${want_mmap}+${ac_cv_func_mmap} in + true+yes ) AC_DEFINE(USE_MMAP) ;; +esac rm -f doc/config.status AC_OUTPUT(Makefile doc/Makefile, |