configure.ac 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. #
  2. # configure.ac -- autoconf configuration for the LZO library
  3. #
  4. # This file is part of the LZO data compression library.
  5. #
  6. # Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
  7. # All Rights Reserved.
  8. #
  9. # The LZO library is free software; you can redistribute it and/or
  10. # modify it under the terms of the GNU General Public License as
  11. # published by the Free Software Foundation; either version 2 of
  12. # the License, or (at your option) any later version.
  13. #
  14. # The LZO library is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with the LZO library; see the file COPYING.
  21. # If not, write to the Free Software Foundation, Inc.,
  22. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  23. #
  24. # Markus F.X.J. Oberhumer
  25. # <markus@oberhumer.com>
  26. # http://www.oberhumer.com/opensource/lzo/
  27. #
  28. # /***********************************************************************
  29. # // Init
  30. # ************************************************************************/
  31. AC_COPYRIGHT([Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer.
  32. All Rights Reserved.
  33. This configure script may be copied, distributed and modified under the
  34. terms of the GNU General Public License; see COPYING for more details.])
  35. AC_PREREQ(2.69)
  36. AC_INIT([LZO],[2.09],[markus@oberhumer.com],[lzo],[http://www.oberhumer.com/opensource/lzo/])
  37. AC_MSG_NOTICE([Configuring LZO $PACKAGE_VERSION])
  38. AC_CONFIG_SRCDIR(src/lzo_init.c)
  39. AC_CONFIG_AUX_DIR(autoconf)
  40. m4_include([autoconf/local.m4])
  41. AC_PREFIX_DEFAULT(/usr/local)
  42. AC_CANONICAL_BUILD
  43. AC_CANONICAL_HOST
  44. AC_CANONICAL_TARGET
  45. AM_MAINTAINER_MODE
  46. if test -z "$ac_abs_top_srcdir"; then
  47. _AC_SRCDIRS([.])
  48. fi
  49. if test -z "$ac_abs_top_srcdir"; then
  50. as_fn_error 1 "internal error: ac_abs_top_srcdir is not set"
  51. fi
  52. if test -r .Conf.settings1; then
  53. . ./.Conf.settings1
  54. fi
  55. AC_PROG_CC
  56. AM_PROG_CC_C_O
  57. AM_PROG_AR
  58. AM_PROG_AS
  59. AC_PROG_CPP
  60. mfx_PROG_CPPFLAGS
  61. AC_C_CONST
  62. mfx_LZO_CHECK_ENDIAN
  63. AC_SYS_LARGEFILE
  64. AM_INIT_AUTOMAKE([1.15 gnu subdir-objects -Wall -Werror])
  65. AM_SILENT_RULES([yes])
  66. AC_CONFIG_HEADERS([config.h:config.hin])
  67. AH_TOP([#ifndef __LZO_AUTOCONF_CONFIG_H_INCLUDED
  68. #define __LZO_AUTOCONF_CONFIG_H_INCLUDED 1])
  69. AH_BOTTOM([#endif /* already included */])
  70. AC_ENABLE_STATIC
  71. AC_DISABLE_SHARED
  72. LT_INIT
  73. # /***********************************************************************
  74. # // Checks for header files
  75. # ************************************************************************/
  76. mfx_ACC_CHECK_HEADERS
  77. dnl AC_CHECK_HEADERS([sys/param.h sys/resource.h sys/times.h])
  78. if test "X$ac_cv_header_limits_h" != Xyes; then
  79. AC_MSG_ERROR([<limits.h> header not found])
  80. fi
  81. mfx_CHECK_HEADER_SANE_LIMITS_H
  82. if test "X$mfx_cv_header_sane_limits_h" != Xyes; then
  83. AC_MSG_ERROR([your <limits.h> header is broken - for details see config.log])
  84. fi
  85. # /***********************************************************************
  86. # // Checks for typedefs and structures
  87. # ************************************************************************/
  88. AC_TYPE_OFF_T
  89. AC_CHECK_TYPE(ptrdiff_t,long)
  90. AC_TYPE_SIZE_T
  91. AC_TYPE_SIGNAL
  92. mfx_ACC_CHECK_SIZEOF
  93. mfx_CHECK_SIZEOF
  94. # /***********************************************************************
  95. # // Checks for library functions
  96. # ************************************************************************/
  97. mfx_ACC_CHECK_FUNCS
  98. mfx_CHECK_LIB_WINMM
  99. # /***********************************************************************
  100. # // Checks for assembler
  101. # ************************************************************************/
  102. AC_ARG_ENABLE(asm, AS_HELP_STRING(--disable-asm,disable assembly versions))
  103. asm_arch=
  104. asm_dir=
  105. asm_msg_amd64=no
  106. asm_msg_i386=no
  107. case "$host_cpu-$ac_cv_sizeof_void_p" in
  108. amd64-8 | x86_64-8) asm_arch="amd64"; asm_dir="asm/amd64/src_gas/elf64"; asm_mode="amd64_src_gas_elf64" ;;
  109. i?86-4) asm_arch="i386"; asm_dir="asm/i386/src_gas"; asm_mode="i386_src_gas" ;;
  110. *) enable_asm=no ;;
  111. esac
  112. LZO_USE_ASM_i386_src_gas=no
  113. AC_MSG_CHECKING([whether to build assembly versions])
  114. if test "X$enable_asm" != Xno; then
  115. mfx_compile_S='${CCAS} ${CCASFLAGS} -c conftest.S 1>&AS_MESSAGE_LOG_FD'
  116. cat > conftest.S <<EOF
  117. #if !defined(__i386__) && !defined(__i386)
  118. #error
  119. this+is+an+error
  120. #endif
  121. #include "$ac_abs_top_srcdir/$asm_dir/lzo1x_f1.S"
  122. EOF
  123. enable_asm=no
  124. if AC_TRY_EVAL(mfx_compile_S); then
  125. if AC_TRY_COMMAND([test -s conftest.$ac_objext]); then
  126. enable_asm=yes
  127. eval asm_msg_$asm_arch="'yes [[$asm_dir]]'"
  128. eval LZO_USE_ASM_$asm_mode=yes
  129. fi
  130. fi
  131. if test "X$enable_asm" = Xno; then
  132. echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
  133. cat conftest.S >&AS_MESSAGE_LOG_FD
  134. fi
  135. rm -rf conftest*
  136. fi
  137. AC_MSG_RESULT([$enable_asm])
  138. AM_CONDITIONAL(LZO_USE_ASM_i386_src_gas, [test "X$LZO_USE_ASM_i386_src_gas" != Xno])
  139. AM_CONDITIONAL(LZO_USE_ASM_i386_obj_elf32, [false])
  140. # /***********************************************************************
  141. # // Write output files
  142. # ************************************************************************/
  143. mfx_LZO_LZOCHK(["-I$srcdir/include -I$srcdir"],[#include <lzo/lzoconf.h>],[<src/lzo_supp.h>])
  144. if test -r .Conf.settings2; then
  145. . ./.Conf.settings2
  146. fi
  147. my_DEFS="-DLZO_HAVE_CONFIG_H=1"
  148. if test "X$enable_asm" != Xno; then
  149. my_DEFS="$my_DEFS -DLZO_USE_ASM=1"
  150. fi
  151. AC_CONFIG_COMMANDS_PRE([
  152. test "X$DEFS" = "X-DHAVE_CONFIG_H" && DEFS=
  153. test "X$DEFS" != "X" && DEFS="$DEFS "
  154. DEFS="${DEFS}${my_DEFS}"
  155. ])
  156. AC_CONFIG_FILES([Makefile])
  157. AC_OUTPUT
  158. ## enable AMD64 assembly code : ${asm_msg_amd64}
  159. cat <<EOF
  160. LZO configuration summary
  161. -------------------------
  162. LZO version : ${PACKAGE_VERSION}
  163. configured for host : ${host_cpu}-${host_vendor}-${host_os}
  164. source code location : ${srcdir}
  165. compiler : ${CC}
  166. preprocessor definitions : ${DEFS}
  167. preprocessor flags : ${CPPFLAGS}
  168. compiler flags : ${CFLAGS}
  169. build static library : ${enable_static}
  170. build shared library : ${enable_shared}
  171. enable i386 assembly code : ${asm_msg_i386}
  172. LZO ${PACKAGE_VERSION} configured.
  173. Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
  174. All Rights Reserved.
  175. The LZO library is free software; you can redistribute it and/or
  176. modify it under the terms of the GNU General Public License as
  177. published by the Free Software Foundation; either version 2 of
  178. the License, or (at your option) any later version.
  179. The LZO library is distributed in the hope that it will be useful,
  180. but WITHOUT ANY WARRANTY; without even the implied warranty of
  181. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  182. GNU General Public License for more details.
  183. Markus F.X.J. Oberhumer
  184. <markus@oberhumer.com>
  185. http://www.oberhumer.com/opensource/lzo/
  186. Type 'make' to build LZO.
  187. Type 'make check' and 'make test' to test LZO.
  188. Type 'make install' to install LZO.
  189. After installing LZO, please have a look at 'examples/simple.c'.
  190. EOF
  191. # vim:set ts=4 sw=4 et: