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.

356 lines
11 KiB

  1. AC_INIT([libisofs], [1.5.1], [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=1
  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. # 2018.09.15 development jump has not yet happened
  49. # SONAME = 92 - 86 = 6 . Library name = libisofs.6.86.0
  50. LT_CURRENT=92
  51. LT_AGE=86
  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. LIBACL_DEF=
  144. has_acl_h_but_no_func=0
  145. if test x$LIBBURNIA_SUPP_ACL = xlibacl
  146. then
  147. if test x$enable_libacl = xyes; then
  148. dnl Check whether there is libacl-devel and libacl-runtime.
  149. dnl If not, erase this macro which would enable use of acl_to_text and others
  150. LIBACL_DEF="-DLibisofs_with_aaip_acL"
  151. dnl The empty yes case obviously causes -lacl to be linked
  152. AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= )
  153. if test "$has_acl_h_but_no_libacl" = 1
  154. then
  155. AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= )
  156. fi
  157. fi
  158. fi
  159. if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL
  160. then
  161. if test x$has_acl_h_but_no_libacl = x1
  162. then
  163. echo "enabled local processing of ACL"
  164. else
  165. echo "enabled libacl, local processing of ACL"
  166. fi
  167. else
  168. echo "disabled local processing of ACL"
  169. fi
  170. AC_SUBST(LIBACL_DEF)
  171. dnl ts A90123 - B80508
  172. AC_ARG_ENABLE(xattr,
  173. [ --enable-xattr Enable use of extended file attributes by libisofs, default=yes],
  174. , enable_xattr=yes)
  175. AC_ARG_ENABLE(xattr_h_pref_attr,
  176. [ --enable-xattr-h-pref-attr Prefer include file attr/xattr.h over sys/xattr.h, default=no],
  177. , enable_xattr_h_pref_attr=no)
  178. XATTR_DEF=
  179. XATTR_ADDON_DEF=
  180. if test x"$LIBBURNIA_SUPP_FATTR" = xxattr
  181. then
  182. if test "x$enable_xattr" = xyes; then
  183. dnl Check whether there is the header for Linux xattr.
  184. dnl If not, erase this macro which would enable use of listxattr and others
  185. XATTR_A_DEF=
  186. XATTR_S_DEF=
  187. if test x"$enable_xattr_h_pref_attr" = xyes
  188. then
  189. echo "prefering include file attr/xattr.h over sys/attr.h"
  190. XATTR_A_DEF=1
  191. AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  192. XATTR_A_DEF= ), XATTR_A_DEF= )
  193. if test x"$XATTR_A_DEF" = x1
  194. then
  195. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  196. else
  197. XATTR_S_DEF=1
  198. AC_CHECK_HEADER(sys/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  199. XATTR_S_DEF= ), XATTR_S_DEF= )
  200. if test x"$XATTR_S_DEF" = x1
  201. then
  202. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  203. XATTR_ADDON_DEF="-DLibisofs_with_sys_xattR"
  204. fi
  205. fi
  206. else
  207. XATTR_S_DEF=1
  208. AC_CHECK_HEADER(sys/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  209. XATTR_S_DEF= ), XATTR_S_DEF= )
  210. if test x"$XATTR_S_DEF" = x1
  211. then
  212. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  213. XATTR_ADDON_DEF="-DLibisofs_with_sys_xattR"
  214. else
  215. XATTR_A_DEF=1
  216. AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  217. XATTR_A_DEF= ), XATTR_A_DEF= )
  218. if test x"$XATTR_A_DEF" = x1
  219. then
  220. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  221. fi
  222. fi
  223. fi
  224. if test x"$XATTR_S_DEF" = x1
  225. then
  226. echo "decided to include file sys/attr.h"
  227. elif test x"$XATTR_A_DEF" = x1
  228. then
  229. echo "decided to include file attr/xattr.h"
  230. fi
  231. fi
  232. elif test x"$LIBBURNIA_SUPP_FATTR" = xextattr
  233. then
  234. if test "x$enable_xattr" = xyes; then
  235. XATTR_DEF="-DLibisofs_with_freebsd_extattR"
  236. AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=,
  237. XATTR_DEF= ), XATTR_DEF= )
  238. fi
  239. fi
  240. if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR
  241. then
  242. echo "enabled xattr, local processing of extended file attributes Linux style"
  243. elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR
  244. then
  245. echo "enabled extattr, local processing of extended file attributes FreeBSD style"
  246. else
  247. echo "disabled local processing of extended file attributes"
  248. fi
  249. XATTR_DEF="$XATTR_DEF $XATTR_ADDON_DEF"
  250. AC_SUBST(XATTR_DEF)
  251. dnl ts A90409
  252. AC_ARG_ENABLE(zlib,
  253. [ --enable-zlib Enable use of zlib by libisofs, default=yes],
  254. , enable_zlib=yes)
  255. if test "x$enable_zlib" = xyes; then
  256. dnl Check whether there is the header for zlib.
  257. dnl If not, erase this macro which would enable use of compress2() and others.
  258. dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks
  259. dnl compressBound(). So compressBound is the more modern thing to test.
  260. dnl The empty parameter after "compressBound" causes -lz.
  261. ZLIB_DEF="-DLibisofs_with_zliB"
  262. AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= )
  263. else
  264. ZLIB_DEF=
  265. fi
  266. AC_SUBST(ZLIB_DEF)
  267. dnl ts B00927
  268. AC_ARG_ENABLE(libjte,
  269. [ --enable-libjte Enable use of libjte by libisofs, default=yes],
  270. , enable_libjte=yes)
  271. if test "x$enable_libjte" = xyes; then
  272. LIBJTE_DEF="-DLibisofs_with_libjtE"
  273. AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_new, , LIBJTE_DEF= ), LIBJTE_DEF= )
  274. else
  275. LIBJTE_DEF=
  276. fi
  277. AC_SUBST(LIBJTE_DEF)
  278. # Library versioning normally serves a complex purpose.
  279. # Since libisofs obeys strict ABI backward compatibility, it needs only the
  280. # simple feature to declare function names "global:" or "local:". Only the
  281. # global ones are visible to applications at library load time.
  282. AC_ARG_ENABLE(versioned-libs,
  283. [ --enable-versioned-libs Enable strict symbol encapsulation , default=yes],
  284. , enable_versioned_libs=yes)
  285. if test x$enable_versioned_libs = xyes; then
  286. vers_libs_test=no
  287. LIBISOFS_ASSERT_VERS_LIBS
  288. if test x$vers_libs_test = xno
  289. then
  290. echo "disabled strict symbol encapsulation (test failed)"
  291. else
  292. echo "enabled strict symbol encapsulation"
  293. fi
  294. else
  295. echo "disabled strict symbol encapsulation"
  296. fi
  297. AC_ARG_ENABLE(ldconfig-at-install,
  298. [ --enable-ldconfig-at-install On GNU/Linux run ldconfig, default=yes],
  299. , ldconfig_at_install=yes)
  300. if test x$ldconfig_at_install = xyes; then
  301. dummy=dummy
  302. else
  303. LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'"
  304. echo "disabled run of ldconfig during installation on GNU/Linux"
  305. fi
  306. AC_SUBST(LIBBURNIA_LDCONFIG_CMD)
  307. AC_CONFIG_FILES([
  308. Makefile
  309. doc/doxygen.conf
  310. version.h
  311. libisofs-1.pc
  312. ])
  313. AC_OUTPUT