Advertisement
Guest User

Untitled

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