From e0bf1022ddc4d5697106c67a0a6f4088fb6531aa Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor <ian@airs.com> Date: Mon, 5 Feb 1996 21:17:52 +0000 Subject: 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, SHLINK. * configure: Rebuild. * 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) rather than $(TARGETLIB). (stamp-piclist, piclist): New targets. ($(SHLIB), $(SHLINK)): New targets. ($(OFILES)): Depend upon stamp-picdir. (disassemble.o): Build twice if PICFLAG is set. (MOSTLYCLEAN): Add pic/*.o. (clean): Remove $(SHLIB), $(SHLINK), piclist, and stamp-piclist. (distclean): Remove pic and stamp-picdir. (install): Install shared libraries. (stamp-picdir): New target. --- opcodes/configure | 85 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 77 insertions(+), 8 deletions(-) (limited to 'opcodes/configure') diff --git a/opcodes/configure b/opcodes/configure index b73a75c..f3bea80 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.6 +# Generated automatically using autoconf version 2.7 # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -13,6 +13,10 @@ ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --enable-targets alternative target configurations" +ac_help="$ac_help + --enable-shared build shared opcodes library" +ac_help="$ac_help + --enable-commonbfdlib build shared BFD/opcodes/libiberty library" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -332,7 +336,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.6" + echo "configure generated by autoconf version 2.7" exit 0 ;; -with-* | --with-*) @@ -545,6 +549,24 @@ if test "${enable_targets+set}" = set; then *) enable_targets=$enableval ;; esac fi +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + case "${enableval}" in + yes) shared=true ;; + no) shared=false ;; + *) { echo "configure: error: bad value ${enableval} for opcodes shared option" 1>&2; exit 1; } ;; +esac +fi +# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +if test "${enable_commonbfdlib+set}" = set; then + enableval="$enable_commonbfdlib" + case "${enableval}" in + yes) commonbfdlib=true ;; + no) commonbfdlib=false ;; + *) { echo "configure: error: bad value ${enableval} for opcodes commonbfdlib option" 1>&2; exit 1; } ;; +esac +fi @@ -659,6 +681,22 @@ fi # host-specific stuff: +ALLIBS='$(TARGETLIB)' +PICFLAG= +SHLIB= +SHLINK= +if test "${shared}" = "true"; then + ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)' + PICFLAG=-fpic + if test "${commonbfdlib}" = "true"; then + SHLIB=../bfd/libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION` + SHLINK=../bfd/libbfd.so + else + SHLIB=libopcodes.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION` + SHLINK=libopcodes.so + fi +fi + . ${srcdir}/../bfd/configure.host # Extract the first word of "gcc", so it can be a program name with args. @@ -854,6 +892,28 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +if test "${shared}" = "true"; then + if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then + echo "configure: warning: opcodes --enable-shared only supported when using gcc" 1>&2 + shared=false + PICFLAG= + SHLIB= + fi +fi + + + + + + +if test "${commonbfdlib}" = "true"; then + COMMON_SHLIB=yes +else + COMMON_SHLIB= +fi + + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then @@ -869,7 +929,7 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 873 "configure" +#line 933 "configure" #include "confdefs.h" #include <assert.h> Syntax Error @@ -883,7 +943,7 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 887 "configure" +#line 947 "configure" #include "confdefs.h" #include <assert.h> Syntax Error @@ -916,7 +976,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 920 "configure" +#line 980 "configure" #include "confdefs.h" #include <$ac_hdr> EOF @@ -1129,7 +1189,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.6" + echo "$CONFIG_STATUS generated by autoconf version 2.7" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1141,10 +1201,12 @@ ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF # Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@CFLAGS@%$CFLAGS%g @@ -1189,6 +1251,13 @@ s%@AR@%$AR%g s%@RANLIB@%$RANLIB%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@ALLLIBS@%$ALLLIBS%g +s%@PICFLAG@%$PICFLAG%g +s%@SHLIB@%$SHLIB%g +s%@SHLIB_CC@%$SHLIB_CC%g +s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g +s%@COMMON_SHLIB@%$COMMON_SHLIB%g +s%@SHLINK@%$SHLINK%g s%@CPP@%$CPP%g s%@archdefs@%$archdefs%g s%@BFD_MACHINES@%$BFD_MACHINES%g -- cgit v1.1