configure.ac 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. dnl Copyright (C) 1996-2015 Free Software Foundation, Inc.
  2. dnl
  3. dnl This program is free software; you can redistribute it and/or modify
  4. dnl it under the terms of the GNU General Public License as published by
  5. dnl the Free Software Foundation; either version 3 of the License, or
  6. dnl (at your option) any later version.
  7. dnl
  8. dnl This program is distributed in the hope that it will be useful,
  9. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. dnl GNU General Public License for more details.
  12. dnl
  13. dnl You should have received a copy of the GNU General Public License
  14. dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. dnl Process this file with autoconf to produce a configure script.
  16. AC_PREREQ(2.64)dnl
  17. AC_INIT(Makefile.in)
  18. sinclude(../common/acinclude.m4)
  19. SIM_AC_COMMON
  20. # In the Cygwin environment, we need some additional flags.
  21. AC_CACHE_CHECK([for cygwin], sim_cv_os_cygwin,
  22. [AC_EGREP_CPP(lose, [
  23. #ifdef __CYGWIN__
  24. lose
  25. #endif],[sim_cv_os_cygwin=yes],[sim_cv_os_cygwin=no])])
  26. if test x$sim_cv_os_cygwin = xyes; then
  27. TERMCAP='`if test -r ../../libtermcap/libtermcap.a; then echo ../../libtermcap/libtermcap.a; else echo -ltermcap; fi` -luser32'
  28. else
  29. # Keep in sync with gdb's configure.ac list.
  30. AC_SEARCH_LIBS(tgetent, [termcap tinfo curses ncurses],
  31. [TERMCAP=$ac_cv_search_tgetent], [TERMCAP=""])
  32. fi
  33. AC_SUBST(TERMCAP)
  34. # We prefer the in-tree readline. Top-level dependencies make sure
  35. # src/readline (if it's there) is configured before src/sim.
  36. if test -r ../../readline/Makefile; then
  37. READLINE=../../readline/libreadline.a
  38. else
  39. AC_CHECK_LIB(readline, readline, READLINE=-lreadline,
  40. AC_ERROR([the required "readline" library is missing]), $TERMCAP)
  41. fi
  42. AC_SUBST(READLINE)
  43. SIM_AC_OPTION_HOSTENDIAN
  44. SIM_AC_OUTPUT