home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lzop-1.00.tar.gz / lzop-1.00.tar / lzop-1.00 / configure.in < prev    next >
Text File  |  1998-04-21  |  8KB  |  250 lines

  1. dnl Process this file with autoconf to produce a configure script.
  2.  
  3. #
  4. #  configure.in -- autoconf configuration for the LZO package
  5. #
  6. #  This file is part of the lzop file compressor.
  7. #
  8. #  Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
  9. #  Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
  10. #  Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
  11. #
  12. #  lzop and the LZO library are free software; you can redistribute them
  13. #  and/or modify them under the terms of the GNU General Public License as
  14. #  published by the Free Software Foundation; either version 2 of
  15. #  the License, or (at your option) any later version.
  16. #
  17. #  This program is distributed in the hope that it will be useful,
  18. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20. #  GNU General Public License for more details.
  21. #
  22. #  You should have received a copy of the GNU General Public License
  23. #  along with this program; see the file COPYING.
  24. #  If not, write to the Free Software Foundation, Inc.,
  25. #  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  26. #
  27. #  Markus F.X.J. Oberhumer
  28. #  markus.oberhumer@jk.uni-linz.ac.at
  29. #
  30.  
  31.  
  32. # /***********************************************************************
  33. # // Initialization
  34. # ************************************************************************/
  35.  
  36. AC_INIT(src/lzop.c)
  37. AC_PREREQ(2.12)
  38. AC_CONFIG_AUX_DIR(acconfig)
  39. AC_PREFIX_DEFAULT(/usr/local)
  40. AM_INIT_AUTOMAKE(lzop,1.00)
  41. AM_CONFIG_HEADER(config.h:config.hin)
  42. AC_CANONICAL_HOST
  43.  
  44. AM_MAINTAINER_MODE
  45. AM_CONDITIONAL(MAINTAINER, test x$USE_MAINTAINER_MODE = xyes)
  46.  
  47. mfx_PROG_MAKE_GNU(mfx_GMAKE)
  48. AM_CONDITIONAL(GMAKE, test x$mfx_GMAKE = xyes)
  49.  
  50. CLEANFILES='*.i'
  51. DISTCLEANFILES='*.bb *.bbg *.da *.gcov bb.out bbtrace* gmon.out'
  52. AC_SUBST(CLEANFILES)
  53. AC_SUBST(DISTCLEANFILES)
  54.  
  55. AM_WITH_DMALLOC
  56.  
  57. AC_ARG_ENABLE(debug,
  58. [  --enable-debug          build a debug version [default=no]],
  59. [test "$enableval" = yes && enable_debug=yes])
  60. test "$enable_debug" = yes || enable_debug=no
  61.  
  62. AC_ARG_ENABLE(coverage,
  63. [  --enable-coverage       build a coverage version [default=no]],
  64. [test "$enableval" = yes && enable_coverage=yes])
  65. test "$enable_coverage" = yes || enable_coverage=no
  66.  
  67.  
  68. # /***********************************************************************
  69. # // Prepare compiler flags
  70. # ************************************************************************/
  71.  
  72. dnl CC=""
  73. dnl LIBS=""
  74. dnl CFLAGS=""
  75. dnl CPPFLAGS=""
  76. dnl LDFLAGS=""
  77.  
  78. CPPFLAGS="$CPPFLAGS"
  79. CFLAGS="$CFLAGS"
  80. CFLAGS_O=""
  81. CFLAGS_W=""
  82. EXTRA_CFLAGS=""
  83. AC_SUBST(CFLAGS_O)dnl
  84. AC_SUBST(CFLAGS_W)dnl
  85. AC_SUBST(EXTRA_CFLAGS)dnl
  86.  
  87.  
  88. # /***********************************************************************
  89. # // try to locate the LZO library
  90. # ************************************************************************/
  91.  
  92. lzo_includedir=""
  93. lzo_libdir=""
  94. lzo_liblzo_a=""
  95. AC_SUBST(lzo_includedir)
  96. AC_SUBST(lzo_libdir)dnl
  97. AC_SUBST(lzo_liblzo_a)dnl
  98.  
  99. if test -n "$LZODIR"; then
  100.   test -d "$LZODIR" && LZODIR=`cd "$LZODIR" && pwd`
  101. fi
  102.  
  103. if test -d "$LZODIR"; then
  104.   test -z "$lzo_includedir" && test -f "$LZODIR/include/lzoconf.h" \
  105.     && lzo_includedir="$LZODIR/include"
  106.   test -z "$lzo_includedir" && test -f "$LZODIR/lzoconf.h" \
  107.     && lzo_includedir="$LZODIR"
  108.  
  109.   test -z "$lzo_libdir" && test -f "$LZODIR/lib/liblzo.a" \
  110.     && lzo_libdir="$LZODIR/lib"
  111.   test -z "$lzo_libdir" && test -f "$LZODIR/src/.libs/liblzo.a" \
  112.     && lzo_libdir="$LZODIR/src/.libs"
  113.   test -z "$lzo_libdir" && test -f "$LZODIR/src/_libs/liblzo.a" \
  114.     && lzo_libdir="$LZODIR/src/_libs"
  115.   test -z "$lzo_libdir" && test -f "$LZODIR/src/liblzo.a" \
  116.     && lzo_libdir="$LZODIR/src"
  117.   test -z "$lzo_libdir" && test -f "$LZODIR/liblzo.a" \
  118.     && lzo_libdir="$LZODIR"
  119.  
  120.   test -n "$lzo_includedir" && CPPFLAGS="$CPPFLAGS -I$lzo_includedir"
  121. fi
  122.  
  123. if test -n "$lzo_libdir"; then
  124.   test -f "$lzo_libdir/liblzo.a" && lzo_liblzo_a="$lzo_libdir/liblzo.a"
  125.   LDFLAGS="$LDFLAGS -L$lzo_libdir"
  126. fi
  127.  
  128.  
  129. # /***********************************************************************
  130. # // Checks for compiler
  131. # ************************************************************************/
  132.  
  133. AC_PROG_CC
  134. mfx_PROG_CC_ANSI
  135. AC_PROG_CPP
  136. AC_PROG_CC_C_O
  137. AM_EXEEXT
  138.  
  139. if test "$enable_debug" = yes; then
  140.   CPPFLAGS="$CPPFLAGS -DNRV_DEBUG"
  141. fi
  142. AC_MSG_CHECKING([whether to build a debug version])
  143. AC_MSG_RESULT($enable_debug)
  144.  
  145. if test "$GCC" = yes; then
  146.   if test "$enable_coverage" = yes; then
  147.     x="-fprofile-arcs -ftest-coverage"
  148.     EXTRA_CFLAGS="$EXTRA_CFLAGS $x -O0"
  149.   fi
  150. else
  151.   enable_coverage=no
  152. fi
  153. AC_MSG_CHECKING([whether to build a coverage version])
  154. AC_MSG_RESULT($enable_coverage)
  155.  
  156.  
  157. # /***********************************************************************
  158. # // Checks for other programs
  159. # ************************************************************************/
  160.  
  161. AM_PROG_INSTALL
  162.  
  163.  
  164. # /***********************************************************************
  165. # // Checks for libraries
  166. # ************************************************************************/
  167.  
  168. AC_CHECK_LIB(lzo,__lzo_init2,,AC_MSG_ERROR([LZO library v1.02 or above not found. Please check your installation or set the environment variable \`LZODIR'.]))
  169.  
  170. dnl AC_CHECK_LIB(ncurses,start_color)
  171.  
  172.  
  173. # /***********************************************************************
  174. # // Checks for system header files
  175. # ************************************************************************/
  176.  
  177. AC_HEADER_STDC
  178. AC_HEADER_TIME
  179. AC_CHECK_HEADERS(assert.h ctype.h limits.h stddef.h time.h unistd.h)
  180. AC_CHECK_HEADERS(memory.h signal.h utime.h sys/utime.h)
  181. AC_CHECK_HEADERS(sys/param.h sys/resource.h sys/time.h sys/times.h)
  182. AC_CHECK_HEADERS(linux/kd.h linux/kdev_t.h linux/major.h)
  183.  
  184.  
  185. # /***********************************************************************
  186. # // Checks for library header files
  187. # ************************************************************************/
  188.  
  189. AC_CHECK_HEADERS(lzoconf.h lzo1x.h,,AC_MSG_ERROR([LZO header file not found. Please check your installation or set the environment variable \`LZODIR'.]))
  190.  
  191. AC_CHECK_HEADERS(curses.h ncurses.h)
  192.  
  193.  
  194. # /***********************************************************************
  195. # // Checks for typedefs and structures
  196. # ************************************************************************/
  197.  
  198. AC_CHECK_TYPE(ptrdiff_t,long)
  199. AC_TYPE_SIZE_T
  200. AC_TYPE_SIGNAL
  201.  
  202. dnl no support for cross-compiling
  203. mfx_CHECK_SIZEOF(ptrdiff_t,0)
  204. mfx_CHECK_SIZEOF(size_t,0)
  205.  
  206.  
  207. # /***********************************************************************
  208. # // Checks for compiler characteristics
  209. # ************************************************************************/
  210.  
  211. AC_C_CONST
  212.  
  213.  
  214. # /***********************************************************************
  215. # // Checks for library functions
  216. # ************************************************************************/
  217.  
  218. AC_CHECK_FUNCS(memcmp memcpy memmove memset strdup)
  219. AC_CHECK_FUNCS(access atoi chmod chown fchmod fileno fstat getumask isatty setmode stat umask utime)
  220. AC_CHECK_FUNCS(ctime difftime gmtime localtime mktime strftime tzset)
  221. AC_CHECK_FUNCS(index strchr strcasecmp strncasecmp stricmp strnicmp strstr)
  222. mfx_FUNC_MEMCMP
  223.  
  224.  
  225. # /***********************************************************************
  226. # // Checks for system services
  227. # ************************************************************************/
  228.  
  229.  
  230. # /***********************************************************************
  231. # // Customization
  232. # ************************************************************************/
  233.  
  234. mfx_CUSTOMIZE
  235.  
  236. CPPFLAGS="$CPPFLAGS -DLZOP_HAVE_CONFIG_H"
  237.  
  238. if test "$USE_MAINTAINER_MODE" = yes; then
  239.   CPPFLAGS="$CPPFLAGS -DMAINT"
  240.   test "$GCC" = yes && EXTRA_CFLAGS="$EXTRA_CFLAGS -Werror"
  241. fi
  242.  
  243.  
  244. # /***********************************************************************
  245. # // Write output files
  246. # ************************************************************************/
  247.  
  248. AC_OUTPUT(Makefile doc/Makefile src/Makefile)
  249.  
  250.