home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / binutils-2.7-src.tgz / tar.out / fsf / binutils / gprof / configure.in < prev    next >
Text File  |  1996-09-28  |  3KB  |  118 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.5)dnl
  3. AC_INIT(gprof.c)
  4.  
  5. AC_ARG_ENABLE(shared,
  6. [  --enable-shared         build shared BFD library],
  7. [case "${enableval}" in
  8.   yes) shared=true ;;
  9.   no)  shared=false ;;
  10.   *bfd*) shared=true ;;
  11.   *) shared=false ;;
  12. esac])dnl
  13.  
  14. AC_PROG_CC
  15. AC_PROG_INSTALL
  16.  
  17. AC_ISC_POSIX
  18.  
  19. AC_CANONICAL_SYSTEM
  20. AC_ARG_PROGRAM
  21.  
  22. case "${target}" in
  23. alpha-*-*)    MY_TARGET=alpha ;;
  24. changequote(,)dnl
  25. i[345]86-*-*)    MY_TARGET=i386 ;;
  26. changequote([,])dnl
  27. sparc-*-*)    MY_TARGET=sparc ;;
  28. tahoe-*-*)    MY_TARGET=tahoe ;;
  29. vax-*-*)    MY_TARGET=vax ;;
  30. ns32k-*-*)    MY_TARGET=ns532;;
  31. *-*-*)        MY_TARGET=dummy ;;
  32. esac
  33.  
  34. AC_SUBST(MY_TARGET)
  35.  
  36. BFDLIB='-L../bfd -lbfd'
  37.  
  38. # We need to handle some special cases if BFD was built shared.
  39. case "${host}" in
  40.   *-*-sunos*)
  41.   # On SunOS, we must link against the name we are going to install,
  42.   # not -lbfd, since SunOS does not support SONAME.
  43.   if test "${shared}" = "true"; then
  44.     BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
  45.   fi
  46.   ;;
  47. alpha*-*-osf*)
  48.   # On Alpha OSF/1, the native linker searches all the -L
  49.   # directories for any LIB.so files, and only then searches for any
  50.   # LIB.a files.  That means that if there is an installed
  51.   # libbfd.so, but this build is not done with --enable-shared, the
  52.   # link will wind up being against the install libbfd.so rather
  53.   # than the newly built libbfd.  To avoid this, we must explicitly
  54.   # link against libbfd.a when --enable-shared is not used.
  55.   if test "${shared}" != "true"; then
  56.     BFDLIB='../bfd/libbfd.a'
  57.   fi
  58.   ;;
  59. esac
  60. AC_SUBST(BFDLIB)
  61.  
  62. HLDFLAGS=
  63. # If we have shared libraries, try to set rpath reasonably.
  64. if test "${shared}" = "true"; then
  65.   case "${host}" in
  66.   *-*-hpux*)
  67.     HLDFLAGS='-Wl,+s,+b,$(libdir)'
  68.     ;;
  69.   *-*-irix5*)
  70.     HLDFLAGS='-Wl,-rpath,$(libdir)'
  71.     ;;
  72.   *-*-linux*aout*)
  73.     ;;
  74.   *-*-linux*)
  75.     HLDFLAGS='-Wl,-rpath,$(libdir)'
  76.     ;;
  77.   *-*-sysv4* | *-*-solaris*)
  78.     HLDFLAGS='-R $(libdir)'
  79.     ;;
  80.   esac
  81. fi
  82.  
  83. ### begin-ADE-local
  84. # Check for additional host specific CFLAGS.
  85. AC_MSG_CHECKING(for host dependent CFLAGS)
  86. other_host_cflags=""
  87. case "${host}" in
  88.     m68*-*-amigaos*)    other_host_cflags="-mstackextend" ;;
  89. esac
  90. test -n "$other_host_cflags" && CFLAGS="$CFLAGS $other_host_cflags"
  91. AC_MSG_RESULT($other_host_cflags)
  92. ### end-ADE-local
  93.  
  94. # On SunOS, if the linker supports the -rpath option, use it to
  95. # prevent ../bfd and ../opcodes from being included in the run time
  96. # search path.
  97. case "${host}" in
  98.   *-*-sunos*)
  99.     echo 'main () { }' > conftest.c
  100.     ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
  101.     if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
  102.       :
  103.     elif grep 'No such file' conftest.t >/dev/null 2>&1; then
  104.       :
  105.     elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
  106.       :
  107.     elif test "${shared}" = "true"; then
  108.       HLDFLAGS='-Wl,-rpath=$(libdir)'
  109.     else
  110.       HLDFLAGS='-Wl,-rpath='
  111.     fi
  112.     rm -f conftest.t conftest.c conftest
  113.     ;;
  114. esac
  115. AC_SUBST(HLDFLAGS)
  116.  
  117. AC_OUTPUT(Makefile)
  118.