1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 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 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
|
AC_INIT([libopenmpt], [0.8.3+release.autotools], [https://bugs.openmpt.org/], [libopenmpt], [https://lib.openmpt.org/])
AC_PREREQ([2.69])
# we do want 2.70, but distributions are not ready yet
#AC_PREREQ([2.70])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_FILES([Makefile libopenmpt/libopenmpt.pc Doxyfile])
AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign subdir-objects])
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_AR
LT_INIT
AC_SYS_LARGEFILE
PKG_PROG_PKG_CONFIG([0.24])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_INSTALL
# We need C++17 support.
AX_CXX_COMPILE_STDCXX([23], [noext], [optional])
AS_IF([test "x$HAVE_CXX23" != "x1"],
[
AX_CXX_COMPILE_STDCXX([20], [noext], [optional])
AS_IF([test "x$HAVE_CXX20" != "x1"],
[
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
],[]
)
],[]
)
GLOBAL_CPPFLAGS=
GLOBAL_CFLAGS=
GLOBAL_CXXFLAGS=
AC_LANG_PUSH([C])
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [GLOBAL_CFLAGS="$GLOBAL_CFLAGS -fvisibility=hidden"])
AX_CFLAGS_WARN_ALL
AC_LANG_POP([C])
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [GLOBAL_CXXFLAGS="$GLOBAL_CXXFLAGS -fvisibility=hidden"])
AX_CXXFLAGS_WARN_ALL
AC_LANG_POP([C++])
AX_CXX_EXCEPTIONS
AX_CXX_RTTI
AX_PTHREAD([
LIBS="$PTHREAD_LIBS $LIBS"
GLOBAL_CFLAGS="$GLOBAL_CFLAGS $PTHREAD_CFLAGS"
GLOBAL_CXXFLAGS="$GLOBAL_CXXFLAGS $PTHREAD_CFLAGS"
#CC="$PTHREAD_CC"
#CXX="$PTHREAD_CXX"
],
[]
)
# work-around <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115049>
# This is somewhat pessimistic, but necessary for GCC 8 or earlier,
# which we still support and where we cannot use #pragma GCC optimize.
AC_LANG_PUSH([C])
AX_CHECK_COMPILE_FLAG([-fno-ipa-ra], [GLOBAL_CFLAGS="$GLOBAL_CFLAGS -fno-ipa-ra"])
AX_CFLAGS_WARN_ALL
AC_LANG_POP([C])
AC_LANG_PUSH([C++])
AX_CHECK_COMPILE_FLAG([-fno-ipa-ra], [GLOBAL_CXXFLAGS="$GLOBAL_CXXFLAGS -fno-ipa-ra"])
AX_CXXFLAGS_WARN_ALL
AC_LANG_POP([C++])
AC_SUBST([GLOBAL_CPPFLAGS])
AC_SUBST([GLOBAL_CFLAGS])
AC_SUBST([GLOBAL_CXXFLAGS])
LIBOPENMPT_LTVER_CURRENT=5
LIBOPENMPT_LTVER_REVISION=5
LIBOPENMPT_LTVER_AGE=5
AC_SUBST([LIBOPENMPT_LTVER_CURRENT])
AC_SUBST([LIBOPENMPT_LTVER_REVISION])
AC_SUBST([LIBOPENMPT_LTVER_AGE])
AC_DEFINE([MPT_SVNURL], ["https://source.openmpt.org/svn/openmpt/tags/libopenmpt-0.8.3"], [svn version])
AC_DEFINE([MPT_SVNVERSION], ["24141"], [svn version])
AC_DEFINE([MPT_SVNDATE], ["2025-09-06T13:42:08.986313Z"], [svn date])
AC_DEFINE([MPT_PACKAGE], [true], [is package])
AC_ARG_VAR(CXXSTDLIB_PCLIBSPRIVATE, [C++ standard library (or libraries) required for static linking. This will be put in the pkg-config file libopenmpt.pc Libs.private field and used for nothing else.])
AC_CANONICAL_HOST
# work-around NetBSD toolchain not understanding transitive shared object dependencies at all
AS_CASE([$host_os],
[netbsd*], [LIBS="$LIBS -lstdc++"],
[]
)
AS_CASE([$host_os],
[mingw32*],[
LIBOPENMPT_WIN32_LIBS=
LIBOPENMPT_LIBS_PRIVATE_WIN32=
LIBOPENMPTTEST_WIN32_LIBS="-lole32 -lrpcrt4"
OPENMPT123_WIN32_LIBS=-lwinmm
WIN32_CPPFLAGS="-D_UNICODE -DNOMINMAX"
WIN32_CXXFLAGS="-municode -mthreads"
WIN32_CFLAGS="-municode -mthreads"
WIN32_CONSOLE_CXXFLAGS=-mconsole
WIN32_CONSOLE_CFLAGS=-mconsole
],
[
LIBOPENMPT_WIN32_LIBS=
LIBOPENMPT_LIBS_PRIVATE_WIN32=
LIBOPENMPTTEST_WIN32_LIBS=
OPENMPT123_WIN32_LIBS=
WIN32_CPPFLAGS=
WIN32_CXXFLAGS=
WIN32_CFLAGS=
WIN32_CONSOLE_CXXFLAGS=
WIN32_CONSOLE_CFLAGS=
]
)
AC_SUBST([LIBOPENMPT_WIN32_LIBS])
AC_SUBST([LIBOPENMPTTEST_WIN32_LIBS])
AC_SUBST([OPENMPT123_WIN32_LIBS])
AC_SUBST([WIN32_CPPFLAGS])
AC_SUBST([WIN32_CXXFLAGS])
AC_SUBST([WIN32_CFLAGS])
AC_SUBST([WIN32_CONSOLE_CXXFLAGS])
AC_SUBST([WIN32_CONSOLE_CFLAGS])
LIBOPENMPT_REQUIRES_PRIVATE=
LIBOPENMPT_LIBS_PRIVATE=
# Required libopenmpt dependency: zlib
ZLIB_PKG=
AC_ARG_WITH([zlib], AS_HELP_STRING([--without-zlib], [Disable use of zlib.]))
AS_IF([test "x$with_zlib" != "xno"],
[
PKG_CHECK_MODULES([ZLIB], [zlib],
[
ZLIB_PKG=zlib
ZLIB_CFLAGS="-DMPT_WITH_ZLIB $ZLIB_CFLAGS"
], [AC_MSG_ERROR([Unable to find zlib.])])
]
)
# Required libopenmpt dependency: mpg123
MPG123_PKG=
AC_ARG_WITH([mpg123], AS_HELP_STRING([--without-mpg123], [Disable use of libmpg123.]))
AS_IF([test "x$with_mpg123" != "xno"],
[
PKG_CHECK_MODULES([MPG123], [libmpg123 >= 1.14.0],
[
MPG123_PKG=libmpg123
MPG123_CFLAGS="-DMPT_WITH_MPG123 $MPG123_CFLAGS"
], [AC_MSG_ERROR([Unable to find libmpg123.])])
]
)
# Required libopenmpt dependency: ogg
OGG_PKG=
AC_ARG_WITH([ogg], AS_HELP_STRING([--without-ogg], [Disable use of libogg.]))
AS_IF([test "x$with_ogg" != "xno"],
[
PKG_CHECK_MODULES([OGG], [ogg],
[
OGG_PKG=ogg
OGG_CFLAGS="-DMPT_WITH_OGG $OGG_CFLAGS"
], [AC_MSG_ERROR([Unable to find libogg.])])
]
)
# Required libopenmpt dependency: vorbis
VORBIS_PKG=
AC_ARG_WITH([vorbis], AS_HELP_STRING([--without-vorbis], [Disable use of libvorbis.]))
AS_IF([test "x$with_vorbis" != "xno"],
[
PKG_CHECK_MODULES([VORBIS], [vorbis],
[
VORBIS_PKG=vorbis
VORBIS_CFLAGS="-DMPT_WITH_VORBIS $VORBIS_CFLAGS"
], [AC_MSG_ERROR([Unable to find libvorbis.])])
]
)
# Required libopenmpt dependency: vorbisfile
VORBISFILE_PKG=
AC_ARG_WITH([vorbisfile], AS_HELP_STRING([--without-vorbisfile], [Disable use of libvorbisfile.]))
AS_IF([test "x$with_vorbisfile" != "xno"],
[
PKG_CHECK_MODULES([VORBISFILE], [vorbisfile],
[
VORBISFILE_PKG=vorbisfile
VORBISFILE_CFLAGS="-DMPT_WITH_VORBISFILE $VORBISFILE_CFLAGS"
], [AC_MSG_ERROR([Unable to find libvorbisfile.])])
]
)
LIBOPENMPT_REQUIRES_PRIVATE="$ZLIB_PKG $MPG123_PKG $OGG_PKG $VORBIS_PKG $VORBISFILE_PKG"
LIBOPENMPT_LIBS_PRIVATE="$CXXSTDLIB_PCLIBSPRIVATE $LIBOPENMPT_LIBS_PRIVATE_WIN32"
AC_SUBST([LIBOPENMPT_REQUIRES_PRIVATE])
AC_SUBST([LIBOPENMPT_LIBS_PRIVATE])
# openmpt123
AC_ARG_ENABLE([openmpt123], AS_HELP_STRING([--disable-openmpt123], [Disable the openmpt123 command line player.]))
AM_CONDITIONAL([ENABLE_OPENMPT123], [test "x$enable_openmpt123" != "xno"])
# examples
AC_ARG_ENABLE([examples], AS_HELP_STRING([--disable-examples], [Disable the example programs.]))
AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" != "xno"])
# tests
AC_ARG_ENABLE([tests], AS_HELP_STRING([--disable-tests], [Disable the test suite.]))
AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" != "xno"])
# Optional openmpt123 dependency
AC_ARG_WITH([pulseaudio], AS_HELP_STRING([--with-pulseaudio], [Enable use of libpulse and libpulse-simple (enabled by default on Linux).]))
AS_IF([test "x$enable_openmpt123" != "xno"],[
AS_CASE([$host_os],
[linux*],[
AS_IF([test "x$with_pulseaudio" != "xno"],
[
PKG_CHECK_MODULES([PULSEAUDIO], [libpulse libpulse-simple],
[
have_pulseaudio=1
PULSEAUDIO_CFLAGS="-DMPT_WITH_PULSEAUDIO $PULSEAUDIO_CFLAGS"
],
[
have_pulseaudio=0
AC_MSG_ERROR([Unable to find libpulse and/or libpulse-simple.])
]
)
],
[
have_pulseaudio=0
]
)
;;
*)
AS_IF([test "x$with_pulseaudio" = "xyes"],
[
PKG_CHECK_MODULES([PULSEAUDIO], [libpulse libpulse-simple],
[
have_pulseaudio=1
PULSEAUDIO_CFLAGS="-DMPT_WITH_PULSEAUDIO $PULSEAUDIO_CFLAGS"
],
[
have_pulseaudio=0
AC_MSG_ERROR([Unable to find libpulse and/or libpulse-simple.])
]
)
],
[
have_pulseaudio=0
]
)
],
[]
)
],[have_pulseaudio=0])
# Optional openmpt123 and examples dependency
AC_ARG_WITH([portaudio], AS_HELP_STRING([--without-portaudio], [Disable use of libportaudio.]))
AS_IF([test "x$enable_openmpt123$enable_examples" != "xnono"],[
AS_IF([test "x$with_portaudio" != "xno"],
[
PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0],
[
have_portaudio=1
PORTAUDIO_CFLAGS="-DMPT_WITH_PORTAUDIO $PORTAUDIO_CFLAGS"
],
[
have_portaudio=0
AC_MSG_ERROR([Unable to find libportaudio.])
]
)
],
[
have_portaudio=0
]
)
],[have_portaudio=0])
AM_CONDITIONAL([HAVE_PORTAUDIO], [test x$have_portaudio = x1])
# Optional examples dependency: PortAudio C++
AC_ARG_WITH([portaudiocpp], AS_HELP_STRING([--without-portaudiocpp], [Disable use of libportaudiocpp.]))
AS_IF([test "x$enable_examples" != "xno"],[
AS_IF([test "x$with_portaudiocpp" != "xno"],
[
PKG_CHECK_MODULES([PORTAUDIOCPP], [portaudiocpp],
[
have_portaudiocpp=1
PORTAUDIOCPP_CFLAGS="-DMPT_WITH_PORTAUDIOCPP $PORTAUDIOCPP_CFLAGS"
],
[
have_portaudiocpp=0
AC_MSG_ERROR([Unable to find libportaudiocpp.])
]
)
],
[
have_portaudiocpp=0
]
)
],[have_portaudiocpp=0])
AM_CONDITIONAL([HAVE_PORTAUDIOCPP], [test x$have_portaudiocpp = x1])
# Optional disabled openmpt123 dependency: libsdl2
AC_ARG_WITH([sdl2], AS_HELP_STRING([--with-sdl2], [Enable use of libsdl2.]))
AS_IF([test "x$enable_openmpt123" != "xno"],[
AS_IF([test "x$with_sdl2" = "xyes"],
[
PKG_CHECK_MODULES([SDL2], [sdl2 >= 2.0.4], [SDL2_CFLAGS="-DMPT_WITH_SDL2 $SDL2_CFLAGS"], [AC_MSG_ERROR([Unable to find libsdl2.])])
]
)
])
# Optional openmpt123 dependency: libsndfile
AC_ARG_WITH([sndfile], AS_HELP_STRING([--without-sndfile], [Disable use of libsndfile.]))
AS_IF([test "x$enable_openmpt123" != "xno"],[
AS_IF([test "x$with_sndfile" != "xno"],
[
PKG_CHECK_MODULES([SNDFILE], [sndfile], [SNDFILE_CFLAGS="-DMPT_WITH_SNDFILE $SNDFILE_CFLAGS"], [AC_MSG_ERROR([Unable to find libsndfile.])])
]
)
])
# Optional openmpt123 dependency: libFLAC
AC_ARG_WITH([flac], AS_HELP_STRING([--without-flac], [Disable use of libflac.]))
AS_IF([test "x$enable_openmpt123" != "xno"],[
AS_IF([test "x$with_flac" != "xno"],
[
PKG_CHECK_MODULES([FLAC], [flac >= 1.3.0], [FLAC_CFLAGS="-DMPT_WITH_FLAC $FLAC_CFLAGS"], [AC_MSG_ERROR([Unable to find libflac >= 1.3.0.])])
]
)
])
DX_DOXYGEN_FEATURE(ON)
DX_DOT_FEATURE(OFF)
DX_HTML_FEATURE(ON)
DX_MAN_FEATURE(OFF)
DX_CHM_FEATURE(OFF)
DX_CHI_FEATURE(OFF)
DX_RTF_FEATURE(OFF)
DX_XML_FEATURE(OFF)
DX_PDF_FEATURE(OFF)
DX_PS_FEATURE(OFF)
DX_INIT_DOXYGEN([libopenmpt], [Doxyfile], [doxygen-doc])
AC_OUTPUT
|