diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml index 790adebc..6229136a 100644 --- a/.github/workflows/coverity-scan.yml +++ b/.github/workflows/coverity-scan.yml @@ -42,7 +42,6 @@ jobs: - name: Install dependencies via apt-get run: | - sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get -y install \ ca-certificates \ diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2ef3de84..9d606a93 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -30,7 +30,7 @@ jobs: brew install autoconf-archive brew install pkg-config - - name: Build + - name: Test on macOS run: | autoreconf -v --install --force ./configure --prefix=/usr diff --git a/.github/workflows/netbsd.yml b/.github/workflows/netbsd.yml index fa270221..7c5f7d83 100644 --- a/.github/workflows/netbsd.yml +++ b/.github/workflows/netbsd.yml @@ -26,7 +26,7 @@ jobs: uname -a whoami pwd - export PKG_REPOS="http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/9.0_current/All/" + export PKG_REPOS="http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/.9.0_current/All/" sudo -E pkgin clean sudo -E pkgin update # https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/index-all.html diff --git a/.github/workflows/solaris.yml b/.github/workflows/solaris.yml index 99b47e58..3a36253e 100644 --- a/.github/workflows/solaris.yml +++ b/.github/workflows/solaris.yml @@ -20,7 +20,12 @@ jobs: uses: vmactions/solaris-vm@v0 with: prepare: | - pkg install gcc-7 + pkg publisher solaris + beadm list + pkg info entire + pkg list -af entire + pkg list -af gcc-7 + pkg install -v --accept developer/gcc-7@7.3.0-11.4.0.0.1.14.0 pkgutil -y -i automake autoconf autoconf_archive libtool pkgconfig libcppunit1_12_1 libcppunit_dev gsed ggrep mem: 4096 run: | diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 6058485f..4764e3b6 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -39,6 +39,7 @@ jobs: gcc \ g++ \ gpm \ + git \ wget \ unzip \ libgpm-dev \ @@ -57,6 +58,8 @@ jobs: unzip -q "sonar-scanner-cli-${LATEST_VERSION}-linux.zip" -d "/tmp" || echo echo "sonar.host.url=https://sonarcloud.io" >> /tmp/sonar-scanner-*/conf/sonar-scanner.properties mkdir /tmp/sonar-cache + chmod +x /tmp/sonar-scanner-${LATEST_VERSION}-linux/jre/lib/jexec + chmod +x /tmp/sonar-scanner-${LATEST_VERSION}-linux/jre/lib/jspawnhelper autoreconf -v --install --force ./configure --prefix=/usr /tmp/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make all diff --git a/.gitignore b/.gitignore index 1f7be808..cc944388 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ examples/choice examples/.deps/ examples/dialog examples/event-log +examples/eventloop examples/fullwidth-character examples/hello examples/highlight-text @@ -74,6 +75,10 @@ final/dialog/.depend final/dialog/.deps/ final/dialog/.dirstamp final/dialog/.libs/ +final/eventloop/.depend +final/eventloop/.deps/ +final/eventloop/.dirstamp +final/eventloop/.libs/ final/input/.depend final/input/.deps/ final/input/.dirstamp @@ -103,6 +108,7 @@ final/widget/.depend final/widget/.deps/ final/widget/.dirstamp final/widget/.libs/ +m4/ test/.deps/ test/.libs/ test/*_test diff --git a/ChangeLog b/ChangeLog index 826c0df4..46742b95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2023-10-14 Markus Gans + * Switch to a readers-writer lock for the timer list + +2023-10-07 Markus Gans + * Bugfix: Bottom transparent shadow changes were registered in wrong row + +2023-10-03 Markus Gans + * Eliminate undefined behavior on exit + +2023-09-17 Markus Gans + * Better direct access to FCharAttribute type + +2023-06-04 Markus Gans + * Added support for a tiltable scroll wheel. This allows you to scroll + the context of widgets left and right in an xterm + +2023-05-31 Markus Gans + * Fix setFormatedNumber() in FString for separator > 127 + (e.g. non-breaking space) + 2023-05-18 Markus Gans * Version 0.9.0 diff --git a/configure.ac b/configure.ac index 1b8fe931..ec2b06ee 100644 --- a/configure.ac +++ b/configure.ac @@ -47,16 +47,22 @@ AC_CHECK_FUNCS( \ geteuid \ getttynam \ select \ + sigaction \ strdup \ strstr \ + timer_create \ + timer_settime \ vsnprintf \ wcwidth ) - # Checks for 'tgetent' AC_SEARCH_LIBS([tgetent], [terminfo mytinfo termlib termcap tinfo ncurses curses]) # Checks for 'tparm' AC_SEARCH_LIBS([tparm], [terminfo mytinfo termlib termcap tinfo ncurses curses]) +# Checks for 'timer_create' +AC_SEARCH_LIBS([timer_create], [rt]) +# Checks for 'timer_create' +AC_SEARCH_LIBS([timer_settime], [rt]) AC_SUBST([FINAL_LIBS]) AC_SUBST([TERMCAP_LIB]) diff --git a/doc/FDialog.svg b/doc/FDialog.svg index 375e9b33..bbd752f8 100644 --- a/doc/FDialog.svg +++ b/doc/FDialog.svg @@ -1,200 +1 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - Title bar - Zoom - Dialog menu - Minimize - Resize corner - - - - - - - +Title barZoomDialog menuMinimizeResize corner \ No newline at end of file diff --git a/doc/final-cut-application-structure.svg b/doc/final-cut-application-structure.svg index e992dacd..f1c6b6f7 100644 --- a/doc/final-cut-application-structure.svg +++ b/doc/final-cut-application-structure.svg @@ -1,220 +1 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - Application - - - Standard C/C++ Library - - - Operating System - - - Widgets - - - Virtual Terminal - - - Termcap - - - Terminal - - - FINAL CUT - - - - - - +ApplicationStandard C/C++ LibraryOperating SystemWidgetsVirtual TerminalTermcapTerminalFINAL CUT \ No newline at end of file diff --git a/doc/final-cut-widget-tree.svg b/doc/final-cut-widget-tree.svg index fe73d040..76d5b7a1 100644 --- a/doc/final-cut-widget-tree.svg +++ b/doc/final-cut-widget-tree.svg @@ -1,324 +1 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - FApplication - - - - - - FDialog - - - - - - FDialog - - - - - - FLabel - - - - - - FListBox - - - - - etc. - - - - - - - - - Parent: - - - Child: - - - Subchild: - - - Sub-subchild: - - - - - Application widget (= 1) - - - Main widget (= 1) - - - Widget(s) of the main widget (≥ 0) - - - Widget(s) from the parent widget (≥ 0) - - - +FApplicationFDialogFDialogFLabelFListBoxetc.Parent:Child:Subchild:Sub-subchild:Application widget (= 1)Main widget (= 1)Widget(s) of the main widget (≥ 0)Widget(s) from the parent widget (≥ 0) \ No newline at end of file diff --git a/doc/user-theme-bee-palette.svg b/doc/user-theme-bee-palette.svg index 90825aa4..4d81c1d7 100644 --- a/doc/user-theme-bee-palette.svg +++ b/doc/user-theme-bee-palette.svg @@ -1,330 +1 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - +0123456789101112131415 \ No newline at end of file diff --git a/doc/user-theme-fc16-dark-palette.svg b/doc/user-theme-fc16-dark-palette.svg index 0d91e4d3..c14e19d2 100644 --- a/doc/user-theme-fc16-dark-palette.svg +++ b/doc/user-theme-fc16-dark-palette.svg @@ -1,330 +1 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - +0123456789101112131415 \ No newline at end of file diff --git a/doc/user-theme-fc16-palette.svg b/doc/user-theme-fc16-palette.svg index 7bcadf23..a62fce42 100644 --- a/doc/user-theme-fc16-palette.svg +++ b/doc/user-theme-fc16-palette.svg @@ -1,330 +1 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - +0123456789101112131415 \ No newline at end of file diff --git a/doc/user-theme-fc8-palette.svg b/doc/user-theme-fc8-palette.svg index 0578c6a1..f606a103 100644 --- a/doc/user-theme-fc8-palette.svg +++ b/doc/user-theme-fc8-palette.svg @@ -1,194 +1 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - +01234567 \ No newline at end of file diff --git a/doc/user-theme-vga-palette.svg b/doc/user-theme-vga-palette.svg index e451e02c..51a8fefb 100644 --- a/doc/user-theme-vga-palette.svg +++ b/doc/user-theme-vga-palette.svg @@ -1,330 +1 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - +0123456789101112131415 \ No newline at end of file diff --git a/doc/widget-coordinates.svg b/doc/widget-coordinates.svg index 694d2b1c..e566d4e3 100644 --- a/doc/widget-coordinates.svg +++ b/doc/widget-coordinates.svg @@ -1,432 +1 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getDesktopWidth() = 80 - getDesktopHeight() = 24 - - - getPos() = (25,6) - getTermPos() = (25,6) - - - getY() = 6 - getTermY() = 6 - - - - - getX() = 25 - getTermX() = 25 - - - - (1,1) - - - - (80,24) - - - - - getX() = 19 - getTermX() = 44 - - - - getY() = 8 - getTermY() = 15 - - - getPos() = (19,8) - getTermPos() = (44,15) - - - - (80,1) - - - - (1,24) - - - +getDesktopWidth() = 80getDesktopHeight() = 24getPos() = (25,6) getTermPos() = (25,6)getY() = 6 getTermY() = 6getX() = 25 getTermX() = 25(1,1)(80,24)getX() = 19 getTermX() = 44getY() = 8 getTermY() = 15getPos() = (19,8) getTermPos() = (44,15)(80,1)(1,24) \ No newline at end of file diff --git a/doc/widget-geometry.svg b/doc/widget-geometry.svg index e7a6451b..340f2876 100644 --- a/doc/widget-geometry.svg +++ b/doc/widget-geometry.svg @@ -1,481 +1 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getSize() = FSize(32,12) - - - - = FPoint(25,6), FPoint(56,17) - - - getGeometry() = FPoint(25,6), FSize(32,12) - - - getTermGeometry() = FPoint(25,6), FSize(32,12) - - - = FPoint(25,6), FPoint(56,17) - - - getShadow() = FSize(2,1) - - - getGeometryWithShadow() = FPoint(25,6), FSize(34,13) - - - = FPoint(25,6), FPoint(58,18) - - - getTermGeometryWithShadow() = FPoint(25,6), FSize(34,13) - - - = FPoint(25,6), FPoint(58,18) - - - getSize() = FSize(10,1) - - - = FPoint(19,8), FPoint(28,8) - - - getGeometry() = FPoint(19,8), FSize(10,1) - - - getTermGeometry() = FPoint(44,15), FSize(10,1) - - - = FPoint(44,15), FPoint(53,15) - - - getShadow() = FSize(1,1) - - - getGeometryWithShadow() = FPoint(19,8), FSize(11,2) - - - = FPoint(19,8), FPoint(29,9) - - - getTermGeometryWithShadow() = FPoint(44,15), FSize(11,2) - - - = FPoint(44,15), FPoint(54,16) - - - - - - FDialog() - - - FButton() - - +getSize() = FSize(32,12)= FPoint(25,6), FPoint(56,17)getGeometry() = FPoint(25,6), FSize(32,12)getTermGeometry() = FPoint(25,6), FSize(32,12)= FPoint(25,6), FPoint(56,17)getShadow() = FSize(2,1)getGeometryWithShadow() = FPoint(25,6), FSize(34,13)= FPoint(25,6), FPoint(58,18)getTermGeometryWithShadow() = FPoint(25,6), FSize(34,13)= FPoint(25,6), FPoint(58,18)getSize() = FSize(10,1)= FPoint(19,8), FPoint(28,8)getGeometry() = FPoint(19,8), FSize(10,1)getTermGeometry() = FPoint(44,15), FSize(10,1)= FPoint(44,15), FPoint(53,15)getShadow() = FSize(1,1)getGeometryWithShadow() = FPoint(19,8), FSize(11,2)= FPoint(19,8), FPoint(29,9)getTermGeometryWithShadow() = FPoint(44,15), FSize(11,2)= FPoint(44,15), FPoint(54,16)FDialog()FButton() \ No newline at end of file diff --git a/doc/widget-lengths.svg b/doc/widget-lengths.svg index 0a0897df..545b420a 100644 --- a/doc/widget-lengths.svg +++ b/doc/widget-lengths.svg @@ -1,702 +1 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getDesktopWidth() - getDesktopHeight() - - - getPos() - getTermPos() - - - - getY() - getTermY() - - - - getX() - getTermX() - - - getWidth() - - - getHeight() - - - - - - - getClientHeight() - - getTopPadding() - - - getBottomPadding() - - - - - - - - - - - getRightPadding() - - - getLeftPadding() - - - getClientWidth() - +getDesktopWidth()getDesktopHeight()getPos() getTermPos()getY() getTermY()getX() getTermX()getWidth()getHeight()getClientHeight()getTopPadding()getBottomPadding()getRightPadding()getLeftPadding()getClientWidth() \ No newline at end of file diff --git a/examples/Makefile.am b/examples/Makefile.am index da879c88..0c774239 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -18,6 +18,7 @@ noinst_PROGRAMS = \ choice \ dialog \ event-log \ + eventloop \ fullwidth-character \ hello \ highlight-text \ @@ -52,6 +53,7 @@ checklist_SOURCES = checklist.cpp choice_SOURCES = choice.cpp dialog_SOURCES = dialog.cpp event_log_SOURCES = event-log.cpp +eventloop_SOURCES = eventloop.cpp fullwidth_character_SOURCES = fullwidth-character.cpp hello_SOURCES = hello.cpp highlight_text_SOURCES = highlight-text.cpp diff --git a/examples/eventloop.cpp b/examples/eventloop.cpp new file mode 100644 index 00000000..2304c60c --- /dev/null +++ b/examples/eventloop.cpp @@ -0,0 +1,137 @@ +/*********************************************************************** +* eventloop.cpp - Example of using the event loop * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include +#include +#include + +#include +#include + +#include + + +struct Global +{ + static struct termios original_term_io_settings; // global termios object +}; + +// static class attribute +struct termios Global::original_term_io_settings{}; + + +//---------------------------------------------------------------------- +static void onExit() +{ + // Restore terminal control + tcsetattr (STDIN_FILENO, TCSAFLUSH, &Global::original_term_io_settings); + std::cout << "Bye!" << std::endl; +} + + +//---------------------------------------------------------------------- +// main part +//---------------------------------------------------------------------- + +auto main() -> int +{ + finalcut::EventLoop loop{}; + finalcut::TimerMonitor timer1{&loop}; + finalcut::TimerMonitor timer2{&loop}; + finalcut::SignalMonitor sig_int_monitor{&loop}; + finalcut::SignalMonitor sig_abrt_monitor{&loop}; + finalcut::IoMonitor stdin_monitor{&loop}; + finalcut::FTermios::init(); + auto stdin_no = finalcut::FTermios::getStdIn(); + + // Save terminal setting and set terminal to raw mode + // (no echo, no line buffering). + tcgetattr (stdin_no, &Global::original_term_io_settings); + atexit (onExit); + struct termios new_term_io_settings{Global::original_term_io_settings}; + new_term_io_settings.c_lflag &= uInt(~(ECHO | ICANON)); + tcsetattr (stdin_no, TCSAFLUSH, &new_term_io_settings); + + // Set file descriptor of stdin to non-blocking mode + int stdin_flags{fcntl(stdin_no, F_GETFL, 0)}; + (void)fcntl(stdin_no, F_SETFL, stdin_flags | O_NONBLOCK); + + // Configure monitors + timer1.init ( [] (const finalcut::Monitor*, short) + { + std::cout << "Tick" << std::endl; + } + , nullptr ); + + timer2.init ( [] (const finalcut::Monitor*, short) + { + std::cout << "Tock" << std::endl; + } + , nullptr ); + + timer1.setInterval ( std::chrono::nanoseconds{ 500'000'000 } + , std::chrono::nanoseconds{ 1'000'000'000 } ); + + timer2.setInterval ( std::chrono::nanoseconds{ 1'000'000'000 } + , std::chrono::nanoseconds{ 1'000'000'000 } ); + + sig_int_monitor.init ( SIGINT + , [&loop] (const finalcut::Monitor*, short) + { + std::cout << "Signal SIGINT received." + << std::endl; + loop.leave(); + } + , nullptr ); + + sig_abrt_monitor.init ( SIGABRT + , [&loop] (const finalcut::Monitor*, short) + { + std::cout << "Signal SIGABRT received." + << std::endl; + loop.leave(); + } + , nullptr ); + + stdin_monitor.init ( stdin_no + , POLLIN + , [] (const finalcut::Monitor* monitor, short) + { + char Char{'\0'}; + const auto bytes = ::read(monitor->getFileDescriptor(), &Char, 1); + + if ( bytes > 0 ) + std::cout << "typed in: '" << Char << "'" + << std::endl; + } + , nullptr ); + + // Start monitors + timer1.resume(); + timer2.resume(); + sig_int_monitor.resume(); + sig_abrt_monitor.resume(); + stdin_monitor.resume(); + + // Monitoring + return loop.run(); +} diff --git a/examples/listbox.cpp b/examples/listbox.cpp index 8b940c22..6f7af7db 100644 --- a/examples/listbox.cpp +++ b/examples/listbox.cpp @@ -55,7 +55,7 @@ void doubleToItem ( FListBoxItem& item , std::size_t index ) { using DblList = std::list; - DblList& dbl_list = flistboxhelper::getContainer(container); + const DblList& dbl_list = flistboxhelper::getContainer(container); auto iter = dbl_list.begin(); std::advance (iter, index); item.setText (FString() << *iter); diff --git a/examples/string-operations.cpp b/examples/string-operations.cpp index bb7ad75a..8d2b154f 100644 --- a/examples/string-operations.cpp +++ b/examples/string-operations.cpp @@ -532,7 +532,7 @@ void convertToNumberExample() try { const double double_num = \ - finalcut::FString("2.718'281'828'459'045'235'3").toDouble(); + finalcut::FString("2.7182818284590452353").toDouble(); std::ios_base::fmtflags save_flags = std::cout.flags(); std::cout << " toDouble: " << std::setprecision(11) << double_num << std::endl; @@ -579,11 +579,11 @@ void formatedNumberExample() finalcut::FString fnum2{}; #if defined(__LP64__) || defined(_LP64) // 64-bit architecture - fnum1.setFormatedNumber(0xffffffffffffffffU, '\''); + fnum1.setFormatedNumber(0xffffffffffffffffU, finalcut::C_STR("'")); fnum2.setFormatedNumber(-9223372036854775807); #else // 32-bit architecture - fnum1.setFormatedNumber(0xffffffffU, '\''); + fnum1.setFormatedNumber(0xffffffffU, finalcut::C_STR("'")); fnum2.setFormatedNumber(-2147483647); #endif std::cout << "setFormatedNumber: " diff --git a/examples/term-attributes.cpp b/examples/term-attributes.cpp index 11bb7ae2..b8e117d2 100644 --- a/examples/term-attributes.cpp +++ b/examples/term-attributes.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2015-2022 Markus Gans * +* Copyright 2015-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -433,6 +433,7 @@ void AttribDemo::draw() const std::vector > effect { [this] { printNormal(); }, + [this] { printDim(); }, [this] { printBold(); }, [this] { printBoldDim(); }, [this] { printItalic(); }, diff --git a/examples/ui.cpp b/examples/ui.cpp index 40b74602..1555b091 100644 --- a/examples/ui.cpp +++ b/examples/ui.cpp @@ -952,12 +952,10 @@ void MyDialog::cb_showProgressBar() //---------------------------------------------------------------------- void MyDialog::cb_updateNumber() { - int select_num = 0; - - for (const auto& item : myList.getData() ) - if ( item.isSelected() ) - select_num++; - + auto is_selected = [] (auto item) { return item.isSelected(); }; + auto select_num = std::count_if ( std::begin(myList.getData()) + , std::end(myList.getData()) + , is_selected ); tagged_count.clear(); tagged_count << select_num; tagged_count.redraw(); diff --git a/examples/watch.cpp b/examples/watch.cpp index f847f45f..76a5450f 100644 --- a/examples/watch.cpp +++ b/examples/watch.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2015-2022 Markus Gans * +* Copyright 2015-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -71,7 +71,8 @@ Watch::Watch (FWidget* parent) time_label.setEmphasis(); // Switch - sec = seconds_sw.setChecked(); + seconds_sw.setChecked(); + sec = seconds_sw.isChecked(); // Connect switch signal "toggled" with a callback member function clock_sw.addCallback @@ -146,10 +147,7 @@ void Watch::cb_clock() //---------------------------------------------------------------------- void Watch::cb_seconds() { - if ( seconds_sw.isChecked() ) - sec = true; - else - sec = false; + sec = seconds_sw.isChecked(); if ( clock_sw.isChecked() ) printTime(); diff --git a/examples/xpmimage.h b/examples/xpmimage.h index 3d6d2036..02a63b03 100644 --- a/examples/xpmimage.h +++ b/examples/xpmimage.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2022 Markus Gans * +* Copyright 2022-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -1124,10 +1124,7 @@ void XpmImage::parseXPM3 (XPMdataT& raw_xpm) { std::vector xpm{}; xpm.reserve(getArraySize(xpm)); - - for (const auto& line : raw_xpm) - xpm.emplace_back(line); - + std::copy (std::begin(raw_xpm), std::end(raw_xpm), std::back_inserter(xpm)); parseXPM3 (xpm); } diff --git a/final/Makefile.am b/final/Makefile.am index 9d61be75..05576835 100644 --- a/final/Makefile.am +++ b/final/Makefile.am @@ -15,6 +15,16 @@ libfinal_la_SOURCES = \ dialog/fdialog.cpp \ dialog/ffiledialog.cpp \ dialog/fmessagebox.cpp \ + eventloop/backend_monitor.cpp \ + eventloop/eventloop.cpp \ + eventloop/eventloop_functions.cpp \ + eventloop/io_monitor.cpp \ + eventloop/kqueue_timer.cpp \ + eventloop/monitor.cpp \ + eventloop/pipedata.cpp \ + eventloop/posix_timer.cpp \ + eventloop/signal_monitor.cpp \ + eventloop/timer_monitor.cpp \ input/fkeyboard.cpp \ input/fkey_map.cpp \ input/fmouse.cpp \ @@ -91,6 +101,7 @@ libfinal_la_LDFLAGS = -no-undefined -version-info @SO_VERSION@ finalcutincludedir = $(includedir)/final finalcutdialogincludedir = $(includedir)/final/dialog +finalcuteventloopincludedir = $(includedir)/final/eventloop finalcutinputincludedir = $(includedir)/final/input finalcutmenuincludedir = $(includedir)/final/menu finalcutoutputincludedir = $(includedir)/final/output @@ -104,6 +115,16 @@ finalcutdialoginclude_HEADERS = \ dialog/ffiledialog.h \ dialog/fmessagebox.h +finalcuteventloopinclude_HEADERS = \ + eventloop/backend_monitor.h \ + eventloop/eventloop.h \ + eventloop/eventloop_functions.h \ + eventloop/io_monitor.h \ + eventloop/monitor.h \ + eventloop/pipedata.h \ + eventloop/signal_monitor.h \ + eventloop/timer_monitor.h + finalcutinputinclude_HEADERS = \ input/fkeyboard.h \ input/fkey_hashmap.h \ @@ -207,6 +228,7 @@ clean-local: uninstall-hook: if test -d ${finalcutdialogincludedir}; then rmdir ${finalcutdialogincludedir}; fi + if test -d ${finalcuteventloopincludedir}; then rmdir ${finalcuteventloopincludedir}; fi if test -d ${finalcutinputincludedir}; then rmdir ${finalcutinputincludedir}; fi if test -d ${finalcutmenuincludedir}; then rmdir ${finalcutmenuincludedir}; fi if test -d ${finalcutoutputttyincludedir}; then rmdir ${finalcutoutputttyincludedir}; fi diff --git a/final/Makefile.clang b/final/Makefile.clang index 791181ec..91db374e 100644 --- a/final/Makefile.clang +++ b/final/Makefile.clang @@ -12,6 +12,14 @@ INCLUDE_HEADERS = \ dialog/fdialog.h \ dialog/ffiledialog.h \ dialog/fmessagebox.h \ + eventloop/backend_monitor.h \ + eventloop/eventloop.h \ + eventloop/eventloop_functions.h \ + eventloop/io_monitor.h \ + eventloop/monitor.h \ + eventloop/pipedata.h \ + eventloop/signal_monitor.h \ + eventloop/timer_monitor.h \ input/fkeyboard.h \ input/fmouse.h \ menu/fcheckmenuitem.h \ @@ -90,7 +98,7 @@ INCLUDE_HEADERS = \ CXX = clang++ CCXFLAGS = $(OPTIMIZE) $(PROFILE) -DCOMPILE_FINAL_CUT $(DEBUG) $(VER) $(GPM) -fexceptions -std=c++14 MAKEFILE = -f Makefile.clang -LDFLAGS = $(TERMCAP) -lgpm +LDFLAGS = $(TERMCAP) -lrt -lgpm INCLUDES = -I.. GPM = -D F_HAVE_LIBGPM VER = -D F_VERSION=\"$(VERSION)\" @@ -100,6 +108,16 @@ OBJS = \ dialog/fdialog.o \ dialog/ffiledialog.o \ dialog/fmessagebox.o \ + eventloop/backend_monitor.o \ + eventloop/eventloop.o \ + eventloop/eventloop_functions.o \ + eventloop/io_monitor.o \ + eventloop/kqueue_timer.o \ + eventloop/monitor.o \ + eventloop/pipedata.o \ + eventloop/posix_timer.o \ + eventloop/signal_monitor.o \ + eventloop/timer_monitor.o \ input/fkeyboard.o \ input/fkey_map.o \ input/fmouse.o \ @@ -198,7 +216,7 @@ debug: $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic -Weverything -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough -Wno-reserved-id-macro -Wno-format-nonliteral -Wno-switch-enum -Wno-covered-switch-default" unittest: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic -Weverything -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough -Wno-reserved-id-macro -Wno-format-nonliteral -Wno-switch-enum -Wno-covered-switch-default" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -D UNIT_TEST -Wall -Wextra -Wpedantic -Weverything -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough -Wno-reserved-id-macro -Wno-format-nonliteral -Wno-switch-enum -Wno-covered-switch-default" profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" diff --git a/final/Makefile.gcc b/final/Makefile.gcc index ab1f0b86..40daa371 100644 --- a/final/Makefile.gcc +++ b/final/Makefile.gcc @@ -12,6 +12,14 @@ INCLUDE_HEADERS = \ dialog/fdialog.h \ dialog/ffiledialog.h \ dialog/fmessagebox.h \ + eventloop/backend_monitor.h \ + eventloop/eventloop.h \ + eventloop/eventloop_functions.h \ + eventloop/io_monitor.h \ + eventloop/monitor.h \ + eventloop/pipedata.h \ + eventloop/signal_monitor.h \ + eventloop/timer_monitor.h \ input/fkeyboard.h \ input/fmouse.h \ menu/fcheckmenuitem.h \ @@ -90,7 +98,7 @@ INCLUDE_HEADERS = \ CXX = g++ CCXFLAGS = $(OPTIMIZE) $(PROFILE) -DCOMPILE_FINAL_CUT $(DEBUG) $(VER) $(GPM) -fexceptions -std=c++14 MAKEFILE = -f Makefile.gcc -LDFLAGS = $(TERMCAP) -lgpm +LDFLAGS = $(TERMCAP) -lrt -lgpm INCLUDES = -I.. GPM = -D F_HAVE_LIBGPM VER = -D F_VERSION=\"$(VERSION)\" @@ -100,6 +108,16 @@ OBJS = \ dialog/fdialog.o \ dialog/ffiledialog.o \ dialog/fmessagebox.o \ + eventloop/backend_monitor.o \ + eventloop/eventloop.o \ + eventloop/eventloop_functions.o \ + eventloop/io_monitor.o \ + eventloop/kqueue_timer.o \ + eventloop/monitor.o \ + eventloop/pipedata.o \ + eventloop/posix_timer.o \ + eventloop/signal_monitor.o \ + eventloop/timer_monitor.o \ input/fkeyboard.o \ input/fkey_map.o \ input/fmouse.o \ @@ -198,7 +216,7 @@ debug: $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -Wall -Wextra -Wpedantic" unittest: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -D UNIT_TEST -Wall -Wextra -Wpedantic" profile: $(MAKE) $(MAKEFILE) PROFILE="-pg" diff --git a/final/dialog/fdialog.cpp b/final/dialog/fdialog.cpp index 585a5e5a..7546076e 100644 --- a/final/dialog/fdialog.cpp +++ b/final/dialog/fdialog.cpp @@ -82,10 +82,10 @@ FDialog::~FDialog() // destructor // public methods of FDialog //---------------------------------------------------------------------- -auto FDialog::setDialogWidget (bool enable) -> bool +void FDialog::setDialogWidget (bool enable) { if ( isDialogWidget() == enable ) - return true; + return; setFlags().type.dialog_widget = enable; @@ -93,15 +93,13 @@ auto FDialog::setDialogWidget (bool enable) -> bool setTermOffsetWithPadding(); else setParentOffset(); - - return enable; } //---------------------------------------------------------------------- -auto FDialog::setModal (bool enable) -> bool +void FDialog::setModal (bool enable) { if ( isModal() == enable ) - return true; + return; setFlags().visibility.modal = enable; @@ -113,12 +111,10 @@ auto FDialog::setModal (bool enable) -> bool } else setModalDialogCounter()--; - - return enable; } //---------------------------------------------------------------------- -auto FDialog::setBorder (bool enable) -> bool +void FDialog::setBorder (bool enable) { if ( enable ) { @@ -134,8 +130,6 @@ auto FDialog::setBorder (bool enable) -> bool setBottomPadding(0); setRightPadding(0); } - - return ( setFlags().feature.no_border = (! enable) ); } //---------------------------------------------------------------------- @@ -148,7 +142,7 @@ void FDialog::resetColors() } //---------------------------------------------------------------------- -auto FDialog::setResizeable (bool enable) -> bool +void FDialog::setResizeable (bool enable) { FWindow::setResizeable (enable); @@ -156,12 +150,10 @@ auto FDialog::setResizeable (bool enable) -> bool zoom_item->setEnable(); else zoom_item->setDisable(); - - return enable; } //---------------------------------------------------------------------- -auto FDialog::setMinimizable (bool enable) -> bool +void FDialog::setMinimizable (bool enable) { FWindow::setMinimizable (enable); @@ -169,8 +161,6 @@ auto FDialog::setMinimizable (bool enable) -> bool minimize_item->setEnable(); else minimize_item->setDisable(); - - return enable; } //---------------------------------------------------------------------- @@ -581,10 +571,6 @@ void FDialog::onMouseDoubleClick (FMouseEvent* ev) if ( ev->getButton() != MouseButton::Left ) return; - const int x = getTermX(); - const int y = getTermY(); - const FRect title_button{x, y, 3, 1}; - if ( isMouseOverMenuButton(ms) ) { // Double click on title button @@ -1430,11 +1416,8 @@ inline void FDialog::deactivateMinimizeButton() inline void FDialog::leaveMinimizeButton (const MouseStates& ms) { bool minimize_button_pressed_before = minimize_button_pressed; - - if ( isMouseOverMinimizeButton(ms) && minimize_button_active ) - minimize_button_pressed = true; - else if ( minimize_button_pressed ) - minimize_button_pressed = false; + minimize_button_pressed = isMouseOverMinimizeButton(ms) + && minimize_button_active; if ( minimize_button_pressed_before != minimize_button_pressed ) drawTitleBar(); @@ -1480,11 +1463,7 @@ inline void FDialog::deactivateZoomButton() inline void FDialog::leaveZoomButton (const MouseStates& ms) { bool zoom_button_pressed_before = zoom_button_pressed; - - if ( isMouseOverZoomButton(ms) && zoom_button_active ) - zoom_button_pressed = true; - else if ( zoom_button_pressed ) - zoom_button_pressed = false; + zoom_button_pressed = isMouseOverZoomButton(ms) && zoom_button_active; if ( zoom_button_pressed_before != zoom_button_pressed ) drawTitleBar(); diff --git a/final/dialog/fdialog.h b/final/dialog/fdialog.h index ef0e1071..74f96ab5 100644 --- a/final/dialog/fdialog.h +++ b/final/dialog/fdialog.h @@ -104,16 +104,16 @@ class FDialog : public FWindow virtual auto getText() const -> FString; // Mutators - auto setDialogWidget (bool = true) -> bool; - auto unsetDialogWidget() -> bool; - auto setModal (bool = true) -> bool; - auto unsetModal() -> bool; - auto setResizeable (bool = true) -> bool override; - auto setMinimizable (bool = true) -> bool override; - auto setTitlebarButtonVisibility (bool = true) -> bool; - auto unsetTitlebarButtonVisibility() -> bool; - auto setBorder (bool = true) -> bool; - auto unsetBorder() -> bool; + void setDialogWidget (bool = true); + void unsetDialogWidget(); + void setModal (bool = true); + void unsetModal(); + void setResizeable (bool = true) override; + void setMinimizable (bool = true) override; + void setTitlebarButtonVisibility (bool = true); + void unsetTitlebarButtonVisibility(); + void setBorder (bool = true); + void unsetBorder(); void resetColors() override; virtual void setText (const FString&); @@ -287,24 +287,24 @@ inline auto FDialog::getText() const -> FString { return tb_text; } //---------------------------------------------------------------------- -inline auto FDialog::unsetDialogWidget() -> bool -{ return setDialogWidget(false); } +inline void FDialog::unsetDialogWidget() +{ setDialogWidget(false); } //---------------------------------------------------------------------- -inline auto FDialog::unsetModal() -> bool -{ return setModal(false); } +inline void FDialog::unsetModal() +{ setModal(false); } //---------------------------------------------------------------------- -inline auto FDialog::setTitlebarButtonVisibility (bool enable) -> bool -{ return (titlebar_buttons = enable); } +inline void FDialog::setTitlebarButtonVisibility (bool enable) +{ titlebar_buttons = enable; } //---------------------------------------------------------------------- -inline auto FDialog::unsetTitlebarButtonVisibility() -> bool -{ return setTitlebarButtonVisibility(false); } +inline void FDialog::unsetTitlebarButtonVisibility() +{ setTitlebarButtonVisibility(false); } //---------------------------------------------------------------------- -inline auto FDialog::unsetBorder() -> bool -{ return setBorder(false); } +inline void FDialog::unsetBorder() +{ setBorder(false); } //---------------------------------------------------------------------- inline void FDialog::setText (const FString& txt) diff --git a/final/dialog/ffiledialog.cpp b/final/dialog/ffiledialog.cpp index 6b6b9db9..165ca243 100644 --- a/final/dialog/ffiledialog.cpp +++ b/final/dialog/ffiledialog.cpp @@ -181,15 +181,14 @@ void FFileDialog::setFilter (const FString& filter) } //---------------------------------------------------------------------- -auto FFileDialog::setShowHiddenFiles (bool enable) -> bool +void FFileDialog::setShowHiddenFiles (bool enable) { if ( show_hidden == enable ) - return show_hidden; + return; show_hidden = enable; readDir(); filebrowser.redraw(); - return show_hidden; } //---------------------------------------------------------------------- diff --git a/final/dialog/ffiledialog.h b/final/dialog/ffiledialog.h index 5e10289d..5b9bf5c9 100644 --- a/final/dialog/ffiledialog.h +++ b/final/dialog/ffiledialog.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2014-2022 Markus Gans * +* Copyright 2014-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -115,8 +115,8 @@ class FFileDialog : public FDialog // Mutators void setPath (const FString&); void setFilter (const FString&); - auto setShowHiddenFiles (bool = true) -> bool; - auto unsetShowHiddenFiles() -> bool; + void setShowHiddenFiles (bool = true); + void unsetShowHiddenFiles(); // Event handler void onKeyPress (FKeyEvent*) override; @@ -226,8 +226,8 @@ inline auto FFileDialog::getFilter() const -> FString { return filter_pattern; } //---------------------------------------------------------------------- -inline auto FFileDialog::unsetShowHiddenFiles() -> bool -{ return setShowHiddenFiles(false); } +inline void FFileDialog::unsetShowHiddenFiles() +{ setShowHiddenFiles(false); } //---------------------------------------------------------------------- inline auto FFileDialog::getShowHiddenFiles() const noexcept -> bool diff --git a/final/dialog/fmessagebox.h b/final/dialog/fmessagebox.h index 2fa27ece..8b656951 100644 --- a/final/dialog/fmessagebox.h +++ b/final/dialog/fmessagebox.h @@ -111,8 +111,8 @@ class FMessageBox : public FDialog // Mutator void setTitlebarText (const FString&); void setHeadline (const FString&); - auto setCenterText (bool = true) -> bool; - auto unsetCenterText() -> bool; + void setCenterText (bool = true); + void unsetCenterText(); void setText (const FString&) override; // Methods @@ -197,12 +197,12 @@ inline void FMessageBox::setTitlebarText (const FString& txt) { return FDialog::setText(txt); } //---------------------------------------------------------------------- -inline auto FMessageBox::setCenterText(bool enable) -> bool -{ return (center_text = enable); } +inline void FMessageBox::setCenterText (bool enable) +{ center_text = enable; } //---------------------------------------------------------------------- -inline auto FMessageBox::unsetCenterText() -> bool -{ return setCenterText(false); } +inline void FMessageBox::unsetCenterText() +{ setCenterText(false); } //---------------------------------------------------------------------- template diff --git a/final/eventloop/backend_monitor.cpp b/final/eventloop/backend_monitor.cpp new file mode 100644 index 00000000..4dcd4b7a --- /dev/null +++ b/final/eventloop/backend_monitor.cpp @@ -0,0 +1,98 @@ +/*********************************************************************** +* backend_monitor.cpp - Monitoring general objects * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include + +#include "final/eventloop/eventloop_functions.h" +#include "final/eventloop/eventloop.h" +#include "final/eventloop/backend_monitor.h" +#include "final/util/fsystem.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class BackendMonitor +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +BackendMonitor::BackendMonitor (EventLoop* eloop) + : Monitor(eloop) +{ } + +//---------------------------------------------------------------------- +BackendMonitor::~BackendMonitor() noexcept // destructor +{ + // Close pipe file descriptors + static const auto& fsystem = FSystem::getInstance(); + (void)fsystem->close(self_pipe.getReadFd()); + (void)fsystem->close(self_pipe.getWriteFd()); +} + +// public methods of BackendMonitor +//---------------------------------------------------------------------- +void BackendMonitor::setEvent() const noexcept +{ + // The event loop is notified by write access to the pipe + uint64_t buffer{1U}; + auto successful = ::write ( self_pipe.getWriteFd() + , &buffer, sizeof(buffer) ) > 0; + + if ( ! successful ) + { + // Possible error handling + } +} + +//---------------------------------------------------------------------- +void BackendMonitor::clearEvent() const +{ + drainPipe(getFileDescriptor()); +} + +//---------------------------------------------------------------------- +void BackendMonitor::trigger (short return_events) +{ + clearEvent(); + Monitor::trigger(return_events); +} + + +// private methods of BackendMonitor +//---------------------------------------------------------------------- +void BackendMonitor::init() +{ + static const auto& fsystem = FSystem::getInstance(); + setEvents (POLLIN); + + // Set up pipe for notification + if ( fsystem->pipe(self_pipe) != 0 ) + { + throw monitor_error{"No pipe could be set up for the signal monitor."}; + } + + setFileDescriptor(self_pipe.getReadFd()); // Read end of pipe + setInitialized(); +} + +} // namespace finalcut diff --git a/final/eventloop/backend_monitor.h b/final/eventloop/backend_monitor.h new file mode 100644 index 00000000..28556990 --- /dev/null +++ b/final/eventloop/backend_monitor.h @@ -0,0 +1,114 @@ +/*********************************************************************** +* backend_monitor.h - Monitoring general objects * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +/* Inheritance diagram + * ═══════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▏ + * ▕ Monitor ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏1 1▕▔▔▔▔▔▔▔▔▔▔▏ + * ▕ BackendMonitor ▏- - - - -▕ PipeData ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▁▏ + */ + +#ifndef BACKEND_MONITOR_H +#define BACKEND_MONITOR_H + +#include "final/eventloop/monitor.h" +#include "final/eventloop/pipedata.h" +#include "final/util/fstring.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class BackendMonitor +//---------------------------------------------------------------------- + +class BackendMonitor final : public Monitor +{ + public: + explicit BackendMonitor (EventLoop*); + + // Disable default constructor + BackendMonitor() = delete; + + // Disable copy constructor + BackendMonitor(const BackendMonitor&) = delete; + + // Disable move constructor + BackendMonitor(const BackendMonitor&&) = delete; + + // Destructor + ~BackendMonitor() noexcept override; + + // Accessor + auto getClassName() const -> FString override; + + // Mutator + void setEvent() const noexcept; + + // Methods + template + void init (handler_t, T&&); + void trigger (short) override; + + private: + // Disable copy assignment operator (=) + auto operator = (const BackendMonitor&) -> BackendMonitor& = delete; + + // Disable move assignment operator (=) + auto operator = (BackendMonitor&&) noexcept -> BackendMonitor& = delete; + + // Mutator + void clearEvent() const; + + // Methods + void init(); + + // Data members + PipeData self_pipe{NO_FILE_DESCRIPTOR, NO_FILE_DESCRIPTOR}; +}; + +// BackendMonitor inline functions +//---------------------------------------------------------------------- +inline auto BackendMonitor::getClassName() const -> FString +{ return "BackendMonitor"; } + +//---------------------------------------------------------------------- +template +inline void BackendMonitor::init (handler_t hdl, T&& uc) +{ + if ( isInitialized() ) + throw monitor_error{"This instance has already been initialised."}; + + setHandler (std::move(hdl)); + setUserContext (std::forward(uc)); + init(); +} + +} // namespace finalcut + +#endif // BACKEND_MONITOR_H diff --git a/final/eventloop/eventloop-class-diagram.txt b/final/eventloop/eventloop-class-diagram.txt new file mode 100644 index 00000000..a67b6038 --- /dev/null +++ b/final/eventloop/eventloop-class-diagram.txt @@ -0,0 +1,14 @@ + + + ┌───────────┐ platform + │ EventLoop │ specific + └─────┬─────┘ + : 1 ┌───────────────┐ ┌────────────┐ + : ┌───┤ SignalMonitor │ ┌───┤ PosixTimer │◄───┐ + : * │ └───────────────┘ ▼ └────────────┘ │ + ┌────┴────┐ │ ┌─────────────────┴┐ │ ┌──────────────┐ + │ Monitor │◄───┼───┤ TimerMonitorImpl │ ├──┤ TimerMonitor │ + └─────────┘ │ └─────────────────┬┘ │ └──────────────┘ + │ ┌───────────┐ ▲ ┌─────────────┐ │ + └───┤ IoMonitor │ └───┤ KqueueTimer │◄──┘ + └───────────┘ └─────────────┘ diff --git a/final/eventloop/eventloop.cpp b/final/eventloop/eventloop.cpp new file mode 100644 index 00000000..96af9d88 --- /dev/null +++ b/final/eventloop/eventloop.cpp @@ -0,0 +1,139 @@ +/*********************************************************************** +* eventloop.cpp - Implements the event loop * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include + +#include +#include + +#include "final/eventloop/eventloop.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class EventLoop +//---------------------------------------------------------------------- + +// public methods of EventLoop +//---------------------------------------------------------------------- +auto EventLoop::run() -> int +{ + running = true; + + while ( running ) + { + if ( ! processNextEvents() ) + nonPollWaiting(); + } + + return 0; +} + + +// private methods of EventLoop +//---------------------------------------------------------------------- +inline void EventLoop::nonPollWaiting() const +{ + // Saves cpu time when polling fails + std::this_thread::sleep_for(std::chrono::milliseconds(1)); // Wait 1 ms +} + +//---------------------------------------------------------------------- +inline auto EventLoop::processNextEvents() -> bool +{ + nfds_t fd_count = 0; + monitors_changed = false; + + for (Monitor* monitor : monitors) + { + if ( monitor->isActive() ) + { + fds[fd_count] = { monitor->getFileDescriptor(), monitor->getEvents(), 0 }; + lookup_table[fd_count] = monitor; + fd_count++; + } + + if ( fd_count >= MAX_MONITORS ) + break; + } + + if ( fd_count == 0 ) + return false; + + int poll_result{}; + + while ( true ) + { + poll_result = poll(fds.data(), fd_count, WAIT_INDEFINITELY); + + if ( poll_result != -1 || errno != EINTR ) + break; + } + + if ( poll_result <= 0 ) + return false; + + // Dispatch events waiting in fds + dispatcher(poll_result, fd_count); + return true; +} + +//---------------------------------------------------------------------- +inline void EventLoop::dispatcher (int poll_result, nfds_t fd_count) +{ + // Dispatching events that are waiting in fds + nfds_t processed_fds{0}; + + for (nfds_t index{0}; index < fd_count; index++) + { + const pollfd& current_fd = fds[index]; + + if ( current_fd.revents == 0 + || ! (current_fd.revents & current_fd.events) ) + continue; + + // Call the event handler for current_fd + lookup_table[index]->trigger(current_fd.revents); + ++processed_fds; + + if ( monitors_changed || ! running + || int(processed_fds) == poll_result ) + break; + } +} + +//---------------------------------------------------------------------- +void EventLoop::addMonitor (Monitor* monitor) +{ + monitors.push_back(monitor); + monitors_changed = true; +} + +//---------------------------------------------------------------------- +void EventLoop::removeMonitor (Monitor* monitor) +{ + monitors.remove(monitor); + monitors_changed = true; +} + +} // namespace finalcut diff --git a/final/eventloop/eventloop.h b/final/eventloop/eventloop.h new file mode 100644 index 00000000..3686d05f --- /dev/null +++ b/final/eventloop/eventloop.h @@ -0,0 +1,95 @@ +/*********************************************************************** +* eventloop.h - Implements the event loop * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +/* Standalone class + * ════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ EventLoop ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▏ + */ + +#ifndef EVENTLOOP_H +#define EVENTLOOP_H + +#include +#include +#include + +#include "final/eventloop/monitor.h" +#include "final/util/fstring.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class EventLoop +//---------------------------------------------------------------------- + +class EventLoop +{ + public: + // Constructor + EventLoop() = default; + + // Accessor + auto getClassName() const -> FString; + + // Methods + auto run() -> int; + void leave(); + + private: + // Constants + static constexpr nfds_t MAX_MONITORS{50}; + static constexpr int WAIT_INDEFINITELY{-1}; + + // Methods + void nonPollWaiting() const; + auto processNextEvents() -> bool; + void dispatcher (int, nfds_t); + void addMonitor (Monitor*); + void removeMonitor (Monitor*); + + // Data members + bool running{false}; + bool monitors_changed{false}; + std::list monitors{}; + std::array fds{}; + std::array lookup_table{}; + + // Friend classes + friend class Monitor; +}; + +// EventLoop inline functions +//---------------------------------------------------------------------- +inline auto EventLoop::getClassName() const -> FString +{ return "EventLoop"; } + +//---------------------------------------------------------------------- +inline void EventLoop::leave() +{ running = false; } + +} // namespace finalcut + +#endif // EVENTLOOP_H diff --git a/final/eventloop/eventloop_functions.cpp b/final/eventloop/eventloop_functions.cpp new file mode 100644 index 00000000..a76ce909 --- /dev/null +++ b/final/eventloop/eventloop_functions.cpp @@ -0,0 +1,64 @@ +/*********************************************************************** +* eventloop_functions.cpp - Event loop helper functions * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include + +#include +#include +#include + +#include "final/eventloop/eventloop_functions.h" +#include "final/ftypes.h" + +namespace finalcut +{ + +// Event loop non-member functions +//---------------------------------------------------------------------- +void drainPipe (int fd) +{ + // Draining the pipe to reset the signaling for poll() + + uint64_t buffer{0}; + static constexpr auto buffer_size = sizeof(buffer); + std::size_t bytes_read{0}; + + // Ensure that the correct number of bytes are read from the pipe + while ( bytes_read < buffer_size ) + { + auto current_bytes_read = ::read(fd, &buffer, buffer_size - bytes_read); + + if ( current_bytes_read == -1 ) + { + int error{errno}; + std::error_code err_code{error, std::generic_category()}; + std::system_error sys_err{err_code, strerror(error)}; + throw sys_err; + } + else + { + bytes_read += static_cast(current_bytes_read); + } + } +} + +} // namespace finalcut diff --git a/final/eventloop/eventloop_functions.h b/final/eventloop/eventloop_functions.h new file mode 100644 index 00000000..fb23b8be --- /dev/null +++ b/final/eventloop/eventloop_functions.h @@ -0,0 +1,39 @@ +/*********************************************************************** +* eventloop_functions.h - Event loop helper functions * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#ifndef EVENTLOOP_FUNCTIONS_H +#define EVENTLOOP_FUNCTIONS_H + +#if !defined (USE_FINAL_H) && !defined (COMPILE_FINAL_CUT) + #error "Only can be included directly." +#endif + +namespace finalcut +{ + +// non-member function forward declarations +void drainPipe (int); + +} // namespace finalcut + +#endif // EVENTLOOP_FUNCTIONS_H + diff --git a/final/eventloop/io_monitor.cpp b/final/eventloop/io_monitor.cpp new file mode 100644 index 00000000..6045a9e2 --- /dev/null +++ b/final/eventloop/io_monitor.cpp @@ -0,0 +1,43 @@ +/*********************************************************************** +* io_monitor.cpp - I/O monitoring object * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include + +#include "final/eventloop/io_monitor.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class IoMonitor +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +IoMonitor::IoMonitor (EventLoop* eloop) + : Monitor(eloop) +{ } + +//---------------------------------------------------------------------- +IoMonitor::~IoMonitor() noexcept = default; // destructor + +} // namespace finalcut diff --git a/final/eventloop/io_monitor.h b/final/eventloop/io_monitor.h new file mode 100644 index 00000000..c16957b5 --- /dev/null +++ b/final/eventloop/io_monitor.h @@ -0,0 +1,94 @@ +/*********************************************************************** +* io_monitor.h - I/O monitoring object * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +/* Inheritance diagram + * ═══════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▏ + * ▕ Monitor ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ IoMonitor ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▏ + */ + +#ifndef IO_MONITOR_H +#define IO_MONITOR_H + +#include "final/eventloop/monitor.h" +#include "final/util/fstring.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class IoMonitor +//---------------------------------------------------------------------- + +class IoMonitor final : public Monitor +{ + public: + // Disable default constructor + IoMonitor() = delete; + + explicit IoMonitor (EventLoop*); + + // Disable copy constructor + IoMonitor(const IoMonitor&) = delete; + + // Disable move constructor + IoMonitor(const IoMonitor&&) = delete; + + // Destructor + ~IoMonitor() noexcept override; + + // Accessor + auto getClassName() const -> FString override; + + // Method + template + void init (int, short, handler_t, T&&); + auto operator = (const IoMonitor&) -> IoMonitor& = delete; + auto operator = (const IoMonitor&&) -> IoMonitor& = delete; +}; + +// IoMonitor inline functions +//---------------------------------------------------------------------- +inline auto IoMonitor::getClassName() const -> FString +{ return "IoMonitor"; } + +//---------------------------------------------------------------------- +template +inline void IoMonitor::init ( int file_descriptor, short ev + , handler_t hdl, T&& uc ) +{ + setFileDescriptor (file_descriptor); + setEvents (ev); + setHandler (std::move(hdl)); + setUserContext (std::forward(uc)); +} + +} // namespace finalcut + +#endif // IO_MONITOR_H diff --git a/final/eventloop/kqueue_timer.cpp b/final/eventloop/kqueue_timer.cpp new file mode 100644 index 00000000..2d916107 --- /dev/null +++ b/final/eventloop/kqueue_timer.cpp @@ -0,0 +1,386 @@ +/*********************************************************************** +* kqueue_timer.cpp - Time monitoring object with a kqueue timer * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#if (defined(__APPLE__) && defined(__MACH__)) || defined(__OpenBSD__) + #define USE_KQUEUE_TIMER +#endif + +#if defined(USE_KQUEUE_TIMER) || defined(UNIT_TEST) + +#include +#include + +#if defined(UNIT_TEST) + + #include + + using u_short = unsigned short; + using u_int = unsigned int; + + struct kevent + { + uintptr_t ident; // Identifier for this event + short filter; // Filter for event + u_short flags; // Action flags for kqueue + u_int fflags; // Filter flag value + int64_t data; // Filter data value + void* udata; // Opaque user data identifier + }; + + #define EV_SET(kevp, a, b, c, d, e, f) do \ + { \ + struct kevent* __kevp = (kevp); \ + (__kevp)->ident = (a); \ + (__kevp)->filter = (b); \ + (__kevp)->flags = (c); \ + (__kevp)->fflags = (d); \ + (__kevp)->data = (e); \ + (__kevp)->udata = (f); \ + } while(0) + + // Event filter + #define EVFILT_READ (-1) // File descriptor read + #define EVFILT_WRITE (-2) // File descriptor write + #define EVFILT_AIO (-3) // Attached to aio requests + #define EVFILT_VNODE (-4) // Attached to vnodes + #define EVFILT_PROC (-5) // Attached to struct process + #define EVFILT_SIGNAL (-6) // Attached to struct process + #define EVFILT_TIMER (-7) // Timers + #define EVFILT_DEVICE (-8) // Devices + #define EVFILT_EXCEPT (-9) // Exceptional conditions + + // Actions + #define EV_ADD 0x0001 // Add event to kq (implies enable) + #define EV_DELETE 0x0002 // Delete event from kq + #define EV_ENABLE 0x0004 // Enable event + #define EV_DISABLE 0x0008 // Disable event (not reported) + + // Flags + #define EV_ONESHOT 0x0010 // Only report one occurrence + #define EV_CLEAR 0x0020 // Clear event state after reporting + #define EV_RECEIPT 0x0040 // Force EV_ERROR on success, data=0 + #define EV_DISPATCH 0x0080 // Disable event after reporting + + #define EV_SYSFLAGS 0xf800 // Reserved by system + #define EV_FLAG1 0x2000 // Filter-specific flag + + // Returned values + #define EV_EOF 0x8000 // EOF detected + #define EV_ERROR 0x4000 // error, data contains errno + +#else + + #include + #include + +#endif + +#include +#include + +#include "final/eventloop/eventloop.h" +#include "final/eventloop/timer_monitor.h" +#include "final/util/fsystem.h" + +namespace finalcut +{ + +// struct forward declaration +struct TimerNode; + +// Using-declaration +using TimerNodesList = std::vector; +using KEventList = std::vector; + + +//---------------------------------------------------------------------- +#if defined(UNIT_TEST) +static auto getKqueue() -> int +{ + // Creates a new kernel event queue + static const auto& fsystem = FSystem::getInstance(); + return fsystem->kqueue(); +} +#else +static auto getKqueue() -> const int& +{ + // Creates a new kernel event queue + static const auto& fsystem = FSystem::getInstance(); + static const auto kq = fsystem->kqueue(); + return kq; +} +#endif + +//---------------------------------------------------------------------- +static auto getTimerID() -> int& +{ + // Timer id generator (sequential number) + static int timer_id = 0; + constexpr auto max = std::numeric_limits::max(); + timer_id = ( timer_id > 0 && timer_id < max ) ? timer_id + 1 : 1; + return timer_id; +} + +//---------------------------------------------------------------------- +constexpr auto durationToMilliseconds (std::chrono::nanoseconds duration) -> int +{ + return int(std::chrono::duration_cast(duration).count()); +} + +//---------------------------------------------------------------------- +static auto getTimerNodes() -> TimerNodesList& +{ + // Encapsulate global list object + static const auto& timer_nodes = std::make_unique(); + return *timer_nodes; +} + +//---------------------------------------------------------------------- +static auto getKEvents() -> KEventList& +{ + // Encapsulate global list object + static const auto& time_events = std::make_unique(); + return *time_events; +} + + +//---------------------------------------------------------------------- +// struct TimerNode +//---------------------------------------------------------------------- +struct TimerNode +{ + public: + // Constructor + TimerNode (int tid, KqueueTimer* tmon_ptr) + : timer_id{tid} + , timer_monitor{tmon_ptr} + { } + + // Constants + static constexpr int NO_TIMER_ID{-1}; + + // Data members + int timer_id{NO_TIMER_ID}; + KqueueTimer* timer_monitor{}; +}; + + +//---------------------------------------------------------------------- +// class KqueueHandler +//---------------------------------------------------------------------- + +class KqueueHandler final +{ + public: + // Constructor + KqueueHandler() = default; + + // Copy constructor - no mutex copies + KqueueHandler (const KqueueHandler&) + { } + + // Move constructor - no mutex copies + KqueueHandler (KqueueHandler&&) noexcept + { } + + // Overloaded operator + void operator () (Monitor* monitor, short revents) + { + std::lock_guard lock_guard(timer_nodes_mutex); + + // Check active events in the event list + static const auto& fsystem = FSystem::getInstance(); + struct timespec timeout{0, 0}; // Do not wait + auto& time_events = getKEvents(); + auto data = time_events.data(); + const auto size = int(time_events.size()); + const auto n = fsystem->kevent(getKqueue(), nullptr, 0, data, size, &timeout); + + if ( n <= 0 ) + return; + + for (std::size_t i{0}; i < std::size_t(n); i++) + { + if ( time_events[i].filter != EVFILT_TIMER ) + continue; + + const auto ident = int(time_events[i].ident); + auto is_timer_id = [&ident] (const auto& item) + { + return item.timer_id == ident; + }; + static auto& timer_nodes = getTimerNodes(); + const auto iter = std::find_if( timer_nodes.begin() + , timer_nodes.end() + , is_timer_id ); + + if ( iter == timer_nodes.end() ) + continue; + + auto kqueue_timer_ptr = iter->timer_monitor; + + if ( kqueue_timer_ptr->first_interval ) // First timer event + { + kqueue_timer_ptr->first_interval = false; + struct kevent ev_set{}; + const auto kq_flags = EV_ADD | EV_ENABLE; + const auto ms = kqueue_timer_ptr->timer_spec.period_ms; + + // Filling the struct events with values + EV_SET(&ev_set, uintptr_t(ident), EVFILT_TIMER, kq_flags, 0, ms, nullptr); + + // Register event with kqueue + if ( fsystem->kevent(getKqueue(), &ev_set, 1, nullptr, 0, nullptr) != 0 ) + throw monitor_error{"Cannot register event in kqueue."}; + } + + kqueue_timer_ptr->timer_handler(monitor, revents); + } + } + + private: + // Data members + mutable std::mutex timer_nodes_mutex{}; +}; + + +//---------------------------------------------------------------------- +// struct KqueueHandlerInstaller +//---------------------------------------------------------------------- + +struct KqueueHandlerInstaller final +{ + // constructor + KqueueHandlerInstaller() + { + // Creates a new kernel event queue + if ( getKqueue() != -1 ) + return; + + // Could not get kqueue + const int error = errno; + std::error_code err_code{error, std::generic_category()}; + std::system_error sys_err{err_code, strerror(error)}; + throw sys_err; + } + + // destructor + ~KqueueHandlerInstaller() + { + static const auto& fsystem = FSystem::getInstance(); + fsystem->close(getKqueue()); + } +}; + +//---------------------------------------------------------------------- +static auto startKqueueHandlerInstaller() -> KqueueHandlerInstaller* +{ + static const auto& kqueue_handler = std::make_unique(); + return kqueue_handler.get(); +} + +// static class attributes +KqueueHandlerInstaller* KqueueTimer::kqueue_handler_installer{}; + + +//---------------------------------------------------------------------- +// class KqueueTimer +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +KqueueTimer::KqueueTimer (EventLoop* eloop) + : TimerMonitorImpl(eloop) +{ + kqueue_handler_installer = startKqueueHandlerInstaller(); +} + +//---------------------------------------------------------------------- +KqueueTimer::~KqueueTimer() noexcept // destructor +{ + auto& timer_nodes{getTimerNodes()}; + auto& time_events{getKEvents()}; + auto iter{timer_nodes.begin()}; + + while ( iter != timer_nodes.end() ) + { + if ( iter->timer_id == timer_id ) + { + auto is_timer_id = [this] (const auto& timer_item) + { + return int(timer_item.ident) == timer_id; + }; + time_events.erase ( std::remove_if( time_events.begin() + , time_events.end() + , is_timer_id ) + , time_events.end() ); + timer_nodes.erase(iter); + break; + } + + ++iter; + } +} + + +// public methods of KqueueTimer +//---------------------------------------------------------------------- +void KqueueTimer::setInterval ( std::chrono::nanoseconds first, + std::chrono::nanoseconds periodic ) +{ + struct kevent ev_set{}; + static const auto& fsystem = FSystem::getInstance(); + timer_spec.first_ms = durationToMilliseconds(first); + timer_spec.period_ms = durationToMilliseconds(periodic); + const auto kq_flags = EV_ADD | EV_ENABLE | EV_ONESHOT; + const auto ms = timer_spec.first_ms; + + // Filling the struct events with values + EV_SET(&ev_set, uintptr_t(timer_id), EVFILT_TIMER, kq_flags, 0, ms, nullptr); + + // Register event with kqueue + if ( fsystem->kevent(getFileDescriptor(), &ev_set, 1, nullptr, 0, nullptr) != 0 ) + throw monitor_error{"Cannot register event in kqueue."}; +} + +//---------------------------------------------------------------------- +void KqueueTimer::trigger (short return_events) +{ + Monitor::trigger(return_events); +} + +// private methods of KqueueTimer +//---------------------------------------------------------------------- +void KqueueTimer::init() +{ + setFileDescriptor (getKqueue()); + setEvents (POLLIN); + setHandler (KqueueHandler()); + timer_id = getTimerID(); + getKEvents().emplace_back(); + getTimerNodes().emplace_back(timer_id, this); + setInitialized(); +} + +} // namespace finalcut + +#endif // defined(USE_KQUEUE_TIMER) || defined(UNIT_TEST) diff --git a/final/eventloop/monitor.cpp b/final/eventloop/monitor.cpp new file mode 100644 index 00000000..f26cdb7a --- /dev/null +++ b/final/eventloop/monitor.cpp @@ -0,0 +1,55 @@ +/*********************************************************************** +* monitor.cpp - Monitoring object base class * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include "final/eventloop/eventloop.h" +#include "final/eventloop/monitor.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class monitor_error +//---------------------------------------------------------------------- + +monitor_error::~monitor_error() = default; + + +//---------------------------------------------------------------------- +// class Monitor +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +Monitor::Monitor (EventLoop* eloop) + : eventloop{eloop} +{ + eventloop->addMonitor(this); +} + +//---------------------------------------------------------------------- +Monitor::~Monitor() // destructor +{ + if ( eventloop ) + eventloop->removeMonitor(this); +} + +} // namespace finalcut diff --git a/final/eventloop/monitor.h b/final/eventloop/monitor.h new file mode 100644 index 00000000..57b308dc --- /dev/null +++ b/final/eventloop/monitor.h @@ -0,0 +1,223 @@ +/*********************************************************************** +* monitor.h - Monitoring object base class * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +/* Base class + * ══════════ + * + * ▕▔▔▔▔▔▔▔▔▔▏ + * ▕ Monitor ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ + */ + +#ifndef MONITOR_H +#define MONITOR_H + +#include +#include +#include + +#include "final/util/fdata.h" +#include "final/util/fstring.h" + +namespace finalcut +{ + +// class forward declaration +class EventLoop; +class Monitor; + +//---------------------------------------------------------------------- +// class monitor_error +//---------------------------------------------------------------------- + +class monitor_error : public std::runtime_error +{ + public: + using std::runtime_error::runtime_error; + + // Copy constructor + monitor_error (const monitor_error&) = default; + + // Move constructor + monitor_error (monitor_error&&) noexcept = default; + + // Copy assignment operator (=) + auto operator = (const monitor_error&) -> monitor_error& = default; + + // Move assignment operator (=) + auto operator = (monitor_error&&) noexcept -> monitor_error& = default; + + // Destructor + ~monitor_error() override; +}; + +// Using-declaration +using handler_t = std::function; + + +//---------------------------------------------------------------------- +// class Monitor +//---------------------------------------------------------------------- + +class Monitor +{ + public: + // Constructor + explicit Monitor (EventLoop*); + Monitor() = delete; + + // Disable copy constructor + Monitor (const Monitor&) = delete; + + // Disable move constructor + Monitor (Monitor&&) noexcept = delete; + + // Destructor + virtual ~Monitor(); + + // Disable copy assignment operator (=) + auto operator = (const Monitor&) -> Monitor& = delete; + + // Disable move assignment operator (=) + auto operator = (Monitor&&) noexcept -> Monitor& = delete; + + // Accessors + virtual auto getClassName() const -> FString; + auto getEvents() const -> short; + auto getFileDescriptor() const -> int; + template + auto getUserContext() const -> clean_fdata_t&; + + // Inquiry + auto isActive() const -> bool; + + // Methods + virtual void resume(); + virtual void suspend(); + + protected: + // Constants + static constexpr int NO_FILE_DESCRIPTOR{-1}; + + // Mutators + void setFileDescriptor (int); + void setEvents (short); + void setHandler (handler_t&&); + template + void setUserContext (T&&); + void setInitialized(); + + // Inquiry + auto isInitialized() const -> bool; + + // Methods + virtual void trigger (short); + + private: + // Using-declaration + using FDataAccessPtr = std::shared_ptr; + + // Data member + bool active{false}; + EventLoop* eventloop{}; + int fd{NO_FILE_DESCRIPTOR}; + short events{0}; + handler_t handler{}; + FDataAccessPtr user_context{nullptr}; + bool monitor_initialized{false}; + + // Friend classes + friend class EventLoop; +}; + +// Monitor inline functions +//---------------------------------------------------------------------- +inline auto Monitor::getClassName() const -> FString +{ return "Monitor"; } + +//---------------------------------------------------------------------- +inline auto Monitor::getEvents() const -> short +{ return events; } + +//---------------------------------------------------------------------- +inline auto Monitor::getFileDescriptor() const -> int +{ return fd; } + +//---------------------------------------------------------------------- +template +auto Monitor::getUserContext() const -> clean_fdata_t& +{ + static T empty_lvalue = T{}; + return user_context + ? static_cast>&>(*user_context).get() + : empty_lvalue; +} + +//---------------------------------------------------------------------- +inline auto Monitor::isActive() const -> bool +{ return active; } + +//---------------------------------------------------------------------- +inline void Monitor::resume() +{ active = true; } + +//---------------------------------------------------------------------- +inline void Monitor::suspend() +{ active = false; } + +//---------------------------------------------------------------------- +inline void Monitor::trigger (short return_events) +{ + if ( handler ) + handler (this, return_events); +} + +//---------------------------------------------------------------------- +inline void Monitor::setFileDescriptor (int file_descriptor) +{ fd = file_descriptor; } + +//---------------------------------------------------------------------- +inline void Monitor::setEvents (short ev) +{ events = ev; } + +//---------------------------------------------------------------------- +inline void Monitor::setHandler (handler_t&& hdl) +{ handler = std::move(hdl); } + +//---------------------------------------------------------------------- +template +inline void Monitor::setUserContext (T&& uc) +{ + user_context.reset(makeFData(std::forward(uc))); +} + +//---------------------------------------------------------------------- +inline void Monitor::setInitialized() +{ monitor_initialized = true; } + +//---------------------------------------------------------------------- +inline auto Monitor::isInitialized() const -> bool +{ return monitor_initialized; } + +} // namespace finalcut + +#endif // MONITOR_H diff --git a/final/eventloop/pipedata.cpp b/final/eventloop/pipedata.cpp new file mode 100644 index 00000000..60707ca1 --- /dev/null +++ b/final/eventloop/pipedata.cpp @@ -0,0 +1,38 @@ +/*********************************************************************** +* pipedata.cpp - Provides a pipe array to hold the file descriptors * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include "final/eventloop/pipedata.h" +#include "final/util/fstring.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class PipeData +//---------------------------------------------------------------------- + +auto PipeData::getClassName() const -> FString +{ + return "PipeData"; +} + +} // namespace finalcut diff --git a/final/eventloop/pipedata.h b/final/eventloop/pipedata.h new file mode 100644 index 00000000..60785d84 --- /dev/null +++ b/final/eventloop/pipedata.h @@ -0,0 +1,106 @@ +/*********************************************************************** +* pipedata.h - Provides a pipe array to hold the file descriptors * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +/* Standalone class + * ════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▔▏ + * ▕ PipeData ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▏ + */ + +#ifndef PIPEDATA_H +#define PIPEDATA_H + +#include +#include + +namespace finalcut +{ + +// class forward declaration +class FString; + +//---------------------------------------------------------------------- +// class PipeData +//---------------------------------------------------------------------- + +class PipeData final +{ + public: + // Constructor + PipeData() = default; + + explicit PipeData (int read_fd, int write_fd) + : pipe_fd{{read_fd, write_fd}} + { } + + // Accessors + auto getClassName() const -> FString; + auto getArrayData() const -> const int*; + auto getArrayData() -> int*; + auto getReadFd() const -> int; + auto getWriteFd() const -> int; + + private: + // Enumeration + enum class Array + { + Read = 0, // Read end of pipe + Write = 1, // Write end of pipe + Size = 2 // Size of pipe array + }; + + // Using-declaration + using ArrayT = std::underlying_type_t; + + // Data member + std::array(Array::Size)> pipe_fd{}; +}; + +//---------------------------------------------------------------------- +inline auto PipeData::getArrayData() const -> const int* +{ + return pipe_fd.data(); +} + +//---------------------------------------------------------------------- +inline auto PipeData::getArrayData() -> int* +{ + return pipe_fd.data(); +} + +//---------------------------------------------------------------------- +inline auto PipeData::getReadFd() const -> int +{ + return pipe_fd[static_cast(Array::Read)]; +} + +//---------------------------------------------------------------------- +inline auto PipeData::getWriteFd() const -> int +{ + return pipe_fd[static_cast(Array::Write)]; +} + +} // namespace finalcut + +#endif // PIPEDATA_H diff --git a/final/eventloop/posix_timer.cpp b/final/eventloop/posix_timer.cpp new file mode 100644 index 00000000..fe31d742 --- /dev/null +++ b/final/eventloop/posix_timer.cpp @@ -0,0 +1,320 @@ +/*********************************************************************** +* posix_timer.cpp - Time monitoring object with a posix timer * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#if !(defined(__APPLE__) && defined(__MACH__)) && !(defined(__OpenBSD__)) + #define USE_POSIX_TIMER +#endif + +#if defined(USE_POSIX_TIMER) + +#if defined(__CYGWIN__) + #define _XOPEN_SOURCE 700 +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "final/eventloop/eventloop_functions.h" +#include "final/eventloop/eventloop.h" +#include "final/eventloop/timer_monitor.h" +#include "final/util/fsystem.h" + +// Fix warning with recursive macros 'sa_handler' and 'sa_sigaction' +#if defined(__clang__) + #pragma clang diagnostic ignored "-Wdisabled-macro-expansion" +#endif + + +namespace finalcut +{ + +// struct forward declaration +struct TimerNode; + +// Using-declaration +using TimerNodesList = std::list; + + +//---------------------------------------------------------------------- +#if __cplusplus > 1 && __cplusplus >= 201703L + constexpr auto durationToTimespec (std::chrono::nanoseconds duration) -> timespec +#else + static auto durationToTimespec (std::chrono::nanoseconds duration) -> timespec +#endif +{ + const auto seconds{std::chrono::duration_cast(duration)}; + duration -= seconds; + + return timespec{ static_cast(seconds.count()) + , static_cast(duration.count()) }; +} + +//---------------------------------------------------------------------- +static auto getTimerNodes() -> TimerNodesList& +{ + // Encapsulate global list object + static const auto& timer_nodes = std::make_unique(); + return *timer_nodes; +} + + +//---------------------------------------------------------------------- +// struct TimerNode +//---------------------------------------------------------------------- + +struct TimerNode final +{ + public: + // Constructor + TimerNode (timer_t tid, PosixTimer* tmon_ptr, int file_descriptor) + : timer_id{tid} + , timer_monitor{tmon_ptr} + , fd{file_descriptor} + { } + + // Data members + timer_t timer_id{}; + PosixTimer* timer_monitor{}; + int fd{}; +}; + + +//---------------------------------------------------------------------- +// class SigAlrmHandler +//---------------------------------------------------------------------- + +class SigAlrmHandler final +{ + public: + // Using-declaration + using HandlerReturnType = std::decay_t; + + // Overloaded operators + void operator () (int, siginfo_t* signal_info, void*) + { + const auto& timer_id = *static_cast(signal_info->si_value.sival_ptr); + std::lock_guard lock_guard(timer_nodes_mutex); + + for (const auto& timer_node : getTimerNodes()) + { + if ( timer_id != timer_node.timer_id ) + continue; + + if ( timer_node.timer_monitor->isActive() ) + { + // The event loop is notified by write access to the pipe + uint64_t buffer{1U}; + auto successful = ::write (timer_node.fd, &buffer, sizeof(buffer)) > 0; + + if ( ! successful ) + { + // Possible error handling + } + } + + break; + } + } + + operator HandlerReturnType () const noexcept + { + // Converts a member function pointer to a function pointer + return &invoke; + } + + private: + // Method + static void invoke (int, siginfo_t* signal_info, void*) + { + return SigAlrmHandler{}.operator()(0, signal_info, nullptr); + } + + // Data members + std::mutex timer_nodes_mutex{}; +}; + + +//---------------------------------------------------------------------- +// class SigAlrmHandlerInstaller +//---------------------------------------------------------------------- + +class SigAlrmHandlerInstaller final +{ + public: + SigAlrmHandlerInstaller() // constructor + { + static const auto& fsystem = FSystem::getInstance(); + struct sigaction signal_handle{}; + sigemptyset(&signal_handle.sa_mask); + signal_handle.sa_sigaction = SigAlrmHandler(); + signal_handle.sa_flags = SA_SIGINFO; + + if ( fsystem->sigaction(SIGALRM, &signal_handle, &original_signal_handle) != -1 ) + return; + + const int error = errno; + std::error_code err_code{error, std::generic_category()}; + std::system_error sys_err{err_code, strerror(error)}; + throw sys_err; + } + + ~SigAlrmHandlerInstaller() // destructor + { + static const auto& fsystem = FSystem::getInstance(); + fsystem->sigaction (SIGALRM, &original_signal_handle, nullptr); + } + + private: + // Disable copy constructor + SigAlrmHandlerInstaller (const SigAlrmHandlerInstaller&) = delete; + + // Disable move constructor + SigAlrmHandlerInstaller (SigAlrmHandlerInstaller&&) noexcept = delete; + + // Disable copy assignment operator (=) + auto operator = (const SigAlrmHandlerInstaller&) -> SigAlrmHandlerInstaller& = delete; + + // Disable move assignment operator (=) + auto operator = (SigAlrmHandlerInstaller&&) noexcept -> SigAlrmHandlerInstaller& = delete; + + // Data member + struct sigaction original_signal_handle{}; +}; + +//---------------------------------------------------------------------- +static auto startSigAlrmHandlerInstaller() -> SigAlrmHandlerInstaller* +{ + static const auto& sig_alrm_handler = std::make_unique(); + return sig_alrm_handler.get(); +} + +// static class attributes +SigAlrmHandlerInstaller* PosixTimer::sig_alrm_handler_installer{}; + + +//---------------------------------------------------------------------- +// class PosixTimer +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +PosixTimer::PosixTimer (EventLoop* eloop) + : TimerMonitorImpl(eloop) +{ + sig_alrm_handler_installer = startSigAlrmHandlerInstaller(); +} + +//---------------------------------------------------------------------- +PosixTimer::~PosixTimer() noexcept // destructor +{ + static const auto& fsystem = FSystem::getInstance(); + fsystem->close (alarm_pipe.getReadFd()); + fsystem->close (alarm_pipe.getWriteFd()); + + if ( timer_id == timer_t{} ) + return; + + static auto& timer_nodes = getTimerNodes(); + auto iter = timer_nodes.begin(); + + while ( iter != timer_nodes.end() ) + { + if ( iter->timer_id == timer_id + && fsystem->timer_delete(timer_id) == -1 ) + { + timer_nodes.erase(iter); + break; + } + + ++iter; + } +} + + +// public methods of PosixTimer +//---------------------------------------------------------------------- +void PosixTimer::setInterval ( std::chrono::nanoseconds first, + std::chrono::nanoseconds periodic ) +{ + static const auto& fsystem = FSystem::getInstance(); + struct itimerspec timer_spec { durationToTimespec(periodic) + , durationToTimespec(first) }; + + if ( fsystem->timer_settime(timer_id, 0, &timer_spec, nullptr) != -1 ) + return; + + const int error = errno; + std::error_code err_code{error, std::generic_category()}; + std::system_error sys_err{err_code, strerror(error)}; + throw sys_err; +} + +//---------------------------------------------------------------------- +void PosixTimer::trigger (short return_events) +{ + drainPipe(getFileDescriptor()); + Monitor::trigger(return_events); +} + +// private methods of PosixTimer +//---------------------------------------------------------------------- +void PosixTimer::init() +{ + static const auto& fsystem = FSystem::getInstance(); + setEvents (POLLIN); + + if ( fsystem->pipe(alarm_pipe) != 0 ) + throw monitor_error{"No pipe could be set up for the timer."}; + + setFileDescriptor(alarm_pipe.getReadFd()); // Read end of pipe + + struct sigevent sig_event{}; + sig_event.sigev_notify = SIGEV_SIGNAL; + sig_event.sigev_signo = SIGALRM; + sig_event.sigev_value.sival_ptr = &timer_id; + + if ( fsystem->timer_create(CLOCK_MONOTONIC, &sig_event, &timer_id) == 0 ) + { + getTimerNodes().emplace_back(timer_id, this, alarm_pipe.getWriteFd()); + } + else + { + fsystem->close (alarm_pipe.getReadFd()); + fsystem->close (alarm_pipe.getWriteFd()); + throw monitor_error{"No POSIX timer could be reserved."}; + } + + setInitialized(); +} + +} // namespace finalcut + +#endif // defined(USE_POSIX_TIMER) diff --git a/final/eventloop/signal_monitor.cpp b/final/eventloop/signal_monitor.cpp new file mode 100644 index 00000000..95c21e2a --- /dev/null +++ b/final/eventloop/signal_monitor.cpp @@ -0,0 +1,217 @@ +/*********************************************************************** +* signal_monitor.cpp - Signal monitoring object * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#if defined(__CYGWIN__) + #define _XOPEN_SOURCE 700 +#endif + +#include + +#include +#include +#include +#include +#include +#include + +#include "final/eventloop/eventloop_functions.h" +#include "final/eventloop/eventloop.h" +#include "final/eventloop/signal_monitor.h" +#include "final/util/fsystem.h" + +// Fix warning with recursive macros 'sa_handler' and 'sa_sigaction' +#if defined(__clang__) + #pragma clang diagnostic ignored "-Wdisabled-macro-expansion" +#endif + + +namespace finalcut +{ + +// Using-declaration +using SignalMonitorMap = std::unordered_map; + +//---------------------------------------------------------------------- +static auto getSignalMonitorMap() -> SignalMonitorMap& +{ + // Encapsulate global map object + static const auto& signal_monitors = std::make_unique(); + return *signal_monitors; +} + + +//---------------------------------------------------------------------- +// class SignalMonitor::SigactionImpl +//---------------------------------------------------------------------- + +class SignalMonitor::SigactionImpl +{ + public: + // Destructor + ~SigactionImpl() = default; + + // Accessors + auto getSigaction() const -> const struct sigaction*; + auto getSigaction() -> struct sigaction*; + + private: + // Data members + struct sigaction old_sig_action{}; +}; + +// SignalMonitor::SigactionImpl inline functions +//---------------------------------------------------------------------- +inline auto SignalMonitor::SigactionImpl::getSigaction() const -> const struct sigaction* +{ return &old_sig_action; } + +//---------------------------------------------------------------------- +inline auto SignalMonitor::SigactionImpl::getSigaction() -> struct sigaction* +{ return &old_sig_action; } + + +//---------------------------------------------------------------------- +// class SignalMonitor +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +SignalMonitor::SignalMonitor (EventLoop* eloop) + : Monitor(eloop) + , impl(std::make_unique()) +{ } + +//---------------------------------------------------------------------- +SignalMonitor::~SignalMonitor() noexcept // destructor +{ + // Restore original signal handling. + static const auto& fsystem = FSystem::getInstance(); + fsystem->sigaction (signal_number, getSigactionImpl()->getSigaction(), nullptr); + + // Close pipe file descriptors + (void)fsystem->close(signal_pipe.getReadFd()); + (void)fsystem->close(signal_pipe.getWriteFd()); + + // Remove monitor instance from the assignment table. + getSignalMonitorMap().erase(signal_number); +} + + +// public methods of SignalMonitor +//---------------------------------------------------------------------- +void SignalMonitor::trigger (short return_events) +{ + drainPipe(getFileDescriptor()); + Monitor::trigger(return_events); +} + + +// private methods of SignalMonitor +//---------------------------------------------------------------------- +void SignalMonitor::onSignal (int signal_number) +{ + // Determine the signal monitor instance + static auto& signal_monitors = getSignalMonitorMap(); + const auto iter = signal_monitors.find(signal_number); + + if ( iter == signal_monitors.end() ) + return; + + const SignalMonitor* monitor{iter->second}; + + if ( ! monitor->isActive() ) + return; + + // The event loop is notified by write access to the pipe + uint64_t buffer{1U}; + auto successful = ::write ( monitor->signal_pipe.getWriteFd() + , &buffer, sizeof(buffer) ) > 0; + + if ( ! successful ) + { + // Possible error handling + } +} + +//---------------------------------------------------------------------- +void SignalMonitor::init() +{ + static auto& signal_monitors = getSignalMonitorMap(); + static const auto& fsystem = FSystem::getInstance(); + setEvents (POLLIN); + + // SIGALRM is handled by the posix timer monitor + if ( SIGALRM == signal_number ) + throw std::invalid_argument{"signal_number must not be SIGALRM."}; + + // Each signal can only be managed by one monitor instance + if ( signal_monitors.find(signal_number) != signal_monitors.end() ) + { + throw std::invalid_argument + { + "The specified signal is already being handled by another " + "monitor instance." + }; + } + + // Set up pipe for notification + if ( fsystem->pipe(signal_pipe) != 0 ) + { + throw monitor_error{"No pipe could be set up for the signal monitor."}; + } + + setFileDescriptor(signal_pipe.getReadFd()); // Read end of pipe + + // Install signal handler + struct sigaction sig_action{}; + sig_action.sa_handler = onSignal; + sigemptyset(&sig_action.sa_mask); + sig_action.sa_flags = 0; + + if ( fsystem->sigaction( signal_number, &sig_action + , getSigactionImpl()->getSigaction() ) != 0 ) + { + int Error = errno; + (void)fsystem->close(signal_pipe.getReadFd()); + (void)fsystem->close(signal_pipe.getWriteFd()); + std::error_code err_code{Error, std::generic_category()}; + std::system_error sys_err{err_code, strerror(Error)}; + throw sys_err; + } + + // Enter the monitor instance in the assignment table + signal_monitors[signal_number] = this; + setInitialized(); +} + +//---------------------------------------------------------------------- +auto SignalMonitor::getSigactionImpl() const -> const SigactionImpl* +{ + return impl.get(); +} + +//---------------------------------------------------------------------- +auto SignalMonitor::getSigactionImpl() -> SigactionImpl* +{ + return impl.get(); +} + +} // namespace finalcut diff --git a/final/eventloop/signal_monitor.h b/final/eventloop/signal_monitor.h new file mode 100644 index 00000000..2d14dbda --- /dev/null +++ b/final/eventloop/signal_monitor.h @@ -0,0 +1,120 @@ +/*********************************************************************** +* signal_monitor.h - Signal monitoring object * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +/* Inheritance diagram + * ═══════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▏ + * ▕ Monitor ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏1 1▕▔▔▔▔▔▔▔▔▔▔▏ + * ▕ SignalMonitor ▏- - - - -▕ PipeData ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▁▏ + */ + +#ifndef SIGNAL_MONITOR_H +#define SIGNAL_MONITOR_H + +#include +#include + +#include "final/eventloop/monitor.h" +#include "final/eventloop/pipedata.h" +#include "final/util/fstring.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class SignalMonitor +//---------------------------------------------------------------------- + +class SignalMonitor final : public Monitor +{ + public: + explicit SignalMonitor(EventLoop*); + + // Disable default constructor + SignalMonitor() = delete; + + // Disable copy constructor + SignalMonitor(const SignalMonitor&) = delete; + + // Disable move constructor + SignalMonitor(const SignalMonitor&&) = delete; + + // Destructor + ~SignalMonitor() noexcept override; + + // Accessor + auto getClassName() const -> FString override; + + // Methods + template + void init (int, handler_t, T&&); + void trigger (short) override; + + private: + // class forward declaration + class SigactionImpl; + + // Disable copy assignment operator (=) + auto operator = (const SignalMonitor&) -> SignalMonitor& = delete; + + // Disable move assignment operator (=) + auto operator = (SignalMonitor&&) noexcept -> SignalMonitor& = delete; + + // Methods + static void onSignal (int); + void init(); + auto getSigactionImpl() const -> const SigactionImpl*; + auto getSigactionImpl() -> SigactionImpl*; + + // Data members + int signal_number{-1}; + PipeData signal_pipe{NO_FILE_DESCRIPTOR, NO_FILE_DESCRIPTOR}; + std::unique_ptr impl; +}; + +// SignalMonitor inline functions +//---------------------------------------------------------------------- +inline auto SignalMonitor::getClassName() const -> FString +{ return "SignalMonitor"; } + +//---------------------------------------------------------------------- +template +inline void SignalMonitor::init (int sn, handler_t hdl, T&& uc) +{ + if ( isInitialized() ) + throw monitor_error{"This instance has already been initialised."}; + + signal_number = sn; + setHandler (std::move(hdl)); + setUserContext (std::forward(uc)); + init(); +} + +} // namespace finalcut + +#endif // SIGNAL_MONITOR_H diff --git a/final/eventloop/timer_monitor.cpp b/final/eventloop/timer_monitor.cpp new file mode 100644 index 00000000..944a0924 --- /dev/null +++ b/final/eventloop/timer_monitor.cpp @@ -0,0 +1,44 @@ +/*********************************************************************** +* timer_monitor.cpp - Time monitoring object * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include "final/eventloop/timer_monitor.h" + +namespace finalcut +{ + +//---------------------------------------------------------------------- +// class TimerMonitorImpl +//---------------------------------------------------------------------- + +// destructor +TimerMonitorImpl::~TimerMonitorImpl() = default; + + +//---------------------------------------------------------------------- +// class TimerMonitor +//---------------------------------------------------------------------- + +// destructor +TimerMonitor::~TimerMonitor() = default; + +} // namespace finalcut + diff --git a/final/eventloop/timer_monitor.h b/final/eventloop/timer_monitor.h new file mode 100644 index 00000000..9394620b --- /dev/null +++ b/final/eventloop/timer_monitor.h @@ -0,0 +1,282 @@ +/*********************************************************************** +* timer_monitor.h - Time monitoring object * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Andreas Noe * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +/* Inheritance diagram + * ═══════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▏ + * ▕ Monitor ▏ + * ▕▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ TimerMonitorImpl ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + * ▲ ▲ + * │ │ + * ▕▔▔▔▔▔▔▔▔▔▔▏1 1▕▔▔▔▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ PipeData ▏- - -▕ PosixTimer ▏ ▕ KqueueTimer ▏ (platform-specific) + * ▕▁▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + * ▲ ▲ + * │ │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ TimerMonitor ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + */ + +#ifndef TIMER_MONITOR_H +#define TIMER_MONITOR_H + +#if (defined(__APPLE__) && defined(__MACH__)) || defined(__OpenBSD__) + #define USE_KQUEUE_TIMER + #include + #include + #include +#else + #define USE_POSIX_TIMER +#endif + +#include + +#include +#include + +#include "final/eventloop/monitor.h" +#include "final/eventloop/pipedata.h" +#include "final/ftypes.h" + +namespace finalcut +{ + +// class and struct forward declaration +class SigAlrmHandlerInstaller; +struct KqueueHandlerInstaller; + +//---------------------------------------------------------------------- +// class TimerMonitorImpl +//---------------------------------------------------------------------- +class TimerMonitorImpl : public Monitor +{ + public: + // Using-declaration + using Monitor::Monitor; + + // Destructor + ~TimerMonitorImpl() override; + + // Methods + virtual void setInterval ( std::chrono::nanoseconds + , std::chrono::nanoseconds ) = 0; +}; + + +//---------------------------------------------------------------------- +// class PosixTimer +//---------------------------------------------------------------------- +class PosixTimer : public TimerMonitorImpl +{ + public: + // Using-declaration + using TimerMonitorImpl::TimerMonitorImpl; + + // Constructor + explicit PosixTimer (EventLoop*); + + // Disable copy constructor + PosixTimer (const PosixTimer&) = delete; + + // Disable move constructor + PosixTimer (PosixTimer&&) noexcept = delete; + + // Destructor + ~PosixTimer() noexcept override; + + // Disable copy assignment operator (=) + auto operator = (const PosixTimer&) -> PosixTimer& = delete; + + // Disable move assignment operator (=) + auto operator = (PosixTimer&&) noexcept -> PosixTimer& = delete; + + // Methods + template + void init (handler_t, T&&); + void setInterval ( std::chrono::nanoseconds + , std::chrono::nanoseconds ) override; + void trigger(short) override; + + private: + void init(); + +#if defined(USE_POSIX_TIMER) + // Data members + timer_t timer_id{}; + PipeData alarm_pipe{NO_FILE_DESCRIPTOR, NO_FILE_DESCRIPTOR}; + static SigAlrmHandlerInstaller* sig_alrm_handler_installer; +#endif // defined(USE_POSIX_TIMER) +}; + +#if defined(USE_POSIX_TIMER) +//---------------------------------------------------------------------- +template +inline void PosixTimer::init (handler_t hdl, T&& uc) +{ + if ( isInitialized() ) + throw monitor_error{"This instance has already been initialised."}; + + setHandler (std::move(hdl)); + setUserContext (std::forward(uc)); + init(); +} +#endif // defined(USE_POSIX_TIMER) + + +//---------------------------------------------------------------------- +// class KqueueTimer +//---------------------------------------------------------------------- + +class KqueueTimer : public TimerMonitorImpl +{ + public: + // Using-declaration + using TimerMonitorImpl::TimerMonitorImpl; + + // Constructor + explicit KqueueTimer (EventLoop*); + + // Disable copy constructor + KqueueTimer (const KqueueTimer&) = delete; + + // Disable move constructor + KqueueTimer (KqueueTimer&&) noexcept = delete; + + // Destructor + ~KqueueTimer() noexcept override; + + // Disable copy assignment operator (=) + auto operator = (const KqueueTimer&) -> KqueueTimer& = delete; + + // Disable move assignment operator (=) + auto operator = (KqueueTimer&&) noexcept -> KqueueTimer& = delete; + + // Methods + template + void init (handler_t, T&&); + void setInterval ( std::chrono::nanoseconds + , std::chrono::nanoseconds ) override; + void trigger(short) override; + + private: + void init(); + +#if defined(USE_KQUEUE_TIMER) || defined(UNIT_TEST) + struct TimerSpec + { + int period_ms{}; + int first_ms{}; + }; + + // Constants + static constexpr int NO_TIMER_ID{-1}; + + // Data members + int timer_id{NO_TIMER_ID}; + bool first_interval{true}; + TimerSpec timer_spec{}; + handler_t timer_handler{}; + static KqueueHandlerInstaller* kqueue_handler_installer; + + // Friend classes + friend class KqueueHandler; +#endif // defined(USE_KQUEUE_TIMER) +}; + +#if defined(USE_KQUEUE_TIMER) || defined(UNIT_TEST) +//---------------------------------------------------------------------- +template +inline void KqueueTimer::init (handler_t hdl, T&& uc) +{ + if ( isInitialized() ) + throw monitor_error{"This instance has already been initialised."}; + + timer_handler = std::move(hdl); + setUserContext (std::forward(uc)); + init(); +} +#endif // defined(USE_KQUEUE_TIMER) + + +//---------------------------------------------------------------------- +// struct TimerClass +//---------------------------------------------------------------------- + +struct TimerClass +{ + #if defined(__APPLE__) && defined(__MACH__) + using type = KqueueTimer; + #elif defined(__OpenBSD__) + using type = KqueueTimer; + #else + using type = PosixTimer; + #endif +}; + + +//---------------------------------------------------------------------- +// class TimerMonitor +//---------------------------------------------------------------------- + +class TimerMonitor final : public TimerClass::type +{ + public: + // Using-declarations + using base_class = TimerClass::type; + using base_class::base_class; + + TimerMonitor() = delete; + + // Disable copy constructor + TimerMonitor (const TimerMonitor&) = delete; + + // Disable move constructor + TimerMonitor (TimerMonitor&&) noexcept = delete; + + // Destructor + ~TimerMonitor() override; + + // Disable copy assignment operator (=) + auto operator = (const TimerMonitor&) -> TimerMonitor& = delete; + + // Disable move assignment operator (=) + auto operator = (TimerMonitor&&) noexcept -> TimerMonitor& = delete; + + // Accessor + auto getClassName() const -> FString override; +}; + +// TimerMonitor inline functions +//---------------------------------------------------------------------- +inline auto TimerMonitor::getClassName() const -> FString +{ return "TimerMonitor"; } + +} // namespace finalcut + +#endif // TIMER_MONITOR_H diff --git a/final/fapplication.cpp b/final/fapplication.cpp index c8b2958a..97c549a0 100644 --- a/final/fapplication.cpp +++ b/final/fapplication.cpp @@ -136,17 +136,17 @@ auto FApplication::getKeyboardWidget() -> FWidget* auto FApplication::getLog() -> FLogPtr& { // Global logger object - static auto logger_ptr = new FLogPtr(); + static const auto& logger = std::make_unique(); - if ( logger_ptr && *logger_ptr == nullptr ) + if ( logger && *logger == nullptr ) { - *logger_ptr = std::make_shared(); + *logger = std::make_shared(); // Set the logger as rdbuf of clog - std::clog.rdbuf(logger_ptr->get()); + std::clog.rdbuf(logger->get()); } - return *logger_ptr; + return *logger; } //---------------------------------------------------------------------- @@ -650,10 +650,6 @@ inline void FApplication::destroyLog() // Reset the rdbuf of clog std::clog << std::flush; std::clog.rdbuf(default_clog_rdbuf); - - // Delete the logger - const FLogPtr* logger = &(getLog()); - delete logger; } //---------------------------------------------------------------------- @@ -894,11 +890,13 @@ inline void FApplication::processInput() const if ( quit_now || internal::var::exit_loop || has_terminal_resized ) return; + // Keyboard and mouse raw data processing queuingKeyboardInput(); queuingMouseInput(); do { + // Processing of captured keyboard and mouse events processKeyboardEvent(); processMouseEvent(); } @@ -1010,7 +1008,9 @@ void FApplication::determineClickedWidget (const FMouseData& md) && ! md.isRightButtonPressed() && ! md.isMiddleButtonPressed() && ! md.isWheelUp() - && ! md.isWheelDown() ) + && ! md.isWheelDown() + && ! md.isWheelLeft() + && ! md.isWheelRight() ) return; const auto& mouse_position = md.getPos(); @@ -1215,27 +1215,34 @@ void FApplication::sendWheelEvent ( const FMouseData& md , const FPoint& widgetMousePos , const FPoint& mouse_position ) const { - if ( md.isWheelUp() ) - { - FWheelEvent wheel_ev ( Event::MouseWheel - , widgetMousePos - , mouse_position - , MouseWheel::Up ); - auto scroll_over_widget = clicked_widget; - setClickedWidget(nullptr); - sendEvent(scroll_over_widget, &wheel_ev); - } + if ( ! md.isWheelUp() && ! md.isWheelDown() + && ! md.isWheelLeft() && ! md.isWheelRight() ) + return; - if ( md.isWheelDown() ) + auto mouse_wheel = [&md] () { - FWheelEvent wheel_ev ( Event::MouseWheel - , widgetMousePos - , mouse_position - , MouseWheel::Down ); - auto scroll_over_widget = clicked_widget; - setClickedWidget(nullptr); - sendEvent (scroll_over_widget, &wheel_ev); - } + if ( md.isWheelUp() ) + return MouseWheel::Up; + + if ( md.isWheelDown() ) + return MouseWheel::Down; + + if ( md.isWheelLeft() ) + return MouseWheel::Left; + + if ( md.isWheelRight() ) + return MouseWheel::Right; + + return MouseWheel::None; + }(); + + FWheelEvent wheel_ev ( Event::MouseWheel + , widgetMousePos + , mouse_position + , mouse_wheel ); + auto scroll_over_widget = clicked_widget; + setClickedWidget(nullptr); + sendEvent (scroll_over_widget, &wheel_ev); } //---------------------------------------------------------------------- @@ -1319,12 +1326,12 @@ auto FApplication::processNextEvent() -> bool time_last_event = FObjectTimer::getCurrentTime(); num_events += processTimerEvent(); processInput(); - processResizeEvent(); + processResizeEvent(); // when the terminal size has changed processCloseWidget(); sendQueuedEvents(); processDialogResizeMove(); - processTerminalUpdate(); // after terminal changes - flush(); + processTerminalUpdate(); // for changed areas on the terminal + flush(); // Flush output buffer (via an instance of FOutput) processLogger(); } else if ( isKeyPressed(next_event_wait) ) diff --git a/final/fc.h b/final/fc.h index 7a5021c3..946c3f7a 100644 --- a/final/fc.h +++ b/final/fc.h @@ -1316,9 +1316,11 @@ constexpr auto operator &= (MouseButton& b1, const MouseButton& b2) noexcept -> // Mouse wheel state values enum class MouseWheel { - None = 0x00, - Up = 0x01, - Down = 0x02 + None = 0x00, + Up = 0x01, + Down = 0x02, + Left = 0x03, + Right = 0x04, }; // Terminal type @@ -1365,7 +1367,6 @@ constexpr auto operator | (const FTermType& t1, FTermTypeT t2) noexcept -> FTerm return FTermTypeT(t1) | t2; } - // Type of focus enum class FocusTypes { diff --git a/final/fconfig.h b/final/fconfig.h index 213a8278..97f2776b 100644 --- a/final/fconfig.h +++ b/final/fconfig.h @@ -1,5 +1,5 @@ -#ifndef FINAL_FCONFIG_H -#define FINAL_FCONFIG_H 1 +#ifndef _FINAL_FCONFIG_H +#define _FINAL_FCONFIG_H 1 /* final/fconfig.h. Generated automatically at end of configure. */ /* config.h. Generated from config.h.in by configure. */ @@ -83,6 +83,11 @@ #define F_HAVE_SELECT 1 #endif +/* Define to 1 if you have the `sigaction' function. */ +#ifndef F_HAVE_SIGACTION +#define F_HAVE_SIGACTION 1 +#endif + /* Define to 1 if you have the header file. */ #ifndef F_HAVE_STDINT_H #define F_HAVE_STDINT_H 1 @@ -148,6 +153,16 @@ #define F_HAVE_TERM_H 1 #endif +/* Define to 1 if you have the `timer_create' function. */ +#ifndef F_HAVE_TIMER_CREATE +#define F_HAVE_TIMER_CREATE 1 +#endif + +/* Define to 1 if you have the `timer_settime' function. */ +#ifndef F_HAVE_TIMER_SETTIME +#define F_HAVE_TIMER_SETTIME 1 +#endif + /* Define to 1 if you have the header file. */ #ifndef F_HAVE_TTYENT_H #define F_HAVE_TTYENT_H 1 @@ -253,5 +268,5 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ -/* once: FINAL_FCONFIG_H */ +/* once: _FINAL_FCONFIG_H */ #endif diff --git a/final/final.h b/final/final.h index 1f283e5a..18c7df47 100644 --- a/final/final.h +++ b/final/final.h @@ -4,7 +4,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2014-2022 Markus Gans * +* Copyright 2014-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -39,6 +39,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include #include diff --git a/final/fobject.cpp b/final/fobject.cpp index d2ca9f33..da6de911 100644 --- a/final/fobject.cpp +++ b/final/fobject.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2015-2022 Markus Gans * +* Copyright 2015-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -134,9 +134,9 @@ void FObject::delChild (FObject* obj) & obj->parent_obj = nullptr; obj->has_parent = false; - auto end = children_list.end(); - auto last = std::remove (children_list.begin(), end, obj); - children_list.erase(last, end); + auto list_end = children_list.end(); + auto last = std::remove (children_list.begin(), list_end, obj); + children_list.erase(last, list_end); } //---------------------------------------------------------------------- diff --git a/final/fobject.h b/final/fobject.h index 9f119ed6..bc1745ae 100644 --- a/final/fobject.h +++ b/final/fobject.h @@ -23,9 +23,9 @@ /* Inheritance diagram * ═══════════════════ * - * ▕▔▔▔▔▔▔▔▔▏ - * ▕ FTimer ▏ - * ▕▁▁▁▁▁▁▁▁▏ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ FObjectTimer ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ * ▲ * │ * ▕▔▔▔▔▔▔▔▔▔▏ @@ -87,6 +87,7 @@ class FObject : public FObjectTimer using const_reverse_iterator = FObjectList::const_reverse_iterator; using reference = FObjectList::reference; using const_reference = FObjectList::const_reference; + using difference_type = FObjectList::difference_type; // Constants static constexpr auto UNLIMITED = static_cast(-1); diff --git a/final/ftimer.cpp b/final/ftimer.cpp index 5a317a9c..971ab01e 100644 --- a/final/ftimer.cpp +++ b/final/ftimer.cpp @@ -37,7 +37,7 @@ static auto getInstance() -> FTimer* return fobject_timer.get(); } -std::mutex timer_var::mutex{}; +std::shared_timed_mutex timer_var::mutex{}; } // namespace internal diff --git a/final/ftimer.h b/final/ftimer.h index aa8f3851..d2098ab0 100644 --- a/final/ftimer.h +++ b/final/ftimer.h @@ -20,12 +20,13 @@ * . * ***********************************************************************/ -/* Base class - * ══════════ +/* Standalone class Base class + * ════════════════ ══════════ + * + * ▕▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ FTimer ▏ ▕ FObjectTimer ▏ + * ▕▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ * - * ▕▔▔▔▔▔▔▔▔▏ - * ▕ FTimer ▏ - * ▕▁▁▁▁▁▁▁▁▏ */ #ifndef FTIMER_H @@ -38,7 +39,7 @@ #include #include #include -#include +#include #include #include "final/fevent.h" @@ -52,7 +53,7 @@ namespace internal struct timer_var { - static std::mutex mutex; + static std::shared_timed_mutex mutex; }; } // namespace internal @@ -95,7 +96,7 @@ class FTimer // Methods auto addTimer (ObjectT*, int) & -> int; auto delTimer (int) const & -> bool; - auto delOwnTimers(const ObjectT*) const & -> bool; + auto delOwnTimers (const ObjectT*) const & -> bool; auto delAllTimers() const & -> bool; protected: @@ -157,7 +158,7 @@ auto FTimer::addTimer (ObjectT* object, int interval) & -> int // Create a timer and returns the timer identifier number // (interval in ms) - std::lock_guard lock_guard(internal::timer_var::mutex); + std::lock_guard lock_guard(internal::timer_var::mutex); auto& timer_list = globalTimerList(); int id = getNextId(); const auto time_interval = milliseconds(interval); @@ -186,7 +187,7 @@ auto FTimer::delTimer (int id) const & -> bool if ( id <= 0 ) return false; - std::lock_guard lock_guard(internal::timer_var::mutex); + std::lock_guard lock_guard(internal::timer_var::mutex); auto& timer_list = globalTimerList(); if ( ! timer_list || timer_list->empty() ) @@ -213,7 +214,7 @@ auto FTimer::delOwnTimers(const ObjectT* object) const & -> bool { // Deletes all timers of this object - std::lock_guard lock_guard(internal::timer_var::mutex); + std::lock_guard lock_guard(internal::timer_var::mutex); auto& timer_list = globalTimerList(); if ( ! timer_list || timer_list->empty() ) @@ -225,7 +226,8 @@ auto FTimer::delOwnTimers(const ObjectT* object) const & -> bool { return timer.object == object; } - ), timer_list->end() ); + ) + , timer_list->end() ); return true; } @@ -235,7 +237,7 @@ auto FTimer::delAllTimers() const & -> bool { // Deletes all timers of all objects - std::lock_guard lock_guard(internal::timer_var::mutex); + std::lock_guard lock_guard(internal::timer_var::mutex); auto& timer_list = globalTimerList(); if ( ! timer_list || timer_list->empty() ) @@ -253,8 +255,8 @@ template auto FTimer::processTimerEvent (CallbackT callback) -> uInt { uInt activated{0}; - std::unique_lock lock ( internal::timer_var::mutex - , std::defer_lock ); + std::shared_lock lock ( internal::timer_var::mutex + , std::defer_lock ); if ( ! lock.try_lock() ) return 0; diff --git a/final/ftypes.h b/final/ftypes.h index e673d2b3..37a428c7 100644 --- a/final/ftypes.h +++ b/final/ftypes.h @@ -28,6 +28,7 @@ #endif #include +#include #include #include #include @@ -40,6 +41,16 @@ #include #include +#include "final/eventloop/pipedata.h" + +#if (defined(__APPLE__) && defined(__MACH__)) || defined(__OpenBSD__) + #define USE_KQUEUE_TIMER +#endif + +#if !(defined(__APPLE__) && defined(__MACH__)) && !(defined(__OpenBSD__)) + #define USE_POSIX_TIMER +#endif + #define null nullptr #define badAllocOutput(object_name) \ @@ -273,6 +284,36 @@ struct FCharAttribute uInt8 : 8; // padding byte }; +inline auto getFAttributeByte ( const FCharAttribute& fchar_attr + , std::size_t index ) noexcept -> uInt8 +{ + uInt8 byte{}; + std::memcpy (&byte, reinterpret_cast(&fchar_attr) + index, sizeof(uInt8)); + return byte; +} + +inline auto setFAttributeByte ( FCharAttribute& fchar_attr + , std::size_t index + , uInt8 value ) noexcept +{ + assert ( index < sizeof(FCharAttribute) ); + std::memcpy(reinterpret_cast(&fchar_attr) + index, &value, sizeof(uInt8)); +} + +inline auto getFAttributeWord (const FCharAttribute& fchar_attr) noexcept -> uInt32 +{ + uInt32 word{}; + std::memcpy(&word, &fchar_attr, sizeof(word)); + return word; +} + +inline auto WordToFAttribute (uInt32 word) noexcept -> FCharAttribute +{ + FCharAttribute fchar_attr{}; + std::memcpy(&fchar_attr, &word, sizeof(fchar_attr)); + return fchar_attr; +} + union FAttribute { uInt8 byte[4]; diff --git a/final/fwidget.cpp b/final/fwidget.cpp index e2e025b3..e25ad129 100644 --- a/final/fwidget.cpp +++ b/final/fwidget.cpp @@ -122,11 +122,12 @@ FWidget::~FWidget() // destructor FApplication::setKeyboardWidget(nullptr); // unset the local window widget focus - if ( flags.focus.focus ) + if ( flags.focus.focus && getMainWidget() != this ) { - if ( auto window = FWindow::getWindowWidget(this) ) - if ( window != this ) - window->setWindowFocusWidget(nullptr); + auto window = FWindow::getWindowWidget(this); + + if ( window && window != this ) + window->setWindowFocusWidget(nullptr); } // unset the global widget focus @@ -225,20 +226,20 @@ void FWidget::setMainWidget (FWidget* obj) } //---------------------------------------------------------------------- -auto FWidget::setVisible (bool enable) -> bool +void FWidget::setVisible (bool enable) { - return (flags.visibility.visible = enable); + flags.visibility.visible = enable; } //---------------------------------------------------------------------- -auto FWidget::setEnable (bool enable) -> bool +void FWidget::setEnable (bool enable) { if ( enable ) emitCallback("enable"); else emitCallback("disable"); - return (flags.feature.active = enable); + flags.feature.active = enable; } //---------------------------------------------------------------------- @@ -595,14 +596,15 @@ auto FWidget::setCursorPos (const FPoint& pos) -> bool if ( ! area->hasOwner() ) return false; - const auto& area_owner = area->getOwner(); - int woffsetX = getTermX() - area_owner->getTermX(); - int woffsetY = getTermY() - area_owner->getTermY(); + const auto& area_owner = area->getOwner(); + const auto& area_widget = static_cast(area_owner); + int woffsetX = getTermX() - area_widget->getTermX(); + int woffsetY = getTermY() - area_widget->getTermY(); if ( isChildPrintArea() ) { - woffsetX += (1 - area_owner->getLeftPadding()); - woffsetY += (1 - area_owner->getTopPadding()); + woffsetX += (1 - area_widget->getLeftPadding()); + woffsetY += (1 - area_widget->getTopPadding()); } bool visible = ! isCursorHideable() || flags.visibility.visible_cursor; @@ -717,11 +719,11 @@ auto FWidget::numOfFocusableChildren() & -> int int num{0}; - for (auto* child : getChildren()) + for (const auto* child : getChildren()) { if ( child->isWidget() ) { - const auto& widget = static_cast(child); + const auto& widget = static_cast(child); if ( widget->isEnabled() && widget->isShown() diff --git a/final/fwidget.h b/final/fwidget.h index 9c6d2e03..77d31ce6 100644 --- a/final/fwidget.h +++ b/final/fwidget.h @@ -207,13 +207,13 @@ class FWidget : public FVTerm static void setColorTheme(); auto setAcceleratorList() & -> FAcceleratorList&; virtual void setStatusbarMessage (const FString&); - auto setVisible (bool = true) -> bool; - auto unsetVisible() -> bool; - virtual auto setEnable (bool = true) -> bool; - virtual auto unsetEnable() -> bool; - virtual auto setDisable() -> bool; - virtual auto setVisibleCursor (bool = true) -> bool; // input cursor visibility - virtual auto unsetVisibleCursor() -> bool; // for the widget + void setVisible (bool = true); + void unsetVisible(); + virtual void setEnable (bool = true); + virtual void unsetEnable(); + virtual void setDisable(); + virtual void setVisibleCursor (bool = true); // input cursor visibility + virtual void unsetVisibleCursor(); // for the widget virtual auto setFocus ( bool = true , FocusTypes = FocusTypes::DefiniteWidget) -> bool; virtual auto unsetFocus() -> bool; @@ -756,24 +756,24 @@ inline void FWidget::setStatusbarMessage (const FString& msg) { statusbar_message = msg; } //---------------------------------------------------------------------- -inline auto FWidget::unsetVisible() -> bool -{ return setVisible(false); } +inline void FWidget::unsetVisible() +{ setVisible(false); } //---------------------------------------------------------------------- -inline auto FWidget::unsetEnable() -> bool -{ return setEnable(false); } +inline void FWidget::unsetEnable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FWidget::setDisable() -> bool -{ return setEnable(false); } +inline void FWidget::setDisable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FWidget::setVisibleCursor (bool enable) -> bool -{ return (flags.visibility.visible_cursor = enable); } +inline void FWidget::setVisibleCursor (bool enable) +{ flags.visibility.visible_cursor = enable; } //---------------------------------------------------------------------- -inline auto FWidget::unsetVisibleCursor() -> bool -{ return setVisibleCursor(false); } +inline void FWidget::unsetVisibleCursor() +{ setVisibleCursor(false); } //---------------------------------------------------------------------- inline auto FWidget::unsetFocus() -> bool diff --git a/final/fwidget_functions.cpp b/final/fwidget_functions.cpp index e6daeec6..a501eb98 100644 --- a/final/fwidget_functions.cpp +++ b/final/fwidget_functions.cpp @@ -54,13 +54,13 @@ uInt8 var::b1_print_trans_mask{}; void initByte1PrintTransMask() { // Set bits that must not be reset - FAttribute mask{}; - mask.bit.transparent = true; - mask.bit.color_overlay = true; - mask.bit.inherit_background = true; - mask.bit.no_changes = true; - mask.bit.printed = true; - internal::var::b1_print_trans_mask = mask.byte[1]; + FCharAttribute mask{}; + mask.transparent = true; + mask.color_overlay = true; + mask.inherit_background = true; + mask.no_changes = true; + mask.printed = true; + internal::var::b1_print_trans_mask = getFAttributeByte(mask, 1); } //---------------------------------------------------------------------- @@ -285,7 +285,7 @@ void setWidgetFocus (FWidget* widget) } //---------------------------------------------------------------------- -auto setWidgetShadow (FWidget* w, bool enable) -> bool +void setWidgetShadow (FWidget* w, bool enable) { if ( enable && FVTerm::getFOutput()->getEncoding() != Encoding::VT100 @@ -299,8 +299,6 @@ auto setWidgetShadow (FWidget* w, bool enable) -> bool w->setFlags().shadow.shadow = false; w->setShadowSize(FSize{0, 0}); } - - return w->getFlags().shadow.shadow; } //---------------------------------------------------------------------- @@ -401,7 +399,7 @@ void drawTransparentShadow (FWidget* w) area_pos += shadow_width; } - for (std::size_t y{1}; y <= shadow_height; y++) // Draw bottom shadow + for (std::size_t y{height}; y < height + shadow_height; y++) // Draw bottom shadow { area_changes[y].xmin = 0; area_changes[y].xmax = width + shadow_width - 1; diff --git a/final/fwidget_functions.h b/final/fwidget_functions.h index 3c3c6451..14ad4aea 100644 --- a/final/fwidget_functions.h +++ b/final/fwidget_functions.h @@ -62,7 +62,7 @@ auto getHotkey (const FString&) -> FKey; auto getHotkeyPos (const FString& src, FString& dest) -> std::size_t; void setHotkeyViaString (FWidget*, const FString&); void setWidgetFocus (FWidget*); -auto setWidgetShadow (FWidget*, bool) -> bool; +void setWidgetShadow (FWidget*, bool); void passResizeCornerEventToDialog (const FWidget*, const FMouseEvent&); void drawShadow (FWidget*); void drawTransparentShadow (FWidget*); diff --git a/final/input/fkey_hashmap.h b/final/input/fkey_hashmap.h index 1d2f7220..9d8ce6db 100644 --- a/final/input/fkey_hashmap.h +++ b/final/input/fkey_hashmap.h @@ -151,11 +151,11 @@ using HashMap = std::unordered_map template auto createKeyCapMap() -> HashMap { - auto& fkey_cap_table = FKeyMap::getKeyCapMap(); + const auto& fkey_cap_table = FKeyMap::getKeyCapMap(); HashMap fkey_cap_map; fkey_cap_map.reserve(fkey_cap_table.size()); - for (auto& item : fkey_cap_table) + for (const auto& item : fkey_cap_table) if ( item.string && item.length != 0 ) fkey_cap_map[{item.string, item.length}] = item.num; @@ -191,7 +191,7 @@ auto createKeyMap() -> HashMap for (auto& item : fkey_table) if ( item.length != 0 ) // Note: item.string is an array and always allocated - fkey_map[{item.string, item.length}] = item.num; + fkey_map[{item.string.data(), item.length}] = item.num; return fkey_map; } diff --git a/final/input/fkey_map.cpp b/final/input/fkey_map.cpp index d1943e83..d075a4e4 100644 --- a/final/input/fkey_map.cpp +++ b/final/input/fkey_map.cpp @@ -57,835 +57,835 @@ auto FKeyMap::getKeyName() -> const KeyNameType& //---------------------------------------------------------------------- FKeyMap::KeyCapMapType FKeyMap::fkey_cap_table {{ - { FKey::Backspace , nullptr, 0, "kb" }, // Backspace key - { FKey::Clear_all_tabs , nullptr, 0, "ka" }, // Clear-all-tabs key - { FKey::Clear , nullptr, 0, "kC" }, // Clear-screen or erase key - { FKey::Clear_tab , nullptr, 0, "kt" }, // Clear-tab key - { FKey::Del_char , nullptr, 0, "kD" }, // Delete-character key - { FKey::Del_line , nullptr, 0, "kL" }, // Delete-line key - { FKey::Down , nullptr, 0, "kd" }, // Down-arrow key - { FKey::Exit_insert , nullptr, 0, "kM" }, // Sent by rmir or smir in insert mode - { FKey::Clear_eol , nullptr, 0, "kE" }, // Clear-to-end-of-line key - { FKey::Clear_eos , nullptr, 0, "kS" }, // Clear-to-end-of-screen key - { FKey::F0 , nullptr, 0, "k0" }, // F0 function key - { FKey::F1 , nullptr, 0, "k1" }, // F1 function key - { FKey::F2 , nullptr, 0, "k2" }, // F2 function key - { FKey::F3 , nullptr, 0, "k3" }, // F3 function key - { FKey::F4 , nullptr, 0, "k4" }, // F4 function key - { FKey::F5 , nullptr, 0, "k5" }, // F5 function key - { FKey::F6 , nullptr, 0, "k6" }, // F6 function key - { FKey::F7 , nullptr, 0, "k7" }, // F7 function key - { FKey::F8 , nullptr, 0, "k8" }, // F8 fucntion key - { FKey::F9 , nullptr, 0, "k9" }, // F9 function key - { FKey::F10 , nullptr, 0, "k;" }, // F10 function key - { FKey::Home , nullptr, 0, "kh" }, // Home key - { FKey::Insert , nullptr, 0, "kI" }, // Insert-character key - { FKey::Insert_line , nullptr, 0, "kA" }, // Insert-line key - { FKey::Left , nullptr, 0, "kl" }, // Left-arrow key - { FKey::Home_down , nullptr, 0, "kH" }, // Last-line key - { FKey::Page_down , nullptr, 0, "kN" }, // Page-down key - { FKey::Page_up , nullptr, 0, "kP" }, // Page-up key - { FKey::Right , nullptr, 0, "kr" }, // Right-arrow key - { FKey::Scroll_forward , nullptr, 0, "kF" }, // Scroll-forward key (shift-up) - { FKey::Scroll_backward , nullptr, 0, "kR" }, // Scroll-backward key (shift-down) - { FKey::Set_tab , nullptr, 0, "kT" }, // Set-tab key - { FKey::Up , nullptr, 0, "ku" }, // Up-arrow key - { FKey::Upper_left , nullptr, 0, "K1" }, // Upper left of keypad - { FKey::Upper_right , nullptr, 0, "K3" }, // Upper right of keypad - { FKey::Center , nullptr, 0, "K2" }, // Center of keypad - { FKey::Lower_left , nullptr, 0, "K4" }, // Lower left of keypad - { FKey::Lower_right , nullptr, 0, "K5" }, // Lower right of keypad - { FKey::Back_tab , nullptr, 0, "kB" }, // Back-tab key - { FKey::Begin , nullptr, 0, "@1" }, // Begin key - { FKey::Cancel , nullptr, 0, "@2" }, // Cancel key - { FKey::Close , nullptr, 0, "@3" }, // Close key - { FKey::Command , nullptr, 0, "@4" }, // Command key - { FKey::Copy , nullptr, 0, "@5" }, // Copy key - { FKey::Create , nullptr, 0, "@6" }, // Create key - { FKey::End , nullptr, 0, "@7" }, // End key - { FKey::Enter , nullptr, 0, "@8" }, // Enter/send key - { FKey::Exit , nullptr, 0, "@9" }, // Exit key - { FKey::Find , nullptr, 0, "@0" }, // Find key - { FKey::Help , nullptr, 0, "%1" }, // Help key - { FKey::Mark , nullptr, 0, "%2" }, // Mark key - { FKey::Message , nullptr, 0, "%3" }, // Message key - { FKey::Move , nullptr, 0, "%4" }, // Move key - { FKey::Next , nullptr, 0, "%5" }, // Next key - { FKey::Open , nullptr, 0, "%6" }, // Open key - { FKey::Options , nullptr, 0, "%7" }, // Options key - { FKey::Previous , nullptr, 0, "%8" }, // Previous key - { FKey::Print , nullptr, 0, "%9" }, // Print key - { FKey::Redo , nullptr, 0, "%0" }, // Redo key - { FKey::Reference , nullptr, 0, "&1" }, // Reference key - { FKey::Refresh , nullptr, 0, "&2" }, // Refresh key - { FKey::Replace , nullptr, 0, "&3" }, // Replace key - { FKey::Restart , nullptr, 0, "&4" }, // Restart key - { FKey::Resume , nullptr, 0, "&5" }, // Resume key - { FKey::Save , nullptr, 0, "&6" }, // Save key - { FKey::Suspend , nullptr, 0, "&7" }, // Suspend key - { FKey::Undo , nullptr, 0, "&8" }, // Undo key - { FKey::Shift_begin , nullptr, 0, "&9" }, // Shifted begin key - { FKey::Shift_cancel , nullptr, 0, "&0" }, // Shifted cancel key - { FKey::Shift_command , nullptr, 0, "*1" }, // Shifted command key - { FKey::Shift_copy , nullptr, 0, "*2" }, // Shifted copy key - { FKey::Shift_create , nullptr, 0, "*3" }, // Shifted create key - { FKey::Shift_del_char , nullptr, 0, "*4" }, // Shifted delete-character key - { FKey::Shift_dl , nullptr, 0, "*5" }, // Shifted delete-line key - { FKey::Select , nullptr, 0, "*6" }, // Select key - { FKey::Shift_end , nullptr, 0, "*7" }, // Shifted End key - { FKey::Shift_clear_eol , nullptr, 0, "*8" }, // Shifted Clear-to-end-of-line key - { FKey::Shift_exit , nullptr, 0, "*9" }, // Shifted Exit key - { FKey::Shift_find , nullptr, 0, "*0" }, // Shifted Find key - { FKey::Shift_help , nullptr, 0, "#1" }, // Shifted Help key - { FKey::Shift_home , nullptr, 0, "#2" }, // Shifted Home key - { FKey::Shift_insert , nullptr, 0, "#3" }, // Shifted Insert-character key - { FKey::Shift_left , nullptr, 0, "#4" }, // Shifted Left-arrow key - { FKey::Shift_message , nullptr, 0, "%a" }, // Shifted Message key - { FKey::Shift_move , nullptr, 0, "%b" }, // Shifted Move key - { FKey::Shift_page_down , nullptr, 0, "%c" }, // Shifted Page-down key - { FKey::Shift_options , nullptr, 0, "%d" }, // Shifted Options key - { FKey::Shift_page_up , nullptr, 0, "%e" }, // Shifted Page-up key - { FKey::Shift_print , nullptr, 0, "%f" }, // Shifted Print key - { FKey::Shift_redo , nullptr, 0, "%g" }, // Shifted Redo key - { FKey::Shift_replace , nullptr, 0, "%h" }, // Shifted Replace key - { FKey::Shift_right , nullptr, 0, "%i" }, // Shifted Right-arrow key - { FKey::Shift_rsume , nullptr, 0, "%j" }, // Shifted Resume key - { FKey::Shift_save , nullptr, 0, "!1" }, // Shifted Save key - { FKey::Shift_suspend , nullptr, 0, "!2" }, // Shifted Suspend key - { FKey::Shift_undo , nullptr, 0, "!3" }, // Shifted Undo key - { FKey::F11 , nullptr, 0, "F1" }, // F11 function key - { FKey::F12 , nullptr, 0, "F2" }, // F12 function key - { FKey::F13 , nullptr, 0, "F3" }, // F13 function key - { FKey::F14 , nullptr, 0, "F4" }, // F14 function key - { FKey::F15 , nullptr, 0, "F5" }, // F15 function key - { FKey::F16 , nullptr, 0, "F6" }, // F16 function key - { FKey::F17 , nullptr, 0, "F7" }, // F17 function key - { FKey::F18 , nullptr, 0, "F8" }, // F18 function key - { FKey::F19 , nullptr, 0, "F9" }, // F19 function key - { FKey::F20 , nullptr, 0, "FA" }, // F20 function key - { FKey::F21 , nullptr, 0, "FB" }, // F21 function key - { FKey::F22 , nullptr, 0, "FC" }, // F22 function key - { FKey::F23 , nullptr, 0, "FD" }, // F23 function key - { FKey::F24 , nullptr, 0, "FE" }, // F24 function key - { FKey::F25 , nullptr, 0, "FF" }, // F25 function key - { FKey::F26 , nullptr, 0, "FG" }, // F26 function key - { FKey::F27 , nullptr, 0, "FH" }, // F27 function key - { FKey::F28 , nullptr, 0, "FI" }, // F28 function key - { FKey::F29 , nullptr, 0, "FJ" }, // F29 function key - { FKey::F30 , nullptr, 0, "FK" }, // F30 function key - { FKey::F31 , nullptr, 0, "FL" }, // F31 function key - { FKey::F32 , nullptr, 0, "FM" }, // F32 function key - { FKey::F33 , nullptr, 0, "FN" }, // F33 function key - { FKey::F34 , nullptr, 0, "FO" }, // F34 function key - { FKey::F35 , nullptr, 0, "FP" }, // F35 function key - { FKey::F36 , nullptr, 0, "FQ" }, // F36 function key - { FKey::F37 , nullptr, 0, "FR" }, // F37 function key - { FKey::F38 , nullptr, 0, "FS" }, // F38 function key - { FKey::F39 , nullptr, 0, "FT" }, // F39 function key - { FKey::F40 , nullptr, 0, "FU" }, // F40 function key - { FKey::F41 , nullptr, 0, "FV" }, // F41 function key - { FKey::F42 , nullptr, 0, "FW" }, // F42 function key - { FKey::F43 , nullptr, 0, "FX" }, // F43 function key - { FKey::F44 , nullptr, 0, "FY" }, // F44 function key - { FKey::F45 , nullptr, 0, "FZ" }, // F45 function key - { FKey::F46 , nullptr, 0, "Fa" }, // F46 function key - { FKey::F47 , nullptr, 0, "Fb" }, // F47 function key - { FKey::F48 , nullptr, 0, "Fc" }, // F48 function key - { FKey::F49 , nullptr, 0, "Fd" }, // F49 function key - { FKey::F50 , nullptr, 0, "Fe" }, // F50 function key - { FKey::F51 , nullptr, 0, "Ff" }, // F51 function key - { FKey::F52 , nullptr, 0, "Fg" }, // F52 function key - { FKey::F53 , nullptr, 0, "Fh" }, // F53 function key - { FKey::F54 , nullptr, 0, "Fi" }, // F54 function key - { FKey::F55 , nullptr, 0, "Fj" }, // F55 function key - { FKey::F56 , nullptr, 0, "Fk" }, // F56 function key - { FKey::F57 , nullptr, 0, "Fl" }, // F57 function key - { FKey::F58 , nullptr, 0, "Fm" }, // F58 function key - { FKey::F59 , nullptr, 0, "Fn" }, // F59 function key - { FKey::F60 , nullptr, 0, "Fo" }, // F60 function key - { FKey::F61 , nullptr, 0, "Fp" }, // F61 function key - { FKey::F62 , nullptr, 0, "Fq" }, // F62 function key - { FKey::F63 , nullptr, 0, "Fr" }, // F63 function key + { FKey::Backspace , nullptr, 0, {"kb"} }, // Backspace key + { FKey::Clear_all_tabs , nullptr, 0, {"ka"} }, // Clear-all-tabs key + { FKey::Clear , nullptr, 0, {"kC"} }, // Clear-screen or erase key + { FKey::Clear_tab , nullptr, 0, {"kt"} }, // Clear-tab key + { FKey::Del_char , nullptr, 0, {"kD"} }, // Delete-character key + { FKey::Del_line , nullptr, 0, {"kL"} }, // Delete-line key + { FKey::Down , nullptr, 0, {"kd"} }, // Down-arrow key + { FKey::Exit_insert , nullptr, 0, {"kM"} }, // Sent by rmir or smir in insert mode + { FKey::Clear_eol , nullptr, 0, {"kE"} }, // Clear-to-end-of-line key + { FKey::Clear_eos , nullptr, 0, {"kS"} }, // Clear-to-end-of-screen key + { FKey::F0 , nullptr, 0, {"k0"} }, // F0 function key + { FKey::F1 , nullptr, 0, {"k1"} }, // F1 function key + { FKey::F2 , nullptr, 0, {"k2"} }, // F2 function key + { FKey::F3 , nullptr, 0, {"k3"} }, // F3 function key + { FKey::F4 , nullptr, 0, {"k4"} }, // F4 function key + { FKey::F5 , nullptr, 0, {"k5"} }, // F5 function key + { FKey::F6 , nullptr, 0, {"k6"} }, // F6 function key + { FKey::F7 , nullptr, 0, {"k7"} }, // F7 function key + { FKey::F8 , nullptr, 0, {"k8"} }, // F8 fucntion key + { FKey::F9 , nullptr, 0, {"k9"} }, // F9 function key + { FKey::F10 , nullptr, 0, {"k;"} }, // F10 function key + { FKey::Home , nullptr, 0, {"kh"} }, // Home key + { FKey::Insert , nullptr, 0, {"kI"} }, // Insert-character key + { FKey::Insert_line , nullptr, 0, {"kA"} }, // Insert-line key + { FKey::Left , nullptr, 0, {"kl"} }, // Left-arrow key + { FKey::Home_down , nullptr, 0, {"kH"} }, // Last-line key + { FKey::Page_down , nullptr, 0, {"kN"} }, // Page-down key + { FKey::Page_up , nullptr, 0, {"kP"} }, // Page-up key + { FKey::Right , nullptr, 0, {"kr"} }, // Right-arrow key + { FKey::Scroll_forward , nullptr, 0, {"kF"} }, // Scroll-forward key (shift-up) + { FKey::Scroll_backward , nullptr, 0, {"kR"} }, // Scroll-backward key (shift-down) + { FKey::Set_tab , nullptr, 0, {"kT"} }, // Set-tab key + { FKey::Up , nullptr, 0, {"ku"} }, // Up-arrow key + { FKey::Upper_left , nullptr, 0, {"K1"} }, // Upper left of keypad + { FKey::Upper_right , nullptr, 0, {"K3"} }, // Upper right of keypad + { FKey::Center , nullptr, 0, {"K2"} }, // Center of keypad + { FKey::Lower_left , nullptr, 0, {"K4"} }, // Lower left of keypad + { FKey::Lower_right , nullptr, 0, {"K5"} }, // Lower right of keypad + { FKey::Back_tab , nullptr, 0, {"kB"} }, // Back-tab key + { FKey::Begin , nullptr, 0, {"@1"} }, // Begin key + { FKey::Cancel , nullptr, 0, {"@2"} }, // Cancel key + { FKey::Close , nullptr, 0, {"@3"} }, // Close key + { FKey::Command , nullptr, 0, {"@4"} }, // Command key + { FKey::Copy , nullptr, 0, {"@5"} }, // Copy key + { FKey::Create , nullptr, 0, {"@6"} }, // Create key + { FKey::End , nullptr, 0, {"@7"} }, // End key + { FKey::Enter , nullptr, 0, {"@8"} }, // Enter/send key + { FKey::Exit , nullptr, 0, {"@9"} }, // Exit key + { FKey::Find , nullptr, 0, {"@0"} }, // Find key + { FKey::Help , nullptr, 0, {"%1"} }, // Help key + { FKey::Mark , nullptr, 0, {"%2"} }, // Mark key + { FKey::Message , nullptr, 0, {"%3"} }, // Message key + { FKey::Move , nullptr, 0, {"%4"} }, // Move key + { FKey::Next , nullptr, 0, {"%5"} }, // Next key + { FKey::Open , nullptr, 0, {"%6"} }, // Open key + { FKey::Options , nullptr, 0, {"%7"} }, // Options key + { FKey::Previous , nullptr, 0, {"%8"} }, // Previous key + { FKey::Print , nullptr, 0, {"%9"} }, // Print key + { FKey::Redo , nullptr, 0, {"%0"} }, // Redo key + { FKey::Reference , nullptr, 0, {"&1"} }, // Reference key + { FKey::Refresh , nullptr, 0, {"&2"} }, // Refresh key + { FKey::Replace , nullptr, 0, {"&3"} }, // Replace key + { FKey::Restart , nullptr, 0, {"&4"} }, // Restart key + { FKey::Resume , nullptr, 0, {"&5"} }, // Resume key + { FKey::Save , nullptr, 0, {"&6"} }, // Save key + { FKey::Suspend , nullptr, 0, {"&7"} }, // Suspend key + { FKey::Undo , nullptr, 0, {"&8"} }, // Undo key + { FKey::Shift_begin , nullptr, 0, {"&9"} }, // Shifted begin key + { FKey::Shift_cancel , nullptr, 0, {"&0"} }, // Shifted cancel key + { FKey::Shift_command , nullptr, 0, {"*1"} }, // Shifted command key + { FKey::Shift_copy , nullptr, 0, {"*2"} }, // Shifted copy key + { FKey::Shift_create , nullptr, 0, {"*3"} }, // Shifted create key + { FKey::Shift_del_char , nullptr, 0, {"*4"} }, // Shifted delete-character key + { FKey::Shift_dl , nullptr, 0, {"*5"} }, // Shifted delete-line key + { FKey::Select , nullptr, 0, {"*6"} }, // Select key + { FKey::Shift_end , nullptr, 0, {"*7"} }, // Shifted End key + { FKey::Shift_clear_eol , nullptr, 0, {"*8"} }, // Shifted Clear-to-end-of-line key + { FKey::Shift_exit , nullptr, 0, {"*9"} }, // Shifted Exit key + { FKey::Shift_find , nullptr, 0, {"*0"} }, // Shifted Find key + { FKey::Shift_help , nullptr, 0, {"#1"} }, // Shifted Help key + { FKey::Shift_home , nullptr, 0, {"#2"} }, // Shifted Home key + { FKey::Shift_insert , nullptr, 0, {"#3"} }, // Shifted Insert-character key + { FKey::Shift_left , nullptr, 0, {"#4"} }, // Shifted Left-arrow key + { FKey::Shift_message , nullptr, 0, {"%a"} }, // Shifted Message key + { FKey::Shift_move , nullptr, 0, {"%b"} }, // Shifted Move key + { FKey::Shift_page_down , nullptr, 0, {"%c"} }, // Shifted Page-down key + { FKey::Shift_options , nullptr, 0, {"%d"} }, // Shifted Options key + { FKey::Shift_page_up , nullptr, 0, {"%e"} }, // Shifted Page-up key + { FKey::Shift_print , nullptr, 0, {"%f"} }, // Shifted Print key + { FKey::Shift_redo , nullptr, 0, {"%g"} }, // Shifted Redo key + { FKey::Shift_replace , nullptr, 0, {"%h"} }, // Shifted Replace key + { FKey::Shift_right , nullptr, 0, {"%i"} }, // Shifted Right-arrow key + { FKey::Shift_rsume , nullptr, 0, {"%j"} }, // Shifted Resume key + { FKey::Shift_save , nullptr, 0, {"!1"} }, // Shifted Save key + { FKey::Shift_suspend , nullptr, 0, {"!2"} }, // Shifted Suspend key + { FKey::Shift_undo , nullptr, 0, {"!3"} }, // Shifted Undo key + { FKey::F11 , nullptr, 0, {"F1"} }, // F11 function key + { FKey::F12 , nullptr, 0, {"F2"} }, // F12 function key + { FKey::F13 , nullptr, 0, {"F3"} }, // F13 function key + { FKey::F14 , nullptr, 0, {"F4"} }, // F14 function key + { FKey::F15 , nullptr, 0, {"F5"} }, // F15 function key + { FKey::F16 , nullptr, 0, {"F6"} }, // F16 function key + { FKey::F17 , nullptr, 0, {"F7"} }, // F17 function key + { FKey::F18 , nullptr, 0, {"F8"} }, // F18 function key + { FKey::F19 , nullptr, 0, {"F9"} }, // F19 function key + { FKey::F20 , nullptr, 0, {"FA"} }, // F20 function key + { FKey::F21 , nullptr, 0, {"FB"} }, // F21 function key + { FKey::F22 , nullptr, 0, {"FC"} }, // F22 function key + { FKey::F23 , nullptr, 0, {"FD"} }, // F23 function key + { FKey::F24 , nullptr, 0, {"FE"} }, // F24 function key + { FKey::F25 , nullptr, 0, {"FF"} }, // F25 function key + { FKey::F26 , nullptr, 0, {"FG"} }, // F26 function key + { FKey::F27 , nullptr, 0, {"FH"} }, // F27 function key + { FKey::F28 , nullptr, 0, {"FI"} }, // F28 function key + { FKey::F29 , nullptr, 0, {"FJ"} }, // F29 function key + { FKey::F30 , nullptr, 0, {"FK"} }, // F30 function key + { FKey::F31 , nullptr, 0, {"FL"} }, // F31 function key + { FKey::F32 , nullptr, 0, {"FM"} }, // F32 function key + { FKey::F33 , nullptr, 0, {"FN"} }, // F33 function key + { FKey::F34 , nullptr, 0, {"FO"} }, // F34 function key + { FKey::F35 , nullptr, 0, {"FP"} }, // F35 function key + { FKey::F36 , nullptr, 0, {"FQ"} }, // F36 function key + { FKey::F37 , nullptr, 0, {"FR"} }, // F37 function key + { FKey::F38 , nullptr, 0, {"FS"} }, // F38 function key + { FKey::F39 , nullptr, 0, {"FT"} }, // F39 function key + { FKey::F40 , nullptr, 0, {"FU"} }, // F40 function key + { FKey::F41 , nullptr, 0, {"FV"} }, // F41 function key + { FKey::F42 , nullptr, 0, {"FW"} }, // F42 function key + { FKey::F43 , nullptr, 0, {"FX"} }, // F43 function key + { FKey::F44 , nullptr, 0, {"FY"} }, // F44 function key + { FKey::F45 , nullptr, 0, {"FZ"} }, // F45 function key + { FKey::F46 , nullptr, 0, {"Fa"} }, // F46 function key + { FKey::F47 , nullptr, 0, {"Fb"} }, // F47 function key + { FKey::F48 , nullptr, 0, {"Fc"} }, // F48 function key + { FKey::F49 , nullptr, 0, {"Fd"} }, // F49 function key + { FKey::F50 , nullptr, 0, {"Fe"} }, // F50 function key + { FKey::F51 , nullptr, 0, {"Ff"} }, // F51 function key + { FKey::F52 , nullptr, 0, {"Fg"} }, // F52 function key + { FKey::F53 , nullptr, 0, {"Fh"} }, // F53 function key + { FKey::F54 , nullptr, 0, {"Fi"} }, // F54 function key + { FKey::F55 , nullptr, 0, {"Fj"} }, // F55 function key + { FKey::F56 , nullptr, 0, {"Fk"} }, // F56 function key + { FKey::F57 , nullptr, 0, {"Fl"} }, // F57 function key + { FKey::F58 , nullptr, 0, {"Fm"} }, // F58 function key + { FKey::F59 , nullptr, 0, {"Fn"} }, // F59 function key + { FKey::F60 , nullptr, 0, {"Fo"} }, // F60 function key + { FKey::F61 , nullptr, 0, {"Fp"} }, // F61 function key + { FKey::F62 , nullptr, 0, {"Fq"} }, // F62 function key + { FKey::F63 , nullptr, 0, {"Fr"} }, // F63 function key // Some terminals (e.g. PuTTY) send vt100 key codes // when the arrow and function keys are pressed - { FKey::F1 , ESC "OP", 3, "k1x"}, // PF1 (application mode) - { FKey::F2 , ESC "OQ", 3, "k2x"}, // PF2 (application mode) - { FKey::F3 , ESC "OR", 3, "k3x"}, // PF3 (application mode) - { FKey::F4 , ESC "OS", 3, "k4x"}, // PF4 (application mode) - { FKey::Left , CSI "D", 3, "klx"}, // Left-arrow key (standard mode) - { FKey::Left , ESC "OD", 3, "klX"}, // Left-arrow key (application mode) - { FKey::Right , CSI "C", 3, "krx"}, // Right-arrow key (standard mode) - { FKey::Right , ESC "OC", 3, "krX"}, // Right-arrow key (application mode) - { FKey::Up , CSI "A", 3, "kux"}, // Up-arrow key (standard mode) - { FKey::Up , ESC "OA", 3, "kuX"}, // Up-arrow key (application mode) - { FKey::Down , CSI "B", 3, "kdx"}, // Down-arrow key (standard mode) - { FKey::Down , ESC "OB", 3, "kdX"}, // Down-arrow key (application mode) - { FKey::Scroll_forward , CSI "a", 3, "kFx"}, // Scroll-forward key (shift-up) - { FKey::Scroll_backward , CSI "b", 3, "kRx"}, // Scroll-backward key (shift-down) + { FKey::F1 , ESC "OP", 3, {"k1x"}}, // PF1 (application mode) + { FKey::F2 , ESC "OQ", 3, {"k2x"}}, // PF2 (application mode) + { FKey::F3 , ESC "OR", 3, {"k3x"}}, // PF3 (application mode) + { FKey::F4 , ESC "OS", 3, {"k4x"}}, // PF4 (application mode) + { FKey::Left , CSI "D", 3, {"klx"}}, // Left-arrow key (standard mode) + { FKey::Left , ESC "OD", 3, {"klX"}}, // Left-arrow key (application mode) + { FKey::Right , CSI "C", 3, {"krx"}}, // Right-arrow key (standard mode) + { FKey::Right , ESC "OC", 3, {"krX"}}, // Right-arrow key (application mode) + { FKey::Up , CSI "A", 3, {"kux"}}, // Up-arrow key (standard mode) + { FKey::Up , ESC "OA", 3, {"kuX"}}, // Up-arrow key (application mode) + { FKey::Down , CSI "B", 3, {"kdx"}}, // Down-arrow key (standard mode) + { FKey::Down , ESC "OB", 3, {"kdX"}}, // Down-arrow key (application mode) + { FKey::Scroll_forward , CSI "a", 3, {"kFx"}}, // Scroll-forward key (shift-up) + { FKey::Scroll_backward , CSI "b", 3, {"kRx"}}, // Scroll-backward key (shift-down) // Fallback for rxvt with TERM=xterm - { FKey::Home , CSI "7~", 4, "khx"}, // Home key - { FKey::End , CSI "8~", 4, "@7x"}, // End key - { FKey::F1 , CSI "11~", 5, "k1X"}, // F1 function key - { FKey::F2 , CSI "12~", 5, "k2X"}, // F2 function key - { FKey::F3 , CSI "13~", 5, "k3X"}, // F3 function key - { FKey::F4 , CSI "14~", 5, "k4X"}, // F4 function key + { FKey::Home , CSI "7~", 4, {"khx"}}, // Home key + { FKey::End , CSI "8~", 4, {"@7x"}}, // End key + { FKey::F1 , CSI "11~", 5, {"k1X"}}, // F1 function key + { FKey::F2 , CSI "12~", 5, {"k2X"}}, // F2 function key + { FKey::F3 , CSI "13~", 5, {"k3X"}}, // F3 function key + { FKey::F4 , CSI "14~", 5, {"k4X"}}, // F4 function key // Fallback for TERM=ansi - { FKey::Home , CSI "H", 3, "khX"}, // Home key - { FKey::End , CSI "F", 3, "@7X"}, // End key - { FKey::End , CSI "K", 3, "@7y"}, // End key (Microsoft HyperTerminal) + { FKey::Home , CSI "H", 3, {"khX"}}, // Home key + { FKey::End , CSI "F", 3, {"@7X"}}, // End key + { FKey::End , CSI "K", 3, {"@7y"}}, // End key (Microsoft HyperTerminal) // Keypad keys - { FKey::Enter , ESC "OM", 3, "@8x"}, // Enter key - { FKey::Slash , ESC "Oo", 3, "KP1"}, // Keypad Slash - { FKey::Asterisk , ESC "Oj", 3, "KP2"}, // Keypad Asterisk - { FKey::Minus_sign , ESC "Om", 3, "KP3"}, // Keypad Minus sign - { FKey::Plus_sign , ESC "Ok", 3, "KP4"}, // Keypad Plus sign - { FKey::Insert , ESC "Op", 3, "kIx"}, // Keypad Insert - { FKey::Del_char , ESC "On", 3, "kDx"}, // Keypad Delete - { FKey::Left , ESC "Ot", 3, "kly"}, // Keypad Left-arrow - { FKey::Right , ESC "Ov", 3, "kry"}, // Keypad Right-arrow - { FKey::Up , ESC "Ox", 3, "kuy"}, // Keypad Up-arrow - { FKey::Down , ESC "Or", 3, "kdy"}, // Keypad Down-arrow - { FKey::Upper_left , ESC "Ow", 3, "K1x"}, // Keypad Upper left - { FKey::Upper_right , ESC "Oy", 3, "K3x"}, // Keypad Upper right - { FKey::Center , ESC "Ou", 3, "K2x"}, // Keypad Center - { FKey::Center , ESC "OE", 3, "K2X"}, // Keypad Center - { FKey::Center , ESC "OG", 3, "K2y"}, // Keypad Center - { FKey::Lower_left , ESC "Oq", 3, "K4x"}, // Keypad Lower left - { FKey::Lower_right , ESC "Os", 3, "K5x"} // Keypad Lower right + { FKey::Enter , ESC "OM", 3, {"@8x"}}, // Enter key + { FKey::Slash , ESC "Oo", 3, {"KP1"}}, // Keypad Slash + { FKey::Asterisk , ESC "Oj", 3, {"KP2"}}, // Keypad Asterisk + { FKey::Minus_sign , ESC "Om", 3, {"KP3"}}, // Keypad Minus sign + { FKey::Plus_sign , ESC "Ok", 3, {"KP4"}}, // Keypad Plus sign + { FKey::Insert , ESC "Op", 3, {"kIx"}}, // Keypad Insert + { FKey::Del_char , ESC "On", 3, {"kDx"}}, // Keypad Delete + { FKey::Left , ESC "Ot", 3, {"kly"}}, // Keypad Left-arrow + { FKey::Right , ESC "Ov", 3, {"kry"}}, // Keypad Right-arrow + { FKey::Up , ESC "Ox", 3, {"kuy"}}, // Keypad Up-arrow + { FKey::Down , ESC "Or", 3, {"kdy"}}, // Keypad Down-arrow + { FKey::Upper_left , ESC "Ow", 3, {"K1x"}}, // Keypad Upper left + { FKey::Upper_right , ESC "Oy", 3, {"K3x"}}, // Keypad Upper right + { FKey::Center , ESC "Ou", 3, {"K2x"}}, // Keypad Center + { FKey::Center , ESC "OE", 3, {"K2X"}}, // Keypad Center + { FKey::Center , ESC "OG", 3, {"K2y"}}, // Keypad Center + { FKey::Lower_left , ESC "Oq", 3, {"K4x"}}, // Keypad Lower left + { FKey::Lower_right , ESC "Os", 3, {"K5x"}} // Keypad Lower right }}; //---------------------------------------------------------------------- FKeyMap::KeyMapType FKeyMap::fkey_table = {{ - { FKey::Meta_insert , "\033[2;3~" , 6}, // M-Insert - { FKey::Meta_insert , "\033\033[2~" , 5}, // M-Insert - { FKey::Meta_del_char , "\033[3;3~" , 6}, // M-Delete - { FKey::Meta_del_char , "\033\033[3~" , 5}, // M-Delete - { FKey::Meta_home , "\033[1;3H" , 6}, // M-Home - { FKey::Meta_home , "\033\033[1~" , 5}, // M-Home - { FKey::Meta_end , "\033[1;3F" , 6}, // M-End - { FKey::Meta_end , "\033\033[4~" , 5}, // M-End - { FKey::Meta_page_up , "\033[5;3~" , 6}, // M-Page-up - { FKey::Meta_page_up , "\033\033[5~" , 5}, // M-Page-up - { FKey::Meta_page_down , "\033[6;3~" , 6}, // M-Page-down - { FKey::Meta_page_down , "\033\033[6~" , 5}, // M-Page-down - { FKey::Meta_f1 , "\033[1;3P" , 6}, // M-F1 - { FKey::Meta_f1 , "\033\033[11~", 6}, // M-F1 - { FKey::Meta_f2 , "\033[1;3Q" , 6}, // M-F2 - { FKey::Meta_f2 , "\033\033[12~", 6}, // M-F2 - { FKey::Meta_f3 , "\033[1;3R" , 6}, // M-F3 - { FKey::Meta_f3 , "\033\033[13~", 6}, // M-F3 - { FKey::Meta_f4 , "\033[1;3S" , 6}, // M-F4 - { FKey::Meta_f4 , "\033\033[14~", 6}, // M-F4 - { FKey::Meta_f5 , "\033[15;3~" , 7}, // M-F5 - { FKey::Meta_f5 , "\033\033[15~", 6}, // M-F5 - { FKey::Meta_f6 , "\033[17;3~" , 7}, // M-F6 - { FKey::Meta_f6 , "\033\033[17~", 6}, // M-F6 - { FKey::Meta_f7 , "\033[18;3~" , 7}, // M-F7 - { FKey::Meta_f7 , "\033\033[18~", 6}, // M-F7 - { FKey::Meta_f8 , "\033[19;3~" , 7}, // M-F8 - { FKey::Meta_f8 , "\033\033[19~", 6}, // M-F8 - { FKey::Meta_f9 , "\033[20;3~" , 7}, // M-F9 - { FKey::Meta_f9 , "\033\033[20~", 6}, // M-F9 - { FKey::Meta_f10 , "\033[21;3~" , 7}, // M-F10 - { FKey::Meta_f10 , "\033\033[21~", 6}, // M-F10 - { FKey::Meta_f11 , "\033[23;3~" , 7}, // M-F11 - { FKey::Meta_f11 , "\033\033[23~", 6}, // M-F11 - { FKey::Meta_f12 , "\033[24;3~" , 7}, // M-F12 - { FKey::Meta_f12 , "\033\033[24~", 6}, // M-F12 - { FKey::Meta_up , "\033[1;3A" , 6}, // M-Up - { FKey::Meta_up , "\033\033[A" , 4}, // M-Up - { FKey::Meta_down , "\033[1;3B" , 6}, // M-Down - { FKey::Meta_down , "\033\033[B" , 4}, // M-Down - { FKey::Meta_right , "\033[1;3C" , 6}, // M-Right - { FKey::Meta_right , "\033\033[C" , 4}, // M-Right - { FKey::Meta_left , "\033[1;3D" , 6}, // M-Left - { FKey::Meta_left , "\033\033[D" , 4}, // M-Left - { FKey::Shift_Meta_insert , "\033[2;4~" , 6}, // Shift-M-Insert - { FKey::Shift_Meta_del_char , "\033[3;4~" , 6}, // Shift-M-Delete - { FKey::Shift_Meta_home , "\033[1;4H" , 6}, // Shift-M-Home - { FKey::Shift_Meta_end , "\033[1;4F" , 6}, // Shift-M-End - { FKey::Shift_Meta_page_up , "\033[5;4~" , 6}, // Shift-M-Page-up - { FKey::Shift_Meta_page_down , "\033[6;4~" , 6}, // Shift-M-Page-down - { FKey::Shift_Meta_f1 , "\033[1;4P" , 6}, // Shift-M-F1 - { FKey::Shift_Meta_f2 , "\033[1;4Q" , 6}, // Shift-M-F2 - { FKey::Shift_Meta_f3 , "\033[1;4R" , 6}, // Shift-M-F3 - { FKey::Shift_Meta_f4 , "\033[1;4S" , 6}, // Shift-M-F4 - { FKey::Shift_Meta_f5 , "\033[15;4~" , 7}, // Shift-M-F5 - { FKey::Shift_Meta_f6 , "\033[17;4~" , 7}, // Shift-M-F6 - { FKey::Shift_Meta_f7 , "\033[18;4~" , 7}, // Shift-M-F7 - { FKey::Shift_Meta_f8 , "\033[19;4~" , 7}, // Shift-M-F8 - { FKey::Shift_Meta_f9 , "\033[20;4~" , 7}, // Shift-M-F9 - { FKey::Shift_Meta_f10 , "\033[21;4~" , 7}, // Shift-M-F10 - { FKey::Shift_Meta_f11 , "\033[23;4~" , 7}, // Shift-M-F11 - { FKey::Shift_Meta_f12 , "\033[24;4~" , 7}, // Shift-M-F12 - { FKey::Shift_Meta_up , "\033[1;4A" , 6}, // Shift-M-Up - { FKey::Shift_Meta_down , "\033[1;4B" , 6}, // Shift-M-Down - { FKey::Shift_Meta_right , "\033[1;4C" , 6}, // Shift-M-Right - { FKey::Shift_Meta_left , "\033[1;4D" , 6}, // Shift-M-Left - { FKey::Ctrl_insert , "\033[2;5~" , 6}, // Ctrl-Insert - { FKey::Ctrl_del_char , "\033[3;5~" , 6}, // Ctrl-Delete - { FKey::Ctrl_home , "\033[1;5H" , 6}, // Ctrl-Home - { FKey::Ctrl_end , "\033[1;5F" , 6}, // Ctrl-End - { FKey::Ctrl_page_up , "\033[5;5~" , 6}, // Ctrl-Page-up - { FKey::Ctrl_page_down , "\033[6;5~" , 6}, // Ctrl-Page-down - { FKey::Ctrl_up , "\033[1;5A" , 6}, // Ctrl-Up - { FKey::Ctrl_up , "\033Oa" , 3}, // Ctrl-Up - { FKey::Ctrl_down , "\033[1;5B" , 6}, // Ctrl-Down - { FKey::Ctrl_down , "\033Ob" , 3}, // Ctrl-Down - { FKey::Ctrl_right , "\033[1;5C" , 6}, // Ctrl-Right - { FKey::Ctrl_right , "\033Oc" , 3}, // Ctrl-Right - { FKey::Ctrl_left , "\033[1;5D" , 6}, // Ctrl-Left - { FKey::Ctrl_left , "\033Od" , 3}, // Ctrl-Left - { FKey::Shift_Ctrl_insert , "\033[2;6~" , 6}, // Shift-Ctrl-Insert - { FKey::Shift_Ctrl_del_char , "\033[3;6~" , 6}, // Shift-Ctrl-Delete - { FKey::Shift_Ctrl_home , "\033[1;6H" , 6}, // Shift-Ctrl-Home - { FKey::Shift_Ctrl_end , "\033[1;6F" , 6}, // Shift-Ctrl-End - { FKey::Shift_Ctrl_page_up , "\033[5;6~" , 6}, // Shift-Ctrl-Page-up - { FKey::Shift_Ctrl_page_down , "\033[6;6~" , 6}, // Shift-Ctrl-Page-down - { FKey::Shift_Ctrl_up , "\033[1;6A" , 6}, // Shift-Ctrl-Up - { FKey::Shift_Ctrl_down , "\033[1;6B" , 6}, // Shift-Ctrl-Down - { FKey::Shift_Ctrl_right , "\033[1;6C" , 6}, // Shift-Ctrl-Right - { FKey::Shift_Ctrl_left , "\033[1;6D" , 6}, // Shift-Ctrl-Left - { FKey::Ctrl_Meta_insert , "\033[2;7~" , 6}, // Ctrl-M-Insert - { FKey::Ctrl_Meta_del_char , "\033[3;7~" , 6}, // Ctrl-M-Delete - { FKey::Ctrl_Meta_home , "\033[1;7H" , 6}, // Ctrl-M-Home - { FKey::Ctrl_Meta_end , "\033[1;7F" , 6}, // Ctrl-M-End - { FKey::Ctrl_Meta_page_up , "\033[5;7~" , 6}, // Ctrl-M-Page-up - { FKey::Ctrl_Meta_page_down , "\033[6;7~" , 6}, // Ctrl-M-Page-down - { FKey::Ctrl_Meta_up , "\033[1;7A" , 6}, // Ctrl-M-Up - { FKey::Ctrl_Meta_down , "\033[1;7B" , 6}, // Ctrl-M-Down - { FKey::Ctrl_Meta_right , "\033[1;7C" , 6}, // Ctrl-M-Right - { FKey::Ctrl_Meta_left , "\033[1;7D" , 6}, // Ctrl-M-Left - { FKey::Shift_Ctrl_Meta_insert , "\033[2;8~" , 6}, // Shift-Ctrl-M-Insert - { FKey::Shift_Ctrl_Meta_del_char , "\033[3;8~" , 6}, // Shift-Ctrl-M-Delete - { FKey::Shift_Ctrl_Meta_home , "\033[1;8H" , 6}, // Shift-Ctrl-M-Home - { FKey::Shift_Ctrl_Meta_end , "\033[1;8F" , 6}, // Shift-Ctrl-M-End - { FKey::Shift_Ctrl_Meta_page_up , "\033[5;8~" , 6}, // Shift-Ctrl-M-Page-up - { FKey::Shift_Ctrl_Meta_page_down , "\033[6;8~" , 6}, // Shift-Ctrl-M-Page-down - { FKey::Shift_Ctrl_Meta_f1 , "\033[1;8P" , 6}, // Shift-Ctrl-M-F1 - { FKey::Shift_Ctrl_Meta_f2 , "\033[1;8Q" , 6}, // Shift-Ctrl-M-F2 - { FKey::Shift_Ctrl_Meta_f3 , "\033[1;8R" , 6}, // Shift-Ctrl-M-F3 - { FKey::Shift_Ctrl_Meta_f4 , "\033[1;8S" , 6}, // Shift-Ctrl-M-F4 - { FKey::Shift_Ctrl_Meta_f5 , "\033[15;8~" , 7}, // Shift-Ctrl-M-F5 - { FKey::Shift_Ctrl_Meta_f6 , "\033[17;8~" , 7}, // Shift-Ctrl-M-F6 - { FKey::Shift_Ctrl_Meta_f7 , "\033[18;8~" , 7}, // Shift-Ctrl-M-F7 - { FKey::Shift_Ctrl_Meta_f8 , "\033[19;8~" , 7}, // Shift-Ctrl-M-F8 - { FKey::Shift_Ctrl_Meta_f9 , "\033[20;8~" , 7}, // Shift-Ctrl-M-F9 - { FKey::Shift_Ctrl_Meta_f10 , "\033[21;8~" , 7}, // Shift-Ctrl-M-F10 - { FKey::Shift_Ctrl_Meta_f11 , "\033[23;8~" , 7}, // Shift-Ctrl-M-F11 - { FKey::Shift_Ctrl_Meta_f12 , "\033[24;8~" , 7}, // Shift-Ctrl-M-F12 - { FKey::Shift_Ctrl_Meta_up , "\033[1;8A" , 6}, // Shift-Ctrl-M-Up - { FKey::Shift_Ctrl_Meta_down , "\033[1;8B" , 6}, // Shift-Ctrl-M-Down - { FKey::Shift_Ctrl_Meta_right , "\033[1;8C" , 6}, // Shift-Ctrl-M-Right - { FKey::Shift_Ctrl_Meta_left , "\033[1;8D" , 6}, // Shift-Ctrl-M-Left - { FKey::Menu , "\033[29~" , 5}, // Menu - { FKey::Shift_menu , "\033[29$" , 5}, // Shift-Menu - { FKey::Shift_menu , "\033[29;2~" , 7}, // Shift-Menu - { FKey::Ctrl_menu , "\033[29^" , 5}, // Ctrl-Menu - { FKey::Ctrl_menu , "\033[29;5~" , 7}, // Ctrl-Menu - { FKey::Shift_Ctrl_menu , "\033[29@" , 5}, // Shift-Ctrl-Menu - { FKey::Shift_Ctrl_menu , "\033[29;6~" , 7}, // Shift-Ctrl-Menu - { FKey::Meta_menu , "\033[29;3~" , 7}, // M-Menu - { FKey::Shift_Meta_menu , "\033[29;4~" , 7}, // Shift-M-Menu - { FKey::Ctrl_Meta_menu , "\033[29;7~" , 7}, // Ctrl-M-Menu - { FKey::Shift_Ctrl_Meta_menu , "\033[29;8~" , 7}, // Shift-Ctrl-M-Menu - { FKey::Term_Focus_In , "\033[I" , 3}, // Terminal focus-in event - { FKey::Term_Focus_Out , "\033[O" , 3}, // Terminal focus-out event - { FKey::Escape_mintty , "\033O[", 3}, // Mintty Esc - { FKey::Meta_tab , "\033\t", 2}, // M-Tab - { FKey::Meta_enter , "\033\n", 2}, // M-Enter - { FKey::Meta_enter , "\033\r", 2}, // M-Enter - { FKey::Meta_space , "\033 " , 2}, // M-' ' - { FKey::Meta_bang , "\033!" , 2}, // M-! - { FKey::Meta_quotes , "\033\"", 2}, // M-" - { FKey::Meta_hash , "\033#" , 2}, // M-# - { FKey::Meta_dollar , "\033$" , 2}, // M-$ - { FKey::Meta_percent , "\033%" , 2}, // M-% - { FKey::Meta_ampersand , "\033&" , 2}, // M-& - { FKey::Meta_apostrophe , "\033'" , 2}, // M-' - { FKey::Meta_left_parenthesis , "\033(" , 2}, // M-( - { FKey::Meta_right_parenthesis , "\033)" , 2}, // M-) - { FKey::Meta_asterisk , "\033*" , 2}, // M-* - { FKey::Meta_plus , "\033+" , 2}, // M-+ - { FKey::Meta_comma , "\033," , 2}, // M-, - { FKey::Meta_minus , "\033-" , 2}, // M-'-' - { FKey::Meta_full_stop , "\033." , 2}, // M-. - { FKey::Meta_slash , "\033/" , 2}, // M-/ - { FKey::Meta_0 , "\0330" , 2}, // M-0 - { FKey::Meta_1 , "\0331" , 2}, // M-1 - { FKey::Meta_2 , "\0332" , 2}, // M-2 - { FKey::Meta_3 , "\0333" , 2}, // M-3 - { FKey::Meta_4 , "\0334" , 2}, // M-4 - { FKey::Meta_5 , "\0335" , 2}, // M-5 - { FKey::Meta_6 , "\0336" , 2}, // M-6 - { FKey::Meta_7 , "\0337" , 2}, // M-7 - { FKey::Meta_8 , "\0338" , 2}, // M-8 - { FKey::Meta_9 , "\0339" , 2}, // M-9 - { FKey::Meta_colon , "\033:" , 2}, // M-: - { FKey::Meta_semicolon , "\033;" , 2}, // M-; - { FKey::Meta_less_than , "\033<" , 2}, // M-< - { FKey::Meta_equals , "\033=" , 2}, // M-= - { FKey::Meta_greater_than , "\033>" , 2}, // M-> - { FKey::Meta_question_mark , "\033?" , 2}, // M-? - { FKey::Meta_at , "\033@" , 2}, // M-@ - { FKey::Meta_A , "\033A" , 2}, // Shift-M-A - { FKey::Meta_B , "\033B" , 2}, // Shift-M-B - { FKey::Meta_C , "\033C" , 2}, // Shift-M-C - { FKey::Meta_D , "\033D" , 2}, // Shift-M-D - { FKey::Meta_E , "\033E" , 2}, // Shift-M-E - { FKey::Meta_F , "\033F" , 2}, // Shift-M-F - { FKey::Meta_G , "\033G" , 2}, // Shift-M-G - { FKey::Meta_H , "\033H" , 2}, // Shift-M-H - { FKey::Meta_I , "\033I" , 2}, // Shift-M-I - { FKey::Meta_J , "\033J" , 2}, // Shift-M-J - { FKey::Meta_K , "\033K" , 2}, // Shift-M-K - { FKey::Meta_L , "\033L" , 2}, // Shift-M-L - { FKey::Meta_M , "\033M" , 2}, // Shift-M-M - { FKey::Meta_N , "\033N" , 2}, // Shift-M-N - { FKey::Meta_O , "\033O" , 2}, // Shift-M-O - { FKey::Meta_P , "\033P" , 2}, // Shift-M-P - { FKey::Meta_Q , "\033Q" , 2}, // Shift-M-Q - { FKey::Meta_R , "\033R" , 2}, // Shift-M-R - { FKey::Meta_S , "\033S" , 2}, // Shift-M-S - { FKey::Meta_T , "\033T" , 2}, // Shift-M-T - { FKey::Meta_U , "\033U" , 2}, // Shift-M-U - { FKey::Meta_V , "\033V" , 2}, // Shift-M-V - { FKey::Meta_W , "\033W" , 2}, // Shift-M-W - { FKey::Meta_X , "\033X" , 2}, // Shift-M-X - { FKey::Meta_Y , "\033Y" , 2}, // Shift-M-Y - { FKey::Meta_Z , "\033Z" , 2}, // Shift-M-Z - { FKey::Meta_left_square_bracket , "\033[" , 2}, // M-[ - { FKey::Meta_backslash , "\033\\", 2}, // M-'\' - { FKey::Meta_right_square_bracket , "\033]" , 2}, // M-] - { FKey::Meta_caret , "\033^" , 2}, // M-^ - { FKey::Meta_underscore , "\033_" , 2}, // M-_ - { FKey::Meta_grave_accent , "\033`" , 2}, // M-` - { FKey::Meta_a , "\033a" , 2}, // M-a - { FKey::Meta_b , "\033b" , 2}, // M-b - { FKey::Meta_c , "\033c" , 2}, // M-c - { FKey::Meta_d , "\033d" , 2}, // M-d - { FKey::Meta_e , "\033e" , 2}, // M-e - { FKey::Meta_f , "\033f" , 2}, // M-f - { FKey::Meta_g , "\033g" , 2}, // M-g - { FKey::Meta_h , "\033h" , 2}, // M-h - { FKey::Meta_i , "\033i" , 2}, // M-i - { FKey::Meta_j , "\033j" , 2}, // M-j - { FKey::Meta_k , "\033k" , 2}, // M-k - { FKey::Meta_l , "\033l" , 2}, // M-l - { FKey::Meta_m , "\033m" , 2}, // M-m - { FKey::Meta_n , "\033n" , 2}, // M-n - { FKey::Meta_o , "\033o" , 2}, // M-o - { FKey::Meta_p , "\033p" , 2}, // M-p - { FKey::Meta_q , "\033q" , 2}, // M-q - { FKey::Meta_r , "\033r" , 2}, // M-r - { FKey::Meta_s , "\033s" , 2}, // M-s - { FKey::Meta_t , "\033t" , 2}, // M-t - { FKey::Meta_u , "\033u" , 2}, // M-u - { FKey::Meta_v , "\033v" , 2}, // M-v - { FKey::Meta_w , "\033w" , 2}, // M-w - { FKey::Meta_x , "\033x" , 2}, // M-x - { FKey::Meta_y , "\033y" , 2}, // M-y - { FKey::Meta_z , "\033z" , 2}, // M-z - { FKey::Meta_left_curly_bracket , "\033{" , 2}, // M-{ - { FKey::Meta_vertical_bar , "\033|" , 2}, // M-| - { FKey::Meta_right_curly_bracket , "\033}" , 2}, // M-} - { FKey::Meta_tilde , "\033~" , 2} // M-~ + { FKey::Meta_insert , {"\033[2;3~"} , 6}, // M-Insert + { FKey::Meta_insert , {"\033\033[2~"} , 5}, // M-Insert + { FKey::Meta_del_char , {"\033[3;3~"} , 6}, // M-Delete + { FKey::Meta_del_char , {"\033\033[3~"} , 5}, // M-Delete + { FKey::Meta_home , {"\033[1;3H"} , 6}, // M-Home + { FKey::Meta_home , {"\033\033[1~"} , 5}, // M-Home + { FKey::Meta_end , {"\033[1;3F"} , 6}, // M-End + { FKey::Meta_end , {"\033\033[4~"} , 5}, // M-End + { FKey::Meta_page_up , {"\033[5;3~"} , 6}, // M-Page-up + { FKey::Meta_page_up , {"\033\033[5~"} , 5}, // M-Page-up + { FKey::Meta_page_down , {"\033[6;3~"} , 6}, // M-Page-down + { FKey::Meta_page_down , {"\033\033[6~"} , 5}, // M-Page-down + { FKey::Meta_f1 , {"\033[1;3P"} , 6}, // M-F1 + { FKey::Meta_f1 , {"\033\033[11~"}, 6}, // M-F1 + { FKey::Meta_f2 , {"\033[1;3Q"} , 6}, // M-F2 + { FKey::Meta_f2 , {"\033\033[12~"}, 6}, // M-F2 + { FKey::Meta_f3 , {"\033[1;3R"} , 6}, // M-F3 + { FKey::Meta_f3 , {"\033\033[13~"}, 6}, // M-F3 + { FKey::Meta_f4 , {"\033[1;3S"} , 6}, // M-F4 + { FKey::Meta_f4 , {"\033\033[14~"}, 6}, // M-F4 + { FKey::Meta_f5 , {"\033[15;3~"} , 7}, // M-F5 + { FKey::Meta_f5 , {"\033\033[15~"}, 6}, // M-F5 + { FKey::Meta_f6 , {"\033[17;3~"} , 7}, // M-F6 + { FKey::Meta_f6 , {"\033\033[17~"}, 6}, // M-F6 + { FKey::Meta_f7 , {"\033[18;3~"} , 7}, // M-F7 + { FKey::Meta_f7 , {"\033\033[18~"}, 6}, // M-F7 + { FKey::Meta_f8 , {"\033[19;3~"} , 7}, // M-F8 + { FKey::Meta_f8 , {"\033\033[19~"}, 6}, // M-F8 + { FKey::Meta_f9 , {"\033[20;3~"} , 7}, // M-F9 + { FKey::Meta_f9 , {"\033\033[20~"}, 6}, // M-F9 + { FKey::Meta_f10 , {"\033[21;3~"} , 7}, // M-F10 + { FKey::Meta_f10 , {"\033\033[21~"}, 6}, // M-F10 + { FKey::Meta_f11 , {"\033[23;3~"} , 7}, // M-F11 + { FKey::Meta_f11 , {"\033\033[23~"}, 6}, // M-F11 + { FKey::Meta_f12 , {"\033[24;3~"} , 7}, // M-F12 + { FKey::Meta_f12 , {"\033\033[24~"}, 6}, // M-F12 + { FKey::Meta_up , {"\033[1;3A"} , 6}, // M-Up + { FKey::Meta_up , {"\033\033[A"} , 4}, // M-Up + { FKey::Meta_down , {"\033[1;3B"} , 6}, // M-Down + { FKey::Meta_down , {"\033\033[B"} , 4}, // M-Down + { FKey::Meta_right , {"\033[1;3C"} , 6}, // M-Right + { FKey::Meta_right , {"\033\033[C"} , 4}, // M-Right + { FKey::Meta_left , {"\033[1;3D"} , 6}, // M-Left + { FKey::Meta_left , {"\033\033[D"} , 4}, // M-Left + { FKey::Shift_Meta_insert , {"\033[2;4~"} , 6}, // Shift-M-Insert + { FKey::Shift_Meta_del_char , {"\033[3;4~"} , 6}, // Shift-M-Delete + { FKey::Shift_Meta_home , {"\033[1;4H"} , 6}, // Shift-M-Home + { FKey::Shift_Meta_end , {"\033[1;4F"} , 6}, // Shift-M-End + { FKey::Shift_Meta_page_up , {"\033[5;4~"} , 6}, // Shift-M-Page-up + { FKey::Shift_Meta_page_down , {"\033[6;4~"} , 6}, // Shift-M-Page-down + { FKey::Shift_Meta_f1 , {"\033[1;4P"} , 6}, // Shift-M-F1 + { FKey::Shift_Meta_f2 , {"\033[1;4Q"} , 6}, // Shift-M-F2 + { FKey::Shift_Meta_f3 , {"\033[1;4R"} , 6}, // Shift-M-F3 + { FKey::Shift_Meta_f4 , {"\033[1;4S"} , 6}, // Shift-M-F4 + { FKey::Shift_Meta_f5 , {"\033[15;4~"} , 7}, // Shift-M-F5 + { FKey::Shift_Meta_f6 , {"\033[17;4~"} , 7}, // Shift-M-F6 + { FKey::Shift_Meta_f7 , {"\033[18;4~"} , 7}, // Shift-M-F7 + { FKey::Shift_Meta_f8 , {"\033[19;4~"} , 7}, // Shift-M-F8 + { FKey::Shift_Meta_f9 , {"\033[20;4~"} , 7}, // Shift-M-F9 + { FKey::Shift_Meta_f10 , {"\033[21;4~"} , 7}, // Shift-M-F10 + { FKey::Shift_Meta_f11 , {"\033[23;4~"} , 7}, // Shift-M-F11 + { FKey::Shift_Meta_f12 , {"\033[24;4~"} , 7}, // Shift-M-F12 + { FKey::Shift_Meta_up , {"\033[1;4A"} , 6}, // Shift-M-Up + { FKey::Shift_Meta_down , {"\033[1;4B"} , 6}, // Shift-M-Down + { FKey::Shift_Meta_right , {"\033[1;4C"} , 6}, // Shift-M-Right + { FKey::Shift_Meta_left , {"\033[1;4D"} , 6}, // Shift-M-Left + { FKey::Ctrl_insert , {"\033[2;5~"} , 6}, // Ctrl-Insert + { FKey::Ctrl_del_char , {"\033[3;5~"} , 6}, // Ctrl-Delete + { FKey::Ctrl_home , {"\033[1;5H"} , 6}, // Ctrl-Home + { FKey::Ctrl_end , {"\033[1;5F"} , 6}, // Ctrl-End + { FKey::Ctrl_page_up , {"\033[5;5~"} , 6}, // Ctrl-Page-up + { FKey::Ctrl_page_down , {"\033[6;5~"} , 6}, // Ctrl-Page-down + { FKey::Ctrl_up , {"\033[1;5A"} , 6}, // Ctrl-Up + { FKey::Ctrl_up , {"\033Oa"} , 3}, // Ctrl-Up + { FKey::Ctrl_down , {"\033[1;5B"} , 6}, // Ctrl-Down + { FKey::Ctrl_down , {"\033Ob"} , 3}, // Ctrl-Down + { FKey::Ctrl_right , {"\033[1;5C"} , 6}, // Ctrl-Right + { FKey::Ctrl_right , {"\033Oc"} , 3}, // Ctrl-Right + { FKey::Ctrl_left , {"\033[1;5D"} , 6}, // Ctrl-Left + { FKey::Ctrl_left , {"\033Od"} , 3}, // Ctrl-Left + { FKey::Shift_Ctrl_insert , {"\033[2;6~"} , 6}, // Shift-Ctrl-Insert + { FKey::Shift_Ctrl_del_char , {"\033[3;6~"} , 6}, // Shift-Ctrl-Delete + { FKey::Shift_Ctrl_home , {"\033[1;6H"} , 6}, // Shift-Ctrl-Home + { FKey::Shift_Ctrl_end , {"\033[1;6F"} , 6}, // Shift-Ctrl-End + { FKey::Shift_Ctrl_page_up , {"\033[5;6~"} , 6}, // Shift-Ctrl-Page-up + { FKey::Shift_Ctrl_page_down , {"\033[6;6~"} , 6}, // Shift-Ctrl-Page-down + { FKey::Shift_Ctrl_up , {"\033[1;6A"} , 6}, // Shift-Ctrl-Up + { FKey::Shift_Ctrl_down , {"\033[1;6B"} , 6}, // Shift-Ctrl-Down + { FKey::Shift_Ctrl_right , {"\033[1;6C"} , 6}, // Shift-Ctrl-Right + { FKey::Shift_Ctrl_left , {"\033[1;6D"} , 6}, // Shift-Ctrl-Left + { FKey::Ctrl_Meta_insert , {"\033[2;7~"} , 6}, // Ctrl-M-Insert + { FKey::Ctrl_Meta_del_char , {"\033[3;7~"} , 6}, // Ctrl-M-Delete + { FKey::Ctrl_Meta_home , {"\033[1;7H"} , 6}, // Ctrl-M-Home + { FKey::Ctrl_Meta_end , {"\033[1;7F"} , 6}, // Ctrl-M-End + { FKey::Ctrl_Meta_page_up , {"\033[5;7~"} , 6}, // Ctrl-M-Page-up + { FKey::Ctrl_Meta_page_down , {"\033[6;7~"} , 6}, // Ctrl-M-Page-down + { FKey::Ctrl_Meta_up , {"\033[1;7A"} , 6}, // Ctrl-M-Up + { FKey::Ctrl_Meta_down , {"\033[1;7B"} , 6}, // Ctrl-M-Down + { FKey::Ctrl_Meta_right , {"\033[1;7C"} , 6}, // Ctrl-M-Right + { FKey::Ctrl_Meta_left , {"\033[1;7D"} , 6}, // Ctrl-M-Left + { FKey::Shift_Ctrl_Meta_insert , {"\033[2;8~"} , 6}, // Shift-Ctrl-M-Insert + { FKey::Shift_Ctrl_Meta_del_char , {"\033[3;8~"} , 6}, // Shift-Ctrl-M-Delete + { FKey::Shift_Ctrl_Meta_home , {"\033[1;8H"} , 6}, // Shift-Ctrl-M-Home + { FKey::Shift_Ctrl_Meta_end , {"\033[1;8F"} , 6}, // Shift-Ctrl-M-End + { FKey::Shift_Ctrl_Meta_page_up , {"\033[5;8~"} , 6}, // Shift-Ctrl-M-Page-up + { FKey::Shift_Ctrl_Meta_page_down , {"\033[6;8~"} , 6}, // Shift-Ctrl-M-Page-down + { FKey::Shift_Ctrl_Meta_f1 , {"\033[1;8P"} , 6}, // Shift-Ctrl-M-F1 + { FKey::Shift_Ctrl_Meta_f2 , {"\033[1;8Q"} , 6}, // Shift-Ctrl-M-F2 + { FKey::Shift_Ctrl_Meta_f3 , {"\033[1;8R"} , 6}, // Shift-Ctrl-M-F3 + { FKey::Shift_Ctrl_Meta_f4 , {"\033[1;8S"} , 6}, // Shift-Ctrl-M-F4 + { FKey::Shift_Ctrl_Meta_f5 , {"\033[15;8~"} , 7}, // Shift-Ctrl-M-F5 + { FKey::Shift_Ctrl_Meta_f6 , {"\033[17;8~"} , 7}, // Shift-Ctrl-M-F6 + { FKey::Shift_Ctrl_Meta_f7 , {"\033[18;8~"} , 7}, // Shift-Ctrl-M-F7 + { FKey::Shift_Ctrl_Meta_f8 , {"\033[19;8~"} , 7}, // Shift-Ctrl-M-F8 + { FKey::Shift_Ctrl_Meta_f9 , {"\033[20;8~"} , 7}, // Shift-Ctrl-M-F9 + { FKey::Shift_Ctrl_Meta_f10 , {"\033[21;8~"} , 7}, // Shift-Ctrl-M-F10 + { FKey::Shift_Ctrl_Meta_f11 , {"\033[23;8~"} , 7}, // Shift-Ctrl-M-F11 + { FKey::Shift_Ctrl_Meta_f12 , {"\033[24;8~"} , 7}, // Shift-Ctrl-M-F12 + { FKey::Shift_Ctrl_Meta_up , {"\033[1;8A"} , 6}, // Shift-Ctrl-M-Up + { FKey::Shift_Ctrl_Meta_down , {"\033[1;8B"} , 6}, // Shift-Ctrl-M-Down + { FKey::Shift_Ctrl_Meta_right , {"\033[1;8C"} , 6}, // Shift-Ctrl-M-Right + { FKey::Shift_Ctrl_Meta_left , {"\033[1;8D"} , 6}, // Shift-Ctrl-M-Left + { FKey::Menu , {"\033[29~"} , 5}, // Menu + { FKey::Shift_menu , {"\033[29$"} , 5}, // Shift-Menu + { FKey::Shift_menu , {"\033[29;2~"} , 7}, // Shift-Menu + { FKey::Ctrl_menu , {"\033[29^"} , 5}, // Ctrl-Menu + { FKey::Ctrl_menu , {"\033[29;5~"} , 7}, // Ctrl-Menu + { FKey::Shift_Ctrl_menu , {"\033[29@"} , 5}, // Shift-Ctrl-Menu + { FKey::Shift_Ctrl_menu , {"\033[29;6~"} , 7}, // Shift-Ctrl-Menu + { FKey::Meta_menu , {"\033[29;3~"} , 7}, // M-Menu + { FKey::Shift_Meta_menu , {"\033[29;4~"} , 7}, // Shift-M-Menu + { FKey::Ctrl_Meta_menu , {"\033[29;7~"} , 7}, // Ctrl-M-Menu + { FKey::Shift_Ctrl_Meta_menu , {"\033[29;8~"} , 7}, // Shift-Ctrl-M-Menu + { FKey::Term_Focus_In , {"\033[I"} , 3}, // Terminal focus-in event + { FKey::Term_Focus_Out , {"\033[O"} , 3}, // Terminal focus-out event + { FKey::Escape_mintty , {"\033O["}, 3}, // Mintty Esc + { FKey::Meta_tab , {"\033\t"}, 2}, // M-Tab + { FKey::Meta_enter , {"\033\n"}, 2}, // M-Enter + { FKey::Meta_enter , {"\033\r"}, 2}, // M-Enter + { FKey::Meta_space , {"\033 "} , 2}, // M-' ' + { FKey::Meta_bang , {"\033!"} , 2}, // M-! + { FKey::Meta_quotes , {"\033\""}, 2}, // M-" + { FKey::Meta_hash , {"\033#"} , 2}, // M-# + { FKey::Meta_dollar , {"\033$"} , 2}, // M-$ + { FKey::Meta_percent , {"\033%"} , 2}, // M-% + { FKey::Meta_ampersand , {"\033&"} , 2}, // M-& + { FKey::Meta_apostrophe , {"\033'"} , 2}, // M-' + { FKey::Meta_left_parenthesis , {"\033("} , 2}, // M-( + { FKey::Meta_right_parenthesis , {"\033)"} , 2}, // M-) + { FKey::Meta_asterisk , {"\033*"} , 2}, // M-* + { FKey::Meta_plus , {"\033+"} , 2}, // M-+ + { FKey::Meta_comma , {"\033,"} , 2}, // M-, + { FKey::Meta_minus , {"\033-"} , 2}, // M-'-' + { FKey::Meta_full_stop , {"\033."} , 2}, // M-. + { FKey::Meta_slash , {"\033/"} , 2}, // M-/ + { FKey::Meta_0 , {"\0330"} , 2}, // M-0 + { FKey::Meta_1 , {"\0331"} , 2}, // M-1 + { FKey::Meta_2 , {"\0332"} , 2}, // M-2 + { FKey::Meta_3 , {"\0333"} , 2}, // M-3 + { FKey::Meta_4 , {"\0334"} , 2}, // M-4 + { FKey::Meta_5 , {"\0335"} , 2}, // M-5 + { FKey::Meta_6 , {"\0336"} , 2}, // M-6 + { FKey::Meta_7 , {"\0337"} , 2}, // M-7 + { FKey::Meta_8 , {"\0338"} , 2}, // M-8 + { FKey::Meta_9 , {"\0339"} , 2}, // M-9 + { FKey::Meta_colon , {"\033:"} , 2}, // M-: + { FKey::Meta_semicolon , {"\033;"} , 2}, // M-; + { FKey::Meta_less_than , {"\033<"} , 2}, // M-< + { FKey::Meta_equals , {"\033="} , 2}, // M-= + { FKey::Meta_greater_than , {"\033>"} , 2}, // M-> + { FKey::Meta_question_mark , {"\033?"} , 2}, // M-? + { FKey::Meta_at , {"\033@"} , 2}, // M-@ + { FKey::Meta_A , {"\033A"} , 2}, // Shift-M-A + { FKey::Meta_B , {"\033B"} , 2}, // Shift-M-B + { FKey::Meta_C , {"\033C"} , 2}, // Shift-M-C + { FKey::Meta_D , {"\033D"} , 2}, // Shift-M-D + { FKey::Meta_E , {"\033E"} , 2}, // Shift-M-E + { FKey::Meta_F , {"\033F"} , 2}, // Shift-M-F + { FKey::Meta_G , {"\033G"} , 2}, // Shift-M-G + { FKey::Meta_H , {"\033H"} , 2}, // Shift-M-H + { FKey::Meta_I , {"\033I"} , 2}, // Shift-M-I + { FKey::Meta_J , {"\033J"} , 2}, // Shift-M-J + { FKey::Meta_K , {"\033K"} , 2}, // Shift-M-K + { FKey::Meta_L , {"\033L"} , 2}, // Shift-M-L + { FKey::Meta_M , {"\033M"} , 2}, // Shift-M-M + { FKey::Meta_N , {"\033N"} , 2}, // Shift-M-N + { FKey::Meta_O , {"\033O"} , 2}, // Shift-M-O + { FKey::Meta_P , {"\033P"} , 2}, // Shift-M-P + { FKey::Meta_Q , {"\033Q"} , 2}, // Shift-M-Q + { FKey::Meta_R , {"\033R"} , 2}, // Shift-M-R + { FKey::Meta_S , {"\033S"} , 2}, // Shift-M-S + { FKey::Meta_T , {"\033T"} , 2}, // Shift-M-T + { FKey::Meta_U , {"\033U"} , 2}, // Shift-M-U + { FKey::Meta_V , {"\033V"} , 2}, // Shift-M-V + { FKey::Meta_W , {"\033W"} , 2}, // Shift-M-W + { FKey::Meta_X , {"\033X"} , 2}, // Shift-M-X + { FKey::Meta_Y , {"\033Y"} , 2}, // Shift-M-Y + { FKey::Meta_Z , {"\033Z"} , 2}, // Shift-M-Z + { FKey::Meta_left_square_bracket , {"\033["} , 2}, // M-[ + { FKey::Meta_backslash , {"\033\\"}, 2}, // M-'\' + { FKey::Meta_right_square_bracket , {"\033]"} , 2}, // M-] + { FKey::Meta_caret , {"\033^"} , 2}, // M-^ + { FKey::Meta_underscore , {"\033_"} , 2}, // M-_ + { FKey::Meta_grave_accent , {"\033`"} , 2}, // M-` + { FKey::Meta_a , {"\033a"} , 2}, // M-a + { FKey::Meta_b , {"\033b"} , 2}, // M-b + { FKey::Meta_c , {"\033c"} , 2}, // M-c + { FKey::Meta_d , {"\033d"} , 2}, // M-d + { FKey::Meta_e , {"\033e"} , 2}, // M-e + { FKey::Meta_f , {"\033f"} , 2}, // M-f + { FKey::Meta_g , {"\033g"} , 2}, // M-g + { FKey::Meta_h , {"\033h"} , 2}, // M-h + { FKey::Meta_i , {"\033i"} , 2}, // M-i + { FKey::Meta_j , {"\033j"} , 2}, // M-j + { FKey::Meta_k , {"\033k"} , 2}, // M-k + { FKey::Meta_l , {"\033l"} , 2}, // M-l + { FKey::Meta_m , {"\033m"} , 2}, // M-m + { FKey::Meta_n , {"\033n"} , 2}, // M-n + { FKey::Meta_o , {"\033o"} , 2}, // M-o + { FKey::Meta_p , {"\033p"} , 2}, // M-p + { FKey::Meta_q , {"\033q"} , 2}, // M-q + { FKey::Meta_r , {"\033r"} , 2}, // M-r + { FKey::Meta_s , {"\033s"} , 2}, // M-s + { FKey::Meta_t , {"\033t"} , 2}, // M-t + { FKey::Meta_u , {"\033u"} , 2}, // M-u + { FKey::Meta_v , {"\033v"} , 2}, // M-v + { FKey::Meta_w , {"\033w"} , 2}, // M-w + { FKey::Meta_x , {"\033x"} , 2}, // M-x + { FKey::Meta_y , {"\033y"} , 2}, // M-y + { FKey::Meta_z , {"\033z"} , 2}, // M-z + { FKey::Meta_left_curly_bracket , {"\033{"} , 2}, // M-{ + { FKey::Meta_vertical_bar , {"\033|"} , 2}, // M-| + { FKey::Meta_right_curly_bracket , {"\033}"} , 2}, // M-} + { FKey::Meta_tilde , {"\033~"} , 2} // M-~ }}; //---------------------------------------------------------------------- constexpr FKeyMap::KeyNameType FKeyMap::fkeyname = {{ - { FKey::Ctrl_a , "Ctrl+A" }, - { FKey::Ctrl_b , "Ctrl+B" }, - { FKey::Ctrl_c , "Ctrl+C" }, - { FKey::Ctrl_d , "Ctrl+D" }, - { FKey::Ctrl_e , "Ctrl+E" }, - { FKey::Ctrl_f , "Ctrl+F" }, - { FKey::Ctrl_g , "Ctrl+G" }, - { FKey::Erase , "Backspace" }, // Ctrl+H - { FKey::Tab , "Tab" }, // Ctrl+I - { FKey::Ctrl_j , "Ctrl+J" }, - { FKey::Ctrl_h , "Ctrl+K" }, - { FKey::Ctrl_l , "Ctrl+L" }, - { FKey::Return , "Return" }, // Ctrl+M - { FKey::Ctrl_n , "Ctrl+N" }, - { FKey::Ctrl_o , "Ctrl+O" }, - { FKey::Ctrl_p , "Ctrl+P" }, - { FKey::Ctrl_q , "Ctrl+Q" }, - { FKey::Ctrl_r , "Ctrl+R" }, - { FKey::Ctrl_s , "Ctrl+S" }, - { FKey::Ctrl_t , "Ctrl+T" }, - { FKey::Ctrl_u , "Ctrl+U" }, - { FKey::Ctrl_v , "Ctrl+V" }, - { FKey::Ctrl_w , "Ctrl+W" }, - { FKey::Ctrl_x , "Ctrl+X" }, - { FKey::Ctrl_y , "Ctrl+Y" }, - { FKey::Ctrl_z , "Ctrl+Z" }, - { FKey::Escape , "Esc" }, // Ctrl+[ - { FKey::Escape_mintty , "Esc" }, - { FKey::Ctrl_backslash , "Ctrl+\\" }, - { FKey::Ctrl_right_square_bracket , "Ctrl+]" }, - { FKey::Ctrl_caret , "Ctrl+^" }, - { FKey::Ctrl_underscore , "Ctrl+_" }, - { FKey::Space , "Space" }, - { FKey::Ctrl_space , "Ctrl+Space" }, // Ctrl+(Space or @) - { FKey::Backspace , "Backspace" }, - { FKey::Clear_all_tabs , "Clear-All-Tabs" }, - { FKey::Clear , "Clear-Screen" }, - { FKey::Clear_tab , "Clear-Tab" }, - { FKey::Del_char , "Del" }, - { FKey::Del_line , "Del-line" }, - { FKey::Down , "Down" }, - { FKey::Exit_insert , "Exit-Ins" }, - { FKey::Clear_eol , "Clear-End-of-Line" }, - { FKey::Clear_eos , "Clear-End-of-Screen" }, - { FKey::F0 , "F0" }, - { FKey::F1 , "F1" }, - { FKey::F2 , "F2" }, - { FKey::F3 , "F3" }, - { FKey::F4 , "F4" }, - { FKey::F5 , "F5" }, - { FKey::F6 , "F6" }, - { FKey::F7 , "F7" }, - { FKey::F8 , "F8" }, - { FKey::F9 , "F9" }, - { FKey::F10 , "F10" }, - { FKey::Home , "Home" }, - { FKey::Insert , "Ins" }, - { FKey::Insert_line , "Ins-Line" }, - { FKey::Left , "Left" }, - { FKey::Home_down , "Home-Down" }, - { FKey::Page_down , "Page-Down" }, - { FKey::Page_up , "Page-Up" }, - { FKey::Right , "Right" }, - { FKey::Scroll_forward , "Scroll-Forward" }, - { FKey::Scroll_backward , "Scroll-Backward" }, - { FKey::Set_tab , "Set-Tab" }, - { FKey::Up , "Up" }, - { FKey::Upper_left , "Upper-Left" }, - { FKey::Upper_right , "Upper-Right" }, - { FKey::Center , "Center" }, - { FKey::Lower_left , "Lower-Left" }, - { FKey::Lower_right , "Lower-Right" }, - { FKey::Back_tab , "Shift+Tab" }, - { FKey::Begin , "Begin" }, - { FKey::Cancel , "Cancel" }, - { FKey::Close , "Close" }, - { FKey::Command , "Command" }, - { FKey::Copy , "Copy" }, - { FKey::Create , "Create" }, - { FKey::End , "End" }, - { FKey::Enter , "Enter" }, - { FKey::Exit , "Exit" }, - { FKey::Find , "Find" }, - { FKey::Help , "Help" }, - { FKey::Mark , "Mark" }, - { FKey::Message , "Message" }, - { FKey::Move , "Move" }, - { FKey::Next , "Next" }, - { FKey::Open , "Open" }, - { FKey::Options , "Options" }, - { FKey::Previous , "Previous" }, - { FKey::Print , "Print" }, - { FKey::Redo , "Redo" }, - { FKey::Reference , "Reference" }, - { FKey::Refresh , "Refresh" }, - { FKey::Replace , "Replace" }, - { FKey::Restart , "Restart" }, - { FKey::Resume , "Resume" }, - { FKey::Save , "Save" }, - { FKey::Suspend , "Suspend" }, - { FKey::Undo , "Undo" }, - { FKey::Shift_begin , "Shift+Begin" }, - { FKey::Shift_cancel , "Shift+Cancel" }, - { FKey::Shift_command , "Shift+Command" }, - { FKey::Shift_copy , "Shift+Copy" }, - { FKey::Shift_create , "Shift+Create" }, - { FKey::Shift_del_char , "Shift+Del" }, - { FKey::Shift_dl , "Shift+Del-line" }, - { FKey::Select , "Select" }, - { FKey::Shift_end , "Shift+End" }, - { FKey::Shift_clear_eol , "Shift+Clear-End-of-Line" }, - { FKey::Shift_exit , "Shift+Exit" }, - { FKey::Shift_find , "Shift+Find" }, - { FKey::Shift_help , "Shift+Help" }, - { FKey::Shift_home , "Shift+Home" }, - { FKey::Shift_insert , "Shift+Ins" }, - { FKey::Shift_left , "Shift+Left" }, - { FKey::Shift_message , "Shift+Message" }, - { FKey::Shift_move , "Shift+Move" }, - { FKey::Shift_page_down , "Shift+Page-Down" }, - { FKey::Shift_options , "Shift+Options" }, - { FKey::Shift_page_up , "Shift+Page-Up" }, - { FKey::Shift_print , "Shift+Print" }, - { FKey::Shift_redo , "Shift+Redo" }, - { FKey::Shift_replace , "Shift+Replace" }, - { FKey::Shift_right , "Shift+Right" }, - { FKey::Shift_rsume , "Shift+Resume" }, - { FKey::Shift_save , "Shift+Save" }, - { FKey::Shift_suspend , "Shift+Suspend" }, - { FKey::Shift_undo , "Shift+Undo" }, - { FKey::F11 , "F11" }, - { FKey::F12 , "F12" }, - { FKey::F13 , "Shift+F1" }, - { FKey::F14 , "Shift+F2" }, - { FKey::F15 , "Shift+F3" }, - { FKey::F16 , "Shift+F4" }, - { FKey::F17 , "Shift+F5" }, - { FKey::F18 , "Shift+F6" }, - { FKey::F19 , "Shift+F7" }, - { FKey::F20 , "Shift+F8" }, - { FKey::F21 , "Shift+F9" }, - { FKey::F22 , "Shift+F10" }, - { FKey::F23 , "Shift+F11" }, - { FKey::F24 , "Shift+F12" }, - { FKey::F25 , "Ctrl+F1" }, - { FKey::F26 , "Ctrl+F2" }, - { FKey::F27 , "Ctrl+F3" }, - { FKey::F28 , "Ctrl+F4" }, - { FKey::F29 , "Ctrl+F5" }, - { FKey::F30 , "Ctrl+F6" }, - { FKey::F31 , "Ctrl+F7" }, - { FKey::F32 , "Ctrl+F8" }, - { FKey::F33 , "Ctrl+F9" }, - { FKey::F34 , "Ctrl+F10" }, - { FKey::F35 , "Ctrl+F11" }, - { FKey::F36 , "Ctrl+F12" }, - { FKey::F37 , "Shift+Ctrl+F1" }, - { FKey::F38 , "Shift+Ctrl+F2" }, - { FKey::F39 , "Shift+Ctrl+F3" }, - { FKey::F40 , "Shift+Ctrl+F4" }, - { FKey::F41 , "Shift+Ctrl+F5" }, - { FKey::F42 , "Shift+Ctrl+F6" }, - { FKey::F43 , "Shift+Ctrl+F7" }, - { FKey::F44 , "Shift+Ctrl+F8" }, - { FKey::F45 , "Shift+Ctrl+F9" }, - { FKey::F46 , "Shift+Ctrl+F10" }, - { FKey::F47 , "Shift+Ctrl+F11" }, - { FKey::F48 , "Shift+Ctrl+F12" }, - { FKey::F49 , "Meta+F1" }, - { FKey::F50 , "Meta+F2" }, - { FKey::F51 , "Meta+F3" }, - { FKey::F52 , "Meta+F4" }, - { FKey::F53 , "Meta+F5" }, - { FKey::F54 , "Meta+F6" }, - { FKey::F55 , "Meta+F7" }, - { FKey::F56 , "Meta+F8" }, - { FKey::F57 , "Meta+F9" }, - { FKey::F58 , "Meta+F10" }, - { FKey::F59 , "Meta+F11" }, - { FKey::F60 , "Meta+F12" }, - { FKey::F61 , "Shift+Meta+F1" }, - { FKey::F62 , "Shift+Meta+F2" }, - { FKey::F63 , "Shift+Meta+F3" }, - { FKey::Meta_insert , "Meta+Ins" }, - { FKey::Meta_del_char , "Meta+Del" }, - { FKey::Meta_home , "Meta+Home" }, - { FKey::Meta_end , "Meta+End" }, - { FKey::Meta_page_up , "Meta+Page-Up" }, - { FKey::Meta_page_down , "Meta+Page-Down" }, - { FKey::Meta_f1 , "Meta+F1" }, - { FKey::Meta_f2 , "Meta+F2" }, - { FKey::Meta_f3 , "Meta+F3" }, - { FKey::Meta_f4 , "Meta+F4" }, - { FKey::Meta_f5 , "Meta+F5" }, - { FKey::Meta_f6 , "Meta+F6" }, - { FKey::Meta_f7 , "Meta+F7" }, - { FKey::Meta_f8 , "Meta+F8" }, - { FKey::Meta_f9 , "Meta+F9" }, - { FKey::Meta_f10 , "Meta+F10" }, - { FKey::Meta_f11 , "Meta+F11" }, - { FKey::Meta_f12 , "Meta+F12" }, - { FKey::Meta_up , "Meta+Up" }, - { FKey::Meta_down , "Meta+Down" }, - { FKey::Meta_right , "Meta+Right" }, - { FKey::Meta_left , "Meta+Left" }, - { FKey::Shift_Meta_insert , "Shift+Meta+Ins" }, - { FKey::Shift_Meta_del_char , "Shift+Meta+Del" }, - { FKey::Shift_Meta_home , "Shift+Meta+Home" }, - { FKey::Shift_Meta_end , "Shift+Meta+End" }, - { FKey::Shift_Meta_page_up , "Shift+Meta+Page-Up" }, - { FKey::Shift_Meta_page_down , "Shift+Meta+Page-Down" }, - { FKey::Shift_Meta_f1 , "Shift+Meta+F1" }, - { FKey::Shift_Meta_f2 , "Shift+Meta+F2" }, - { FKey::Shift_Meta_f3 , "Shift+Meta+F3" }, - { FKey::Shift_Meta_f4 , "Shift+Meta+F4" }, - { FKey::Shift_Meta_f5 , "Shift+Meta+F5" }, - { FKey::Shift_Meta_f6 , "Shift+Meta+F6" }, - { FKey::Shift_Meta_f7 , "Shift+Meta+F7" }, - { FKey::Shift_Meta_f8 , "Shift+Meta+F8" }, - { FKey::Shift_Meta_f9 , "Shift+Meta+F9" }, - { FKey::Shift_Meta_f10 , "Shift+Meta+F10" }, - { FKey::Shift_Meta_f11 , "Shift+Meta+F11" }, - { FKey::Shift_Meta_f12 , "Shift+Meta+F12" }, - { FKey::Shift_Meta_up , "Shift+Meta+Up" }, - { FKey::Shift_Meta_down , "Shift+Meta+Down" }, - { FKey::Shift_Meta_right , "Shift+Meta+Right" }, - { FKey::Shift_Meta_left , "Shift+Meta+Left" }, - { FKey::Ctrl_insert , "Ctrl+Ins" }, - { FKey::Ctrl_del_char , "Ctrl+Del" }, - { FKey::Ctrl_home , "Ctrl+Home" }, - { FKey::Ctrl_end , "Ctrl+End" }, - { FKey::Ctrl_page_up , "Ctrl+PgUp" }, - { FKey::Ctrl_page_down , "Ctrl+PgDn" }, - { FKey::Ctrl_up , "Ctrl+Up" }, - { FKey::Ctrl_down , "Ctrl+Down" }, - { FKey::Ctrl_right , "Ctrl+Right" }, - { FKey::Ctrl_left , "Ctrl+Left" }, - { FKey::Shift_Ctrl_insert , "Shift+Ctrl+Ins" }, - { FKey::Shift_Ctrl_del_char , "Shift+Ctrl+Del" }, - { FKey::Shift_Ctrl_home , "Shift+Ctrl+Home" }, - { FKey::Shift_Ctrl_end , "Shift+Ctrl+End" }, - { FKey::Shift_Ctrl_page_up , "Shift+Ctrl+Page-Up" }, - { FKey::Shift_Ctrl_page_down , "Shift+Ctrl+Page-Down" }, - { FKey::Shift_Ctrl_up , "Shift+Ctrl+Up" }, - { FKey::Shift_Ctrl_down , "Shift+Ctrl+Down" }, - { FKey::Shift_Ctrl_right , "Shift+Ctrl+Right" }, - { FKey::Shift_Ctrl_left , "Shift+Ctrl+Left" }, - { FKey::Ctrl_Meta_insert , "Ctrl+Meta+Ins" }, - { FKey::Ctrl_Meta_del_char , "Ctrl+Meta+Del" }, - { FKey::Ctrl_Meta_home , "Ctrl+Meta+Home" }, - { FKey::Ctrl_Meta_end , "Ctrl+Meta+End" }, - { FKey::Ctrl_Meta_page_up , "Ctrl+Meta+Page-Up" }, - { FKey::Ctrl_Meta_page_down , "Ctrl+Meta+Page-Down" }, - { FKey::Ctrl_Meta_up , "Ctrl+Meta+Up" }, - { FKey::Ctrl_Meta_down , "Ctrl+Meta+Down" }, - { FKey::Ctrl_Meta_right , "Ctrl+Meta+Right" }, - { FKey::Ctrl_Meta_left , "Ctrl+Meta+Left" }, - { FKey::Shift_Ctrl_Meta_insert , "Shift+Ctrl+Meta+Ins" }, - { FKey::Shift_Ctrl_Meta_del_char , "Shift+Ctrl+Meta+Del" }, - { FKey::Shift_Ctrl_Meta_home , "Shift+Ctrl+Meta+Home" }, - { FKey::Shift_Ctrl_Meta_end , "Shift+Ctrl+Meta+End" }, - { FKey::Shift_Ctrl_Meta_page_up , "Shift+Ctrl+Meta+Page-Up" }, - { FKey::Shift_Ctrl_Meta_page_down , "Shift+Ctrl+Meta+Page-Down" }, - { FKey::Shift_Ctrl_Meta_f1 , "Shift+Ctrl+Meta+F1" }, - { FKey::Shift_Ctrl_Meta_f2 , "Shift+Ctrl+Meta+F2" }, - { FKey::Shift_Ctrl_Meta_f3 , "Shift+Ctrl+Meta+F3" }, - { FKey::Shift_Ctrl_Meta_f4 , "Shift+Ctrl+Meta+F4" }, - { FKey::Shift_Ctrl_Meta_f5 , "Shift+Ctrl+Meta+F5" }, - { FKey::Shift_Ctrl_Meta_f6 , "Shift+Ctrl+Meta+F6" }, - { FKey::Shift_Ctrl_Meta_f7 , "Shift+Ctrl+Meta+F7" }, - { FKey::Shift_Ctrl_Meta_f8 , "Shift+Ctrl+Meta+F8" }, - { FKey::Shift_Ctrl_Meta_f9 , "Shift+Ctrl+Meta+F9" }, - { FKey::Shift_Ctrl_Meta_f10 , "Shift+Ctrl+Meta+F10" }, - { FKey::Shift_Ctrl_Meta_f11 , "Shift+Ctrl+Meta+F11" }, - { FKey::Shift_Ctrl_Meta_f12 , "Shift+Ctrl+Meta+F12" }, - { FKey::Shift_Ctrl_Meta_up , "Shift+Ctrl+Meta+Up" }, - { FKey::Shift_Ctrl_Meta_down , "Shift+Ctrl+Meta+Down" }, - { FKey::Shift_Ctrl_Meta_right , "Shift+Ctrl+Meta+Right" }, - { FKey::Shift_Ctrl_Meta_left , "Shift+Ctrl+Meta+Left" }, - { FKey::Menu , "Menu" }, - { FKey::Shift_menu , "Shift+Menu" }, - { FKey::Ctrl_menu , "Ctrl+Menu" }, - { FKey::Shift_Ctrl_menu , "Shift+Ctrl+Menu" }, - { FKey::Meta_menu , "Meta+Menu" }, - { FKey::Shift_Meta_menu , "Shift+Meta+Menu" }, - { FKey::Ctrl_Meta_menu , "Ctrl+Meta+Menu" }, - { FKey::Shift_Ctrl_Meta_menu , "Shift+Ctrl+Meta+Menu" }, - { FKey::Term_Focus_In , "terminal focus-in" }, - { FKey::Term_Focus_Out , "terminal focus-out" }, - { FKey::Meta_tab , "Meta+Tab" }, - { FKey::Meta_enter , "Meta+Enter" }, - { FKey::Meta_space , "Meta+Space" }, - { FKey::Meta_bang , "Meta+!" }, - { FKey::Meta_quotes , "Meta+\"" }, - { FKey::Meta_hash , "Meta+#" }, - { FKey::Meta_dollar , "Meta+$" }, - { FKey::Meta_percent , "Meta+%" }, - { FKey::Meta_ampersand , "Meta+&" }, - { FKey::Meta_apostrophe , "Meta+'" }, - { FKey::Meta_left_parenthesis , "Meta+(" }, - { FKey::Meta_right_parenthesis , "Meta+)" }, - { FKey::Meta_asterisk , "Meta+*" }, - { FKey::Meta_plus , "Meta++" }, - { FKey::Meta_comma , "Meta+," }, - { FKey::Meta_minus , "Meta+-" }, - { FKey::Meta_full_stop , "Meta+." }, - { FKey::Meta_slash , "Meta+/" }, - { FKey::Meta_0 , "Meta+0" }, - { FKey::Meta_1 , "Meta+1" }, - { FKey::Meta_2 , "Meta+2" }, - { FKey::Meta_3 , "Meta+3" }, - { FKey::Meta_4 , "Meta+4" }, - { FKey::Meta_5 , "Meta+5" }, - { FKey::Meta_6 , "Meta+6" }, - { FKey::Meta_7 , "Meta+7" }, - { FKey::Meta_8 , "Meta+8" }, - { FKey::Meta_9 , "Meta+9" }, - { FKey::Meta_colon , "Meta+:" }, - { FKey::Meta_semicolon , "Meta+;" }, - { FKey::Meta_less_than , "Meta+<" }, - { FKey::Meta_equals , "Meta+=" }, - { FKey::Meta_greater_than , "Meta+>" }, - { FKey::Meta_question_mark , "Meta+?" }, - { FKey::Meta_at , "Meta+@" }, - { FKey::Meta_A , "Shift+Meta+A" }, - { FKey::Meta_B , "Shift+Meta+B" }, - { FKey::Meta_C , "Shift+Meta+C" }, - { FKey::Meta_D , "Shift+Meta+D" }, - { FKey::Meta_E , "Shift+Meta+E" }, - { FKey::Meta_F , "Shift+Meta+F" }, - { FKey::Meta_G , "Shift+Meta+G" }, - { FKey::Meta_H , "Shift+Meta+H" }, - { FKey::Meta_I , "Shift+Meta+I" }, - { FKey::Meta_J , "Shift+Meta+J" }, - { FKey::Meta_K , "Shift+Meta+K" }, - { FKey::Meta_L , "Shift+Meta+L" }, - { FKey::Meta_M , "Shift+Meta+M" }, - { FKey::Meta_N , "Shift+Meta+N" }, - { FKey::Meta_O , "Shift+Meta+O" }, - { FKey::Meta_P , "Shift+Meta+P" }, - { FKey::Meta_Q , "Shift+Meta+Q" }, - { FKey::Meta_R , "Shift+Meta+R" }, - { FKey::Meta_S , "Shift+Meta+S" }, - { FKey::Meta_T , "Shift+Meta+T" }, - { FKey::Meta_U , "Shift+Meta+U" }, - { FKey::Meta_V , "Shift+Meta+V" }, - { FKey::Meta_W , "Shift+Meta+W" }, - { FKey::Meta_X , "Shift+Meta+X" }, - { FKey::Meta_Y , "Shift+Meta+Y" }, - { FKey::Meta_Z , "Shift+Meta+Z" }, - { FKey::Meta_left_square_bracket , "Meta+[" }, - { FKey::Meta_backslash , "Meta+\\" }, - { FKey::Meta_right_square_bracket , "Meta+]" }, - { FKey::Meta_caret , "Meta+^" }, - { FKey::Meta_underscore , "Meta+_" }, - { FKey::Meta_grave_accent , "Meta+`" }, - { FKey::Meta_a , "Meta+A" }, - { FKey::Meta_b , "Meta+B" }, - { FKey::Meta_c , "Meta+C" }, - { FKey::Meta_d , "Meta+D" }, - { FKey::Meta_e , "Meta+E" }, - { FKey::Meta_f , "Meta+F" }, - { FKey::Meta_g , "Meta+G" }, - { FKey::Meta_h , "Meta+H" }, - { FKey::Meta_i , "Meta+I" }, - { FKey::Meta_j , "Meta+J" }, - { FKey::Meta_k , "Meta+K" }, - { FKey::Meta_l , "Meta+L" }, - { FKey::Meta_m , "Meta+M" }, - { FKey::Meta_n , "Meta+N" }, - { FKey::Meta_o , "Meta+O" }, - { FKey::Meta_p , "Meta+P" }, - { FKey::Meta_q , "Meta+Q" }, - { FKey::Meta_r , "Meta+R" }, - { FKey::Meta_s , "Meta+S" }, - { FKey::Meta_t , "Meta+T" }, - { FKey::Meta_u , "Meta+U" }, - { FKey::Meta_v , "Meta+V" }, - { FKey::Meta_w , "Meta+W" }, - { FKey::Meta_x , "Meta+X" }, - { FKey::Meta_y , "Meta+Y" }, - { FKey::Meta_z , "Meta+Z" }, - { FKey::Meta_left_curly_bracket , "Meta+{" }, - { FKey::Meta_vertical_bar , "Meta+|" }, - { FKey::Meta_right_curly_bracket , "Meta+}" }, - { FKey::Meta_tilde , "Meta+~" }, - { FKey::X11mouse , "xterm mouse" }, - { FKey::Extended_mouse , "SGR extended mouse" }, - { FKey::Urxvt_mouse , "urxvt mouse extension" }, - { FKey::Incomplete , "incomplete key string" } + { FKey::Ctrl_a , {"Ctrl+A"} }, + { FKey::Ctrl_b , {"Ctrl+B"} }, + { FKey::Ctrl_c , {"Ctrl+C"} }, + { FKey::Ctrl_d , {"Ctrl+D"} }, + { FKey::Ctrl_e , {"Ctrl+E"} }, + { FKey::Ctrl_f , {"Ctrl+F"} }, + { FKey::Ctrl_g , {"Ctrl+G"} }, + { FKey::Erase , {"Backspace"} }, // Ctrl+H + { FKey::Tab , {"Tab"} }, // Ctrl+I + { FKey::Ctrl_j , {"Ctrl+J"} }, + { FKey::Ctrl_h , {"Ctrl+K"} }, + { FKey::Ctrl_l , {"Ctrl+L"} }, + { FKey::Return , {"Return"} }, // Ctrl+M + { FKey::Ctrl_n , {"Ctrl+N"} }, + { FKey::Ctrl_o , {"Ctrl+O"} }, + { FKey::Ctrl_p , {"Ctrl+P"} }, + { FKey::Ctrl_q , {"Ctrl+Q"} }, + { FKey::Ctrl_r , {"Ctrl+R"} }, + { FKey::Ctrl_s , {"Ctrl+S"} }, + { FKey::Ctrl_t , {"Ctrl+T"} }, + { FKey::Ctrl_u , {"Ctrl+U"} }, + { FKey::Ctrl_v , {"Ctrl+V"} }, + { FKey::Ctrl_w , {"Ctrl+W"} }, + { FKey::Ctrl_x , {"Ctrl+X"} }, + { FKey::Ctrl_y , {"Ctrl+Y"} }, + { FKey::Ctrl_z , {"Ctrl+Z"} }, + { FKey::Escape , {"Esc"} }, // Ctrl+[ + { FKey::Escape_mintty , {"Esc"} }, + { FKey::Ctrl_backslash , {"Ctrl+\\"} }, + { FKey::Ctrl_right_square_bracket , {"Ctrl+]"} }, + { FKey::Ctrl_caret , {"Ctrl+^"} }, + { FKey::Ctrl_underscore , {"Ctrl+_"} }, + { FKey::Space , {"Space"} }, + { FKey::Ctrl_space , {"Ctrl+Space"} }, // Ctrl+(Space or @) + { FKey::Backspace , {"Backspace"} }, + { FKey::Clear_all_tabs , {"Clear-All-Tabs"} }, + { FKey::Clear , {"Clear-Screen"} }, + { FKey::Clear_tab , {"Clear-Tab"} }, + { FKey::Del_char , {"Del"} }, + { FKey::Del_line , {"Del-line"} }, + { FKey::Down , {"Down"} }, + { FKey::Exit_insert , {"Exit-Ins"} }, + { FKey::Clear_eol , {"Clear-End-of-Line"} }, + { FKey::Clear_eos , {"Clear-End-of-Screen"} }, + { FKey::F0 , {"F0"} }, + { FKey::F1 , {"F1"} }, + { FKey::F2 , {"F2"} }, + { FKey::F3 , {"F3"} }, + { FKey::F4 , {"F4"} }, + { FKey::F5 , {"F5"} }, + { FKey::F6 , {"F6"} }, + { FKey::F7 , {"F7"} }, + { FKey::F8 , {"F8"} }, + { FKey::F9 , {"F9"} }, + { FKey::F10 , {"F10"} }, + { FKey::Home , {"Home"} }, + { FKey::Insert , {"Ins"} }, + { FKey::Insert_line , {"Ins-Line"} }, + { FKey::Left , {"Left"} }, + { FKey::Home_down , {"Home-Down"} }, + { FKey::Page_down , {"Page-Down"} }, + { FKey::Page_up , {"Page-Up"} }, + { FKey::Right , {"Right"} }, + { FKey::Scroll_forward , {"Scroll-Forward"} }, + { FKey::Scroll_backward , {"Scroll-Backward"} }, + { FKey::Set_tab , {"Set-Tab"} }, + { FKey::Up , {"Up"} }, + { FKey::Upper_left , {"Upper-Left"} }, + { FKey::Upper_right , {"Upper-Right"} }, + { FKey::Center , {"Center"} }, + { FKey::Lower_left , {"Lower-Left"} }, + { FKey::Lower_right , {"Lower-Right"} }, + { FKey::Back_tab , {"Shift+Tab"} }, + { FKey::Begin , {"Begin"} }, + { FKey::Cancel , {"Cancel"} }, + { FKey::Close , {"Close"} }, + { FKey::Command , {"Command"} }, + { FKey::Copy , {"Copy"} }, + { FKey::Create , {"Create"} }, + { FKey::End , {"End"} }, + { FKey::Enter , {"Enter"} }, + { FKey::Exit , {"Exit"} }, + { FKey::Find , {"Find"} }, + { FKey::Help , {"Help"} }, + { FKey::Mark , {"Mark"} }, + { FKey::Message , {"Message"} }, + { FKey::Move , {"Move"} }, + { FKey::Next , {"Next"} }, + { FKey::Open , {"Open"} }, + { FKey::Options , {"Options"} }, + { FKey::Previous , {"Previous"} }, + { FKey::Print , {"Print"} }, + { FKey::Redo , {"Redo"} }, + { FKey::Reference , {"Reference"} }, + { FKey::Refresh , {"Refresh"} }, + { FKey::Replace , {"Replace"} }, + { FKey::Restart , {"Restart"} }, + { FKey::Resume , {"Resume"} }, + { FKey::Save , {"Save"} }, + { FKey::Suspend , {"Suspend"} }, + { FKey::Undo , {"Undo"} }, + { FKey::Shift_begin , {"Shift+Begin"} }, + { FKey::Shift_cancel , {"Shift+Cancel"} }, + { FKey::Shift_command , {"Shift+Command"} }, + { FKey::Shift_copy , {"Shift+Copy"} }, + { FKey::Shift_create , {"Shift+Create"} }, + { FKey::Shift_del_char , {"Shift+Del"} }, + { FKey::Shift_dl , {"Shift+Del-line"} }, + { FKey::Select , {"Select"} }, + { FKey::Shift_end , {"Shift+End"} }, + { FKey::Shift_clear_eol , {"Shift+Clear-End-of-Line"} }, + { FKey::Shift_exit , {"Shift+Exit"} }, + { FKey::Shift_find , {"Shift+Find"} }, + { FKey::Shift_help , {"Shift+Help"} }, + { FKey::Shift_home , {"Shift+Home"} }, + { FKey::Shift_insert , {"Shift+Ins"} }, + { FKey::Shift_left , {"Shift+Left"} }, + { FKey::Shift_message , {"Shift+Message"} }, + { FKey::Shift_move , {"Shift+Move"} }, + { FKey::Shift_page_down , {"Shift+Page-Down"} }, + { FKey::Shift_options , {"Shift+Options"} }, + { FKey::Shift_page_up , {"Shift+Page-Up"} }, + { FKey::Shift_print , {"Shift+Print"} }, + { FKey::Shift_redo , {"Shift+Redo"} }, + { FKey::Shift_replace , {"Shift+Replace"} }, + { FKey::Shift_right , {"Shift+Right"} }, + { FKey::Shift_rsume , {"Shift+Resume"} }, + { FKey::Shift_save , {"Shift+Save"} }, + { FKey::Shift_suspend , {"Shift+Suspend"} }, + { FKey::Shift_undo , {"Shift+Undo"} }, + { FKey::F11 , {"F11"} }, + { FKey::F12 , {"F12"} }, + { FKey::F13 , {"Shift+F1"} }, + { FKey::F14 , {"Shift+F2"} }, + { FKey::F15 , {"Shift+F3"} }, + { FKey::F16 , {"Shift+F4"} }, + { FKey::F17 , {"Shift+F5"} }, + { FKey::F18 , {"Shift+F6"} }, + { FKey::F19 , {"Shift+F7"} }, + { FKey::F20 , {"Shift+F8"} }, + { FKey::F21 , {"Shift+F9"} }, + { FKey::F22 , {"Shift+F10"} }, + { FKey::F23 , {"Shift+F11"} }, + { FKey::F24 , {"Shift+F12"} }, + { FKey::F25 , {"Ctrl+F1"} }, + { FKey::F26 , {"Ctrl+F2"} }, + { FKey::F27 , {"Ctrl+F3"} }, + { FKey::F28 , {"Ctrl+F4"} }, + { FKey::F29 , {"Ctrl+F5"} }, + { FKey::F30 , {"Ctrl+F6"} }, + { FKey::F31 , {"Ctrl+F7"} }, + { FKey::F32 , {"Ctrl+F8"} }, + { FKey::F33 , {"Ctrl+F9"} }, + { FKey::F34 , {"Ctrl+F10"} }, + { FKey::F35 , {"Ctrl+F11"} }, + { FKey::F36 , {"Ctrl+F12"} }, + { FKey::F37 , {"Shift+Ctrl+F1"} }, + { FKey::F38 , {"Shift+Ctrl+F2"} }, + { FKey::F39 , {"Shift+Ctrl+F3"} }, + { FKey::F40 , {"Shift+Ctrl+F4"} }, + { FKey::F41 , {"Shift+Ctrl+F5"} }, + { FKey::F42 , {"Shift+Ctrl+F6"} }, + { FKey::F43 , {"Shift+Ctrl+F7"} }, + { FKey::F44 , {"Shift+Ctrl+F8"} }, + { FKey::F45 , {"Shift+Ctrl+F9"} }, + { FKey::F46 , {"Shift+Ctrl+F10"} }, + { FKey::F47 , {"Shift+Ctrl+F11"} }, + { FKey::F48 , {"Shift+Ctrl+F12"} }, + { FKey::F49 , {"Meta+F1"} }, + { FKey::F50 , {"Meta+F2"} }, + { FKey::F51 , {"Meta+F3"} }, + { FKey::F52 , {"Meta+F4"} }, + { FKey::F53 , {"Meta+F5"} }, + { FKey::F54 , {"Meta+F6"} }, + { FKey::F55 , {"Meta+F7"} }, + { FKey::F56 , {"Meta+F8"} }, + { FKey::F57 , {"Meta+F9"} }, + { FKey::F58 , {"Meta+F10"} }, + { FKey::F59 , {"Meta+F11"} }, + { FKey::F60 , {"Meta+F12"} }, + { FKey::F61 , {"Shift+Meta+F1"} }, + { FKey::F62 , {"Shift+Meta+F2"} }, + { FKey::F63 , {"Shift+Meta+F3"} }, + { FKey::Meta_insert , {"Meta+Ins"} }, + { FKey::Meta_del_char , {"Meta+Del"} }, + { FKey::Meta_home , {"Meta+Home"} }, + { FKey::Meta_end , {"Meta+End"} }, + { FKey::Meta_page_up , {"Meta+Page-Up"} }, + { FKey::Meta_page_down , {"Meta+Page-Down"} }, + { FKey::Meta_f1 , {"Meta+F1"} }, + { FKey::Meta_f2 , {"Meta+F2"} }, + { FKey::Meta_f3 , {"Meta+F3"} }, + { FKey::Meta_f4 , {"Meta+F4"} }, + { FKey::Meta_f5 , {"Meta+F5"} }, + { FKey::Meta_f6 , {"Meta+F6"} }, + { FKey::Meta_f7 , {"Meta+F7"} }, + { FKey::Meta_f8 , {"Meta+F8"} }, + { FKey::Meta_f9 , {"Meta+F9"} }, + { FKey::Meta_f10 , {"Meta+F10"} }, + { FKey::Meta_f11 , {"Meta+F11"} }, + { FKey::Meta_f12 , {"Meta+F12"} }, + { FKey::Meta_up , {"Meta+Up"} }, + { FKey::Meta_down , {"Meta+Down"} }, + { FKey::Meta_right , {"Meta+Right"} }, + { FKey::Meta_left , {"Meta+Left"} }, + { FKey::Shift_Meta_insert , {"Shift+Meta+Ins"} }, + { FKey::Shift_Meta_del_char , {"Shift+Meta+Del"} }, + { FKey::Shift_Meta_home , {"Shift+Meta+Home"} }, + { FKey::Shift_Meta_end , {"Shift+Meta+End"} }, + { FKey::Shift_Meta_page_up , {"Shift+Meta+Page-Up"} }, + { FKey::Shift_Meta_page_down , {"Shift+Meta+Page-Down"} }, + { FKey::Shift_Meta_f1 , {"Shift+Meta+F1"} }, + { FKey::Shift_Meta_f2 , {"Shift+Meta+F2"} }, + { FKey::Shift_Meta_f3 , {"Shift+Meta+F3"} }, + { FKey::Shift_Meta_f4 , {"Shift+Meta+F4"} }, + { FKey::Shift_Meta_f5 , {"Shift+Meta+F5"} }, + { FKey::Shift_Meta_f6 , {"Shift+Meta+F6"} }, + { FKey::Shift_Meta_f7 , {"Shift+Meta+F7"} }, + { FKey::Shift_Meta_f8 , {"Shift+Meta+F8"} }, + { FKey::Shift_Meta_f9 , {"Shift+Meta+F9"} }, + { FKey::Shift_Meta_f10 , {"Shift+Meta+F10"} }, + { FKey::Shift_Meta_f11 , {"Shift+Meta+F11"} }, + { FKey::Shift_Meta_f12 , {"Shift+Meta+F12"} }, + { FKey::Shift_Meta_up , {"Shift+Meta+Up"} }, + { FKey::Shift_Meta_down , {"Shift+Meta+Down"} }, + { FKey::Shift_Meta_right , {"Shift+Meta+Right"} }, + { FKey::Shift_Meta_left , {"Shift+Meta+Left"} }, + { FKey::Ctrl_insert , {"Ctrl+Ins"} }, + { FKey::Ctrl_del_char , {"Ctrl+Del"} }, + { FKey::Ctrl_home , {"Ctrl+Home"} }, + { FKey::Ctrl_end , {"Ctrl+End"} }, + { FKey::Ctrl_page_up , {"Ctrl+PgUp"} }, + { FKey::Ctrl_page_down , {"Ctrl+PgDn"} }, + { FKey::Ctrl_up , {"Ctrl+Up"} }, + { FKey::Ctrl_down , {"Ctrl+Down"} }, + { FKey::Ctrl_right , {"Ctrl+Right"} }, + { FKey::Ctrl_left , {"Ctrl+Left"} }, + { FKey::Shift_Ctrl_insert , {"Shift+Ctrl+Ins"} }, + { FKey::Shift_Ctrl_del_char , {"Shift+Ctrl+Del"} }, + { FKey::Shift_Ctrl_home , {"Shift+Ctrl+Home"} }, + { FKey::Shift_Ctrl_end , {"Shift+Ctrl+End"} }, + { FKey::Shift_Ctrl_page_up , {"Shift+Ctrl+Page-Up"} }, + { FKey::Shift_Ctrl_page_down , {"Shift+Ctrl+Page-Down"} }, + { FKey::Shift_Ctrl_up , {"Shift+Ctrl+Up"} }, + { FKey::Shift_Ctrl_down , {"Shift+Ctrl+Down"} }, + { FKey::Shift_Ctrl_right , {"Shift+Ctrl+Right"} }, + { FKey::Shift_Ctrl_left , {"Shift+Ctrl+Left"} }, + { FKey::Ctrl_Meta_insert , {"Ctrl+Meta+Ins"} }, + { FKey::Ctrl_Meta_del_char , {"Ctrl+Meta+Del"} }, + { FKey::Ctrl_Meta_home , {"Ctrl+Meta+Home"} }, + { FKey::Ctrl_Meta_end , {"Ctrl+Meta+End"} }, + { FKey::Ctrl_Meta_page_up , {"Ctrl+Meta+Page-Up"} }, + { FKey::Ctrl_Meta_page_down , {"Ctrl+Meta+Page-Down"} }, + { FKey::Ctrl_Meta_up , {"Ctrl+Meta+Up"} }, + { FKey::Ctrl_Meta_down , {"Ctrl+Meta+Down"} }, + { FKey::Ctrl_Meta_right , {"Ctrl+Meta+Right"} }, + { FKey::Ctrl_Meta_left , {"Ctrl+Meta+Left"} }, + { FKey::Shift_Ctrl_Meta_insert , {"Shift+Ctrl+Meta+Ins"} }, + { FKey::Shift_Ctrl_Meta_del_char , {"Shift+Ctrl+Meta+Del"} }, + { FKey::Shift_Ctrl_Meta_home , {"Shift+Ctrl+Meta+Home"} }, + { FKey::Shift_Ctrl_Meta_end , {"Shift+Ctrl+Meta+End"} }, + { FKey::Shift_Ctrl_Meta_page_up , {"Shift+Ctrl+Meta+Page-Up"} }, + { FKey::Shift_Ctrl_Meta_page_down , {"Shift+Ctrl+Meta+Page-Down"} }, + { FKey::Shift_Ctrl_Meta_f1 , {"Shift+Ctrl+Meta+F1"} }, + { FKey::Shift_Ctrl_Meta_f2 , {"Shift+Ctrl+Meta+F2"} }, + { FKey::Shift_Ctrl_Meta_f3 , {"Shift+Ctrl+Meta+F3"} }, + { FKey::Shift_Ctrl_Meta_f4 , {"Shift+Ctrl+Meta+F4"} }, + { FKey::Shift_Ctrl_Meta_f5 , {"Shift+Ctrl+Meta+F5"} }, + { FKey::Shift_Ctrl_Meta_f6 , {"Shift+Ctrl+Meta+F6"} }, + { FKey::Shift_Ctrl_Meta_f7 , {"Shift+Ctrl+Meta+F7"} }, + { FKey::Shift_Ctrl_Meta_f8 , {"Shift+Ctrl+Meta+F8"} }, + { FKey::Shift_Ctrl_Meta_f9 , {"Shift+Ctrl+Meta+F9"} }, + { FKey::Shift_Ctrl_Meta_f10 , {"Shift+Ctrl+Meta+F10"} }, + { FKey::Shift_Ctrl_Meta_f11 , {"Shift+Ctrl+Meta+F11"} }, + { FKey::Shift_Ctrl_Meta_f12 , {"Shift+Ctrl+Meta+F12"} }, + { FKey::Shift_Ctrl_Meta_up , {"Shift+Ctrl+Meta+Up"} }, + { FKey::Shift_Ctrl_Meta_down , {"Shift+Ctrl+Meta+Down"} }, + { FKey::Shift_Ctrl_Meta_right , {"Shift+Ctrl+Meta+Right"} }, + { FKey::Shift_Ctrl_Meta_left , {"Shift+Ctrl+Meta+Left"} }, + { FKey::Menu , {"Menu"} }, + { FKey::Shift_menu , {"Shift+Menu"} }, + { FKey::Ctrl_menu , {"Ctrl+Menu"} }, + { FKey::Shift_Ctrl_menu , {"Shift+Ctrl+Menu"} }, + { FKey::Meta_menu , {"Meta+Menu"} }, + { FKey::Shift_Meta_menu , {"Shift+Meta+Menu"} }, + { FKey::Ctrl_Meta_menu , {"Ctrl+Meta+Menu"} }, + { FKey::Shift_Ctrl_Meta_menu , {"Shift+Ctrl+Meta+Menu"} }, + { FKey::Term_Focus_In , {"terminal focus-in"} }, + { FKey::Term_Focus_Out , {"terminal focus-out"} }, + { FKey::Meta_tab , {"Meta+Tab"} }, + { FKey::Meta_enter , {"Meta+Enter"} }, + { FKey::Meta_space , {"Meta+Space"} }, + { FKey::Meta_bang , {"Meta+!"} }, + { FKey::Meta_quotes , {"Meta+\""} }, + { FKey::Meta_hash , {"Meta+#"} }, + { FKey::Meta_dollar , {"Meta+$"} }, + { FKey::Meta_percent , {"Meta+%"} }, + { FKey::Meta_ampersand , {"Meta+&"} }, + { FKey::Meta_apostrophe , {"Meta+'"} }, + { FKey::Meta_left_parenthesis , {"Meta+("} }, + { FKey::Meta_right_parenthesis , {"Meta+)"} }, + { FKey::Meta_asterisk , {"Meta+*"} }, + { FKey::Meta_plus , {"Meta++"} }, + { FKey::Meta_comma , {"Meta+,"} }, + { FKey::Meta_minus , {"Meta+-"} }, + { FKey::Meta_full_stop , {"Meta+."} }, + { FKey::Meta_slash , {"Meta+/"} }, + { FKey::Meta_0 , {"Meta+0"} }, + { FKey::Meta_1 , {"Meta+1"} }, + { FKey::Meta_2 , {"Meta+2"} }, + { FKey::Meta_3 , {"Meta+3"} }, + { FKey::Meta_4 , {"Meta+4"} }, + { FKey::Meta_5 , {"Meta+5"} }, + { FKey::Meta_6 , {"Meta+6"} }, + { FKey::Meta_7 , {"Meta+7"} }, + { FKey::Meta_8 , {"Meta+8"} }, + { FKey::Meta_9 , {"Meta+9"} }, + { FKey::Meta_colon , {"Meta+:"} }, + { FKey::Meta_semicolon , {"Meta+;"} }, + { FKey::Meta_less_than , {"Meta+<"} }, + { FKey::Meta_equals , {"Meta+="} }, + { FKey::Meta_greater_than , {"Meta+>"} }, + { FKey::Meta_question_mark , {"Meta+?"} }, + { FKey::Meta_at , {"Meta+@"} }, + { FKey::Meta_A , {"Shift+Meta+A"} }, + { FKey::Meta_B , {"Shift+Meta+B"} }, + { FKey::Meta_C , {"Shift+Meta+C"} }, + { FKey::Meta_D , {"Shift+Meta+D"} }, + { FKey::Meta_E , {"Shift+Meta+E"} }, + { FKey::Meta_F , {"Shift+Meta+F"} }, + { FKey::Meta_G , {"Shift+Meta+G"} }, + { FKey::Meta_H , {"Shift+Meta+H"} }, + { FKey::Meta_I , {"Shift+Meta+I"} }, + { FKey::Meta_J , {"Shift+Meta+J"} }, + { FKey::Meta_K , {"Shift+Meta+K"} }, + { FKey::Meta_L , {"Shift+Meta+L"} }, + { FKey::Meta_M , {"Shift+Meta+M"} }, + { FKey::Meta_N , {"Shift+Meta+N"} }, + { FKey::Meta_O , {"Shift+Meta+O"} }, + { FKey::Meta_P , {"Shift+Meta+P"} }, + { FKey::Meta_Q , {"Shift+Meta+Q"} }, + { FKey::Meta_R , {"Shift+Meta+R"} }, + { FKey::Meta_S , {"Shift+Meta+S"} }, + { FKey::Meta_T , {"Shift+Meta+T"} }, + { FKey::Meta_U , {"Shift+Meta+U"} }, + { FKey::Meta_V , {"Shift+Meta+V"} }, + { FKey::Meta_W , {"Shift+Meta+W"} }, + { FKey::Meta_X , {"Shift+Meta+X"} }, + { FKey::Meta_Y , {"Shift+Meta+Y"} }, + { FKey::Meta_Z , {"Shift+Meta+Z"} }, + { FKey::Meta_left_square_bracket , {"Meta+["} }, + { FKey::Meta_backslash , {"Meta+\\"} }, + { FKey::Meta_right_square_bracket , {"Meta+]"} }, + { FKey::Meta_caret , {"Meta+^"} }, + { FKey::Meta_underscore , {"Meta+_"} }, + { FKey::Meta_grave_accent , {"Meta+`"} }, + { FKey::Meta_a , {"Meta+A"} }, + { FKey::Meta_b , {"Meta+B"} }, + { FKey::Meta_c , {"Meta+C"} }, + { FKey::Meta_d , {"Meta+D"} }, + { FKey::Meta_e , {"Meta+E"} }, + { FKey::Meta_f , {"Meta+F"} }, + { FKey::Meta_g , {"Meta+G"} }, + { FKey::Meta_h , {"Meta+H"} }, + { FKey::Meta_i , {"Meta+I"} }, + { FKey::Meta_j , {"Meta+J"} }, + { FKey::Meta_k , {"Meta+K"} }, + { FKey::Meta_l , {"Meta+L"} }, + { FKey::Meta_m , {"Meta+M"} }, + { FKey::Meta_n , {"Meta+N"} }, + { FKey::Meta_o , {"Meta+O"} }, + { FKey::Meta_p , {"Meta+P"} }, + { FKey::Meta_q , {"Meta+Q"} }, + { FKey::Meta_r , {"Meta+R"} }, + { FKey::Meta_s , {"Meta+S"} }, + { FKey::Meta_t , {"Meta+T"} }, + { FKey::Meta_u , {"Meta+U"} }, + { FKey::Meta_v , {"Meta+V"} }, + { FKey::Meta_w , {"Meta+W"} }, + { FKey::Meta_x , {"Meta+X"} }, + { FKey::Meta_y , {"Meta+Y"} }, + { FKey::Meta_z , {"Meta+Z"} }, + { FKey::Meta_left_curly_bracket , {"Meta+{"} }, + { FKey::Meta_vertical_bar , {"Meta+|"} }, + { FKey::Meta_right_curly_bracket , {"Meta+}"} }, + { FKey::Meta_tilde , {"Meta+~"} }, + { FKey::X11mouse , {"xterm mouse"} }, + { FKey::Extended_mouse , {"SGR extended mouse"} }, + { FKey::Urxvt_mouse , {"urxvt mouse extension"} }, + { FKey::Incomplete , {"incomplete key string"} } }}; } // namespace finalcut diff --git a/final/input/fkey_map.h b/final/input/fkey_map.h index 85f154bb..02dc51df 100644 --- a/final/input/fkey_map.h +++ b/final/input/fkey_map.h @@ -43,23 +43,23 @@ class FKeyMap final public: struct KeyCapMap { - FKey num; - const char* string; - uInt8 length; - char tname[4]; + FKey num{}; + const char* string{}; + uInt8 length{}; + std::array tname{}; }; struct KeyMap { - FKey num; - char string[8]; - uInt8 length; + FKey num{}; + std::array string{}; + uInt8 length{}; }; struct KeyName { - FKey num; - char string[26]; + FKey num{}; + std::array string{}; }; // Using-declaration diff --git a/final/input/fkeyboard.cpp b/final/input/fkeyboard.cpp index 3061c8bc..b6d65923 100644 --- a/final/input/fkeyboard.cpp +++ b/final/input/fkeyboard.cpp @@ -111,7 +111,7 @@ auto FKeyboard::getKeyName (const FKey keynum) const -> FString ); if ( found_key != fkeyname.end() ) - return {found_key->string}; + return {found_key->string.data()}; if ( keynum > 32 && keynum < 127 ) return {char(keynum)}; @@ -120,10 +120,10 @@ auto FKeyboard::getKeyName (const FKey keynum) const -> FString } //---------------------------------------------------------------------- -auto FKeyboard::setNonBlockingInput (bool enable) -> bool +void FKeyboard::setNonBlockingInput (bool enable) { if ( enable == non_blocking_stdin ) - return non_blocking_stdin; + return; if ( enable ) // make stdin non-blocking { @@ -139,8 +139,6 @@ auto FKeyboard::setNonBlockingInput (bool enable) -> bool if ( fcntl (FTermios::getStdIn(), F_SETFL, stdin_status_flags) != -1 ) non_blocking_stdin = false; } - - return non_blocking_stdin; } //---------------------------------------------------------------------- @@ -263,11 +261,11 @@ inline auto FKeyboard::getMouseProtocolKey() const -> FKey return NOT_SET; // x11 mouse tracking - if ( fifo_buf[1] == '[' && fifo_buf[2] == 'M' ) + if ( fifo_buf[2] == 'M' ) return ( buf_len < 6 ) ? FKey::Incomplete : FKey::X11mouse; // SGR mouse tracking - if ( fifo_buf[1] == '[' && fifo_buf[2] == '<' ) + if ( fifo_buf[2] == '<' ) { if ( buf_len < 9 || (fifo_buf[buf_len - 1] != 'M' && fifo_buf[buf_len - 1] != 'm') ) return FKey::Incomplete; // Incomplete mouse sequence @@ -276,7 +274,7 @@ inline auto FKeyboard::getMouseProtocolKey() const -> FKey } // urxvt mouse tracking - if ( fifo_buf[1] == '[' && fifo_buf[2] >= '1' && fifo_buf[2] <= '9' + if ( fifo_buf[2] >= '1' && fifo_buf[2] <= '9' && std::isdigit(fifo_buf[3]) && buf_len >= 9 && fifo_buf[buf_len - 1] == 'M' ) return FKey::Urxvt_mouse; diff --git a/final/input/fkeyboard.h b/final/input/fkeyboard.h index 8363b6ea..0a434bcf 100644 --- a/final/input/fkeyboard.h +++ b/final/input/fkeyboard.h @@ -127,8 +127,8 @@ class FKeyboard final static void setKeypressTimeout (const uInt64) noexcept; static void setReadBlockingTime (const uInt64) noexcept; static void setNonBlockingInputSupport (bool = true) noexcept; - auto setNonBlockingInput (bool = true) -> bool; - auto unsetNonBlockingInput() noexcept -> bool; + void setNonBlockingInput (bool = true); + void unsetNonBlockingInput() noexcept; void enableUTF8() noexcept; void disableUTF8() noexcept; void enableMouseSequences() noexcept; @@ -270,8 +270,8 @@ inline void FKeyboard::setNonBlockingInputSupport (bool enable) noexcept { non_blocking_input_support = enable; } //---------------------------------------------------------------------- -inline auto FKeyboard::unsetNonBlockingInput() noexcept -> bool -{ return setNonBlockingInput(false); } +inline void FKeyboard::unsetNonBlockingInput() noexcept +{ setNonBlockingInput(false); } //---------------------------------------------------------------------- inline auto FKeyboard::hasPendingInput() const noexcept -> bool diff --git a/final/input/fmouse.cpp b/final/input/fmouse.cpp index fecde6c5..2faf9831 100644 --- a/final/input/fmouse.cpp +++ b/final/input/fmouse.cpp @@ -168,6 +168,18 @@ auto FMouseData::isWheelDown() const noexcept -> bool return getButtonState().wheel_down; } +//---------------------------------------------------------------------- +auto FMouseData::isWheelLeft() const noexcept -> bool +{ + return getButtonState().wheel_left; +} + +//---------------------------------------------------------------------- +auto FMouseData::isWheelRight() const noexcept -> bool +{ + return getButtonState().wheel_right; +} + //---------------------------------------------------------------------- auto FMouseData::isMoved() const noexcept -> bool { @@ -185,6 +197,8 @@ void FMouseData::clearButtonState() noexcept b_state.meta_button = false; b_state.wheel_up = false; b_state.wheel_down = false; + b_state.wheel_left = false; + b_state.wheel_right = false; b_state.mouse_moved = false; } @@ -417,6 +431,11 @@ void FMouseGPM::processEvent (const TimeValue&) else if ( gpm_ev.wdy < 0 ) getButtonState().wheel_down = true; + if ( gpm_ev.wdx > 0 ) + getButtonState().wheel_right = true; + else if ( gpm_ev.wdx < 0 ) + getButtonState().wheel_left = true; + switch ( gpm_ev.type & 0x0f ) { case GPM_DOWN: @@ -644,8 +663,8 @@ void FMouseX11::processEvent (const TimeValue& time) setButtonState (btn & button_mask, time); if ( mouse_position == getNewPos() - && ! isWheelUp() - && ! isWheelDown() + && ! isWheelUp() && ! isWheelDown() + && ! isWheelLeft() && ! isWheelRight() && x11_button_state == uChar(btn) ) { clearEvent(); @@ -725,6 +744,16 @@ void FMouseX11::setButtonState (const int btn, const TimeValue& time) noexcept getButtonState().wheel_down = true; break; + case button_left: + resetMousePressedTime(); + getButtonState().wheel_left = true; + break; + + case button_right: + resetMousePressedTime(); + getButtonState().wheel_right = true; + break; + default: break; } @@ -875,8 +904,8 @@ void FMouseSGR::processEvent (const TimeValue& time) setReleasedButtonState (btn & button_mask); if ( mouse_position == getNewPos() - && ! isWheelUp() - && ! isWheelDown() + && ! isWheelUp() && ! isWheelDown() + && ! isWheelLeft() && ! isWheelRight() && sgr_button_state == uChar(((*p & 0x20) << 2) + btn) ) { clearEvent(); @@ -952,6 +981,16 @@ void FMouseSGR::setPressedButtonState ( const int btn getButtonState().wheel_down = true; break; + case button_left: + resetMousePressedTime(); + getButtonState().wheel_left = true; + break; + + case button_right: + resetMousePressedTime(); + getButtonState().wheel_right = true; + break; + default: break; } @@ -1120,8 +1159,8 @@ void FMouseUrxvt::processEvent (const TimeValue& time) setButtonState (btn & button_mask, time); if ( mouse_position == getNewPos() - && ! isWheelUp() - && ! isWheelDown() + && ! isWheelUp() && ! isWheelDown() + && ! isWheelLeft() && ! isWheelRight() && urxvt_button_state == uChar(btn) ) { clearEvent(); @@ -1213,6 +1252,16 @@ void FMouseUrxvt::setButtonState (const int btn, const TimeValue& time) noexcept getButtonState().wheel_down = true; break; + case button_left: + resetMousePressedTime(); + getButtonState().wheel_left = true; + break; + + case button_right: + resetMousePressedTime(); + getButtonState().wheel_right = true; + break; + default: break; } @@ -1462,6 +1511,22 @@ auto FMouseControl::isWheelDown() -> bool return found ? (*iter)->isWheelDown() : false; } +//---------------------------------------------------------------------- +auto FMouseControl::isWheelLeft() -> bool +{ + auto iter = findMouseWithEvent(); + const bool found = (iter != mouse_protocol.end()); + return found ? (*iter)->isWheelLeft() : false; +} + +//---------------------------------------------------------------------- +auto FMouseControl::isWheelRight() -> bool +{ + auto iter = findMouseWithEvent(); + const bool found = (iter != mouse_protocol.end()); + return found ? (*iter)->isWheelRight() : false; +} + //---------------------------------------------------------------------- auto FMouseControl::isMoved() -> bool { diff --git a/final/input/fmouse.h b/final/input/fmouse.h index 3a16785f..dfd2fd78 100644 --- a/final/input/fmouse.h +++ b/final/input/fmouse.h @@ -104,7 +104,7 @@ class FMouseData // Destructor virtual ~FMouseData() noexcept; - // copy assignment operator (=) + // Copy assignment operator (=) auto operator = (const FMouseData&) -> FMouseData& = default; // Move assignment operator (=) @@ -127,6 +127,8 @@ class FMouseData auto isMetaKeyPressed() const noexcept -> bool; auto isWheelUp() const noexcept -> bool; auto isWheelDown() const noexcept -> bool; + auto isWheelLeft() const noexcept -> bool; + auto isWheelRight() const noexcept -> bool; auto isMoved() const noexcept -> bool; // Methods @@ -152,6 +154,8 @@ class FMouseData bool meta_button{}; bool wheel_up{}; bool wheel_down{}; + bool wheel_left{}; + bool wheel_right{}; bool mouse_moved{}; }; @@ -293,7 +297,7 @@ class FMouseGPM final : public FMouse }; // Method - auto gpmEvent (bool = true) const -> gpmEventType; + auto gpmEvent (bool = true) const -> gpmEventType; // Data member Gpm_Event gpm_ev{}; @@ -352,10 +356,10 @@ class FMouseX11 final : public FMouse button2_pressed_move = 0x41, button3_pressed_move = 0x42, button_mask = 0x63, - button_up = 0x60, - button_down = 0x61, - button_up_move = 0x60, - button_down_move = 0x61 + button_up = 0x60, // Mouse wheel scrolls up + button_down = 0x61, // Mouse wheel scrolls down + button_left = 0x62, // Mouse wheel left tilt + button_right = 0x63 // Mouse wheel right tilt }; // Constant @@ -408,9 +412,11 @@ class FMouseSGR final : public FMouse button1_move = 0x20, button2_move = 0x21, button3_move = 0x22, - button_mask = 0x63, - button_up = 0x40, - button_down = 0x41, + button_mask = 0xe3, + button_up = 0x40, // Mouse wheel scrolls up + button_down = 0x41, // Mouse wheel scrolls down + button_left = 0x42, // Mouse wheel left tilt + button_right = 0x43, // Mouse wheel right tilt pressed = 'M', released = 'm' }; @@ -466,11 +472,11 @@ class FMouseUrxvt final : public FMouse button1_pressed_move = 0x40, button2_pressed_move = 0x41, button3_pressed_move = 0x42, - button_mask = 0x63, - button_up = 0x60, - button_down = 0x61, - button_up_move = 0x60, - button_down_move = 0x61 + button_mask = 0xe3, + button_up = 0x60, // Mouse wheel scrolls up + button_down = 0x61, // Mouse wheel scrolls down + button_left = 0x62, // Mouse wheel left tilt + button_right = 0x63 // Mouse wheel right tilt }; // Constant @@ -561,6 +567,8 @@ class FMouseControl auto isMetaKeyPressed() -> bool; auto isWheelUp() -> bool; auto isWheelDown() -> bool; + auto isWheelLeft() -> bool; + auto isWheelRight() -> bool; auto isMoved() -> bool; auto hasUnprocessedInput() const -> bool; auto hasDataInQueue() const -> bool; diff --git a/final/menu/fcheckmenuitem.h b/final/menu/fcheckmenuitem.h index 41038b36..4f42a02e 100644 --- a/final/menu/fcheckmenuitem.h +++ b/final/menu/fcheckmenuitem.h @@ -86,7 +86,10 @@ class FCheckMenuItem : public FMenuItem // FCheckMenuItem inline functions //---------------------------------------------------------------------- inline auto FCheckMenuItem::getClassName() const -> FString -{ return "FCheckMenuItem"; } +{ + auto name = FString(L"FCheckMenuItem"); + return {}; +} } // namespace finalcut diff --git a/final/menu/fdialoglistmenu.cpp b/final/menu/fdialoglistmenu.cpp index 8e8ad735..af066259 100644 --- a/final/menu/fdialoglistmenu.cpp +++ b/final/menu/fdialoglistmenu.cpp @@ -49,8 +49,13 @@ FDialogListMenu::FDialogListMenu (FString&& txt, FWidget* parent) } //---------------------------------------------------------------------- -FDialogListMenu::~FDialogListMenu() noexcept = default; // destructor +FDialogListMenu::~FDialogListMenu() // destructor +{ + auto fapp = FApplication::getApplicationObject(); + if ( fapp ) + fapp->delCallback(this); +} // private methods of FMenu //---------------------------------------------------------------------- diff --git a/final/menu/fdialoglistmenu.h b/final/menu/fdialoglistmenu.h index 488da493..2c1f754f 100644 --- a/final/menu/fdialoglistmenu.h +++ b/final/menu/fdialoglistmenu.h @@ -75,7 +75,7 @@ class FDialogListMenu : public FMenu explicit FDialogListMenu (FString&&, FWidget* = nullptr); // Destructor - ~FDialogListMenu() noexcept override; + ~FDialogListMenu() override; // Accessors auto getClassName() const -> FString override; diff --git a/final/menu/fmenu.cpp b/final/menu/fmenu.cpp index f5c7e770..8e38f693 100644 --- a/final/menu/fmenu.cpp +++ b/final/menu/fmenu.cpp @@ -68,12 +68,12 @@ FMenu::~FMenu() // destructor // public methods of FMenu //---------------------------------------------------------------------- -auto FMenu::setMenuWidget (bool enable) -> bool +void FMenu::setMenuWidget (bool enable) { if ( isMenuWidget() == enable ) - return true; + return; - return (setFlags().type.menu_widget = enable); + setFlags().type.menu_widget = enable; } //---------------------------------------------------------------------- @@ -206,7 +206,7 @@ void FMenu::onMouseDown (FMouseEvent* ev) redraw(); // Open the sub menu to be opened - openSubMenu(shown_sub_menu); + openSubMenu (shown_sub_menu); } //---------------------------------------------------------------------- diff --git a/final/menu/fmenu.h b/final/menu/fmenu.h index dc7e9f50..e6f1e22c 100644 --- a/final/menu/fmenu.h +++ b/final/menu/fmenu.h @@ -105,13 +105,13 @@ class FMenu : public FWindow auto getItem() -> FMenuItem*; // Mutators - auto setEnable (bool = true) -> bool override; - auto unsetEnable() -> bool override; - auto setDisable() -> bool override; + void setEnable (bool = true) override; + void unsetEnable() override; + void setDisable() override; void setSelected(); void unsetSelected(); - auto setMenuWidget (bool = true) -> bool; - auto unsetMenuWidget() -> bool; + void setMenuWidget (bool = true); + void unsetMenuWidget(); void setStatusbarMessage (const FString&) override; void setMenu (FMenu*); void setText (const FString&); @@ -270,16 +270,16 @@ inline auto FMenu::getItem() -> FMenuItem* { return &menuitem; } //---------------------------------------------------------------------- -inline auto FMenu::setEnable (bool enable) -> bool -{ return menuitem.setEnable(enable); } +inline void FMenu::setEnable (bool enable) +{ menuitem.setEnable(enable); } //---------------------------------------------------------------------- -inline auto FMenu::unsetEnable() -> bool -{ return menuitem.unsetEnable(); } +inline void FMenu::unsetEnable() +{ menuitem.unsetEnable(); } //---------------------------------------------------------------------- -inline auto FMenu::setDisable() -> bool -{ return menuitem.setDisable(); } +inline void FMenu::setDisable() +{ menuitem.setDisable(); } //---------------------------------------------------------------------- inline void FMenu::setSelected() @@ -290,8 +290,8 @@ inline void FMenu::unsetSelected() { menuitem.unsetSelected(); } //---------------------------------------------------------------------- -inline auto FMenu::unsetMenuWidget() -> bool -{ return setMenuWidget(false); } +inline void FMenu::unsetMenuWidget() +{ setMenuWidget(false); } //---------------------------------------------------------------------- inline void FMenu::setMenu (FMenu* m) diff --git a/final/menu/fmenuitem.cpp b/final/menu/fmenuitem.cpp index 8fdb43fd..85702c5e 100644 --- a/final/menu/fmenuitem.cpp +++ b/final/menu/fmenuitem.cpp @@ -86,7 +86,7 @@ FMenuItem::~FMenuItem() // destructor // public methods of FMenuItem //---------------------------------------------------------------------- -auto FMenuItem::setEnable (bool enable) -> bool +void FMenuItem::setEnable (bool enable) { FWidget::setEnable(enable); auto super = getSuperMenu(); @@ -105,8 +105,6 @@ auto FMenuItem::setEnable (bool enable) -> bool if ( super && isMenuBar(super) ) super->delAccelerator (this); } - - return enable; } //---------------------------------------------------------------------- @@ -218,13 +216,10 @@ void FMenuItem::onKeyPress (FKeyEvent* ev) { auto mbar = static_cast(super_menu); - if ( mbar ) - { - if ( mbar->hotkeyMenu(ev) ) - return; + if ( mbar->hotkeyMenu(ev) ) + return; - mbar->onKeyPress(ev); - } + mbar->onKeyPress(ev); } } @@ -710,7 +705,7 @@ void FMenuItem::cb_switchToDialog (FDialog* win) const //---------------------------------------------------------------------- void FMenuItem::cb_destroyDialog (FDialog* win) { - const auto& fapp = FApplication::getApplicationObject(); + const auto* fapp = FApplication::getApplicationObject(); if ( ! win || ! fapp ) return; diff --git a/final/menu/fmenuitem.h b/final/menu/fmenuitem.h index 58c66289..9b533204 100644 --- a/final/menu/fmenuitem.h +++ b/final/menu/fmenuitem.h @@ -101,7 +101,7 @@ class FMenuItem : public FWidget auto getText() const -> FString; // Mutators - auto setEnable (bool = true) -> bool override; + void setEnable (bool = true) override; void setSelected(); void unsetSelected(); void setSeparator(); diff --git a/final/output/tty/fcharmap.cpp b/final/output/tty/fcharmap.cpp index 9a0b486a..f5f074c8 100644 --- a/final/output/tty/fcharmap.cpp +++ b/final/output/tty/fcharmap.cpp @@ -49,7 +49,7 @@ auto FCharMap::getCharacter ( const CharEncodeMap& char_enc auto FCharMap::setCharacter ( CharEncodeMap& char_enc , const Encoding& enc ) -> wchar_t& { - const auto array = reinterpret_cast(&char_enc); + auto* array = reinterpret_cast(&char_enc); return array[std::size_t(enc)]; } diff --git a/final/output/tty/foptiattr.cpp b/final/output/tty/foptiattr.cpp index cb6f64eb..3cc50c91 100644 --- a/final/output/tty/foptiattr.cpp +++ b/final/output/tty/foptiattr.cpp @@ -939,46 +939,14 @@ auto FOptiAttr::setTermDefaultColor (FChar& term) -> bool //---------------------------------------------------------------------- void FOptiAttr::setAttributesOn (FChar& term) { - static const AttributeHandlers attribute_on_handlers - {{ - { {{0x00, 0x08, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermAltCharset(fchar); } }, - { {{0x00, 0x10, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermPCcharset(fchar); } }, - { {{0x01, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermBold(fchar); } }, - { {{0x02, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermDim(fchar); } }, - { {{0x04, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermItalic(fchar); } }, - { {{0x08, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermUnderline(fchar); } }, - { {{0x10, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermBlink(fchar); } }, - { {{0x20, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermReverse(fchar); } }, - { {{0x40, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermStandout(fchar); } }, - { {{0x80, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermInvisible(fchar); } }, - { {{0x00, 0x01, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermProtected(fchar); } }, - { {{0x00, 0x02, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermCrossedOut(fchar); } }, - { {{0x00, 0x04, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermDoubleUnderline(fchar); } } - }}; - + static const auto& attribute_on_handlers = getAttributeOnHandlers(); setAttributes (on.attr, attribute_on_handlers, term); } //---------------------------------------------------------------------- void FOptiAttr::setAttributesOff (FChar& term) { - static const AttributeHandlers attribute_off_handlers - {{ - { {{0x00, 0x10, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermPCcharset(fchar); } }, - { {{0x00, 0x08, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermAltCharset(fchar); } }, - { {{0x01, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermBold(fchar); } }, - { {{0x02, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermDim(fchar); } }, - { {{0x04, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermItalic(fchar); } }, - { {{0x08, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermUnderline(fchar); } }, - { {{0x10, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermBlink(fchar); } }, - { {{0x20, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermReverse(fchar); } }, - { {{0x40, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermStandout(fchar); } }, - { {{0x80, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermInvisible(fchar); } }, - { {{0x00, 0x01, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermProtected(fchar); } }, - { {{0x00, 0x02, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermCrossedOut(fchar); } }, - { {{0x00, 0x04, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermDoubleUnderline(fchar); } } - }}; - + static const auto& attribute_off_handlers = getAttributeOffHandlers(); setAttributes (off.attr, attribute_off_handlers, term); } @@ -1392,46 +1360,98 @@ inline auto FOptiAttr::hasCharsetEquivalence() const -> bool return false; } +//---------------------------------------------------------------------- +auto FOptiAttr::getAttributeOnHandlers() -> const AttributeHandlers& +{ + static const auto& attribute_on_handlers = std::make_unique + ( + AttributeHandlers + {{ + { {{0x00, 0x08, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermAltCharset(fchar); } }, + { {{0x00, 0x10, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermPCcharset(fchar); } }, + { {{0x01, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermBold(fchar); } }, + { {{0x02, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermDim(fchar); } }, + { {{0x04, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermItalic(fchar); } }, + { {{0x08, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermUnderline(fchar); } }, + { {{0x10, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermBlink(fchar); } }, + { {{0x20, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermReverse(fchar); } }, + { {{0x40, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermStandout(fchar); } }, + { {{0x80, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermInvisible(fchar); } }, + { {{0x00, 0x01, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermProtected(fchar); } }, + { {{0x00, 0x02, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermCrossedOut(fchar); } }, + { {{0x00, 0x04, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->setTermDoubleUnderline(fchar); } } + }} + ); + + return *attribute_on_handlers; +} + +//---------------------------------------------------------------------- +auto FOptiAttr::getAttributeOffHandlers() -> const AttributeHandlers& +{ + static const auto& attribute_off_handlers = std::make_unique + ( + AttributeHandlers + {{ + { {{0x00, 0x10, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermPCcharset(fchar); } }, + { {{0x00, 0x08, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermAltCharset(fchar); } }, + { {{0x01, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermBold(fchar); } }, + { {{0x02, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermDim(fchar); } }, + { {{0x04, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermItalic(fchar); } }, + { {{0x08, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermUnderline(fchar); } }, + { {{0x10, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermBlink(fchar); } }, + { {{0x20, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermReverse(fchar); } }, + { {{0x40, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermStandout(fchar); } }, + { {{0x80, 0x00, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermInvisible(fchar); } }, + { {{0x00, 0x01, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermProtected(fchar); } }, + { {{0x00, 0x02, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermCrossedOut(fchar); } }, + { {{0x00, 0x04, 0x00, 0x00}}, [] (FOptiAttr* obj, FChar& fchar) { return obj->unsetTermDoubleUnderline(fchar); } } + }} + ); + + return *attribute_off_handlers; +} + //---------------------------------------------------------------------- auto FOptiAttr::getByte0ReverseMask() -> uInt8 { - FAttribute mask{}; - mask.bit.reverse = true; - mask.bit.standout = true; - return mask.byte[0]; + FCharAttribute mask{}; + mask.reverse = true; + mask.standout = true; + return getFAttributeByte(mask, 0); } //---------------------------------------------------------------------- auto FOptiAttr::getByte1Mask() -> uInt8 { - FAttribute mask{}; - mask.bit.protect = true; - mask.bit.crossed_out = true; - mask.bit.dbl_underline = true; - mask.bit.alt_charset = true; - mask.bit.pc_charset = true; - return mask.byte[1]; + FCharAttribute mask{}; + mask.protect = true; + mask.crossed_out = true; + mask.dbl_underline = true; + mask.alt_charset = true; + mask.pc_charset = true; + return getFAttributeByte(mask, 1); } //---------------------------------------------------------------------- auto FOptiAttr::getByte1ResetMask() -> uInt8 { // Set bits that must not be reset - FAttribute mask{}; - mask.bit.transparent = true; - mask.bit.color_overlay = true; - mask.bit.inherit_background = true; - return mask.byte[1]; + FCharAttribute mask{}; + mask.transparent = true; + mask.color_overlay = true; + mask.inherit_background = true; + return getFAttributeByte(mask, 1); } //---------------------------------------------------------------------- auto FOptiAttr::getByte2ResetMask() -> uInt8 { // Set bits that must not be reset - FAttribute mask{}; - mask.bit.no_changes = true; - mask.bit.printed = true; - return mask.byte[2]; + FCharAttribute mask{}; + mask.no_changes = true; + mask.printed = true; + return getFAttributeByte(mask, 2); } //---------------------------------------------------------------------- diff --git a/final/output/tty/foptiattr.h b/final/output/tty/foptiattr.h index 4fdbfe7e..68bcbe66 100644 --- a/final/output/tty/foptiattr.h +++ b/final/output/tty/foptiattr.h @@ -258,6 +258,8 @@ class FOptiAttr final void reset (FChar&) const; auto caused_reset_attributes (const char[], uChar = all_tests) const -> bool; auto hasCharsetEquivalence() const -> bool; + static auto getAttributeOnHandlers() -> const AttributeHandlers&; + static auto getAttributeOffHandlers() -> const AttributeHandlers&; static auto getByte0ReverseMask() -> uInt8; static auto getByte1Mask() -> uInt8; static auto getByte1ResetMask() -> uInt8; diff --git a/final/output/tty/fterm.cpp b/final/output/tty/fterm.cpp index ee15eff1..a64023c1 100644 --- a/final/output/tty/fterm.cpp +++ b/final/output/tty/fterm.cpp @@ -307,20 +307,18 @@ void FTerm::useAlternateScreen (bool enable) } //---------------------------------------------------------------------- -auto FTerm::setUTF8 (bool enable) -> bool // UTF-8 (Unicode) +void FTerm::setUTF8 (bool enable) // UTF-8 (Unicode) { static auto& data = FTermData::getInstance(); if ( data.isUTF8() == enable ) - return enable; + return; data.setUTF8(enable); #if defined(__linux__) FTermLinux::getInstance().setUTF8 (enable); #endif - - return data.isUTF8(); } //---------------------------------------------------------------------- diff --git a/final/output/tty/fterm.h b/final/output/tty/fterm.h index 245ec005..7b636e41 100644 --- a/final/output/tty/fterm.h +++ b/final/output/tty/fterm.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2012-2022 Markus Gans * +* Copyright 2012-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -198,8 +198,8 @@ class FTerm final static void redefineDefaultColors (bool = true); static void setDblclickInterval (const uInt64); static void useAlternateScreen (bool = true); - static auto setUTF8 (bool = true) -> bool; - static auto unsetUTF8() -> bool; + static void setUTF8 (bool = true); + static void unsetUTF8(); // Methods static auto setVGAFont() -> bool; @@ -229,8 +229,8 @@ class FTerm final static auto scrollTermForward() -> bool; static auto scrollTermReverse() -> bool; - template - static void paddingPrintf (const std::string&, Args&&...); + template + static void paddingPrintf (StringT&&, Args&&...); static void paddingPrint (const std::string&, int = 1); static void stringPrint (const std::string&); @@ -308,25 +308,30 @@ inline void FTerm::setFSystem (std::unique_ptr& fsystem) //---------------------------------------------------------------------- inline void FTerm::unsetInsertCursor() -{ return setInsertCursor(false); } +{ setInsertCursor(false); } //---------------------------------------------------------------------- -inline auto FTerm::unsetUTF8() -> bool -{ return setUTF8(false); } +inline void FTerm::unsetUTF8() +{ setUTF8(false); } //---------------------------------------------------------------------- -template -inline void FTerm::paddingPrintf (const std::string& format, Args&&... args) +template +inline void FTerm::paddingPrintf (StringT&& format, Args&&... args) { - const int size = std::snprintf (nullptr, 0, format.data(), args...) + 1; + const int size = std::snprintf (nullptr, 0, format, args...); if ( size <= 0 ) return; - const auto count = std::size_t(size); - std::vector buf(count); - std::snprintf (&buf[0], count, format.data(), std::forward(args)...); - paddingPrint (std::string(&buf[0]), 1); + std::string buffer{}; + auto buffer_size = std::size_t(size + 1); + buffer.resize(buffer_size); + std::snprintf ( &*buffer.begin(), buffer_size + , std::forward(format) + , std::forward(args)... ); + buffer_size--; + buffer.resize(buffer_size); + paddingPrint (buffer, 1); } //---------------------------------------------------------------------- diff --git a/final/output/tty/fterm_functions.cpp b/final/output/tty/fterm_functions.cpp index eb063b6c..86bf137b 100644 --- a/final/output/tty/fterm_functions.cpp +++ b/final/output/tty/fterm_functions.cpp @@ -667,7 +667,8 @@ auto getCharLength (const FString& string, std::size_t pos) -> int if ( pos >= string.getLength() ) return -1; - const auto begin = std::next(string.cbegin(), pos); + using distance_type = FString::difference_type; + const auto begin = std::next(string.cbegin(), distance_type(pos)); if ( isWhitespace(*begin) ) return 1; diff --git a/final/output/tty/ftermcap.cpp b/final/output/tty/ftermcap.cpp index ad984ac4..97f5bf38 100644 --- a/final/output/tty/ftermcap.cpp +++ b/final/output/tty/ftermcap.cpp @@ -125,7 +125,7 @@ inline auto getKeyEntry (FKey key) -> FKeyMap::KeyCapMap* inline void del2ndKeyIfDuplicate ( const FKeyMap::KeyCapMap* first , FKeyMap::KeyCapMap* second ) { - if ( ! first || ! second ) + if ( ! first || ! first->string || ! second || ! second->string ) return; auto len = std::min(first->length, second->length); @@ -450,7 +450,7 @@ void FTermcap::termcapStrings() // Read termcap output strings for (auto&& entry : strings) - entry.string = getString(entry.tname); + entry.string = getString(entry.tname.data()); const auto& ho = TCAP(t_cursor_home); @@ -476,7 +476,7 @@ void FTermcap::termcapKeys() if ( entry.string != nullptr ) // String is already set break; - entry.string = getString(entry.tname); + entry.string = getString(entry.tname.data()); entry.length = entry.string ? uInt8(finalcut::stringLength(entry.string)) : 0; } @@ -598,93 +598,93 @@ FTermcap::TCapMapType FTermcap::strings = // | .-------- Tcap-code // | | // variable name -> description //------------------------------------------------------------------------------ - { nullptr, "bl" }, // bell -> audible signal (bell) (P) - { nullptr, "vb" }, // flash_screen -> visible bell (may not move cursor) - { nullptr, "ec" }, // erase_chars -> erase #1 characters (P) - { nullptr, "cl" }, // clear_screen -> clear screen and home cursor (P*) - { nullptr, "cd" }, // clr_eos -> clear to end of screen (P*) - { nullptr, "ce" }, // clr_eol -> clear to end of line (P) - { nullptr, "cb" }, // clr_bol -> Clear to beginning of line - { nullptr, "ho" }, // cursor_home -> home cursor (if no cup) - { nullptr, "ll" }, // cursor_to_ll -> last line, first column (if no cup) - { nullptr, "cr" }, // carriage_return -> carriage return (P*) - { nullptr, "ta" }, // tab -> tab to next 8-space hardware tab stop - { nullptr, "bt" }, // back_tab -> back tab (P) - { nullptr, "pc" }, // pad_char -> padding char (instead of null) - { nullptr, "ip" }, // insert_padding -> insert padding after inserted character - { nullptr, "ic" }, // insert_character -> insert character (P) - { nullptr, "IC" }, // parm_ich -> insert #1 characters (P*) - { nullptr, "rp" }, // repeat_char -> repeat char #1 #2 times (P*) - { nullptr, "Ic" }, // initialize_color -> initialize color #1 to (#2,#3,#4) - { nullptr, "Ip" }, // initialize_pair -> Initialize color pair #1 to - // fg=(#2,#3,#4), bg=(#5,#6,#7) - { nullptr, "AF" }, // set_a_foreground -> Set ANSI background color to #1 - { nullptr, "AB" }, // set_a_background -> Set ANSI background color to #1 - { nullptr, "Sf" }, // set_foreground -> Set foreground color #1 - { nullptr, "Sb" }, // set_background -> Set background color #1 - { nullptr, "sp" }, // set_color_pair -> Set current color pair to #1 - { nullptr, "op" }, // orig_pair -> Set default pair to original value - { nullptr, "oc" }, // orig_colors -> Set all color pairs to the original - { nullptr, "NC" }, // no_color_video -> video attributes that cannot be used - // with colors - { nullptr, "cm" }, // cursor_address -> move to row #1 columns #2 - { nullptr, "ch" }, // column_address -> horizontal position #1, absolute (P) - { nullptr, "cv" }, // row_address -> vertical position #1 absolute (P) - { nullptr, "vs" }, // cursor_visible -> make cursor very visible - { nullptr, "vi" }, // cursor_invisible -> make cursor invisible - { nullptr, "ve" }, // cursor_normal -> make cursor appear normal (undo vi/vs) - { nullptr, "up" }, // cursor_up -> up one line - { nullptr, "do" }, // cursor_down -> down one line - { nullptr, "le" }, // cursor_left -> move left one space - { nullptr, "nd" }, // cursor_right -> non-destructive space (move right) - { nullptr, "UP" }, // parm_up_cursor -> up #1 lines (P*) - { nullptr, "DO" }, // parm_down_cursor -> down #1 lines (P*) - { nullptr, "LE" }, // parm_left_cursor -> move #1 characters to the left (P) - { nullptr, "RI" }, // parm_right_cursor -> move #1 characters to the right (P*) - { nullptr, "sc" }, // save_cursor -> save current cursor position (P) - { nullptr, "rc" }, // restore_cursor -> restore cursor to save_cursor - { nullptr, "Ss" }, // set cursor style -> Select the DECSCUSR cursor style - { nullptr, "sf" }, // scroll_forward -> scroll text up (P) - { nullptr, "sr" }, // scroll_reverse -> scroll text down (P) - { nullptr, "ti" }, // enter_ca_mode -> string to start programs using cup - { nullptr, "te" }, // exit_ca_mode -> strings to end programs using cup - { nullptr, "eA" }, // enable_acs -> enable alternate char set - { nullptr, "md" }, // enter_bold_mode -> turn on bold (double-bright) mode - { nullptr, "me" }, // exit_bold_mode -> turn off bold mode - { nullptr, "mh" }, // enter_dim_mode -> turn on half-bright - { nullptr, "me" }, // exit_dim_mode -> turn off half-bright - { nullptr, "ZH" }, // enter_italics_mode -> Enter italic mode - { nullptr, "ZR" }, // exit_italics_mode -> End italic mode - { nullptr, "us" }, // enter_underline_mode -> begin underline mode - { nullptr, "ue" }, // exit_underline_mode -> exit underline mode - { nullptr, "mb" }, // enter_blink_mode -> turn on blinking - { nullptr, "me" }, // exit_blink_mode -> turn off blinking - { nullptr, "mr" }, // enter_reverse_mode -> turn on reverse video mode - { nullptr, "me" }, // exit_reverse_mode -> turn off reverse video mode - { nullptr, "so" }, // enter_standout_mode -> begin standout mode - { nullptr, "se" }, // exit_standout_mode -> exit standout mode - { nullptr, "mk" }, // enter_secure_mode -> turn on blank mode (characters invisible) - { nullptr, "me" }, // exit_secure_mode -> turn off blank mode (characters visible) - { nullptr, "mp" }, // enter_protected_mode -> turn on protected mode - { nullptr, "me" }, // exit_protected_mode -> turn off protected mode - { nullptr, "XX" }, // enter_crossed_out_mode -> turn on mark character as deleted - { nullptr, "me" }, // exit_crossed_out_mode -> turn off mark character as deleted - { nullptr, "Us" }, // enter_dbl_underline_mode -> begin double underline mode - { nullptr, "Ue" }, // exit_dbl_underline_mode -> exit double underline mode - { nullptr, "sa" }, // set_attributes -> define videoattributes #1-#9 (PG9) - { nullptr, "me" }, // exit_attribute_mode -> turn off all attributes - { nullptr, "as" }, // enter_alt_charset_mode -> start alternate character set (P) - { nullptr, "ae" }, // exit_alt_charset_mode -> end alternate character set (P) - { nullptr, "S2" }, // enter_pc_charset_mode -> Enter PC character display mode - { nullptr, "S3" }, // exit_pc_charset_mode -> Exit PC character display mode - { nullptr, "im" }, // enter_insert_mode -> enter insert mode - { nullptr, "ei" }, // exit_insert_mode -> exit insert mode - { nullptr, "SA" }, // enter_am_mode -> turn on automatic margins - { nullptr, "RA" }, // exit_am_mode -> turn off automatic margins - { nullptr, "ac" }, // acs_chars -> graphics charset pairs (vt100) - { nullptr, "ks" }, // keypad_xmit -> enter 'key-board_transmit' mode - { nullptr, "ke" }, // keypad_local -> leave 'key-board_transmit' mode - { nullptr, "Km" } // key_mouse -> Mouse event has occurred + { nullptr, {"bl"} }, // bell -> audible signal (bell) (P) + { nullptr, {"vb"} }, // flash_screen -> visible bell (may not move cursor) + { nullptr, {"ec"} }, // erase_chars -> erase #1 characters (P) + { nullptr, {"cl"} }, // clear_screen -> clear screen and home cursor (P*) + { nullptr, {"cd"} }, // clr_eos -> clear to end of screen (P*) + { nullptr, {"ce"} }, // clr_eol -> clear to end of line (P) + { nullptr, {"cb"} }, // clr_bol -> Clear to beginning of line + { nullptr, {"ho"} }, // cursor_home -> home cursor (if no cup) + { nullptr, {"ll"} }, // cursor_to_ll -> last line, first column (if no cup) + { nullptr, {"cr"} }, // carriage_return -> carriage return (P*) + { nullptr, {"ta"} }, // tab -> tab to next 8-space hardware tab stop + { nullptr, {"bt"} }, // back_tab -> back tab (P) + { nullptr, {"pc"} }, // pad_char -> padding char (instead of null) + { nullptr, {"ip"} }, // insert_padding -> insert padding after inserted character + { nullptr, {"ic"} }, // insert_character -> insert character (P) + { nullptr, {"IC"} }, // parm_ich -> insert #1 characters (P*) + { nullptr, {"rp"} }, // repeat_char -> repeat char #1 #2 times (P*) + { nullptr, {"Ic"} }, // initialize_color -> initialize color #1 to (#2,#3,#4) + { nullptr, {"Ip"} }, // initialize_pair -> Initialize color pair #1 to + // fg=(#2,#3,#4), bg=(#5,#6,#7) + { nullptr, {"AF"} }, // set_a_foreground -> Set ANSI background color to #1 + { nullptr, {"AB"} }, // set_a_background -> Set ANSI background color to #1 + { nullptr, {"Sf"} }, // set_foreground -> Set foreground color #1 + { nullptr, {"Sb"} }, // set_background -> Set background color #1 + { nullptr, {"sp"} }, // set_color_pair -> Set current color pair to #1 + { nullptr, {"op"} }, // orig_pair -> Set default pair to original value + { nullptr, {"oc"} }, // orig_colors -> Set all color pairs to the original + { nullptr, {"NC"} }, // no_color_video -> video attributes that cannot be used + // with colors + { nullptr, {"cm"} }, // cursor_address -> move to row #1 columns #2 + { nullptr, {"ch"} }, // column_address -> horizontal position #1, absolute (P) + { nullptr, {"cv"} }, // row_address -> vertical position #1 absolute (P) + { nullptr, {"vs"} }, // cursor_visible -> make cursor very visible + { nullptr, {"vi"} }, // cursor_invisible -> make cursor invisible + { nullptr, {"ve"} }, // cursor_normal -> make cursor appear normal (undo vi/vs) + { nullptr, {"up"} }, // cursor_up -> up one line + { nullptr, {"do"} }, // cursor_down -> down one line + { nullptr, {"le"} }, // cursor_left -> move left one space + { nullptr, {"nd"} }, // cursor_right -> non-destructive space (move right) + { nullptr, {"UP"} }, // parm_up_cursor -> up #1 lines (P*) + { nullptr, {"DO"} }, // parm_down_cursor -> down #1 lines (P*) + { nullptr, {"LE"} }, // parm_left_cursor -> move #1 characters to the left (P) + { nullptr, {"RI"} }, // parm_right_cursor -> move #1 characters to the right (P*) + { nullptr, {"sc"} }, // save_cursor -> save current cursor position (P) + { nullptr, {"rc"} }, // restore_cursor -> restore cursor to save_cursor + { nullptr, {"Ss"} }, // set cursor style -> Select the DECSCUSR cursor style + { nullptr, {"sf"} }, // scroll_forward -> scroll text up (P) + { nullptr, {"sr"} }, // scroll_reverse -> scroll text down (P) + { nullptr, {"ti"} }, // enter_ca_mode -> string to start programs using cup + { nullptr, {"te"} }, // exit_ca_mode -> strings to end programs using cup + { nullptr, {"eA"} }, // enable_acs -> enable alternate char set + { nullptr, {"md"} }, // enter_bold_mode -> turn on bold (double-bright) mode + { nullptr, {"me"} }, // exit_bold_mode -> turn off bold mode + { nullptr, {"mh"} }, // enter_dim_mode -> turn on half-bright + { nullptr, {"me"} }, // exit_dim_mode -> turn off half-bright + { nullptr, {"ZH"} }, // enter_italics_mode -> Enter italic mode + { nullptr, {"ZR"} }, // exit_italics_mode -> End italic mode + { nullptr, {"us"} }, // enter_underline_mode -> begin underline mode + { nullptr, {"ue"} }, // exit_underline_mode -> exit underline mode + { nullptr, {"mb"} }, // enter_blink_mode -> turn on blinking + { nullptr, {"me"} }, // exit_blink_mode -> turn off blinking + { nullptr, {"mr"} }, // enter_reverse_mode -> turn on reverse video mode + { nullptr, {"me"} }, // exit_reverse_mode -> turn off reverse video mode + { nullptr, {"so"} }, // enter_standout_mode -> begin standout mode + { nullptr, {"se"} }, // exit_standout_mode -> exit standout mode + { nullptr, {"mk"} }, // enter_secure_mode -> turn on blank mode (characters invisible) + { nullptr, {"me"} }, // exit_secure_mode -> turn off blank mode (characters visible) + { nullptr, {"mp"} }, // enter_protected_mode -> turn on protected mode + { nullptr, {"me"} }, // exit_protected_mode -> turn off protected mode + { nullptr, {"XX"} }, // enter_crossed_out_mode -> turn on mark character as deleted + { nullptr, {"me"} }, // exit_crossed_out_mode -> turn off mark character as deleted + { nullptr, {"Us"} }, // enter_dbl_underline_mode -> begin double underline mode + { nullptr, {"Ue"} }, // exit_dbl_underline_mode -> exit double underline mode + { nullptr, {"sa"} }, // set_attributes -> define videoattributes #1-#9 (PG9) + { nullptr, {"me"} }, // exit_attribute_mode -> turn off all attributes + { nullptr, {"as"} }, // enter_alt_charset_mode -> start alternate character set (P) + { nullptr, {"ae"} }, // exit_alt_charset_mode -> end alternate character set (P) + { nullptr, {"S2"} }, // enter_pc_charset_mode -> Enter PC character display mode + { nullptr, {"S3"} }, // exit_pc_charset_mode -> Exit PC character display mode + { nullptr, {"im"} }, // enter_insert_mode -> enter insert mode + { nullptr, {"ei"} }, // exit_insert_mode -> exit insert mode + { nullptr, {"SA"} }, // enter_am_mode -> turn on automatic margins + { nullptr, {"RA"} }, // exit_am_mode -> turn off automatic margins + { nullptr, {"ac"} }, // acs_chars -> graphics charset pairs (vt100) + { nullptr, {"ks"} }, // keypad_xmit -> enter 'key-board_transmit' mode + { nullptr, {"ke"} }, // keypad_local -> leave 'key-board_transmit' mode + { nullptr, {"Km"} } // key_mouse -> Mouse event has occurred }}; /* diff --git a/final/output/tty/ftermcap.h b/final/output/tty/ftermcap.h index 2424a013..7749eefc 100644 --- a/final/output/tty/ftermcap.h +++ b/final/output/tty/ftermcap.h @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -71,13 +72,13 @@ class FTermcap final struct TCapMap { const char* string; - char tname[tname_size]; + std::array tname; }; // Using-declaration using TCapMapType = std::array; - using PutCharFunc = int (*)(int); - using PutStringFunc = int (*)(const std::string&); + using PutCharFunc = std::decay_t; + using PutStringFunc = std::decay_t; // Constructors FTermcap() = default; diff --git a/final/output/tty/ftermcapquirks.cpp b/final/output/tty/ftermcapquirks.cpp index 9e1ec279..4e82dcde 100644 --- a/final/output/tty/ftermcapquirks.cpp +++ b/final/output/tty/ftermcapquirks.cpp @@ -383,15 +383,15 @@ void FTermcapQuirks::sunConsole() {"KP4", CSI "253z"}, // keypad plus sign }; - for (std::size_t i{0}; fkey_cap_table[i].tname[0] != 0; i++) + for (std::size_t i{0}; i < fkey_cap_table.size(); i++) { for (const auto& key : sun_console_keys) { const std::string& tname = key.first; const std::string& string = key.second; - if ( std::memcmp(fkey_cap_table[i].tname, tname.c_str(), tname.size()) == 0 - && stringLength(fkey_cap_table[i].tname) == tname.size() ) + if ( std::memcmp(fkey_cap_table[i].tname.data(), tname.c_str(), tname.size()) == 0 + && stringLength(fkey_cap_table[i].tname.data()) == tname.size() ) { fkey_cap_table[i].string = string.c_str(); } diff --git a/final/output/tty/ftermdetection.cpp b/final/output/tty/ftermdetection.cpp index 423270d4..71c2bbc1 100644 --- a/final/output/tty/ftermdetection.cpp +++ b/final/output/tty/ftermdetection.cpp @@ -159,15 +159,15 @@ auto FTermDetection::getTTYtype() -> bool else term_basename++; - std::FILE* fp{}; + std::FILE* file_ptr{}; std::array str{}; static const auto& fsystem = FSystem::getInstance(); - if ( (fp = fsystem->fopen(ttytypename.c_str(), "r")) == nullptr ) + if ( (file_ptr = fsystem->fopen(ttytypename.c_str(), "r")) == nullptr ) return false; // Read and parse the file - while ( fgets(str.data(), str.size() - 1, fp) != nullptr ) + while ( fgets(str.data(), str.size() - 1, file_ptr) != nullptr ) { const char* type{nullptr}; // nullptr == not found const char* name{nullptr}; @@ -189,12 +189,12 @@ auto FTermDetection::getTTYtype() -> bool { // Save name in termtype termtype = type; - fsystem->fclose(fp); + fsystem->fclose(file_ptr); return true; } } - fsystem->fclose(fp); + fsystem->fclose(file_ptr); return false; } @@ -559,10 +559,12 @@ auto FTermDetection::parseAnswerbackMsg (const FString& current_termtype) -> FSt new_termtype = "putty"; } +#if !defined(UNIT_TEST) // Some terminals like cygwin or the Windows terminal // have to delete the printed character '♣' std::fprintf (stdout, "\r " BS); std::fflush (stdout); +#endif // !defined(UNIT_TEST) #if DEBUG if ( ! new_termtype.isEmpty() ) diff --git a/final/output/tty/ftermios.cpp b/final/output/tty/ftermios.cpp index 694db78c..484908e5 100644 --- a/final/output/tty/ftermios.cpp +++ b/final/output/tty/ftermios.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2018-2022 Markus Gans * +* Copyright 2018-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -21,17 +21,15 @@ ***********************************************************************/ #if defined(__CYGWIN__) - #undef __STRICT_ANSI__ // need for fileno #define _POSIX_C_SOURCE 200809L #define _BSD_SOURCE + #ifndef __STRICT_ANSI__ + #define __STRICT_ANSI__ // need for bits/c++config.h + #endif #endif #include -#if defined(__CYGWIN__) - #define __STRICT_ANSI__ // need for bits/c++config.h -#endif - #include #include @@ -174,11 +172,11 @@ void FTermios::unsetCaptureSendCharacters() } //---------------------------------------------------------------------- -auto FTermios::setRawMode (bool enable) -> bool +void FTermios::setRawMode (bool enable) { // set + unset flags for raw mode if ( raw_mode == enable ) - return raw_mode; + return; // Info under: man 3 termios struct termios t{}; @@ -217,8 +215,6 @@ auto FTermios::setRawMode (bool enable) -> bool setTTY (t); raw_mode = false; } - - return raw_mode; } //---------------------------------------------------------------------- diff --git a/final/output/tty/ftermios.h b/final/output/tty/ftermios.h index 6f136a11..4eae0006 100644 --- a/final/output/tty/ftermios.h +++ b/final/output/tty/ftermios.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2018-2022 Markus Gans * +* Copyright 2018-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -73,9 +73,9 @@ class FTermios final static void unsetHardwareEcho(); static void setCaptureSendCharacters(); static void unsetCaptureSendCharacters(); - static auto setRawMode (bool = true) -> bool; - static auto unsetRawMode() -> bool; - static auto setCookedMode() -> bool; + static void setRawMode (bool = true); + static void unsetRawMode(); + static void setCookedMode(); static auto getBaudRate() -> uInt; private: @@ -110,12 +110,12 @@ inline auto FTermios::isRaw() noexcept -> bool { return raw_mode; } //---------------------------------------------------------------------- -inline auto FTermios::unsetRawMode() -> bool -{ return setRawMode(false); } +inline void FTermios::unsetRawMode() +{ setRawMode(false); } //---------------------------------------------------------------------- -inline auto FTermios::setCookedMode() -> bool -{ return setRawMode(false); } +inline void FTermios::setCookedMode() +{ setRawMode(false); } } // namespace finalcut diff --git a/final/output/tty/sgr_optimizer.cpp b/final/output/tty/sgr_optimizer.cpp index 184fefdf..46fc957a 100644 --- a/final/output/tty/sgr_optimizer.cpp +++ b/final/output/tty/sgr_optimizer.cpp @@ -130,7 +130,7 @@ void SGRoptimizer::combineParameter() // Copy SGR parameter values std::size_t param_size = iter->end - iter->start; - std::memcpy(&seq[write_pos], &seq[iter->start], param_size); + std::memmove(&seq[write_pos], &seq[iter->start], param_size); write_pos += param_size; read_pos = iter->end + 1; @@ -142,7 +142,7 @@ void SGRoptimizer::combineParameter() } // Copy remaining characters in the sequence - std::memcpy(&seq[write_pos], &seq[read_pos], seq.size() - read_pos); + std::memmove(&seq[write_pos], &seq[read_pos], seq.size() - read_pos); write_pos += seq.size() - read_pos; seq.resize(write_pos); diff --git a/final/util/char_ringbuffer.cpp b/final/util/char_ringbuffer.cpp index 9cb45a55..394231a1 100644 --- a/final/util/char_ringbuffer.cpp +++ b/final/util/char_ringbuffer.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2022 Markus Gans * +* Copyright 2022-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -21,7 +21,7 @@ ***********************************************************************/ -#include +#include "final/util/char_ringbuffer.h" namespace finalcut { diff --git a/final/util/char_ringbuffer.h b/final/util/char_ringbuffer.h index abb74bd1..ce6256dd 100644 --- a/final/util/char_ringbuffer.h +++ b/final/util/char_ringbuffer.h @@ -68,12 +68,15 @@ class FRingBuffer //------------------------------------------------------------------ template - class ring_iterator : public std::iterator + class ring_iterator { public: // Using-declarations - using pointer = Type*; - using reference = Type&; + using iterator_category = std::forward_iterator_tag; + using value_type = Type; + using difference_type = std::ptrdiff_t; + using pointer = Type*; + using reference = Type&; explicit ring_iterator (pointer p, std::size_t start, std::size_t pos) : ptr{p} diff --git a/final/util/fdata.h b/final/util/fdata.h index 7b569fab..2199ad5c 100644 --- a/final/util/fdata.h +++ b/final/util/fdata.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2020-2022 Markus Gans * +* Copyright 2020-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -248,8 +248,8 @@ class FData : public FDataAccess // Inquiries constexpr auto isInitializedCopy() const -> bool { - const auto& v = reinterpret_cast(const_cast(&value)); - const auto& r = reinterpret_cast(const_cast(&value_ref.get())); + const auto* v = reinterpret_cast(const_cast(&value)); + const auto* r = reinterpret_cast(const_cast(&value_ref.get())); return v == r; } diff --git a/final/util/fstring.cpp b/final/util/fstring.cpp index f34a45d6..24c48c10 100644 --- a/final/util/fstring.cpp +++ b/final/util/fstring.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2012-2022 Markus Gans * +* Copyright 2012-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -82,9 +82,8 @@ FString::FString (const std::wstring& s) //---------------------------------------------------------------------- FString::FString (std::wstring&& s) -{ - string = std::move(s); -} + : string{std::move(s)} +{ } //---------------------------------------------------------------------- FString::FString (const wchar_t s[]) @@ -294,7 +293,7 @@ auto FString::operator () () const -> const FString& // public methods of FString //---------------------------------------------------------------------- -auto FString::clear() -> FString +auto FString::clear() -> FString& { string.clear(); return *this; @@ -687,11 +686,9 @@ auto FString::setNumber (sInt64 num) -> FString& { std::array buf{}; wchar_t* s = &buf[29]; // Pointer to the last character - auto abs_num = static_cast(num); - - if ( num < 0 ) - abs_num = static_cast(-num); - + auto abs_num = ( num >= 0 ) + ? static_cast(num) + : ~static_cast(num) + 1; *s = '\0'; do @@ -760,15 +757,15 @@ auto FString::setNumber (lDouble f_num, int precision) -> FString& } //---------------------------------------------------------------------- -auto FString::setFormatedNumber (sInt64 num, char separator) -> FString& +auto FString::setFormatedNumber (sInt64 num, FString separator) -> FString& { int n{0}; std::array buf{}; wchar_t* s = &buf[29]; // Pointer to the last character auto abs_num = static_cast(num); - if ( separator == 0 ) - separator = ' '; + if ( separator[0] == 0 ) + separator = L" "; if ( num < 0 ) abs_num = static_cast(-num); @@ -782,7 +779,7 @@ auto FString::setFormatedNumber (sInt64 num, char separator) -> FString& n++; if ( abs_num && n % 3 == 0 ) - *--s = separator; + *--s = separator[0]; } while ( abs_num ); @@ -790,20 +787,20 @@ auto FString::setFormatedNumber (sInt64 num, char separator) -> FString& *--s = '-'; std::wstring str{s}; - internal_assign (str); + internal_assign (std::move(str)); return *this; } //---------------------------------------------------------------------- -auto FString::setFormatedNumber (uInt64 num, char separator) -> FString& +auto FString::setFormatedNumber (uInt64 num, FString separator) -> FString& { int n{0}; std::array buf{}; wchar_t* s = &buf[29]; // Pointer to the last character *s = L'\0'; - if ( separator == 0 ) - separator = ' '; + if ( separator[0] == 0 ) + separator = L" "; do { @@ -812,12 +809,12 @@ auto FString::setFormatedNumber (uInt64 num, char separator) -> FString& n++; if ( num && n % 3 == 0 ) - *--s = separator; + *--s = separator[0]; } while ( num ); std::wstring str{s}; - internal_assign (str); + internal_assign (std::move(str)); return *this; } @@ -1059,16 +1056,14 @@ auto FString::internal_toCharString (const std::wstring& s) const -> std::string auto src = s.c_str(); auto state = std::mbstate_t(); - const auto& size = std::wcsrtombs(nullptr, &src, 0, &state) + 1; + const auto size = std::wcsrtombs(nullptr, &src, 0, &state) + 1; std::vector dest(size); const auto mblength = std::wcsrtombs (dest.data(), &src, size, &state); - if ( mblength == static_cast(-1) && errno != EILSEQ ) - { + if ( mblength == MALFORMED_STRING && errno != EILSEQ ) return {}; - } return dest.data(); } @@ -1081,21 +1076,17 @@ inline auto FString::internal_toWideString (const std::string& s) const -> std:: auto src = s.c_str(); auto state = std::mbstate_t(); - const auto& size = std::mbsrtowcs(nullptr, &src, 0, &state) + 1; + auto size = std::mbsrtowcs(nullptr, &src, 0, &state); - if ( size == 0 ) // ...malformed UTF-8 string + if ( size == MALFORMED_STRING ) return {}; + size++; std::vector dest(size); - const auto& wide_length = std::mbsrtowcs (dest.data(), &src, size, &state); - - if ( wide_length == static_cast(-1) ) - { - if ( src != s.c_str() ) - return dest.data(); + const auto wide_length = std::mbsrtowcs (dest.data(), &src, size, &state); + if ( wide_length == MALFORMED_STRING ) return {}; - } if ( wide_length == size ) dest[size - 1] = '\0'; diff --git a/final/util/fstring.h b/final/util/fstring.h index 36605423..0401e943 100644 --- a/final/util/fstring.h +++ b/final/util/fstring.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2012-2022 Markus Gans * +* Copyright 2012-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -253,7 +253,7 @@ class FString template auto sprintf (const FString&, Args&&...) -> FString&; - auto clear() -> FString; + auto clear() -> FString&; auto wc_str() const -> const wchar_t*; auto wc_str() -> wchar_t*; @@ -292,9 +292,9 @@ class FString auto setNumber (lDouble, int = int(getPrecision())) -> FString&; template - auto setFormatedNumber (NumT, char = nl_langinfo(THOUSEP)[0]) -> FString&; - auto setFormatedNumber (sInt64, char = nl_langinfo(THOUSEP)[0]) -> FString&; - auto setFormatedNumber (uInt64, char = nl_langinfo(THOUSEP)[0]) -> FString&; + auto setFormatedNumber (NumT, FString&& = nl_langinfo(THOUSEP)) -> FString&; + auto setFormatedNumber (sInt64, FString = nl_langinfo(THOUSEP)) -> FString&; + auto setFormatedNumber (uInt64, FString = nl_langinfo(THOUSEP)) -> FString&; auto insert (const FString&, int) -> const FString&; auto insert (const FString&, std::size_t) -> const FString&; @@ -314,7 +314,8 @@ class FString private: // Constants - static constexpr uInt INPBUFFER = 200; + static constexpr auto INPBUFFER = uInt(200); + static constexpr auto MALFORMED_STRING = static_cast(-1); // Methods void internal_assign (std::wstring); @@ -671,8 +672,7 @@ inline auto FString::sprintf (const FString& format, Args&&... args) -> FString& std::swprintf ( buf.data(), buf.size(), format.wc_str() , std::forward(args)... ); - setString(buf.data()); - return *this; + return setString(buf.data()); } //---------------------------------------------------------------------- @@ -690,12 +690,12 @@ inline auto FString::setNumber (NumT num, int precision) -> FString& //---------------------------------------------------------------------- template -inline auto FString::setFormatedNumber (NumT num, char separator) -> FString& +inline auto FString::setFormatedNumber (NumT num, FString&& separator) -> FString& { if ( isNegative(num) ) - return setFormatedNumber (sInt64(num), separator); + return setFormatedNumber (sInt64(num), std::move(separator)); - return setFormatedNumber (uInt64(num), separator); + return setFormatedNumber (uInt64(num), std::move(separator)); } diff --git a/final/util/fsystem.h b/final/util/fsystem.h index 12104804..b3041965 100644 --- a/final/util/fsystem.h +++ b/final/util/fsystem.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2019-2022 Markus Gans * +* Copyright 2019-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -35,11 +35,18 @@ #error "Only can be included directly." #endif +#ifdef __APPLE__ + using timer_t = void*; +#endif + #include #include #include "final/ftypes.h" +// struct forward declaration +struct kevent; + namespace finalcut { @@ -64,12 +71,25 @@ class FSystem virtual void outPortByte (uChar, uShort) = 0; virtual auto isTTY (int) const -> int = 0; virtual auto ioctl (int, uLong, ...) -> int = 0; + virtual auto pipe (PipeData&) -> int = 0; virtual auto open (const char*, int, ...) -> int = 0; virtual auto close (int) -> int = 0; virtual auto fopen (const char*, const char*) -> FILE* = 0; virtual auto fclose (FILE*) -> int = 0; virtual auto fputs (const char*, FILE*) -> int = 0; virtual auto putchar (int) -> int = 0; + virtual auto sigaction ( int, const struct sigaction* + , struct sigaction* ) -> int = 0; + virtual auto timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int = 0; + virtual auto timer_settime ( timer_t, int, + const struct itimerspec*, + struct itimerspec* ) -> int = 0; + virtual auto timer_delete (timer_t) -> int = 0; + virtual auto kqueue() -> int = 0; + virtual auto kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec* ) -> int = 0; virtual auto getuid() -> uid_t = 0; virtual auto geteuid() -> uid_t = 0; virtual auto getpwuid_r ( uid_t, struct passwd*, char* diff --git a/final/util/fsystemimpl.cpp b/final/util/fsystemimpl.cpp index fb56da4b..71eb8885 100644 --- a/final/util/fsystemimpl.cpp +++ b/final/util/fsystemimpl.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2019-2022 Markus Gans * +* Copyright 2019-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -20,10 +20,23 @@ * . * ***********************************************************************/ +#if (defined(__APPLE__) && defined(__MACH__)) || defined(__OpenBSD__) + #define USE_KQUEUE_TIMER +#endif + +#if defined(USE_KQUEUE_TIMER) + #include + #include + #include + #include +#endif + #if defined(__CYGWIN__) #include "final/fconfig.h" // need for getpwuid_r and realpath #endif +#include + #include "final/util/fsystemimpl.h" namespace finalcut @@ -39,6 +52,113 @@ FSystemImpl::~FSystemImpl() noexcept = default; // destructor // public methods of FSystemImpl +//---------------------------------------------------------------------- + +auto FSystemImpl::sigaction ( int signum + , const struct sigaction* act + , struct sigaction* oldact ) -> int +{ + return ::sigaction (signum, act, oldact); +} + +//---------------------------------------------------------------------- +#if defined(USE_POSIX_TIMER) + +auto FSystemImpl::timer_create ( clockid_t clockid + , struct sigevent* sevp + , timer_t* timerid ) -> int +{ + return ::timer_create (clockid, sevp, timerid); +} + +#else + +auto FSystemImpl::timer_create ( clockid_t + , struct sigevent* + , timer_t* ) -> int +{ + return 0; +} + +#endif + +//---------------------------------------------------------------------- +#if defined(USE_POSIX_TIMER) + +auto FSystemImpl::timer_settime ( timer_t timer_id, int flags + , const struct itimerspec* new_value + , struct itimerspec* old_value ) -> int +{ + return ::timer_settime(timer_id, flags, new_value, old_value); +} + +#else + +auto FSystemImpl::timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int +{ + return 0; +} + +#endif + +//---------------------------------------------------------------------- +#if defined(USE_POSIX_TIMER) + +auto FSystemImpl::timer_delete (timer_t timer_id) -> int +{ + return ::timer_delete (timer_id); +} + +#else + +auto FSystemImpl::timer_delete (timer_t) -> int +{ + return 0; +} + +#endif + +//---------------------------------------------------------------------- + +#if defined(USE_KQUEUE_TIMER) + +auto FSystemImpl::kqueue() -> int +{ + return ::kqueue(); +} + +#else + +auto FSystemImpl::kqueue() -> int +{ + return 0; +} + +#endif + +//---------------------------------------------------------------------- +#if defined(USE_KQUEUE_TIMER) + +auto FSystemImpl::kevent ( int kq, const struct kevent* changelist + , int nchanges, struct kevent* eventlist + , int nevents, const struct timespec* timeout) -> int +{ + return ::kevent (kq, changelist, nchanges, eventlist, nevents, timeout); +} + +#else + +auto FSystemImpl::kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec* ) -> int +{ + return 0; +} + +#endif + //---------------------------------------------------------------------- auto FSystemImpl::getpwuid_r ( uid_t uid, struct passwd* pwd , char* buf, size_t buflen diff --git a/final/util/fsystemimpl.h b/final/util/fsystemimpl.h index d9492d87..766447f2 100644 --- a/final/util/fsystemimpl.h +++ b/final/util/fsystemimpl.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2019-2022 Markus Gans * +* Copyright 2019-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -108,21 +108,26 @@ class FSystemImpl : public FSystem { } #endif - inline auto isTTY (int fd) const -> int override + inline auto isTTY (int file_descriptor) const -> int override { - return ::isatty(fd); + return ::isatty(file_descriptor); } - inline auto ioctl (int fd, uLong request, ...) -> int override + inline auto ioctl (int file_descriptor, uLong request, ...) -> int override { va_list args{}; va_start (args, request); void* argp = va_arg (args, void*); - int ret = ::ioctl (fd, request, argp); + int ret = ::ioctl (file_descriptor, request, argp); va_end (args); return ret; } + inline auto pipe (PipeData& pipe) -> int override + { + return ::pipe(pipe.getArrayData()); + } + inline auto open (const char* pathname, int flags, ...) -> int override { va_list args{}; @@ -133,9 +138,9 @@ class FSystemImpl : public FSystem return ret; } - inline auto close (int fildes) -> int override + inline auto close (int file_descriptor) -> int override { - return ::close(fildes); + return ::close(file_descriptor); } inline auto fopen (const char* path, const char* mode) -> FILE* override @@ -143,9 +148,9 @@ class FSystemImpl : public FSystem return std::fopen (path, mode); } - inline auto fclose (FILE* fp) -> int override + inline auto fclose (FILE* file_ptr) -> int override { - return std::fclose (fp); + return std::fclose (file_ptr); } inline auto fputs (const char* str, FILE* stream) -> int override @@ -162,6 +167,19 @@ class FSystemImpl : public FSystem #endif } + auto sigaction ( int, const struct sigaction* + , struct sigaction* ) -> int override; + auto timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int override; + auto timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int override; + auto timer_delete (timer_t) -> int override; + auto kqueue() -> int override; + auto kevent ( int, const struct ::kevent* + , int, struct ::kevent* + , int, const struct timespec* ) -> int override; + inline auto getuid() -> uid_t override { return ::getuid(); diff --git a/final/vterm/fstyle.h b/final/vterm/fstyle.h index 9ad5a4fa..316fb94b 100644 --- a/final/vterm/fstyle.h +++ b/final/vterm/fstyle.h @@ -68,23 +68,31 @@ class FStyle inline void setStyle (Style attr) noexcept { attribute = attr & Style(ATTRIBUTE_MASK); } + auto toFCharAttribute() const noexcept -> FCharAttribute + { + FCharAttribute fchar_attr{}; + fchar_attr.bold = (attribute & Style::Bold) != Style::None; + fchar_attr.dim = (attribute & Style::Dim) != Style::None; + fchar_attr.italic = (attribute & Style::Italic) != Style::None; + fchar_attr.underline = (attribute & Style::Underline) != Style::None; + fchar_attr.blink = (attribute & Style::Blink) != Style::None; + fchar_attr.reverse = (attribute & Style::Reverse) != Style::None; + fchar_attr.standout = (attribute & Style::Standout) != Style::None; + fchar_attr.invisible = (attribute & Style::Invisible) != Style::None; + fchar_attr.protect = (attribute & Style::Protected) != Style::None; + fchar_attr.crossed_out = (attribute & Style::CrossedOut) != Style::None; + fchar_attr.dbl_underline = (attribute & Style::DoubleUnderline) != Style::None; + fchar_attr.transparent = (attribute & Style::Transparent) != Style::None; + fchar_attr.color_overlay = (attribute & Style::ColorOverlay) != Style::None; + fchar_attr.inherit_background = (attribute & Style::InheritBackground) != Style::None; + return fchar_attr; + } + auto toFAttribute() const noexcept -> FAttribute { + FCharAttribute fchar_attr{toFCharAttribute()}; FAttribute fattr{}; - fattr.bit.bold = (attribute & Style::Bold) != Style::None; - fattr.bit.dim = (attribute & Style::Dim) != Style::None; - fattr.bit.italic = (attribute & Style::Italic) != Style::None; - fattr.bit.underline = (attribute & Style::Underline) != Style::None; - fattr.bit.blink = (attribute & Style::Blink) != Style::None; - fattr.bit.reverse = (attribute & Style::Reverse) != Style::None; - fattr.bit.standout = (attribute & Style::Standout) != Style::None; - fattr.bit.invisible = (attribute & Style::Invisible) != Style::None; - fattr.bit.protect = (attribute & Style::Protected) != Style::None; - fattr.bit.crossed_out = (attribute & Style::CrossedOut) != Style::None; - fattr.bit.dbl_underline = (attribute & Style::DoubleUnderline) != Style::None; - fattr.bit.transparent = (attribute & Style::Transparent) != Style::None; - fattr.bit.color_overlay = (attribute & Style::ColorOverlay) != Style::None; - fattr.bit.inherit_background = (attribute & Style::InheritBackground) != Style::None; + std::memcpy(&fattr, &fchar_attr, sizeof(fattr)); return fattr; } diff --git a/final/vterm/fvterm.cpp b/final/vterm/fvterm.cpp index 275148ce..c11d8fa6 100644 --- a/final/vterm/fvterm.cpp +++ b/final/vterm/fvterm.cpp @@ -1289,7 +1289,7 @@ void FVTerm::updateVTerm() const if ( hasPendingUpdates(vdesktop.get()) ) { - addLayer(vdesktop.get()); + addLayer(vdesktop.get()); // Add vdesktop changes to vterm vdesktop->has_changes = false; } @@ -1306,7 +1306,7 @@ void FVTerm::updateVTerm() const if ( hasPendingUpdates(v_win) ) { passChangesToOverlap(v_win); - addLayer(v_win); + addLayer(v_win); // Add v_win changes to vterm v_win->has_changes = false; } else if ( hasChildAreaChanges(v_win) ) @@ -1440,11 +1440,11 @@ inline auto FVTerm::isTransparentInvisible (const FChar& fchar) const -> bool //---------------------------------------------------------------------- void FVTerm::defineByte1TransparentMask() { - FAttribute mask{}; - mask.bit.transparent = true; - mask.bit.color_overlay = true; - mask.bit.inherit_background = true; - internal::var::b1_transparent_mask = mask.byte[1]; + FCharAttribute mask{}; + mask.transparent = true; + mask.color_overlay = true; + mask.inherit_background = true; + internal::var::b1_transparent_mask = getFAttributeByte(mask, 1); } //---------------------------------------------------------------------- @@ -1764,13 +1764,13 @@ inline auto FVTerm::printWrap (FTermArea* area) const -> bool auto FVTerm::getByte1PrintTransMask() const -> uInt8 { // Set bits that must not be reset - FAttribute mask{}; - mask.bit.transparent = true; - mask.bit.color_overlay = true; - mask.bit.inherit_background = true; - mask.bit.no_changes = true; - mask.bit.printed = true; - return mask.byte[1]; + FCharAttribute mask{}; + mask.transparent = true; + mask.color_overlay = true; + mask.inherit_background = true; + mask.no_changes = true; + mask.printed = true; + return getFAttributeByte(mask, 1); } //---------------------------------------------------------------------- diff --git a/final/vterm/fvterm.h b/final/vterm/fvterm.h index 7ee6849b..adce14dd 100644 --- a/final/vterm/fvterm.h +++ b/final/vterm/fvterm.h @@ -471,9 +471,9 @@ inline auto FVTerm::FTermArea::contains (const FPoint& pos) const noexcept -> bo const int x = pos.getX(); const int y = pos.getY(); return x >= offset_left - && x <= offset_left + width + right_shadow - 1 + && x < offset_left + width + right_shadow && y >= offset_top - && y <= offset_top + current_height - 1; + && y < offset_top + current_height; } //---------------------------------------------------------------------- diff --git a/final/vterm/fvtermattribute.cpp b/final/vterm/fvtermattribute.cpp index 04117c0e..5f840fea 100644 --- a/final/vterm/fvtermattribute.cpp +++ b/final/vterm/fvtermattribute.cpp @@ -33,6 +33,39 @@ namespace finalcut // static class attributes FChar FVTermAttribute::next_attribute{}; +// Using-declaration +using map_type = std::pair>; +using AttributeLookupMap = std::unordered_map>; + +//---------------------------------------------------------------------- +static auto getAttributeLookupMap() -> AttributeLookupMap& +{ + // Encapsulate global unordered_map object + static const auto& attribute_lookup = std::make_unique + ( + std::initializer_list + ({ + { Style::Bold, &FVTermAttribute::setBold }, + { Style::Dim, &FVTermAttribute::setDim }, + { Style::Italic, &FVTermAttribute::setItalic }, + { Style::Underline, &FVTermAttribute::setUnderline }, + { Style::Blink, &FVTermAttribute::setBlink }, + { Style::Reverse, &FVTermAttribute::setReverse }, + { Style::Standout, &FVTermAttribute::setStandout }, + { Style::Invisible, &FVTermAttribute::setInvisible }, + { Style::Protected, &FVTermAttribute::setProtected }, + { Style::CrossedOut, &FVTermAttribute::setCrossedOut }, + { Style::DoubleUnderline, &FVTermAttribute::setDoubleUnderline }, + { Style::Transparent, &FVTermAttribute::setTransparent }, + { Style::ColorOverlay, &FVTermAttribute::setColorOverlay }, + { Style::InheritBackground, &FVTermAttribute::setInheritBackground } + }) + ); + + return *attribute_lookup; +} + + //---------------------------------------------------------------------- // class FVTermAttribute //---------------------------------------------------------------------- @@ -64,25 +97,8 @@ void FVTermAttribute::initAttribute() //---------------------------------------------------------------------- void FVTermAttribute::print (const FStyle& style) { - static const std::unordered_map> attributeLookup - { - { Style::Bold, &FVTermAttribute::setBold }, - { Style::Dim, &FVTermAttribute::setDim }, - { Style::Italic, &FVTermAttribute::setItalic }, - { Style::Underline, &FVTermAttribute::setUnderline }, - { Style::Blink, &FVTermAttribute::setBlink }, - { Style::Reverse, &FVTermAttribute::setReverse }, - { Style::Standout, &FVTermAttribute::setStandout }, - { Style::Invisible, &FVTermAttribute::setInvisible }, - { Style::Protected, &FVTermAttribute::setProtected }, - { Style::CrossedOut, &FVTermAttribute::setCrossedOut }, - { Style::DoubleUnderline, &FVTermAttribute::setDoubleUnderline }, - { Style::Transparent, &FVTermAttribute::setTransparent }, - { Style::ColorOverlay, &FVTermAttribute::setColorOverlay }, - { Style::InheritBackground, &FVTermAttribute::setInheritBackground } - }; - Style attr = style.getStyle(); + static const auto& attribute_lookup = getAttributeLookupMap(); if ( attr == Style::None ) { @@ -93,9 +109,9 @@ void FVTermAttribute::print (const FStyle& style) while ( attr != Style::None ) { const auto style_name = Style(attr & -attr); // Find rightmost set bit - const auto iter = attributeLookup.find(style_name); + const auto iter = attribute_lookup.find(style_name); - if ( iter != attributeLookup.end() ) + if ( iter != attribute_lookup.end() ) iter->second(true); // Sets the found style attr ^= style_name; // Clear the rightmost set bit diff --git a/final/vterm/fvtermbuffer.h b/final/vterm/fvtermbuffer.h index 67c57bc2..71e6788b 100644 --- a/final/vterm/fvtermbuffer.h +++ b/final/vterm/fvtermbuffer.h @@ -62,6 +62,7 @@ class FVTermBuffer using const_iterator = FCharVector::const_iterator; using reference = FCharVector::reference; using const_reference = FCharVector::const_reference; + using difference_type = FCharVector::difference_type; // Constructor FVTermBuffer(); diff --git a/final/widget/fbutton.cpp b/final/widget/fbutton.cpp index a3c7a383..d96cc615 100644 --- a/final/widget/fbutton.cpp +++ b/final/widget/fbutton.cpp @@ -144,13 +144,13 @@ void FButton::resetColors() } //---------------------------------------------------------------------- -auto FButton::setNoUnderline (bool enable) -> bool +void FButton::setNoUnderline (bool enable) { - return (setFlags().feature.no_underline = enable); + setFlags().feature.no_underline = enable; } //---------------------------------------------------------------------- -auto FButton::setEnable (bool enable) -> bool +void FButton::setEnable (bool enable) { FWidget::setEnable(enable); @@ -160,31 +160,28 @@ auto FButton::setEnable (bool enable) -> bool delAccelerator(); updateButtonColor(); - return enable; } //---------------------------------------------------------------------- -auto FButton::setFlat (bool enable) -> bool +void FButton::setFlat (bool enable) { - return (setFlags().feature.flat = enable); + setFlags().feature.flat = enable; } //---------------------------------------------------------------------- -auto FButton::setShadow (bool enable) -> bool +void FButton::setShadow (bool enable) { - return setWidgetShadow(this, enable); + setWidgetShadow(this, enable); } //---------------------------------------------------------------------- -auto FButton::setDown (bool enable) -> bool +void FButton::setDown (bool enable) { - if ( button_down != enable ) - { - button_down = enable; - redraw(); - } + if ( button_down == enable ) + return; - return enable; + button_down = enable; + redraw(); } //---------------------------------------------------------------------- diff --git a/final/widget/fbutton.h b/final/widget/fbutton.h index c2e7f85a..55a8cac1 100644 --- a/final/widget/fbutton.h +++ b/final/widget/fbutton.h @@ -83,19 +83,19 @@ class FButton : public FWidget void setInactiveForegroundColor (FColor); void setInactiveBackgroundColor (FColor); void resetColors() override; - auto setNoUnderline (bool = true) -> bool; - auto unsetNoUnderline() -> bool; - auto setEnable (bool = true) -> bool override; - auto unsetEnable() -> bool override; - auto setDisable() -> bool override; - auto setFlat (bool = true) -> bool; - auto unsetFlat() -> bool; - auto setShadow (bool = true) -> bool; - auto unsetShadow() -> bool; - auto setDown (bool = true) -> bool; - auto setUp() -> bool; - auto setClickAnimation (bool = true) -> bool; - auto unsetClickAnimation() -> bool; + void setNoUnderline (bool = true); + void unsetNoUnderline(); + void setEnable (bool = true) override; + void unsetEnable() override; + void setDisable() override; + void setFlat (bool = true); + void unsetFlat(); + void setShadow (bool = true); + void unsetShadow(); + void setDown (bool = true); + void setUp(); + void setClickAnimation (bool = true); + void unsetClickAnimation(); void setText (const FString&); // Inquiries @@ -174,36 +174,36 @@ inline auto FButton::getText() const -> FString { return text; } //---------------------------------------------------------------------- -inline auto FButton::unsetNoUnderline() -> bool -{ return setNoUnderline(false); } +inline void FButton::unsetNoUnderline() +{ setNoUnderline(false); } //---------------------------------------------------------------------- -inline auto FButton::unsetEnable() -> bool -{ return setEnable(false); } +inline void FButton::unsetEnable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FButton::setDisable() -> bool -{ return setEnable(false); } +inline void FButton::setDisable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FButton::unsetFlat() -> bool -{ return setFlat(false); } +inline void FButton::unsetFlat() +{ setFlat(false); } //---------------------------------------------------------------------- -inline auto FButton::unsetShadow() -> bool -{ return setShadow(false); } +inline void FButton::unsetShadow() +{ setShadow(false); } //---------------------------------------------------------------------- -inline auto FButton::setUp() -> bool -{ return setDown(false); } +inline void FButton::setUp() +{ setDown(false); } //---------------------------------------------------------------------- -inline auto FButton::setClickAnimation(bool enable) -> bool -{ return (click_animation = enable); } +inline void FButton::setClickAnimation(bool enable) +{ click_animation = enable; } //---------------------------------------------------------------------- -inline auto FButton::unsetClickAnimation() -> bool -{ return setClickAnimation(false); } +inline void FButton::unsetClickAnimation() +{ setClickAnimation(false); } //---------------------------------------------------------------------- inline auto FButton::isFlat() const -> bool diff --git a/final/widget/fbuttongroup.cpp b/final/widget/fbuttongroup.cpp index 8d75634b..bda6c2cc 100644 --- a/final/widget/fbuttongroup.cpp +++ b/final/widget/fbuttongroup.cpp @@ -99,7 +99,7 @@ auto FButtonGroup::getCheckedButton() const -> FToggleButton* } //---------------------------------------------------------------------- -auto FButtonGroup::setEnable (bool enable) -> bool +void FButtonGroup::setEnable (bool enable) { FWidget::setEnable(enable); @@ -107,8 +107,6 @@ auto FButtonGroup::setEnable (bool enable) -> bool setHotkeyAccelerator(); else delAccelerator(); - - return enable; } //---------------------------------------------------------------------- @@ -465,7 +463,7 @@ void FButtonGroup::cb_buttonToggled (const FToggleButton* button) const // FToggleButton friend function definition //---------------------------------------------------------------------- -auto getGroup (FToggleButton& toggle_btn) -> FButtonGroup* +auto getGroup (const FToggleButton& toggle_btn) -> FButtonGroup* { return toggle_btn.button_group; } diff --git a/final/widget/fbuttongroup.h b/final/widget/fbuttongroup.h index 1a0c044e..53744485 100644 --- a/final/widget/fbuttongroup.h +++ b/final/widget/fbuttongroup.h @@ -79,9 +79,9 @@ class FButtonGroup : public FScrollView auto getCount() const -> std::size_t; // Mutator - auto setEnable (bool = true) -> bool override; - auto unsetEnable() -> bool override; - auto setDisable() -> bool override; + void setEnable (bool = true) override; + void unsetEnable() override; + void setDisable() override; // Inquiries auto isChecked (int) const -> bool; @@ -135,12 +135,12 @@ inline auto FButtonGroup::getClassName() const -> FString { return "FButtonGroup"; } //---------------------------------------------------------------------- -inline auto FButtonGroup::unsetEnable() -> bool -{ return setEnable(false); } +inline void FButtonGroup::unsetEnable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FButtonGroup::setDisable() -> bool -{ return setEnable(false); } +inline void FButtonGroup::setDisable() +{ setEnable(false); } //---------------------------------------------------------------------- inline auto FButtonGroup::getCount() const -> std::size_t diff --git a/final/widget/fcombobox.cpp b/final/widget/fcombobox.cpp index eafd0682..7d37b645 100644 --- a/final/widget/fcombobox.cpp +++ b/final/widget/fcombobox.cpp @@ -201,24 +201,23 @@ void FComboBox::setGeometry ( const FPoint& pos, const FSize& size } //---------------------------------------------------------------------- -auto FComboBox::setEnable (bool enable) -> bool +void FComboBox::setEnable (bool enable) { FWidget::setEnable(enable); input_field.setEnable(enable); - return enable; } //---------------------------------------------------------------------- -auto FComboBox::setShadow (bool enable) -> bool +void FComboBox::setShadow (bool enable) { - return setWidgetShadow(this, enable); + setWidgetShadow(this, enable); } //---------------------------------------------------------------------- -auto FComboBox::setEditable (bool enable) -> bool +void FComboBox::setEditable (bool enable) { if ( is_editable == enable ) - return is_editable; + return; if ( enable ) unsetVisibleCursor(); @@ -226,7 +225,6 @@ auto FComboBox::setEditable (bool enable) -> bool setVisibleCursor(); input_field.setReadOnly(! enable); - return (is_editable = enable); } //---------------------------------------------------------------------- diff --git a/final/widget/fcombobox.h b/final/widget/fcombobox.h index bbd51023..69828465 100644 --- a/final/widget/fcombobox.h +++ b/final/widget/fcombobox.h @@ -145,13 +145,13 @@ class FComboBox : public FWidget // Mutators void setSize (const FSize&, bool = true) override; void setGeometry (const FPoint&, const FSize&, bool = true) override; - auto setEnable (bool = true) -> bool override; - auto unsetEnable() -> bool override; - auto setDisable() -> bool override; - auto setShadow (bool = true) -> bool; - auto unsetShadow() -> bool; - auto setEditable (bool = true) -> bool; - auto unsetEditable() -> bool; + void setEnable (bool = true) override; + void unsetEnable() override; + void setDisable() override; + void setShadow (bool = true); + void unsetShadow(); + void setEditable (bool = true); + void unsetEditable(); void setCurrentItem (std::size_t); void setMaxVisibleItems (std::size_t); void setText (const FString&); @@ -244,20 +244,20 @@ inline auto FComboBox::getLabelOrientation() const -> FLineEdit::LabelOrientatio { return input_field.getLabelOrientation(); } //---------------------------------------------------------------------- -inline auto FComboBox::unsetEnable() -> bool -{ return setEnable(false); } +inline void FComboBox::unsetEnable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FComboBox::setDisable() -> bool -{ return setEnable(false); } +inline void FComboBox::setDisable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FComboBox::unsetShadow() -> bool -{ return setShadow(false); } +inline void FComboBox::unsetShadow() +{ setShadow(false); } //---------------------------------------------------------------------- -inline auto FComboBox::unsetEditable() -> bool -{ return setEditable(false); } +inline void FComboBox::unsetEditable() +{ setEditable(false); } //---------------------------------------------------------------------- inline auto FComboBox::hasShadow() const -> bool @@ -268,7 +268,7 @@ template void FComboBox::insert (const std::initializer_list& list, DT&& d) { - for (auto& item : list) + for (const auto& item : list) { FListBoxItem listItem (FString() << item, std::forward
(d)); insert (listItem); diff --git a/final/widget/flabel.cpp b/final/widget/flabel.cpp index f9f18648..9b03d914 100644 --- a/final/widget/flabel.cpp +++ b/final/widget/flabel.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2014-2022 Markus Gans * +* Copyright 2014-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -55,10 +55,8 @@ FLabel::FLabel (const FString& txt, FWidget* parent) } //---------------------------------------------------------------------- -FLabel::~FLabel() // destructor -{ - delAccelerator(); -} +FLabel::~FLabel() noexcept = default; // destructor + // FLabel operators //---------------------------------------------------------------------- @@ -125,7 +123,7 @@ void FLabel::resetColors() } //---------------------------------------------------------------------- -auto FLabel::setEnable (bool enable) -> bool +void FLabel::setEnable (bool enable) { FWidget::setEnable(enable); @@ -133,8 +131,6 @@ auto FLabel::setEnable (bool enable) -> bool setHotkeyAccelerator(); else delAccelerator(); - - return enable; } //---------------------------------------------------------------------- diff --git a/final/widget/flabel.h b/final/widget/flabel.h index 799b2c83..62e97473 100644 --- a/final/widget/flabel.h +++ b/final/widget/flabel.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2014-2022 Markus Gans * +* Copyright 2014-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -76,7 +76,7 @@ class FLabel : public FWidget FLabel (FLabel&&) noexcept = delete; // Destructor - ~FLabel() override; + ~FLabel() noexcept override; // Disable copy assignment operator (=) auto operator = (const FLabel&) -> FLabel& = delete; @@ -101,12 +101,12 @@ class FLabel : public FWidget // Mutators void setAccelWidget (FWidget* = nullptr); void setAlignment (Align) noexcept; - auto setEmphasis (bool = true) noexcept -> bool; - auto unsetEmphasis() noexcept -> bool; + void setEmphasis (bool = true) noexcept; + void unsetEmphasis() noexcept; void resetColors() override; - auto setReverseMode (bool = true) noexcept -> bool; - auto unsetReverseMode() noexcept -> bool; - auto setEnable (bool = true) -> bool override; + void setReverseMode (bool = true) noexcept; + void unsetReverseMode() noexcept; + void setEnable (bool = true) override; void setNumber (uLong); void setNumber (long); void setNumber (float, int = FLT_DIG); @@ -187,20 +187,20 @@ inline auto FLabel::getText() & -> FString& { return text; } //---------------------------------------------------------------------- -inline auto FLabel::setEmphasis (bool enable) noexcept -> bool -{ return (emphasis = enable); } +inline void FLabel::setEmphasis (bool enable) noexcept +{ emphasis = enable; } //---------------------------------------------------------------------- -inline auto FLabel::unsetEmphasis() noexcept -> bool -{ return setEmphasis(false); } +inline void FLabel::unsetEmphasis() noexcept +{ setEmphasis(false); } //---------------------------------------------------------------------- -inline auto FLabel::setReverseMode (bool enable) noexcept -> bool -{ return (reverse_mode = enable); } +inline void FLabel::setReverseMode (bool enable) noexcept +{ reverse_mode = enable; } //---------------------------------------------------------------------- -inline auto FLabel::unsetReverseMode() noexcept -> bool -{ return setReverseMode(false); } +inline void FLabel::unsetReverseMode() noexcept +{ setReverseMode(false); } //---------------------------------------------------------------------- inline void FLabel::setNumber (uLong num) diff --git a/final/widget/flineedit.cpp b/final/widget/flineedit.cpp index 77c0d4e0..afbfb1a2 100644 --- a/final/widget/flineedit.cpp +++ b/final/widget/flineedit.cpp @@ -64,8 +64,7 @@ FLineEdit::FLineEdit (const FString& txt, FWidget* parent) FLineEdit::~FLineEdit() // destructor { if ( input_type == InputType::Password ) // Zero password in memory - for (auto&& ch : text) - ch = '\0'; + std::fill (text.begin(), text.end(), '\0'); if ( ! insert_mode ) FVTerm::getFOutput()->setCursor(CursorMode::Insert); @@ -103,28 +102,27 @@ auto FLineEdit::operator >> (FString& s) const -> const FLineEdit& // public methods of FLineEdit //---------------------------------------------------------------------- -auto FLineEdit::setEnable (bool enable) -> bool +void FLineEdit::setEnable (bool enable) { FWidget::setEnable(enable); resetColors(); - return enable; } //---------------------------------------------------------------------- -auto FLineEdit::setShadow (bool enable) -> bool +void FLineEdit::setShadow (bool enable) { - return setWidgetShadow(this, enable); + setWidgetShadow(this, enable); } //---------------------------------------------------------------------- -auto FLineEdit::setReadOnly (bool enable) -> bool +void FLineEdit::setReadOnly (bool enable) { if ( enable ) unsetVisibleCursor(); else setVisibleCursor(); - return (read_only = enable); + read_only = enable; } //---------------------------------------------------------------------- diff --git a/final/widget/flineedit.h b/final/widget/flineedit.h index 22a32e08..b48f2a72 100644 --- a/final/widget/flineedit.h +++ b/final/widget/flineedit.h @@ -141,13 +141,13 @@ class FLineEdit : public FWidget void setSize (const FSize&, bool = true) override; void setGeometry ( const FPoint&, const FSize& , bool = true ) override; - auto setEnable (bool = true) -> bool override; - auto unsetEnable() -> bool override; - auto setDisable() -> bool override; - auto setShadow (bool = true) -> bool; - auto unsetShadow() -> bool; - auto setReadOnly (bool = true) -> bool; - auto unsetReadOnly() -> bool; + void setEnable (bool = true) override; + void unsetEnable() override; + void setDisable() override; + void setShadow (bool = true); + void unsetShadow(); + void setReadOnly (bool = true); + void unsetReadOnly(); // Inquiry auto hasShadow() const -> bool; @@ -290,20 +290,20 @@ inline void FLineEdit::setLabelAssociatedWidget (FWidget* w) { label_associated_widget = w; } //---------------------------------------------------------------------- -inline auto FLineEdit::unsetEnable() -> bool -{ return setEnable(false); } +inline void FLineEdit::unsetEnable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FLineEdit::setDisable() -> bool -{ return setEnable(false); } +inline void FLineEdit::setDisable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FLineEdit::unsetShadow() -> bool -{ return setShadow(false); } +inline void FLineEdit::unsetShadow() +{ setShadow(false); } //---------------------------------------------------------------------- -inline auto FLineEdit::unsetReadOnly() -> bool -{ return setReadOnly(true); } +inline void FLineEdit::unsetReadOnly() +{ setReadOnly(true); } //---------------------------------------------------------------------- inline auto FLineEdit::hasShadow() const -> bool diff --git a/final/widget/flistbox.cpp b/final/widget/flistbox.cpp index d2a1d99e..5228f21f 100644 --- a/final/widget/flistbox.cpp +++ b/final/widget/flistbox.cpp @@ -34,15 +34,6 @@ namespace finalcut { -//---------------------------------------------------------------------- -// class FListBoxItem -//---------------------------------------------------------------------- - -// constructor and destructor -//---------------------------------------------------------------------- -FListBoxItem::~FListBoxItem() noexcept = default; // destructor - - //---------------------------------------------------------------------- // class FListBox //---------------------------------------------------------------------- @@ -468,6 +459,10 @@ void FListBox::onWheel (FWheelEvent* ev) wheelUp (wheel_distance); else if ( wheel == MouseWheel::Down ) wheelDown (wheel_distance); + else if ( wheel == MouseWheel::Left ) + wheelLeft (wheel_distance); + else if ( wheel == MouseWheel::Right ) + wheelRight (wheel_distance); if ( current_before != current ) { @@ -1180,6 +1175,30 @@ void FListBox::wheelDown (int pagesize) current = element_count; } +//---------------------------------------------------------------------- +void FListBox::wheelLeft (int pagesize) +{ + if ( getCount() == 0 || xoffset == 0 ) + return; + + const int xoffset_before = xoffset; + scrollLeft (pagesize); + const bool draw_hbar(xoffset_before != xoffset); + updateDrawing (false, draw_hbar); +} + +//---------------------------------------------------------------------- +void FListBox::wheelRight (int pagesize) +{ + if ( getCount() == 0 ) + return; + + const int xoffset_before = xoffset; + scrollRight (pagesize); + const bool draw_hbar(xoffset_before != xoffset); + updateDrawing (false, draw_hbar); +} + //---------------------------------------------------------------------- auto FListBox::dragScrollUp() -> bool { @@ -1703,10 +1722,12 @@ void FListBox::cb_vbarChange (const FWidget*) break; case FScrollbar::ScrollType::WheelUp: + case FScrollbar::ScrollType::WheelLeft: wheelUp (wheel_distance); break; case FScrollbar::ScrollType::WheelDown: + case FScrollbar::ScrollType::WheelRight: wheelDown (wheel_distance); break; @@ -1764,10 +1785,12 @@ void FListBox::cb_hbarChange (const FWidget*) break; case FScrollbar::ScrollType::WheelUp: + case FScrollbar::ScrollType::WheelLeft: scrollLeft (wheel_distance); break; case FScrollbar::ScrollType::WheelDown: + case FScrollbar::ScrollType::WheelRight: scrollRight (wheel_distance); break; diff --git a/final/widget/flistbox.h b/final/widget/flistbox.h index 54b44402..718d1098 100644 --- a/final/widget/flistbox.h +++ b/final/widget/flistbox.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2014-2022 Markus Gans * +* Copyright 2014-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -72,28 +72,12 @@ class FListBoxItem { public: // Constructors - FListBoxItem() = default; template - explicit FListBoxItem (const FString&, DT&& = DT() ); - - // Copy constructor - FListBoxItem (const FListBoxItem&) = default; - - // Move constructor - FListBoxItem (FListBoxItem&&) noexcept = default; - - // Destructor - virtual ~FListBoxItem() noexcept; - - // Copy assignment operator (=) - auto operator = (const FListBoxItem&) -> FListBoxItem& = default; - - // Move assignment operator (=) - auto operator = (FListBoxItem&&) noexcept -> FListBoxItem& = default; + explicit FListBoxItem (const FString& = FString{}, DT&& = DT() ); // Accessors - virtual auto getClassName() const -> FString; - virtual auto getText() const -> FString; + auto getClassName() const -> FString; + auto getText() const -> FString; template auto getData() const -> clean_fdata_t
&; @@ -243,7 +227,7 @@ class FListBox : public FWidget void setGeometry (const FPoint&, const FSize&, bool = true) override; void setMultiSelection (bool = true); void unsetMultiSelection (); - auto setDisable() -> bool override; + void setDisable() override; void setText (const FString&); // Inquiries @@ -343,6 +327,8 @@ class FListBox : public FWidget void multiSelectionUpTo (std::size_t); void wheelUp (int); void wheelDown (int); + void wheelLeft (int); + void wheelRight (int); auto dragScrollUp() -> bool; auto dragScrollDown() -> bool; void dragUp (MouseButton); @@ -534,8 +520,8 @@ inline void FListBox::unsetMultiSelection() { setMultiSelection(false); } //---------------------------------------------------------------------- -inline auto FListBox::setDisable() -> bool -{ return setEnable(false); } +inline void FListBox::setDisable() +{ setEnable(false); } //---------------------------------------------------------------------- inline auto FListBox::isSelected (std::size_t index) const -> bool @@ -609,7 +595,7 @@ void FListBox::insert ( const std::initializer_list& list , bool s , DT&& d ) { - for (auto& item : list) + for (const auto& item : list) { FListBoxItem listItem (FString() << item, std::forward
(d)); listItem.brackets = b; @@ -645,7 +631,8 @@ inline auto \ FListBox::index2iterator (std::size_t index) -> FListBoxItems::iterator { auto iter = itemlist.begin(); - std::advance (iter, index); + using distance_type = FListBoxItems::difference_type; + std::advance (iter, distance_type(index)); return iter; } @@ -654,7 +641,8 @@ inline auto \ FListBox::index2iterator (std::size_t index) const -> FListBoxItems::const_iterator { auto iter = itemlist.begin(); - std::advance (iter, index); + using distance_type = FListBoxItems::difference_type; + std::advance (iter, distance_type(index)); return iter; } diff --git a/final/widget/flistview.cpp b/final/widget/flistview.cpp index 32e19f33..54a817a3 100644 --- a/final/widget/flistview.cpp +++ b/final/widget/flistview.cpp @@ -946,8 +946,8 @@ void FListView::remove (FListViewItem* item) return; auto parent = item->getParent(); - const auto& current_item = static_cast(*current_iter); - const auto& first_item = itemlist.front(); + const auto* current_item = static_cast(*current_iter); + const auto* first_item = itemlist.front(); auto end_iter = static_cast(itemlist.end()); const auto& last_item = *(--end_iter); const bool is_current_line( item == current_item ); @@ -1280,15 +1280,20 @@ void FListView::onWheel (FWheelEvent* ev) { const int position_before = current_iter.getPosition(); static constexpr int wheel_distance = 4; + const auto& wheel = ev->getWheel(); first_line_position_before = first_visible_line.getPosition(); if ( isDragging(drag_scroll) ) stopDragScroll(); - if ( ev->getWheel() == MouseWheel::Up ) + if ( wheel == MouseWheel::Up ) wheelUp (wheel_distance); - else if ( ev->getWheel() == MouseWheel::Down ) + else if ( wheel == MouseWheel::Down ) wheelDown (wheel_distance); + else if ( wheel == MouseWheel::Left ) + wheelLeft (wheel_distance); + else if ( wheel == MouseWheel::Right ) + wheelRight (wheel_distance); if ( position_before != current_iter.getPosition() ) processRowChanged(); @@ -1997,7 +2002,8 @@ inline auto FListView::findHeaderStartPos (bool& left_trunc) -> FVTermBuffer::it } auto first = headerline.begin(); - std::advance(first, offset); + using distance_type = FVTermBuffer::difference_type; + std::advance(first, distance_type(offset)); return first; } @@ -2034,7 +2040,8 @@ inline auto FListView::findHeaderEndPos ( FVTermBuffer::iterator first } last = first; - std::advance(last, character); + using distance_type = FVTermBuffer::difference_type; + std::advance(last, distance_type(character)); return last; } @@ -2343,6 +2350,30 @@ void FListView::wheelDown (int pagesize) } } +//---------------------------------------------------------------------- +void FListView::wheelLeft (int pagesize) +{ + if ( isItemListEmpty() || xoffset == 0 ) + return; + + const int xoffset_before = xoffset; + scrollBy (-pagesize, 0); + const bool draw_hbar(xoffset_before != xoffset); + updateDrawing (false, draw_hbar); +} + +//---------------------------------------------------------------------- +void FListView::wheelRight (int pagesize) +{ + if ( isItemListEmpty() ) + return; + + const int xoffset_before = xoffset; + scrollBy (pagesize, 0); + const bool draw_hbar(xoffset_before != xoffset); + updateDrawing (false, draw_hbar); +} + //---------------------------------------------------------------------- auto FListView::dragScrollUp (int position_before) -> bool { @@ -2920,10 +2951,12 @@ void FListView::cb_vbarChange (const FWidget*) break; case FScrollbar::ScrollType::WheelUp: + case FScrollbar::ScrollType::WheelLeft: wheelUp (wheel_distance); break; case FScrollbar::ScrollType::WheelDown: + case FScrollbar::ScrollType::WheelRight: wheelDown (wheel_distance); break; @@ -2975,10 +3008,12 @@ void FListView::cb_hbarChange (const FWidget*) break; case FScrollbar::ScrollType::WheelUp: + case FScrollbar::ScrollType::WheelLeft: scrollBy (-wheel_distance, 0); break; case FScrollbar::ScrollType::WheelDown: + case FScrollbar::ScrollType::WheelRight: scrollBy (wheel_distance, 0); break; diff --git a/final/widget/flistview.h b/final/widget/flistview.h index e901d6d5..e0586137 100644 --- a/final/widget/flistview.h +++ b/final/widget/flistview.h @@ -357,8 +357,8 @@ class FListView : public FWidget void hideSortIndicator (bool = true); void showColumn (int); void hideColumn (int); - auto setTreeView (bool = true) -> bool; - auto unsetTreeView() -> bool; + void setTreeView (bool = true); + void unsetTreeView(); // Inquiries auto isColumnHidden (int) const -> bool; @@ -479,6 +479,8 @@ class FListView : public FWidget void mouseHeaderClicked(); void wheelUp (int); void wheelDown (int); + void wheelLeft (int); + void wheelRight (int); auto dragScrollUp (int) -> bool; auto dragScrollDown (int) -> bool; void dragUp (MouseButton); @@ -611,12 +613,12 @@ inline void FListView::hideSortIndicator (bool hide) { hide_sort_indicator = hide; } //---------------------------------------------------------------------- -inline auto FListView::setTreeView (bool enable) -> bool -{ return (tree_view = enable); } +inline void FListView::setTreeView (bool enable) +{ tree_view = enable; } //---------------------------------------------------------------------- -inline auto FListView::unsetTreeView() -> bool -{ return setTreeView(false); } +inline void FListView::unsetTreeView() +{ setTreeView(false); } //---------------------------------------------------------------------- inline auto FListView::insert (FListViewItem* item) -> FObject::iterator diff --git a/final/widget/fprogressbar.cpp b/final/widget/fprogressbar.cpp index db5e535b..ddbeeed6 100644 --- a/final/widget/fprogressbar.cpp +++ b/final/widget/fprogressbar.cpp @@ -84,9 +84,9 @@ void FProgressbar::setGeometry ( const FPoint& pos, const FSize& size } //---------------------------------------------------------------------- -auto FProgressbar::setShadow (bool enable) -> bool +void FProgressbar::setShadow (bool enable) { - return setWidgetShadow(this, enable); + setWidgetShadow(this, enable); } //---------------------------------------------------------------------- diff --git a/final/widget/fprogressbar.h b/final/widget/fprogressbar.h index 2ba0a877..f5f876ae 100644 --- a/final/widget/fprogressbar.h +++ b/final/widget/fprogressbar.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2014-2022 Markus Gans * +* Copyright 2014-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -76,8 +76,8 @@ class FProgressbar : public FWidget void setPercentage (std::size_t); void setSize (const FSize&, bool = true) override; void setGeometry (const FPoint&, const FSize&, bool = true) override; - auto setShadow (bool = true) -> bool; - auto unsetShadow() -> bool; + void setShadow (bool = true) ; + void unsetShadow(); // Inquiries auto hasShadow() const -> bool; @@ -114,8 +114,8 @@ inline auto FProgressbar::getPercentage() const noexcept -> std::size_t { return percentage; } //---------------------------------------------------------------------- -inline auto FProgressbar::unsetShadow() -> bool -{ return setShadow(false); } +inline void FProgressbar::unsetShadow() +{ setShadow(false); } //---------------------------------------------------------------------- inline auto FProgressbar::hasShadow() const -> bool diff --git a/final/widget/fscrollbar.cpp b/final/widget/fscrollbar.cpp index fe82aa12..a17e4375 100644 --- a/final/widget/fscrollbar.cpp +++ b/final/widget/fscrollbar.cpp @@ -393,6 +393,10 @@ void FScrollbar::onWheel (FWheelEvent* ev) scroll_type = ScrollType::WheelUp; else if ( wheel == MouseWheel::Down ) scroll_type = ScrollType::WheelDown; + else if ( wheel == MouseWheel::Left ) + scroll_type = ScrollType::WheelLeft; + else if ( wheel == MouseWheel::Right ) + scroll_type = ScrollType::WheelRight; processScroll(); } diff --git a/final/widget/fscrollbar.h b/final/widget/fscrollbar.h index 963ed420..b7e328ce 100644 --- a/final/widget/fscrollbar.h +++ b/final/widget/fscrollbar.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2012-2022 Markus Gans * +* Copyright 2012-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -83,7 +83,9 @@ class FScrollbar : public FWidget PageBackward = 4, PageForward = 5, WheelUp = 6, - WheelDown = 7 + WheelDown = 7, + WheelLeft = 8, + WheelRight = 9 }; // Constructors diff --git a/final/widget/fscrollview.cpp b/final/widget/fscrollview.cpp index db5f82b8..f86f8246 100644 --- a/final/widget/fscrollview.cpp +++ b/final/widget/fscrollview.cpp @@ -302,9 +302,9 @@ void FScrollView::setText (const FString& txt) } //---------------------------------------------------------------------- -auto FScrollView::setViewportPrint (bool enable) -> bool +void FScrollView::setViewportPrint (bool enable) { - return (use_own_print_area = ! enable); + use_own_print_area = ! enable; } //---------------------------------------------------------------------- @@ -317,9 +317,9 @@ void FScrollView::resetColors() } //---------------------------------------------------------------------- -auto FScrollView::setBorder (bool enable) -> bool +void FScrollView::setBorder (bool enable) { - return (setFlags().feature.no_border = ! enable); + setFlags().feature.no_border = ! enable; } //---------------------------------------------------------------------- @@ -344,7 +344,7 @@ void FScrollView::setVerticalScrollBarMode (ScrollBarMode mode) void FScrollView::clearArea (wchar_t fillchar) { if ( viewport ) - clearArea (viewport.get(), fillchar); + FScrollView::clearArea (viewport.get(), fillchar); } //---------------------------------------------------------------------- @@ -540,6 +540,14 @@ void FScrollView::onWheel (FWheelEvent* ev) { scrollBy (0, distance); } + else if ( ev->getWheel() == MouseWheel::Left ) + { + scrollBy (-distance, 0); + } + else if ( ev->getWheel() == MouseWheel::Right ) + { + scrollBy (distance, 0); + } } //---------------------------------------------------------------------- @@ -599,11 +607,11 @@ void FScrollView::onChildFocusOut (FFocusEvent* out_ev) { // Change the focus away from FScrollView to another widget - const auto& focus = FWidget::getFocusWidget(); + const auto* focus = FWidget::getFocusWidget(); if ( out_ev->getFocusType() == FocusTypes::NextWidget ) { - const auto& last_widget = getLastFocusableWidget(getChildren()); + const auto* last_widget = getLastFocusableWidget(getChildren()); if ( focus != last_widget ) return; @@ -613,7 +621,7 @@ void FScrollView::onChildFocusOut (FFocusEvent* out_ev) } else if ( out_ev->getFocusType() == FocusTypes::PreviousWidget ) { - const auto& first_widget = getFirstFocusableWidget(getChildren()); + const auto* first_widget = getFirstFocusableWidget(getChildren()); if ( focus != first_widget ) return; @@ -811,7 +819,7 @@ inline void FScrollView::createViewport (const FSize& size) noexcept scroll_geometry.setSize(size); viewport = createArea(scroll_geometry); setColor(); - clearArea(); + FScrollView::clearArea(); } //---------------------------------------------------------------------- @@ -1055,10 +1063,12 @@ void FScrollView::cb_vbarChange (const FWidget*) break; case FScrollbar::ScrollType::WheelUp: + case FScrollbar::ScrollType::WheelLeft: scrollBy (0, -wheel_distance); break; case FScrollbar::ScrollType::WheelDown: + case FScrollbar::ScrollType::WheelRight: scrollBy (0, wheel_distance); break; @@ -1106,10 +1116,12 @@ void FScrollView::cb_hbarChange (const FWidget*) break; case FScrollbar::ScrollType::WheelUp: + case FScrollbar::ScrollType::WheelLeft: scrollBy (-wheel_distance, 0); break; case FScrollbar::ScrollType::WheelDown: + case FScrollbar::ScrollType::WheelRight: scrollBy (wheel_distance, 0); break; diff --git a/final/widget/fscrollview.h b/final/widget/fscrollview.h index 3b952472..ced76181 100644 --- a/final/widget/fscrollview.h +++ b/final/widget/fscrollview.h @@ -117,11 +117,11 @@ class FScrollView : public FWidget auto setCursorPos (const FPoint&) -> bool override; void setPrintPos (const FPoint&) override; void setText (const FString&); - auto setViewportPrint (bool = true) -> bool; - auto unsetViewportPrint() -> bool; + void setViewportPrint (bool = true); + void unsetViewportPrint(); void resetColors() override; - auto setBorder (bool = true) -> bool; - auto unsetBorder() -> bool; + void setBorder (bool = true); + void unsetBorder(); void setHorizontalScrollBarMode (ScrollBarMode); void setVerticalScrollBarMode (ScrollBarMode); @@ -260,12 +260,12 @@ inline auto FScrollView::getScrollY() const -> int { return viewport_geometry.getY(); } //---------------------------------------------------------------------- -inline auto FScrollView::unsetViewportPrint() -> bool -{ return setViewportPrint(false); } +inline void FScrollView::unsetViewportPrint() +{ setViewportPrint(false); } //---------------------------------------------------------------------- -inline auto FScrollView::unsetBorder() -> bool -{ return setBorder(false); } +inline void FScrollView::unsetBorder() +{ setBorder(false); } //---------------------------------------------------------------------- inline auto FScrollView::hasBorder() const -> bool diff --git a/final/widget/fspinbox.cpp b/final/widget/fspinbox.cpp index 5817f6ff..d440ba00 100644 --- a/final/widget/fspinbox.cpp +++ b/final/widget/fspinbox.cpp @@ -72,17 +72,16 @@ void FSpinBox::setGeometry ( const FPoint& pos, const FSize& size } //---------------------------------------------------------------------- -auto FSpinBox::setEnable (bool enable) -> bool +void FSpinBox::setEnable (bool enable) { FWidget::setEnable(enable); input_field.setEnable(enable); - return enable; } //---------------------------------------------------------------------- -auto FSpinBox::setShadow (bool enable) -> bool +void FSpinBox::setShadow (bool enable) { - return setWidgetShadow(this, enable); + setWidgetShadow(this, enable); } //---------------------------------------------------------------------- diff --git a/final/widget/fspinbox.h b/final/widget/fspinbox.h index d186ddbc..ae9cd1a8 100644 --- a/final/widget/fspinbox.h +++ b/final/widget/fspinbox.h @@ -85,11 +85,11 @@ class FSpinBox : public FWidget // Mutators void setSize (const FSize&, bool = true) override; void setGeometry (const FPoint&, const FSize&, bool = true) override; - auto setEnable (bool = true) -> bool override; - auto unsetEnable() -> bool override; - auto setDisable() -> bool override; - auto setShadow (bool = true) -> bool; - auto unsetShadow() -> bool; + void setEnable (bool = true) override; + void unsetEnable() override; + void setDisable() override; + void setShadow (bool = true); + void unsetShadow(); void setValue (sInt64); void setMinValue (sInt64); void setMaxValue (sInt64); @@ -173,16 +173,16 @@ inline auto FSpinBox::getLabelOrientation() const -> FLineEdit::LabelOrientation { return input_field.getLabelOrientation(); } //---------------------------------------------------------------------- -inline auto FSpinBox::unsetEnable() -> bool -{ return setEnable(false); } +inline void FSpinBox::unsetEnable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FSpinBox::setDisable() -> bool -{ return setEnable(false); } +inline void FSpinBox::setDisable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FSpinBox::unsetShadow() -> bool -{ return setShadow(false); } +inline void FSpinBox::unsetShadow() +{ setShadow(false); } //---------------------------------------------------------------------- inline auto FSpinBox::hasShadow() const -> bool diff --git a/final/widget/fstatusbar.cpp b/final/widget/fstatusbar.cpp index b34eaeb0..a3db313f 100644 --- a/final/widget/fstatusbar.cpp +++ b/final/widget/fstatusbar.cpp @@ -89,12 +89,12 @@ void FStatusKey::setActive() } //---------------------------------------------------------------------- -auto FStatusKey::setMouseFocus(bool enable) -> bool +void FStatusKey::setMouseFocus (bool enable) { if ( mouse_focus == enable ) - return true; + return; - return (mouse_focus = enable); + mouse_focus = enable; } diff --git a/final/widget/fstatusbar.h b/final/widget/fstatusbar.h index 5ae6cad1..30b6fa85 100644 --- a/final/widget/fstatusbar.h +++ b/final/widget/fstatusbar.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2014-2022 Markus Gans * +* Copyright 2014-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -102,8 +102,8 @@ class FStatusKey : public FWidget void setText (const FString&); void setActive(); void unsetActive() noexcept; - auto setMouseFocus (bool = true) -> bool; - auto unsetMouseFocus() -> bool; + void setMouseFocus (bool = true); + void unsetMouseFocus(); // Inquiry auto isActivated() const noexcept -> bool; @@ -157,8 +157,8 @@ inline void FStatusKey::unsetActive() noexcept { active = false; } //---------------------------------------------------------------------- -inline auto FStatusKey::unsetMouseFocus() -> bool -{ return setMouseFocus(false); } +inline void FStatusKey::unsetMouseFocus() +{ setMouseFocus(false); } //---------------------------------------------------------------------- inline auto FStatusKey::isActivated() const noexcept -> bool diff --git a/final/widget/ftextview.cpp b/final/widget/ftextview.cpp index 402f384a..477d3986 100644 --- a/final/widget/ftextview.cpp +++ b/final/widget/ftextview.cpp @@ -418,6 +418,10 @@ void FTextView::onWheel (FWheelEvent* ev) scrollBy (0, -distance); else if ( wheel == MouseWheel::Down ) scrollBy (0, distance); + else if ( wheel == MouseWheel::Left ) + scrollBy (-distance, 0); + else if ( wheel == MouseWheel::Right ) + scrollBy (distance, 0); if ( isShown() ) drawText(); @@ -745,10 +749,12 @@ void FTextView::cb_vbarChange (const FWidget*) break; case FScrollbar::ScrollType::WheelUp: + case FScrollbar::ScrollType::WheelLeft: scrollBy (0, -wheel_distance); break; case FScrollbar::ScrollType::WheelDown: + case FScrollbar::ScrollType::WheelRight: scrollBy (0, wheel_distance); break; @@ -792,10 +798,12 @@ void FTextView::cb_hbarChange (const FWidget*) break; case FScrollbar::ScrollType::WheelUp: + case FScrollbar::ScrollType::WheelLeft: scrollBy (-wheel_distance, 0); break; case FScrollbar::ScrollType::WheelDown: + case FScrollbar::ScrollType::WheelRight: scrollBy (wheel_distance, 0); break; diff --git a/final/widget/ftextview.h b/final/widget/ftextview.h index 9411d2b0..2db053d1 100644 --- a/final/widget/ftextview.h +++ b/final/widget/ftextview.h @@ -332,7 +332,7 @@ inline void FTextView::scrollTo (const FPoint& pos) template void FTextView::append (const std::initializer_list& list) { - for (auto& str : list) + for (const auto& str : list) insert(str, -1); } @@ -340,7 +340,7 @@ void FTextView::append (const std::initializer_list& list) template void FTextView::insert (const std::initializer_list& list, int pos) { - for (auto& str : list) + for (const auto& str : list) { insert(str, pos); pos++; diff --git a/final/widget/ftogglebutton.cpp b/final/widget/ftogglebutton.cpp index b1dfc4f9..74e85793 100644 --- a/final/widget/ftogglebutton.cpp +++ b/final/widget/ftogglebutton.cpp @@ -139,13 +139,13 @@ void FToggleButton::resetColors() } //---------------------------------------------------------------------- -auto FToggleButton::setNoUnderline (bool enable) -> bool +void FToggleButton::setNoUnderline (bool enable) { - return (setFlags().feature.no_underline = enable); + setFlags().feature.no_underline = enable; } //---------------------------------------------------------------------- -auto FToggleButton::setEnable (bool enable) -> bool +void FToggleButton::setEnable (bool enable) { FWidget::setEnable(enable); resetColors(); @@ -154,20 +154,16 @@ auto FToggleButton::setEnable (bool enable) -> bool setHotkeyAccelerator(); else delAccelerator(); - - return enable; } //---------------------------------------------------------------------- -auto FToggleButton::setChecked (bool enable) -> bool +void FToggleButton::setChecked (bool enable) { - if ( checked != enable ) - { - checked = enable; - processToggle(); - } + if ( checked == enable ) + return; - return checked; + checked = enable; + processToggle(); } //---------------------------------------------------------------------- diff --git a/final/widget/ftogglebutton.h b/final/widget/ftogglebutton.h index 35810cbe..55a24a48 100644 --- a/final/widget/ftogglebutton.h +++ b/final/widget/ftogglebutton.h @@ -91,13 +91,13 @@ class FToggleButton : public FWidget void setSize (const FSize&, bool = true) override; void setGeometry (const FPoint&, const FSize&, bool = true) override; void resetColors() override; - auto setNoUnderline (bool = true) -> bool; - auto unsetNoUnderline() -> bool; - auto setEnable (bool = true) -> bool override; - auto unsetEnable() -> bool override; - auto setDisable() -> bool override; - auto setChecked (bool = true) -> bool; - auto unsetChecked() -> bool; + void setNoUnderline (bool = true); + void unsetNoUnderline(); + void setEnable (bool = true) override; + void unsetEnable() override; + void setDisable() override; + void setChecked (bool = true); + void unsetChecked(); virtual void setText (const FString&); // Inquiries @@ -118,7 +118,7 @@ class FToggleButton : public FWidget protected: // Accessor auto getGroup() const -> FButtonGroup*; - friend auto getGroup (FToggleButton& toggle_btn) -> FButtonGroup*; + friend auto getGroup (const FToggleButton& toggle_btn) -> FButtonGroup*; // Mutator void setHotkeyAccelerator(); @@ -172,19 +172,20 @@ inline auto FToggleButton::getText() & -> FString& { return text; } //---------------------------------------------------------------------- -inline auto FToggleButton::unsetNoUnderline() -> bool -{ return setNoUnderline(false); } +inline void FToggleButton::unsetNoUnderline() +{ setNoUnderline(false); } + //---------------------------------------------------------------------- -inline auto FToggleButton::unsetEnable() -> bool -{ return setEnable(false); } +inline void FToggleButton::unsetEnable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FToggleButton::setDisable() -> bool -{ return setEnable(false); } +inline void FToggleButton::setDisable() +{ setEnable(false); } //---------------------------------------------------------------------- -inline auto FToggleButton::unsetChecked() -> bool -{ return setChecked(false); } +inline void FToggleButton::unsetChecked() +{ setChecked(false); } //---------------------------------------------------------------------- inline auto FToggleButton::isChecked() const noexcept -> bool diff --git a/final/widget/ftooltip.cpp b/final/widget/ftooltip.cpp index f7efa006..3ddf223c 100644 --- a/final/widget/ftooltip.cpp +++ b/final/widget/ftooltip.cpp @@ -83,11 +83,10 @@ void FToolTip::resetColors() } //---------------------------------------------------------------------- -auto FToolTip::setBorder (bool enable) -> bool +void FToolTip::setBorder (bool enable) { setFlags().feature.no_border = ! enable; calculateDimensions(); - return hasBorder(); } //---------------------------------------------------------------------- diff --git a/final/widget/ftooltip.h b/final/widget/ftooltip.h index e531a187..7f98d330 100644 --- a/final/widget/ftooltip.h +++ b/final/widget/ftooltip.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2016-2022 Markus Gans * +* Copyright 2016-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -82,8 +82,8 @@ class FToolTip : public FWindow void enableAutoTrim(); void disableAutoTrim(); void resetColors() override; - auto setBorder (bool = true) -> bool; - auto unsetBorder() -> bool; + void setBorder (bool = true); + void unsetBorder(); // Inquiries auto hasBorder() const -> bool; @@ -129,8 +129,8 @@ inline void FToolTip::disableAutoTrim() { text_auto_trim = false; } //---------------------------------------------------------------------- -inline auto FToolTip::unsetBorder() -> bool -{ return setBorder(false); } +inline void FToolTip::unsetBorder() +{ setBorder(false); } //---------------------------------------------------------------------- inline auto FToolTip::hasBorder() const -> bool diff --git a/final/widget/fwindow.cpp b/final/widget/fwindow.cpp index 5ae48dae..45ad8ad3 100644 --- a/final/widget/fwindow.cpp +++ b/final/widget/fwindow.cpp @@ -103,10 +103,10 @@ auto FWindow::getWindowFocusWidget() const -> FWidget* } //---------------------------------------------------------------------- -auto FWindow::setWindowWidget (bool enable) -> bool +void FWindow::setWindowWidget (bool enable) { if ( isWindowWidget() == enable ) - return true; + return; setFlags().type.window_widget = enable; @@ -114,8 +114,6 @@ auto FWindow::setWindowWidget (bool enable) -> bool setTermOffset(); else setParentOffset(); - - return enable; } //---------------------------------------------------------------------- @@ -179,19 +177,19 @@ void FWindow::unsetActiveWindow() const } //---------------------------------------------------------------------- -auto FWindow::setResizeable (bool enable) -> bool +void FWindow::setResizeable (bool enable) { - return (setFlags().feature.resizeable = enable); + setFlags().feature.resizeable = enable; } //---------------------------------------------------------------------- -auto FWindow::setMinimizable (bool enable) -> bool +void FWindow::setMinimizable (bool enable) { - return (setFlags().feature.minimizable = enable); + setFlags().feature.minimizable = enable; } //---------------------------------------------------------------------- -auto FWindow::setTransparentShadow (bool enable) -> bool +void FWindow::setTransparentShadow (bool enable) { setFlags().shadow.shadow = setFlags().shadow.trans_shadow = enable; @@ -199,15 +197,13 @@ auto FWindow::setTransparentShadow (bool enable) -> bool setShadowSize (FSize{2, 1}); else setShadowSize (FSize{0, 0}); - - return enable; } //---------------------------------------------------------------------- -auto FWindow::setShadow (bool enable) -> bool +void FWindow::setShadow (bool enable) { if ( FVTerm::getFOutput()->isMonochron() ) - return false; + return; if ( enable ) { @@ -221,15 +217,13 @@ auto FWindow::setShadow (bool enable) -> bool setFlags().shadow.trans_shadow = false; setShadowSize (FSize{0, 0}); } - - return enable; } //---------------------------------------------------------------------- -auto FWindow::setAlwaysOnTop (bool enable) -> bool +void FWindow::setAlwaysOnTop (bool enable) { if ( isAlwaysOnTop() == enable ) - return true; + return; setFlags().visibility.always_on_top = enable; @@ -245,8 +239,6 @@ auto FWindow::setAlwaysOnTop (bool enable) -> bool } else deleteFromAlwaysOnTopList (this); - - return enable; } //---------------------------------------------------------------------- diff --git a/final/widget/fwindow.h b/final/widget/fwindow.h index e95c6f28..c7b1d848 100644 --- a/final/widget/fwindow.h +++ b/final/widget/fwindow.h @@ -97,23 +97,23 @@ class FWindow : public FWidget auto getWindowFocusWidget() const -> FWidget*; // Mutators - auto setWindowWidget (bool = true) -> bool; - auto unsetWindowWidget() -> bool; + void setWindowWidget (bool = true); + void unsetWindowWidget(); static void setActiveWindow (FWindow*); void setWindowFocusWidget (FWidget*); auto activateWindow (bool = true) -> bool; void unsetActiveWindow() const; auto deactivateWindow() -> bool; - virtual auto setResizeable (bool = true) -> bool; - auto unsetResizeable() -> bool; - virtual auto setMinimizable (bool = true) -> bool; - auto unsetMinimizable() -> bool; - auto setTransparentShadow (bool = true) -> bool; - auto unsetTransparentShadow() -> bool; - auto setShadow (bool = true) -> bool; - auto unsetShadow() -> bool; - auto setAlwaysOnTop (bool = true) -> bool; - auto unsetAlwaysOnTop() -> bool; + virtual void setResizeable (bool = true); + void unsetResizeable(); + virtual void setMinimizable (bool = true); + void unsetMinimizable(); + void setTransparentShadow (bool = true); + void unsetTransparentShadow(); + void setShadow (bool = true); + void unsetShadow(); + void setAlwaysOnTop (bool = true); + void unsetAlwaysOnTop(); // Inquiries auto isZoomed() const noexcept -> bool; @@ -215,32 +215,32 @@ inline auto FWindow::getWindowLayer (WidgetT* obj) -> int } //---------------------------------------------------------------------- -inline auto FWindow::unsetWindowWidget() -> bool -{ return setWindowWidget(false); } +inline void FWindow::unsetWindowWidget() +{ setWindowWidget(false); } //---------------------------------------------------------------------- inline auto FWindow::deactivateWindow() -> bool { return activateWindow(false); } //---------------------------------------------------------------------- -inline auto FWindow::unsetResizeable() -> bool -{ return setResizeable(false); } +inline void FWindow::unsetResizeable() +{ setResizeable(false); } //---------------------------------------------------------------------- -inline auto FWindow::unsetMinimizable() -> bool -{ return setMinimizable(false); } +inline void FWindow::unsetMinimizable() +{ setMinimizable(false); } //---------------------------------------------------------------------- -inline auto FWindow::unsetTransparentShadow() -> bool -{ return setTransparentShadow(false); } +inline void FWindow::unsetTransparentShadow() +{ setTransparentShadow(false); } //---------------------------------------------------------------------- -inline auto FWindow::unsetShadow() -> bool -{ return setShadow(false); } +inline void FWindow::unsetShadow() +{ setShadow(false); } //---------------------------------------------------------------------- -inline auto FWindow::unsetAlwaysOnTop() -> bool -{ return setAlwaysOnTop(false); } +inline void FWindow::unsetAlwaysOnTop() +{ setAlwaysOnTop(false); } //---------------------------------------------------------------------- inline auto FWindow::isZoomed() const noexcept -> bool diff --git a/m4/ax_prefix_config_h.m4 b/m4/ax_prefix_config_h.m4 deleted file mode 100644 index 5a3b2f92..00000000 --- a/m4/ax_prefix_config_h.m4 +++ /dev/null @@ -1,203 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])] -# -# DESCRIPTION -# -# Generate an installable config.h. -# -# A package should not normally install its config.h as a system header, -# but if it must, this macro can be used to avoid namespace pollution by -# making a copy of config.h with a prefix added to all the macro names. -# -# Each "#define SOMEDEF" line of the configuration header has the given -# prefix added, in the same case as the first character of the macro name. -# -# Defaults: -# -# OUTPUT-HEADER = $PACKAGE-config.h -# PREFIX = $PACKAGE -# ORIG-HEADER, from AM_CONFIG_HEADER(config.h) -# -# Your configure.ac script should contain both macros in this order. -# -# Example: -# -# AC_INIT(config.h.in) # config.h.in as created by "autoheader" -# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE -# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in -# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it.. -# AC_MEMORY_H # makes "#undef NEED_MEMORY_H" -# AC_C_CONST_H # makes "#undef const" -# AC_OUTPUT(Makefile) # creates the "config.h" now -# # and also mylib/_config.h -# -# If the argument to AX_PREFIX_CONFIG_H would have been omitted then the -# default output file would have been called simply "testpkg-config.h", -# but even under the name "mylib/_config.h" it contains prefix-defines -# like -# -# #ifndef TESTPKG_VERSION -# #define TESTPKG_VERSION "0.1.1" -# #endif -# #ifndef TESTPKG_NEED_MEMORY_H -# #define TESTPKG_NEED_MEMORY_H 1 -# #endif -# #ifndef _testpkg_const -# #define _testpkg_const _const -# #endif -# -# and this "mylib/_config.h" can be installed along with other header -# files, which is most convenient when creating a shared library (that has -# some headers) whose functionality depends on features detected at -# compile-time. No need to invent some "mylib-confdefs.h.in" manually. -# -# Note that some AC_DEFINEs that end up in the config.h file are actually -# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T -# say that they "will define inline|const|off_t if the system does not do -# it by itself". You might want to clean up about these - consider an -# extra mylib/conf.h that reads something like: -# -# #include -# #ifndef _testpkg_const -# #define _testpkg_const const -# #endif -# -# and then start using _testpkg_const in the header files. That is also a -# good thing to differentiate whether some library-user has starting to -# take up with a different compiler, so perhaps it could read something -# like this: -# -# #ifdef _MSC_VER -# #include -# #else -# #include -# #endif -# #ifndef _testpkg_const -# #define _testpkg_const const -# #endif -# -# LICENSE -# -# Copyright (c) 2014 Reuben Thomas -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2008 Marten Svantesson -# Copyright (c) 2008 Gerald Point -# -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 15 - -AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl -AC_PREREQ([2.62]) -AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl -AC_CONFIG_COMMANDS(m4_default([$1], [$PACKAGE-config.h]),[dnl -AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl -AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl -AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl -AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl -AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl -AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl -m4_pushdef([_script],[conftest.prefix])dnl -m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl -_OUT=`echo m4_default([$1], [$PACKAGE-config.h])` -_DEF=`echo $_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"` -_PKG=`echo m4_default([$2], [$PACKAGE])` -_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"` -_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"` -_INP=`echo "$3" | sed -e 's/ *//'` -if test ".$_INP" = "."; then - for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue - case "$ac_file" in - *.h) _INP=$ac_file ;; - *) - esac - test ".$_INP" != "." && break - done -fi -if test ".$_INP" = "."; then - case "$_OUT" in - */*) _INP=`basename "$_OUT"` - ;; - *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"` - ;; - *) _INP=config.h - ;; - esac -fi -if test -z "$_PKG" ; then - AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H]) -else - if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then - _INP="$srcdir/$_INP" - fi fi - AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines) - if test -f $_INP ; then - AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/"]) > _script - AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/"]) >> _script - AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1\\"]) >> _script - AS_ECHO(["@%:@def[]ine $_UPP""_\\1\\2\\"]) >> _script - AS_ECHO(["@%:@endif/"]) >> _script - AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1\\"]) >> _script - AS_ECHO(["@%:@define $_LOW""_\\1\\2\\"]) >> _script - AS_ECHO(["@%:@endif/"]) >> _script - # now executing _script on _DEF input to create _OUT output file - echo "@%:@ifndef $_DEF" >$tmp/pconfig.h - echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h - echo '' >>$tmp/pconfig.h - echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h - - sed -f _script $_INP >>$tmp/pconfig.h - echo '' >>$tmp/pconfig.h - echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h - echo "@%:@endif" >>$tmp/pconfig.h - if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then - AC_MSG_NOTICE([$_OUT is unchanged]) - else - ac_dir=`AS_DIRNAME(["$_OUT"])` - AS_MKDIR_P(["$ac_dir"]) - rm -f "$_OUT" - mv $tmp/pconfig.h "$_OUT" - fi - else - AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT]) - fi - rm -f conftest.* -fi -m4_popdef([_symbol])dnl -m4_popdef([_script])dnl -AS_VAR_POPDEF([_INP])dnl -AS_VAR_POPDEF([_UPP])dnl -AS_VAR_POPDEF([_LOW])dnl -AS_VAR_POPDEF([_PKG])dnl -AS_VAR_POPDEF([_DEF])dnl -AS_VAR_POPDEF([_OUT])dnl -],[PACKAGE="$PACKAGE"])]) diff --git a/m4/libtool.m4 b/m4/libtool.m4 deleted file mode 100644 index c4c02946..00000000 --- a/m4/libtool.m4 +++ /dev/null @@ -1,8394 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 2014 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. - -# GNU Libtool 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 of of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program or library that is built -# using GNU Libtool, you may include this file under the same -# distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 . -]) - -# serial 58 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_PREPARE_CC_BASENAME -# ----------------------- -m4_defun([_LT_PREPARE_CC_BASENAME], [ -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in @S|@*""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} -])# _LT_PREPARE_CC_BASENAME - - -# _LT_CC_BASENAME(CC) -# ------------------- -# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, -# but that macro is also expanded into generated libtool script, which -# arranges for $SED and $ECHO to be set by different means. -m4_defun([_LT_CC_BASENAME], -[m4_require([_LT_PREPARE_CC_BASENAME])dnl -AC_REQUIRE([_LT_DECL_SED])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl -func_cc_basename $1 -cc_basename=$func_cc_basename_result -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl -dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl -m4_require([_LT_CMD_TRUNCATE])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options that allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld=$lt_cv_prog_gnu_ld - -old_CC=$CC -old_CFLAGS=$CFLAGS - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from 'configure', and 'config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# 'config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain=$ac_aux_dir/ltmain.sh -])# _LT_PROG_LTMAIN - - -## ------------------------------------- ## -## Accumulate code for creating libtool. ## -## ------------------------------------- ## - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the 'libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - -## ------------------------ ## -## FIXME: Eliminate VARNAME ## -## ------------------------ ## - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to 'config.status' so that its -# declaration there will have the same value as in 'configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags='_LT_TAGS'dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into 'config.status', and then the shell code to quote escape them in -# for loops in 'config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -_LT_OUTPUT_LIBTOOL_INIT -]) - -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# '#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test 0 = "$lt_write_fail" && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -'$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2011 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test 0 != $[#] -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try '$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try '$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test yes = "$silent" && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options that allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST - fi - - cfgfile=${ofile}T - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL -# Generated automatically by $as_me ($PACKAGE) $VERSION -# NOTE: Changes made to this file will be lost: look at ltmain.sh. - -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit, 1996 - -_LT_COPYING -_LT_LIBTOOL_TAGS - -# Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - cat <<'_LT_EOF' >> "$cfgfile" - -# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE - -_LT_PREPARE_MUNGE_PATH_LIST -_LT_PREPARE_CC_BASENAME - -# ### END FUNCTIONS SHARED WITH CONFIGURE - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Go], [_LT_LANG(GO)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -m4_ifndef([AC_PROG_GO], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_GO. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -m4_defun([AC_PROG_GO], -[AC_LANG_PUSH(Go)dnl -AC_ARG_VAR([GOC], [Go compiler command])dnl -AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl -_AC_ARG_VAR_LDFLAGS()dnl -AC_CHECK_TOOL(GOC, gccgo) -if test -z "$GOC"; then - if test -n "$ac_tool_prefix"; then - AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) - fi -fi -if test -z "$GOC"; then - AC_CHECK_PROG(GOC, gccgo, gccgo, false) -fi -])#m4_defun -])#m4_ifndef - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([AC_PROG_GO], - [LT_LANG(GO)], - [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS=$save_LDFLAGS - ]) - - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[912]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*|11.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test yes = "$lt_cv_apple_cc_single_mod"; then - _lt_dar_single_mod='$single_module' - fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' - fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES([TAG]) -# --------------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test yes = "$lt_cv_ld_force_load"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], - [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - m4_if([$1], [CXX], -[ if test yes != "$lt_cv_apple_cc_single_mod"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script that will find a shell with a builtin -# printf (that we can use as an echo command). -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -case $ECHO in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], - [Search for dependent libraries within DIR (or the compiler's sysroot - if not specified).])], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case $with_sysroot in #( - yes) - if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([$with_sysroot]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac - - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and where our libraries should be installed.])]) - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test no = "$enable_libtool_lock" || enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE=32 - ;; - *ELF-64*) - HPUX_IA64_MODE=64 - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test yes != "$lt_cv_cc_needs_belf"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS - fi - ;; -*-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*|x86_64-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks=$enable_libtool_lock -])# _LT_ENABLE_LOCK - - -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cr} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test 0 -eq "$ac_status"; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test 0 -ne "$ac_status"; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test yes = "[$]$2"; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS -]) - -if test yes = "[$]$2"; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring=ABCD - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n "$lt_cv_sys_max_cmd_len"; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test yes = "$cross_compiling"; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test yes != "$enable_dlopen"; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen=load_add_on - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ - lt_cv_dlopen=dyld - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen=shl_load], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen=dlopen], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else - enable_dlopen=yes - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS=$LDFLAGS - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS=$LIBS - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test yes = "$lt_cv_dlopen_self"; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links=nottested -if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test no = "$hard_links"; then - AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", - [Define to the sub-directory where libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then - - # We can hardcode non-existent directories. - if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && - test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || - test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_PREPARE_MUNGE_PATH_LIST -# --------------------------- -# Make sure func_munge_path_list() is defined correctly. -m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], -[[# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x@S|@2 in - x) - ;; - *:) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" - ;; - x:*) - eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" - ;; - *) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" - ;; - esac -} -]])# _LT_PREPARE_PATH_LIST - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test yes = "$GCC"; then - case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -AC_ARG_VAR([LT_SYS_LIBRARY_PATH], -[User-defined run-time library search path.]) - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[[4-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a[(]lib.so.V[)]' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec=$LIB - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[23]].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], - [Detected run-time system search path for libraries]) -_LT_DECL([], [configure_time_lt_sys_library_path], [2], - [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program that can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$1"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac]) -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program that can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test no = "$withval" || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i -cat conftest.i conftest.i >conftest2.i -: ${lt_DD:=$DD} -AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], -[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: -fi]) -rm -f conftest.i conftest2.i conftest.out]) -])# _LT_PATH_DD - - -# _LT_CMD_TRUNCATE -# ---------------- -# find command to truncate a binary pipe -m4_defun([_LT_CMD_TRUNCATE], -[m4_require([_LT_PATH_DD]) -AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], -[printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -lt_cv_truncate_bin= -if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" -fi -rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) -_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], - [Command to truncate a binary pipe]) -])# _LT_CMD_TRUNCATE - - -# _LT_CHECK_MAGIC_METHOD -# ---------------------- -# how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_MAGIC_METHOD], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -AC_CACHE_CHECK([how to recognize dependent libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[[4-9]]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[[45]]*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -os2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM=$NM -else - lt_nm_to_check=${ac_tool_prefix}nm - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty - case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; - *) lt_bad_file=/dev/null ;; - esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in - *$lt_bad_file* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break 2 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break 2 - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS=$lt_save_ifs - done - : ${lt_cv_path_NM=no} -fi]) -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" - ;; - *) - DUMPBIN=: - ;; - esac - fi - AC_SUBST([DUMPBIN]) - if test : != "$DUMPBIN"; then - NM=$DUMPBIN - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test yes != "$lt_cv_path_mainfest_tool"; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# _LT_DLL_DEF_P([FILE]) -# --------------------- -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with func_dll_def_p in the libtool script -AC_DEFUN([_LT_DLL_DEF_P], -[dnl - test DEF = "`$SED -n dnl - -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace - -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments - -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl - -e q dnl Only consider the first "real" line - $1`" dnl -])# _LT_DLL_DEF_P - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM=-lm) - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test yes = "$GCC"; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test ia64 = "$host_cpu"; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD - if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], - [Transform the output of nm into a list of symbols to manually relocate]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], - [The name lister interface]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test yes = "$GXX"; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - if test ia64 != "$host_cpu"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd* | netbsdelf*-gnu) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test yes = "$GCC"; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # flang / f18. f95 an alias for gfortran or flang on Debian - flang* | f18* | f95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ F* | *Sun*Fortran*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Intel*\ [[CF]]*Compiler*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - *Portland\ Group*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - with_gnu_ld=no - ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test yes = "$lt_use_gnu_ld_interface"; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test linux-dietlibc = "$host_os"; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - tcc*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' - ;; - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then - aix_use_runtimelinking=yes - break - fi - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # traditional, no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - ;; - esac - - if test yes = "$GCC"; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - ;; - - hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) - ;; - esac - fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS=$save_LDFLAGS]) - if test yes = "$lt_cv_irix_exported_symbol"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' - fi - _LT_TAGVAR(link_all_deplibs, $1)=no - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - linux*) - case $cc_basename in - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(ld_shlibs, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - netbsd* | netbsdelf*-gnu) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - osf3*) - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test sequent = "$host_vendor"; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test sni = "$host_vendor"; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting $shlibpath_var if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC=$CC -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report what library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC=$lt_save_CC -])# _LT_LANG_C_CONFIG - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test yes = "$GXX"; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test yes = "$GXX"; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test yes = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='$wl' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - ;; - esac - - if test yes = "$GXX"; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - # The "-G" linker flag allows undefined symbols. - _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared - # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' - else - # g++ 2.7 appears to require '-G' NOT '-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - - _LT_TAGVAR(GCC, $1)=$GXX - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test yes != "$_lt_caught_CXX_error" - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case @S|@2 in - .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; - *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF -package foo -func foo() { -} -_LT_EOF -]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test no = "$pre_test_object_deps_done"; then - case $prev in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)=$prev$p - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test no = "$pre_test_object_deps_done"; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)=$p - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)=$p - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test no = "$F77"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_F77"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)=$G77 - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_F77" - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test no = "$FC"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_FC"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_FC" - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_GO_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Go compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_GO_CONFIG], -[AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE - -# Source file extension for Go test sources. -ac_ext=go - -# Object file extension for compiled Go test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="package main; func main() { }" - -# Code to be used in simple link tests -lt_simple_link_test_code='package main; func main() { }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GOC-"gccgo"} -CFLAGS=$GOFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD -_LT_CC_BASENAME([$compiler]) - -# Go did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GO_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code=$lt_simple_compile_test_code - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_GO -# ---------- -AC_DEFUN([LT_PROG_GO], -[AC_CHECK_TOOL(GOC, gccgo,) -]) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f "$lt_ac_sed" && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test 10 -lt "$lt_ac_count" && break - lt_ac_count=`expr $lt_ac_count + 1` - if test "$lt_ac_count" -gt "$lt_ac_max"; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine what file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4 deleted file mode 100644 index 94b08297..00000000 --- a/m4/ltoptions.m4 +++ /dev/null @@ -1,437 +0,0 @@ -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 8 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option '$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl 'shared' nor 'disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], - [_LT_WITH_AIX_SONAME([aix])]) - ]) -])# _LT_SET_OPTIONS - - -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the 'shared' and -# 'disable-shared' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the 'static' and -# 'disable-static' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the 'fast-install' -# and 'disable-fast-install' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_AIX_SONAME([DEFAULT]) -# ---------------------------------- -# implement the --with-aix-soname flag, and support the `aix-soname=aix' -# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT -# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. -m4_define([_LT_WITH_AIX_SONAME], -[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl -shared_archive_member_spec= -case $host,$enable_shared in -power*-*-aix[[5-9]]*,yes) - AC_MSG_CHECKING([which variant of shared library versioning to provide]) - AC_ARG_WITH([aix-soname], - [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], - [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], - [case $withval in - aix|svr4|both) - ;; - *) - AC_MSG_ERROR([Unknown argument to --with-aix-soname]) - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname], - [AC_CACHE_VAL([lt_cv_with_aix_soname], - [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) - with_aix_soname=$lt_cv_with_aix_soname]) - AC_MSG_RESULT([$with_aix_soname]) - if test aix != "$with_aix_soname"; then - # For the AIX way of multilib, we name the shared archive member - # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', - # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. - # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, - # the AIX toolchain works better with OBJECT_MODE set (default 32). - if test 64 = "${OBJECT_MODE-32}"; then - shared_archive_member_spec=shr_64 - else - shared_archive_member_spec=shr - fi - fi - ;; -*) - with_aix_soname=aix - ;; -esac - -_LT_DECL([], [shared_archive_member_spec], [0], - [Shared archive member basename, for filename based shared library versioning on AIX])dnl -])# _LT_WITH_AIX_SONAME - -LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) -LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) -LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' -# LT_INIT options. -# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [pic_mode=m4_default([$1], [default])]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - -## ----------------- ## -## LTDL_INIT Options ## -## ----------------- ## - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4 deleted file mode 100644 index 48bc9344..00000000 --- a/m4/ltsugar.m4 +++ /dev/null @@ -1,124 +0,0 @@ -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software -# Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59, which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) diff --git a/m4/ltversion.m4 b/m4/ltversion.m4 deleted file mode 100644 index fa04b52a..00000000 --- a/m4/ltversion.m4 +++ /dev/null @@ -1,23 +0,0 @@ -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# @configure_input@ - -# serial 4179 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 deleted file mode 100644 index c6b26f88..00000000 --- a/m4/lt~obsolete.m4 +++ /dev/null @@ -1,99 +0,0 @@ -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/misc/icon/scalable/finalcut.svg b/misc/icon/scalable/finalcut.svg index 3983e085..9c443376 100644 --- a/misc/icon/scalable/finalcut.svg +++ b/misc/icon/scalable/finalcut.svg @@ -1,144 +1 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/misc/logo/png/finalcut-logo.png b/misc/logo/png/finalcut-logo.png index 3a66c498..0e8ebd97 100644 Binary files a/misc/logo/png/finalcut-logo.png and b/misc/logo/png/finalcut-logo.png differ diff --git a/misc/logo/svg/finalcut-logo.svg b/misc/logo/svg/finalcut-logo.svg index 5426d960..f9310018 100644 --- a/misc/logo/svg/finalcut-logo.svg +++ b/misc/logo/svg/finalcut-logo.svg @@ -1,303 +1 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FINAL CUT - - - - - - - - - - - FINAL CUT - - +FINAL CUTFINAL CUT \ No newline at end of file diff --git a/test/Makefile.am b/test/Makefile.am index 30d53e34..e8ee3326 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -10,11 +10,12 @@ AM_LDFLAGS = -L$(top_builddir)/final/.libs AM_CPPFLAGS = -I$(top_srcdir)/final -Wall -Werror -std=c++14 noinst_PROGRAMS = \ + char_ringbuffer_test \ + eventloop_monitor_test \ fcallback_test \ fcolorpair_test \ fdata_test \ fevent_test \ - char_ringbuffer_test \ fkeyboard_test \ flogger_test \ fmouse_test \ @@ -24,15 +25,15 @@ noinst_PROGRAMS = \ fpoint_test \ frect_test \ fsize_test \ - fstringstream_test \ fstring_test \ + fstringstream_test \ fstyle_test \ - ftermcapquirks_test \ + fterm_functions_test \ ftermcap_test \ + ftermcapquirks_test \ ftermdata_test \ ftermdetection_test \ ftermfreebsd_test \ - fterm_functions_test \ ftermlinux_test \ ftermopenbsd_test \ ftimer_test \ @@ -41,11 +42,12 @@ noinst_PROGRAMS = \ fvtermbuffer_test \ fwidget_test +char_ringbuffer_test_SOURCES = char_ringbuffer-test.cpp +eventloop_monitor_test_SOURCES = eventloop-monitor-test.cpp fcallback_test_SOURCES = fcallback-test.cpp fcolorpair_test_SOURCES = fcolorpair-test.cpp fdata_test_SOURCES = fdata-test.cpp fevent_test_SOURCES = fevent-test.cpp -char_ringbuffer_test_SOURCES = char_ringbuffer-test.cpp fkeyboard_test_SOURCES = fkeyboard-test.cpp flogger_test_SOURCES = flogger-test.cpp fmouse_test_SOURCES = fmouse-test.cpp @@ -55,20 +57,20 @@ foptimove_test_SOURCES = foptimove-test.cpp fpoint_test_SOURCES = fpoint-test.cpp frect_test_SOURCES = frect-test.cpp fsize_test_SOURCES = fsize-test.cpp -fstringstream_test_SOURCES = fstringstream-test.cpp fstring_test_SOURCES = fstring-test.cpp +fstringstream_test_SOURCES = fstringstream-test.cpp fstyle_test_SOURCES = fstyle-test.cpp -ftermcapquirks_test_SOURCES = ftermcapquirks-test.cpp +fterm_functions_test_SOURCES = fterm_functions-test.cpp ftermcap_test_SOURCES = ftermcap-test.cpp +ftermcapquirks_test_SOURCES = ftermcapquirks-test.cpp ftermdata_test_SOURCES = ftermdata-test.cpp ftermdetection_test_SOURCES = ftermdetection-test.cpp -ftermfreebsd_test_SOURCES = ftermfreebsd-test.cpp ftermfreebsd_test_LDADD = @TERMCAP_LIB@ -fterm_functions_test_SOURCES = fterm_functions-test.cpp -ftermlinux_test_SOURCES = ftermlinux-test.cpp +ftermfreebsd_test_SOURCES = ftermfreebsd-test.cpp ftermlinux_test_LDADD = @TERMCAP_LIB@ -ftermopenbsd_test_SOURCES = ftermopenbsd-test.cpp +ftermlinux_test_SOURCES = ftermlinux-test.cpp ftermopenbsd_test_LDADD = @TERMCAP_LIB@ +ftermopenbsd_test_SOURCES = ftermopenbsd-test.cpp ftimer_test_SOURCES = ftimer-test.cpp fvterm_test_SOURCES = fvterm-test.cpp fvtermattribute_test_SOURCES = fvtermattribute-test.cpp @@ -76,11 +78,12 @@ fvtermbuffer_test_SOURCES = fvtermbuffer-test.cpp fwidget_test_SOURCES = fwidget-test.cpp TESTS = \ + char_ringbuffer_test \ + eventloop_monitor_test \ fcallback_test \ fcolorpair_test \ fdata_test \ fevent_test \ - char_ringbuffer_test \ fkeyboard_test \ flogger_test \ fmouse_test \ @@ -90,15 +93,15 @@ TESTS = \ fpoint_test \ frect_test \ fsize_test \ - fstringstream_test \ fstring_test \ + fstringstream_test \ fstyle_test \ - ftermcapquirks_test \ + fterm_functions_test \ ftermcap_test \ + ftermcapquirks_test \ ftermdata_test \ ftermdetection_test \ ftermfreebsd_test \ - fterm_functions_test \ ftermlinux_test \ ftermopenbsd_test \ ftimer_test \ diff --git a/test/Makefile.clang b/test/Makefile.clang index 7f0bced4..7ce84a31 100644 --- a/test/Makefile.clang +++ b/test/Makefile.clang @@ -11,7 +11,7 @@ SRCS = $(wildcard *.cpp) OBJS = $(SRCS:%.cpp=%) CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) -std=c++14 MAKEFILE = -f Makefile.clang -LDFLAGS = -L../src -lfinal $(TERMCAP) -lcppunit -ldl +LDFLAGS = -L../final -lfinal $(TERMCAP) -lcppunit -ldl INCLUDES = -I. -I.. -I/usr/include RM = rm -f @@ -31,7 +31,7 @@ endif all: $(OBJS) unittest: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -D UNIT_TEST -Wall -Wextra -Wpedantic -Wno-padded -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-implicit-fallthrough" check: test test: unittest diff --git a/test/Makefile.gcc b/test/Makefile.gcc index b5b7f951..cec48cb2 100644 --- a/test/Makefile.gcc +++ b/test/Makefile.gcc @@ -11,7 +11,7 @@ SRCS = $(wildcard *.cpp) OBJS = $(SRCS:%.cpp=%) CCXFLAGS = $(OPTIMIZE) $(PROFILE) $(DEBUG) -std=c++14 MAKEFILE = -f Makefile.gcc -LDFLAGS = -L../src -lfinal $(TERMCAP) -lcppunit -ldl +LDFLAGS = -L../final -lfinal $(TERMCAP) -lcppunit -ldl INCLUDES = -I. -I.. -I/usr/include RM = rm -f @@ -31,7 +31,7 @@ endif all: $(OBJS) unittest: - $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -DUNIT_TEST -Wall -Wextra -Wpedantic" + $(MAKE) $(MAKEFILE) DEBUG="-g -D DEBUG -D UNIT_TEST -Wall -Wextra -Wpedantic" check: test test: unittest diff --git a/test/conemu.h b/test/conemu.h index a7ec23a3..6af5bf38 100644 --- a/test/conemu.h +++ b/test/conemu.h @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2019-2022 Markus Gans * +* Copyright 2019-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -82,6 +82,9 @@ class ConEmu // Constructors ConEmu() { + // create timer instance + finalcut::FObjectTimer timer{}; + // Map shared memory void* ptr = mmap ( nullptr , sizeof(*shared_state) @@ -481,14 +484,16 @@ inline void ConEmu::printConEmuDebug() echo -e \"\\r\"; \ done'"; system(debug_command); + std::cout << std::flush; + std::fflush (stdout); } //---------------------------------------------------------------------- inline void ConEmu::closeConEmuStdStreams() { - close(fd_stdin); // stdin - close(fd_stdout); // stdout - close(fd_stderr); // stderr + ::close(fd_stdin); // stdin + ::close(fd_stdout); // stdout + ::close(fd_stderr); // stderr } //---------------------------------------------------------------------- @@ -518,7 +523,7 @@ inline auto ConEmu::forkConEmu() -> pid_t #ifdef TIOCSCTTY // Set controlling tty - if ( ioctl(fd_slave, TIOCSCTTY, 0) == -1 ) + if ( ::ioctl(fd_slave, TIOCSCTTY, 0) == -1 ) { *shared_state = true; return -1; @@ -542,7 +547,7 @@ inline auto ConEmu::forkConEmu() -> pid_t size.ws_row = 25; size.ws_col = 80; - if ( ioctl(fd_slave, TIOCSWINSZ, &size) == -1) + if ( ::ioctl(fd_slave, TIOCSWINSZ, &size) == -1) { *shared_state = true; return -1; @@ -874,7 +879,7 @@ inline auto ConEmu::openSlavePTY() -> bool return false; // Open the slave PTY - fd_slave = open(pty_name, O_RDWR); + fd_slave = ::open(pty_name, O_RDWR); if ( fd_slave < 0 ) return false; @@ -888,7 +893,7 @@ inline void ConEmu::closeMasterPTY() if ( fd_master <= 0 ) return; - close (fd_master); + ::close (fd_master); fd_master = -1; } @@ -898,7 +903,7 @@ inline void ConEmu::closeSlavePTY() if ( fd_slave <= 0 ) return; - close (fd_slave); + ::close (fd_slave); fd_slave = -1; } diff --git a/test/eventloop-monitor-test.cpp b/test/eventloop-monitor-test.cpp new file mode 100644 index 00000000..e82b32f2 --- /dev/null +++ b/test/eventloop-monitor-test.cpp @@ -0,0 +1,1093 @@ +/*********************************************************************** +* eventloop-monitor-test.cpp - Event loop monitor unit tests * +* * +* This file is part of the FINAL CUT widget toolkit * +* * +* Copyright 2023 Markus Gans * +* * +* FINAL CUT is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as * +* published by the Free Software Foundation; either version 3 of * +* the License, or (at your option) any later version. * +* * +* FINAL CUT 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 Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public * +* License along with this program. If not, see * +* . * +***********************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#define USE_FINAL_H +#include +#undef USE_FINAL_H + +using std::chrono::duration_cast; +using std::chrono::milliseconds; +using std::chrono::high_resolution_clock; + +void getException() +{ throw finalcut::monitor_error{"Monitor error"}; } + +void getNoException() +{ } + + +//---------------------------------------------------------------------- +// class FWidget_protected +//---------------------------------------------------------------------- + +class Monitor_protected : public finalcut::Monitor +{ + public: + // Using-declaration + using Monitor::Monitor; + + // Destructor + ~Monitor_protected() override; + + // Mutators + void p_setFileDescriptor (int); + void p_setEvents (short); + void p_setHandler (finalcut::handler_t&&); + + template + void p_setUserContext (T&&); + void p_setInitialized(); + + // Inquiry + auto p_isInitialized() const -> bool; + + // Methods + void p_trigger (short); +}; + +//---------------------------------------------------------------------- +inline Monitor_protected::~Monitor_protected() = default; // destructor + +//---------------------------------------------------------------------- +inline void Monitor_protected::p_setFileDescriptor (int file_descriptor) +{ + finalcut::Monitor::setFileDescriptor(file_descriptor); +} + +//---------------------------------------------------------------------- +inline void Monitor_protected::p_setEvents (short ev) +{ + finalcut::Monitor::setEvents(ev); +} + +//---------------------------------------------------------------------- +inline void Monitor_protected::p_setHandler (finalcut::handler_t&& hdl) +{ + finalcut::Monitor::setHandler(std::move(hdl)); +} + +//---------------------------------------------------------------------- +template +inline void Monitor_protected::p_setUserContext (T&& uc) +{ + finalcut::Monitor::setUserContext(std::move(uc)); +} + +//---------------------------------------------------------------------- +inline void Monitor_protected::p_setInitialized() +{ + finalcut::Monitor::setInitialized(); +} + +//---------------------------------------------------------------------- +inline auto Monitor_protected::p_isInitialized() const -> bool +{ + return finalcut::Monitor::isInitialized(); +} + +//---------------------------------------------------------------------- +inline void Monitor_protected::p_trigger (short return_events) +{ + finalcut::Monitor::trigger(return_events); +} + + +//---------------------------------------------------------------------- +// class KqueueTimer_protected +//---------------------------------------------------------------------- + +class KqueueTimer_protected : public finalcut::KqueueTimer +{ + public: + // Using-declaration + using KqueueTimer::KqueueTimer; + + // Destructor + ~KqueueTimer_protected() override; + + // Methods + void p_trigger (short); +}; + +//---------------------------------------------------------------------- +inline KqueueTimer_protected::~KqueueTimer_protected() = default; // destructor + +//---------------------------------------------------------------------- +inline void KqueueTimer_protected::p_trigger (short return_events) +{ + finalcut::Monitor::trigger(return_events); +} + + +namespace +{ + +std::function signal_handler; + +//---------------------------------------------------------------------- +void sigHandler (int num) +{ + CPPUNIT_ASSERT ( num == SIGALRM ); + std::cout << "Call sigHandler(" << num << ")\n"; + signal_handler(num); +} + +} + +#if !defined(USE_KQUEUE_TIMER) + using u_short = unsigned short; + using u_int = unsigned int; + + struct kevent + { + uintptr_t ident; // Identifier for this event + short filter; // Filter for event + u_short flags; // Action flags for kqueue + u_int fflags; // Filter flag value + int64_t data; // Filter data value + void* udata; // Opaque user data identifier + }; + + // Event filter + #define EVFILT_READ (-1) // File descriptor read + #define EVFILT_WRITE (-2) // File descriptor write + #define EVFILT_AIO (-3) // Attached to aio requests + #define EVFILT_VNODE (-4) // Attached to vnodes + #define EVFILT_PROC (-5) // Attached to struct process + #define EVFILT_SIGNAL (-6) // Attached to struct process + #define EVFILT_TIMER (-7) // Timers + #define EVFILT_DEVICE (-8) // Devices + #define EVFILT_EXCEPT (-9) // Exceptional conditions +#endif + + +namespace test +{ + +//---------------------------------------------------------------------- +// class FSystemTest +//---------------------------------------------------------------------- + +class FSystemTest : public finalcut::FSystem +{ + public: + // Constructor + FSystemTest(); + + // Methods + auto inPortByte (uShort) -> uChar override; + void outPortByte (uChar, uShort) override; + auto isTTY (int) const -> int override; + auto ioctl (int, uLong, ...) -> int override; + auto pipe (finalcut::PipeData&) -> int override; + auto open (const char*, int, ...) -> int override; + auto close (int) -> int override; + auto fopen (const char*, const char*) -> FILE* override; + auto fputs (const char*, FILE*) -> int override; + auto fclose (FILE*) -> int override; + auto putchar (int) -> int override; + auto sigaction ( int, const struct sigaction* + , struct sigaction*) -> int override; + auto timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int override; + auto timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int override; + auto timer_delete (timer_t) -> int override; + auto kqueue() -> int override; + auto kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec* ) -> int override; + auto getuid() -> uid_t override; + auto geteuid() -> uid_t override; + auto getpwuid_r ( uid_t, struct passwd*, char* + , size_t, struct passwd** ) -> int override; + auto realpath (const char*, char*) -> char* override; + void setPipeReturnValue (int); + void setSigactionReturnValue (int); + void setTimerCreateReturnValue (int); + void setTimerSettimeReturnValue (int); + void setTimerDeleteReturnValue (int); + void setKqueueReturnValue (int); + void setKeventReturnValue (int); + + private: + int pipe_ret_value{0}; + int sigaction_ret_value{0}; + int timer_create_ret_value{0}; + int timer_settime_ret_value{0}; + int timer_delete_ret_value{0}; + int kqueue_ret_value{0}; + int kevent_ret_value{0}; +}; + + +// constructors and destructor +//---------------------------------------------------------------------- +FSystemTest::FSystemTest() // constructor +{ } + + +// public methods of FSystemTest +//---------------------------------------------------------------------- +inline auto FSystemTest::inPortByte (uShort) -> uChar +{ + return 0; +} + +//---------------------------------------------------------------------- +inline void FSystemTest::outPortByte (uChar, uShort) +{ } + +//---------------------------------------------------------------------- +inline auto FSystemTest::isTTY (int file_descriptor) const -> int +{ + std::cerr << "Call: isatty (file_descriptor=" << file_descriptor << ")\n"; + return 1; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::ioctl (int file_descriptor, uLong request, ...) -> int +{ + va_list args{}; + void* argp{}; + int ret_val{0}; + + va_start (args, request); + argp = va_arg (args, void*); + va_end (args); + + std::cerr << "Call: ioctl (file_descriptor=" << file_descriptor + << ", request=0x" << std::hex << request + << ", argp=" << argp << std::dec << ")\n"; + return ret_val; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::pipe (finalcut::PipeData& pipe) -> int +{ + std::cerr << "Call: pipe (pipefd={" + << pipe.getReadFd() << ", " + << pipe.getWriteFd() << "})\n"; + return pipe_ret_value; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::open (const char* pathname, int flags, ...) -> int +{ + va_list args{}; + va_start (args, flags); + auto mode = static_cast(va_arg (args, int)); + va_end (args); + + std::cerr << "Call: open (pathname=\"" << pathname + << "\", flags=" << flags + << ", mode=" << mode << ")\n"; + + return 0; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::close (int file_descriptor) -> int +{ + std::cerr << "Call: close (file_descriptor=" << file_descriptor << ")\n"; + return 0; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::fopen (const char* path, const char* mode) -> FILE* +{ + std::cerr << "Call: fopen (path=" << path + << ", mode=" << mode << ")\n"; + return nullptr; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::fclose (FILE* file_ptr) -> int +{ + std::cerr << "Call: fclose (file_ptr=" << file_ptr << ")\n"; + return 0; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::fputs (const char* str, FILE* stream) -> int +{ + return std::fputs(str, stream); +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::putchar (int c) -> int +{ +#if defined(__sun) && defined(__SVR4) + return std::putchar(char(c)); +#else + return std::putchar(c); +#endif +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::sigaction ( int signum + , const struct sigaction* act + , struct sigaction* oldact ) -> int +{ + std::cerr << "Call: sigaction (signum=" << signum + << ", act=" << act + << ", oldact=" << oldact << ")\n"; + return sigaction_ret_value; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::timer_create ( clockid_t clockid + , struct sigevent* sevp + , timer_t* timerid ) -> int +{ + std::cerr << "Call: timer_create (clockid=" << clockid + << ", sevp=" << sevp + << ", timerid=" << timerid << ")\n"; + return timer_create_ret_value; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::timer_settime ( timer_t timer_id + , int flags + , const struct itimerspec* new_value + , struct itimerspec* old_value ) -> int +{ + std::cerr << "Call: timer_settime (timer_id=" << timer_id + << ", flags=" << flags + << ", new_value=" << new_value + << ", old_value=" << old_value << ")\n"; + return timer_settime_ret_value; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::timer_delete (timer_t timer_id) -> int +{ + std::cerr << "Call: timer_delete (timer_id=" << timer_id << ")\n"; + return timer_delete_ret_value; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::kqueue() -> int +{ + std::cerr << "Call: kqueue()\n"; + return kqueue_ret_value; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::kevent ( int kq, const struct ::kevent* changelist + , int nchanges, struct ::kevent* eventlist + , int nevents, const struct timespec* timeout) -> int +{ + std::cerr << "Call: kevent (kq=" << kq + << ", changelist=" << changelist + << ", nchanges=" << nchanges + << ", eventlist=" << eventlist + << ", nevents=" << nevents + << ", timeout=" << timeout << ")\n"; + + if ( ! changelist ) + { + if ( eventlist && nevents ) + { + eventlist[0].ident = 1; + eventlist[0].filter = EVFILT_TIMER; + } + return 1; + } + + return kevent_ret_value; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::getuid() -> uid_t +{ + return 0; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::geteuid() -> uid_t +{ + return 0; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::getpwuid_r ( uid_t, struct passwd*, char* + , size_t, struct passwd** ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +inline auto FSystemTest::realpath (const char*, char*) -> char* +{ + return const_cast(""); +} + +//---------------------------------------------------------------------- +inline void FSystemTest::setPipeReturnValue (int ret_val) +{ + pipe_ret_value = ret_val; +} + +//---------------------------------------------------------------------- +inline void FSystemTest::setSigactionReturnValue (int ret_val) +{ + sigaction_ret_value = ret_val; +} + +//---------------------------------------------------------------------- +inline void FSystemTest::setTimerCreateReturnValue (int ret_val) +{ + timer_create_ret_value = ret_val; +} + +//---------------------------------------------------------------------- +inline void FSystemTest::setTimerSettimeReturnValue (int ret_val) +{ + timer_settime_ret_value = ret_val; +} + +//---------------------------------------------------------------------- +inline void FSystemTest::setTimerDeleteReturnValue (int ret_val) +{ + timer_delete_ret_value = ret_val; +} + +//---------------------------------------------------------------------- +inline void FSystemTest::setKqueueReturnValue (int ret_val) +{ + kqueue_ret_value = ret_val; +} + +//---------------------------------------------------------------------- +inline void FSystemTest::setKeventReturnValue (int ret_val) +{ + kevent_ret_value = ret_val; +} + + +//---------------------------------------------------------------------- +// class StringParser +//---------------------------------------------------------------------- + +class StringParser +{ + public: + explicit StringParser (finalcut::EventLoop* eloop) + : queue_monitor(eloop) + { + auto callback = [this, eloop] (const finalcut::Monitor*, short) + { + std::cout << "BackendMonitor callback handle"; + processQueuedInput(); + eloop->leave(); + }; + queue_monitor.init (callback, nullptr); + queue_monitor.resume(); + } + + // Disable default constructor + StringParser() = delete; + + // Disable copy constructor + StringParser(const StringParser&) = delete; + + // Disable move constructor + StringParser(const StringParser&&) = delete; + + // Accessors + auto getQueue() const -> const std::deque& + { + return number_queue; + } + + // Mutator + void setString (const finalcut::FString& s) + { + data_string = s; + } + + // Methods + void parseString(); + void processQueuedInput(); + + private: + std::deque number_queue{}; + finalcut::FString data_string{}; + finalcut::BackendMonitor queue_monitor; +}; + +//---------------------------------------------------------------------- +void StringParser::parseString() +{ + auto is_empty_before = number_queue.empty(); + auto number_parts = data_string.split(","); + + for (auto&& number_string : number_parts) + number_queue.push_back(number_string.toInt()); + + if ( is_empty_before && ! number_queue.empty() ) + queue_monitor.setEvent(); +} + +//---------------------------------------------------------------------- +void StringParser::processQueuedInput() +{ + std::cout << "\nData in queue: "; + + while ( ! number_queue.empty() ) + { + std::cout << "<" << number_queue.front() << "> "; + number_queue.pop_front(); + } + + std::cout << "\n"; +} + +} // namespace test + + +//---------------------------------------------------------------------- +// class EventloopMonitorTest +//---------------------------------------------------------------------- + +class EventloopMonitorTest : public CPPUNIT_NS::TestFixture +{ + public: + EventloopMonitorTest() = default; + + protected: + void classNameTest(); + void noArgumentTest(); + void PipeDataTest(); + void eventLoopTest(); + void setMonitorTest(); + void IoMonitorTest(); + void SignalMonitorTest(); + void TimerMonitorTest(); + void BackendMonitorTest(); + void exceptionTest(); + + private: + void keyboardInput (std::string); + void drainStdin(); + + // Adds code needed to register the test suite + CPPUNIT_TEST_SUITE (EventloopMonitorTest); + + // Add a methods to the test suite + CPPUNIT_TEST (classNameTest); + CPPUNIT_TEST (noArgumentTest); + CPPUNIT_TEST (PipeDataTest); + CPPUNIT_TEST (eventLoopTest); + CPPUNIT_TEST (setMonitorTest); + CPPUNIT_TEST (IoMonitorTest); + CPPUNIT_TEST (SignalMonitorTest); + CPPUNIT_TEST (TimerMonitorTest); + CPPUNIT_TEST (BackendMonitorTest); + CPPUNIT_TEST (exceptionTest); + + // End of test suite definition + CPPUNIT_TEST_SUITE_END(); +}; + + +//---------------------------------------------------------------------- +void EventloopMonitorTest::classNameTest() +{ + finalcut::EventLoop eloop{}; + const finalcut::Monitor monitor(&eloop); + const finalcut::FString& eloop_classname = eloop.getClassName(); + const finalcut::FString& monitor_classname = monitor.getClassName(); + CPPUNIT_ASSERT ( eloop_classname == "EventLoop" ); + CPPUNIT_ASSERT ( monitor_classname == "Monitor" ); + const finalcut::PipeData pipedata; + const finalcut::FString& pipedata_classname = pipedata.getClassName(); + CPPUNIT_ASSERT ( pipedata_classname == "PipeData" ); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::noArgumentTest() +{ + finalcut::EventLoop eloop{}; + const finalcut::Monitor m(&eloop); + CPPUNIT_ASSERT ( m.getEvents() == 0 ); + CPPUNIT_ASSERT ( m.getFileDescriptor() == -1 ); // No File Descriptor + CPPUNIT_ASSERT ( m.getUserContext() == nullptr ); + CPPUNIT_ASSERT ( m.getUserContext() == 0 ); + CPPUNIT_ASSERT ( m.getUserContext() == nullptr ); + CPPUNIT_ASSERT ( m.getUserContext() == 0 ); + CPPUNIT_ASSERT ( m.getUserContext() == nullptr ); + CPPUNIT_ASSERT ( m.getUserContext() == 0.0 ); + CPPUNIT_ASSERT ( m.getUserContext() == nullptr ); + CPPUNIT_ASSERT ( m.getUserContext() == finalcut::FPoint() ); + CPPUNIT_ASSERT ( m.getUserContext() == finalcut::FPoint(0, 0) ); + CPPUNIT_ASSERT ( m.getUserContext() != finalcut::FPoint(1, 2) ); + CPPUNIT_ASSERT ( m.getUserContext() == 0 ); + CPPUNIT_ASSERT ( m.getUserContext() == nullptr ); + CPPUNIT_ASSERT ( ! m.isActive() ); + + const finalcut::PipeData pipedata; + CPPUNIT_ASSERT ( pipedata.getReadFd() == 0 ); + CPPUNIT_ASSERT ( pipedata.getWriteFd() == 0 ); + CPPUNIT_ASSERT ( pipedata.getArrayData()[0] == 0 ); + CPPUNIT_ASSERT ( pipedata.getArrayData()[1] == 0 ); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::PipeDataTest() +{ + finalcut::PipeData pipedata1; + CPPUNIT_ASSERT ( pipedata1.getReadFd() == 0 ); + CPPUNIT_ASSERT ( pipedata1.getWriteFd() == 0 ); + CPPUNIT_ASSERT ( pipedata1.getArrayData()[0] == 0 ); + CPPUNIT_ASSERT ( pipedata1.getArrayData()[1] == 0 ); + pipedata1.getArrayData()[0] = 2; + pipedata1.getArrayData()[1] = 5; + CPPUNIT_ASSERT ( pipedata1.getArrayData()[0] == 2 ); + CPPUNIT_ASSERT ( pipedata1.getArrayData()[1] == 5 ); + + finalcut::PipeData pipedata2{10, 11}; + CPPUNIT_ASSERT ( pipedata2.getReadFd() == 10 ); + CPPUNIT_ASSERT ( pipedata2.getWriteFd() == 11 ); + CPPUNIT_ASSERT ( pipedata2.getArrayData()[0] == 10 ); + CPPUNIT_ASSERT ( pipedata2.getArrayData()[1] == 11 ); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::eventLoopTest() +{ + // Test without monitor + finalcut::EventLoop eloop{}; + auto eloop_ptr = &eloop; + signal_handler = [eloop_ptr] (int) + { + eloop_ptr->leave(); + }; + signal(SIGALRM, sigHandler); // Register signal handler + std::cout << "\n"; + alarm(1); // Schedule a alarm after 1 seconds + CPPUNIT_ASSERT ( eloop.run() == 0 ); // Run event loop + + // Test with one monitor + Monitor_protected mon(&eloop); + CPPUNIT_ASSERT ( mon.getEvents() == 0 ); + CPPUNIT_ASSERT ( mon.getFileDescriptor() == -1 ); // No File Descriptor + CPPUNIT_ASSERT ( mon.getUserContext() == nullptr ); + CPPUNIT_ASSERT ( ! mon.isActive() ); + mon.p_setEvents (POLLIN); + std::array pipe_fd{{-1, -1}}; + auto callback_handler = [&pipe_fd, eloop_ptr] (const finalcut::Monitor*, short) + { + std::cout << "Callback handle"; + uint64_t buf{0}; + CPPUNIT_ASSERT ( ::read(pipe_fd[0], &buf, sizeof(buf)) == sizeof(buf) ); + CPPUNIT_ASSERT ( buf == std::numeric_limits::max() ); + eloop_ptr->leave(); + }; + mon.p_setHandler(callback_handler); + CPPUNIT_ASSERT ( ::pipe(pipe_fd.data()) == 0 ); + mon.p_setFileDescriptor(pipe_fd[0]); // Read end of pipe + mon.resume(); + signal_handler = [&pipe_fd] (int) + { + uint64_t buf{std::numeric_limits::max()}; + CPPUNIT_ASSERT ( ::write (pipe_fd[1], &buf, sizeof(buf)) > 0 ); + }; + alarm(1); // Schedule a alarm after 1 seconds + CPPUNIT_ASSERT ( eloop.run() == 0 ); // Run event loop + CPPUNIT_ASSERT ( mon.getEvents() == POLLIN ); + CPPUNIT_ASSERT ( mon.getFileDescriptor() == pipe_fd[0] ); + CPPUNIT_ASSERT ( mon.getUserContext() == nullptr ); + CPPUNIT_ASSERT ( mon.isActive() ); + signal(SIGALRM, SIG_DFL); + signal_handler = [] (int) { }; // Do nothing +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::setMonitorTest() +{ + finalcut::EventLoop eloop{}; + Monitor_protected m(&eloop); + CPPUNIT_ASSERT ( m.getEvents() == 0 ); + CPPUNIT_ASSERT ( m.getFileDescriptor() == -1 ); // No File Descriptor + CPPUNIT_ASSERT ( m.getUserContext() == nullptr ); + CPPUNIT_ASSERT ( ! m.p_isInitialized() ); + m.p_setInitialized(); + CPPUNIT_ASSERT ( m.p_isInitialized() ); + CPPUNIT_ASSERT ( ! m.isActive() ); + m.resume(); + CPPUNIT_ASSERT ( m.isActive() ); + m.suspend(); + CPPUNIT_ASSERT ( ! m.isActive() ); + m.resume(); + CPPUNIT_ASSERT ( m.isActive() ); + m.p_setFileDescriptor (0); + CPPUNIT_ASSERT ( m.getFileDescriptor() == 0 ); + m.p_setFileDescriptor (245); + CPPUNIT_ASSERT ( m.getFileDescriptor() == 245 ); + m.p_setEvents (2); + CPPUNIT_ASSERT ( m.getEvents() == 2 ); + m.p_setEvents (std::numeric_limits::max()); + CPPUNIT_ASSERT ( m.getEvents() == std::numeric_limits::max() ); + int value = 10; + m.p_setHandler ([&value] (const finalcut::Monitor*, short n) { value -= n; }); + CPPUNIT_ASSERT ( value == 10 ); + m.p_trigger(2); + CPPUNIT_ASSERT ( value == 8 ); + using Function = std::function; + Function f = [&value] () { value *= 10; }; + m.p_setUserContext(f); + CPPUNIT_ASSERT ( value == 8 ); + m.getUserContext()(); + CPPUNIT_ASSERT ( value == 80 ); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::IoMonitorTest() +{ + finalcut::FTermios::init(); + finalcut::FTermios::storeTTYsettings(); + drainStdin(); + auto stdin_no = finalcut::FTermios::getStdIn(); + auto stdin_status_flags = fcntl(stdin_no, F_GETFL); + finalcut::EventLoop eloop{}; + auto eloop_ptr = &eloop; + finalcut::IoMonitor io_monitor{&eloop}; + const finalcut::FString& io_monitor_classname = io_monitor.getClassName(); + CPPUNIT_ASSERT ( io_monitor_classname == "IoMonitor" ); + auto callback_handler = [&stdin_status_flags, &stdin_no, eloop_ptr] (const finalcut::Monitor* mon, short) + { + char read_character{'\0'}; + CPPUNIT_ASSERT ( read_character == '\0' ); + stdin_status_flags |= O_NONBLOCK; + CPPUNIT_ASSERT ( fcntl(stdin_no, F_SETFL, stdin_status_flags) != -1 ); + const auto bytes = ::read(mon->getFileDescriptor(), &read_character, 1); + CPPUNIT_ASSERT ( bytes == 1 ); + CPPUNIT_ASSERT ( read_character == 'A' ); + stdin_status_flags &= ~O_NONBLOCK; + CPPUNIT_ASSERT ( fcntl(stdin_no, F_SETFL, stdin_status_flags) != -1 ); + eloop_ptr->leave(); + std::cout << "\nIoMonitor callback handle" << std::flush; + }; + io_monitor.init (stdin_no, POLLIN, callback_handler, nullptr); + std::cout << "\n" << std::flush; + io_monitor.resume(); + // Enter 'A' + keyboardInput("A"); + // Keyboard interval timeout 75 ms + std::this_thread::sleep_for(std::chrono::milliseconds(75)); + CPPUNIT_ASSERT ( eloop.run() == 0 ); // Run event loop + finalcut::FTermios::restoreTTYsettings(); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::SignalMonitorTest() +{ + finalcut::EventLoop eloop{}; + signal_handler = [] (int) + { + std::raise(SIGABRT); // Send abort signal + }; + signal(SIGALRM, sigHandler); // Register signal handler + finalcut::SignalMonitor signal_monitor{&eloop}; + const finalcut::FString& signal_monitor_classname = signal_monitor.getClassName(); + CPPUNIT_ASSERT ( signal_monitor_classname == "SignalMonitor" ); + auto callback_handler = [&eloop] (const finalcut::Monitor*, short) + { + std::cout << "SignalMonitor callback handle"; + eloop.leave(); + }; + signal_monitor.init(SIGABRT, callback_handler, nullptr); + std::cout << "\n"; + alarm(1); // Schedule a alarm after 1 seconds + signal_monitor.resume(); + CPPUNIT_ASSERT ( eloop.run() == 0 ); // Run event loop + signal(SIGALRM, SIG_DFL); + signal_handler = [] (int) { }; // Do nothing +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::TimerMonitorTest() +{ + finalcut::EventLoop eloop{}; + auto eloop_ptr = &eloop; + finalcut::TimerMonitor timer_monitor{&eloop}; + const finalcut::FString& timer_monitor_classname = timer_monitor.getClassName(); + CPPUNIT_ASSERT ( timer_monitor_classname == "TimerMonitor" ); + int num{0}; + auto callback_handler = [eloop_ptr, &num] (const finalcut::Monitor*, short) + { + num++; + std::cout << "TimerMonitor callback handle (" << num << ")\n"; + + if ( num == 3 ) + eloop_ptr->leave(); + }; + timer_monitor.init (callback_handler, nullptr); + timer_monitor.setInterval ( std::chrono::nanoseconds{ 500'000'000 } + , std::chrono::nanoseconds{ 1'000'000'000 } ); + std::cout << "\n"; + timer_monitor.resume(); + auto start = high_resolution_clock::now(); + CPPUNIT_ASSERT ( eloop.run() == 0 ); // Run event loop + auto end = high_resolution_clock::now(); + auto duration_ms = int(duration_cast(end - start).count()); + CPPUNIT_ASSERT ( num == 3 ); + CPPUNIT_ASSERT ( duration_ms >= 2500 ); + CPPUNIT_ASSERT ( duration_ms < 2510 ); + + timer_monitor.setInterval ( std::chrono::nanoseconds{ 100'000'000 } + , std::chrono::nanoseconds{ 100'000'000 } ); + num = 0; + start = high_resolution_clock::now(); + CPPUNIT_ASSERT ( eloop.run() == 0 ); // Run event loop + end = high_resolution_clock::now(); + duration_ms = int(duration_cast(end - start).count()); + CPPUNIT_ASSERT ( num == 3 ); + CPPUNIT_ASSERT ( duration_ms >= 300 ); + CPPUNIT_ASSERT ( duration_ms < 310 ); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::BackendMonitorTest() +{ + finalcut::EventLoop eloop{}; + finalcut::BackendMonitor backend_monitor{&eloop}; + const finalcut::FString& backend_monitor_classname = backend_monitor.getClassName(); + CPPUNIT_ASSERT ( backend_monitor_classname == "BackendMonitor" ); + + test::StringParser string_parser{&eloop}; + string_parser.setString("59,7,99,34,71,38,24,56,4"); + std::cout << "\n"; + CPPUNIT_ASSERT ( string_parser.getQueue().empty() ); + // The queue receives data and sends a backend event + string_parser.parseString(); + CPPUNIT_ASSERT ( ! string_parser.getQueue().empty() ); + CPPUNIT_ASSERT ( string_parser.getQueue().size() == 9 ); + CPPUNIT_ASSERT ( eloop.run() == 0 ); // Run event loop + CPPUNIT_ASSERT ( string_parser.getQueue().empty() ); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::exceptionTest() +{ + CPPUNIT_ASSERT_THROW ( getException(), finalcut::monitor_error ); + CPPUNIT_ASSERT_NO_THROW ( getNoException() ); + + // Bad file descriptor + auto max_fd = int(sysconf(_SC_OPEN_MAX)); + CPPUNIT_ASSERT_THROW ( finalcut::drainPipe(max_fd), std::system_error ); + CPPUNIT_ASSERT_THROW ( finalcut::drainPipe(-1), std::system_error); + + // Signal monitor + //--------------- + + finalcut::EventLoop eloop{}; + finalcut::SignalMonitor signal_monitor1{&eloop}; + auto callback_handler = [] (finalcut::Monitor*, short) { }; + + // SIGALRM used + CPPUNIT_ASSERT_THROW ( signal_monitor1.init(SIGALRM, callback_handler, nullptr) + , std::invalid_argument ); + + // No pipe could be established + std::unique_ptr fsys = std::make_unique(); + finalcut::FSystem::getInstance().swap(fsys); + auto fsys_ptr = static_cast(finalcut::FSystem::getInstance().get()); + fsys_ptr->setPipeReturnValue(-1); + std::cout << "\n"; + CPPUNIT_ASSERT_THROW ( signal_monitor1.init(SIGTERM, callback_handler, nullptr) + , finalcut::monitor_error ); + fsys_ptr->setPipeReturnValue(0); + + // Double monitor instance for one signal + CPPUNIT_ASSERT_NO_THROW ( signal_monitor1.init(SIGTERM, callback_handler, nullptr) ); + finalcut::SignalMonitor signal_monitor2{&eloop}; + CPPUNIT_ASSERT_THROW ( signal_monitor2.init(SIGTERM, callback_handler, nullptr) + , std::invalid_argument ); + CPPUNIT_ASSERT_NO_THROW ( signal_monitor2.init(SIGABRT, callback_handler, nullptr) ); + + // Already initialised + CPPUNIT_ASSERT_THROW ( signal_monitor1.init(SIGINT, callback_handler, nullptr) + , finalcut::monitor_error ); + + // Sigaction error + fsys_ptr->setSigactionReturnValue(-1); + finalcut::SignalMonitor signal_monitor3{&eloop}; + CPPUNIT_ASSERT_THROW ( signal_monitor3.init(SIGHUP, callback_handler, nullptr) + , std::system_error ); + fsys_ptr->setSigactionReturnValue(0); + CPPUNIT_ASSERT_NO_THROW ( signal_monitor3.init(SIGHUP, callback_handler, nullptr) ); + + // Posix timer monitor + //-------------------- + + // No pipe could be established + finalcut::PosixTimer posix_timer_monitor{&eloop}; + fsys_ptr->setPipeReturnValue(-1); + CPPUNIT_ASSERT_THROW ( posix_timer_monitor.init(callback_handler, nullptr) + , finalcut::monitor_error ); + fsys_ptr->setPipeReturnValue(0); + + // Posix timer cannot be created + fsys_ptr->setTimerCreateReturnValue(-1); + CPPUNIT_ASSERT_THROW ( posix_timer_monitor.init(callback_handler, nullptr) + , finalcut::monitor_error ); + fsys_ptr->setTimerCreateReturnValue(0); + + CPPUNIT_ASSERT_NO_THROW ( posix_timer_monitor.init(callback_handler, nullptr) ); + + // Already initialised + CPPUNIT_ASSERT_THROW ( posix_timer_monitor.init(callback_handler, nullptr) + , finalcut::monitor_error ); + + // Timer interval cannot be set + fsys_ptr->setTimerSettimeReturnValue(-1); + auto t1 = std::chrono::nanoseconds{ 500'000'000 }; + auto t2 = std::chrono::nanoseconds{ 1'000'000'000 }; + CPPUNIT_ASSERT_THROW ( posix_timer_monitor.setInterval(t1, t2) + , std::system_error ); + fsys_ptr->setTimerSettimeReturnValue(0); + CPPUNIT_ASSERT_NO_THROW ( posix_timer_monitor.setInterval(t1, t2) ); + + // Kqueue timer monitor + //--------------------- + + fsys_ptr->setKqueueReturnValue(-1); + CPPUNIT_ASSERT_THROW ( finalcut::KqueueTimer{&eloop} + , std::system_error ); + fsys_ptr->setKqueueReturnValue(0); + CPPUNIT_ASSERT_NO_THROW ( finalcut::KqueueTimer{&eloop} ); + KqueueTimer_protected kqueue_timer_monitor{&eloop}; + + CPPUNIT_ASSERT_NO_THROW ( kqueue_timer_monitor.init(callback_handler, nullptr) ); + + // Already initialised + CPPUNIT_ASSERT_THROW ( kqueue_timer_monitor.init(callback_handler, nullptr) + , finalcut::monitor_error ); + + // Event cannot be registered + fsys_ptr->setKeventReturnValue(-1); + CPPUNIT_ASSERT_THROW ( kqueue_timer_monitor.setInterval(t1, t2) + , finalcut::monitor_error ); + fsys_ptr->setKeventReturnValue(0); + CPPUNIT_ASSERT_NO_THROW ( kqueue_timer_monitor.setInterval(t1, t2) ); + + // First timer event - cannot register event in kqueue + fsys_ptr->setKeventReturnValue(-1); + CPPUNIT_ASSERT_THROW ( kqueue_timer_monitor.p_trigger(5) + , finalcut::monitor_error ); + + fsys_ptr->setKeventReturnValue(1); + CPPUNIT_ASSERT_NO_THROW ( kqueue_timer_monitor.p_trigger(5) ); + + // Backend monitor + //---------------- + + finalcut::BackendMonitor backend_monitor{&eloop}; + + // No pipe could be established + fsys_ptr->setPipeReturnValue(-1); + CPPUNIT_ASSERT_THROW ( backend_monitor.init(callback_handler, nullptr) + , finalcut::monitor_error ); + fsys_ptr->setPipeReturnValue(0); + + CPPUNIT_ASSERT_NO_THROW ( backend_monitor.init(callback_handler, nullptr) ); + + // Already initialised + CPPUNIT_ASSERT_THROW ( backend_monitor.init(callback_handler, nullptr) + , finalcut::monitor_error ); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::keyboardInput (std::string s) +{ + // Simulates keystrokes + + const char EOT = 0x04; // End of Transmission + auto stdin_no = finalcut::FTermios::getStdIn(); + fflush(stdout); + + std::string::const_iterator iter; + iter = s.begin(); + + while ( iter != s.end() ) + { + char c = *iter; + + if ( ::ioctl (stdin_no, TIOCSTI, &c) < 0 ) + break; + + ++iter; + } + + if ( ::ioctl (stdin_no, TIOCSTI, &EOT) < 0 ) + return; + + fflush(stdin); +} + +//---------------------------------------------------------------------- +void EventloopMonitorTest::drainStdin() +{ + auto stdin_no = finalcut::FTermios::getStdIn(); + auto stdin_no2 = dup(stdin_no); + + if ( stdin_no2 < 0 ) + return; + + if ( tcdrain(stdin_no2) < 0 ) + { + ::close(stdin_no2); + return; + } + + if ( tcflush(stdin_no2, TCIFLUSH) < 0 ) + { + ::close(stdin_no2); + return; + } + + if ( ::close(stdin_no2) < 0 ) + return; +} + +// Put the test suite in the registry +CPPUNIT_TEST_SUITE_REGISTRATION (EventloopMonitorTest); + +// The general unit test main part +#include diff --git a/test/fevent-test.cpp b/test/fevent-test.cpp index fad09402..2c098973 100644 --- a/test/fevent-test.cpp +++ b/test/fevent-test.cpp @@ -471,7 +471,7 @@ void FEventTest::fusereventTest() auto lambda = [] () { return 5; }; auto&& fdata = finalcut::makeFData(std::move(lambda)); event2.setFDataObject(*fdata); - auto& lambda_from_event = event1.getData(); + auto& lambda_from_event = event2.getData(); CPPUNIT_ASSERT ( lambda_from_event() == 5 ); auto&& fdata_obj2 = event2.getFDataObject(); auto& lambda_from_fdata = fdata_obj2.get(); diff --git a/test/fkeyboard-test.cpp b/test/fkeyboard-test.cpp index 8f7f6d74..6c17fe05 100644 --- a/test/fkeyboard-test.cpp +++ b/test/fkeyboard-test.cpp @@ -84,200 +84,200 @@ using test_type = finalcut::FKeyMap::KeyCapMapType; // std::array(this); // Need for isQuit() keyboard = new finalcut::FKeyboard(); @@ -3191,13 +3192,13 @@ void FKeyboardTest::input (std::string s) { char c = *iter; - if ( ioctl (stdin_no, TIOCSTI, &c) < 0 ) + if ( ::ioctl (stdin_no, TIOCSTI, &c) < 0 ) break; ++iter; } - if ( ioctl (stdin_no, TIOCSTI, &EOT) < 0 ) + if ( ::ioctl (stdin_no, TIOCSTI, &EOT) < 0 ) return; fflush(stdin); diff --git a/test/flogger-test.cpp b/test/flogger-test.cpp index 61593c28..7731cb7d 100644 --- a/test/flogger-test.cpp +++ b/test/flogger-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2020-2022 Markus Gans * +* Copyright 2020-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -406,12 +406,6 @@ void FLoggerTest::applicationObjectTest() // Reset to the default rdbuf of clog std::clog.rdbuf(default_clog_rdbuf); - - // Delete the global FApplication logger object - auto logger = &(finalcut::FApplication::getLog()); - - if ( logger ) - delete logger; } diff --git a/test/fmouse-test.cpp b/test/fmouse-test.cpp index 27892c00..0a49327d 100644 --- a/test/fmouse-test.cpp +++ b/test/fmouse-test.cpp @@ -95,7 +95,11 @@ class FMouse_protected : public finalcut::FMouse class FMouseTest : public CPPUNIT_NS::TestFixture { public: - FMouseTest() = default; + FMouseTest() + { + // create timer instance + finalcut::FObjectTimer timer{}; + } protected: void classNameTest(); @@ -182,6 +186,8 @@ void FMouseTest::noArgumentTest() CPPUNIT_ASSERT ( ! mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! mouse.isMoved() ); CPPUNIT_ASSERT ( ! mouse.hasUnprocessedInput() ); CPPUNIT_ASSERT ( mouse.getMouseTypeID() == finalcut::FMouse::MouseType::None ); @@ -309,6 +315,8 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); // The same input again @@ -338,6 +346,8 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); // Left mouse button released @@ -362,6 +372,8 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); // Left mouse button pressed again (double click) @@ -387,6 +399,8 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); @@ -414,6 +428,8 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); x11_mouse.setRawData (rawdata5); @@ -446,6 +462,8 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); x11_mouse.setRawData (rawdata6); @@ -456,7 +474,9 @@ void FMouseTest::x11MouseTest() // Mouse wheel auto rawdata7 = insertData ({ 0x1b, '[', 'M', 0x60, 0x70, 0x39 - , 0x1b, '[', 'M', 0x61, 0x70, 0x39 }); + , 0x1b, '[', 'M', 0x61, 0x70, 0x39 + , 0x1b, '[', 'M', 0x62, 0x70, 0x39 + , 0x1b, '[', 'M', 0x63, 0x70, 0x39 }); x11_mouse.setRawData (rawdata7); CPPUNIT_ASSERT ( x11_mouse.hasData() ); @@ -478,12 +498,33 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); x11_mouse.setRawData (rawdata7); x11_mouse.processEvent (tv); - CPPUNIT_ASSERT ( ! x11_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( x11_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); + + x11_mouse.setRawData (rawdata7); + x11_mouse.processEvent (tv); + CPPUNIT_ASSERT ( x11_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); + + x11_mouse.setRawData (rawdata7); + x11_mouse.processEvent (tv); + CPPUNIT_ASSERT ( ! x11_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( x11_mouse.isWheelRight() ); // Mouse move auto rawdata8 = insertData ({ 0x1b, '[', 'M', 0x20, 0x21, 0x21 @@ -510,6 +551,8 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); x11_mouse.setRawData (rawdata8); @@ -548,6 +591,8 @@ void FMouseTest::x11MouseTest() CPPUNIT_ASSERT ( ! x11_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! x11_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! x11_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! x11_mouse.isMoved() ); x11_mouse.setRawData (rawdata9); @@ -614,6 +659,8 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); // The same input again @@ -644,6 +691,8 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); // Left mouse button pressed again (double click) @@ -669,6 +718,8 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); // Middle mouse button @@ -695,6 +746,8 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); sgr_mouse.setRawData (rawdata5); @@ -727,6 +780,8 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); sgr_mouse.setRawData (rawdata6); @@ -738,7 +793,9 @@ void FMouseTest::sgrMouseTest() // Mouse wheel auto rawdata7 = insertData ({ 0x1b, '[', '<', '6', '4', ';', '4', ';', '9', 'M' - , 0x1b, '[', '<', '6', '5', ';', '4', ';', '9', 'M' }); + , 0x1b, '[', '<', '6', '5', ';', '4', ';', '9', 'M' + , 0x1b, '[', '<', '6', '6', ';', '4', ';', '9', 'M' + , 0x1b, '[', '<', '6', '7', ';', '4', ';', '9', 'M' }); sgr_mouse.setRawData (rawdata7); CPPUNIT_ASSERT ( sgr_mouse.hasData() ); @@ -760,12 +817,33 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); sgr_mouse.setRawData (rawdata7); sgr_mouse.processEvent (tv); - CPPUNIT_ASSERT ( ! sgr_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); + + sgr_mouse.setRawData (rawdata7); + sgr_mouse.processEvent (tv); + CPPUNIT_ASSERT ( sgr_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); + + sgr_mouse.setRawData (rawdata7); + sgr_mouse.processEvent (tv); + CPPUNIT_ASSERT ( ! sgr_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( sgr_mouse.isWheelRight() ); // Mouse move auto rawdata8 = insertData ({ 0x1b, '[', '<', '0', ';', '1', ';', '2', 'M' @@ -792,6 +870,8 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); sgr_mouse.setRawData (rawdata8); @@ -830,6 +910,8 @@ void FMouseTest::sgrMouseTest() CPPUNIT_ASSERT ( ! sgr_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! sgr_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! sgr_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! sgr_mouse.isMoved() ); sgr_mouse.setRawData (rawdata9); @@ -918,6 +1000,8 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); // The same input again @@ -948,6 +1032,8 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); // Left mouse button pressed again (double click) @@ -973,6 +1059,8 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); // Middle mouse button @@ -999,6 +1087,8 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); urxvt_mouse.setRawData (rawdata5); @@ -1031,6 +1121,8 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); urxvt_mouse.setRawData (rawdata6); @@ -1042,7 +1134,9 @@ void FMouseTest::urxvtMouseTest() // Mouse wheel auto rawdata7 = insertData ({ 0x1b, '[', '9', '6', ';', '4', ';', '9', 'M' - , 0x1b, '[', '9', '7', ';', '4', ';', '9', 'M' }); + , 0x1b, '[', '9', '7', ';', '4', ';', '9', 'M' + , 0x1b, '[', '9', '8', ';', '4', ';', '9', 'M' + , 0x1b, '[', '9', '9', ';', '4', ';', '9', 'M' }); urxvt_mouse.setRawData (rawdata7); CPPUNIT_ASSERT ( urxvt_mouse.hasData() ); @@ -1064,12 +1158,33 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); urxvt_mouse.setRawData (rawdata7); urxvt_mouse.processEvent (tv); - CPPUNIT_ASSERT ( ! urxvt_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); + + urxvt_mouse.setRawData (rawdata7); + urxvt_mouse.processEvent (tv); + CPPUNIT_ASSERT ( urxvt_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); + + urxvt_mouse.setRawData (rawdata7); + urxvt_mouse.processEvent (tv); + CPPUNIT_ASSERT ( ! urxvt_mouse.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( urxvt_mouse.isWheelRight() ); // Mouse move auto rawdata8 = insertData ({ 0x1b, '[', '3', '2', ';', '1', ';', '2', 'M' @@ -1096,6 +1211,8 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); urxvt_mouse.setRawData (rawdata8); @@ -1134,6 +1251,8 @@ void FMouseTest::urxvtMouseTest() CPPUNIT_ASSERT ( ! urxvt_mouse.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelUp() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelDown() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelLeft() ); + CPPUNIT_ASSERT ( ! urxvt_mouse.isWheelRight() ); CPPUNIT_ASSERT ( ! urxvt_mouse.isMoved() ); urxvt_mouse.setRawData (rawdata9); @@ -1272,6 +1391,8 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelRight() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); CPPUNIT_ASSERT ( ! mouse_control.hasUnprocessedInput() ); CPPUNIT_ASSERT ( ! mouse_control.hasDataInQueue() ); @@ -1307,6 +1428,8 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelRight() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() ); CPPUNIT_ASSERT ( mouse_control.hasDataInQueue() ); @@ -1350,6 +1473,8 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelRight() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); CPPUNIT_ASSERT ( mouse_control.hasDataInQueue() ); @@ -1391,6 +1516,8 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelRight() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); CPPUNIT_ASSERT ( mouse_control.hasDataInQueue() ); @@ -1412,7 +1539,9 @@ void FMouseTest::mouseControlTest() // Mouse wheel on an X11 mouse auto rawdata4 = insertData ({ 0x1b, '[', 'M', 0x60, 0x70, 0x39 - , 0x1b, '[', 'M', 0x61, 0x70, 0x39 }); + , 0x1b, '[', 'M', 0x61, 0x70, 0x39 + , 0x1b, '[', 'M', 0x62, 0x70, 0x39 + , 0x1b, '[', 'M', 0x63, 0x70, 0x39 }); mouse_control.setRawData (finalcut::FMouse::MouseType::X11, rawdata4); CPPUNIT_ASSERT ( mouse_control.hasData() ); CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() ); @@ -1434,6 +1563,8 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isMetaKeyPressed() ); CPPUNIT_ASSERT ( mouse_control.isWheelUp() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelRight() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); CPPUNIT_ASSERT ( mouse_control.hasDataInQueue() ); @@ -1447,8 +1578,27 @@ void FMouseTest::mouseControlTest() mouse_control.setRawData (finalcut::FMouse::MouseType::X11, rawdata4); mouse_control.processEvent (tv); - CPPUNIT_ASSERT ( ! mouse_control.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() ); CPPUNIT_ASSERT ( mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelRight() ); + + mouse_control.setRawData (finalcut::FMouse::MouseType::X11, rawdata4); + mouse_control.processEvent (tv); + CPPUNIT_ASSERT ( mouse_control.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelRight() ); + + mouse_control.setRawData (finalcut::FMouse::MouseType::X11, rawdata4); + mouse_control.processEvent (tv); + CPPUNIT_ASSERT ( ! mouse_control.hasUnprocessedInput() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( mouse_control.isWheelRight() ); // Mouse move on an SGR mouse auto rawdata5 = insertData ({ 0x1b, '[', '<', '0', ';', '1', ';', '2', 'M' @@ -1475,6 +1625,8 @@ void FMouseTest::mouseControlTest() CPPUNIT_ASSERT ( ! mouse_control.isMetaKeyPressed() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelUp() ); CPPUNIT_ASSERT ( ! mouse_control.isWheelDown() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelLeft() ); + CPPUNIT_ASSERT ( ! mouse_control.isWheelRight() ); CPPUNIT_ASSERT ( ! mouse_control.isMoved() ); CPPUNIT_ASSERT ( mouse_control.hasDataInQueue() ); diff --git a/test/fstring-test.cpp b/test/fstring-test.cpp index b8546450..3fd385c5 100644 --- a/test/fstring-test.cpp +++ b/test/fstring-test.cpp @@ -1376,6 +1376,14 @@ void FStringTest::formatTest() fnum2.setFormatedNumber(uInt64(9223372036854775807u), '\0'); CPPUNIT_ASSERT ( fnum2 == "9 223 372 036 854 775 807" ); + + // Non-breaking space + // value: 0xa0 = \240 + // UTF-8: 0xc2 0xa0 = \302 \204 + fnum2.setFormatedNumber(uInt64(9223372036854775807u), L"\240"); + CPPUNIT_ASSERT ( fnum2 == "9\302\240" "223\302\240" "372\302\240" + "036\302\240" "854\302\240" "775\302\240" + "807" ); #else // 32-bit architecture fnum1.setFormatedNumber(0xffffffffu, '\''); @@ -1395,6 +1403,13 @@ void FStringTest::formatTest() fnum2.setFormatedNumber(uInt32(2147483647u), '\0'); CPPUNIT_ASSERT ( fnum2 == "2 147 483 647" ); + + // Non-breaking space + // value: 0xa0 = \240 + // UTF-8: 0xc2 0xa0 = \302 \204 + fnum2.setFormatedNumber(uInt32(2147483647u), L"\240"); + CPPUNIT_ASSERT ( fnum2 == "2\302\240" "147\302\240" "483\302\240" + "647" ); #endif fnum1.setFormatedNumber(sInt16(-2048), '_'); diff --git a/test/ftermcap-test.cpp b/test/ftermcap-test.cpp index b4ff7ab0..f78314f3 100644 --- a/test/ftermcap-test.cpp +++ b/test/ftermcap-test.cpp @@ -193,10 +193,9 @@ void FTermcapTest::getNumberTest() CPPUNIT_ASSERT ( fterm_data.getTermType() == "xterm" ); CPPUNIT_ASSERT ( tcap.getNumber("Co") == 8 ); // Colors + CPPUNIT_ASSERT ( tcap.getNumber("pa") == 64 ); // Pairs CPPUNIT_ASSERT ( tcap.getNumber("it") == 8 ); // Tab stop CPPUNIT_ASSERT ( tcap.getNumber("NC") == NA ); // Attr. without color - CPPUNIT_ASSERT ( tcap.getNumber("co") == 80 ); // Columns - CPPUNIT_ASSERT ( tcap.getNumber("li") == 24 ); // Lines } //---------------------------------------------------------------------- diff --git a/test/ftermcapquirks-test.cpp b/test/ftermcapquirks-test.cpp index 3395b3ca..353de557 100644 --- a/test/ftermcapquirks-test.cpp +++ b/test/ftermcapquirks-test.cpp @@ -672,94 +672,94 @@ void FTermcapQuirksTest::sunTest() , CSI "%p1%dD" ); auto& fkey_cap_table = finalcut::FKeyMap::getInstance().getKeyCapMap(); - for (std::size_t i = 0; fkey_cap_table[i].tname[0] != 0; i++) + for (std::size_t i = 0; i < fkey_cap_table.size(); i++) { - if ( std::memcmp(fkey_cap_table[i].tname, "K2", 2) == 0 - && finalcut::stringLength(fkey_cap_table[i].tname) == 2 ) // center of keypad + if ( std::memcmp(fkey_cap_table[i].tname.data(), "K2", 2) == 0 + && finalcut::stringLength(fkey_cap_table[i].tname.data()) == 2 ) // center of keypad CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "218z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "kb", 2) == 0 ) // backspace key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "kb", 2) == 0 ) // backspace key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , "\b" ); - if ( std::memcmp(fkey_cap_table[i].tname, "kD", 2) == 0 - && std::strlen(fkey_cap_table[i].tname) == 2 ) // delete-character key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "kD", 2) == 0 + && std::strlen(fkey_cap_table[i].tname.data()) == 2 ) // delete-character key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , "\177" ); - if ( std::memcmp(fkey_cap_table[i].tname, "@7", 2) == 0 - && finalcut::stringLength(fkey_cap_table[i].tname) == 2 ) // end key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "@7", 2) == 0 + && finalcut::stringLength(fkey_cap_table[i].tname.data()) == 2 ) // end key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "220z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "k;", 2) == 0 ) // F10 function key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "k;", 2) == 0 ) // F10 function key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "233z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "F1", 2) == 0 ) // F11 function key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "F1", 2) == 0 ) // F11 function key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "234z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "F2", 2) == 0 ) // F12 function key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "F2", 2) == 0 ) // F12 function key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "235z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "kh", 2) == 0 - && finalcut::stringLength(fkey_cap_table[i].tname) == 2 ) // home key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "kh", 2) == 0 + && finalcut::stringLength(fkey_cap_table[i].tname.data()) == 2 ) // home key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "214z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "kI", 2) == 0 - && finalcut::stringLength(fkey_cap_table[i].tname) == 2 ) // insert-character key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "kI", 2) == 0 + && finalcut::stringLength(fkey_cap_table[i].tname.data()) == 2 ) // insert-character key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "247z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "kN", 2) == 0 ) // next-page key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "kN", 2) == 0 ) // next-page key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "222z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "%7", 2) == 0 ) // options key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "%7", 2) == 0 ) // options key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "194z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "kP", 2) == 0 ) // prev-page key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "kP", 2) == 0 ) // prev-page key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "216z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "&5", 2) == 0 ) // resume key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "&5", 2) == 0 ) // resume key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "193z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "&8", 2) == 0 ) // undo key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "&8", 2) == 0 ) // undo key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "195z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "K2", 2) == 0 - && finalcut::stringLength(fkey_cap_table[i].tname) == 2 ) // center of keypad + if ( std::memcmp(fkey_cap_table[i].tname.data(), "K2", 2) == 0 + && finalcut::stringLength(fkey_cap_table[i].tname.data()) == 2 ) // center of keypad CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "218z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "kDx", 3) == 0 ) // keypad delete + if ( std::memcmp(fkey_cap_table[i].tname.data(), "kDx", 3) == 0 ) // keypad delete CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "249z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "@8x", 3) == 0 ) // enter/send key + if ( std::memcmp(fkey_cap_table[i].tname.data(), "@8x", 3) == 0 ) // enter/send key CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "250z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "KP1", 3) == 0 ) // keypad slash + if ( std::memcmp(fkey_cap_table[i].tname.data(), "KP1", 3) == 0 ) // keypad slash CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "212z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "KP2", 3) == 0 ) // keypad asterisk + if ( std::memcmp(fkey_cap_table[i].tname.data(), "KP2", 3) == 0 ) // keypad asterisk CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "213z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "KP3", 3) == 0 ) // keypad minus sign + if ( std::memcmp(fkey_cap_table[i].tname.data(), "KP3", 3) == 0 ) // keypad minus sign CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "254z" ); - if ( std::memcmp(fkey_cap_table[i].tname, "KP4", 3) == 0 ) // keypad plus sign + if ( std::memcmp(fkey_cap_table[i].tname.data(), "KP4", 3) == 0 ) // keypad plus sign CPPUNIT_ASSERT_CSTRING ( fkey_cap_table[i].string , CSI "253z" ); } diff --git a/test/ftermdetection-test.cpp b/test/ftermdetection-test.cpp index 5dcb7491..25d5a810 100644 --- a/test/ftermdetection-test.cpp +++ b/test/ftermdetection-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2018-2022 Markus Gans * +* Copyright 2018-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -129,16 +129,16 @@ void FTermDetectionTest::ansiTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "ansi", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -174,7 +174,7 @@ void FTermDetectionTest::ansiTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "" ); // Test fallback to vt100 without TERM environment variable - unsetenv("TERM"); + unsetenv ("TERM"); data.unsetTermType(finalcut::FTermType::ansi); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::ansi) ); @@ -214,15 +214,15 @@ void FTermDetectionTest::xtermTest() // (gdb) set follow-fork-mode child setenv ("TERM", "xterm", 1); setenv ("XTERM_VERSION", "XTerm(312)", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::xterm) ); @@ -262,6 +262,8 @@ void FTermDetectionTest::xtermTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("XTERM_VERSION"); exit(EXIT_SUCCESS); } else // Parent @@ -294,14 +296,14 @@ void FTermDetectionTest::rxvtTest() setenv ("TERM", "rxvt-cygwin-native", 1); setenv ("COLORTERM", "rxvt-xpm", 1); setenv ("COLORFGBG", "default;default", 1); - unsetenv("TERMCAP"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -338,6 +340,9 @@ void FTermDetectionTest::rxvtTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); exit(EXIT_SUCCESS); } else // Parent @@ -370,14 +375,14 @@ void FTermDetectionTest::urxvtTest() setenv ("TERM", "rxvt-unicode-256color", 1); setenv ("COLORTERM", "rxvt-xpm", 1); setenv ("COLORFGBG", "default;default;0", 1); - unsetenv("TERMCAP"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -414,6 +419,9 @@ void FTermDetectionTest::urxvtTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); exit(EXIT_SUCCESS); } else // Parent @@ -447,13 +455,13 @@ void FTermDetectionTest::kdeKonsoleTest() setenv ("COLORTERM", "truecolor", 1); setenv ("KONSOLE_DBUS_SERVICE", "DCOPRef(konsole-11768,konsole)", 1); setenv ("KONSOLE_DCOP", ":1.77", 1); - unsetenv("COLORFGBG"); - unsetenv("TERMCAP"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("COLORFGBG"); + unsetenv ("TERMCAP"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::xterm) ); @@ -490,6 +498,10 @@ void FTermDetectionTest::kdeKonsoleTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("COLORTERM"); + unsetenv ("KONSOLE_DBUS_SERVICE"); + unsetenv ("KONSOLE_DCOP"); exit(EXIT_SUCCESS); } else // Parent @@ -522,14 +534,14 @@ void FTermDetectionTest::gnomeTerminalTest() setenv ("TERM", "xterm-256color", 1); setenv ("COLORTERM", "truecolor", 1); setenv ("VTE_VERSION", "5202", 1); - unsetenv("COLORFGBG"); - unsetenv("TERMCAP"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("COLORFGBG"); + unsetenv ("TERMCAP"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::xterm) ); @@ -566,6 +578,9 @@ void FTermDetectionTest::gnomeTerminalTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("COLORTERM"); + unsetenv ("VTE_VERSION"); exit(EXIT_SUCCESS); } else // Parent @@ -598,14 +613,14 @@ void FTermDetectionTest::newerVteTerminalTest() setenv ("TERM", "xterm-256color", 1); setenv ("COLORTERM", "truecolor", 1); setenv ("VTE_VERSION", "5300", 1); - unsetenv("COLORFGBG"); - unsetenv("TERMCAP"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("COLORFGBG"); + unsetenv ("TERMCAP"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::xterm) ); @@ -642,6 +657,9 @@ void FTermDetectionTest::newerVteTerminalTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("COLORTERM"); + unsetenv ("VTE_VERSION"); exit(EXIT_SUCCESS); } else // Parent @@ -672,16 +690,16 @@ void FTermDetectionTest::puttyTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "xterm", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::xterm) ); @@ -719,6 +737,7 @@ void FTermDetectionTest::puttyTest() enableConEmuDebug(true); printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); exit(EXIT_SUCCESS); } else // Parent @@ -749,16 +768,16 @@ void FTermDetectionTest::windowsTerminalTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "xterm-256color", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); setenv ("WT_PROFILE_ID", "{61c54cbd-c2a6-5271-96e7-009a87ff44bf}", 1); setenv ("WT_SESSION", "4dc413a1-5ed9-46d4-b4e0-5a2fec7acb44", 1); detect.detect(); @@ -797,6 +816,9 @@ void FTermDetectionTest::windowsTerminalTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("WT_PROFILE_ID"); + unsetenv ("WT_SESSION"); exit(EXIT_SUCCESS); } else // Parent @@ -827,16 +849,16 @@ void FTermDetectionTest::teraTermTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "xterm", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::xterm) ); @@ -873,6 +895,7 @@ void FTermDetectionTest::teraTermTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); exit(EXIT_SUCCESS); } else // Parent @@ -903,16 +926,16 @@ void FTermDetectionTest::cygwinTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "cygwin", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -948,7 +971,7 @@ void FTermDetectionTest::cygwinTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "" ); // Use Sec DA without TERM environment variable - unsetenv("TERM"); + unsetenv ("TERM"); data.unsetTermType(finalcut::FTermType::cygwin); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::cygwin) ); @@ -987,16 +1010,16 @@ void FTermDetectionTest::minttyTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "xterm-256color", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::xterm) ); @@ -1033,6 +1056,7 @@ void FTermDetectionTest::minttyTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); exit(EXIT_SUCCESS); } else // Parent @@ -1063,16 +1087,16 @@ void FTermDetectionTest::sttermTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "st-256color", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -1109,6 +1133,7 @@ void FTermDetectionTest::sttermTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); exit(EXIT_SUCCESS); } else // Parent @@ -1139,16 +1164,16 @@ void FTermDetectionTest::linuxTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "linux", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -1184,7 +1209,7 @@ void FTermDetectionTest::linuxTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "" ); // Test fallback to vt100 without TERM environment variable - unsetenv("TERM"); + unsetenv ("TERM"); data.unsetTermType(finalcut::FTermType::linux_con); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::linux_con) ); @@ -1222,16 +1247,16 @@ void FTermDetectionTest::freebsdTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "xterm", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); data.setTermType(finalcut::FTermType::freebsd_con); // Fake FreeBSD Console detection @@ -1268,7 +1293,7 @@ void FTermDetectionTest::freebsdTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "\033[>0;10;0c" ); // Test fallback to vt100 without TERM environment variable - unsetenv("TERM"); + unsetenv ("TERM"); data.unsetTermType(finalcut::FTermType::xterm); data.unsetTermType(finalcut::FTermType::freebsd_con); detect.detect(); @@ -1308,16 +1333,16 @@ void FTermDetectionTest::netbsdTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "wsvt25", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); data.setTermType(finalcut::FTermType::netbsd_con); // Fake NetBSD Console detection @@ -1354,7 +1379,7 @@ void FTermDetectionTest::netbsdTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "\033[>24;20;0c" ); // Test fallback to vt100 without TERM environment variable - unsetenv("TERM"); + unsetenv ("TERM"); data.unsetTermType(finalcut::FTermType::netbsd_con); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::freebsd_con) ); @@ -1392,16 +1417,16 @@ void FTermDetectionTest::openbsdTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "vt220", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); data.setTermType(finalcut::FTermType::openbsd_con); // Fake OpenBSD Console detection @@ -1438,7 +1463,7 @@ void FTermDetectionTest::openbsdTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "\033[>24;20;0c" ); // Test fallback to vt100 without TERM environment variable - unsetenv("TERM"); + unsetenv ("TERM"); data.unsetTermType(finalcut::FTermType::openbsd_con); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::openbsd_con) ); @@ -1475,16 +1500,16 @@ void FTermDetectionTest::sunTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "sun-color", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -1520,7 +1545,7 @@ void FTermDetectionTest::sunTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "" ); // Test fallback to vt100 without TERM environment variable - unsetenv("TERM"); + unsetenv ("TERM"); data.unsetTermType(finalcut::FTermType::sun_con); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::sun_con) ); @@ -1559,15 +1584,15 @@ void FTermDetectionTest::screenTest() // (gdb) set follow-fork-mode child setenv ("TERM", "screen", 1); setenv ("TERMCAP", "SC|screen|VT 100/ANSI X3.64 virtual terminal:...", 1); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -1609,6 +1634,9 @@ void FTermDetectionTest::screenTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("XTERM_VERSION"); + unsetenv ("TERM"); + unsetenv ("TERMCAP"); exit(EXIT_SUCCESS); } else // Parent @@ -1641,15 +1669,15 @@ void FTermDetectionTest::tmuxTest() setenv ("TERM", "screen", 1); setenv ("TMUX", "/tmp/tmux-1000/default,7844,0", 1); setenv ("TMUX_PANE", "%0", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -1691,15 +1719,23 @@ void FTermDetectionTest::tmuxTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("VTE_VERSION"); + unsetenv ("TERM"); + unsetenv ("TMUX"); + unsetenv ("TMUX_PANE"); exit(EXIT_SUCCESS); } else // Parent { // Start the terminal simulation startConEmuTerminal (ConEmu::console::tmux); + int wstatus; - if ( waitpid(pid, nullptr, WUNTRACED) != pid ) + if ( waitpid(pid, &wstatus, WUNTRACED) != pid ) std::cerr << "waitpid error" << std::endl; + + if ( WIFEXITED(wstatus) ) + CPPUNIT_ASSERT ( WEXITSTATUS(wstatus) == 0 ); } } @@ -1717,16 +1753,16 @@ void FTermDetectionTest::ktermTest() { // (gdb) set follow-fork-mode child setenv ("TERM", "kterm", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -1762,7 +1798,7 @@ void FTermDetectionTest::ktermTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "" ); // Test fallback to vt100 without TERM environment variable - unsetenv("TERM"); + unsetenv ("TERM"); data.unsetTermType(finalcut::FTermType::kterm); detect.detect(); CPPUNIT_ASSERT ( detect.hasTerminalDetection() ); @@ -1805,15 +1841,15 @@ void FTermDetectionTest::mltermTest() setenv ("TERM", "mlterm", 1); setenv ("MLTERM", "3.8.4", 1); setenv ("COLORFGBG", "default;default", 1); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); detect.detect(); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::xterm) ); @@ -1849,13 +1885,16 @@ void FTermDetectionTest::mltermTest() CPPUNIT_ASSERT ( detect.getSecDAString() == "\033[>24;279;0c" ); setenv ("TERM", "mlterm", 1); - unsetenv("COLORFGBG"); + unsetenv ("COLORFGBG"); detect.detect(); CPPUNIT_ASSERT ( detect.canDisplay256Colors() ); CPPUNIT_ASSERT ( detect.getTermType() == "xterm-256color" ); printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("MLTERM"); + unsetenv ("COLORFGBG"); exit(EXIT_SUCCESS); } else // Parent @@ -1888,13 +1927,13 @@ void FTermDetectionTest::kittyTest() setenv ("TERM", "xterm-kitty", 1); setenv ("KITTY_WINDOW_ID", "1", 1); setenv ("COLORTERM", "truecolor", 1); - unsetenv("TERMCAP"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); + unsetenv ("TERMCAP"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); detect.detect(); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::xterm) ); @@ -1935,6 +1974,9 @@ void FTermDetectionTest::kittyTest() printConEmuDebug(); closeConEmuStdStreams(); + unsetenv ("TERM"); + unsetenv ("KITTY_WINDOW_ID"); + unsetenv ("COLORTERM"); exit(EXIT_SUCCESS); } else // Parent @@ -1998,17 +2040,17 @@ void FTermDetectionTest::ttytypeTest() if ( isConEmuChildProcess(pid) ) { // (gdb) set follow-fork-mode child - unsetenv("TERM"); - unsetenv("TERMCAP"); - unsetenv("COLORTERM"); - unsetenv("COLORFGBG"); - unsetenv("VTE_VERSION"); - unsetenv("XTERM_VERSION"); - unsetenv("ROXTERM_ID"); - unsetenv("KONSOLE_DBUS_SESSION"); - unsetenv("KONSOLE_DCOP"); - unsetenv("TMUX"); - unsetenv("KITTY_WINDOW_ID"); + unsetenv ("TERM"); + unsetenv ("TERMCAP"); + unsetenv ("COLORTERM"); + unsetenv ("COLORFGBG"); + unsetenv ("VTE_VERSION"); + unsetenv ("XTERM_VERSION"); + unsetenv ("ROXTERM_ID"); + unsetenv ("KONSOLE_DBUS_SESSION"); + unsetenv ("KONSOLE_DCOP"); + unsetenv ("TMUX"); + unsetenv ("KITTY_WINDOW_ID"); auto& data = finalcut::FTermData::getInstance(); // Test /dev/tty3 with linux diff --git a/test/ftermfreebsd-test.cpp b/test/ftermfreebsd-test.cpp index cc4ed475..a9dfff12 100644 --- a/test/ftermfreebsd-test.cpp +++ b/test/ftermfreebsd-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2019-2022 Markus Gans * +* Copyright 2019-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -52,23 +52,36 @@ class FSystemTest : public finalcut::FSystem FSystemTest() = default; // Methods - auto inPortByte (uShort) -> uChar override; - void outPortByte (uChar, uShort) override; - auto isTTY (int) const -> int override; - auto ioctl (int, uLong, ...) -> int override; - auto open (const char*, int, ...) -> int override; - auto close (int) -> int override; - auto fopen (const char*, const char*) -> FILE* override; - auto fclose (FILE*) -> int override; - auto fputs (const char*, FILE*) -> int override; - auto putchar (int) -> int override; - auto getuid() -> uid_t override; - auto geteuid() -> uid_t override; - auto getpwuid_r (uid_t, struct passwd*, char* - , size_t, struct passwd** ) -> int override; - auto realpath (const char*, char*) -> char* override; - auto getCharacters() -> std::string&; - auto getCursorType() -> int&; + auto inPortByte (uShort) -> uChar override; + void outPortByte (uChar, uShort) override; + auto isTTY (int) const -> int override; + auto ioctl (int, uLong, ...) -> int override; + auto pipe (finalcut::PipeData&) -> int override; + auto open (const char*, int, ...) -> int override; + auto close (int) -> int override; + auto fopen (const char*, const char*) -> FILE* override; + auto fclose (FILE*) -> int override; + auto fputs (const char*, FILE*) -> int override; + auto putchar (int) -> int override; + auto sigaction ( int, const struct sigaction* + , struct sigaction*) -> int override; + auto timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int override; + auto timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int override; + auto timer_delete (timer_t) -> int override; + auto kqueue() -> int override; + auto kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec* ) -> int override; + auto getuid() -> uid_t override; + auto geteuid() -> uid_t override; + auto getpwuid_r ( uid_t, struct passwd*, char* + , size_t, struct passwd** ) -> int override; + auto realpath (const char*, char*) -> char* override; + auto getCharacters() -> std::string&; + auto getCursorType() -> int&; auto getTerminalKeymap() -> struct keymap_t&; private: @@ -381,14 +394,14 @@ void FSystemTest::outPortByte (uChar, uShort) } //---------------------------------------------------------------------- -auto FSystemTest::isTTY (int fd) const -> int +auto FSystemTest::isTTY (int file_descriptor) const -> int { - std::cerr << "Call: isatty (fd=" << fd << ")\n"; + std::cerr << "Call: isatty (file_descriptor=" << file_descriptor << ")\n"; return 1; } //---------------------------------------------------------------------- -auto FSystemTest::ioctl (int fd, uLong request, ...) -> int +auto FSystemTest::ioctl (int file_descriptor, uLong request, ...) -> int { va_list args{}; void* argp{}; @@ -460,13 +473,21 @@ auto FSystemTest::ioctl (int fd, uLong request, ...) -> int va_end (args); - std::cerr << "Call: ioctl (fd=" << fd + std::cerr << "Call: ioctl (file_descriptor=" << file_descriptor << ", request=" << req_string << "(0x" << std::hex << request << ")" << ", argp=" << argp << std::dec << ")\n"; return ret_val; } +//---------------------------------------------------------------------- +auto FSystemTest::pipe (finalcut::PipeData& pipe) -> int +{ + std::cerr << "Call: pipe (pipefd={" << pipe.getReadFd() << ", " + << pipe.getWriteFd() << "})\n"; + return 0; +} + //---------------------------------------------------------------------- auto FSystemTest::open (const char* pathname, int flags, ...) -> int { @@ -483,9 +504,9 @@ auto FSystemTest::open (const char* pathname, int flags, ...) -> int } //---------------------------------------------------------------------- -auto FSystemTest::close (int fildes) -> int +auto FSystemTest::close (int file_descriptor) -> int { - std::cerr << "Call: close (fildes=" << fildes << ")\n"; + std::cerr << "Call: close (file_descriptor=" << file_descriptor << ")\n"; return 0; } @@ -498,9 +519,9 @@ auto FSystemTest::fopen (const char* path, const char* mode) -> FILE* } //---------------------------------------------------------------------- -auto FSystemTest::fclose (FILE* fp) -> int +auto FSystemTest::fclose (FILE* file_ptr) -> int { - std::cerr << "Call: fclose (fp=" << fp << ")\n"; + std::cerr << "Call: fclose (file_ptr=" << file_ptr << ")\n"; return 0; } @@ -528,6 +549,48 @@ auto FSystemTest::putchar (int c) -> int return 1; } +//---------------------------------------------------------------------- +auto FSystemTest::sigaction ( int, const struct sigaction* + , struct sigaction* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_delete (timer_t) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::kqueue() -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec*) -> int +{ + return 0; +} + //---------------------------------------------------------------------- auto FSystemTest::getuid() -> uid_t { @@ -765,7 +828,7 @@ void ftermfreebsdTest::freebsdConsoleTest() CPPUNIT_ASSERT ( sec_da == "\033[>0;10;0c" ); #endif - CPPUNIT_ASSERT ( isatty(0) == 1 ); + CPPUNIT_ASSERT ( ::isatty(0) == 1 ); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::freebsd_con) ); CPPUNIT_ASSERT ( data.getTerminalGeometry().getWidth() == 80 ); CPPUNIT_ASSERT ( data.getTerminalGeometry().getHeight() == 25 ); diff --git a/test/ftermlinux-test.cpp b/test/ftermlinux-test.cpp index 5550e26f..a036277a 100644 --- a/test/ftermlinux-test.cpp +++ b/test/ftermlinux-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2019-2021 Markus Gans * +* Copyright 2019-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -111,26 +111,39 @@ class FSystemTest : public finalcut::FSystem ~FSystemTest() override; // Methods - auto inPortByte (uShort) -> uChar override; - void outPortByte (uChar, uShort) override; - auto isTTY (int) const -> int override; - auto ioctl (int, uLong, ...) -> int override; - auto open (const char*, int, ...) -> int override; - auto close (int) -> int override; - auto fopen (const char*, const char*) -> FILE* override; - auto fclose (FILE*) -> int override; - auto fputs (const char*, FILE*) -> int override; - auto putchar (int) -> int override; - auto getuid() -> uid_t override; - auto geteuid() -> uid_t override; - auto getpwuid_r ( uid_t, struct passwd*, char* - , size_t, struct passwd** ) -> int override; - auto realpath (const char*, char*) -> char* override; - auto getRGB (finalcut::FColor) -> RGB&; + auto inPortByte (uShort) -> uChar override; + void outPortByte (uChar, uShort) override; + auto isTTY (int) const -> int override; + auto ioctl (int, uLong, ...) -> int override; + auto pipe (finalcut::PipeData&) -> int override; + auto open (const char*, int, ...) -> int override; + auto close (int) -> int override; + auto fopen (const char*, const char*) -> FILE* override; + auto fclose (FILE*) -> int override; + auto fputs (const char*, FILE*) -> int override; + auto putchar (int) -> int override; + auto sigaction ( int, const struct sigaction* + , struct sigaction*) -> int override; + auto timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int override; + auto timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int override; + auto timer_delete (timer_t) -> int override; + auto kqueue() -> int override; + auto kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec* ) -> int override; + auto getuid() -> uid_t override; + auto geteuid() -> uid_t override; + auto getpwuid_r ( uid_t, struct passwd*, char* + , size_t, struct passwd** ) -> int override; + auto realpath (const char*, char*) -> char* override; + auto getRGB (finalcut::FColor) -> RGB&; auto getConsoleFont() -> console_font_op&; - auto getShiftState() -> ShiftState&; - auto getCharacters() -> std::string&; - void setCodeset (Codeset); + auto getShiftState() -> ShiftState&; + auto getCharacters() -> std::string&; + void setCodeset (Codeset); private: // Methods @@ -1552,14 +1565,14 @@ void FSystemTest::outPortByte (uChar value, uShort port) } //---------------------------------------------------------------------- -auto FSystemTest::isTTY (int fd) const -> int +auto FSystemTest::isTTY (int file_descriptor) const -> int { - std::cerr << "Call: isatty (fd=" << fd << ")\n"; + std::cerr << "Call: isatty (file_descriptor=" << file_descriptor << ")\n"; return 1; } //---------------------------------------------------------------------- -auto FSystemTest::ioctl (int fd, uLong request, ...) -> int +auto FSystemTest::ioctl (int file_descriptor, uLong request, ...) -> int { va_list args{}; void* argp{}; @@ -1833,13 +1846,22 @@ auto FSystemTest::ioctl (int fd, uLong request, ...) -> int va_end (args); - std::cerr << "Call: ioctl (fd=" << fd + std::cerr << "Call: ioctl (file_descriptor=" << file_descriptor << ", request=" << req_string << "(0x" << std::hex << request << ")" << ", argp=" << argp << std::dec << ")\n"; return ret_val; } +//---------------------------------------------------------------------- +auto FSystemTest::pipe (finalcut::PipeData& pipe) -> int +{ + std::cerr << "Call: pipe (pipefd={" + << pipe.getReadFd() << ", " + << pipe.getWriteFd() << "})\n"; + return 0; +} + //---------------------------------------------------------------------- auto FSystemTest::open (const char* pathname, int flags, ...) -> int { @@ -1860,9 +1882,9 @@ auto FSystemTest::open (const char* pathname, int flags, ...) -> int } //---------------------------------------------------------------------- -auto FSystemTest::close (int fildes) -> int +auto FSystemTest::close (int file_descriptor) -> int { - std::cerr << "Call: close (fildes=" << fildes << ")\n"; + std::cerr << "Call: close (file_descriptor=" << file_descriptor << ")\n"; return 0; } @@ -1875,9 +1897,9 @@ auto FSystemTest::fopen (const char* path, const char* mode) -> FILE* } //---------------------------------------------------------------------- -auto FSystemTest::fclose (FILE* fp) -> int +auto FSystemTest::fclose (FILE* file_ptr) -> int { - std::cerr << "Call: fclose (fp=" << fp << ")\n"; + std::cerr << "Call: fclose (file_ptr=" << file_ptr << ")\n"; return 0; } @@ -1905,6 +1927,48 @@ auto FSystemTest::putchar (int c) -> int return 1; } +//---------------------------------------------------------------------- +auto FSystemTest::sigaction ( int, const struct sigaction* + , struct sigaction* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_delete (timer_t) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::kqueue() -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec*) -> int +{ + return 0; +} + //---------------------------------------------------------------------- auto FSystemTest::getuid() -> uid_t { @@ -2153,7 +2217,7 @@ void FTermLinuxTest::linuxConsoleTest() term_detection.detect(); linux.init(); - CPPUNIT_ASSERT ( isatty(3) == 0 ); + CPPUNIT_ASSERT ( ::isatty(3) == 0 ); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::linux_con) ); CPPUNIT_ASSERT ( data.getTerminalGeometry().getWidth() == 96 ); CPPUNIT_ASSERT ( data.getTerminalGeometry().getHeight() == 36 ); diff --git a/test/ftermopenbsd-test.cpp b/test/ftermopenbsd-test.cpp index 6caef26b..b983beb5 100644 --- a/test/ftermopenbsd-test.cpp +++ b/test/ftermopenbsd-test.cpp @@ -3,7 +3,7 @@ * * * This file is part of the FINAL CUT widget toolkit * * * -* Copyright 2019-2022 Markus Gans * +* Copyright 2019-2023 Markus Gans * * * * FINAL CUT is free software; you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -53,21 +53,34 @@ class FSystemTest : public finalcut::FSystem FSystemTest(); // Methods - auto inPortByte (uShort) -> uChar override; - void outPortByte (uChar, uShort) override; - auto isTTY (int) const -> int override; - auto ioctl (int, uLong, ...) -> int override; - auto open (const char*, int, ...) -> int override; - auto close (int) -> int override; - auto fopen (const char*, const char*) -> FILE* override; - auto fputs (const char*, FILE*) -> int override; - auto fclose (FILE*) -> int override; - auto putchar (int) -> int override; - auto getuid() -> uid_t override; - auto geteuid() -> uid_t override; - auto getpwuid_r (uid_t, struct passwd*, char* - , size_t, struct passwd** ) -> int override; - auto realpath (const char*, char*) -> char* override; + auto inPortByte (uShort) -> uChar override; + void outPortByte (uChar, uShort) override; + auto isTTY (int) const -> int override; + auto ioctl (int, uLong, ...) -> int override; + auto pipe (finalcut::PipeData&) -> int override; + auto open (const char*, int, ...) -> int override; + auto close (int) -> int override; + auto fopen (const char*, const char*) -> FILE* override; + auto fputs (const char*, FILE*) -> int override; + auto fclose (FILE*) -> int override; + auto putchar (int) -> int override; + auto sigaction ( int, const struct sigaction* + , struct sigaction*) -> int override; + auto timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int override; + auto timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int override; + auto timer_delete (timer_t) -> int override; + auto kqueue() -> int override; + auto kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec* ) -> int override; + auto getuid() -> uid_t override; + auto geteuid() -> uid_t override; + auto getpwuid_r ( uid_t, struct passwd*, char* + , size_t, struct passwd** ) -> int override; + auto realpath (const char*, char*) -> char* override; auto getBell() -> wskbd_bell_data&; private: @@ -101,14 +114,14 @@ void FSystemTest::outPortByte (uChar, uShort) } //---------------------------------------------------------------------- -auto FSystemTest::isTTY (int fd) const -> int +auto FSystemTest::isTTY (int file_descriptor) const -> int { - std::cerr << "Call: isatty (fd=" << fd << ")\n"; + std::cerr << "Call: isatty (file_descriptor=" << file_descriptor << ")\n"; return 1; } //---------------------------------------------------------------------- -auto FSystemTest::ioctl (int fd, uLong request, ...) -> int +auto FSystemTest::ioctl (int file_descriptor, uLong request, ...) -> int { va_list args{}; void* argp{}; @@ -186,13 +199,22 @@ auto FSystemTest::ioctl (int fd, uLong request, ...) -> int va_end (args); - std::cerr << "Call: ioctl (fd=" << fd + std::cerr << "Call: ioctl (file_descriptor=" << file_descriptor << ", request=" << req_string << "(0x" << std::hex << request << ")" << ", argp=" << argp << std::dec << ")\n"; return ret_val; } +//---------------------------------------------------------------------- +auto FSystemTest::pipe (finalcut::PipeData& pipe) -> int +{ + std::cerr << "Call: pipe (pipefd={" + << pipe.getReadFd() << ", " + << pipe.getWriteFd() << "})\n"; + return 0; +} + //---------------------------------------------------------------------- auto FSystemTest::open (const char* pathname, int flags, ...) -> int { @@ -209,9 +231,9 @@ auto FSystemTest::open (const char* pathname, int flags, ...) -> int } //---------------------------------------------------------------------- -auto FSystemTest::close (int fildes) -> int +auto FSystemTest::close (int file_descriptor) -> int { - std::cerr << "Call: close (fildes=" << fildes << ")\n"; + std::cerr << "Call: close (file_descriptor=" << file_descriptor << ")\n"; return 0; } @@ -224,9 +246,9 @@ auto FSystemTest::fopen (const char* path, const char* mode) -> FILE* } //---------------------------------------------------------------------- -auto FSystemTest::fclose (FILE* fp) -> int +auto FSystemTest::fclose (FILE* file_ptr) -> int { - std::cerr << "Call: fclose (fp=" << fp << ")\n"; + std::cerr << "Call: fclose (file_ptr=" << file_ptr << ")\n"; return 0; } @@ -246,6 +268,48 @@ auto FSystemTest::putchar (int c) -> int #endif } +//---------------------------------------------------------------------- +auto FSystemTest::sigaction ( int, const struct sigaction* + , struct sigaction* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_create ( clockid_t, struct sigevent* + , timer_t* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::timer_delete (timer_t) -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::kqueue() -> int +{ + return 0; +} + +//---------------------------------------------------------------------- +auto FSystemTest::kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec*) -> int +{ + return 0; +} + //---------------------------------------------------------------------- auto FSystemTest::getuid() -> uid_t { @@ -386,7 +450,7 @@ void ftermopenbsdTest::netbsdConsoleTest() CPPUNIT_ASSERT ( sec_da == "\033[>24;20;0c" ); #endif - CPPUNIT_ASSERT ( isatty(0) == 1 ); + CPPUNIT_ASSERT ( ::isatty(0) == 1 ); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::openbsd_con) ); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::netbsd_con) ); CPPUNIT_ASSERT ( data.getTerminalGeometry().getWidth() == 80 ); @@ -399,7 +463,7 @@ void ftermopenbsdTest::netbsdConsoleTest() netbsd.enableMetaSendsEscape(); netbsd.init(); - CPPUNIT_ASSERT ( isatty(0) == 1 ); + CPPUNIT_ASSERT ( ::isatty(0) == 1 ); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::openbsd_con) ); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::netbsd_con) ); CPPUNIT_ASSERT ( data.getTerminalGeometry().getWidth() == 80 ); @@ -499,7 +563,7 @@ void ftermopenbsdTest::openbsdConsoleTest() CPPUNIT_ASSERT ( sec_da == "\033[>24;20;0c" ); #endif - CPPUNIT_ASSERT ( isatty(0) == 1 ); + CPPUNIT_ASSERT ( ::isatty(0) == 1 ); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::openbsd_con) ); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::netbsd_con) ); CPPUNIT_ASSERT ( data.getTerminalGeometry().getWidth() == 80 ); @@ -513,7 +577,7 @@ void ftermopenbsdTest::openbsdConsoleTest() openbsd.enableMetaSendsEscape(); openbsd.init(); - CPPUNIT_ASSERT ( isatty(0) == 1 ); + CPPUNIT_ASSERT ( ::isatty(0) == 1 ); CPPUNIT_ASSERT ( data.isTermType(finalcut::FTermType::openbsd_con) ); CPPUNIT_ASSERT ( ! data.isTermType(finalcut::FTermType::netbsd_con) ); CPPUNIT_ASSERT ( data.getTerminalGeometry().getWidth() == 80 ); diff --git a/test/fwidget-test.cpp b/test/fwidget-test.cpp index 2f98e1dd..5a3ecf8c 100644 --- a/test/fwidget-test.cpp +++ b/test/fwidget-test.cpp @@ -463,6 +463,11 @@ class FWidgetTest::FSystemTest : public finalcut::FSystem return ret_val; } + auto pipe (finalcut::PipeData&) -> int override + { + return 0; + } + auto open (const char*, int, ...) -> int override { return 0; @@ -497,6 +502,40 @@ class FWidgetTest::FSystemTest : public finalcut::FSystem #endif } + auto sigaction (int, const struct sigaction*, struct sigaction*) -> int override + { + return 0; + } + + auto timer_create (clockid_t, struct sigevent*, timer_t*) -> int override + { + return 0; + } + + auto timer_settime ( timer_t, int + , const struct itimerspec* + , struct itimerspec* ) -> int override + { + return 0; + } + + auto timer_delete (timer_t) -> int override + { + return 0; + } + + auto kqueue() -> int override + { + return 0; + } + + auto kevent ( int, const struct kevent* + , int, struct kevent* + , int, const struct timespec* ) -> int override + { + return 0; + } + auto getuid() -> uid_t override { return 0; @@ -886,7 +925,7 @@ void FWidgetTest::resetColorsTest() ~TestWidget() override { } - void resetColors() + void resetColors() override { const auto& wc = getColorTheme(); setForegroundColor (wc->dialog_fg); @@ -1761,7 +1800,8 @@ void FWidgetTest::PosAndSizeTest() tcap.setPutStringFunction (nullptr); auto& fdata = finalcut::FTermData::getInstance(); fdata.setTermType(finalcut::FTermType::xterm); - static_cast(fsys.get())->setScreenSize(finalcut::FSize(132, 43)); + auto fsys_ptr = static_cast(finalcut::FSystem::getInstance().get()); + fsys_ptr->setScreenSize(finalcut::FSize(132, 43)); root_wdgt.setTerminalSize( finalcut::FSize(132, 43) ); CPPUNIT_ASSERT ( root_wdgt.getWidth() == 132 ); CPPUNIT_ASSERT ( root_wdgt.getHeight() == 43 ); @@ -2544,7 +2584,7 @@ void FWidgetTest::closeWidgetTest() ~TestWidget() override { } - void onClose (finalcut::FCloseEvent* ev) + void onClose (finalcut::FCloseEvent* ev) override { if ( confirmed ) ev->accept(); diff --git a/test/test b/test/test new file mode 100755 index 00000000..eb052596 --- /dev/null +++ b/test/test @@ -0,0 +1,2 @@ +#!/bin/sh +make test