From 9bd1dffe3019184165b67a494da90aed673982be Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Sun, 19 May 2024 19:23:04 +0200 Subject: [PATCH 1/3] Add configury script for CMake migration --- configure | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100755 configure diff --git a/configure b/configure new file mode 100755 index 0000000000..51d0bd3f80 --- /dev/null +++ b/configure @@ -0,0 +1,214 @@ +#!/bin/bash + +# configure - helper script to aid CMake migration +# by carstene1ns 2024, released under the MIT license + +set -e +#set -x + +# helper functions + +colorize() { + RESET="\e[0m" + BOLD="\e[1m" + BLUE="${BOLD}\e[34m" + GREEN="${BOLD}\e[32m" + RED="${BOLD}\e[31m" + YELLOW="${BOLD}\e[33m" +} + +message() { + printf "${GREEN}==>${RESET} ${1}\n" +} + +argument() { + printf "${BLUE}${1} ->${RESET} ${2}\n" +} + +argument_simple() { + printf "${BLUE}${1} ->${RESET} For ${2} support use '-D${3}=ON|OFF'\n" +} + +warning() { + printf "${YELLOW}WARNING:${RESET}${BOLD} ${1}${RESET}\n" >&2 +} + +error() { + printf "${RED}ERROR:${RESET}${BOLD} ${1}${RESET}\n" >&2 +} + +# variables +show_dirinfo=0 +show_crossinfo=0 +show_libflaginfo=0 +arguments="" + +# main + +# check for terminal output +test -t 0 && colorize + +warning "After version 0.8.1 autotools support has been removed.\n \ + We migrated to CMake (https://cmake.org) exclusively.\n \ + Please check the docs/BUILDING.md document. Now follows a\n \ + generated help based on provided arguments for pointers\n \ + how to migrate your build settings to cmake invocation.\n" + +while [[ $# -gt 0 ]]; do + case $1 in + # ignore + --help=*|-h|--help|-q|--quiet|--silent) + shift + ;; + + # directories + --*dir=*) + show_dirinfo=1 + shift + ;; + --*dir) + show_dirinfo=1 + shift 2 + ;; + + # crossbuild + --build=*|--host=*) + show_crossinfo=1 + shift + ;; + --build|--host) + show_crossinfo=1 + shift 2 + ;; + + # variables + *_LIBS=*|*_CFLAGS=*) + show_libflaginfo=1 + shift + ;; + + # libraries + --disable-fmmidi*|--enable-fmmidi*) + argument_simple "$1" "FMMidi" "PLAYER_ENABLE_FMMIDI" + shift + ;; + + --disable-drwav*|--enable-drwav*) + argument_simple "$1" "drwav" "PLAYER_ENABLE_DRWAV" + shift + ;; + + --disable-doxygen*|--enable-doxygen*) + argument "$1" "To build doxygen documentation use 'doc' target after generating, e.g. 'make doc'" + shift + ;; + + --with-freetype*|--without-freetype*) + argument_simple "$1" "FreeType" "PLAYER_WITH_FREETYPE" + shift + ;; + + --with-harfbuzz*|--without-harfbuzz*) + argument_simple "$1" "Harfbuzz" "PLAYER_WITH_HARFBUZZ" + shift + ;; + + --with-lhasa*|--without-lhasa*) + argument_simple "$1" "Lhasa" "PLAYER_WITH_LHASA" + shift + ;; + + --with-audio*|--without-audio*) + argument "$1" "To disable audio use '-DPLAYER_AUDIO_BACKEND=OFF'" + shift + ;; + + --with-libmpg123*|--without-libmpg123*) + argument_simple "$1" "mpeg123" "HAVE_LIBMPG123" + shift + ;; + + --with-libwildmidi*|--without-libwildmidi*) + argument_simple "$1" "WildMidi" "PLAYER_WITH_WILDMIDI" + shift + ;; + + --with-fluidsynth*|--without-fluidsynth*) + argument_simple "$1" "Fluidsynth" "PLAYER_WITH_FLUIDSYNTH" + shift + ;; + + --with-fluidlite*|--without-fluidlite*) + argument_simple "$1" "FluidLite" "PLAYER_WITH_FLUIDLITE" + shift + ;; + + --with-alsa*|--without-alsa*) + argument_simple "$1" "Native MIDI" "PLAYER_WITH_NATIVE_MIDI" + shift + ;; + + --with-oggvorbis*|--without-oggvorbis*) + argument_simple "$1" "Ogg Vorbis" "PLAYER_WITH_OGGVORBIS" + shift + ;; + + --with-opus*|--without-opus*) + argument_simple "$1" "Opus" "PLAYER_WITH_OPUS" + shift + ;; + + --with-libsndfile*|--without-libsndfile*) + argument_simple "$1" "Sndfile" "PLAYER_WITH_LIBSNDFILE" + shift + ;; + + --with-libxmp*|--without-libxmp*) + argument_simple "$1" "xmp" "PLAYER_WITH_XMP" + shift + ;; + + --with-libspeexdsp*|--without-libspeexdsp*) + argument_simple "$1" "speexDSP" "PLAYER_WITH_SPEEXDSP" + shift + ;; + + # ignore remaining, notify later + *) + arguments="$arguments $1" + shift + ;; + esac +done + +echo + +# show generic messages +if [ $show_dirinfo -eq 1 ]; then + message "You provided one or more directory options (--somedir=somewhere),\n \ + Changing installation directories is supported, see the following link for reference:\n \ + https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html\n" +fi +if [ $show_crossinfo -eq 1 ]; then + message "For crosscompiling you need a toolchain file, see the following link for reference:\n \ + https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling\n" +fi +if [ $show_libflaginfo -eq 1 ]; then + message "For custom library flags, it might be needed to have a look at the 'Find*.cmake'\n \ + Modules in 'builds/cmake/Modules' directory\n" +fi + +# show other options +if [ -n "$arguments" ]; then + error "The following options are unrecognized:" + for arg in $arguments; do + echo " $arg" + done + echo +fi + +echo "If you need further help, use our bug tracker or contact us:" +echo "https://github.com/EasyRPG/Player/issues - https://easyrpg.org/contact/" + +# exit with error code to make external tools aware of "unsuccessful" build +exit 1 From 292a870612adb6a6161af0909389450b9e2e3a68 Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Sun, 19 May 2024 19:38:36 +0200 Subject: [PATCH 2/3] autotools: remove support --- .gitattributes | 3 - .gitignore | 35 +- CMakeLists.txt | 7 - Makefile.am | 763 ---------------- builds/autoconf/git-version.sh | 52 -- builds/autoconf/m4/ax_build_date_epoch.m4 | 70 -- builds/autoconf/m4/ax_cxx_compile_stdcxx.m4 | 962 -------------------- builds/autoconf/m4/ax_prog_doxygen.m4 | 310 ------- builds/autoconf/m4/ax_pthread.m4 | 522 ----------- builds/autoconf/m4/with_pkg.m4 | 61 -- builds/release-helper.sh | 14 +- configure.ac | 263 ------ docs/BUILDING.md | 35 +- resources/Doxyfile.in | 8 +- src/system.h | 8 - 15 files changed, 11 insertions(+), 3102 deletions(-) delete mode 100644 Makefile.am delete mode 100755 builds/autoconf/git-version.sh delete mode 100644 builds/autoconf/m4/ax_build_date_epoch.m4 delete mode 100644 builds/autoconf/m4/ax_cxx_compile_stdcxx.m4 delete mode 100644 builds/autoconf/m4/ax_prog_doxygen.m4 delete mode 100644 builds/autoconf/m4/ax_pthread.m4 delete mode 100644 builds/autoconf/m4/with_pkg.m4 delete mode 100644 configure.ac diff --git a/.gitattributes b/.gitattributes index cdc1f9d1ad..e4b4a58dcf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,11 +6,8 @@ *.py text *.rb text *.sh text -*.ac text -*.am text tests/doctest.h -diff linguist-vendored -builds/autoconf/m4/ax_*.m4 -diff linguist-vendored src/external/* -diff linguist-vendored src/midiprogram.h -diff linguist-vendored src/midisequencer.* -diff linguist-vendored diff --git a/.gitignore b/.gitignore index 83a7e2b742..bdd6bd88ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -/bin/ -/Makefile /easyrpg-player /Player.app *.a @@ -9,33 +7,8 @@ *.orig *.bak -# autotools -/autom4te.cache/ -/easyrpg-player-*/ -/.libs/ -.deps/ -Makefile.in -aclocal.m4 -config.h -config.h.in -config.status -configure -libtool -/builds/autoconf/aux/ -/builds/autoconf/m4/*.m4 -!/builds/autoconf/m4/ax_*.m4 -!/builds/autoconf/m4/with_pkg.m4 -stamp-h1 -.dirstamp -*.la -*.lo -/output -/utils -/directorytree -/.version-append -/.version-git - # cmake +/Makefile CMakeFiles/ CMakeScripts/ CMakeCache.txt @@ -88,10 +61,10 @@ build/ # test/run artifacts easyrpg_log.txt /*.log -/*.trs Testing/ # distribution archives +/easyrpg-player-*/ easyrpg-player-*.tar.* *.zip @@ -109,10 +82,6 @@ __MACOSX /RelWithDebInfo/ /*.build/ -# legacy -/lib/liblcf/ -.buildconfig - # Android *.iml local.properties diff --git a/CMakeLists.txt b/CMakeLists.txt index a57c27d7d5..7c05aada65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1392,14 +1392,7 @@ find_package(Doxygen) set(DOXYGEN_STATUS "Unavailable") if(DOXYGEN_FOUND) set(DOXYGEN_STATUS "Available (target \"doc\")") - # fake autotools variables - set(PACKAGE_VERSION ${PLAYER_VERSION}) - set(DX_DOCDIR ${CMAKE_CURRENT_BINARY_DIR}/doc) - set(srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file(resources/Doxyfile.in resources/Doxyfile @ONLY) - unset(PACKAGE_VERSION) - unset(DX_DOCDIR) - unset(srcdir) add_custom_target(player_doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/resources/Doxyfile diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index c05af3518a..0000000000 --- a/Makefile.am +++ /dev/null @@ -1,763 +0,0 @@ -ACLOCAL_AMFLAGS = --install -I builds/autoconf/m4 - -EXTRA_DIST = CMakeLists.txt README.md builds docs resources -MOSTLYCLEANFILES = $(DX_CLEANFILES) - -bin_PROGRAMS = easyrpg-player - -noinst_LIBRARIES = libeasyrpg-player.a libplayer-version.a -libeasyrpg_player_a_SOURCES = \ - src/lcf_data.cpp \ - src/lcf/data.h \ - src/async_handler.cpp \ - src/async_handler.h \ - src/async_op.h \ - src/algo.h \ - src/algo.cpp \ - src/attribute.h \ - src/attribute.cpp \ - src/audio.cpp \ - src/audio.h \ - src/audio_decoder.cpp \ - src/audio_decoder.h \ - src/audio_decoder_base.cpp \ - src/audio_decoder_base.h \ - src/audio_decoder_midi.cpp \ - src/audio_decoder_midi.h \ - src/audio_generic.cpp \ - src/audio_generic.h \ - src/audio_generic_midiout.cpp \ - src/audio_generic_midiout.h \ - src/audio_midi.cpp \ - src/audio_midi.h \ - src/audio_resampler.cpp \ - src/audio_resampler.h \ - src/audio_secache.cpp \ - src/audio_secache.h \ - src/autobattle.cpp \ - src/autobattle.h \ - src/background.cpp \ - src/background.h \ - src/baseui.cpp \ - src/baseui.h \ - src/battle_animation.cpp \ - src/battle_animation.h \ - src/battle_message.cpp \ - src/battle_message.h \ - src/bitmap.cpp \ - src/bitmap.h \ - src/bitmapfont.h \ - src/bitmapfont_glyph.h \ - src/bitmap_hslrgb.h \ - src/cache.cpp \ - src/cache.h \ - src/cmdline_parser.cpp \ - src/cmdline_parser.h \ - src/color.h \ - src/compiler.h \ - src/config_param.h \ - src/decoder_fluidsynth.cpp \ - src/decoder_fluidsynth.h \ - src/decoder_fmmidi.cpp \ - src/decoder_fmmidi.h \ - src/decoder_libsndfile.cpp \ - src/decoder_libsndfile.h \ - src/decoder_mpg123.cpp \ - src/decoder_mpg123.h \ - src/decoder_oggvorbis.cpp \ - src/decoder_oggvorbis.h \ - src/decoder_opus.cpp \ - src/decoder_opus.h \ - src/decoder_wildmidi.cpp \ - src/decoder_wildmidi.h \ - src/decoder_xmp.cpp \ - src/decoder_xmp.h \ - src/default_graphics.h \ - src/directory_tree.cpp \ - src/directory_tree.h \ - src/docmain.h \ - src/drawable.cpp \ - src/drawable.h \ - src/drawable_list.cpp \ - src/drawable_list.h \ - src/drawable_mgr.cpp \ - src/drawable_mgr.h \ - src/dynrpg.cpp \ - src/dynrpg.h \ - src/dynrpg_easyrpg.cpp \ - src/dynrpg_easyrpg.h \ - src/dynrpg_textplugin.h \ - src/dynrpg_textplugin.cpp \ - src/enemyai.cpp \ - src/enemyai.h \ - src/exe_reader.cpp \ - src/exe_reader.h \ - src/exfont.h \ - src/feature.cpp \ - src/feature.h \ - src/filefinder.cpp \ - src/filefinder.h \ - src/filefinder_rtp.cpp \ - src/filefinder_rtp.h \ - src/fileext_guesser.cpp \ - src/fileext_guesser.h \ - src/filesystem.cpp \ - src/filesystem.h \ - src/filesystem_lzh.cpp \ - src/filesystem_lzh.h \ - src/filesystem_native.cpp \ - src/filesystem_native.h \ - src/filesystem_root.cpp \ - src/filesystem_root.h \ - src/filesystem_stream.cpp \ - src/filesystem_stream.h \ - src/filesystem_zip.cpp \ - src/filesystem_zip.h \ - src/flash.h \ - src/flat_map.h \ - src/font.cpp \ - src/font.h \ - src/fps_overlay.cpp \ - src/fps_overlay.h \ - src/frame.cpp \ - src/frame.h \ - src/game_actor.cpp \ - src/game_actor.h \ - src/game_actors.cpp \ - src/game_actors.h \ - src/game_battle.cpp \ - src/game_battle.h \ - src/game_battlealgorithm.cpp \ - src/game_battlealgorithm.h \ - src/game_battler.cpp \ - src/game_battler.h \ - src/game_character.cpp \ - src/game_character.h \ - src/game_clock.cpp \ - src/game_clock.h \ - src/game_commonevent.cpp \ - src/game_commonevent.h \ - src/game_config.cpp \ - src/game_config.h \ - src/game_config_game.cpp \ - src/game_config_game.h \ - src/game_enemy.cpp \ - src/game_enemy.h \ - src/game_enemyparty.cpp \ - src/game_enemyparty.h \ - src/game_event.cpp \ - src/game_event.h \ - src/game_ineluki.cpp \ - src/game_ineluki.h \ - src/game_interpreter.cpp \ - src/game_interpreter.h \ - src/game_interpreter_battle.cpp \ - src/game_interpreter_battle.h \ - src/game_interpreter_control_variables.cpp \ - src/game_interpreter_control_variables.h \ - src/game_interpreter_map.cpp \ - src/game_interpreter_map.h \ - src/game_map.cpp \ - src/game_map.h \ - src/game_message.cpp \ - src/game_message.h \ - src/game_party.cpp \ - src/game_party.h \ - src/game_party_base.cpp \ - src/game_party_base.h \ - src/game_pictures.cpp \ - src/game_pictures.h \ - src/game_player.cpp \ - src/game_player.h \ - src/game_screen.cpp \ - src/game_screen.h \ - src/game_strings.cpp \ - src/game_strings.h \ - src/game_switches.cpp \ - src/game_switches.h \ - src/game_system.cpp \ - src/game_system.h \ - src/game_targets.cpp \ - src/game_targets.h \ - src/game_variables.cpp \ - src/game_variables.h \ - src/game_vehicle.cpp \ - src/game_vehicle.h \ - src/game_windows.cpp \ - src/game_windows.h \ - src/generated/bitmapfont_rmg2000.h \ - src/generated/bitmapfont_ttyp0.h \ - src/generated/bitmapfont_wqy.h \ - src/generated/logo.h \ - src/generated/logo2.h \ - src/generated/shinonome_gothic.h \ - src/generated/shinonome_mincho.h \ - src/graphics.cpp \ - src/graphics.h \ - src/hslrgb.cpp \ - src/hslrgb.h \ - src/icon.h \ - src/image_bmp.cpp \ - src/image_bmp.h \ - src/image_png.cpp \ - src/image_png.h \ - src/image_xyz.cpp \ - src/image_xyz.h \ - src/input.cpp \ - src/input.h \ - src/input_buttons.h \ - src/input_buttons_desktop.cpp \ - src/input_source.cpp \ - src/input_source.h \ - src/instrumentation.cpp \ - src/instrumentation.h \ - src/keys.h \ - src/main_data.cpp \ - src/main_data.h \ - src/maniac_patch.cpp \ - src/maniac_patch.h \ - src/map_data.h \ - src/memory_management.h \ - src/message_overlay.cpp \ - src/message_overlay.h \ - src/meta.cpp \ - src/meta.h \ - src/midisequencer.cpp \ - src/midisequencer.h \ - src/opacity.h \ - src/options.h \ - src/output.cpp \ - src/output.h \ - src/pending_message.h \ - src/pending_message.cpp \ - src/pixel_format.h \ - src/pixman_image_ptr.h \ - src/plane.cpp \ - src/plane.h \ - src/platform.cpp \ - src/platform.h \ - src/platform/clock.h \ - src/player.cpp \ - src/player.h \ - src/point.h \ - src/game_quit.cpp \ - src/game_quit.h \ - src/rand.cpp \ - src/rand.h \ - src/rect.cpp \ - src/rect.h \ - src/registry.cpp \ - src/registry.h \ - src/registry_wine.cpp \ - src/rtp.cpp \ - src/rtp.h \ - src/rtp_table.cpp \ - src/scene.cpp \ - src/scene.h \ - src/scene_import.cpp \ - src/scene_import.h \ - src/scene_actortarget.cpp \ - src/scene_actortarget.h \ - src/scene_battle.cpp \ - src/scene_battle.h \ - src/scene_battle_rpg2k.cpp \ - src/scene_battle_rpg2k.h \ - src/scene_battle_rpg2k3.cpp \ - src/scene_battle_rpg2k3.h \ - src/scene_debug.cpp \ - src/scene_debug.h \ - src/scene_end.cpp \ - src/scene_end.h \ - src/scene_equip.cpp \ - src/scene_equip.h \ - src/scene_file.cpp \ - src/scene_file.h \ - src/scene_gamebrowser.cpp \ - src/scene_gamebrowser.h \ - src/scene_gameover.cpp \ - src/scene_gameover.h \ - src/scene_item.cpp \ - src/scene_item.h \ - src/scene_load.cpp \ - src/scene_load.h \ - src/scene_logo.cpp \ - src/scene_logo.h \ - src/scene_map.cpp \ - src/scene_map.h \ - src/scene_menu.cpp \ - src/scene_menu.h \ - src/scene_name.cpp \ - src/scene_name.h \ - src/scene_order.cpp \ - src/scene_order.h \ - src/scene_save.cpp \ - src/scene_save.h \ - src/scene_shop.cpp \ - src/scene_shop.h \ - src/scene_skill.cpp \ - src/scene_skill.h \ - src/scene_status.cpp \ - src/scene_status.h \ - src/scene_settings.cpp \ - src/scene_settings.h \ - src/scene_teleport.cpp \ - src/scene_teleport.h \ - src/scene_title.cpp \ - src/scene_title.h \ - src/screen.cpp \ - src/screen.h \ - src/shake.h \ - src/span.h \ - src/sprite.cpp \ - src/sprite.h \ - src/sprite_airshipshadow.h \ - src/sprite_airshipshadow.cpp \ - src/sprite_actor.cpp \ - src/sprite_actor.h \ - src/sprite_battler.cpp \ - src/sprite_battler.h \ - src/sprite_enemy.cpp \ - src/sprite_enemy.h \ - src/sprite_character.cpp \ - src/sprite_character.h \ - src/sprite_picture.cpp \ - src/sprite_picture.h \ - src/sprite_timer.cpp \ - src/sprite_timer.h \ - src/sprite_weapon.cpp \ - src/sprite_weapon.h \ - src/spriteset_battle.cpp \ - src/spriteset_battle.h \ - src/spriteset_map.cpp \ - src/spriteset_map.h \ - src/state.cpp \ - src/state.h \ - src/std_clock.h \ - src/string_view.cpp \ - src/string_view.h \ - src/system.h \ - src/teleport_target.h \ - src/text.cpp \ - src/text.h \ - src/tilemap.cpp \ - src/tilemap.h \ - src/tilemap_layer.cpp \ - src/tilemap_layer.h \ - src/tone.h \ - src/transform.h \ - src/transition.cpp \ - src/transition.h \ - src/translation.cpp \ - src/translation.h \ - src/util_macro.h \ - src/utils.cpp \ - src/utils.h \ - src/weather.cpp \ - src/weather.h \ - src/window.cpp \ - src/window.h \ - src/window_about.cpp \ - src/window_about.h \ - src/window_actorinfo.cpp \ - src/window_actorinfo.h \ - src/window_actorsp.cpp \ - src/window_actorsp.h \ - src/window_actorstatus.cpp \ - src/window_actorstatus.h \ - src/window_actortarget.cpp \ - src/window_actortarget.h \ - src/window_base.cpp \ - src/window_base.h \ - src/window_battlecommand.cpp \ - src/window_battlecommand.h \ - src/window_battlemessage.cpp \ - src/window_battlemessage.h \ - src/window_battlestatus.cpp \ - src/window_battlestatus.h \ - src/window_command.cpp \ - src/window_command.h \ - src/window_command_horizontal.cpp \ - src/window_command_horizontal.h \ - src/window_equip.cpp \ - src/window_equip.h \ - src/window_equipitem.cpp \ - src/window_equipitem.h \ - src/window_equipstatus.cpp \ - src/window_equipstatus.h \ - src/window_face.cpp \ - src/window_face.h \ - src/window_gamelist.cpp \ - src/window_gamelist.h \ - src/window_gold.cpp \ - src/window_gold.h \ - src/window_help.cpp \ - src/window_help.h \ - src/window_import_progress.cpp \ - src/window_import_progress.h \ - src/window_input_settings.cpp \ - src/window_input_settings.h \ - src/window_item.cpp \ - src/window_item.h \ - src/window_keyboard.cpp \ - src/window_keyboard.h \ - src/window_menustatus.cpp \ - src/window_menustatus.h \ - src/window_message.cpp \ - src/window_message.h \ - src/window_name.cpp \ - src/window_name.h \ - src/window_numberinput.cpp \ - src/window_numberinput.h \ - src/window_paramstatus.cpp \ - src/window_paramstatus.h \ - src/window_savefile.cpp \ - src/window_savefile.h \ - src/window_selectable.cpp \ - src/window_selectable.h \ - src/window_settings.cpp \ - src/window_settings.h \ - src/window_shop.cpp \ - src/window_shop.h \ - src/window_shopbuy.cpp \ - src/window_shopbuy.h \ - src/window_shopnumber.cpp \ - src/window_shopnumber.h \ - src/window_shopparty.cpp \ - src/window_shopparty.h \ - src/window_shopsell.cpp \ - src/window_shopsell.h \ - src/window_shopstatus.cpp \ - src/window_shopstatus.h \ - src/window_skill.cpp \ - src/window_skill.h \ - src/window_skillstatus.cpp \ - src/window_skillstatus.h \ - src/window_targetstatus.cpp \ - src/window_targetstatus.h \ - src/window_teleport.cpp \ - src/window_teleport.h \ - src/window_varlist.cpp \ - src/window_varlist.h - -SOURCEFILES_SDL2 = \ - src/platform/sdl/sdl2_ui.cpp \ - src/platform/sdl/sdl2_ui.h \ - src/platform/sdl/sdl_audio.cpp \ - src/platform/sdl/sdl_audio.h -if HAVE_SDL2 -libeasyrpg_player_a_SOURCES += $(SOURCEFILES_SDL2) -else -EXTRA_DIST += $(SOURCEFILES_SDL2) -endif - -SOURCEFILES_SDL1 = \ - src/platform/sdl/sdl_ui.cpp \ - src/platform/sdl/sdl_ui.h \ - src/platform/sdl/sdl_audio.cpp \ - src/platform/sdl/sdl_audio.h \ - src/platform/sdl/axis.h -if HAVE_SDL1 -libeasyrpg_player_a_SOURCES += $(SOURCEFILES_SDL1) -else -EXTRA_DIST += $(SOURCEFILES_SDL1) -endif - -SOURCEFILES_FMMIDI = \ - src/midiprogram.h \ - src/midisynth.cpp \ - src/midisynth.h -if WANT_FMMIDI -libeasyrpg_player_a_SOURCES += $(SOURCEFILES_FMMIDI) -else -EXTRA_DIST += $(SOURCEFILES_FMMIDI) -endif - -SOURCEFILES_DRWAV = \ - src/decoder_drwav.cpp \ - src/decoder_drwav.h \ - src/external/dr_wav.h -if WANT_DRWAV -libeasyrpg_player_a_SOURCES += $(SOURCEFILES_DRWAV) -else -EXTRA_DIST += $(SOURCEFILES_DRWAV) -endif - -SOURCEFILES_ALSA = \ - src/platform/linux/midiout_device_alsa.cpp \ - src/platform/linux/midiout_device_alsa.h -if HAVE_ALSA -libeasyrpg_player_a_SOURCES += $(SOURCEFILES_ALSA) -else -EXTRA_DIST += $(SOURCEFILES_ALSA) -endif - -SOURCEFILES_MACOS = \ - src/platform/macos/macos_utils.h \ - src/platform/macos/macos_utils.mm \ - src/platform/macos/midiout_device_coreaudio.cpp \ - src/platform/macos/midiout_device_coreaudio.h -if MACOS -libeasyrpg_player_a_SOURCES += $(SOURCEFILES_MACOS) -else -EXTRA_DIST += $(SOURCEFILES_MACOS) -endif - -# These are used by CMake -EXTRA_DIST += \ - bench/bitmap.cpp \ - bench/draw.cpp \ - bench/font.cpp \ - bench/pixel_format.cpp \ - bench/rtp.cpp \ - bench/switches.cpp \ - bench/text.cpp \ - bench/utils.cpp \ - bench/variables.cpp \ - src/external/picojson.h \ - src/platform/3ds/audio.cpp \ - src/platform/3ds/audio.h \ - src/platform/3ds/clock.cpp \ - src/platform/3ds/clock.h \ - src/platform/3ds/input_buttons.cpp \ - src/platform/3ds/main.cpp \ - src/platform/3ds/ui.cpp \ - src/platform/3ds/ui.h \ - src/platform/amigaos4/cmath \ - src/platform/android/android.h \ - src/platform/android/filesystem_apk.cpp \ - src/platform/android/filesystem_apk.h \ - src/platform/android/filesystem_saf.cpp \ - src/platform/android/filesystem_saf.h \ - src/platform/android/org_easyrpg_player_player_EasyRpgPlayerActivity.cpp \ - src/platform/android/org_easyrpg_player_player_EasyRpgPlayerActivity.h \ - src/platform/emscripten/clock.h \ - src/platform/emscripten/interface.cpp \ - src/platform/emscripten/interface.h \ - src/platform/emscripten/main.cpp \ - src/platform/libretro/audio.cpp \ - src/platform/libretro/audio.h \ - src/platform/libretro/clock.cpp \ - src/platform/libretro/clock.h \ - src/platform/libretro/input_buttons.cpp \ - src/platform/libretro/midiout_device.cpp \ - src/platform/libretro/midiout_device.h \ - src/platform/libretro/ui.cpp \ - src/platform/libretro/ui.h \ - src/platform/morphos/integration.cpp \ - src/platform/opendingux/opendingux_input_buttons.cpp \ - src/platform/psp/psp_input_buttons.cpp \ - src/platform/psvita/audio.cpp \ - src/platform/psvita/audio.h \ - src/platform/psvita/clock.cpp \ - src/platform/psvita/clock.h \ - src/platform/psvita/input_buttons.cpp \ - src/platform/psvita/main.cpp \ - src/platform/psvita/ui.cpp \ - src/platform/psvita/ui.h \ - src/platform/switch/audio.cpp \ - src/platform/switch/audio.h \ - src/platform/switch/clock.cpp \ - src/platform/switch/clock.h \ - src/platform/switch/input_buttons.cpp \ - src/platform/switch/main.cpp \ - src/platform/switch/ui.cpp \ - src/platform/switch/ui.h \ - src/platform/wii/clock.cpp \ - src/platform/wii/clock.h \ - src/platform/wii/input_buttons.cpp \ - src/platform/wii/main.cpp \ - src/platform/windows/midiout_device_win32.cpp \ - src/platform/windows/midiout_device_win32.h \ - src/platform/windows/utils.cpp \ - src/platform/windows/utils.h - -libeasyrpg_player_a_CXXFLAGS = \ - -fno-math-errno \ - -I$(srcdir)/src \ - $(LCF_CFLAGS) \ - $(PIXMAN_CFLAGS) \ - $(FREETYPE_CFLAGS) \ - $(HARFBUZZ_CFLAGS) \ - $(LHASA_CFLAGS) \ - $(SDL_CFLAGS) \ - $(PNG_CFLAGS) \ - $(ZLIB_CFLAGS) \ - $(LIBMPG123_CFLAGS) \ - $(LIBWILDMIDI_CFLAGS) \ - $(OGGVORBIS_CFLAGS) \ - $(OPUS_CFLAGS) \ - $(FMT_CFLAGS) \ - $(LIBSNDFILE_CFLAGS) \ - $(LIBXMP_CFLAGS) \ - $(LIBSPEEXDSP_CFLAGS) \ - $(FLUIDSYNTH_CFLAGS) \ - $(FLUIDLITE_CFLAGS) \ - $(ALSA_CFLAGS) \ - $(PTHREAD_CFLAGS) - -libeasyrpg_player_a_OBJCXXFLAGS = $(libeasyrpg_player_a_CXXFLAGS) - -# extra lib to only add version definitions here -libplayer_version_a_SOURCES = \ - src/version.cpp \ - src/version.h -libplayer_version_a_CXXFLAGS = \ - -DEP_VERSION_MAJOR=$(EP_VERSION_MAJOR) \ - -DEP_VERSION_MINOR=$(EP_VERSION_MINOR) \ - -DEP_VERSION_PATCH=$(EP_VERSION_PATCH) \ - -DEP_VERSION_TWEAK=$(EP_VERSION_TWEAK) \ - -DEP_VERSION='"$(EP_VERSION)"' \ - -DEP_VERSION_APPEND='"$(EP_VERSION_APPEND)"' \ - -DEP_VERSION_GIT=\"`cat $(builddir)/.version-git`\" - -# regenerate lib when version has changed -$(libplayer_version_a_OBJECTS): $(builddir)/.version-append $(builddir)/.version-git - -CLEANFILES = $(builddir)/.version-append $(builddir)/.version-git -.PHONY: update_version -$(builddir)/.version-append: update_version - $(AM_V_at)[ -f $@ ] || touch $@ - $(AM_V_at)echo "$(EP_VERSION_APPEND)" | cmp -s $@ - || echo "$(EP_VERSION_APPEND)" > $@ - -$(builddir)/.version-git: update_version - $(AM_V_at)[ -f $@ ] || touch $@ - $(AM_V_at)$(top_srcdir)/builds/autoconf/git-version.sh > $@-t - $(AM_V_at)cmp -s $@ $@-t && rm $@-t || mv $@-t $@ - -easyrpg_player_SOURCES = src/platform/sdl/main.cpp -easyrpg_player_CXXFLAGS = $(libeasyrpg_player_a_CXXFLAGS) -easyrpg_player_LDADD = libeasyrpg-player.a libplayer-version.a \ - $(LCF_LIBS) \ - $(PIXMAN_LIBS) \ - $(FREETYPE_LIBS) \ - $(HARFBUZZ_LIBS) \ - $(LHASA_LIBS) \ - $(SDL_LIBS) \ - $(PNG_LIBS) \ - $(ZLIB_LIBS) \ - $(LIBMPG123_LIBS) \ - $(LIBWILDMIDI_LIBS) \ - $(OGGVORBIS_LIBS) \ - $(OPUS_LIBS) \ - $(FMT_LIBS) \ - $(LIBSNDFILE_LIBS) \ - $(LIBXMP_LIBS) \ - $(LIBSPEEXDSP_LIBS) \ - $(FLUIDSYNTH_LIBS) \ - $(FLUIDLITE_LIBS) \ - $(ALSA_LIBS) \ - $(PTHREAD_LIBS) - -if MACOS -easyrpg_player_LDFLAGS = -framework Foundation -endif - -# manual page -if HAVE_ASCIIDOCTOR -resources/unix/easyrpg-player.6: resources/unix/easyrpg-player.6.adoc - $(AM_V_GEN)$(ASCIIDOCTOR) -a player_version=$(PACKAGE_VERSION) -b manpage -D $(builddir)/resources/unix $< - -dist_man6_MANS = resources/unix/easyrpg-player.6 -MOSTLYCLEANFILES += resources/unix/easyrpg-player.6 -else -if HAVE_MANUAL -dist_man6_MANS = resources/unix/easyrpg-player.6 -endif -endif - -# bash completion -if HAVE_BASHCOMPLETION -bashcompletiondir = $(BASHCOMPLETION_DIR) -dist_bashcompletion_DATA = resources/unix/bash-completion/easyrpg-player -endif - -# desktop integration -if !MACOS -desktopdir = $(datadir)/applications -dist_desktop_DATA = resources/unix/easyrpg-player.desktop -metainfodir = $(datadir)/metainfo -dist_metainfo_DATA = resources/unix/easyrpg-player.metainfo.xml -icondir = $(datadir)/icons/hicolor -scalabledir = $(icondir)/scalable/apps -dist_scalable_DATA = resources/unix/easyrpg-player.svg -pixmapdir = $(datadir)/pixmaps - -install-data-hook: - @echo " $(MKDIR_P) '$(DESTDIR)$(pixmapdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pixmapdir)" || exit 1; \ - echo " $(INSTALL_DATA) resources/unix/icon-48.png '$(DESTDIR)$(pixmapdir)/easyrpg-player.png'"; \ - $(INSTALL_DATA) $(srcdir)/resources/unix/icon-48.png "$(DESTDIR)$(pixmapdir)/easyrpg-player.png" || exit $$?; \ - for files in $(srcdir)/resources/unix/icon-*.png; do \ - size=`basename $$files .png | tr -cd '[0-9]'`; \ - echo " $(MKDIR_P) '$(DESTDIR)$(icondir)/$${size}x$${size}/apps'"; \ - $(MKDIR_P) "$(DESTDIR)$(icondir)/$${size}x$${size}/apps" || exit 1; \ - echo " $(INSTALL_DATA) resources/unix/icon-$${size}.png; '$(DESTDIR)$(icondir)/$${size}x$${size}/apps/easyrpg-player.png'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(icondir)/$${size}x$${size}/apps/easyrpg-player.png" || exit $$?; \ - done -endif - -# doxygen -@DX_RULES@ - -# tests -EXTRA_DIST += tests/assets - -check_PROGRAMS = test_runner -test_runner_SOURCES = \ - tests/algo.cpp \ - tests/attribute.cpp \ - tests/autobattle.cpp \ - tests/bitmapfont.cpp \ - tests/cmdline_parser.cpp \ - tests/config_param.cpp \ - tests/doctest.h \ - tests/drawable_list.cpp \ - tests/drawable_mgr.cpp \ - tests/dynrpg.cpp \ - tests/enemyai.cpp \ - tests/filefinder.cpp \ - tests/filesystem.cpp \ - tests/filesystem_zip.cpp \ - tests/flat_map.cpp \ - tests/font.cpp \ - tests/game_actor.cpp \ - tests/game_battlealgorithm.cpp \ - tests/game_character.cpp \ - tests/game_character_anim.cpp \ - tests/game_character_flash.cpp \ - tests/game_character_move.cpp \ - tests/game_character_moveto.cpp \ - tests/game_enemy.cpp \ - tests/game_event.cpp \ - tests/game_player_input.cpp \ - tests/game_player_pan.cpp \ - tests/game_player_savecount.cpp \ - tests/mock_game.cpp \ - tests/mock_game.h \ - tests/move_route.cpp \ - tests/output.cpp \ - tests/parse.cpp \ - tests/platform.cpp \ - tests/rand.cpp \ - tests/rtp.cpp \ - tests/switches.cpp \ - tests/test_main.cpp \ - tests/test_mock_actor.h \ - tests/test_move_route.h \ - tests/text.cpp \ - tests/utf.cpp \ - tests/utils.cpp \ - tests/variables.cpp \ - tests/wordwrap.cpp - -test_runner_CXXFLAGS = \ - $(libeasyrpg_player_a_CXXFLAGS) -DEP_TEST_PATH=\"$(canonical_srcdir)/tests/assets\" -test_runner_LDADD = \ - $(easyrpg_player_LDADD) - -check-local: - $(AM_V_at)./test_runner - -# Some tests will create this file -# make distcheck will fail if it is not cleaned after running these tests -CLEANFILES += easyrpg_log.txt diff --git a/builds/autoconf/git-version.sh b/builds/autoconf/git-version.sh deleted file mode 100755 index fcf1a21c37..0000000000 --- a/builds/autoconf/git-version.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -# Based on GIT-VERSION-GEN from git source code - -set -e -#set -x - -nl=' -' - -# check if there is a reachable tag -if test -d ${GIT_DIR:-.git} -o -f .git && - version=`git describe --tags --long --match "[0-9].[0-9]*" HEAD 2>/dev/null` && - case "$version" in - *$nl*) (exit 0) ;; - [0-9].[0-9]*) - # check if the working tree is dirty - git update-index -q --refresh - test -z "`git diff-index --name-only HEAD --`" || version="$version-dirty" ;; - esac -then - # split for pretty output - tag=`echo "$version" | cut -s -d- -f1` - commits=`echo "$version" | cut -s -d- -f2` - hash=`echo "$version" | cut -s -d- -f3 | cut -c2-` - dirty=`echo "$version" | cut -s -d- -f4` - - # remove tag, substitute delimiters, format for output - version=`echo "$version" | sed 's/\([^-]*\)-\([^-]*\)-g\([^-]*\)/git+\2@\3/'`; -else - # git not available or version not found - exit 0 -fi - -if test "$commits" -eq 0 -then - # building a tag - exit 0 -fi - -# output -if test "$1" = "--pretty" -then - echo "Building from git repository:" - echo " -$commits commits since tag \"$tag\", object hash is $hash." - if test -n "$dirty" - then - echo " -You have uncommitted changes." - fi -else - echo "$version" -fi diff --git a/builds/autoconf/m4/ax_build_date_epoch.m4 b/builds/autoconf/m4/ax_build_date_epoch.m4 deleted file mode 100644 index dbecb067a8..0000000000 --- a/builds/autoconf/m4/ax_build_date_epoch.m4 +++ /dev/null @@ -1,70 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_build_date_epoch.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BUILD_DATE_EPOCH(VARIABLE[, FORMAT[, ACTION-IF-FAIL]]) -# -# DESCRIPTION -# -# Sets VARIABLE to a string representing the current time. It is -# formatted according to FORMAT if specified, otherwise it is formatted as -# the number of seconds (excluding leap seconds) since the UNIX epoch (01 -# Jan 1970 00:00:00 UTC). -# -# If the SOURCE_DATE_EPOCH environment variable is set, it uses the value -# of that variable instead of the current time. See -# https://reproducible-builds.org/specs/source-date-epoch). If -# SOURCE_DATE_EPOCH is set but cannot be properly interpreted as a UNIX -# timestamp, then execute ACTION-IF-FAIL if specified, otherwise error. -# -# VARIABLE is AC_SUBST-ed. -# -# LICENSE -# -# Copyright (c) 2016 Eric Bavier -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 2 - -AC_DEFUN([AX_BUILD_DATE_EPOCH], -[dnl -AC_MSG_CHECKING([for build time]) -ax_date_fmt="m4_default($2,%s)" -AS_IF([test x"$SOURCE_DATE_EPOCH" = x], - [$1=`date "+$ax_date_fmt"`], - [ax_build_date=`date -u -d "@$SOURCE_DATE_EPOCH" "+$ax_date_fmt" 2>/dev/null \ - || date -u -r "$SOURCE_DATE_EPOCH" "+$ax_date_fmt" 2>/dev/null` - AS_IF([test x"$ax_build_date" = x], - [m4_ifval([$3], - [$3], - [AC_MSG_ERROR([malformed SOURCE_DATE_EPOCH])])], - [$1=$ax_build_date])]) -AC_MSG_RESULT([$$1]) -])dnl AX_BUILD_DATE_EPOCH diff --git a/builds/autoconf/m4/ax_cxx_compile_stdcxx.m4 b/builds/autoconf/m4/ax_cxx_compile_stdcxx.m4 deleted file mode 100644 index 9413da624d..0000000000 --- a/builds/autoconf/m4/ax_cxx_compile_stdcxx.m4 +++ /dev/null @@ -1,962 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) -# or '14' (for the C++14 standard). -# -# The second argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for no added switch, and then for an extended mode. -# -# The third argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline support for the specified C++ standard is -# required and that the macro should error out if no mode with that -# support is found. If specified 'optional', then configuration proceeds -# regardless, after defining HAVE_CXX${VERSION} if and only if a -# supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# Copyright (c) 2015 Paul Norman -# Copyright (c) 2015 Moritz Klammler -# Copyright (c) 2016, 2018 Krzesimir Nowak -# Copyright (c) 2019 Enji Cooper -# Copyright (c) 2020 Jason Merrill -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 12 - -dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro -dnl (serial version number 13). - -AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl - m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], - [$1], [14], [ax_cxx_compile_alternatives="14 1y"], - [$1], [17], [ax_cxx_compile_alternatives="17 1z"], - [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$2], [], [], - [$2], [ext], [], - [$2], [noext], [], - [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], - [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], - [$3], [optional], [ax_cxx_compile_cxx$1_required=false], - [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) - AC_LANG_PUSH([C++])dnl - ac_success=no - - m4_if([$2], [], [dnl - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi]) - - m4_if([$2], [noext], [], [dnl - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi]) - - m4_if([$2], [ext], [], [dnl - if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - dnl Cray's crayCC needs "-h std=c++11" - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi]) - AC_LANG_POP([C++]) - if test x$ax_cxx_compile_cxx$1_required = xtrue; then - if test x$ac_success = xno; then - AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) - fi - fi - if test x$ac_success = xno; then - HAVE_CXX$1=0 - AC_MSG_NOTICE([No compiler with C++$1 support was found]) - else - HAVE_CXX$1=1 - AC_DEFINE(HAVE_CXX$1,1, - [define if the compiler supports basic C++$1 syntax]) - fi - AC_SUBST(HAVE_CXX$1) -]) - - -dnl Test body for checking C++11 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 -) - - -dnl Test body for checking C++14 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 -) - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 -) - -dnl Tests for new features in C++11 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; - - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - -]]) - - -dnl Tests for new features in C++14 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201402L - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_separators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - -]]) - - -dnl Tests for new features in C++17 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ - -// If the compiler admits that it is not ready for C++17, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201703L - -#error "This is not a C++17 compiler" - -#else - -#include -#include -#include - -namespace cxx17 -{ - - namespace test_constexpr_lambdas - { - - constexpr int foo = [](){return 42;}(); - - } - - namespace test::nested_namespace::definitions - { - - } - - namespace test_fold_expression - { - - template - int multiply(Args... args) - { - return (args * ... * 1); - } - - template - bool all(Args... args) - { - return (args && ...); - } - - } - - namespace test_extended_static_assert - { - - static_assert (true); - - } - - namespace test_auto_brace_init_list - { - - auto foo = {5}; - auto bar {5}; - - static_assert(std::is_same, decltype(foo)>::value); - static_assert(std::is_same::value); - } - - namespace test_typename_in_template_template_parameter - { - - template typename X> struct D; - - } - - namespace test_fallthrough_nodiscard_maybe_unused_attributes - { - - int f1() - { - return 42; - } - - [[nodiscard]] int f2() - { - [[maybe_unused]] auto unused = f1(); - - switch (f1()) - { - case 17: - f1(); - [[fallthrough]]; - case 42: - f1(); - } - return f1(); - } - - } - - namespace test_extended_aggregate_initialization - { - - struct base1 - { - int b1, b2 = 42; - }; - - struct base2 - { - base2() { - b3 = 42; - } - int b3; - }; - - struct derived : base1, base2 - { - int d; - }; - - derived d1 {{1, 2}, {}, 4}; // full initialization - derived d2 {{}, {}, 4}; // value-initialized bases - - } - - namespace test_general_range_based_for_loop - { - - struct iter - { - int i; - - int& operator* () - { - return i; - } - - const int& operator* () const - { - return i; - } - - iter& operator++() - { - ++i; - return *this; - } - }; - - struct sentinel - { - int i; - }; - - bool operator== (const iter& i, const sentinel& s) - { - return i.i == s.i; - } - - bool operator!= (const iter& i, const sentinel& s) - { - return !(i == s); - } - - struct range - { - iter begin() const - { - return {0}; - } - - sentinel end() const - { - return {5}; - } - }; - - void f() - { - range r {}; - - for (auto i : r) - { - [[maybe_unused]] auto v = i; - } - } - - } - - namespace test_lambda_capture_asterisk_this_by_value - { - - struct t - { - int i; - int foo() - { - return [*this]() - { - return i; - }(); - } - }; - - } - - namespace test_enum_class_construction - { - - enum class byte : unsigned char - {}; - - byte foo {42}; - - } - - namespace test_constexpr_if - { - - template - int f () - { - if constexpr(cond) - { - return 13; - } - else - { - return 42; - } - } - - } - - namespace test_selection_statement_with_initializer - { - - int f() - { - return 13; - } - - int f2() - { - if (auto i = f(); i > 0) - { - return 3; - } - - switch (auto i = f(); i + 4) - { - case 17: - return 2; - - default: - return 1; - } - } - - } - - namespace test_template_argument_deduction_for_class_templates - { - - template - struct pair - { - pair (T1 p1, T2 p2) - : m1 {p1}, - m2 {p2} - {} - - T1 m1; - T2 m2; - }; - - void f() - { - [[maybe_unused]] auto p = pair{13, 42u}; - } - - } - - namespace test_non_type_auto_template_parameters - { - - template - struct B - {}; - - B<5> b1; - B<'a'> b2; - - } - - namespace test_structured_bindings - { - - int arr[2] = { 1, 2 }; - std::pair pr = { 1, 2 }; - - auto f1() -> int(&)[2] - { - return arr; - } - - auto f2() -> std::pair& - { - return pr; - } - - struct S - { - int x1 : 2; - volatile double y1; - }; - - S f3() - { - return {}; - } - - auto [ x1, y1 ] = f1(); - auto& [ xr1, yr1 ] = f1(); - auto [ x2, y2 ] = f2(); - auto& [ xr2, yr2 ] = f2(); - const auto [ x3, y3 ] = f3(); - - } - - namespace test_exception_spec_type_system - { - - struct Good {}; - struct Bad {}; - - void g1() noexcept; - void g2(); - - template - Bad - f(T*, T*); - - template - Good - f(T1*, T2*); - - static_assert (std::is_same_v); - - } - - namespace test_inline_variables - { - - template void f(T) - {} - - template inline T g(T) - { - return T{}; - } - - template<> inline void f<>(int) - {} - - template<> int g<>(int) - { - return 5; - } - - } - -} // namespace cxx17 - -#endif // __cplusplus < 201703L - -]]) diff --git a/builds/autoconf/m4/ax_prog_doxygen.m4 b/builds/autoconf/m4/ax_prog_doxygen.m4 deleted file mode 100644 index b06ffec91a..0000000000 --- a/builds/autoconf/m4/ax_prog_doxygen.m4 +++ /dev/null @@ -1,310 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_prog_doxygen.html -# =========================================================================== -# -# SYNOPSIS -# -# DX_INIT_DOXYGEN(PROJECT-NAME, [DOXYFILE-PATH], [OUTPUT-DIR], ...) -# DX_DOXYGEN_FEATURE(ON|OFF) -# DX_DOT_FEATURE(ON|OFF) -# DX_HTML_FEATURE(ON|OFF) -# -# DESCRIPTION -# -# The DX_*_FEATURE macros control the default setting for the given -# Doxygen feature. Supported features are 'DOXYGEN' itself, 'DOT' for -# generating graphics and 'HTML' for plain HTML. -# -# The macros mainly control the default state of the feature. The user can -# override the default by specifying --enable or --disable. The macros -# ensure that contradictory flags are not given (e.g., -# --enable-doxygen-anything with --disable-doxygen, etc.) Finally, each -# feature will be automatically disabled (with a warning) if the required -# programs are missing. -# -# Once all the feature defaults have been specified, call DX_INIT_DOXYGEN -# with the following parameters: a one-word name for the project for use -# as a filename base etc., an optional configuration file name (the -# default is '$(srcdir)/Doxyfile', the same as Doxygen's default), and an -# optional output directory name (the default is 'doxygen-doc'). To run -# doxygen multiple times for different configuration files and output -# directories provide more parameters: the second, forth, sixth, etc -# parameter are configuration file names and the third, fifth, seventh, -# etc parameter are output directories. No checking is done to catch -# duplicates. -# -# Automake Support -# -# The DX_RULES substitution can be used to add all needed rules to the -# Makefile. Note that this is a substitution without being a variable: -# only the @DX_RULES@ syntax will work. -# -# The provided targets are: -# -# doxygen-doc: Generate all doxygen documentation. -# doxygen-run: Run doxygen, which will generate the documentation (HTML). -# -# Because of the modification, both targets do the same. Note that by default -# these are not integrated into the automake targets. -# -# The following variable is intended for use in Makefile.am: -# -# DX_CLEANFILES = everything to clean. -# -# Then add this variable to MOSTLYCLEANFILES. -# -# LICENSE -# -# Copyright (c) 2009 Oren Ben-Kiki -# Copyright (c) 2015 Olaf Mandel -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. -# -# MODIFICATION -# -# This file has been modified to only provide HTML generation. -# - carstene1ns, 2014, 2017 -# - -#serial 23 - -## ----------## -## Defaults. ## -## ----------## - -DX_ENV="" -AC_DEFUN([DX_FEATURE_doc], ON) -AC_DEFUN([DX_FEATURE_dot], OFF) -AC_DEFUN([DX_FEATURE_html], ON) - -## --------------- ## -## Private macros. ## -## --------------- ## - -# DX_ENV_APPEND(VARIABLE, VALUE) -# ------------------------------ -# Append VARIABLE="VALUE" to DX_ENV for invoking doxygen and add it -# as a substitution (but not a Makefile variable). The substitution -# is skipped if the variable name is VERSION. -AC_DEFUN([DX_ENV_APPEND], -[AC_SUBST([DX_ENV], ["$DX_ENV $1='$2'"])dnl -m4_if([$1], [VERSION], [], [AC_SUBST([$1], [$2])dnl -AM_SUBST_NOTMAKE([$1])])dnl -]) - -# DX_DIRNAME_EXPR -# --------------- -# Expand into a shell expression prints the directory part of a path. -AC_DEFUN([DX_DIRNAME_EXPR], - [[expr ".$1" : '\(\.\)[^/]*$' \| "x$1" : 'x\(.*\)/[^/]*$']]) - -# DX_IF_FEATURE(FEATURE, IF-ON, IF-OFF) -# ------------------------------------- -# Expands according to the M4 (static) status of the feature. -AC_DEFUN([DX_IF_FEATURE], [ifelse(DX_FEATURE_$1, ON, [$2], [$3])]) - -# DX_REQUIRE_PROG(VARIABLE, PROGRAM) -# ---------------------------------- -# Require the specified program to be found for the DX_CURRENT_FEATURE to work. -AC_DEFUN([DX_REQUIRE_PROG], [ -AC_PATH_TOOL([$1], [$2]) -if test "$DX_FLAG_[]DX_CURRENT_FEATURE$$1" = 1; then - AC_MSG_WARN([$2 not found - will not DX_CURRENT_DESCRIPTION]) - AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) -fi -]) - -# DX_TEST_FEATURE(FEATURE) -# ------------------------ -# Expand to a shell expression testing whether the feature is active. -AC_DEFUN([DX_TEST_FEATURE], [test "$DX_FLAG_$1" = 1]) - -# DX_CHECK_DEPEND(REQUIRED_FEATURE, REQUIRED_STATE) -# ------------------------------------------------- -# Verify that a required features has the right state before trying to turn on -# the DX_CURRENT_FEATURE. -AC_DEFUN([DX_CHECK_DEPEND], [ -test "$DX_FLAG_$1" = "$2" \ -|| AC_MSG_ERROR([doxygen-DX_CURRENT_FEATURE ifelse([$2], 1, - requires, contradicts) doxygen-DX_CURRENT_FEATURE]) -]) - -# DX_CLEAR_DEPEND(FEATURE, REQUIRED_FEATURE, REQUIRED_STATE) -# ---------------------------------------------------------- -# Turn off the DX_CURRENT_FEATURE if the required feature is off. -AC_DEFUN([DX_CLEAR_DEPEND], [ -test "$DX_FLAG_$1" = "$2" || AC_SUBST(DX_FLAG_[]DX_CURRENT_FEATURE, 0) -]) - -# DX_FEATURE_ARG(FEATURE, DESCRIPTION, -# CHECK_DEPEND, CLEAR_DEPEND, -# REQUIRE, DO-IF-ON, DO-IF-OFF) -# -------------------------------------------- -# Parse the command-line option controlling a feature. CHECK_DEPEND is called -# if the user explicitly turns the feature on (and invokes DX_CHECK_DEPEND), -# otherwise CLEAR_DEPEND is called to turn off the default state if a required -# feature is disabled (using DX_CLEAR_DEPEND). REQUIRE performs additional -# requirement tests (DX_REQUIRE_PROG). Finally, an automake flag is set and -# DO-IF-ON or DO-IF-OFF are called according to the final state of the feature. -AC_DEFUN([DX_ARG_ABLE], [ - AC_DEFUN([DX_CURRENT_FEATURE], [$1]) - AC_DEFUN([DX_CURRENT_DESCRIPTION], [$2]) - AC_ARG_ENABLE(doxygen-$1, - [AS_HELP_STRING(DX_IF_FEATURE([$1], [--disable-doxygen-$1], - [--enable-doxygen-$1]), - DX_IF_FEATURE([$1], [don't $2], [$2]))], - [ -case "$enableval" in -#( -y|Y|yes|Yes|YES) - AC_SUBST([DX_FLAG_$1], 1) - $3 -;; #( -n|N|no|No|NO) - AC_SUBST([DX_FLAG_$1], 0) -;; #( -*) - AC_MSG_ERROR([invalid value '$enableval' given to doxygen-$1]) -;; -esac -], [ -AC_SUBST([DX_FLAG_$1], [DX_IF_FEATURE([$1], 1, 0)]) -$4 -]) -if DX_TEST_FEATURE([$1]); then - $5 - : -fi -if DX_TEST_FEATURE([$1]); then - $6 - : -else - $7 - : -fi -]) - -## -------------- ## -## Public macros. ## -## -------------- ## - -# DX_XXX_FEATURE(DEFAULT_STATE) -# ----------------------------- -AC_DEFUN([DX_DOXYGEN_FEATURE], [AC_DEFUN([DX_FEATURE_doc], [$1])]) -AC_DEFUN([DX_DOT_FEATURE], [AC_DEFUN([DX_FEATURE_dot], [$1])]) -AC_DEFUN([DX_HTML_FEATURE], [AC_DEFUN([DX_FEATURE_html], [$1])]) - -# DX_INIT_DOXYGEN(PROJECT, [CONFIG-FILE], [OUTPUT-DOC-DIR], ...) -# -------------------------------------------------------------- -# PROJECT also serves as the base name for the documentation files. -# The default CONFIG-FILE is "$(srcdir)/Doxyfile" and OUTPUT-DOC-DIR is -# "doxygen-doc". -# More arguments are interpreted as interleaved CONFIG-FILE and -# OUTPUT-DOC-DIR values. -AC_DEFUN([DX_INIT_DOXYGEN], [ - -# Files: -AC_SUBST([DX_PROJECT], [$1]) -AC_SUBST([DX_CONFIG], ['ifelse([$2], [], [$(srcdir)/Doxyfile], [$2])']) -AC_SUBST([DX_DOCDIR], ['ifelse([$3], [], [doxygen-doc], [$3])']) -m4_if(m4_eval(3 < m4_count($@)), 1, [m4_for([DX_i], 4, m4_count($@), 2, - [AC_SUBST([DX_CONFIG]m4_eval(DX_i[/2]), - 'm4_default_nblank_quoted(m4_argn(DX_i, $@), - [$(srcdir)/Doxyfile])')])])dnl -m4_if(m4_eval(3 < m4_count($@)), 1, [m4_for([DX_i], 5, m4_count($@,), 2, - [AC_SUBST([DX_DOCDIR]m4_eval([(]DX_i[-1)/2]), - 'm4_default_nblank_quoted(m4_argn(DX_i, $@), - [doxygen-doc])')])])dnl -m4_define([DX_loop], m4_dquote(m4_if(m4_eval(3 < m4_count($@)), 1, - [m4_for([DX_i], 4, m4_count($@), 2, [, m4_eval(DX_i[/2])])], - [])))dnl - -# Environment variables used inside doxygen.cfg: -DX_ENV_APPEND(SRCDIR, $srcdir) -DX_ENV_APPEND(PROJECT, $DX_PROJECT) -DX_ENV_APPEND(VERSION, $PACKAGE_VERSION) - -# Doxygen itself: -DX_ARG_ABLE(doc, [generate any doxygen documentation], - [], - [], - [DX_REQUIRE_PROG([DX_DOXYGEN], doxygen) - DX_REQUIRE_PROG([DX_PERL], perl)], - [DX_ENV_APPEND(PERL_PATH, $DX_PERL)]) - -# Dot for graphics: -DX_ARG_ABLE(dot, [generate graphics for doxygen documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [DX_REQUIRE_PROG([DX_DOT], dot)], - [DX_ENV_APPEND(HAVE_DOT, YES) - DX_ENV_APPEND(DOT_PATH, [`DX_DIRNAME_EXPR($DX_DOT)`])], - [DX_ENV_APPEND(HAVE_DOT, NO)]) - -# Plain HTML pages generation: -DX_ARG_ABLE(html, [generate doxygen plain HTML documentation], - [DX_CHECK_DEPEND(doc, 1)], - [DX_CLEAR_DEPEND(doc, 1)], - [], - [DX_ENV_APPEND(GENERATE_HTML, YES)], - [DX_ENV_APPEND(GENERATE_HTML, NO)]) - -# Rules: -AS_IF([[test $DX_FLAG_html -eq 1]], -[[DX_SNIPPET_html="## ------------------------------- ## -## Rules specific for HTML output. ## -## ------------------------------- ## - -DX_CLEAN_HTML = \$(DX_DOCDIR)/html]dnl -m4_foreach([DX_i], [m4_shift(DX_loop)], [[\\ - \$(DX_DOCDIR]DX_i[)/html]])[ - -"]], -[[DX_SNIPPET_html=""]]) -AS_IF([[test $DX_FLAG_doc -eq 1]], -[[DX_SNIPPET_doc="## --------------------------------- ## -## Format-independent Doxygen rules. ## -## --------------------------------- ## - -${DX_SNIPPET_html}\ -DX_V_DXGEN = \$(_DX_v_DXGEN_\$(V)) -_DX_v_DXGEN_ = \$(_DX_v_DXGEN_\$(AM_DEFAULT_VERBOSITY)) -_DX_v_DXGEN_0 = @echo \" DXGEN \" \$<; - -.PHONY: doxygen-run doxygen-doc - -.INTERMEDIATE: doxygen-run - -doxygen-run:]m4_foreach([DX_i], [DX_loop], - [[ \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag]])[ - -doxygen-doc: doxygen-run - -]m4_foreach([DX_i], [DX_loop], -[[\$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag: \$(DX_CONFIG]DX_i[) \$(pkginclude_HEADERS) - \$(A""M_V_at)rm -rf \$(DX_DOCDIR]DX_i[) - \$(DX_V_DXGEN)\$(DX_ENV) DOCDIR=\$(DX_DOCDIR]DX_i[) \$(DX_DOXYGEN) \$(DX_CONFIG]DX_i[) - \$(A""M_V_at)echo Timestamp >\$][@ - -]])dnl -[DX_CLEANFILES = \\] -m4_foreach([DX_i], [DX_loop], -[[ \$(DX_DOCDIR]DX_i[)/doxygen_sqlite3.db \\ - \$(DX_DOCDIR]DX_i[)/\$(PACKAGE).tag \\ -]])dnl -[ -r \\ - \$(DX_CLEAN_HTML)"]], -[[DX_SNIPPET_doc=""]]) -AC_SUBST([DX_RULES], -["${DX_SNIPPET_doc}"])dnl -AM_SUBST_NOTMAKE([DX_RULES]) - -#For debugging: -#echo DX_FLAG_doc=$DX_FLAG_doc -#echo DX_FLAG_dot=$DX_FLAG_dot -#echo DX_FLAG_html=$DX_FLAG_html -#echo DX_ENV=$DX_ENV -]) diff --git a/builds/autoconf/m4/ax_pthread.m4 b/builds/autoconf/m4/ax_pthread.m4 deleted file mode 100644 index 9f35d13914..0000000000 --- a/builds/autoconf/m4/ax_pthread.m4 +++ /dev/null @@ -1,522 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is -# needed for multi-threaded programs (defaults to the value of CC -# respectively CXX otherwise). (This is necessary on e.g. AIX to use the -# special cc_r/CC_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also to link with them as well. For example, you might link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threaded programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# CXX="$PTHREAD_CXX" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to -# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the -# PTHREAD_PRIO_INHERIT symbol is defined when compiling with -# PTHREAD_CFLAGS. -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# Updated for Autoconf 2.68 by Daniel Richard G. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2011 Daniel Richard G. -# Copyright (c) 2019 Marc Stevens -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 31 - -AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) -AC_DEFUN([AX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_PROG_SED]) -AC_LANG_PUSH([C]) -ax_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on Tru64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then - ax_pthread_save_CC="$CC" - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) - AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) - AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) - AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = "xno"; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - CC="$ax_pthread_save_CC" - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items with a "," contain both -# C compiler flags (before ",") and linker flags (after ","). Other items -# starting with a "-" are C compiler flags, and remaining items are -# library names, except for "none" which indicates that we try without -# any flags at all, and "pthread-config" which is a program returning -# the flags for the Pth emulation library. - -ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 -# (Note: HP C rejects this with "bad form for `-t' option") -# -pthreads: Solaris/gcc (Note: HP C also rejects) -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads and -# -D_REENTRANT too), HP C (must be checked before -lpthread, which -# is present but should not be used directly; and before -mthreads, -# because the compiler interprets this as "-mt" + "-hreads") -# -mthreads: Mingw32/gcc, Lynx/gcc -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case $host_os in - - freebsd*) - - # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) - # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) - - ax_pthread_flags="-kthread lthread $ax_pthread_flags" - ;; - - hpux*) - - # From the cc(1) man page: "[-mt] Sets various -D flags to enable - # multi-threading and also sets -lpthread." - - ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" - ;; - - openedition*) - - # IBM z/OS requires a feature-test macro to be defined in order to - # enable POSIX threads at all, so give the user a hint if this is - # not set. (We don't define these ourselves, as they can affect - # other portions of the system API in unpredictable ways.) - - AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], - [ -# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) - AX_PTHREAD_ZOS_MISSING -# endif - ], - [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) - ;; - - solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (N.B.: The stubs are missing - # pthread_cleanup_push, or rather a function called by this macro, - # so we could check for that, but who knows whether they'll stub - # that too in a future libc.) So we'll check first for the - # standard Solaris way of linking pthreads (-mt -lpthread). - - ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" - ;; -esac - -# Are we compiling with Clang? - -AC_CACHE_CHECK([whether $CC is Clang], - [ax_cv_PTHREAD_CLANG], - [ax_cv_PTHREAD_CLANG=no - # Note that Autoconf sets GCC=yes for Clang as well as GCC - if test "x$GCC" = "xyes"; then - AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], - [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ -# if defined(__clang__) && defined(__llvm__) - AX_PTHREAD_CC_IS_CLANG -# endif - ], - [ax_cv_PTHREAD_CLANG=yes]) - fi - ]) -ax_pthread_clang="$ax_cv_PTHREAD_CLANG" - - -# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) - -# Note that for GCC and Clang -pthread generally implies -lpthread, -# except when -nostdlib is passed. -# This is problematic using libtool to build C++ shared libraries with pthread: -# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 -# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 -# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 -# To solve this, first try -pthread together with -lpthread for GCC - -AS_IF([test "x$GCC" = "xyes"], - [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) - -# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first - -AS_IF([test "x$ax_pthread_clang" = "xyes"], - [ax_pthread_flags="-pthread,-lpthread -pthread"]) - - -# The presence of a feature test macro requesting re-entrant function -# definitions is, on some systems, a strong hint that pthreads support is -# correctly enabled - -case $host_os in - darwin* | hpux* | linux* | osf* | solaris*) - ax_pthread_check_macro="_REENTRANT" - ;; - - aix*) - ax_pthread_check_macro="_THREAD_SAFE" - ;; - - *) - ax_pthread_check_macro="--" - ;; -esac -AS_IF([test "x$ax_pthread_check_macro" = "x--"], - [ax_pthread_check_cond=0], - [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) - - -if test "x$ax_pthread_ok" = "xno"; then -for ax_pthread_try_flag in $ax_pthread_flags; do - - case $ax_pthread_try_flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - *,*) - PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` - PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` - AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) - PTHREAD_CFLAGS="$ax_pthread_try_flag" - ;; - - pthread-config) - AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) - PTHREAD_LIBS="-l$ax_pthread_try_flag" - ;; - esac - - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include -# if $ax_pthread_check_cond -# error "$ax_pthread_check_macro must be defined" -# endif - static void *some_global = NULL; - static void routine(void *a) - { - /* To avoid any unused-parameter or - unused-but-set-parameter warning. */ - some_global = a; - } - static void *start_routine(void *a) { return a; }], - [pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - AC_MSG_RESULT([$ax_pthread_ok]) - AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - - -# Clang needs special handling, because older versions handle the -pthread -# option in a rather... idiosyncratic way - -if test "x$ax_pthread_clang" = "xyes"; then - - # Clang takes -pthread; it has never supported any other flag - - # (Note 1: This will need to be revisited if a system that Clang - # supports has POSIX threads in a separate library. This tends not - # to be the way of modern systems, but it's conceivable.) - - # (Note 2: On some systems, notably Darwin, -pthread is not needed - # to get POSIX threads support; the API is always present and - # active. We could reasonably leave PTHREAD_CFLAGS empty. But - # -pthread does define _REENTRANT, and while the Darwin headers - # ignore this macro, third-party headers might not.) - - # However, older versions of Clang make a point of warning the user - # that, in an invocation where only linking and no compilation is - # taking place, the -pthread option has no effect ("argument unused - # during compilation"). They expect -pthread to be passed in only - # when source code is being compiled. - # - # Problem is, this is at odds with the way Automake and most other - # C build frameworks function, which is that the same flags used in - # compilation (CFLAGS) are also used in linking. Many systems - # supported by AX_PTHREAD require exactly this for POSIX threads - # support, and in fact it is often not straightforward to specify a - # flag that is used only in the compilation phase and not in - # linking. Such a scenario is extremely rare in practice. - # - # Even though use of the -pthread flag in linking would only print - # a warning, this can be a nuisance for well-run software projects - # that build with -Werror. So if the active version of Clang has - # this misfeature, we search for an option to squash it. - - AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], - [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], - [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown - # Create an alternate version of $ac_link that compiles and - # links in two steps (.c -> .o, .o -> exe) instead of one - # (.c -> exe), because the warning occurs only in the second - # step - ax_pthread_save_ac_link="$ac_link" - ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` - ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" - ax_pthread_save_CFLAGS="$CFLAGS" - for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do - AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) - CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" - ac_link="$ax_pthread_save_ac_link" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], - [ac_link="$ax_pthread_2step_ac_link" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], - [break]) - ]) - done - ac_link="$ax_pthread_save_ac_link" - CFLAGS="$ax_pthread_save_CFLAGS" - AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" - ]) - - case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in - no | unknown) ;; - *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; - esac - -fi # $ax_pthread_clang = yes - - - -# Various other checks: -if test "x$ax_pthread_ok" = "xyes"; then - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_CACHE_CHECK([for joinable pthread attribute], - [ax_cv_PTHREAD_JOINABLE_ATTR], - [ax_cv_PTHREAD_JOINABLE_ATTR=unknown - for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $ax_pthread_attr; return attr /* ; */])], - [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], - []) - done - ]) - AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ - test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ - test "x$ax_pthread_joinable_attr_defined" != "xyes"], - [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], - [$ax_cv_PTHREAD_JOINABLE_ATTR], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - ax_pthread_joinable_attr_defined=yes - ]) - - AC_CACHE_CHECK([whether more special flags are required for pthreads], - [ax_cv_PTHREAD_SPECIAL_FLAGS], - [ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $host_os in - solaris*) - ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" - ;; - esac - ]) - AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ - test "x$ax_pthread_special_flags_added" != "xyes"], - [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" - ax_pthread_special_flags_added=yes]) - - AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT; - return i;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) - ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ - test "x$ax_pthread_prio_inherit_defined" != "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) - ax_pthread_prio_inherit_defined=yes - ]) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - # More AIX lossage: compile with *_r variant - if test "x$GCC" != "xyes"; then - case $host_os in - aix*) - AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [ - AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) - AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) - ], - [ - AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) - AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) - ] - ) - ]) - ;; - esac - fi -fi - -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" -test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" - -AC_SUBST([PTHREAD_LIBS]) -AC_SUBST([PTHREAD_CFLAGS]) -AC_SUBST([PTHREAD_CC]) -AC_SUBST([PTHREAD_CXX]) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test "x$ax_pthread_ok" = "xyes"; then - ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) - : -else - ax_pthread_ok=no - $2 -fi -AC_LANG_POP -])dnl AX_PTHREAD diff --git a/builds/autoconf/m4/with_pkg.m4 b/builds/autoconf/m4/with_pkg.m4 deleted file mode 100644 index 07602fa017..0000000000 --- a/builds/autoconf/m4/with_pkg.m4 +++ /dev/null @@ -1,61 +0,0 @@ -dnl with_pkg.m4 - Macros to ease the usage of pkg-config. -*- Autoconf -*- -dnl -dnl Copyright © 2008 Luca Barbato , -dnl Diego Pettenò -dnl Jean-Baptiste Kempf -dnl pkgconf contributors -dnl 2020 carstene1ns -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that program. - -dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, -dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], -dnl [DESCRIPTION], [DEFAULT]) -dnl ------------------------------------------ -dnl -dnl Prepare a "--with-" configure option using the lowercase -dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and -dnl PKG_CHECK_MODULES in a single macro. -AC_DEFUN([PKG_WITH_MODULES], -[ -AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -m4_pushdef([with_arg], m4_tolower([$1])) -m4_pushdef([description], - [m4_default([$5], [build with ]with_arg[ support])]) -m4_pushdef([def_arg], [m4_default([$6], [auto])]) -m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) -m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) -m4_case(def_arg, - [no],[m4_pushdef([with_without],[--with-]with_arg)], - [m4_pushdef([with_without], [--without-]with_arg)]) - -AC_ARG_WITH(with_arg, - AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, - [AS_TR_SH([with_]with_arg)=def_arg]) -AS_CASE([$AS_TR_SH([with_]with_arg)], - [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], - [auto],[PKG_CHECK_MODULES([$1],[$2], - [m4_n([def_action_if_found]) $3], - [m4_n([def_action_if_not_found]) $4])]) - -m4_popdef([with_arg]) -m4_popdef([description]) -m4_popdef([def_arg]) -])dnl PKG_WITH_MODULES diff --git a/builds/release-helper.sh b/builds/release-helper.sh index 0f9469f6e1..dd00074247 100755 --- a/builds/release-helper.sh +++ b/builds/release-helper.sh @@ -1,7 +1,7 @@ #!/bin/bash # release-helper.sh - maintainer utility script to change the release version -# by carstene1ns 2021, released under the MIT license +# by carstene1ns 2021-2024, released under the MIT license set -e @@ -18,7 +18,7 @@ fi if [[ ! $version =~ ^[0-9](\.[0-9]){1,3}$ ]]; then echo "Invalid version argument. Only digits and dots allowed." - echo "Example: 0.8 or 0.7.0.1" + echo "Example: 0.9 or 0.8.0.1" exit 1 fi @@ -65,16 +65,6 @@ sed -i "/EasyRPG_Player VERSION/,1 s/[0-9]\(.[0-9]\)\{1,3\}/$version/" $file sed -i "/liblcf VERSION/,1 s/[0-9]\(.[0-9]\)\{1,3\}/$lcfversion/" $file print_verbose " VERSION " $file -file=configure.ac -print_file -sed -i -e "/ep_version_major/,1 s/\[[0-9]\+\]/[$_maj]/" \ - -e "/ep_version_minor/,1 s/\[[0-9]\+\]/[$_min]/" \ - -e "/ep_version_patch/,1 s/\[[0-9]\+\]/[$_pat]/" \ - -e "/ep_version_tweak/,1 s/\[[0-9]\+\]/[$_twk]/" $file -sed -i "/liblcf >= /,1 s/[0-9]\(.[0-9]\)\{1,3\}/$lcfversion/" $file -print_verbose 'm4_define(\[ep_version_' $file -print_verbose "liblcf >= [0-9]" $file - # + 2 because of two extra commits: version commit itself & merge commit file="builds/android/gradle.properties" print_file diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 37e8fbbbc7..0000000000 --- a/configure.ac +++ /dev/null @@ -1,263 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ([2.69]) - -# version magic -m4_define([ep_version_major], [0]) -m4_define([ep_version_minor], [8]) -m4_define([ep_version_patch], [0]) -m4_define([ep_version_tweak], [0]) -m4_define([ep_version], [ep_version_major.ep_version_minor]) -m4_append([ep_version], m4_if(ep_version_tweak, 0, - m4_if(ep_version_patch, 0,, [.ep_version_patch]), - [.ep_version_patch.ep_version_tweak])) - -AC_INIT([easyrpg-player],[ep_version],[https://github.com/EasyRPG/Player/issues],[easyrpg-player],[https://easyrpg.org]) - -AC_CONFIG_AUX_DIR([builds/autoconf/aux]) -AM_INIT_AUTOMAKE([1.11.4 foreign subdir-objects tar-ustar -Wall dist-xz]) -AM_MAINTAINER_MODE([enable]) -AM_SILENT_RULES([yes]) - -AC_CONFIG_MACRO_DIR([builds/autoconf/m4]) -AC_CONFIG_SRCDIR([src/player.cpp]) -AC_CONFIG_HEADERS([config.h]) -AC_LANG([C++]) - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CXXCPP -AM_PROG_AR -AC_PROG_RANLIB -PKG_PROG_PKG_CONFIG -AC_PROG_OBJCXX - -# Options -AC_ARG_ENABLE([fmmidi], - AS_HELP_STRING([--enable-fmmidi],[use internal MIDI sequencer @<:@default=no@:>@])) -AS_IF([test "x$enable_fmmidi" = "xyes" -o "x$enable_fmmidi" = "xfallback"], [ - enable_fmmidi="yes" dnl fallback counts as yes, since it is default now - AC_DEFINE([WANT_FMMIDI],[1],[Enable internal MIDI sequencer]) -],[enable_fmmidi="no"]) -AM_CONDITIONAL([WANT_FMMIDI],[test "x$enable_fmmidi" = "xyes"]) - -AC_ARG_ENABLE([drwav], - AS_HELP_STRING([--disable-drwav],[use internal WAV library dr_wav @<:@default=yes@:>@]), ,[enable_drwav="yes"]) -AS_IF([test "x$enable_drwav" = "xyes"], - [AC_DEFINE([WANT_DRWAV],[1],[use internal WAV library dr_wav])], - [enable_drwav="no"]) -AM_CONDITIONAL([WANT_DRWAV],[test "x$enable_drwav" = "xyes"]) - -# additional version -AX_BUILD_DATE_EPOCH(ep_date, [%Y-%m-%d]) -AC_ARG_ENABLE([append-version], - [AS_HELP_STRING([--enable-append-version@<:@=TEXT@:>@], - [Additional version information to include. @<:@default=(build date)@:>@])]) -AS_IF([test "x$enable_append_version" = "xyes" -o "x$enable_append_version" = "x"], - [enable_append_version="($ep_date)"], - [test "x$enable_append_version" = "xno"], [enable_append_version=""]) -EP_VERSION_APPEND=$enable_append_version -AC_SUBST([EP_VERSION_APPEND]) - -# Checks for libraries. -AC_DEFUN([EP_PKG_CHECK],[ dnl VARIABLE-PREFIX, MODULES, [DESCRIPTION], [DEFAULT=auto] - PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) - AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],[ - AC_DEFINE([HAVE_][$1], [1], [$3]) - ]) -]) - -PKG_CHECK_MODULES([LCF],[liblcf >= 0.8]) -PKG_CHECK_MODULES([PIXMAN],[pixman-1]) -PKG_CHECK_MODULES([ZLIB],[zlib]) -PKG_CHECK_MODULES([PNG],[libpng]) -PKG_CHECK_MODULES([FMT],[fmt],,[ - AC_CHECK_HEADER([fmt/core.h],[fmtlib_header=1],,[ ]) - AC_MSG_CHECKING([for FMT (legacy)]) - saved_ldflags="${LDFLAGS}" - LDFLAGS="${LDFLAGS} -lfmt" - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],[fmt::format("")])],[FMT_LIBS="-lfmt"]) - LDFLAGS="${saved_ldflags}" - AS_IF([test -z "$FMT_LIBS" -o -z "$fmtlib_header"],[AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find libfmt! Consider installing version 5.3 or newer.]) - ],[AC_MSG_RESULT([yes])]) -]) -PKG_CHECK_MODULES([SDL],[sdl2 >= 2.0.5],[sdl_version=2],[ - PKG_CHECK_MODULES([SDL],[sdl],[sdl_version=1],[ - AC_MSG_ERROR([Could not find SDL! Consider installing version 2.0.5 or newer.]) - ]) -]) -AC_DEFINE_UNQUOTED([USE_SDL],[$sdl_version],[Enable SDL, version 2 or 1.2]) -AM_CONDITIONAL([HAVE_SDL2], [test "x$sdl_version" = "x2"]) -AM_CONDITIONAL([HAVE_SDL1], [test "x$sdl_version" = "x1"]) -EP_PKG_CHECK([FREETYPE],[freetype2],[Custom Font rendering.]) -AS_IF([test "$with_freetype" = "yes"],[ - EP_PKG_CHECK([HARFBUZZ],[harfbuzz],[Custom Font text shaping.]) -]) -EP_PKG_CHECK([LHASA],[liblhasa],[Support running games in lzh archives.]) - -AC_ARG_WITH([audio],[AS_HELP_STRING([--without-audio], [Disable audio support. @<:@default=on@:>@])]) -AS_IF([test "x$with_audio" != "xno"],[ - AC_DEFINE([SUPPORT_AUDIO],[1],[Enable Audio Support]) - EP_PKG_CHECK([LIBMPG123],[libmpg123],[MP3 support.]) - EP_PKG_CHECK([LIBWILDMIDI],[wildmidi],[Midi support (GUS patches). Alternative to internal fmmidi.]) - EP_PKG_CHECK([FLUIDSYNTH],[fluidsynth],[Midi support (Soundfonts). Alternative to internal fmmidi.]) - AS_IF([test "$with_fluidsynth" != "yes"],[ - EP_PKG_CHECK([FLUIDLITE],[fluidlite],[Midi support (Soundfonts). Liteweight version of FluidSynth. Alternative to internal fmmidi.]) - ], [AC_SUBST([with_fluidlite], "no"])) - EP_PKG_CHECK([ALSA],[alsa],[Midi support (Daemon)]) - EP_PKG_CHECK([OGGVORBIS],[vorbisfile vorbis],[Ogg Vorbis support.]) - EP_PKG_CHECK([OPUS],[opusfile],[Opus support.]) - EP_PKG_CHECK([LIBSNDFILE],[sndfile],[Improved WAV support. Fallback when unsupported by dr_wav.]) - EP_PKG_CHECK([LIBXMP],[libxmp >= 4.5.0],[Tracker module support.]) - EP_PKG_CHECK([LIBSPEEXDSP],[speexdsp],[Resampling support.]) - - AS_IF([test "$with_alsa" = "yes"],[ - AC_DEFINE([HAVE_NATIVE_MIDI],[1],[Native Midi support]) - AX_PTHREAD - ]) -]) -AM_CONDITIONAL([HAVE_ALSA], [test "$with_alsa" = "yes"]) - -# bash completion -AC_ARG_WITH([bash-completion-dir],[AS_HELP_STRING([--with-bash-completion-dir@<:@=DIR@:>@], - [Install the parameter auto-completion script for bash in DIR. @<:@default=auto@:>@])], - [],[with_bash_completion_dir=yes]) -AS_IF([test "x$with_bash_completion_dir" = "xyes"],[ - BASHCOMPLETION_DIR="`$PKG_CONFIG --silence-errors --define-variable=prefix="\${prefix}" --define-variable=datadir="\${datadir}" --variable=completionsdir bash-completion`" -],[ - BASHCOMPLETION_DIR=$with_bash_completion_dir -]) -AS_IF([test "x$BASHCOMPLETION_DIR" = "x"],[ - BASHCOMPLETION_DIR="${datadir}/bash-completion/completions" -]) -AC_SUBST([BASHCOMPLETION_DIR]) -AM_CONDITIONAL([HAVE_BASHCOMPLETION], [test "x$with_bash_completion_dir" != "xno"]) - -# Expose OS type to automake -AC_CANONICAL_HOST - -EP_BUILD_MAC=NO - -# Detect the target system -case "${host_os}" in - darwin*) - EP_BUILD_MAC=YES - ;; -esac - -# Pass the conditionals to automake -AM_CONDITIONAL([MACOS], [test "$EP_BUILD_MAC" = "YES"]) - -# C++17 is mandatory -AX_CXX_COMPILE_STDCXX(17, noext) - -# Checks for header files. -AC_CHECK_HEADERS([cstdint cstdlib string iostream unistd.h wchar.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_BIGENDIAN -AC_CHECK_HEADER_STDBOOL -AC_C_INLINE -AC_TYPE_INT16_T -AC_TYPE_INT32_T -AC_TYPE_INT8_T -AC_TYPE_SIZE_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT8_T - -# Checks for library functions. -AC_FUNC_ERROR_AT_LINE -AC_CHECK_FUNCS([malloc floor getcwd memset putenv strerror]) - -# version setup -AC_SUBST(EP_VERSION_MAJOR, ep_version_major) -AC_SUBST(EP_VERSION_MINOR, ep_version_minor) -AC_SUBST(EP_VERSION_PATCH, ep_version_patch) -AC_SUBST(EP_VERSION_TWEAK, ep_version_tweak) -AC_SUBST(EP_VERSION, ep_version) -git_version=`$srcdir/builds/autoconf/git-version.sh --pretty` - -# manual page -AC_CHECK_PROG([ASCIIDOCTOR], [asciidoctor], [asciidoctor], [no]) -AM_CONDITIONAL([HAVE_ASCIIDOCTOR], [test x"$ASCIIDOCTOR" != "xno"]) -AS_IF([test x"$ASCIIDOCTOR" = "xno" && test ! -f "${srcdir}/resources/unix/easyrpg-player.6"], - AC_MSG_WARN([asciidoctor is required to create the manual page])) -AM_CONDITIONAL([HAVE_MANUAL], [test -f "${srcdir}/resources/unix/easyrpg-player.6"]) - -# Doxygen source documentation -DX_DOXYGEN_FEATURE(OFF) -DX_HTML_FEATURE(ON) -DX_DOT_FEATURE(ON) -DX_INIT_DOXYGEN(easyrpg-player, resources/Doxyfile, doc) - -# Files to generate -AC_CONFIG_FILES([Makefile - resources/Doxyfile]) - -# Absolute & Canonical source directory for unit tests -canonical_srcdir=`cd $srcdir && pwd -P` -AC_SUBST([canonical_srcdir]) - -AC_OUTPUT - -if test "yes" != "$silent"; then - echo "===============================================================================" - - echo "EasyRPG Player $VERSION configuration summary:" - echo "" - - if test -n "$git_version"; then - echo "$git_version" - echo "" - fi - - echo "Paths:" - echo " prefix: $prefix" - echo " bash completion: $BASHCOMPLETION_DIR" - - test "$sdl_version" = "2" && \ - echo "Backend: SDL2" - test "$sdl_version" = "1" && \ - echo "Backend: SDL1.2 (legacy version, may be removed soon!)" - - echo "Optional features:" - echo " -custom Font rendering (freetype2): $with_freetype" - test "$with_freetype" = "yes" && \ - echo " -custom Font text shaping (harfbuzz): $with_harfbuzz" - echo " -run games in lzh archives (lhasa): $with_lhasa" - - if test "$with_audio" = "no"; then - echo "Audio support: no" - else - echo "Audio support:" - echo " -FMMidi: $enable_fmmidi" - echo " -MP3 (libmpg123): $with_libmpg123" - echo " -midi (libwildmidi): $with_libwildmidi" - echo " -midi (FluidSynth): $with_fluidsynth" - echo " -midi (FluidLite): $with_fluidlite" - echo " -midi (Native, ALSA): $with_alsa" - echo " -ogg Vorbis (vorbisfile): $with_oggvorbis" - echo " -opus (opusfile): $with_opus" - echo " -built-in WAV (dr_wav): $enable_drwav" - echo " -WAV (sndfile): $with_libsndfile" - echo " -tracker module (libxmp): $with_libxmp" - echo " -resampling (speexdsp): $with_libspeexdsp" - fi - - echo "Documentation:" - echo -n " manual page: " - if test "$ASCIIDOCTOR" = "no" -a -f "${srcdir}/resources/unix/easyrpg-player.6"; then - echo "shipped" - elif test "x$ASCIIDOCTOR" != "xno"; then - echo "generated" - else - echo "not available" - fi - echo -n " doxygen: " - test "$DX_FLAG_doc" = 1 && echo "yes" || echo "no" - - echo "===============================================================================" -fi diff --git a/docs/BUILDING.md b/docs/BUILDING.md index 83856138b6..705cbde685 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -9,37 +9,12 @@ In case you want to compile the dependencies yourself, you can find them, except for [liblcf], in our [buildscripts] repository. -## Autotools Makefile method: - -Building requirements: - -- pkg-config -- GNU make - -Step-by-step instructions: - - tar xf easyrpg-player-0.8.tar.xz # unpack the tarball - cd easyrpg-player-0.8 # enter in the package directory - ./configure # find libraries, set options - make # compile the executable - -Additional building requirements when using the source tree (git): - -- autoconf >= 2.69 -- automake >= 1.11.4 -- libtool - -To generate the "configure" script, run before following the above section: - - autoreconf -i - - -## CMake method: +## Standard build with CMake Building requirements: - pkg-config (only on Linux) -- CMake 3.10 or newer +- CMake 3.16 or newer Step-by-step instructions: @@ -49,14 +24,12 @@ Step-by-step instructions: cmake --build . # compile the executable sudo cmake --build . --target install # install system-wide -CMake is the only supported way to build Player for Windows. All dependencies +CMake is the only supported way to build Player. On Windows all dependencies must be installed with [vcpkg]. ## libretro core: -Building for libretro is based on the CMake method. - Additional commands required before building: git submodule init # Init submodules @@ -96,8 +69,6 @@ The unsigned APK is stored in: ## Nintendo and Sony Homebrew ports (Wii, 3DS, Switch, PSVita/PSTV) -This is based on the CMake method. - Building requirements: - devkitPPC for Wii diff --git a/resources/Doxyfile.in b/resources/Doxyfile.in index b2e6f272ac..5711182337 100644 --- a/resources/Doxyfile.in +++ b/resources/Doxyfile.in @@ -38,7 +38,7 @@ PROJECT_NAME = "EasyRPG Player" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = @PACKAGE_VERSION@ +PROJECT_NUMBER = @PLAYER_VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @DX_DOCDIR@ +OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@/doc # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -834,7 +834,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = @srcdir@/src +INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -2157,7 +2157,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = @srcdir@/src +INCLUDE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/src # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the diff --git a/src/system.h b/src/system.h index 74b8d0b12c..3e7187e730 100644 --- a/src/system.h +++ b/src/system.h @@ -18,14 +18,6 @@ #ifndef EP_SYSTEM_H #define EP_SYSTEM_H -/* - * Includes GNU Autotools build configuration parameters. - * This option may have defined USE_SDL and others. - */ -#ifdef HAVE_CONFIG_H -# include -#endif - #if !(defined(USE_SDL) || defined(PLAYER_UI)) # error "This build doesn't target a backend" #endif From 81fb4d6305da0fbfdb6285c73e116d4184d2161e Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Thu, 23 May 2024 01:10:11 +0200 Subject: [PATCH 3/3] Generate distribution archives with git Update cmake version finding with prepopulated information --- .gitattributes | 16 +++ CMakeLists.txt | 61 +++------- builds/cmake/.git-hash | 1 + builds/cmake/Modules/PlayerBuildType.cmake | 2 - builds/cmake/Modules/PlayerMisc.cmake | 71 ++++++++++++ builds/make-dist.sh | 124 +++++++++++++++++++++ 6 files changed, 229 insertions(+), 46 deletions(-) create mode 100644 builds/cmake/.git-hash create mode 100755 builds/make-dist.sh diff --git a/.gitattributes b/.gitattributes index e4b4a58dcf..e1125d5233 100644 --- a/.gitattributes +++ b/.gitattributes @@ -17,3 +17,19 @@ CMakePresets.json -diff linguist-generated builds/android/app/src/main/java/org/libsdl/app/*.java -diff linguist-vendored builds/android/app/src/main/java/org/libsdl/app/SDLActivity.java diff src/generated/* -diff linguist-generated + +.gitattributes export-ignore +.gitignore export-ignore +/.github/ export-ignore +/.tx/ export-ignore +.editorconfig export-ignore +/builds/cmake/.git-hash export-subst + +#TODO? .gitmodules export-ignore +#TODO? /builds/libretro/ export-ignore + +/builds/android/ export-ignore +/builds/flatpak/ export-ignore +/builds/snap/ export-ignore +/builds/release-helper.sh export-ignore +/builds/make-dist.sh export-ignore diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c05aada65..e1f8788c23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,6 @@ include(PlayerConfigureWindows) include(PlayerFindPackage) include(PlayerBuildType) include(PlayerMisc) -include(GetGitRevisionDescription) # Dependencies provided by CMake Presets list(APPEND CMAKE_PREFIX_PATH "${PLAYER_PREFIX_PATH_APPEND}") @@ -486,53 +485,24 @@ set(PLAYER_VERSION_FULL ${PLAYER_VERSION}) string(CONCAT PROJECT_VERSION ${PROJECT_VERSION_MAJOR} "." ${PROJECT_VERSION_MINOR} "." ${PROJECT_VERSION_PATCH} "." ${PROJECT_VERSION_TWEAK}) - -set(PLAYER_VERSION_GIT "") -git_get_exact_tag(GIT_TAG) -# Do not include a hash, if we are building a release tag -if(NOT GIT_TAG) - # otherwise concatenate a version with hash - git_describe(GIT_DESCRIPTION) - if(GIT_DESCRIPTION) - string(REPLACE "-" ";" GIT_DESCRIPTION ${GIT_DESCRIPTION}) - list(LENGTH GIT_DESCRIPTION GIT_DESCRIPTION_PARTS) - set(GIT_MESSAGE "Found git info: ") - if(GIT_DESCRIPTION_PARTS EQUAL 3) - list(GET GIT_DESCRIPTION 0 GIT_TAG) - list(GET GIT_DESCRIPTION 1 GIT_COMMITS) - list(GET GIT_DESCRIPTION 2 GIT_HASH) - string(APPEND GIT_MESSAGE "${GIT_COMMITS} commits since tag \"${GIT_TAG}\", ") - string(PREPEND GIT_COMMITS "+") - # strip the g prefix - string(SUBSTRING ${GIT_HASH} 1 -1 GIT_HASH) - else() - # no tags found, only hash - list(GET GIT_DESCRIPTION 0 GIT_HASH) - endif() - set(PLAYER_VERSION_GIT "git${GIT_COMMITS}@${GIT_HASH}") - string(APPEND GIT_MESSAGE "object hash is ${GIT_HASH}") - git_local_changes(GIT_DIRTY) - if(GIT_DIRTY STREQUAL "DIRTY") - string(APPEND PLAYER_VERSION_GIT "-dirty") - string(APPEND GIT_MESSAGE ", you have uncommitted changes") - endif() - string(APPEND PLAYER_VERSION_FULL "-${PLAYER_VERSION_GIT}") - - message(STATUS "${GIT_MESSAGE}") - endif() +set(PLAYER_VERSION_DEFS EP_VERSION="${PLAYER_VERSION}" + EP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} EP_VERSION_MINOR=${PROJECT_VERSION_MINOR} + EP_VERSION_PATCH=${PROJECT_VERSION_PATCH} EP_VERSION_TWEAK=${PROJECT_VERSION_TWEAK}) + +player_find_gitversion(VERSION_VAR PLAYER_VERSION_GIT + MESSAGE_VAR GIT_STATUS) +if(PLAYER_VERSION_GIT) + string(APPEND PLAYER_VERSION_FULL "-${PLAYER_VERSION_GIT}") + list(APPEND PLAYER_VERSION_DEFS EP_VERSION_GIT="${PLAYER_VERSION_GIT}") endif() string(TIMESTAMP PLAYER_DATE "(%Y-%m-%d)") set(PLAYER_VERSION_APPEND ${PLAYER_DATE} CACHE STRING "Additional version information to include") -set_property(SOURCE src/version.cpp PROPERTY COMPILE_DEFINITIONS - EP_VERSION="${PLAYER_VERSION}"; - EP_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}; - EP_VERSION_MINOR=${PROJECT_VERSION_MINOR}; - EP_VERSION_PATCH=${PROJECT_VERSION_PATCH}; - EP_VERSION_TWEAK=${PROJECT_VERSION_TWEAK}; - EP_VERSION_APPEND="${PLAYER_VERSION_APPEND}"; - EP_VERSION_GIT="${PLAYER_VERSION_GIT}" -) +if(NOT PLAYER_VERSION_APPEND STREQUAL "") + list(APPEND PLAYER_VERSION_DEFS EP_VERSION_APPEND="${PLAYER_VERSION_APPEND}") +endif() + +set_property(SOURCE src/version.cpp PROPERTY COMPILE_DEFINITIONS ${PLAYER_VERSION_DEFS}) # Platform setup set(PLAYER_TARGET_PLATFORM "SDL2" CACHE STRING "Platform to compile for. Options: SDL2 SDL1 libretro psvita 3ds switch wii amigaos4") @@ -1466,6 +1436,9 @@ endif() # Print summary message(STATUS "") +message(STATUS "EasyRPG Player version ${PLAYER_VERSION} has been configured --") +message(STATUS "Git info: ${GIT_STATUS}") +message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") message(STATUS "Target system: ${PLAYER_TARGET_PLATFORM}") if(PLAYER_ROMFS) message(STATUS "RomFS: Embedding directory \"${PLAYER_ROMFS_PATH}\"") diff --git a/builds/cmake/.git-hash b/builds/cmake/.git-hash new file mode 100644 index 0000000000..46b7856fbc --- /dev/null +++ b/builds/cmake/.git-hash @@ -0,0 +1 @@ +$Format:%h$ diff --git a/builds/cmake/Modules/PlayerBuildType.cmake b/builds/cmake/Modules/PlayerBuildType.cmake index db166fedb4..e4a2fbe480 100644 --- a/builds/cmake/Modules/PlayerBuildType.cmake +++ b/builds/cmake/Modules/PlayerBuildType.cmake @@ -8,8 +8,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${default_build_type}' as none was specified.") set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") -else() - message(STATUS "Build type is set to ${CMAKE_BUILD_TYPE}.") endif() # Ensure needed debugging flags are passed diff --git a/builds/cmake/Modules/PlayerMisc.cmake b/builds/cmake/Modules/PlayerMisc.cmake index deeb4f10c2..a85f2c6689 100644 --- a/builds/cmake/Modules/PlayerMisc.cmake +++ b/builds/cmake/Modules/PlayerMisc.cmake @@ -10,3 +10,74 @@ if(CMAKE_VERSION VERSION_LESS "3.24") endif() endif() endif() + +include(GetGitRevisionDescription) +# query special files or git commands to figure out a usable version +function(player_find_gitversion) + cmake_parse_arguments(FIND_GITVER "" "VERSION_VAR;MESSAGE_VAR" "" ${ARGN}) + + # internal vars + set(version "VERSION-NOTFOUND") + set(message "Unknown") + + # generated by our maintainer script for release archives + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/.git-dist) + set(message "distribution archive") + else() + # git checkout or GitHub export + # 1) try git tag + git_get_exact_tag(GIT_TAG) + if(GIT_TAG) + set(message "release tag \"${GIT_TAG}\"") + else() + # 2) try normal checkout + git_describe(GIT_DESCRIPTION) + if(GIT_DESCRIPTION) + # concatenate a version string with hash + string(REPLACE "-" ";" GIT_DESCRIPTION ${GIT_DESCRIPTION}) + list(LENGTH GIT_DESCRIPTION GIT_DESCRIPTION_PARTS) + if(GIT_DESCRIPTION_PARTS EQUAL 3) + list(GET GIT_DESCRIPTION 0 GIT_TAG) + list(GET GIT_DESCRIPTION 1 GIT_COMMITS) + list(GET GIT_DESCRIPTION 2 GIT_HASH) + set(message "${GIT_COMMITS} commits since tag \"${GIT_TAG}\", ") + string(PREPEND GIT_COMMITS "+") + string(SUBSTRING ${GIT_HASH} 1 -1 GIT_HASH) # strip the g prefix + else() + # no tags found, only hash (checkout without history/detached head) + list(GET GIT_DESCRIPTION 0 GIT_HASH) + set(message "") + endif() + set(version "git${GIT_COMMITS}@${GIT_HASH}") + string(APPEND message "object hash is ${GIT_HASH}") + + # append marker for local changes + git_local_changes(GIT_DIRTY) + if(GIT_DIRTY STREQUAL "DIRTY") + string(APPEND version "-dirty") + string(APPEND message ", you have uncommitted changes") + endif() + else() + # 3) no git dir, likely git archive export from GitHub + file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/.git-hash + GIT_HASH_STRINGS REGEX "^[A-Za-z0-9_]+$" LIMIT_COUNT 1) + list(LENGTH GIT_HASH_STRINGS GIT_HASH_STRINGS_LENGTH) + if(GIT_HASH_STRINGS_LENGTH EQUAL 1) + list(GET GIT_HASH_STRINGS 0 GIT_HASH) + set(version "git@${GIT_HASH}") + set(message "object hash is ${GIT_HASH}") + else() + # 4) give up, use "undefined" values + endif() + endif() + endif() + endif() + + # export information + if(FIND_GITVER_VERSION_VAR) + set(${FIND_GITVER_VERSION_VAR} ${version} PARENT_SCOPE) + endif() + if(FIND_GITVER_MESSAGE_VAR) + set(${FIND_GITVER_MESSAGE_VAR} ${message} PARENT_SCOPE) + endif() +endfunction() diff --git a/builds/make-dist.sh b/builds/make-dist.sh new file mode 100755 index 0000000000..b68fdac983 --- /dev/null +++ b/builds/make-dist.sh @@ -0,0 +1,124 @@ +#!/bin/bash + +# make-dist.sh - maintainer utility script to generate distribution archives +# by carstene1ns 2019-2024, released under the MIT license + +set -e +#set -x + +# helper functions + +colorize() { + RESET="\e[0m" + BOLD="\e[1m" + BLUE="${BOLD}\e[34m" + RED="${BOLD}\e[31m" + YELLOW="${BOLD}\e[33m" +} + +message() { + if [ -z ${V} ]; then + printf "${BLUE}${1}${RESET}\n" + else + printf "\n${BLUE}${1}${RESET}\n" + local underline=$(printf "%-${#1}s" "=") + printf "${BOLD}${underline// /=}${RESET}\n" + fi +} + +warning() { + printf "${YELLOW}WARNING:${RESET}${BOLD} ${1}${RESET}\n" >&2 +} + +error() { + printf "${RED}ERROR:${RESET}${BOLD} ${1}${RESET}\n" >&2 + exit 1 +} + +has() { + hash ${1} 2> /dev/null || error "'${1}' not found" +} + +cleanup() { + warning "Something went wrong, cleaning up" + [ -d "${TEMPDIR}" ] && rm ${V} -rf "${TEMPDIR}" + [ -f ${TARFILE} ] && rm ${V} -f ${TARFILE} +} + +# main + +# check for terminal output +test -t 0 && colorize + +[ -d .git ] || error "Not in a git repository (no .git directory found)" + +# check tools +has git +has rm +has asciidoctor +has mktemp +has gzip +has xz + +# options +V="" +WORKTREE_ATTRIBUTES="" +TREEISH=master +while getopts ":hvt:w" ARG; do + case $ARG in + v) + V="-v" + ;; + w) + WORKTREE_ATTRIBUTES="--worktree-attributes" + ;; + t) + TREEISH=$OPTARG + ;; + h) + echo "make-dist.sh - Generate EasyRPG Player distribution archives" + echo "Options:" + echo " -h - This help message" + echo " -v - Run in verbose mode" + echo " -t - Archive branch/tag/... instead of '${TREEISH}'" + echo " -w - Use current working tree .gitattributes state" + exit 0 + ;; + \?) + error "Invalid option: -$OPTARG." + ;; + :) + error "Option -$OPTARG requires an argument." + esac +done + +APP="easyrpg-player" +RELEASE=$(git describe --abbrev=0 --tags ${TREEISH}) +PREFIX="${APP}-${RELEASE}" +TARFILE="${PREFIX}.tar" +MANPREFIX="resources/unix" # since 0.8 + +message "Deleting old archives" +rm ${V} -f ${TARFILE} ${TARFILE}.gz ${TARFILE}.xz + +message "Creating temporary directory for additional files" +TEMPDIR=$(mktemp -d dist.XXXXX) +trap cleanup EXIT + +message "Generating manual page" +git show ${TREEISH}:${MANPREFIX}/${APP}.6.adoc \ + | asciidoctor ${V} -a player_version="${RELEASE}" -b manpage -o ${TEMPDIR}/${APP}.6 - + +message "Archiving repository (@${TREEISH})" +git archive ${V} ${WORKTREE_ATTRIBUTES} -o ${TARFILE} \ + --prefix=${PREFIX}/${MANPREFIX}/ --add-file=${TEMPDIR}/${APP}.6 \ + --add-virtual-file=${PREFIX}/builds/cmake/.git-dist:"${TREEISH}" \ + --prefix=${PREFIX}/ ${TREEISH} || error "Cannot create archive" + +message "Deleting temporary directory" +rm ${V} -rf ${TEMPDIR} +trap - EXIT + +message "Compressing tar archive with gzip and xz" +GZIP= gzip -9 -k ${V} ${TARFILE} +XZ_OPT= xz -5 -T2 ${V} ${TARFILE}