You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

278 lines
8.3 KiB

  1. AC_INIT([libisofs], [1.4.2], [http://libburnia-project.org])
  2. AC_PREREQ([2.50])
  3. dnl AC_CONFIG_HEADER([config.h])
  4. AC_CANONICAL_HOST
  5. AC_CANONICAL_TARGET
  6. LIBBURNIA_SET_FLAGS
  7. AM_INIT_AUTOMAKE([subdir-objects])
  8. AC_CONFIG_MACRO_DIR([./])
  9. dnl
  10. dnl if MAJOR or MINOR version changes, be sure to change AC_INIT above to match
  11. dnl
  12. dnl CURRENT and AGE describe the binary compatibility interval of a
  13. dnl dynamic library.
  14. dnl See also http://www.gnu.org/software/libtool/manual.html#Interfaces
  15. dnl
  16. dnl The name of the library will be libisofs.so.$CURRENT-$AGE.$AGE.$REV
  17. dnl In the terminology of this file:
  18. dnl CURRENT = LT_CURRENT
  19. dnl REV = LT_REVISION
  20. dnl AGE = LT_AGE
  21. dnl
  22. dnl LT_CURRENT, LT_REVISION and LT_AGE get set directly now.
  23. dnl
  24. dnl SONAME of the emerging library is LT_CURRENT - LT_AGE.
  25. dnl The linker will do no finer checks. Especially no age range check for
  26. dnl the cdrskin binary. If SONAME matches, then the couple starts.
  27. dnl
  28. dnl Therefore a run time check is provided by libisofs function
  29. dnl iso_lib_version(). It returns the major, minor and micro revision of the
  30. dnl library. This means LIBISOFS_*_VERSION kept its second job which does not
  31. dnl comply to the usual ways of configure.ac . I.e. now *officially* this is
  32. dnl the source code release version as announced to the public. It has no
  33. dnl connection to SONAME or libtool version numbering.
  34. dnl It rather feeds the API function iso_lib_version().
  35. dnl
  36. dnl If LIBISOFS_*_VERSION changes, be sure to change AC_INIT above to match.
  37. dnl
  38. LIBISOFS_MAJOR_VERSION=1
  39. LIBISOFS_MINOR_VERSION=4
  40. LIBISOFS_MICRO_VERSION=2
  41. LIBISOFS_VERSION=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION.$LIBISOFS_MICRO_VERSION
  42. AC_SUBST(LIBISOFS_MAJOR_VERSION)
  43. AC_SUBST(LIBISOFS_MINOR_VERSION)
  44. AC_SUBST(LIBISOFS_MICRO_VERSION)
  45. AC_SUBST(LIBISOFS_VERSION)
  46. dnl Libtool versioning
  47. LT_RELEASE=$LIBISOFS_MAJOR_VERSION.$LIBISOFS_MINOR_VERSION
  48. # 2015.11.28 development jump has not yet happened
  49. # SONAME = 84 - 78 = 6 . Library name = libisofs.6.78.0
  50. LT_CURRENT=84
  51. LT_AGE=78
  52. LT_REVISION=0
  53. LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
  54. AC_SUBST(LT_RELEASE)
  55. AC_SUBST(LT_CURRENT)
  56. AC_SUBST(LT_REVISION)
  57. AC_SUBST(LT_AGE)
  58. AC_SUBST(LT_CURRENT_MINUS_AGE)
  59. AC_PREFIX_DEFAULT([/usr/local])
  60. test "$prefix" = "NONE" && prefix=$ac_default_prefix
  61. AM_MAINTAINER_MODE
  62. AM_PROG_CC_C_O
  63. AC_C_CONST
  64. AC_C_INLINE
  65. AC_C_BIGENDIAN
  66. dnl Large file support
  67. AC_SYS_LARGEFILE
  68. AC_FUNC_FSEEKO
  69. AC_CHECK_FUNC([fseeko])
  70. if test ! $ac_cv_func_fseeko; then
  71. AC_MSG_ERROR([Libisofs requires largefile support.])
  72. fi
  73. dnl If iconv(3) is in an extra lib, then it gets added to variable LIBS.
  74. dnl If not, then no -liconv will be added.
  75. LIBBURNIA_CHECK_ICONV
  76. dnl To abort configuration if iconv() still cannot be compiled
  77. LIBBURNIA_ASSERT_ICONV
  78. AC_PROG_LIBTOOL
  79. AC_SUBST(LIBTOOL_DEPS)
  80. LIBTOOL="$LIBTOOL --silent"
  81. AC_PROG_INSTALL
  82. AC_CHECK_HEADERS()
  83. dnl Use GNU extensions if available
  84. AC_DEFINE(_GNU_SOURCE, 1)
  85. dnl Check for tm_gmtoff field in struct tm
  86. AC_CHECK_MEMBER([struct tm.tm_gmtoff],
  87. [AC_DEFINE(HAVE_TM_GMTOFF, 1,
  88. [Define this if tm structure includes a tm_gmtoff entry.])],
  89. ,
  90. [#include <time.h>])
  91. dnl Check if non standard timegm() function is available
  92. AC_CHECK_DECL([timegm],
  93. [AC_DEFINE(HAVE_TIMEGM, 1, [Define this if timegm function is available])],
  94. ,
  95. [#include <time.h>])
  96. dnl Whether timezone is an integer variable
  97. AH_TEMPLATE([Libburnia_timezonE], [Either timezone or 0])
  98. LIBBURNIA_TRY_TIMEZONE
  99. if test x$LIBBURNIA_TIMEZONE = xtimezone
  100. then
  101. AC_DEFINE([Libburnia_timezonE], [timezone])
  102. else
  103. AC_DEFINE([Libburnia_timezonE], [0])
  104. fi
  105. dnl Check if non standard eaccess() function is available
  106. AC_CHECK_DECL([eaccess],
  107. [AC_DEFINE(HAVE_EACCESS, 1, [Define this if eaccess function is available])],
  108. ,
  109. [#include <unistd.h>])
  110. THREAD_LIBS=-lpthread
  111. AC_SUBST(THREAD_LIBS)
  112. TARGET_SHIZZLE
  113. AC_SUBST(ARCH)
  114. AC_SUBST(LIBBURN_ARCH_LIBS)
  115. dnl See if the user wants aggressive optimizations of the code
  116. AC_ARG_ENABLE(debug,
  117. [ --enable-debug Disable aggressive optimizations, default=yes],
  118. , enable_debug=yes)
  119. if test x$enable_debug != xyes; then
  120. if test x$GCC = xyes; then
  121. CFLAGS="-O3 $CFLAGS"
  122. CFLAGS="-fexpensive-optimizations $CFLAGS"
  123. fi
  124. CFLAGS="-DNDEBUG $CFLAGS"
  125. else
  126. if test x$GCC = xyes; then
  127. CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-char-subscripts $CFLAGS"
  128. fi
  129. CFLAGS="-DDEBUG $CFLAGS"
  130. fi
  131. dnl Verbose debug to make libisofs issue more debug messages
  132. AC_ARG_ENABLE(verbose-debug,
  133. [ --enable-verbose-debug Enable verbose debug messages, default=no],
  134. AC_DEFINE(LIBISOFS_VERBOSE_DEBUG, 1))
  135. dnl Determine target directory for libisofs-*.pc
  136. dnl Important: Must be performed _after_ TARGET_SHIZZLE
  137. dnl
  138. LIBBURNIA_SET_PKGCONFIG
  139. dnl Add compiler-specific flags
  140. AC_ARG_ENABLE(libacl,
  141. [ --enable-libacl Enable use of ACL functions by libisofs, default=yes],
  142. , enable_libacl=yes)
  143. if test "x$enable_libacl" = xyes; then
  144. dnl Check whether there is libacl-devel and libacl-runtime.
  145. dnl If not, erase this macro which would enable use of acl_to_text and others
  146. LIBACL_DEF="-DLibisofs_with_aaip_acL"
  147. dnl The empty yes case obviously causes -lacl to be linked
  148. has_acl_h_but_no_func=0
  149. AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= )
  150. if test "$has_acl_h_but_no_libacl" = 1
  151. then
  152. AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= )
  153. fi
  154. else
  155. LIBACL_DEF=
  156. fi
  157. AC_SUBST(LIBACL_DEF)
  158. dnl ts A90123
  159. AC_ARG_ENABLE(xattr,
  160. [ --enable-xattr Enable use of xattr by libisofs, default=yes],
  161. , enable_xattr=yes)
  162. if test "x$enable_xattr" = xyes; then
  163. dnl Check whether there is the header for Linux xattr.
  164. dnl If not, erase this macro which would enable use of listxattr and others
  165. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  166. AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= , XATTR_DEF= ), XATTR_DEF= )
  167. if test "x$XATTR_DEF" = x
  168. then
  169. XATTR_DEF="-DLibisofs_with_freebsd_extattR"
  170. AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=, XATTR_DEF= ), XATTR_DEF= )
  171. fi
  172. else
  173. XATTR_DEF=
  174. fi
  175. AC_SUBST(XATTR_DEF)
  176. dnl ts A90409
  177. AC_ARG_ENABLE(zlib,
  178. [ --enable-zlib Enable use of zlib by libisofs, default=yes],
  179. , enable_zlib=yes)
  180. if test "x$enable_zlib" = xyes; then
  181. dnl Check whether there is the header for zlib.
  182. dnl If not, erase this macro which would enable use of compress2() and others.
  183. dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks
  184. dnl compressBound(). So compressBound is the more modern thing to test.
  185. dnl The empty parameter after "compressBound" causes -lz.
  186. ZLIB_DEF="-DLibisofs_with_zliB"
  187. AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= )
  188. else
  189. ZLIB_DEF=
  190. fi
  191. AC_SUBST(ZLIB_DEF)
  192. dnl ts B00927
  193. AC_ARG_ENABLE(libjte,
  194. [ --enable-libjte Enable use of libjte by libisofs, default=yes],
  195. , enable_libjte=yes)
  196. if test "x$enable_libjte" = xyes; then
  197. LIBJTE_DEF="-DLibisofs_with_libjtE"
  198. AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_new, , LIBJTE_DEF= ), LIBJTE_DEF= )
  199. else
  200. LIBJTE_DEF=
  201. fi
  202. AC_SUBST(LIBJTE_DEF)
  203. # Library versioning normally serves a complex purpose.
  204. # Since libisofs obeys strict ABI backward compatibility, it needs only the
  205. # simple feature to declare function names "global:" or "local:". Only the
  206. # global ones are visible to applications at library load time.
  207. AC_ARG_ENABLE(versioned-libs,
  208. [ --enable-versioned-libs Enable strict symbol encapsulation , default=yes],
  209. , enable_versioned_libs=yes)
  210. if test x$enable_versioned_libs = xyes; then
  211. vers_libs_test=no
  212. LIBISOFS_ASSERT_VERS_LIBS
  213. if test x$vers_libs_test = xno
  214. then
  215. echo "disabled strict symbol encapsulation (test failed)"
  216. else
  217. echo "enabled strict symbol encapsulation"
  218. fi
  219. else
  220. echo "disabled strict symbol encapsulation"
  221. fi
  222. AC_ARG_ENABLE(ldconfig-at-install,
  223. [ --enable-ldconfig-at-install On GNU/Linux run ldconfig, default=yes],
  224. , ldconfig_at_install=yes)
  225. if test x$ldconfig_at_install = xyes; then
  226. dummy=dummy
  227. else
  228. LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'"
  229. echo "disabled run of ldconfig during installation on GNU/Linux"
  230. fi
  231. AC_SUBST(LIBBURNIA_LDCONFIG_CMD)
  232. AC_CONFIG_FILES([
  233. Makefile
  234. doc/doxygen.conf
  235. version.h
  236. libisofs-1.pc
  237. ])
  238. AC_OUTPUT