home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / the25.zip / thesrc251.zip / configure.in < prev    next >
Text File  |  1998-05-07  |  6KB  |  255 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(./the.c)
  3.  
  4. dnl ---------------------- check for C compiler -----------------
  5. dnl Checks for one of the C compilers below - change if yours not there.
  6. CC_LIST="c89 acc gcc cc"
  7. MH_PROG_CC
  8.  
  9. AC_CONFIG_HEADER(config.h)
  10. AC_ISC_POSIX
  11.  
  12. dnl Checks for system first
  13. AC_CANONICAL_SYSTEM
  14. AC_PROG_GCC_TRADITIONAL
  15.  
  16.  
  17. case "$target" in
  18.     *hp-hpux*) 
  19.         SYS_DEFS="-D_HPUX_SOURCE"
  20.         ;;
  21.     *ibm-aix*)
  22.         SYS_DEFS="-D_ALL_SOURCE"
  23.         ;;
  24.     *dec-osf4*)
  25.         AC_DEFINE(HAVE_BROKEN_SYS_ACL_H)
  26.         ;;
  27.     *dec-osf*)
  28.         ;;
  29.     *sequent-dynix*)
  30.         ;;
  31.     *solaris*)
  32.         ;;
  33.     sparc*sunos*)
  34.         ;;
  35.     *linux*)
  36.         ;;
  37. esac
  38. AC_SUBST(SYS_DEFS)
  39.  
  40. dnl ---------------------- check for Curses argument -----------------
  41. dnl allow --with-xcurses to link with XCurses
  42. AC_ARG_WITH(xcurses,
  43.     [  --with-xcurses          link with XCurses],
  44.     [with_xcurses=$withval],
  45.     [with_xcurses=no],
  46. )
  47. dnl allow --with-ncurses to link with ncurses
  48. AC_ARG_WITH(ncurses,
  49.     [  --with-ncurses          link with ncurses],
  50.     [with_ncurses=$withval],
  51.     [with_ncurses=no],
  52. )
  53. dnl allow --with-extcurses to link with AIX Extended curses
  54. AC_ARG_WITH(extcurses,
  55.     [  --with-extcurses        link with AIX Extended curses],
  56.     [with_extcurses=$withval],
  57.     [with_extcurses=no],
  58. )
  59. dnl allow --with-cursesincdir to specify where Curses header file is
  60. AC_ARG_WITH(cursesincdir,
  61.     [  --with-cursesincdir=DIR specify where curses header file is],
  62.     [with_cursesincdir=$withval],
  63.     [with_cursesincdir=no],
  64. )
  65. dnl allow --with-curseslibdir to specify where Curses library file is
  66. AC_ARG_WITH(curseslibdir,
  67.     [  --with-curseslibdir=DIR specify where curses library file is],
  68.     [with_curseslibdir=$withval],
  69.     [with_curseslibdir=no],
  70. )
  71.  
  72. dnl ---------------------- check for REXX argument -----------------
  73. dnl allow --with-regina to link with Regina
  74. AC_ARG_WITH(regina,
  75.     [  --with-regina           link with Regina],
  76.     [with_regina=$withval],
  77.     [with_regina=no],
  78. )
  79. dnl allow --with-rexximc to link with REXX/imc
  80. AC_ARG_WITH(rexximc,
  81.     [  --with-rexximc          link with REXX/imc],
  82.     [with_rexximc=$withval],
  83.     [with_rexximc=no],
  84. )
  85. dnl allow --with-rexx6000 to link with AIX REXX/6000
  86. AC_ARG_WITH(rexx6000,
  87.     [  --with-rexx6000         link with AIX REXX/6000],
  88.     [with_rexx6000=$withval],
  89.     [with_rexx6000=no],
  90. )
  91. dnl allow --with-orexx to link with IBM Object Rexx
  92. AC_ARG_WITH(orexx,
  93.     [  --with-orexx            link with IBM Object Rexx],
  94.     [with_orexx=$withval],
  95.     [with_orexx=no],
  96. )
  97. dnl allow --with-unirexx to link with uni-REXX
  98. AC_ARG_WITH(unirexx,
  99.     [  --with-unirexx          link with uni-REXX],
  100.     [with_unirexx=$withval],
  101.     [with_unirexx=no],
  102. )
  103. dnl allow --with-rexxincdir to specify where REXX header file is
  104. AC_ARG_WITH(rexxincdir,
  105.     [  --with-rexxincdir=DIR   specify where REXX header file is],
  106.     [with_rexxincdir=$withval],
  107.     [with_rexxincdir=no],
  108. )
  109. dnl allow --with-rexxlibdir to specify where REXX library file is
  110. AC_ARG_WITH(rexxlibdir,
  111.     [  --with-rexxlibdir=DIR   specify where REXX library file is],
  112.     [with_rexxlibdir=$withval],
  113.     [with_rexxlibdir=no],
  114. )
  115.  
  116. dnl ---------------------- check packages -----------------------
  117. dnl Check for X libraries if using XCurses
  118. dnl
  119. MH_XLIBS=""
  120. MH_XINC_DIR=""
  121. if test "$with_xcurses" = yes; then
  122.     MH_CHECK_X_LIB
  123. fi
  124.  
  125. MH_CHECK_CURSES
  126. MH_CHECK_REXX
  127.  
  128. dnl --------------------- Check for other programs. ---------------
  129. AC_PROG_LN_S
  130. AC_PROG_MAKE_SET
  131.  
  132. MH_CHECK_LIB(dld m dl s)
  133. if test "$with_regina" = yes; then
  134.     MH_CHECK_LEX(fl l)
  135.     MH_EXTRA_LIBS="${MH_EXTRA_LIBS} ${MHLEXLIB}"
  136. fi
  137. AC_SUBST(MH_EXTRA_LIBS)
  138.  
  139. dnl -------------------- Checks for header files. -----------------
  140. AC_HEADER_STDC
  141. AC_CHECK_HEADERS( \
  142.     ctype.h \
  143.     sys/types.h \
  144.     sys/mode.h \
  145.     sys/stat.h \
  146.     sys/file.h \
  147.     sys/wait.h \
  148.     sys/acl.h \
  149.     unistd.h \
  150.     stdlib.h \
  151.     memory.h \
  152.     fcntl.h \
  153.     string.h \
  154.     stdarg.h \
  155.     stat.h \
  156.     dirent.h \
  157.     time.h \
  158.     linux/stat.h \
  159.     )
  160.  
  161. MH_HAVE_PROTO
  162.  
  163. dnl Checks for typedefs, structures, and compiler characteristics.
  164. AC_C_CONST
  165. AC_TYPE_SIZE_T
  166. AC_HEADER_TIME
  167. AC_STRUCT_TM
  168.  
  169. dnl Checks for library functions.
  170. AC_FUNC_MEMCMP
  171. AC_TYPE_SIGNAL
  172. MH_FUNC_ACL_GET
  173. AC_CHECK_FUNCS(rename getopt lstat readlink getacl chown)
  174. if test "$ac_cv_func_getopt_func" = no; then
  175.     MH_XTRA_OBJS="$MH_XTRA_OBJS getopt.o"
  176. fi
  177.  
  178. MH_CHECK_CHTYPE
  179. MH_CHECK_BROKEN_SYSVR4_CURSES
  180. MH_CURSES_FUNCS
  181.  
  182. dnl --------------- allow --enable-debug to compile in debug mode --------
  183. AC_ARG_ENABLE(debug,
  184.     [  --enable-debug          turn on debugging],
  185.     [with_debug=$enableval],
  186.     [with_debug=no],
  187. )
  188. cflags_g="`echo $CFLAGS | grep -c '\-g'`"
  189. cflags_O="`echo $CFLAGS | grep -c '\-O'`"
  190.  
  191. if test "$with_debug" = yes; then
  192.     if test "$cflags_g" = "0"; then
  193.         CFLAGS="${CFLAGS} -g"
  194.     fi
  195.     if test "$cflags_O" != "0"; then
  196.         CFLAGS="`echo ${CFLAGS} | sed -e s/-O.//`"
  197.     fi
  198. else
  199.     if test "$cflags_O" = "0"; then
  200.         CFLAGS="${CFLAGS} -O"
  201.     fi
  202.     if test "$cflags_g" != "0"; then
  203.         CFLAGS="`echo ${CFLAGS} | sed -e s/-g//`"
  204.     fi
  205. fi
  206.  
  207. dnl --------------- allow --enable-trace to log trace information --------
  208. AC_ARG_ENABLE(trace,
  209.     [  --enable-trace          turn on tracing],
  210.     [with_trace=$enableval;AC_DEFINE(TRACE)],
  211.     [with_trace=no]
  212. )
  213. if test "$with_trace" = yes; then
  214.     MH_XTRA_OBJS="$MH_XTRA_OBJS trace.o"
  215. fi
  216. AC_SUBST(MH_XTRA_OBJS)
  217.  
  218. dnl --------------- allow --enable-purify to enable linking with Purify
  219. AC_ARG_ENABLE(purify,
  220.     [  --enable-purify         link with Purify (TM)],
  221.     [with_purify=$enableval],
  222.     [with_purify=no],
  223. )
  224. if test "$with_purify" = yes; then
  225.     PURIFY="purify"
  226. else
  227.     PURIFY=""
  228. fi
  229. AC_SUBST(PURIFY)
  230.  
  231. dnl ---------------------- check for Xaw3d library -------------------
  232. dnl allow --with-xaw3d to link with XCurses
  233. AC_ARG_WITH(xaw3d,
  234.     [  --with-xaw3d            link with Xaw3d],
  235.     [with_xaw3d=$withval],
  236.     [with_xaw3d=no],
  237. )
  238.  
  239. dnl --------------- Force definition of pre-compiler macro UNIX ----------
  240. AC_DEFINE(UNIX)
  241.  
  242. dnl --------------- Force definition of this build number ----------------
  243. AC_DEFINE(BUILD2502)
  244.  
  245. dnl --------------- Find us an xterm if using XCurses --------------------
  246. MH_FIND_XTERM
  247.  
  248. dnl --------------- Get us an install package ----------------------------
  249. AC_PROG_INSTALL
  250.  
  251. thisdir="`pwd`"
  252. AC_SUBST(thisdir)
  253.  
  254. AC_OUTPUT(Makefile)
  255.