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.
 
 
 

358 lines
11 KiB

  1. AC_INIT([libisofs], [1.5.3], [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. If SONAME matches, then the couple
  26. dnl 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=5
  40. LIBISOFS_MICRO_VERSION=3
  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. dnl 2019.11.23 development jump has happened
  49. dnl SONAME = 95 - 89 = 6 . Library name = libisofs.6.89.0
  50. LT_CURRENT=95
  51. LT_AGE=89
  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. dnl ts B90405 : Disabled on advise of Ross Burton
  62. dnl AM_MAINTAINER_MODE
  63. AM_PROG_CC_C_O
  64. AC_C_CONST
  65. AC_C_INLINE
  66. AC_C_BIGENDIAN
  67. dnl Large file support
  68. AC_SYS_LARGEFILE
  69. AC_FUNC_FSEEKO
  70. AC_CHECK_FUNC([fseeko])
  71. if test ! $ac_cv_func_fseeko; then
  72. AC_MSG_ERROR([Libisofs requires largefile support.])
  73. fi
  74. dnl If iconv(3) is in an extra lib, then it gets added to variable LIBS.
  75. dnl If not, then no -liconv will be added.
  76. LIBBURNIA_CHECK_ICONV
  77. dnl To abort configuration if iconv() still cannot be compiled
  78. LIBBURNIA_ASSERT_ICONV
  79. AC_PROG_LIBTOOL
  80. AC_SUBST(LIBTOOL_DEPS)
  81. # LIBTOOL="$LIBTOOL --silent"
  82. AC_PROG_INSTALL
  83. AC_CHECK_HEADERS()
  84. dnl Use GNU extensions if available
  85. AC_DEFINE(_GNU_SOURCE, 1)
  86. dnl Check for tm_gmtoff field in struct tm
  87. AC_CHECK_MEMBER([struct tm.tm_gmtoff],
  88. [AC_DEFINE(HAVE_TM_GMTOFF, 1,
  89. [Define this if tm structure includes a tm_gmtoff entry.])],
  90. ,
  91. [#include <time.h>])
  92. dnl Check if non standard timegm() function is available
  93. AC_CHECK_DECL([timegm],
  94. [AC_DEFINE(HAVE_TIMEGM, 1, [Define this if timegm function is available])],
  95. ,
  96. [#include <time.h>])
  97. dnl Whether timezone is an integer variable
  98. AH_TEMPLATE([Libburnia_timezonE], [Either timezone or 0])
  99. LIBBURNIA_TRY_TIMEZONE
  100. if test x$LIBBURNIA_TIMEZONE = xtimezone
  101. then
  102. AC_DEFINE([Libburnia_timezonE], [timezone])
  103. else
  104. AC_DEFINE([Libburnia_timezonE], [0])
  105. fi
  106. dnl Check if non standard eaccess() function is available
  107. AC_CHECK_DECL([eaccess],
  108. [AC_DEFINE(HAVE_EACCESS, 1, [Define this if eaccess function is available])],
  109. ,
  110. [#include <unistd.h>])
  111. THREAD_LIBS=-lpthread
  112. AC_SUBST(THREAD_LIBS)
  113. TARGET_SHIZZLE
  114. AC_SUBST(ARCH)
  115. AC_SUBST(LIBBURN_ARCH_LIBS)
  116. dnl See if the user wants aggressive optimizations of the code
  117. AC_ARG_ENABLE(debug,
  118. [ --enable-debug Disable aggressive optimizations, default=yes],
  119. , enable_debug=yes)
  120. if test x$enable_debug != xyes; then
  121. if test x$GCC = xyes; then
  122. CFLAGS="-O3 $CFLAGS"
  123. CFLAGS="-fexpensive-optimizations $CFLAGS"
  124. fi
  125. CFLAGS="-DNDEBUG $CFLAGS"
  126. else
  127. if test x$GCC = xyes; then
  128. CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-char-subscripts $CFLAGS"
  129. fi
  130. CFLAGS="-DDEBUG $CFLAGS"
  131. fi
  132. dnl Verbose debug to make libisofs issue more debug messages
  133. AC_ARG_ENABLE(verbose-debug,
  134. [ --enable-verbose-debug Enable verbose debug messages, default=no],
  135. AC_DEFINE(LIBISOFS_VERBOSE_DEBUG, 1))
  136. dnl Determine target directory for libisofs-*.pc
  137. dnl Important: Must be performed _after_ TARGET_SHIZZLE
  138. dnl
  139. LIBBURNIA_SET_PKGCONFIG
  140. dnl Add compiler-specific flags
  141. AC_ARG_ENABLE(libacl,
  142. [ --enable-libacl Enable use of ACL functions by libisofs, default=yes],
  143. , enable_libacl=yes)
  144. LIBACL_DEF=
  145. has_acl_h_but_no_func=0
  146. if test x$LIBBURNIA_SUPP_ACL = xlibacl
  147. then
  148. if test x$enable_libacl = xyes; then
  149. dnl Check whether there is libacl-devel and libacl-runtime.
  150. dnl If not, erase this macro which would enable use of acl_to_text and others
  151. LIBACL_DEF="-DLibisofs_with_aaip_acL"
  152. dnl The empty yes case obviously causes -lacl to be linked
  153. AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= )
  154. if test "$has_acl_h_but_no_libacl" = 1
  155. then
  156. AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= )
  157. fi
  158. fi
  159. fi
  160. if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL
  161. then
  162. if test x$has_acl_h_but_no_libacl = x1
  163. then
  164. echo "enabled local processing of ACL"
  165. else
  166. echo "enabled libacl, local processing of ACL"
  167. fi
  168. else
  169. echo "disabled local processing of ACL"
  170. fi
  171. AC_SUBST(LIBACL_DEF)
  172. dnl ts A90123 - B80508
  173. AC_ARG_ENABLE(xattr,
  174. [ --enable-xattr Enable use of extended file attributes by libisofs, default=yes],
  175. , enable_xattr=yes)
  176. AC_ARG_ENABLE(xattr_h_pref_attr,
  177. [ --enable-xattr-h-pref-attr Prefer include file attr/xattr.h over sys/xattr.h, default=no],
  178. , enable_xattr_h_pref_attr=no)
  179. XATTR_DEF=
  180. XATTR_ADDON_DEF=
  181. if test x"$LIBBURNIA_SUPP_FATTR" = xxattr
  182. then
  183. if test "x$enable_xattr" = xyes; then
  184. dnl Check whether there is the header for Linux xattr.
  185. dnl If not, erase this macro which would enable use of listxattr and others
  186. XATTR_A_DEF=
  187. XATTR_S_DEF=
  188. if test x"$enable_xattr_h_pref_attr" = xyes
  189. then
  190. echo "prefering include file attr/xattr.h over sys/attr.h"
  191. XATTR_A_DEF=1
  192. AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  193. XATTR_A_DEF= ), XATTR_A_DEF= )
  194. if test x"$XATTR_A_DEF" = x1
  195. then
  196. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  197. else
  198. XATTR_S_DEF=1
  199. AC_CHECK_HEADER(sys/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  200. XATTR_S_DEF= ), XATTR_S_DEF= )
  201. if test x"$XATTR_S_DEF" = x1
  202. then
  203. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  204. XATTR_ADDON_DEF="-DLibisofs_with_sys_xattR"
  205. fi
  206. fi
  207. else
  208. XATTR_S_DEF=1
  209. AC_CHECK_HEADER(sys/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  210. XATTR_S_DEF= ), XATTR_S_DEF= )
  211. if test x"$XATTR_S_DEF" = x1
  212. then
  213. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  214. XATTR_ADDON_DEF="-DLibisofs_with_sys_xattR"
  215. else
  216. XATTR_A_DEF=1
  217. AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  218. XATTR_A_DEF= ), XATTR_A_DEF= )
  219. if test x"$XATTR_A_DEF" = x1
  220. then
  221. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  222. fi
  223. fi
  224. fi
  225. if test x"$XATTR_S_DEF" = x1
  226. then
  227. echo "decided to include file sys/attr.h"
  228. elif test x"$XATTR_A_DEF" = x1
  229. then
  230. echo "decided to include file attr/xattr.h"
  231. fi
  232. fi
  233. elif test x"$LIBBURNIA_SUPP_FATTR" = xextattr
  234. then
  235. if test "x$enable_xattr" = xyes; then
  236. XATTR_DEF="-DLibisofs_with_freebsd_extattR"
  237. AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=,
  238. XATTR_DEF= ), XATTR_DEF= )
  239. fi
  240. fi
  241. if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR
  242. then
  243. echo "enabled xattr, local processing of extended file attributes Linux style"
  244. elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR
  245. then
  246. echo "enabled extattr, local processing of extended file attributes FreeBSD style"
  247. else
  248. echo "disabled local processing of extended file attributes"
  249. fi
  250. XATTR_DEF="$XATTR_DEF $XATTR_ADDON_DEF"
  251. AC_SUBST(XATTR_DEF)
  252. dnl ts A90409
  253. AC_ARG_ENABLE(zlib,
  254. [ --enable-zlib Enable use of zlib by libisofs, default=yes],
  255. , enable_zlib=yes)
  256. if test "x$enable_zlib" = xyes; then
  257. dnl Check whether there is the header for zlib.
  258. dnl If not, erase this macro which would enable use of compress2() and others.
  259. dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks
  260. dnl compressBound(). So compressBound is the more modern thing to test.
  261. dnl The empty parameter after "compressBound" causes -lz.
  262. ZLIB_DEF="-DLibisofs_with_zliB"
  263. AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= )
  264. else
  265. ZLIB_DEF=
  266. fi
  267. AC_SUBST(ZLIB_DEF)
  268. dnl ts B00927
  269. AC_ARG_ENABLE(libjte,
  270. [ --enable-libjte Enable use of libjte >= 2.0 by libisofs, default=yes],
  271. , enable_libjte=yes)
  272. if test "x$enable_libjte" = xyes; then
  273. LIBJTE_DEF="-DLibisofs_with_libjtE"
  274. AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_set_checksum_algorithm, , LIBJTE_DEF= ), LIBJTE_DEF= )
  275. else
  276. LIBJTE_DEF=
  277. fi
  278. AC_SUBST(LIBJTE_DEF)
  279. # Library versioning normally serves a complex purpose.
  280. # Since libisofs obeys strict ABI backward compatibility, it needs only the
  281. # simple feature to declare function names "global:" or "local:". Only the
  282. # global ones are visible to applications at library load time.
  283. AC_ARG_ENABLE(versioned-libs,
  284. [ --enable-versioned-libs Enable strict symbol encapsulation , default=yes],
  285. , enable_versioned_libs=yes)
  286. if test x$enable_versioned_libs = xyes; then
  287. vers_libs_test=no
  288. LIBISOFS_ASSERT_VERS_LIBS
  289. if test x$vers_libs_test = xno
  290. then
  291. echo "disabled strict symbol encapsulation (test failed)"
  292. else
  293. echo "enabled strict symbol encapsulation"
  294. fi
  295. else
  296. echo "disabled strict symbol encapsulation"
  297. fi
  298. AC_ARG_ENABLE(ldconfig-at-install,
  299. [ --enable-ldconfig-at-install On GNU/Linux run ldconfig, default=yes],
  300. , ldconfig_at_install=yes)
  301. if test x$ldconfig_at_install = xyes; then
  302. dummy=dummy
  303. else
  304. LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'"
  305. echo "disabled run of ldconfig during installation on GNU/Linux"
  306. fi
  307. AC_SUBST(LIBBURNIA_LDCONFIG_CMD)
  308. AC_CONFIG_FILES([
  309. Makefile
  310. doc/doxygen.conf
  311. version.h
  312. libisofs-1.pc
  313. ])
  314. AC_OUTPUT