#
# ultrastardx configure.ac script
#
# by UltraStar Deluxe Team
#
# Execute "autogen.sh" or "make reconf"
# to create the configure script.
#
# Helper macros have been separated to
#   ax_extract_version.m4 (AX_EXTRACT_VERSION)
#   pkg_config_utils.m4   (PKG_VALUE, PKG_VERSION, PKG_HAVE)
#

# Require autoconf >= 2.61
AC_PREREQ(2.61)

# Init autoconf
AC_INIT([ultrastardx],
        m4_esyscmd_s([cat VERSION]),
        [https://github.com/UltraStar-Deluxe/USDX/issues/])
# specify the website here
PACKAGE_WEBSITE="http://usdx.eu/"
AC_SUBST(PACKAGE_WEBSITE)
# specify the Discord channel here
PACKAGE_DISCORD="https://discord.gg/qfS2b7VwDG"
AC_SUBST(PACKAGE_DISCORD)

AC_CONFIG_MACRO_DIR([dists/autogen/m4])
# Specify a source-file so autoconf can check if the source-dir exists
AC_CONFIG_SRCDIR(src/ultrastardx.dpr)

# Set the path to install-sh
AC_CONFIG_AUX_DIR(dists/autogen)

# show features and packages in one list
AC_PRESERVE_HELP_ORDER

# -----------------------------------------
# find tools
# -----------------------------------------

# options for make command
AC_PROG_MAKE_SET
# find a program for recursive dir creation
AC_PROG_MKDIR_P
# find the best install tool
AC_PROG_INSTALL
# some other useful tools
#AC_PROG_AWK
AC_PROG_SED
AC_PROG_GREP
#AC_PROG_EGREP
CMAKE_FIND_BINARY
[[ -n "$CMAKE_BINARY" ]] || CMAKE_BINARY=false

# -----------------------------------------
# macro declarations
# -----------------------------------------

# AC_SUBST_DEFINE(DEFINE_SUFFIX, IS_DEFINED)
# used to enable/disable pascal defines
AC_DEFUN([AC_SUBST_DEFINE],
[
    if [[ x$2 = xyes ]]; then
        DEFINE_[$1]=DEFINE
    else
	DEFINE_[$1]=UNDEF
    fi
    AC_SUBST(DEFINE_[$1])
])

# -----------------------------------------
# define switches
# -----------------------------------------

AC_CANONICAL_HOST

# print library options header
AC_ARG_WITH([cfg-dummy1], [
External Libraries:])

# add portmixer option
AC_ARG_WITH([portaudio],
    [AS_HELP_STRING([--with-portaudio],
      [enable audio capture with PortAudio @<:@default=check@:>@])],
    [with_portmixer=$withval], [with_portaudio="check"])

AC_ARG_WITH([portmixer],
    [AS_HELP_STRING([--with-portmixer],
      [enable portmixer audio-mixer support @<:@default=check@:>@])],
    [with_portmixer=$withval], [with_portmixer="check"])

# add projectM option
AC_ARG_WITH([libprojectM], 
    [AS_HELP_STRING([--with-libprojectM],
      [enable projectM visualization support @<:@default=no@:>@])],
    [with_libprojectM=$withval], [with_libprojectM="no"])

AC_ARG_WITH([local-projectM-presets],
    [AS_HELP_STRING([--with-local-projectM-presets],
		    [use the presets from game/visuals/ @<:@default=no@:>@])],
    [with_local_projectM_presets=$withval], [with_local_projectM_presets="no"])

# add OpenCV option
AC_ARG_WITH([opencv],
    [AS_HELP_STRING([--with-opencv],
      [enable webcam support with OpenCV @<:@default=check@:>@])],
    [with_OpenCV=$withval], [with_OpenCV="check"])

# Backward-compatible spelling for the OpenCV package name used by PKG_HAVE.
AC_ARG_WITH([OpenCV], [],
    [with_OpenCV=$withval], [])

AC_ARG_WITH([opencv-cxx-api],
    [AS_HELP_STRING([--with-opencv-cxx-api],
      [(deprecated) alias for --with-opencv])],
    [case "$withval" in
        yes)  with_OpenCV=yes ;;
        no)   with_OpenCV=no ;;
        auto) with_OpenCV=check ;;
        *)    AC_MSG_ERROR([bad value "$withval" for --with-opencv-cxx-api]) ;;
     esac], [])

case "$with_OpenCV" in
    yes|no|check|nocheck) ;;
    auto) with_OpenCV=check ;;
    *) AC_MSG_ERROR([bad value "$with_OpenCV" for --with-opencv; use yes, no, check, auto, or nocheck]) ;;
esac

# print misc options header
AC_ARG_WITH([cfg-dummy2], [
Development options:])

# add DEPRECATED global and local options
AC_ARG_ENABLE(global, [AS_HELP_STRING([--enable-global], [(DEPRECATED, DO NOT USE]))])
AC_ARG_ENABLE(local, [AS_HELP_STRING([--enable-local], [(DEPRECATED, DO NOT USE]))])

if [[ x$enable_global != x -o x$enable_local != x ]]; then
   AC_MSG_NOTICE([

!!! NOTE: --enable-global and --enable-local are deprecated:
!!! - global build: just type "make" and "make install"
!!! - local  build: just type "make" and start "game/ultrastardx"
])
   sleep 2
fi

AC_ARG_ENABLE(debug,
  [AS_HELP_STRING([--enable-debug],
    [Enable debug build @<:@default=no@:>@])],
  [test $enableval = "yes" && ENABLE_DEBUG="yes"], [])
AC_SUBST(ENABLE_DEBUG)

# -----------------------------------------
# check for compilers
# -----------------------------------------

# find and test the freepascal compiler
# sets PFLAGS, FPC_VERSION, FPC_DEBUG, etc.
AC_PROG_FPC

if [[ "$FPC_VERSION_MAJOR" -lt 3 ]]; then
   AC_MSG_ERROR([
!!! fpc (the free Pascal compiler) is required in at least
!!! version 3.0.0, but only version $FPC_VERSION was found.
!!! Please install a newer fpc version.
]) 
fi

# find and test the C compiler (for C-libs and wrappers)
AC_PROG_CC
AC_LANG([C])

AC_PROG_RANLIB

# find pkg-config
PKG_PROG_PKG_CONFIG()
if [[ x$PKG_CONFIG = x ]]; then
   AC_MSG_ERROR([
!!! pkg-config was not found on your system. 
!!! It is needed to determine the versions of your libraries.
!!! Install it and try again.])
fi


# -----------------------------------------
# check for OS
# -----------------------------------------

if test x$FPC_PLATFORM = xdarwin; then
    AC_MACOS_VERSION
    
    if command -v brew >/dev/null 2>&1; then
        MACOS_PACKAGING="brew"
        MACOS_PACKAGING_LIBDIR="$(brew --prefix)/lib"
    else
        MACOS_PACKAGING="none"
        MACOS_PACKAGING_LIBDIR="/usr/local/lib"
        
        AC_MSG_WARN([
!!! Homebrew was not found. 
!!! It is highly recommended to install Homebrew on macOS to manage dependencies.
!!! Visit https://brew.sh for installation instructions.
!!! Proceeding with system default paths, which might fail.
        ])
    fi
    
    AC_SUBST([MACOS_PACKAGING])
    AC_SUBST([MACOS_PACKAGING_LIBDIR])
fi

# -----------------------------------------
# check for libraries
# -----------------------------------------

use_generated_config=yes
if test x$FPC_PLATFORM = xwin32 -o x$FPC_PLATFORM = xwin64; then
    use_generated_config=no
    AC_MSG_NOTICE([Using src/config-win.inc for Windows library configuration; skipping pkg-config checks for bundled runtime DLLs.])
    libprojectM_USE_CWRAPPER=no
    AC_SUBST(USE_PROJECTM_CWRAPPER, $libprojectM_USE_CWRAPPER)
    opencv_USE_CWRAPPER=yes
    AC_SUBST(USE_OPENCV_CWRAPPER, $opencv_USE_CWRAPPER)
else
# find sdl2
PKG_HAVE([sdl2], [sdl2], yes)

# find SDL2_image
PKG_HAVE([sdl2_image], [SDL2_image], yes)

# find freetype
PKG_HAVE([freetype], [freetype2], yes)

# find sqlite3
PKG_HAVE([sqlite3], [sqlite3], yes)

# find lua 5.5, 5.4, 5.3, 5.2 or 5.1
# (K)Ubuntu uses lua5.2.pc and lua5.1.pc, 
# macOS and other linux distributions use lua.pc
# Archlinux aur package for 5.3 use lua5.3.pc in order
# to make it work alongside the 5.2 version.

for i in 5.5 5.4 5.3 5.2 5.1 ; do
    PKG_HAVE([lua], [lua$i], check)
    if [[ x$lua_HAVE = xyes ]]; then
        lua_LIB_NAME="lua$i"
        PKG_VERSION([lua], [lua$i])
        break
    fi
done

if [[ x$lua_HAVE != xyes ]]; then
    PKG_HAVE([lua], [lua >= 5.1], yes)
    lua_LIB_NAME="lua"
    PKG_VERSION([lua], [lua])
fi
AC_MSG_CHECKING([size of lua_Integer])
PKG_VALUE([lua],[CFLAGS],[cflags],[$lua_LIB_NAME],[C compiler flags for Lua])
old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lua_CFLAGS"
AC_COMPUTE_INT([LUA_INTEGER_BITS],[(long)sizeof(lua_Integer)*8],[#include <lua.h>])
CFLAGS="$old_CFLAGS"
AC_SUBST(LUA_INTEGER_BITS)
AC_MSG_RESULT([$LUA_INTEGER_BITS bits])
lua_lib_candidates=
for i in $lua_LIBS ; do
	case "$i" in
	-l*) lua_lib_candidates="$lua_lib_candidates ${i#-l}"
	esac
done
old_LIBS=$LIBS
AC_SEARCH_LIBS([luaL_newstate], [$lua_lib_candidates], [lua_LIB_NAME=${ac_cv_search_luaL_newstate#-l}], [], [])
LIBS=$old_LIBS
AC_SUBST(lua_LIB_NAME)

# find FFMpeg
# Note: do not use the min/max version parameters with ffmpeg
# otherwise it might fail in ubuntu due to a wrong version number 
# format in ffmpeg's .pc-files.
# For example: 0d.51.1.2 instead of the correct 51.1.2.
#   A check for version >=52.0.0 will return version 0d.51.1.2 
#   although it is lower because pkg-config is confused by the 0d.
# Use [mylib]_VERSION_INT for version-checking instead
PKG_HAVE([libavcodec], [libavcodec], check)
# The following finds libavcodec.pc in its new location on macOS.
# It only takes the last from the list, assuming that this is the latest 
# version.
if [[ x$libavcodec_HAVE = xno -a x$FPC_PLATFORM = xdarwin ]]; then
    PKG_CONFIG_PATH="$MACOS_PACKAGING_LIBDIR/pkgconfig:$PKG_CONFIG_PATH"
    export PKG_CONFIG_PATH
    PKG_HAVE([libavcodec], [libavcodec], yes)
fi
PKG_VERSION([libavcodec], [libavcodec])
PKG_HAVE([libavformat], [libavformat], yes)
PKG_VERSION([libavformat], [libavformat])
PKG_HAVE([libavutil], [libavutil], yes)
PKG_VERSION([libavutil], [libavutil])
PKG_HAVE([libswscale], [libswscale], yes)
PKG_VERSION([libswscale], [libswscale])
PKG_HAVE([libswresample], [libswresample], yes)
PKG_VERSION([libswresample], [libswresample])

if [[ x$libavcodec_HAVE = xyes -a x$libavformat_HAVE = xyes -a x$libavutil_HAVE = xyes -a x$libswscale_HAVE = xyes -a x$libswresample_HAVE = xyes ]]; then
    ffmpeg_HAVE=yes
else
    ffmpeg_HAVE=no
fi
AC_SUBST_DEFINE(HAVE_FFMPEG, $ffmpeg_HAVE)

# map avutil library version to ffmpeg version
AC_MSG_CHECKING([version of ffmpeg])
# the order is ([avutil], [avcodec], [avformat], [swscale], [swresample])
if   FFMPEG_LIBS_COMPATIBLE([60008100], [62011100], [62003100], [9001100], [6001100]); then
    FFMPEG_VERSION="8.0"
elif   FFMPEG_LIBS_COMPATIBLE([59008100], [61003100], [61001100], [8001100], [5001100]); then
    FFMPEG_VERSION="7.0"
elif FFMPEG_LIBS_COMPATIBLE([58002100], [60003100], [60003100], [7001100], [4010100]); then
    FFMPEG_VERSION="6.0"
elif FFMPEG_LIBS_COMPATIBLE([57017100], [59018100], [59016100], [6004100], [4003100]); then
    FFMPEG_VERSION="5.0"
elif FFMPEG_LIBS_COMPATIBLE([56014100], [58018100], [58012100], [5001100], [3001100]); then
    FFMPEG_VERSION="4.0"
else
    AC_MSG_ERROR([

Unsupported ffmpeg version, most recent version supported is 8.0, oldest version supported is 4.0.
])
fi
AX_EXTRACT_VERSION(FFMPEG, $FFMPEG_VERSION)
AC_SUBST(FFMPEG_VERSION)
AC_MSG_RESULT(@<:@$FFMPEG_VERSION@:>@)

AC_MSG_NOTICE([Checking for C++ compiler])
AC_PROG_CXX
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([if C++ toolchain works])
cxx_works=no
use_cxx=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
		  [AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
				  [AC_MSG_RESULT([yes])
				   cxx_works=yes],
				  [AC_MSG_RESULT([linking C++ programs does not work])])],
		  [AC_MSG_RESULT([C++ compiler does not work])])
AC_LANG_POP([C++])

# find projectM version
libprojectM_PKG="libprojectM >= 1.0"
PKG_HAVE([libprojectM], [$libprojectM_PKG], no)
PKG_VERSION([libprojectM], [$libprojectM_PKG])
if [[ "$libprojectM_VERSION_MAJOR" -ge 3 ]] ; then
	AC_MSG_FAILURE([libprojectM >= 3 not yet supported])
fi
if [[ "$libprojectM_VERSION_MAJOR" -eq 1 ]] && [[ "${#libprojectM_VERSION_MAJOR}" -eq 2 ]] ; then
	# The official releases with major = 1 were 1.00, 1.01, 1.10, and 1.2.0.
	# So 1.10 is in fact 1.1.0 and also uses 1.1 in the ChangeLog file.
	libprojectM_VERSION_RELEASE="${libprojectM_VERSION_MINOR#?}"
	libprojectM_VERSION_MINOR="${libprojectM_VERSION_MINOR%?}"
fi
AC_SUBST_DEFINE(HAVE_PROJECTM, $libprojectM_HAVE)
# get projectM include-dir
PKG_VALUE([libprojectM], [INCLUDEDIR], [variable=includedir], [$libprojectM_PKG], 
          [C-Header include-dir (e.g. /usr/include)])
# get projectM data-dir (for preset- and font-dir)
PKG_VALUE([libprojectM], [DATADIR], [variable=pkgdatadir], [$libprojectM_PKG], 
          [projectM data-directory for presets etc. (e.g. /usr/share/projectM)])
# check if we need the c-wrapper
if [[ "$libprojectM_VERSION_MAJOR" -ge 1 ]]; then
    if [[ "$cxx_works" = yes ]] ; then
        libprojectM_USE_CWRAPPER=yes
        use_cxx=yes
    else
        AC_MSG_FAILURE([Need C++ compiler to build libprojectM wrapper])
    fi
else
    libprojectM_USE_CWRAPPER=no
fi
AC_SUBST(USE_PROJECTM_CWRAPPER, $libprojectM_USE_CWRAPPER)
AC_SUBST_DEFINE(USE_LOCAL_PROJECTM_PRESETS, $with_local_projectM_presets)

opencv_core_standalone=no
opencv_imgproc_standalone=no
opencv_videoio_standalone=no
OpenCV_WRAPPER_LIBS=
OpenCV_PKG=
opencv_USE_CWRAPPER=no
if [[ x$with_OpenCV != xno ]] ; then
    if [[ "$cxx_works" = yes ]] ; then
        AX_CXX_COMPILE_STDCXX([11], [], [optional])
        if [[ x$with_OpenCV = xnocheck ]] ; then
            OpenCV_HAVE=yes
        else
            CMAKE_FIND_PACKAGE([OpenCV], [CXX], [GNU], , [OpenCV_HAVE=yes], [OpenCV_HAVE=no])
            if [[ "$OpenCV_HAVE" != yes ]] ; then
                saved_with_OpenCV=$with_OpenCV
                with_OpenCV=check
                PKG_HAVE([OpenCV], [opencv4], no)
                if [[ "$OpenCV_HAVE" = yes ]] ; then
                    OpenCV_PKG=opencv4
                else
                    PKG_HAVE([OpenCV], [opencv >= 3.0.0], no)
                    if [[ "$OpenCV_HAVE" = yes ]] ; then
                        OpenCV_PKG="opencv >= 3.0.0"
                    fi
                fi
                with_OpenCV=$saved_with_OpenCV
                if [[ x$OpenCV_PKG != x ]] ; then
                    OpenCV_CXXFLAGS=`$PKG_CONFIG --cflags "$OpenCV_PKG"`
                fi
            fi
        fi
        if [[ "$OpenCV_HAVE" = yes ]] ; then
            opencv_USE_CWRAPPER=yes
            use_cxx=yes
            for lib in $OpenCV_LIBS ; do
                case "${lib##*/}" in
                *opencv_core*|*opencv_imgproc*|*opencv_videoio*)
                    OpenCV_WRAPPER_LIBS="$OpenCV_WRAPPER_LIBS $lib"
                    ;;
                *opencv_*)
                    ;;
                *)
                    OpenCV_WRAPPER_LIBS="$OpenCV_WRAPPER_LIBS $lib"
                    continue
                    ;;
                esac
                case "${lib##*/}" in
                *opencv_core*)    opencv_core_standalone=yes ;;
                *opencv_imgproc*) opencv_imgproc_standalone=yes ;;
                *opencv_videoio*) opencv_videoio_standalone=yes ;;
                *) continue ;;
                esac
                case "$lib" in
                -L)  LIBS="$LIBS $lib" ;;
                */*) LIBS="$LIBS -L${lib%/*}" ;;
                esac
            done
            AC_SUBST(OpenCV_CXXFLAGS)
            AC_SUBST(OpenCV_LIBS)
            AC_SUBST(OpenCV_WRAPPER_LIBS)
        elif [[ x$with_OpenCV = xyes ]] ; then
            AC_MSG_FAILURE([OpenCV was requested but not found])
        else
            AC_MSG_NOTICE([OpenCV not found; webcam support disabled])
        fi
    elif [[ x$with_OpenCV = xyes -o x$with_OpenCV = xnocheck ]] ; then
        AC_MSG_FAILURE([Need C++ compiler to build the OpenCV wrapper])
    else
        AC_MSG_NOTICE([C++ compiler is not available; webcam support disabled])
    fi
fi
AC_SUBST_DEFINE(USE_OPENCV_CWRAPPER, $opencv_USE_CWRAPPER)
AC_SUBST(USE_OPENCV_CWRAPPER, $opencv_USE_CWRAPPER)
AC_SUBST_DEFINE(OPENCV_CORE_STANDALONE, $opencv_core_standalone)
AC_SUBST_DEFINE(OPENCV_IMGPROC_STANDALONE, $opencv_imgproc_standalone)
AC_SUBST_DEFINE(OPENCV_VIDEOIO_STANDALONE, $opencv_videoio_standalone)

if [[ "$use_cxx" = yes ]] ; then
    # Hack to link to libstdc++ through libprojectM where needed
    # Of course only works if libprojectM is a shared library
    # --no-copy-dt-needed-entries is the default since Binutils 2.22
    if test x$ac_cv_prog_ppc_copy_dt_needed_entries = xyes ; then
        PFLAGS_EXTRA="$PFLAGS_EXTRA -k\"--copy-dt-needed-entries\""
    fi
fi

# find portaudio
PKG_HAVE([portaudio], [portaudio-2.0], no)
PKG_VERSION([portaudio], [portaudio-2.0])
AC_SUBST_DEFINE(HAVE_PORTAUDIO, $portaudio_HAVE)

# find portmixer
PKG_HAVE([portmixer], [portmixer], no)
AC_SUBST_DEFINE(HAVE_PORTMIXER, $portmixer_HAVE)

AC_ARG_ENABLE(portmidi, [AS_HELP_STRING([--disable-portmidi], [Disable PortTime Midi loop])])
AC_ARG_WITH(porttime, [AS_HELP_STRING([--with-porttime], [Use PortTime instead of SDL Midi loop])])


# Default to MIDI emulation on Linux and macOS unless --disable-midiemu is given
case "$host_os" in
    linux*|darwin*)
        default_midiemu=yes ;;
    *)
        default_midiemu=no ;;
esac
AC_ARG_ENABLE(midiemu, [AS_HELP_STRING([--enable-midiemu],[Enable built-in MIDI emulation backend (default on Linux/macOS)])],
    [enable_midiemu=$enableval],
    [enable_midiemu=$default_midiemu])

AC_ARG_ENABLE(disable-midiemu, [AS_HELP_STRING([--disable-midiemu],[Disable built-in MIDI emulation backend and use system MIDI backend if available])],
    [if test x$enableval = xyes; then enable_midiemu=no; fi])


if [[ x$enable_portmidi != xno ]] ; then
    AC_CHECK_LIB([portmidi], [Pm_Initialize], [
        portmidi_HAVE=yes
        if [[ x$with_porttime = xyes ]] ; then
            porttime_HAVE=yes
            AC_CHECK_LIB([portmidi], [Pt_Start], [porttime_LIB_NAME=portmidi],
                [AC_CHECK_LIB([porttime], [Pt_Start], [porttime_LIB_NAME=porttime],
                     [AC_MSG_ERROR([PortTime library not found])])])
        else
            porttime_HAVE=no
        fi
        ], [
        if [[ x$enable_portmidi = xyes ]] ; then
            AC_MSG_ERROR([PortMidi library not found])
        else
            portmidi_HAVE=no
        fi
        ])
else
	portmidi_HAVE=no
fi
AC_SUBST_DEFINE(HAVE_PORTMIDI, $portmidi_HAVE)
AC_SUBST_DEFINE(HAVE_PORTTIME, $porttime_HAVE)
AC_SUBST(porttime_LIB_NAME)
fi

## MIDI emulation backend
if [[ x$enable_midiemu = xyes ]] ; then
    midiemu_HAVE=yes
    PFLAGS_EXTRA="$PFLAGS_EXTRA -dUseMidiEmu"
    # Avoid platform MIDI backends with system synths if built-in MIDI emulation is enabled
    portmidi_HAVE=no
    porttime_HAVE=no
else
    midiemu_HAVE=no
fi
AC_SUBST_DEFINE(HAVE_MIDI_EMU, $midiemu_HAVE)
AC_SUBST(PFLAGS_EXTRA)

# determine linker-flags
if test x$FPC_PLATFORM = xdarwin; then
    LDFLAGS="-macos_version_min 10.8 -undefined dynamic_lookup -headerpad_max_install_names"
fi
#LIBS=
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)

# -----------------------------------------
# create output files
# -----------------------------------------

AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([src/Makefile])
if [[ "$use_generated_config" = yes ]]; then
    AC_CONFIG_FILES([src/config-$FPC_PLATFORM.inc:src/config.inc.in])
fi
if [[ x$libprojectM_USE_CWRAPPER = xyes ]]; then
    AC_CONFIG_FILES([src/lib/projectM/cwrapper/Makefile])
fi
if [[ x$opencv_USE_CWRAPPER = xyes ]]; then
    AC_CONFIG_FILES([src/lib/openCV3/Makefile])
fi
AC_OUTPUT

# -----------------------------------------
# show results
# -----------------------------------------

AC_MSG_NOTICE([

!!!
!!! Configuration of $PACKAGE_NAME $PACKAGE_VERSION done!
!!!
!!! Type "make" to compile and 
!!!      "make install" to install it afterwards.
!!!
!!! For further information on $PACKAGE_NAME visit:
!!!   $PACKAGE_WEBSITE
!!!
!!! In case you find a bug, please send a bug report to:
!!!   $PACKAGE_BUGREPORT
!!! You might as well ask for help on Discord
!!!   $PACKAGE_DISCORD
!!!
])

if test x$FPC_PLATFORM = xdarwin; then
    AC_MSG_NOTICE([
!!! Special target for macOS are:
!!! "make macos-standalone-app" to create a standalone .app
!!! "make macos-dmg" to create a dmg archive with standalone .app
!!! Packaging with $MACOS_PACKAGING and libdir $MACOS_PACKAGING_LIBDIR.
                   ])
fi

