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.
 
 
 
 
 
 

513 lines
17 KiB

  1. AC_INIT([libisoburn], [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 Hint: Search list for version code aspects:
  10. dnl /AC_INIT(
  11. dnl /ISOBURN_.*_VERSION
  12. dnl /LT_.*
  13. dnl /LIB.*_REQUIRED
  14. dnl The API version codes are defined in libisoburn/libisoburn.h
  15. dnl #define isoburn_header_version_*
  16. dnl configure.ac only rules the libtool revision numbering about
  17. dnl LT_CURREN, LT_AGE, LT_REVISION where SONAME becomes LT_CURRENT - LT_AGE
  18. dnl
  19. dnl These three are only copies to provide libtool with unused LT_RELEASE
  20. ISOBURN_MAJOR_VERSION=1
  21. ISOBURN_MINOR_VERSION=5
  22. ISOBURN_MICRO_VERSION=3
  23. dnl ISOBURN_VERSION=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION.$ISOBURN_MICRO_VERSION
  24. AC_SUBST(ISOBURN_MAJOR_VERSION)
  25. AC_SUBST(ISOBURN_MINOR_VERSION)
  26. AC_SUBST(ISOBURN_MICRO_VERSION)
  27. dnl AC_SUBST(ISOBURN_VERSION)
  28. dnl Libtool versioning
  29. dnl Generate libisoburn.so.1.x.y
  30. dnl SONAME will become LT_CURRENT - LT_AGE
  31. dnl
  32. dnl ts B91123
  33. dnl ### This is the release version 1.5.2 = libisoburn.so.1.109.0
  34. dnl This is the development version after above stable release
  35. dnl ### LT_CURRENT++, LT_AGE++ have not happened yet.
  36. dnl LT_CURRENT++, LT_AGE++ has happened meanwhile.
  37. dnl
  38. dnl SONAME = 111 - 110 = 1 . Library name = libisoburn.so.1.110.0
  39. LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION
  40. LT_CURRENT=111
  41. LT_AGE=110
  42. LT_REVISION=0
  43. LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
  44. AC_SUBST(LT_RELEASE)
  45. AC_SUBST(LT_CURRENT)
  46. AC_SUBST(LT_REVISION)
  47. AC_SUBST(LT_AGE)
  48. AC_SUBST(LT_CURRENT_MINUS_AGE)
  49. AC_PREFIX_DEFAULT([/usr/local])
  50. test "$prefix" = "NONE" && prefix=$ac_default_prefix
  51. dnl ts B90405 : Disabled on advise of Ross Burton
  52. dnl AM_MAINTAINER_MODE
  53. AM_PROG_CC_C_O
  54. AC_C_CONST
  55. AC_C_INLINE
  56. AC_C_BIGENDIAN
  57. dnl Large file support
  58. AC_SYS_LARGEFILE
  59. AC_FUNC_FSEEKO
  60. AC_CHECK_FUNC([fseeko])
  61. if test ! $ac_cv_func_fseeko; then
  62. AC_ERROR([Libburn requires largefile support.])
  63. fi
  64. if test x$LIBISOBURN_OLD_ICONV_CONFIGURE = x
  65. then
  66. dnl ts B00410 : To detect the need for -liconv and const argument of iconv()
  67. LIBBURNIA_CHECK_ICONV
  68. else
  69. dnl Outdated: produces double -liconv and warnings about parameter mismatch
  70. dnl If iconv(3) is in an extra lib, then it gets added to variable LIBS.
  71. dnl If not, then no -liconv will be added.
  72. AC_CHECK_LIB(iconv, iconv, , )
  73. dnl GNU iconv has no function iconv() but libiconv() and a macro iconv()
  74. AC_CHECK_LIB(iconv, libiconv, , )
  75. fi
  76. AC_PROG_LIBTOOL
  77. AC_SUBST(LIBTOOL_DEPS)
  78. # LIBTOOL="$LIBTOOL --silent"
  79. AC_PROG_INSTALL
  80. AC_CHECK_HEADERS()
  81. dnl Check for tm_gmtoff field in struct tm
  82. AC_CHECK_MEMBER([struct tm.tm_gmtoff],
  83. [AC_DEFINE(HAVE_TM_GMTOFF, 1,
  84. [Define this if tm structure includes a tm_gmtoff entry.])],
  85. ,
  86. [#include <time.h>])
  87. dnl Whether timezone is an integer variable
  88. AH_TEMPLATE([Libburnia_timezonE], [Either timezone or 0])
  89. LIBBURNIA_TRY_TIMEZONE
  90. if test x$LIBBURNIA_TIMEZONE = xtimezone
  91. then
  92. AC_DEFINE([Libburnia_timezonE], [timezone])
  93. else
  94. AC_DEFINE([Libburnia_timezonE], [0])
  95. fi
  96. THREAD_LIBS=-lpthread
  97. AC_SUBST(THREAD_LIBS)
  98. TARGET_SHIZZLE
  99. AC_SUBST(ARCH)
  100. AC_SUBST(LIBBURNIA_PKGCONFDIR)
  101. AC_SUBST(LIBBURN_ARCH_LIBS)
  102. # Do not link libcam or libvolmgt if not available.
  103. # (They are indirect dependency on FreeBSD or Solaris.)
  104. LIBBURNIA_CHECK_ARCH_LIBS(optional)
  105. dnl Determine target directory for libisoburn-*.pc
  106. dnl Important: Must be performed _after_ TARGET_SHIZZLE
  107. dnl
  108. LIBBURNIA_SET_PKGCONFIG
  109. dnl xorriso-dd-target is addicted to the Linux kernel and util-linux lsblk
  110. if uname -s | grep '^Linux' >/dev/null
  111. then
  112. XORRISO_DD_TARGET=xorriso-dd-target/xorriso-dd-target
  113. XORRISO_DD_TARGET_MAN=xorriso-dd-target/xorriso-dd-target.1
  114. XORRISO_DD_TARGET_TEXI=xorriso-dd-target/xorriso-dd-target.texi
  115. echo "enabled installation of xorriso-dd-target/xorriso-dd-target"
  116. else
  117. XORRISO_DD_TARGET=
  118. XORRISO_DD_TARGET_MAN=
  119. XORRISO_DD_TARGET_TEXI=
  120. echo "disabled installation of xorriso-dd-target/xorriso-dd-target"
  121. fi
  122. AC_SUBST(XORRISO_DD_TARGET)
  123. AC_SUBST(XORRISO_DD_TARGET_MAN)
  124. AC_SUBST(XORRISO_DD_TARGET_TEXI)
  125. AC_ARG_ENABLE(libreadline,
  126. [ --enable-libreadline Enable use of libreadline by xorriso, default=yes],
  127. , enable_libreadline=yes)
  128. if test x$enable_libreadline = xyes; then
  129. dnl Check whether there is readline-devel and readline-runtime.
  130. dnl If not, erase this macro which would enable use of readline(),add_history()
  131. READLINE_DEF="-DXorriso_with_readlinE"
  132. if test x$XORRISO_OLD_READLINE_CONFIGURE = x
  133. then
  134. dnl ts B00411 : To disable readline if not all needed functions are present
  135. LIBBURNIA_ASSERT_READLINE
  136. else
  137. dnl The empty yes case obviously causes -lreadline to be linked
  138. AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= )
  139. dnl The X= in the yes case prevents that -lreadline gets linked twice
  140. AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= )
  141. fi
  142. else
  143. READLINE_DEF=
  144. echo "disabled libreadline"
  145. fi
  146. if test x$READLINE_DEF = x; then
  147. if test x$enable_libreadline = xyes; then
  148. libedit_deflt=yes
  149. else
  150. libedit_deflt=no
  151. fi
  152. AC_ARG_ENABLE(libedit,
  153. [ --enable-libedit Enable use of libedit by xorriso if not libreadline,
  154. default= setting of --enable-libreadline],
  155. , enable_libedit=$libedit_deflt)
  156. if test x$enable_libedit = xyes; then
  157. READLINE_DEF="-DXorriso_with_editlinE"
  158. LIBBURNIA_ASSERT_EDITLINE
  159. else
  160. READLINE_DEF=
  161. echo "disabled libedit"
  162. fi
  163. fi
  164. AC_SUBST(READLINE_DEF)
  165. dnl ts A90329
  166. dnl ACL and xattr do not need to be enabled in libisoburn or xorriso source
  167. dnl but without AC_CHECK_LIB() xorriso will not be linked with -lacl .
  168. dnl On my Linux this does work with an ACL enabled libisofs but in general
  169. dnl it seems not be right.
  170. dnl So for now it seems to be best to do the same configuration for libisoburn
  171. dnl and xorriso as for libisofs.
  172. AC_ARG_ENABLE(libacl,
  173. [ --enable-libacl Enable use of libacl by libisofs, default=yes],
  174. , enable_libacl=yes)
  175. LIBACL_DEF=
  176. if test x$LIBBURNIA_SUPP_ACL = xlibacl
  177. then
  178. if test x$enable_libacl = xyes; then
  179. dnl Check whether there is libacl-devel and libacl-runtime.
  180. dnl If not, erase this macro which would enable use of acl_to_text and others
  181. LIBACL_DEF="-DLibisofs_with_aaip_acL"
  182. dnl The empty yes case obviously causes -lacl to be linked
  183. has_acl_h_but_no_func=0
  184. AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= )
  185. if test "$has_acl_h_but_no_libacl" = 1
  186. then
  187. AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= )
  188. fi
  189. fi
  190. fi
  191. if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL
  192. then
  193. if test x$has_acl_h_but_no_libacl = x1
  194. then
  195. echo "enabled local processing of ACL"
  196. else
  197. echo "enabled libacl, local processing of ACL"
  198. fi
  199. else
  200. echo "disabled local processing of ACL"
  201. fi
  202. AC_SUBST(LIBACL_DEF)
  203. AC_ARG_ENABLE(xattr,
  204. [ --enable-xattr Enable use of extended file attributes by libisofs, default=yes],
  205. , enable_xattr=yes)
  206. XATTR_DEF=
  207. if test x"$LIBBURNIA_SUPP_FATTR" = xxattr
  208. then
  209. if test "x$enable_xattr" = xyes; then
  210. dnl Check whether there is the header for Linux xattr.
  211. dnl If not, erase this macro which would enable use of listxattr and others
  212. XATTR_DEF="-DLibisofs_with_aaip_xattR"
  213. AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= ,
  214. XATTR_DEF= ), XATTR_DEF= )
  215. fi
  216. elif test x"$LIBBURNIA_SUPP_FATTR" = xextattr
  217. then
  218. if test "x$enable_xattr" = xyes; then
  219. XATTR_DEF="-DLibisofs_with_freebsd_extattR"
  220. AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=,
  221. XATTR_DEF= ), XATTR_DEF= )
  222. fi
  223. fi
  224. if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR
  225. then
  226. echo "enabled xattr, local processing of extended file attributes Linux style"
  227. elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR
  228. then
  229. echo "enabled extattr, local processing of extended file attributes FreeBSD style"
  230. else
  231. echo "disabled local processing of extended file attributes"
  232. fi
  233. AC_SUBST(XATTR_DEF)
  234. dnl ts A90409
  235. dnl Same situation as with xattr and ACL: libisoburn does not depend directly
  236. dnl on zlib. But if it is enabled in libisofs then it seems wise to link it
  237. dnl with libisoburn apps.
  238. AC_ARG_ENABLE(zlib,
  239. [ --enable-zlib Enable use of zlib by libisofs, default=yes],
  240. , enable_zlib=yes)
  241. if test x$enable_zlib = xyes; then
  242. dnl Check whether there is the header for zlib.
  243. dnl If not, erase this macro which would enable use of compress2() and others.
  244. dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks
  245. dnl compressBound(). So compressBound is the more modern thing to test.
  246. dnl The empty parameter after "compressBound" causes -lz.
  247. ZLIB_DEF="-DLibisofs_with_zliB"
  248. AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= )
  249. else
  250. ZLIB_DEF=
  251. fi
  252. AC_SUBST(ZLIB_DEF)
  253. dnl ts B00928
  254. AC_ARG_ENABLE(libjte,
  255. [ --enable-libjte Enable use of libjte >= 2.0 by xorriso, default=yes],
  256. , enable_libjte=yes)
  257. if test "x$enable_libjte" = xyes; then
  258. LIBJTE_DEF="-DXorriso_with_libjtE"
  259. AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_set_checksum_algorithm, , LIBJTE_DEF= ), LIBJTE_DEF= )
  260. else
  261. LIBJTE_DEF=
  262. fi
  263. AC_SUBST(LIBJTE_DEF)
  264. dnl ts B00107
  265. dnl Just for the case that it is necessary to give link option -lcdio not only
  266. dnl with libburn but also with libburn apps like xorriso.
  267. dnl On SuSE 10.2 this is not needed. libburn finds libcdio on its own.
  268. case $host_os in
  269. cygwin*|mingw*)
  270. default_libcdio=yes
  271. ;;
  272. *)
  273. default_libcdio=no
  274. ;;
  275. esac
  276. AC_ARG_ENABLE(libcdio,
  277. [ --enable-libcdio Enable use of libcdio as system adapter, default=no (except on MSWindows)],
  278. , enable_libcdio=$default_libcdio)
  279. if test x$enable_libcdio = xyes; then
  280. dnl Check whether there is libcdio-devel and libcdio-runtime.
  281. dnl If not, erase this macro
  282. LIBCDIO_DEF="-DLibburn_use_libcdiO"
  283. dnl The empty yes case obviously causes -lcdio to be linked
  284. AC_CHECK_HEADER(cdio/cdio.h, AC_CHECK_LIB(cdio, mmc_last_cmd_sense, , LIBCDIO_DEF= ), LIBCDIO_DEF= )
  285. else
  286. LIBCDIO_DEF=
  287. fi
  288. if test x$LIBCDIO_DEF = x
  289. then
  290. if test x$enable_libcdio = xyes
  291. then
  292. echo "WARNING: could not enable use of libcdio as system adapter"
  293. fi
  294. else
  295. echo "enabled use of libcdio as system adapter"
  296. fi
  297. AC_SUBST(LIBCDIO_DEF)
  298. AC_ARG_ENABLE(external-filters,
  299. [ --enable-external-filters Enable use of external filter programs by xorriso, default=yes],
  300. , enable_external_filters=yes)
  301. if test x"$enable_external_filters" = xyes; then
  302. EXTF_DEF="-DXorriso_allow_external_filterS"
  303. echo "enabled xorriso external filter programs"
  304. else
  305. EXTF_DEF=
  306. echo "disabled xorriso external filter programs"
  307. fi
  308. AC_SUBST(EXTF_DEF)
  309. AC_ARG_ENABLE(external-filters-setuid,
  310. [ --enable-external-filters-setuid Enable xorriso external filter programs under setuid, default=no],
  311. , enable_external_filters_setuid=no)
  312. if test x$enable_external_filters_setuid = xyes; then
  313. EXTF_SUID_DEF="-DXorriso_allow_extf_suiD"
  314. echo "enabled xorriso external filter programs under setuid"
  315. else
  316. EXTF_SUID_DEF=
  317. echo "disabled xorriso external filter programs under setuid"
  318. fi
  319. AC_SUBST(EXTF_SUID_DEF)
  320. AC_ARG_ENABLE(launch-frontend,
  321. [ --enable-launch-frontend Enable start of piped frontend program by xorriso, default=yes],
  322. , enable_launch_frontend=yes)
  323. if test x"$enable_launch_frontend" = xyes; then
  324. LFRONT_DEF="-DXorriso_allow_launch_frontenD"
  325. echo "enabled xorriso command -launch_frontend"
  326. else
  327. LFRONT_DEF=
  328. echo "disabled xorriso command -launch_frontend"
  329. fi
  330. AC_SUBST(LFRONT_DEF)
  331. AC_ARG_ENABLE(launch-frontend-setuid,
  332. [ --enable-launch-frontend-setuid Enable start of piped frontend program under setuid, default=no],
  333. , enable_launch_frontend_setuid=no)
  334. if test x$enable_launch_frontend_setuid = xyes; then
  335. LFRONT_SUID_DEF="-DXorriso_allow_extf_suiD"
  336. echo "enabled xorriso command -launch_frontend under setuid"
  337. else
  338. LFRONT_SUID_DEF=
  339. echo "disabled xorriso command -launch_frontend under setuid"
  340. fi
  341. AC_SUBST(LFRONT_SUID_DEF)
  342. AC_ARG_ENABLE(dvd-obs-64k,
  343. [ --enable-dvd-obs-64k 64 KB default size for xorriso DVD writing, default=no],
  344. , enable_dvd_obs_64=no)
  345. if test x$enable_dvd_obs_64k = xyes; then
  346. XORRISO_DVD_OBS_64K="-DXorriso_dvd_obs_default_64K"
  347. echo "enabled xorriso write size default 64 KB on DVD"
  348. else
  349. XORRISO_DVD_OBS_64K=
  350. echo "disabled xorriso write size default 64 KB on DVD"
  351. fi
  352. AC_SUBST(XORRISO_DVD_OBS_64K)
  353. # Library versioning normally serves a complex purpose.
  354. # Since libisoburn obeys strict ABI backward compatibility, it needs only the
  355. # simple feature to declare function names "global:" or "local:". Only the
  356. # global ones are visible to applications at library load time.
  357. AC_ARG_ENABLE(versioned-libs,
  358. [ --enable-versioned-libs Enable strict symbol encapsulation , default=yes],
  359. , enable_versioned_libs=yes)
  360. if test x$enable_versioned_libs = xyes; then
  361. vers_libs_test=no
  362. LIBISOBURN_ASSERT_VERS_LIBS
  363. if test x$vers_libs_test = xno
  364. then
  365. echo "disabled strict symbol encapsulation (test failed)"
  366. else
  367. echo "enabled strict symbol encapsulation"
  368. fi
  369. else
  370. echo "disabled strict symbol encapsulation"
  371. fi
  372. AC_ARG_ENABLE(ldconfig-at-install,
  373. [ --enable-ldconfig-at-install On GNU/Linux run ldconfig, default=yes],
  374. , ldconfig_at_install=yes)
  375. if test x$ldconfig_at_install = xyes; then
  376. dummy=dummy
  377. else
  378. LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'"
  379. echo "disabled run of ldconfig during installation on GNU/Linux"
  380. fi
  381. AC_SUBST(LIBBURNIA_LDCONFIG_CMD)
  382. AC_CHECK_HEADER(libburn/libburn.h, LIBBURNIA_HAVE_LIBBURN=1, LIBBURNIA_HAVE_LIBBURN=0)
  383. AC_CHECK_HEADER(libisofs/libisofs.h, LIBBURNIA_HAVE_LIBISOFS=1, LIBBURNIA_HAVE_LIBISOFS=0)
  384. if test x$LIBBURNIA_HAVE_LIBBURN = x0; then
  385. echo "FATAL: Lacking libburn development header file <libburn/libburn.h>" 2>&1
  386. echo "HINT: You first have to install libburn before you can build libisoburn" 2>&1
  387. fi
  388. if test x$LIBBURNIA_HAVE_LIBISOFS = x0; then
  389. echo "FATAL: Lacking libisofs development header file <libisofs/libisofs.h>" 2>&1
  390. echo "HINT: You first have to install libisofs before you can build libisoburn" 2>&1
  391. fi
  392. if test x$LIBBURNIA_HAVE_LIBBURN = x0 -o x$LIBBURNIA_HAVE_LIBISOFS = x0; then
  393. echo "ABORT: Lacking mandatory prerequisites" 2>&1
  394. exit 1
  395. fi
  396. # ------- Visible mark in configure : Start of library check
  397. # Check for proper library versions if this is desired.
  398. # (It fails too often on too many systems.)
  399. AC_ARG_ENABLE(pkg-check-modules,
  400. [ --enable-pkg-check-modules Enable pkg-config check for libburn and libisofs , default=no],
  401. , enable_pkg_check_modules=no)
  402. if test x$enable_pkg_check_modules = xyes; then
  403. dnl If PKG_CHECK_MODULES is to be used after this if-block,
  404. dnl then it might be necessary to perform PKG_PROG_PKG_CONFIG before the block.
  405. LIBBURN_REQUIRED=1.5.2
  406. LIBISOFS_REQUIRED=1.5.2
  407. PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED)
  408. PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED)
  409. if test x$LIBCDIO_DEF = x; then
  410. dummy=dummy
  411. else
  412. LIBCDIO_REQUIRED=0.83
  413. PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED)
  414. fi
  415. else
  416. echo "checking for LIBBURN... skipped, no --enable-pkg-check-modules"
  417. echo "checking for LIBISOFS... skipped, no --enable-pkg-check-modules"
  418. if test x$LIBCDIO_DEF = x; then
  419. dummy=dummy
  420. else
  421. echo "checking for LIBCDIO... skipped, no --enable-pkg-check-modules"
  422. fi
  423. fi
  424. # ------- Visible mark in configure : End of library check
  425. dnl Add compiler-specific flags
  426. dnl See if the user wants aggressive optimizations of the code
  427. AC_ARG_ENABLE(debug,
  428. [ --enable-debug Disable aggressive optimizations [default=yes]],
  429. , enable_debug=yes)
  430. if test x$enable_debug != xyes; then
  431. if test x$GCC = xyes; then
  432. CFLAGS="-O3 $CFLAGS"
  433. CFLAGS="-fexpensive-optimizations $CFLAGS"
  434. fi
  435. CFLAGS="-DNDEBUG $CFLAGS"
  436. else
  437. if test x$GCC = xyes; then
  438. CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-char-subscripts $CFLAGS"
  439. fi
  440. CFLAGS="-DDEBUG $CFLAGS"
  441. fi
  442. CFLAGS="$READLINE_DEF $LIBACL_DEF $XATTR_DEF $EXTF_DEF $EXTF_SUID_DEF $LFRONT_DEF $LFRONT_SUID_DEF $ZLIB_DEF $LIBJTE_DEF $XORRISO_DVD_OBS_64K $CFLAGS"
  443. AC_CONFIG_FILES([
  444. Makefile
  445. doc/doxygen.conf
  446. version.h
  447. libisoburn-1.pc
  448. ])
  449. AC_OUTPUT