configure.ac 10.3 KB
Newer Older
1
AC_INIT([libburn], [1.0.2], [http://libburnia-project.org])
Mario Danic's avatar
Mario Danic committed
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

Mario Danic's avatar
Mario Danic committed
10 11
AM_INIT_AUTOMAKE([subdir-objects])

12
dnl Notes by ts A71207 - B10116 :
Mario Danic's avatar
Mario Danic committed
13
dnl
14 15
dnl Regrettably the meaning of the various version types was misunderstood
dnl before version 0.4.1.
16
dnl
17 18 19 20
dnl In the past MAJOR.MINOR.MICRO versions led to the following SONAME numbers:
dnl    0.2.2 = 2 , 0.2.3 = 3 , 0.2.6 = 6
dnl    0.3.0 = 0 , 0.3.2 = 2 , 0.3.4 = 4 . 0.3.6 = 6 , 0.3.8 = 4
dnl    0.4.0 = 0 (also released as SONAME 4)
21
dnl
22
dnl Meanwhile the following schemes are maintained in parallel:
23
dnl
24 25 26 27 28 29
dnl BURN_MAJOR_VERSION , BURN_MINOR_VERSION , BURN_MICRO_VERSION 
dnl    are three small non-negative integers which describe the evolution
dnl    steps of the library.
dnl    Older applications are able to use younger libraries over
dnl    quite a long range of such steps. Some day, nevertheless,
dnl    compatibility might get terminated, after due notice.
30
dnl
31 32 33 34 35 36 37
dnl SONAME (libburn.so.4)
dnl    is a small positive integer which marks a family of compatible
dnl    evolution steps. Libraries with a particular SONAME allow a binary
dnl    with the same SONAME to start up. Any further compatibility check is to
dnl    be done by own runtime means. Especially  *_version() calls in the API
dnl    which return BURN_MAJOR_VERSION, BURN_MINOR_VERSION, BURN_MICRO_VERSION.
dnl    See below.
38
dnl
39 40 41 42 43 44 45
dnl CURRENT, AGE, REVISION
dnl    are three integers used by libtool. CURRENT is positive, the others
dnl    non-negative. The use at runtime is not known yet. But libtool computes
dnl    at build time  SONAME = CURRENT - AGE.
dnl    So this is a superspace of the SONAME version space. To avoid
dnl    ill SONAME, the value of  CURRENT must be larger than AGE.
dnl    See also http://www.gnu.org/software/libtool/manual.html#Interfaces
46
dnl
47 48
dnl On Linux the name of the dynamic library will be
dnl    libburn.so.$SONAME.$AGE.$REV
49 50 51 52
dnl In the terminology of this file:
dnl    CURRENT = LT_CURRENT
dnl    AGE     = LT_AGE
dnl    REVISION= LT_REVISION
53
dnl
54 55 56 57 58 59 60 61
dnl Beginning with libburn-0.4.1 a rectified counting was introduced as
dnl    CURRENT=10, REVISION=1, AGE=6
dnl This rectification declared that version to be binary compatible up
dnl from libburn-0.3.4.
dnl Real compatibility was given since libburn-0.3.2.
dnl Beware of libburn-0.2.6 which had SONAME=6 and is not binary compatible.
dnl Applications for libburn-0.2 to libburn-0.3.1 need recompilation but no
dnl source code changes.
62
dnl
63 64
dnl Neatly versioned stable releases meanwhile:
dnl    0.4.2 = libburn.so.4.7.0
65
dnl    0.4.4 = libburn.so.4.9.0
66
dnl    0.4.6 = libburn.so.4.11.0
67
dnl    0.4.8 = libburn.so.4.13.0
68
dnl    0.5.0 = libburn.so.4.15.0
69
dnl    0.5.2 = libburn.so.4.17.0
70
dnl    0.5.4 = libburn.so.4.19.0
71
dnl    0.5.6 = libburn.so.4.21.0
Thomas Schmitt's avatar
Thomas Schmitt committed
72
dnl    0.5.8 = libburn.so.4.23.0
73
dnl    0.6.0 = libburn.so.4.25.0
74
dnl    0.6.2 = libburn.so.4.27.0
75
dnl    0.6.4 = libburn.so.4.29.0
76
dnl    0.6.6 = libburn.so.4.31.0
77
dnl    0.6.8 = libburn.so.4.33.0
78
dnl    0.7.0 = libburn.so.4.35.0
79
dnl    0.7.2 = libburn.so.4.37.0
80
dnl    0.7.4 = libburn.so.4.39.0
81
dnl    0.7.6 = libburn.so.4.41.0
82
dnl    0.7.8 = libburn.so.4.43.0
83
dnl    0.8.0 = libburn.so.4.45.0
84
dnl    0.8.2 = libburn.so.4.47.0
85
dnl    0.8.4 = libburn.so.4.49.0
86
dnl    0.8.6 = libburn.so.4.51.0
87
dnl    0.8.8 = libburn.so.4.53.0
88
dnl    0.9.0 = libburn.so.4.55.0
89
dnl    1.0.0 = libburn.so.4.57.0
90
dnl    1.0.2 = libburn.so.4.59.0
91 92
dnl
dnl So LT_CURRENT, LT_REVISION and LT_AGE get set directly here.
93 94
dnl SONAME of the emerging library is  LT_CURRENT - LT_AGE.
dnl The linker will do no finer checks. Especially no age range check for
95
dnl the application binary. If SONAME matches, then the couple starts.
96
dnl 
97
dnl Therefore at run time info is provided by libburn function burn_version().
98
dnl It returns the major, minor and micro revision of the library.
99 100
dnl Before using any API feature, a program should check for age.
dnl
101 102 103 104
dnl The variables BURN_*_VERSION are mere copies for informing libtool.
dnl The true values which get issued and should be compared are macros
dnl defined in libburn/libburn.h .
dnl
105 106 107
dnl Normally one can allow a program to run with a library which passed the
dnl linker SONAME test and which is not older than the library it was
dnl developed for. Library2 is younger than library1 if:
108 109
dnl   major2>major1 || (major2==major1 &&
dnl                     (minor2>minor1 || (minor2==minor1 && micro2 > micro1)))
110 111
dnl
dnl If BURN_*_VERSION changes, be sure to change AC_INIT above to match.
Mario Danic's avatar
Mario Danic committed
112
dnl
113
dnl As said: Only copies. Original in libburn/libburn.h : burn_header_version_*
114 115
BURN_MAJOR_VERSION=1
BURN_MINOR_VERSION=0
116
BURN_MICRO_VERSION=2
117
BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
Mario Danic's avatar
Mario Danic committed
118 119 120

AC_SUBST(BURN_MAJOR_VERSION)
AC_SUBST(BURN_MINOR_VERSION)
121
AC_SUBST(BURN_MICRO_VERSION)
Mario Danic's avatar
Mario Danic committed
122 123 124
AC_SUBST(BURN_VERSION)

dnl Libtool versioning
125
LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
126
dnl
127
dnl This is the release version libburn-1.0.2
128
dnl ### This is the development version after above release version
129 130
dnl LT_CURRENT++, LT_AGE++ has not yet happened.
dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile.
131
dnl
132 133 134
dnl SONAME = 63 - 59 = 4 . Linux library name = libburn.so.4.59.0
LT_CURRENT=63
LT_AGE=59
135
LT_REVISION=0
Mario Danic's avatar
Mario Danic committed
136 137 138 139 140 141 142 143
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)

144
dnl ts A71207: This is done only not to break any old components
145 146 147 148 149
BURN_INTERFACE_AGE=$LT_REVISION
BURN_BINARY_AGE=`expr $LT_AGE + $BURN_INTERFACE_AGE`
AC_SUBST(BURN_INTERFACE_AGE)
AC_SUBST(BURN_BINARY_AGE)

Mario Danic's avatar
Mario Danic committed
150 151 152 153 154 155 156 157 158 159 160 161 162
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
163
AC_CHECK_FUNC([fseeko])
Mario Danic's avatar
Mario Danic committed
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
if test ! $ac_cv_func_fseeko; then
   AC_ERROR([Libburn requires largefile support.])
fi

AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
LIBTOOL="$LIBTOOL --silent"

AC_PROG_INSTALL

AC_CHECK_HEADERS()

THREAD_LIBS=-lpthread
AC_SUBST(THREAD_LIBS)

TARGET_SHIZZLE
180
AC_SUBST(ARCH)
181
AC_SUBST(LIBBURNIA_PKGCONFDIR)
182
AC_SUBST(LIBBURN_ARCH_LIBS)
Mario Danic's avatar
Mario Danic committed
183

184 185 186 187 188 189 190 191
dnl ts A90303
dnl Check the preconditions for using statvfs() in sg-dummy
dnl (sg-linux and sg-freebsd use statvfs() unconditionally)
STATVFS_DEF=-DLibburn_os_has_statvfS
AC_CHECK_HEADER(sys/statvfs.h, X=, STATVFS_DEF=)
AC_CHECK_FUNC([statvfs], X=, STATVFS_DEF=)
dnl If this would be done more specifically in Makefile.am
dnl via libburn_libburn_la_CFLAGS then undesired .o file names would emerge
192
CFLAGS="$STATVFS_DEF $CFLAGS"
193

194 195
dnl ts A91122
AC_ARG_ENABLE(track-src-odirect,
196
[  --enable-track-src-odirect Enable use of O_DIRECT with track input, default=no],
197 198 199 200
               , enable_track_src_odirect=no)
if test x$enable_track_src_odirect = xyes; then
    LIBBURN_O_DIRECT_DEF="-DLibburn_read_o_direcT"
    echo "enabled  use of O_DIRECT with track input"
201
else
202 203
    LIBBURN_O_DIRECT_DEF=
    echo "disabled use of O_DIRECT with track input"
204
fi
205 206
dnl Avoid the need for libburn_libburn_la_CFLAGS in Makefile.am (ugly .o names)
dnl ### AC_SUBST(LIBBURN_O_DIRECT_DEF)
207
CFLAGS="$LIBBURN_O_DIRECT_DEF $CFLAGS"
208

209
dnl ts A91116
210
AC_ARG_ENABLE(dvd-obs-64k,
211
[  --enable-dvd-obs-64k    64 KB default size for DVD/BD writing, default=no],
212
               , enable_dvd_obs_64k=no)
213 214 215 216 217 218 219
if test x$enable_dvd_obs_64k = xyes; then
    LIBBURN_DVD_OBS_64K="-DLibburn_dvd_obs_default_64K"
    echo "enabled  write size default 64 KB on DVD and BD"
else
    LIBBURN_DVD_OBS_64K=
    echo "disabled write size default 64 KB on DVD and BD"
fi
220
CFLAGS="$LIBBURN_DVD_OBS_64K $CFLAGS"
221

222 223
dnl ts A91218
AC_ARG_ENABLE(libcdio,
224
[  --enable-libcdio        Enable EXPERIMENTAL use of libcdio as system adapter, default=no],
225 226 227 228 229
               , enable_libcdio=no)
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" 
230
dnl The empty yes case obviously causes -lcdio to be linked
231
    AC_CHECK_HEADER(cdio/cdio.h, AC_CHECK_LIB(cdio, mmc_last_cmd_sense, , LIBCDIO_DEF= ), LIBCDIO_DEF= )
232 233 234 235 236
else
    LIBCDIO_DEF=
fi
if test x$LIBCDIO_DEF = x
then
237 238 239 240
    if test x$enable_libcdio = xyes
    then
      echo "WARNING: could not enable use of libcdio as system adapter"
    fi
241 242
else
    echo "enabled  EXPERIMENTAL use of libcdio as system adapter"
243
    CFLAGS="$LIBCDIO_DEF $CFLAGS"
244

245
    LIBCDIO_REQUIRED=0.83
246 247 248
    PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED)

fi
249

250 251 252 253 254 255 256 257 258
dnl ts B00704
# Library versioning normally serves a complex purpose.
# Since libburn 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,
[  --enable-versioned-libs Enable strict symbol encapsulation , default=yes],
               , enable_versioned_libs=yes)
if test x$enable_versioned_libs = xyes; then
259 260 261 262 263 264 265 266
    vers_libs_test=no
    LIBBURN_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
267 268 269 270
else
    echo "disabled strict symbol encapsulation"
fi

271 272 273 274 275 276 277 278 279 280 281
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
    LIBBURNIA_LDCONFIG_CMD="echo 'NOTE: ldconfig is disabled. If needed, configure manually for:'"
    echo "disabled run of ldconfig during installation on GNU/Linux"
fi  
AC_SUBST(LIBBURNIA_LDCONFIG_CMD)

282

283 284 285 286 287 288 289 290
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
291 292
        CFLAGS="-O3 $CFLAGS"
        CFLAGS="-fexpensive-optimizations $CFLAGS"
293
    fi
294
    CFLAGS="-DNDEBUG $CFLAGS"
295 296
else
    if test x$GCC = xyes; then
297
        CFLAGS="-g -pedantic -Wall $CFLAGS"
298
    fi
299
    CFLAGS="-DDEBUG $CFLAGS"
300
fi
301 302 303 304 305 306 307

dnl Determine target directory for libburn-*.pc
dnl Important: Must be performed _after_ TARGET_SHIZZLE
dnl
LIBBURNIA_SET_PKGCONFIG


Mario Danic's avatar
Mario Danic committed
308 309 310 311
AC_CONFIG_FILES([
	Makefile
	doc/doxygen.conf
	version.h
312
	libburn-1.pc
Mario Danic's avatar
Mario Danic committed
313 314
	])
AC_OUTPUT