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

  1. dnl This is a simple configuration-script for the ncurses test programs that
  2. dnl allows the test-directory to be separately configured against a reference
  3. dnl system (i.e., sysvr4 curses)
  4. dnl
  5. dnl If you're configuring ncurses, you shouldn't need to use this script.
  6. dnl It's only for testing purposes.
  7. dnl
  8. dnl dickey@clark.net (Thomas Dickey)
  9. AC_PREREQ(2.0)
  10. AC_INIT(ncurses.c)
  11.  
  12. AC_PROG_CC
  13.  
  14. CPPFLAGS="$CPPFLAGS -I."
  15. AC_SUBST(CPPFLAGS)
  16.  
  17. LIB_NAME=curses
  18. AC_SUBST(LIB_NAME)
  19.  
  20. dnl SunOS 4.x
  21. AC_ARG_WITH(5lib,
  22.     [  --with-5lib             use SunOS sysv-libraries],
  23.     [LIBS="-L/usr/5lib $LIBS"
  24.      CPPFLAGS="$CPPFLAGS -I/usr/5include"])
  25.  
  26. dnl Ncurses, installed in conventional location
  27. AC_ARG_WITH(ncurses,
  28.     [  --with-ncurses          use ncurses-libraries (installed)],
  29.     [LIB_NAME=ncurses
  30.      for p in $HOME /usr/local /usr
  31.      do
  32.          if test -f $p/include/ncurses/curses.h
  33.         then
  34.             CPPFLAGS="$CPPFLAGS -I$p/include/ncurses"
  35.             test $p != /usr && LIBS="-L$p/lib $LIBS"
  36.             break
  37.         elif test $p != /usr
  38.         then
  39.             if test -f $p/include/curses.h
  40.             then
  41.                 CPPFLAGS="$CPPFLAGS -I$p/include"
  42.                 LIBS="-L$p/lib $LIBS"
  43.                 break
  44.             fi
  45.         fi
  46.      done
  47.     ])
  48.  
  49. dnl If we've not specified a library, assume we're using sysvr4 libraries
  50. dnl installed conventionally (e.g., SunOS 5.x - solaris).
  51.  
  52. dnl Autoconf builds up the $LIBS in reverse order
  53.  
  54. AC_CHECK_LIB($LIB_NAME,initscr)
  55. AC_CHECK_LIB(form,form_driver,,,-lcurses)
  56. AC_CHECK_LIB(menu,menu_driver,,,-lcurses)
  57. AC_CHECK_LIB(panel,new_panel,,,-lcurses)
  58.  
  59. AC_CHECK_HEADERS( \
  60. form.h \
  61. menu.h \
  62. panel.h \
  63. sys/ioctl.h \
  64. termios.h \
  65. )
  66.  
  67. dnl Things that we don't need (or must override) if we're not building ncurses
  68. ECHO_LINK='@ echo linking $@ ... ;'
  69. AC_SUBST(ECHO_LINK)
  70.  
  71. LD_MODEL=""
  72. AC_SUBST(LD_MODEL)
  73.  
  74. LOCAL_LDFLAGS=""
  75. AC_SUBST(LOCAL_LDFLAGS)
  76.  
  77. TEST_DEPS=""
  78. AC_SUBST(TEST_DEPS)
  79.  
  80. LIB_PREFIX="-l"
  81. AC_SUBST(LIB_PREFIX)
  82.  
  83. DFT_DEP_SUFFIX=""
  84. AC_SUBST(DFT_DEP_SUFFIX)
  85.  
  86. rm -f config_h.in
  87. echo '@DEFS@' >config_h.in
  88.  
  89. changequote({,})dnl
  90. AC_OUTPUT(config_h Makefile,{
  91.  
  92. ### Special editing.  We generate config.h directly to allow all filenames
  93. ### to be MSDOS-compatible, as well as to make the list of definitions be
  94. ### dynamically determined by the configuration script -- a consideration when
  95. ### doing type-clean development testing.
  96.  
  97. echo creating config.h
  98. rm -f config.h
  99. echo "/* generated by configure-script
  100.  * On host: $SYS_NAME
  101.  */
  102. #ifndef NC_CONFIG_H
  103. #define NC_CONFIG_H" >config.h
  104. sed    -e '/^ -D/!d' \
  105.     -e 's/ -D/\
  106. #define /g' \
  107.     -e 's/\(#define [A-Za-z_][A-Za-z0-9_]*\)=/\1    /g' \
  108.     -e 's@\\@@g' \
  109.     config_h | sort >>config.h
  110. echo "
  111.     /* The C compiler may not treat these properly, but C++ has to */
  112. #ifdef __cplusplus
  113. #undef const
  114. #undef inline
  115. #endif
  116.  
  117. #endif /* NC_CONFIG_H */" >> config.h
  118. echo removing config_h
  119. rm config_h
  120. },{
  121. ### Special initialization commands, used to pass information from the
  122. ### configuration-run into config.status
  123.  
  124. SYS_NAME="`(uname -a || hostname) 2>/dev/null | sed 1q`"
  125. if test -z "\$SYS_NAME"; then SYS_NAME=unknown;fi
  126. })
  127. changequote([,])dnl
  128.  
  129. rm -f config_h.in
  130.