From a407c6b24ded815eb10fcd29ca0a10a11a2b0491 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Tue, 18 Nov 2025 10:32:14 +0100 Subject: [PATCH 01/86] lavc: Fix r12l_to_gbrp12le conversion --- src/libavcodec/to_lavc_vid_conv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libavcodec/to_lavc_vid_conv.c b/src/libavcodec/to_lavc_vid_conv.c index e45a9a3973..3175fcd0db 100644 --- a/src/libavcodec/to_lavc_vid_conv.c +++ b/src/libavcodec/to_lavc_vid_conv.c @@ -1133,7 +1133,6 @@ static void r12l_to_gbrp16le(AVFrame * __restrict out_frame, const unsigned char static void r12l_to_gbrp12le(AVFrame * __restrict out_frame, const unsigned char * __restrict in_data, int width, int height) { r12l_to_gbrpXXle(out_frame, in_data, width, height, 12U); - memset(out_frame->data[1], 255, 5000); } static void rg48_to_gbrp12le(AVFrame * __restrict out_frame, const unsigned char * __restrict in_data, int width, int height) From 4e381b93241313dd49f83107e54cdcbf31c85c62 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 21 Nov 2025 11:51:46 +0100 Subject: [PATCH 02/86] create FIXES.md --- FIXES.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 FIXES.md diff --git a/FIXES.md b/FIXES.md new file mode 100644 index 0000000000..10a818bf42 --- /dev/null +++ b/FIXES.md @@ -0,0 +1,3 @@ +#### 1.10.1 + +* fix temporarily broken r12l_to_gbrp16le From 3503bb1ad3f067e1e31630fa16170f2b33c1559b Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 24 Nov 2025 13:28:41 +0100 Subject: [PATCH 03/86] AppImage: include libOpenGL.so.0 fallback Currently Ubuntu 25.10 live DVD (ubuntu-25.10-desktop-amd64.iso) does not include the library, preventing the GUI from being run. On the other hand, if used unconditionally, it causes the warning (even in the U25.10) for which it was removed: So preload the library if is in the system and use the bundled just as a fallback. --- data/scripts/Linux-AppImage/AppRun | 1 + data/scripts/Linux-AppImage/create-appimage.sh | 4 ++++ data/scripts/Linux-AppImage/scripts/preload.sh | 10 ++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/data/scripts/Linux-AppImage/AppRun b/data/scripts/Linux-AppImage/AppRun index a9fbe7eabb..213b51e5f3 100755 --- a/data/scripts/Linux-AppImage/AppRun +++ b/data/scripts/Linux-AppImage/AppRun @@ -368,6 +368,7 @@ setup_wayland # while portaudio is linked directly to JACK library set_ld_preload ultragrid_aplay_portaudio.so libjack set_ld_preload ultragrid_vidcap_pipewire.so libpipewire +set_ld_preload_exe "$AI_LIB_PATH/../bin/uv-qt" libOpenGL.so.0 ## @param $@ Date: Tue, 25 Nov 2025 13:45:00 +0100 Subject: [PATCH 04/86] CI macOS 14 (arm64) deployment fix It seems like libbrotlidec.1.dylib is dependency of Qt but incorrectly deployed by macdepoloyqt - just the library (that is symlink to libbrotlidec.1.2.dylib) but not its dependency @rpath/libbrotlicommon.1.dylib (+ fix path). Since libbrotlidec.1.2.dylib is already deployed and fixed as a dependency of uv (AFAIK through lavc->libjxl), just symlink that. fixes --- Makefile.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.in b/Makefile.in index edb0beb5dd..4cdd912d50 100644 --- a/Makefile.in +++ b/Makefile.in @@ -647,6 +647,13 @@ $(GUI_BUNDLE): $(BUNDLE) $(GUI_BUNDLE_DEP) | dylibbundler -of -cd -b -d $(GUI_BUNDLE)/Contents/libs \ -x $(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework/QtDBus;\ fi + # TODO TOREMOVE: also libbrotlidec.1.dylib seem to be copied with macdeployqt + # but without dependencies handled. However, the v1.2 (1.dylib is a symlink) is + # bundled/fixed by uv so use that. + if [ -f $(GUI_BUNDLE)/Contents/libs/libbrotlidec.1.dylib ]; then \ + cd $(GUI_BUNDLE)/Contents/libs/; rm libbrotlidec.1.dylib; \ + ln -s libbrotlidec*.dylib libbrotlidec.1.dylib; \ + fi defaults write `pwd`/$(GUI_BUNDLE)/Contents/Info.plist NSCameraUsageDescription \ 'Allow camera for video capture' From cd2eb43fb9520b2e96e534f75f93c54ee1c6b6a8 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 13 Nov 2025 12:00:00 +0100 Subject: [PATCH 05/86] updated FIXES.md --- FIXES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FIXES.md b/FIXES.md index 10a818bf42..4523e31676 100644 --- a/FIXES.md +++ b/FIXES.md @@ -1,3 +1,5 @@ #### 1.10.1 -* fix temporarily broken r12l_to_gbrp16le +* fix temporarily broken r12l_to_gbrp16le (GH-476) +* missing arm64 macOS dependency on brotlicommon (GH-478) +* add libOpenGL.0.so library fallback to Linux AppImage From 1daec22f47f68f75b525b5b203d70285ca29fc61 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Mon, 1 Dec 2025 12:46:13 +0100 Subject: [PATCH 06/86] vcap/pipewire: Fix screen capture --- FIXES.md | 1 + src/video_capture/pipewire.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/FIXES.md b/FIXES.md index 4523e31676..bab24c134a 100644 --- a/FIXES.md +++ b/FIXES.md @@ -3,3 +3,4 @@ * fix temporarily broken r12l_to_gbrp16le (GH-476) * missing arm64 macOS dependency on brotlicommon (GH-478) * add libOpenGL.0.so library fallback to Linux AppImage +* fix Pipewire screen capture not starting diff --git a/src/video_capture/pipewire.cpp b/src/video_capture/pipewire.cpp index 9d89089487..ac918f7f17 100644 --- a/src/video_capture/pipewire.cpp +++ b/src/video_capture/pipewire.cpp @@ -423,7 +423,7 @@ static int start_pipewire(vcap_pw_state *s) auto flags = PW_STREAM_FLAG_MAP_BUFFERS | PW_STREAM_FLAG_DONT_RECONNECT; - if(!s->user_options.target.empty()){ + if(!s->user_options.target.empty() || s->mode == vcap_pw_state::Mode::Screen_capture){ flags |= PW_STREAM_FLAG_AUTOCONNECT; } From 662aeb80db6c371fb75afe337281d7b004d0ac31 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 26 Nov 2025 09:27:01 +0100 Subject: [PATCH 07/86] vcomp/lavc: do not wrap the output for the output Long lines do not harm here but it will make unusable grepping like in: and GH-480. --- src/video_compress/libavcodec.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index c453228f20..5ecf337cb7 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -781,22 +781,22 @@ static int vaapi_init(struct AVCodecContext *s){ #endif void print_codec_supp_pix_fmts(const enum AVPixelFormat *first) { - char out[STR_LEN]; - snprintf(out, sizeof out, - MOD_NAME "Codec supported pixel formats: " TBOLD("%s"), - get_avpixfmts_names(first)); - LOG(LOG_LEVEL_VERBOSE) << wrap_paragraph(out) << TERM_RESET "\n"; + MSG(VERBOSE, "Codec supported pixel formats: " TBOLD("%s") "\n", + get_avpixfmts_names(first)); } void print_pix_fmts(const list &req_pix_fmts, const enum AVPixelFormat *first) { print_codec_supp_pix_fmts(first); - char out[STR_LEN] = MOD_NAME "Supported pixel formats:" TERM_BOLD; - for (auto &c : req_pix_fmts) { - snprintf(out + strlen(out), sizeof out - strlen(out), " %s", - av_get_pix_fmt_name(c)); + + enum AVPixelFormat pixfmts[AV_PIX_FMT_NB]; + enum AVPixelFormat *pixfmts_it = pixfmts; + for (const auto &c : req_pix_fmts) { + *pixfmts_it++ = c; } - LOG(LOG_LEVEL_VERBOSE) << wrap_paragraph(out) << TERM_RESET "\n"; + *pixfmts_it++ = AV_PIX_FMT_NONE; + MSG(VERBOSE, "Supported pixel formats: " TBOLD("%s") "\n", + get_avpixfmts_names(pixfmts)); } /** From 34418e7770abf0dbbca92409c9d18ff8d1dab667 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 25 Nov 2025 16:30:35 +0100 Subject: [PATCH 08/86] vdisp/sdl3: set render clear color Seems like Wayland driver seem to need to have this set explicitly for the eventual borders to be cleared correctly with SDL_RenderClear. Otherwise the eventual margins may not be cleared by SDL_RenderClear (tested with U25.10 live DVD with llvmpipe software renderer inside VM). --- src/video_display/sdl3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video_display/sdl3.c b/src/video_display/sdl3.c index aa55c6f06f..d76ab31670 100644 --- a/src/video_display/sdl3.c +++ b/src/video_display/sdl3.c @@ -869,6 +869,8 @@ display_sdl3_reconfigure_real(void *state, struct video_desc desc) MSG(ERROR, "Unable to create renderer: %s\n", SDL_GetError()); return false; } + SDL_CHECK( + SDL_SetRenderDrawColor(s->renderer, 0, 0, 0, SDL_ALPHA_OPAQUE)); if (s->vsync) { // try adaptive first, if it doesn't succeed try 1 if (!SDL_SetRenderVSync(s->renderer, From 2681ce654747672956fca5b5f4b03790feea22e0 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 26 Nov 2025 15:55:23 +0100 Subject: [PATCH 09/86] lavc: AV_PIX_FMT_YUVA444P12 !present compat + typo --- src/video_compress/libavcodec.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 5ecf337cb7..b51b9dc9f1 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -1761,7 +1761,9 @@ setparam_oapv(AVCodecContext */*codec_ctx*/, struct setparam_param *param) case AV_PIX_FMT_YUV444P10: profile = "444-10"; break; case AV_PIX_FMT_YUV444P12: profile = "444-12"; break; case AV_PIX_FMT_YUVA444P10: profile = "4444-10"; break; - case AV_PIX_FMT_YUVA444P12: profile = "4444-14"; break; +#ifdef AV_PIX_FMT_YUVA444P12 + case AV_PIX_FMT_YUVA444P12: profile = "4444-12"; break; +#endif // clang-format on default: MSG(WARNING, From 4390ab0386043a558e2f93fb9187a9030f25865a Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 4 Dec 2025 10:31:50 +0100 Subject: [PATCH 10/86] CI AJA: use release branch Use rather branch release instead of main because in main things may break sometimes. Eg. currently (libajantv2 commit 9060cc4a), ntv2m31enums.h is not installed but ntv2utils.h includes that. --- .github/scripts/install-common-deps.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/install-common-deps.sh b/.github/scripts/install-common-deps.sh index 6ceac9adf0..48d6a26ed4 100755 --- a/.github/scripts/install-common-deps.sh +++ b/.github/scripts/install-common-deps.sh @@ -36,7 +36,8 @@ cineform-0001-CMakeList.txt-remove-output-lib-name-force-UNIX.patch )} download_build_aja() { - git clone --depth 1 https://github.com/aja-video/libajantv2.git + aja_url=https://github.com/aja-video/libajantv2.git + git clone -b release --depth 1 $aja_url # TODO TOREMOVE this workarounds when not needed tr -d '\n' < libajantv2/VERSION.txt > ver-fix-no-NL$$.txt && mv ver-fix-no-NL$$.txt libajantv2/VERSION.txt From af37525456811ed57417b5e619735a930b6e5fa2 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 4 Dec 2025 14:36:57 +0100 Subject: [PATCH 11/86] configure.ac: fix avfoundation + ensure AV Foundation was never enabled due to a error in configure broken since f1745fba (2025-05-23) --- configure.ac | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 61e766aa1f..fdfe401c67 100644 --- a/configure.ac +++ b/configure.ac @@ -1288,7 +1288,7 @@ AC_ARG_ENABLE(avfoundation, [avfoundation_req=auto] ) -if test "$system?" = MacOSX && test "${avfoundation_req?}" != no +if test "${system?}" = MacOSX && test "${avfoundation_req?}" != no then AVFOUNDATION_LIB="-framework AppKit -framework AVFoundation -framework CoreMedia -framework CoreVideo" AVFOUNDATION_OBJ="src/video_capture/avfoundation.o" @@ -1296,6 +1296,9 @@ then avfoundation=yes fi +ENSURE_FEATURE_PRESENT([${avfoundation_req?}], [${avfoundation?}], + [AV Foundation not found]) + # ------------------------------------------------------------------------------ # SDL1/2/3 Stuff # ------------------------------------------------------------------------------ From d58cb2a59111c68aa4f5ca94363da92324a463c9 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 4 Dec 2025 16:49:59 +0100 Subject: [PATCH 12/86] CI delta SDK: output name explicitly When non-free SDK path is provided but the server curl automatic path with -O doesn't work (eg. the downloaded file name is passed in a GET variable). --- .github/scripts/Windows/prepare_msys.sh | 2 +- .github/workflows/ccpp.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/Windows/prepare_msys.sh b/.github/scripts/Windows/prepare_msys.sh index 0d66807d3f..8547992588 100644 --- a/.github/scripts/Windows/prepare_msys.sh +++ b/.github/scripts/Windows/prepare_msys.sh @@ -79,7 +79,7 @@ install_deltacast() {( mkdir VideoMaster cd VideoMaster filename=videomaster-win.x64-dev.zip - if curl -f -S "$SDK_URL/$filename" -O; then + if curl -f -S "$SDK_URL/$filename" -o $filename; then FEATURES="$FEATURES --enable-deltacast" echo "FEATURES=$FEATURES" >> "$GITHUB_ENV" unzip "$filename" diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 077bf0b64b..15db41f324 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -180,7 +180,7 @@ jobs: rm -rf ${{ env.SDK_NONFREE_PATH }} mkdir -p ${{ env.SDK_NONFREE_PATH }} cd ${{ env.SDK_NONFREE_PATH }} - curl -S -f -O "$SDK_URL/$DELTA_MAC_ARCHIVE" + curl -S -f "$SDK_URL/$DELTA_MAC_ARCHIVE" -o "$DELTA_MAC_ARCHIVE" - name: Run actions/cache for XIMEA id: cache-macos-ximea uses: actions/cache@main From dc4abb46c182cd6306c6605d84ef3679221e120c Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 5 Dec 2025 08:46:08 +0100 Subject: [PATCH 13/86] vdec/lavc: fix ProRes decode fixes decode broken since the commit 7dd9a44 (2025-10-23) refers to closes --- src/libavcodec/lavc_common.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/libavcodec/lavc_common.c b/src/libavcodec/lavc_common.c index 976684b7b4..60aaaaf6ba 100644 --- a/src/libavcodec/lavc_common.c +++ b/src/libavcodec/lavc_common.c @@ -64,17 +64,23 @@ static const struct { enum AVCodecID av; codec_t uv; } av_to_uv_map[] = { - { AV_CODEC_ID_H264, H264 }, - { AV_CODEC_ID_HEVC, H265 }, - { AV_CODEC_ID_MJPEG, JPEG }, - { AV_CODEC_ID_JPEG2000, J2K }, - { AV_CODEC_ID_VP8, VP8 }, - { AV_CODEC_ID_VP9, VP9 }, - { AV_CODEC_ID_HUFFYUV, HFYU }, - { AV_CODEC_ID_FFV1, FFV1 }, - { AV_CODEC_ID_AV1, AV1 }, - { AV_CODEC_ID_PRORES, PRORES }, - { AV_CODEC_ID_APV, APV }, + { AV_CODEC_ID_H264, H264 }, + { AV_CODEC_ID_HEVC, H265 }, + { AV_CODEC_ID_MJPEG, JPEG }, + { AV_CODEC_ID_JPEG2000, J2K }, + { AV_CODEC_ID_VP8, VP8 }, + { AV_CODEC_ID_VP9, VP9 }, + { AV_CODEC_ID_HUFFYUV, HFYU }, + { AV_CODEC_ID_FFV1, FFV1 }, + { AV_CODEC_ID_AV1, AV1 }, + { AV_CODEC_ID_PRORES, PRORES }, + { AV_CODEC_ID_PRORES, PRORES_4444 }, + { AV_CODEC_ID_PRORES, PRORES_4444_XQ }, + { AV_CODEC_ID_PRORES, PRORES_422_HQ }, + { AV_CODEC_ID_PRORES, PRORES_422 }, + { AV_CODEC_ID_PRORES, PRORES_422_PROXY }, + { AV_CODEC_ID_PRORES, PRORES_422_LT }, + { AV_CODEC_ID_APV, APV }, }; codec_t get_av_to_ug_codec(enum AVCodecID av_codec) From e710195825c802b6804e2e4223987470791ff3ee Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 5 Dec 2025 11:12:07 +0100 Subject: [PATCH 14/86] updated FIXES.md --- FIXES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FIXES.md b/FIXES.md index bab24c134a..ef3c7732e2 100644 --- a/FIXES.md +++ b/FIXES.md @@ -4,3 +4,6 @@ * missing arm64 macOS dependency on brotlicommon (GH-478) * add libOpenGL.0.so library fallback to Linux AppImage * fix Pipewire screen capture not starting +* build fixes +* reenable AV Foundation (not being enabled on macOS) +* fix decoding ProRes From c9cc2801bc1523ff4f521950f0e60f3ad973b8bd Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Thu, 20 Nov 2025 12:13:21 +0100 Subject: [PATCH 15/86] CI: Linux/SDL: Install xtest build dependency --- .github/scripts/Linux/install_sdl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/Linux/install_sdl.sh b/.github/scripts/Linux/install_sdl.sh index 40ef6b586e..bd1e298cdd 100755 --- a/.github/scripts/Linux/install_sdl.sh +++ b/.github/scripts/Linux/install_sdl.sh @@ -18,7 +18,7 @@ deps() { fluidsynth_build_dep=$(get_build_deps_excl libfluidsynth3 libsdl2-dev) sdl2_ttf_build_dep=$(get_build_deps_excl libsdl2-ttf libsdl2-dev) # shellcheck disable=SC2086 # intentional - sudo apt install $fluidsynth_build_dep $sdl2_ttf_build_dep + sudo apt install $fluidsynth_build_dep $sdl2_ttf_build_dep libxtst-dev } # build SDL, SDL_ttf and fluidsynth and also install them From 06d9fcd1498bdbdf7c0890ada7d80b36caab90ea Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 5 Dec 2025 11:12:39 +0100 Subject: [PATCH 16/86] UltraGrid 1.10.1 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fdfe401c67..c09ef4adae 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([UltraGrid],[1.10],[ultragrid-dev@cesnet.cz]) +AC_INIT([UltraGrid],[1.10.1],[ultragrid-dev@cesnet.cz]) configure_flags="$*" AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.10]) From ec066cf688cce9c13df6bf54a1135dac3c5e8ea3 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Fri, 2 Jan 2026 10:56:48 +0100 Subject: [PATCH 17/86] disp/vulkan: Fix crash on module message It was trying to get the state pointer from the module pointer, but the module isn't the first member in state. (cherry picked from commit ca04cb3e38b1a8d06f83420342f200fbd6916303) --- src/video_display/vulkan/vulkan_sdl3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_display/vulkan/vulkan_sdl3.cpp b/src/video_display/vulkan/vulkan_sdl3.cpp index 297c2cf50f..34ee09e2e3 100644 --- a/src/video_display/vulkan/vulkan_sdl3.cpp +++ b/src/video_display/vulkan/vulkan_sdl3.cpp @@ -201,6 +201,7 @@ struct state_vulkan_sdl3 { module_init_default(&mod); mod.new_message = display_vulkan_new_message; mod.cls = MODULE_CLASS_DATA; + mod.priv_data = this; module_register(&mod, parent); sdl_user_new_message_event = SDL_RegisterEvents(1); @@ -1002,7 +1003,7 @@ bool display_vulkan_get_property(void* state, int property, void* val, size_t* l } void display_vulkan_new_message(module* mod) { - auto s = reinterpret_cast(mod); + auto s = reinterpret_cast(mod->priv_data); assert(s->magic == magic_vulkan_sdl3); SDL_Event event{}; From 1b0c29a0ca10bfb6df73630d47ac2353a989a6ed Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Fri, 2 Jan 2026 11:30:55 +0100 Subject: [PATCH 18/86] Update FIXES.md --- FIXES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FIXES.md b/FIXES.md index ef3c7732e2..12c80c659d 100644 --- a/FIXES.md +++ b/FIXES.md @@ -1,3 +1,7 @@ +#### 1.10.2 + +* fix Vulkan display crashing on keypresses in console + #### 1.10.1 * fix temporarily broken r12l_to_gbrp16le (GH-476) From 761ce6b85889ef6439b3c2722aa1b069605e515a Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 5 Dec 2025 11:35:34 +0100 Subject: [PATCH 19/86] macos-wrapper: ensure os release according to arch x86_64 now builds on macOS 13 while arm64 on macOS 14 --- data/scripts/macos-wrapper | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/data/scripts/macos-wrapper b/data/scripts/macos-wrapper index 6f1e587786..83fde35b33 100755 --- a/data/scripts/macos-wrapper +++ b/data/scripts/macos-wrapper @@ -2,10 +2,24 @@ MACOS_VER_MAJOR=$(uname -r | cut -f 1 -d .) -MSG="Please use an alternative build for macOS older than 13, available at: +req_macos_arm64=14 +req_darwin_arm64=23 + +req_macos_x86_64=13 +req_darwin_x86_64=22 + +if [ "$(uname -m)" = arm64 ]; then + req_macos=$req_macos_arm64 + req_darwin=$req_darwin_arm64 +else + req_macos=$req_macos_x86_64 + req_darwin=$req_darwin_x86_64 +fi + +MSG="Please use an alternative build for macOS older than ${req_macos:?}, available at: https://github.com/CESNET/UltraGrid/releases/download/continuous/UltraGrid-nightly-alt.dmg" -if [ "$MACOS_VER_MAJOR" -lt 22 ]; then +if [ "$MACOS_VER_MAJOR" -lt "${req_darwin:?}" ]; then BASENAME=$(basename "$0") if [ "$BASENAME" = uv-qt ]; then osascript -e "tell application \"SystemUIServer\" From eec97817f87fd95ac273c0c99ae399aeebcaf3e5 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 5 Dec 2025 11:49:42 +0100 Subject: [PATCH 20/86] rework macos-wrapper generate the run-time dependency according to the build system, not hard-coded The advantage for CI is that it does no longer need to be upgraded every time the GH runner was updated. This also generalizes for non-CI builds, when the build macOS version can obviously differ from the CI macos runner. Do not use both Darwin and macOS version, use just macOS ver. --- Makefile.in | 2 +- .../{macos-wrapper => gen-macos-wrapper.sh} | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) rename data/scripts/{macos-wrapper => gen-macos-wrapper.sh} (55%) diff --git a/Makefile.in b/Makefile.in index 4cdd912d50..484f027b52 100644 --- a/Makefile.in +++ b/Makefile.in @@ -626,7 +626,7 @@ $(GUI_BUNDLE): $(BUNDLE) $(GUI_BUNDLE_DEP) if expr $$n : '.*-real$$' >/dev/null || expr $$n : '.*\.sh$$' >/dev/null || \ [ !-f $$n ]; then continue; fi; \ mv -f $$n $$n-real; dsymutil $$n-real; \ - $(CP) -f $(srcdir)/data/scripts/macos-wrapper $$n; \ + $(srcdir)/data/scripts/gen-macos-wrapper.sh > $$n; chmod 755 $$n; \ done; \ fi diff --git a/data/scripts/macos-wrapper b/data/scripts/gen-macos-wrapper.sh similarity index 55% rename from data/scripts/macos-wrapper rename to data/scripts/gen-macos-wrapper.sh index 83fde35b33..7503b37911 100755 --- a/data/scripts/macos-wrapper +++ b/data/scripts/gen-macos-wrapper.sh @@ -1,25 +1,24 @@ #!/bin/sh -eu -MACOS_VER_MAJOR=$(uname -r | cut -f 1 -d .) +cat << 'EOF' +#!/bin/sh -eu -req_macos_arm64=14 -req_darwin_arm64=23 +EOF -req_macos_x86_64=13 -req_darwin_x86_64=22 +# req_macos is evaluated during the build (EOF not in '') +cat << EOF +req_macos=$(sw_vers -productVersion | cut -d. -f1) -if [ "$(uname -m)" = arm64 ]; then - req_macos=$req_macos_arm64 - req_darwin=$req_darwin_arm64 -else - req_macos=$req_macos_x86_64 - req_darwin=$req_darwin_x86_64 -fi +EOF + +# following macos var will be evaluated on run-time +cat << 'EOF' +macos=$(sw_vers -productVersion | cut -d. -f1) MSG="Please use an alternative build for macOS older than ${req_macos:?}, available at: https://github.com/CESNET/UltraGrid/releases/download/continuous/UltraGrid-nightly-alt.dmg" -if [ "$MACOS_VER_MAJOR" -lt "${req_darwin:?}" ]; then +if [ "${macos:?}" -lt "${req_macos:?}" ]; then BASENAME=$(basename "$0") if [ "$BASENAME" = uv-qt ]; then osascript -e "tell application \"SystemUIServer\" @@ -32,3 +31,4 @@ end" fi exec "$0-real" "$@" +EOF From d241fedb41bb998bb6ef8c3f3905b7d7a6ccd600 Mon Sep 17 00:00:00 2001 From: armelvil <103518994+armelvil@users.noreply.github.com> Date: Mon, 15 Dec 2025 12:26:00 -0500 Subject: [PATCH 21/86] Update hd-rum-translator.cpp - fix typo - fix "c" to "n" in case statement line 669 --- src/hd-rum-translator/hd-rum-translator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hd-rum-translator/hd-rum-translator.cpp b/src/hd-rum-translator/hd-rum-translator.cpp index d33c798f05..ca60d8bf16 100644 --- a/src/hd-rum-translator/hd-rum-translator.cpp +++ b/src/hd-rum-translator/hd-rum-translator.cpp @@ -655,7 +655,7 @@ static int parse_global_opts(int argc, char **argv, { "verbose", optional_argument, nullptr, 'V'}, { "capabilities", no_argument, nullptr, 'b'}, { "help", no_argument, nullptr, 'h'}, - { "contol-port", required_argument, nullptr, 'n'}, + { "control-port", required_argument, nullptr, 'n'}, { "conference", required_argument, nullptr, 'r'}, { "version", no_argument, nullptr, 'v'}, { nullptr, 0, nullptr, 0 } @@ -666,7 +666,7 @@ static int parse_global_opts(int argc, char **argv, while ((ch = getopt_long(argc, argv, optstring, getopt_options, nullptr)) != -1) { switch (ch) { - case 'c': + case 'n': parsed->control_port = stoi(optarg); parsed->control_connection_type = 0; if (strchr(optarg, ':') != nullptr) { From 1d91f55bcf3ed467246709f698e40377d57583bc Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 5 Dec 2025 11:05:21 +0100 Subject: [PATCH 22/86] CI: use macos-15-intel screen must be disabled here because the Core Graphics API for screen capture is being deprecated/removed in macOS 15. closes --- .github/scripts/environment.sh | 4 ++++ .github/workflows/ccpp.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/scripts/environment.sh b/.github/scripts/environment.sh index cc6d1619fd..792eb00e58 100644 --- a/.github/scripts/environment.sh +++ b/.github/scripts/environment.sh @@ -104,6 +104,10 @@ case "$RUNNER_OS" in --enable-libbacktrace \ --enable-syphon \ " + macos_major=$(sw_vers -productVersion | cut -d. -f1) + if [ "$macos_major" -ge 15 ]; then + FEATURES="$FEATURES --disable-screen" + fi ;; Windows) FEATURES="$FEATURES $CUDA_FEATURES --enable-dshow --enable-spout --enable-wasapi" diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 15db41f324..a08fa352aa 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -144,7 +144,7 @@ jobs: needs: prepare strategy: matrix: - os: [macos-13, macos-14] + os: [macos-15-intel, macos-14] fail-fast: false runs-on: ${{ matrix.os }} env: From f1384bdec74dbb973fcb29774d3092304db59816 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Tue, 6 Jan 2026 13:58:43 +0100 Subject: [PATCH 23/86] disp/gl: Fix cursor hide keybind Now it shows correctly in help and also works through terminal (cherry picked from commit 59c2f5b97415f282ac56cf8d244f9de9939fe998) --- src/video_display/gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_display/gl.cpp b/src/video_display/gl.cpp index f7449904ce..364c1619b3 100644 --- a/src/video_display/gl.cpp +++ b/src/video_display/gl.cpp @@ -361,7 +361,7 @@ static constexpr pair keybindings[] = { pair{K_ALT('d'), "toggle deinterlace"}, pair{K_ALT('p'), "pause video"}, pair{K_ALT('s'), "screenshot"}, - pair{K_ALT('c'), "show/hide cursor"}, + pair{K_ALT('m'), "force show/hide cursor (default is autohide when not moving)"}, pair{K_CTRL_DOWN, "make window 10% smaller"}, pair{K_CTRL_UP, "make window 10% bigger"} }; From 27896831041183986936408892de0e693f4549ed Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Tue, 6 Jan 2026 14:14:25 +0100 Subject: [PATCH 24/86] Update FIXES.md --- FIXES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FIXES.md b/FIXES.md index 12c80c659d..855f0724e8 100644 --- a/FIXES.md +++ b/FIXES.md @@ -1,6 +1,8 @@ #### 1.10.2 * fix Vulkan display crashing on keypresses in console +* fix GL display show/hide cursor keybind +* fix control port argument in hd-rum-translator #### 1.10.1 From 671f6181873ffced10becba10cb4e5be58cc61a9 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 2 Jan 2026 15:45:59 +0100 Subject: [PATCH 25/86] disp/vulkan_sdl2: fix crash on message ported the commit ca04cb3e3 from vulkan_sdl3 --- src/video_display/vulkan/vulkan_sdl2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/video_display/vulkan/vulkan_sdl2.cpp b/src/video_display/vulkan/vulkan_sdl2.cpp index e8324bbd10..8f98e58c1a 100644 --- a/src/video_display/vulkan/vulkan_sdl2.cpp +++ b/src/video_display/vulkan/vulkan_sdl2.cpp @@ -6,7 +6,7 @@ * @author Martin Bela <492789@mail.muni.cz> */ /* - * Copyright (c) 2018-2025 CESNET + * Copyright (c) 2018-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -206,6 +206,7 @@ struct state_vulkan_sdl2 { explicit state_vulkan_sdl2(module* parent) { module_init_default(&mod); mod.new_message = display_vulkan_new_message; + mod.priv_data = this; mod.cls = MODULE_CLASS_DATA; module_register(&mod, parent); @@ -973,7 +974,7 @@ bool display_vulkan_get_property(void* state, int property, void* val, size_t* l } void display_vulkan_new_message(module* mod) { - auto s = reinterpret_cast(mod); + auto s = reinterpret_cast(mod->priv_data); assert(s->magic == magic_vulkan_sdl2); SDL_Event event{}; From 6e56a15439579a6b807c10460b4f53d0184074a0 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 26 Nov 2025 13:28:33 +0100 Subject: [PATCH 26/86] to_lav_vid_conv: add r12l_to_p210le refers to --- src/libavcodec/lavc_common.h | 2 + src/libavcodec/to_lavc_vid_conv.c | 113 ++++++++++++++++++++++++++++++ src/libavcodec/to_lavc_vid_conv.h | 4 +- 3 files changed, 117 insertions(+), 2 deletions(-) diff --git a/src/libavcodec/lavc_common.h b/src/libavcodec/lavc_common.h index db0fb8b3ae..9a350f0433 100644 --- a/src/libavcodec/lavc_common.h +++ b/src/libavcodec/lavc_common.h @@ -44,6 +44,7 @@ extern "C" { #endif +// IWYU pragma: begin_exports #include #include #include @@ -51,6 +52,7 @@ extern "C" { #include #include #include +// IWYU pragma: end_exports #ifdef __cplusplus } diff --git a/src/libavcodec/to_lavc_vid_conv.c b/src/libavcodec/to_lavc_vid_conv.c index 3175fcd0db..28a57ee88c 100644 --- a/src/libavcodec/to_lavc_vid_conv.c +++ b/src/libavcodec/to_lavc_vid_conv.c @@ -729,6 +729,7 @@ static inline void r12l_to_yuv4XXpYYle(int depth, bool out_422, AVFrame * __rest src += 4; } } +#undef WRITE_RES } static void r12l_to_yuv444p10le(AVFrame * __restrict out_frame, const unsigned char * __restrict in_data, int width, int height) @@ -761,6 +762,115 @@ static void r12l_to_yuv422p16le(AVFrame * __restrict out_frame, const unsigned c r12l_to_yuv4XXpYYle(16, true, out_frame, in_data, width, height); } +#if P210_PRESENT +// copied from r12l_to_yuv4XXpYYle +static void +r12l_to_p210le(AVFrame *__restrict out_frame, + const unsigned char *__restrict in_data, int width, int height) +{ + assert((uintptr_t) out_frame->linesize[0] % 2 == 0); + assert((uintptr_t) out_frame->linesize[1] % 2 == 0); + + const struct color_coeffs cfs = *get_color_coeffs(CS_DFL, DEPTH10); +#define WRITE_RES(idx) \ + res_y = (RGB_TO_Y(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + (1 << (DEPTH16 - 4)); \ + *dst_y++ = CLAMP_LIMITED_Y(res_y, DEPTH16); \ + if ((idx) % 2 == 0) { \ + res_cb = \ + (RGB_TO_CB(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + (1 << (DEPTH16 - 1)); \ + res_cr = \ + (RGB_TO_CR(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + (1 << (DEPTH16 - 1)); \ + *dst_cbcr++ = CLAMP_LIMITED_CBCR(res_cb, depth); \ + *dst_cbcr++ = CLAMP_LIMITED_CBCR(res_cr, depth); \ + } + + const int src_linesize = vc_get_linesize(width, R12L); + for (int y = 0; y < height; ++y) { + const unsigned char *src = in_data + y * src_linesize; + uint16_t *dst_y = (uint16_t *)(void *) (out_frame->data[0] + out_frame->linesize[0] * y); + uint16_t *dst_cbcr = (uint16_t *)(void *) (out_frame->data[1] + out_frame->linesize[1] * y); + + OPTIMIZED_FOR (int x = 0; x < width; x += 8) { + comp_type_t r = 0; + comp_type_t g = 0; + comp_type_t b = 0; + comp_type_t res_y = 0; + comp_type_t res_cb = 0; + comp_type_t res_cr = 0; + + r = src[BYTE_SWAP(0)]; + r |= (src[BYTE_SWAP(1)] & 0xF) << 8; + g = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // g0 + b = src[BYTE_SWAP(3)]; + src += 4; + + b |= (src[BYTE_SWAP(0)] & 0xF) << 8; + WRITE_RES(0) + r = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // r1 + g = src[BYTE_SWAP(2)]; + g |= (src[BYTE_SWAP(3)] & 0xF) << 8; + b = src[BYTE_SWAP(3)] >> 4; + src += 4; + + b |= src[BYTE_SWAP(0)] << 4; // b1 + WRITE_RES(1) + r = src[BYTE_SWAP(1)]; + r |= (src[BYTE_SWAP(2)] & 0xF) << 8; + g = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // g2 + src += 4; + + b = src[BYTE_SWAP(0)]; + b |= (src[BYTE_SWAP(1)] & 0xF) << 8; + WRITE_RES(2) + r = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // r3 + g = src[BYTE_SWAP(3)]; + src += 4; + + g |= (src[BYTE_SWAP(0)] & 0xF) << 8; + b = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // b3 + WRITE_RES(3) + r = src[BYTE_SWAP(2)]; + r |= (src[BYTE_SWAP(3)] & 0xF) << 8; + g = src[BYTE_SWAP(3)] >> 4; + src += 4; + + g |= src[BYTE_SWAP(0)] << 4; // g4 + b = src[BYTE_SWAP(1)]; + b |= (src[BYTE_SWAP(2)] & 0xF) << 8; + WRITE_RES(4) + r = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // r5 + src += 4; + + g = src[BYTE_SWAP(0)]; + g |= (src[BYTE_SWAP(1)] & 0xF) << 8; + b = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // b5 + WRITE_RES(5) + r = src[BYTE_SWAP(3)]; + src += 4; + + r |= (src[BYTE_SWAP(0)] & 0xF) << 8; + g = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // g6 + b = src[BYTE_SWAP(2)]; + b |= (src[BYTE_SWAP(3)] & 0xF) << 8; + WRITE_RES(6) + r = src[BYTE_SWAP(3)] >> 4; + src += 4; + + r |= src[BYTE_SWAP(0)] << 4; // r7 + g = src[BYTE_SWAP(1)]; + g |= (src[BYTE_SWAP(2)] & 0xF) << 8; + b = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // b7 + WRITE_RES(7) + src += 4; + } + } +#undef WRITE_RES +} +#endif // P210_PRESENT + /// @brief Converts RG48 to yuv444p 10/12/14 le #if defined __GNUC__ static inline void rg48_to_yuv444pXXle(int depth, AVFrame * __restrict out_frame, const unsigned char * __restrict in_data, int width, int height) @@ -1195,6 +1305,9 @@ static const struct uv_to_av_conversion *get_uv_to_av_conversions() { { R12L, AV_PIX_FMT_YUV422P10LE, r12l_to_yuv422p10le }, { R12L, AV_PIX_FMT_YUV422P12LE, r12l_to_yuv422p12le }, { R12L, AV_PIX_FMT_YUV422P16LE, r12l_to_yuv422p16le }, +#if P210_PRESENT + { R12L, AV_PIX_FMT_P210LE, r12l_to_p210le }, +#endif // defined P210_PRESENT { RG48, AV_PIX_FMT_YUV444P10LE, rg48_to_yuv444p10le }, { RG48, AV_PIX_FMT_YUV444P12LE, rg48_to_yuv444p12le }, { RG48, AV_PIX_FMT_YUV444P16LE, rg48_to_yuv444p16le }, diff --git a/src/libavcodec/to_lavc_vid_conv.h b/src/libavcodec/to_lavc_vid_conv.h index d5932718bc..29d9adec8c 100644 --- a/src/libavcodec/to_lavc_vid_conv.h +++ b/src/libavcodec/to_lavc_vid_conv.h @@ -6,7 +6,7 @@ * @sa from_lavc_vid_conv.h */ /* - * Copyright (c) 2013-2023 CESNET, z. s. p. o. + * Copyright (c) 2013-2025 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ #define LIBAVCODEC_TO_LAVC_VID_CONV_0C22E28C_A3F1_489D_87DC_E56D76E3598B #include "libavcodec/lavc_common.h" -#include "video_codec.h" +#include "types.h" // for codec_t #ifdef __cplusplus extern "C" { From a6ab9ed8bbd4602815491b11f8fddcf3e8306b8c Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 26 Nov 2025 14:30:10 +0100 Subject: [PATCH 27/86] vcomp/lavc: hevc_videotoolbox: enforce rext profile Otherwise encoding 4:2:0 will be used by the encoder - if not specified, the default profile is Main10, which is 4:2:0. The only option to get 4:2:2 is to use AV_PROFILE_HEVC_REXT. Only remaining is Main, which isn't suitable neither for UYVY if we don't want to reduce subsampling. --- src/video_compress/libavcodec.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index b51b9dc9f1..d2c4a41c13 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -1986,6 +1986,17 @@ static void configure_qsv_h264_hevc(AVCodecContext *codec_ctx, struct setparam_p } } +static void +configure_videotoolbox_hevc(AVCodecContext * /*codec_ctx*/, + struct setparam_param *param) +{ + if (param->lavc_opts.find("profile") == param->lavc_opts.end()) { + // enforce AV_PROFILE_HEVC_REXT, otherwise we will get Main10 + // profile (10-bit 4:2:0) - even for UYVY + param->lavc_opts["profile"] = "rext"; + } +} + static void configure_vaapi(AVCodecContext * /* codec_ctx */, struct setparam_param *param) { param->thread_mode = "no"; // VA-API doesn't support threads // interesting options: "b_depth" (not used - we are not using B-frames), "idr_interval" - set to 0 by default @@ -2198,6 +2209,8 @@ static void setparam_h264_h265_av1(AVCodecContext *codec_ctx, struct setparam_pa } else if (strcmp(codec_ctx->codec->name, "h264_qsv") == 0 || strcmp(codec_ctx->codec->name, "hevc_qsv") == 0) { configure_qsv_h264_hevc(codec_ctx, param); + } else if (strcmp(codec_ctx->codec->name, "hevc_videotoolbox") == 0) { + configure_videotoolbox_hevc(codec_ctx, param); } else if (strcmp(codec_ctx->codec->name, "libaom-av1") == 0) { configure_aom_av1(codec_ctx, param); } else if (strcmp(codec_ctx->codec->name, "librav1e") == 0) { From 774df9408e4a1ec0df55cb06fdd9dd161dcc3b3f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 26 Nov 2025 15:13:12 +0100 Subject: [PATCH 28/86] vcomp/lavc: videotoolbox_hevc: honor :subsampling opt --- src/video_compress/libavcodec.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index d2c4a41c13..6c7550946b 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -65,6 +65,7 @@ #include "rtp/rtpdec_h264.h" #include "rtp/rtpenc_h264.h" #include "tv.h" +#include "types.h" // for UYVY, RGBA, v210, RGB #include "ug_runtime_error.hpp" #include "utils/color_out.h" #include "utils/debug.h" // for debug_file_dump @@ -1993,7 +1994,16 @@ configure_videotoolbox_hevc(AVCodecContext * /*codec_ctx*/, if (param->lavc_opts.find("profile") == param->lavc_opts.end()) { // enforce AV_PROFILE_HEVC_REXT, otherwise we will get Main10 // profile (10-bit 4:2:0) - even for UYVY - param->lavc_opts["profile"] = "rext"; + const char *profile = "rext"; + // but user may requested :subsampling=420 -> use main[10] : + if (av_pixfmt_get_subsampling(param->av_pix_fmt) == SUBS_420) { + profile = av_pix_fmt_desc_get(param->av_pix_fmt) + ->comp[0] + .depth == DEPTH8 + ? "main" + : "main10"; + } + param->lavc_opts["profile"] = profile; } } From f5d3f03139b3ca725385223fbd051025e632f88d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 26 Nov 2025 15:33:16 +0100 Subject: [PATCH 29/86] to_lavc_vid_conv: add r12l_to_ayuv64le refers to --- src/libavcodec/to_lavc_vid_conv.c | 105 ++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/src/libavcodec/to_lavc_vid_conv.c b/src/libavcodec/to_lavc_vid_conv.c index 28a57ee88c..fe52f77470 100644 --- a/src/libavcodec/to_lavc_vid_conv.c +++ b/src/libavcodec/to_lavc_vid_conv.c @@ -871,6 +871,110 @@ r12l_to_p210le(AVFrame *__restrict out_frame, } #endif // P210_PRESENT +// copied from r12l_to_p210le +static void +r12l_to_ayuv64le(AVFrame *__restrict out_frame, + const unsigned char *__restrict in_data, int width, int height) +{ + assert((uintptr_t) out_frame->linesize[0] % 2 == 0); + + const struct color_coeffs cfs = *get_color_coeffs(CS_DFL, DEPTH16); +#define WRITE_RES(idx) \ + *dst++ = 0xffff; /* alpha */ \ + res_y = (RGB_TO_Y(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + (1 << (DEPTH16 - 4)); \ + *dst++ = CLAMP_LIMITED_Y(res_y, DEPTH16); \ + res_cb = \ + (RGB_TO_CB(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + (1 << (DEPTH16 - 1)); \ + res_cr = \ + (RGB_TO_CR(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + (1 << (DEPTH16 - 1)); \ + *dst++ = CLAMP_LIMITED_CBCR(res_cb, depth); \ + *dst++ = CLAMP_LIMITED_CBCR(res_cr, depth); \ + + const int src_linesize = vc_get_linesize(width, R12L); + for (int y = 0; y < height; ++y) { + const unsigned char *src = in_data + y * src_linesize; + uint16_t *dst = (uint16_t *)(void *) (out_frame->data[0] + out_frame->linesize[0] * y); + + OPTIMIZED_FOR (int x = 0; x < width; x += 8) { + comp_type_t r = 0; + comp_type_t g = 0; + comp_type_t b = 0; + comp_type_t res_y = 0; + comp_type_t res_cb = 0; + comp_type_t res_cr = 0; + + r = src[BYTE_SWAP(0)]; + r |= (src[BYTE_SWAP(1)] & 0xF) << 8; + g = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // g0 + b = src[BYTE_SWAP(3)]; + src += 4; + + b |= (src[BYTE_SWAP(0)] & 0xF) << 8; + WRITE_RES(0) + r = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // r1 + g = src[BYTE_SWAP(2)]; + g |= (src[BYTE_SWAP(3)] & 0xF) << 8; + b = src[BYTE_SWAP(3)] >> 4; + src += 4; + + b |= src[BYTE_SWAP(0)] << 4; // b1 + WRITE_RES(1) + r = src[BYTE_SWAP(1)]; + r |= (src[BYTE_SWAP(2)] & 0xF) << 8; + g = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // g2 + src += 4; + + b = src[BYTE_SWAP(0)]; + b |= (src[BYTE_SWAP(1)] & 0xF) << 8; + WRITE_RES(2) + r = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // r3 + g = src[BYTE_SWAP(3)]; + src += 4; + + g |= (src[BYTE_SWAP(0)] & 0xF) << 8; + b = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // b3 + WRITE_RES(3) + r = src[BYTE_SWAP(2)]; + r |= (src[BYTE_SWAP(3)] & 0xF) << 8; + g = src[BYTE_SWAP(3)] >> 4; + src += 4; + + g |= src[BYTE_SWAP(0)] << 4; // g4 + b = src[BYTE_SWAP(1)]; + b |= (src[BYTE_SWAP(2)] & 0xF) << 8; + WRITE_RES(4) + r = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // r5 + src += 4; + + g = src[BYTE_SWAP(0)]; + g |= (src[BYTE_SWAP(1)] & 0xF) << 8; + b = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // b5 + WRITE_RES(5) + r = src[BYTE_SWAP(3)]; + src += 4; + + r |= (src[BYTE_SWAP(0)] & 0xF) << 8; + g = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // g6 + b = src[BYTE_SWAP(2)]; + b |= (src[BYTE_SWAP(3)] & 0xF) << 8; + WRITE_RES(6) + r = src[BYTE_SWAP(3)] >> 4; + src += 4; + + r |= src[BYTE_SWAP(0)] << 4; // r7 + g = src[BYTE_SWAP(1)]; + g |= (src[BYTE_SWAP(2)] & 0xF) << 8; + b = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // b7 + WRITE_RES(7) + src += 4; + } + } +#undef WRITE_RES +} + /// @brief Converts RG48 to yuv444p 10/12/14 le #if defined __GNUC__ static inline void rg48_to_yuv444pXXle(int depth, AVFrame * __restrict out_frame, const unsigned char * __restrict in_data, int width, int height) @@ -1308,6 +1412,7 @@ static const struct uv_to_av_conversion *get_uv_to_av_conversions() { #if P210_PRESENT { R12L, AV_PIX_FMT_P210LE, r12l_to_p210le }, #endif // defined P210_PRESENT + { R12L, AV_PIX_FMT_AYUV64LE, r12l_to_ayuv64le }, { RG48, AV_PIX_FMT_YUV444P10LE, rg48_to_yuv444p10le }, { RG48, AV_PIX_FMT_YUV444P12LE, rg48_to_yuv444p12le }, { RG48, AV_PIX_FMT_YUV444P16LE, rg48_to_yuv444p16le }, From 7edd4f5b6e8362efd440a2042f52746df75a9c7f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 26 Nov 2025 16:58:53 +0100 Subject: [PATCH 30/86] to_lavc_vid_conv: reindent the recent 2 convs --- src/libavcodec/to_lavc_vid_conv.c | 266 ++++++++++++++++-------------- 1 file changed, 145 insertions(+), 121 deletions(-) diff --git a/src/libavcodec/to_lavc_vid_conv.c b/src/libavcodec/to_lavc_vid_conv.c index fe52f77470..2a31dffbe5 100644 --- a/src/libavcodec/to_lavc_vid_conv.c +++ b/src/libavcodec/to_lavc_vid_conv.c @@ -790,81 +790,95 @@ r12l_to_p210le(AVFrame *__restrict out_frame, const int src_linesize = vc_get_linesize(width, R12L); for (int y = 0; y < height; ++y) { const unsigned char *src = in_data + y * src_linesize; - uint16_t *dst_y = (uint16_t *)(void *) (out_frame->data[0] + out_frame->linesize[0] * y); - uint16_t *dst_cbcr = (uint16_t *)(void *) (out_frame->data[1] + out_frame->linesize[1] * y); - - OPTIMIZED_FOR (int x = 0; x < width; x += 8) { - comp_type_t r = 0; - comp_type_t g = 0; - comp_type_t b = 0; - comp_type_t res_y = 0; + uint16_t *dst_y = + (uint16_t *) (void *) (out_frame->data[0] + + out_frame->linesize[0] * y); + uint16_t *dst_cbcr = + (uint16_t *) (void *) (out_frame->data[1] + + out_frame->linesize[1] * y); + + OPTIMIZED_FOR(int x = 0; x < width; x += 8) + { + comp_type_t r = 0; + comp_type_t g = 0; + comp_type_t b = 0; + comp_type_t res_y = 0; comp_type_t res_cb = 0; comp_type_t res_cr = 0; - r = src[BYTE_SWAP(0)]; - r |= (src[BYTE_SWAP(1)] & 0xF) << 8; - g = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // g0 - b = src[BYTE_SWAP(3)]; - src += 4; + r = src[BYTE_SWAP(0)]; + r |= (src[BYTE_SWAP(1)] & 0xF) << 8; + g = src[BYTE_SWAP(2)] << 4 | + src[BYTE_SWAP(1)] >> 4; // g0 + b = src[BYTE_SWAP(3)]; + src += 4; - b |= (src[BYTE_SWAP(0)] & 0xF) << 8; + b |= (src[BYTE_SWAP(0)] & 0xF) << 8; WRITE_RES(0) - r = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // r1 - g = src[BYTE_SWAP(2)]; - g |= (src[BYTE_SWAP(3)] & 0xF) << 8; - b = src[BYTE_SWAP(3)] >> 4; - src += 4; + r = src[BYTE_SWAP(1)] << 4 | + src[BYTE_SWAP(0)] >> 4; // r1 + g = src[BYTE_SWAP(2)]; + g |= (src[BYTE_SWAP(3)] & 0xF) << 8; + b = src[BYTE_SWAP(3)] >> 4; + src += 4; - b |= src[BYTE_SWAP(0)] << 4; // b1 + b |= src[BYTE_SWAP(0)] << 4; // b1 WRITE_RES(1) - r = src[BYTE_SWAP(1)]; - r |= (src[BYTE_SWAP(2)] & 0xF) << 8; - g = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // g2 - src += 4; + r = src[BYTE_SWAP(1)]; + r |= (src[BYTE_SWAP(2)] & 0xF) << 8; + g = src[BYTE_SWAP(3)] << 4 | + src[BYTE_SWAP(2)] >> 4; // g2 + src += 4; - b = src[BYTE_SWAP(0)]; - b |= (src[BYTE_SWAP(1)] & 0xF) << 8; + b = src[BYTE_SWAP(0)]; + b |= (src[BYTE_SWAP(1)] & 0xF) << 8; WRITE_RES(2) - r = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // r3 - g = src[BYTE_SWAP(3)]; - src += 4; + r = src[BYTE_SWAP(2)] << 4 | + src[BYTE_SWAP(1)] >> 4; // r3 + g = src[BYTE_SWAP(3)]; + src += 4; - g |= (src[BYTE_SWAP(0)] & 0xF) << 8; - b = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // b3 + g |= (src[BYTE_SWAP(0)] & 0xF) << 8; + b = src[BYTE_SWAP(1)] << 4 | + src[BYTE_SWAP(0)] >> 4; // b3 WRITE_RES(3) - r = src[BYTE_SWAP(2)]; - r |= (src[BYTE_SWAP(3)] & 0xF) << 8; - g = src[BYTE_SWAP(3)] >> 4; - src += 4; + r = src[BYTE_SWAP(2)]; + r |= (src[BYTE_SWAP(3)] & 0xF) << 8; + g = src[BYTE_SWAP(3)] >> 4; + src += 4; - g |= src[BYTE_SWAP(0)] << 4; // g4 - b = src[BYTE_SWAP(1)]; - b |= (src[BYTE_SWAP(2)] & 0xF) << 8; - WRITE_RES(4) - r = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // r5 - src += 4; + g |= src[BYTE_SWAP(0)] << 4; // g4 + b = src[BYTE_SWAP(1)]; + b |= (src[BYTE_SWAP(2)] & 0xF) << 8; + WRITE_RES(4) + r = src[BYTE_SWAP(3)] << 4 | + src[BYTE_SWAP(2)] >> 4; // r5 + src += 4; - g = src[BYTE_SWAP(0)]; - g |= (src[BYTE_SWAP(1)] & 0xF) << 8; - b = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // b5 + g = src[BYTE_SWAP(0)]; + g |= (src[BYTE_SWAP(1)] & 0xF) << 8; + b = src[BYTE_SWAP(2)] << 4 | + src[BYTE_SWAP(1)] >> 4; // b5 WRITE_RES(5) - r = src[BYTE_SWAP(3)]; - src += 4; + r = src[BYTE_SWAP(3)]; + src += 4; - r |= (src[BYTE_SWAP(0)] & 0xF) << 8; - g = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // g6 - b = src[BYTE_SWAP(2)]; - b |= (src[BYTE_SWAP(3)] & 0xF) << 8; + r |= (src[BYTE_SWAP(0)] & 0xF) << 8; + g = src[BYTE_SWAP(1)] << 4 | + src[BYTE_SWAP(0)] >> 4; // g6 + b = src[BYTE_SWAP(2)]; + b |= (src[BYTE_SWAP(3)] & 0xF) << 8; WRITE_RES(6) - r = src[BYTE_SWAP(3)] >> 4; - src += 4; + r = src[BYTE_SWAP(3)] >> 4; + src += 4; - r |= src[BYTE_SWAP(0)] << 4; // r7 - g = src[BYTE_SWAP(1)]; - g |= (src[BYTE_SWAP(2)] & 0xF) << 8; - b = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // b7 + r |= src[BYTE_SWAP(0)] << 4; // r7 + g = src[BYTE_SWAP(1)]; + g |= (src[BYTE_SWAP(2)] & 0xF) << 8; + b = src[BYTE_SWAP(3)] << 4 | + src[BYTE_SWAP(2)] >> 4; // b7 WRITE_RES(7) - src += 4; + src += 4; } } #undef WRITE_RES @@ -874,102 +888,112 @@ r12l_to_p210le(AVFrame *__restrict out_frame, // copied from r12l_to_p210le static void r12l_to_ayuv64le(AVFrame *__restrict out_frame, - const unsigned char *__restrict in_data, int width, int height) + const unsigned char *__restrict in_data, int width, int height) { assert((uintptr_t) out_frame->linesize[0] % 2 == 0); const struct color_coeffs cfs = *get_color_coeffs(CS_DFL, DEPTH16); #define WRITE_RES(idx) \ *dst++ = 0xffff; /* alpha */ \ - res_y = (RGB_TO_Y(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + res_y = (RGB_TO_Y(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ (1 << (DEPTH16 - 4)); \ *dst++ = CLAMP_LIMITED_Y(res_y, DEPTH16); \ - res_cb = \ - (RGB_TO_CB(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ - (1 << (DEPTH16 - 1)); \ - res_cr = \ - (RGB_TO_CR(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ - (1 << (DEPTH16 - 1)); \ + res_cb = (RGB_TO_CB(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + (1 << (DEPTH16 - 1)); \ + res_cr = (RGB_TO_CR(cfs, r, g, b) >> (COMP_BASE + 12 - DEPTH16)) + \ + (1 << (DEPTH16 - 1)); \ *dst++ = CLAMP_LIMITED_CBCR(res_cb, depth); \ - *dst++ = CLAMP_LIMITED_CBCR(res_cr, depth); \ + *dst++ = CLAMP_LIMITED_CBCR(res_cr, depth); const int src_linesize = vc_get_linesize(width, R12L); for (int y = 0; y < height; ++y) { const unsigned char *src = in_data + y * src_linesize; - uint16_t *dst = (uint16_t *)(void *) (out_frame->data[0] + out_frame->linesize[0] * y); + uint16_t *dst = + (uint16_t *) (void *) (out_frame->data[0] + + out_frame->linesize[0] * y); - OPTIMIZED_FOR (int x = 0; x < width; x += 8) { - comp_type_t r = 0; - comp_type_t g = 0; - comp_type_t b = 0; - comp_type_t res_y = 0; + OPTIMIZED_FOR(int x = 0; x < width; x += 8) + { + comp_type_t r = 0; + comp_type_t g = 0; + comp_type_t b = 0; + comp_type_t res_y = 0; comp_type_t res_cb = 0; comp_type_t res_cr = 0; - r = src[BYTE_SWAP(0)]; - r |= (src[BYTE_SWAP(1)] & 0xF) << 8; - g = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // g0 - b = src[BYTE_SWAP(3)]; - src += 4; + r = src[BYTE_SWAP(0)]; + r |= (src[BYTE_SWAP(1)] & 0xF) << 8; + g = src[BYTE_SWAP(2)] << 4 | + src[BYTE_SWAP(1)] >> 4; // g0 + b = src[BYTE_SWAP(3)]; + src += 4; - b |= (src[BYTE_SWAP(0)] & 0xF) << 8; + b |= (src[BYTE_SWAP(0)] & 0xF) << 8; WRITE_RES(0) - r = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // r1 - g = src[BYTE_SWAP(2)]; - g |= (src[BYTE_SWAP(3)] & 0xF) << 8; - b = src[BYTE_SWAP(3)] >> 4; - src += 4; + r = src[BYTE_SWAP(1)] << 4 | + src[BYTE_SWAP(0)] >> 4; // r1 + g = src[BYTE_SWAP(2)]; + g |= (src[BYTE_SWAP(3)] & 0xF) << 8; + b = src[BYTE_SWAP(3)] >> 4; + src += 4; - b |= src[BYTE_SWAP(0)] << 4; // b1 + b |= src[BYTE_SWAP(0)] << 4; // b1 WRITE_RES(1) - r = src[BYTE_SWAP(1)]; - r |= (src[BYTE_SWAP(2)] & 0xF) << 8; - g = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // g2 - src += 4; + r = src[BYTE_SWAP(1)]; + r |= (src[BYTE_SWAP(2)] & 0xF) << 8; + g = src[BYTE_SWAP(3)] << 4 | + src[BYTE_SWAP(2)] >> 4; // g2 + src += 4; - b = src[BYTE_SWAP(0)]; - b |= (src[BYTE_SWAP(1)] & 0xF) << 8; + b = src[BYTE_SWAP(0)]; + b |= (src[BYTE_SWAP(1)] & 0xF) << 8; WRITE_RES(2) - r = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // r3 - g = src[BYTE_SWAP(3)]; - src += 4; + r = src[BYTE_SWAP(2)] << 4 | + src[BYTE_SWAP(1)] >> 4; // r3 + g = src[BYTE_SWAP(3)]; + src += 4; - g |= (src[BYTE_SWAP(0)] & 0xF) << 8; - b = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // b3 + g |= (src[BYTE_SWAP(0)] & 0xF) << 8; + b = src[BYTE_SWAP(1)] << 4 | + src[BYTE_SWAP(0)] >> 4; // b3 WRITE_RES(3) - r = src[BYTE_SWAP(2)]; - r |= (src[BYTE_SWAP(3)] & 0xF) << 8; - g = src[BYTE_SWAP(3)] >> 4; - src += 4; + r = src[BYTE_SWAP(2)]; + r |= (src[BYTE_SWAP(3)] & 0xF) << 8; + g = src[BYTE_SWAP(3)] >> 4; + src += 4; - g |= src[BYTE_SWAP(0)] << 4; // g4 - b = src[BYTE_SWAP(1)]; - b |= (src[BYTE_SWAP(2)] & 0xF) << 8; - WRITE_RES(4) - r = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // r5 - src += 4; + g |= src[BYTE_SWAP(0)] << 4; // g4 + b = src[BYTE_SWAP(1)]; + b |= (src[BYTE_SWAP(2)] & 0xF) << 8; + WRITE_RES(4) + r = src[BYTE_SWAP(3)] << 4 | + src[BYTE_SWAP(2)] >> 4; // r5 + src += 4; - g = src[BYTE_SWAP(0)]; - g |= (src[BYTE_SWAP(1)] & 0xF) << 8; - b = src[BYTE_SWAP(2)] << 4 | src[BYTE_SWAP(1)] >> 4; // b5 + g = src[BYTE_SWAP(0)]; + g |= (src[BYTE_SWAP(1)] & 0xF) << 8; + b = src[BYTE_SWAP(2)] << 4 | + src[BYTE_SWAP(1)] >> 4; // b5 WRITE_RES(5) - r = src[BYTE_SWAP(3)]; - src += 4; + r = src[BYTE_SWAP(3)]; + src += 4; - r |= (src[BYTE_SWAP(0)] & 0xF) << 8; - g = src[BYTE_SWAP(1)] << 4 | src[BYTE_SWAP(0)] >> 4; // g6 - b = src[BYTE_SWAP(2)]; - b |= (src[BYTE_SWAP(3)] & 0xF) << 8; + r |= (src[BYTE_SWAP(0)] & 0xF) << 8; + g = src[BYTE_SWAP(1)] << 4 | + src[BYTE_SWAP(0)] >> 4; // g6 + b = src[BYTE_SWAP(2)]; + b |= (src[BYTE_SWAP(3)] & 0xF) << 8; WRITE_RES(6) - r = src[BYTE_SWAP(3)] >> 4; - src += 4; + r = src[BYTE_SWAP(3)] >> 4; + src += 4; - r |= src[BYTE_SWAP(0)] << 4; // r7 - g = src[BYTE_SWAP(1)]; - g |= (src[BYTE_SWAP(2)] & 0xF) << 8; - b = src[BYTE_SWAP(3)] << 4 | src[BYTE_SWAP(2)] >> 4; // b7 + r |= src[BYTE_SWAP(0)] << 4; // r7 + g = src[BYTE_SWAP(1)]; + g |= (src[BYTE_SWAP(2)] & 0xF) << 8; + b = src[BYTE_SWAP(3)] << 4 | + src[BYTE_SWAP(2)] >> 4; // b7 WRITE_RES(7) - src += 4; + src += 4; } } #undef WRITE_RES From d029f9d90d11c854b6d6a1c48547b942a906a9ec Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 27 Nov 2025 08:26:44 +0100 Subject: [PATCH 31/86] to_lavc_vid_conv: remove some warn in 2 last conv + IWYU file --- src/libavcodec/to_lavc_vid_conv.c | 35 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/libavcodec/to_lavc_vid_conv.c b/src/libavcodec/to_lavc_vid_conv.c index 2a31dffbe5..76eddcbeff 100644 --- a/src/libavcodec/to_lavc_vid_conv.c +++ b/src/libavcodec/to_lavc_vid_conv.c @@ -46,8 +46,14 @@ #define __STDC_WANT_LIB_EXT1__ 1 // qsort_s #include +#include // for AVFrame, av_frame_alloc +#include // for av_get_pix_fmt_name +#include // for CHAR_BIT #include +#include // for NULL, ptrdiff_t, size_t #include +#include // for free, calloc, abort +#include // for memcpy #include "color_space.h" #include "compat/net.h" // for htonl @@ -56,10 +62,14 @@ #include "host.h" #include "libavcodec/to_lavc_vid_conv.h" #include "libavcodec/to_lavc_vid_conv_cuda.h" +#include "libavcodec/utils.h" // for uv_to_av_pixfmt, get_u... +#include "pixfmt_conv.h" // for get_decoder_from_to +#include "tv.h" // for get_time_in_ns, time_ns_t #include "utils/macros.h" // OPTIMIZED_FOR #include "utils/parallel_conv.h" #include "utils/worker.h" -#include "video.h" +#include "video_codec.h" // for vc_get_linesize, get_p... +#include "video_frame.h" // for buf_get_planes #ifdef __SSE3__ #include "pmmintrin.h" @@ -788,14 +798,12 @@ r12l_to_p210le(AVFrame *__restrict out_frame, } const int src_linesize = vc_get_linesize(width, R12L); - for (int y = 0; y < height; ++y) { - const unsigned char *src = in_data + y * src_linesize; - uint16_t *dst_y = - (uint16_t *) (void *) (out_frame->data[0] + - out_frame->linesize[0] * y); - uint16_t *dst_cbcr = - (uint16_t *) (void *) (out_frame->data[1] + - out_frame->linesize[1] * y); + for (size_t y = 0; y < (size_t) height; ++y) { + const unsigned char *src = in_data + (y * src_linesize); + uint16_t *dst_y = (void *) (out_frame->data[0] + + (out_frame->linesize[0] * y)); + uint16_t *dst_cbcr = (void *) (out_frame->data[1] + + (out_frame->linesize[1] * y)); OPTIMIZED_FOR(int x = 0; x < width; x += 8) { @@ -906,11 +914,10 @@ r12l_to_ayuv64le(AVFrame *__restrict out_frame, *dst++ = CLAMP_LIMITED_CBCR(res_cr, depth); const int src_linesize = vc_get_linesize(width, R12L); - for (int y = 0; y < height; ++y) { - const unsigned char *src = in_data + y * src_linesize; - uint16_t *dst = - (uint16_t *) (void *) (out_frame->data[0] + - out_frame->linesize[0] * y); + for (size_t y = 0; y < (size_t) height; ++y) { + const unsigned char *src = in_data + (y * src_linesize); + uint16_t *dst = (void *) (out_frame->data[0] + + (out_frame->linesize[0] * y)); OPTIMIZED_FOR(int x = 0; x < width; x += 8) { From 0f6edcbb09233a17fdaed770f80d61acac768b2e Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 2 Jan 2026 15:32:37 +0100 Subject: [PATCH 32/86] vcomp/lavc/oapv: fix out-of-bound dereference fixes CID 897313 --- src/video_compress/libavcodec.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 6c7550946b..a7e3ae78a1 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2013-2025 CESNET + * Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1750,7 +1750,8 @@ static void setparam_oapv(AVCodecContext */*codec_ctx*/, struct setparam_param *param) { auto it = param->lavc_opts.find("oapv-params"); - if (it->second.find("profile=") != std::string::npos) { + if (it != param->lavc_opts.end() && + it->second.find("profile=") != std::string::npos) { return; // do not overwrite profile if set explicitly } const char *profile = nullptr; From 926bd5e4741a79841c634559797117cc27a9804d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 5 Jan 2026 13:20:56 +0100 Subject: [PATCH 33/86] AppImage: bundle libdecor both GLFW and SDL load libdecor-0.so.0 by dlopen so it is not going to be bundled... --- .github/scripts/Linux/prepare.sh | 2 ++ data/scripts/Linux-AppImage/AppRun | 1 + .../scripts/Linux-AppImage/create-appimage.sh | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/.github/scripts/Linux/prepare.sh b/.github/scripts/Linux/prepare.sh index 4b47edc5fa..30beeffe25 100755 --- a/.github/scripts/Linux/prepare.sh +++ b/.github/scripts/Linux/prepare.sh @@ -25,6 +25,8 @@ sudo apt install appstream `# appstreamcli for mkappimage AppStream validation` asciidoc sudo apt install fonts-dejavu-core sudo apt --no-install-recommends install nvidia-cuda-toolkit +sudo apt install libdecor-0-0 && + ls /usr/lib/x86_64-linux-gnu/libdecor/plugins-1/*so >/dev/null # check plugin sudo apt install libglew-dev sudo apt install libglm-dev sudo apt install imagemagick libmagickwand-dev diff --git a/data/scripts/Linux-AppImage/AppRun b/data/scripts/Linux-AppImage/AppRun index 213b51e5f3..79a892fa16 100755 --- a/data/scripts/Linux-AppImage/AppRun +++ b/data/scripts/Linux-AppImage/AppRun @@ -20,6 +20,7 @@ LD_PRELOAD=${LD_PRELOAD-} # there is an issue with running_from_path() which evaluates this executable # as being system-installed #export PATH=$DIR/usr/bin:$PATH +export LIBDECOR_PLUGIN_DIR="$DIR/usr/lib/libdecor/plugins-1" export QT_QPA_FONTDIR="$DIR/usr/share/fonts" export UG_FONT_DIR="$DIR/usr/share/fonts" QT_PLUGIN_PATH=$(set -- "$DIR"/usr/lib/qt?/plugins; echo "$1") diff --git a/data/scripts/Linux-AppImage/create-appimage.sh b/data/scripts/Linux-AppImage/create-appimage.sh index 2c0ba6ee03..5de5dcc329 100755 --- a/data/scripts/Linux-AppImage/create-appimage.sh +++ b/data/scripts/Linux-AppImage/create-appimage.sh @@ -62,6 +62,26 @@ if [ -n "$QT_DIR" ]; then PLUGIN_LIBS=$(find "$DST_PLUGIN_DIR" -type f) fi +# append to string delimited with space if \$$1 non-empty +append() { eval "$1=\"\$$1\${$1:+ }$2\""; } + +# deploy libdecor + its plugin(s) - it is dlopen-ed so not automatic +if [ -f $APPPREFIX/lib/ultragrid/ultragrid_display_gl.so ] || + [ -f $APPPREFIX/lib/ultragrid/ultragrid_display_sdl.so ]; then + libdecor=$(find /usr/lib -name libdecor-0.so.0 | head -n 1) + if [ -f "$libdecor" ]; then + cp "$libdecor" $APPPREFIX/lib/ + append PLUGIN_LIBS $APPPREFIX/lib/libdecor-0.so.0 + plugins=$(dirname "$libdecor")/libdecor/plugins-1 + if [ -d "$plugins" ]; then + dst=$APPPREFIX/lib/libdecor/plugins-1 + mkdir -p $dst + cp "$plugins"/*.so $dst/ + append PLUGIN_LIBS "$(find "$dst" -type f -exec echo {} +)" + fi + fi +fi + if [ -f $APPPREFIX/lib/ultragrid/ultragrid_vo_pp_text.so ]; then if ! command -v convert >/dev/null; then handle_error 'IM convert missing! (needed for bundle)' From 8d7ad615873f5333eab57a54fca986e888d1e069 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 6 Jan 2026 11:01:38 +0100 Subject: [PATCH 34/86] CI Linux install libdecor Cairo plugin explicitly Instead of ensuring that the plugin is present, instal the Cairo plugin directly. The Cairo implementation is the only libdecor plugin present in U22.04 repositories (U24.04 has the Gtk implementation as well). --- .github/scripts/Linux/prepare.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/scripts/Linux/prepare.sh b/.github/scripts/Linux/prepare.sh index 30beeffe25..926fd41d7b 100755 --- a/.github/scripts/Linux/prepare.sh +++ b/.github/scripts/Linux/prepare.sh @@ -25,8 +25,7 @@ sudo apt install appstream `# appstreamcli for mkappimage AppStream validation` asciidoc sudo apt install fonts-dejavu-core sudo apt --no-install-recommends install nvidia-cuda-toolkit -sudo apt install libdecor-0-0 && - ls /usr/lib/x86_64-linux-gnu/libdecor/plugins-1/*so >/dev/null # check plugin +sudo apt install libdecor-0-0 libdecor-0-plugin-1-cairo sudo apt install libglew-dev sudo apt install libglm-dev sudo apt install imagemagick libmagickwand-dev From 1b34ac5ec298c13ae06bcc66aa306d3f9529a2d7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 7 Jan 2026 14:35:41 +0100 Subject: [PATCH 35/86] control_socked: fix early module_done The thread is not joined yet so it may access the module data (check_message). This might have caused this failure: --- src/control_socket.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/control_socket.cpp b/src/control_socket.cpp index f42dd26221..8b8595ea6f 100644 --- a/src/control_socket.cpp +++ b/src/control_socket.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2013-2025 CESNET + * Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -976,8 +976,6 @@ void control_done(struct control_state *s) } assert(s->magic == MODULE_MAGIC); - module_done(&s->mod); - if(s->started) { s->stats_lock.lock(); s->stat_event_queue.push({}); @@ -999,6 +997,8 @@ void control_done(struct control_state *s) CLOSESOCKET(s->socket_fd); } + module_done(&s->mod); + delete s; } From 61ae980655d94d26436cfe2ab7e0f25e0447baf1 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 9 Jan 2026 14:57:58 +0100 Subject: [PATCH 36/86] CI Win: use pre-built Spout instead of building own Spout, use pre-built release on GH This actually reverts the commit b98b5ab0 from 2023-11-06. Date: Mon Nov 6 09:08:46 2023 +0100 --- .github/scripts/Windows/install_spout.sh | 22 +++++++--------------- .github/workflows/ccpp.yml | 11 +---------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/.github/scripts/Windows/install_spout.sh b/.github/scripts/Windows/install_spout.sh index 9e7ea7c380..90213a8dce 100755 --- a/.github/scripts/Windows/install_spout.sh +++ b/.github/scripts/Windows/install_spout.sh @@ -1,21 +1,13 @@ #!/bin/sh -eux # Install SPOUT -build() {( - cd /c - rm -rf Spout2 - git clone --depth 1 https://github.com/leadedge/Spout2.git - cd Spout2 - /c/Program\ Files/CMake/bin/cmake.exe -Bbuild2 . # ./BUILD already exists - /c/Program\ Files/CMake/bin/cmake.exe --build build2 --config Release \ - -j "$(nproc)" -)} - install() {( - mkdir -p /usr/local/bin /usr/local/include /usr/local/lib - cp /c/Spout2/build2/bin/Release/SpoutLibrary.dll /usr/local/bin/ - cp /c/Spout2/build2/lib/Release/SpoutLibrary.lib /usr/local/lib/ - cp /c/Spout2/SPOUTSDK/SpoutLibrary/SpoutLibrary.h /usr/local/include/ + .github/scripts/download-gh-asset.sh leadedge/Spout2 binaries Spout.zip + unzip Spout.zip + d=$(echo Spout-SDK-binaries/Libs_*) + cp "$d"/MT/bin/SpoutLibrary.dll /usr/local/bin/ + cp "$d"/MT/lib/SpoutLibrary.lib /usr/local/lib/ + cp "$d"/include/SpoutLibrary/SpoutLibrary.h /usr/local/include/ )} -$1 +install diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index a08fa352aa..3b44eddd8e 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -319,17 +319,8 @@ jobs: - name: bootsrap MSYS2 run: $GITHUB_WORKSPACE/.github/scripts/Windows/prepare_msys.sh - - name: Run actions/cache for Spout build - id: cache-spout - uses: actions/cache@main - with: - path: 'C:\Spout2' - key: cache-spout-${{ runner.os }}-${{ hashFiles('.github/scripts/Windows/install_spout.sh') }} - - name: Build Spout - if: steps.cache-spout.outputs.cache-hit != 'true' - run: $GITHUB_WORKSPACE/.github/scripts/Windows/install_spout.sh build - name: Install Spout - run: $GITHUB_WORKSPACE/.github/scripts/Windows/install_spout.sh install + run: $GITHUB_WORKSPACE/.github/scripts/Windows/install_spout.sh - name: Run actions/cache for CineForm build id: cache-cineform From 957a461e1a4e5c4cbcafea2c07e71a8457efccf7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 12 Jan 2026 11:40:04 +0100 Subject: [PATCH 37/86] spout: enable logging It seems like SPOUTLIBRARY::EnableSpoutLog() must be also executed to actually enable the logging. Note that there also exists SPOUTLIBRARY::OpenSpoutConsole(), which seems to be intended to open a standalone logging window but it didn't open when just executed between EnableSpoutLog(). As the logging is mainly intended to be output to the console window, it seems like when issed just EnableSpoutLog() it is dumped to the stdout/stderr, which is just what we want in UG. --- src/spout_sender.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spout_sender.cpp b/src/spout_sender.cpp index 6f4835cca6..99b0608776 100644 --- a/src/spout_sender.cpp +++ b/src/spout_sender.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2017-2023 CESNET, z. s. p. o. + * Copyright (c) 2017-2026 CESNET, zajmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -74,4 +74,5 @@ void spout_set_log_level(void *s, int ug_level) { } spout->SetSpoutLogLevel(l); + spout->EnableSpoutLog(); } From ff458792c75a1393e1743eab88f538457798fe25 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 12 Jan 2026 12:52:36 +0100 Subject: [PATCH 38/86] spout: adjust log levels - the fatal/error/warning was off-by-one, should have been "6 -" to match corresponding Spout log levels, but: - made the fatal/error/warning mapping explicit, anyways - use SPOUT_LOG_WARNING for both UG NOTICE and INFO - the previous SPOUT_LOG_NOTICE is a bit chatty during init, so: - UG VERBOSE - use the Spout notice --- src/spout_sender.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/spout_sender.cpp b/src/spout_sender.cpp index 99b0608776..8301d951a0 100644 --- a/src/spout_sender.cpp +++ b/src/spout_sender.cpp @@ -63,14 +63,23 @@ void spout_sender_unregister(void *s) { void spout_set_log_level(void *s, int ug_level) { auto *spout = static_cast(s); enum SpoutLibLogLevel l; + // SPOUT_LOG_SILENT (0) - Disable all messages + // SPOUT_LOG_VERBOSE (1) - Show all messages + // SPOUT_LOG_NOTICE (2) - Show information messages - default + // SPOUT_LOG_WARNING (3) - Something might go wrong + // SPOUT_LOG_ERROR (4) - Something did go wrong + // SPOUT_LOG_FATAL (5) - Something bad happened switch (ug_level) { - case LOG_LEVEL_QUIET: l = SPOUT_LOG_SILENT; break; - case LOG_LEVEL_FATAL: - case LOG_LEVEL_ERROR: - case LOG_LEVEL_WARNING: l = (enum SpoutLibLogLevel) (7 - ug_level); break; - case LOG_LEVEL_NOTICE: - case LOG_LEVEL_INFO: l = SPOUT_LOG_NOTICE; break; - default: l = SPOUT_LOG_VERBOSE; + // clang-format off + case LOG_LEVEL_QUIET: l = SPOUT_LOG_SILENT; break; + case LOG_LEVEL_FATAL: l = SPOUT_LOG_FATAL; break; + case LOG_LEVEL_ERROR: l = SPOUT_LOG_ERROR; break; + case LOG_LEVEL_WARNING: + case LOG_LEVEL_NOTICE: + case LOG_LEVEL_INFO: l = SPOUT_LOG_WARNING; break; + case LOG_LEVEL_VERBOSE: l = SPOUT_LOG_NOTICE; break; // this is a bit chatty... + default: l = SPOUT_LOG_VERBOSE; break; + // clang-format on } spout->SetSpoutLogLevel(l); From 799e4b420fe7a48301b320305f97cf1e3c3257d1 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 12 Jan 2026 09:56:58 +0100 Subject: [PATCH 39/86] CI Win: temporarily revert to Spout 2.007.016 refers to --- .github/scripts/Windows/install_spout.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/scripts/Windows/install_spout.sh b/.github/scripts/Windows/install_spout.sh index 90213a8dce..2853ac6e19 100755 --- a/.github/scripts/Windows/install_spout.sh +++ b/.github/scripts/Windows/install_spout.sh @@ -2,9 +2,12 @@ # Install SPOUT install() {( - .github/scripts/download-gh-asset.sh leadedge/Spout2 binaries Spout.zip + # .github/scripts/download-gh-asset.sh leadedge/Spout2 binaries Spout.zip + curl -LSs https://github.com/leadedge/Spout2/releases/download/\ +2.007.016/Spout-SDK-binaries_2-007-016.zip -o Spout.zip unzip Spout.zip - d=$(echo Spout-SDK-binaries/Libs_*) + # d=$(echo Spout-SDK-binaries/Libs_*) + d=$(echo Spout-SDK-binaries/*/Libs) cp "$d"/MT/bin/SpoutLibrary.dll /usr/local/bin/ cp "$d"/MT/lib/SpoutLibrary.lib /usr/local/lib/ cp "$d"/include/SpoutLibrary/SpoutLibrary.h /usr/local/include/ From f916a92c3cb364f820461690e793304445fe17a8 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 12 Jan 2026 16:56:24 +0100 Subject: [PATCH 40/86] [Win] set NvOptimusEnablement=0 (or by env var) - fixes the SPOUT capture with NVIDIA Optimus - renderer for Vulkan seem to still use NVIDIA for 10 bit rendering (-t testcard:c=R10k:patt=gradient2) refers to --- src/host.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/host.cpp b/src/host.cpp index 1de66f1e60..95eb678903 100644 --- a/src/host.cpp +++ b/src/host.cpp @@ -192,6 +192,16 @@ void *mainloop_udata; // required for NVCC+MSVC compiled objs if /nodefaultlib is used extern "C" int _fltused = 0; #endif +#ifdef _WIN32 +extern "C" { +// this is a bit dirty because this assumes that the this static initialization +// happens before NV pre-main init (it doesn't work /isn't honored/ if run from +// main!); but it is actually (currently) true (possibly implementation +// defined?). Values: 0 - autoselect; 1 - enforce nvidia +__declspec(dllexport) unsigned long NvOptimusEnablement = + getenv("NV_OPTIMUS_ENABLEMENT") ? atoi(getenv("NV_OPTIMUS_ENABLEMENT")) : 0; +} +#endif struct init_data { bool com_initialized = false; From 750174026aa63fde3b63c5ac0b500641068762d7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 13 Jan 2026 10:50:06 +0100 Subject: [PATCH 41/86] main: docu 2 env vars in fullhelp NDILIB_REDIST_FOLDER and NV_OPTIMUS_ENABLEMENT (added recently; Win only) the others env vars used by UG are not much important for regular users --- src/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 554709e0a0..3d82309f50 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -295,6 +295,14 @@ usage(bool full = false) print_help_item("--video-codecs", {"list of video codecs"}); } print_help_item("address", {"destination address"}); + if (full) { + color_printf("Environment variables: " + TBOLD("NDILIB_REDIST_FOLDER") +#ifdef _WIN32 + ", " TBOLD("NV_OPTIMUS_ENABLEMENT") +#endif + " and others (less important)\n"); + } printf("\n"); } From f6677026f7f63a28e2ba5a4a652bdc21ee424eee Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 13 Jan 2026 16:50:16 +0100 Subject: [PATCH 42/86] from_lavc_pf_priority: do not advertise HW_VDPAU This is handled differently and may trigger unexpected decode to HW_VDPAU if gl display advertises that, eg. `uv -t testcard -c lavc:c=MJPG -d gl`. This fixes the commit 647d8627 (2025-06-25) that unintentionally enabled that. The HW accel is hanndled actually separately ahd snouldn't be "enabled" in this way. --- src/libavcodec/from_lavc_vid_conv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libavcodec/from_lavc_vid_conv.c b/src/libavcodec/from_lavc_vid_conv.c index 9dcd2f0d3e..ebfb3d031f 100644 --- a/src/libavcodec/from_lavc_vid_conv.c +++ b/src/libavcodec/from_lavc_vid_conv.c @@ -3166,6 +3166,10 @@ av_to_uv_convert(const av_to_uv_convert_t *convert, int from_lavc_pf_priority(struct pixfmt_desc internal, codec_t ugc) { + if (codec_is_hw_accelerated(ugc)) { + return VDEC_PRIO_NA; + } + bool found_a_conversion = false; for (unsigned i = 0; i < ARR_COUNT(av_to_uv_conversions); i++) { if (av_to_uv_conversions[i].uv_codec == ugc) { From b6141ac9236dae6866341fca89b46768b169cc2f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 19 Jan 2026 11:54:46 +0100 Subject: [PATCH 43/86] configure.ac: switch from Darwin vers. to macOS The actual Darwin version was actually matched to corresponding macOS version so use those directly. --- configure.ac | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index c09ef4adae..fd2a3f9545 100644 --- a/configure.ac +++ b/configure.ac @@ -155,8 +155,9 @@ fi if test $system = MacOSX; then MACOS_LEGACY=no - os_version_major=`uname -r |cut -d . -f 1` - if test $os_version_major -lt 19; then # Darwin 19.0.0 is macOS 10.15 + macos_major=$(sw_vers -productVersion | cut -d. -f1) + macos_minor=$(sw_vers -productVersion | cut -d. -f2) + if test ${macos_major?} -eq 10 && test ${macos_minor?} -lt 15; then MACOS_LEGACY=yes fi CFLAGS="$CFLAGS $COMMON_OSX_FLAGS" @@ -2220,7 +2221,7 @@ AC_ARG_ENABLE(screen, case "$system" in MacOSX) - if test "$os_version_major" -lt 24; then # Darwin 24.0.0 is macOS 15 + if test "${macos_major?}" -lt 15; then screen_cap=yes SCREEN_CAP_LIB="-framework CoreFoundation" fi From 960c0875696f9db1f56815132aa52174c6c55f2f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 20 Jan 2026 08:30:58 +0100 Subject: [PATCH 44/86] macOS: port screen AV Foundation impl from master Ported the implementation to reenable screen capture for macos on Intels because the runner has switched to macos-15-intel that no longer supports Core Graphics capture. The AV Foundation was needed to port directly so this module is now exactly same as in master - it is probably not worth and error-prone cherry-picking just the "needed" commits. see the commits in master for actual changes up to the commit 3ae62524 --- configure.ac | 64 ++++--- src/compat/c23.h | 59 ++++++ src/video_capture/avfoundation.mm | 308 ++++++++++++++++++++---------- src/video_capture/screen_avf.c | 151 +++++++++++++++ src/video_capture_params.cpp | 9 +- src/video_capture_params.h | 4 +- 6 files changed, 475 insertions(+), 120 deletions(-) create mode 100644 src/compat/c23.h create mode 100644 src/video_capture/screen_avf.c diff --git a/configure.ac b/configure.ac index fd2a3f9545..9b538a7c6c 100644 --- a/configure.ac +++ b/configure.ac @@ -2213,23 +2213,43 @@ sc_details= AC_ARG_ENABLE(screen, [ --disable-screen disable screen capture (default is auto)] -[ --enable-screen@<:@=x11,pipewire@:>@ @<:@Linux only@:>@ choose implementation (can be both)] -[ Requires: none (OSX) x11 or pipewire (Linux) dshow (Win)], +AS_HELP_STRING([--enable-screen@<:@=x11,pipewire,cg@:>@], +[choose implementation (Linux: can be both x11 and pipewire; macOS: cg] +[ - use Core Graphics implementation instead of AV Foundation).] +[Requires: macOS<15 (cg), AVF (macOS otherwise); X11 or PipeWire (Linux); DShow (Win)]), [screen_cap_req=$enableval], [screen_cap_req=$build_default] ) -case "$system" in - MacOSX) - if test "${macos_major?}" -lt 15; then - screen_cap=yes +if test "${system?}" = Linux && test "${screen_cap_req?}" = yes; then + screen_cap_req=pipewire,x11 +fi + +if test "${system?}" = Windows && test "${screen_cap_req?}" != no; then + SCREEN_CAP_OBJ="src/video_capture/screen_win.o" + DLL_LIBS="${DLL_LIBS:+$DLL_LIBS }${srcdir}/data/screen-capture-recorder-x64.dll" + screen_cap=$dshow +fi + +if test "${system?}" = MacOSX && test "${screen_cap_req?}" != no; then + if test "${avfoundation?}" = no || test "${screen_cap_req?}" = cg; then + if test "${macos_major?}" -ge 15; then + AC_MSG_WARN([Core Graphics screen capture]dnl + [unsupported since macOS 15!]) + else + SCREEN_CAP_OBJ="src/video_capture/screen_osx.o" SCREEN_CAP_LIB="-framework CoreFoundation" + screen_modules="Core Graphics" + screen_cap=yes fi - ;; - Windows) - screen_cap=$dshow - ;; -esac + else + if test "${avfoundation?}" = yes; then + SCREEN_CAP_OBJ="src/video_capture/screen_avf.o" + screen_modules="AV Foundation" + screen_cap=yes + fi + fi +fi # X11 screen_cap_x11=no @@ -2263,7 +2283,8 @@ fi # PipeWire found_screen_screen_pw_deps=no screen_cap_pw=no -if test $screen_cap_req != no && test $screen_cap_req != x11; then +if test ${system?} = Linux && test ${screen_cap_req?} != no && + test ${screen_cap_req} != x11; then PKG_CHECK_MODULES([SCREEN_PW_DEPS], [glib-2.0 gobject-2.0 gio-unix-2.0 ], [found_screen_screen_pw_deps=yes], [found_screen_screen_pw_deps=no]) fi @@ -2286,23 +2307,22 @@ fi if test $screen_cap_req != no && test $screen_cap = yes then - if test $system = MacOSX; then - SCREEN_CAP_OBJ="src/video_capture/screen_osx.o" - elif test $system = Linux; then + if test $system = Linux; then SCREEN_CAP_OBJ="src/video_capture/screen_linux.o" - else - SCREEN_CAP_OBJ="src/video_capture/screen_win.o" - DLL_LIBS="${DLL_LIBS:+$DLL_LIBS }${srcdir}/data/screen-capture-recorder-x64.dll" fi add_module vidcap_screen "$SCREEN_CAP_OBJ" "$SCREEN_CAP_LIB" else screen_cap=no fi -if { test $screen_cap_req = yes && { test $screen_cap = no || { test $system = Linux && { test $screen_cap_x11 = no || test $screen_cap_pw = no; }; }; }; } \ - || { test $screen_cap_req = x11 && test $screen_cap_x11 = no; } || { test $screen_cap_req = pipewire && test $screen_cap_pw = no; } -then - AC_MSG_ERROR([Screen capture not found]); +ENSURE_FEATURE_PRESENT([$screen_cap_req], [$screen_cap], [Screen capture not found]) + +if { expr "x${screen_cap_req?}" : "x.*x11" >/dev/null && + test "${screen_cap_x11?}" = no; } || + { expr "x${screen_cap_req?}" : "x.*pipewire" >/dev/null && + test "${screen_cap_pw?}" = no; }; then + AC_MSG_ERROR([Desired screen capture implementation not found!] + [Wanted: ${screen_cap_req?}]) fi if test -n "$screen_modules"; then diff --git a/src/compat/c23.h b/src/compat/c23.h new file mode 100644 index 0000000000..a858af3e45 --- /dev/null +++ b/src/compat/c23.h @@ -0,0 +1,59 @@ +/** + * @file compat/c23.h + * @author Martin Pulec + * + * fallback implementation of some C23 features like nullptr or built-in + * bool/true/false + */ +/* + * Copyright (c) 2026 CESNET, zájmové sdružení právnických osob + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, is permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of CESNET nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef COMPAT_C23_H_B55FDBEB_BED9_4D10_85D8_BE8CE8C21997 +#define COMPAT_C23_H_B55FDBEB_BED9_4D10_85D8_BE8CE8C21997 + +#if !defined __cplusplus + +// IWYU pragma: begin_exports + +// bool, true, false, nullptr +#if __STDC_VERSION__ < 202311L + #include + #define nullptr NULL + #include +#endif + +// IWYU pragma: end_exports + +#endif // !defined __cplusplus +#endif // ! defined COMPAT_C23_H_B55FDBEB_BED9_4D10_85D8_BE8CE8C21997 + diff --git a/src/video_capture/avfoundation.mm b/src/video_capture/avfoundation.mm index 06b67fd657..2d3f1325a5 100644 --- a/src/video_capture/avfoundation.mm +++ b/src/video_capture/avfoundation.mm @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2014-2023 CESNET z.s.p.o. + * Copyright (c) 2014-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,6 +44,7 @@ #include #include #include +#include #include "debug.h" #include "lib_common.h" @@ -52,9 +53,15 @@ #include "video_capture.h" #define MOD_NAME "[AVFoundation] " +#define SCR_CAP_NAME_PREF "Capture screen " -#define NSAppKitVersionNumber10_8 1187 -#define NSAppKitVersionNumber10_9 1265 +// definitions used (also) by screen_avf +extern "C" { + extern const unsigned AVF_SCR_CAP_OFF = 100; + extern const char AFV_SCR_CAP_NAME_PREF[] = SCR_CAP_NAME_PREF; + unsigned avfoundation_get_screen_count(void); + bool avfoundation_usage(const char *fmt, bool for_screen); +} // extern "C" #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 140000 #define DESK_VIEW_IF_DEFINED ,AVCaptureDeviceTypeDeskViewCamera @@ -69,13 +76,6 @@ using std::string; namespace vidcap_avfoundation { -std::unordered_map preset_to_av = { - { "high", AVCaptureSessionPresetHigh }, - { "medium", AVCaptureSessionPresetMedium }, - { "low", AVCaptureSessionPresetLow }, - { "VGA", AVCaptureSessionPreset640x480 }, - { "HD", AVCaptureSessionPreset1280x720 }, -}; std::unordered_map> av_to_uv = { {kCVPixelFormatType_32ARGB, {RGBA, 8, 16, 24}}, @@ -106,13 +106,13 @@ @interface vidcap_avfoundation_state : NSObject { AVCaptureDevice *m_device; + bool m_is_screen_cap; AVCaptureSession *m_session; mutex m_lock; condition_variable m_frame_ready; queue m_queue; - chrono::steady_clock::time_point m_t0; double m_fps_req; - int m_frames; + struct video_desc m_saved_desc; } - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer @@ -147,17 +147,40 @@ +(NSArray *) devices }]; } -enum usage_verbosity { - VERB_SHORT, - VERB_NORMAL, - VERB_FULL, -}; - -+ (void)usage: (enum usage_verbosity) verbose +/** + * @param for_screen print from screen (-t screen:help), not avfoundation:help + * @retval true - help shown; false - help not requested + */ +bool +avfoundation_usage(const char *fmt, bool for_screen = false) { - col() << "AV Foundation capture usage:" << "\n"; - col() << "\t" << SBOLD(SRED("-t avfoundation") << "[:device=|:name=|:uid=][:preset=|:mode=[:fps=|:fr_idx=]]") << "\n"; - col() << "\t" << SBOLD("-t avfoundation:[short|full]help") << "\n"; + enum { + VERB_SHORT, + VERB_NORMAL, + VERB_FULL, + } verbose; + if (strcasecmp(fmt, "help") == 0) { + verbose = VERB_NORMAL; + } else if (strcasecmp(fmt, "shorthelp") == 0) { + verbose = VERB_SHORT; + } else if (strcasecmp(fmt, "fullhelp") == 0) { + verbose = VERB_FULL; + } else { + return false; + } + + if (for_screen) { + color_printf(TBOLD("screen") " capture - AV Foundation implementation.\n"); + color_printf("You can use also " TBOLD("avfoundation") " capture directly.\n"); + color_printf("\nUsage:\n"); + } else { + color_printf(TBOLD("AV Foundation") " capture usage:\n"); + } + const char *mod_name = for_screen ? "screen" : "avfoundation"; + color_printf("\t" TBOLD(TRED("-t %s") "[:device=|:name=|" + ":uid=][:preset=|:mode=[:fps=|" + ":fr_idx=]]") "\n", mod_name); + color_printf("\t" TBOLD("-t %s:[short|full]help") "\n", mod_name); col() << "\n"; col() << "where:\n"; col() << "\t" << SBOLD("") << " represents a device index in a list below\n"; @@ -165,25 +188,44 @@ + (void)usage: (enum usage_verbosity) verbose col() << "\t" << SBOLD("") << " is a device unique identifier\n"; col() << "\t" << SBOLD("") << " is a number of frames per second (can be a number with a decimal point)\n"; col() << "\t" << SBOLD("") << " is index of frame rate obtained from '-t avfoundation:fullhelp'\n"; - col() <<"\t" << SBOLD("") << " may be " << SBOLD("\"low\"") << ", " << SBOLD("\"medium\"") << ", " << SBOLD("\"high\"") << ", " << SBOLD("\"VGA\"") << " or " << SBOLD("\"HD\"") << "\n"; + color_printf("\t" TBOLD("") " may be any of " + TUNDERLINE("AVCaptureSessionPreset") " such as " + TBOLD("Low") ", " TBOLD("Medium") ", " TBOLD("High") ", " + TBOLD("Photo") ", " TBOLD("1280x720") ", " TBOLD("1920x1080") + ", " TBOLD("320x240") ", " TBOLD("352x288") ", " + TBOLD("3840x2160") ", " TBOLD("3840x2160") ", " TBOLD("640x480") + " or " TBOLD("960x540") "\n"); col() << "\n"; col() << "All other parameters are represented by appropriate numeric index." << "\n\n"; col() << "Examples:" << "\n"; - col() << "\t" << SBOLD("-t avfoundation") << "\n"; - col() << "\t" << SBOLD("-t avfoundation:preset=high") << "\n"; - col() << "\t" << SBOLD("-t avfoundation:device=0:preset=high") << "\n"; - col() << "\t" << SBOLD("-t avfoundation:device=0:mode=24:fps=30") << " (advanced)" << "\n"; + color_printf("\t" TBOLD("-t %s") "\n", mod_name); + color_printf("\t" TBOLD("-t %s:pr=1280x720:fps=30") "\n", mod_name); + color_printf("\t" TBOLD("-t %s:device=0:preset=High") "\n", mod_name); + if (!for_screen) { + color_printf("\t" TBOLD("-t %s:dev=0:mode=24:fps=30") + " (advanced, not for screen cap)" "\n", mod_name); + } col() << "\n"; - col() << "Available AV foundation capture devices and modes:" << "\n"; + if (for_screen) { + color_printf("Available AV Foundation " TBOLD("screen") + " displays:\n"); + } else { + color_printf("Available " TBOLD("AV Foundation") + " capture devices and modes:\n"); + } int i = 0; // deprecated rewrite example: https://github.com/flutter/plugins/blob/e85f8ac1502db556e03953794ad0aa9149ddb02a/packages/camera/camera_avfoundation/ios/Classes/CameraPlugin.m#L108 // but the new API doesn't seem to be eligible since individual AVCaptureDeviceType must be enumerated, perhaps better to keep the old one for (AVCaptureDevice *device in [vidcap_avfoundation_state devices]) { + if (for_screen) { + continue; + } int j = 0; - string default_dev = device == [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] ? "*" : ""; - col() << default_dev << i++ << ": " << SBOLD([[device - localizedName] UTF8String]) << " (uid: " << - [[device uniqueID] UTF8String] << ")\n"; + const char default_dev = device == [AVCaptureDevice + defaultDeviceWithMediaType:AVMediaTypeVideo] ? '*' : ' '; + color_printf("%c%3d: " TBOLD("%s") " (uid: %s)\n", default_dev, i++, + [[device localizedName] UTF8String], + [[device uniqueID] UTF8String]); if (verbose == VERB_SHORT) { continue; } @@ -211,11 +253,31 @@ + (void)usage: (enum usage_verbosity) verbose } col() << "\n"; } - col() << "device marked with an asterisk ('*') is default\n"; - if (verbose == VERB_NORMAL) { + + uint32_t num_screens = 0; + CGGetActiveDisplayList(0, NULL, &num_screens); + if (num_screens > 0) { + vector screens(num_screens); + CGGetActiveDisplayList(num_screens, screens.data(), &num_screens); + for (unsigned j = 0; j < num_screens; j++) { + const char default_dev = i == 0 + && screens[j] == CGMainDisplayID() ? '*' : ' '; + color_printf("%c%3u: " TBOLD(SCR_CAP_NAME_PREF "%u") " (uid: %u)" + "\n\n", default_dev, AVF_SCR_CAP_OFF + j, j, screens[j]); + } + } + + if (i == 0 && num_screens == 0) { + MSG(WARNING, "No devices found!\n"); + } else { + color_printf("device marked with an asterisk ('*') is default\n"); + } + + if (!for_screen && verbose == VERB_NORMAL) { col() << "(type '-t avfoundation:fullhelp' to see available framerates)\n"; col() << "(type '-t avfoundation:shorthelp' to hide modes)\n"; } + return true; } #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101400 @@ -229,14 +291,43 @@ static void (^cb)(BOOL) = ^void(BOOL granted) { }; #endif // at least mac 10.14 +static void +set_scren_cap_properties(AVCaptureScreenInput* capture_screen_input, double fps) { + capture_screen_input.capturesCursor = YES; + capture_screen_input.capturesMouseClicks = YES; + if (fps) { + capture_screen_input.minFrameDuration = CMTimeMake(1, fps); + } +} + +unsigned +avfoundation_get_screen_count(void) { + uint32_t num_screens = 0; + CGGetActiveDisplayList(0, NULL, &num_screens); + return num_screens; +} + - (id)initWithParams: (NSDictionary *) params { self = [super init]; bool use_preset = true; + int device_idx = [params valueForKey:@"device"] + ? [[params valueForKey:@"device"] intValue] : -1; + NSString *device_name = [params valueForKey:@"name"]; + NSString *device_uid = [params valueForKey:@"uid"]; - m_t0 = chrono::steady_clock::now(); - m_frames = 0; - m_fps_req = 0.0; + if (device_name) { + if (sscanf([device_name UTF8String], SCR_CAP_NAME_PREF "%d", + &device_idx) == 1) { // eg. "Capture screen 0" + device_idx += AVF_SCR_CAP_OFF; + } + } + m_fps_req = [params valueForKey:@"fps"] + ? [[params valueForKey:@"fps"] doubleValue] : 0; + m_is_screen_cap = device_idx >= (int) AVF_SCR_CAP_OFF + || (device_uid && [device_uid length] <= 3); + m_device = nil; + m_saved_desc = {}; #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101400 AVAuthorizationStatus authorization_status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; @@ -259,10 +350,27 @@ - (id)initWithParams: (NSDictionary *) params // chosen device. // Find a suitable AVCaptureDevice - int device_idx = [params valueForKey:@"device"] ? [[params valueForKey:@"device"] intValue] : -1; - NSString *device_uid = [params valueForKey:@"uid"]; - NSString *device_name = [params valueForKey:@"name"]; - if (device_idx != -1 || device_name != nullptr || + if (m_is_screen_cap) { + uint32_t num_screens = 0; + CGDirectDisplayID id; + if (device_idx != -1) { + CGGetActiveDisplayList(0, NULL, &num_screens); + unsigned idx = device_idx - AVF_SCR_CAP_OFF; + if (device_idx != -1 && idx >= num_screens) { + [NSException raise:@"Invalid argument" format:@"Screen capture device index %d is invalid", device_idx]; + } + vector screens(num_screens); + CGGetActiveDisplayList(num_screens, screens.data(), &num_screens); + id = screens[idx]; + } else { + id = atoi([device_uid UTF8String]); + } + AVCaptureScreenInput* capture_screen_input = + [[[AVCaptureScreenInput alloc] + initWithDisplayID:id] autorelease]; + set_scren_cap_properties(capture_screen_input, m_fps_req); + m_device = (AVCaptureDevice*) capture_screen_input; + } else if (device_idx != -1 || device_name != nullptr || device_uid != nullptr) { int i = -1; for (AVCaptureDevice *device in [vidcap_avfoundation_state devices]) { @@ -292,17 +400,28 @@ - (id)initWithParams: (NSDictionary *) params } else { m_device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + if (m_device == nil) { + CGDirectDisplayID mainScreenID = CGMainDisplayID(); + AVCaptureScreenInput* capture_screen_input = + [[[AVCaptureScreenInput alloc] + initWithDisplayID:mainScreenID] autorelease]; + set_scren_cap_properties(capture_screen_input, m_fps_req); + m_device = (AVCaptureDevice*) capture_screen_input; + } } if (m_device == nil) { [NSException raise:@"No device" format:@"No capture device was found!"]; } - LOG(LOG_LEVEL_NOTICE) << MOD_NAME << "Using device: " << [[m_device localizedName] UTF8String] << "\n"; + MSG(NOTICE, "Using device: %s\n", m_is_screen_cap + ? [[m_device description] UTF8String] + : [[m_device localizedName] UTF8String]); // Create a device input with the device and add it to the session. - AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:m_device - error:&error]; + AVCaptureDeviceInput *input = m_is_screen_cap + ? (AVCaptureDeviceInput *) m_device + : [AVCaptureDeviceInput deviceInputWithDevice:m_device error:&error]; if (!input) { [NSException raise:@"No media" format:@"No media input!"]; } @@ -344,9 +463,6 @@ - (id)initWithParams: (NSDictionary *) params NSLog(@"Mode index out of bounds!"); format = nil; } - if ([params valueForKey:@"fps"]) { - m_fps_req = [[params valueForKey:@"fps"] doubleValue]; - } if ([params valueForKey:@"fr_idx"]) { rate_idx_req = [[params valueForKey:@"fr_idx"] intValue]; } @@ -398,26 +514,33 @@ - (id)initWithParams: (NSDictionary *) params forKey:(id)kCVPixelBufferPixelFormatTypeKey]; } } - } else { - NSString *preset = AVCaptureSessionPresetMedium; - if ([params valueForKey:@"preset"]) { - auto it = preset_to_av.find([[params valueForKey:@"preset"] UTF8String]); - if (it != preset_to_av.end()) { - preset = it->second; - } else { - NSLog(@"Unknown preset %@!", [params valueForKey:@"preset"]); - } + } else if ([params valueForKey:@"preset"]) { + NSString *req_preset = [params valueForKey:@"preset"]; + if ([req_preset isEqualToString:@"VGA"]) { + MSG(WARNING, "preset VGA deprecated - use 640x480\n"); + req_preset = @"640x480"; + } + if ([req_preset isEqualToString:@"HD"]) { + MSG(WARNING, "preset HD deprecated - use 1280x720\n"); + req_preset = @"1280x720"; } + // for compat make first letter Upper - the preset opt used to + // be "low" so make it "Low" + NSString *firstLetterUpper = [[req_preset substringToIndex:1] + uppercaseString]; + NSString *restOfString = [req_preset substringFromIndex:1]; + NSString *preset = [ @"AVCaptureSessionPreset" stringByAppendingString: + [firstLetterUpper stringByAppendingString:restOfString]]; + + MSG(INFO, "using preset: %s\n", [preset UTF8String]); m_session.sessionPreset = preset; } // set device frame rate also to capture output to prevent rate oscilation AVCaptureConnection *conn = [output connectionWithMediaType: AVMediaTypeVideo]; - if (conn.isVideoMinFrameDurationSupported) + if (!m_is_screen_cap && conn.isVideoMinFrameDurationSupported) { conn.videoMinFrameDuration = m_device.activeVideoMinFrameDuration; - if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_9) { - if (conn.isVideoMaxFrameDurationSupported) - conn.videoMaxFrameDuration = m_device.activeVideoMaxFrameDuration; + conn.videoMaxFrameDuration = m_device.activeVideoMaxFrameDuration; } // You must also call lockForConfiguration: before calling the AVCaptureSession method startRunning, or the session's preset will override the selected active format on the capture device. @@ -458,6 +581,12 @@ - (void)dealloc [m_session stopRunning]; [m_session release]; + while (m_queue.size() > 0) { + struct video_frame *frame = m_queue.front(); + VIDEO_FRAME_DISPOSE(frame); + m_queue.pop(); + } + [super dealloc]; } @@ -486,6 +615,12 @@ - (struct video_frame *) imageFromSampleBuffer:(CMSampleBufferRef) sampleBuffer desc.tile_count = 1; desc.interlacing = PROGRESSIVE; + if (!video_desc_eq(m_saved_desc, desc)) { + MSG(NOTICE, "capturing video format: %s\n", + video_desc_to_string(desc)); + m_saved_desc = desc; + } + struct video_frame *ret = nullptr; // Get a CMSampleBuffer's Core Video image buffer for the media data @@ -532,29 +667,18 @@ - (struct video_frame *) grab m_frame_ready.wait_for(lock, milliseconds(100), [&]{return m_queue.size() != 0;}); if (m_queue.size() == 0) { return NULL; - } else { - struct video_frame *ret; - ret = m_queue.front(); - m_queue.pop(); - - m_frames++; - - chrono::steady_clock::time_point now = chrono::steady_clock::now(); - double seconds = chrono::duration_cast(now - m_t0).count() / 1000000.0; - if (seconds >= 5) { - cout << "[AVfoundation capture] " << m_frames << " frames in " - << seconds << " seconds = " << m_frames / seconds << " FPS\n"; - m_t0 = now; - m_frames = 0; - } - - return ret; } + + struct video_frame *ret; + ret = m_queue.front(); + m_queue.pop(); + return ret; } @end static void vidcap_avfoundation_probe(struct device_info **available_cards, int *count, void (**deleter)(void *)) { +@autoreleasepool { *deleter = free; struct device_info *cards = NULL; @@ -603,11 +727,12 @@ static void vidcap_avfoundation_probe(struct device_info **available_cards, int *available_cards = cards; *count = card_count; } +} static NSMutableDictionary * parse_fmt(char *fmt) { - NSMutableDictionary *init_params = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *init_params = [[[NSMutableDictionary alloc] init] autorelease]; char *item = nullptr; char *save_ptr = nullptr; char *cfg = fmt; @@ -642,8 +767,6 @@ static void vidcap_avfoundation_probe(struct device_info **available_cards, int NSString *key = [NSString stringWithCString:key_cstr encoding:NSASCIIStringEncoding]; [init_params setObject:val forKey:key]; - [key release]; - [val release]; cfg = NULL; } @@ -652,15 +775,9 @@ static void vidcap_avfoundation_probe(struct device_info **available_cards, int static int vidcap_avfoundation_init(struct vidcap_params *params, void **state) { - if (strcasecmp(vidcap_params_get_fmt(params), "help") == 0) { - [vidcap_avfoundation_state usage: VERB_NORMAL]; - return VIDCAP_INIT_NOERR; - } else if (strcasecmp(vidcap_params_get_fmt(params), "shorthelp") == 0) { - [vidcap_avfoundation_state usage: VERB_SHORT]; - return VIDCAP_INIT_NOERR; - } else if (strcasecmp(vidcap_params_get_fmt(params), "fullhelp") == 0) { - [vidcap_avfoundation_state usage: VERB_FULL]; - return VIDCAP_INIT_NOERR; +@autoreleasepool { + if (avfoundation_usage(vidcap_params_get_fmt(params))) { + return VIDCAP_INIT_NOERR; // help shown } if ((vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) != 0U) { return VIDCAP_INIT_AUDIO_NOT_SUPPORTED; @@ -680,13 +797,12 @@ static int vidcap_avfoundation_init(struct vidcap_params *params, void **state) cerr << [[e reason] UTF8String] << "\n"; ret = nullptr; } - [init_params release]; - if (ret) { - *state = ret; - return VIDCAP_INIT_OK; - } else { + if (!ret) { return VIDCAP_INIT_FAIL; } + *state = ret; + return VIDCAP_INIT_OK; +} } static void vidcap_avfoundation_done(void *state) @@ -700,12 +816,12 @@ static void vidcap_avfoundation_done(void *state) return [(vidcap_avfoundation_state *) state grab]; } -static const struct video_capture_info vidcap_avfoundation_info = { +extern const struct video_capture_info vidcap_avfoundation_info = { vidcap_avfoundation_probe, vidcap_avfoundation_init, vidcap_avfoundation_done, vidcap_avfoundation_grab, - VIDCAP_NO_GENERIC_FPS_INDICATOR, + MOD_NAME, }; REGISTER_MODULE(avfoundation, &vidcap_avfoundation_info, LIBRARY_CLASS_VIDEO_CAPTURE, VIDEO_CAPTURE_ABI_VERSION); diff --git a/src/video_capture/screen_avf.c b/src/video_capture/screen_avf.c new file mode 100644 index 0000000000..f81ad23035 --- /dev/null +++ b/src/video_capture/screen_avf.c @@ -0,0 +1,151 @@ +/** + * @file video_capture/screen_avf.c + * @author Martin Pulec + * + * screen capture using AVFoundation + */ +/* + * Copyright (c) 2026 CESNET, zájmové sdružení právnických osob + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, is permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of CESNET nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include // for calloc, free +#include // for strcasecmp + +#include "compat/c23.h" // C23 fallback defines (nullptr etc.) +#include "lib_common.h" // for REGISTER_MODULE, library_class +#include "types.h" // for device_info +#include "utils/macros.h" // for snprintf_ch +#include "video_capture.h" // for video_capture_info, VIDCAP_INIT_NOERR +#include "video_capture_params.h" // for vidcap_params_get_fmt + +struct audio_frame; +struct vidcap_params; + +#define MOD_NAME "[screen cap avf] " + +// items defined in avfoundation.mm +extern const struct video_capture_info vidcap_avfoundation_info; +bool avfoundation_usage(const char *fmt, bool for_screen); +unsigned avfoundation_get_screen_count(void); +extern const char AFV_SCR_CAP_NAME_PREF[]; +extern const unsigned AVF_SCR_CAP_OFF; + +static void +vidcap_screen_avf_probe(struct device_info **available_cards, int *count, + void (**deleter)(void *)) +{ + *available_cards = nullptr; + *count = (int) avfoundation_get_screen_count(); + *deleter = free; + if (*count == 0) { + return; + } + *available_cards = calloc(*count, sizeof(struct device_info)); + + for (int i = 0; i < *count; ++i) { + snprintf_ch((*available_cards)[i].name, ":%u", + AVF_SCR_CAP_OFF + i); + snprintf_ch((*available_cards)[i].dev, "%s%d", + AFV_SCR_CAP_NAME_PREF, i); + } +} + +/// @returns whether the config string contains device spec (d=/uid=/name=) +static bool +contains_dev_spec(const char *fmt) +{ + char *cpy = strdup(fmt); + char *tmp = cpy; + char *saveptr = nullptr; + char *item = nullptr; + while ((item = strtok_r(tmp, ":", &saveptr)) != nullptr) { + tmp = nullptr; + char *delim = strchr(item, '='); + if (!delim) { + continue; + } + *delim = '\0'; + if (strstr(item, "device") == item || + strstr(item, "uid") == item || + strstr(item, "name") == item) { + return true; + } + } + return false; +} + +static int +vidcap_screen_avf_init(struct vidcap_params *params, void **state) +{ + const char *fmt = vidcap_params_get_fmt(params); + + if (avfoundation_usage(fmt, true)) { + return VIDCAP_INIT_NOERR; // help shown + } + + if (contains_dev_spec(fmt)) { + return vidcap_avfoundation_info.init(params, state); + } + + // add "d=100" to initialize first screen cap av foundation device + const size_t orig_len = strlen(fmt); + const size_t new_len = orig_len + 50; + char *new_fmt = malloc(new_len); + (void) snprintf(new_fmt, new_len, "%s%sd=%u", fmt, + orig_len == 0 ? "" : ":", AVF_SCR_CAP_OFF); + vidcap_params_replace_fmt(params, new_fmt); + free(new_fmt); + return vidcap_avfoundation_info.init(params, state); +} + +static void +vidcap_screen_avf_done(void *state) +{ + return vidcap_avfoundation_info.done(state); +} + +static struct video_frame * +vidcap_screen_avf_grab(void *state, struct audio_frame **audio) +{ + return vidcap_avfoundation_info.grab(state, audio); +} + +static const struct video_capture_info vidcap_screen_avf_info = { + vidcap_screen_avf_probe, + vidcap_screen_avf_init, + vidcap_screen_avf_done, + vidcap_screen_avf_grab, + MOD_NAME, +}; + +REGISTER_MODULE(screen, &vidcap_screen_avf_info, LIBRARY_CLASS_VIDEO_CAPTURE, + VIDEO_CAPTURE_ABI_VERSION); diff --git a/src/video_capture_params.cpp b/src/video_capture_params.cpp index ebaf96e618..65faa8a0fe 100644 --- a/src/video_capture_params.cpp +++ b/src/video_capture_params.cpp @@ -5,7 +5,7 @@ * @ingroup vidcap */ /* - * Copyright (c) 2013-2025 CESNET, zájmové sdružení právnických osob + * Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -280,6 +280,13 @@ struct vidcap_params *vidcap_params_copy(const struct vidcap_params *params) return ret; } +void +vidcap_params_replace_fmt(struct vidcap_params *params, const char *new_fmt) +{ + free(params->fmt); + params->fmt = strdup(new_fmt); +} + /** * Frees all members of the given structure as well as its members. * diff --git a/src/video_capture_params.h b/src/video_capture_params.h index 71f07c1d0a..05b90b9df8 100644 --- a/src/video_capture_params.h +++ b/src/video_capture_params.h @@ -10,7 +10,7 @@ * individual devices' parameters (namely per-device capture filter). */ /** - * Copyright (c) 2013-2025 CESNET, zájmové sdružení právnických osob + * Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,6 +81,8 @@ void vidcap_params_add_capture_filter(struct vidcap_params *par const char *vidcap_params_get_capture_filter(const struct vidcap_params *params); void vidcap_params_set_flags(struct vidcap_params *params, unsigned int flags); void vidcap_params_add_flags(struct vidcap_params *params, unsigned int flags); +void vidcap_params_replace_fmt(struct vidcap_params *params, + const char *new_fmt); /// @} #ifdef __cplusplus From 65fe8de662cfb84173e458c7338d864a5063e3a6 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 20 Jan 2026 08:33:16 +0100 Subject: [PATCH 45/86] CI: enable screen on macos-15-intel + CG on mac 14 Removed --disable-screen for macos-15-intel and enforced the original Core Graphics implementation for the arm64 builds (we are still in the stable branch so not to make the change when not needed - for Intel builds it was enforced by the GH runner replacement, however). --- .github/scripts/environment.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/environment.sh b/.github/scripts/environment.sh index 792eb00e58..4c468af114 100644 --- a/.github/scripts/environment.sh +++ b/.github/scripts/environment.sh @@ -105,8 +105,8 @@ case "$RUNNER_OS" in --enable-syphon \ " macos_major=$(sw_vers -productVersion | cut -d. -f1) - if [ "$macos_major" -ge 15 ]; then - FEATURES="$FEATURES --disable-screen" + if [ "$macos_major" -lt 15 ]; then + FEATURES="$FEATURES --enable-screen=cg" fi ;; Windows) From d3c70c382ce7776dba98418214ec6396d8987041 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 15 Jan 2026 14:43:44 +0100 Subject: [PATCH 46/86] CI Linux FFmpeg: updated SVT-HEVC patch SVT-JPEG-XS has been merged, which was causing the conflicts --- ...hevc-add-libsvt-hevc-encoder-wrapper.patch | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/scripts/Linux/ffmpeg-patches/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch b/.github/scripts/Linux/ffmpeg-patches/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch index 3357f93abb..3f0a7f9ed8 100644 --- a/.github/scripts/Linux/ffmpeg-patches/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch +++ b/.github/scripts/Linux/ffmpeg-patches/0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch @@ -1,4 +1,4 @@ -From 19f4bd57e3d60dc6e40bc1ff96fbb91916dd7cc4 Mon Sep 17 00:00:00 2001 +From 6fe97a207e1094365f4be54dff0a2412d3130042 Mon Sep 17 00:00:00 2001 From: Jing Sun Date: Wed, 21 Nov 2018 11:33:04 +0800 Subject: [PATCH] lavc/svt_hevc: add libsvt hevc encoder wrapper @@ -21,10 +21,10 @@ UPDATED 2025-06-20 by Martin Pulec: rebased against 45a30e036 + fix compile create mode 100644 libavcodec/libsvt_hevc.c diff --git a/configure b/configure -index e1809a3e58..936cea82ab 100755 +index 60e33e26e4..da24e814a4 100755 --- a/configure +++ b/configure -@@ -339,6 +339,7 @@ External library support: +@@ -345,6 +345,7 @@ External library support: --enable-whisper enable whisper filter [no] --disable-xlib disable xlib [autodetect] --disable-zlib disable zlib [autodetect] @@ -32,15 +32,15 @@ index e1809a3e58..936cea82ab 100755 The following libraries provide various hardware acceleration features: --disable-amf disable AMF video encoding code [autodetect] -@@ -1979,6 +1980,7 @@ EXTERNAL_LIBRARY_LIST=" +@@ -2052,6 +2053,7 @@ EXTERNAL_LIBRARY_LIST=" libsrt libssh libsvtav1 + libsvthevc + libsvtjpegxs libtensorflow libtesseract - libtheora -@@ -3678,6 +3680,7 @@ vapoursynth_demuxer_deps="vapoursynth" +@@ -3792,6 +3794,7 @@ vapoursynth_demuxer_deps="vapoursynth" videotoolbox_suggest="coreservices" videotoolbox_deps="corefoundation coremedia corevideo VTDecompressionSessionDecodeFrame" videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames" @@ -48,19 +48,19 @@ index e1809a3e58..936cea82ab 100755 # demuxers / muxers ac3_demuxer_select="ac3_parser" -@@ -7149,6 +7152,7 @@ enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/ +@@ -7313,6 +7316,7 @@ enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/ enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle +enabled libsvthevc && require_pkg_config libsvthevc SvtHevcEnc EbApi.h EbInitHandle + enabled libsvtjpegxs && require_pkg_config libsvtjpegxs "SvtJpegxs >= 0.10.0" SvtJpegxsEnc.h svt_jpeg_xs_encoder_init enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate - enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg diff --git a/libavcodec/Makefile b/libavcodec/Makefile -index 35408949ac..12f534a1d7 100644 +index 3d60347a19..db09ee37de 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile -@@ -1202,6 +1202,7 @@ OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER) += libwebpenc_common.o libwebpenc_anim +@@ -1225,6 +1225,7 @@ OBJS-$(CONFIG_LIBWEBP_ANIM_ENCODER) += libwebpenc_common.o libwebpenc_anim OBJS-$(CONFIG_LIBX262_ENCODER) += libx264.o OBJS-$(CONFIG_LIBX264_ENCODER) += libx264.o OBJS-$(CONFIG_LIBX265_ENCODER) += libx265.o @@ -69,10 +69,10 @@ index 35408949ac..12f534a1d7 100644 OBJS-$(CONFIG_LIBXAVS2_ENCODER) += libxavs2.o OBJS-$(CONFIG_LIBXEVD_DECODER) += libxevd.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c -index f5ec2e01e8..7844040a00 100644 +index 042b07c895..69005226ef 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c -@@ -827,6 +827,7 @@ extern const FFCodec ff_libxavs_encoder; +@@ -841,6 +841,7 @@ extern const FFCodec ff_libxavs_encoder; extern const FFCodec ff_libxavs2_encoder; extern const FFCodec ff_libxvid_encoder; extern const FFCodec ff_libzvbi_teletext_decoder; @@ -671,5 +671,5 @@ index 0000000000..07f62fa762 + .p.wrapper_name = "libsvt_hevc", +}; -- -2.50.1 +2.52.0 From 925a91835f45881d371d5de263c4f9ad54558aac Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 6 Jan 2026 14:19:46 +0100 Subject: [PATCH 47/86] AppRun: fix lavc warnings on Tumbleweed suppress ldd warnings: when trying the the bundled libavcodec.so with system deps Probably OK to silence - the system libva from the live OpenSUSE ISO seem to be preloaded. --- data/scripts/Linux-AppImage/AppRun | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/scripts/Linux-AppImage/AppRun b/data/scripts/Linux-AppImage/AppRun index 79a892fa16..52356e15de 100755 --- a/data/scripts/Linux-AppImage/AppRun +++ b/data/scripts/Linux-AppImage/AppRun @@ -197,12 +197,14 @@ libavcodec.so" | grep "$1" | grep -v 'not found' | awk '{print $3}' AI_LIBAVCODEC_LIB=$(get_ai_lib_path libavcodec.so) check_libva_deps() { # check if all liva*.so satisfied from sys [ -n "$1" ] || return 1 - ! LD_TRACE_LOADED_OBJECTS=1 "$LOADER" "$1" | + ! LD_TRACE_LOADED_OBJECTS=1 "$LOADER" "$1" 2>/dev/null | grep -q 'libva.*not found' } check_libva_deps "$AI_LIBAVCODEC_LIB" && check_libva_deps \ "$(get_ai_lib_path libavutil.so)" || return 1 - LIBVA_LIB=$(LD_TRACE_LOADED_OBJECTS=1 "$LOADER" "$AI_LIBAVCODEC_LIB" | grep libva.so | grep -v 'not found' | awk '{print $3}') + LIBVA_LIB=$(LD_TRACE_LOADED_OBJECTS=1 "$LOADER" "$AI_LIBAVCODEC_LIB" \ + 2>/dev/null | grep libva.so | grep -v 'not found' | + awk '{print $3}') [ -n "$LIBVA_LIB" ] || return 1 libva_libs=$LIBVA_LIB # add also libva-drm, libva-x11 if present @@ -214,7 +216,8 @@ libavcodec.so" | grep "$1" | grep -v 'not found' | awk '{print $3}' done # preload also VDPAU libvdpau_lib=$(LD_TRACE_LOADED_OBJECTS=1 "$LOADER" "$AI_LIBAVCODEC_LIB"\ - | grep libvdpau.so | grep -v 'not found' | awk '{print $3}') + 2>/dev/null | grep libvdpau.so | grep -v 'not found' | + awk '{print $3}') if [ -n "$libvdpau_lib" ]; then libva_libs=$libva_libs:$libvdpau_lib fi From eb078cc7e5850533dac170abf1f2fed4efc52240 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 20 Jan 2026 11:47:31 +0100 Subject: [PATCH 48/86] updated FIXES.md --- FIXES.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/FIXES.md b/FIXES.md index 855f0724e8..d04e8134fd 100644 --- a/FIXES.md +++ b/FIXES.md @@ -2,7 +2,17 @@ * fix Vulkan display crashing on keypresses in console * fix GL display show/hide cursor keybind -* fix control port argument in hd-rum-translator +* fix control port argument in hd-rum-translator (GH-482) +* added 2 conversions for Videotoolbox 10b encode (GH-479, GH-480) +* modified hevc_videotoolbox not to default to 4:2:0 (GH-480) +* bundle libdecor so that the windows (GL/SDL/Vulkan) have decorations + in Wayland +* make SPOUT running again (GH-487) +* fix VDPAU being advertised/used with GL even when undesirable +* fix GPUJPEG subsampling detection (probe, by updated GJ upstream) +* ported AV Foundation vcap from master so that it can be used as + a screen capture for macOS Intel builds (the old Core Graphics cannot + be built anymore) (GH-485) #### 1.10.1 @@ -12,4 +22,4 @@ * fix Pipewire screen capture not starting * build fixes * reenable AV Foundation (not being enabled on macOS) -* fix decoding ProRes +* fix decoding ProRes (GH-481) From 07d32819c340972ff65bb17dbd1615353ff0fc9e Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 20 Jan 2026 11:48:00 +0100 Subject: [PATCH 49/86] UltraGrid 1.10.2 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9b538a7c6c..46c9e89ad6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([UltraGrid],[1.10.1],[ultragrid-dev@cesnet.cz]) +AC_INIT([UltraGrid],[1.10.2],[ultragrid-dev@cesnet.cz]) configure_flags="$*" AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.10]) From c5d6edc9ed1aae40be60b921aa34cb450e182f92 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 21 Jan 2026 13:27:37 +0100 Subject: [PATCH 50/86] screen_avf: probe: fixed swapped name/dev + missing "d" in dev specifier (should be ":d=100" for 1st screen) --- src/video_capture/screen_avf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_capture/screen_avf.c b/src/video_capture/screen_avf.c index f81ad23035..2c7576c61d 100644 --- a/src/video_capture/screen_avf.c +++ b/src/video_capture/screen_avf.c @@ -72,9 +72,9 @@ vidcap_screen_avf_probe(struct device_info **available_cards, int *count, *available_cards = calloc(*count, sizeof(struct device_info)); for (int i = 0; i < *count; ++i) { - snprintf_ch((*available_cards)[i].name, ":%u", + snprintf_ch((*available_cards)[i].dev, ":d=%u", AVF_SCR_CAP_OFF + i); - snprintf_ch((*available_cards)[i].dev, "%s%d", + snprintf_ch((*available_cards)[i].name, "%s%d", AFV_SCR_CAP_NAME_PREF, i); } } From a44124feb531d4133ab5a90bdb1b57bb5e0c2cab Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 21 Jan 2026 15:59:01 +0100 Subject: [PATCH 51/86] cap/avf,ca: print that capturing explicitly to eventualy comply with Apple Developer Program License Agreement 3.3.3.A --- src/audio/capture/coreaudio.m | 4 +++- src/video_capture/avfoundation.mm | 2 ++ src/video_capture/screen_osx.c | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/audio/capture/coreaudio.m b/src/audio/capture/coreaudio.m index 5f07d1397c..179d11c53b 100644 --- a/src/audio/capture/coreaudio.m +++ b/src/audio/capture/coreaudio.m @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2011-2023 CESNET, z. s. p. o. + * Copyright (c) 2011-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -393,6 +393,8 @@ static void (^cb)(BOOL) = ^void(BOOL granted) { } while(0); if (!failed) { + color_printf("🔴 " MOD_NAME TBOLD(TYELLOW("This application is capturing" + " computer audio.")) "\n"); return s; } diff --git a/src/video_capture/avfoundation.mm b/src/video_capture/avfoundation.mm index 2d3f1325a5..211f5de380 100644 --- a/src/video_capture/avfoundation.mm +++ b/src/video_capture/avfoundation.mm @@ -800,6 +800,8 @@ static int vidcap_avfoundation_init(struct vidcap_params *params, void **state) if (!ret) { return VIDCAP_INIT_FAIL; } + color_printf("🔴 " MOD_NAME TBOLD(TYELLOW("This application is capturing" + " computer video.")) "\n"); *state = ret; return VIDCAP_INIT_OK; } diff --git a/src/video_capture/screen_osx.c b/src/video_capture/screen_osx.c index a6f50e5459..0231fdcfc8 100644 --- a/src/video_capture/screen_osx.c +++ b/src/video_capture/screen_osx.c @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2012-2025 CESNET + * Copyright (c) 2012-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,7 @@ #include "pixfmt_conv.h" #include "tv.h" #include "types.h" +#include "utils/color_out.h" #include "utils/video_frame_pool.h" #include "video_capture.h" #include "video_capture_params.h" @@ -227,6 +228,9 @@ static int vidcap_screen_osx_init(struct vidcap_params *params, void **state) return VIDCAP_INIT_FAIL; } + color_printf("🔴 " MOD_NAME TBOLD(TYELLOW("This application is capturing" + " computer screen.")) "\n"); + *state = s; return VIDCAP_INIT_OK; } From 9f01f684be62e9879a2de81bdf74fe227e184de2 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 22 Jan 2026 09:46:53 +0100 Subject: [PATCH 52/86] Revert "CI macOS 14 (arm64) deployment fix" This reverts commit f9963c42ad3b0eb9c55de26fff962641d06ea052. This workaround is no longer needed, on the contrary, it breaks the CI now: --- Makefile.in | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Makefile.in b/Makefile.in index 484f027b52..6d255bcd9d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -647,13 +647,6 @@ $(GUI_BUNDLE): $(BUNDLE) $(GUI_BUNDLE_DEP) | dylibbundler -of -cd -b -d $(GUI_BUNDLE)/Contents/libs \ -x $(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework/QtDBus;\ fi - # TODO TOREMOVE: also libbrotlidec.1.dylib seem to be copied with macdeployqt - # but without dependencies handled. However, the v1.2 (1.dylib is a symlink) is - # bundled/fixed by uv so use that. - if [ -f $(GUI_BUNDLE)/Contents/libs/libbrotlidec.1.dylib ]; then \ - cd $(GUI_BUNDLE)/Contents/libs/; rm libbrotlidec.1.dylib; \ - ln -s libbrotlidec*.dylib libbrotlidec.1.dylib; \ - fi defaults write `pwd`/$(GUI_BUNDLE)/Contents/Info.plist NSCameraUsageDescription \ 'Allow camera for video capture' From d1836a94edc2217b8e68988db8285e3ef7f75ae8 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Fri, 23 Jan 2026 15:09:21 +0100 Subject: [PATCH 53/86] GUI: Add "LIVE" indicator --- gui/QT/ui/ultragrid_window.ui | 20 ++++++++++++++-- gui/QT/uv-qt.pro | 2 ++ gui/QT/widget/live_widget.cpp | 38 ++++++++++++++++++++++++++++++ gui/QT/widget/live_widget.hpp | 25 ++++++++++++++++++++ gui/QT/window/ultragrid_window.cpp | 2 ++ 5 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 gui/QT/widget/live_widget.cpp create mode 100644 gui/QT/widget/live_widget.hpp diff --git a/gui/QT/ui/ultragrid_window.ui b/gui/QT/ui/ultragrid_window.ui index 084ad344c5..6bf3199532 100644 --- a/gui/QT/ui/ultragrid_window.ui +++ b/gui/QT/ui/ultragrid_window.ui @@ -77,7 +77,7 @@ - + 0 0 @@ -90,10 +90,20 @@ + + + + + 0 + 0 + + + + - + 0 0 @@ -854,6 +864,12 @@ QLabel
bandwidth_widget.hpp
+ + LiveWidget + QWidget +
live_widget.hpp
+ 1 +
diff --git a/gui/QT/uv-qt.pro b/gui/QT/uv-qt.pro index 119c221ce0..6a6cac6b8e 100644 --- a/gui/QT/uv-qt.pro +++ b/gui/QT/uv-qt.pro @@ -57,6 +57,7 @@ HEADERS += window/ultragrid_window.hpp \ widget/recv_loss.hpp \ widget/bandwidth_widget.hpp \ window/settings_window.hpp \ + widget/live_widget.hpp \ option/widget_ui.hpp \ option/checkable_ui.hpp \ option/checkbox_ui.hpp \ @@ -91,6 +92,7 @@ SOURCES += window/ultragrid_window.cpp \ widget/recv_report.cpp \ widget/recv_loss.cpp \ widget/bandwidth_widget.cpp \ + widget/live_widget.cpp \ window/settings_window.cpp \ option/widget_ui.cpp \ option/checkable_ui.cpp \ diff --git a/gui/QT/widget/live_widget.cpp b/gui/QT/widget/live_widget.cpp new file mode 100644 index 0000000000..fbc51e4ec6 --- /dev/null +++ b/gui/QT/widget/live_widget.cpp @@ -0,0 +1,38 @@ +#include "live_widget.hpp" + +#include + +constexpr auto label = "LIVE"; + +LiveWidget::LiveWidget(QWidget *parent) : + QWidget(parent), + liveText(label) +{ + QFontMetrics fm = fontMetrics(); + boundingRect = fm.boundingRect(liveText); + boundingRect.setWidth(boundingRect.width() + boundingRect.height()); //Add space for dot + + setMinimumSize(boundingRect.width(), boundingRect.height()); +} + +void LiveWidget::setLive(bool live){ + this->live = live; + update(); +} + +void LiveWidget::paintEvent(QPaintEvent *event){ + QPainter painter(this); + + + if(live){ + painter.setBrush(Qt::red); + painter.setPen(Qt::red); + } else{ + painter.setPen(Qt::gray); + auto font = painter.font(); + font.setStrikeOut(true); + painter.setFont(font); + } + painter.drawEllipse(0, boundingRect.height() / 4, boundingRect.height() / 2, boundingRect.height() / 2); + painter.drawText(QRect(0, 0, boundingRect.width(), boundingRect.height()), Qt::AlignRight, liveText); +} diff --git a/gui/QT/widget/live_widget.hpp b/gui/QT/widget/live_widget.hpp new file mode 100644 index 0000000000..c41eac3cd3 --- /dev/null +++ b/gui/QT/widget/live_widget.hpp @@ -0,0 +1,25 @@ +#ifndef LIVE_WIDGET_HPP_14CFE779EB7746999FBF8CE66D903392 +#define LIVE_WIDGET_HPP_14CFE779EB7746999FBF8CE66D903392 + +#include + +class LiveWidget : public QWidget{ + Q_OBJECT +public: + LiveWidget(QWidget *parent); + + +protected: + void paintEvent(QPaintEvent *paintEvent); + +public slots: + void setLive(bool live); + + +private: + QString liveText; + QRect boundingRect; + bool live = false; +}; + +#endif //LIVE_WIDGET_HPP_14CFE779EB7746999FBF8CE66D903392 \ No newline at end of file diff --git a/gui/QT/window/ultragrid_window.cpp b/gui/QT/window/ultragrid_window.cpp index 5f6f38e9ab..e5ac66dd56 100644 --- a/gui/QT/window/ultragrid_window.cpp +++ b/gui/QT/window/ultragrid_window.cpp @@ -353,6 +353,7 @@ void UltragridWindow::start(){ ui.startButton->setEnabled(true); processStatus.setText("UG: Running"); ui.actionRefresh->setEnabled(false); + ui.liveIndicator->setLive(true); }); connect(ctx.get(), &LaunchContext::processTerminated, @@ -365,6 +366,7 @@ void UltragridWindow::start(){ clearFmtLabels(); rtcpRr.resetRecvReports(); ui.send_bandwidth->reset(); + ui.liveIndicator->setLive(false); if(!requested && (es == QProcess::ExitStatus::CrashExit || ec != 0)){ processStatus.setText("UG: Crashed"); From 5808c805e0cc32cce1b2a1832c93bc35e0911173 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 18 Feb 2026 08:25:56 +0100 Subject: [PATCH 54/86] vdec/lavd: reenable CFHD decoder removed unintentionally by the commit 7dd9a441 (2025-10-03) as a consequence, this commit also allows CFHD encoder over vcap/lavc --- src/libavcodec/lavc_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libavcodec/lavc_common.c b/src/libavcodec/lavc_common.c index 60aaaaf6ba..9a2f73dce3 100644 --- a/src/libavcodec/lavc_common.c +++ b/src/libavcodec/lavc_common.c @@ -4,7 +4,7 @@ * @author Martin Piatka <445597@mail.muni.cz> */ /* - * Copyright (c) 2013-2025 CESNET, zájmové sdružení právnických osob + * Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -81,6 +81,7 @@ static const struct { { AV_CODEC_ID_PRORES, PRORES_422_PROXY }, { AV_CODEC_ID_PRORES, PRORES_422_LT }, { AV_CODEC_ID_APV, APV }, + { AV_CODEC_ID_CFHD, CFHD }, }; codec_t get_av_to_ug_codec(enum AVCodecID av_codec) From 69f86d002065a514eaad9a58f023dfee1e74e54a Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 19 Feb 2026 09:47:19 +0100 Subject: [PATCH 55/86] vdec/lavc: return PRIO_NA if decoder not present If the decoder is not present, do not return that we can decode because we cannot (we have just a pixfmt conversion here). This was omitted in refactor in the commit 7dd9a441 (2025-10-23) removing the metadata structure. --- src/video_decompress/libavcodec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video_decompress/libavcodec.c b/src/video_decompress/libavcodec.c index 77868323e5..b9f08ff708 100644 --- a/src/video_decompress/libavcodec.c +++ b/src/video_decompress/libavcodec.c @@ -1197,6 +1197,7 @@ static int libavcodec_decompress_get_priority(codec_t compression, struct pixfmt "Codec %s supported by lavd but " "not compiled in FFmpeg build.\n", get_codec_name(compression)); + return VDEC_PRIO_NA; } if (ugc == VC_NONE) { // probe From fd3f97129cc0e644d6a95d9cee6caad9a5a399d7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 19 Feb 2026 10:27:24 +0100 Subject: [PATCH 56/86] vcomp/lavc: hide CFHD if help is not full It is better that user uses the dedicated encoder so do not advertise that by default. --- src/video_compress/libavcodec.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index a7e3ae78a1..3925b88608 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -400,6 +400,7 @@ void usage(bool full) { ":slices=][safe]\n\t\t[:=]*") << "\n\t" << SBOLD(SRED("-c libavcodec") << ":[full]help") << "\n"; col() << "\nwhere\n"; + col() << "\t" << SBOLD("fullhelp") << " show all supported codecs and optiona\n"; col() << "\t" << SBOLD("") << " specifies encoder (eg. nvenc or libx264 for H.264)\n"; col() << "\t" << SBOLD("") << " - codec name (default MJPEG) if encoder name is not specified\n"; col() << "\t" << SBOLD("[disable_]intra_refresh") << ", " @@ -434,6 +435,9 @@ void usage(bool full) { if (avID == AV_CODEC_ID_NONE) { // unhandled or old FFMPEG -> codec id is flushed to 0 in compat continue; } + if (!full && ug_codec == CFHD) { + continue; + } char avail[1024]; const AVCodec *codec; if ((codec = avcodec_find_encoder(avID))) { From c7e7e8fd039507a8afd77c181c7b3a3ecd039ab9 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 20 Feb 2026 15:40:10 +0100 Subject: [PATCH 57/86] updated FIXES.md --- FIXES.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/FIXES.md b/FIXES.md index d04e8134fd..3327ba8216 100644 --- a/FIXES.md +++ b/FIXES.md @@ -1,3 +1,11 @@ +#### 1.10.3 + +* screen_avf: fix swapped name/dev in probe (for GUI) +* compliance with Apple Dev Program (explicit recording notice +if screen capture or Core Audio device is used) +* reenable CFHD decoding fallback with lavd +* fixed some small lavd regression when some decoders unavail + #### 1.10.2 * fix Vulkan display crashing on keypresses in console From 12e27052b06ca48b7a52ea2f27e6f1310b46ef53 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 20 Feb 2026 15:40:34 +0100 Subject: [PATCH 58/86] UltraGrid 1.10.3 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 46c9e89ad6..3370f8e292 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([UltraGrid],[1.10.2],[ultragrid-dev@cesnet.cz]) +AC_INIT([UltraGrid],[1.10.3],[ultragrid-dev@cesnet.cz]) configure_flags="$*" AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.10]) From 87c9fbacfffcd6a7d79801e5b81ee0a93bed1a73 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 10 Mar 2026 16:39:53 +0100 Subject: [PATCH 59/86] vcomp/lavc: fix default VP9 encoder for non-avx2 the default - libsvt_vp9 - requires AVX2 instructions so if not present, use the fallback. broken by some weird mistake since the commit ff3e34ef (24th Oct 2025) But see also the commit 2f145378 in master branch - the libvpx-vp9 encoder should be better for all other scenarios. Currently it is used just if compiled in to libavcodec, which is just the case for Linux CI builds and more generally if linked to libavcodec with libxvt_vp9 (most likely not the case unless FFmpeg manually compiled). --- FIXES.md | 5 +++++ src/video_compress/libavcodec.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/FIXES.md b/FIXES.md index 3327ba8216..89952714c3 100644 --- a/FIXES.md +++ b/FIXES.md @@ -1,3 +1,8 @@ +#### 1.10.4 + +* fix default VP9 on x86-64 pre v3 (wo AVX2). But the libvpx-vp9 + seem to be better encoder than libsvt_vp9 in any case. + #### 1.10.3 * screen_avf: fix swapped name/dev in probe (for GUI) diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 3925b88608..4f18f19c99 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -197,7 +197,7 @@ static void cleanup(struct state_video_compress_libav *s); const char *get_vp9_encoder(bool /* rgb */) { #ifdef __x86_64__ - return __builtin_cpu_supports("avx2") ? nullptr : "libaom-av1"; + return __builtin_cpu_supports("avx2") ? nullptr : "libvpx-vp9"; #else return nullptr; #endif From 8b29e9951924ff2008eb1e0455dd1c9993d36005 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 11 Mar 2026 09:48:20 +0100 Subject: [PATCH 60/86] Makefile: copy license to macOS bundle --- Makefile.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 6d255bcd9d..358e9724b7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -596,8 +596,10 @@ hd-rum-multi/hd-rum: $(BUNDLE): $(TARGET) $(REFLECTOR_TARGET) @MANPAGES@ hd-rum-multi/hd-rum rm -rf $(BUNDLE) - $(MKDIR_P) $(BUNDLE)/Contents/MacOS $(BUNDLE)/Contents/libs + $(MKDIR_P) $(BUNDLE)/Contents/MacOS $(BUNDLE)/Contents/Resources \ + $(BUNDLE)/Contents/libs $(CP) $(REFLECTOR_TARGET) $(TARGET) $(BUNDLE)/Contents/MacOS/ + $(CP) $(srcdir)/COPYRIGHT $(BUNDLE)/Contents/Resources/LICENSE $(CP) -r bin/*.dSYM $(BUNDLE)/Contents/MacOS/ $(CP) -r data/template/macOS-bundle/* $(BUNDLE)/ $(CP) hd-rum-multi/hd-rum $(BUNDLE)/Contents/MacOS/ From 65c5edeafc21252d400e6ec5d1f7eb4e5e9268ae Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Mon, 6 Apr 2026 19:38:37 +0200 Subject: [PATCH 61/86] vcap/dshow: Fix crash on unknown codec (cherry picked from commit a26ac91c2f141aa258a632df231e1d0e00b1221a) --- FIXES.md | 1 + src/video_capture/DirectShowGrabber.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/FIXES.md b/FIXES.md index 89952714c3..4ca31c4bbd 100644 --- a/FIXES.md +++ b/FIXES.md @@ -2,6 +2,7 @@ * fix default VP9 on x86-64 pre v3 (wo AVX2). But the libvpx-vp9 seem to be better encoder than libsvt_vp9 in any case. +* fix crash on querying directshow devices (GH-493) #### 1.10.3 diff --git a/src/video_capture/DirectShowGrabber.cpp b/src/video_capture/DirectShowGrabber.cpp index 57bd6468eb..37e5f54506 100644 --- a/src/video_capture/DirectShowGrabber.cpp +++ b/src/video_capture/DirectShowGrabber.cpp @@ -514,7 +514,7 @@ vidcap_dshow_probe_internal(device_info **available_cards, int *count, } codec_t ug_codec = get_ug_codec(&mediaType->subtype); - bool force_rgb = is_codec_opaque(ug_codec) || codec_is_planar(ug_codec) || ug_codec == VIDEO_CODEC_NONE; + bool force_rgb = ug_codec == VC_NONE || is_codec_opaque(ug_codec) || codec_is_planar(ug_codec); snprintf(cards[card_count - 1].modes[mode_idx].id, sizeof cards[card_count - 1].modes[mode_idx].id, From 94c86e2665b2bcafa1983ac910f5b0269fc91f7d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 16 Mar 2026 16:44:17 +0100 Subject: [PATCH 62/86] MJPEG compat (name) Since the commit 5471e804 (Oct 2024), `-c lavc:codec=MJPEG` stopped to work while `-x sdp` defaults to this if no compression specified. Fixed in both ways (the default and MJPEG name compat). --- src/video_codec.c | 1 + src/video_rxtx/h264_sdp.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/video_codec.c b/src/video_codec.c index 21eabeab1c..a8e3201858 100644 --- a/src/video_codec.c +++ b/src/video_codec.c @@ -252,6 +252,7 @@ static const struct alternative_codec_name codec_name_aliases[] = { {"H265", "H.265"}, {"HEVC", "H.265"}, {"MJPG", "JPEG"}, + {"MJPEG", "JPEG"}, }; void show_codec_help(const char *module, const codec_t *codecs8, const codec_t *codecs10, const codec_t *codecs_ge12) diff --git a/src/video_rxtx/h264_sdp.cpp b/src/video_rxtx/h264_sdp.cpp index 055cb5711a..926cb85679 100644 --- a/src/video_rxtx/h264_sdp.cpp +++ b/src/video_rxtx/h264_sdp.cpp @@ -7,7 +7,7 @@ */ /* * Copyright (c) 2013-2014 Fundació i2CAT, Internet I Innovació Digital a Catalunya - * Copyright (c) 2013-2024 CESNET + * Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -62,7 +62,7 @@ #include "video_codec.h" // for is_codec_opaque #include "video_rxtx.hpp" -#define DEFAULT_SDP_COMPRESSION "lavc:codec=MJPEG:safe" +#define DEFAULT_SDP_COMPRESSION "lavc:codec=MJPG:safe" #define MOD_NAME "[vrxtx/sdp] " using std::cout; From f2ea7b61569285d409bab4af6443a384bddc3e90 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Fri, 10 Apr 2026 10:31:25 +0200 Subject: [PATCH 63/86] disp/vulkan_sdl3: Fix SDL_RegisterEvents error handling The behaviour changed in SDL3 and now it returns 0 on error (cherry picked from commit 21a50cd9858b877edd1b47e0e947dd9f862d66ca) --- src/video_display/vulkan/vulkan_sdl3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video_display/vulkan/vulkan_sdl3.cpp b/src/video_display/vulkan/vulkan_sdl3.cpp index 34ee09e2e3..2331502392 100644 --- a/src/video_display/vulkan/vulkan_sdl3.cpp +++ b/src/video_display/vulkan/vulkan_sdl3.cpp @@ -205,7 +205,7 @@ struct state_vulkan_sdl3 { module_register(&mod, parent); sdl_user_new_message_event = SDL_RegisterEvents(1); - assert(sdl_user_new_message_event != static_cast(-1)); + assert(sdl_user_new_message_event != 0); } state_vulkan_sdl3(const state_vulkan_sdl3& other) = delete; From 4d423715ec18cc1c71f9dda12b001beff9f61a6b Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Thu, 9 Apr 2026 10:02:10 +0200 Subject: [PATCH 64/86] disp/decklink: Fix One definition rule violation There is a state_decklink struct in both display/decklink and audio/playback/decklink. Moved to anonymous namespace and also renamed it to avoid confusion (cherry picked from commit 646984dd1ffbf308949a62dc72cf3c67ecb43f5d) --- src/video_display/decklink.cpp | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/video_display/decklink.cpp b/src/video_display/decklink.cpp index 72dd6ff716..87ef669bbf 100644 --- a/src/video_display/decklink.cpp +++ b/src/video_display/decklink.cpp @@ -144,10 +144,10 @@ using std::unique_lock; using std::unique_ptr; using std::vector; -struct state_decklink; namespace { class DeckLinkFrame; +struct state_decklink_vdisp; /// Used for scheduled playback only class PlaybackDelegate : public IDeckLinkVideoOutputCallback // , public IDeckLinkAudioOutputCallback @@ -197,7 +197,7 @@ class PlaybackDelegate : public IDeckLinkVideoOutputCallback // , public IDeckLi frameRateScale = fs; } void SetSynchronized(const char *cfg); - bool Preroll(struct state_decklink *s); + bool Preroll(struct state_decklink_vdisp *s); void Reset(); void ResetAudio() { m_audio_sync_ts = audio_sync_val::deinit; } @@ -498,9 +498,8 @@ void PlaybackDelegate::ScheduleNextFrame() schedSeq += 1; } } -} // end of unnamed namespace -struct state_decklink { +struct state_decklink_vdisp { uint32_t magic = DECKLINK_MAGIC; bool com_initialized = false; PlaybackDelegate delegate; @@ -544,6 +543,7 @@ struct state_decklink { AudioDriftFixer audio_drift_fixer{}; }; +} // end of unnamed namespace /// @param query_prop_fcc if not NULL, print corresponding BMDDeckLinkAttribute static void @@ -692,7 +692,7 @@ show_help(bool full, const char *query_prop_fcc = nullptr) } static DeckLinkFrame* -allocate_new_decklink_frame(struct state_decklink *s) +allocate_new_decklink_frame(struct state_decklink_vdisp *s) { const int linesize = vc_get_linesize(s->vid_desc.width, s->vid_desc.color_spec); @@ -708,7 +708,7 @@ allocate_new_decklink_frame(struct state_decklink *s) static struct video_frame * display_decklink_getf(void *state) { - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_vdisp *s = (struct state_decklink_vdisp *)state; assert(s->magic == DECKLINK_MAGIC); assert(s->initialized); @@ -810,7 +810,7 @@ static void update_timecode(DeckLinkTimecode *tc, double fps) static bool display_decklink_putf(void *state, struct video_frame *frame, [[maybe_unused]] long long timeout_ns) { - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_vdisp *s = (struct state_decklink_vdisp *)state; bool ret = true; if (frame == NULL) @@ -911,7 +911,7 @@ static BMDDisplayMode get_mode(IDeckLinkOutput *deckLinkOutput, struct video_des return displayMode; } -static bool enable_audio(struct state_decklink *s, int bps, int channels) +static bool enable_audio(struct state_decklink_vdisp *s, int bps, int channels) { const BMDAudioSampleType sample_type = bps == 2 ? bmdAudioSampleType16bitInteger @@ -929,7 +929,7 @@ static bool enable_audio(struct state_decklink *s, int bps, int channels) static bool display_decklink_reconfigure(void *state, struct video_desc desc) { - auto *s = (struct state_decklink *) state; + auto *s = (struct state_decklink_vdisp *) state; assert(s->magic == DECKLINK_MAGIC); BMDDisplayMode displayMode; @@ -1113,7 +1113,7 @@ display_decklink_reconfigure(void *state, struct video_desc desc) } bool -PlaybackDelegate::Preroll(struct state_decklink *s) +PlaybackDelegate::Preroll(struct state_decklink_vdisp *s) { auto *f = allocate_new_decklink_frame(s); for (unsigned i = 0; @@ -1191,7 +1191,7 @@ PlaybackDelegate::SetSynchronized(const char *cfg) } static void -set_low_latency(struct state_decklink *s, bool on) +set_low_latency(struct state_decklink_vdisp *s, bool on) { if (on) { MSG(WARNING, "Low latency option unneeded (implicit).\n"); @@ -1203,7 +1203,7 @@ set_low_latency(struct state_decklink *s, bool on) s->low_latency = false; } -static bool settings_init(struct state_decklink *s, const char *fmt, +static bool settings_init(struct state_decklink_vdisp *s, const char *fmt, string &cardId) { if (strlen(fmt) == 0) { return true; @@ -1347,7 +1347,7 @@ static bool settings_init(struct state_decklink *s, const char *fmt, is_power_of_two((channels))) static void -set_audio_props(state_decklink *s, +set_audio_props(state_decklink_vdisp *s, IDeckLinkConfiguration *deckLinkConfiguration, unsigned int audio_output) { @@ -1425,7 +1425,7 @@ static void *display_decklink_init(struct module *parent, const char *fmt, unsig return INIT_NOERR; } - auto *s = new state_decklink(); + auto *s = new state_decklink_vdisp(); s->audio_drift_fixer.set_root(get_root_module(parent)); bool succeeded = false; @@ -1597,7 +1597,7 @@ static void *display_decklink_init(struct module *parent, const char *fmt, unsig static void display_decklink_done(void *state) { debug_msg("display_decklink_done\n"); /* TOREMOVE */ - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_vdisp *s = (struct state_decklink_vdisp *)state; assert (s != NULL); @@ -1637,7 +1637,7 @@ static void display_decklink_done(void *state) static bool display_decklink_get_property(void *state, int property, void *val, size_t *len) { - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_vdisp *s = (struct state_decklink_vdisp *)state; vector codecs(uv_to_bmd_codec_map.size()); int rgb_shift[] = {16, 8, 0}; interlacing_t supported_il_modes[] = {PROGRESSIVE, INTERLACED_MERGED, SEGMENTED_FRAME}; @@ -1752,7 +1752,7 @@ void PlaybackDelegate::ScheduleAudio(const struct audio_frame *frame, static void display_decklink_put_audio_frame(void *state, const struct audio_frame *frame) { - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_vdisp *s = (struct state_decklink_vdisp *)state; assert(s->play_audio); if (s->audio_reconfigure) { return; @@ -1797,7 +1797,7 @@ static void display_decklink_put_audio_frame(void *state, const struct audio_fra static bool display_decklink_reconfigure_audio(void *state, int quant_samples, int channels, int sample_rate) { - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_vdisp *s = (struct state_decklink_vdisp *)state; assert(s->play_audio); CHECK_CH_COUNT(channels); From 50635b57fb27ba94cbbe59ced764900220ec316e Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Thu, 9 Apr 2026 10:02:23 +0200 Subject: [PATCH 65/86] aplay/decklink: Fix One definition rule violation There is a state_decklink struct in both display/decklink and audio/playback/decklink. Moved to anonymous namespace and also renamed it to avoid confusion (cherry picked from commit 68fb31111f8bd9e3994ca5e8201ee6dc79844e03) --- src/audio/playback/decklink.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/audio/playback/decklink.cpp b/src/audio/playback/decklink.cpp index 67bf3d927b..14b24a00dc 100644 --- a/src/audio/playback/decklink.cpp +++ b/src/audio/playback/decklink.cpp @@ -63,12 +63,11 @@ namespace { class PlaybackDelegate; -} #define DECKLINK_MAGIC 0x415f46d0 #define MOD_NAME "[DeckLink audio play.] " -struct state_decklink { +struct state_decklink_aplay { uint32_t magic; struct audio_desc audio_desc; @@ -88,13 +87,12 @@ struct state_decklink { int audio_consumer_levels; ///< 0 false, 1 true, -1 default }; -namespace { class PlaybackDelegate : public IDeckLinkVideoOutputCallback // , public IDeckLinkAudioOutputCallback { - struct state_decklink * s; + struct state_decklink_aplay * s; public: - PlaybackDelegate (struct state_decklink* owner) { + PlaybackDelegate (struct state_decklink_aplay* owner) { s = owner; } @@ -190,7 +188,7 @@ audio_play_decklink_init(const struct audio_playback_opts *opts) return INIT_NOERR; } - struct state_decklink *s = NULL; + struct state_decklink_aplay *s = NULL; IDeckLinkIterator* deckLinkIterator; HRESULT result; IDeckLinkConfiguration* deckLinkConfiguration = NULL; @@ -204,7 +202,7 @@ audio_play_decklink_init(const struct audio_playback_opts *opts) //BMDDisplayMode displayMode = bmdModeUnknown; int width, height; - s = (struct state_decklink *)calloc(1, sizeof(struct state_decklink)); + s = (struct state_decklink_aplay *)calloc(1, sizeof(struct state_decklink_aplay)); s->magic = DECKLINK_MAGIC; s->audio_consumer_levels = -1; @@ -342,7 +340,7 @@ audio_play_decklink_init(const struct audio_playback_opts *opts) static void audio_play_decklink_put_frame(void *state, const struct audio_frame *frame) { - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_aplay *s = (struct state_decklink_aplay *)state; unsigned int sampleFrameCount = frame->data_len / (s->audio_desc.bps * s->audio_desc.ch_count); uint32_t sampleFramesWritten; @@ -397,7 +395,7 @@ static bool audio_play_decklink_ctl(void *state [[gnu::unused]], int request, vo } static bool audio_play_decklink_reconfigure(void *state, struct audio_desc desc) { - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_aplay *s = (struct state_decklink_aplay *)state; BMDAudioSampleType sample_type; s->audio_desc = desc; @@ -445,7 +443,7 @@ static bool audio_play_decklink_reconfigure(void *state, struct audio_desc desc) static void audio_play_decklink_done(void *state) { - struct state_decklink *s = (struct state_decklink *)state; + struct state_decklink_aplay *s = (struct state_decklink_aplay *)state; s->deckLinkOutput->DisableAudioOutput(); s->deckLinkOutput->DisableVideoOutput(); From f8509fced65ba2bd975f8d3e9ba475e7c6f6b10a Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Tue, 21 Apr 2026 14:46:47 +0200 Subject: [PATCH 66/86] dbus_portal: Use random token According to https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Session.html the token should be unique and unguessable. (cherry picked from commit f9c8de5eb67de92d60f90ca62ef3a62ee679ee45) --- src/utils/dbus_portal.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/utils/dbus_portal.cpp b/src/utils/dbus_portal.cpp index b8756b0131..11cb66e77c 100644 --- a/src/utils/dbus_portal.cpp +++ b/src/utils/dbus_portal.cpp @@ -54,18 +54,28 @@ #include "misc.h" #include "dbus_portal.hpp" +#include + #define MOD_NAME "[dbus] " namespace { + +std::string generate_token(){ + std::random_device random_device; + auto random_engine = std::default_random_engine(random_device()); + auto dist = std::uniform_int_distribution(); + const auto rand_val = dist(random_engine); + + return "uv_" + std::to_string(rand_val); +} + struct request_path_t { std::string token; std::string path; static request_path_t create(const std::string &name) { - ++token_counter; - - auto token = std::string("uv") + std::to_string(token_counter); + const auto token = generate_token(); request_path_t result = { .token = token, .path = std::string("/org/freedesktop/portal/desktop/request/") + name + "/" + token @@ -74,33 +84,21 @@ struct request_path_t { LOG(LOG_LEVEL_DEBUG) << "new request: '" << result.path << "'\n"; return result; } - -private: - static unsigned int token_counter; }; -unsigned int request_path_t::token_counter = 0; - struct session_path_t { std::string token; std::string path; static session_path_t create(const std::string &name) { - ++token_counter; - - auto token = std::string("uv") + std::to_string(token_counter); + auto token = generate_token(); return { .token = token, .path = std::string("/org/freedesktop/portal/desktop/session/") + name + "/" + token }; } - -private: - static unsigned int token_counter; }; -unsigned int session_path_t::token_counter = 0; - struct GVariant_deleter { void operator()(GVariant *a) { g_variant_unref(a); } }; using GVariant_uniq = std::unique_ptr; From 8a872e5db16eaf2298482d39a2591ac590a5eba2 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 23 Apr 2026 11:49:14 +0200 Subject: [PATCH 67/86] configure.ac: fix missing "test" keyword (blue444) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3370f8e292..4108ee2299 100644 --- a/configure.ac +++ b/configure.ac @@ -967,7 +967,7 @@ if test "$bluefish444_req" != no; then AC_CHECK_HEADERS([BlueVelvetC.h], [BLUE_H=yes], [BLUE_H=no]) AC_CHECK_LIB($BLUEFISH444_LIB_NAME, bfcFactory, [BLUE_L=yes], [BLUE_L=no]) - if test "${BLUE_H?}" = yes && "${BLUE_L?}" = yes + if test "${BLUE_H?}" = yes && test "${BLUE_L?}" = yes then BLUEFISH444_LIB="$BLUEFISH444_LIB -l$BLUEFISH444_LIB_NAME" add_module vidcap_bluefish444 src/video_capture/bluefish444.o "$BLUEFISH444_LIB" From 5f659f1e48cdde887e734abe1ec1aefbaa4127d7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 20 Mar 2026 13:21:39 +0100 Subject: [PATCH 68/86] CI mac: build Syphon just for host arch - faster build times (we build arm64 and x86_64 separately) - avoid occasional build errors (see git note) --- .github/scripts/macOS/install_others.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/macOS/install_others.sh b/.github/scripts/macOS/install_others.sh index 6b7b07d685..d6d5ad93b0 100755 --- a/.github/scripts/macOS/install_others.sh +++ b/.github/scripts/macOS/install_others.sh @@ -77,7 +77,7 @@ install_syphon() { git clone --depth 1 https://github.com/Syphon/Syphon-Framework.git cd Syphon-Framework xcodebuild LD_DYLIB_INSTALL_NAME=$syphon_dst/\ -Syphon.framework/Versions/A/Syphon +Syphon.framework/Versions/A/Syphon -arch "$(uname -m)" sudo cp -R 'build/Release/Syphon.framework' \ $syphon_dst ) From 0856b3763e46fc24c657dca33670f1058ec68800 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 23 Apr 2026 13:20:26 +0200 Subject: [PATCH 69/86] various compilation fixes ported from master Ported bluefish444, dvs and gpujpeg_to_dxt from master - not compiled by default, neither in CI, but now can be compiled (if anyone uses that). --- FIXES.md | 1 + src/video_capture/bluefish444.cpp | 35 ++++++----- src/video_capture/dvs.c | 40 ++++++++----- src/video_decompress/gpujpeg_to_dxt.cpp | 30 +++++----- src/video_display/bluefish444.cpp | 32 ++++++---- src/video_display/dvs.c | 79 ++++++++++++++----------- 6 files changed, 123 insertions(+), 94 deletions(-) diff --git a/FIXES.md b/FIXES.md index 4ca31c4bbd..c26d1a2234 100644 --- a/FIXES.md +++ b/FIXES.md @@ -3,6 +3,7 @@ * fix default VP9 on x86-64 pre v3 (wo AVX2). But the libvpx-vp9 seem to be better encoder than libsvt_vp9 in any case. * fix crash on querying directshow devices (GH-493) +* compilation fixes of various seldom used modules #### 1.10.3 diff --git a/src/video_capture/bluefish444.cpp b/src/video_capture/bluefish444.cpp index 76f3036926..344e0d32e5 100644 --- a/src/video_capture/bluefish444.cpp +++ b/src/video_capture/bluefish444.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2015-2023 CESNET, z. s. p. o. + * Copyright (c) 2015-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,26 +35,29 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#include "config_unix.h" -#include "config_win32.h" -#endif // HAVE_CONFIG_H - +#include // for assert +#include // for uint32_t +#include // for NULL, printf, snprintf +#include // for atoi, free, calloc +#include // for strlen, memset, strcmp, strdup #include #include +#include // for pthread_cond_signal, pthread_mutex... #include #include "bluefish444_common.h" #include "audio/types.h" #include "audio/utils.h" +#include "compat/strings.h" // for strcasecmp, strncasecmp #include "debug.h" #include "host.h" #include "lib_common.h" #include "tv.h" +#include "types.h" // for video_frame, tile, video_desc, dev... #include "video.h" #include "video_capture.h" +#include "video_capture_params.h" // for vidcap_params_get_fmt, vidcap_para... #ifndef UINT #define UINT uint32_t @@ -267,7 +270,7 @@ static int CompleteBlueAsyncReq(HANDLE hDevice, LPOVERLAPPED pOverlap) { DWORD bytesReturned; ResetEvent(pOverlap->hEvent); - GetOverlappedResult(hDevice, pOverlap, &bytesReturned, TRUE); + GetOverlappedResult(hDevice, pOverlap, &bytesReturned, true); //cout << "Bytes ret: " << bytesReturned << endl; return bytesReturned; } @@ -278,7 +281,7 @@ static void WaitForMajorInterrupt(struct vidcap_bluefish444_state *s) #ifdef _WIN32 assert(s->attachedDevices == 1); - BOOL bWaitForField = TRUE; + BOOL bWaitForField = true; //We need to wait for a major interrupt (sub field interrupt == 0) before we schedule a frame to be captured UINT SubFieldIrqs = 0; @@ -295,7 +298,7 @@ static void WaitForMajorInterrupt(struct vidcap_bluefish444_state *s) bfcVideoSyncStructGet(s->pSDK[0], s->pIrqInfo, VideoMsc, SubFieldIrqs); if(s->video_desc.interlacing == PROGRESSIVE || (VideoMsc & 0x1)) - bWaitForField = FALSE; + bWaitForField = false; }while(!((SubFieldIrqs == 0) && !bWaitForField)); //we need to schedule the field capture when SubFieldIrqs is 0 #else @@ -643,13 +646,13 @@ static void *worker(void *arg) if(s->SubField) { if(SubFieldIrqs == 0) { nOffset = (nChunks - 1) * ChunkSize; - current_frame->video->last_fragment = TRUE; + current_frame->video->last_fragment = true; } else { nOffset = (SubFieldIrqs - 1) * ChunkSize; - current_frame->video->last_fragment = FALSE; + current_frame->video->last_fragment = false; } current_frame->video->tiles[0].data_len = ChunkSize; - current_frame->video->fragment = TRUE; + current_frame->video->fragment = true; current_frame->video->tiles[0].offset = nOffset; current_frame->video->frame_fragment_id = CurrentFieldCount & 0x3fff; } @@ -770,7 +773,7 @@ static void parse_fmt(struct vidcap_bluefish444_state *s, char *fmt) { } static int -vidcap_bluefish444_init(struct vidcap_params *params, void **state) +vidcap_bluefish444_init(const struct vidcap_params *params, void **state) { struct vidcap_bluefish444_state *s; ULONG InputChannels[4] = { @@ -817,7 +820,7 @@ vidcap_bluefish444_init(struct vidcap_params *params, void **state) #ifdef _WIN32 memset(&s->OverlapChA, 0, sizeof(s->OverlapChA)); - s->OverlapChA.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + s->OverlapChA.hEvent = CreateEvent(NULL, true, false, NULL); #endif int iDevices = 0; @@ -1067,7 +1070,7 @@ vidcap_bluefish444_grab(void *state, struct audio_frame **audio) if(res->fragment) { if(res->frame_fragment_id % 2 == 0) { //upper field - res->last_fragment = FALSE; + res->last_fragment = false; } else { //bottom field res->tiles[0].offset += res->tiles[0].data_len * 2; diff --git a/src/video_capture/dvs.c b/src/video_capture/dvs.c index 53e38e2842..9a46831ea4 100644 --- a/src/video_capture/dvs.c +++ b/src/video_capture/dvs.c @@ -10,7 +10,7 @@ * Ian Wesley-Smith * * Copyright (c) 2001-2003 University of Southern California - * Copyright (c) 2005-2023 CESNET z.s.p.o. + * Copyright (c) 2005-2026 CESNET, zájmové sdružení právnických osob * * Redistribution and use in source and binary forms, with or without * modification, is permitted provided that the following conditions @@ -49,21 +49,31 @@ * */ -#include "host.h" -#include "config.h" -#include "config_unix.h" -#include "config_win32.h" +#include // for ETIMEDOUT +#include // for isdigit +#include +#include +#include +#include +#include +#include // for strtok, strchr, strncmp, memset +#include // for timespec +#include // for timeval, gettimeofday +#include "host.h" #include "audio/types.h" #include "audio/utils.h" #include "debug.h" #include "lib_common.h" #include "video.h" #include "video_capture.h" +#include "video_capture_params.h" // for vidcap_params_get_fmt, vidcap_para... #include "video_display.h" #include "video_display/dvs.h" #include "tv.h" +#include "types.h" #include "dvs_clib.h" /* From the DVS SDK */ +#include "dvs_errors.h" // for SV_OK #include "dvs_fifo.h" /* From the DVS SDK */ struct vidcap_dvs_state { @@ -144,7 +154,7 @@ static void *vidcap_dvs_grab_thread(void *arg) pthread_mutex_lock(&(s->lock)); - while (s->work_to_do == FALSE) { + while (s->work_to_do == false) { pthread_cond_wait(&(s->worker_cv), &(s->lock)); } @@ -163,7 +173,7 @@ static void *vidcap_dvs_grab_thread(void *arg) s->audio.data_len = s->dma_buffer->audio[0].size; } - s->work_to_do = FALSE; + s->work_to_do = false; pthread_cond_signal(&(s->boss_cv)); pthread_mutex_unlock(&(s->lock)); @@ -228,7 +238,7 @@ static void show_help(void) /* External API ***********************************************************************************/ -static int vidcap_dvs_init(struct vidcap_params *params, void **state) +static int vidcap_dvs_init(const struct vidcap_params *params, void **state) { struct vidcap_dvs_state *s; int i; @@ -354,13 +364,13 @@ static int vidcap_dvs_init(struct vidcap_params *params, void **state) } if(vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_EMBEDDED) { - s->grab_audio = TRUE; + s->grab_audio = true; } else { if (vidcap_params_get_flags(params) & VIDCAP_FLAG_AUDIO_ANY) { free(s); return VIDCAP_INIT_AUDIO_NOT_SUPPORTED; } - s->grab_audio = FALSE; + s->grab_audio = false; } s->hd_video_mode = 0; @@ -407,7 +417,7 @@ static int vidcap_dvs_init(struct vidcap_params *params, void **state) } s->hd_video_mode |= val; if (s->mode == NULL) { - log_msg(LOG_LEVEL_ERROR, "[DVS] Mode detected, however unknown. Report to " PACKAGE_BUGREPORT ".\n"); + bug_msg(LOG_LEVEL_ERROR, "[DVS] Mode detected, however unknown. "); goto error_detect; } printf("[DVS] Autodetected video mode: %dx%d @ %2.2fFPS.\n", s->mode->width, s->mode->height, s->mode->fps); @@ -531,7 +541,7 @@ static int vidcap_dvs_init(struct vidcap_params *params, void **state) s->rtp_buffer = NULL; s->dma_buffer = NULL; s->tmp_buffer = NULL; - s->work_to_do = FALSE; + s->work_to_do = false; s->bufs[0] = malloc(s->tile->data_len); s->bufs[1] = malloc(s->tile->data_len); s->bufs_index = 0; @@ -562,7 +572,7 @@ static void vidcap_dvs_done(void *state) (struct vidcap_dvs_state *)state; pthread_mutex_lock(&s->lock); - s->work_to_do = TRUE; + s->work_to_do = true; s->should_exit = true; pthread_cond_signal(&s->worker_cv); pthread_mutex_unlock(&s->lock); @@ -610,7 +620,7 @@ static struct video_frame *vidcap_dvs_grab(void *state, struct audio_frame **aud /* ...and give it more to do... */ s->rtp_buffer = s->tmp_buffer; - s->work_to_do = TRUE; + s->work_to_do = true; /* ...and signal the worker... */ pthread_cond_signal(&(s->worker_cv)); @@ -663,7 +673,7 @@ static void vidcap_dvs_probe(struct device_info **available_cards, int *count, v snprintf(cards[card_idx].name, sizeof cards[card_idx].name, "DVS card #%d", card_idx); snprintf(cards[card_idx].extra, sizeof cards[card_idx].extra, - "\"embeddedAudioAvailable\":\"t\"", card_idx); + "\"embeddedAudioAvailable\":\"t\""); sv_close(sv); card_idx++; diff --git a/src/video_decompress/gpujpeg_to_dxt.cpp b/src/video_decompress/gpujpeg_to_dxt.cpp index b0eaa54cfa..81b60381c9 100644 --- a/src/video_decompress/gpujpeg_to_dxt.cpp +++ b/src/video_decompress/gpujpeg_to_dxt.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2012-2025, CESNET + * Copyright (c) 2012-2026, CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -35,16 +35,11 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#include "config_unix.h" -#include "config_win32.h" -#endif // HAVE_CONFIG_H - -#include "cuda_dxt/cuda_dxt.h" - +#include +#include #include -#include + +#include "../cuda_dxt/cuda_dxt.h" #include "libgpujpeg/gpujpeg_decoder.h" #include "libgpujpeg/gpujpeg_version.h" @@ -190,7 +185,7 @@ static void * gpujpeg_to_dxt_decompress_init(void) s->occupied_count = 0; for(unsigned int i = 0; i < cuda_devices_count; ++i) { - int ret = gpujpeg_init_device(cuda_devices[i], TRUE); + int ret = gpujpeg_init_device(cuda_devices[i], true); if(ret != 0) { log_msg(LOG_LEVEL_ERROR, MOD_NAME "initializing CUDA device %d failed.\n", cuda_devices[0]); delete s; @@ -260,12 +255,12 @@ static int gpujpeg_to_dxt_decompress_reconfigure(void *state, struct video_desc assert(status != NULL); if (!status->success) { delete status; - return FALSE; + return false; } delete status; } - return TRUE; + return true; } /** @@ -306,7 +301,7 @@ static int reconfigure_thread(struct thread_data *s, struct video_desc desc, int } static decompress_status gpujpeg_to_dxt_decompress(void *state, unsigned char *dst, unsigned char *buffer, - unsigned int src_len, int frame_seq, video_frame_callbacks * /* callbacks */, codec_t * /* internal_codec */) + unsigned int src_len, int frame_seq, video_frame_callbacks * /* callbacks */, pixfmt_desc * /* internal_codec */) { struct state_decompresss_gpujpeg_to_dxt *s = (struct state_decompresss_gpujpeg_to_dxt *) state; UNUSED(frame_seq); @@ -341,7 +336,7 @@ static int gpujpeg_to_dxt_decompress_get_property(void *state, int property, voi UNUSED(val); UNUSED(len); - return FALSE; + return false; } static void gpujpeg_to_dxt_decompress_done(void *state) @@ -366,7 +361,10 @@ static void gpujpeg_to_dxt_decompress_done(void *state) delete s; } -static int gpujpeg_to_dxt_decompress_get_priority(codec_t compression, struct pixfmt_desc internal, codec_t ugc) { +static int +gpujpeg_to_dxt_decompress_get_priority(codec_t compression, + struct pixfmt_desc /* internal */, codec_t ugc) +{ return compression == JPEG && (ugc == DXT1 || ugc == DXT5) ? 900 : -1; } diff --git a/src/video_display/bluefish444.cpp b/src/video_display/bluefish444.cpp index b9ad94d686..7e59f9c39f 100644 --- a/src/video_display/bluefish444.cpp +++ b/src/video_display/bluefish444.cpp @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2013-2025 CESNET + * Copyright (c) 2013-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,27 +42,34 @@ #ifdef HAVE_CONFIG_H #include "config.h" -#include "config_unix.h" -#include "config_win32.h" #endif #include "video_display.h" +#include // for max +#include +#include // for fabs +#include +#include // for abort, atoi, calloc +#include +#include // for memcpy, memset, strlen, strcmp #include #include +#include // for pthread_mutex_lock, pthread_mutex_un... #include #include #include -#include #include #include "bluefish444_common.h" #include "audio/types.h" +#include "compat/strings.h" // for strncasecmp #include "debug.h" #include "host.h" #include "lib_common.h" #include "tv.h" +#include "types.h" // for video_desc, device_info, tile, inter... #include "utils/ring_buffer.h" #include "video.h" #include "video_display.h" @@ -267,7 +274,7 @@ void *display_bluefish444_state::playback_loop() noexcept #ifdef _WIN32 OVERLAPPED Overlapped[MAX_BLUE_OUT_CHANNELS]; for (int i = 0;i < MAX_BLUE_OUT_CHANNELS; ++ i) { - Overlapped[i].hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + Overlapped[i].hEvent = CreateEvent(NULL, true, false, NULL); } #endif @@ -333,7 +340,7 @@ void *display_bluefish444_state::playback_loop() noexcept if(WaitResult) { for(int i = 0; i < m_AttachedDevicesCount; ++i) { DWORD BytesReturned = 0; - GetOverlappedResult(bfcGetHandle(m_pSDK[i]), &Overlapped[i], &BytesReturned, TRUE); + GetOverlappedResult(bfcGetHandle(m_pSDK[i]), &Overlapped[i], &BytesReturned, true); ResetEvent(Overlapped[i].hEvent); } } @@ -988,10 +995,10 @@ static bool display_bluefish444_get_property(void *state, int property, void *va return true; } +#ifdef HAVE_BLUE_AUDIO static bool display_bluefish444_reconfigure_audio(void *state, int quant_samples, int channels, int sample_rate) { -#ifdef HAVE_BLUE_AUDIO display_bluefish444_state *s = (display_bluefish444_state *) state; try { @@ -1002,14 +1009,10 @@ static bool display_bluefish444_reconfigure_audio(void *state, int quant_samples } return true; -#else - return false; -#endif } static void display_bluefish444_put_audio_frame(void *state, const struct audio_frame *frame) { -#ifdef HAVE_BLUE_AUDIO display_bluefish444_state *s = (display_bluefish444_state *) state; @@ -1018,8 +1021,8 @@ static void display_bluefish444_put_audio_frame(void *state, const struct audio_ } catch(runtime_error &e) { cerr << "[Blue444 disp] " << e.what() << endl; } -#endif } +#endif static const struct video_display_info display_bluefish444_info = { display_bluefish444_probe, @@ -1030,8 +1033,13 @@ static const struct video_display_info display_bluefish444_info = { display_bluefish444_putf, display_bluefish444_reconfigure, display_bluefish444_get_property, +#ifdef HAVE_BLUE_AUDIO display_bluefish444_put_audio_frame, display_bluefish444_reconfigure_audio, +#else + nullptr, + nullptr, +#endif DISPLAY_NO_GENERIC_FPS_INDICATOR, }; diff --git a/src/video_display/dvs.c b/src/video_display/dvs.c index bf687e98d7..b7f82e0c91 100644 --- a/src/video_display/dvs.c +++ b/src/video_display/dvs.c @@ -9,7 +9,7 @@ * Ian Wesley-Smith * Colin Perkins * - * Copyright (c) 2005-2023 CESNET z.s.p.o. + * Copyright (c) 2005-2026 CESNET, zájmové sdružené právnických osob * Copyright (c) 2001-2003 University of Southern California * * Redistribution and use in source and binary forms, with or without @@ -49,9 +49,17 @@ * */ -#include "config.h" -#include "config_unix.h" -#include "config_win32.h" +#include +#include // for fabs +#include // for pthread_mutex_unlock, pthread_cond_init +#include // for false, true, bool +#include // for int32_t, uint32_t +#include +#include +#include +#include + + #include "host.h" #include "audio/types.h" @@ -61,9 +69,11 @@ #include "video_display.h" #include "video_display/dvs.h" #include "tv.h" +#include "types.h" // for video_desc, tile, device_info, video_... #include "utils/ring_buffer.h" #include "dvs_clib.h" /* From the DVS SDK */ +#include "dvs_errors.h" // for SV_OK #include "dvs_fifo.h" /* From the DVS SDK */ #define HDSP_MAGIC 0x12345678 @@ -325,7 +335,6 @@ volatile int worker_waiting; int frames; struct timeval t, t0; - pthread_t thread_id; bool should_exit; }; @@ -390,14 +399,14 @@ static void *display_dvs_run(void *arg) while (1) { pthread_mutex_lock(&s->lock); - while (s->work_to_do == FALSE) { - s->worker_waiting = TRUE; + while (s->work_to_do == false) { + s->worker_waiting = true; pthread_cond_wait(&s->worker_cv, &s->lock); - s->worker_waiting = FALSE; + s->worker_waiting = false; } s->display_buffer = s->tmp_buffer; - s->work_to_do = FALSE; + s->work_to_do = false; if (s->boss_waiting) { pthread_cond_signal(&s->boss_cv); @@ -460,12 +469,12 @@ display_dvs_getf(void *state) else { pthread_mutex_lock(&s->audio_reconf_lock); if(s->audio_reconf_pending) { - s->audio_reconf_possible = TRUE; + s->audio_reconf_possible = true; pthread_cond_signal(&s->audio_reconf_possible_cv); } while(!s->audio_reconf_done) pthread_cond_wait(&s->audio_reconf_done_cv, &s->audio_reconf_lock); - s->audio_reconf_possible = FALSE; + s->audio_reconf_possible = false; pthread_mutex_unlock(&s->audio_reconf_lock); } /* Prepare the new RTP buffer... */ @@ -488,7 +497,7 @@ display_dvs_getf(void *state) s->fifo_buffer->audio[0].addr[0] = s->audio_fifo_data; } } - s->first_run = FALSE; + s->first_run = false; return s->frame; } @@ -502,14 +511,14 @@ static bool display_dvs_putf(void *state, struct video_frame *frame, long long f pthread_mutex_lock(&s->lock); if(s->work_to_do && flags != PUTF_BLOCKING) { pthread_mutex_unlock(&s->lock); - return FALSE; + return false; } /* Wait for the worker to finish... */ while (s->work_to_do) { - s->boss_waiting = TRUE; + s->boss_waiting = true; pthread_cond_wait(&s->boss_cv, &s->lock); - s->boss_waiting = FALSE; + s->boss_waiting = false; } // pass poisoned pill @@ -520,7 +529,7 @@ static bool display_dvs_putf(void *state, struct video_frame *frame, long long f /* ...and give it more to do... */ s->tmp_buffer = s->fifo_buffer; s->fifo_buffer = NULL; - s->work_to_do = TRUE; + s->work_to_do = true; /* ...and signal the worker */ if (s->worker_waiting) { @@ -674,7 +683,7 @@ static void *display_dvs_init(struct module *parent, const char *cfg, unsigned i s = (struct state_hdsp *)calloc(1, sizeof(struct state_hdsp)); s->magic = HDSP_MAGIC; - s->mode_set_manually = FALSE; + s->mode_set_manually = false; s->frame = vf_alloc(1); s->tile = vf_get_tile(s->frame, 0); @@ -733,10 +742,10 @@ static void *display_dvs_init(struct module *parent, const char *cfg, unsigned i s->audio_ring_buffer = NULL; s->audio_fifo_data = NULL; if(flags & DISPLAY_FLAG_AUDIO_EMBEDDED) { - s->play_audio = TRUE; + s->play_audio = true; } else { - s->play_audio = FALSE; - sv_option(s->sv, SV_OPTION_AUDIOMUTE, TRUE); + s->play_audio = false; + sv_option(s->sv, SV_OPTION_AUDIOMUTE, true); } /* Start the display thread... */ @@ -747,8 +756,8 @@ static void *display_dvs_init(struct module *parent, const char *cfg, unsigned i goto error; } - s->worker_waiting = TRUE; - s->first_run = TRUE; + s->worker_waiting = true; + s->first_run = true; if(s->mode) { struct video_desc desc; @@ -773,23 +782,23 @@ static void *display_dvs_init(struct module *parent, const char *cfg, unsigned i display_dvs_reconfigure(s, desc); - s->mode_set_manually = TRUE; + s->mode_set_manually = true; } pthread_mutex_init(&s->lock, NULL); pthread_cond_init(&s->boss_cv, NULL); pthread_cond_init(&s->worker_cv, NULL); - s->work_to_do = FALSE; - s->boss_waiting = FALSE; - s->worker_waiting = FALSE; + s->work_to_do = false; + s->boss_waiting = false; + s->worker_waiting = false; s->display_buffer = NULL; pthread_mutex_init(&s->audio_reconf_lock, NULL); pthread_cond_init(&s->audio_reconf_possible_cv, NULL); pthread_cond_init(&s->audio_reconf_done_cv, NULL); - s->audio_reconf_possible = FALSE; - s->audio_reconf_pending = FALSE; - s->audio_reconf_done = FALSE; + s->audio_reconf_possible = false; + s->audio_reconf_pending = false; + s->audio_reconf_done = false; /*if (pthread_create(&(s->thread_id), NULL, display_thread_hd, (void *)s) != 0) { @@ -799,7 +808,7 @@ static void *display_dvs_init(struct module *parent, const char *cfg, unsigned i free(name); - pthread_create(&s->thread_id, NULL, display_aggregate_run, s); + pthread_create(&s->thread_id, NULL, display_dvs_run, s); return (void *)s; error: @@ -881,14 +890,14 @@ static void display_dvs_put_audio_frame(void *state, const struct audio_frame *f ring_buffer_write(s->audio_ring_buffer, frame->data, frame->data_len); } -static int display_dvs_reconfigure_audio(void *state, int quant_samples, int channels, +static bool display_dvs_reconfigure_audio(void *state, int quant_samples, int channels, int sample_rate) { bool ret; struct state_hdsp *s = (struct state_hdsp *)state; int res = SV_OK; pthread_mutex_lock(&s->audio_reconf_lock); - s->audio_reconf_pending = TRUE; + s->audio_reconf_pending = true; while(!s->audio_reconf_possible) pthread_cond_wait(&s->audio_reconf_possible_cv, &s->audio_reconf_lock); @@ -954,18 +963,18 @@ static int display_dvs_reconfigure_audio(void *state, int quant_samples, int cha goto error; } - s->audio_reconf_done = FALSE; + s->audio_reconf_done = false; ret = true; goto unlock; error: fprintf(stderr, "Setting audio error %s\n", sv_geterrortext(res)); - s->play_audio = FALSE; + s->play_audio = false; ret = false; unlock: - s->audio_reconf_done = TRUE; + s->audio_reconf_done = true; pthread_cond_signal(&s->audio_reconf_done_cv); pthread_mutex_unlock(&s->audio_reconf_lock); From 7d4ba48b2ab1e8c0b7d046807d426c6ff49c6602 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 23 Apr 2026 13:32:14 +0200 Subject: [PATCH 70/86] UltraGrid 1.10.4 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4108ee2299..49f659b7f8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([UltraGrid],[1.10.3],[ultragrid-dev@cesnet.cz]) +AC_INIT([UltraGrid],[1.10.4],[ultragrid-dev@cesnet.cz]) configure_flags="$*" AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.10]) From 05d791ebf46e299fcdac6438d348df30c5e2a601 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 27 Apr 2026 16:22:36 +0200 Subject: [PATCH 71/86] audio_buffer: fix dropping audio samples Align the drop count to audio frame size to avoid dropping just part of the audio frame causing disruption. Actually fixes the error mentioned in the commit 8cfb42ce (mistakenly attributed to acap/fluidsynth while just the acap frame sizes triggered the problem). steps to reproduce: `uv -s fluidsynth -r alsa` (the alsa part - it may be also in a separate process). However, not always reproducible, maybe after 10-30 minutes, the identifying string in receiver output: `Dropped audio samples: req latency 4608 remaining 4962 dropped 2481!` ("samples" are actually bytes and the problem arises when dropped is odd - we have 16 bit capture so the underlying ring buffer will be off by one byte until eventual next odd-byte drop). --- src/utils/audio_buffer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/utils/audio_buffer.c b/src/utils/audio_buffer.c index 30f77dfc05..cc105e498b 100644 --- a/src/utils/audio_buffer.c +++ b/src/utils/audio_buffer.c @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2016-2021 CESNET, z. s. p. o. + * Copyright (c) 2016-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -155,10 +155,16 @@ int audio_buffer_read(struct audio_buffer *buf, char *out, int max_len) int len_drop = (1<aggressivity) * buf->desc.bps * buf->desc.ch_count * 128; len_drop = min(len_drop, remaining_bytes / 2); + int frame_size = buf->desc.bps * buf->desc.ch_count; + len_drop = len_drop / frame_size * frame_size; + char *tmp = alloca(len_drop); ring_buffer_read(buf->ring, tmp, len_drop); buf->last_overrun = 0; - log_msg(LOG_LEVEL_VERBOSE, "Dropped audio samples: req latency %d remaining %d dropped %d!\n", requested_latency_bytes, remaining_bytes, len_drop); + log_msg(LOG_LEVEL_VERBOSE, + "Dropped audio bytes: req latency %d remaining %d " + "dropped %d!\n", + requested_latency_bytes, remaining_bytes, len_drop); } else { buf->last_overrun += 1; } From ce9e28c95dc9309b9e2ac36cdea3cb8360bc0e5d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 28 Apr 2026 12:42:01 +0200 Subject: [PATCH 72/86] portaudio help: fix incorrect filter Actually the record-only devices were print for playback and vice versa (bi-directional devices were displayed properly). --- src/audio/portaudio_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/portaudio_common.c b/src/audio/portaudio_common.c index e67346371c..64a6c03009 100644 --- a/src/audio/portaudio_common.c +++ b/src/audio/portaudio_common.c @@ -152,7 +152,7 @@ portaudio_print_help(enum portaudio_device_direction kind, bool full) const char *highlight = TERM_BOLD; const PaDeviceInfo *device_info = Pa_GetDeviceInfo(i); // filter out (or differently highlight in verbose mode) unusable devices - if (has_channels(device_info, kind)) { + if (!has_channels(device_info, kind)) { if (log_level < LOG_LEVEL_VERBOSE) { continue; } else { From be6d4ba6df9c93088fc3be65546155b13669ea91 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 5 May 2026 09:04:52 +0200 Subject: [PATCH 73/86] add configure In releases, there could be included the configure file - it is more convenient and it eliminates the need for user to have autoconf/automake. The reason why it is not included in the main (master) branch is that it unnecessarily spoils the history, but it is not the case of release/ branches. --- configure | 19983 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 19983 insertions(+) create mode 100755 configure diff --git a/configure b/configure new file mode 100755 index 0000000000..795dfd43b7 --- /dev/null +++ b/configure @@ -0,0 +1,19983 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.73 for UltraGrid 1.10.4. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2026 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # contradicts POSIX and common usage. Disable this. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in #( + e) case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf '%s\n' "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +case $# in # (( + 0) exec $CONFIG_SHELL $as_opts "$as_myself" ;; + *) exec $CONFIG_SHELL $as_opts "$as_myself" "$@" ;; +esac +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf '%s\n' "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # contradicts POSIX and common usage. Disable this. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else case e in #( + e) as_have_required=no ;; +esac +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi ;; +esac +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +case $# in # (( + 0) exec $CONFIG_SHELL $as_opts "$as_myself" ;; + *) exec $CONFIG_SHELL $as_opts "$as_myself" "$@" ;; +esac +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed 'exec'. +printf '%s\n' "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf '%s\n' "$0: This script requires a shell more modern than all" + printf '%s\n' "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf '%s\n' "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf '%s\n' "$0: be upgraded to zsh 4.3.4 or later." + else + printf '%s\n' "$0: Please tell bug-autoconf@gnu.org and +$0: ultragrid-dev@cesnet.cz about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." + fi + exit 1 +fi ;; +esac +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf '%s\n' "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in #( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in #( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf '%s\n' "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + t clear + :clear + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf '%s\n' "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_CONFIG_STATUS= +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='UltraGrid' +PACKAGE_TARNAME='ultragrid' +PACKAGE_VERSION='1.10.4' +PACKAGE_STRING='UltraGrid 1.10.4' +PACKAGE_BUGREPORT='ultragrid-dev@cesnet.cz' +PACKAGE_URL='' + +ac_unique_file="src/main.cpp" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +: ${enable_year2038:=no} +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +TOREMOVE +TEST_OBJS +TEST_LIBS +TARGETS +REFLECTOR_OBJS +MODULES +LIB_GENERATED_HEADERS +GENERATED_HEADERS +BIN_DEPS +REFLECTOR_TARGET +FLUIDSYNTH_LIBS +FLUIDSYNTH_CFLAGS +PCP_LIBS +PCP_CFLAGS +CINEFORM_LIBS +CINEFORM_CFLAGS +OpenCL_Headers_LIBS +OpenCL_Headers_CFLAGS +OpenCL_LIBS +OpenCL_CFLAGS +FRAMEWORK_SYPHON +CRYPTO_LIBS +CRYPTO_CFLAGS +V4LCONVERT_LIBS +V4LCONVERT_CFLAGS +GUI_TARGET +GUI_EXE +QMAKE +WAND7_LIBS +WAND7_CFLAGS +TEXT_LIBS +TEXT_CFLAGS +ZFEC_PREFIX +LIBSOXR_LIBS +LIBSOXR_CFLAGS +LIBSPEEXDSP_LIBS +LIBSPEEXDSP_CFLAGS +LIBGPUSTITCH_LIBS +LIBGPUSTITCH_CFLAGS +LIBGPUJPEG_LIBS +LIBGPUJPEG_CFLAGS +LIBGPUJPEG_ANY_LIBS +LIBGPUJPEG_ANY_CFLAGS +SCREEN_PW_DEPS_LIBS +SCREEN_PW_DEPS_CFLAGS +PIPEWIRE_LIBS +PIPEWIRE_CFLAGS +GLFW_LIBS +GLFW_CFLAGS +DRM_LIBS +DRM_CFLAGS +LIBAVFORMAT_LIBS +LIBAVFORMAT_CFLAGS +LIBAVUTIL_LIBS +LIBAVUTIL_CFLAGS +LIBAVCODEC_LIBS +LIBAVCODEC_CFLAGS +LIBSWSCALE_LIBS +LIBSWSCALE_CFLAGS +LAVC_HWACC_VAAPI_LIBS +LAVC_HWACC_VAAPI_CFLAGS +LAVC_HWACC_VDPAU_LIBS +LAVC_HWACC_VDPAU_CFLAGS +SDL_TTF_LIBS +SDL_TTF_CFLAGS +BLANK_LIBS +BLANK_CFLAGS +RTSP_LIBS +RTSP_CFLAGS +OPENCV_2_LIBS +OPENCV_2_CFLAGS +OPENCV_3_LIBS +OPENCV_3_CFLAGS +OPENCV_4_LIBS +OPENCV_4_CFLAGS +CACA_LIBS +CACA_CFLAGS +XRGLDISP_LIBS +XRGLDISP_CFLAGS +GLM_LIBS +GLM_CFLAGS +VULKAN +VULKAN_LIBS +VULKAN_CFLAGS +SDL_LIBS +SDL_CFLAGS +FRAMEWORK_M3API +FRAMEWORK_VIDEOMASTERHD_AUDIO +FRAMEWORK_VIDEOMASTERHD +DECKLINK_PATH +CUDA_COMPUTE_ARGS +CUDA_COMPILER +CUDA_LIB +CUDA_INC +cuda_host_cc +DYLIBBUNDLER_FLAGS +CL +NVCC +SAGE_DIRECTORY +NTV2_ROOT +GENICAM_GENTL64_PATH +DVS_DIRECTORY +DELTACAST_DIRECTORY +CUDA_PATH +CINEFORM_DIRECTORY +BLUE_LATEST_SDK +AJA_DIRECTORY +MATHLIBS +DLL_LIBS +MANPAGES +A2X +DYLIBBUNDLER +OFAST +ARCH +CUDA_FLAGS +UV_LDFLAGS +LINKER +LLD +MACOS_LEGACY +system +COMMON_FLAGS +POST_COMPILE_MSG +ULTRAGRID_OBJS +ULTRAGRID_LIBS +INC +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +EGREP +GREP +CXXCPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__xargs_n +am__rm_f_notfound +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +ECHO_T +ECHO_N +ECHO_C +target_alias +host_alias +build_alias +LIBS +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +enable_largefile +enable_depends_version_check +enable_all +enable_man +enable_plugins +enable_rt +enable_profile +enable_debug +enable_ipv6 +enable_libbacktrace +enable_cuda +with_cuda +with_cuda_compiler +with_cuda_host_compiler +enable_gl +enable_dvs +with_dvs +enable_decklink +enable_bluefish444 +with_bluefish444 +enable_aja +with_aja +enable_holepunch +enable_deltacast +with_deltacast +enable_ximea +enable_ximea_runtime_linking +enable_avfoundation +enable_sdl +enable_vulkan +enable_panogl_disp +enable_xrgl_disp +enable_caca +enable_opencv +enable_rtsp +enable_rtsp_server +with_live555 +enable_sdp_http +enable_resize +enable_blank +enable_testcard2 +enable_lavc_hw_accel_vdpau +enable_lavc_hw_accel_vaapi +enable_libswscale +enable_libavcodec +enable_lavc_cuda_conv +enable_file +enable_drm_disp +enable_gl_display +enable_swmix +enable_dshow +enable_pipewire +enable_pipewire_audio +enable_pipewire_video +enable_screen +enable_rtdxt +enable_uyvy +enable_gpujpeg +enable_cuda_dxt +enable_gpujpeg_to_dxt +enable_gpustitch +enable_sage +enable_sage_native_dxt5ycocg +with_sage +enable_portaudio +enable_speexdsp +enable_soxr +enable_zfec +with_zfec +enable_jack_transport +enable_jack +enable_alsa +enable_coreaudio +enable_scale +enable_text +enable_qt +enable_static_qt +enable_v4l2 +enable_wasapi +enable_ihdtv +enable_openssl +enable_ldgm_gpu +enable_syphon +enable_spout +enable_video_mixer +enable_bitflow +enable_cmpto_j2k +enable_ndi +enable_cineform +with_cineform +enable_natpmp +enable_pcp +enable_fluidsynth +enable_reflector +enable_object +enable_year2038 +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +ARCH +AJA_DIRECTORY +BLUE_LATEST_SDK +CINEFORM_DIRECTORY +CUDA_FLAGS +CUDA_PATH +DELTACAST_DIRECTORY +DVS_DIRECTORY +GENICAM_GENTL64_PATH +NTV2_ROOT +SAGE_DIRECTORY +SDL_CFLAGS +SDL_LIBS +VULKAN_CFLAGS +VULKAN_LIBS +GLM_CFLAGS +GLM_LIBS +XRGLDISP_CFLAGS +XRGLDISP_LIBS +CACA_CFLAGS +CACA_LIBS +OPENCV_4_CFLAGS +OPENCV_4_LIBS +OPENCV_3_CFLAGS +OPENCV_3_LIBS +OPENCV_2_CFLAGS +OPENCV_2_LIBS +RTSP_CFLAGS +RTSP_LIBS +BLANK_CFLAGS +BLANK_LIBS +SDL_TTF_CFLAGS +SDL_TTF_LIBS +LAVC_HWACC_VDPAU_CFLAGS +LAVC_HWACC_VDPAU_LIBS +LAVC_HWACC_VAAPI_CFLAGS +LAVC_HWACC_VAAPI_LIBS +LIBSWSCALE_CFLAGS +LIBSWSCALE_LIBS +LIBAVCODEC_CFLAGS +LIBAVCODEC_LIBS +LIBAVUTIL_CFLAGS +LIBAVUTIL_LIBS +LIBAVFORMAT_CFLAGS +LIBAVFORMAT_LIBS +DRM_CFLAGS +DRM_LIBS +GLFW_CFLAGS +GLFW_LIBS +PIPEWIRE_CFLAGS +PIPEWIRE_LIBS +SCREEN_PW_DEPS_CFLAGS +SCREEN_PW_DEPS_LIBS +LIBGPUJPEG_ANY_CFLAGS +LIBGPUJPEG_ANY_LIBS +LIBGPUJPEG_CFLAGS +LIBGPUJPEG_LIBS +LIBGPUSTITCH_CFLAGS +LIBGPUSTITCH_LIBS +LIBSPEEXDSP_CFLAGS +LIBSPEEXDSP_LIBS +LIBSOXR_CFLAGS +LIBSOXR_LIBS +TEXT_CFLAGS +TEXT_LIBS +WAND7_CFLAGS +WAND7_LIBS +V4LCONVERT_CFLAGS +V4LCONVERT_LIBS +CRYPTO_CFLAGS +CRYPTO_LIBS +OpenCL_CFLAGS +OpenCL_LIBS +OpenCL_Headers_CFLAGS +OpenCL_Headers_LIBS +CINEFORM_CFLAGS +CINEFORM_LIBS +PCP_CFLAGS +PCP_LIBS +FLUIDSYNTH_CFLAGS +FLUIDSYNTH_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: '$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf '%s\n' "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf '%s\n' "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf '%s\n' "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`printf '%s\n' $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf '%s\n' "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: '$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +'configure' configures UltraGrid 1.10.4 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print 'checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for '--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or '..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/ultragrid] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of UltraGrid 1.10.4:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --disable-largefile omit support for large files + --disable-depends-version-check + Disable libraries version check + --enable-all Enable or disable all features (default is auto) + --enable-man build (default is auto) requires: + AsciiDoc/Asciidoctor + --enable-plugins build modules as libraries (default is off) + --enable-rt enable RT priority + --enable-profile enable profiling + --enable-debug enable debug messages and code + --disable-ipv6 disable ipv6 + --disable-libbacktrace disable libbacktrace + --disable-cuda disable all CUDA code + --disable-gl disable all OpenGL stuff (default is auto) + Requires: glew gl (Linux + Win), none (macOS) + --disable-dvs disable DVS (default is auto) + Requires: DVS_SDK + --disable-decklink disable DeckLink (default is auto) + Requires: DesktopVideo + --disable-bluefish444 disable Bluefish444 suppport (default is auto) + Requires: bluefish444_SDK + --disable-aja disable AJA suppport (default is auto) + Requires: NTV2_SDK + --disable-holepunch disable holepunch suppport (default is auto) + Requires: libjuice + --disable-deltacast disable DELTACAST suppport (default is auto) + Requires: VideoMasterHD_SDK + --disable-ximea disable XIMEA suppport (default is auto) + Requires: XIMEA SDK + --disable-ximea-runtime-linking disable XIMEA suppport (default is enable), disabling may result in non-portable build + --disable-avfoundation enable AVFoundation support (default is enable on + macOS) + --enable-sdl[=1|2|3] enable SDL (optionally with version(s); default is + auto), requires: sdl >= 1.2.14 | sdl2 | sdl3 >= + 3.2.0 + --disable-vulkan disable sdl2_vulkan display (default is auto) + Requires: sdl2|sdl3 vulkan + --disable-panogl_disp disable gl panorama display (default is auto) + Requires: sdl2 gl + --disable-xrgl_disp disable OpenXR VR display (default is auto) + Requires: sdl2 gl openxr + --disable-caca disable caca display (default is auto) + --disable-opencv disable all OpenCV code + --disable-rtsp disable RTSP support (default is auto) + Requires: libcurl + --enable-rtsp-server enables RTSP server support (default is auto) + Requires: live555 + --enable-sdp-http enables SDP/HTTP transport (default is auto) + --disable-resize disable resize capture filter (default is auto) + Requires: opencv + --disable-blank disable blank capture filter (default is auto) + Requires: libswscale + --enable-testcard2[=[no]ttf] + enable testcard2 (default is auto) This includes + testcard2 (optionally with TTF). Requires: SDL_ttf + (optional) + --disable-lavc-hw-accel-vdpau disable lavc-hw-accel-vdpau (default is auto) + Requires: libavcodec libavutil >= 55.22.1 vdpau + --disable-lavc-hw-accel-vaapi disable lavc-hw-accel-vaapi (default is auto) + Requires: libavcodec libavutil >= 55.22.1 libva + --disable-libswscale disable libswscale support (default is auto) + Requires: libswscale libavutil + --disable-libavcodec disable libavcodec support (default is auto) + Requires: libavcodec libavutil + --disable-lavc-cuda-conv + disable lavc CUDA conversions (default is auto) + Requires: libavcodec CUDA + --disable-file disable file IO support (default is auto) Requires: + libavcodec libavformat libavutil libswscale + --disable-drm_disp disable DRM display support (default is auto) + Requires: libdrm + --disable-gl-display disable OpenGL display (default is auto) + Requires: OpenGL GLFW3 + --disable-swmix disable SW mix (default is auto) + Requires: gl + --disable-dshow disable DirectShow support(default is auto) + --disable-pipewire disable all pipewire stuff (default is auto) + Requires: pipewire + --disable-pipewire-audio disable pipewire audio (default is auto) + Requires: pipewire + --disable-pipewire-video disable pipewire video (default is auto) + Requires: pipewire + --disable-screen disable screen capture (default is auto) + --enable-screen[=x11,pipewire,cg] + choose implementation (Linux: can be both x11 and + pipewire; macOS: cg - use Core Graphics + implementation instead of AV Foundation). Requires: + macOS<15 (cg), AVF (macOS otherwise); X11 or + PipeWire (Linux); DShow (Win) + --disable-rtdxt disable Real-Time OpenGL DXT compression (default is auto) + Requires: gl + --disable-uyvy disable dummy RGB to UYVY compression (default is auto) + Requires: CUDA + --disable-gpujpeg disable GPUJPEG compression (auto) + Requires: libgpujpeg + --disable-cuda-dxt disable CUDA DXT compression (auto) + Requires: CUDA + --disable-gpujpeg_to_dxt disable GPUJPEG DXT transcoder (default is disable) + Requires: CUDA libgpujpeg + --disable-gpustitch disable gpustitch (default is auto) + Requires: CUDA gpustitch + --disable-sage disable SAGE (default is disable) + Requires: SAGE + --enable-sage-native-dxt5ycocg + Assume that SAGE supports native DXT5 YCoCg (default + is disable) + --disable-portaudio disable Portaudio (default is auto) + Requires: portaudio-2.0 + --disable-speexdsp disable SpeexDSP (default is auto) + --disable-soxr disable Soxr (default is auto) + --disable-zfec disable zfec (default is auto) + --enable-jack-transport=force enable JACK transport (default is auto) + Requires: jack + --disable-jack disable JACK (default is auto) + Requires: jack + --disable-alsa disable ALSA (default is auto on Linux) + Requires: alsa + --disable-coreaudio disable CoreAudio support(default is auto on macOS) + --disable-scale disable scale postprocessor (default is auto) + Requires: gl + --disable-text disable text postprocessor (default is auto) + Requires: MagickWand + --enable-qt build Qt GUI (default is disabled) + Requires: qt5_gui_dep | Qt6 + --enable-static-qt use statically built Qt (default is disabled) + --disable-v4l2 disable V4L2 support (default is auto); requires: + Linux, v4lconvert (optional) + --disable-wasapi disable WASAPI support (default is auto) + --enable-ihdtv enable iHDTV support (default is disabled) + --enable-openssl[=auto|openssl|wolfssl] + enable encryption support (default is auto) + Requires: crypto | wolfssl + --disable-ldgm-gpu disable GPU accelerated LDGM (default is auto) + Requires: CUDA + --enable-syphon enables Syphon support (default is auto on macOS) + Requires: Syphon + --enable-spout enables Spout support (default is auto) + Requires: Spout GLEW + --disable-video-mixer disable MCU-like video mixer (default is auto) + Requires: opencv + --enable-bitflow Compile BitFlow grabber support + --enable-cmpto-j2k enables Comprimato J2K support (default is auto) + Requires: cmpto_j2k + --enable-ndi[=ver] enables NDI support (default is auto) + --disable-cineform disable cineform suppport (default is auto) + Requires: CINEFORM_SDK + --disable-natpmp disable NAT-PMP suppport (default is auto) + Requires: natpmp + --disable-pcp disable PCP suppport (default is auto) + Requires: libpcp + --disable-fluidsynth disable fluidtynth audio capture (default is auto) + --disable-reflector disables reflector (default is enabled) + --enable-object enable specific object(s) compilation (typically + when disabled non-essential features with + --disable-all; comma-separated, "all" to enable all) + --enable-year2038 support timestamps after 2038 + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-cuda=DIR specify location of CUDA Toolkit + --with-cuda-compiler=compiler + select compiler to compile cuda code with; suported: + clang, nvcc; default: nvcc + --with-cuda-host-compiler=BINARY + specify compiler used for building cuda host code + --with-dvs=DIR specify location of DVS SDK + --with-bluefish444=DIR specify location of Bluefish444 + --with-aja=DIR specify location of NTV2 + --with-deltacast=DIR specify location of DELTACAST + --with-live555=DIR specify location of live555 + --with-sage=DIR specify location of SAGE + --with-zfec=DIR path to zfec sources + --with-cineform=DIR specify location of Cineform SDK + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + ARCH Architecture to build for + AJA_DIRECTORY + Directory to AJA NTV2 SDK. + BLUE_LATEST_SDK + Placement of Bluefish444 SDK. + CINEFORM_DIRECTORY + Directory to Cineform SDK. + CUDA_FLAGS Flags to be passed to CUDA compiler, eg. -arch=native; + alterntatively CUDAFLAGS + CUDA_PATH Directory of your Nvidia toolkit instalation. + DELTACAST_DIRECTORY + Placement of VideoMasterHD directory (Deltacast). + DVS_DIRECTORY + Path to DVS installation. + GENICAM_GENTL64_PATH + XIMEA SDK library path + NTV2_ROOT Directory to AJA NTV2 SDK (ends with ntv2projects). + SAGE_DIRECTORY + Directory of your SAGE installation. + SDL_CFLAGS C compiler flags for SDL, overriding pkg-config + SDL_LIBS linker flags for SDL, overriding pkg-config + VULKAN_CFLAGS + C compiler flags for VULKAN, overriding pkg-config + VULKAN_LIBS linker flags for VULKAN, overriding pkg-config + GLM_CFLAGS C compiler flags for GLM, overriding pkg-config + GLM_LIBS linker flags for GLM, overriding pkg-config + XRGLDISP_CFLAGS + C compiler flags for XRGLDISP, overriding pkg-config + XRGLDISP_LIBS + linker flags for XRGLDISP, overriding pkg-config + CACA_CFLAGS C compiler flags for CACA, overriding pkg-config + CACA_LIBS linker flags for CACA, overriding pkg-config + OPENCV_4_CFLAGS + C compiler flags for OPENCV_4, overriding pkg-config + OPENCV_4_LIBS + linker flags for OPENCV_4, overriding pkg-config + OPENCV_3_CFLAGS + C compiler flags for OPENCV_3, overriding pkg-config + OPENCV_3_LIBS + linker flags for OPENCV_3, overriding pkg-config + OPENCV_2_CFLAGS + C compiler flags for OPENCV_2, overriding pkg-config + OPENCV_2_LIBS + linker flags for OPENCV_2, overriding pkg-config + RTSP_CFLAGS C compiler flags for RTSP, overriding pkg-config + RTSP_LIBS linker flags for RTSP, overriding pkg-config + BLANK_CFLAGS + C compiler flags for BLANK, overriding pkg-config + BLANK_LIBS linker flags for BLANK, overriding pkg-config + SDL_TTF_CFLAGS + C compiler flags for SDL_TTF, overriding pkg-config + SDL_TTF_LIBS + linker flags for SDL_TTF, overriding pkg-config + LAVC_HWACC_VDPAU_CFLAGS + C compiler flags for LAVC_HWACC_VDPAU, overriding pkg-config + LAVC_HWACC_VDPAU_LIBS + linker flags for LAVC_HWACC_VDPAU, overriding pkg-config + LAVC_HWACC_VAAPI_CFLAGS + C compiler flags for LAVC_HWACC_VAAPI, overriding pkg-config + LAVC_HWACC_VAAPI_LIBS + linker flags for LAVC_HWACC_VAAPI, overriding pkg-config + LIBSWSCALE_CFLAGS + C compiler flags for LIBSWSCALE, overriding pkg-config + LIBSWSCALE_LIBS + linker flags for LIBSWSCALE, overriding pkg-config + LIBAVCODEC_CFLAGS + C compiler flags for LIBAVCODEC, overriding pkg-config + LIBAVCODEC_LIBS + linker flags for LIBAVCODEC, overriding pkg-config + LIBAVUTIL_CFLAGS + C compiler flags for LIBAVUTIL, overriding pkg-config + LIBAVUTIL_LIBS + linker flags for LIBAVUTIL, overriding pkg-config + LIBAVFORMAT_CFLAGS + C compiler flags for LIBAVFORMAT, overriding pkg-config + LIBAVFORMAT_LIBS + linker flags for LIBAVFORMAT, overriding pkg-config + DRM_CFLAGS C compiler flags for DRM, overriding pkg-config + DRM_LIBS linker flags for DRM, overriding pkg-config + GLFW_CFLAGS C compiler flags for GLFW, overriding pkg-config + GLFW_LIBS linker flags for GLFW, overriding pkg-config + PIPEWIRE_CFLAGS + C compiler flags for PIPEWIRE, overriding pkg-config + PIPEWIRE_LIBS + linker flags for PIPEWIRE, overriding pkg-config + SCREEN_PW_DEPS_CFLAGS + C compiler flags for SCREEN_PW_DEPS, overriding pkg-config + SCREEN_PW_DEPS_LIBS + linker flags for SCREEN_PW_DEPS, overriding pkg-config + LIBGPUJPEG_ANY_CFLAGS + C compiler flags for LIBGPUJPEG_ANY, overriding pkg-config + LIBGPUJPEG_ANY_LIBS + linker flags for LIBGPUJPEG_ANY, overriding pkg-config + LIBGPUJPEG_CFLAGS + C compiler flags for LIBGPUJPEG, overriding pkg-config + LIBGPUJPEG_LIBS + linker flags for LIBGPUJPEG, overriding pkg-config + LIBGPUSTITCH_CFLAGS + C compiler flags for LIBGPUSTITCH, overriding pkg-config + LIBGPUSTITCH_LIBS + linker flags for LIBGPUSTITCH, overriding pkg-config + LIBSPEEXDSP_CFLAGS + C compiler flags for LIBSPEEXDSP, overriding pkg-config + LIBSPEEXDSP_LIBS + linker flags for LIBSPEEXDSP, overriding pkg-config + LIBSOXR_CFLAGS + C compiler flags for LIBSOXR, overriding pkg-config + LIBSOXR_LIBS + linker flags for LIBSOXR, overriding pkg-config + TEXT_CFLAGS C compiler flags for TEXT, overriding pkg-config + TEXT_LIBS linker flags for TEXT, overriding pkg-config + WAND7_CFLAGS + C compiler flags for WAND7, overriding pkg-config + WAND7_LIBS linker flags for WAND7, overriding pkg-config + V4LCONVERT_CFLAGS + C compiler flags for V4LCONVERT, overriding pkg-config + V4LCONVERT_LIBS + linker flags for V4LCONVERT, overriding pkg-config + CRYPTO_CFLAGS + C compiler flags for CRYPTO, overriding pkg-config + CRYPTO_LIBS linker flags for CRYPTO, overriding pkg-config + OpenCL_CFLAGS + C compiler flags for OpenCL, overriding pkg-config + OpenCL_LIBS linker flags for OpenCL, overriding pkg-config + OpenCL_Headers_CFLAGS + C compiler flags for OpenCL_Headers, overriding pkg-config + OpenCL_Headers_LIBS + linker flags for OpenCL_Headers, overriding pkg-config + CINEFORM_CFLAGS + C compiler flags for CINEFORM, overriding pkg-config + CINEFORM_LIBS + linker flags for CINEFORM, overriding pkg-config + PCP_CFLAGS C compiler flags for PCP, overriding pkg-config + PCP_LIBS linker flags for PCP, overriding pkg-config + FLUIDSYNTH_CFLAGS + C compiler flags for FLUIDSYNTH, overriding pkg-config + FLUIDSYNTH_LIBS + linker flags for FLUIDSYNTH, overriding pkg-config + +Use these variables to override the choices made by 'configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf '%s\n' "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf '%s\n' "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf '%s\n' "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +UltraGrid configure 1.10.4 +generated by GNU Autoconf 2.73 + +Copyright (C) 2026 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else case e in #( + e) printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else case e in #( + e) printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else case e in #( + e) printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else case e in #( + e) printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) eval "$3=yes" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else case e in #( + e) printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else case e in #( + e) printf '%s\n' "$as_me: program exited with status $ac_status" >&5 + printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status ;; +esac +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else case e in #( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else case e in #( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else case e in #( + e) ac_lo= ac_hi= ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else case e in #( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +#include +#include +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 &5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (void); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (void); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_cxx_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval "$3=yes" +else case e in #( + e) eval "$3=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +eval ac_res=\$$3 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_compile + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else case e in #( + e) printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf '%s\n' "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf '%s\n' "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by UltraGrid $as_me 1.10.4, which was +generated by GNU Autoconf 2.73. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf '%s\n' "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf '%s\n' "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# Dump the cache to stdout. It can be in a pipe (this is a requirement). +ac_cache_dump () +{ + # The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf '%s\n' "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # 'set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # 'set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) +} + +# Print debugging info to stdout. +ac_dump_debugging_info () +{ + echo + + printf '%s\n' "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + ac_cache_dump + echo + + printf '%s\n' "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'*) ac_val=`printf '%s\n' "$ac_val" | sed "s/'/'\\\\\\\\''/g"`;; + esac + printf '%s\n' "$ac_var='$ac_val'" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf '%s\n' "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'*) ac_val=`printf '%s\n' "$ac_val" | sed "s/'/'\\\\\\\\''/g"`;; + esac + printf '%s\n' "$ac_var='$ac_val'" + done | sort + echo + fi + + if test -s confdefs.h; then + printf '%s\n' "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf '%s\n' "$as_me: caught signal $ac_signal" + printf '%s\n' "$as_me: exit $exit_status" +} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. +ac_exit_trap () +{ + exit_status= + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + ac_dump_debugging_info >&5 + eval "rm -f $ac_clean_CONFIG_STATUS core *.core core.conftest.*" && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +} + +trap 'ac_exit_trap $?' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf '%s\n' "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf '%s\n' "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf '%s\n' "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf '%s\n' "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf '%s\n' "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf '%s\n' "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf '%s\n' "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf '%s\n' "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See 'config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf '%s\n' "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf '%s\n' "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C23 (global declarations) +ac_c_conftest_c23_globals=' +/* Does the compiler advertise conformance to C17 or earlier? + Although GCC 14 does not do that, even with -std=gnu23, + it is close enough, and defines __STDC_VERSION == 202000L. */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ <= 201710L +# error "Compiler advertises conformance to C17 or earlier" +#endif + +// Check alignas. +char alignas (double) c23_aligned_as_double; +char alignas (0) c23_no_special_alignment; +extern char c23_aligned_as_int; +char alignas (0) alignas (int) c23_aligned_as_int; + +// Check alignof. +enum +{ + c23_int_alignment = alignof (int), + c23_int_array_alignment = alignof (int[100]), + c23_char_alignment = alignof (char) +}; +static_assert (0 < -alignof (int), "alignof is signed"); + +int function_with_unnamed_parameter (int) { return 0; } + +void c23_noreturn (); + +/* Test parsing of string and char UTF-8 literals (including hex escapes). + The parens pacify GCC 15. */ +bool use_u8 = (!sizeof u8"\xFF") == (!u8'\''x'\''); + +bool check_that_bool_works = true | false | !nullptr; +#if !true +# error "true does not work in #if" +#endif +#if false +#elifdef __STDC_VERSION__ +#else +# error "#elifdef does not work" +#endif + +#ifndef __has_c_attribute +# error "__has_c_attribute not defined" +#endif + +#ifndef __has_include +# error "__has_include not defined" +#endif + +#define LPAREN() ( +#define FORTY_TWO(x) 42 +#define VA_OPT_TEST(r, x, ...) __VA_OPT__ (FORTY_TWO r x)) +static_assert (VA_OPT_TEST (LPAREN (), 0, <:-) == 42); + +static_assert (0b101010 == 42); +static_assert (0B101010 == 42); +static_assert (0xDEAD'\''BEEF == 3'\''735'\''928'\''559); +static_assert (0.500'\''000'\''000 == 0.5); + +enum unsignedish : unsigned int { uione = 1 }; +static_assert (0 < -uione); + +#include +constexpr nullptr_t null_pointer = nullptr; + +static typeof (1 + 1L) two () { return 2; } +static long int three () { return 3; } +' + +# Test code for whether the C compiler supports C23 (body of main). +ac_c_conftest_c23_main=' + { + label_before_declaration: + int arr[10] = {}; + if (arr[0]) + goto label_before_declaration; + if (!arr[0]) + goto label_at_end_of_block; + label_at_end_of_block: + } + ok |= !null_pointer; + ok |= two != three; +' + +# Test code for whether the C compiler supports C23 (complete). +ac_c_conftest_c23_program="${ac_c_conftest_c23_globals} + +int +main (int, char **) +{ + int ok = 0; + ${ac_c_conftest_c23_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Do not test the value of __STDC__, because some compilers define it to 0 + or do not define it, while otherwise adequately conforming. */ + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +/* Does the compiler advertise C99 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +// See if C++-style comments work. + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr, and "aND" is used instead of "and" to work around +// GCC bug 40564 which is irrelevant here. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, aND third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + const char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + static struct incomplete_array *volatile incomplete_array_pointer; + struct incomplete_array *ia = incomplete_array_pointer; + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + // Do not test for VLAs, as some otherwise-conforming compilers lack them. + // C code should instead use __STDC_NO_VLA__; see Autoconf manual. + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || ni.number != 58); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +/* Does the compiler advertise C11 conformance? */ +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="compile missing install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf '%s\n' "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf '%s\n' "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf '%s\n' "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf '%s\n' "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf '%s\n' "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf '%s\n' "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf '%s\n' "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf '%s\n' "$as_me: error: '$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w= + for ac_val in x $ac_old_val; do + ac_old_val_w="$ac_old_val_w $ac_val" + done + ac_new_val_w= + for ac_val in x $ac_new_val; do + ac_new_val_w="$ac_new_val_w $ac_val" + done + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf '%s\n' "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf '%s\n' "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf '%s\n' "$as_me: former value: '$ac_old_val'" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf '%s\n' "$as_me: current value: '$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf '%s\n' "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf '%s\n' "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +configure_flags="$*" + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf '%s\n' "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`printf '%s\n' "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf '%s\n' "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`printf '%s\n' "$host_os" | sed 's/ /-/g'`;; esac + + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +printf %s "checking target system type... " >&6; } +if test ${ac_cv_target+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +printf '%s\n' "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`printf '%s\n' "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +am__api_version='1.18' + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF/1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF/1 since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + ;; +esac +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf '%s\n' "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether sleep supports fractional seconds" >&5 +printf %s "checking whether sleep supports fractional seconds... " >&6; } +if test ${am_cv_sleep_fractional_seconds+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if sleep 0.001 2>/dev/null +then : + am_cv_sleep_fractional_seconds=yes +else case e in #( + e) am_cv_sleep_fractional_seconds=no ;; +esac +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_sleep_fractional_seconds" >&5 +printf '%s\n' "$am_cv_sleep_fractional_seconds" >&6; } + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking filesystem timestamp resolution" >&5 +printf %s "checking filesystem timestamp resolution... " >&6; } +if test ${am_cv_filesystem_timestamp_resolution+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `ls -t conftest.ts[12]` && + { + test "$*" != "X conftest.ts1 conftest.ts2" || + test "$*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + printf '%s\n' ""Bad output from ls -t: \"`ls -t conftest.ts[12]`\""" >&5 + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment. +See 'config.log' for more details" "$LINENO" 5; } +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$2" = conftest.ts3 && + test "$3" = conftest.ts2 && + test "$4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_filesystem_timestamp_resolution" >&5 +printf '%s\n' "$am_cv_filesystem_timestamp_resolution" >&6; } + +# This check should not be cached, as it may vary across builds of +# different projects. +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_build_env_is_sane" >&5 +printf '%s\n' "$am_build_env_is_sane" >&6; } +if test "$am_build_env_is_sane" = no; then + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi + +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1 +then : + +else case e in #( + e) ( sleep "$am_cv_filesystem_timestamp_resolution" ) & + am_sleep_pid=$! + ;; +esac +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was 's,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf '%s\n' "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf '%s\n' "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf '%s\n' "$STRIP" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf '%s\n' "$ac_ct_STRIP" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + *'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + ;; +esac +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use plain mkdir -p, + # in the hope it doesn't have the bugs of ancient mkdir. + MKDIR_P='mkdir -p' + fi +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf '%s\n' "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk 'busybox awk' +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf '%s\n' "$AWK" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf '%s\n' "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @printf '%s\n' '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make ;; +esac +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + SET_MAKE= +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +AM_DEFAULT_VERBOSITY=1 +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +am_make=${MAKE-make} +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if printf '%s\n' 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf '%s\n' "$am_cv_make_support_nested_variables" >&6; } +AM_BACKSLASH='\' + +am__rm_f_notfound= +if (rm -f && rm -fr && rm -rf) 2>/dev/null +then : + +else case e in #( + e) am__rm_f_notfound='""' ;; +esac +fi + + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking xargs -n works" >&5 +printf %s "checking xargs -n works... " >&6; } +if test ${am_cv_xargs_n_works+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3" +then : + am_cv_xargs_n_works=yes +else case e in #( + e) am_cv_xargs_n_works=no ;; +esac +fi ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_xargs_n_works" >&5 +printf '%s\n' "$am_cv_xargs_n_works" >&6; } +if test "$am_cv_xargs_n_works" = yes +then : + am__xargs_n='xargs -n' +else case e in #( + e) am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "" "$am__xargs_n_arg"; done; }' + ;; +esac +fi + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='ultragrid' + VERSION='1.10.4' + + +printf '%s\n' "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf '%s\n' "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar plaintar pax cpio none' + +# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + if test x$am_uid = xunknown; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&5 +printf '%s\n' "$as_me: WARNING: ancient id detected; assuming current UID is ok, but dist-ustar might not work" >&2;} + elif test $am_uid -le $am_max_uid; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + _am_tools=none + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + if test x$gm_gid = xunknown; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&5 +printf '%s\n' "$as_me: WARNING: ancient id detected; assuming current GID is ok, but dist-ustar might not work" >&2;} + elif test $am_gid -le $am_max_gid; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + _am_tools=none + fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_ustar-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + { echo "$as_me:$LINENO: $_am_tar --version" >&5 + ($_am_tar --version) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && break + done + am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x ustar -w "$$tardir"' + am__tar_='pax -L -x ustar -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H ustar -L' + am__tar_='find "$tardir" -print | cpio -o -H ustar -L' + am__untar='cpio -i -H ustar -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_ustar}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 + (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + rm -rf conftest.dir + if test -s conftest.tar; then + { echo "$as_me:$LINENO: $am__untar &5 + ($am__untar &5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 + (cat conftest.dir/file) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) am_cv_prog_tar_ustar=$_am_tool ;; +esac +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf '%s\n' "$am_cv_prog_tar_ustar" >&6; } + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + + + + + + + + + +PARENT=`echo $PWD | sed -e 's%/[^/]*$%%'` + + +printf '%s\n' "#define CONFIG_FLAGS \"$configure_flags\"" >>confdefs.h + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf '%s\n' "$CC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf '%s\n' "$ac_ct_CC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See 'config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf '%s\n' "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an '-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else case e in #( + e) ac_file='' ;; +esac +fi +if test -z "$ac_file" +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf '%s\n' "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else case e in #( + e) { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest conftest$ac_cv_exeext +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf '%s\n' "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf '%s\n' "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out +ac_clean_files=$ac_clean_files_save +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else case e in #( + e) printf '%s\n' "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf '%s\n' "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else case e in #( + e) ac_compiler_gnu=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf '%s\n' "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else case e in #( + e) CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf '%s\n' "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C23 features" >&5 +printf %s "checking for $CC option to enable C23 features... " >&6; } +if test ${ac_cv_prog_cc_c23+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c23=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c23_program +_ACEOF +for ac_arg in '' -std=gnu23 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c23=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c23" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c23" = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c23" = x +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } +else case e in #( + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c23" >&5 +printf '%s\n' "$ac_cv_prog_cc_c23" >&6; } + CC="$CC $ac_cv_prog_cc_c23" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c23 + ac_prog_cc_stdc=c23 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 -std:c11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } +else case e in #( + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf '%s\n' "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } +else case e in #( + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf '%s\n' "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 ;; +esac +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC ;; +esac +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf '%s\n' "unsupported" >&6; } +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf '%s\n' "none needed" >&6; } +else case e in #( + e) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf '%s\n' "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" ;; +esac +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 ;; +esac +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM + unset am_i ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf '%s\n' "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf '%s\n' "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf '%s\n' "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in #( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + ;; +esac +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf '%s\n' "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in #( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else case e in #( + e) { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf '%s\n' "$CXX" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf '%s\n' "$ac_ct_CXX" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf '%s\n' "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else case e in #( + e) ac_compiler_gnu=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf '%s\n' "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else case e in #( + e) CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else case e in #( + e) ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf '%s\n' "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf '%s\n' "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in #( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + ;; +esac +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf '%s\n' "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in #( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else case e in #( + e) { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in #( +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf '%s\n' 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf '%s\n' "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf '%s\n' 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf '%s\n' "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP + + + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Derived from code rejected by Sun C 1.0 and similar vintage. */ + int x[] = {25, 17}; + typedef int const *iptr; + iptr foo = &x[0]; + ++foo; + if (!*foo) return 0; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else case e in #( + e) ac_cv_c_const=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf '%s\n' "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +printf '%s\n' "#define const /**/" >>confdefs.h + +fi + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf '%s\n' "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf '%s\n' "#define STDC_HEADERS 1" >>confdefs.h + +fi +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else case e in #( + e) +printf '%s\n' "#define size_t unsigned int" >>confdefs.h + ;; +esac +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf '%s\n' "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf '%s\n' "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf '%s\n' "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +printf %s "checking whether char is unsigned... " >&6; } +if test ${ac_cv_c_char_unsigned+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ +static int test_array [1 - 2 * !(((char) -1) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_char_unsigned=no +else case e in #( + e) ac_cv_c_char_unsigned=yes ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +printf '%s\n' "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes; then + printf '%s\n' "#define __CHAR_UNSIGNED__ 1" >>confdefs.h + +fi + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi +if test "$enable_largefile,$enable_year2038" != no,no +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to support large files" >&5 +printf %s "checking for $CC option to support large files... " >&6; } +if test ${ac_cv_sys_largefile_opts+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CPPFLAGS=$CPPFLAGS + ac_opt_found=no + for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1"; do + if test x"$ac_opt" != x"none needed" +then : + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifndef FTYPE +# define FTYPE off_t +#endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_opt" = x"none needed" +then : + # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CPPFLAGS="$CPPFLAGS -DFTYPE=ino_t" + if ac_fn_c_try_compile "$LINENO" +then : + +else case e in #( + e) CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" + if ac_fn_c_try_compile "$LINENO" +then : + ac_opt='-D_FILE_OFFSET_BITS=64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam +fi + ac_cv_sys_largefile_opts=$ac_opt + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CPPFLAGS=$ac_save_CPPFLAGS + + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 +printf '%s\n' "$ac_cv_sys_largefile_opts" >&6; } + +ac_have_largefile=yes +case $ac_cv_sys_largefile_opts in #( + "none needed") : + ;; #( + "supported through gnulib") : + ;; #( + "support not detected") : + ac_have_largefile=no ;; #( + "-D_FILE_OFFSET_BITS=64") : + +printf '%s\n' "#define _FILE_OFFSET_BITS 64" >>confdefs.h + ;; #( + "-D_LARGE_FILES=1") : + +printf '%s\n' "#define _LARGE_FILES 1" >>confdefs.h + ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; +esac + +if test "$enable_year2038" != no +then : + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $CC option to support timestamps after 2038" >&5 +printf %s "checking for $CC option to support timestamps after 2038... " >&6; } +if test ${ac_cv_sys_year2038_opts+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do + if test x"$ac_opt" != x"none needed" +then : + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 +printf '%s\n' "$ac_cv_sys_year2038_opts" >&6; } + +ac_have_year2038=yes +case $ac_cv_sys_year2038_opts in #( + "none needed") : + ;; #( + "support not detected") : + ac_have_year2038=no ;; #( + "-D_TIME_BITS=64") : + +printf '%s\n' "#define _TIME_BITS 64" >>confdefs.h + ;; #( + "-D__MINGW_USE_VC2005_COMPAT") : + +printf '%s\n' "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h + ;; #( + "-U_USE_32_BIT_TIME_T"*) : + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It +will stop working after mid-January 2038. Remove +_USE_32BIT_TIME_T from the compiler flags. +See 'config.log' for more details" "$LINENO" 5; } ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; +esac + +fi + +fi + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf '%s\n' "$PKG_CONFIG" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf '%s\n' "$ac_pt_PKG_CONFIG" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + PKG_CONFIG="" + fi +fi +if test -z "$PKG_CONFIG"; then + PKG_CONFIG= +fi +if test -z "$PKG_CONFIG"; then + PKG_CONFIG=$(command -v pkgconf) + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf '%s\n' "$PKG_CONFIG" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf '%s\n' "$ac_pt_PKG_CONFIG" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf '%s\n' "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + PKG_CONFIG="" + fi +fi +if test -z "$PKG_CONFIG"; then + as_fn_error $? "pkg-config not found" "$LINENO" 5 +fi +fi + +# ------------------------------------------------------------------------------------------------- +POST_COMPILE_MSG="" +CXXFLAGS="${CXXFLAGS:+$CXXFLAGS }-std=gnu++17" +CUDA_FLAGS="$CUDA_FLAGS${CUDA_FLAGS:+${CUDAFLAGS:+ }}$CUDAFLAGS" +INC="${INC-}" +LDFLAGS="${LDFLAGS-}" +LIB_MODULES= # modules libraries +UG_LIB_MODULES= +LIB_OBJS= # module object files +UG_LIB_OBJS= +LIBS="${LIBS-}" +MODULES= +OBJS= +TARGETS= + + + + + + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 +printf %s "checking size of int *... " >&6; } +if test ${ac_cv_sizeof_int_p+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default" +then : + +else case e in #( + e) ac_cv_sizeof_int_p=0 ;; +esac +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int_p" >&5 +printf '%s\n' "$ac_cv_sizeof_int_p" >&6; } + + + +printf '%s\n' "#define SIZEOF_INT_P $ac_cv_sizeof_int_p" >>confdefs.h + + + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + fi ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf '%s\n' "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + +printf '%s\n' "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + +printf '%s\n' "#define WORDS_SMALLENDIAN 1" >>confdefs.h + + ;; #( + universal) + +printf '%s\n' "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +printf %s "checking size of size_t... " >&6; } +if test ${ac_cv_sizeof_size_t+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" +then : + +else case e in #( + e) ac_cv_sizeof_size_t=0 ;; +esac +fi + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +printf '%s\n' "$ac_cv_sizeof_size_t" >&6; } + + + +printf '%s\n' "#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t" >>confdefs.h + + + +if test $ac_cv_sizeof_size_t -eq 8 +then + WORD_LEN=64 +else + WORD_LEN=32 +fi + + + +WARNINGS= +# variant of AC_MSG_WARN that in addition stores the message for repost at the end + + + + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking GIT presence" >&5 +printf %s "checking GIT presence... " >&6; } +if which git +then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking checking GIT branch " >&5 +printf %s "checking checking GIT branch ... " >&6; } + git_branch=$(srcdir=$(dirname "$0"); cd "$srcdir"; git name-rev --name-only HEAD) + if test "$git_branch"; then + +printf '%s\n' "#define GIT_BRANCH \"$git_branch\"" >>confdefs.h + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $git_branch" >&5 +printf '%s\n' "$git_branch" >&6; }; + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; }; + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking checking GIT revision " >&5 +printf %s "checking checking GIT revision ... " >&6; } + git_rev=$(srcdir=$(dirname "$0"); cd "$srcdir"; git rev-parse --short HEAD) + if test "$git_rev"; then + +printf '%s\n' "#define GIT_REV \"$git_rev\"" >>confdefs.h + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $git_rev" >&5 +printf '%s\n' "$git_rev" >&6; }; + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; }; + fi +fi + +# TODO: remove plaform macros definitions +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking OS family" >&5 +printf %s "checking OS family... " >&6; } +if test "$host_vendor" = "apple"; then + system=MacOSX + +printf '%s\n' "#define HAVE_MACOSX 1" >>confdefs.h + + APPEXT=.app +elif expr "x$host_os" : "x.*mingw32.*" > /dev/null || + expr "x$host_os" : "x.*msys.*" > /dev/null || test "$host_os" = cygwin; then + system=Windows + APPEXT=.exe + +printf '%s\n' "#define WIN32 1" >>confdefs.h + +elif expr "x$host_os" : xlinux >/dev/null; then + system=Linux + +printf '%s\n' "#define HAVE_LINUX 1" >>confdefs.h + +else + system=other +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $system" >&5 +printf '%s\n' "$system" >&6; }; + + +if test $build != $host; then + cross_compile=yes # don't confuse with autoconf's $cross_compiling - ours is more correct + # because $cross_compiling=no if we are cross-compiling but are able to + # execute the compiled binary (eg. using wine-binfmt) +else + cross_compile=no +fi + +if test $system = Linux; then + ac_fn_c_check_header_compile "$LINENO" "linux/version.h" "ac_cv_header_linux_version_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_version_h" = xyes +then : + printf '%s\n' "#define HAVE_LINUX_VERSION_H 1" >>confdefs.h + +fi + + LDFLAGS="$LDFLAGS -Wl,--dynamic-list-data" + COMMON_FLAGS="${COMMON_FLAGS:+$COMMON_FLAGS }-D_GNU_SOURCE" +fi + +if test $system = MacOSX; then + MACOS_LEGACY=no + macos_major=$(sw_vers -productVersion | cut -d. -f1) + macos_minor=$(sw_vers -productVersion | cut -d. -f2) + if test ${macos_major?} -eq 10 && test ${macos_minor?} -lt 15; then + MACOS_LEGACY=yes + fi + CFLAGS="$CFLAGS $COMMON_OSX_FLAGS" + CPPFLAGS="$CPPFLAGS $COMMON_OSX_FLAGS" + CXXFLAGS="$CXXFLAGS $COMMON_OSX_FLAGS" + if test $WORD_LEN = 32; then + CUDA_FLAGS="$CUDA_FLAGS -Xcompiler -Wno-error=unused-command-line-argument-hard-error-in-future" + fi + LDFLAGS="$LDFLAGS $COMMON_OSX_FLAGS -headerpad_max_install_names" + OBJS="$OBJS src/utils/macos.o" + +fi + +if test $system = Windows; then + LIBS="$LIBS -lsetupapi -lws2_32 -liphlpapi -lole32 -loleaut32" + LIBS="$LIBS -ldbghelp" + ac_fn_c_check_func "$LINENO" "SetThreadDescription" "ac_cv_func_SetThreadDescription" +if test "x$ac_cv_func_SetThreadDescription" = xyes +then : + printf '%s\n' "#define HAVE_SETTHREADDESCRIPTION 1" >>confdefs.h + +fi + + if $CXX -dM -E - /dev/null; then + # Extract the first word of "lld", so it can be a program name with args. +set dummy lld; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LLD+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$LLD"; then + ac_cv_prog_LLD="$LLD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LLD="yes" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +LLD=$ac_cv_prog_LLD +if test -n "$LLD"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $LLD" >&5 +printf '%s\n' "$LLD" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + if test "$LLD" = yes; then + COMMON_FLAGS="${COMMON_FLAGS:+$COMMON_FLAGS }-gcodeview" + UV_LDFLAGS="-fuse-ld=lld -g -Wl,--pdb=bin/uv.pdb" + fi + fi + if ! expr "x$COMMON_FLAGS" : '.*gcodeview' >/dev/null; then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Windows stacktrace will not be available." >&5 +printf '%s\n' "$as_me: WARNING: Windows stacktrace will not be available." >&2;} + WARNINGS="${WARNINGS}Windows stacktrace will not be available.\n" + + fi +fi + +LINKER=$CXX + + + + + + +# Check whether --enable-depends-version-check was given. +if test ${enable_depends_version_check+y} +then : + enableval=$enable_depends_version_check; version_check=$enableval +else case e in #( + e) version_check=yes + ;; +esac +fi + + +build_default=auto +# Check whether --enable-all was given. +if test ${enable_all+y} +then : + enableval=$enable_all; build_default=$enableval +else case e in #( + e) build_default=auto + ;; +esac +fi + + +if test $system = Windows; then + CUDA_FLAGS="$CUDA_FLAGS -Xcompiler -FS -Xcompiler -GS- -Xcompiler -MD" +else + CFLAGS="$CFLAGS -fPIC" + CXXFLAGS="$CXXFLAGS -fPIC" + CUDA_FLAGS="$CUDA_FLAGS -Xcompiler -fPIC" +fi + + + +if test "${target_cpu?}" = x86_64 || test "${target_cpu?}" = i686 +then + ARCH=${ARCH--msse4.1} +fi +if test $target_cpu = armv7l || { test $target_cpu = aarch64 && \ +test $ac_cv_sizeof_int_p -eq 4; } +then + LIBS="${LIBS:+$LIBS }-latomic" # needed for atomic_uint64_t +fi +CFLAGS="$CFLAGS${ARCH:+ $ARCH}" +CXXFLAGS="$CXXFLAGS${ARCH:+ $ARCH}" +LDFLAGS="$LDFLAGS${ARCH:+ $ARCH}" + +if expr "x$CFLAGS" : 'x.*-O' >/dev/null; then + OFAST="" +else + OFAST="-Ofast" +fi + + +ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_termios_h" = xyes +then : + printf '%s\n' "#define HAVE_TERMIOS_H 1" >>confdefs.h + +fi + + +# Adds the module to UltraGrid build system. +# @param $1 name of the module, should be in format _ unless +# sure that the modular build won't take place +# @param $2 object files +# @param $3 libraries +add_module() { + TARGET=lib/ultragrid/ultragrid_"$1".so + if `echo "$1" | grep -q 'vcompress\|vdecompress\|display_video_mix'`; then + LIB_OBJS="$LIB_OBJS $2" + LIB_MODULES="$LIB_MODULES $3" + else + UG_LIB_OBJS="$UG_LIB_OBJS $2" + UG_LIB_MODULES="$UG_LIB_MODULES $3" + fi + if test -n "$1"; then + MODULES="$MODULES $TARGET" + TARGETS="$TARGETS +$TARGET: $2 + \$(MKDIR_P) lib/ultragrid + \$(LINKER) \$(LDFLAGS) -shared -Wl,-soname,ultragrid_$1.so $2 -o lib/ultragrid/ultragrid_$1.so $3 +" + fi +} + +# --------------------------------------------------------------------- +# Dylib bundler +# --------------------------------------------------------------------- +if test $system = MacOSX; then + for ac_prog in dylibbundler +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DYLIBBUNDLER+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $DYLIBBUNDLER in + [\\/]* | ?:[\\/]*) + ac_cv_path_DYLIBBUNDLER="$DYLIBBUNDLER" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DYLIBBUNDLER="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +DYLIBBUNDLER=$ac_cv_path_DYLIBBUNDLER +if test -n "$DYLIBBUNDLER"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $DYLIBBUNDLER" >&5 +printf '%s\n' "$DYLIBBUNDLER" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + test -n "$DYLIBBUNDLER" && break +done +test -n "$DYLIBBUNDLER" || DYLIBBUNDLER="true" + + if test "$DYLIBBUNDLER" = true; then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find dylibbundler. We cannot put libraries into a bundle so it probably will not be portable." >&5 +printf '%s\n' "$as_me: WARNING: Cannot find dylibbundler. We cannot put libraries into a bundle so it probably will not be portable." >&2;} + WARNINGS="${WARNINGS}Cannot find dylibbundler. We cannot put libraries into a bundle so it probably will not be portable.\n" + + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking dylibbundler version" >&5 +printf %s "checking dylibbundler version... " >&6; } + dyl_ver=$($DYLIBBUNDLER -V >/dev/null 2>&1 && dylibbundler -V | cut -d\ -f2 || echo unknown) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $dyl_ver" >&5 +printf '%s\n' "$dyl_ver" >&6; }; + + if test "x$dyl_ver" = xunknown || test "${dyl_ver%%.*}" -eq 1 + then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Original dylib bundler detected, recommending v2 instead (https://github.com/SCG82/macdylibbundler)" >&5 +printf '%s\n' "$as_me: WARNING: Original dylib bundler detected, recommending v2 instead (https://github.com/SCG82/macdylibbundler)" >&2;} + WARNINGS="${WARNINGS}Original dylib bundler detected, recommending v2 instead (https://github.com/SCG82/macdylibbundler)\n" + + else + DYLIBBUNDLER="$DYLIBBUNDLER -f" # bundle also frameworks + fi + fi +fi + + + +# --------------------------------------------------------------------- +# AsciiDoc +# --------------------------------------------------------------------- +for ac_prog in asciidoctor a2x +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_A2X+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $A2X in + [\\/]* | ?:[\\/]*) + ac_cv_path_A2X="$A2X" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_A2X="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +A2X=$ac_cv_path_A2X +if test -n "$A2X"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $A2X" >&5 +printf '%s\n' "$A2X" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + test -n "$A2X" && break +done +test -n "$A2X" || A2X=":" + + + +man=no + +# Check whether --enable-man was given. +if test ${enable_man+y} +then : + enableval=$enable_man; req_man=$enableval +else case e in #( + e) req_man=$build_default ;; +esac +fi + + +if test "$req_man" != no; then + if test "$A2X" != :; then + man=yes + MANPAGES=uv.1 + fi +fi + +if test "$req_man" = yes && test "$A2X" = :; then + as_fn_error $? "Manual pages generate required, but +AsciiDoc/Asciidoctor was not found!" "$LINENO" 5 +fi + + + +ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" +if test "x$ac_cv_func_usleep" = xyes +then : + printf '%s\n' "#define HAVE_USLEEP 1" >>confdefs.h + +fi + + +# --------------------------------------------------------------------- +# Common shell utility functions +# --------------------------------------------------------------------- +# Be careful about [] m4 processing - either use quadrigraphs or enclose macro with additional [] + +# remove redundant spaces from argument (multiplied, leading, trailing) +compact_spaces_pipe() { sed -e 's/ */ /g' -e 's/^ //' -e 's/ $//' ;} +compact_spaces() { echo "$1" | compact_spaces_pipe ;} +# remove "-mwindows" from lib flags obtained with pkg-config +# because it causes output to be scratched by cmd/pwsh (but +# not MSYS2 terminal) +remove_mwindows() { + echo "$1" | sed 's/-mwindows//' | compact_spaces_pipe +} + +## ensures that user explicitly requested feature is present, otherwise fail +## @param $1 feature requeseted +## @param $2 feature feature found +## @param $3 error message + + +# ------------------------------------------------------------------------------------------------- +# GCC-specific warning flags +if test "$GCC" = yes +then + CFLAGS="$CFLAGS -pipe -W -Wcast-qual -Wcast-align -Wbad-function-cast -Wmissing-prototypes -Wmissing-declarations" + CXXFLAGS="$CXXFLAGS -pipe -W -Wcast-qual -Wcast-align -Wmissing-declarations" +fi + +# ------------------------------------------------------------------------------------------------ +# Dynamic libraries stuff +# +build_libraries=no +# Check whether --enable-plugins was given. +if test ${enable_plugins+y} +then : + enableval=$enable_plugins; build_libraries=$enableval +fi + + +if test "$build_libraries" = yes +then + if test "$system" = "Linux" + then + LIBS="$LIBS -ldl" + LDFLAGS="$LDFLAGS -rdynamic" + else + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Building libraries is not supported with other system than Linux" >&5 +printf '%s\n' "$as_me: WARNING: Building libraries is not supported with other system than Linux" >&2;} + WARNINGS="${WARNINGS}Building libraries is not supported with other system than Linux\n" + + build_libraries=no + fi + +printf '%s\n' "#define BUILD_LIBRARIES 1" >>confdefs.h + +fi + + +# ------------------------------------------------------------------------------------------------- +# Check for libraries + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 +printf %s "checking for library containing socket... " >&6; } +if test ${ac_cv_search_socket+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); +int +main (void) +{ +return socket (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_socket=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_socket+y} +then : + break +fi +done +if test ${ac_cv_search_socket+y} +then : + +else case e in #( + e) ac_cv_search_socket=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 +printf '%s\n' "$ac_cv_search_socket" >&6; } +ac_res=$ac_cv_search_socket +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5 +printf %s "checking for library containing inet_addr... " >&6; } +if test ${ac_cv_search_inet_addr+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char inet_addr (void); +int +main (void) +{ +return inet_addr (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_inet_addr=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_inet_addr+y} +then : + break +fi +done +if test ${ac_cv_search_inet_addr+y} +then : + +else case e in #( + e) ac_cv_search_inet_addr=no ;; +esac +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5 +printf '%s\n' "$ac_cv_search_inet_addr" >&6; } +ac_res=$ac_cv_search_inet_addr +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for timer_create in -lrt" >&5 +printf %s "checking for timer_create in -lrt... " >&6; } +if test ${ac_cv_lib_rt_timer_create+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char timer_create (void); +int +main (void) +{ +return timer_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_rt_timer_create=yes +else case e in #( + e) ac_cv_lib_rt_timer_create=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_timer_create" >&5 +printf '%s\n' "$ac_cv_lib_rt_timer_create" >&6; } +if test "x$ac_cv_lib_rt_timer_create" = xyes +then : + printf '%s\n' "#define HAVE_LIBRT 1" >>confdefs.h + + LIBS="-lrt $LIBS" + +fi + + +ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" +if test "x$ac_cv_func_sin" = xyes +then : + MATHLIBS="" +else case e in #( + e) MATHLIBS="-lm" ;; +esac +fi + + + +# ------------------------------------------------------------------------------------------------- +# See if this system supports sched_setscheduler() + +use_rt=no +# Check whether --enable-rt was given. +if test ${enable_rt+y} +then : + enableval=$enable_rt; use_rt=$enableval +fi + +if test "$use_rt" = "yes"; then + ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler" +if test "x$ac_cv_func_sched_setscheduler" = xyes +then : + printf '%s\n' "#define HAVE_SCHED_SETSCHEDULER 1" >>confdefs.h + +fi + + +printf '%s\n' "#define USE_RT 1" >>confdefs.h + +fi + +# ------------------------------------------------------------------------------------------------- +# Try to find the pthread library... + +case "$host" in + *-*-*bsd*) + CFLAGS="$CFLAGS -pthread" + ;; + *) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +printf %s "checking for pthread_create in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread_pthread_create+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_create (void); +int +main (void) +{ +return pthread_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_pthread_pthread_create=yes +else case e in #( + e) ac_cv_lib_pthread_pthread_create=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 +printf '%s\n' "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = xyes +then : + LIBS="$LIBS -lpthread" +else case e in #( + e) as_fn_error $? "Require POSIX thread" "$LINENO" 5 ;; +esac +fi + + ;; +esac + +# ------------------------------------------------------------------------------------------------- +debug_output=no +profile=no +ipv6=yes + +# Check whether --enable-profile was given. +if test ${enable_profile+y} +then : + enableval=$enable_profile; if test $enableval = yes + then + if test "$GCC" = yes + then + CFLAGS="$CFLAGS -pg" + profile=yes + else + as_fn_error $? "Do not know how to enable profiling for $CC" "$LINENO" 5 + fi + fi +fi + + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; if test $enableval = yes + then + +printf '%s\n' "#define DEBUG 1" >>confdefs.h + + debug_output=yes + fi +fi + + +# Check whether --enable-ipv6 was given. +if test ${enable_ipv6+y} +then : + enableval=$enable_ipv6; if test $enableval = no + then + ipv6=no + fi +fi + + +if test "$ipv6" != no +then + +printf '%s\n' "#define HAVE_IPv6 1" >>confdefs.h + +fi + +# ---------------------------------------------------------------------- +# environment variables +# ---------------------------------------------------------------------- + + + + + + + + + + + +# ------------------------------------------------ +# libbacktrace +# ----------------------------------------------- +libbacktrace=no +# Check whether --enable-libbacktrace was given. +if test ${enable_libbacktrace+y} +then : + enableval=$enable_libbacktrace; libbacktrace_req=$enableval +else case e in #( + e) libbacktrace_req=$build_default ;; +esac +fi + + +if test "${libbacktrace_req?}" != no; then + ac_fn_c_check_header_compile "$LINENO" "backtrace.h" "ac_cv_header_backtrace_h" "$ac_includes_default" +if test "x$ac_cv_header_backtrace_h" = xyes +then : + +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for backtrace_pcinfo in -lbacktrace" >&5 +printf %s "checking for backtrace_pcinfo in -lbacktrace... " >&6; } +if test ${ac_cv_lib_backtrace_backtrace_pcinfo+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lbacktrace $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char backtrace_pcinfo (void); +int +main (void) +{ +return backtrace_pcinfo (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_backtrace_backtrace_pcinfo=yes +else case e in #( + e) ac_cv_lib_backtrace_backtrace_pcinfo=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_backtrace_backtrace_pcinfo" >&5 +printf '%s\n' "$ac_cv_lib_backtrace_backtrace_pcinfo" >&6; } +if test "x$ac_cv_lib_backtrace_backtrace_pcinfo" = xyes +then : + printf '%s\n' "#define HAVE_LIBBACKTRACE 1" >>confdefs.h + + LIBS="-lbacktrace $LIBS" + +fi + + if test "${ac_cv_header_backtrace_h?}" = yes && \ + test "${ac_cv_lib_backtrace_backtrace_pcinfo?}" = yes; + then + LIBS="$LIBS -lbacktrace" + +printf '%s\n' "#define HAVE_LIBBACKTRACE 1" >>confdefs.h + + libbacktrace=yes + fi +fi + + +if { test "$libbacktrace_req" != no && test "$libbacktrace_req" != auto ;} && test "$libbacktrace" = no; then + as_fn_error $? "libbacktrace not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# CUDA stuff +# +# CUDA compiler choice - defaults to nvcc +# +# CUDA lookup order: +# 1) --with-cuda +# 2) CUDA_DIRECTORY env variable +# 3) CUDA_PATH env variable +# 4) default system path (PATH, LD_LIBRARY_PATH, C_INCLUDE_PATH/CPATH) +# 5) default CUDA path + +CUDA_COMPUTE_ARGS="" +CUDA_COMPILER="" + +CUDA_INC= +CUDA_LIB= +NVCC= +CUDA_LIB_PATH= +FOUND_CUDA=no +if test -n "$CUDA_DIRECTORY"; then + CUDA_PATH=$CUDA_DIRECTORY +fi + +# Check whether --enable-cuda was given. +if test ${enable_cuda+y} +then : + enableval=$enable_cuda; cuda_req=$enableval +else case e in #( + e) cuda_req=$build_default ;; +esac +fi + + + +# Check whether --with-cuda was given. +if test ${with_cuda+y} +then : + withval=$with_cuda; CUDA_PATH=$withval + +fi + + +if test -n "$CUDA_PATH"; then + CUDA_PATH_SEP="$CUDA_PATH/bin$PATH_SEPARATOR" +fi + +if test $cuda_req != no; then + # nvcc is intentional here + # Extract the first word of "nvcc", so it can be a program name with args. +set dummy nvcc; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_NVCC+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $NVCC in + [\\/]* | ?:[\\/]*) + ac_cv_path_NVCC="$NVCC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $CUDA_PATH_SEP$PATH $PATH_SEPARATOR/opt/cuda/bin$PATH_SEPARATOR/usr/local/cuda/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_NVCC="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +NVCC=$ac_cv_path_NVCC +if test -n "$NVCC"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $NVCC" >&5 +printf '%s\n' "$NVCC" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + +fi + +if test -n "${NVCC?}" && test "${cross_compile?}" = no && test "${cuda_req?}" != no +then + CUDA_PATH=`dirname "$NVCC"` + CUDA_PATH=`dirname "$CUDA_PATH"` + + if test $system = Windows; then + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CL+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -n "$CL"; then + ac_cv_prog_CL="$CL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CL="cl" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi ;; +esac +fi +CL=$ac_cv_prog_CL +if test -n "$CL"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $CL" >&5 +printf '%s\n' "$CL" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + if test -n "$CL"; then + cl_lib_path=$(realpath "$(dirname "$(command -v "$CL")")"/../../../lib/x64) + if test $? -ne 0; then + # MSVS 14.0 has it otherwhere + cl_lib_path=$(realpath "$(dirname "$(command -v "$CL")")"/../lib) + fi + DEFAULT_LIB_P=$($LINKER --verbose 2>&1 | awk \ +'BEGIN { ORS="" } /InstalledDir: / { print $2 }')/../lib + CUDA_LIB="${CUDA_LIB:+$CUDA_LIB }-L$DEFAULT_LIB_P" + CUDA_LIB="$CUDA_LIB -L\"$cl_lib_path\"" + FOUND_CUDA=yes + fi + else + FOUND_CUDA=yes + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking CUDA Toolkit version - major" >&5 +printf %s "checking CUDA Toolkit version - major... " >&6; } + nvcc_major=`"$NVCC" --version |grep release|sed 's/^.*release \([0-9][0-9]*\).*$/\1/'` + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $nvcc_major" >&5 +printf '%s\n' "$nvcc_major" >&6; } + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking CUDA Toolkit version - minor" >&5 +printf %s "checking CUDA Toolkit version - minor... " >&6; } + nvcc_minor=`"$NVCC" --version |grep release|sed 's/^.*release [0-9][0-9]*\.\([0-9][0-9]*\).*$/\1/'` + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $nvcc_minor" >&5 +printf '%s\n' "$nvcc_minor" >&6; } + + if test "${ac_cv_sizeof_int_p?}" -eq 8 && test "${system?}" = Linux + then + CUDA_LIB_PATH="$CUDA_PATH/lib64" + else + CUDA_LIB_PATH="$CUDA_PATH/lib" + fi + + if test $system = Windows; then + CUDA_PATH="\"$CUDA_PATH\"" + CUDA_LIB_PATH="\"$CUDA_LIB_PATH\"" + if test $WORD_LEN = 64; then + CUDA_LIB_PATH="$CUDA_LIB_PATH/x64" + else + CUDA_LIB_PATH="$CUDA_LIB_PATH/Win32" + fi + fi + + CUDA_LIB="${CUDA_LIB:+$CUDA_LIB }-L$CUDA_LIB_PATH -lcudart" + CUDA_INC="-I$CUDA_PATH/include" + CUDA_COMPILER="$NVCC" + INC="$INC $CUDA_INC" + + if test $system = MacOSX; then + LDFLAGS="$LDFLAGS${LDFLAGS:+ }-rpath $CUDA_LIB_PATH" + DYLIBBUNDLER_FLAGS="${DYLIBBUNDER_FLAGS:+$DYLIBBUNDLER_FLAGS }-s $CUDA_LIB_PATH" + fi +fi + + + +# Pick compiler for cuda device code + +# Check whether --with-cuda-compiler was given. +if test ${with_cuda_compiler+y} +then : + withval=$with_cuda_compiler; CUDA_COMPILER="$withval" +fi + + +HOST_CC_REPORT=" (" +case "$CUDA_COMPILER" in + *nvcc*) + ;; + *clang*) + CUDA_COMPUTE_ARGS="--cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35" + ;; + "") + ;; + *) + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Unsupported cuda compiler $CUDA_COMPILER" >&5 +printf '%s\n' "$as_me: WARNING: Unsupported cuda compiler $CUDA_COMPILER" >&2;} + WARNINGS="${WARNINGS}Unsupported cuda compiler $CUDA_COMPILER\n" + + ;; +esac +HOST_CC_REPORT="$HOST_CC_REPORT"$(basename "$CUDA_COMPILER") + +# CUDA host compiler + +# Check whether --with-cuda-host-compiler was given. +if test ${with_cuda_host_compiler+y} +then : + withval=$with_cuda_host_compiler; +fi + +if test "x${with_cuda_host_compiler}" != "x" ; then + # Extract the first word of "${with_cuda_host_compiler}", so it can be a program name with args. +set dummy ${with_cuda_host_compiler}; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_cuda_host_cc+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $cuda_host_cc in + [\\/]* | ?:[\\/]*) + ac_cv_path_cuda_host_cc="$cuda_host_cc" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_cuda_host_cc="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_cuda_host_cc" && ac_cv_path_cuda_host_cc="no" + ;; +esac ;; +esac +fi +cuda_host_cc=$ac_cv_path_cuda_host_cc +if test -n "$cuda_host_cc"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $cuda_host_cc" >&5 +printf '%s\n' "$cuda_host_cc" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + # note AC_CHECK_PROG always fails on path with spaces in MSW + if test "x${cuda_host_cc?}" != "xno" || test "${system?}" = Windows; then + CUDA_FLAGS="$CUDA_FLAGS -ccbin \"${cuda_host_cc}\"" + else + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "Binary ${with_cuda_host_compiler} given as cuda host compiler, yet not found! +See 'config.log' for more details" "$LINENO" 5; } + fi +else + with_cuda_host_compiler="default" +fi + +if test "x$FOUND_CUDA" = "xyes" ; then + HOST_CC_REPORT="$HOST_CC_REPORT, ${with_cuda_host_compiler})" +else + HOST_CC_REPORT="" +fi + + +if test "$FOUND_CUDA" = yes; then + +printf '%s\n' "#define HAVE_CUDA 1" >>confdefs.h + + OBJS="$OBJS src/cuda_wrapper.o" + if test $system != Windows; then + POST_COMPILE_MSG="$POST_COMPILE_MSG\n***\nYou have compiled in sort of CUDA code.\nIn order to use use it compression and \ +decompression, you will need to have CUDA libraries visible to your OS.\n\ +If not done so, you can accomplish this by adding line:\n\ + export LD_LIBRARY_PATH=$CUDA_LIB_PATH:\\\$\$LD_LIBRARY_PATH\n\ +to your .bashrc file (in home directory). To take effect immediatelly, you will need to enter:\n\ + exec bash\n***\n" + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking cl.exe supports -d2FH4-" >&5 +printf %s "checking cl.exe supports -d2FH4-... " >&6; } + tst=$(mktemp tst-cl-frame-pointer-XXXX.c) + if "$CL" -d2FH4- -c $tst >/dev/null 2>&1; then + CUDA_FLAGS="$CUDA_FLAGS -Xcompiler -d2FH4-" + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + fi + rm $tst + fi +fi + + +if { test "$cuda_req" != no && test "$cuda_req" != auto ;} && test "$FOUND_CUDA" = no; then + as_fn_error $? "CUDA not found" "$LINENO" 5; +fi + + + + + + + +# ------------------------------------------------------------------------------------------------- +# GL common +# ------------------------------------------------------------------------------------------------- +# Check whether --enable-gl was given. +if test ${enable_gl+y} +then : + enableval=$enable_gl; gl_req=$enableval +else case e in #( + e) gl_req=$build_default + ;; +esac +fi + +OPENGL=no +OPENGL_COMMON=no + +SAVED_LIBS=$LIBS +SAVED_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS -DGLEW_NO_GLU" +ac_fn_c_check_header_compile "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" +if test "x$ac_cv_header_GL_gl_h" = xyes +then : + +fi + +ac_fn_c_check_header_compile "$LINENO" "GL/glew.h" "ac_cv_header_GL_glew_h" "$ac_includes_default" +if test "x$ac_cv_header_GL_glew_h" = xyes +then : + +fi + +ac_fn_c_check_header_compile "$LINENO" "GL/glx.h" "ac_cv_header_GL_glx_h" "$ac_includes_default" +if test "x$ac_cv_header_GL_glx_h" = xyes +then : + +fi + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for glBindTexture in -lGL" >&5 +printf %s "checking for glBindTexture in -lGL... " >&6; } +if test ${ac_cv_lib_GL_glBindTexture+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lGL $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char glBindTexture (void); +int +main (void) +{ +return glBindTexture (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_GL_glBindTexture=yes +else case e in #( + e) ac_cv_lib_GL_glBindTexture=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glBindTexture" >&5 +printf '%s\n' "$ac_cv_lib_GL_glBindTexture" >&6; } +if test "x$ac_cv_lib_GL_glBindTexture" = xyes +then : + printf '%s\n' "#define HAVE_LIBGL 1" >>confdefs.h + + LIBS="-lGL $LIBS" + +fi + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for glXCreateNewContext in -lGL" >&5 +printf %s "checking for glXCreateNewContext in -lGL... " >&6; } +if test ${ac_cv_lib_GL_glXCreateNewContext+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lGL $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char glXCreateNewContext (void); +int +main (void) +{ +return glXCreateNewContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_GL_glXCreateNewContext=yes +else case e in #( + e) ac_cv_lib_GL_glXCreateNewContext=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glXCreateNewContext" >&5 +printf '%s\n' "$ac_cv_lib_GL_glXCreateNewContext" >&6; } +if test "x$ac_cv_lib_GL_glXCreateNewContext" = xyes +then : + printf '%s\n' "#define HAVE_LIBGL 1" >>confdefs.h + + LIBS="-lGL $LIBS" + +fi + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for glewInit in -lGLEW" >&5 +printf %s "checking for glewInit in -lGLEW... " >&6; } +if test ${ac_cv_lib_GLEW_glewInit+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lGLEW $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char glewInit (void); +int +main (void) +{ +return glewInit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_GLEW_glewInit=yes +else case e in #( + e) ac_cv_lib_GLEW_glewInit=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLEW_glewInit" >&5 +printf '%s\n' "$ac_cv_lib_GLEW_glewInit" >&6; } +if test "x$ac_cv_lib_GLEW_glewInit" = xyes +then : + printf '%s\n' "#define HAVE_LIBGLEW 1" >>confdefs.h + + LIBS="-lGLEW $LIBS" + +fi + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for glewInit in -lglew32" >&5 +printf %s "checking for glewInit in -lglew32... " >&6; } +if test ${ac_cv_lib_glew32_glewInit+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lglew32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char glewInit (void); +int +main (void) +{ +return glewInit (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_glew32_glewInit=yes +else case e in #( + e) ac_cv_lib_glew32_glewInit=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_glew32_glewInit" >&5 +printf '%s\n' "$ac_cv_lib_glew32_glewInit" >&6; } +if test "x$ac_cv_lib_glew32_glewInit" = xyes +then : + printf '%s\n' "#define HAVE_LIBGLEW32 1" >>confdefs.h + + LIBS="-lglew32 $LIBS" + +fi + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for XCreateWindow in -lX11" >&5 +printf %s "checking for XCreateWindow in -lX11... " >&6; } +if test ${ac_cv_lib_X11_XCreateWindow+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XCreateWindow (void); +int +main (void) +{ +return XCreateWindow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_X11_XCreateWindow=yes +else case e in #( + e) ac_cv_lib_X11_XCreateWindow=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XCreateWindow" >&5 +printf '%s\n' "$ac_cv_lib_X11_XCreateWindow" >&6; } +if test "x$ac_cv_lib_X11_XCreateWindow" = xyes +then : + printf '%s\n' "#define HAVE_LIBX11 1" >>confdefs.h + + LIBS="-lX11 $LIBS" + +fi + +LIBS=$SAVED_LIBS +CFLAGS=$SAVED_CFLAGS +HAVE_GL=no +HAVE_GLEW=no + +GL_COMMON_OBJ="src/gl_context.o" + +if test "${ac_cv_header_GL_gl_h?}" = yes && \ + test "${ac_cv_lib_GL_glBindTexture?}" = yes +then + HAVE_GL=yes +fi + +if test "${ac_cv_header_GL_glew_h?}" = yes && \ + { test "${ac_cv_lib_GLEW_glewInit?}" = yes || test "${ac_cv_lib_glew32_glewInit?}" = yes; } +then + HAVE_GLEW=yes +fi + +# Linux +if { test "$system" = Linux || test "$system" = other; } && \ + test "$HAVE_GL" = yes && \ + test "$HAVE_GLEW" = yes +then + OPENGL_LIB="-lGLEW -lGL" + OPENGL=yes + if test "$ac_cv_header_GL_glx_h" = yes && \ + test "$ac_cv_lib_GL_glXCreateNewContext" = yes && \ + test "$ac_cv_lib_X11_XCreateWindow" = yes + then + OPENGL_LIB="$OPENGL_LIB -lX11" + OPENGL_COMMON=yes + GL_COMMON_OBJ="$GL_COMMON_OBJ src/glx_common.o src/x11_common.o" + fi +fi + +# Mac +if test "$system" = MacOSX +then + OPENGL=yes + OPENGL_COMMON=yes + OPENGL_LIB="-framework Cocoa -framework OpenGL" + COMMON_FLAGS="$COMMON_FLAGS -DGL_SILENCE_DEPRECATION" + GL_COMMON_OBJ="$GL_COMMON_OBJ src/mac_gl_common.o" +fi + +# Win32 +if test "${system?}" = Windows && test "${HAVE_GLEW?}" = yes +then + OPENGL=yes + OPENGL_COMMON=yes + GL_COMMON_OBJ="$GL_COMMON_OBJ src/win32_gl_common.o" + OPENGL_LIB="-lopengl32 -lglew32 -lgdi32" +fi + +if test $gl_req = no; then + OPENGL=no + GL_COMMON_OBJ= + OPENGL_LIB= +fi + + +if { test "$gl_req" != no && test "$gl_req" != auto ;} && test "$OPENGL" = no; then + as_fn_error $? "OpenGL stuff requested but dependencies were not found." "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Do we have FireWire/DV support? + +case "$host_os" in +*freebsd*) + ac_fn_c_check_header_compile "$LINENO" "dev/firewire/firewire.h" "ac_cv_header_dev_firewire_firewire_h" "$ac_includes_default" +if test "x$ac_cv_header_dev_firewire_firewire_h" = xyes +then : + + +printf '%s\n' "#define HAVE_FIREWIRE_DV_FREEBSD 1" >>confdefs.h + + +fi + + ;; +esac + +# ------------------------------------------------------------------------------------------------- +# Try to find the SDK for the DVS cards +dvs=no +dvs_req=$build_default +# Check whether --enable-dvs was given. +if test ${enable_dvs+y} +then : + enableval=$enable_dvs; dvs_req=$enableval +fi + + +case "$system" in + MacOSX) + DVS_SDK_SUBDIR="universal" + ;; + Linux) + DVS_SDK_SUBDIR="linux-x86_64" + ;; + Windows) + DVS_SDK_SUBDIR="win32" + ;; +esac + +if test -n "$DVS_DIRECTORY" +then + DVS_HDR_PATH=$DVS_DIRECTORY/development/header + DVS_LIB=$DVS_DIRECTORY/${DVS_SDK_SUBDIR}/lib +else + DVS_HDR_PATH=sdk4.0.1.17/development/header + DVS_LIB=sdk4.0.1.17/${DVS_SDK_SUBDIR}/lib +fi + + +# Check whether --with-dvs was given. +if test ${with_dvs+y} +then : + withval=$with_dvs; DVS_HDR_PATH=$withval/development/header + DVS_LIB=$withval/${DVS_SDK_SUBDIR}/lib +fi + + +if test "$dvs_req" != no; then + SAVED_CFLAGS=$CFLAGS + SAVED_CPPFLAGS=$CPPFLAGS + CFLAGS="$CFLAGS -I${DVS_HDR_PATH}" + CPPFLAGS="$CPPFLAGS -I${DVS_HDR_PATH}" + ac_fn_c_check_header_compile "$LINENO" "dvs_clib.h" "ac_cv_header_dvs_clib_h" "$ac_includes_default" +if test "x$ac_cv_header_dvs_clib_h" = xyes +then : + FOUND_DVS_H=yes +else case e in #( + e) FOUND_DVS_H=no ;; +esac +fi + + CFLAGS=$SAVED_CFLAGS + CPPFLAGS=$SAVED_CPPFLAGS + + SAVED_LIBS=$LIBS + if test $system = MacOSX + then + LIBS="$LIBS -framework IOKit" + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for sv_open in -ldvsoem" >&5 +printf %s "checking for sv_open in -ldvsoem... " >&6; } +if test ${ac_cv_lib_dvsoem_sv_open+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-ldvsoem -L${DVS_LIB} $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char sv_open (void); +int +main (void) +{ +return sv_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dvsoem_sv_open=yes +else case e in #( + e) ac_cv_lib_dvsoem_sv_open=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dvsoem_sv_open" >&5 +printf '%s\n' "$ac_cv_lib_dvsoem_sv_open" >&6; } +if test "x$ac_cv_lib_dvsoem_sv_open" = xyes +then : + FOUND_DVS_L=yes +else case e in #( + e) FOUND_DVS_L=no ;; +esac +fi + + LIBS=$SAVED_LIBS + + if test $FOUND_DVS_H = yes && test $FOUND_DVS_L = yes + then + DVS_INC=-I${DVS_HDR_PATH} + DVS_LIB="-L${DVS_LIB} -ldvsoem" + if test $system = Linux; then + DVS_LIB="$DVS_LIB -ldl" + fi + DVS_CAP_OBJ="src/video_capture/dvs.o" + DVS_DISP_OBJ="src/video_display/dvs.o" + DVS_LIB="$DVS_LIB" + if test $system = MacOSX + then + DVS_LIB="$DVS_LIB -framework IOKit" + fi + add_module vidcap_dvs "$DVS_CAP_OBJ" "$DVS_LIB" + add_module display_dvs "$DVS_DISP_OBJ" "$DVS_LIB" + INC="$INC $DVS_INC" + dvs=yes + fi +fi + + +if { test "$dvs_req" != no && test "$dvs_req" != auto ;} && test "$dvs" = no; then + as_fn_error $? "DVS not found." "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Blackmagic stuff + +decklink=no + +# Check whether --enable-decklink was given. +if test ${enable_decklink+y} +then : + enableval=$enable_decklink; decklink_req=$enableval +else case e in #( + e) decklink_req=$build_default + ;; +esac +fi + +DECKLINK_INC=$srcdir/ext-deps/DeckLink + +if test $decklink_req != no; then + case "$system" in + MacOSX) + DECKLINK_INC=$DECKLINK_INC/Mac + OLD_LIBS=$LIBS + LIBS="$LIBS -framework CoreFoundation" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include "$DECKLINK_INC/DeckLinkAPI.h" + +int +main (void) +{ +IDeckLinkIterator *deckLinkIter = CreateDeckLinkIteratorInstance(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + FOUND_DECKLINK=yes +else case e in #( + e) FOUND_DECKLINK=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + LIBS=$OLD_LIBS + if test $FOUND_DECKLINK = yes; then + DECKLINK_LIB="-framework CoreFoundation" + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ;; + Windows) + DECKLINK_INC=$DECKLINK_INC/Windows + SAVED_LIBS=$LIBS + LIBS="$LIBS -lole32" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking DeckLink usability" >&5 +printf %s "checking DeckLink usability... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include "$DECKLINK_INC/DeckLinkAPI.h" + #include "$DECKLINK_INC/DeckLinkAPIVersion.h" + #include + +int +main (void) +{ +IDeckLinkIterator *deckLinkIter; CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL, IID_IDeckLinkIterator, (void **) deckLinkIter); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + FOUND_DECKLINK=yes +else case e in #( + e) FOUND_DECKLINK=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + LIBS=$SAVED_LIBS + if test $FOUND_DECKLINK = yes; then + DECKLINK_LIB="-lole32" + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $FOUND_DECKLINK" >&5 +printf '%s\n' "$FOUND_DECKLINK" >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ;; + Linux) + DECKLINK_INC=$DECKLINK_INC/Linux + + as_ac_File=`printf '%s\n' "ac_cv_file_${DECKLINK_INC}/DeckLinkAPI.h" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for ${DECKLINK_INC}/DeckLinkAPI.h" >&5 +printf %s "checking for ${DECKLINK_INC}/DeckLinkAPI.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${DECKLINK_INC}/DeckLinkAPI.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi ;; +esac +fi +eval ac_res=\$$as_ac_File + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + FOUND_DECKLINK_H=yes +else case e in #( + e) FOUND_DECKLINK_H=no ;; +esac +fi + + as_ac_File=`printf '%s\n' "ac_cv_file_${DECKLINK_INC}/DeckLinkAPIDispatch.cpp" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for ${DECKLINK_INC}/DeckLinkAPIDispatch.cpp" >&5 +printf %s "checking for ${DECKLINK_INC}/DeckLinkAPIDispatch.cpp... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${DECKLINK_INC}/DeckLinkAPIDispatch.cpp"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi ;; +esac +fi +eval ac_res=\$$as_ac_File + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + FOUND_DECKLINK_SRC=yes +else case e in #( + e) FOUND_DECKLINK_SRC=no ;; +esac +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lDeckLinkAPI" >&5 +printf %s "checking for main in -lDeckLinkAPI... " >&6; } +if test ${ac_cv_lib_DeckLinkAPI_main+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lDeckLinkAPI $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_DeckLinkAPI_main=yes +else case e in #( + e) ac_cv_lib_DeckLinkAPI_main=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_DeckLinkAPI_main" >&5 +printf '%s\n' "$ac_cv_lib_DeckLinkAPI_main" >&6; } +if test "x$ac_cv_lib_DeckLinkAPI_main" = xyes +then : + FOUND_DECKLINK_L=yes +else case e in #( + e) FOUND_DECKLINK_L=no ;; +esac +fi + + #if test $FOUND_DECKLINK_H = yes -a $FOUND_DECKLINK_SRC = yes -a $FOUND_DECKLINK_L = yes; then + if test "${FOUND_DECKLINK_H?}" = yes && test "${FOUND_DECKLINK_SRC?}" = yes; then + FOUND_DECKLINK=yes + DECKLINK_LIB="-ldl" + else + FOUND_DECKLINK=no + fi + ;; + esac + if test "$FOUND_DECKLINK" = yes; then + DECKLINK_PATH=${DECKLINK_INC} + + DECKLINK_INC=-I${DECKLINK_INC} + DECKLINK_CAP_OBJ="src/blackmagic_common.o src/video_capture/decklink.o" + DECKLINK_DISP_OBJ="src/blackmagic_common.o src/video_display/decklink.o" + DECKLINK_SOUND_PLAY_OBJ="src/blackmagic_common.o src/audio/playback/decklink.o" + if test $system = "Windows"; then + DECK_COMMON_OBJS="$OBJS src/video_capture/DeckLinkAPI_i.o" + else + DECK_COMMON_OBJS="$OBJS src/video_capture/DeckLinkAPIDispatch.o" + fi + add_module vidcap_decklink "$DECK_COMMON_OBJS $DECKLINK_CAP_OBJ" "$DECKLINK_LIB" + add_module display_decklink "$DECK_COMMON_OBJS $DECKLINK_DISP_OBJ" "$DECKLINK_LIB" + add_module aplay_decklink "$DECK_COMMON_OBJS $DECKLINK_SOUND_PLAY_OBJ" "$DECKLINK_LIB" + decklink=yes + INC="$INC $DECKLINK_INC" + fi +fi + + +if { test "$decklink_req" != no && test "$decklink_req" != auto ;} && test "$decklink" = no; then + as_fn_error $? "DeckLink not found." "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Bluefish444 stuff +# ------------------------------------------------------------------------------------------------- +BLUEFISH444_INC= +BLUEFISH444_LIB= +bluefish444=no +blue_audio=no + +# Check whether --enable-bluefish444 was given. +if test ${enable_bluefish444+y} +then : + enableval=$enable_bluefish444; bluefish444_req=$enableval +else case e in #( + e) bluefish444_req=$build_default + ;; +esac +fi + + +BLUEFISH444_PATH=$BLUE_LATEST_SDK + + +# Check whether --with-bluefish444 was given. +if test ${with_bluefish444+y} +then : + withval=$with_bluefish444; BLUEFISH444_PATH=$withval + +fi + + + +SAVED_LIBS=$LIBS +SAVED_CXXFLAGS=$CXXFLAGS +SAVED_CPPFLAGS_SAVE=$CPPFLAGS +if test -n "$BLUEFISH444_PATH"; then + if test $system = Linux; then + BLUEFISH444_INC="-I$BLUEFISH444_PATH/build/inc" + BLUEFISH444_LIB="-L$BLUEFISH444_PATH/build/lib" + elif test $system = Windows; then + BLUEFISH444_INC="-I$BLUEFISH444_PATH/inc" + BLUEFISH444_LIB="-L$BLUEFISH444_PATH/lib/win" + fi +fi + +if test $WORD_LEN -eq 64; then + BLUEFISH444_LIB_NAME=BlueVelvetC64 +else + BLUEFISH444_LIB_NAME=BlueVelvetC +fi + +if test "$bluefish444_req" != no; then + BLUE_L=no + BLUE_H=no + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + CPPFLAGS="$CPPFLAGS $BLUEFISH444_INC" + CXXFLAGS="$CXXFLAGS $BLUEFISH444_INC" + LIBS="$LIBS $BLUEFISH444_LIB" + for ac_header in BlueVelvetC.h +do : + ac_fn_cxx_check_header_compile "$LINENO" "BlueVelvetC.h" "ac_cv_header_BlueVelvetC_h" "$ac_includes_default" +if test "x$ac_cv_header_BlueVelvetC_h" = xyes +then : + printf '%s\n' "#define HAVE_BLUEVELVETC_H 1" >>confdefs.h + BLUE_H=yes +else case e in #( + e) BLUE_H=no ;; +esac +fi + +done + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$BLUEFISH444_LIB_NAME""_bfcFactory" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for bfcFactory in -l$BLUEFISH444_LIB_NAME" >&5 +printf %s "checking for bfcFactory in -l$BLUEFISH444_LIB_NAME... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-l$BLUEFISH444_LIB_NAME $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int bfcFactory (); +} +int +main (void) +{ +return conftest::bfcFactory (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else case e in #( + e) eval "$as_ac_Lib=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +eval ac_res=\$$as_ac_Lib + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + BLUE_L=yes +else case e in #( + e) BLUE_L=no ;; +esac +fi + + + if test "${BLUE_H?}" = yes && test "${BLUE_L?}" = yes + then + BLUEFISH444_LIB="$BLUEFISH444_LIB -l$BLUEFISH444_LIB_NAME" + add_module vidcap_bluefish444 src/video_capture/bluefish444.o "$BLUEFISH444_LIB" + add_module display_bluefish444 src/video_display/bluefish444.o "$BLUEFISH444_LIB" + INC="$INC $BLUEFISH444_INC" + bluefish444=yes + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + LIBS=$SAVED_LIBS + CXXFLAGS=$SAVED_CXXFLAGS + CPPFLAGS=$SAVED_CPPFLAGS_SAVE +fi + + +if { test "$bluefish444_req" != no && test "$bluefish444_req" != auto ;} && test "$bluefish444" = no; then + as_fn_error $? "Bluefish444 not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# AJA stuff +# ------------------------------------------------------------------------------------------------- +AJA_PATH= +aja=no + +# Check whether --enable-aja was given. +if test ${enable_aja+y} +then : + enableval=$enable_aja; aja_req=$enableval +else case e in #( + e) aja_req=$build_default ;; +esac +fi + + +if test -n "$NTV2_ROOT"; then + AJA_PATH=$NTV2_ROOT/.. +fi + +if test -n "$AJA_DIRECTORY"; then + AJA_PATH=$AJA_DIRECTORY +fi + +if test -z "$AJA_PATH"; then + if test -d /usr/local/include/libajantv2; then + AJA_PATH=/usr/local/include/libajantv2 + # libajantv2 AUR + elif test -d /usr/include/libajantv2; then + AJA_PATH=/usr/include/libajantv2 + fi +fi + + +# Check whether --with-aja was given. +if test ${with_aja+y} +then : + withval=$with_aja; AJA_PATH=$withval + +fi + + +if test "$aja_req" != no; then + if test $system != Windows; then + AJA_LIB=ajantv2 + platform=lin + if test "$system" = MacOSX; then + platform=mac + fi + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$AJA_LIB""_main" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -l$AJA_LIB" >&5 +printf %s "checking for main in -l$AJA_LIB... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-l$AJA_LIB $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else case e in #( + e) eval "$as_ac_Lib=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +eval ac_res=\$$as_ac_Lib + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + aja=yes +else case e in #( + e) aja=no ;; +esac +fi + + if test "$aja" = yes; then + # we need to have the headers path, anyways (see 30 lines below) + if ! test -d "$AJA_PATH"; then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: libajantv2 found, but \$AJA_DIRECTORY still needs to point to headers root" >&5 +printf '%s\n' "$as_me: WARNING: libajantv2 found, but \$AJA_DIRECTORY still needs to point to headers root" >&2;} + WARNINGS="${WARNINGS}libajantv2 found, but \$AJA_DIRECTORY still needs to point to headers root\n" + + aja=no + fi + AJA_LIB=-l$AJA_LIB + fi + else # Windows + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for display_aja_probe in -laja" >&5 +printf %s "checking for display_aja_probe in -laja... " >&6; } +if test ${ac_cv_lib_aja_display_aja_probe+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-laja $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char display_aja_probe (void); +int +main (void) +{ +return display_aja_probe (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_aja_display_aja_probe=yes +else case e in #( + e) ac_cv_lib_aja_display_aja_probe=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aja_display_aja_probe" >&5 +printf '%s\n' "$ac_cv_lib_aja_display_aja_probe" >&6; } +if test "x$ac_cv_lib_aja_display_aja_probe" = xyes +then : + aja=yes +else case e in #( + e) aja=no ;; +esac +fi + + fi + + if test "${aja?}" = yes && test "${system?}" = Windows; then + add_module aja src/aja_win32_stub.o -laja + elif test $aja = yes; then # Linux and macOS + AJA_INC="$AJA_INC -I$AJA_PATH -I$AJA_PATH/ajantv2/\ +includes -I$AJA_PATH/ajantv2/src/$platform" + if test $system = Linux; then + AJA_CXXFLAGS="-DAJALinux -DAJA_LINUX" + AJA_LIB="$AJA_LIB -lrt" + else # mac + AJA_CXXFLAGS="-DAJAMac -DAJA_MAC" + AJA_LIB="$AJA_LIB -framework IOKit" + fi + + add_module aja "src/aja_common.o src/video_capture/aja.o src/video_display/aja.o" "$AJA_LIB" + INC="$INC $AJA_INC" + CXXFLAGS="$CXXFLAGS $AJA_CXXFLAGS" + fi +fi + + +if { test "$aja_req" != no && test "$aja_req" != auto ;} && test "$aja" = no; then + as_fn_error $? "AJA not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# holepunch stuff + +libjuice=no + +# Check whether --enable-holepunch was given. +if test ${enable_holepunch+y} +then : + enableval=$enable_holepunch; libjuice_req=$enableval +else case e in #( + e) libjuice_req=$build_default ;; +esac +fi + + +if test "$libjuice_req" != no; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for juice_create in -ljuice" >&5 +printf %s "checking for juice_create in -ljuice... " >&6; } +if test ${ac_cv_lib_juice_juice_create+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-ljuice $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char juice_create (void); +int +main (void) +{ +return juice_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_juice_juice_create=yes +else case e in #( + e) ac_cv_lib_juice_juice_create=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_juice_juice_create" >&5 +printf '%s\n' "$ac_cv_lib_juice_juice_create" >&6; } +if test "x$ac_cv_lib_juice_juice_create" = xyes +then : + FOUND_LIBJUICE=yes +else case e in #( + e) FOUND_LIBJUICE=no ;; +esac +fi + + LIBJUICE_LIB="-ljuice" + + if test "$FOUND_LIBJUICE" = yes + then + libjuice=yes + add_module holepunch src/utils/udp_holepunch.o "$LIBJUICE_LIB" + COMMON_FLAGS="$COMMON_FLAGS -DHAVE_LIBJUICE" + fi +fi + + +if { test "$libjuice_req" != no && test "$libjuice_req" != auto ;} && test "$libjuice" = no; then + as_fn_error $? "LIBJUICE not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# DELTACAST stuff + +deltacast=no +deltacast_found=no + +# Check whether --enable-deltacast was given. +if test ${enable_deltacast+y} +then : + enableval=$enable_deltacast; deltacast_req=$enableval +else case e in #( + e) deltacast_req=$build_default + ;; +esac +fi + +DELTACAST_PATH=$DELTACAST_DIRECTORY + + +# Check whether --with-deltacast was given. +if test ${with_deltacast+y} +then : + withval=$with_deltacast; DELTACAST_PATH=$withval + +fi + + +if test "$deltacast_req" != no; then + if test "$system" = Linux || test "$system" = Windows; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + if test -n "$DELTACAST_PATH"; then + DELTA_INC="-I$DELTACAST_PATH/Include\ + -I$DELTACAST_PATH/include/videomaster" + CXXFLAGS_SAVE=$CXXFLAGS + CXXFLAGS="$CXXFLAGS ${DELTA_INC?}" + CPPFLAGS_SAVE=$CPPFLAGS + CPPFLAGS="$CPPFLAGS ${DELTA_INC?}" + fi + + if test $system = Windows; then + EXTRA_HEADERS="#include " + else + EXTRA_HEADERS= + fi + + ac_fn_cxx_check_header_compile "$LINENO" "VideoMasterHD_Core.h" "ac_cv_header_VideoMasterHD_Core_h" "$EXTRA_HEADERS + #ifdef HAVE_VIDEOMASTERHD_CORE_H + # include + #endif + #ifdef HAVE_VIDEOMASTERHD_SDI_H + # include + #endif + +" +if test "x$ac_cv_header_VideoMasterHD_Core_h" = xyes +then : + printf '%s\n' "#define HAVE_VIDEOMASTERHD_CORE_H 1" >>confdefs.h + +fi +ac_fn_cxx_check_header_compile "$LINENO" "VideoMasterHD_Sdi.h" "ac_cv_header_VideoMasterHD_Sdi_h" "$EXTRA_HEADERS + #ifdef HAVE_VIDEOMASTERHD_CORE_H + # include + #endif + #ifdef HAVE_VIDEOMASTERHD_SDI_H + # include + #endif + +" +if test "x$ac_cv_header_VideoMasterHD_Sdi_h" = xyes +then : + printf '%s\n' "#define HAVE_VIDEOMASTERHD_SDI_H 1" >>confdefs.h + +fi +ac_fn_cxx_check_header_compile "$LINENO" "VideoMasterHD_Sdi_Audio.h" "ac_cv_header_VideoMasterHD_Sdi_Audio_h" "$EXTRA_HEADERS + #ifdef HAVE_VIDEOMASTERHD_CORE_H + # include + #endif + #ifdef HAVE_VIDEOMASTERHD_SDI_H + # include + #endif + +" +if test "x$ac_cv_header_VideoMasterHD_Sdi_Audio_h" = xyes +then : + printf '%s\n' "#define HAVE_VIDEOMASTERHD_SDI_AUDIO_H 1" >>confdefs.h + +fi + + + SAVED_LIBS=$LIBS + DELTACAST_LIB="-lvideomasterhd_audio -lvideomasterhd" + if test -n "$DELTACAST_PATH"; then + if test "${ac_cv_sizeof_int_p?}" -eq 8 && + test "${system?}" = Linux; then + DELTACAST_LIB="$DELTACAST_LIB -L$DELTACAST_PATH/Library/x64" + else + DELTACAST_LIB="$DELTACAST_LIB -L$DELTACAST_PATH/Library/x86" + fi + fi + LIBS="$LIBS $DELTACAST_LIB" + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking DELTACAST library presence" >&5 +printf %s "checking DELTACAST library presence... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$EXTRA_HEADERS + # include + # include + # include + +int +main (void) +{ + + VHD_OpenBoardHandle(0, (void **) 0, (void *) 0, 0); + VHD_SlotExtractAudio(0, 0); + VHD_LockSlotHandle(0, 0); + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + FOUND_VHD_L=yes +else case e in #( + e) FOUND_VHD_L=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + #AC_CHECK_LIB(videomasterhd_audio, VHD_GetNbSamples, [], [], [-lvideomasterhd]) + LIBS=$SAVED_LIBS + if test -n "$DELTACAST_PATH"; then + CXXFLAGS=$CXXFLAGS_SAVE + CPPFLAGS=$CPPFLAGS_SAVE + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $FOUND_VHD_L" >&5 +printf '%s\n' "$FOUND_VHD_L" >&6; } + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + if test "${ac_cv_header_VideoMasterHD_Core_h?}" = yes && + test "${ac_cv_header_VideoMasterHD_Sdi_h?}" = yes && + test "${ac_cv_header_VideoMasterHD_Sdi_Audio_h?}" = yes && + test "${FOUND_VHD_L?}" = yes; then + deltacast_found=yes + fi + else # OS X + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking if -framework VideoMasterHD works" >&5 +printf %s "checking if -framework VideoMasterHD works... " >&6; } +if test ${my_cv_framework_VideoMasterHD+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) save_LIBS="$LIBS" + LIBS="$LIBS -framework VideoMasterHD" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + my_cv_framework_VideoMasterHD=yes +else case e in #( + e) my_cv_framework_VideoMasterHD=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $my_cv_framework_VideoMasterHD" >&5 +printf '%s\n' "$my_cv_framework_VideoMasterHD" >&6; } + LIBS="$save_LIBS" + if test "$my_cv_framework_VideoMasterHD"="yes"; then + +printf '%s\n' "#define HAVE_FRAMEWORK_VIDEOMASTERHD 1" >>confdefs.h + + FRAMEWORK_VIDEOMASTERHD="-framework VideoMasterHD" + + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking if -framework VideoMasterHD_Audio works" >&5 +printf %s "checking if -framework VideoMasterHD_Audio works... " >&6; } +if test ${my_cv_framework_VideoMasterHD_Audio+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) save_LIBS="$LIBS" + LIBS="$LIBS -framework VideoMasterHD_Audio" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + my_cv_framework_VideoMasterHD_Audio=yes +else case e in #( + e) my_cv_framework_VideoMasterHD_Audio=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $my_cv_framework_VideoMasterHD_Audio" >&5 +printf '%s\n' "$my_cv_framework_VideoMasterHD_Audio" >&6; } + LIBS="$save_LIBS" + if test "$my_cv_framework_VideoMasterHD_Audio"="yes"; then + +printf '%s\n' "#define HAVE_FRAMEWORK_VIDEOMASTERHD_AUDIO 1" >>confdefs.h + + FRAMEWORK_VIDEOMASTERHD_AUDIO="-framework VideoMasterHD_Audio" + + fi + ac_fn_c_check_header_compile "$LINENO" "VideoMasterHD/VideoMasterHD_Core.h" "ac_cv_header_VideoMasterHD_VideoMasterHD_Core_h" "$ac_includes_default" +if test "x$ac_cv_header_VideoMasterHD_VideoMasterHD_Core_h" = xyes +then : + printf '%s\n' "#define HAVE_VIDEOMASTERHD_VIDEOMASTERHD_CORE_H 1" >>confdefs.h + +fi + + if test "${ac_cv_header_VideoMasterHD_VideoMasterHD_Core_h?}" = yes && + test "${my_cv_framework_VideoMasterHD?}" = yes && + test "${my_cv_framework_VideoMasterHD?}" = yes; then + deltacast_found=yes + DELTACAST_LIB="$FRAMEWORK_VIDEOMASTERHD $FRAMEWORK_VIDEOMASTERHD_AUDIO" + fi + fi + if test "$deltacast_found" = yes; then + INC="$INC${DELTA_INC:+ $DELTA_INC}" + add_module vidcap_deltacast "src/deltacast_common.o \ +src/video_capture/deltacast.o src/video_capture/deltacast_dvi.o" "$DELTACAST_LIB" + add_module display_deltacast "src/deltacast_common.o \ +src/video_display/deltacast.o" "$DELTACAST_LIB" + deltacast=yes + fi +fi + + +if { test "$deltacast_req" != no && test "$deltacast_req" != auto ;} && test "$deltacast" = no; then + as_fn_error $? "Deltacast not found" "$LINENO" 5; +fi + + +#---------------------------------------------------------------------- +# XIMEA +# --------------------------------------------------------------------- +# Check whether --enable-ximea was given. +if test ${enable_ximea+y} +then : + enableval=$enable_ximea; ximea_req=$enableval +else case e in #( + e) ximea_req=$build_default + ;; +esac +fi + + +# Check whether --enable-ximea-runtime-linking was given. +if test ${enable_ximea_runtime_linking+y} +then : + enableval=$enable_ximea_runtime_linking; ximea_link_runtime=$enableval +else case e in #( + e) ximea_link_runtime=yes + ;; +esac +fi + +ximea=no + +if test $system = MacOSX; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking if -framework m3api works" >&5 +printf %s "checking if -framework m3api works... " >&6; } +if test ${my_cv_framework_m3api+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) save_LIBS="$LIBS" + LIBS="$LIBS -framework m3api" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + my_cv_framework_m3api=yes +else case e in #( + e) my_cv_framework_m3api=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $my_cv_framework_m3api" >&5 +printf '%s\n' "$my_cv_framework_m3api" >&6; } + LIBS="$save_LIBS" + if test "$my_cv_framework_m3api"="yes"; then + +printf '%s\n' "#define HAVE_FRAMEWORK_M3API 1" >>confdefs.h + + FRAMEWORK_M3API="-framework m3api" + + fi + if test $my_cv_framework_m3api = yes; then + if test $ximea_link_runtime = no; then + XIMEA_LIBS=$FRAMEWORK_M3API + fi + ximea=yes + fi + if test -z "$GENICAM_GENTL64_PATH"; then + GENICAM_GENTL64_PATH="/Library/Frameworks/m3api.framework" + fi + XI_LIB_NAME="m3api" +else + if test $system = Linux; then + XIAPI_PATH=${GENICAM_GENTL64_PATH:-/opt/XIMEA/lib} + XI_LIB_EXT=".so" + XI_LIB_NAME="m3api" + XI_LIB_PREF="lib" + XIMEA_CFLAGS="-I$XIAPI_PATH/../include" + else + if test -d "$GENICAM_GENTL64_PATH/../../API/xiAPI"; then + # the env var contains actually something like "C:\XIMEA\GenTL Producer\64bit" + XIAPI_PATH=$(realpath "$GENICAM_GENTL64_PATH/../../API/xiAPI") + else + XIAPI_PATH="C:/XIMEA/API/xiAPI" + fi + XI_LIB_EXT=".dll" + XI_LIB_NAME="xiapi64" + XIMEA_CFLAGS="-I$XIAPI_PATH" + fi + SAVED_CFLAGS=$CFLAGS + SAVED_CPPFLAGS=$CPPFLAGS + CFLAGS="$CFLAGS $XIMEA_CFLAGS" + CPPFLAGS="$CPPFLAGS $XIMEA_CFLAGS" + ac_fn_c_check_header_compile "$LINENO" "xiApi.h" "ac_cv_header_xiApi_h" "$ac_includes_default" +if test "x$ac_cv_header_xiApi_h" = xyes +then : + printf '%s\n' "#define HAVE_XIAPI_H 1" >>confdefs.h + +fi + + CFLAGS=$SAVED_CFLAGS + + if test $ximea_link_runtime = no; then + XIMEA_LIBS="-L$XIAPI_PATH" + SAVED_LIBS=$LIBS + LIBS="$LIBS $XIMEA_LIBS" + CPPFLAGS=$SAVED_CPPFLAGS + as_ac_Lib=`printf '%s\n' "ac_cv_lib_$XI_LIB_NAME""_xiGetImage" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for xiGetImage in -l$XI_LIB_NAME" >&5 +printf %s "checking for xiGetImage in -l$XI_LIB_NAME... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-l$XI_LIB_NAME $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char xiGetImage (void); +int +main (void) +{ +return xiGetImage (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_ac_Lib=yes" +else case e in #( + e) eval "$as_ac_Lib=no" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +eval ac_res=\$$as_ac_Lib + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + HAVE_XI_L=yes +else case e in #( + e) HAVE_XI_L=no ;; +esac +fi + + XIMEA_LIBS="-l$XI_LIB_NAME -L$XIAPI_PATH" + LIBS=$SAVED_LIBS + else + HAVE_XI_L=yes + fi + + if test "${ximea_req?}" != no && test "${HAVE_XI_L?}" = yes && + test "${ac_cv_header_xiApi_h?}" = yes; then + ximea=yes + fi +fi + +if test "${ximea?}" = yes && test "${ximea_link_runtime?}" = yes; then + +printf '%s\n' "#define XIMEA_RUNTIME_LINKING 1" >>confdefs.h + + +printf '%s\n' "#define XIMEA_LIBRARY_NAME \"$XI_LIB_PREF$XI_LIB_NAME$XI_LIB_EXT\"" >>confdefs.h + + +printf '%s\n' "#define XIMEA_LIBRARY_PATH \"$GENICAM_GENTL64_PATH\"" >>confdefs.h + +fi + +if test $ximea = yes; then + CFLAGS="$CFLAGS $XIMEA_CFLAGS" + add_module vidcap_ximea src/video_capture/ximea.o "$XIMEA_LIBS" +fi + + +if { test "$ximea_req" != no && test "$ximea_req" != auto ;} && test "$ximea" = no; then + as_fn_error $? "XIMEA SDK not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# AV Foundation capture +# ------------------------------------------------------------------------------------------------- +avfoundation=no +# Check whether --enable-avfoundation was given. +if test ${enable_avfoundation+y} +then : + enableval=$enable_avfoundation; avfoundation_req=$enableval +else case e in #( + e) avfoundation_req=auto + ;; +esac +fi + + +if test "${system?}" = MacOSX && test "${avfoundation_req?}" != no +then + AVFOUNDATION_LIB="-framework AppKit -framework AVFoundation -framework CoreMedia -framework CoreVideo" + AVFOUNDATION_OBJ="src/video_capture/avfoundation.o" + add_module "" "$AVFOUNDATION_OBJ" "$AVFOUNDATION_LIB" + avfoundation=yes +fi + + +if { test "${avfoundation_req?}" != no && test "${avfoundation_req?}" != auto ;} && test "${avfoundation?}" = no; then + as_fn_error $? "AV Foundation not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------ +# SDL1/2/3 Stuff +# ------------------------------------------------------------------------------ +sdl=no +sdl_version= +sdl_version_str= +sdl_ver_suffix= +# Check whether --enable-sdl was given. +if test ${enable_sdl+y} +then : + enableval=$enable_sdl; sdl_req=$enableval +else case e in #( + e) sdl_req=$build_default + ;; +esac +fi + + +if test "$sdl_req" != no; then + sdl_req_ver=$sdl_req + sdl2_pc_path=$("$PKG_CONFIG" --path sdl2 2>/dev/null) + if "$PKG_CONFIG" --print-provides sdl2 | grep -q sdl2_compat || + { test -f "$sdl2_pc_path" && + grep -q sdl2_compat -- "$sdl2_pc_path"; } || + "$PKG_CONFIG" --debug sdl2 2>&1 | grep -q sdl2_compat + then + sdl2_is_compat=yes + fi + if test "$sdl_req" = yes || test "$sdl_req" = auto; then + sdl_req_ver=321 + fi + + while test -n "$sdl_req_ver"; do + ver=$(echo "$sdl_req_ver" | cut -c1) + case "$ver" in + 1) +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for sdl" >&5 +printf %s "checking for sdl... " >&6; } + +if test -n "$SDL_CFLAGS"; then + pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SDL_LIBS"; then + pkg_cv_SDL_LIBS="$SDL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl" 2>&1` + else + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_PKG_ERRORS" >&5 + + +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +else + SDL_CFLAGS=$pkg_cv_SDL_CFLAGS + SDL_LIBS=$pkg_cv_SDL_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + sdl_version=1 +fi ;; + 2) +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for sdl2" >&5 +printf %s "checking for sdl2... " >&6; } + +if test -n "$SDL_CFLAGS"; then + pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl2") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SDL_LIBS"; then + pkg_cv_SDL_LIBS="$SDL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl2") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl2" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl2" 2>&1` + else + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_PKG_ERRORS" >&5 + + +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +else + SDL_CFLAGS=$pkg_cv_SDL_CFLAGS + SDL_LIBS=$pkg_cv_SDL_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + sdl_version=2 +fi ;; + 3) +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for sdl3 >= 3.2.0" >&5 +printf %s "checking for sdl3 >= 3.2.0... " >&6; } + +if test -n "$SDL_CFLAGS"; then + pkg_cv_SDL_CFLAGS="$SDL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= 3.2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl3 >= 3.2.0") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl3 >= 3.2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SDL_LIBS"; then + pkg_cv_SDL_LIBS="$SDL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl3 >= 3.2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl3 >= 3.2.0") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl3 >= 3.2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl3 >= 3.2.0" 2>&1` + else + SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl3 >= 3.2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_PKG_ERRORS" >&5 + + +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +else + SDL_CFLAGS=$pkg_cv_SDL_CFLAGS + SDL_LIBS=$pkg_cv_SDL_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + sdl_version=3 +fi ;; + esac + if test -n "$sdl_version"; then + break + fi + sdl_req_ver=$(printf "$sdl_req_ver" | cut -c2-) + done + + if test "$sdl_version" = 2 && test "$sdl2_is_compat" ; then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Using SDL3 sdl2_compat, which is not recommended (use 3 directly)" >&5 +printf '%s\n' "$as_me: WARNING: Using SDL3 sdl2_compat, which is not recommended (use 3 directly)" >&2;} + WARNINGS="${WARNINGS}Using SDL3 sdl2_compat, which is not recommended (use 3 directly)\n" + + fi + if test -n "$sdl_version"; then + if test "$sdl_version" = 1; then + SDL_LIBS="$SDL_LIBS -lX11" # X11 for x11_common.o + else + sdl_ver_suffix=$sdl_version + fi + if test "$sdl_version" -eq 3; then + +printf '%s\n' "#define HAVE_SDL3 1" >>confdefs.h + + fi + SDL_OBJ="src/video_display/sdl${sdl_ver_suffix}.o" + INC="$INC $($PKG_CONFIG --cflags-only-I sdl${sdl_ver_suffix})" + SDL_LIBS=$(remove_mwindows "$SDL_LIBS") + add_module display_sdl "$SDL_OBJ" "$SDL_LIBS" + sdl_version_str=" (ver. $sdl_version)" + sdl=yes + fi +fi + +sdl_version=${sdl_version:-0} + + +if { test "$sdl_req" != no && test "$sdl_req" != auto ;} && test "$sdl" = no; then + as_fn_error $? "SDL requested but not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------ +# Vulkan +# ------------------------------------------------------------------------------ +vulkan=no + +# Check whether --enable-vulkan was given. +if test ${enable_vulkan+y} +then : + enableval=$enable_vulkan; vulkan_req=$enableval +else case e in #( + e) vulkan_req=$build_default + ;; +esac +fi + + +if test "$vulkan_req" != no; then + if test "$vulkan_req" != nomoltenvk; then + SAVED_LIBS=$LIBS + VULKAN_LIBS=-lMoltenVK # mac MoltenVK + LIBS="$LIBS $VULKAN_LIBS" + + for ac_func in vkCreateImage +do : + ac_fn_c_check_func "$LINENO" "vkCreateImage" "ac_cv_func_vkCreateImage" +if test "x$ac_cv_func_vkCreateImage" = xyes +then : + printf '%s\n' "#define HAVE_VKCREATEIMAGE 1" >>confdefs.h + found_vulkan=yes +else case e in #( + e) found_vulkan=no ;; +esac +fi + +done + LIBS=$SAVED_LIBS + fi + if test "$found_vulkan" != yes; then + VULKAN_LIBS= + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for vulkan >= 1.1.101" >&5 +printf %s "checking for vulkan >= 1.1.101... " >&6; } + +if test -n "$VULKAN_CFLAGS"; then + pkg_cv_VULKAN_CFLAGS="$VULKAN_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vulkan >= 1.1.101\""; } >&5 + ($PKG_CONFIG --exists --print-errors "vulkan >= 1.1.101") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_VULKAN_CFLAGS=`$PKG_CONFIG --cflags "vulkan >= 1.1.101" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$VULKAN_LIBS"; then + pkg_cv_VULKAN_LIBS="$VULKAN_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vulkan >= 1.1.101\""; } >&5 + ($PKG_CONFIG --exists --print-errors "vulkan >= 1.1.101") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_VULKAN_LIBS=`$PKG_CONFIG --libs "vulkan >= 1.1.101" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + VULKAN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "vulkan >= 1.1.101" 2>&1` + else + VULKAN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "vulkan >= 1.1.101" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$VULKAN_PKG_ERRORS" >&5 + + found_vulkan=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_vulkan=no +else + VULKAN_CFLAGS=$pkg_cv_VULKAN_CFLAGS + VULKAN_LIBS=$pkg_cv_VULKAN_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_vulkan=yes +fi + fi + for ac_header in vulkan/vulkan.h +do : + ac_fn_c_check_header_compile "$LINENO" "vulkan/vulkan.h" "ac_cv_header_vulkan_vulkan_h" "$ac_includes_default" +if test "x$ac_cv_header_vulkan_vulkan_h" = xyes +then : + printf '%s\n' "#define HAVE_VULKAN_VULKAN_H 1" >>confdefs.h + +else case e in #( + e) found_vulkan=no ;; +esac +fi + +done + + if test $sdl = yes && test $sdl_version -ge 2 && test $found_vulkan = yes; then + VULKAN_OBJ="src/video_display/vulkan/vulkan_sdl$sdl_version.o \ + src/video_display/vulkan/vulkan_display.o \ + src/video_display/vulkan/vulkan_context.o \ + src/video_display/vulkan/vulkan_transfer_image.o \ + src/video_display/vulkan/vulkan_pipelines.o" + VULKAN_LIBS="$VULKAN_LIBS $SDL_LIBS" + add_module display_vulkan "$VULKAN_OBJ" "$VULKAN_LIBS" + VULKAN=vulkanEnabled + + vulkan=yes + vulkan_sdl_ver=" (SDL$sdl_version)" + fi +fi + + +if { test "$vulkan_req" != no && test "$vulkan_req" != auto ;} && test "$vulkan" = no; then + as_fn_error $? "Vulkan dependencies were not found (Vulkan ver 1.1.101 or SDL2/3)!" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------ +# GLM (OpenGL math library) +# ------------------------------------------------------------------------------ +GLM_INC= +GLM_DIR=$srcdir/glm +glm=no + + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for glm" >&5 +printf %s "checking for glm... " >&6; } + +if test -n "$GLM_CFLAGS"; then + pkg_cv_GLM_CFLAGS="$GLM_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glm") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLM_CFLAGS=`$PKG_CONFIG --cflags "glm" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GLM_LIBS"; then + pkg_cv_GLM_LIBS="$GLM_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glm") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLM_LIBS=`$PKG_CONFIG --libs "glm" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GLM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glm" 2>&1` + else + GLM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glm" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLM_PKG_ERRORS" >&5 + + FOUND_GLM=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_GLM=no +else + GLM_CFLAGS=$pkg_cv_GLM_CFLAGS + GLM_LIBS=$pkg_cv_GLM_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_GLM=yes +fi + +if test $FOUND_GLM = yes; then + GLM_INC=$GLM_CFLAGS + glm=yes +elif test $cross_compile = no; then + as_ac_File=`printf '%s\n' "ac_cv_file_$GLM_DIR/glm/glm.hpp" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $GLM_DIR/glm/glm.hpp" >&5 +printf %s "checking for $GLM_DIR/glm/glm.hpp... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$GLM_DIR/glm/glm.hpp"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi ;; +esac +fi +eval ac_res=\$$as_ac_File + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + found_glm_hpp=yes +else case e in #( + e) found_glm_hpp=no ;; +esac +fi + + if test $found_glm_hpp = yes; then + glm=yes + GLM_INC=-I$GLM_DIR + else + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_fn_cxx_check_header_compile "$LINENO" "glm/glm.hpp" "ac_cv_header_glm_glm_hpp" "$ac_includes_default" +if test "x$ac_cv_header_glm_glm_hpp" = xyes +then : + glm=yes +else case e in #( + e) glm=no ;; +esac +fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi +fi + +# ------------------------------------------------------------------------------ +# Panorama gl display +# ------------------------------------------------------------------------------ +panogl_disp=no +# Check whether --enable-panogl_disp was given. +if test ${enable_panogl_disp+y} +then : + enableval=$enable_panogl_disp; panogl_disp_req=$enableval +else case e in #( + e) panogl_disp_req=$build_default + ;; +esac +fi + + +if test $panogl_disp_req = yes; then + if test "${sdl?}" = no || test "${sdl_version?}" != 2; then + as_fn_error $? "SDL2 not found" "$LINENO" 5; + fi + + if test $glm = no; then + as_fn_error $? "GLM not found" "$LINENO" 5; + fi +fi + +if test $panogl_disp_req != no && test $sdl = yes && test $sdl_version = 2 && test $glm = yes +then + PANOGL_OBJ="src/video_display/pano_gl.o src/video_display/opengl_utils.o src/video_display/opengl_conversions.o src/video_display/opengl_panorama.o src/video_display/sdl_window.o" + PANOGL_LIBS=$SDL_LIBS + add_module display_panogl "$PANOGL_OBJ" "$PANOGL_LIBS" + INC="$INC $GLM_INC" + panogl_disp=yes +fi + +# ------------------------------------------------------------------------------ +# OpenXR VR gl display +# ------------------------------------------------------------------------------ +xrgl_disp=no +# Check whether --enable-xrgl_disp was given. +if test ${enable_xrgl_disp+y} +then : + enableval=$enable_xrgl_disp; xrgl_disp_req=$enableval +else case e in #( + e) xrgl_disp_req=$build_default + ;; +esac +fi + + +FOUND_XRGL_DEPS=no +if test $xrgl_disp_req != no && test "$sdl_version" = 2 && test "$glm" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for openxr" >&5 +printf %s "checking for openxr... " >&6; } + +if test -n "$XRGLDISP_CFLAGS"; then + pkg_cv_XRGLDISP_CFLAGS="$XRGLDISP_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openxr\""; } >&5 + ($PKG_CONFIG --exists --print-errors "openxr") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_XRGLDISP_CFLAGS=`$PKG_CONFIG --cflags "openxr" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$XRGLDISP_LIBS"; then + pkg_cv_XRGLDISP_LIBS="$XRGLDISP_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openxr\""; } >&5 + ($PKG_CONFIG --exists --print-errors "openxr") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_XRGLDISP_LIBS=`$PKG_CONFIG --libs "openxr" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + XRGLDISP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openxr" 2>&1` + else + XRGLDISP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openxr" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$XRGLDISP_PKG_ERRORS" >&5 + + FOUND_XRGL_DEPS=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_XRGL_DEPS=no +else + XRGLDISP_CFLAGS=$pkg_cv_XRGLDISP_CFLAGS + XRGLDISP_LIBS=$pkg_cv_XRGLDISP_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_XRGL_DEPS=yes +fi + if test "$FOUND_XRGL_DEPS" = yes; then + XRGLDISP_OBJ="src/video_display/openxr_gl.o src/video_display/opengl_utils.o src/video_display/opengl_conversions.o src/video_display/opengl_panorama.o src/video_display/sdl_window.o" + XRGLDISP_LIBS="$XRGLDISP_LIBS $SDL_LIBS" + add_module display_xrgl "$XRGLDISP_OBJ" "$XRGLDISP_LIBS" + INC="$INC $GLM_INC" + xrgl_disp=yes + fi +fi + + +if { test "$xrgl_disp_req" != no && test "$xrgl_disp_req" != auto ;} && test "$xrgl_disp" = no; then + as_fn_error $? "XRGL deps not found" "$LINENO" 5; +fi + + +# +# ------------------------------------------------------------------------------ +# caca +# ------------------------------------------------------------------------------ +caca=no +# Check whether --enable-caca was given. +if test ${enable_caca+y} +then : + enableval=$enable_caca; caca_req=$enableval +else case e in #( + e) caca_req=$build_default + ;; +esac +fi + + +if test $caca_req != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for caca" >&5 +printf %s "checking for caca... " >&6; } + +if test -n "$CACA_CFLAGS"; then + pkg_cv_CACA_CFLAGS="$CACA_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"caca\""; } >&5 + ($PKG_CONFIG --exists --print-errors "caca") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CACA_CFLAGS=`$PKG_CONFIG --cflags "caca" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CACA_LIBS"; then + pkg_cv_CACA_LIBS="$CACA_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"caca\""; } >&5 + ($PKG_CONFIG --exists --print-errors "caca") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CACA_LIBS=`$PKG_CONFIG --libs "caca" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CACA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "caca" 2>&1` + else + CACA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "caca" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CACA_PKG_ERRORS" >&5 + + caca_found=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + caca_found=no +else + CACA_CFLAGS=$pkg_cv_CACA_CFLAGS + CACA_LIBS=$pkg_cv_CACA_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + caca_found=yes +fi + if test "$caca_found" = no && test "$caca_req" = yes; then + as_fn_error $? "caca requested but libcaca was not found!" "$LINENO" 5 + fi + if test "$caca_found" = yes; then + add_module display_caca src/video_display/caca.o "$CACA_LIBS" + caca=yes + fi +fi + + +if { test "$caca_req" != no && test "$caca_req" != auto ;} && test "$caca" = no; then + as_fn_error $? "libcaca not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# OpenCV version detection +# ------------------------------------------------------------------------------------------------- +remove_all_libs_but_opencv_core() { echo "$1" | sed -e 's/-lopencv_[a-z0-9_]*//g' -e 's/$/ -lopencv_core/' | compact_spaces_pipe ; } +# Check whether --enable-opencv was given. +if test ${enable_opencv+y} +then : + enableval=$enable_opencv; opencv_req=$enableval +else case e in #( + e) opencv_req=$build_default ;; +esac +fi + +found_opencv=no +opencv=no + +if test "$opencv_req" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for opencv4" >&5 +printf %s "checking for opencv4... " >&6; } + +if test -n "$OPENCV_4_CFLAGS"; then + pkg_cv_OPENCV_4_CFLAGS="$OPENCV_4_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opencv4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "opencv4") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OPENCV_4_CFLAGS=`$PKG_CONFIG --cflags "opencv4" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OPENCV_4_LIBS"; then + pkg_cv_OPENCV_4_LIBS="$OPENCV_4_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opencv4\""; } >&5 + ($PKG_CONFIG --exists --print-errors "opencv4") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OPENCV_4_LIBS=`$PKG_CONFIG --libs "opencv4" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OPENCV_4_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "opencv4" 2>&1` + else + OPENCV_4_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "opencv4" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OPENCV_4_PKG_ERRORS" >&5 + + found_opencv=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_opencv=no +else + OPENCV_4_CFLAGS=$pkg_cv_OPENCV_4_CFLAGS + OPENCV_4_LIBS=$pkg_cv_OPENCV_4_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + + found_opencv=yes + OPENCV_LIBS=$OPENCV_4_LIBS + OPENCV_CFLAGS=$OPENCV_4_CFLAGS + +fi + if test "$found_opencv" = no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for opencv > 3.0" >&5 +printf %s "checking for opencv > 3.0... " >&6; } + +if test -n "$OPENCV_3_CFLAGS"; then + pkg_cv_OPENCV_3_CFLAGS="$OPENCV_3_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opencv > 3.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "opencv > 3.0") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OPENCV_3_CFLAGS=`$PKG_CONFIG --cflags "opencv > 3.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OPENCV_3_LIBS"; then + pkg_cv_OPENCV_3_LIBS="$OPENCV_3_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opencv > 3.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "opencv > 3.0") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OPENCV_3_LIBS=`$PKG_CONFIG --libs "opencv > 3.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OPENCV_3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "opencv > 3.0" 2>&1` + else + OPENCV_3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "opencv > 3.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OPENCV_3_PKG_ERRORS" >&5 + + found_opencv=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_opencv=no +else + OPENCV_3_CFLAGS=$pkg_cv_OPENCV_3_CFLAGS + OPENCV_3_LIBS=$pkg_cv_OPENCV_3_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + + found_opencv=yes + OPENCV_LIBS=$OPENCV_3_LIBS + OPENCV_CFLAGS=$OPENCV_3_CFLAGS + +fi + fi + if test "$found_opencv" = no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for opencv > 2.3" >&5 +printf %s "checking for opencv > 2.3... " >&6; } + +if test -n "$OPENCV_2_CFLAGS"; then + pkg_cv_OPENCV_2_CFLAGS="$OPENCV_2_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opencv > 2.3\""; } >&5 + ($PKG_CONFIG --exists --print-errors "opencv > 2.3") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OPENCV_2_CFLAGS=`$PKG_CONFIG --cflags "opencv > 2.3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OPENCV_2_LIBS"; then + pkg_cv_OPENCV_2_LIBS="$OPENCV_2_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"opencv > 2.3\""; } >&5 + ($PKG_CONFIG --exists --print-errors "opencv > 2.3") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OPENCV_2_LIBS=`$PKG_CONFIG --libs "opencv > 2.3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OPENCV_2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "opencv > 2.3" 2>&1` + else + OPENCV_2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "opencv > 2.3" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OPENCV_2_PKG_ERRORS" >&5 + + found_opencv=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_opencv=no +else + OPENCV_2_CFLAGS=$pkg_cv_OPENCV_2_CFLAGS + OPENCV_2_LIBS=$pkg_cv_OPENCV_2_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + + found_opencv=yes + OPENCV_LIBS=$OPENCV_2_LIBS + OPENCV_CFLAGS=$OPENCV_2_CFLAGS + +fi + fi + if test "$found_opencv" = yes; then + OPENCV_LIBS=$(remove_all_libs_but_opencv_core $OPENCV_LIBS) + opencv=yes + fi + if test "$found_opencv" = no; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for cvCreateMat in -lopencv_core" >&5 +printf %s "checking for cvCreateMat in -lopencv_core... " >&6; } +if test ${ac_cv_lib_opencv_core_cvCreateMat+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lopencv_core $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cvCreateMat (void); +int +main (void) +{ +return cvCreateMat (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_opencv_core_cvCreateMat=yes +else case e in #( + e) ac_cv_lib_opencv_core_cvCreateMat=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opencv_core_cvCreateMat" >&5 +printf '%s\n' "$ac_cv_lib_opencv_core_cvCreateMat" >&6; } +if test "x$ac_cv_lib_opencv_core_cvCreateMat" = xyes +then : + printf '%s\n' "#define HAVE_LIBOPENCV_CORE 1" >>confdefs.h + + LIBS="-lopencv_core $LIBS" + +fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_fn_cxx_check_header_compile "$LINENO" "opencv2/core/mat.hpp" "ac_cv_header_opencv2_core_mat_hpp" "$ac_includes_default" +if test "x$ac_cv_header_opencv2_core_mat_hpp" = xyes +then : + printf '%s\n' "#define HAVE_OPENCV2_CORE_MAT_HPP 1" >>confdefs.h + +fi + + # if hdrs not in default path, try also /usr/include/opencv4 (we don't have CFLAGS from .pc; eg. U20.04) + if test "$ac_cv_header_opencv2_core_mat_hpp" = no; then + OPENCV_CFLAGS=-I/usr/include/opencv4 + SAVED_CPPFLAGS=$CPPFLAGS + SAVED_CXXFLAGS=$CXXFLAGS + CPPFLAGS="$CPPFLAGS $OPENCV_CFLAGS" + CXXFLAGS="$CXXFLAGS $OPENCV_CFLAGS" + unset ac_cv_header_opencv2_core_mat_hpp # prevent AC from using cached result + ac_fn_cxx_check_header_compile "$LINENO" "opencv2/core/mat.hpp" "ac_cv_header_opencv2_core_mat_hpp" "$ac_includes_default" +if test "x$ac_cv_header_opencv2_core_mat_hpp" = xyes +then : + printf '%s\n' "#define HAVE_OPENCV2_CORE_MAT_HPP 1" >>confdefs.h + +fi + + CPPFLAGS=$SAVED_CPPFLAGS + CXXFLAGS=$SAVED_CXXFLAGS + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test "$ac_cv_lib_opencv_core_cvCreateMat" = yes && test "$ac_cv_header_opencv2_core_mat_hpp" = yes; then + OPENCV_LIBS=-lopencv_core + opencv=yes + fi + fi +fi + +if test "$opencv" = yes; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_fn_cxx_check_header_compile "$LINENO" "opencv2/opencv.hpp" "ac_cv_header_opencv2_opencv_hpp" "$ac_includes_default" +if test "x$ac_cv_header_opencv2_opencv_hpp" = xyes +then : + printf '%s\n' "#define HAVE_OPENCV2_OPENCV_HPP 1" >>confdefs.h + +fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # opencv_imgproc is commonly needed so make the check here + SAVED_LIBS=$LIBS + LIBS="$LIBS $OPENCV_LIBS" + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for cvAcc in -lopencv_imgproc" >&5 +printf %s "checking for cvAcc in -lopencv_imgproc... " >&6; } +if test ${ac_cv_lib_opencv_imgproc_cvAcc+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lopencv_imgproc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cvAcc (void); +int +main (void) +{ +return cvAcc (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_opencv_imgproc_cvAcc=yes +else case e in #( + e) ac_cv_lib_opencv_imgproc_cvAcc=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_opencv_imgproc_cvAcc" >&5 +printf '%s\n' "$ac_cv_lib_opencv_imgproc_cvAcc" >&6; } +if test "x$ac_cv_lib_opencv_imgproc_cvAcc" = xyes +then : + printf '%s\n' "#define HAVE_LIBOPENCV_IMGPROC 1" >>confdefs.h + + LIBS="-lopencv_imgproc $LIBS" + +fi + + FOUND_OPENCV_IMGPROC=$ac_cv_lib_opencv_imgproc_cvAcc + LIBS=$SAVED_LIBS +fi + + +if { test "$opencv_req" != no && test "$opencv_req" != auto ;} && test "$opencv" = no; then + as_fn_error $? "OpenCV dependencies not found!" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# RTSP capture stuff +# ------------------------------------------------------------------------------------------------- +rtsp=no + + + +# Check whether --enable-rtsp was given. +if test ${enable_rtsp+y} +then : + enableval=$enable_rtsp; rtsp_req=$enableval +else case e in #( + e) rtsp_req=$build_default + ;; +esac +fi + + +if test "$rtsp_req" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libcurl" >&5 +printf %s "checking for libcurl... " >&6; } + +if test -n "$RTSP_CFLAGS"; then + pkg_cv_RTSP_CFLAGS="$RTSP_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_RTSP_CFLAGS=`$PKG_CONFIG --cflags "libcurl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$RTSP_LIBS"; then + pkg_cv_RTSP_LIBS="$RTSP_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_RTSP_LIBS=`$PKG_CONFIG --libs "libcurl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + RTSP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcurl" 2>&1` + else + RTSP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcurl" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$RTSP_PKG_ERRORS" >&5 + + FOUND_RTSP_DEPS=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_RTSP_DEPS=no +else + RTSP_CFLAGS=$pkg_cv_RTSP_CFLAGS + RTSP_LIBS=$pkg_cv_RTSP_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_RTSP_DEPS=yes +fi + if test $FOUND_RTSP_DEPS = yes; then + SAVED_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS ${RTSP_CFLAGS}" + SAVED_CXXFLAGS=$CXXFLAGS + CXXFLAGS="$CXXFLAGS ${RTSP_CFLAGS}" + RTSP_OBJ="src/utils/h264_stream.o src/utils/hevc_stream.o \ +src/video_capture/rtsp.o \ +src/rtp/rtpdec_h264.o src/rtp/rtpdec_jpeg.o src/utils/jpeg_writer.o" + add_module vidcap_rtsp "$RTSP_OBJ" "$RTSP_LIBS" + rtsp=yes + fi +fi + + +if { test "$rtsp_req" != no && test "$rtsp_req" != auto ;} && test "$rtsp" = no; then + as_fn_error $? "rtsp not found, check curl dependencies..." "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------------------------- +# RTSP server stuff +# TODO: create pkg-config search path for liblivemedia-dev (create live555.pc file) +# ------------------------------------------------------------------------------------------------- +rtsp_server=no +livemedia=no +livemedia_prefix=/usr + +# Check whether --enable-rtsp_server was given. +if test ${enable_rtsp_server+y} +then : + enableval=$enable_rtsp_server; rtsp_server_req=$enableval +else case e in #( + e) rtsp_server_req=$build_default + ;; +esac +fi + + + +# Check whether --with-live555 was given. +if test ${with_live555+y} +then : + withval=$with_live555; livemedia_prefix=$withval +else case e in #( + e) livemedia_prefix=/usr/local ;; +esac +fi + + +if test $rtsp_server_req != no; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + RTSP_SERVER_FLAGS="-I$livemedia_prefix/include/groupsock -I$livemedia_prefix/include/liveMedia -I$livemedia_prefix/include/BasicUsageEnvironment -I$livemedia_prefix/include/UsageEnvironment" + SAVED_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $RTSP_SERVER_FLAGS" + ac_fn_cxx_check_header_compile "$LINENO" "liveMedia.hh" "ac_cv_header_liveMedia_hh" "$ac_includes_default" +if test "x$ac_cv_header_liveMedia_hh" = xyes +then : + FOUND_LIVE_H=yes +else case e in #( + e) FOUND_LIVE_H=no ;; +esac +fi + + CPPFLAGS=$SAVED_CPPFLAGS + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test $FOUND_LIVE_H = yes + then + +printf '%s\n' "#define HAVE_RTSP_SERVER 1" >>confdefs.h + + CFLAGS="$CFLAGS $RTSP_SERVER_FLAGS" + CXXFLAGS="$CXXFLAGS $RTSP_SERVER_FLAGS" + RTSP_SERVER_LIBS="-lliveMedia -lBasicUsageEnvironment -lUsageEnvironment -lgroupsock" + RTSP_SERVER_OBJ="src/rtsp/c_basicRTSPOnlyServer.o src/rtsp/BasicRTSPOnlyServer.o src/rtsp/BasicRTSPOnlySubsession.o src/video_rxtx/h264_rtp.o" + add_module video_rxtx_h264 "$RTSP_SERVER_OBJ" "$RTSP_SERVER_LIBS" + rtsp_server=yes + livemedia=yes + fi +fi + + +if { test "$rtsp_server_req" != no && test "$rtsp_server_req" != auto ;} && test "$rtsp_server" = no; then + as_fn_error $? "rtsp server not found, check live555 -livemedia lib- dependencies..." "$LINENO" 5; +fi + + +# ---------------------------------------------------------------------- +# SDP over HTTP +# ---------------------------------------------------------------------- +# Check whether --enable-sdp-http was given. +if test ${enable_sdp_http+y} +then : + enableval=$enable_sdp_http; sdp_http_req=$enableval +else case e in #( + e) sdp_http_req=$build_default + ;; +esac +fi + +sdp_http=no + +if test $sdp_http_req != no; then + ac_fn_c_check_header_compile "$LINENO" "EmbeddableWebServer.h" "ac_cv_header_EmbeddableWebServer_h" "$ac_includes_default" +if test "x$ac_cv_header_EmbeddableWebServer_h" = xyes +then : + printf '%s\n' "#define HAVE_EMBEDDABLEWEBSERVER_H 1" >>confdefs.h + +fi + + if test $ac_cv_header_EmbeddableWebServer_h = yes + then + +printf '%s\n' "#define SDP_HTTP 1" >>confdefs.h + + sdp_http=yes + fi +fi + + +if { test "$sdp_http_req" != no && test "$sdp_http_req" != auto ;} && test "$sdp_http" = no; then + as_fn_error $? "SDP/HTTP dependency EmbeddableWebServer.h not found!" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Resize stuff +# ------------------------------------------------------------------------------------------------- +resize=no + +# Check whether --enable-resize was given. +if test ${enable_resize+y} +then : + enableval=$enable_resize; resize_req=$enableval +else case e in #( + e) resize_req=$build_default + ;; +esac +fi + + +if test $resize_req != no && test "$opencv" = yes && test "$FOUND_OPENCV_IMGPROC" = yes +then + CFLAGS="$CFLAGS ${OPENCV_CFLAGS}" + CXXFLAGS="$CXXFLAGS ${OPENCV_CFLAGS}" + RESIZE_OBJ="src/capture_filter/resize.o src/capture_filter/resize_utils.o" + add_module vcapfilter_resize "$RESIZE_OBJ" "$OPENCV_LIBS -lopencv_imgproc" + resize=yes +fi + + +if { test "$resize_req" != no && test "$resize_req" != auto ;} && test "$resize" = no; then + as_fn_error $? "Resize dependency not found, may install OpenCV...?" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Blank stuff +# ------------------------------------------------------------------------------------------------- +blank=no + + + +# Check whether --enable-blank was given. +if test ${enable_blank+y} +then : + enableval=$enable_blank; blank_req=$enableval +else case e in #( + e) blank_req=$build_default + ;; +esac +fi + + +if test $blank_req != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libswscale" >&5 +printf %s "checking for libswscale... " >&6; } + +if test -n "$BLANK_CFLAGS"; then + pkg_cv_BLANK_CFLAGS="$BLANK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libswscale\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libswscale") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_BLANK_CFLAGS=`$PKG_CONFIG --cflags "libswscale" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$BLANK_LIBS"; then + pkg_cv_BLANK_LIBS="$BLANK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libswscale\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libswscale") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_BLANK_LIBS=`$PKG_CONFIG --libs "libswscale" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + BLANK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libswscale" 2>&1` + else + BLANK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libswscale" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$BLANK_PKG_ERRORS" >&5 + + FOUND_BLANK_DEP=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_BLANK_DEP=no +else + BLANK_CFLAGS=$pkg_cv_BLANK_CFLAGS + BLANK_LIBS=$pkg_cv_BLANK_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_BLANK_DEP=yes +fi + + if test $FOUND_BLANK_DEP = no; then + for ac_header in libswscale/swscale.h +do : + ac_fn_c_check_header_compile "$LINENO" "libswscale/swscale.h" "ac_cv_header_libswscale_swscale_h" "$ac_includes_default" +if test "x$ac_cv_header_libswscale_swscale_h" = xyes +then : + printf '%s\n' "#define HAVE_LIBSWSCALE_SWSCALE_H 1" >>confdefs.h + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for sws_scale in -lswscale" >&5 +printf %s "checking for sws_scale in -lswscale... " >&6; } +if test ${ac_cv_lib_swscale_sws_scale+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lswscale $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char sws_scale (void); +int +main (void) +{ +return sws_scale (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_swscale_sws_scale=yes +else case e in #( + e) ac_cv_lib_swscale_sws_scale=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swscale_sws_scale" >&5 +printf '%s\n' "$ac_cv_lib_swscale_sws_scale" >&6; } +if test "x$ac_cv_lib_swscale_sws_scale" = xyes +then : + FOUND_BLANK_DEP=yes +fi + +fi + +done + if test $FOUND_BLANK_DEP = yes; then + BLANK_LIBS='-lswscale' + fi + fi + + if test "${blank_req?}" != no && test "${FOUND_BLANK_DEP?}" = yes + then + CFLAGS="$CFLAGS ${BLANK_CFLAGS}" + CXXFLAGS="$CXXFLAGS ${BLANK_CFLAGS}" + BLANK_OBJ="src/capture_filter/blank.o src/libavcodec/utils.o" # get_ug_to_av_pixfmt() + add_module vcapfilter_blank "$BLANK_OBJ" "$BLANK_LIBS" + blank=yes + fi +fi + + +if { test "$blank_req" != no && test "$blank_req" != auto ;} && test "$blank" = no; then + as_fn_error $? "Blank dep not found (libswscale)" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Testcard stuff +# ------------------------------------------------------------------------------------------------- +# Check whether --enable-testcard2 was given. +if test ${enable_testcard2+y} +then : + enableval=$enable_testcard2; testcard2_req=$enableval +else case e in #( + e) testcard2_req=$build_default + ;; +esac +fi + + +FOUND_SDL_TTF=no +testcard2=no +testcard2_sdl_ttf_req=auto + +case "${testcard2_req?}" in + auto|no|yes) + ;; + ttf) + testcard2_req=yes + testcard2_sdl_ttf_req=yes + ;; + nottf) + testcard2_req=yes + testcard2_sdl_ttf_req=no + ;; + *) + as_fn_error $? "Wrong option for testcard2 $testcard2_req!" "$LINENO" 5; + ;; +esac + +if test $testcard2_req != no +then + TESTCARD2_OBJ="src/video_capture/testcard2.o" + if test "${testcard2_sdl_ttf_req?}" != no; then + if test "${sdl_version?}" -lt 3; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for SDL${sdl_ver_suffix}_ttf" >&5 +printf %s "checking for SDL${sdl_ver_suffix}_ttf... " >&6; } + +if test -n "$SDL_TTF_CFLAGS"; then + pkg_cv_SDL_TTF_CFLAGS="$SDL_TTF_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"SDL\${sdl_ver_suffix}_ttf\""; } >&5 + ($PKG_CONFIG --exists --print-errors "SDL${sdl_ver_suffix}_ttf") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_TTF_CFLAGS=`$PKG_CONFIG --cflags "SDL${sdl_ver_suffix}_ttf" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SDL_TTF_LIBS"; then + pkg_cv_SDL_TTF_LIBS="$SDL_TTF_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"SDL\${sdl_ver_suffix}_ttf\""; } >&5 + ($PKG_CONFIG --exists --print-errors "SDL${sdl_ver_suffix}_ttf") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_TTF_LIBS=`$PKG_CONFIG --libs "SDL${sdl_ver_suffix}_ttf" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SDL_TTF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "SDL${sdl_ver_suffix}_ttf" 2>&1` + else + SDL_TTF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "SDL${sdl_ver_suffix}_ttf" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_TTF_PKG_ERRORS" >&5 + + FOUND_SDL_TTF=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_SDL_TTF=no +else + SDL_TTF_CFLAGS=$pkg_cv_SDL_TTF_CFLAGS + SDL_TTF_LIBS=$pkg_cv_SDL_TTF_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_SDL_TTF=yes +fi + else + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for sdl${sdl_ver_suffix}-ttf" >&5 +printf %s "checking for sdl${sdl_ver_suffix}-ttf... " >&6; } + +if test -n "$SDL_TTF_CFLAGS"; then + pkg_cv_SDL_TTF_CFLAGS="$SDL_TTF_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\${sdl_ver_suffix}-ttf\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl${sdl_ver_suffix}-ttf") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_TTF_CFLAGS=`$PKG_CONFIG --cflags "sdl${sdl_ver_suffix}-ttf" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SDL_TTF_LIBS"; then + pkg_cv_SDL_TTF_LIBS="$SDL_TTF_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\${sdl_ver_suffix}-ttf\""; } >&5 + ($PKG_CONFIG --exists --print-errors "sdl${sdl_ver_suffix}-ttf") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SDL_TTF_LIBS=`$PKG_CONFIG --libs "sdl${sdl_ver_suffix}-ttf" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SDL_TTF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl${sdl_ver_suffix}-ttf" 2>&1` + else + SDL_TTF_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl${sdl_ver_suffix}-ttf" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SDL_TTF_PKG_ERRORS" >&5 + + FOUND_SDL_TTF=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_SDL_TTF=no +else + SDL_TTF_CFLAGS=$pkg_cv_SDL_TTF_CFLAGS + SDL_TTF_LIBS=$pkg_cv_SDL_TTF_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_SDL_TTF=yes +fi + fi + if test "${FOUND_SDL_TTF?}" = yes + then + SDL_TTF_LIBS=$(remove_mwindows "${SDL_TTF_LIBS?}") + TESTCARD2_LIB="${TESTCARD2_LIB-} ${SDL_TTF_LIBS?}" + +printf '%s\n' "#define HAVE_LIBSDL_TTF 1" >>confdefs.h + + fi + fi + add_module vidcap_testcard2 "${TESTCARD2_OBJ?}" "${TESTCARD2_LIB-}" + testcard2=yes +fi + +# ensuring testcard2 itself unneeded - no dependencies + +if { test "${testcard2_sdl_ttf_req?}" != no && test "${testcard2_sdl_ttf_req?}" != auto ;} && test "${FOUND_SDL_TTF?}" = no; then + as_fn_error $? "SDL_ttf for testcard2 not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# libavcodec hw-accelerated decoding support +# ------------------------------------------------------------------------------------------------- +lavc_hwacc_vdpau=no +lavc_hwacc_vaapi=no + + + + + +# Check whether --enable-lavc-hw-accel-vdpau was given. +if test ${enable_lavc_hw_accel_vdpau+y} +then : + enableval=$enable_lavc_hw_accel_vdpau; lavc_hwacc_vdpau_req=$enableval +else case e in #( + e) lavc_hwacc_vdpau_req=$build_default + ;; +esac +fi + + +# Check whether --enable-lavc-hw-accel-vaapi was given. +if test ${enable_lavc_hw_accel_vaapi+y} +then : + enableval=$enable_lavc_hw_accel_vaapi; lavc_hwacc_vaapi_req=$enableval +else case e in #( + e) lavc_hwacc_vaapi_req=$build_default + ;; +esac +fi + + +LAVC_HWACC_FLAGS=-DHWACC_COMMON_IMPL +LAVC_HWACC_LIBS= +HW_ACC_OBJ="src/hwaccel_libav_common.o" + +if test $lavc_hwacc_vdpau_req != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libavcodec libavutil >= 55.22.1 vdpau" >&5 +printf %s "checking for libavcodec libavutil >= 55.22.1 vdpau... " >&6; } + +if test -n "$LAVC_HWACC_VDPAU_CFLAGS"; then + pkg_cv_LAVC_HWACC_VDPAU_CFLAGS="$LAVC_HWACC_VDPAU_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec libavutil >= 55.22.1 vdpau\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavcodec libavutil >= 55.22.1 vdpau") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LAVC_HWACC_VDPAU_CFLAGS=`$PKG_CONFIG --cflags "libavcodec libavutil >= 55.22.1 vdpau" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LAVC_HWACC_VDPAU_LIBS"; then + pkg_cv_LAVC_HWACC_VDPAU_LIBS="$LAVC_HWACC_VDPAU_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec libavutil >= 55.22.1 vdpau\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavcodec libavutil >= 55.22.1 vdpau") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LAVC_HWACC_VDPAU_LIBS=`$PKG_CONFIG --libs "libavcodec libavutil >= 55.22.1 vdpau" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LAVC_HWACC_VDPAU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libavcodec libavutil >= 55.22.1 vdpau" 2>&1` + else + LAVC_HWACC_VDPAU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libavcodec libavutil >= 55.22.1 vdpau" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LAVC_HWACC_VDPAU_PKG_ERRORS" >&5 + + FOUND_HWACC_VDPAU_DEP=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_HWACC_VDPAU_DEP=no +else + LAVC_HWACC_VDPAU_CFLAGS=$pkg_cv_LAVC_HWACC_VDPAU_CFLAGS + LAVC_HWACC_VDPAU_LIBS=$pkg_cv_LAVC_HWACC_VDPAU_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_HWACC_VDPAU_DEP=yes +fi + if test $FOUND_HWACC_VDPAU_DEP = yes; then + LAVC_HWACC_FLAGS="${LAVC_HWACC_FLAGS} ${LAVC_HWACC_VDPAU_CFLAGS}" + LAVC_HWACC_LIBS="${LAVC_HWACC_LIBS} ${LAVC_HWACC_VDPAU_LIBS}" + HW_ACC_OBJ="${HW_ACC_OBJ} src/hwaccel_vdpau.o" + lavc_hwacc_vdpau=yes + fi +fi +if test $lavc_hwacc_vaapi_req != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libavcodec libavutil >= 55.22.1 libva" >&5 +printf %s "checking for libavcodec libavutil >= 55.22.1 libva... " >&6; } + +if test -n "$LAVC_HWACC_VAAPI_CFLAGS"; then + pkg_cv_LAVC_HWACC_VAAPI_CFLAGS="$LAVC_HWACC_VAAPI_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec libavutil >= 55.22.1 libva\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavcodec libavutil >= 55.22.1 libva") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LAVC_HWACC_VAAPI_CFLAGS=`$PKG_CONFIG --cflags "libavcodec libavutil >= 55.22.1 libva" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LAVC_HWACC_VAAPI_LIBS"; then + pkg_cv_LAVC_HWACC_VAAPI_LIBS="$LAVC_HWACC_VAAPI_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec libavutil >= 55.22.1 libva\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavcodec libavutil >= 55.22.1 libva") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LAVC_HWACC_VAAPI_LIBS=`$PKG_CONFIG --libs "libavcodec libavutil >= 55.22.1 libva" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LAVC_HWACC_VAAPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libavcodec libavutil >= 55.22.1 libva" 2>&1` + else + LAVC_HWACC_VAAPI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libavcodec libavutil >= 55.22.1 libva" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LAVC_HWACC_VAAPI_PKG_ERRORS" >&5 + + FOUND_HWACC_VAAPI_DEP=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_HWACC_VAAPI_DEP=no +else + LAVC_HWACC_VAAPI_CFLAGS=$pkg_cv_LAVC_HWACC_VAAPI_CFLAGS + LAVC_HWACC_VAAPI_LIBS=$pkg_cv_LAVC_HWACC_VAAPI_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_HWACC_VAAPI_DEP=yes +fi + if test $FOUND_HWACC_VAAPI_DEP = yes; then + LAVC_HWACC_FLAGS="${LAVC_HWACC_FLAGS} -DHWACC_VAAPI ${LAVC_HWACC_VAAPI_CFLAGS}" + LAVC_HWACC_LIBS="${LAVC_HWACC_LIBS} ${LAVC_HWACC_VAAPI_LIBS}" + HW_ACC_OBJ="${HW_ACC_OBJ} src/hwaccel_vaapi.o" + lavc_hwacc_vaapi=yes + fi +fi + +COMMON_FLAGS="$COMMON_FLAGS $LAVC_HWACC_FLAGS" + + +if { test "$lavc_hwacc_vdpau_req" != no && test "$lavc_hwacc_vdpau_req" != auto ;} && test "$lavc_hwacc_vdpau" = no; then + as_fn_error $? "Could not find hwacc vdpau dependencies" "$LINENO" 5; +fi + + +if { test "$lavc_hwacc_vaapi_req" != no && test "$lavc_hwacc_vaapi_req" != auto ;} && test "$lavc_hwacc_vaapi" = no; then + as_fn_error $? "Could not find hwacc vaapi dependencies!" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Libswscale +# ------------------------------------------------------------------------------------------------- +libswscale=no +# Check whether --enable-libswscale was given. +if test ${enable_libswscale+y} +then : + enableval=$enable_libswscale; libswscale_req=$enableval +else case e in #( + e) libswscale_req=$build_default + ;; +esac +fi + + +if test "$libswscale_req" != no; then + if test $system = Windows; then + ac_fn_c_check_header_compile "$LINENO" "libswscale/swscale.h" "ac_cv_header_libswscale_swscale_h" "$ac_includes_default" +if test "x$ac_cv_header_libswscale_swscale_h" = xyes +then : + printf '%s\n' "#define HAVE_LIBSWSCALE_SWSCALE_H 1" >>confdefs.h + +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for sws_getContext in -lswscale" >&5 +printf %s "checking for sws_getContext in -lswscale... " >&6; } +if test ${ac_cv_lib_swscale_sws_getContext+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lswscale $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char sws_getContext (void); +int +main (void) +{ +return sws_getContext (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_swscale_sws_getContext=yes +else case e in #( + e) ac_cv_lib_swscale_sws_getContext=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swscale_sws_getContext" >&5 +printf '%s\n' "$ac_cv_lib_swscale_sws_getContext" >&6; } +if test "x$ac_cv_lib_swscale_sws_getContext" = xyes +then : + printf '%s\n' "#define HAVE_LIBSWSCALE 1" >>confdefs.h + + LIBS="-lswscale $LIBS" + +fi + + if test "${ac_cv_header_libswscale_swscale_h?}" = yes && \ + test "${ac_cv_lib_swscale_sws_getContext?}" = yes + then + found_libswscale=yes + LIBSWSCALE_LIBS="-lswscale" + else + found_libswscale=no + fi + else # Linux, OS X + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libswscale" >&5 +printf %s "checking for libswscale... " >&6; } + +if test -n "$LIBSWSCALE_CFLAGS"; then + pkg_cv_LIBSWSCALE_CFLAGS="$LIBSWSCALE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libswscale\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libswscale") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBSWSCALE_CFLAGS=`$PKG_CONFIG --cflags "libswscale" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBSWSCALE_LIBS"; then + pkg_cv_LIBSWSCALE_LIBS="$LIBSWSCALE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libswscale\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libswscale") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBSWSCALE_LIBS=`$PKG_CONFIG --libs "libswscale" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBSWSCALE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libswscale" 2>&1` + else + LIBSWSCALE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libswscale" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBSWSCALE_PKG_ERRORS" >&5 + + found_libswscale=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_libswscale=no +else + LIBSWSCALE_CFLAGS=$pkg_cv_LIBSWSCALE_CFLAGS + LIBSWSCALE_LIBS=$pkg_cv_LIBSWSCALE_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_libswscale=yes +fi + fi + + if test $found_libswscale = yes; then + +printf '%s\n' "#define HAVE_SWSCALE 1" >>confdefs.h + + COMMON_FLAGS="$COMMON_FLAGS $LIBSWSCALE_CFLAGS" + libswscale=yes + #LIBSWSCALE_LIBS="$LIBSWSCALE_LIBS $LIBAVUTIL_LIBS" # added libavutil explicitly + fi +fi + + +if { test "$libswscale_req" != no && test "$libswscale_req" != auto ;} && test "$libswscale" = no; then + as_fn_error $? "Libswscale not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Libav +# ------------------------------------------------------------------------------------------------- +lavc_cuda=no +libavcodec=no +libavcodec_audio=no +# Check whether --enable-libavcodec was given. +if test ${enable_libavcodec+y} +then : + enableval=$enable_libavcodec; libavcodec_req=$enableval +else case e in #( + e) libavcodec_req=$build_default + ;; +esac +fi + + +# Check whether --enable-lavc-cuda-conv was given. +if test ${enable_lavc_cuda_conv+y} +then : + enableval=$enable_lavc_cuda_conv; lavc_cuda_conv_req=$enableval +else case e in #( + e) lavc_cuda_conv_req=$build_default + ;; +esac +fi + + +if test "$libavcodec_req" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libavcodec >= 53.35.0 " >&5 +printf %s "checking for libavcodec >= 53.35.0 ... " >&6; } + +if test -n "$LIBAVCODEC_CFLAGS"; then + pkg_cv_LIBAVCODEC_CFLAGS="$LIBAVCODEC_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 53.35.0 \""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavcodec >= 53.35.0 ") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBAVCODEC_CFLAGS=`$PKG_CONFIG --cflags "libavcodec >= 53.35.0 " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBAVCODEC_LIBS"; then + pkg_cv_LIBAVCODEC_LIBS="$LIBAVCODEC_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 53.35.0 \""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavcodec >= 53.35.0 ") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBAVCODEC_LIBS=`$PKG_CONFIG --libs "libavcodec >= 53.35.0 " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBAVCODEC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libavcodec >= 53.35.0 " 2>&1` + else + LIBAVCODEC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libavcodec >= 53.35.0 " 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBAVCODEC_PKG_ERRORS" >&5 + + found_libavcodec=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_libavcodec=no +else + LIBAVCODEC_CFLAGS=$pkg_cv_LIBAVCODEC_CFLAGS + LIBAVCODEC_LIBS=$pkg_cv_LIBAVCODEC_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_libavcodec=yes +fi + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libavutil >= 51.22.1 " >&5 +printf %s "checking for libavutil >= 51.22.1 ... " >&6; } + +if test -n "$LIBAVUTIL_CFLAGS"; then + pkg_cv_LIBAVUTIL_CFLAGS="$LIBAVUTIL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavutil >= 51.22.1 \""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavutil >= 51.22.1 ") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBAVUTIL_CFLAGS=`$PKG_CONFIG --cflags "libavutil >= 51.22.1 " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBAVUTIL_LIBS"; then + pkg_cv_LIBAVUTIL_LIBS="$LIBAVUTIL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavutil >= 51.22.1 \""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavutil >= 51.22.1 ") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBAVUTIL_LIBS=`$PKG_CONFIG --libs "libavutil >= 51.22.1 " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBAVUTIL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libavutil >= 51.22.1 " 2>&1` + else + LIBAVUTIL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libavutil >= 51.22.1 " 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBAVUTIL_PKG_ERRORS" >&5 + + found_libavutil=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_libavutil=no +else + LIBAVUTIL_CFLAGS=$pkg_cv_LIBAVUTIL_CFLAGS + LIBAVUTIL_LIBS=$pkg_cv_LIBAVUTIL_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_libavutil=yes +fi + + if test "$found_libavcodec" = no || test "$found_libavutil" = no; then + ac_fn_c_check_header_compile "$LINENO" "libavcodec/avcodec.h" "ac_cv_header_libavcodec_avcodec_h" "$ac_includes_default" +if test "x$ac_cv_header_libavcodec_avcodec_h" = xyes +then : + printf '%s\n' "#define HAVE_LIBAVCODEC_AVCODEC_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libavutil/imgutils.h" "ac_cv_header_libavutil_imgutils_h" "$ac_includes_default" +if test "x$ac_cv_header_libavutil_imgutils_h" = xyes +then : + printf '%s\n' "#define HAVE_LIBAVUTIL_IMGUTILS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libavutil/opt.h" "ac_cv_header_libavutil_opt_h" "$ac_includes_default" +if test "x$ac_cv_header_libavutil_opt_h" = xyes +then : + printf '%s\n' "#define HAVE_LIBAVUTIL_OPT_H 1" >>confdefs.h + +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for avcodec_open2 in -lavcodec" >&5 +printf %s "checking for avcodec_open2 in -lavcodec... " >&6; } +if test ${ac_cv_lib_avcodec_avcodec_open2+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lavcodec $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char avcodec_open2 (void); +int +main (void) +{ +return avcodec_open2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_avcodec_avcodec_open2=yes +else case e in #( + e) ac_cv_lib_avcodec_avcodec_open2=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_open2" >&5 +printf '%s\n' "$ac_cv_lib_avcodec_avcodec_open2" >&6; } +if test "x$ac_cv_lib_avcodec_avcodec_open2" = xyes +then : + printf '%s\n' "#define HAVE_LIBAVCODEC 1" >>confdefs.h + + LIBS="-lavcodec $LIBS" + +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for av_free in -lavutil" >&5 +printf %s "checking for av_free in -lavutil... " >&6; } +if test ${ac_cv_lib_avutil_av_free+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lavutil $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char av_free (void); +int +main (void) +{ +return av_free (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_avutil_av_free=yes +else case e in #( + e) ac_cv_lib_avutil_av_free=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avutil_av_free" >&5 +printf '%s\n' "$ac_cv_lib_avutil_av_free" >&6; } +if test "x$ac_cv_lib_avutil_av_free" = xyes +then : + printf '%s\n' "#define HAVE_LIBAVUTIL 1" >>confdefs.h + + LIBS="-lavutil $LIBS" + +fi + + if test "${ac_cv_header_libavcodec_avcodec_h?}" = yes && \ + test "${ac_cv_header_libavutil_imgutils_h?}" = yes && \ + test "${ac_cv_header_libavutil_opt_h?}" = yes && \ + test "${ac_cv_lib_avcodec_avcodec_open2?}" = yes && \ + test "${ac_cv_lib_avutil_av_free?}" = yes; then + found_libavcodec=yes + found_libavutil=yes + libavcodec_ge_55=yes # TODO + LIBAVCODEC_LIBS="-lavcodec" + LIBAVUTIL_LIBS="-lavutil" + fi + fi +fi + +if test $libavcodec_req != no && test $found_libavcodec = yes && + test $found_libavutil = yes +then + LIBAVCODEC_COMMON="src/libavcodec/lavc_common.o src/libavcodec/utils.o" + LIBAVCODEC_VIDEO="src/libavcodec/lavc_video.o src/libavcodec/from_lavc_vid_conv.o src/libavcodec/to_lavc_vid_conv.o" + if test "$lavc_cuda_conv_req" != no && test "$FOUND_CUDA" = yes && + test "$system" != MacOSX && test "$nvcc_major" -ge 9 + then + lavc_cuda=yes + fi + if test "$lavc_cuda" = yes && test "$system" = Windows && + test -z "$INCLUDE"; then + lavc_cuda=no + fi + if test "$lavc_cuda" = yes; then + +printf '%s\n' "#define HAVE_LAVC_CUDA_CONV 1" >>confdefs.h + + to_lavc_cuda_obj=src/libavcodec/to_lavc_vid_conv_cuda.o + LIBAVCODEC_VIDEO="$LIBAVCODEC_VIDEO $to_lavc_cuda_obj src/libavcodec/from_lavc_vid_conv_cuda.o" + fi + +printf '%s\n' "#define HAVE_LAVC 1" >>confdefs.h + + if test $lavc_hwacc_vdpau = yes; then + +printf '%s\n' "#define HWACC_VDPAU 1" >>confdefs.h + + fi + LIBAVCODEC_AUDIO_CODEC_OBJ="$LIBAVCODEC_COMMON src/audio/codec/libavcodec.o" + + LIBAVCODEC_COMPRESS_OBJ="$LIBAVCODEC_COMMON $LIBAVCODEC_VIDEO $HW_ACC_OBJ src/video_compress/libavcodec.o" + LIBAVCODEC_DECOMPRESS_OBJ="$LIBAVCODEC_COMMON $LIBAVCODEC_VIDEO $HW_ACC_OBJ src/video_decompress/libavcodec.o" + if test $system = MacOSX; then + LIBAVCODEC_DECOMPRESS_OBJ="$LIBAVCODEC_DECOMPRESS_OBJ src/hwaccel_videotoolbox.o" + fi + COMMON_FLAGS="$COMMON_FLAGS $LIBAVCODEC_CFLAGS $LIBAVUTIL_CFLAGS" + if test "$system" != Windows; then + CUDA_FLAGS="$CUDA_FLAGS $LIBAVCODEC_CFLAGS $LIBAVUTIL_CFLAGS" + fi + libavcodec=yes + LIBAVCODEC_LIBS="$LIBAVCODEC_LIBS $LIBAVUTIL_LIBS" # added libavutil explicitly + add_module vcompress_libavcodec "$LIBAVCODEC_COMPRESS_OBJ" "$LIBAVCODEC_LIBS $LIBSWSCALE_LIBS" + add_module vdecompress_libavcodec "$LIBAVCODEC_DECOMPRESS_OBJ" "$LIBAVCODEC_LIBS $LAVC_HWACC_LIBS" + add_module acompress_libavcodec "$LIBAVCODEC_AUDIO_CODEC_OBJ" "$LIBAVCODEC_LIBS" +else + HW_ACC_OBJ= +fi + + +if { test "$libavcodec_req" != no && test "$libavcodec_req" != auto ;} && test "$libavcodec" = no; then + as_fn_error $? "Libavcodec not found" "$LINENO" 5; +fi + + +if { test "$lavc_cuda_conv_req" != no && test "$lavc_cuda_conv_req" != auto ;} && test "$lavc_cuda" = no; then + as_fn_error $? "either libavcodec or CUDA>=9 missing for lavc_cuda" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# File vidcap/display +# ------------------------------------------------------------------------------------------------- +file=no +# Check whether --enable-file was given. +if test ${enable_file+y} +then : + enableval=$enable_file; file_req=$enableval +else case e in #( + e) file_req=$build_default + ;; +esac +fi + + +if test "${file_req?}" = no; then + unset missing_item +elif test "${libavcodec?}" != yes; then + missing_item=libavcodec +elif test "${libswscale?}" != yes; then + missing_item=libswscale +else + missing_item=libavformat + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libavformat" >&5 +printf %s "checking for libavformat... " >&6; } + +if test -n "$LIBAVFORMAT_CFLAGS"; then + pkg_cv_LIBAVFORMAT_CFLAGS="$LIBAVFORMAT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavformat\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavformat") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBAVFORMAT_CFLAGS=`$PKG_CONFIG --cflags "libavformat" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBAVFORMAT_LIBS"; then + pkg_cv_LIBAVFORMAT_LIBS="$LIBAVFORMAT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavformat\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libavformat") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBAVFORMAT_LIBS=`$PKG_CONFIG --libs "libavformat" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBAVFORMAT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libavformat" 2>&1` + else + LIBAVFORMAT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libavformat" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBAVFORMAT_PKG_ERRORS" >&5 + + found_libavformat=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_libavformat=no +else + LIBAVFORMAT_CFLAGS=$pkg_cv_LIBAVFORMAT_CFLAGS + LIBAVFORMAT_LIBS=$pkg_cv_LIBAVFORMAT_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_libavformat=yes +fi + if test "$found_libavformat" != yes; then + SAVED_LIBS=$LIBS + ac_fn_c_check_header_compile "$LINENO" "libavformat/avformat.h" "ac_cv_header_libavformat_avformat_h" "$ac_includes_default" +if test "x$ac_cv_header_libavformat_avformat_h" = xyes +then : + printf '%s\n' "#define HAVE_LIBAVFORMAT_AVFORMAT_H 1" >>confdefs.h + +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for avformat_open_input in -lavformat" >&5 +printf %s "checking for avformat_open_input in -lavformat... " >&6; } +if test ${ac_cv_lib_avformat_avformat_open_input+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lavformat $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char avformat_open_input (void); +int +main (void) +{ +return avformat_open_input (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_avformat_avformat_open_input=yes +else case e in #( + e) ac_cv_lib_avformat_avformat_open_input=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avformat_avformat_open_input" >&5 +printf '%s\n' "$ac_cv_lib_avformat_avformat_open_input" >&6; } +if test "x$ac_cv_lib_avformat_avformat_open_input" = xyes +then : + printf '%s\n' "#define HAVE_LIBAVFORMAT 1" >>confdefs.h + + LIBS="-lavformat $LIBS" + +fi + + LIBS=$SAVED_LIBS + + if test "${ac_cv_header_libavformat_avformat_h?}" = yes && \ + test "${ac_cv_lib_avformat_avformat_open_input?}" = yes; then + found_libavformat=yes + LIBAVFORMAT_LIBS="-lavformat" + else + found_libavformat=no + fi + fi + if test $found_libavformat = yes; then + COMMON_FLAGS="$COMMON_FLAGS $LIBAVFORMAT_CFLAGS" + file=yes + add_module vidcap_file "src/libavcodec/lavc_common.o "\ +src/video_capture/file.o "$LIBAVCODEC_LIBS $LIBAVFORMAT_LIBS $LIBSWSCALE_LIBS" + add_module display_file "src/libavcodec/lavc_common.o "\ +"src/video_display/file.o src/libavcodec/to_lavc_vid_conv.o $to_lavc_cuda_obj" \ +"$LIBAVCODEC_LIBS $LIBAVFORMAT_LIBS" + fi +fi + + +if { test "${file_req?}" != no && test "${file_req?}" != auto ;} && test "${file?}" = no; then + as_fn_error $? "Vidcap file input dependencies not found: ${missing_item?}" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# DRM display +# ------------------------------------------------------------------------------------------------- +drm_disp=no + +# Check whether --enable-drm_disp was given. +if test ${enable_drm_disp+y} +then : + enableval=$enable_drm_disp; drm_req=$enableval +else case e in #( + e) drm_req=$build_default + ;; +esac +fi + + +if test $drm_req != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libdrm" >&5 +printf %s "checking for libdrm... " >&6; } + +if test -n "$DRM_CFLAGS"; then + pkg_cv_DRM_CFLAGS="$DRM_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DRM_CFLAGS=`$PKG_CONFIG --cflags "libdrm" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DRM_LIBS"; then + pkg_cv_DRM_LIBS="$DRM_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DRM_LIBS=`$PKG_CONFIG --libs "libdrm" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + DRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm" 2>&1` + else + DRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DRM_PKG_ERRORS" >&5 + + FOUND_DRM_DEP=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_DRM_DEP=no +else + DRM_CFLAGS=$pkg_cv_DRM_CFLAGS + DRM_LIBS=$pkg_cv_DRM_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_DRM_DEP=yes +fi + + if test "${drm_req?}" != no && test "${FOUND_DRM_DEP?}" = yes + then + CFLAGS="$CFLAGS ${DRM_CFLAGS}" + CXXFLAGS="$CXXFLAGS ${DRM_CFLAGS}" + DRM_OBJ="src/video_display/drm.o" + add_module display_drm "$DRM_OBJ" "$DRM_LIBS" + drm_disp=yes + fi +fi + + +if { test "$drm_req" != no && test "$drm_req" != auto ;} && test "$drm" = no; then + as_fn_error $? "drm dep not found (libdrm)" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# OpenGL display +# ------------------------------------------------------------------------------------------------- +GL_LIB=$OPENGL_LIB +gl_display=no + +# Check whether --enable-gl-display was given. +if test ${enable_gl_display+y} +then : + enableval=$enable_gl_display; gl_display_req=$enableval +else case e in #( + e) gl_display_req=$build_default + ;; +esac +fi + + +if test "$OPENGL" = yes && test "$gl_display_req" != no +then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for glfw3" >&5 +printf %s "checking for glfw3... " >&6; } + +if test -n "$GLFW_CFLAGS"; then + pkg_cv_GLFW_CFLAGS="$GLFW_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glfw3\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glfw3") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLFW_CFLAGS=`$PKG_CONFIG --cflags "glfw3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GLFW_LIBS"; then + pkg_cv_GLFW_LIBS="$GLFW_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glfw3\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glfw3") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLFW_LIBS=`$PKG_CONFIG --libs "glfw3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GLFW_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glfw3" 2>&1` + else + GLFW_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glfw3" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GLFW_PKG_ERRORS" >&5 + + FOUND_GLFW=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_GLFW=no +else + GLFW_CFLAGS=$pkg_cv_GLFW_CFLAGS + GLFW_LIBS=$pkg_cv_GLFW_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_GLFW=yes +fi + if test "$FOUND_GLFW" = yes; then + GL_LIB="$GLFW_LIBS $OPENGL_LIB" + gl_display=yes + if test $lavc_hwacc_vdpau = yes -a $libavcodec = yes; then + HW_ACC_OBJ="${HW_ACC_OBJ} src/video_display/gl_vdpau.o" + fi + COMMON_FLAGS="$COMMON_FLAGS $GLFW_CFLAGS" + add_module display_gl "$GL_COMMON_OBJ $HW_ACC_OBJ src/video_display/gl.o" "$GL_LIB $LAVC_HWACC_LIBS" + fi +fi + + +if { test "$gl_display_req" != no && test "$gl_display_req" != auto ;} && test "$gl_display" = no; then + as_fn_error $? "OpenGL not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# SW Mix Stuff +# ------------------------------------------------------------------------------------------------- +swmix=no + +# Check whether --enable-swmix was given. +if test ${enable_swmix+y} +then : + enableval=$enable_swmix; swmix_req=$enableval +else case e in #( + e) swmix_req=$build_default + ;; +esac +fi + + +if test "$swmix_req" != no && test "$OPENGL_COMMON" = yes +then + swmix=yes + SWMIX_LIB="$OPENGL_LIB" + SWMIX_OBJ="$SWMIX_OBJ $GL_COMMON_OBJ src/video_capture/swmix.o" + add_module vidcap_swmix "$SWMIX_OBJ" "$SWMIX_LIB" +fi + +if test $swmix_req = yes && test $swmix = no; then + as_fn_error $? "SW mix was not found (OpenGL libraries missing)" "$LINENO" 5; +fi + +# ----------------------------------------------------------------------------- +# DirectShow +# ----------------------------------------------------------------------------- +dshow=no +# Check whether --enable-dshow was given. +if test ${enable_dshow+y} +then : + enableval=$enable_dshow; dshow_req=$enableval +else case e in #( + e) dshow_req=$build_default + ;; +esac +fi + + +if test $system = Windows -a $dshow_req != no; then + add_module "" "src/video_capture/DirectShowGrabber.o" \ + "-lstrmiids -luuid -lole32 -loleaut32" #-lstrmbase -ldxguid -ldmoguids + dshow=yes +fi + +if test $dshow_req = yes && test $dshow = no; then + as_fn_error $? "DirectShow not found" "$LINENO" 5; +fi + +# ----------------------------------------------------------------------------- +# Pipewire common +# ----------------------------------------------------------------------------- +pipewire_common=no + +# Check whether --enable-pipewire was given. +if test ${enable_pipewire+y} +then : + enableval=$enable_pipewire; pipewire_common_req=$enableval +else case e in #( + e) pipewire_common_req=$build_default + ;; +esac +fi + + + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libpipewire-0.3 >= 0.3.30" >&5 +printf %s "checking for libpipewire-0.3 >= 0.3.30... " >&6; } + +if test -n "$PIPEWIRE_CFLAGS"; then + pkg_cv_PIPEWIRE_CFLAGS="$PIPEWIRE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpipewire-0.3 >= 0.3.30\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpipewire-0.3 >= 0.3.30") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PIPEWIRE_CFLAGS=`$PKG_CONFIG --cflags "libpipewire-0.3 >= 0.3.30" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PIPEWIRE_LIBS"; then + pkg_cv_PIPEWIRE_LIBS="$PIPEWIRE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpipewire-0.3 >= 0.3.30\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpipewire-0.3 >= 0.3.30") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PIPEWIRE_LIBS=`$PKG_CONFIG --libs "libpipewire-0.3 >= 0.3.30" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PIPEWIRE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpipewire-0.3 >= 0.3.30" 2>&1` + else + PIPEWIRE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpipewire-0.3 >= 0.3.30" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PIPEWIRE_PKG_ERRORS" >&5 + + found_pw_common_deps=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_pw_common_deps=no +else + PIPEWIRE_CFLAGS=$pkg_cv_PIPEWIRE_CFLAGS + PIPEWIRE_LIBS=$pkg_cv_PIPEWIRE_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_pw_common_deps=yes +fi + +if test "${pipewire_common_req?}" != no && test "${found_pw_common_deps?}" = yes +then + pipewire_common=yes + PIPEWIRE_COMMON_LIBS="$($PKG_CONFIG --libs libpipewire-0.3)" + # include pipewire headers as system headers to supress warnings in the headers (instead of -Ipath use -isystem path) + PIPEWIRE_COMMON_INC="$($PKG_CONFIG --cflags-only-I libpipewire-0.3 | sed 's/\(^\| \)-I\//\1-isystem \//g')" + PIPEWIRE_COMMON_OBJ="src/pipewire_common.o" + + INC="$INC $PIPEWIRE_COMMON_INC" + CXXFLAGS="$CXXFLAGS $PIPEWIRE_COMMON_INC" +fi + +# ----------------------------------------------------------------------------- +# Pipewire audio +# ----------------------------------------------------------------------------- +pipewire_audio=no + +# Check whether --enable-pipewire-audio was given. +if test ${enable_pipewire_audio+y} +then : + enableval=$enable_pipewire_audio; pipewire_audio_req=$enableval +else case e in #( + e) pipewire_audio_req=$build_default + ;; +esac +fi + + +if test "${pipewire_audio_req?}" != no && test "${pipewire_common?}" = yes +then + pipewire_audio=yes + PIPEWIRE_ACAP_OBJS="$PIPEWIRE_COMMON_OBJ src/audio/capture/pipewire.o" + PIPEWIRE_APLAY_OBJS="$PIPEWIRE_COMMON_OBJ src/audio/playback/pipewire.o" + add_module acap_pipewire "$PIPEWIRE_ACAP_OBJS" "$PIPEWIRE_LIBS" + add_module aplay_pipewire "$PIPEWIRE_APLAY_OBJS" "$PIPEWIRE_LIBS" +fi + +if test $pipewire_audio_req = yes && test $pipewire_audio = no; then + as_fn_error $? "pipewire audio was not found (libraries missing)" "$LINENO" 5; +fi + +# ----------------------------------------------------------------------------- +# Pipewire video +# ----------------------------------------------------------------------------- +pipewire_video=no + +# Check whether --enable-pipewire-video was given. +if test ${enable_pipewire_video+y} +then : + enableval=$enable_pipewire_video; pipewire_video_req=$enableval +else case e in #( + e) pipewire_video_req=$build_default + ;; +esac +fi + + +if test "${pipewire_video_req?}" != no && test "${pipewire_common?}" = yes +then + pipewire_video=yes + PIPEWIRE_DISP_OBJS="$PIPEWIRE_COMMON_OBJ src/video_display/pipewire.o" + PIPEWIRE_CAP_OBJS="$PIPEWIRE_COMMON_OBJ src/video_capture/pipewire.o" + PIPEWIRE_CAP_LIBS="$PIPEWIRE_LIBS" + add_module display_pipewire "$PIPEWIRE_DISP_OBJS" "$PIPEWIRE_LIBS" + #vcap_pipewire module added after screen +fi + +if test $pipewire_video_req = yes && test $pipewire_video = no; then + as_fn_error $? "pipewire video was not found (libraries missing)" "$LINENO" 5; +fi + +# ------------------------------------------------------------------------------------------------- +# Screen capture stuff +# ------------------------------------------------------------------------------------------------- +SCREEN_CAP_INC= +SCREEN_CAP_OBJ= +SCREEN_CAP_LIB= +screen_cap=no +screen_cap_x11=no +sc_details= + +# Check whether --enable-screen was given. +if test ${enable_screen+y} +then : + enableval=$enable_screen; screen_cap_req=$enableval +else case e in #( + e) screen_cap_req=$build_default + ;; +esac +fi + + +if test "${system?}" = Linux && test "${screen_cap_req?}" = yes; then + screen_cap_req=pipewire,x11 +fi + +if test "${system?}" = Windows && test "${screen_cap_req?}" != no; then + SCREEN_CAP_OBJ="src/video_capture/screen_win.o" + DLL_LIBS="${DLL_LIBS:+$DLL_LIBS }${srcdir}/data/screen-capture-recorder-x64.dll" + screen_cap=$dshow +fi + +if test "${system?}" = MacOSX && test "${screen_cap_req?}" != no; then + if test "${avfoundation?}" = no || test "${screen_cap_req?}" = cg; then + if test "${macos_major?}" -ge 15; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Core Graphics screen capture unsupported since macOS 15!" >&5 +printf '%s\n' "$as_me: WARNING: Core Graphics screen capture unsupported since macOS 15!" >&2;} + else + SCREEN_CAP_OBJ="src/video_capture/screen_osx.o" + SCREEN_CAP_LIB="-framework CoreFoundation" + screen_modules="Core Graphics" + screen_cap=yes + fi + else + if test "${avfoundation?}" = yes; then + SCREEN_CAP_OBJ="src/video_capture/screen_avf.o" + screen_modules="AV Foundation" + screen_cap=yes + fi + fi +fi + +# X11 +screen_cap_x11=no +if test "$system" = Linux && test $screen_cap_req != no && test $screen_cap_req != pipewire; then + SAVED_LIBS=$LIBS + ac_fn_c_check_header_compile "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_Xlib_h" = xyes +then : + +fi + + ac_fn_c_check_header_compile "$LINENO" "X11/Xutil.h" "ac_cv_header_X11_Xutil_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_Xutil_h" = xyes +then : + +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for XGetImage in -lX11" >&5 +printf %s "checking for XGetImage in -lX11... " >&6; } +if test ${ac_cv_lib_X11_XGetImage+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XGetImage (void); +int +main (void) +{ +return XGetImage (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_X11_XGetImage=yes +else case e in #( + e) ac_cv_lib_X11_XGetImage=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XGetImage" >&5 +printf '%s\n' "$ac_cv_lib_X11_XGetImage" >&6; } +if test "x$ac_cv_lib_X11_XGetImage" = xyes +then : + printf '%s\n' "#define HAVE_LIBX11 1" >>confdefs.h + + LIBS="-lX11 $LIBS" + +fi + + #PKG_CHECK_MODULES([XFIXES], [xfixes], [AC_DEFINE([HAVE_XFIXES], [1], [Build with XFixes support])], [HAVE_XFIXES=no]) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for XFixesGetCursorImage in -lXfixes" >&5 +printf %s "checking for XFixesGetCursorImage in -lXfixes... " >&6; } +if test ${ac_cv_lib_Xfixes_XFixesGetCursorImage+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lXfixes $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XFixesGetCursorImage (void); +int +main (void) +{ +return XFixesGetCursorImage (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_Xfixes_XFixesGetCursorImage=yes +else case e in #( + e) ac_cv_lib_Xfixes_XFixesGetCursorImage=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xfixes_XFixesGetCursorImage" >&5 +printf '%s\n' "$ac_cv_lib_Xfixes_XFixesGetCursorImage" >&6; } +if test "x$ac_cv_lib_Xfixes_XFixesGetCursorImage" = xyes +then : + printf '%s\n' "#define HAVE_LIBXFIXES 1" >>confdefs.h + + LIBS="-lXfixes $LIBS" + +fi + + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xfixes.h" "ac_cv_header_X11_extensions_Xfixes_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_extensions_Xfixes_h" = xyes +then : + +fi + + LIBS=$SAVED_LIBS + + if test "${screen_cap_req?}" != no && + test "${ac_cv_lib_X11_XGetImage?}" = yes && + test "${ac_cv_header_X11_Xlib_h?}" = yes && + test "${ac_cv_header_X11_Xutil_h?}" = yes; then + screen_cap=yes + screen_cap_x11=yes + SCREEN_CAP_LIB="$SCREEN_CAP_LIB -lX11" + if test "${ac_cv_lib_Xfixes_XFixesGetCursorImage?}" = yes && + test "${ac_cv_header_X11_extensions_Xfixes_h?}" = yes; then + +printf '%s\n' "#define HAVE_XFIXES 1" >>confdefs.h + + SCREEN_CAP_LIB="$SCREEN_CAP_LIB -lXfixes" + fi + add_module vidcap_screen_x11 "src/video_capture/screen_x11.o src/x11_common.o" "$SCREEN_CAP_LIB" + screen_modules="${screen_modules:+$screen_modules,}X11" + fi +fi + +# PipeWire +found_screen_screen_pw_deps=no +screen_cap_pw=no +if test ${system?} = Linux && test ${screen_cap_req?} != no && + test ${screen_cap_req} != x11; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 gobject-2.0 gio-unix-2.0 " >&5 +printf %s "checking for glib-2.0 gobject-2.0 gio-unix-2.0 ... " >&6; } + +if test -n "$SCREEN_PW_DEPS_CFLAGS"; then + pkg_cv_SCREEN_PW_DEPS_CFLAGS="$SCREEN_PW_DEPS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 gobject-2.0 gio-unix-2.0 \""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 gobject-2.0 gio-unix-2.0 ") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SCREEN_PW_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 gobject-2.0 gio-unix-2.0 " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$SCREEN_PW_DEPS_LIBS"; then + pkg_cv_SCREEN_PW_DEPS_LIBS="$SCREEN_PW_DEPS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 gobject-2.0 gio-unix-2.0 \""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 gobject-2.0 gio-unix-2.0 ") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SCREEN_PW_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 gobject-2.0 gio-unix-2.0 " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + SCREEN_PW_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 gobject-2.0 gio-unix-2.0 " 2>&1` + else + SCREEN_PW_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 gobject-2.0 gio-unix-2.0 " 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SCREEN_PW_DEPS_PKG_ERRORS" >&5 + + found_screen_screen_pw_deps=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_screen_screen_pw_deps=no +else + SCREEN_PW_DEPS_CFLAGS=$pkg_cv_SCREEN_PW_DEPS_CFLAGS + SCREEN_PW_DEPS_LIBS=$pkg_cv_SCREEN_PW_DEPS_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_screen_screen_pw_deps=yes +fi +fi + +if test $found_screen_screen_pw_deps = yes && test $pipewire_video = yes; then + screen_cap=yes + screen_cap_pw=yes + SCREEN_CAP_PIPEWIRE_LIBS="$($PKG_CONFIG --libs glib-2.0) $($PKG_CONFIG --libs gobject-2.0) $($PKG_CONFIG --libs gio-2.0) $($PKG_CONFIG --libs gio-unix-2.0)" + + SCREEN_CAP_PIPEWIRE_INC="$($PKG_CONFIG --cflags-only-I glib-2.0) $($PKG_CONFIG --cflags-only-I gobject-2.0) $($PKG_CONFIG --cflags-only-I gio-2.0) $($PKG_CONFIG --cflags-only-I gio-unix-2.0)" + + INC="$INC $SCREEN_CAP_PIPEWIRE_INC" + CXXFLAGS="$CXXFLAGS $SCREEN_CAP_PIPEWIRE_INC" + +printf '%s\n' "#define HAVE_DBUS_SCREENCAST 1" >>confdefs.h + + + PIPEWIRE_CAP_LIBS="$PIPEWIRE_CAP_LIBS $SCREEN_CAP_PIPEWIRE_LIBS" + PIPEWIRE_CAP_OBJS="$PIPEWIRE_CAP_OBJS src/utils/dbus_portal.o" + + screen_modules="${screen_modules:+$screen_modules,}pipewire" +fi + +if test $screen_cap_req != no && test $screen_cap = yes +then + if test $system = Linux; then + SCREEN_CAP_OBJ="src/video_capture/screen_linux.o" + fi + add_module vidcap_screen "$SCREEN_CAP_OBJ" "$SCREEN_CAP_LIB" +else + screen_cap=no +fi + + +if { test "$screen_cap_req" != no && test "$screen_cap_req" != auto ;} && test "$screen_cap" = no; then + as_fn_error $? "Screen capture not found" "$LINENO" 5; +fi + + +if { expr "x${screen_cap_req?}" : "x.*x11" >/dev/null && + test "${screen_cap_x11?}" = no; } || + { expr "x${screen_cap_req?}" : "x.*pipewire" >/dev/null && + test "${screen_cap_pw?}" = no; }; then + as_fn_error $? "Desired screen capture implementation not found! + Wanted: ${screen_cap_req?}" "$LINENO" 5 +fi + +if test -n "$screen_modules"; then + screen_modules=" ($screen_modules)" +fi + +if test $pipewire_video = yes +then + add_module vidcap_pipewire "$PIPEWIRE_CAP_OBJS" "$PIPEWIRE_CAP_LIBS" +fi + + +# ------------------------------------------------------------------------------------------------- +# GLSL DXT +# ------------------------------------------------------------------------------------------------- +rtdxt=no + +# Check whether --enable-rtdxt was given. +if test ${enable_rtdxt+y} +then : + enableval=$enable_rtdxt; rtdxt_req=$enableval +else case e in #( + e) rtdxt_req=$build_default ;; +esac +fi + + + + +printf '%s\n' "#define USE_PBO_DXT_ENCODER 1" >>confdefs.h + +# We probably want this only if there is need to maximalize bandwidth +# With NVidia cards, it increases latency up about 1.5x frame time +#AC_DEFINE([USE_PBO_DXT_ENCODER], [1], [We want to use OpenGL pixel buffer objects]) + +# Linux +if test "$rtdxt_req" != no && test "$OPENGL_COMMON" = yes +then + rtdxt=yes + RTDXT_LIB="$OPENGL_LIB" + RTDXT_COMMON_OBJ="$RTDXT_COMMON_OBJ $GL_COMMON_OBJ dxt_compress/dxt_util.o" + RTDXT_COMMON_HEADERS="$RTDXT_COMMON_HEADERS dxt_compress/dxt_glsl.h" + RTDXT_COMPRESS_OBJ="$RTDXT_COMMON_OBJ dxt_compress/dxt_encoder.o src/video_compress/dxt_glsl.o" + RTDXT_DECOMPRESS_OBJ="$RTDXT_COMMON_OBJ dxt_compress/dxt_decoder.o src/video_decompress/dxt_glsl.o" + COMMON_FLAGS="$COMMON_FLAGS -Idxt_compress" + add_module vcompress_rtdxt "$RTDXT_COMPRESS_OBJ" "$RTDXT_LIB" + add_module vdecompress_rtdxt "$RTDXT_DECOMPRESS_OBJ" "$RTDXT_LIB" + LIB_GENERATED_HEADERS="$RTDXT_COMMON_HEADERS" +fi + +if test $rtdxt_req = yes && test $rtdxt = no; then + as_fn_error $? "RTDXT not found" "$LINENO" 5; +fi + +# ------------------------------------------------------------------------------------------------- +# UYVY +uyvy=no + +# Check whether --enable-uyvy was given. +if test ${enable_uyvy+y} +then : + enableval=$enable_uyvy; uyvy_req=$enableval +else case e in #( + e) uyvy_req=$build_default ;; +esac +fi + + +SAVED_LIBS=$LIBS + +if test "$uyvy_req" != no && test "$OPENGL_COMMON" = yes +then + uyvy=yes +fi + +# common +if test $uyvy = yes +then + UYVY_COMPRESS_OBJ="$GL_COMMON_OBJ src/video_compress/uyvy.o" + add_module vcompress_uyvy "$UYVY_COMPRESS_OBJ" "$OPENGL_LIB" +fi + +if test $uyvy_req = yes && test $uyvy = no; then + as_fn_error $? "UYVY not found" "$LINENO" 5; +fi + +# ------------------------------------------------------------------------------------------------- +# GPUJPEG + +gpujpeg=no + +# Check whether --enable-gpujpeg was given. +if test ${enable_gpujpeg+y} +then : + enableval=$enable_gpujpeg; gpujpeg_req=$enableval +else case e in #( + e) gpujpeg_req=$build_default ;; +esac +fi + + +if test "$gpujpeg_req" != no; then + SAVED_PKG_CONFIG_PATH=$PKG_CONFIG_PATH + export PKG_CONFIG_PATH="ext-deps/gpujpeg/install/share/pkgconfig:$PKG_CONFIG_PATH" + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libgpujpeg" >&5 +printf %s "checking for libgpujpeg... " >&6; } + +if test -n "$LIBGPUJPEG_ANY_CFLAGS"; then + pkg_cv_LIBGPUJPEG_ANY_CFLAGS="$LIBGPUJPEG_ANY_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgpujpeg\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libgpujpeg") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBGPUJPEG_ANY_CFLAGS=`$PKG_CONFIG --cflags "libgpujpeg" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBGPUJPEG_ANY_LIBS"; then + pkg_cv_LIBGPUJPEG_ANY_LIBS="$LIBGPUJPEG_ANY_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgpujpeg\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libgpujpeg") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBGPUJPEG_ANY_LIBS=`$PKG_CONFIG --libs "libgpujpeg" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBGPUJPEG_ANY_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libgpujpeg" 2>&1` + else + LIBGPUJPEG_ANY_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libgpujpeg" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBGPUJPEG_ANY_PKG_ERRORS" >&5 + + found_gpujpeg_any=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_gpujpeg_any=no +else + LIBGPUJPEG_ANY_CFLAGS=$pkg_cv_LIBGPUJPEG_ANY_CFLAGS + LIBGPUJPEG_ANY_LIBS=$pkg_cv_LIBGPUJPEG_ANY_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_gpujpeg_any=yes +fi + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libgpujpeg >= 0.14.0" >&5 +printf %s "checking for libgpujpeg >= 0.14.0... " >&6; } + +if test -n "$LIBGPUJPEG_CFLAGS"; then + pkg_cv_LIBGPUJPEG_CFLAGS="$LIBGPUJPEG_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgpujpeg >= 0.14.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libgpujpeg >= 0.14.0") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBGPUJPEG_CFLAGS=`$PKG_CONFIG --cflags "libgpujpeg >= 0.14.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBGPUJPEG_LIBS"; then + pkg_cv_LIBGPUJPEG_LIBS="$LIBGPUJPEG_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgpujpeg >= 0.14.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libgpujpeg >= 0.14.0") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBGPUJPEG_LIBS=`$PKG_CONFIG --libs "libgpujpeg >= 0.14.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBGPUJPEG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libgpujpeg >= 0.14.0" 2>&1` + else + LIBGPUJPEG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libgpujpeg >= 0.14.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBGPUJPEG_PKG_ERRORS" >&5 + + found_gpujpeg=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_gpujpeg=no +else + LIBGPUJPEG_CFLAGS=$pkg_cv_LIBGPUJPEG_CFLAGS + LIBGPUJPEG_LIBS=$pkg_cv_LIBGPUJPEG_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_gpujpeg=yes +fi + PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH + + if test "${found_gpujpeg_any?}" = yes && test "${found_gpujpeg?}" = no + then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Old GPUJPEG version found, please upgrade" >&5 +printf '%s\n' "$as_me: WARNING: Old GPUJPEG version found, please upgrade" >&2;} + WARNINGS="${WARNINGS}Old GPUJPEG version found, please upgrade\n" + + fi +else + found_gpujpeg=no + found_gpujpeg_any=no +fi + +# try to find without pkg-config (but only if old version was not detected - to avoid side-loading +# that version without pkg-config version check) +if test "$gpujpeg_req" != no && test "$found_gpujpeg_any" != yes && test "$found_gpujpeg" != yes +then + GPUJPEG_LIB="$GPUJPEG_LIB -lgpujpeg" + SAVED_LIBS=$LIBS + LIBS="$LIBS $GPUJPEG_LIB" + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for gpujpeg_encoder_create in -lgpujpeg" >&5 +printf %s "checking for gpujpeg_encoder_create in -lgpujpeg... " >&6; } +if test ${ac_cv_lib_gpujpeg_gpujpeg_encoder_create+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpujpeg $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gpujpeg_encoder_create (void); +int +main (void) +{ +return gpujpeg_encoder_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_gpujpeg_gpujpeg_encoder_create=yes +else case e in #( + e) ac_cv_lib_gpujpeg_gpujpeg_encoder_create=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gpujpeg_gpujpeg_encoder_create" >&5 +printf '%s\n' "$ac_cv_lib_gpujpeg_gpujpeg_encoder_create" >&6; } +if test "x$ac_cv_lib_gpujpeg_gpujpeg_encoder_create" = xyes +then : + printf '%s\n' "#define HAVE_LIBGPUJPEG 1" >>confdefs.h + + LIBS="-lgpujpeg $LIBS" + +fi + + ac_fn_c_check_header_compile "$LINENO" "libgpujpeg/gpujpeg_decoder.h" "ac_cv_header_libgpujpeg_gpujpeg_decoder_h" "$ac_includes_default" +if test "x$ac_cv_header_libgpujpeg_gpujpeg_decoder_h" = xyes +then : + +fi + + LIBS=$SAVED_LIBS + if test "${ac_cv_lib_gpujpeg_gpujpeg_encoder_create?}" = yes && + test "${ac_cv_header_libgpujpeg_gpujpeg_decoder_h?}" = yes + then + found_gpujpeg=yes + else + found_gpujpeg=no + fi +fi + +if test "$gpujpeg_req" != no && test "$found_gpujpeg" = yes; then + gpujpeg=yes + + GPUJPEG_INC="$GPUJPEG_INC $LIBGPUJPEG_CFLAGS" + GPUJPEG_LIB="$GPUJPEG_LIB $LIBGPUJPEG_LIBS" + GPUJPEG_COMPRESS_OBJ="src/video_compress/gpujpeg.o" + GPUJPEG_DECOMPRESS_OBJ="src/video_decompress/gpujpeg.o " + +printf '%s\n' "#define HAVE_GPUJPEG 1" >>confdefs.h + + add_module vcompress_gpujpeg "$GPUJPEG_COMPRESS_OBJ" "$GPUJPEG_LIB" + add_module vdecompress_gpujpeg "$GPUJPEG_DECOMPRESS_OBJ" "$GPUJPEG_LIB" + + INC="$INC $GPUJPEG_INC" +fi + + +if { test "$gpujpeg_req" != no && test "$gpujpeg_req" != auto ;} && test "$gpujpeg" = no; then + as_fn_error $? "GPUJPEG not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# CUDA DXT +# ------------------------------------------------------------------------------------------------- + +cuda_dxt=no + +# Check whether --enable-cuda-dxt was given. +if test ${enable_cuda_dxt+y} +then : + enableval=$enable_cuda_dxt; cuda_dxt_req=$enableval +else case e in #( + e) cuda_dxt_req=$build_default ;; +esac +fi + + +LIBS=$SAVED_LIBS +CUDA_DXT_COMMON_OBJ="cuda_dxt/cuda_dxt.o" + +if test "${cuda_dxt_req?}" != no && test "${FOUND_CUDA?}" = yes +then + cuda_dxt=yes + + CUDA_DXT_LIB="$CUDA_DXT_COMMON_LIB $CUDA_LIB" + CUDA_DXT_OBJ="src/video_compress/cuda_dxt.o $CUDA_DXT_COMMON_OBJ $CUDA_COMMON_OBJ" + add_module vcompress_cuda_dxt "$CUDA_DXT_OBJ" "$CUDA_DXT_LIB" +fi + + +if { test "$cuda_dxt_req" != no && test "$cuda_dxt_req" != auto ;} && test "$cuda_dxt" = no; then + as_fn_error $? "CUDA DXT not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# GPUJPEG transcode to DXT +# ------------------------------------------------------------------------------------------------- +gpujpeg_to_dxt=no +# Check whether --enable-gpujpeg_to_dxt was given. +if test ${enable_gpujpeg_to_dxt+y} +then : + enableval=$enable_gpujpeg_to_dxt; gpujpeg_to_dxt_req=$enableval +else case e in #( + e) gpujpeg_to_dxt_req=no ;; +esac +fi + + +if test "${gpujpeg_to_dxt_req?}" != no && test "${FOUND_CUDA?}" = yes && +test "${found_gpujpeg?}" = yes +then + gpujpeg_to_dxt=yes + GPUJPEG_TO_DXT_INC=" $CUDA_INC" + GPUJPEG_TO_DXT_LIB="$CUDA_DXT_COMMON_LIB $CUDA_LIB $GPUJPEG_LIB" + GPUJPEG_TO_DXT_OBJ="src/video_decompress/gpujpeg_to_dxt.o $CUDA_COMMON_OBJ $CUDA_DXT_COMMON_OBJ" + add_module vdecompress_gpujpeg_to_dxt "$GPUJPEG_TO_DXT_OBJ" "$GPUJPEG_TO_DXT_LIB" +fi + + +if { test "$gpujpeg_to_dxt" != no && test "$gpujpeg_to_dxt" != auto ;} && test "$gpujpeg_to_dxt_req" = no; then + as_fn_error $? "GPUJPEG DXT transcoder not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# gpustitch stuff +# ------------------------------------------------------------------------------------------------- + +gpustitch=no + +# Check whether --enable-gpustitch was given. +if test ${enable_gpustitch+y} +then : + enableval=$enable_gpustitch; gpustitch_req=$enableval +else case e in #( + e) gpustitch_req=$build_default + ;; +esac +fi + + +if test "$gpustitch_req" != no && test "$FOUND_CUDA" = yes; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libgpustitch >= 0.0.1 " >&5 +printf %s "checking for libgpustitch >= 0.0.1 ... " >&6; } + +if test -n "$LIBGPUSTITCH_CFLAGS"; then + pkg_cv_LIBGPUSTITCH_CFLAGS="$LIBGPUSTITCH_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgpustitch >= 0.0.1 \""; } >&5 + ($PKG_CONFIG --exists --print-errors "libgpustitch >= 0.0.1 ") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBGPUSTITCH_CFLAGS=`$PKG_CONFIG --cflags "libgpustitch >= 0.0.1 " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBGPUSTITCH_LIBS"; then + pkg_cv_LIBGPUSTITCH_LIBS="$LIBGPUSTITCH_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libgpustitch >= 0.0.1 \""; } >&5 + ($PKG_CONFIG --exists --print-errors "libgpustitch >= 0.0.1 ") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBGPUSTITCH_LIBS=`$PKG_CONFIG --libs "libgpustitch >= 0.0.1 " 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBGPUSTITCH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libgpustitch >= 0.0.1 " 2>&1` + else + LIBGPUSTITCH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libgpustitch >= 0.0.1 " 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBGPUSTITCH_PKG_ERRORS" >&5 + + found_gpustitch=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_gpustitch=no +else + LIBGPUSTITCH_CFLAGS=$pkg_cv_LIBGPUSTITCH_CFLAGS + LIBGPUSTITCH_LIBS=$pkg_cv_LIBGPUSTITCH_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_gpustitch=yes +fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + SAVED_LIBS=$LIBS + SAVED_CPPFLAGS=$CPPFLAGS + LIBS="$LIBS -lgpustitch" + CPPFLAGS="$CPPFLAGS $LIBGPUSTITCH_CFLAGS" + ac_fn_cxx_check_header_compile "$LINENO" "libgpustitch/stitcher.hpp" "ac_cv_header_libgpustitch_stitcher_hpp" "$ac_includes_default" +if test "x$ac_cv_header_libgpustitch_stitcher_hpp" = xyes +then : + +fi + + LIBS=$SAVED_LIBS + CPPFLAGS=$SAVED_CPPFLAGS + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + if test "$ac_cv_header_libgpustitch_stitcher_hpp" != yes + then + found_gpustitch=no + fi + + if test "$found_gpustitch" = yes; then + gpustitch=yes + + GPUSTITCH_LIB="-lgpustitch $LIBGPUSTITCH_LIBS" + GPUSTITCH_OBJ="src/video_capture/gpustitch.o src/utils/cuda_pix_conv.o $CUDA_COMMON_OBJ" + add_module vidcap_gpustitch "$GPUSTITCH_OBJ" "$GPUSTITCH_LIB" + + INC="$INC $LIBGPUSTITCH_CFLAGS" + fi +fi + + +if { test "$gpustitch_req" != no && test "$gpustitch_req" != auto ;} && test "$gpustitch " = no; then + as_fn_error $? "GPUSTITCH not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# SAGE stuff + +sage=no + +# Check whether --enable-sage was given. +if test ${enable_sage+y} +then : + enableval=$enable_sage; sage_req=$enableval +else case e in #( + e) sage_req=no ;; +esac +fi + + +# Check whether --enable-sage-native-dxt5ycocg was given. +if test ${enable_sage_native_dxt5ycocg+y} +then : + enableval=$enable_sage_native_dxt5ycocg; native_ycocg=$enableval +else case e in #( + e) native_ycocg=no ;; +esac +fi + + + +# Check whether --with-sage was given. +if test ${with_sage+y} +then : + withval=$with_sage; SAGE_DIRECTORY=$withval +fi + + +if test $native_ycocg = yes +then + +printf '%s\n' "#define SAGE_NATIVE_DXT5YCOCG 1" >>confdefs.h + +fi + +# if directory not set manually, use default installation location +if test -z "$SAGE_DIRECTORY"; then + SAGE_DIRECTORY=/usr/local/sage +fi + +if test $sage_req != no; then + SAGE_INC=$SAGE_DIRECTORY/include + SAGE_LIB=$SAGE_DIRECTORY/lib64 + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lsail" >&5 +printf %s "checking for main in -lsail... " >&6; } +if test ${ac_cv_lib_sail_main+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lsail -lquanta -I${SAGE_INC} -L${SAGE_LIB} $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_sail_main=yes +else case e in #( + e) ac_cv_lib_sail_main=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sail_main" >&5 +printf '%s\n' "$ac_cv_lib_sail_main" >&6; } +if test "x$ac_cv_lib_sail_main" = xyes +then : + FOUND_SAGE_L=yes +else case e in #( + e) FOUND_SAGE_L=no ;; +esac +fi + + # if library not found in lib64/ try lib/ + if test $FOUND_SAGE_L = no + then + SAGE_LIB=$SAGE_DIRECTORY/lib + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for main in -lsail" >&5 +printf %s "checking for main in -lsail... " >&6; } +if test ${ac_cv_lib_sail_main+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lsail -lquanta -I${SAGE_INC} -L${SAGE_LIB} $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_sail_main=yes +else case e in #( + e) ac_cv_lib_sail_main=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sail_main" >&5 +printf '%s\n' "$ac_cv_lib_sail_main" >&6; } +if test "x$ac_cv_lib_sail_main" = xyes +then : + FOUND_SAGE_L=yes +else case e in #( + e) FOUND_SAGE_L=no ;; +esac +fi + + fi + + for ac_header in ${SAGE_INC}/sail.h +do : + as_ac_Header=`printf '%s\n' "ac_cv_header_$ac_header" | sed "$as_sed_sh"` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : + cat >>confdefs.h <<_ACEOF +#define `printf '%s\n' "HAVE_$ac_header" | sed "$as_sed_cpp"` 1 +_ACEOF + FOUND_SAGE_H=yes +else case e in #( + e) FOUND_SAGE_H=no ;; +esac +fi + +done + + if test $FOUND_SAGE_L = yes && test $FOUND_SAGE_H = yes + then + SAGE_INC=-I${SAGE_INC} + SAGE_LIB=-"L${SAGE_LIB} -lsail -lquanta" + SAGE_OBJ="src/video_display/sage.o" + CXXFLAGS="$CXXFLAGS -DQUANTA_USE_PTHREADS -DQUANTA_THREAD_SAFE -DGLSL_YUV" + add_module display_sage "$SAGE_OBJ" "$SAGE_LIB" + INC="$INC $SAGE_INC" + sage=yes + fi +fi + + +if { test "$sage_req" != no && test "$sage_req" != auto ;} && test "$sage " = no; then + as_fn_error $? "SAGE not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# AUDIO stuff + +portaudio=no + +# Check whether --enable-portaudio was given. +if test ${enable_portaudio+y} +then : + enableval=$enable_portaudio; portaudio_req=$enableval +else case e in #( + e) portaudio_req=$build_default ;; +esac +fi + + + +SAVED_LIBS=$LIBS + +if test $portaudio_req != no; then + ac_fn_c_check_header_compile "$LINENO" "portaudio.h" "ac_cv_header_portaudio_h" "$ac_includes_default" +if test "x$ac_cv_header_portaudio_h" = xyes +then : + +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Pa_GetDeviceCount in -lportaudio" >&5 +printf %s "checking for Pa_GetDeviceCount in -lportaudio... " >&6; } +if test ${ac_cv_lib_portaudio_Pa_GetDeviceCount+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char Pa_GetDeviceCount (void); +int +main (void) +{ +return Pa_GetDeviceCount (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_portaudio_Pa_GetDeviceCount=yes +else case e in #( + e) ac_cv_lib_portaudio_Pa_GetDeviceCount=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portaudio_Pa_GetDeviceCount" >&5 +printf '%s\n' "$ac_cv_lib_portaudio_Pa_GetDeviceCount" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_GetDeviceCount" = xyes +then : + printf '%s\n' "#define HAVE_LIBPORTAUDIO 1" >>confdefs.h + + LIBS="-lportaudio $LIBS" + +fi + # present in v19 + LIBS=$SAVED_LIBS + + if test $ac_cv_lib_portaudio_Pa_GetDeviceCount = yes && test $ac_cv_header_portaudio_h = yes + then + PORTAUDIO_LIB='-lportaudio' + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for Pa_GetVersionInfo in -lportaudio" >&5 +printf %s "checking for Pa_GetVersionInfo in -lportaudio... " >&6; } +if test ${ac_cv_lib_portaudio_Pa_GetVersionInfo+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lportaudio $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char Pa_GetVersionInfo (void); +int +main (void) +{ +return Pa_GetVersionInfo (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_portaudio_Pa_GetVersionInfo=yes +else case e in #( + e) ac_cv_lib_portaudio_Pa_GetVersionInfo=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portaudio_Pa_GetVersionInfo" >&5 +printf '%s\n' "$ac_cv_lib_portaudio_Pa_GetVersionInfo" >&6; } +if test "x$ac_cv_lib_portaudio_Pa_GetVersionInfo" = xyes +then : + +printf '%s\n' "#define HAVE_PA_GETVERSIONINFO 1" >>confdefs.h + +fi + + PORTAUDIO_CAP_OBJ="src/audio/portaudio_common.o src/audio/capture/portaudio.o" + PORTAUDIO_PLAY_OBJ="src/audio/portaudio_common.o src/audio/playback/portaudio.o" + add_module acap_portaudio "$PORTAUDIO_CAP_OBJ" "$PORTAUDIO_LIB" + add_module aplay_portaudio "$PORTAUDIO_PLAY_OBJ" "$PORTAUDIO_LIB" + portaudio=yes + fi +fi + + +if { test "$portaudio_req" != no && test "$portaudio_req" != auto ;} && test "$portaudio" = no; then + as_fn_error $? "PortAudio not found" "$LINENO" 5; +fi + + +# --------------------------------------------------------------------------- +# SpeexDSP +# --------------------------------------------------------------------------- +speexdsp=no + +# Check whether --enable-speexdsp was given. +if test ${enable_speexdsp+y} +then : + enableval=$enable_speexdsp; speexdsp_req=$enableval +else case e in #( + e) speexdsp_req=$build_default ;; +esac +fi + + +if test "$speexdsp_req" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for speexdsp" >&5 +printf %s "checking for speexdsp... " >&6; } + +if test -n "$LIBSPEEXDSP_CFLAGS"; then + pkg_cv_LIBSPEEXDSP_CFLAGS="$LIBSPEEXDSP_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"speexdsp\""; } >&5 + ($PKG_CONFIG --exists --print-errors "speexdsp") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBSPEEXDSP_CFLAGS=`$PKG_CONFIG --cflags "speexdsp" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBSPEEXDSP_LIBS"; then + pkg_cv_LIBSPEEXDSP_LIBS="$LIBSPEEXDSP_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"speexdsp\""; } >&5 + ($PKG_CONFIG --exists --print-errors "speexdsp") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBSPEEXDSP_LIBS=`$PKG_CONFIG --libs "speexdsp" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBSPEEXDSP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "speexdsp" 2>&1` + else + LIBSPEEXDSP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "speexdsp" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBSPEEXDSP_PKG_ERRORS" >&5 + + found_speexdsp=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_speexdsp=no +else + LIBSPEEXDSP_CFLAGS=$pkg_cv_LIBSPEEXDSP_CFLAGS + LIBSPEEXDSP_LIBS=$pkg_cv_LIBSPEEXDSP_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_speexdsp=yes +fi + + if test "$found_speexdsp" = yes; then + OBJS="$OBJS src/audio/echo.o" + LIBS="$LIBS $LIBSPEEXDSP_LIBS" + COMMON_FLAGS="$COMMON_FLAGS${SPEEXDSP_COMMON_FLAGS:+${COMMON_FLAGS:+ }}$SPEEXDSP_COMMON_FLAGS" + +printf '%s\n' "#define HAVE_SPEEXDSP 1" >>confdefs.h + + speexdsp=yes + fi +fi + +if { test "$speexdsp_req" != no && test "$speexdsp_req" != auto ;} && test "$speexdsp" = no; then + as_fn_error $? "SpeexDSP not found" "$LINENO" 5; +fi + + +# --------------------------------------------------------------------------- +# SOXR +# --------------------------------------------------------------------------- +soxr=no + +# Check whether --enable-soxr was given. +if test ${enable_soxr+y} +then : + enableval=$enable_soxr; soxr_req=$enableval +else case e in #( + e) soxr_req=$build_default ;; +esac +fi + + +if test "$soxr_req" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for soxr" >&5 +printf %s "checking for soxr... " >&6; } + +if test -n "$LIBSOXR_CFLAGS"; then + pkg_cv_LIBSOXR_CFLAGS="$LIBSOXR_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"soxr\""; } >&5 + ($PKG_CONFIG --exists --print-errors "soxr") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBSOXR_CFLAGS=`$PKG_CONFIG --cflags "soxr" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBSOXR_LIBS"; then + pkg_cv_LIBSOXR_LIBS="$LIBSOXR_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"soxr\""; } >&5 + ($PKG_CONFIG --exists --print-errors "soxr") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBSOXR_LIBS=`$PKG_CONFIG --libs "soxr" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBSOXR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "soxr" 2>&1` + else + LIBSOXR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "soxr" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBSOXR_PKG_ERRORS" >&5 + + found_soxr=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_soxr=no +else + LIBSOXR_CFLAGS=$pkg_cv_LIBSOXR_CFLAGS + LIBSOXR_LIBS=$pkg_cv_LIBSOXR_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_soxr=yes +fi + if test "$found_soxr" = yes; then + LIBS="$LIBS $LIBSOXR_LIBS" + COMMON_FLAGS="$COMMON_FLAGS${LIBSOXR_CFLAGS:+${COMMON_FLAGS:+ }}$LIBSOXR_CFLAGS" + +printf '%s\n' "#define HAVE_SOXR 1" >>confdefs.h + + soxr=yes + fi +fi + +if { test "$soxr_req" != no && test "$soxr_req" != auto ;} && test "$soxr" = no; then + as_fn_error $? "Soxr not found" "$LINENO" 5; +fi + + +if test "$found_speexdsp" = no && test "$speexdsp_req" != no && test "$soxr" = no && test "$soxr_req" != no; then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Neither Soxr nor SpeexDSP was not found. Strongly recommending installing that, otherwise audio part of UG will be crippled." >&5 +printf '%s\n' "$as_me: WARNING: Neither Soxr nor SpeexDSP was not found. Strongly recommending installing that, otherwise audio part of UG will be crippled." >&2;} + WARNINGS="${WARNINGS}Neither Soxr nor SpeexDSP was not found. Strongly recommending installing that, otherwise audio part of UG will be crippled.\n" + +fi + +# --------------------------------------------------------------------------- +# Zfec +# --------------------------------------------------------------------------- +zfec=no +# Check whether --enable-zfec was given. +if test ${enable_zfec+y} +then : + enableval=$enable_zfec; zfec_req=$enableval +else case e in #( + e) zfec_req=$build_default ;; +esac +fi + + +# Check whether --with-zfec was given. +if test ${with_zfec+y} +then : + withval=$with_zfec; ZFEC_PREFIX=$withval +else case e in #( + e) ZFEC_PREFIX=$srcdir/ext-deps/zfec/zfec + ;; +esac +fi + +found_zfec=no +if test $cross_compile = no && test "$zfec_req" != no; then + as_ac_File=`printf '%s\n' "ac_cv_file_$ZFEC_PREFIX/fec.c" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ZFEC_PREFIX/fec.c" >&5 +printf %s "checking for $ZFEC_PREFIX/fec.c... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$ZFEC_PREFIX/fec.c"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi ;; +esac +fi +eval ac_res=\$$as_ac_File + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + +cat >>confdefs.h <<_ACEOF +#define `printf '%s\n' "HAVE_$ZFEC_PREFIX/fec.c" | sed "$as_sed_cpp"` 1 +_ACEOF +found_zfec=yes +fi +as_ac_File=`printf '%s\n' "ac_cv_file_$ZFEC_PREFIX/fec.h" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ZFEC_PREFIX/fec.h" >&5 +printf %s "checking for $ZFEC_PREFIX/fec.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$ZFEC_PREFIX/fec.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi ;; +esac +fi +eval ac_res=\$$as_ac_File + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + +cat >>confdefs.h <<_ACEOF +#define `printf '%s\n' "HAVE_$ZFEC_PREFIX/fec.h" | sed "$as_sed_cpp"` 1 +_ACEOF +found_zfec=yes +fi + + if test $found_zfec = no; then + ZFEC_PREFIX=/usr/lib/python3/dist-packages/zfec + if test ! -d "$ZFEC_PREFIX"; then + ZFEC_PREFIX=$(echo /usr/lib/python* | sed 's/.* \([^ ]*\)/\1/')/site-packages/zfec + fi + if test ! -d "$ZFEC_PREFIX"; then + ZFEC_PREFIX=/usr/local/src/zfec + fi + if test ! -d "$ZFEC_PREFIX"; then + ZFEC_PREFIX=/usr/src/zfec + fi + as_ac_File=`printf '%s\n' "ac_cv_file_$ZFEC_PREFIX/fec.c" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ZFEC_PREFIX/fec.c" >&5 +printf %s "checking for $ZFEC_PREFIX/fec.c... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$ZFEC_PREFIX/fec.c"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi ;; +esac +fi +eval ac_res=\$$as_ac_File + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + +cat >>confdefs.h <<_ACEOF +#define `printf '%s\n' "HAVE_$ZFEC_PREFIX/fec.c" | sed "$as_sed_cpp"` 1 +_ACEOF +found_zfec=yes +fi +as_ac_File=`printf '%s\n' "ac_cv_file_$ZFEC_PREFIX/fec.h" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ZFEC_PREFIX/fec.h" >&5 +printf %s "checking for $ZFEC_PREFIX/fec.h... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$ZFEC_PREFIX/fec.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi ;; +esac +fi +eval ac_res=\$$as_ac_File + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + +cat >>confdefs.h <<_ACEOF +#define `printf '%s\n' "HAVE_$ZFEC_PREFIX/fec.h" | sed "$as_sed_cpp"` 1 +_ACEOF +found_zfec=yes +fi + + fi + if test "$found_zfec" = yes; then + S_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -I$ZFEC_PREFIX" + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking fec_init declaration in fec.h" >&5 +printf %s "checking fec_init declaration in fec.h... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include "fec.h" + +int +main (void) +{ + + #pragma GCC diagnostic error "-Wimplicit-function-declaration" + fec_init(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + fec_init=yes +else case e in #( + e) fec_init=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CFLAGS=$S_CFLAGS + if test "$fec_init" = yes; then + +printf '%s\n' "#define HAVE_FEC_INIT 1" >>confdefs.h + + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $fec_init" >&5 +printf '%s\n' "$fec_init" >&6; } + fi +fi + +if test "$found_zfec" = yes; then + OBJS="$OBJS src/zfec.o" + COMMON_FLAGS="$COMMON_FLAGS -I$ZFEC_PREFIX" + +printf '%s\n' "#define HAVE_ZFEC 1" >>confdefs.h + + + zfec=yes +fi + +if { test "$zfec_req" != no && test "$zfec_req" != auto ;} && test "$found_zfec" = no; then + as_fn_error $? "Zfec not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# +# Jack stuff +# + +# transport +jack_trans=no +jack=no + +# Check whether --enable-jack-transport was given. +if test ${enable_jack_transport+y} +then : + enableval=$enable_jack_transport; jack_trans_req=$enableval +else case e in #( + e) jack_trans_req=$build_default ;; +esac +fi + + +# sound system +# Check whether --enable-jack was given. +if test ${enable_jack+y} +then : + enableval=$enable_jack; jack_req=$enableval +else case e in #( + e) jack_req=$build_default ;; +esac +fi + + +FOUND_JACK_H=no +if test $jack_trans_req != no || test $jack_req != no; then + ac_fn_c_check_header_compile "$LINENO" "jack/jack.h" "ac_cv_header_jack_jack_h" "$ac_includes_default" +if test "x$ac_cv_header_jack_jack_h" = xyes +then : + FOUND_JACK_H=yes +else case e in #( + e) FOUND_JACK_H=no ;; +esac +fi + +fi + +if test "${system?}" != Windows; then + JACK_LIBS=-ldl +fi + +if test "${jack_trans_req?}" != no && test "${FOUND_JACK_H?}" = yes +then + OBJS="$OBJS src/audio/jack.o" + LIBS="$LIBS${JACK_LIBS:+ $JACK_LIBS}" + +printf '%s\n' "#define HAVE_JACK_TRANS 1" >>confdefs.h + + jack_trans=yes +fi + +if test "${jack_req?}" != no && test "${FOUND_JACK_H?}" = yes +then + JACK_CAP_OBJ="src/audio/capture/jack.o" + JACK_PLAY_OBJ="src/audio/playback/jack.o" + jack=yes + add_module acap_jack "$JACK_CAP_OBJ" "${JACK_LIBS-}" + add_module aplay_jack "$JACK_PLAY_OBJ" "${JACK_LIBS-}" +fi + + +if { test "$jack_req" != no && test "$jack_req" != auto ;} && test "$jack" = no; then + as_fn_error $? "JACK not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# +# ALSA +# +alsa=no +# Check whether --enable-alsa was given. +if test ${enable_alsa+y} +then : + enableval=$enable_alsa; alsa_req=$enableval +else case e in #( + e) alsa_req=$build_default ;; +esac +fi + + +if test "$alsa_req" = yes || { test "$alsa_req" != no && test "$system" = Linux ; }; then + ac_fn_c_check_header_compile "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default" +if test "x$ac_cv_header_alsa_asoundlib_h" = xyes +then : + +fi + + SAVED_LIBS=$LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for snd_pcm_open in -lasound" >&5 +printf %s "checking for snd_pcm_open in -lasound... " >&6; } +if test ${ac_cv_lib_asound_snd_pcm_open+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lasound $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char snd_pcm_open (void); +int +main (void) +{ +return snd_pcm_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_asound_snd_pcm_open=yes +else case e in #( + e) ac_cv_lib_asound_snd_pcm_open=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_pcm_open" >&5 +printf '%s\n' "$ac_cv_lib_asound_snd_pcm_open" >&6; } +if test "x$ac_cv_lib_asound_snd_pcm_open" = xyes +then : + printf '%s\n' "#define HAVE_LIBASOUND 1" >>confdefs.h + + LIBS="-lasound $LIBS" + +fi + + LIBS=$SAVED_LIBS + if test "$ac_cv_header_alsa_asoundlib_h" = yes && test "$ac_cv_lib_asound_snd_pcm_open" = yes; then + alsa=yes + ALSA_CAP_OBJ="src/audio/capture/alsa.o" + ALSA_PLAY_OBJ="src/audio/playback/alsa.o" + ALSA_LIB="-lasound" + add_module acap_alsa "$ALSA_CAP_OBJ" "$ALSA_LIB" + add_module aplay_alsa "$ALSA_PLAY_OBJ" "$ALSA_LIB" + fi +fi + + +if { test "$alsa_req" != no && test "$alsa_req" != auto ;} && test "$alsa" = no; then + as_fn_error $? "ALSA not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# CoreAudio Stuff + +coreaudio=no + +# Check whether --enable-coreaudio was given. +if test ${enable_coreaudio+y} +then : + enableval=$enable_coreaudio; coreaudio_req=$enableval +else case e in #( + e) coreaudio_req=$build_default + ;; +esac +fi + + + +if test $system = MacOSX && test $coreaudio_req != no; then + for ac_header in AudioUnit/AudioUnit.h +do : + ac_fn_c_check_header_compile "$LINENO" "AudioUnit/AudioUnit.h" "ac_cv_header_AudioUnit_AudioUnit_h" "$ac_includes_default" +if test "x$ac_cv_header_AudioUnit_AudioUnit_h" = xyes +then : + printf '%s\n' "#define HAVE_AUDIOUNIT_AUDIOUNIT_H 1" >>confdefs.h + FOUND_AUDIOUNIT_H=yes +else case e in #( + e) echo "AudioUnit headers not found." ;; +esac +fi + +done + + if test $FOUND_AUDIOUNIT_H = yes + then + COREAUDIO_LIB="-framework CoreAudio -framework AudioUnit -framework AVFoundation" + COREAUDIO_OBJ="src/audio/capture/coreaudio.o src/audio/playback/coreaudio.o" + coreaudio=yes + add_module "" "$COREAUDIO_OBJ" "$COREAUDIO_LIB" + fi +fi + + +if { test "$coreaudio_req" != no && test "$coreaudio_req" != auto ;} && test "$coreaudio" = no; then + as_fn_error $? "Core Audio not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Scale Stuff +# ------------------------------------------------------------------------------------------------- + +scale=no + +# Check whether --enable-scale was given. +if test ${enable_scale+y} +then : + enableval=$enable_scale; scale_req=$enableval +else case e in #( + e) scale_req=$build_default + ;; +esac +fi + + +if test "${scale_req?}" != no && test "${OPENGL_COMMON?}" = yes +then + scale=yes + SCALE_LIB="$SCALE_LIB $OPENGL_LIB" + SCALE_OBJ="$SCALE_OBJ $GL_COMMON_OBJ src/vo_postprocess/scale.o" + add_module vo_pp_scale "$SCALE_OBJ" "$SCALE_LIB" +fi + + +if { test "$scale_req" != no && test "$scale_req" != auto ;} && test "$scale" = no; then + as_fn_error $? "Scale not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Text Stuff +# ------------------------------------------------------------------------------------------------- + +text=no + + + +# Check whether --enable-text was given. +if test ${enable_text+y} +then : + enableval=$enable_text; text_req=$enableval +else case e in #( + e) text_req=$build_default + ;; +esac +fi + + +if test $text_req != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for MagickWand" >&5 +printf %s "checking for MagickWand... " >&6; } + +if test -n "$TEXT_CFLAGS"; then + pkg_cv_TEXT_CFLAGS="$TEXT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickWand\""; } >&5 + ($PKG_CONFIG --exists --print-errors "MagickWand") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_TEXT_CFLAGS=`$PKG_CONFIG --cflags "MagickWand" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$TEXT_LIBS"; then + pkg_cv_TEXT_LIBS="$TEXT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickWand\""; } >&5 + ($PKG_CONFIG --exists --print-errors "MagickWand") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_TEXT_LIBS=`$PKG_CONFIG --libs "MagickWand" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + TEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "MagickWand" 2>&1` + else + TEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "MagickWand" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$TEXT_PKG_ERRORS" >&5 + + FOUND_TEXT_DEPS=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_TEXT_DEPS=no +else + TEXT_CFLAGS=$pkg_cv_TEXT_CFLAGS + TEXT_LIBS=$pkg_cv_TEXT_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_TEXT_DEPS=yes +fi + if test "$FOUND_TEXT_DEPS" = yes; then + text=yes + COMMON_FLAGS="$COMMON_FLAGS $TEXT_CFLAGS" + TEXT_LIB="$TEXT_LIBS" + TEXT_OBJ="$TEXT_OBJ src/vo_postprocess/text.o" + CFLAGS="$CFLAGS $MAGICKWAND_CFLAGS" + add_module vo_pp_text "$TEXT_OBJ" "$TEXT_LIB" + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for MagickWand > 7" >&5 +printf %s "checking for MagickWand > 7... " >&6; } + +if test -n "$WAND7_CFLAGS"; then + pkg_cv_WAND7_CFLAGS="$WAND7_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickWand > 7\""; } >&5 + ($PKG_CONFIG --exists --print-errors "MagickWand > 7") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAND7_CFLAGS=`$PKG_CONFIG --cflags "MagickWand > 7" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$WAND7_LIBS"; then + pkg_cv_WAND7_LIBS="$WAND7_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"MagickWand > 7\""; } >&5 + ($PKG_CONFIG --exists --print-errors "MagickWand > 7") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_WAND7_LIBS=`$PKG_CONFIG --libs "MagickWand > 7" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + WAND7_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "MagickWand > 7" 2>&1` + else + WAND7_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "MagickWand > 7" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$WAND7_PKG_ERRORS" >&5 + + FOUND_WAND7=NO +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_WAND7=NO +else + WAND7_CFLAGS=$pkg_cv_WAND7_CFLAGS + WAND7_LIBS=$pkg_cv_WAND7_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_WAND7=yes +fi + if test "$FOUND_WAND7" = yes; then + +printf '%s\n' "#define WAND7 1" >>confdefs.h + + fi + fi +fi + + +if { test "$text_req" != no && test "$text_req" != auto ;} && test "$text" = no; then + as_fn_error $? "text not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# QT GUI + +qt_gui=no +static_qt=no + +GUI_EXE= +GUI_TARGET= + +QMAKE= +#qmake # default for most distributions + +# Check whether --enable-qt was given. +if test ${enable_qt+y} +then : + enableval=$enable_qt; qt_req=$enableval +else case e in #( + e) qt_req=no + ;; +esac +fi + + +# Check whether --enable-static-qt was given. +if test ${enable_static_qt+y} +then : + enableval=$enable_static_qt; static_qt=$enableval +else case e in #( + e) static_qt=no + ;; +esac +fi + + +if test "$qt_req" != no; then + for ac_prog in qmake qmake6 qmake-qt5 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_QMAKE+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $QMAKE in + [\\/]* | ?:[\\/]*) + ac_cv_path_QMAKE="$QMAKE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="/usr/lib/qt5/bin:$PATH" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_QMAKE="$as_dir$ac_word$ac_exec_ext" + printf '%s\n' "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +QMAKE=$ac_cv_path_QMAKE +if test -n "$QMAKE"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $QMAKE" >&5 +printf '%s\n' "$QMAKE" >&6; } +else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } +fi + + + test -n "$QMAKE" && break +done +test -n "$QMAKE" || QMAKE=":" + + #AC_MSG_NOTICE("Qmake: $QMAKE") + if test $QMAKE != :; then + GUI_TARGET=gui/QT/uv-qt$APPEXT + GUI_EXE=$GUI_TARGET + if test $system = MacOSX; then + GUI_EXE=$GUI_TARGET/Contents/MacOS/uv-qt + fi + qt_gui=yes + fi +fi + + + + + + +if { test "$qt_req" != no && test "$qt_req" != auto ;} && test "$qt_gui" = no; then + as_fn_error $? "Qt libraries are required." "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# V4L2 +# ------------------------------------------------------------------------------------------------- +v4l2=no +found_v4l2=no + +# Check whether --enable-v4l2 was given. +if test ${enable_v4l2+y} +then : + enableval=$enable_v4l2; v4l2_req=$enableval +else case e in #( + e) v4l2_req=$build_default + ;; +esac +fi + + +if test "$system" = Linux && test "$v4l2_req" != no +then + ac_fn_c_check_header_compile "$LINENO" "linux/videodev2.h" "ac_cv_header_linux_videodev2_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_videodev2_h" = xyes +then : + printf '%s\n' "#define HAVE_LINUX_VIDEODEV2_H 1" >>confdefs.h + +fi + +fi + +if test "$ac_cv_header_linux_videodev2_h" = yes; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libv4lconvert" >&5 +printf %s "checking for libv4lconvert... " >&6; } + +if test -n "$V4LCONVERT_CFLAGS"; then + pkg_cv_V4LCONVERT_CFLAGS="$V4LCONVERT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libv4lconvert\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libv4lconvert") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_V4LCONVERT_CFLAGS=`$PKG_CONFIG --cflags "libv4lconvert" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$V4LCONVERT_LIBS"; then + pkg_cv_V4LCONVERT_LIBS="$V4LCONVERT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libv4lconvert\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libv4lconvert") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_V4LCONVERT_LIBS=`$PKG_CONFIG --libs "libv4lconvert" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + V4LCONVERT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libv4lconvert" 2>&1` + else + V4LCONVERT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libv4lconvert" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$V4LCONVERT_PKG_ERRORS" >&5 + + found_v4lconvert=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_v4lconvert=no +else + V4LCONVERT_CFLAGS=$pkg_cv_V4LCONVERT_CFLAGS + V4LCONVERT_LIBS=$pkg_cv_V4LCONVERT_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_v4lconvert=yes +fi + if test $found_v4lconvert = yes; then + +printf '%s\n' "#define HAVE_LIBV4LCONVERT 1" >>confdefs.h + + elif test "$v4l2_req" = yes; then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: Compiling V4L2 capture without v4lconvert support (not found)." >&5 +printf '%s\n' "$as_me: WARNING: Compiling V4L2 capture without v4lconvert support (not found)." >&2;} + WARNINGS="${WARNINGS}Compiling V4L2 capture without v4lconvert support (not found).\n" + + fi + V4L2_CAP_OBJ="src/video_capture/v4l2.o" + V4L2_DISP_OBJ="src/video_display/v4l2.o" + add_module vidcap_v4l2 "$V4L2_CAP_OBJ" "$V4LCONVERT_LIBS" + add_module display_v4l2 "$V4L2_DISP_OBJ" + CFLAGS="$CFLAGS $V4LCONVERT_CFLAGS" + v4l2=yes +fi + + +if { test "$v4l2_req" != no && test "$v4l2_req" != auto ;} && test "$v4l2" = no; then + as_fn_error $? "V4L2 not found" "$LINENO" 5; +fi + + +# ----------------------------------------------------------------------------- +# WASAPI +# ----------------------------------------------------------------------------- +wasapi=no +# Check whether --enable-wasapi was given. +if test ${enable_wasapi+y} +then : + enableval=$enable_wasapi; wasapi_req=$enableval +else case e in #( + e) wasapi_req=$build_default + ;; +esac +fi + + +if test "${system?}" = Windows && test "${wasapi_req?}" != no; then + add_module aplay_wasapi "src/audio/capture/wasapi.o src/audio/playback/wasapi.o" + wasapi=yes +fi + + +if { test "$wasapi_req" != no && test "$wasapi_req" != auto ;} && test "$wasapi" = no; then + as_fn_error $? "WASAPI not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# iHDTV +# ------------------------------------------------------------------------------------------------- +# Check whether --enable-ihdtv was given. +if test ${enable_ihdtv+y} +then : + enableval=$enable_ihdtv; ihdtv_req=$enableval +else case e in #( + e) ihdtv_req=no + ;; +esac +fi + +ihdtv=no + +if test $ihdtv_req = yes +then + +printf '%s\n' "#define HAVE_IHDTV 1" >>confdefs.h + + ihdtv=yes +fi + +# ------------------------------------------------------------------------------------------------- +# use shared decoder +# ------------------------------------------------------------------------------------------------- + +# the shared behaviour is faulty, but it saves resources when restarting sender (different SSRC). +shared_decoder=no +if test $shared_decoder = yes +then + +printf '%s\n' "#define SHARED_DECODER 1" >>confdefs.h + +fi + +# ------------------------------------------------------------------------------------------------- +# OpenSSL-libcrypto +# ------------------------------------------------------------------------------------------------- +crypto=no +crypto_impl= +# Check whether --enable-openssl was given. +if test ${enable_openssl+y} +then : + enableval=$enable_openssl; crypto_req=$enableval +else case e in #( + e) crypto_req=$build_default + ;; +esac +fi + + +check_required_ciphers() { + SAVED_LIBS=$LIBS + LIBS="$LIBS $CRYPTO_LIBS" + + for ac_func in EVP_aes_128_cbc +do : + ac_fn_c_check_func "$LINENO" "EVP_aes_128_cbc" "ac_cv_func_EVP_aes_128_cbc" +if test "x$ac_cv_func_EVP_aes_128_cbc" = xyes +then : + printf '%s\n' "#define HAVE_EVP_AES_128_CBC 1" >>confdefs.h + +else case e in #( + e) + for ac_func in wolfSSL_EVP_aes_128_cbc +do : + ac_fn_c_check_func "$LINENO" "wolfSSL_EVP_aes_128_cbc" "ac_cv_func_wolfSSL_EVP_aes_128_cbc" +if test "x$ac_cv_func_wolfSSL_EVP_aes_128_cbc" = xyes +then : + printf '%s\n' "#define HAVE_WOLFSSL_EVP_AES_128_CBC 1" >>confdefs.h + +else case e in #( + e) crypto_impl= ;; +esac +fi + +done ;; +esac +fi + +done + + for ac_func in EVP_aes_128_gcm +do : + ac_fn_c_check_func "$LINENO" "EVP_aes_128_gcm" "ac_cv_func_EVP_aes_128_gcm" +if test "x$ac_cv_func_EVP_aes_128_gcm" = xyes +then : + printf '%s\n' "#define HAVE_EVP_AES_128_GCM 1" >>confdefs.h + +else case e in #( + e) + for ac_func in wolfSSL_EVP_aes_128_gcm +do : + ac_fn_c_check_func "$LINENO" "wolfSSL_EVP_aes_128_gcm" "ac_cv_func_wolfSSL_EVP_aes_128_gcm" +if test "x$ac_cv_func_wolfSSL_EVP_aes_128_gcm" = xyes +then : + printf '%s\n' "#define HAVE_WOLFSSL_EVP_AES_128_GCM 1" >>confdefs.h + +else case e in #( + e) crypto_impl= ;; +esac +fi + +done ;; +esac +fi + +done + LIBS=$SAVED_LIBS +} + +if test "$crypto_req" != no && test "$crypto_req" != wolfssl; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libcrypto" >&5 +printf %s "checking for libcrypto... " >&6; } + +if test -n "$CRYPTO_CFLAGS"; then + pkg_cv_CRYPTO_CFLAGS="$CRYPTO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcrypto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcrypto") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CRYPTO_CFLAGS=`$PKG_CONFIG --cflags "libcrypto" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CRYPTO_LIBS"; then + pkg_cv_CRYPTO_LIBS="$CRYPTO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcrypto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcrypto") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CRYPTO_LIBS=`$PKG_CONFIG --libs "libcrypto" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CRYPTO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcrypto" 2>&1` + else + CRYPTO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcrypto" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CRYPTO_PKG_ERRORS" >&5 + + crypto_impl= +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + crypto_impl= +else + CRYPTO_CFLAGS=$pkg_cv_CRYPTO_CFLAGS + CRYPTO_LIBS=$pkg_cv_CRYPTO_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + crypto_impl=OpenSSL +fi + if test -n "$crypto_impl"; then + SAVED_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $CRYPTO_CFLAGS" + ac_fn_c_check_header_compile "$LINENO" "openssl/aes.h" "ac_cv_header_openssl_aes_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_aes_h" = xyes +then : + FOUND_CRYPTO_H=yes +else case e in #( + e) FOUND_CRYPTO_H=no ;; +esac +fi + + if test $FOUND_CRYPTO_H = no; then + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: libcrypto.pc found but openssl/aes.h is not present. This is usually caused by presence of /usr/lib/pkgconfig/libcrypto.pc on macOS. You can install OpenSSL from Homebrew and set PKG_CONFIG_PATH accordingly (see 'brew ln openssl') OR use WolfSSL instead of OpenSSL." >&5 +printf '%s\n' "$as_me: WARNING: libcrypto.pc found but openssl/aes.h is not present. This is usually caused by presence of /usr/lib/pkgconfig/libcrypto.pc on macOS. You can install OpenSSL from Homebrew and set PKG_CONFIG_PATH accordingly (see 'brew ln openssl') OR use WolfSSL instead of OpenSSL." >&2;} + WARNINGS="${WARNINGS}libcrypto.pc found but openssl/aes.h is not present. This is usually caused by presence of /usr/lib/pkgconfig/libcrypto.pc on macOS. You can install OpenSSL from Homebrew and set PKG_CONFIG_PATH accordingly (see 'brew ln openssl') OR use WolfSSL instead of OpenSSL.\n" + + crypto_impl= + fi + CFLAGS=$SAVED_CFLAGS + check_required_ciphers + fi +fi +if test -z "$crypto_impl" && test "$crypto_req" != no && test "$crypto_req" != openssl; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for wolfssl" >&5 +printf %s "checking for wolfssl... " >&6; } + +if test -n "$CRYPTO_CFLAGS"; then + pkg_cv_CRYPTO_CFLAGS="$CRYPTO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wolfssl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wolfssl") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CRYPTO_CFLAGS=`$PKG_CONFIG --cflags "wolfssl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CRYPTO_LIBS"; then + pkg_cv_CRYPTO_LIBS="$CRYPTO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"wolfssl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "wolfssl") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CRYPTO_LIBS=`$PKG_CONFIG --libs "wolfssl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CRYPTO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "wolfssl" 2>&1` + else + CRYPTO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "wolfssl" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CRYPTO_PKG_ERRORS" >&5 + + crypto_impl= +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + crypto_impl= +else + CRYPTO_CFLAGS=$pkg_cv_CRYPTO_CFLAGS + CRYPTO_LIBS=$pkg_cv_CRYPTO_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + crypto_impl=wolfSSL +fi + if test -n "$crypto_impl"; then + check_required_ciphers + +printf '%s\n' "#define HAVE_WOLFSSL 1" >>confdefs.h + + fi +fi + +if test -n "$crypto_impl"; then + crypto=yes + crypto_impl=" ($crypto_impl)" + OPENSSL_OBJ="src/crypto/openssl_encrypt.o src/crypto/openssl_decrypt.o" + CFLAGS="$CFLAGS $CRYPTO_CFLAGS" + CXXFLAGS="$CXXFLAGS $CRYPTO_CFLAGS" + CPPFLAGS="$CPPFLAGS $CRYPTO_CFLAGS" + add_module openssl "$OPENSSL_OBJ" "$CRYPTO_LIBS" + SAVED_LIBS=$LIBS + LIBS="$LIBS $CRYPTO_LIBS" + # optional ciphers + ac_fn_c_check_func "$LINENO" "EVP_aes_128_cfb128" "ac_cv_func_EVP_aes_128_cfb128" +if test "x$ac_cv_func_EVP_aes_128_cfb128" = xyes +then : + printf '%s\n' "#define HAVE_EVP_AES_128_CFB128 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "EVP_aes_128_ctr" "ac_cv_func_EVP_aes_128_ctr" +if test "x$ac_cv_func_EVP_aes_128_ctr" = xyes +then : + printf '%s\n' "#define HAVE_EVP_AES_128_CTR 1" >>confdefs.h + +fi + + ac_fn_c_check_func "$LINENO" "EVP_aes_128_ecb" "ac_cv_func_EVP_aes_128_ecb" +if test "x$ac_cv_func_EVP_aes_128_ecb" = xyes +then : + printf '%s\n' "#define HAVE_EVP_AES_128_ECB 1" >>confdefs.h + +fi + + + for ac_func in wolfSSL_EVP_aes_128_cfb128 +do : + ac_fn_c_check_func "$LINENO" "wolfSSL_EVP_aes_128_cfb128" "ac_cv_func_wolfSSL_EVP_aes_128_cfb128" +if test "x$ac_cv_func_wolfSSL_EVP_aes_128_cfb128" = xyes +then : + printf '%s\n' "#define HAVE_WOLFSSL_EVP_AES_128_CFB128 1" >>confdefs.h + +printf '%s\n' "#define HAVE_EVP_AES_128_CFB128 1" >>confdefs.h + +fi + +done + + for ac_func in wolfSSL_EVP_aes_128_ctr +do : + ac_fn_c_check_func "$LINENO" "wolfSSL_EVP_aes_128_ctr" "ac_cv_func_wolfSSL_EVP_aes_128_ctr" +if test "x$ac_cv_func_wolfSSL_EVP_aes_128_ctr" = xyes +then : + printf '%s\n' "#define HAVE_WOLFSSL_EVP_AES_128_CTR 1" >>confdefs.h + +printf '%s\n' "#define HAVE_EVP_AES_128_CTR 1" >>confdefs.h + +fi + +done + + for ac_func in wolfSSL_EVP_aes_128_ecb +do : + ac_fn_c_check_func "$LINENO" "wolfSSL_EVP_aes_128_ecb" "ac_cv_func_wolfSSL_EVP_aes_128_ecb" +if test "x$ac_cv_func_wolfSSL_EVP_aes_128_ecb" = xyes +then : + printf '%s\n' "#define HAVE_WOLFSSL_EVP_AES_128_ECB 1" >>confdefs.h + +printf '%s\n' "#define HAVE_EVP_AES_ECB 1" >>confdefs.h + +fi + +done + LIBS=$SAVED_LIBS +fi + + +if { test "$crypto_req" != no && test "$crypto_req" != auto ;} && test "$crypto" = no; then + as_fn_error $? "OpenSSL not found" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# GPU accelerated LDGM +# ------------------------------------------------------------------------------------------------- +ldgm_gpu=no +# Check whether --enable-ldgm-gpu was given. +if test ${enable_ldgm_gpu+y} +then : + enableval=$enable_ldgm_gpu; ldgm_gpu_req=$enableval +else case e in #( + e) ldgm_gpu_req=$build_default + ;; +esac +fi + + +if test "${ldgm_gpu_req?}" != no && test "${FOUND_CUDA?}" = yes +then + LDGM_GPU_OBJS="ldgm/src/ldgm-session-gpu.o src/rtp/ldgm_gpu.o $CUDA_COMMON_OBJ" + LDGM_GPU_LIBS="$CUDA_LIB" + LDGM_GPU_OBJS="$LDGM_GPU_OBJS ldgm/src/gpu.o" + add_module ldgm_gpu "$LDGM_GPU_OBJS" "$LDGM_GPU_LIBS" + if test "${WORD_LEN?}" -eq 32 && test "${system?}" = Linux; then + CUDA_FLAGS="$CUDA_FLAGS -Xcompiler -msse2" + fi + ldgm_gpu=yes +else + ldgm_gpu=no +fi + + +if { test "$ldgm_gpu_req" != no && test "$ldgm_gpu_req" != auto ;} && test "$ldgm_gpu" = no; then + as_fn_error $? "LDGM accelerated GPU cannot be enabled (CUDA not found?)" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# Syphon +# ------------------------------------------------------------------------------------------------- +syphon=no +# Check whether --enable-syphon was given. +if test ${enable_syphon+y} +then : + enableval=$enable_syphon; syphon_req=$enableval +else case e in #( + e) syphon_req=$build_default + ;; +esac +fi + + +if test "$syphon_req" != no && test "$system" = MacOSX; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking if -framework Syphon works" >&5 +printf %s "checking if -framework Syphon works... " >&6; } +if test ${my_cv_framework_Syphon+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) save_LIBS="$LIBS" + LIBS="$LIBS -framework Syphon" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + my_cv_framework_Syphon=yes +else case e in #( + e) my_cv_framework_Syphon=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $my_cv_framework_Syphon" >&5 +printf '%s\n' "$my_cv_framework_Syphon" >&6; } + LIBS="$save_LIBS" + if test "$my_cv_framework_Syphon"="yes"; then + +printf '%s\n' "#define HAVE_FRAMEWORK_SYPHON 1" >>confdefs.h + + FRAMEWORK_SYPHON="-framework Syphon" + + fi + if test $my_cv_framework_Syphon = yes + then + +printf '%s\n' "#define HAVE_SYPHON 1" >>confdefs.h + + add_module syphon "src/syphon_server.o src/video_capture/syphon.o" "-framework Syphon" + syphon=yes + fi +fi + + +if { test "$syphon_req" != no && test "$syphon_req" != auto ;} && test "$syphon" = no; then + as_fn_error $? "Syphon framework cannot be found!" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------ +# Spout +# ------------------------------------------------------------------------------ +spout=no +# Check whether --enable-spout was given. +if test ${enable_spout+y} +then : + enableval=$enable_spout; spout_req=$enableval +else case e in #( + e) spout_req=$build_default + ;; +esac +fi + + +FOUND_SPOUT=no +missing_item="OpenGL" +if test $system = Windows && test "$spout_req" != no && test "$OPENGL_COMMON" = yes +then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + SAVED_LIBS="$LIBS" + LIBS="$LIBS -lSpoutLibrary" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +auto *spout = GetSpout(); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + FOUND_SPOUT=yes +else case e in #( + e) FOUND_SPOUT=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$SAVED_LIBS + missing_item="SpoutLibrary.h" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi + +if test $FOUND_SPOUT = yes +then + +printf '%s\n' "#define HAVE_SPOUT 1" >>confdefs.h + + add_module spout "src/spout_sender.o src/video_capture/spout.o" -lSpoutLibrary + spout=yes +fi + + +if { test "$spout_req" != no && test "$spout_req" != auto ;} && test "$spout" = no; then + as_fn_error $? "Could not found Spout dependencies: ${missing_item?}" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------- +# MCU-like video mixer +# ------------------------------------------------------------------------------------------------- +video_mix=no + +# Check whether --enable-video-mixer was given. +if test ${enable_video_mixer+y} +then : + enableval=$enable_video_mixer; video_mix_req=$enableval +else case e in #( + e) video_mix_req=$build_default + ;; +esac +fi + + +if test $video_mix_req != no && test "$opencv" = yes && test "$FOUND_OPENCV_IMGPROC" = yes; then + CFLAGS="$CFLAGS $OPENCV_CFLAGS" + CXXFLAGS="$CXXFLAGS $OPENCV_CFLAGS" + add_module display_video_mix src/video_display/conference.o "$OPENCV_LIBS -lopencv_imgproc" + video_mix=yes +fi + + +if { test "$video_mix_req" != no && test "$video_mix_req" != auto ;} && test "$video_mix" = no; then + as_fn_error $? "Could not found OpenCV needed for video mixer!" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------------------------ +# BitFlow +# ------------------------------------------------------------------------------------------------- +# Check whether --enable-bitflow was given. +if test ${enable_bitflow+y} +then : + enableval=$enable_bitflow; bitflow_req=$enableval +else case e in #( + e) bitflow_req=no + ;; +esac +fi + + +bitflow=no + +if test $bitflow_req = yes +then + LIBS="$LIBS -lBFSOciLib -lBFciLib -lBFML" + OBJS="$OBJS src/video_capture/bitflow.o" + bitflow=yes +fi + +# ------------------------------------------------------------------------------ +# Comprimato J2K +# ------------------------------------------------------------------------------ +cmpto_j2k=no +# Check whether --enable-cmpto-j2k was given. +if test ${enable_cmpto_j2k+y} +then : + enableval=$enable_cmpto_j2k; cmpto_j2k_req=$enableval +else case e in #( + e) cmpto_j2k_req=$build_default + ;; +esac +fi + + +if test $cmpto_j2k_req != no; then + ac_fn_c_check_header_compile "$LINENO" "cmpto_j2k_enc.h" "ac_cv_header_cmpto_j2k_enc_h" "$ac_includes_default" +if test "x$ac_cv_header_cmpto_j2k_enc_h" = xyes +then : + FOUND_CMPTO_J2K_ENC_H=yes +else case e in #( + e) FOUND_CMPTO_J2K_ENC_H=no ;; +esac +fi + + ac_fn_c_check_header_compile "$LINENO" "cmpto_j2k_dec.h" "ac_cv_header_cmpto_j2k_dec_h" "$ac_includes_default" +if test "x$ac_cv_header_cmpto_j2k_dec_h" = xyes +then : + FOUND_CMPTO_J2K_DEC_H=yes +else case e in #( + e) FOUND_CMPTO_J2K_DEC_H=no ;; +esac +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for cmpto_j2k_enc_ctx_cfg_create in -lcmpto_j2k_enc" >&5 +printf %s "checking for cmpto_j2k_enc_ctx_cfg_create in -lcmpto_j2k_enc... " >&6; } +if test ${ac_cv_lib_cmpto_j2k_enc_cmpto_j2k_enc_ctx_cfg_create+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lcmpto_j2k_enc $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cmpto_j2k_enc_ctx_cfg_create (void); +int +main (void) +{ +return cmpto_j2k_enc_ctx_cfg_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_cmpto_j2k_enc_cmpto_j2k_enc_ctx_cfg_create=yes +else case e in #( + e) ac_cv_lib_cmpto_j2k_enc_cmpto_j2k_enc_ctx_cfg_create=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cmpto_j2k_enc_cmpto_j2k_enc_ctx_cfg_create" >&5 +printf '%s\n' "$ac_cv_lib_cmpto_j2k_enc_cmpto_j2k_enc_ctx_cfg_create" >&6; } +if test "x$ac_cv_lib_cmpto_j2k_enc_cmpto_j2k_enc_ctx_cfg_create" = xyes +then : + FOUND_CMPTO_J2K_ENC_L=yes +else case e in #( + e) FOUND_CMPTO_J2K_ENC_L=no ;; +esac +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for cmpto_j2k_dec_ctx_cfg_create in -lcmpto_j2k_dec" >&5 +printf %s "checking for cmpto_j2k_dec_ctx_cfg_create in -lcmpto_j2k_dec... " >&6; } +if test ${ac_cv_lib_cmpto_j2k_dec_cmpto_j2k_dec_ctx_cfg_create+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lcmpto_j2k_dec $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cmpto_j2k_dec_ctx_cfg_create (void); +int +main (void) +{ +return cmpto_j2k_dec_ctx_cfg_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_cmpto_j2k_dec_cmpto_j2k_dec_ctx_cfg_create=yes +else case e in #( + e) ac_cv_lib_cmpto_j2k_dec_cmpto_j2k_dec_ctx_cfg_create=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cmpto_j2k_dec_cmpto_j2k_dec_ctx_cfg_create" >&5 +printf '%s\n' "$ac_cv_lib_cmpto_j2k_dec_cmpto_j2k_dec_ctx_cfg_create" >&6; } +if test "x$ac_cv_lib_cmpto_j2k_dec_cmpto_j2k_dec_ctx_cfg_create" = xyes +then : + FOUND_CMPTO_J2K_DEC_L=yes +else case e in #( + e) FOUND_CMPTO_J2K_DEC_L=no ;; +esac +fi + +fi +if test "$cmpto_j2k_req" != no && + test "$FOUND_CMPTO_J2K_ENC_H" = yes && + test "$FOUND_CMPTO_J2K_DEC_H" = yes && + test "$FOUND_CMPTO_J2K_ENC_L" = yes && + test "$FOUND_CMPTO_J2K_DEC_L" = yes +then + cmpto_libs= + kernels= + if test "$FOUND_CUDA" = yes; then + cmpto_libs="$CUDA_LIB" + kernels="src/cuda_wrapper/kernels.o" + else + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: CUDA is recommended for optimal cmpto_j2k performance but not found" >&5 +printf '%s\n' "$as_me: WARNING: CUDA is recommended for optimal cmpto_j2k performance but not found" >&2;} + WARNINGS="${WARNINGS}CUDA is recommended for optimal cmpto_j2k performance but not found\n" + + fi + + # OpenCL + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for OpenCL" >&5 +printf %s "checking for OpenCL... " >&6; } + +if test -n "$OpenCL_CFLAGS"; then + pkg_cv_OpenCL_CFLAGS="$OpenCL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"OpenCL\""; } >&5 + ($PKG_CONFIG --exists --print-errors "OpenCL") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OpenCL_CFLAGS=`$PKG_CONFIG --cflags "OpenCL" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OpenCL_LIBS"; then + pkg_cv_OpenCL_LIBS="$OpenCL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"OpenCL\""; } >&5 + ($PKG_CONFIG --exists --print-errors "OpenCL") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OpenCL_LIBS=`$PKG_CONFIG --libs "OpenCL" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OpenCL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "OpenCL" 2>&1` + else + OpenCL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "OpenCL" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OpenCL_PKG_ERRORS" >&5 + + found_cl=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_cl=no +else + OpenCL_CFLAGS=$pkg_cv_OpenCL_CFLAGS + OpenCL_LIBS=$pkg_cv_OpenCL_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_cl=yes +fi + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for OpenCL-Headers" >&5 +printf %s "checking for OpenCL-Headers... " >&6; } + +if test -n "$OpenCL_Headers_CFLAGS"; then + pkg_cv_OpenCL_Headers_CFLAGS="$OpenCL_Headers_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"OpenCL-Headers\""; } >&5 + ($PKG_CONFIG --exists --print-errors "OpenCL-Headers") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OpenCL_Headers_CFLAGS=`$PKG_CONFIG --cflags "OpenCL-Headers" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OpenCL_Headers_LIBS"; then + pkg_cv_OpenCL_Headers_LIBS="$OpenCL_Headers_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"OpenCL-Headers\""; } >&5 + ($PKG_CONFIG --exists --print-errors "OpenCL-Headers") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_OpenCL_Headers_LIBS=`$PKG_CONFIG --libs "OpenCL-Headers" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OpenCL_Headers_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "OpenCL-Headers" 2>&1` + else + OpenCL_Headers_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "OpenCL-Headers" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OpenCL_Headers_PKG_ERRORS" >&5 + + found_cl_h=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_cl_h=no +else + OpenCL_Headers_CFLAGS=$pkg_cv_OpenCL_Headers_CFLAGS + OpenCL_Headers_LIBS=$pkg_cv_OpenCL_Headers_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_cl_h=yes +fi + if test "${found_cl?}" = yes && test "${found_cl_h?}" = yes; then + +printf '%s\n' "#define HAVE_OPENCL 1" >>confdefs.h + + cmpto_libs="$cmpto_libs $OpenCL_LIBS" + CFLAGS="$CFLAGS${OpenCL_CFLAGS:+ $OPENCL_CFLAGS}" + CFLAGS="$CFLAGS${OpenCL_Headers_CFLAGS:+ $OPENCL_Headers_CFLAGS}" + fi + + add_module vcompress_cmpto_j2k "src/video_compress/cmpto_j2k.o \ +src/utils/opencl.o $kernels" "-lcmpto_j2k_enc $cmpto_libs" + add_module vdecompress_cmpto_j2k "src/video_decompress/cmpto_j2k.o \ +$kernels" "-lcmpto_j2k_dec $cmpto_libs" + cmpto_j2k=yes +fi + + +if { test "$cmpto_j2k_req" != no && test "$cmpto_j2k_req" != auto ;} && test "$cmpto_j2k" = no; then + as_fn_error $? "Comprimato J2K not found!" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------ +# NDI +# ------------------------------------------------------------------------------ +ndi=no +# Check whether --enable-ndi was given. +if test ${enable_ndi+y} +then : + enableval=$enable_ndi; ndi_req=$enableval +else case e in #( + e) ndi_req=$build_default + ;; +esac +fi + + + +NDI_VER= +if expr "x$ndi_req" : 'x[0-9]' >/dev/null; then + NDI_VER=$ndi_req + ndi_req=yes +fi + +if test $ndi_req != no; then + S_CPATH=$CPATH + if test -n "$NDI_SDK_DIR"; then + CPATH="$CPATH;$NDI_SDK_DIR/Include" + export CPATH + fi + ac_fn_c_check_header_compile "$LINENO" "Processing.NDI.Lib.h" "ac_cv_header_Processing_NDI_Lib_h" "$ac_includes_default" +if test "x$ac_cv_header_Processing_NDI_Lib_h" = xyes +then : + FOUND_NDI_H=yes +else case e in #( + e) FOUND_NDI_H=no ;; +esac +fi + + CPATH=$S_CPATH + + if test "$FOUND_NDI_H" = yes + then + if test -n "$NDI_SDK_DIR" && test $system = Windows; then + COMMON_FLAGS="$COMMON_FLAGS -I\"$NDI_SDK_DIR/Include\"" + fi + if test -n "$NDI_VER"; then + +printf '%s\n' "#define USE_NDI_VERSION $NDI_VER" >>confdefs.h + + fi + add_module vidcap_ndi src/video_capture/ndi.o + add_module display_ndi src/video_display/ndi.o + ndi=yes + fi +fi + + +if { test "$ndi_req" != no && test "$ndi_req" != auto ;} && test "$ndi" = no; then + as_fn_error $? "NDI not found!" "$LINENO" 5; +fi + + +# ------------------------------------------------------------------------------ +# Cineform +# ------------------------------------------------------------------------------ +CINEFORM_PATH=$srcdir/ext-deps/cineform-sdk +cineform=no + +# Check whether --enable-cineform was given. +if test ${enable_cineform+y} +then : + enableval=$enable_cineform; cineform_req=$enableval +else case e in #( + e) cineform_req=$build_default + ;; +esac +fi + + +if test -n "$CINEFORM_DIRECTORY"; then + CINEFORM_PATH=$CINEFORM_DIRECTORY +fi + + +# Check whether --with-cineform was given. +if test ${with_cineform+y} +then : + withval=$with_cineform; CINEFORM_PATH=$withval + +fi + + +if test "$cineform_req" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libcineformsdk" >&5 +printf %s "checking for libcineformsdk... " >&6; } + +if test -n "$CINEFORM_CFLAGS"; then + pkg_cv_CINEFORM_CFLAGS="$CINEFORM_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcineformsdk\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcineformsdk") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CINEFORM_CFLAGS=`$PKG_CONFIG --cflags "libcineformsdk" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CINEFORM_LIBS"; then + pkg_cv_CINEFORM_LIBS="$CINEFORM_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcineformsdk\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcineformsdk") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CINEFORM_LIBS=`$PKG_CONFIG --libs "libcineformsdk" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CINEFORM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcineformsdk" 2>&1` + else + CINEFORM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcineformsdk" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CINEFORM_PKG_ERRORS" >&5 + + FOUND_CINEFORM=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_CINEFORM=no +else + CINEFORM_CFLAGS=$pkg_cv_CINEFORM_CFLAGS + CINEFORM_LIBS=$pkg_cv_CINEFORM_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_CINEFORM=yes +fi + if test "$FOUND_CINEFORM" = no; then # libcineform fork + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libcineform" >&5 +printf %s "checking for libcineform... " >&6; } + +if test -n "$CINEFORM_CFLAGS"; then + pkg_cv_CINEFORM_CFLAGS="$CINEFORM_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcineform\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcineform") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CINEFORM_CFLAGS=`$PKG_CONFIG --cflags "libcineform" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$CINEFORM_LIBS"; then + pkg_cv_CINEFORM_LIBS="$CINEFORM_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcineform\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcineform") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_CINEFORM_LIBS=`$PKG_CONFIG --libs "libcineform" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + CINEFORM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcineform" 2>&1` + else + CINEFORM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcineform" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$CINEFORM_PKG_ERRORS" >&5 + + FOUND_CINEFORM=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_CINEFORM=no +else + CINEFORM_CFLAGS=$pkg_cv_CINEFORM_CFLAGS + CINEFORM_LIBS=$pkg_cv_CINEFORM_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_CINEFORM=yes +fi + fi +fi + +if test "$cineform_req" != no && test "$FOUND_CINEFORM" = no +then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for CFHD_OpenDecoder in -lCFHDCodec" >&5 +printf %s "checking for CFHD_OpenDecoder in -lCFHDCodec... " >&6; } +if test ${ac_cv_lib_CFHDCodec_CFHD_OpenDecoder+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lCFHDCodec $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +namespace conftest { + extern "C" int CFHD_OpenDecoder (); +} +int +main (void) +{ +return conftest::CFHD_OpenDecoder (); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + ac_cv_lib_CFHDCodec_CFHD_OpenDecoder=yes +else case e in #( + e) ac_cv_lib_CFHDCodec_CFHD_OpenDecoder=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_CFHDCodec_CFHD_OpenDecoder" >&5 +printf '%s\n' "$ac_cv_lib_CFHDCodec_CFHD_OpenDecoder" >&6; } +if test "x$ac_cv_lib_CFHDCodec_CFHD_OpenDecoder" = xyes +then : + FOUND_CINEFORM=yes; CINEFORM_LIBS=-lCFHDCodec +else case e in #( + e) FOUND_CINEFORM=no ;; +esac +fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi + +if test "$cineform_req" != no && test "$FOUND_CINEFORM" = no +then + if test $system = Windows + then + CINEFORM_LIBS="${CINEFORM_PATH}/Release/CFHDCodec.lib" + else + CINEFORM_LIBS="${CINEFORM_PATH}/libCFHDCodec.a" + fi + + if test -n "${CINEFORM_PATH?}" && test "${cross_compile?}" = no + then + as_ac_File=`printf '%s\n' "ac_cv_file_${CINEFORM_LIBS}" | sed "$as_sed_sh"` +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for ${CINEFORM_LIBS}" >&5 +printf %s "checking for ${CINEFORM_LIBS}... " >&6; } +if eval test \${$as_ac_File+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "${CINEFORM_LIBS}"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi ;; +esac +fi +eval ac_res=\$$as_ac_File + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf '%s\n' "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes" +then : + +cat >>confdefs.h <<_ACEOF +#define `printf '%s\n' "HAVE_${CINEFORM_LIBS}" | sed "$as_sed_cpp"` 1 +_ACEOF +FOUND_CINEFORM=yes +else case e in #( + e) FOUND_CINEFORM=no ;; +esac +fi + + fi +fi + +if test "$FOUND_CINEFORM" = yes; then + CINEFORM_CFLAGS="$CINEFORM_CFLAGS -I${CINEFORM_PATH}/Common/" + + if test "$system" = Linux + then + CINEFORM_LIBS="${CINEFORM_LIBS} -luuid" + fi +fi + +if test "${cineform_req?}" != no && test "${FOUND_CINEFORM?}" = yes +then + cineform=yes + CINEFORM_COMPRESS_OBJ="src/video_compress/cineform.o" + CINEFORM_DECOMPRESS_OBJ="src/video_decompress/cineform.o" + + INC="$INC $CINEFORM_CFLAGS" + + add_module vcompress_cineform "$CINEFORM_COMPRESS_OBJ" "$CINEFORM_LIBS" + add_module vdecompress_cineform "$CINEFORM_DECOMPRESS_OBJ" "$CINEFORM_LIBS" +fi + + +if { test "$cineform_req" != no && test "$cineform_req" != auto ;} && test "$cineform" = no; then + as_fn_error $? "CINEFORM not found" "$LINENO" 5; +fi + + +# --------------------------------------------------------------------- +# NAT-PMP +# ----------------------------------- +natpmp=no +# Check whether --enable-natpmp was given. +if test ${enable_natpmp+y} +then : + enableval=$enable_natpmp; natpmp_req=$enableval +else case e in #( + e) natpmp_req=$build_default + ;; +esac +fi + + +if test "$natpmp_req" != no; then + ac_fn_c_check_header_compile "$LINENO" "natpmp.h" "ac_cv_header_natpmp_h" "$ac_includes_default" +if test "x$ac_cv_header_natpmp_h" = xyes +then : + FOUND_NATPMP_H=yes +else case e in #( + e) FOUND_NATPMP_H=no ;; +esac +fi + + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for initnatpmp in -lnatpmp" >&5 +printf %s "checking for initnatpmp in -lnatpmp... " >&6; } +if test ${ac_cv_lib_natpmp_initnatpmp+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lnatpmp $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char initnatpmp (void); +int +main (void) +{ +return initnatpmp (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_natpmp_initnatpmp=yes +else case e in #( + e) ac_cv_lib_natpmp_initnatpmp=no ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS ;; +esac +fi +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_natpmp_initnatpmp" >&5 +printf '%s\n' "$ac_cv_lib_natpmp_initnatpmp" >&6; } +if test "x$ac_cv_lib_natpmp_initnatpmp" = xyes +then : + FOUND_NATPMP_L=yes +else case e in #( + e) FOUND_NATPMP_L=no ;; +esac +fi + + if test "$FOUND_NATPMP_H" = yes && test "$FOUND_NATPMP_L" = yes; then + LIBS="-lnatpmp $LIBS" + +printf '%s\n' "#define HAVE_NATPMP 1" >>confdefs.h + + if test $system = Windows; then + COMMON_FLAGS="$COMMON_FLAGS -DNATPMP_STATICLIB" + fi + natpmp=yes + fi +fi + + +if { test "$natpmp_req" != no && test "$natpmp_req" != auto ;} && test "$natpmp" = no; then + as_fn_error $? "NAT-PMP not found" "$LINENO" 5; +fi + + +# --------------------------------------------------------------------- +# PCP +# ----------------------------------- +pcp=no +# Check whether --enable-pcp was given. +if test ${enable_pcp+y} +then : + enableval=$enable_pcp; pcp_req=$enableval +else case e in #( + e) pcp_req=$build_default + ;; +esac +fi + + +if test "$pcp_req" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libpcpnatpmp" >&5 +printf %s "checking for libpcpnatpmp... " >&6; } + +if test -n "$PCP_CFLAGS"; then + pkg_cv_PCP_CFLAGS="$PCP_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcpnatpmp\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpcpnatpmp") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCP_CFLAGS=`$PKG_CONFIG --cflags "libpcpnatpmp" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PCP_LIBS"; then + pkg_cv_PCP_LIBS="$PCP_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcpnatpmp\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpcpnatpmp") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCP_LIBS=`$PKG_CONFIG --libs "libpcpnatpmp" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PCP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcpnatpmp" 2>&1` + else + PCP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcpnatpmp" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PCP_PKG_ERRORS" >&5 + + FOUND_PCP=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_PCP=no +else + PCP_CFLAGS=$pkg_cv_PCP_CFLAGS + PCP_LIBS=$pkg_cv_PCP_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_PCP=new +fi + if test "$FOUND_PCP" = no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libpcp-client" >&5 +printf %s "checking for libpcp-client... " >&6; } + +if test -n "$PCP_CFLAGS"; then + pkg_cv_PCP_CFLAGS="$PCP_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcp-client\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpcp-client") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCP_CFLAGS=`$PKG_CONFIG --cflags "libpcp-client" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$PCP_LIBS"; then + pkg_cv_PCP_LIBS="$PCP_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcp-client\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libpcp-client") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_PCP_LIBS=`$PKG_CONFIG --libs "libpcp-client" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + PCP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcp-client" 2>&1` + else + PCP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcp-client" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$PCP_PKG_ERRORS" >&5 + + FOUND_PCP=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + FOUND_PCP=no +else + PCP_CFLAGS=$pkg_cv_PCP_CFLAGS + PCP_LIBS=$pkg_cv_PCP_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + FOUND_PCP=old +fi + fi + if test "$FOUND_PCP" != no; then + LIBS="$PCP_LIBS $LIBS" + +printf '%s\n' "#define HAVE_PCP 1" >>confdefs.h + + if test "$FOUND_PCP" = new; then + +printf '%s\n' "#define HAVE_PCP_NEW 1" >>confdefs.h + + fi + pcp=yes + fi +fi + + +if { test "$pcp_req" != no && test "$pcp_req" != auto ;} && test "$pcp" = no; then + as_fn_error $? "PCP not found" "$LINENO" 5; +fi + + +# --------------------------------------------------------------------- +# fluidsynth audio capture synthesizer +# --------------------------------------------------------------------- +# Check whether --enable-fluidsynth was given. +if test ${enable_fluidsynth+y} +then : + enableval=$enable_fluidsynth; fluidsynth_req=$enableval +else case e in #( + e) fluidsynth_req=$build_default ;; +esac +fi + +fluidsynth=no + +if test "${fluidsynth_req?}" != no; then + +pkg_failed=no +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for fluidsynth" >&5 +printf %s "checking for fluidsynth... " >&6; } + +if test -n "$FLUIDSYNTH_CFLAGS"; then + pkg_cv_FLUIDSYNTH_CFLAGS="$FLUIDSYNTH_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fluidsynth\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fluidsynth") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FLUIDSYNTH_CFLAGS=`$PKG_CONFIG --cflags "fluidsynth" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$FLUIDSYNTH_LIBS"; then + pkg_cv_FLUIDSYNTH_LIBS="$FLUIDSYNTH_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fluidsynth\""; } >&5 + ($PKG_CONFIG --exists --print-errors "fluidsynth") 2>&5 + ac_status=$? + printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FLUIDSYNTH_LIBS=`$PKG_CONFIG --libs "fluidsynth" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + FLUIDSYNTH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "fluidsynth" 2>&1` + else + FLUIDSYNTH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "fluidsynth" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$FLUIDSYNTH_PKG_ERRORS" >&5 + + found_fluidsynth=no +elif test $pkg_failed = untried; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf '%s\n' "no" >&6; } + found_fluidsynth=no +else + FLUIDSYNTH_CFLAGS=$pkg_cv_FLUIDSYNTH_CFLAGS + FLUIDSYNTH_LIBS=$pkg_cv_FLUIDSYNTH_LIBS + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf '%s\n' "yes" >&6; } + found_fluidsynth=yes +fi + if test "${found_fluidsynth?}" = yes; then + add_module acap_fluidsynth src/audio/capture/fluidsynth.o "$FLUIDSYNTH_LIBS" + INC="$INC${FLUIDSYNTH_CFLAGS:+ $FLUIDSYNTH_CFLAGS}" + fluidsynth=yes + fi +fi + + +if { test "$fluidsynth_req" != no && test "$fluidsynth_req" != auto ;} && test "$fluidsynth" = no; then + as_fn_error $? "fluidsynth not found!" "$LINENO" 5; +fi + + +# ----------------------------------------------------------------------------- +# Reflector +# ----------------------------------------------------------------------------- +# Check whether --enable-reflector was given. +if test ${enable_reflector+y} +then : + enableval=$enable_reflector; reflector_req=$enableval +else case e in #( + e) reflector_req=$build_default ;; +esac +fi + +if test "$reflector_req" != no; then + REFLECTOR_TARGET=bin/hd-rum-transcode + if test "$man" = yes; then + MANPAGES="$MANPAGES hd-rum-transcode.1" + fi +fi + + +# ------------------------------------------------------------------------------ +# Non-essential objs +# ------------------------------------------------------------------------------ +# Check whether --enable-object was given. +if test ${enable_object+y} +then : + enableval=$enable_object; req_files=$enableval +else case e in #( + e) req_files= ;; +esac +fi + + +if test -n "$req_files" && test "$req_files" != all; then + OBJS="$OBJS $(echo "$req_files" | sed 's/,/ /g')" +fi + +if test "$build_default" != no || test "$req_files" = all; then + ULTRAGRID_OBJS="$ULTRAGRID_OBJS + src/audio/capture/passive.o + src/audio/playback/dump.o + src/audio/playback/mixer.o + src/audio/filter/delay.o + src/audio/filter/discard.o + src/audio/filter/controlport_stats.o + src/audio/filter/silence.o + src/audio/filter/playback.o + src/audio/filter/channel_remap.o + src/capture_filter/change_pixfmt.o + src/capture_filter/color.o + src/capture_filter/display.o + src/capture_filter/disrupt.o + src/capture_filter/every.o + src/capture_filter/flip.o + src/capture_filter/gamma.o + src/capture_filter/grayscale.o + src/capture_filter/logo.o + src/capture_filter/matrix.o + src/capture_filter/matrix2.o + src/capture_filter/mirror.o + src/capture_filter/noise.o + src/capture_filter/override_prop.o + src/capture_filter/preview.o + src/capture_filter/ratelimit.o + src/capture_filter/split.o + src/capture_filter/temporal_3d.o + src/video_capture/aggregate.o + src/video_capture/import.o + src/video_capture/switcher.o + src/video_capture/ug_input.o + src/video_decompress/i420.o + src/video_display/aggregate.o + src/video_display/dump.o + src/video_display/multiplier.o + src/video_display/pipe.o + src/video_display/unix_sock.o + src/video_rxtx/h264_sdp.o + src/video_rxtx/ihdtv.o + src/video_rxtx/loopback.o + src/video_rxtx/sage.o + src/vo_postprocess/3d-interlaced.o + src/vo_postprocess/border.o + src/vo_postprocess/crop.o + src/vo_postprocess/deinterlace.o + src/vo_postprocess/delay.o + src/vo_postprocess/interlace.o + src/vo_postprocess/split.o + src/vo_postprocess/temporal-deint.o + src/vo_postprocess/temporal_3d.o + " +fi + +# ------------------------------------------------------------------------------------------------- +# We need to add libraries then +# ------------------------------------------------------------------------------------------------- +TEST_LIBS="$LIB_MODULES $LIBS $UG_LIB_MODULES" +TEST_OBJS="$OBJS $LIB_OBJS $UG_LIB_OBJS" +REFLECTOR_OBJS="src/video_display/blend.o src/video_display/pipe.o" + +# this is only needed when passing to "clean" make target +if test "$build_libraries" != yes +then + LIBS="$LIB_MODULES $LIBS" + OBJS="$OBJS $LIB_OBJS" + ULTRAGRID_OBJS="$ULTRAGRID_OBJS $UG_LIB_OBJS" + ULTRAGRID_LIBS="$UG_LIB_MODULES" + GENERATED_HEADERS="$GENERATED_HEADERS $LIB_GENERATED_HEADERS" + LIB_OBJS= + LIB_GENERATED_HEADERS= + MODULES= + TARGETS= +fi + +TOREMOVE="$LIB_OBJS $UG_LIB_OBJS" + +# remove duplicite objs +REFLECTOR_OBJS=`echo $REFLECTOR_OBJS $OBJS | tr ' ' '\n' | sort | uniq | tr '\n' ' '` +TEST_OBJS=`echo $TEST_OBJS | tr ' ' '\n' | sort | uniq | tr '\n' ' '` +ULTRAGRID_OBJS=`echo $ULTRAGRID_OBJS $OBJS | tr ' ' '\n' | sort | uniq | tr '\n' ' '` + + + + + + + + + + + +# ------------------------------------------------------------------------------------------------- +# Print summary + set it to AUTOCONF_RESULT +# ------------------------------------------------------------------------------------------------- + +start_section() { + printf "$1\n$2:" + true # set $? to zero -> causes add_column to start on new line +} + +end_section() { + printf "$1 + " +} + +# params: 0|1 +# 0 - print left column; 1 - print right column +add_column() { + PAD_DOTS=31 + # left column + if test "${4?}" -eq 0; then + printf "$1\n $2 $(for n in `seq ${#2} $PAD_DOTS`; do printf .; done) $(printf %-3s $3)" + return 1 + else + # right column + printf "$1 $2 $(for n in `seq ${#2} $PAD_DOTS`; do printf .; done) $(printf %-3s $3)\n" + return 0 + fi +} + +RESULT="Target: $target\n" + +# features +RESULT=`start_section "$RESULT" "Features"` +RESULT=`add_column "$RESULT" "Crypto$crypto_impl" $crypto $?` +RESULT=`add_column "$RESULT" "CUDA support$HOST_CC_REPORT" $FOUND_CUDA $?` +RESULT=`add_column "$RESULT" "Debug output" $debug_output $?` +RESULT=`add_column "$RESULT" "iHDTV support" $ihdtv $?` +RESULT=`add_column "$RESULT" "IPv6 support" $ipv6 $?` +RESULT=`add_column "$RESULT" "Library live555" $livemedia $?` +RESULT=`add_column "$RESULT" "Libbacktrace" $libbacktrace $?` +RESULT=`add_column "$RESULT" "Manual pages" $man $?` +RESULT=`add_column "$RESULT" "OpenCV" $opencv $?` +RESULT=`add_column "$RESULT" "Profiling support" $profile $?` +RESULT=`add_column "$RESULT" "Qt GUI" $qt_gui $?` +RESULT=`add_column "$RESULT" "RT priority" $use_rt $?` +RESULT=`add_column "$RESULT" "Soxr" $soxr $?` +RESULT=`add_column "$RESULT" "SpeexDSP" $speexdsp $?` +RESULT=`add_column "$RESULT" "Standalone modules" $build_libraries $?` +RESULT=`add_column "$RESULT" "zfec" $zfec $?` +RESULT=`end_section "$RESULT"` + +# audio +RESULT=`start_section "$RESULT" "Audio"` +RESULT=`add_column "$RESULT" "ALSA" $alsa $?` +RESULT=`add_column "$RESULT" "CoreAudio" $coreaudio $?` +RESULT=`add_column "$RESULT" "FluidSynth" $fluidsynth $?` +RESULT=`add_column "$RESULT" "JACK" $jack $?` +RESULT=`add_column "$RESULT" "JACK transport" $jack_trans $?` +RESULT=`add_column "$RESULT" "Pipewire" $pipewire_audio $?` +RESULT=`add_column "$RESULT" "Portaudio" $portaudio $?` +RESULT=`add_column "$RESULT" "WASAPI" $wasapi $?` +RESULT=`end_section "$RESULT"` + +# video +RESULT=`start_section "$RESULT" "Video"` +RESULT=`add_column "$RESULT" "AJA" $aja $?` +RESULT=`add_column "$RESULT" "AV Foundation" $avfoundation $?` +RESULT=`add_column "$RESULT" "BitFlow" $bitflow $?` +RESULT=`add_column "$RESULT" "Bluefish444" $bluefish444 $?` +RESULT=`add_column "$RESULT" "caca" $caca $?` +RESULT=`add_column "$RESULT" "DeckLink" $decklink $?` +RESULT=`add_column "$RESULT" "DELTACAST" $deltacast $?` +RESULT=`add_column "$RESULT" "DirectShow" $dshow $?` +RESULT=`add_column "$RESULT" "DRM" $drm_disp $?` +RESULT=`add_column "$RESULT" "DVS" $dvs $?` +RESULT=`add_column "$RESULT" "File" $file $?` +RESULT=`add_column "$RESULT" "Gpustitch" $gpustitch $?` +RESULT=`add_column "$RESULT" "NDI" $ndi $?` +RESULT=`add_column "$RESULT" "OpenGL" $gl_display $?` +RESULT=`add_column "$RESULT" "OpenXR VR Display" $xrgl_disp $?` +RESULT=`add_column "$RESULT" "Panorama Gl Display" $panogl_disp $?` +RESULT=`add_column "$RESULT" "Pipewire" $pipewire_video $?` +RESULT=`add_column "$RESULT" "RTSP capture client" $rtsp $?` +RESULT=`add_column "$RESULT" "SAGE" $sage $?` +RESULT=`add_column "$RESULT" "Screen capture$screen_modules" $screen_cap $?` +RESULT=`add_column "$RESULT" "SDL$sdl_version_str" $sdl $?` +RESULT=`add_column "$RESULT" "SW video mix" $swmix $?` +RESULT=`add_column "$RESULT" "V4L2" $v4l2 $?` +RESULT=`add_column "$RESULT" "Vulkan$vulkan_sdl_ver" $vulkan $?` +RESULT=`add_column "$RESULT" "XIMEA" $ximea $?` +RESULT=`end_section "$RESULT"` + +# compressions +RESULT=`start_section "$RESULT" "Compressions"` +RESULT=`add_column "$RESULT" "Cineform" $cineform $?` +RESULT=`add_column "$RESULT" "Comprimato J2K" $cmpto_j2k $?` +RESULT=`add_column "$RESULT" "CUDA DXT" $cuda_dxt $?` +RESULT=`add_column "$RESULT" "GPUJPEG" $gpujpeg $?` +RESULT=`add_column "$RESULT" "GPUJPEG transcode to DXT" $gpujpeg_to_dxt $?` +RESULT=`add_column "$RESULT" "Lavc (VDP $lavc_hwacc_vdpau, VA $lavc_hwacc_vaapi)" $libavcodec $?` +RESULT=`add_column "$RESULT" "Realtime DXT" $rtdxt $?` +RESULT=`add_column "$RESULT" "UYVY dummy compression" $uyvy $?` +RESULT=`end_section "$RESULT"` + +# other +RESULT=`start_section "$RESULT" "Others"` +RESULT=`add_column "$RESULT" "Blank capture filter" $blank $?` +RESULT=`add_column "$RESULT" "GPU accelerated LDGM" $ldgm_gpu $?` +RESULT=`add_column "$RESULT" "Hole punching" $libjuice $?` +RESULT=`add_column "$RESULT" "iHDTV support" $ihdtv $?` +RESULT=`add_column "$RESULT" "MCU-like video mixer" $video_mix $?` +RESULT=`add_column "$RESULT" "NAT-PMP traversal" $natpmp $?` +RESULT=`add_column "$RESULT" "PCP NAT traversal" $pcp $?` +RESULT=`add_column "$RESULT" "Resize capture filter" $resize $?` +RESULT=`add_column "$RESULT" "RTSP server" $rtsp_server $?` +RESULT=`add_column "$RESULT" "Scale postprocessor" $scale $?` +RESULT=`add_column "$RESULT" "SDP over HTTP" $sdp_http $?` +RESULT=`add_column "$RESULT" "Spout" $spout $?` +RESULT=`add_column "$RESULT" "Swscale support" $libswscale $?` +RESULT=`add_column "$RESULT" "Syphon" $syphon $?` +RESULT=`add_column "$RESULT" "Testcard2 (TTF: $FOUND_SDL_TTF)" \ +$testcard2 $?` +RESULT=`add_column "$RESULT" "Text postprocess and filter" $text $?` +RESULT=`end_section "$RESULT"` + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: +UltraGrid configuration summary +===============================" >&5 +printf '%s\n' " +UltraGrid configuration summary +===============================" >&6; } +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: $RESULT" >&5 +printf '%s\n' "$RESULT" >&6; } + +if test -n "$WARNINGS"; then + printf "*** Following WARNINGS were issued:\n$WARNINGS\n" +fi + +RES_STR=`printf "$RESULT" | sed 's/$/\\\\n/' | tr -d '\n'` + + +printf '%s\n' "#define AUTOCONF_RESULT \"$RES_STR\"" >>confdefs.h + + +# ------------------------------------------------------------------------------------------------- +# Finally, substitute things into the Makefile and config.h +# ------------------------------------------------------------------------------------------------- + + +printf '%s\n' "#define SRCDIR \"$srcdir\"" >>confdefs.h + + +ac_config_headers="$ac_config_headers src/config.h" + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +ac_cache_dump | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf '%s\n' "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf '%s\n' "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf '%s\n' "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf '%s\n' "done" >&6; } +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +# Check whether --enable-year2038 was given. +if test ${enable_year2038+y} +then : + enableval=$enable_year2038; +fi + + + +: "${CONFIG_STATUS=./config.status}" +case $CONFIG_STATUS in #( + -*) : + CONFIG_STATUS=./$CONFIG_STATUS ;; #( + */*) : + ;; #( + *) : + CONFIG_STATUS=./$CONFIG_STATUS ;; +esac + +ac_write_fail=0 +ac_clean_CONFIG_STATUS='"$CONFIG_STATUS"' +{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf '%s\n' "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >"$CONFIG_STATUS" <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>"$CONFIG_STATUS" <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # contradicts POSIX and common usage. Disable this. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else case e in #( + e) case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as 'sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf '%s\n' "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf '%s\n' "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else case e in #( + e) as_fn_append () + { + eval $1=\$$1\$2 + } ;; +esac +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else case e in #( + e) as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } ;; +esac +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf '%s\n' "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated + +# Sed expression to map a string onto a valid variable name. +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated + + +exec 6>&1 +## ------------------------------------- ## +## Main body of "$CONFIG_STATUS" script. ## +## ------------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x "$CONFIG_STATUS" || ac_write_fail=1 + +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by UltraGrid $as_me 1.10.4, which was +generated by GNU Autoconf 2.73. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +'$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +ac_cs_config=`printf '%s\n' "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf '%s\n' "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +UltraGrid config.status 1.10.4 +configured by $0, generated by GNU Autoconf 2.73, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2026 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || { + awk '' >"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf '%s\n' "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf '%s\n' "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf '%s\n' "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf '%s\n' "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; + --help | --hel | -h ) + printf '%s\n' "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf '%s\n' "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf '%s\n' "$ac_log" +} >&5 + +_ACEOF +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + +_ACEOF + +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to '$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with './config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | sed -n '$='` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | sed -n '$='` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >"$CONFIG_STATUS" || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with './config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script 'defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >"$CONFIG_STATUS" || ac_write_fail=1 + +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + suffix = P[macro] D[macro] + while (suffix ~ /[\t ]$/) { + suffix = substr(suffix, 1, length(suffix) - 1) + } + # Preserve the white space surrounding the "#". + print prefix "define", macro suffix + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain ':'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf '%s\n' "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is 'configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf '%s\n' "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf '%s\n' "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf '%s\n' "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf '%s\n' "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf '%s\n' "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf '%s\n' "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when '$srcdir' = '.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf '%s\n' "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf '%s\n' "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf '%s\n' "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf '%s\n' "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { printf '%s\n' "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf '%s\n' "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf '%s\n' "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf '%s\n' X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf '%s\n' "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See 'config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_CONFIG_STATUS= + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + case $CONFIG_STATUS in #( + -*) : + ac_no_opts=-- ;; #( + *) : + ac_no_opts= ;; +esac + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $ac_no_opts "$CONFIG_STATUS" $ac_config_status_args || + ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf '%s\n' "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf '%s\n' "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + + From 097cee76ad79b993fb9fcc0c3f725cda487f1efa Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 10 Apr 2026 12:26:25 +0200 Subject: [PATCH 74/86] CI mac: mv ensure step to environment.sh handled earlier and not complicating the YAML --- .github/scripts/environment.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/scripts/environment.sh b/.github/scripts/environment.sh index 4c468af114..f30e37ce5d 100644 --- a/.github/scripts/environment.sh +++ b/.github/scripts/environment.sh @@ -162,8 +162,17 @@ set_ximea_url() { } set_ximea_url -import_signing_key() { - if [ "$(uname -s)" != Darwin ] || [ -z "$apple_key_p12_b64" ]; then +import_macos_signing_key() { + if [ "$(uname -s)" != Darwin ]; then + return 0 + fi + + if [ -z "$apple_key_p12_b64" ]; then + if [ "${GITHUB_REPOSITORY?}" = CESNET/UltraGrid ]; then + echo "apple_key_p12_b64 GitHub secret must be set"\ + "in main repository (signing won't work without)" + exit 1 + fi return 0 fi # Inspired by https://www.update.rocks/blog/osx-signing-with-travis/ @@ -180,7 +189,7 @@ import_signing_key() { printf '%b' "KEY_CHAIN_PASS=$KEY_CHAIN_PASS\nKEY_CHAIN=$KEY_CHAIN\n" \ >> "$GITHUB_ENV" } -import_signing_key +import_macos_signing_key printf '%b' 'DELTA_MAC_ARCHIVE=videomaster-macos-dev.tar.gz\n' >> "$GITHUB_ENV" From 70fb5e65591da18ee8466c8ec9c649cb0f50bebc Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 20 May 2026 14:28:09 +0200 Subject: [PATCH 75/86] CI Windows: use windows-2022 see the commit c042847f6 in master branch for details --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 3b44eddd8e..e1cdf7680c 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -246,7 +246,7 @@ jobs: Windows: name: run Windows needs: prepare - runs-on: windows-latest + runs-on: windows-2022 defaults: run: shell: C:\shells\msys2bash.cmd {0} From b922f72d06e8a346be809cc53315b68bedf4f959 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 14 May 2026 08:11:34 +0200 Subject: [PATCH 76/86] pcp: drop include prefix the header is no longer in pcpnatpmp-clinet/ subdir Do not keep compat - it is perhaps not worth it, the library is usually not handled by package management so we can assume the upstream version. Also remove the old compat. --- configure.ac | 4 ---- src/utils/nat.c | 9 +++------ 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 49f659b7f8..9c271d56e6 100644 --- a/configure.ac +++ b/configure.ac @@ -3429,10 +3429,6 @@ AC_ARG_ENABLE(pcp, if test "$pcp_req" != no; then PKG_CHECK_MODULES([PCP], [libpcpnatpmp], [FOUND_PCP=new], [FOUND_PCP=no]) - if test "$FOUND_PCP" = no; then - PKG_CHECK_MODULES([PCP], [libpcp-client], [FOUND_PCP=old], - [FOUND_PCP=no]) - fi if test "$FOUND_PCP" != no; then LIBS="$PCP_LIBS $LIBS" AC_DEFINE([HAVE_PCP], [1], [Build with PCP support]) diff --git a/src/utils/nat.c b/src/utils/nat.c index 7584e1f8e7..526007440e 100644 --- a/src/utils/nat.c +++ b/src/utils/nat.c @@ -3,7 +3,7 @@ * @author Martin Pulec */ /* - * Copyright (c) 2020-2021 CESNET z.s.p.o. + * Copyright (c) 2020-2026 CESNET, zájmové sdružení právnických osob * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -59,12 +59,9 @@ #define STATICLIB 1 #include #endif // defined HAVE_NATPMP + #ifdef HAVE_PCP - #ifdef HAVE_PCP_NEW - #include - #else - #include - #endif + #include #endif // defined HAVE_PCP #include "debug.h" From 44b1fcd5680cc50b34988d35a12ef2e8e587ee35 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 22 May 2026 12:59:37 +0200 Subject: [PATCH 77/86] UltraGrid 1.10.5 --- FIXES.md | 6 ++++ configure | 93 ++++++---------------------------------------------- configure.ac | 2 +- 3 files changed, 17 insertions(+), 84 deletions(-) diff --git a/FIXES.md b/FIXES.md index c26d1a2234..05079bac25 100644 --- a/FIXES.md +++ b/FIXES.md @@ -1,3 +1,9 @@ +#### 1.10.5 + +* fix seldom audio corruption +* fix presentation of portaudio devices in help +* add configure (user doesn't need autoconf/automake) + #### 1.10.4 * fix default VP9 on x86-64 pre v3 (wo AVX2). But the libvpx-vp9 diff --git a/configure b/configure index 795dfd43b7..9cf3581e51 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.73 for UltraGrid 1.10.4. +# Generated by GNU Autoconf 2.73 for UltraGrid 1.10.5. # # Report bugs to . # @@ -588,8 +588,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='UltraGrid' PACKAGE_TARNAME='ultragrid' -PACKAGE_VERSION='1.10.4' -PACKAGE_STRING='UltraGrid 1.10.4' +PACKAGE_VERSION='1.10.5' +PACKAGE_STRING='UltraGrid 1.10.5' PACKAGE_BUGREPORT='ultragrid-dev@cesnet.cz' PACKAGE_URL='' @@ -1616,7 +1616,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures UltraGrid 1.10.4 to adapt to many kinds of systems. +'configure' configures UltraGrid 1.10.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1688,7 +1688,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of UltraGrid 1.10.4:";; + short | recursive ) echo "Configuration of UltraGrid 1.10.5:";; esac cat <<\_ACEOF @@ -2100,7 +2100,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -UltraGrid configure 1.10.4 +UltraGrid configure 1.10.5 generated by GNU Autoconf 2.73 Copyright (C) 2026 Free Software Foundation, Inc. @@ -2823,7 +2823,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by UltraGrid $as_me 1.10.4, which was +It was created by UltraGrid $as_me 1.10.5, which was generated by GNU Autoconf 2.73. Invocation command line was $ $0$ac_configure_args_raw @@ -4554,7 +4554,7 @@ fi # Define the identity of the package. PACKAGE='ultragrid' - VERSION='1.10.4' + VERSION='1.10.5' printf '%s\n' "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -18059,79 +18059,6 @@ else printf '%s\n' "yes" >&6; } FOUND_PCP=new fi - if test "$FOUND_PCP" = no; then - -pkg_failed=no -{ printf '%s\n' "$as_me:${as_lineno-$LINENO}: checking for libpcp-client" >&5 -printf %s "checking for libpcp-client... " >&6; } - -if test -n "$PCP_CFLAGS"; then - pkg_cv_PCP_CFLAGS="$PCP_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcp-client\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpcp-client") 2>&5 - ac_status=$? - printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PCP_CFLAGS=`$PKG_CONFIG --cflags "libpcp-client" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$PCP_LIBS"; then - pkg_cv_PCP_LIBS="$PCP_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpcp-client\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libpcp-client") 2>&5 - ac_status=$? - printf '%s\n' "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_PCP_LIBS=`$PKG_CONFIG --libs "libpcp-client" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf '%s\n' "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - PCP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libpcp-client" 2>&1` - else - PCP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libpcp-client" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$PCP_PKG_ERRORS" >&5 - - FOUND_PCP=no -elif test $pkg_failed = untried; then - { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf '%s\n' "no" >&6; } - FOUND_PCP=no -else - PCP_CFLAGS=$pkg_cv_PCP_CFLAGS - PCP_LIBS=$pkg_cv_PCP_LIBS - { printf '%s\n' "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf '%s\n' "yes" >&6; } - FOUND_PCP=old -fi - fi if test "$FOUND_PCP" != no; then LIBS="$PCP_LIBS $LIBS" @@ -19035,7 +18962,7 @@ cat >>"$CONFIG_STATUS" <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by UltraGrid $as_me 1.10.4, which was +This file was extended by UltraGrid $as_me 1.10.5, which was generated by GNU Autoconf 2.73. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19103,7 +19030,7 @@ ac_cs_config_escaped=`printf '%s\n' "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>"$CONFIG_STATUS" <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -UltraGrid config.status 1.10.4 +UltraGrid config.status 1.10.5 configured by $0, generated by GNU Autoconf 2.73, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 9c271d56e6..994051f78d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([UltraGrid],[1.10.4],[ultragrid-dev@cesnet.cz]) +AC_INIT([UltraGrid],[1.10.5],[ultragrid-dev@cesnet.cz]) configure_flags="$*" AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.10]) From 7267befd5d27856f26564a2d7f3ecec720584f4b Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 26 May 2026 08:25:52 +0200 Subject: [PATCH 78/86] CI AJA: libajantv2: improve Mac workaround improves 2a315d4a - avoid fiddling in .cmake file, use -DCMAKE_OSX_SYSROOT as proposed in --- .github/scripts/install-common-deps.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/scripts/install-common-deps.sh b/.github/scripts/install-common-deps.sh index 48d6a26ed4..1f69cad030 100755 --- a/.github/scripts/install-common-deps.sh +++ b/.github/scripts/install-common-deps.sh @@ -38,17 +38,15 @@ cineform-0001-CMakeList.txt-remove-output-lib-name-force-UNIX.patch download_build_aja() { aja_url=https://github.com/aja-video/libajantv2.git git clone -b release --depth 1 $aja_url - # TODO TOREMOVE this workarounds when not needed + # TODO TOREMOVE this workaround when not needed tr -d '\n' < libajantv2/VERSION.txt > ver-fix-no-NL$$.txt && mv ver-fix-no-NL$$.txt libajantv2/VERSION.txt - sed -i -e '/MACOS_SDK_VERSION/d' libajantv2/cmake/CMakeOptions.cmake && - SDKROOT=$(xcrun --sdk macosx --show-sdk-path) && export SDKROOT - export MACOSX_DEPLOYMENT_TARGET=10.13 # needed for arm64 mac cmake -DAJANTV2_DISABLE_DEMOS=ON -DAJANTV2_DISABLE_DRIVER=ON \ -DAJANTV2_DISABLE_TOOLS=ON -DAJANTV2_DISABLE_TESTS=ON \ -DAJANTV2_DISABLE_PLUGIN_LOAD=ON -DAJANTV2_BUILD_SHARED=ON \ - -DCMAKE_BUILD_TYPE=Release -Blibajantv2/build -Slibajantv2 + -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=macosx \ + -Blibajantv2/build -Slibajantv2 cmake --build libajantv2/build --config Release -j "$(nproc)" } From b396f6766795b41d96c7ce7fd80e6a3efbc1ed2f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 26 May 2026 09:46:44 +0200 Subject: [PATCH 79/86] configure.ac: AJA: test file, not directory The directory structure may be present from previous installation but without files (uninstalled). + do not repeat AJA_PATH for test and set (set first and do the test with the var) --- configure.ac | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 994051f78d..af9dac888b 100644 --- a/configure.ac +++ b/configure.ac @@ -1005,11 +1005,14 @@ if test -n "$AJA_DIRECTORY"; then fi if test -z "$AJA_PATH"; then - if test -d /usr/local/include/libajantv2; then - AJA_PATH=/usr/local/include/libajantv2 - # libajantv2 AUR - elif test -d /usr/include/libajantv2; then + testf=ajantv2/includes/ntv2card.h + AJA_PATH=/usr/local/include/libajantv2 + if ! test -f "${AJA_PATH?}/${testf?}"; then + # libajantv2 AUR AJA_PATH=/usr/include/libajantv2 + if ! test -f "${AJA_PATH?}/${testf?}"; then + AJA_PATH= + fi fi fi From b7a0939d4250f06808e9646b0bcc0a75aa99a17a Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 28 May 2026 13:56:02 +0200 Subject: [PATCH 80/86] audio: fix run pbuf_remove() for all participants It seeems like there was an issue for ages when - if receiving audio from 2 participans, only one is active at a time. **But** there is early return so that pbuf_remove() may not be run for the inactive stream, meaning that the pbuf gets filled with packets unlimitely. --- src/audio/audio.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/audio/audio.cpp b/src/audio/audio.cpp index bf4bb50e9f..271ee33295 100644 --- a/src/audio/audio.cpp +++ b/src/audio/audio.cpp @@ -802,9 +802,6 @@ static void *audio_receiver_thread(void *arg) pbuf_remove(cp->playout_buffer, curr_time); cp = pdb_iter_next(&it); - - if (decoded && !playback_supports_multiple_streams) - break; } pdb_iter_done(&it); }else { /* NET_JACK */ From 9e725703a986880fe2687c9466b928fefbf5b850 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 28 May 2026 15:16:57 +0200 Subject: [PATCH 81/86] CI libajantv2: latest tag instead of release branch Use the latest tag instead of the branch release - the branch is no longer updated. Also removed the workaround (VERSION.txt does no longer contains trailing NL). --- .github/scripts/install-common-deps.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/scripts/install-common-deps.sh b/.github/scripts/install-common-deps.sh index 1f69cad030..c6b55b8626 100755 --- a/.github/scripts/install-common-deps.sh +++ b/.github/scripts/install-common-deps.sh @@ -37,17 +37,19 @@ cineform-0001-CMakeList.txt-remove-output-lib-name-force-UNIX.patch download_build_aja() { aja_url=https://github.com/aja-video/libajantv2.git - git clone -b release --depth 1 $aja_url - # TODO TOREMOVE this workaround when not needed - tr -d '\n' < libajantv2/VERSION.txt > ver-fix-no-NL$$.txt && - mv ver-fix-no-NL$$.txt libajantv2/VERSION.txt - + git clone --depth 1 $aja_url + cd libajantv2 + latest_tag=$(git ls-remote --tags origin | awk '{print $2}' | \ + grep 'refs/tags/ntv2_[0-9]' | grep -Ev 'beta|rc' | sort | \ + tail -n 1) + git fetch --depth=1 origin "$latest_tag" + git checkout FETCH_HEAD cmake -DAJANTV2_DISABLE_DEMOS=ON -DAJANTV2_DISABLE_DRIVER=ON \ -DAJANTV2_DISABLE_TOOLS=ON -DAJANTV2_DISABLE_TESTS=ON \ -DAJANTV2_DISABLE_PLUGIN_LOAD=ON -DAJANTV2_BUILD_SHARED=ON \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=macosx \ - -Blibajantv2/build -Slibajantv2 - cmake --build libajantv2/build --config Release -j "$(nproc)" + -Bbuild -S. + cmake --build build --config Release -j "$(nproc)" } install_aja() {( From e8094042e02f353a7c4d5fa34a261ee584fce9e0 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 28 May 2026 08:26:40 +0200 Subject: [PATCH 82/86] transmit: traffic shaping simplified just clock_gettime() left - it works fine across platforms (in Windows probably using libpthread wrapper) --- src/transmit.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/transmit.cpp b/src/transmit.cpp index ac607a835e..69779e049e 100644 --- a/src/transmit.cpp +++ b/src/transmit.cpp @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -98,19 +99,9 @@ #define CONTROL_PORT_BANDWIDTH_REPORT_INTERVAL_NS NS_IN_SEC -#ifdef __APPLE__ -#define GET_STARTTIME gettimeofday(&start, NULL) -#define GET_STOPTIME gettimeofday(&stop, NULL) -#define GET_DELTA delta = (stop.tv_sec - start.tv_sec) * 1000000000l + (stop.tv_usec - start.tv_usec) * 1000L -#elif defined __unix__ #define GET_STARTTIME clock_gettime(CLOCK_REALTIME, &start) #define GET_STOPTIME clock_gettime(CLOCK_REALTIME, &stop) #define GET_DELTA delta = (stop.tv_sec - start.tv_sec) * 1000000000l + stop.tv_nsec - start.tv_nsec -#else // Windows -#define GET_STARTTIME {QueryPerformanceFrequency(&freq); QueryPerformanceCounter(&start); } -#define GET_STOPTIME { QueryPerformanceCounter(&stop); } -#define GET_DELTA delta = (long)((double)(stop.QuadPart - start.QuadPart) * 1000 * 1000 * 1000 / freq.QuadPart); -#endif using std::array; using std::vector; @@ -680,13 +671,7 @@ tx_send_base(struct tx *tx, struct video_frame *frame, struct rtp *rtp_session, uint32_t rtp_hdr[100]; int rtp_hdr_len; int pt = fec_pt_from_fec_type(TX_MEDIA_VIDEO, frame->fec_params.type, tx->encryption); /* A value specified in our packet format */ -#ifdef __unix__ struct timespec start, stop; -#elif defined __APPLE__ - struct timeval start, stop; -#else // Windows - LARGE_INTEGER start, stop, freq; -#endif long delta, overslept = 0; int hdrs_len = get_tx_hdr_len(rtp_is_ipv6(rtp_session)); From c011133f1baa4e7c3afa4de8a0a6305667465f45 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 28 May 2026 08:32:11 +0200 Subject: [PATCH 83/86] transmit: use CLOCK_MONOTONIC This is actually the correct clock - CLOCK_REALTIME was there perhaps because CLOCK_MONOTONIC was not implemented? Until POSIX v8 (2024), it has been optional, anyways. This will prevent problems when time jumps eg. due to NTP sync. If it jumped backwards, the traffic shaper whould perhaps busy-wait until the start time passes again (with clock shifted). --- src/transmit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transmit.cpp b/src/transmit.cpp index 69779e049e..3209b2836c 100644 --- a/src/transmit.cpp +++ b/src/transmit.cpp @@ -99,8 +99,8 @@ #define CONTROL_PORT_BANDWIDTH_REPORT_INTERVAL_NS NS_IN_SEC -#define GET_STARTTIME clock_gettime(CLOCK_REALTIME, &start) -#define GET_STOPTIME clock_gettime(CLOCK_REALTIME, &stop) +#define GET_STARTTIME clock_gettime(CLOCK_MONOTONIC, &start) +#define GET_STOPTIME clock_gettime(CLOCK_MONOTONIC, &stop) #define GET_DELTA delta = (stop.tv_sec - start.tv_sec) * 1000000000l + stop.tv_nsec - start.tv_nsec using std::array; From c4800e45bcfa2145c4ce8fe664219dc61594466d Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 1 Jun 2026 15:03:14 +0200 Subject: [PATCH 84/86] updated configure + add missing files for standalone configure run (without autoconf) --- compile | 348 +++++++++ config.guess | 1812 +++++++++++++++++++++++++++++++++++++++++++ config.sub | 1971 +++++++++++++++++++++++++++++++++++++++++++++++ configure | 11 +- install-sh | 541 +++++++++++++ missing | 236 ++++++ src/config.h.in | 412 ++++++++++ 7 files changed, 5327 insertions(+), 4 deletions(-) create mode 100755 compile create mode 100755 config.guess create mode 100755 config.sub create mode 100755 install-sh create mode 100755 missing create mode 100644 src/config.h.in diff --git a/compile b/compile new file mode 100755 index 0000000000..23fcba0113 --- /dev/null +++ b/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# 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 2, 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 to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.guess b/config.guess new file mode 100755 index 0000000000..f6d217a49f --- /dev/null +++ b/config.guess @@ -0,0 +1,1812 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2024 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2024-01-01' + +# This file 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 to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system '$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2024 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# Just in case it came from the environment. +GUESS= + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case $UNAME_SYSTEM in +Linux|GNU|GNU/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif + #endif + EOF + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case $UNAME_VERSION in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + GUESS=$machine-${os}${release}${abi-} + ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; + *:ekkoBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; + *:SolidBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; + macppc:MirBSD:*:*) + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; + *:MirBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; + alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case $ALPHA_CPU_TYPE in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; + Amiga*:UNIX_System_V:4.0:*) + GUESS=m68k-unknown-sysv4 + ;; + *:[Aa]miga[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; + *:[Mm]orph[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-morphos + ;; + *:OS/390:*:*) + GUESS=i370-ibm-openedition + ;; + *:z/VM:*:*) + GUESS=s390-ibm-zvmoe + ;; + *:OS400:*:*) + GUESS=powerpc-ibm-os400 + ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + GUESS=arm-unknown-riscos + ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + GUESS=hppa1.1-hitachi-hiuxmpp + ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; + NILE*:*:*:dcosx) + GUESS=pyramid-pyramid-svr4 + ;; + DRS?6000:unix:4.0:6*) + GUESS=sparc-icl-nx6 + ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; + s390x:SunOS:*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; + sun4H:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; + sun4*:SunOS:*:*) + case `/usr/bin/arch -k` in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like '4.1.3-JL'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; + sun3*:SunOS:*:*) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in + sun3) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun4) + GUESS=sparc-sun-sunos$UNAME_RELEASE + ;; + esac + ;; + aushp:SunOS:*:*) + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; + m68k:machten:*:*) + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; + powerpc:machten:*:*) + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; + RISC*:Mach:*:*) + GUESS=mips-dec-mach_bsd4.3 + ;; + RISC*:ULTRIX:*:*) + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; + VAX*:ULTRIX*:*:*) + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; + Motorola:PowerMAX_OS:*:*) + GUESS=powerpc-motorola-powermax + ;; + Motorola:*:4.3:PL8-*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:Power_UNIX:*:*) + GUESS=powerpc-harris-powerunix + ;; + m88k:CX/UX:7*:*) + GUESS=m88k-harris-cxux7 + ;; + m88k:*:4*:R4*) + GUESS=m88k-motorola-sysv4 + ;; + m88k:*:3*:R3*) + GUESS=m88k-motorola-sysv3 + ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x + then + GUESS=m88k-dg-dgux$UNAME_RELEASE + else + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE + fi + else + GUESS=i586-dg-dgux$UNAME_RELEASE + fi + ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + GUESS=m88k-dolphin-sysv3 + ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + GUESS=m88k-motorola-sysv3 + ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + GUESS=m88k-tektronix-sysv3 + ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + GUESS=m68k-tektronix-bsd + ;; + *:IRIX*:*:*) + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + GUESS=i386-ibm-aix + ;; + ia64:AIX:*:*) + if test -x /usr/bin/oslevel ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + GUESS=$SYSTEM_NAME + else + GUESS=rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + GUESS=rs6000-ibm-aix3.2.4 + else + GUESS=rs6000-ibm-aix3.2 + fi + ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; + *:AIX:*:*) + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + GUESS=rs6000-bull-bosx + ;; + DPX/2?00:B.O.S.:*:*) + GUESS=m68k-bull-sysv3 + ;; + 9000/[34]??:4.3bsd:1.*:*) + GUESS=m68k-hp-bsd + ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + GUESS=m68k-hp-bsd4.4 + ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if test -x /usr/bin/getconf; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case $sc_cpu_version in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case $sc_kernel_bits in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if test "$HP_ARCH" = hppa2.0w + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; + 9000/8??:4.3bsd:*:*) + GUESS=hppa1.0-hp-bsd + ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; + hp8??:OSF1:*:*) + GUESS=hppa1.0-hp-osf + ;; + i*86:OSF1:*:*) + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk + else + GUESS=$UNAME_MACHINE-unknown-osf1 + fi + ;; + parisc*:Lites*:*:*) + GUESS=hppa1.1-hp-lites + ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + GUESS=c1-convex-bsd + ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + GUESS=c34-convex-bsd + ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + GUESS=c38-convex-bsd + ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + GUESS=c4-convex-bsd + ;; + CRAY*Y-MP:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; + CRAY*T3E:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; + CRAY*SV1:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; + *:UNICOS/mp:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; + sparc*:BSD/OS:*:*) + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; + *:BSD/OS:*:*) + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; + i*:CYGWIN*:*) + GUESS=$UNAME_MACHINE-pc-cygwin + ;; + *:MINGW64*:*) + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; + *:MINGW*:*) + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; + *:MSYS*:*) + GUESS=$UNAME_MACHINE-pc-msys + ;; + i*:PW*:*) + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; + *:Interix*:*) + case $UNAME_MACHINE in + x86) + GUESS=i586-pc-interix$UNAME_RELEASE + ;; + authenticamd | genuineintel | EM64T) + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; + IA64) + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; + esac ;; + i*:UWIN*:*) + GUESS=$UNAME_MACHINE-pc-uwin + ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + GUESS=x86_64-pc-cygwin + ;; + prep*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; + *:GNU:*:*) + # the GNU system + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; + aarch64:Linux:*:*) + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI + ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi + else + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf + fi + fi + ;; + avr32*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + cris:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + crisv32:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + frv:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + hexagon:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:Linux:*:*) + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; + ia64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m32r*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m68*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + openrisc*:Linux:*:*) + GUESS=or1k-unknown-linux-$LIBC + ;; + or32:Linux:*:* | or1k*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + padre:Linux:*:*) + GUESS=sparc-unknown-linux-$LIBC + ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + GUESS=hppa64-unknown-linux-$LIBC + ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; + esac + ;; + ppc64:Linux:*:*) + GUESS=powerpc64-unknown-linux-$LIBC + ;; + ppc:Linux:*:*) + GUESS=powerpc-unknown-linux-$LIBC + ;; + ppc64le:Linux:*:*) + GUESS=powerpc64le-unknown-linux-$LIBC + ;; + ppcle:Linux:*:*) + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + s390:Linux:*:* | s390x:Linux:*:*) + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; + sh64*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sh*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + tile*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + vax:Linux:*:*) + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; + x86_64:Linux:*:*) + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac + fi + GUESS=$CPU-pc-linux-$LIBCABI + ;; + xtensa*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + GUESS=i386-sequent-sysv4 + ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; + i*86:OS/2:*:*) + # If we were able to find 'uname', then EMX Unix compatibility + # is probably installed. + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; + i*86:XTS-300:*:STOP) + GUESS=$UNAME_MACHINE-unknown-stop + ;; + i*86:atheos:*:*) + GUESS=$UNAME_MACHINE-unknown-atheos + ;; + i*86:syllable:*:*) + GUESS=$UNAME_MACHINE-pc-syllable + ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; + i*86:*DOS:*:*) + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL + fi + ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv32 + fi + ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + GUESS=i586-pc-msdosdjgpp + ;; + Intel:Mach:3*:*) + GUESS=i386-pc-mach3 + ;; + paragon:*:*:*) + GUESS=i860-intel-osf1 + ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 + fi + ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + GUESS=m68010-convergent-sysv + ;; + mc68k:UNIX:SYSTEM5:3.51m) + GUESS=m68k-convergent-sysv + ;; + M680?0:D-NIX:5.3:*) + GUESS=m68k-diab-dnix + ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; + mc68030:UNIX_System_V:4.*:*) + GUESS=m68k-atari-sysv4 + ;; + TSUNAMI:LynxOS:2.*:*) + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; + rs6000:LynxOS:2.*:*) + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; + SM[BE]S:UNIX_SV:*:*) + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; + RM*:ReliantUNIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + RM*:SINIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 + else + GUESS=ns32k-sni-sysv + fi + ;; + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort + # says + GUESS=i586-unisys-sysv4 + ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + GUESS=hppa1.1-stratus-sysv4 + ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + GUESS=i860-stratus-sysv4 + ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=$UNAME_MACHINE-stratus-vos + ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=hppa1.1-stratus-vos + ;; + mc68*:A/UX:*:*) + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; + news*:NEWS-OS:6*:*) + GUESS=mips-sony-newsos6 + ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE + else + GUESS=mips-unknown-sysv$UNAME_RELEASE + fi + ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + GUESS=powerpc-be-beos + ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + GUESS=powerpc-apple-beos + ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + GUESS=i586-pc-beos + ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + GUESS=i586-pc-haiku + ;; + ppc:Haiku:*:*) # Haiku running on Apple PowerPC + GUESS=powerpc-apple-haiku + ;; + *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) + GUESS=$UNAME_MACHINE-unknown-haiku + ;; + SX-4:SUPER-UX:*:*) + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; + SX-5:SUPER-UX:*:*) + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; + SX-6:SUPER-UX:*:*) + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; + SX-7:SUPER-UX:*:*) + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; + SX-8:SUPER-UX:*:*) + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; + SX-8R:SUPER-UX:*:*) + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; + Power*:Rhapsody:*:*) + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; + *:Rhapsody:*:*) + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; + *:QNX:*:4*) + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; + NSE-*:NONSTOP_KERNEL:*:*) + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; + *:NonStop-UX:*:*) + GUESS=mips-compaq-nonstopux + ;; + BS2000:POSIX*:*:*) + GUESS=bs2000-siemens-sysv + ;; + DS/*:UNIX_System_V:*:*) + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "${cputype-}" = 386; then + UNAME_MACHINE=i386 + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype + fi + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; + *:TOPS-10:*:*) + GUESS=pdp10-unknown-tops10 + ;; + *:TENEX:*:*) + GUESS=pdp10-unknown-tenex + ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + GUESS=pdp10-dec-tops20 + ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + GUESS=pdp10-xkl-tops20 + ;; + *:TOPS-20:*:*) + GUESS=pdp10-unknown-tops20 + ;; + *:ITS:*:*) + GUESS=pdp10-unknown-its + ;; + SEI:*:*:SEIUX) + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; + *:DragonFly:*:*) + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; + esac ;; + *:XENIX:*:SysV) + GUESS=i386-pc-xenix + ;; + i*86:skyos:*:*) + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; + i*86:rdos:*:*) + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; + x86_64:VMkernel:*:*) + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.sub b/config.sub new file mode 100755 index 0000000000..2c6a07ab3c --- /dev/null +++ b/config.sub @@ -0,0 +1,1971 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2024 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2024-01-01' + +# This file 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 to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2024 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ + | windows-* ) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if test x"$basic_os" != x +then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +obj= +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 + fi + ;; + *) + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- ) + ;; + uclinux-uclibc*- ) + ;; + managarm-mlibc*- | managarm-kernel*- ) + ;; + windows*-msvc*-) + ;; + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 + ;; + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 + ;; + kfreebsd*-gnu*- | kopensolaris*-gnu*-) + ;; + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) + ;; + nto-qnx*-) + ;; + os2-emx-) + ;; + *-eabi*- | *-gnueabi*-) + ;; + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) + # Blank kernel with real OS is always fine. + ;; + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) + vendor=acorn + ;; + *-sunos*) + vendor=sun + ;; + *-cnk* | *-aix*) + vendor=ibm + ;; + *-beos*) + vendor=be + ;; + *-hpux*) + vendor=hp + ;; + *-mpeix*) + vendor=hp + ;; + *-hiux*) + vendor=hitachi + ;; + *-unos*) + vendor=crds + ;; + *-dgux*) + vendor=dg + ;; + *-luna*) + vendor=omron + ;; + *-genix*) + vendor=ns + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) + vendor=sequent + ;; + *-tpf*) + vendor=ibm + ;; + *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; + *-aux*) + vendor=apple + ;; + *-hms*) + vendor=hitachi + ;; + *-mpw* | *-macos*) + vendor=apple + ;; + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; + *-vos*) + vendor=stratus + ;; + esac + ;; +esac + +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure index 9cf3581e51..fa20e3249a 100755 --- a/configure +++ b/configure @@ -10323,11 +10323,14 @@ if test -n "$AJA_DIRECTORY"; then fi if test -z "$AJA_PATH"; then - if test -d /usr/local/include/libajantv2; then - AJA_PATH=/usr/local/include/libajantv2 - # libajantv2 AUR - elif test -d /usr/include/libajantv2; then + testf=ajantv2/includes/ntv2card.h + AJA_PATH=/usr/local/include/libajantv2 + if ! test -f "${AJA_PATH?}/${testf?}"; then + # libajantv2 AUR AJA_PATH=/usr/include/libajantv2 + if ! test -f "${AJA_PATH?}/${testf?}"; then + AJA_PATH= + fi fi fi diff --git a/install-sh b/install-sh new file mode 100755 index 0000000000..b1d7a6f67f --- /dev/null +++ b/install-sh @@ -0,0 +1,541 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2024-06-19.01; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. + -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Report bugs to . +GNU Automake home page: . +General help using GNU software: ." + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -p) cpprog="$cpprog -p";; + + -s) stripcmd=$stripprog;; + + -S) backupsuffix="$2" + shift;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 (GNU Automake) $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibility with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/missing b/missing new file mode 100755 index 0000000000..7e7d78ec52 --- /dev/null +++ b/missing @@ -0,0 +1,236 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU and other programs. + +scriptversion=2024-06-07.14; # UTC + +# shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells + +# Copyright (C) 1996-2024 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# 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 2, 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 to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: +aclocal autoconf autogen autoheader autom4te automake autoreconf +bison flex help2man lex makeinfo perl yacc + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Report bugs to . +GNU Automake home page: . +General help using GNU software: ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing (GNU Automake) $scriptversion" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake|autoreconf) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + *) + : + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + autoheader_deps="'acconfig.h'" + automake_deps="'Makefile.am'" + aclocal_deps="'acinclude.m4'" + case $normalized_program in + aclocal*) + echo "You should only need it if you modified $aclocal_deps or" + echo "$configure_deps." + ;; + autoconf*) + echo "You should only need it if you modified $configure_deps." + ;; + autogen*) + echo "You should only need it if you modified a '.def' or '.tpl' file." + echo "You may want to install the GNU AutoGen package:" + echo "<$gnu_software_URL/autogen/>" + ;; + autoheader*) + echo "You should only need it if you modified $autoheader_deps or" + echo "$configure_deps." + ;; + automake*) + echo "You should only need it if you modified $automake_deps or" + echo "$configure_deps." + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + ;; + autoreconf*) + echo "You should only need it if you modified $aclocal_deps or" + echo "$automake_deps or $autoheader_deps or $automake_deps or" + echo "$configure_deps." + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + perl*) + echo "You should only need it to run GNU Autoconf, GNU Automake, " + echo " assorted other tools, or if you modified a Perl source file." + echo "You may want to install the Perl 5 language interpreter:" + echo "<$perl_URL>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac + program_details "$normalized_program" +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 0000000000..0c9eea2ccd --- /dev/null +++ b/src/config.h.in @@ -0,0 +1,412 @@ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Autoconf result */ +#undef AUTOCONF_RESULT + +/* Build drivers as a standalone libraries */ +#undef BUILD_LIBRARIES + +/* Flags passed to configure */ +#undef CONFIG_FLAGS + +/* We build with debug messages */ +#undef DEBUG + +/* Current GIT branch */ +#undef GIT_BRANCH + +/* Current GIT revision */ +#undef GIT_REV + +/* Define to 1 if you have the header file. */ +#undef HAVE_AUDIOUNIT_AUDIOUNIT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_BLUEVELVETC_H + +/* CUDA is present on the system */ +#undef HAVE_CUDA + +/* Build with pipewire screencast dbus support */ +#undef HAVE_DBUS_SCREENCAST + +/* Define to 1 if you have the header file. */ +#undef HAVE_EMBEDDABLEWEBSERVER_H + +/* Define to 1 if you have the 'EVP_aes_128_cbc' function. */ +#undef HAVE_EVP_AES_128_CBC + +/* have CFB128 */ +#undef HAVE_EVP_AES_128_CFB128 + +/* have CTR */ +#undef HAVE_EVP_AES_128_CTR + +/* Define to 1 if you have the 'EVP_aes_128_ecb' function. */ +#undef HAVE_EVP_AES_128_ECB + +/* Define to 1 if you have the 'EVP_aes_128_gcm' function. */ +#undef HAVE_EVP_AES_128_GCM + +/* have ECB */ +#undef HAVE_EVP_AES_ECB + +/* fec_init must be called before fec_new */ +#undef HAVE_FEC_INIT + +/* We have Firewire DV */ +#undef HAVE_FIREWIRE_DV_FREEBSD + +/* Define if you have the m3api framework */ +#undef HAVE_FRAMEWORK_M3API + +/* Define if you have the Syphon framework */ +#undef HAVE_FRAMEWORK_SYPHON + +/* Define if you have the VideoMasterHD framework */ +#undef HAVE_FRAMEWORK_VIDEOMASTERHD + +/* Define if you have the VideoMasterHD_Audio framework */ +#undef HAVE_FRAMEWORK_VIDEOMASTERHD_AUDIO + +/* Build with GPUJPEG support */ +#undef HAVE_GPUJPEG + +/* Build with iHDTV support */ +#undef HAVE_IHDTV + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Enable IPv6 support */ +#undef HAVE_IPv6 + +/* Build with JACK transport support */ +#undef HAVE_JACK_TRANS + +/* Build with LAVC support */ +#undef HAVE_LAVC + +/* Build with lavc CUDA conversions */ +#undef HAVE_LAVC_CUDA_CONV + +/* Define to 1 if you have the 'asound' library (-lasound). */ +#undef HAVE_LIBASOUND + +/* Define to 1 if you have the 'avcodec' library (-lavcodec). */ +#undef HAVE_LIBAVCODEC + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBAVCODEC_AVCODEC_H + +/* Define to 1 if you have the 'avformat' library (-lavformat). */ +#undef HAVE_LIBAVFORMAT + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBAVFORMAT_AVFORMAT_H + +/* Define to 1 if you have the 'avutil' library (-lavutil). */ +#undef HAVE_LIBAVUTIL + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBAVUTIL_IMGUTILS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBAVUTIL_OPT_H + +/* we have libbacktrace */ +#undef HAVE_LIBBACKTRACE + +/* Define to 1 if you have the 'GL' library (-lGL). */ +#undef HAVE_LIBGL + +/* Define to 1 if you have the 'GLEW' library (-lGLEW). */ +#undef HAVE_LIBGLEW + +/* Define to 1 if you have the 'glew32' library (-lglew32). */ +#undef HAVE_LIBGLEW32 + +/* Define to 1 if you have the 'gpujpeg' library (-lgpujpeg). */ +#undef HAVE_LIBGPUJPEG + +/* Define to 1 if you have the 'opencv_core' library (-lopencv_core). */ +#undef HAVE_LIBOPENCV_CORE + +/* Define to 1 if you have the 'opencv_imgproc' library (-lopencv_imgproc). */ +#undef HAVE_LIBOPENCV_IMGPROC + +/* Define to 1 if you have the 'portaudio' library (-lportaudio). */ +#undef HAVE_LIBPORTAUDIO + +/* Define to 1 if you have the 'rt' library (-lrt). */ +#undef HAVE_LIBRT + +/* Build testcard2 with TTF support */ +#undef HAVE_LIBSDL_TTF + +/* Define to 1 if you have the 'swscale' library (-lswscale). */ +#undef HAVE_LIBSWSCALE + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBSWSCALE_SWSCALE_H + +/* Build with libv4lconvert support */ +#undef HAVE_LIBV4LCONVERT + +/* Define to 1 if you have the 'X11' library (-lX11). */ +#undef HAVE_LIBX11 + +/* Define to 1 if you have the 'Xfixes' library (-lXfixes). */ +#undef HAVE_LIBXFIXES + +/* This is Linux */ +#undef HAVE_LINUX + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_VERSION_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_VIDEODEV2_H + +/* This is Mac X OS */ +#undef HAVE_MACOSX + +/* Build with NAT-PMP support */ +#undef HAVE_NATPMP + +/* OpenCL is supported */ +#undef HAVE_OPENCL + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENCV2_CORE_MAT_HPP + +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENCV2_OPENCV_HPP + +/* Portaudio has Pa_GetVersionInfo */ +#undef HAVE_PA_GETVERSIONINFO + +/* Build with PCP support */ +#undef HAVE_PCP + +/* Build with new PCP name */ +#undef HAVE_PCP_NEW + +/* RTSP server build with live555 support */ +#undef HAVE_RTSP_SERVER + +/* Define to 1 if you have the 'sched_setscheduler' function. */ +#undef HAVE_SCHED_SETSCHEDULER + +/* Build with SDL3 support */ +#undef HAVE_SDL3 + +/* Define to 1 if you have the 'SetThreadDescription' function. */ +#undef HAVE_SETTHREADDESCRIPTION + +/* Build with Soxr support */ +#undef HAVE_SOXR + +/* Build with SpeexDSP support */ +#undef HAVE_SPEEXDSP + +/* Build with Spout support */ +#undef HAVE_SPOUT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Build with Swscale support */ +#undef HAVE_SWSCALE + +/* Build with Syphon support */ +#undef HAVE_SYPHON + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the 'usleep' function. */ +#undef HAVE_USLEEP + +/* Define to 1 if you have the header file. */ +#undef HAVE_VIDEOMASTERHD_CORE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_VIDEOMASTERHD_SDI_AUDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_VIDEOMASTERHD_SDI_H + +/* Define to 1 if you have the header + file. */ +#undef HAVE_VIDEOMASTERHD_VIDEOMASTERHD_CORE_H + +/* Define to 1 if you have the 'vkCreateImage' function. */ +#undef HAVE_VKCREATEIMAGE + +/* Define to 1 if you have the header file. */ +#undef HAVE_VULKAN_VULKAN_H + +/* Using WolfSSL instead of OpenSSL */ +#undef HAVE_WOLFSSL + +/* Define to 1 if you have the 'wolfSSL_EVP_aes_128_cbc' function. */ +#undef HAVE_WOLFSSL_EVP_AES_128_CBC + +/* Define to 1 if you have the 'wolfSSL_EVP_aes_128_cfb128' function. */ +#undef HAVE_WOLFSSL_EVP_AES_128_CFB128 + +/* Define to 1 if you have the 'wolfSSL_EVP_aes_128_ctr' function. */ +#undef HAVE_WOLFSSL_EVP_AES_128_CTR + +/* Define to 1 if you have the 'wolfSSL_EVP_aes_128_ecb' function. */ +#undef HAVE_WOLFSSL_EVP_AES_128_ECB + +/* Define to 1 if you have the 'wolfSSL_EVP_aes_128_gcm' function. */ +#undef HAVE_WOLFSSL_EVP_AES_128_GCM + +/* Build with XFixes support */ +#undef HAVE_XFIXES + +/* Define to 1 if you have the header file. */ +#undef HAVE_XIAPI_H + +/* Build with zfec support */ +#undef HAVE_ZFEC + +/* Build with libavcodec VDPAU HW acceleration support */ +#undef HWACC_VDPAU + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Assume that SAGE supports native DXT5 YCoCg */ +#undef SAGE_NATIVE_DXT5YCOCG + +/* Add support for SDP over HTTP */ +#undef SDP_HTTP + +/* use shared decoder for all participants */ +#undef SHARED_DECODER + +/* The size of 'int *', as computed by sizeof. */ +#undef SIZEOF_INT_P + +/* The size of 'size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + +/* path to src directory */ +#undef SRCDIR + +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* NDI version to use */ +#undef USE_NDI_VERSION + +/* We want to use OpenGL pixel buffer objects */ +#undef USE_PBO_DXT_ENCODER + +/* We use RT priority */ +#undef USE_RT + +/* Version number of package */ +#undef VERSION + +/* MagickWand is v7 or later */ +#undef WAND7 + +/* This is an Windows OS */ +#undef WIN32 + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* This is little endian system */ +#undef WORDS_SMALLENDIAN + +/* Name of the dynamic libarary */ +#undef XIMEA_LIBRARY_NAME + +/* Path to the XI dynamic libarary */ +#undef XIMEA_LIBRARY_PATH + +/* Dynamically open XIMEA lib on runtime */ +#undef XIMEA_RUNTIME_LINKING + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define to 1 on platforms where this makes off_t a 64-bit type. */ +#undef _LARGE_FILES + +/* Number of bits in time_t, on hosts where this is settable. */ +#undef _TIME_BITS + +/* Define to 1 if type 'char' is unsigned and your compiler does not + predefine this macro. */ +#ifndef __CHAR_UNSIGNED__ +# undef __CHAR_UNSIGNED__ +#endif + +/* Define to 1 on platforms where this makes time_t a 64-bit type. */ +#undef __MINGW_USE_VC2005_COMPAT + +/* Define to empty if 'const' does not conform to ANSI C. */ +#undef const + +/* Define as 'unsigned int' if doesn't define. */ +#undef size_t From b873141158fbc9a7c72b9b138b6d16f67a8f31b9 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 1 Jun 2026 15:03:14 +0200 Subject: [PATCH 85/86] removed configure-related files from .gitignore --- .gitignore | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8e4d5b3847..aa19a1223f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ -configure Makefile -config.guess config.h -config.h.in -config.sub *.o *.P *.lo @@ -23,8 +19,6 @@ aclocal.m4 autom4te.cache config.log config.status -install-sh -missing src/version.h RCS *.sw? @@ -42,7 +36,6 @@ src/stamp-h1 .DS_Store uv.app/Contents/libs/ depcomp -compile core m4/ libtool From 78efd6673176edb50c5cffe176e2598ee7b58709 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 15 Jun 2026 11:51:48 +0200 Subject: [PATCH 86/86] vcap/v4l2: fix use-after-free opts.dev_name points to tmp --- src/video_capture/v4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_capture/v4l2.c b/src/video_capture/v4l2.c index 89cc944d69..2483499ed9 100644 --- a/src/video_capture/v4l2.c +++ b/src/video_capture/v4l2.c @@ -779,13 +779,13 @@ static int vidcap_v4l2_init(struct vidcap_params *params, void **state) gettimeofday(&s->t0, NULL); s->frames = 0; - free(tmp); - MSG(NOTICE, "Capturing %dx%d @%.2f%s %s from %s\n", s->desc.width, s->desc.height, s->desc.fps, get_interlacing_suffix(s->desc.interlacing), get_codec_name(s->desc.color_spec), opts.dev_name); + free(tmp); + *state = s; return VIDCAP_INIT_OK;