configure.ac 13.7 KB
Newer Older
1
AC_INIT([libisoburn], [1.3.6], [http://libburnia-project.org])
2 3 4 5 6 7
AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h])	

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

8 9
LIBBURNIA_SET_FLAGS

10
AM_INIT_AUTOMAKE([subdir-objects])
11
AC_CONFIG_MACRO_DIR([./])
12

Thomas Schmitt's avatar
Thomas Schmitt committed
13
dnl Hint: Search list for version code aspects:
Thomas Schmitt's avatar
Thomas Schmitt committed
14
dnl       /AC_INIT(
Thomas Schmitt's avatar
Thomas Schmitt committed
15 16 17 18
dnl       /ISOBURN_.*_VERSION
dnl       /LT_.*
dnl       /LIB.*_REQUIRED

Thomas Schmitt's avatar
Thomas Schmitt committed
19
dnl The API version codes are defined in libisoburn/libisoburn.h
20 21 22 23 24
dnl #define  isoburn_header_version_*
dnl configure.ac only rules the libtool revision numbering about
dnl LT_CURREN, LT_AGE, LT_REVISION where SONAME becomes LT_CURRENT - LT_AGE
dnl 
dnl These three are only copies to provide libtool with unused LT_RELEASE
25
ISOBURN_MAJOR_VERSION=1
26
ISOBURN_MINOR_VERSION=3
27
ISOBURN_MICRO_VERSION=6
28

29 30
dnl ISOBURN_VERSION=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION.$ISOBURN_MICRO_VERSION
 
31 32 33
AC_SUBST(ISOBURN_MAJOR_VERSION)
AC_SUBST(ISOBURN_MINOR_VERSION)
AC_SUBST(ISOBURN_MICRO_VERSION)
34
dnl AC_SUBST(ISOBURN_VERSION)
35 36

dnl Libtool versioning
37
dnl Generate libisoburn.so.1.x.y
38
dnl SONAME will become LT_CURRENT - LT_AGE
39
dnl 
40 41 42
dnl ts B40304
dnl This is the release version 1.3.6 = libisoburn.so.1.93.0
dnl ### This is the development version after above stable release
43
dnl LT_CURRENT++, LT_AGE++ have not happened yet.
Thomas Schmitt's avatar
Thomas Schmitt committed
44
dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile.
45
dnl
46
dnl SONAME = 94 - 93 = 1 . Library name = libisoburn.so.1.93.0
47
LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION
48 49
LT_CURRENT=94
LT_AGE=93
Thomas Schmitt's avatar
Thomas Schmitt committed
50
LT_REVISION=0
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`

AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_CURRENT_MINUS_AGE)

AC_PREFIX_DEFAULT([/usr/local])
test "$prefix" = "NONE" && prefix=$ac_default_prefix

AM_MAINTAINER_MODE

AM_PROG_CC_C_O
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN

dnl Large file support
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_FUNC([fseeko])
if test ! $ac_cv_func_fseeko; then
   AC_ERROR([Libburn requires largefile support.])
fi

77 78 79 80
if test x$LIBISOBURN_OLD_ICONV_CONFIGURE = x
then

dnl ts B00410 : To detect the need for -liconv and const argument of iconv()
81
    LIBBURNIA_CHECK_ICONV
82 83 84 85

else

dnl Outdated: produces double -liconv and warnings about parameter mismatch
86 87
dnl If iconv(3) is in an extra lib, then it gets added to variable LIBS.
dnl If not, then no -liconv will be added.
88
    AC_CHECK_LIB(iconv, iconv, , )
89
dnl GNU iconv has no function iconv() but libiconv() and a macro iconv()
90
    AC_CHECK_LIB(iconv, libiconv, , )
91

92 93
fi

94 95 96 97 98 99 100 101
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
LIBTOOL="$LIBTOOL --silent"

AC_PROG_INSTALL

AC_CHECK_HEADERS()

102 103 104 105 106 107 108
dnl Check for tm_gmtoff field in struct tm
AC_CHECK_MEMBER([struct tm.tm_gmtoff],
	[AC_DEFINE(HAVE_TM_GMTOFF, 1,
		[Define this if tm structure includes a tm_gmtoff entry.])],
	,
	[#include <time.h>])

109 110 111 112 113
THREAD_LIBS=-lpthread
AC_SUBST(THREAD_LIBS)

TARGET_SHIZZLE
AC_SUBST(ARCH)
114
AC_SUBST(LIBBURNIA_PKGCONFDIR)
115 116
AC_SUBST(LIBBURN_ARCH_LIBS)

117

118 119 120 121 122 123
dnl Determine target directory for libisoburn-*.pc
dnl Important: Must be performed _after_ TARGET_SHIZZLE
dnl
LIBBURNIA_SET_PKGCONFIG


124 125 126 127
AC_ARG_ENABLE(libreadline,
[  --enable-libreadline    Enable use of libreadline by xorriso, default=yes],
               , enable_libreadline=yes)
if test x$enable_libreadline = xyes; then
128 129
dnl Check whether there is readline-devel and readline-runtime.
dnl If not, erase this macro which would enable use of readline(),add_history()
130
    READLINE_DEF="-DXorriso_with_readlinE"
131 132 133 134 135 136 137 138

    if test x$XORRISO_OLD_READLINE_CONFIGURE = x
    then

dnl ts B00411 : To disable readline if not all needed functions are present
        LIBBURNIA_ASSERT_READLINE

    else
139
dnl The empty yes case obviously causes -lreadline to be linked
140
        AC_CHECK_HEADER(readline/readline.h, AC_CHECK_LIB(readline, readline, , READLINE_DEF= ), READLINE_DEF= )
141
dnl The X= in the yes case prevents that -lreadline gets linked twice
142 143
        AC_CHECK_HEADER(readline/history.h, AC_CHECK_LIB(readline, add_history, X= , READLINE_DEF= ), READLINE_DEF= )
    fi
144 145 146
else
    READLINE_DEF=
fi
147 148
AC_SUBST(READLINE_DEF)

149 150 151 152 153 154 155 156 157
dnl ts A90329
dnl ACL and xattr do not need to be enabled in libisoburn or xorriso source
dnl but without AC_CHECK_LIB() xorriso will not be linked with -lacl .
dnl On my Linux this does work with an ACL enabled libisofs but in general
dnl it seems not be right.
dnl So for now it seems to be best to do the same configuration for libisoburn
dnl and xorriso as for libisofs.
 
AC_ARG_ENABLE(libacl,
158
[  --enable-libacl         Enable use of libacl by libisofs, default=yes],
159 160 161 162 163 164 165 166 167 168 169
               , enable_libacl=yes)
if test x$enable_libacl = xyes; then
dnl Check whether there is libacl-devel and libacl-runtime.
dnl If not, erase this macro which would enable use of acl_to_text and others
    LIBACL_DEF="-DLibisofs_with_aaip_acL"
dnl The empty yes case obviously causes -lacl to be linked
    AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , LIBACL_DEF= ), LIBACL_DEF= )
else
    LIBACL_DEF=
fi
AC_SUBST(LIBACL_DEF)
170 171


172
AC_ARG_ENABLE(xattr,
173
[  --enable-xattr          Enable use of xattr by libisofs, default=yes],
174 175 176 177 178 179 180 181 182 183 184
               , enable_xattr=yes)
if test x$enable_xattr = xyes; then
dnl Check whether there is the header for Linux xattr. 
dnl If not, erase this macro which would enable use of listxattr and others
    XATTR_DEF="-DLibisofs_with_aaip_xattR"
    AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= , XATTR_DEF= ), XATTR_DEF= )
else
    XATTR_DEF=
fi
AC_SUBST(XATTR_DEF)

185

186 187 188 189 190
dnl ts A90409
dnl Same situation as with xattr and ACL: libisoburn does not depend directly
dnl on zlib. But if it is enabled in libisofs then it seems wise to link it
dnl with libisoburn apps.
AC_ARG_ENABLE(zlib,
191
[  --enable-zlib           Enable use of zlib by libisofs, default=yes],
192 193 194 195
               , enable_zlib=yes)
if test x$enable_zlib = xyes; then
dnl Check whether there is the header for zlib. 
dnl If not, erase this macro which would enable use of compress2() and others.
196 197 198
dnl Linking fails on SuSE 9.0 because zlib has compress2() but lacks  
dnl compressBound(). So compressBound is the more modern thing to test.
dnl The empty parameter after "compressBound" causes -lz.
199
    ZLIB_DEF="-DLibisofs_with_zliB"
200
    AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= )
201 202 203 204 205
else
    ZLIB_DEF=
fi
AC_SUBST(ZLIB_DEF)

206 207
dnl ts B00928
AC_ARG_ENABLE(libjte,
208
[  --enable-libjte         Enable use of libjte by xorriso, default=yes],
209 210 211 212 213 214 215 216
               , enable_libjte=yes)
if test "x$enable_libjte" = xyes; then
    LIBJTE_DEF="-DXorriso_with_libjtE"
    AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_new, , LIBJTE_DEF= ), LIBJTE_DEF= )
else
    LIBJTE_DEF=
fi
AC_SUBST(LIBJTE_DEF)
217

218 219 220 221
dnl ts B00107
dnl Just for the case that it is necessary to give link option -lcdio not only
dnl with libburn but also with libburn apps like xorriso.
dnl On SuSE 10.2 this is not needed. libburn finds libcdio on its own.
222 223 224 225 226 227 228 229
case $host_os in
    cygwin*|mingw*)
        default_libcdio=yes
        ;;
    *)
        default_libcdio=no
        ;;
esac
230
AC_ARG_ENABLE(libcdio,
231 232
[  --enable-libcdio        Enable use of libcdio as system adapter, default=no (except on MSWindows)],
               , enable_libcdio=$default_libcdio)
233 234 235 236 237 238 239 240 241
if test x$enable_libcdio = xyes; then
dnl Check whether there is libcdio-devel and libcdio-runtime.
dnl If not, erase this macro
    LIBCDIO_DEF="-DLibburn_use_libcdiO"
dnl The empty yes case obviously causes -lcdio to be linked
    AC_CHECK_HEADER(cdio/cdio.h, AC_CHECK_LIB(cdio, mmc_last_cmd_sense, , LIBCDIO_DEF= ), LIBCDIO_DEF= )
else
    LIBCDIO_DEF=
fi
242 243 244 245 246 247 248
if test x$LIBCDIO_DEF = x
then
    if test x$enable_libcdio = xyes
    then
      echo "WARNING: could not enable use of libcdio as system adapter"
    fi
else
249
    echo "enabled  use of libcdio as system adapter"
250
fi
251 252 253
AC_SUBST(LIBCDIO_DEF)


254
AC_ARG_ENABLE(external-filters,
255
[  --enable-external-filters       Enable use of external filter programs by xorriso, default=yes],
256 257 258 259 260 261 262 263 264 265 266
               , enable_external_filters=yes)
if test x"$enable_external_filters" = xyes; then
    EXTF_DEF="-DXorriso_allow_external_filterS"
    echo "enabled  xorriso external filter programs"
else
    EXTF_DEF=
    echo "disabled xorriso external filter programs"
fi
AC_SUBST(EXTF_DEF)

AC_ARG_ENABLE(external-filters-setuid,
267
[  --enable-external-filters-setuid   Enable xorriso external filter programs under setuid, default=no],
268 269 270 271 272 273 274 275 276 277
               , enable_external_filters_setuid=no)
if test x$enable_external_filters_setuid = xyes; then
    EXTF_SUID_DEF="-DXorriso_allow_extf_suiD"
    echo "enabled  xorriso external filter programs under setuid"
else
    EXTF_SUID_DEF=
    echo "disabled xorriso external filter programs under setuid"
fi
AC_SUBST(EXTF_SUID_DEF)

278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303

AC_ARG_ENABLE(launch-frontend,
[  --enable-launch-frontend        Enable start of piped frontend program by xorriso, default=yes],
               , enable_launch_frontend=yes)
if test x"$enable_launch_frontend" = xyes; then
    LFRONT_DEF="-DXorriso_allow_launch_frontenD"
    echo "enabled  xorriso command -launch_frontend"
else
    LFRONT_DEF=
    echo "disabled xorriso command -launch_frontend"
fi
AC_SUBST(LFRONT_DEF)

AC_ARG_ENABLE(launch-frontend-setuid,
[  --enable-launch-frontend-setuid   Enable start of piped frontend program under setuid, default=no],
               , enable_launch_frontend_setuid=no)
if test x$enable_launch_frontend_setuid = xyes; then
    LFRONT_SUID_DEF="-DXorriso_allow_extf_suiD"
    echo "enabled  xorriso command -launch_frontend under setuid"
else
    LFRONT_SUID_DEF=
    echo "disabled xorriso command -launch_frontend under setuid"
fi
AC_SUBST(LFRONT_SUID_DEF)


304
AC_ARG_ENABLE(dvd-obs-64k,
305
[  --enable-dvd-obs-64k            64 KB default size for xorriso DVD writing, default=no],
306
               , enable_dvd_obs_64=no)
307 308
if test x$enable_dvd_obs_64k = xyes; then
    XORRISO_DVD_OBS_64K="-DXorriso_dvd_obs_default_64K"
309
    echo "enabled  xorriso write size default 64 KB on DVD"
310 311
else
    XORRISO_DVD_OBS_64K=
312
    echo "disabled xorriso write size default 64 KB on DVD"
313 314 315
fi
AC_SUBST(XORRISO_DVD_OBS_64K)

316 317 318 319 320
# Library versioning normally serves a complex purpose.
# Since libisoburn obeys strict ABI backward compatibility, it needs only the
# simple feature to declare function names "global:" or "local:". Only the
# global ones are visible to applications at library load time.
AC_ARG_ENABLE(versioned-libs,
321
[  --enable-versioned-libs         Enable strict symbol encapsulation , default=yes],
322 323
               , enable_versioned_libs=yes)
if test x$enable_versioned_libs = xyes; then
324 325 326 327 328 329 330 331
    vers_libs_test=no
    LIBISOBURN_ASSERT_VERS_LIBS
    if test x$vers_libs_test = xno
    then
        echo "disabled strict symbol encapsulation (test failed)"
    else
        echo "enabled  strict symbol encapsulation"
    fi
332 333 334
else
    echo "disabled strict symbol encapsulation"
fi
335

336 337 338 339 340 341
AC_ARG_ENABLE(ldconfig-at-install,
[  --enable-ldconfig-at-install    On GNU/Linux run ldconfig, default=yes],
               , ldconfig_at_install=yes)
if test x$ldconfig_at_install = xyes; then
    dummy=dummy
else
342
    LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'"
343 344 345 346 347
    echo "disabled run of ldconfig during installation on GNU/Linux"
fi
AC_SUBST(LIBBURNIA_LDCONFIG_CMD)


348 349 350 351 352 353 354 355 356 357 358 359 360 361
AC_CHECK_HEADER(libburn/libburn.h, LIBBURNIA_HAVE_LIBBURN=1, LIBBURNIA_HAVE_LIBBURN=0)
AC_CHECK_HEADER(libisofs/libisofs.h, LIBBURNIA_HAVE_LIBISOFS=1, LIBBURNIA_HAVE_LIBISOFS=0)
if test x$LIBBURNIA_HAVE_LIBBURN = x0; then
    echo "FATAL: Lacking libburn development header file <libburn/libburn.h>" 2>&1
    echo "HINT: You first have to install libburn before you can build libisoburn" 2>&1
fi
if test x$LIBBURNIA_HAVE_LIBISOFS = x0; then
    echo "FATAL: Lacking libisofs development header file <libisofs/libisofs.h>" 2>&1
    echo "HINT: You first have to install libisofs before you can build libisoburn" 2>&1
fi
if test x$LIBBURNIA_HAVE_LIBBURN = x0 -o x$LIBBURNIA_HAVE_LIBISOFS = x0; then
    echo "ABORT: Lacking mandatory prerequisites" 2>&1
    exit 1
fi
362 363 364

# ------- Visible mark in configure : Start of library check

365 366 367 368 369 370 371
# Check for proper library versions if this is desired.
# (It fails too often on too many systems.)
AC_ARG_ENABLE(pkg-check-modules,
[  --enable-pkg-check-modules      Enable pkg-config check for libburn and libisofs , default=no],
               , enable_pkg_check_modules=no)
if test x$enable_pkg_check_modules = xyes; then

372
dnl If PKG_CHECK_MODULES is to be used after this if-block,
373 374
dnl then it might be necessary to perform PKG_PROG_PKG_CONFIG before the block.

375
  LIBBURN_REQUIRED=1.3.5
376
  LIBISOFS_REQUIRED=1.3.6
377 378
  PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED)
  PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED)
379 380 381 382 383 384
  if test x$LIBCDIO_DEF = x; then
    dummy=dummy
  else
    LIBCDIO_REQUIRED=0.83
    PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED)
  fi
385 386 387
else
  echo "checking for LIBBURN... skipped, no --enable-pkg-check-modules"
  echo "checking for LIBISOFS... skipped, no --enable-pkg-check-modules"
388 389 390 391 392
  if test x$LIBCDIO_DEF = x; then
    dummy=dummy
  else
    echo "checking for LIBCDIO... skipped, no --enable-pkg-check-modules"
  fi
393
fi
394

395 396
# ------- Visible mark in configure : End of library check

397 398 399 400 401 402 403 404
dnl Add compiler-specific flags

dnl See if the user wants aggressive optimizations of the code
AC_ARG_ENABLE(debug,
[  --enable-debug          Disable aggressive optimizations [default=yes]],
              , enable_debug=yes)
if test x$enable_debug != xyes; then
    if test x$GCC = xyes; then
405 406
        CFLAGS="-O3 $CFLAGS"
        CFLAGS="-fexpensive-optimizations $CFLAGS"
407
    fi
408
    CFLAGS="-DNDEBUG $CFLAGS"
409 410
else
    if test x$GCC = xyes; then
411
        CFLAGS="-g -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-char-subscripts $CFLAGS"
412
    fi
413
    CFLAGS="-DDEBUG $CFLAGS"
414 415
fi

416
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"
417

418 419 420 421
AC_CONFIG_FILES([
	Makefile
	doc/doxygen.conf
	version.h
422
	libisoburn-1.pc
423 424
	])
AC_OUTPUT