From a8be252c6d2de1fd0f19cd4deccdc2be7970e0e8 Mon Sep 17 00:00:00 2001 From: Christopher Chavez Date: Thu, 29 Feb 2024 14:28:16 -0600 Subject: [PATCH] Import Tk 8.6.14 --- .github/workflows/linux-build.yml | 164 + .github/workflows/mac-build.yml | 172 + .github/workflows/win-build.yml | 179 + .travis.yml | 236 - README.md | 12 +- changes | 130 +- doc/AddOption.3 | 12 +- doc/FindPhoto.3 | 2 +- doc/SetOptions.3 | 10 +- doc/keysyms.n | 10 +- doc/menu.n | 11 +- doc/scrollbar.n | 2 +- doc/text.n | 3 +- doc/ttk_notebook.n | 39 +- doc/ttk_style.n | 2 +- doc/ttk_treeview.n | 7 +- generic/ks_names.h | 6 + generic/tk.h | 6 +- generic/tk3d.c | 41 +- generic/tkArgv.c | 2 +- generic/tkArray.h | 10 +- generic/tkBind.c | 65 +- generic/tkBitmap.c | 8 +- generic/tkBusy.c | 23 +- generic/tkButton.c | 48 +- generic/tkCanvLine.c | 6 +- generic/tkCanvUtil.c | 8 +- generic/tkCanvas.c | 6 +- generic/tkCmds.c | 240 +- generic/tkColor.c | 6 +- generic/tkConfig.c | 14 +- generic/tkCursor.c | 6 +- generic/tkDList.h | 22 +- generic/tkEntry.c | 204 +- generic/tkEntry.h | 6 +- generic/tkFocus.c | 2 +- generic/tkFont.c | 15 +- generic/tkFrame.c | 145 +- generic/tkGrid.c | 6 +- generic/tkImage.c | 51 +- generic/tkImgPNG.c | 2 +- generic/tkImgPPM.c | 8 +- generic/tkImgPhInstance.c | 38 +- generic/tkImgPhoto.c | 54 +- generic/tkInt.decls | 10 +- generic/tkInt.h | 4 + generic/tkIntPlatDecls.h | 2 + generic/tkIntXlibDecls.h | 12 +- generic/tkListbox.c | 29 +- generic/tkMenu.c | 117 +- generic/tkMenubutton.h | 2 +- generic/tkObj.c | 109 +- generic/tkOldConfig.c | 60 +- generic/tkOldTest.c | 12 +- generic/tkPack.c | 6 +- generic/tkPointer.c | 6 +- generic/tkRectOval.c | 2 +- generic/tkScale.c | 12 +- generic/tkScale.h | 4 +- generic/tkSelect.c | 6 +- generic/tkSquare.c | 30 +- generic/tkStubInit.c | 4 +- generic/tkTest.c | 14 +- generic/tkText.c | 3 +- generic/tkText.h | 1 + generic/tkTextBTree.c | 18 +- generic/tkTextDisp.c | 8 +- generic/tkTextImage.c | 47 +- generic/tkTextIndex.c | 12 +- generic/tkTextMark.c | 4 +- generic/tkTextTag.c | 356 +- generic/tkUtil.c | 8 +- generic/tkWindow.c | 7 + generic/ttk/ttkCache.c | 22 +- generic/ttk/ttkClamTheme.c | 139 +- generic/ttk/ttkElements.c | 161 +- generic/ttk/ttkEntry.c | 8 +- generic/ttk/ttkImage.c | 9 +- generic/ttk/ttkLabel.c | 6 +- generic/ttk/ttkLayout.c | 11 +- generic/ttk/ttkNotebook.c | 60 +- generic/ttk/ttkTheme.c | 4 +- generic/ttk/ttkTheme.h | 2 +- generic/ttk/ttkThemeInt.h | 2 + generic/ttk/ttkTreeview.c | 28 +- generic/ttk/ttkWidget.c | 11 +- library/choosedir.tcl | 4 +- library/clrpick.tcl | 1 - library/console.tcl | 2 +- library/demos/check.tcl | 8 +- library/demos/floor.tcl | 3 +- library/demos/goldberg.tcl | 17 +- library/demos/pendulum.tcl | 16 +- library/demos/rolodex | 2 +- library/demos/widget | 2 +- library/entry.tcl | 12 + library/fontchooser.tcl | 10 +- library/iconlist.tcl | 9 +- library/menu.tcl | 59 +- library/msgs/zh_cn.msg | 2 +- library/tearoff.tcl | 67 +- library/text.tcl | 6 +- library/tk.tcl | 19 +- library/tkfbox.tcl | 4 +- library/ttk/entry.tcl | 8 + library/ttk/fonts.tcl | 3 - library/ttk/menubutton.tcl | 3 +- library/ttk/notebook.tcl | 8 +- macosx/README | 4 +- macosx/Tk.xcode/project.pbxproj | 4 - macosx/Tk.xcodeproj/project.pbxproj | 4 - macosx/configure | 11834 ++++++++++++++++---------- macosx/tkMacOSXBitmap.c | 22 +- macosx/tkMacOSXButton.c | 16 +- macosx/tkMacOSXClipboard.c | 8 +- macosx/tkMacOSXColor.c | 51 +- macosx/tkMacOSXConfig.c | 10 +- macosx/tkMacOSXCursor.c | 6 +- macosx/tkMacOSXDebug.c | 4 +- macosx/tkMacOSXDialog.c | 38 +- macosx/tkMacOSXDraw.c | 72 +- macosx/tkMacOSXEmbed.c | 11 +- macosx/tkMacOSXEntry.c | 12 +- macosx/tkMacOSXEvent.c | 8 +- macosx/tkMacOSXFileTypes.c | 57 +- macosx/tkMacOSXFileTypes.h | 144 - macosx/tkMacOSXFont.c | 27 +- macosx/tkMacOSXHLEvents.c | 69 +- macosx/tkMacOSXImage.c | 29 +- macosx/tkMacOSXInit.c | 49 +- macosx/tkMacOSXInt.h | 1 - macosx/tkMacOSXKeyEvent.c | 42 +- macosx/tkMacOSXKeyboard.c | 12 +- macosx/tkMacOSXMenu.c | 34 +- macosx/tkMacOSXMenus.c | 4 + macosx/tkMacOSXMouseEvent.c | 21 +- macosx/tkMacOSXNotify.c | 2 - macosx/tkMacOSXPort.h | 6 +- macosx/tkMacOSXPrivate.h | 10 - macosx/tkMacOSXRegion.c | 123 +- macosx/tkMacOSXScale.c | 9 +- macosx/tkMacOSXScrlbr.c | 13 +- macosx/tkMacOSXSend.c | 27 +- macosx/tkMacOSXServices.c | 6 +- macosx/tkMacOSXSubwindows.c | 39 +- macosx/tkMacOSXTest.c | 81 + macosx/tkMacOSXWindowEvent.c | 69 +- macosx/tkMacOSXWm.c | 113 +- macosx/tkMacOSXXStubs.c | 103 +- macosx/ttkMacOSXTheme.c | 294 +- manifest.uuid | 2 +- tests/bell.test | 2 +- tests/bind.test | 39 +- tests/border.test | 1 + tests/busy.test | 8 +- tests/button.test | 156 +- tests/canvPs.test | 4 +- tests/canvRect.test | 8 +- tests/canvText.test | 36 +- tests/canvas.test | 32 +- tests/clipboard.test | 4 +- tests/clrpick.test | 23 +- tests/color.test | 6 +- tests/constraints.tcl | 41 +- tests/dialog.test | 6 +- tests/entry.test | 55 +- tests/event.test | 1 + tests/focus.test | 1 + tests/font.test | 120 +- tests/fontchooser.test | 13 +- tests/frame.test | 450 +- tests/geometry.test | 2 +- tests/grid.test | 17 +- tests/image.test | 2 +- tests/imgBmap.test | 2 +- tests/imgPNG.test | 3 +- tests/imgPhoto.test | 9 +- tests/listbox.test | 12 +- tests/menu.test | 158 +- tests/message.test | 18 +- tests/oldpack.test | 8 +- tests/option.test | 8 +- tests/pack.test | 116 +- tests/panedwindow.test | 4 +- tests/place.test | 63 +- tests/raise.test | 4 +- tests/safe.test | 6 +- tests/safePrimarySelection.test | 32 +- tests/scale.test | 68 +- tests/scrollbar.test | 71 +- tests/send.test | 4 +- tests/spinbox.test | 61 +- tests/text.test | 301 +- tests/textDisp.test | 124 +- tests/textImage.test | 2 +- tests/textIndex.test | 16 +- tests/textMark.test | 4 +- tests/textTag.test | 633 +- tests/textWind.test | 237 +- tests/tk.test | 12 +- tests/ttk/combobox.test | 12 +- tests/ttk/entry.test | 31 +- tests/ttk/labelframe.test | 4 +- tests/ttk/notebook.test | 18 +- tests/ttk/panedwindow.test | 4 +- tests/ttk/progressbar.test | 2 +- tests/ttk/radiobutton.test | 2 +- tests/ttk/scrollbar.test | 4 +- tests/ttk/spinbox.test | 14 + tests/ttk/treetags.test | 11 +- tests/ttk/treeview.test | 61 +- tests/ttk/ttk.test | 22 +- tests/ttk/validate.test | 2 +- tests/unixEmbed.test | 88 +- tests/unixFont.test | 35 +- tests/unixSelect.test | 4 +- tests/unixWm.test | 53 +- tests/util.test | 8 +- tests/visual.test | 8 +- tests/winDialog.test | 22 +- tests/winFont.test | 20 +- tests/winSend.test | 10 +- tests/winWm.test | 5 +- tests/winfo.test | 22 +- tests/wm.test | 58 +- unix/Makefile.in | 23 +- unix/configure | 237 +- unix/configure.in | 18 +- unix/install-sh | 37 +- unix/installManPage | 9 +- unix/tcl.m4 | 133 +- unix/tk.spec | 2 +- unix/tkConfig.h.in | 12 +- unix/tkConfig.sh.in | 1 - unix/tkUnix.c | 26 + unix/tkUnixConfig.c | 2 +- unix/tkUnixDialog.c | 193 - unix/tkUnixEmbed.c | 4 +- unix/tkUnixEvent.c | 9 +- unix/tkUnixFont.c | 26 +- unix/tkUnixPort.h | 2 +- unix/tkUnixRFont.c | 61 +- unix/tkUnixScale.c | 6 +- unix/tkUnixSelect.c | 4 +- unix/tkUnixSend.c | 12 +- unix/tkUnixWm.c | 15 +- win/configure | 10 +- win/configure.in | 7 +- win/makefile.vc | 14 +- win/nmakehlp.c | 28 +- win/rc/tk.rc | 3 +- win/rc/tktest.rc | 86 + win/rc/wish.rc | 3 +- win/rules.vc | 24 +- win/stubs.c | 6 +- win/tcl.m4 | 4 +- win/tkConfig.sh.in | 6 +- win/tkWinButton.c | 2 +- win/tkWinClipboard.c | 17 +- win/tkWinConfig.c | 2 +- win/tkWinDialog.c | 118 +- win/tkWinDraw.c | 14 +- win/tkWinFont.c | 23 +- win/tkWinImage.c | 4 +- win/tkWinInit.c | 3 +- win/tkWinInt.h | 8 + win/tkWinMenu.c | 129 +- win/tkWinPixmap.c | 22 +- win/tkWinPointer.c | 6 +- win/tkWinRegion.c | 24 + win/tkWinScrlbr.c | 2 +- win/tkWinSend.c | 16 +- win/tkWinTest.c | 8 +- win/tkWinWindow.c | 48 +- win/tkWinWm.c | 117 +- win/tkWinX.c | 170 +- win/ttkWinTheme.c | 162 + win/ttkWinXPTheme.c | 122 +- xlib/X11/Sunkeysym.h | 2 +- xlib/X11/X.h | 99 +- xlib/X11/XF86keysym.h | 0 xlib/X11/Xfuncproto.h | 13 - xlib/X11/Xlib.h | 537 +- xlib/X11/Xutil.h | 4 +- xlib/X11/keysymdef.h | 16 +- xlib/xgc.c | 51 +- xlib/xutil.c | 8 +- 287 files changed, 13516 insertions(+), 9939 deletions(-) create mode 100644 .github/workflows/linux-build.yml create mode 100644 .github/workflows/mac-build.yml create mode 100644 .github/workflows/win-build.yml delete mode 100644 .travis.yml delete mode 100644 macosx/tkMacOSXFileTypes.h mode change 100755 => 100644 unix/configure.in delete mode 100644 unix/tkUnixDialog.c create mode 100644 win/rc/tktest.rc mode change 100644 => 100755 xlib/X11/XF86keysym.h diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 0000000000..94140373d9 --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -0,0 +1,164 @@ +name: Linux +on: + push: + branches: + - "main" + - "core-8-branch" + - "core-8-6-branch" + tags: + - "core-**" +permissions: + contents: read +defaults: + run: + shell: bash + working-directory: tk/unix +env: + ERROR_ON_FAILURES: 1 +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + compiler: + - "gcc" + - "clang" + config: + - "" + - "--disable-shared" + - "--disable-xft" + - "--disable-xss" + - "--enable-symbols" + steps: + - name: Checkout Tk + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl 8.6 + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-branch + path: tcl + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install tcl8.6-dev libxss-dev libxft-dev + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT --with-tcl=/usr/lib/tcl8.6" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV + echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.config }} + COMPILER: ${{ matrix.compiler }} + OPTS: ${{ matrix.compiler }}${{ matrix.config }} + - name: Configure (opts=${{ matrix.config }}) + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries || { + echo "::error::Failure during Build" + exit 1 + } + - name: Build Test Harness + run: | + make tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Test-Drive Installation + run: | + make install || { + echo "::error::Failure during Install" + exit 1 + } + - name: Create Distribution Package + run: | + make dist || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Convert Documentation to HTML + run: | + make html-tk TOOL_DIR=$TOOL_DIR || { + echo "::error::Failure during Distribute" + exit 1 + } + - name: Discover Version ID + if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} + run: | + cd /tmp/dist + echo "VERSION=`ls -d tk* | sed 's/tk//'`" >> $GITHUB_ENV + - name: Upload Source Distribution + if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} + uses: actions/upload-artifact@v4 + with: + name: Tk ${{ env.VERSION }} Source distribution (snapshot) + path: | + /tmp/dist/tk* + !/tmp/dist/tk*/html/** + - name: Upload Documentation Distribution + if: ${{ env.BUILD_CONFIG_ID == 'gcc' }} + uses: actions/upload-artifact@v4 + with: + name: Tk ${{ env.VERSION }} HTML documentation (snapshot) + path: /tmp/dist/tk*/html + test: + runs-on: ubuntu-20.04 + strategy: + matrix: + compiler: + - "gcc" + config: + - "" + - "--disable-xft" + - "--enable-symbols" + steps: + - name: Checkout Tk + uses: actions/checkout@v4 + with: + path: tk + - name: Setup Environment (compiler=${{ matrix.compiler }}) + run: | + sudo apt-get install tcl8.6-dev libxss-dev libxft-dev xvfb + mkdir "$HOME/install dir" + touch tk/doc/man.macros tk/generic/tkStubInit.c + echo "CFGOPT=$CFGOPT --with-tcl=/usr/lib/tcl8.6" >> $GITHUB_ENV + echo "CC=$COMPILER" >> $GITHUB_ENV + working-directory: "." + env: + CFGOPT: ${{ matrix.config }} + COMPILER: ${{ matrix.compiler }} + - name: Configure ${{ matrix.config }} + run: | + ./configure $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + xvfb-run --auto-servernum make test-classic | tee out-classic.txt + xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt + grep -q "Failed 0" out-classic.txt || { + echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } + timeout-minutes: 10 diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml new file mode 100644 index 0000000000..9fd297a226 --- /dev/null +++ b/.github/workflows/mac-build.yml @@ -0,0 +1,172 @@ +name: macOS +on: + push: + branches: + - "main" + - "core-8-branch" + - "core-8-6-branch" + tags: + - "core-**" +permissions: + contents: read +env: + ERROR_ON_FAILURES: 1 +jobs: + xcode: + runs-on: macos-11 + defaults: + run: + shell: bash + working-directory: tk/macosx + steps: + - name: Checkout Tk + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-branch + path: tcl + - name: Prepare checked out repositories + run: | + touch tk/generic/tkStubInit.c + mkdir build + echo "BUILD_DIR=`cd build && pwd`" >> $GITHUB_ENV + echo "DESTDIR=`cd build && pwd`" >> $GITHUB_ENV + working-directory: . + - name: Build Tcl + run: | + make all + working-directory: tcl/macosx + - name: Build + run: | + make all install || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + make test | tee out.txt + nmatches=$( grep -c "Failed 0" out.txt ) + if [ $nmatches -lt 4 ] + then + echo "::error::Failure during Test" + exit 1 + fi + timeout-minutes: 30 + clang: + runs-on: macos-11 + strategy: + matrix: + symbols: + - 'no' + - 'mem' + options: + - '--enable-aqua' + - '--disable-aqua' + defaults: + run: + shell: bash + working-directory: tk/unix + steps: + - name: Checkout Tk + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-branch + path: tcl + - name: Prepare checked out repositories + env: + SET_DISPLAY: ${{ contains(matrix.options, '--disable-aqua') }} + run: | + touch ../generic/tkStubInit.c ../doc/man.macros + mkdir "$HOME/install dir" + echo "USE_XVFB=$SET_DISPLAY" >> $GITHUB_ENV + - name: Add X11 (if required) + if: ${{ env.USE_XVFB == 'true' }} + run: | + brew install --cask xquartz + sudo /opt/X11/libexec/privileged_startx || true + working-directory: . + - name: Build Tcl + # Note that macOS is always a 64 bit platform + run: | + ./configure --enable-64bit $CFGOPT "--prefix=$HOME/install dir" || { + cat config.log + echo "::error::Failure during Tcl Configure" + exit 1 + } + make all || { + echo "::error::Failure during Tcl Build" + exit 1 + } + make install || { + echo "::error::Failure during Tcl Install" + exit 1 + } + working-directory: tcl/unix + env: + CFGOPT: --enable-symbols=${{ matrix.symbols }} + - name: Configure (symbols=${{ matrix.symbols }} ${{matrix.options }}) + # Note that macOS is always a 64 bit platform + run: | + ./configure --enable-64bit $CFGOPT "--prefix=$HOME/install dir" --disable-xft || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + env: + CFGOPT: --enable-symbols=${{ matrix.symbols }} ${{matrix.options }} + - name: Build + run: | + make binaries libraries tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tests + run: | + if [ $USE_XVFB == true ]; then + function runXvfb { + PATH=$PATH:/opt/X11/bin + Xvfb $1 & + XVFB_PID=$! + echo Launched Xvfb $1 as process $XVFB_PID >&2 + trap "echo killing process $XVFB_PID... >&2; kill $XVFB_PID" 0 + export DISPLAY=$1 + sleep 2 + } + else + function runXvfb { + echo Xvfb not used, this is a --enable-aqua build + } + fi + ( runXvfb :0; make test-classic; exit $? ) | tee out-classic.txt || { + echo "::error::Failure during Test (classic)" + exit 1 + } + ( runXvfb :0; make test-ttk; exit $? ) | tee out-ttk.txt || { + echo "::error::Failure during Test (ttk)" + exit 1 + } + cat out-classic.txt | grep -q "Failed 0" || { + echo "::error::Failure in classic test results" + exit 1 + } + cat out-ttk.txt | grep -q "Failed 0" || { + echo "::error::Failure in ttk test results" + exit 1 + } + timeout-minutes: 20 + - name: Carry out trial installation + run: | + make install || { + cat config.log + echo "::error::Failure during Install" + exit 1 + } diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml new file mode 100644 index 0000000000..a0af6589ec --- /dev/null +++ b/.github/workflows/win-build.yml @@ -0,0 +1,179 @@ +name: Windows +on: + push: + branches: + - "main" + - "core-8-branch" + - "core-8-6-branch" + tags: + - "core-**" +permissions: + contents: read +env: + ERROR_ON_FAILURES: 1 +jobs: + msvc: + runs-on: windows-2022 + defaults: + run: + shell: powershell + working-directory: tk/win + # Using powershell means we need to explicitly stop on failure + strategy: + matrix: + config: + - "" + - "OPTS=symbols" + - "OPTS=static" + - "OPTS=static,staticpkg" + steps: + - name: Checkout Tk + uses: actions/checkout@v4 + with: + path: tk + - name: Checkout Tcl 8.6 + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-branch + path: tcl + - name: Init MSVC + uses: ilammy/msvc-dev-cmd@v1 + - name: Make Install Location + working-directory: tcl + run: | + echo "TCLDIR=`pwd`" >> $GITHUB_ENV + cd .. + mkdir install + cd install + echo "INSTALLDIR=`pwd`" >> $GITHUB_ENV + - name: Build Tcl (${{ matrix.config }}) + run: | + &nmake -f makefile.vc release install ${{ matrix.config }} + if ($lastexitcode -ne 0) { + throw "nmake exit code: $lastexitcode" + } + working-directory: tcl/win + - name: Build Tk (${{ matrix.config }}) + run: | + &nmake -f makefile.vc all ${{ matrix.config }} + if ($lastexitcode -ne 0) { + throw "nmake exit code: $lastexitcode" + } + - name: Build Test Harness (${{ matrix.config }}) + run: | + &nmake -f makefile.vc tktest ${{ matrix.config }} + if ($lastexitcode -ne 0) { + throw "nmake exit code: $lastexitcode" + } + - name: Run Tk Tests (${{ matrix.config }}) + run: | + nmake -f makefile.vc test-classic ${{ matrix.config }} | tee out-classic.txt || { + echo "::error::Failure during Test" + exit 1 + } + nmake -f makefile.vc test-ttk ${{ matrix.config }} | tee out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-classic.txt || { + echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } + env: + CI_BUILD_WITH_MSVC: 1 + shell: bash + timeout-minutes: 10 + - name: Build Help (${{ matrix.config }}) + run: | + &nmake -f makefile.vc htmlhelp ${{ matrix.config }} + if ($lastexitcode -ne 0) { + throw "nmake exit code: $lastexitcode" + } + - name: Install (${{ matrix.config }}) + run: | + &nmake -f makefile.vc install ${{ matrix.config }} + if ($lastexitcode -ne 0) { + throw "nmake exit code: $lastexitcode" + } + gcc: + runs-on: windows-2019 + defaults: + run: + shell: msys2 {0} + working-directory: win + strategy: + matrix: + config: + - "" + - "--enable-config=mem" + - "--enable-config=all" + - "--disable-shared" + steps: + - name: Install MSYS2 + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + install: git mingw-w64-x86_64-toolchain make + - name: Checkout Tk + uses: actions/checkout@v4 + - name: Checkout Tcl 8.6 + uses: actions/checkout@v4 + with: + repository: tcltk/tcl + ref: core-8-6-branch + path: tcl + - name: Prepare + run: | + touch tkStubInit.c + touch "${HOME}/forWinDialog-5.12.7" + mkdir "${HOME}/install_dir" + echo "INSTALL_DIR=${HOME}/install_dir" >> $GITHUB_ENV + working-directory: generic + - name: Configure and Build Tcl (${{ matrix.config }}) + run: | + ./configure $CFGOPT "--prefix=$INSTALL_DIR" || { + cat config.log + echo "::warning::Failure during Tcl Configure" + exit 1 + } + make all install || { + echo "::warning::Failure during Tcl Build" + exit 1 + } + echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV + env: + CFGOPT: --enable-64bit ${{ matrix.config }} + working-directory: tcl/win + - name: Configure Tk (${{ matrix.config }}) + run: | + ./configure $CFGOPT "--prefix=$HOME/INSTALL_DIR" "--with-tcl=$TCL_CONFIG_PATH" || { + cat config.log + echo "::error::Failure during Configure" + exit 1 + } + env: + CFGOPT: --enable-64bit ${{ matrix.config }} + - name: Build Tk + run: | + make all tktest || { + echo "::error::Failure during Build" + exit 1 + } + - name: Run Tk Tests + run: | + make test-classic | tee out-classic.txt + make test-ttk | tee out-ttk.txt + grep -q "Failed 0" out-classic.txt || { + echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 + } + timeout-minutes: 10 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 77a8d274c0..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,236 +0,0 @@ -language: c -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - binutils-mingw-w64-i686 - - binutils-mingw-w64-x86-64 - - gcc-mingw-w64 - - gcc-mingw-w64-base - - gcc-mingw-w64-i686 - - gcc-mingw-w64-x86-64 - - gcc-multilib - - tcl8.6-dev - - libx11-dev - - libxss-dev - - xvfb - homebrew: - packages: - - tcl-tk -# casks: -# - xquartz -jobs: - include: -# Testing on Linux GCC - - name: "Linux/GCC/Shared" - os: linux - dist: focal - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - script: &x11gui - - make binaries libraries tktest - - make install - - make test-classic >out-classic.txt - - cat out-classic.txt - - grep -q "Failed 0" out-classic.txt - - make test-ttk >out-ttk.txt - - cat out-ttk.txt - - grep -q "Failed 0" out-ttk.txt - - name: "Linux/GCC/Shared/no-xft" - os: linux - dist: focal - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - - CFGOPT="--disable-xft" - script: *x11gui - - name: "Linux/GCC/Shared/bionic" - os: linux - dist: bionic - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - script: *x11gui - - name: "Linux/GCC/Shared/xenial" - os: linux - dist: xenial - services: - - xvfb - compiler: gcc - env: - - BUILD_DIR=unix - script: *x11gui - - name: "Linux/GCC/Static" - os: linux - dist: focal - compiler: gcc - env: - - BUILD_DIR=unix - - CFGOPT="--disable-shared" - - name: "Linux/GCC/Debug" - os: linux - dist: focal - compiler: gcc - env: - - BUILD_DIR=unix - - CFGOPT="--enable-symbols" -# Newer/Older versions of GCC - - name: "Linux/GCC 10/Shared" - os: linux - dist: focal - compiler: gcc-10 - addons: - apt: - packages: - - g++-10 - env: - - BUILD_DIR=unix - - name: "Linux/GCC 5/Shared" - os: linux - dist: bionic - compiler: gcc-5 - addons: - apt: - packages: - - g++-5 - env: - - BUILD_DIR=unix -# Testing on Linux Clang - - name: "Linux/Clang/Shared" - os: linux - dist: focal - compiler: clang - env: - - BUILD_DIR=unix - - name: "Linux/Clang/Shared/no-xft" - os: linux - dist: focal - compiler: clang - env: - - BUILD_DIR=unix - - CFGOPT="--disable-xft" - - name: "Linux/Clang/Static" - os: linux - dist: focal - compiler: clang - env: - - CFGOPT="--disable-shared" - - BUILD_DIR=unix - - name: "Linux/Clang/Debug" - os: linux - dist: focal - compiler: clang - env: - - BUILD_DIR=unix - - CFGOPT="--enable-symbols" -# Testing on Mac, various styles - - name: "macOS/Xcode 12/Shared" - os: osx - osx_image: xcode12 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include" - - name: "macOS/Xcode 12/Static" - os: osx - osx_image: xcode12 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --disable-shared CFLAGS=-I/usr/local/opt/tcl-tk/include" - - name: "macOS/Xcode 12/Debug" - os: osx - osx_image: xcode12 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua --enable-symbols CFLAGS=-I/usr/local/opt/tcl-tk/include" -# - name: "macOS/Xcode 12/Shared/XQuartz" -# os: osx -# osx_image: xcode12 -# env: -# - BUILD_DIR=unix -# - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --disable-corefoundation --x-includes=/opt/X11/include --x-libraries=/opt/X11/lib CFLAGS=-I/usr/local/opt/tcl-tk/include" -# Older MacOS versions - - name: "macOS/Xcode 11/Shared" - os: osx - osx_image: xcode11.7 - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14" - - name: "macOS/Xcode 10/Shared" - os: osx - osx_image: xcode10.3 - addons: - homebrew: - packages: - - tcl-tk - update: true - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.14" - - name: "macOS/Xcode 9/Shared" - os: osx - osx_image: xcode9.4 - addons: - homebrew: - packages: - - tcl-tk - update: true - env: - - BUILD_DIR=unix - - CFGOPT="--with-tcl=/usr/local/opt/tcl-tk/lib --enable-aqua CFLAGS=-I/usr/local/opt/tcl-tk/include CPPFLAGS=-mmacosx-version-min=10.13" -# Test on Windows with MSVC native -# - name: "Windows/MSVC/Shared" -# os: windows -# compiler: cl -# env: &vcenv -# - BUILD_DIR=win -# - VCDIR="/C/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Auxiliary/Build" -# before_install: &vcpreinst -# - PATH="$PATH:$VCDIR" -# - cd ${BUILD_DIR} -# install: [] -# script: -# - cmd.exe //C vcvarsall.bat x64 '&&' nmake '-f' makefile.vc all tktest -# "make dist" only - - name: "Linux: make dist" - os: linux - dist: focal - compiler: gcc - env: - - BUILD_DIR=unix - script: - - touch ../doc/man.macros - - make dist -before_install: - - |- - case $TRAVIS_OS_NAME in - windows) - choco install -y magicsplat-tcl-tk - ;; - esac - - cd ${BUILD_DIR} -install: - - mkdir "$HOME/install dir" - - ./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1) -script: - - make binaries libraries tktest - - make install -before_cache: - - |- - case $TRAVIS_OS_NAME in - osx) - brew cleanup - ;; - esac -cache: - directories: - - $HOME/Library/Caches/Homebrew - - $HOME/AppData/Local/Temp/chocolatey - - $HOME/AppData/Local/Apps/Tcl86 diff --git a/README.md b/README.md index e35013e56d..608a1e9cfc 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,23 @@ # README: Tk -This is the **Tk 8.6.13** source distribution. +This is the **Tk 8.6.14** source distribution. You can get any source release of Tk from [our distribution site](https://sourceforge.net/projects/tcl/files/Tcl/). +8.6 (production release, daily build) [![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-6-branch) [![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-6-branch) [![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-6-branch) +
+8.7 (in development, daily build)) +[![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Acore-8-branch) +[![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Acore-8-branch) +[![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Acore-8-branch) +9.0 (in development, daily build)) +[![Build Status](https://github.com/tcltk/tk/workflows/Linux/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Linux%22+branch%3Amain) +[![Build Status](https://github.com/tcltk/tk/workflows/Windows/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22Windows%22+branch%3Amain) +[![Build Status](https://github.com/tcltk/tk/workflows/macOS/badge.svg?branch=main)](https://github.com/tcltk/tk/actions?query=workflow%3A%22macOS%22+branch%3Amain) ## 1. Introduction diff --git a/changes b/changes index 80765aeef3..803dd7d6d7 100644 --- a/changes +++ b/changes @@ -8055,4 +8055,132 @@ Tk Cocoa 2.0: More drawing internals refinements (culler,walzer) 2022-10-28 (bug)[5e4e44] ttk::panedwindow drag robust wrt orientation variants (xolodho,vogel) -- Released 8.6.13, Nov 16, 2022 - https://core.tcl-lang.org/tk/ for details +- Released 8.6.13, Nov 22, 2022 - https://core.tcl-lang.org/tk/ for details + +2022-12-12 Windows binaries licence metadata changed to University of + California to match licence (nadkarni) + +2022-12-12 (bug)[6ee162] crash in [ttk::style configure] (vogel) + +2022-12-14 Permit [tk scaling] to return scale factor in safe interp (nijtmans) + +2023-01-05 Correct rounding of [nsFont pointSize] (nijtmans) + +2023-01-08 (bug)[cee095] X error handler management in Tk_MeasureChars (kechel) + +2023-01-18 macOS 13 SDK deprecates sprintf() (vogel) + +2023-02-12 (bug)[170551] crash in [tk busy forget] + +2023-02-27 (bug)[6cd476] crash using [tk busy hold] (vogel) + +2023-03-04 (bug)[93fe36] Fix <> with -tearoff (mcdonald) + +2023-03-30 (bug)[15c685] menu clones, tests menu-20.1[2-6] (bron) + +2023-04-10 (bug)[f4d9d7] canvas items ignored -disabledwidth (chavez,vogel) + +2023-04-30 (bug)[a9cf21] Text selection omits first character (moosems) + +2023-05-03 (bug)[310c74] No theme change attempts after Tk finalize (chavez) + +2023-05-13 (bug)[3414695] Dialogs robust against parent destruction (vogel) + +2023-05-23 (bug)[ab9581] Guard against use-after-free crashes (chavez) + +2023-05-23 (bug)[f40d9d] Aqua: FourCC bitmaps (chavez) + +2023-05-25 (bug)[7447ed] [tk_chooseColor] handle grab fail (leunissen) + +2023-05-31 (bug)[4666f2] Protect aganst NULL windows (nab,vogel) + +2023-06-06 (bug)[a418aa] bogus @x,y menu entry indices, menu-22.[6-9] (vogel) + +2023-06-11 (bug)[578441] memleak in TkScrollWindow (chavez) + +2023-06-13 (bug)[228476] link wish to correct libtk (root) + +2023-07-09 (bug)[a526d4] Aqua: memleak in TkpOpenDisplay (chavez) + +2023-07-10 (bug)[fa4694,0502c1] Aqua: memleaks in TkpConfigureMenuEntry (chavez) + +2023-07-17 (bug)[f9eddb] region clip & copy better OS implementations (chavez) + +2023-07-18 (bug)[2cb602] Aqua: memleak in TkCreateRegion (chavez) + +2023-07-19 (bug)[edb769] Aqua: memleak in XGetImage (chavez) + +2023-07-19 (bug)[c35c34] memleak in Initialize (chavez) + +2023-07-20 (bug)[deca94] memleak in TkpMakeMenuWindow (chavez) + +2023-07-23 (bug)[f24725] crash using Aqua pre-defined bitmap names (chavez) + +2023-07-24 (feature) better solve Y2038 on most systems (chavez,nijtmans) + +2023-07-26 (bug)[ed9b28] Aqua: memleak in GetWidgetDemoPath (chavez) + +2023-08-02 (bug)[2a3222] navigation exposed clues about masked entry + +2023-08-04 Update [trace] subcommands for Tcl 9 compat + +2023-08-29 (bug)[e42eef] memory issues interfacing with XIM (goodward) + +2023-08-30 (bug)[ef5d3e] Aqua: crash after first toplevel destroyed (chavez) + +2023-09-01 (bug)[6cc800] Harmonize number parsing with Tcl (nijtmans) + *** POTENTIAL INCOMPATIBILITY *** + +2023-09-03 (bug)[4468ed] Iconlist no fg text color from options db (chavez) + *** POTENTIAL INCOMPATIBILITY *** + +2023-09-04 (bug)[d2396a] error reporting from [send -option] (emanuele,nijtmans) + +2023-10-11 (bug)[9675dd] wrong free() call from Tk_ConfigureValue (nijtmans) + +2023-10 (bug) Many revisions to satisfy -fsanitize=function (chavez) + [d96974,04d3e5,84fe25,bb8041] + +2023-10-16 (bug)[22eefb] unixWm-45.[24] (vogel) + +2023-10-18 (bug)[10b38a] Silence macOS 14 warning about secure restorable state + +2023-10-28 (bug)[198376] move notebook tabs to position s (rozenberg,vogel) + +2023-11-06 (bug)[499f8e] eliminate undefined realloc() calls (chavez) + +2023-11-07 (bug)[09a11f] crash menu-40.[12] (chavez,culler) + +2023-11-13 (bug)[eedd2e] ttk::notebook looks bad when tabs are positioned on + edges other than the top (nemethi,werner) + +2023-11-15 (bug)[61550f] font-44.1 with Xft (vogel) + +2023-11-22 (bug)[22a4ad] Aqua: CoreGraphics manages memory for pixmaps (chavez) + +2023-11-28 (bug)[900f23] PNG encoder missed 0xFF entry (obermeier) + +2023-12-03 Aqua: Update handling of Apple FourCC creator codes (chavez) + +2023-12-03 (bug)[fe9423] Aqua: XPutImage() swap red and blue (chavez) + *** POTENTIAL INCOMPATIBILITY *** + +2023-12-09 (bug)[1d8b71] X: Photo color drawing for 32-bit visuals (warnholz) + +2023-12-12 Update to latest X11 headers + +2023-12-22 (bug)[9c5742] Fix handling of abbreviated -relief args (nijtmans) + +2024-01-03 (bug)[52df66] nonXft: [font measure] results inconsistent (vogel) + +2024-01-05 (bug)[a9e637] treeview display partial final line (bron) + +2024-01-09 (bug)[b7abf0] treeview destruction from O(N^2) to O(N) (emiliano) + +2024-01-12 (bug)[737abf] text image insertion from O(N^2) to O(N) + +2024-01-27 (bug)[8da7af] font caching performance issues (thraen,vogel) + +2024-02-08 (bug)[57b821] see test textIndex-22.16 (vogel) + +- Released 8.6.14, Feb 28, 2024 - https://core.tcl-lang.org/tk/ for details diff --git a/doc/AddOption.3 b/doc/AddOption.3 index 2368f09385..c6f0cc1175 100644 --- a/doc/AddOption.3 +++ b/doc/AddOption.3 @@ -33,17 +33,17 @@ classes separated by asterisks or dots, in the usual X format. this value will be returned in calls to \fBTk_GetOption\fR. \fIPriority\fR specifies the priority of the value; when options are queried using \fBTk_GetOption\fR, the value with the highest priority -is returned. \fIPriority\fR must be between 0 and \fBTK_MAX_PRIO\fR. Some -common priority values are: -.IP 20 +is returned. \fIPriority\fR must be between 0 and \fBTK_MAX_PRIO\fR (100). +Some common priority values are: +.IP \fBTK_WIDGET_DEFAULT_PRIO\fR (20) Used for default values hard-coded into widgets. -.IP 40 +.IP \fBTK_STARTUP_FILE_PRIO\fR (40) Used for options specified in application-specific startup files. -.IP 60 +.IP \fBTK_USER_DEFAULT_PRIO\fR (60) Used for options specified in user-specific defaults files, such as \fB.Xdefaults\fR, resource databases loaded into the X server, or user-specific startup files. -.IP 80 +.IP \fBTK_INTERACTIVE_PRIO\fR (80) Used for options specified interactively after the application starts running. .SH KEYWORDS diff --git a/doc/FindPhoto.3 b/doc/FindPhoto.3 index dc218bf109..8b28478742 100644 --- a/doc/FindPhoto.3 +++ b/doc/FindPhoto.3 @@ -264,7 +264,7 @@ data (e.g. separate planes for the red, green, blue and alpha channels). Unfortunately, the implementation fails to hold this promise. The problem is that the \fIpixelSize\fR field is (incorrectly) used to determine whether the image has an alpha channel. -Currently, if the offset for the alpha channel is greater or equal than +Currently, if the offset for the alpha channel is greater than or equal to \fIpixelSize\fR, \fBtk_PhotoPutblock\fR assumes no alpha data is present and makes the image fully opaque. This means that for layouts where the channels are separate (or any other exotic layout where diff --git a/doc/SetOptions.3 b/doc/SetOptions.3 index b77f8d0c71..c989821462 100644 --- a/doc/SetOptions.3 +++ b/doc/SetOptions.3 @@ -130,20 +130,20 @@ called to free all of its resources. All of the option tables for a Tcl interpreter are freed automatically if the interpreter is deleted. .PP \fBTk_InitOptions\fR is invoked when a new widget is created to set the -default values for all of the widget's configuration options that do not -have \fBTK_OPTION_DONT_SET_DEFAULT\fR set in their \fIflags\fR field. +default values. \fBTk_InitOptions\fR is passed a token for an option table (\fIoptionTable\fR) and a pointer to a widget record (\fIrecordPtr\fR), which is the C structure that holds information about this widget. \fBTk_InitOptions\fR uses the information in the option table to choose an -appropriate default for each option, except those having -\fBTK_OPTION_DONT_SET_DEFAULT\fR set, then it stores the default value +appropriate default for each option, then it stores the default value directly into the widget record, overwriting any information that was already present in the widget record. \fBTk_InitOptions\fR normally returns \fBTCL_OK\fR. If an error occurred while setting the default values (e.g., because a default value was erroneous) then \fBTCL_ERROR\fR is returned and an error message is left in \fIinterp\fR's result if -\fIinterp\fR is not NULL. +\fIinterp\fR is not NULL. For any widget's configuration option that +has \fBTK_OPTION_DONT_SET_DEFAULT\fR set in its \fIflags\fR field, +the above initialization is fully skipped, see below. .PP \fBTk_SetOptions\fR is invoked to modify configuration options based on information specified in a Tcl command. The command might be one that diff --git a/doc/keysyms.n b/doc/keysyms.n index 6e7699bc59..08df32e587 100644 --- a/doc/keysyms.n +++ b/doc/keysyms.n @@ -129,7 +129,7 @@ section 167 0xA7 diaeresis 168 0xA8 copyright 169 0xA9 ordfeminine 170 0xAA -guillemotleft 171 0xAB +guillemetleft 171 0xAB notsign 172 0xAC hyphen 173 0xAD registered 174 0xAE @@ -144,8 +144,8 @@ paragraph 182 0xB6 periodcentered 183 0xB7 cedilla 184 0xB8 onesuperior 185 0xB9 -masculine 186 0xBA -guillemotright 187 0xBB +ordmasculine 186 0xBA +guillemetright 187 0xBB onequarter 188 0xBC onehalf 189 0xBD threequarters 190 0xBE @@ -1092,8 +1092,8 @@ dead_o 65158 0xFE86 dead_O 65159 0xFE87 dead_u 65160 0xFE88 dead_U 65161 0xFE89 -dead_small_schwa 65162 0xFE8A -dead_capital_schwa 65163 0xFE8B +dead_schwa 65162 0xFE8A +dead_SCHWA 65163 0xFE8B dead_greek 65164 0xFE8C dead_lowline 65168 0xFE90 dead_aboveverticalline 65169 0xFE91 diff --git a/doc/menu.n b/doc/menu.n index ed0d33d5bd..5f084861d2 100644 --- a/doc/menu.n +++ b/doc/menu.n @@ -339,13 +339,12 @@ menu. In most cases the specification of \fBnone\fR causes nothing to happen in the widget command. This form may not be abbreviated. .TP 12 -\fB@\fInumber\fR +\fB@\fIx\fB,\fIy\fR . -In this form, \fInumber\fR is treated as a y-coordinate in the -menu's window; the entry closest to that y-coordinate is used. -For example, -.QW \fB@0\fR -indicates the top-most entry in the window. +Indicates the entry that covers the point in the menu's window specified +by \fIx\fR and \fIy\fR (in pixel coordinates). +If no entry covers that point, then this form is equivalent to \fBnone\fR. +If only a single number is specified, it is treated as the y-coordinate. .TP 12 \fInumber\fR . diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 4b1d4bae49..eee6a637a5 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -203,7 +203,7 @@ generated from the scrollbar's \fB\-command\fR option. The command may take any of the following forms. In each case, \fIprefix\fR is the contents of the \fB\-command\fR option, which usually has a form like -.QW \fB.t yview\fR . +.QW "\fB.t yview\fR" . .TP \fIprefix \fBmoveto \fIfraction\fR . diff --git a/doc/text.n b/doc/text.n index e4bc64d813..fa00af7158 100644 --- a/doc/text.n +++ b/doc/text.n @@ -229,7 +229,8 @@ Indicates the end of the text (the character just after the last newline). .TP 12 \fImark\fR . -Indicates the character just after the mark whose name is \fImark\fR. +Indicates the character just after the mark whose name is \fImark\fR (see +\fBMARKS\fR for details). .TP 12 \fItag\fB.first\fR . diff --git a/doc/ttk_notebook.n b/doc/ttk_notebook.n index efbfe6c5a1..293f01890c 100644 --- a/doc/ttk_notebook.n +++ b/doc/ttk_notebook.n @@ -232,7 +232,15 @@ are: .br \fB\-tabmargins\fP \fIpadding\fP .br -\fB\-tabposition\fP \fIside\fP +\fB\-tabposition\fP \fIposition\fP +.RS +Specifies the position of the tab row or column as a string of length +1 or 2. The first character indicates the side as \fBn\fP, \fBs\fP, +\fBw\fP, or \fBe\fP, while the second character (if present) is the +sticky bit (specified as \fBw\fP, \fBe\fP, \fBn\fP, or \fBs\fP) within +the tab position. The default position is \fBn\fP for the \fBaqua\fP +theme and \fBnw\fP for all the other built-in themes. +.RE .br .PP \fBTNotebook.Tab\fP styling options configurable with \fBttk::style\fP @@ -249,12 +257,41 @@ are: Defines how much the tab grows in size. Usually used with the \fBselected\fP dynamic state. \fB\-tabmargins\fP should be set appropriately so that there is room for the tab growth. +For example, the Ttk library file \fBvistaTheme.tcl\fP contains +the lines +.CS +ttk::style configure TNotebook -tabmargins {2 2 2 0} +ttk::style map TNotebook.Tab -expand {selected {2 2 2 2}} +.CE +which are valid for the default value \fBnw\fP of the \fB\-tabposition\fP +style option. For a \fBttk::notebook\fP style \fBnbStyle\fP defined by +.CS +set nbStyle SW.TNotebook +ttk::style configure $nbStyle -tabposition sw +.CE +you will have to adapt the above settings as follows: +.CS +ttk::style configure $nbStyle -tabmargins {2 0 2 2} +ttk::style map $nbStyle.Tab -expand {selected {2 2 2 2}} +.CE .RE \fB\-font\fP \fIfont\fP .br \fB\-foreground\fP \fIcolor\fP .br \fB\-padding\fP \fIpadding\fP +.RS +Some themes (e.g., \fBclam\fP) use a different \fIpadding\fP for the +selected tab. For example, the Ttk library file \fBclamTheme.tcl\fP +contains the lines +.CS +ttk::style configure TNotebook.Tab -padding {6 2 6 2} +ttk::style map TNotebook.Tab -padding {selected {6 4 6 2}} +.CE +which are valid for the default value \fBnw\fP of the \fB\-tabposition\fP +style option. Again, for a different tab position you will have to adapt +the above settings accordingly. +.RE .PP Some options are only available for specific themes. .PP diff --git a/doc/ttk_style.n b/doc/ttk_style.n index f4ff6a7d8a..5d7b5d1a44 100644 --- a/doc/ttk_style.n +++ b/doc/ttk_style.n @@ -15,7 +15,7 @@ ttk::style \- Manipulate style database .SH NOTES .PP See also the Tcl'2004 conference presentation, -available at http://tktable.sourceforge.net/tile/tile-tcl2004.pdf +available at https://tktable.sourceforge.net/tile/tile-tcl2004.pdf .SH DEFINITIONS .PP Each widget is assigned a \fIstyle\fR, diff --git a/doc/ttk_treeview.n b/doc/ttk_treeview.n index 8494dad5a6..ef89b0359c 100644 --- a/doc/ttk_treeview.n +++ b/doc/ttk_treeview.n @@ -505,10 +505,15 @@ are: .br \fB\-foreground\fP \fIcolor\fP .br +\fB\-indent\fP \fIamount\fP +.RS +Specifies how many pixels items are indented from their parents. Defaults to 20. +.RE +.br \fB\-rowheight\fP \fIamount\fP .RS The \fB\-rowheight\fP value is not corrected by the \fBtk scaling\fP -value or by the configured font size and must always be set. Also make +value or by the configured font size. It defaults to 20 pixels. Make sure that the \fB\-rowheight\fP is large enough to contain any images. .PP To adjust the \fB\-rowheight\fP for the Treeview style, use the following code diff --git a/generic/ks_names.h b/generic/ks_names.h index 729436b92e..3fce645920 100644 --- a/generic/ks_names.h +++ b/generic/ks_names.h @@ -302,7 +302,9 @@ { "dead_O", 0xFE87 }, { "dead_u", 0xFE88 }, { "dead_U", 0xFE89 }, +{ "dead_schwa", 0xFE8A }, { "dead_small_schwa", 0xFE8A }, +{ "dead_SCHWA", 0xFE8B }, { "dead_capital_schwa", 0xFE8B }, { "dead_greek", 0xFE8C }, { "dead_lowline", 0xFE90 }, @@ -458,6 +460,7 @@ { "diaeresis", 0xA8 }, { "copyright", 0xA9 }, { "ordfeminine", 0xAA }, +{ "guillemetleft", 0xAB }, { "guillemotleft", 0xAB }, { "notsign", 0xAC }, { "hyphen", 0xAD }, @@ -473,7 +476,9 @@ { "periodcentered", 0xB7 }, { "cedilla", 0xB8 }, { "onesuperior", 0xB9 }, +{ "ordmasculine", 0xBA }, { "masculine", 0xBA }, +{ "guillemetright", 0xBB }, { "guillemotright", 0xBB }, { "onequarter", 0xBC }, { "onehalf", 0xBD }, @@ -539,6 +544,7 @@ { "odiaeresis", 0xF6 }, { "division", 0xF7 }, { "oslash", 0xF8 }, +{ "ooblique", 0xF8 }, { "ugrave", 0xF9 }, { "uacute", 0xFA }, { "ucircumflex", 0xFB }, diff --git a/generic/tk.h b/generic/tk.h index 66db0c564a..ef54890103 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -75,10 +75,10 @@ extern "C" { #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 6 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 13 +#define TK_RELEASE_SERIAL 14 #define TK_VERSION "8.6" -#define TK_PATCH_LEVEL "8.6.13" +#define TK_PATCH_LEVEL "8.6.14" /* * A special definition used to allow this header file to be included from @@ -117,7 +117,7 @@ extern "C" { * Decide whether or not to use input methods. */ -#ifdef XNQueryInputStyle +#if defined(XNQueryInputStyle) && !defined(_WIN32) && !defined(MAC_OSX_TK) #define TK_USE_INPUT_METHODS #endif diff --git a/generic/tk3d.c b/generic/tk3d.c index f1cc8f1deb..65980e6cf9 100644 --- a/generic/tk3d.c +++ b/generic/tk3d.c @@ -637,8 +637,7 @@ Tk_GetReliefFromObj( * * Results: * A standard Tcl return value. If all goes well then *reliefPtr is - * filled in with one of the values TK_RELIEF_RAISED, TK_RELIEF_FLAT, or - * TK_RELIEF_SUNKEN. + * filled in with one of the values TK_RELIEF_* * * Side effects: * None. @@ -654,30 +653,38 @@ Tk_GetRelief( { char c; size_t length; + int relief; c = name[0]; length = strlen(name); if ((c == 'f') && (strncmp(name, "flat", length) == 0)) { - *reliefPtr = TK_RELIEF_FLAT; - } else if ((c == 'g') && (strncmp(name, "groove", length) == 0) - && (length >= 2)) { - *reliefPtr = TK_RELIEF_GROOVE; + relief = TK_RELIEF_FLAT; + } else if ((c == 'g') && (strncmp(name, "groove", length) == 0)) { + relief = TK_RELIEF_GROOVE; } else if ((c == 'r') && (strncmp(name, "raised", length) == 0) && (length >= 2)) { - *reliefPtr = TK_RELIEF_RAISED; - } else if ((c == 'r') && (strncmp(name, "ridge", length) == 0)) { - *reliefPtr = TK_RELIEF_RIDGE; - } else if ((c == 's') && (strncmp(name, "solid", length) == 0)) { - *reliefPtr = TK_RELIEF_SOLID; - } else if ((c == 's') && (strncmp(name, "sunken", length) == 0)) { - *reliefPtr = TK_RELIEF_SUNKEN; + relief = TK_RELIEF_RAISED; + } else if ((c == 'r') && (strncmp(name, "ridge", length) == 0) + && (length >= 2)) { + relief = TK_RELIEF_RIDGE; + } else if ((c == 's') && (strncmp(name, "solid", length) == 0) + && (length >= 2)) { + relief = TK_RELIEF_SOLID; + } else if ((c == 's') && (strncmp(name, "sunken", length) == 0) + && (length >= 2)) { + relief = TK_RELIEF_SUNKEN; } else { - Tcl_SetObjResult(interp, - Tcl_ObjPrintf("bad relief \"%.50s\": must be %s", - name, "flat, groove, raised, ridge, solid, or sunken")); - Tcl_SetErrorCode(interp, "TK", "VALUE", "RELIEF", NULL); + if (interp) { + Tcl_SetObjResult(interp, + Tcl_ObjPrintf("bad relief \"%.50s\": must be %s", + name, "flat, groove, raised, ridge, solid, or sunken")); + Tcl_SetErrorCode(interp, "TK", "VALUE", "RELIEF", NULL); + } return TCL_ERROR; } + if (reliefPtr) { + *reliefPtr = relief; + } return TCL_OK; } diff --git a/generic/tkArgv.c b/generic/tkArgv.c index 8fe8514686..6bfcedcdbb 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -106,7 +106,7 @@ Tk_ParseArgv( } /* - * Loop throught the argument descriptors searching for one with the + * Loop through the argument descriptors searching for one with the * matching key string. If found, leave a pointer to it in matchPtr. */ diff --git a/generic/tkArray.h b/generic/tkArray.h index 65693fe6a4..ec5cb81e40 100644 --- a/generic/tkArray.h +++ b/generic/tkArray.h @@ -5,7 +5,7 @@ * Random access to any item is very fast. New items can be either appended * or prepended. An array may be traversed in the forward or backward direction. * - * Copyright (c) 2018-2019 by Gregor Cramer. + * Copyright (c) 2018-2019 Gregor Cramer. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -188,7 +188,7 @@ AT##_Init(AT *arr) \ \ __TK_ARRAY_UNUSED \ static size_t \ -AT##_ElemSize() \ +AT##_ElemSize(void) \ { \ return sizeof(ElemType); \ } \ @@ -273,7 +273,7 @@ AT##_Resize(AT **arrp, size_t newSize) \ } else { \ int init = *arrp == NULL; \ size_t memSize = AT##_BufferSize(newSize - 1) + sizeof(AT); \ - *arrp = ckrealloc(*arrp, memSize); \ + *arrp = (AT *)ckrealloc(*arrp, memSize); \ if (init) { \ (*arrp)->size = 0; \ } else if (newSize < (*arrp)->size) { \ @@ -399,7 +399,7 @@ typedef struct AT { \ \ __TK_ARRAY_UNUSED \ static size_t \ -AT##_ElemSize() \ +AT##_ElemSize(void) \ { \ return sizeof(ElemType); \ } \ @@ -484,7 +484,7 @@ AT##_Resize(AT **arrp, size_t newCapacity) \ } else { \ int init = *arrp == NULL; \ size_t memSize = AT##_BufferSize(newCapacity - 1) + sizeof(AT); \ - *arrp = ckrealloc(*arrp, memSize); \ + *arrp = (AT *)ckrealloc(*arrp, memSize); \ if (init) { \ (*arrp)->size = 0; \ } else if (newCapacity < (*arrp)->size) { \ diff --git a/generic/tkBind.c b/generic/tkBind.c index 830e429b40..0e46a741aa 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -6,8 +6,8 @@ * * Copyright (c) 1989-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 1998 by Scriptics Corporation. - * Copyright (c) 2018-2019 by Gregor Cramer. + * Copyright (c) 1998 Scriptics Corporation. + * Copyright (c) 2018-2019 Gregor Cramer. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -31,14 +31,6 @@ # define DEBUG(expr) expr #endif -#ifdef _MSC_VER -/* - * Earlier versions of MSVC don't know snprintf, but _snprintf is compatible. - * Note that sprintf is deprecated. - */ -# define snprintf _snprintf -#endif - #define SIZE_OF_ARRAY(arr) (sizeof(arr)/sizeof(arr[0])) /* @@ -239,7 +231,7 @@ typedef struct { */ typedef struct { - ClientData object; /* For binding table, identifies the binding tag of the object + void *object; /* For binding table, identifies the binding tag of the object * (or class of objects) relative to which the event occurred. * For virtual event table, always NULL. */ unsigned type; /* Type of event (from X). */ @@ -705,7 +697,7 @@ static void DeleteVirtualEventTable(VirtualEventTable *vetPtr); static void ExpandPercents(TkWindow *winPtr, const char *before, Event *eventPtr, unsigned scriptCount, Tcl_DString *dsPtr); static PatSeq * FindSequence(Tcl_Interp *interp, LookupTables *lookupTables, - ClientData object, const char *eventString, int create, + void *object, const char *eventString, int create, int allowVirtual, unsigned *maskPtr); static void GetAllVirtualEvents(Tcl_Interp *interp, VirtualEventTable *vetPtr); static const char * GetField(const char *p, char *copy, unsigned size); @@ -718,16 +710,16 @@ static int HandleEventGenerate(Tcl_Interp *interp, Tk_Window main, static void InitVirtualEventTable(VirtualEventTable *vetPtr); static PatSeq * MatchPatterns(TkDisplay *dispPtr, Tk_BindingTable bindPtr, PSList *psList, PSList *psSuccList, unsigned patIndex, const Event *eventPtr, - ClientData object, PatSeq **physPtrPtr); + void *object, PatSeq **physPtrPtr); static int NameToWindow(Tcl_Interp *interp, Tk_Window main, Tcl_Obj *objPtr, Tk_Window *tkwinPtr); static unsigned ParseEventDescription(Tcl_Interp *interp, const char **eventStringPtr, TkPattern *patPtr, unsigned *eventMaskPtr); -static void DoWarp(ClientData clientData); +static void DoWarp(void *clientData); static PSList * GetLookupForEvent(LookupTables* lookupPtr, const Event *eventPtr, Tcl_Obj *object, int onlyConsiderDetailedEvents); -static void ClearLookupTable(LookupTables *lookupTables, ClientData object); -static void ClearPromotionLists(Tk_BindingTable bindPtr, ClientData object); +static void ClearLookupTable(LookupTables *lookupTables, void *object); +static void ClearPromotionLists(Tk_BindingTable bindPtr, void *object); static PSEntry * MakeListEntry(PSList *pool, PatSeq *psPtr, int needModMasks); static void RemovePatSeqFromLookup(LookupTables *lookupTables, PatSeq *psPtr); static void RemovePatSeqFromPromotionLists(Tk_BindingTable bindPtr, PatSeq *psPtr); @@ -842,14 +834,14 @@ CountSpecialized( return sndCount - fstCount; } -int +static int IsKeyEventType( - unsigned eventType) + int eventType) { return eventType == KeyPress || eventType == KeyRelease; } -int +static int IsButtonEventType( unsigned eventType) { @@ -921,7 +913,7 @@ static void ClearList( PSList *psList, PSList *pool, - ClientData object) + void *object) { assert(psList); assert(pool); @@ -1145,7 +1137,7 @@ GetLookupForEvent( static void ClearLookupTable( LookupTables *lookupTables, - ClientData object) + void *object) { Tcl_HashSearch search; Tcl_HashEntry *hPtr; @@ -1195,10 +1187,9 @@ ClearLookupTable( static void ClearPromotionLists( Tk_BindingTable bindPtr, - ClientData object) + void *object) { - unsigned newArraySize = 0; - unsigned i; + size_t i, newArraySize = 0; assert(bindPtr); @@ -1620,7 +1611,7 @@ unsigned long Tk_CreateBinding( Tcl_Interp *interp, /* Used for error reporting. */ Tk_BindingTable bindPtr, /* Table in which to create binding. */ - ClientData object, /* Token for object with which binding is associated. */ + void *object, /* Token for object with which binding is associated. */ const char *eventString, /* String describing event sequence that triggers binding. */ const char *script, /* Contains Tcl script to execute when binding triggers. */ int append) /* 0 means replace any existing binding for eventString; @@ -1719,7 +1710,7 @@ int Tk_DeleteBinding( Tcl_Interp *interp, /* Used for error reporting. */ Tk_BindingTable bindPtr, /* Table in which to delete binding. */ - ClientData object, /* Token for object with which binding is associated. */ + void *object, /* Token for object with which binding is associated. */ const char *eventString) /* String describing event sequence that triggers binding. */ { PatSeq *psPtr; @@ -1792,7 +1783,7 @@ const char * Tk_GetBinding( Tcl_Interp *interp, /* Interpreter for error reporting. */ Tk_BindingTable bindPtr, /* Table in which to look for binding. */ - ClientData object, /* Token for object with which binding is associated. */ + void *object, /* Token for object with which binding is associated. */ const char *eventString) /* String describing event sequence that triggers binding. */ { const PatSeq *psPtr; @@ -1830,7 +1821,7 @@ void Tk_GetAllBindings( Tcl_Interp *interp, /* Interpreter returning result or error. */ Tk_BindingTable bindPtr, /* Table in which to look for bindings. */ - ClientData object) /* Token for object. */ + void *object) /* Token for object. */ { Tcl_HashEntry *hPtr; @@ -1921,7 +1912,7 @@ RemovePatSeqFromPromotionLists( Tk_BindingTable bindPtr, /* Table in which to look for bindings. */ PatSeq *psPtr) /* Remove this pattern sequence. */ { - unsigned i; + size_t i; assert(bindPtr); assert(psPtr); @@ -2019,7 +2010,7 @@ DeletePatSeq( void Tk_DeleteAllBindings( Tk_BindingTable bindPtr, /* Table in which to delete bindings. */ - ClientData object) /* Token for object. */ + void *object) /* Token for object. */ { PatSeq *psPtr; PatSeq *nextPtr; @@ -2147,7 +2138,7 @@ Tk_BindEvent( Tk_Window tkwin, /* Window on display where event occurred (needed in order to * locate display information). */ int numObjects, /* Number of objects at *objArr. */ - ClientData *objArr) /* Array of one or more objects to check for a matching binding. */ + void **objArr) /* Array of one or more objects to check for a matching binding. */ { Tcl_Interp *interp; ScreenInfo *screenPtr; @@ -2591,7 +2582,7 @@ Tk_BindEvent( Tcl_Preserve(bindInfoPtr); for (p = Tcl_DStringValue(&scripts), end = p + Tcl_DStringLength(&scripts); p < end; ) { - unsigned len = strlen(p); + size_t len = strlen(p); int code; if (!bindInfoPtr->deleted) { @@ -2656,7 +2647,7 @@ static int VirtPatIsBound( Tk_BindingTable bindPtr, /* Table in which to look for bindings. */ PatSeq *psPtr, /* Test this pattern. */ - ClientData object, /* Check for this binding tag. */ + void *object, /* Check for this binding tag. */ PatSeq **physPtrPtr) /* Input: the best physical event. * Output: the physical event associated with matching virtual event. */ { @@ -2785,7 +2776,7 @@ MatchPatterns( * Can be NULL. */ unsigned patIndex, /* Match only this tag in sequence. */ const Event *curEvent, /* Match this event. */ - ClientData object, /* Check for this binding tag. */ + void *object, /* Check for this binding tag. */ PatSeq **physPtrPtr) /* Input: the best physical event; NULL if we test physical events. * Output: the associated physical event for the best matching virtual * event; NULL when we match physical events. */ @@ -3343,7 +3334,7 @@ ChangeScreen( int Tk_EventObjCmd( - ClientData clientData, /* Main window associated with interpreter. */ + void *clientData, /* Main window associated with interpreter. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -4550,7 +4541,7 @@ NameToWindow( static void DoWarp( - ClientData clientData) + void *clientData) { TkDisplay *dispPtr = (TkDisplay *)clientData; @@ -4653,7 +4644,7 @@ static PatSeq * FindSequence( Tcl_Interp *interp, /* Interpreter to use for error reporting. */ LookupTables *lookupTables, /* Tables used for lookup. */ - ClientData object, /* For binding table, token for object with which binding is + void *object, /* For binding table, token for object with which binding is * associated. For virtual event table, NULL. */ const char *eventString, /* String description of pattern to match on. See user * documentation for details. */ diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index 55317deaab..ad118d317b 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.c @@ -14,6 +14,10 @@ #include "tkInt.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * The includes below are for pre-defined bitmaps. * @@ -834,7 +838,7 @@ Tk_GetBitmapFromData( name = (char *)Tcl_GetHashValue(dataHashPtr); } else { dispPtr->bitmapAutoNumber++; - sprintf(string, "_tk%d", dispPtr->bitmapAutoNumber); + snprintf(string, sizeof(string), "_tk%d", dispPtr->bitmapAutoNumber); name = string; Tcl_SetHashValue(dataHashPtr, name); if (Tk_DefineBitmap(interp, name, source, width, height) != TCL_OK) { @@ -1078,7 +1082,7 @@ BitmapInit( * TkReadBitmapFile -- * * Loads a bitmap image in X bitmap format into the specified drawable. - * This is equivelent to the XReadBitmapFile in X. + * This is equivalent to the XReadBitmapFile in X. * * Results: * Sets the size, hotspot, and bitmap on success. diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 6f58c52759..00ba73ed86 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -16,6 +16,10 @@ #include "tkBusy.h" #include "default.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Things about the busy system that may be configured. Note that on some * platforms this may or may not have an effect. @@ -41,7 +45,7 @@ static void BusyCustodyProc(ClientData clientData, static int ConfigureBusy(Tcl_Interp *interp, Busy *busyPtr, int objc, Tcl_Obj *const objv[]); static Busy * CreateBusy(Tcl_Interp *interp, Tk_Window tkRef); -static void DestroyBusy(void *dataPtr); +static Tcl_FreeProc DestroyBusy; static void DoConfigureNotify(Tk_FakeWin *winPtr); static inline Tk_Window FirstChild(Tk_Window parent); static Busy * GetBusy(Tcl_Interp *interp, @@ -133,7 +137,7 @@ BusyCustodyProc( busyPtr); TkpHideBusyWindow(busyPtr); busyPtr->tkBusy = NULL; - Tcl_EventuallyFree(busyPtr, (Tcl_FreeProc *)DestroyBusy); + Tcl_EventuallyFree(busyPtr, DestroyBusy); } /* @@ -258,7 +262,7 @@ RefWinEventProc( * Arrange for the busy structure to be removed at a proper time. */ - Tcl_EventuallyFree(busyPtr, (Tcl_FreeProc *)DestroyBusy); + Tcl_EventuallyFree(busyPtr, DestroyBusy); break; case ConfigureNotify: @@ -329,7 +333,7 @@ RefWinEventProc( static void DestroyBusy( - void *data) /* Busy window structure record */ + char *data) /* Busy window structure record */ { Busy *busyPtr = (Busy *)data; @@ -379,7 +383,7 @@ BusyEventProc( if (eventPtr->type == DestroyNotify) { busyPtr->tkBusy = NULL; - Tcl_EventuallyFree(busyPtr, (Tcl_FreeProc *)DestroyBusy); + Tcl_EventuallyFree(busyPtr, DestroyBusy); } } @@ -550,7 +554,7 @@ CreateBusy( tkChild = NextChild(tkChild)) { Tk_MakeWindowExist(tkChild); } - sprintf(name, fmt, Tk_Name(tkRef)); + snprintf(name, length + 6, fmt, Tk_Name(tkRef)); tkBusy = Tk_CreateWindow(interp, tkParent, name, NULL); ckfree(name); @@ -682,8 +686,8 @@ GetBusy( Tcl_HashEntry *hPtr; Tk_Window tkwin; - if (TkGetWindowFromObj(interp, Tk_MainWindow(interp), windowObj, - &tkwin) != TCL_OK) { + tkwin = Tk_MainWindow(interp); + if (!tkwin || (TkGetWindowFromObj(interp, tkwin, windowObj, &tkwin) != TCL_OK)) { return NULL; } hPtr = Tcl_FindHashEntry(busyTablePtr, (char *) tkwin); @@ -739,6 +743,7 @@ HoldBusy( if (isNew) { busyPtr = CreateBusy(interp, tkwin); if (busyPtr == NULL) { + Tcl_DeleteHashEntry(hPtr); return TCL_ERROR; } Tcl_SetHashValue(hPtr, busyPtr); @@ -896,7 +901,7 @@ Tk_BusyObjCmd( return TCL_ERROR; } TkpHideBusyWindow(busyPtr); - Tcl_EventuallyFree(busyPtr, (Tcl_FreeProc *)DestroyBusy); + Tcl_EventuallyFree(busyPtr, DestroyBusy); return TCL_OK; case BUSY_HOLD: diff --git a/generic/tkButton.c b/generic/tkButton.c index b96ccd1bc0..afb9973028 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -90,7 +90,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, + DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -102,7 +102,7 @@ static const Tk_OptionSpec labelOptionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, -1, Tk_Offset(TkButton, highlightBorder), 0, - (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, + DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr), 0, 0, 0}, @@ -181,7 +181,7 @@ static const Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, + DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -193,7 +193,7 @@ static const Tk_OptionSpec buttonOptionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, -1, Tk_Offset(TkButton, highlightBorder), 0, - (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, + DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr), 0, 0, 0}, @@ -279,7 +279,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, + DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -291,7 +291,7 @@ static const Tk_OptionSpec checkbuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, -1, Tk_Offset(TkButton, highlightBorder), 0, - (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, + DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr), 0, 0, 0}, @@ -392,7 +392,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = { {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_BUTTON_DISABLED_FG_COLOR, -1, Tk_Offset(TkButton, disabledFg), TK_OPTION_NULL_OK, - (ClientData) DEF_BUTTON_DISABLED_FG_MONO, 0}, + DEF_BUTTON_DISABLED_FG_MONO, 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, {TK_OPTION_FONT, "-font", "font", "Font", @@ -404,7 +404,7 @@ static const Tk_OptionSpec radiobuttonOptionSpecs[] = { {TK_OPTION_BORDER, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_BUTTON_HIGHLIGHT_BG_COLOR, -1, Tk_Offset(TkButton, highlightBorder), 0, - (ClientData) DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, + DEF_BUTTON_HIGHLIGHT_BG_MONO, 0}, {TK_OPTION_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_BUTTON_HIGHLIGHT, -1, Tk_Offset(TkButton, highlightColorPtr), 0, 0, 0}, @@ -619,7 +619,7 @@ Tk_RadiobuttonObjCmd( static int ButtonCreate( - ClientData clientData, /* NULL. */ + TCL_UNUSED(void *), /* NULL. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[], /* Argument values. */ @@ -630,7 +630,7 @@ ButtonCreate( TkButton *butPtr; Tk_OptionTable optionTable; Tk_Window tkwin; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->defaultsInitialized) { @@ -779,7 +779,7 @@ ButtonWidgetObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; int index; int result; Tcl_Obj *objPtr; @@ -1339,7 +1339,7 @@ TkButtonWorldChanged( XGCValues gcValues; GC newGC; unsigned long mask; - TkButton *butPtr = instanceData; + TkButton *butPtr = (TkButton *)instanceData; /* * Recompute GCs. @@ -1450,7 +1450,7 @@ ButtonEventProc( ClientData clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { goto redraw; } else if (eventPtr->type == ConfigureNotify) { @@ -1508,7 +1508,7 @@ static void ButtonCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; /* * This function could be invoked either because the window was destroyed @@ -1594,7 +1594,6 @@ TkInvokeButton( *-------------------------------------------------------------- */ - /* ARGSUSED */ static char * ButtonVarProc( ClientData clientData, /* Information about button. */ @@ -1603,7 +1602,7 @@ ButtonVarProc( const char *name2, /* Second part of variable name. */ int flags) /* Information about what happened. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; const char *value; Tcl_Obj *valuePtr; @@ -1615,14 +1614,14 @@ ButtonVarProc( if (flags & TCL_TRACE_UNSETS) { butPtr->flags &= ~(SELECTED | TRISTATED); if (!Tcl_InterpDeleted(interp)) { - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, Tcl_GetString(butPtr->selVarNamePtr), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonVarProc, probe); - if (probe == (ClientData)butPtr) { + if (probe == (void *)butPtr) { break; } } while (probe); @@ -1704,7 +1703,6 @@ ButtonVarProc( *-------------------------------------------------------------- */ - /* ARGSUSED */ static char * ButtonTextVarProc( ClientData clientData, /* Information about button. */ @@ -1713,7 +1711,7 @@ ButtonTextVarProc( const char *name2, /* Not used. */ int flags) /* Information about what happened. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; Tcl_Obj *valuePtr; if (butPtr->flags & BUTTON_DELETED) { @@ -1733,14 +1731,14 @@ ButtonTextVarProc( * the variable we have stored in butPtr->textVarNamePtr ? */ - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, Tcl_GetString(butPtr->textVarNamePtr), TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, ButtonTextVarProc, probe); - if (probe == (ClientData)butPtr) { + if (probe == (void *)butPtr) { break; } } while (probe); @@ -1808,7 +1806,7 @@ ButtonImageProc( * <= 0). */ int imgWidth, int imgHeight)/* New dimensions of image. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; if (butPtr->tkwin != NULL) { TkpComputeButtonGeometry(butPtr); @@ -1846,7 +1844,7 @@ ButtonSelectImageProc( * <= 0). */ int imgWidth, int imgHeight)/* New dimensions of image. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; #ifdef MAC_OSX_TK if (butPtr->tkwin != NULL) { @@ -1893,7 +1891,7 @@ ButtonTristateImageProc( * <= 0). */ int imgWidth, int imgHeight)/* New dimensions of image. */ { - TkButton *butPtr = clientData; + TkButton *butPtr = (TkButton *)clientData; #ifdef MAC_OSX_TK if (butPtr->tkwin != NULL) { diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 2633744e44..de46813eda 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -15,6 +15,10 @@ #include "tkCanvas.h" #include "default.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * The structure below defines the record for each line item. */ @@ -2075,7 +2079,7 @@ PrintArrowShape( LineItem *linePtr = (LineItem *) recordPtr; char *buffer = (char *)ckalloc(120); - sprintf(buffer, "%.5g %.5g %.5g", linePtr->arrowShapeA, + snprintf(buffer, 120, "%.5g %.5g %.5g", linePtr->arrowShapeA, linePtr->arrowShapeB, linePtr->arrowShapeC); *freeProcPtr = TCL_DYNAMIC; return buffer; diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 86439dfe78..310df534af 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -13,6 +13,10 @@ #include "tkInt.h" #include "tkCanvas.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Structures defined only in this file. */ @@ -570,9 +574,9 @@ TkCanvasDashPrintProc( *freeProcPtr = TCL_DYNAMIC; p = (i > (int)sizeof(char *)) ? dash->pattern.pt : dash->pattern.array; - sprintf(buffer, "%d", *p++ & 0xff); + snprintf(buffer, 4 * i, "%d", *p++ & 0xff); while (--i) { - sprintf(buffer+strlen(buffer), " %d", *p++ & 0xff); + snprintf(buffer + strlen(buffer), 4 * i - strlen(buffer), " %d", *p++ & 0xff); } return buffer; } diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index b80c197ba5..aaac122490 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -267,7 +267,7 @@ static void CanvasWorldChanged(ClientData instanceData); static int ConfigureCanvas(Tcl_Interp *interp, TkCanvas *canvasPtr, int objc, Tcl_Obj *const *objv, int flags); -static void DestroyCanvas(void *memPtr); +static Tcl_FreeProc DestroyCanvas; static void DisplayCanvas(ClientData clientData); static void DoItem(Tcl_Obj *accumObj, Tk_Item *itemPtr, Tk_Uid tag); @@ -2168,7 +2168,7 @@ CanvasWidgetCmd( static void DestroyCanvas( - void *memPtr) /* Info about canvas widget. */ + char *memPtr) /* Info about canvas widget. */ { TkCanvas *canvasPtr = (TkCanvas *)memPtr; Tk_Item *itemPtr; @@ -2730,7 +2730,7 @@ CanvasEventProc( if (canvasPtr->flags & REDRAW_PENDING) { Tcl_CancelIdleCall(DisplayCanvas, canvasPtr); } - Tcl_EventuallyFree(canvasPtr, (Tcl_FreeProc *) DestroyCanvas); + Tcl_EventuallyFree(canvasPtr, DestroyCanvas); } else if (eventPtr->type == ConfigureNotify) { canvasPtr->flags |= UPDATE_SCROLLBARS; diff --git a/generic/tkCmds.c b/generic/tkCmds.c index c5f0a506e9..a6421374c2 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -774,7 +774,8 @@ CaretCmd( } Tcl_SetObjResult(interp, Tcl_NewIntObj(value)); } else { - int i, value, x = 0, y = 0, height = -1; + int i; + int value, x = 0, y = 0, height = -1; for (i = 2; i < objc; i += 2) { if ((Tcl_GetIndexFromObj(interp, objv[i], caretStrings, @@ -810,13 +811,6 @@ ScalingCmd( int skip, width, height; double d; - if (Tcl_IsSafe(interp)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "scaling not accessible in a safe interpreter", -1)); - Tcl_SetErrorCode(interp, "TK", "SAFE", "SCALING", NULL); - return TCL_ERROR; - } - skip = TkGetDisplayOf(interp, objc - 1, objv + 1, &tkwin); if (skip < 0) { return TCL_ERROR; @@ -827,6 +821,11 @@ ScalingCmd( d *= WidthOfScreen(screenPtr); d /= WidthMMOfScreen(screenPtr); Tcl_SetObjResult(interp, Tcl_NewDoubleObj(d)); + } else if (Tcl_IsSafe(interp)) { + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "setting the scaling not accessible in a safe interpreter", -1)); + Tcl_SetErrorCode(interp, "TK", "SAFE", "SCALING", NULL); + return TCL_ERROR; } else if (objc - skip == 2) { if (Tcl_GetDoubleFromObj(interp, objv[1+skip], &d) != TCL_OK) { return TCL_ERROR; @@ -940,11 +939,11 @@ InactiveCmd( return TCL_ERROR; } if (objc - skip == 1) { - long inactive; + Tcl_WideInt inactive; inactive = (Tcl_IsSafe(interp) ? -1 : Tk_GetUserInactiveTime(Tk_Display(tkwin))); - Tcl_SetObjResult(interp, Tcl_NewLongObj(inactive)); + Tcl_SetObjResult(interp, Tcl_NewWideIntObj(inactive)); } else if (objc - skip == 2) { const char *string; @@ -1806,10 +1805,10 @@ Tk_WinfoObjCmd( if (string == NULL) { strcpy(buf, "unknown"); } else { - sprintf(buf, "%s %d", string, visInfoPtr[i].depth); + snprintf(buf, sizeof(buf), "%s %d", string, visInfoPtr[i].depth); } if (includeVisualId) { - sprintf(visualIdString, " 0x%lx", + snprintf(visualIdString, sizeof(visualIdString), " 0x%lx", (unsigned long) visInfoPtr[i].visualid); strcat(buf, visualIdString); } @@ -1824,224 +1823,7 @@ Tk_WinfoObjCmd( return TCL_OK; } -#if 0 -/* - *---------------------------------------------------------------------- - * - * Tk_WmObjCmd -- - * - * This function is invoked to process the "wm" Tcl command. See the user - * documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -int -Tk_WmObjCmd( - ClientData clientData, /* Main window associated with interpreter. */ - Tcl_Interp *interp, /* Current interpreter. */ - int objc, /* Number of arguments. */ - Tcl_Obj *const objv[]) /* Argument objects. */ -{ - Tk_Window tkwin; - TkWindow *winPtr; - - static const char *const optionStrings[] = { - "aspect", "client", "command", "deiconify", - "focusmodel", "frame", "geometry", "grid", - "group", "iconbitmap", "iconify", "iconmask", - "iconname", "iconposition", "iconwindow", "maxsize", - "minsize", "overrideredirect", "positionfrom", "protocol", - "resizable", "sizefrom", "state", "title", - "tracing", "transient", "withdraw", NULL - }; - enum options { - TKWM_ASPECT, TKWM_CLIENT, TKWM_COMMAND, TKWM_DEICONIFY, - TKWM_FOCUSMOD, TKWM_FRAME, TKWM_GEOMETRY, TKWM_GRID, - TKWM_GROUP, TKWM_ICONBMP, TKWM_ICONIFY, TKWM_ICONMASK, - TKWM_ICONNAME, TKWM_ICONPOS, TKWM_ICONWIN, TKWM_MAXSIZE, - TKWM_MINSIZE, TKWM_OVERRIDE, TKWM_POSFROM, TKWM_PROTOCOL, - TKWM_RESIZABLE, TKWM_SIZEFROM, TKWM_STATE, TKWM_TITLE, - TKWM_TRACING, TKWM_TRANSIENT, TKWM_WITHDRAW - }; - - tkwin = (Tk_Window) clientData; - - if (objc < 2) { - Tcl_WrongNumArgs(interp, 1, objv, "option window ?arg?"); - return TCL_ERROR; - } - if (Tcl_GetIndexFromObj(interp, objv[1], optionStrings, "option", 0, - &index) != TCL_OK) { - return TCL_ERROR; - } - - if (index == TKWM_TRACING) { - int wmTracing; - TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr; - - if ((objc != 2) && (objc != 3)) { - Tcl_WrongNumArgs(interp, 1, objv, "tracing ?boolean?"); - return TCL_ERROR; - } - if (objc == 2) { - Tcl_SetObjResult(interp, Tcl_NewBooleanObj( - dispPtr->flags & TK_DISPLAY_WM_TRACING)); - return TCL_OK; - } - if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) { - return TCL_ERROR; - } - if (wmTracing) { - dispPtr->flags |= TK_DISPLAY_WM_TRACING; - } else { - dispPtr->flags &= ~TK_DISPLAY_WM_TRACING; - } - return TCL_OK; - } - - if (objc < 3) { - Tcl_WrongNumArgs(interp, 2, objv, "window ?arg?"); - return TCL_ERROR; - } - winPtr = (TkWindow *) Tk_NameToWindow(interp, - Tcl_GetString(objv[2]), tkwin); - if (winPtr == NULL) { - return TCL_ERROR; - } - if (!(winPtr->flags & TK_TOP_LEVEL)) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "window \"%s\" isn't a top-level window", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", winPtr->pathName, - NULL); - return TCL_ERROR; - } - - switch ((enum options) index) { - case TKWM_ASPECT: - TkpWmAspectCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_CLIENT: - TkpWmClientCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_COMMAND: - TkpWmCommandCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_DEICONIFY: - TkpWmDeiconifyCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_FOCUSMOD: - TkpWmFocusmodCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_FRAME: - TkpWmFrameCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_GEOMETRY: - TkpWmGeometryCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_GRID: - TkpWmGridCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_GROUP: - TkpWmGroupCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_ICONBMP: - TkpWmIconbitmapCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_ICONIFY: - TkpWmIconifyCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_ICONMASK: - TkpWmIconmaskCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_ICONNAME: - /* - * Slight Unix variation. - */ - TkpWmIconnameCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_ICONPOS: - /* - * nearly same - 1 line more on Unix. - */ - TkpWmIconpositionCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_ICONWIN: - TkpWmIconwindowCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_MAXSIZE: - /* - * Nearly same, win diffs. - */ - TkpWmMaxsizeCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_MINSIZE: - /* - * Nearly same, win diffs - */ - TkpWmMinsizeCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_OVERRIDE: - /* - * Almost same. - */ - TkpWmOverrideCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_POSFROM: - /* - * Equal across platforms - */ - TkpWmPositionfromCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_PROTOCOL: - /* - * Equal across platforms - */ - TkpWmProtocolCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_RESIZABLE: - /* - * Almost same - */ - TkpWmResizableCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_SIZEFROM: - /* - * Equal across platforms - */ - TkpWmSizefromCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_STATE: - TkpWmStateCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_TITLE: - TkpWmTitleCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_TRANSIENT: - TkpWmTransientCmd(interp, tkwin, winPtr, objc, objv); - break; - case TKWM_WITHDRAW: - TkpWmWithdrawCmd(interp, tkwin, winPtr, objc, objv); - break; - } - - updateGeom: - if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { - Tcl_DoWhenIdle(UpdateGeometryInfo, winPtr); - wmPtr->flags |= WM_UPDATE_PENDING; - } - return TCL_OK; -} -#endif - /* *---------------------------------------------------------------------- * diff --git a/generic/tkColor.c b/generic/tkColor.c index 6b6405ad34..bc4c30cf23 100644 --- a/generic/tkColor.c +++ b/generic/tkColor.c @@ -15,6 +15,10 @@ #include "tkInt.h" #include "tkColor.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Structures of the following following type are used as keys for * colorValueTable (in TkDisplay). @@ -371,7 +375,7 @@ Tk_NameOfColor( ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red, + snprintf(tsdPtr->rgbString, sizeof(tsdPtr->rgbString), "#%04x%04x%04x", colorPtr->red, colorPtr->green, colorPtr->blue); /* diff --git a/generic/tkConfig.c b/generic/tkConfig.c index c98f4d9672..9e4c875dea 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -26,6 +26,10 @@ #include "tkInt.h" #include "tkFont.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * The following encoding is used in TYPE_FLAGS: * @@ -509,19 +513,19 @@ Tk_InitOptions( switch (source) { case OPTION_DATABASE: - sprintf(msg, "\n (database entry for \"%.50s\")", + snprintf(msg, 200, "\n (database entry for \"%.50s\")", optionPtr->specPtr->optionName); break; case SYSTEM_DEFAULT: - sprintf(msg, "\n (system default for \"%.50s\")", + snprintf(msg, 200, "\n (system default for \"%.50s\")", optionPtr->specPtr->optionName); break; case TABLE_DEFAULT: - sprintf(msg, "\n (default value for \"%.50s\")", + snprintf(msg, 200, "\n (default value for \"%.50s\")", optionPtr->specPtr->optionName); } if (tkwin != NULL) { - sprintf(msg + strlen(msg) - 1, " in widget \"%.50s\")", + snprintf(msg + strlen(msg) - 1, 200 - (strlen(msg) - 1), " in widget \"%.50s\")", Tk_PathName(tkwin)); } Tcl_AddErrorInfo(interp, msg); @@ -619,7 +623,7 @@ DoObjConfig( } else { oldInternalPtr = (char *) &internal.internalForm; } - nullOK = (optionPtr->specPtr->flags & TK_OPTION_NULL_OK); + nullOK = (optionPtr->specPtr->flags & (TK_OPTION_NULL_OK|32 /* TCL_NULL_OK */)); switch (optionPtr->specPtr->type) { case TK_OPTION_BOOLEAN: { int newBool; diff --git a/generic/tkCursor.c b/generic/tkCursor.c index 902472b33a..50c68036aa 100644 --- a/generic/tkCursor.c +++ b/generic/tkCursor.c @@ -14,6 +14,10 @@ #include "tkInt.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * A TkCursor structure exists for each cursor that is currently active. Each * structure is indexed with two hash tables defined below. One of the tables @@ -425,7 +429,7 @@ Tk_NameOfCursor( if (!dispPtr->cursorInit) { printid: - sprintf(dispPtr->cursorString, "cursor id 0x%" TCL_Z_MODIFIER "x", (size_t)cursor); + snprintf(dispPtr->cursorString, sizeof(dispPtr->cursorString), "cursor id 0x%" TCL_Z_MODIFIER "x", (size_t)cursor); return dispPtr->cursorString; } idHashPtr = Tcl_FindHashEntry(&dispPtr->cursorIdTable, (char *) cursor); diff --git a/generic/tkDList.h b/generic/tkDList.h index 24484392fe..3a8840c90b 100644 --- a/generic/tkDList.h +++ b/generic/tkDList.h @@ -7,7 +7,7 @@ * before or after an existing element or at the head/tail of the list. * A list may be traversed in the forward or backward direction. * - * Copyright (c) 2018 by Gregor Cramer. + * Copyright (c) 2018 Gregor Cramer. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -28,8 +28,8 @@ * MyList listHdr = TK_DLIST_LIST_INITIALIZER; // or MyList_Init(&listHdr) * MyListEntry *p; * int i = 0; - * MyList_Append(&listHdr, ckalloc(sizeof(MyListEntry))); - * MyList_Append(&listHdr, ckalloc(sizeof(MyListEntry))); + * MyList_Append(&listHdr, (MyListEntry *)ckalloc(sizeof(MyListEntry))); + * MyList_Append(&listHdr, (MyListEntry *)ckalloc(sizeof(MyListEntry))); * TK_DLIST_FOREACH(p, &listHdr) { p->value = i++; } * // ... * MyList_RemoveHead(&listHdr); @@ -361,9 +361,9 @@ LT##_Prepend(LT *head, struct ElemType *elem) \ { \ assert(head); \ assert(elem); \ - elem->_dl_.prev = (void *) head; \ + elem->_dl_.prev = (PSEntry *) head; \ if (!head->first) { \ - elem->_dl_.next = (void *) head; \ + elem->_dl_.next = (PSEntry *) head; \ head->last = elem; \ } else { \ elem->_dl_.next = head->first; \ @@ -378,9 +378,9 @@ LT##_Append(LT *head, struct ElemType *elem) \ { \ assert(head); \ assert(elem); \ - elem->_dl_.next = (void *) head; \ + elem->_dl_.next = (PSEntry *) head; \ if (!head->first) { \ - elem->_dl_.prev = (void *) head; \ + elem->_dl_.prev = (PSEntry *) head; \ head->first = elem; \ } else { \ elem->_dl_.prev = head->last; \ @@ -402,9 +402,9 @@ LT##_Move(LT *dst, LT *src) \ dst->last = src->last; \ } else { \ *dst = *src; \ - dst->first->_dl_.prev = (void *) dst; \ + dst->first->_dl_.prev = (PSEntry *) dst; \ } \ - dst->last->_dl_.next = (void *) dst; \ + dst->last->_dl_.next = (PSEntry *) dst; \ LT##_Init(src); \ } \ } \ @@ -528,11 +528,11 @@ LT##_Traverse(LT *head, LT##_Func func) \ #define TK_DLIST_FOREACH(var, head) \ assert(head); \ - for (var = head->first ? head->first : (void *) head; var != (void *) head; var = var->_dl_.next) + for (var = head->first ? head->first : (PSEntry *) head; var != (PSEntry *) head; var = var->_dl_.next) #define TK_DLIST_FOREACH_REVERSE(var, head) \ assert(head); \ - for (var = head->last ? head->last : (void *) head; var != (void *) head; var = var->_dl_.prev) + for (var = head->last ? head->last : (PSEntry *) head; var != (PSEntry *) head; var = var->_dl_.prev) #endif /* TK_DLIST_DEFINED */ diff --git a/generic/tkEntry.c b/generic/tkEntry.c index bf7626aa17..3c38c5cf3b 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -16,8 +16,12 @@ */ #include "tkInt.h" -#include "default.h" #include "tkEntry.h" +#include "default.h" + +#ifdef _WIN32 +#include "tkWinInt.h" +#endif /* * The following macro defines how many extra pixels to leave on each side of @@ -77,7 +81,7 @@ static const Tk_OptionSpec entryOptSpec[] = { {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1, Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK, - (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0}, + DEF_ENTRY_DISABLED_BG_MONO, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1, Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, @@ -103,7 +107,7 @@ static const Tk_OptionSpec entryOptSpec[] = { {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1, Tk_Offset(Entry, insertBorderWidth), 0, - (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0}, + DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime), 0, 0, 0}, @@ -121,7 +125,7 @@ static const Tk_OptionSpec entryOptSpec[] = { {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1, Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK, - (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0}, + DEF_ENTRY_READONLY_BG_MONO, 0}, {TK_OPTION_RELIEF, "-relief", "relief", "Relief", DEF_ENTRY_RELIEF, -1, Tk_Offset(Entry, relief), 0, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", @@ -210,7 +214,7 @@ static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_BORDER, "-disabledbackground", "disabledBackground", "DisabledBackground", DEF_ENTRY_DISABLED_BG_COLOR, -1, Tk_Offset(Entry, disabledBorder), TK_OPTION_NULL_OK, - (ClientData) DEF_ENTRY_DISABLED_BG_MONO, 0}, + DEF_ENTRY_DISABLED_BG_MONO, 0}, {TK_OPTION_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_ENTRY_DISABLED_FG, -1, Tk_Offset(Entry, dfgColorPtr), TK_OPTION_NULL_OK, 0, 0}, @@ -243,7 +247,7 @@ static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_PIXELS, "-insertborderwidth", "insertBorderWidth", "BorderWidth", DEF_ENTRY_INSERT_BD_COLOR, -1, Tk_Offset(Entry, insertBorderWidth), 0, - (ClientData) DEF_ENTRY_INSERT_BD_MONO, 0}, + DEF_ENTRY_INSERT_BD_MONO, 0}, {TK_OPTION_INT, "-insertofftime", "insertOffTime", "OffTime", DEF_ENTRY_INSERT_OFF_TIME, -1, Tk_Offset(Entry, insertOffTime), 0, 0, 0}, @@ -263,7 +267,7 @@ static const Tk_OptionSpec sbOptSpec[] = { {TK_OPTION_BORDER, "-readonlybackground", "readonlyBackground", "ReadonlyBackground", DEF_ENTRY_READONLY_BG_COLOR, -1, Tk_Offset(Entry, readonlyBorder), TK_OPTION_NULL_OK, - (ClientData) DEF_ENTRY_READONLY_BG_MONO, 0}, + DEF_ENTRY_READONLY_BG_MONO, 0}, {TK_OPTION_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", DEF_SPINBOX_REPEAT_DELAY, -1, Tk_Offset(Spinbox, repeatDelay), 0, 0, 0}, @@ -392,22 +396,22 @@ static const char *const selElementNames[] = { static int ConfigureEntry(Tcl_Interp *interp, Entry *entryPtr, int objc, Tcl_Obj *const objv[]); static int DeleteChars(Entry *entryPtr, int index, int count); -static void DestroyEntry(void *memPtr); -static void DisplayEntry(ClientData clientData); -static void EntryBlinkProc(ClientData clientData); -static void EntryCmdDeletedProc(ClientData clientData); +static Tcl_FreeProc DestroyEntry; +static void DisplayEntry(void *clientData); +static void EntryBlinkProc(void *clientData); +static void EntryCmdDeletedProc(void *clientData); static void EntryComputeGeometry(Entry *entryPtr); -static void EntryEventProc(ClientData clientData, +static void EntryEventProc(void *clientData, XEvent *eventPtr); static void EntryFocusProc(Entry *entryPtr, int gotFocus); -static int EntryFetchSelection(ClientData clientData, int offset, +static int EntryFetchSelection(void *clientData, int offset, char *buffer, int maxBytes); -static void EntryLostSelection(ClientData clientData); +static void EntryLostSelection(void *clientData); static void EventuallyRedraw(Entry *entryPtr); static void EntryScanTo(Entry *entryPtr, int y); static void EntrySetValue(Entry *entryPtr, const char *value); static void EntrySelectTo(Entry *entryPtr, int index); -static char * EntryTextVarProc(ClientData clientData, +static char * EntryTextVarProc(void *clientData, Tcl_Interp *interp, const char *name1, const char *name2, int flags); static void EntryUpdateScrollbar(Entry *entryPtr); @@ -421,10 +425,10 @@ static int EntryValueChanged(Entry *entryPtr, const char *newValue); static void EntryVisibleRange(Entry *entryPtr, double *firstPtr, double *lastPtr); -static int EntryWidgetObjCmd(ClientData clientData, +static int EntryWidgetObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static void EntryWorldChanged(ClientData instanceData); +static void EntryWorldChanged(void *instanceData); static int GetEntryIndex(Tcl_Interp *interp, Entry *entryPtr, Tcl_Obj *indexObj, int *indexPtr); static int InsertChars(Entry *entryPtr, int index, const char *string); @@ -433,7 +437,7 @@ static int InsertChars(Entry *entryPtr, int index, const char *string); * These forward declarations are the spinbox specific ones: */ -static int SpinboxWidgetObjCmd(ClientData clientData, +static int SpinboxWidgetObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int GetSpinboxElement(Spinbox *sbPtr, int x, int y); @@ -472,7 +476,7 @@ static const Tk_ClassProcs entryClass = { int Tk_EntryObjCmd( - ClientData clientData, /* NULL. */ + TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -507,7 +511,7 @@ Tk_EntryObjCmd( * initialized as memset covers the rest. */ - entryPtr = ckalloc(sizeof(Entry)); + entryPtr = (Entry *)ckalloc(sizeof(Entry)); memset(entryPtr, 0, sizeof(Entry)); entryPtr->tkwin = tkwin; @@ -518,7 +522,7 @@ Tk_EntryObjCmd( EntryCmdDeletedProc); entryPtr->optionTable = optionTable; entryPtr->type = TK_ENTRY; - tmp = ckalloc(1); + tmp = (char *)ckalloc(1); tmp[0] = '\0'; entryPtr->string = tmp; entryPtr->selectFirst = -1; @@ -583,12 +587,12 @@ Tk_EntryObjCmd( static int EntryWidgetObjCmd( - ClientData clientData, /* Information about entry widget. */ + void *clientData, /* Information about entry widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Entry *entryPtr = clientData; + Entry *entryPtr = (Entry *)clientData; int cmdIndex, selIndex, result; Tcl_Obj *objPtr; @@ -611,7 +615,8 @@ EntryWidgetObjCmd( Tcl_Preserve(entryPtr); switch ((enum entryCmd) cmdIndex) { case COMMAND_BBOX: { - int index, x, y, width, height; + int index; + int x, y, width, height; Tcl_Obj *bbox[4]; if (objc != 3) { @@ -664,7 +669,8 @@ EntryWidgetObjCmd( break; case COMMAND_DELETE: { - int first, last, code; + int first, last; + int code; if ((objc < 3) || (objc > 4)) { Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?"); @@ -725,7 +731,8 @@ EntryWidgetObjCmd( } case COMMAND_INSERT: { - int index, code; + int index; + int code; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "index text"); @@ -1017,9 +1024,9 @@ EntryWidgetObjCmd( static void DestroyEntry( - void *memPtr) /* Info about entry widget. */ + char *memPtr) /* Info about entry widget. */ { - Entry *entryPtr = memPtr; + Entry *entryPtr = (Entry *)memPtr; /* * Free up all the stuff that requires special handling, then let @@ -1097,14 +1104,15 @@ ConfigureEntry( Spinbox *sbPtr = (Spinbox *) entryPtr; /* Only used when this widget is of type * TK_SPINBOX */ - char *oldValues = NULL; /* lint initialization */ - char *oldFormat = NULL; /* lint initialization */ + char *oldValues = NULL; + char *oldFormat = NULL; int error; - int oldExport = 0; /* lint initialization */ - int valuesChanged = 0; /* lint initialization */ - double oldFrom = 0.0; /* lint initialization */ - double oldTo = 0.0; /* lint initialization */ + int oldExport = 0; + int valuesChanged = 0; + double oldFrom = 0.0; + double oldTo = 0.0; int code; + size_t formatSpace = TCL_DOUBLE_SPACE; /* * Eliminate any existing trace on a variable monitored by the entry. @@ -1193,7 +1201,7 @@ ConfigureEntry( */ int min, max; - size_t formatLen, formatSpace = TCL_DOUBLE_SPACE; + size_t formatLen; char fbuf[4], *fmt = sbPtr->reqFormat; formatLen = strlen(fmt); @@ -1220,7 +1228,7 @@ ConfigureEntry( if (formatSpace < TCL_DOUBLE_SPACE) { formatSpace = TCL_DOUBLE_SPACE; } - sbPtr->formatBuf = ckrealloc(sbPtr->formatBuf, formatSpace); + sbPtr->formatBuf = (char *)ckrealloc(sbPtr->formatBuf, formatSpace); /* * We perturb the value of oldFrom to allow us to go into the @@ -1370,7 +1378,7 @@ ConfigureEntry( } else if (dvalue < sbPtr->fromValue) { dvalue = sbPtr->fromValue; } - sprintf(sbPtr->formatBuf, sbPtr->valueFormat, dvalue); + snprintf(sbPtr->formatBuf, formatSpace, sbPtr->valueFormat, dvalue); /* * No check for error return here as well, because any possible @@ -1427,14 +1435,14 @@ ConfigureEntry( static void EntryWorldChanged( - ClientData instanceData) /* Information about widget. */ + void *instanceData) /* Information about widget. */ { XGCValues gcValues; GC gc = NULL; unsigned long mask; Tk_3DBorder border; XColor *colorPtr; - Entry *entryPtr = instanceData; + Entry *entryPtr = (Entry *)instanceData; entryPtr->avgWidth = Tk_TextWidth(entryPtr->tkfont, "0", 1); if (entryPtr->avgWidth == 0) { @@ -1528,9 +1536,9 @@ EntryWorldChanged( int TkpDrawEntryBorderAndFocus( - Entry *entryPtr, - Drawable pixmap, - int isSpinbox) + TCL_UNUSED(Entry *), + TCL_UNUSED(Drawable), + TCL_UNUSED(int)) { return 0; } @@ -1555,8 +1563,8 @@ TkpDrawEntryBorderAndFocus( int TkpDrawSpinboxButtons( - Spinbox *sbPtr, - Pixmap pixmap) + TCL_UNUSED(Spinbox *), + TCL_UNUSED(Pixmap)) { return 0; } @@ -1580,9 +1588,9 @@ TkpDrawSpinboxButtons( static void DisplayEntry( - ClientData clientData) /* Information about window. */ + void *clientData) /* Information about window. */ { - Entry *entryPtr = clientData; + Entry *entryPtr = (Entry *)clientData; Tk_Window tkwin = entryPtr->tkwin; int baseY, selStartX, selEndX, cursorX; int showSelection, xBound; @@ -1920,7 +1928,8 @@ static void EntryComputeGeometry( Entry *entryPtr) /* Widget record for entry. */ { - int totalLength, overflow, maxOffScreen, rightX; + int totalLength, overflow, rightX; + int maxOffScreen; int height, width, i; Tk_FontMetrics fm; char *p; @@ -1952,7 +1961,7 @@ EntryComputeGeometry( size = TkUniCharToUtf(ch, buf); entryPtr->numDisplayBytes = entryPtr->numChars * size; - p = ckalloc(entryPtr->numDisplayBytes + 1); + p = (char *)ckalloc(entryPtr->numDisplayBytes + 1); entryPtr->displayString = p; for (i = entryPtr->numChars; --i >= 0; ) { @@ -2071,7 +2080,7 @@ InsertChars( } newByteCount = entryPtr->numBytes + byteCount + 1; - newStr = ckalloc(newByteCount); + newStr = (char *)ckalloc(newByteCount); memcpy(newStr, string, byteIndex); strcpy(newStr + byteIndex, value); strcpy(newStr + byteIndex + byteCount, string + byteIndex); @@ -2162,7 +2171,7 @@ DeleteChars( const char *string; char *newStr, *toDelete; - if ((index + count) > entryPtr->numChars) { + if (index + count > entryPtr->numChars) { count = entryPtr->numChars - index; } if (count <= 0) { @@ -2174,11 +2183,11 @@ DeleteChars( byteCount = TkUtfAtIndex(string + byteIndex, count) - (string+byteIndex); newByteCount = entryPtr->numBytes + 1 - byteCount; - newStr = ckalloc(newByteCount); + newStr = (char *)ckalloc(newByteCount); memcpy(newStr, string, (size_t) byteIndex); strcpy(newStr + byteIndex, string + byteIndex + byteCount); - toDelete = ckalloc(byteCount + 1); + toDelete = (char *)ckalloc(byteCount + 1); memcpy(toDelete, string + byteIndex, (size_t) byteCount); toDelete[byteCount] = '\0'; @@ -2209,14 +2218,14 @@ DeleteChars( */ if (entryPtr->selectFirst >= index) { - if (entryPtr->selectFirst >= (index + count)) { + if (entryPtr->selectFirst >= index + count) { entryPtr->selectFirst -= count; } else { entryPtr->selectFirst = index; } } if (entryPtr->selectLast >= index) { - if (entryPtr->selectLast >= (index + count)) { + if (entryPtr->selectLast >= index + count) { entryPtr->selectLast -= count; } else { entryPtr->selectLast = index; @@ -2227,21 +2236,21 @@ DeleteChars( entryPtr->selectLast = -1; } if (entryPtr->selectAnchor >= index) { - if (entryPtr->selectAnchor >= (index+count)) { + if (entryPtr->selectAnchor >= index + count) { entryPtr->selectAnchor -= count; } else { entryPtr->selectAnchor = index; } } if (entryPtr->leftIndex > index) { - if (entryPtr->leftIndex >= (index + count)) { + if (entryPtr->leftIndex >= index + count) { entryPtr->leftIndex -= count; } else { entryPtr->leftIndex = index; } } if (entryPtr->insertPos >= index) { - if (entryPtr->insertPos >= (index + count)) { + if (entryPtr->insertPos >= index + count) { entryPtr->insertPos -= count; } else { entryPtr->insertPos = index; @@ -2364,7 +2373,7 @@ EntrySetValue( * during validation */ - char *tmp = ckalloc(valueLen + 1); + char *tmp = (char *)ckalloc(valueLen + 1); strcpy(tmp, value); value = tmp; @@ -2393,7 +2402,7 @@ EntrySetValue( if (malloced) { entryPtr->string = value; } else { - char *tmp = ckalloc(valueLen + 1); + char *tmp = (char *)ckalloc(valueLen + 1); strcpy(tmp, value); entryPtr->string = tmp; @@ -2450,13 +2459,13 @@ EntrySetValue( static void EntryEventProc( - ClientData clientData, /* Information about window. */ + void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - Entry *entryPtr = clientData; + Entry *entryPtr = (Entry *)clientData; if ((entryPtr->type == TK_SPINBOX) && (eventPtr->type == MotionNotify)) { - Spinbox *sbPtr = clientData; + Spinbox *sbPtr = (Spinbox *)clientData; int elem; elem = GetSpinboxElement(sbPtr, eventPtr->xmotion.x, @@ -2493,7 +2502,7 @@ EntryEventProc( if (entryPtr->flags & REDRAW_PENDING) { Tcl_CancelIdleCall(DisplayEntry, clientData); } - Tcl_EventuallyFree(clientData, (Tcl_FreeProc *) DestroyEntry); + Tcl_EventuallyFree(clientData, DestroyEntry); } break; case ConfigureNotify: @@ -2532,9 +2541,9 @@ EntryEventProc( static void EntryCmdDeletedProc( - ClientData clientData) /* Pointer to widget record for widget. */ + void *clientData) /* Pointer to widget record for widget. */ { - Entry *entryPtr = clientData; + Entry *entryPtr = (Entry *)clientData; /* * This function could be invoked either because the window was destroyed @@ -2815,14 +2824,14 @@ EntrySelectTo( static int EntryFetchSelection( - ClientData clientData, /* Information about entry widget. */ + void *clientData, /* Information about entry widget. */ int offset, /* Byte offset within selection of first * character to be returned. */ char *buffer, /* Location in which to place selection. */ int maxBytes) /* Maximum number of bytes to place at buffer, * not including terminating NUL character. */ { - Entry *entryPtr = clientData; + Entry *entryPtr = (Entry *)clientData; int byteCount; const char *string; const char *selStart, *selEnd; @@ -2842,7 +2851,7 @@ EntryFetchSelection( if (byteCount <= 0) { return 0; } - memcpy(buffer, selStart + offset, (size_t) byteCount); + memcpy(buffer, selStart + offset, byteCount); buffer[byteCount] = '\0'; return byteCount; } @@ -2867,9 +2876,9 @@ EntryFetchSelection( static void EntryLostSelection( - ClientData clientData) /* Information about entry widget. */ + void *clientData) /* Information about entry widget. */ { - Entry *entryPtr = clientData; + Entry *entryPtr = (Entry *)clientData; entryPtr->flags &= ~GOT_SELECTION; @@ -3054,9 +3063,9 @@ EntryUpdateScrollbar( static void EntryBlinkProc( - ClientData clientData) /* Pointer to record describing entry. */ + void *clientData) /* Pointer to record describing entry. */ { - Entry *entryPtr = clientData; + Entry *entryPtr = (Entry *)clientData; if ((entryPtr->state == STATE_DISABLED) || (entryPtr->state == STATE_READONLY) || @@ -3142,16 +3151,15 @@ EntryFocusProc( *-------------------------------------------------------------- */ - /* ARGSUSED */ static char * EntryTextVarProc( - ClientData clientData, /* Information about button. */ + void *clientData, /* Information about button. */ Tcl_Interp *interp, /* Interpreter containing variable. */ - const char *name1, /* Not used. */ - const char *name2, /* Not used. */ + TCL_UNUSED(const char *), + TCL_UNUSED(const char *), int flags) /* Information about what happened. */ { - Entry *entryPtr = clientData; + Entry *entryPtr = (Entry *)clientData; const char *value; if (entryPtr->flags & ENTRY_DELETED) { @@ -3168,14 +3176,14 @@ EntryTextVarProc( if (flags & TCL_TRACE_UNSETS) { if (!Tcl_InterpDeleted(interp) && entryPtr->textVarName) { - ClientData probe = NULL; + void *probe = NULL; do { probe = Tcl_VarTraceInfo(interp, entryPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, EntryTextVarProc, probe); - if (probe == (ClientData)entryPtr) { + if (probe == (void *)entryPtr) { break; } } while (probe); @@ -3529,11 +3537,11 @@ ExpandPercents( number = -1; break; } - sprintf(numStorage, "%d", number); + snprintf(numStorage, sizeof(numStorage), "%d", number); string = numStorage; break; case 'i': /* index of insert/delete */ - sprintf(numStorage, "%d", index); + snprintf(numStorage, sizeof(numStorage), "%d", index); string = numStorage; break; case 'P': /* 'Peeked' new value of the string */ @@ -3602,7 +3610,7 @@ ExpandPercents( int Tk_SpinboxObjCmd( - ClientData clientData, /* NULL. */ + TCL_UNUSED(void *), Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -3638,7 +3646,7 @@ Tk_SpinboxObjCmd( * initialized as memset covers the rest. */ - sbPtr = ckalloc(sizeof(Spinbox)); + sbPtr = (Spinbox *)ckalloc(sizeof(Spinbox)); entryPtr = (Entry *) sbPtr; memset(sbPtr, 0, sizeof(Spinbox)); @@ -3650,7 +3658,7 @@ Tk_SpinboxObjCmd( EntryCmdDeletedProc); entryPtr->optionTable = optionTable; entryPtr->type = TK_SPINBOX; - tmp = ckalloc(1); + tmp = (char *)ckalloc(1); tmp[0] = '\0'; entryPtr->string = tmp; entryPtr->selectFirst = -1; @@ -3677,7 +3685,7 @@ Tk_SpinboxObjCmd( sbPtr->fromValue = 0.0; sbPtr->toValue = 100.0; sbPtr->increment = 1.0; - sbPtr->formatBuf = ckalloc(TCL_DOUBLE_SPACE); + sbPtr->formatBuf = (char *)ckalloc(TCL_DOUBLE_SPACE); sbPtr->bdRelief = TK_RELIEF_FLAT; sbPtr->buRelief = TK_RELIEF_FLAT; @@ -3733,13 +3741,13 @@ Tk_SpinboxObjCmd( static int SpinboxWidgetObjCmd( - ClientData clientData, /* Information about spinbox widget. */ + void *clientData, /* Information about spinbox widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - Entry *entryPtr = clientData; - Spinbox *sbPtr = clientData; + Entry *entryPtr = (Entry *)clientData; + Spinbox *sbPtr = (Spinbox *)clientData; int cmdIndex, selIndex, result; Tcl_Obj *objPtr; @@ -3762,7 +3770,8 @@ SpinboxWidgetObjCmd( Tcl_Preserve(entryPtr); switch ((enum sbCmd) cmdIndex) { case SB_CMD_BBOX: { - int index, x, y, width, height; + int index; + int x, y, width, height; Tcl_Obj *bbox[4]; if (objc != 3) { @@ -3814,7 +3823,8 @@ SpinboxWidgetObjCmd( break; case SB_CMD_DELETE: { - int first, last, code; + int first, last; + int code; if ((objc < 3) || (objc > 4)) { Tcl_WrongNumArgs(interp, 2, objv, "firstIndex ?lastIndex?"); @@ -3896,7 +3906,8 @@ SpinboxWidgetObjCmd( } case SB_CMD_INSERT: { - int index, code; + int index; + int code; if (objc != 4) { Tcl_WrongNumArgs(interp, 2, objv, "index text"); @@ -4321,7 +4332,8 @@ SpinboxInvoke( * there. If not, move to the first element of the list. */ - int i, listc, elemLen, length = entryPtr->numChars; + int i, listc; + int elemLen, length = entryPtr->numChars; const char *bytes; Tcl_Obj **listv; @@ -4330,7 +4342,7 @@ SpinboxInvoke( bytes = Tcl_GetStringFromObj(listv[i], &elemLen); if ((length == elemLen) && (memcmp(bytes, entryPtr->string, - (size_t) length) == 0)) { + length) == 0)) { sbPtr->eIndex = i; break; } @@ -4400,7 +4412,7 @@ SpinboxInvoke( dvalue = sbPtr->toValue; } } - sprintf(sbPtr->formatBuf, sbPtr->valueFormat, dvalue); + snprintf(sbPtr->formatBuf, TCL_DOUBLE_SPACE, sbPtr->valueFormat, dvalue); code = EntryValueChanged(entryPtr, sbPtr->formatBuf); } } @@ -4517,9 +4529,9 @@ ComputeFormat( fDigits++; /* Zero to left of decimal point. */ } if (fDigits <= eDigits) { - sprintf(sbPtr->digitFormat, "%%.%df", afterDecimal); + snprintf(sbPtr->digitFormat, sizeof(sbPtr->digitFormat), "%%.%df", afterDecimal); } else { - sprintf(sbPtr->digitFormat, "%%.%de", numDigits-1); + snprintf(sbPtr->digitFormat, sizeof(sbPtr->digitFormat), "%%.%de", numDigits-1); } sbPtr->valueFormat = sbPtr->digitFormat; return TCL_OK; diff --git a/generic/tkEntry.h b/generic/tkEntry.h index 6b1bf87aa8..8d863cf938 100644 --- a/generic/tkEntry.h +++ b/generic/tkEntry.h @@ -217,11 +217,11 @@ typedef struct { * multiple of this value. */ char *formatBuf; /* string into which to format value. * Malloc'ed. */ - char *reqFormat; /* Sprintf conversion specifier used for the + char *reqFormat; /* Snprintf conversion specifier used for the * value that the users requests. Malloc'ed */ - char *valueFormat; /* Sprintf conversion specifier used for the + char *valueFormat; /* Snprintf conversion specifier used for the * value. */ - char digitFormat[16]; /* Sprintf conversion specifier computed from + char digitFormat[16]; /* Snprintf conversion specifier computed from * digits and other information; used for the * value. */ diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 9bf31d49d3..6f17b76d37 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -1049,7 +1049,7 @@ FindDisplayFocusInfo( * None. * * Side effects: - * This mainPtr should no long access focus information. + * This mainPtr should no longer access focus information. * *---------------------------------------------------------------------- */ diff --git a/generic/tkFont.c b/generic/tkFont.c index 8138c34ad4..cef6f862a3 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -17,6 +17,10 @@ #include "tkMacOSXInt.h" /* Defines TK_DRAW_IN_CONTEXT */ #endif +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * The following structure is used to keep track of all the fonts that exist * in the current application. It must be stored in the TkMainInfo for the @@ -416,12 +420,16 @@ TkFontPkgFree( TkFontInfo *fiPtr = mainPtr->fontInfoPtr; Tcl_HashEntry *hPtr, *searchPtr; Tcl_HashSearch search; +#ifdef PURIFY int fontsLeft = 0; +#endif for (searchPtr = Tcl_FirstHashEntry(&fiPtr->fontCache, &search); searchPtr != NULL; searchPtr = Tcl_NextHashEntry(&search)) { +#ifdef PURIFY fontsLeft++; +#endif #ifdef DEBUG_FONTS fprintf(stderr, "Font %s still in cache.\n", (char *) Tcl_GetHashKey(&fiPtr->fontCache, searchPtr)); @@ -660,7 +668,7 @@ Tk_FontObjCmd( */ for (i = 1; ; i++) { - sprintf(buf, "font%d", i); + snprintf(buf, sizeof(buf), "font%d", i); namedHashPtr = Tcl_FindHashEntry(&fiPtr->namedTable, buf); if (namedHashPtr == NULL) { break; @@ -1318,6 +1326,7 @@ Tk_GetFontFromObj( FreeFontObj(objPtr); fontPtr = NULL; } else if (Tk_Screen(tkwin) == fontPtr->screen) { + fontPtr->resourceRefCount++; return (Tk_Font) fontPtr; } } @@ -3328,7 +3337,7 @@ Tk_TextLayoutToPostscript( p += TkUtfToUniChar(p, &ch); if ((ch == '(') || (ch == ')') || (ch == '\\') || (ch < 0x20)) { /* - * Tricky point: the "03" is necessary in the sprintf below, + * Tricky point: the "03" is necessary in the snprintf below, * so that a full three digits of octal are always generated. * Without the "03", a number following this sequence could be * interpreted by Postscript as part of this sequence. @@ -3354,7 +3363,7 @@ Tk_TextLayoutToPostscript( if (ch > 0xffff) { goto noMapping; } - sprintf(uindex, "%04X", ch); /* endianness? */ + snprintf(uindex, sizeof(uindex), "%04X", ch); /* endianness? */ glyphname = Tcl_GetVar2(interp, "::tk::psglyphs", uindex, 0); if (glyphname) { ps = Tcl_GetStringFromObj(psObj, &len); diff --git a/generic/tkFrame.c b/generic/tkFrame.c index 30602b2b6f..c5e50b6841 100644 --- a/generic/tkFrame.c +++ b/generic/tkFrame.c @@ -12,8 +12,8 @@ * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#include "default.h" #include "tkInt.h" +#include "default.h" /* * The following enum is used to define the type of the frame. @@ -305,26 +305,26 @@ static const Tk_OptionSpec *const optionSpecs[] = { static void ComputeFrameGeometry(Frame *framePtr); static int ConfigureFrame(Tcl_Interp *interp, Frame *framePtr, int objc, Tcl_Obj *const objv[]); -static int CreateFrame(ClientData clientData, Tcl_Interp *interp, +static int CreateFrame(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[], enum FrameType type, const char *appName); -static void DestroyFrame(void *memPtr); +static Tcl_FreeProc DestroyFrame; static void DestroyFramePartly(Frame *framePtr); -static void DisplayFrame(ClientData clientData); -static void FrameCmdDeletedProc(ClientData clientData); -static void FrameEventProc(ClientData clientData, +static void DisplayFrame(void *clientData); +static void FrameCmdDeletedProc(void *clientData); +static void FrameEventProc(void *clientData, XEvent *eventPtr); -static void FrameLostContentProc(ClientData clientData, +static void FrameLostContentProc(void *clientData, Tk_Window tkwin); -static void FrameRequestProc(ClientData clientData, +static void FrameRequestProc(void *clientData, Tk_Window tkwin); -static void FrameStructureProc(ClientData clientData, +static void FrameStructureProc(void *clientData, XEvent *eventPtr); -static int FrameWidgetObjCmd(ClientData clientData, +static int FrameWidgetObjCmd(void *clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); -static void FrameWorldChanged(ClientData instanceData); -static void MapFrame(ClientData clientData); +static void FrameWorldChanged(void *instanceData); +static void MapFrame(void *clientData); /* * The structure below defines frame class behavior by means of functions that @@ -346,7 +346,7 @@ static const Tk_ClassProcs frameClass = { static const Tk_GeomMgr frameGeomType = { "labelframe", /* name */ FrameRequestProc, /* requestProc */ - FrameLostContentProc /* lostSlaveProc */ + FrameLostContentProc /* lostContentProc */ }; /* @@ -370,7 +370,7 @@ static const Tk_GeomMgr frameGeomType = { int Tk_FrameObjCmd( - ClientData clientData, /* Either NULL or pointer to option table. */ + void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -380,7 +380,7 @@ Tk_FrameObjCmd( int Tk_ToplevelObjCmd( - ClientData clientData, /* Either NULL or pointer to option table. */ + void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -390,7 +390,7 @@ Tk_ToplevelObjCmd( int Tk_LabelframeObjCmd( - ClientData clientData, /* Either NULL or pointer to option table. */ + void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -419,7 +419,7 @@ Tk_LabelframeObjCmd( int TkCreateFrame( - ClientData clientData, /* Either NULL or pointer to option table. */ + void *clientData, /* Either NULL or pointer to option table. */ Tcl_Interp *interp, /* Current interpreter. */ int argc, /* Number of arguments. */ const char *const *argv, /* Argument strings. */ @@ -431,7 +431,7 @@ TkCreateFrame( * application. */ { int result, i; - Tcl_Obj **objv = ckalloc((argc+1) * sizeof(Tcl_Obj **)); + Tcl_Obj **objv = (Tcl_Obj **)ckalloc((argc+1) * sizeof(Tcl_Obj **)); for (i=0; i= 3) - && (strncmp(arg, "-class", (unsigned) length) == 0)) { + && (strncmp(arg, "-class", length) == 0)) { className = Tcl_GetString(objv[i+1]); } else if ((arg[1] == 'c') && (length >= 3) - && (strncmp(arg, "-colormap", (unsigned) length) == 0)) { + && (strncmp(arg, "-colormap", length) == 0)) { colormapName = Tcl_GetString(objv[i+1]); } else if ((arg[1] == 's') && (type == TYPE_TOPLEVEL) - && (strncmp(arg, "-screen", (unsigned) length) == 0)) { + && (strncmp(arg, "-screen", length) == 0)) { screenName = Tcl_GetString(objv[i+1]); } else if ((arg[1] == 'u') && (type == TYPE_TOPLEVEL) - && (strncmp(arg, "-use", (unsigned) length) == 0)) { + && (strncmp(arg, "-use", length) == 0)) { useOption = Tcl_GetString(objv[i+1]); } else if ((arg[1] == 'v') - && (strncmp(arg, "-visual", (unsigned) length) == 0)) { + && (strncmp(arg, "-visual", length) == 0)) { visualName = Tcl_GetString(objv[i+1]); } } @@ -647,10 +648,10 @@ CreateFrame( */ if (type == TYPE_LABELFRAME) { - framePtr = ckalloc(sizeof(Labelframe)); + framePtr = (Frame *)ckalloc(sizeof(Labelframe)); memset(framePtr, 0, sizeof(Labelframe)); } else { - framePtr = ckalloc(sizeof(Frame)); + framePtr = (Frame *)ckalloc(sizeof(Frame)); memset(framePtr, 0, sizeof(Frame)); } framePtr->tkwin = newWin; @@ -730,7 +731,7 @@ CreateFrame( static int FrameWidgetObjCmd( - ClientData clientData, /* Information about frame widget. */ + void *clientData, /* Information about frame widget. */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ @@ -741,9 +742,10 @@ FrameWidgetObjCmd( enum options { FRAME_CGET, FRAME_CONFIGURE }; - Frame *framePtr = clientData; + Frame *framePtr = (Frame *)clientData; int result = TCL_OK, index; - int c, i, length; + int c, i; + int length; Tcl_Obj *objPtr; if (objc < 2) { @@ -794,17 +796,17 @@ FrameWidgetObjCmd( } c = arg[1]; if (((c == 'c') && (length >= 2) - && (strncmp(arg, "-class", (unsigned)length) == 0)) + && (strncmp(arg, "-class", length) == 0)) || ((c == 'c') && (length >= 3) - && (strncmp(arg, "-colormap", (unsigned)length) == 0)) + && (strncmp(arg, "-colormap", length) == 0)) || ((c == 'c') && (length >= 3) - && (strncmp(arg, "-container", (unsigned)length) == 0)) + && (strncmp(arg, "-container", length) == 0)) || ((c == 's') && (framePtr->type == TYPE_TOPLEVEL) - && (strncmp(arg, "-screen", (unsigned)length) == 0)) + && (strncmp(arg, "-screen", length) == 0)) || ((c == 'u') && (framePtr->type == TYPE_TOPLEVEL) - && (strncmp(arg, "-use", (unsigned)length) == 0)) + && (strncmp(arg, "-use", length) == 0)) || ((c == 'v') - && (strncmp(arg, "-visual", (unsigned)length) == 0))) { + && (strncmp(arg, "-visual", length) == 0))) { #ifdef _WIN32 if (c == 'u') { @@ -857,10 +859,10 @@ FrameWidgetObjCmd( static void DestroyFrame( - void *memPtr) /* Info about frame widget. */ + char *memPtr) /* Info about frame widget. */ { - Frame *framePtr = memPtr; - Labelframe *labelframePtr = memPtr; + Frame *framePtr = (Frame *)memPtr; + Labelframe *labelframePtr = (Labelframe *)memPtr; if (framePtr->type == TYPE_LABELFRAME) { Tk_FreeTextLayout(labelframePtr->textLayout); @@ -953,7 +955,7 @@ ConfigureFrame( if (framePtr->menuName == NULL) { oldMenuName = NULL; } else { - oldMenuName = ckalloc(strlen(framePtr->menuName) + 1); + oldMenuName = (char *)ckalloc(strlen(framePtr->menuName) + 1); strcpy(oldMenuName, framePtr->menuName); } @@ -1092,10 +1094,10 @@ ConfigureFrame( static void FrameWorldChanged( - ClientData instanceData) /* Information about widget. */ + void *instanceData) /* Information about widget. */ { - Frame *framePtr = instanceData; - Labelframe *labelframePtr = instanceData; + Frame *framePtr = (Frame *)instanceData; + Labelframe *labelframePtr = (Labelframe *)instanceData; Tk_Window tkwin = framePtr->tkwin; XGCValues gcValues; GC gc; @@ -1410,13 +1412,13 @@ ComputeFrameGeometry( static void DisplayFrame( - ClientData clientData) /* Information about widget. */ + void *clientData) /* Information about widget. */ { - Frame *framePtr = clientData; + Frame *framePtr = (Frame *)clientData; Tk_Window tkwin = framePtr->tkwin; int bdX1, bdY1, bdX2, bdY2, hlWidth; Pixmap pixmap; - TkRegion clipRegion = NULL; + Bool useClipping = False; framePtr->flags &= ~REDRAW_PENDING; if ((framePtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { @@ -1551,11 +1553,9 @@ DisplayFrame( if ((labelframePtr->labelBox.width < labelframePtr->labelReqWidth) || (labelframePtr->labelBox.height < labelframePtr->labelReqHeight)) { - clipRegion = TkCreateRegion(); - TkUnionRectWithRegion(&labelframePtr->labelBox, clipRegion, - clipRegion); - TkSetRegion(framePtr->display, labelframePtr->textGC, - clipRegion); + useClipping = True; + XSetClipRectangles(framePtr->display, labelframePtr->textGC, 0, 0, + &labelframePtr->labelBox, 1, Unsorted); } Tk_DrawTextLayout(framePtr->display, pixmap, @@ -1563,9 +1563,8 @@ DisplayFrame( labelframePtr->labelTextX + LABELSPACING, labelframePtr->labelTextY + LABELSPACING, 0, -1); - if (clipRegion != NULL) { + if (useClipping) { XSetClipMask(framePtr->display, labelframePtr->textGC, None); - TkDestroyRegion(clipRegion); } } else { /* @@ -1634,10 +1633,10 @@ DisplayFrame( static void FrameEventProc( - ClientData clientData, /* Information about window. */ + void *clientData, /* Information about window. */ XEvent *eventPtr) /* Information about event. */ { - Frame *framePtr = clientData; + Frame *framePtr = (Frame *)clientData; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { goto redraw; @@ -1679,7 +1678,7 @@ FrameEventProc( Tcl_CancelIdleCall(DisplayFrame, framePtr); } Tcl_CancelIdleCall(MapFrame, framePtr); - Tcl_EventuallyFree(framePtr, (Tcl_FreeProc *) DestroyFrame); + Tcl_EventuallyFree(framePtr, DestroyFrame); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { framePtr->flags |= GOT_FOCUS; @@ -1727,9 +1726,9 @@ FrameEventProc( static void FrameCmdDeletedProc( - ClientData clientData) /* Pointer to widget record for widget. */ + void *clientData) /* Pointer to widget record for widget. */ { - Frame *framePtr = clientData; + Frame *framePtr = (Frame *)clientData; Tk_Window tkwin = framePtr->tkwin; if (framePtr->menuName != NULL) { @@ -1778,9 +1777,9 @@ FrameCmdDeletedProc( static void MapFrame( - ClientData clientData) /* Pointer to frame structure. */ + void *clientData) /* Pointer to frame structure. */ { - Frame *framePtr = clientData; + Frame *framePtr = (Frame *)clientData; /* * Wait for all other background events to be processed before mapping @@ -1835,7 +1834,7 @@ TkInstallFrameMenu( TkWindow *winPtr = (TkWindow *) tkwin; if (winPtr->mainPtr != NULL) { - Frame *framePtr = winPtr->instanceData; + Frame *framePtr = (Frame *)winPtr->instanceData; if (framePtr == NULL) { Tcl_Panic("TkInstallFrameMenu couldn't get frame pointer"); @@ -1865,10 +1864,10 @@ TkInstallFrameMenu( static void FrameStructureProc( - ClientData clientData, /* Pointer to record describing frame. */ + void *clientData, /* Pointer to record describing frame. */ XEvent *eventPtr) /* Describes what just happened. */ { - Labelframe *labelframePtr = clientData; + Labelframe *labelframePtr = (Labelframe *)clientData; if (eventPtr->type == DestroyNotify) { /* @@ -1903,10 +1902,10 @@ FrameStructureProc( static void FrameRequestProc( - ClientData clientData, /* Pointer to record for frame. */ - Tk_Window tkwin) /* Window that changed its desired size. */ + void *clientData, /* Pointer to record for frame. */ + TCL_UNUSED(Tk_Window)) /* Window that changed its desired size. */ { - Frame *framePtr = clientData; + Frame *framePtr = (Frame *)clientData; FrameWorldChanged(framePtr); } @@ -1930,12 +1929,12 @@ FrameRequestProc( static void FrameLostContentProc( - ClientData clientData, /* Frame structure for content window that was + void *clientData, /* Frame structure for content window that was * stolen away. */ - Tk_Window tkwin) /* Tk's handle for the content window. */ + TCL_UNUSED(Tk_Window)) /* Tk's handle for the content window window. */ { - Frame *framePtr = clientData; - Labelframe *labelframePtr = clientData; + Frame *framePtr = (Frame *)clientData; + Labelframe *labelframePtr = (Labelframe *)clientData; /* * This should only happen in a labelframe but it doesn't hurt to be @@ -1958,7 +1957,7 @@ void TkMapTopFrame( Tk_Window tkwin) { - Frame *framePtr = ((TkWindow *) tkwin)->instanceData; + Frame *framePtr = (Frame *)((TkWindow *) tkwin)->instanceData; Tk_OptionTable optionTable; if (Tk_IsTopLevel(tkwin) && framePtr->type == TYPE_FRAME) { @@ -2022,7 +2021,7 @@ TkToplevelWindowForCommand( if (cmdInfo.objProc != FrameWidgetObjCmd) { return NULL; } - framePtr = cmdInfo.objClientData; + framePtr = (Frame *)cmdInfo.objClientData; if (framePtr->type != TYPE_TOPLEVEL) { return NULL; } diff --git a/generic/tkGrid.c b/generic/tkGrid.c index ac6b59bf4a..f1e06ba0cf 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -262,7 +262,7 @@ static int CheckSlotData(Gridder *containerPtr, int slot, int slotType, int checkOnly); static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); -static void DestroyGrid(void *memPtr); +static Tcl_FreeProc DestroyGrid; static Gridder * GetGrid(Tk_Window tkwin); static int GridAnchorCommand(Tk_Window tkwin, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); @@ -2807,7 +2807,7 @@ Unlink( static void DestroyGrid( - void *memPtr) /* Info about window that is now dead. */ + char *memPtr) /* Info about window that is now dead. */ { Gridder *gridPtr = (Gridder *)memPtr; @@ -2890,7 +2890,7 @@ GridStructureProc( Tcl_CancelIdleCall(ArrangeGrid, gridPtr); } gridPtr->tkwin = NULL; - Tcl_EventuallyFree(gridPtr, (Tcl_FreeProc *)DestroyGrid); + Tcl_EventuallyFree(gridPtr, DestroyGrid); } else if (eventPtr->type == MapNotify) { if ((gridPtr->contentPtr != NULL) && !(gridPtr->flags & REQUESTED_RELAYOUT)) { diff --git a/generic/tkImage.c b/generic/tkImage.c index d42ed7db7b..50c3c666fe 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -13,6 +13,10 @@ #include "tkInt.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Each call to Tk_GetImage returns a pointer to one of the following * structures, which is used as a token by clients (widgets) that display @@ -37,6 +41,8 @@ typedef struct Image { ClientData widgetClientData;/* Argument to pass to changeProc. */ struct Image *nextPtr; /* Next in list of all image instances * associated with the same name. */ + struct Image *prevPtr; /* Previous in list of all image instances + * associated with the same name. */ } Image; /* @@ -82,7 +88,7 @@ static Tcl_ThreadDataKey dataKey; */ static void ImageTypeThreadExitProc(ClientData clientData); -static void DeleteImage(ImageModel *modelPtr); +static Tcl_FreeProc DeleteImage; static void EventuallyDeleteImage(ImageModel *modelPtr, int forgetImageHashNow); @@ -285,7 +291,7 @@ Tk_ImageObjCmd( if ((objc == 3) || (*(arg = Tcl_GetString(objv[3])) == '-')) { do { dispPtr->imageId++; - sprintf(idString, "image%d", dispPtr->imageId); + snprintf(idString, sizeof(idString), "image%d", dispPtr->imageId); name = idString; } while (Tcl_FindCommand(interp, name, NULL, 0) != NULL); firstOption = 3; @@ -368,8 +374,17 @@ Tk_ImageObjCmd( args[objc] = NULL; } Tcl_Preserve(modelPtr); - if (typePtr->createProc(interp, name, objc, args, typePtr, - (Tk_ImageModel)modelPtr, &modelPtr->modelData) != TCL_OK){ + if (oldimage) { + typedef int (OldCreateProc)(Tcl_Interp*, char*, int, char**, + Tk_ImageType*, Tk_ImageModel, ClientData*); + i = ((OldCreateProc*)typePtr->createProc)(interp, + (char*)name, objc, (char**)args, typePtr, + (Tk_ImageModel)modelPtr, &modelPtr->modelData); + } else { + i = typePtr->createProc(interp, name, objc, args, typePtr, + (Tk_ImageModel)modelPtr, &modelPtr->modelData); + } + if (i != TCL_OK){ EventuallyDeleteImage(modelPtr, 0); Tcl_Release(modelPtr); if (oldimage) { @@ -402,7 +417,7 @@ Tk_ImageObjCmd( if (modelPtr->deleted) { goto alreadyDeleted; } - DeleteImage(modelPtr); + DeleteImage((char *)modelPtr); } break; case IMAGE_NAMES: @@ -631,6 +646,10 @@ Tk_GetImage( imagePtr->changeProc = changeProc; imagePtr->widgetClientData = clientData; imagePtr->nextPtr = modelPtr->instancePtr; + if (imagePtr->nextPtr) { + imagePtr->nextPtr->prevPtr = imagePtr; + } + imagePtr->prevPtr = NULL; modelPtr->instancePtr = imagePtr; return (Tk_Image) imagePtr; @@ -668,7 +687,6 @@ Tk_FreeImage( { Image *imagePtr = (Image *) image; ImageModel *modelPtr = imagePtr->modelPtr; - Image *prevPtr; /* * Clean up the particular instance. @@ -678,14 +696,16 @@ Tk_FreeImage( modelPtr->typePtr->freeProc(imagePtr->instanceData, imagePtr->display); } - prevPtr = modelPtr->instancePtr; - if (prevPtr == imagePtr) { - modelPtr->instancePtr = imagePtr->nextPtr; + if (imagePtr->prevPtr) { + imagePtr->prevPtr->nextPtr = imagePtr->nextPtr; + if (imagePtr->nextPtr) { + imagePtr->nextPtr->prevPtr = imagePtr->prevPtr; + } } else { - while (prevPtr->nextPtr != imagePtr) { - prevPtr = prevPtr->nextPtr; + modelPtr->instancePtr = imagePtr->nextPtr; + if (modelPtr->instancePtr) { + modelPtr->instancePtr->prevPtr = NULL; } - prevPtr->nextPtr = imagePtr->nextPtr; } ckfree(imagePtr); @@ -931,7 +951,7 @@ Tk_DeleteImage( if (hPtr == NULL) { return; } - DeleteImage((ImageModel *)Tcl_GetHashValue(hPtr)); + DeleteImage((char *)Tcl_GetHashValue(hPtr)); } /* @@ -954,10 +974,11 @@ Tk_DeleteImage( static void DeleteImage( - ImageModel *modelPtr) /* Pointer to main data structure for image. */ + char *blockPtr) /* Pointer to main data structure for image. */ { Image *imagePtr; Tk_ImageType *typePtr; + ImageModel *modelPtr = (ImageModel *)blockPtr; typePtr = modelPtr->typePtr; modelPtr->typePtr = NULL; @@ -1011,7 +1032,7 @@ EventuallyDeleteImage( } if (!modelPtr->deleted) { modelPtr->deleted = 1; - Tcl_EventuallyFree(modelPtr, (Tcl_FreeProc *) DeleteImage); + Tcl_EventuallyFree(modelPtr, DeleteImage); } } diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c index 86e274850c..83406d9db3 100644 --- a/generic/tkImgPNG.c +++ b/generic/tkImgPNG.c @@ -457,7 +457,7 @@ ReadBase64( 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, - 0x83, 0x83 + 0x83, 0x83, 0x83 }; /* diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index a53213ea61..fe76e36a06 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -16,6 +16,10 @@ #include "tkInt.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * The maximum amount of memory to allocate for data read from the file. If we * need more than this, we do it in pieces. @@ -305,7 +309,7 @@ FileWritePPM( return TCL_ERROR; } - sprintf(header, "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height); + snprintf(header, sizeof(header), "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height); Tcl_Write(chan, header, -1); pixLinePtr = blockPtr->pixelPtr + blockPtr->offset[0]; @@ -376,7 +380,7 @@ StringWritePPM( char header[16 + TCL_INTEGER_SPACE * 2]; Tcl_Obj *byteArrayObj; - sprintf(header, "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height); + snprintf(header, sizeof(header), "P6\n%d %d\n255\n", blockPtr->width, blockPtr->height); /* * Construct a byte array of the right size with the header and diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c index 37ee3d91aa..6c1631b738 100644 --- a/generic/tkImgPhInstance.c +++ b/generic/tkImgPhInstance.c @@ -21,6 +21,10 @@ #include "tkImgPhoto.h" #include "tkPort.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Declaration for internal Xlib function used here: */ @@ -218,6 +222,9 @@ TkImgPhotoGet( char buf[TCL_INTEGER_SPACE * 3]; XColor *white, *black; XGCValues gcValues; +#if (!defined(_WIN32) && !defined(MAC_OSX_TK)) + int gcmask; +#endif /* * Table of "best" choices for palette for PseudoColor displays with @@ -250,7 +257,11 @@ TkImgPhotoGet( for (instancePtr = modelPtr->instancePtr; instancePtr != NULL; instancePtr = instancePtr->nextPtr) { if ((colormap == instancePtr->colormap) - && (Tk_Display(tkwin) == instancePtr->display)) { + && (Tk_Display(tkwin) == instancePtr->display) +#if (!defined(_WIN32) && !defined(MAC_OSX_TK)) + && (Tk_Visual(tkwin) == instancePtr->visualInfo.visual) +#endif + ) { /* * Re-use this instance. */ @@ -307,6 +318,10 @@ TkImgPhotoGet( nGreen = nBlue = 0; mono = 1; instancePtr->visualInfo = *visInfoPtr; +#if (!defined(_WIN32) && !defined(MAC_OSX_TK)) + gcmask = 0; + instancePtr->visualInfo.visual = Tk_Visual(tkwin); +#endif switch (visInfoPtr->c_class) { case DirectColor: case TrueColor: @@ -314,6 +329,14 @@ TkImgPhotoGet( nGreen = 1 << CountBits(visInfoPtr->green_mask); nBlue = 1 << CountBits(visInfoPtr->blue_mask); mono = 0; +#if (!defined(_WIN32) && !defined(MAC_OSX_TK)) + if (visInfoPtr->depth > 24) { + gcValues.plane_mask = visInfoPtr->red_mask + | visInfoPtr->green_mask + | visInfoPtr->blue_mask; + gcmask = GCPlaneMask; + } +#endif break; case PseudoColor: case StaticColor: @@ -339,9 +362,9 @@ TkImgPhotoGet( XFree((char *) visInfoPtr); if (mono) { - sprintf(buf, "%d", nRed); + snprintf(buf, sizeof(buf), "%d", nRed); } else { - sprintf(buf, "%d/%d/%d", nRed, nGreen, nBlue); + snprintf(buf, sizeof(buf), "%d/%d/%d", nRed, nGreen, nBlue); } instancePtr->defaultPalette = Tk_GetUid(buf); @@ -358,8 +381,13 @@ TkImgPhotoGet( Tk_FreeColor(white); Tk_FreeColor(black); gcValues.graphics_exposures = False; +#if (!defined(_WIN32) && !defined(MAC_OSX_TK)) instancePtr->gc = Tk_GetGC(tkwin, - GCForeground|GCBackground|GCGraphicsExposures, &gcValues); + gcmask|GCForeground|GCBackground|GCGraphicsExposures, &gcValues); +#else + instancePtr->gc = Tk_GetGC(tkwin, + GCForeground|GCBackground|GCGraphicsExposures, &gcValues); +#endif /* * Set configuration options and finish the initialization of the @@ -681,7 +709,7 @@ TkImgPhotoDisplay( Tk_DeleteErrorHandler(handler); } else { /* - * modelPtr->region describes which parts of the image contain valid + * modelPtr->validRegion describes which parts of the image contain valid * data. We set this region as the clip mask for the gc, setting its * origin appropriately, and use it when drawing the image. */ diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 3d22c63372..cadbb2d8d2 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -151,8 +151,12 @@ static Tcl_ThreadDataKey dataKey; */ static const Tk_ConfigSpec configSpecs[] = { + {TK_CONFIG_STRING, "-data", NULL, NULL, + NULL, -1, TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_STRING, "-file", NULL, NULL, NULL, Tk_Offset(PhotoModel, fileString), TK_CONFIG_NULL_OK, NULL}, + {TK_CONFIG_STRING, "-format", NULL, NULL, + NULL, -1, TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_DOUBLE, "-gamma", NULL, NULL, DEF_PHOTO_GAMMA, Tk_Offset(PhotoModel, gamma), 0, NULL}, {TK_CONFIG_INT, "-height", NULL, NULL, @@ -783,11 +787,10 @@ ImgPhotoCmd( } } else { typedef int (*NewStringWriteProc)(Tcl_Interp *interp, - Tcl_Obj *formatString, Tk_PhotoImageBlock *blockPtr, - void *dummy); + Tcl_Obj *formatString, Tk_PhotoImageBlock *blockPtr); result = ((NewStringWriteProc)(void *)stringWriteProc)(interp, - options.format, &block, NULL); + options.format, &block); } if (options.background) { Tk_FreeColor(options.background); @@ -1190,9 +1193,6 @@ ImgPhotoCmd( switch ((enum transOptions) index) { case PHOTO_TRANS_GET: { - XRectangle testBox; - TkRegion testRegion; - if (objc != 5) { Tcl_WrongNumArgs(interp, 3, objv, "x y"); return TCL_ERROR; @@ -1211,19 +1211,9 @@ ImgPhotoCmd( return TCL_ERROR; } - testBox.x = x; - testBox.y = y; - testBox.width = 1; - testBox.height = 1; - /* What a way to do a test! */ - testRegion = TkCreateRegion(); - TkUnionRectWithRegion(&testBox, testRegion, testRegion); - TkIntersectRegion(testRegion, modelPtr->validRegion, testRegion); - TkClipBox(testRegion, &testBox); - TkDestroyRegion(testRegion); - - Tcl_SetObjResult(interp, Tcl_NewBooleanObj( - testBox.width==0 && testBox.height==0)); + pixelPtr = modelPtr->pix32 + (y * modelPtr->width + x) * 4; + + Tcl_SetObjResult(interp, Tcl_NewBooleanObj(pixelPtr[3] == 0)); return TCL_OK; } @@ -1806,37 +1796,31 @@ ImgPhotoConfigureModel( Tcl_Obj *oldData, *data = NULL, *oldFormat, *format = NULL; Tcl_Obj *tempdata, *tempformat; size_t length; - int i, j, result, imageWidth, imageHeight, oldformat; + int i, result, imageWidth, imageHeight, oldformat; double oldGamma; Tcl_Channel chan; Tk_PhotoImageFormat *imageFormat; - const char **args; - args = (const char **)ckalloc((objc + 1) * sizeof(char *)); - for (i = 0, j = 0; i < objc; i++,j++) { - args[j] = Tcl_GetString(objv[i]); + for (i = 0; i < objc; i++) { + const char *arg = Tcl_GetString(objv[i]); length = objv[i]->length; - if ((length > 1) && (args[j][0] == '-')) { - if ((args[j][1] == 'd') && - !strncmp(args[j], "-data", length)) { + if ((length > 1) && (arg[0] == '-')) { + if ((arg[1] == 'd') && + !strncmp(arg, "-data", length)) { if (++i < objc) { data = objv[i]; - j--; } else { - ckfree(args); Tcl_SetObjResult(interp, Tcl_NewStringObj( "value for \"-data\" missing", -1)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", "MISSING_VALUE", NULL); return TCL_ERROR; } - } else if ((args[j][1] == 'f') && - !strncmp(args[j], "-format", length)) { + } else if ((arg[1] == 'f') && + !strncmp(arg, "-format", length)) { if (++i < objc) { format = objv[i]; - j--; } else { - ckfree(args); Tcl_SetObjResult(interp, Tcl_NewStringObj( "value for \"-format\" missing", -1)); Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO", @@ -1875,11 +1859,9 @@ ImgPhotoConfigureModel( */ if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs, - j, args, (char *) modelPtr, flags) != TCL_OK) { - ckfree(args); + objc, (const char **)objv, (char *) modelPtr, flags|TK_CONFIG_OBJS) != TCL_OK) { goto errorExit; } - ckfree(args); /* * Regard the empty string for -file, -data or -format as the null value. diff --git a/generic/tkInt.decls b/generic/tkInt.decls index 7f68cf1067..8106b83b41 100644 --- a/generic/tkInt.decls +++ b/generic/tkInt.decls @@ -1335,12 +1335,10 @@ declare 80 win { Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) } -# This slot is reserved for use by the clipping rectangle patch: -# declare 81 win { -# XSetClipRectangles(Display *display, GC gc, int clip_x_origin, -# int clip_y_origin, XRectangle rectangles[], int n, int ordering) -# } - +declare 81 win { + int XSetClipRectangles(Display *display, GC gc, int clip_x_origin, + int clip_y_origin, XRectangle rectangles[], int n, int ordering) +} declare 82 win { Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr) diff --git a/generic/tkInt.h b/generic/tkInt.h index 7568585fad..0742563b97 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -693,6 +693,8 @@ typedef struct TkMainInfo { /* Saved Tcl [update] command, used to restore * Tcl's version of [update] after Tk is shut * down */ + unsigned int ttkNbTabsStickBit; + /* Information used by ttk::notebook. */ } TkMainInfo; /* @@ -1337,6 +1339,8 @@ MODULE_SCOPE Status TkParseColor (Display * display, MODULE_SCOPE void TkUnixSetXftClipRegion(TkRegion clipRegion); #endif +MODULE_SCOPE void TkpCopyRegion(TkRegion dst, TkRegion src); + #if !defined(__cplusplus) && !defined(c_plusplus) # define c_class class #endif diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h index e9b3a6548d..3e6bfb2665 100644 --- a/generic/tkIntPlatDecls.h +++ b/generic/tkIntPlatDecls.h @@ -795,6 +795,8 @@ extern const TkIntPlatStubs *tkIntPlatStubsPtr; #undef TkGenerateActivateEvents_ #define TkMacOSXGetContainer TkGetTransientMaster +#undef TkMacOSXIsCharacterMissing +#define TkMacOSXIsCharacterMissing(tkfont) ((void)tkfont, 0) #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/generic/tkIntXlibDecls.h b/generic/tkIntXlibDecls.h index 9d4200a86b..4c1d4ac72e 100644 --- a/generic/tkIntXlibDecls.h +++ b/generic/tkIntXlibDecls.h @@ -24,7 +24,7 @@ #endif /* Some (older) versions of X11/Xutil.h have a wrong signature of those - two functions, so move them out of the way temporarly. */ + two functions, so move them out of the way temporarily. */ #define XOffsetRegion _XOffsetRegion #define XUnionRegion _XUnionRegion #include "X11/Xutil.h" @@ -275,7 +275,10 @@ EXTERN int TkPutImage(unsigned long *colors, int ncolors, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); -/* Slot 81 is reserved */ +/* 81 */ +EXTERN int XSetClipRectangles(Display *display, GC gc, + int clip_x_origin, int clip_y_origin, + XRectangle rectangles[], int n, int ordering); /* 82 */ EXTERN Status XParseColor(Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); @@ -879,7 +882,7 @@ typedef struct TkIntXlibStubs { Bool (*xFilterEvent) (XEvent *x, Window w); /* 78 */ int (*xmbLookupString) (XIC xi, XKeyPressedEvent *xk, char *c, int i, KeySym *k, Status *s); /* 79 */ int (*tkPutImage) (unsigned long *colors, int ncolors, Display *display, Drawable d, GC gc, XImage *image, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); /* 80 */ - void (*reserved81)(void); + int (*xSetClipRectangles) (Display *display, GC gc, int clip_x_origin, int clip_y_origin, XRectangle rectangles[], int n, int ordering); /* 81 */ Status (*xParseColor) (Display *display, Colormap map, _Xconst char *spec, XColor *colorPtr); /* 82 */ GC (*xCreateGC) (Display *display, Drawable d, unsigned long valuemask, XGCValues *values); /* 83 */ int (*xFreeGC) (Display *display, GC gc); /* 84 */ @@ -1296,7 +1299,8 @@ extern const TkIntXlibStubs *tkIntXlibStubsPtr; (tkIntXlibStubsPtr->xmbLookupString) /* 79 */ #define TkPutImage \ (tkIntXlibStubsPtr->tkPutImage) /* 80 */ -/* Slot 81 is reserved */ +#define XSetClipRectangles \ + (tkIntXlibStubsPtr->xSetClipRectangles) /* 81 */ #define XParseColor \ (tkIntXlibStubsPtr->xParseColor) /* 82 */ #define XCreateGC \ diff --git a/generic/tkListbox.c b/generic/tkListbox.c index 7977d43a24..f97a9c81f2 100644 --- a/generic/tkListbox.c +++ b/generic/tkListbox.c @@ -317,26 +317,23 @@ static const Tk_OptionSpec optionSpecs[] = { */ static const Tk_OptionSpec itemAttrOptionSpecs[] = { - {TK_OPTION_BORDER, "-background", "background", "Background", + {TK_OPTION_BORDER, "-background", NULL, NULL, NULL, -1, Tk_Offset(ItemAttr, border), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - DEF_LISTBOX_BG_MONO, 0}, + TK_OPTION_NULL_OK, NULL, 0}, {TK_OPTION_SYNONYM, "-bg", NULL, NULL, NULL, 0, -1, 0, "-background", 0}, {TK_OPTION_SYNONYM, "-fg", "foreground", NULL, NULL, 0, -1, 0, "-foreground", 0}, - {TK_OPTION_COLOR, "-foreground", "foreground", "Foreground", + {TK_OPTION_COLOR, "-foreground", NULL, NULL, NULL, -1, Tk_Offset(ItemAttr, fgColor), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, - {TK_OPTION_BORDER, "-selectbackground", "selectBackground", "Foreground", + TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, -1, Tk_Offset(ItemAttr, selBorder), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - DEF_LISTBOX_SELECT_MONO, 0}, - {TK_OPTION_COLOR, "-selectforeground", "selectForeground", "Background", + TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, NULL, -1, Tk_Offset(ItemAttr, selFgColor), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, - DEF_LISTBOX_SELECT_FG_MONO, 0}, - {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, 0, 0} + TK_OPTION_NULL_OK, NULL, 0}, + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, -1, 0, NULL, 0} }; /* @@ -392,7 +389,7 @@ static int ConfigureListboxItem(Tcl_Interp *interp, Tcl_Obj *const objv[], int index); static int ListboxDeleteSubCmd(Listbox *listPtr, int first, int last); -static void DestroyListbox(void *memPtr); +static Tcl_FreeProc DestroyListbox; static void DestroyListboxOptionTables(ClientData clientData, Tcl_Interp *interp); static void DisplayListbox(ClientData clientData); @@ -1439,9 +1436,9 @@ ListboxGetItemAttributes( static void DestroyListbox( - void *memPtr) /* Info about listbox widget. */ + char *memPtr) /* Info about listbox widget. */ { - Listbox *listPtr = memPtr; + Listbox *listPtr = (Listbox *)memPtr; Tcl_HashEntry *entry; Tcl_HashSearch search; @@ -2622,7 +2619,7 @@ ListboxEventProc( if (listPtr->flags & REDRAW_PENDING) { Tcl_CancelIdleCall(DisplayListbox, clientData); } - Tcl_EventuallyFree(clientData, (Tcl_FreeProc *) DestroyListbox); + Tcl_EventuallyFree(clientData, DestroyListbox); } } else if (eventPtr->type == ConfigureNotify) { int vertSpace; diff --git a/generic/tkMenu.c b/generic/tkMenu.c index b4c64737f7..715c6d7146 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -38,7 +38,7 @@ * implemented using menu clones. Menu clones are full menus in their own * right; they have a Tk window and pathname associated with them; they have a * TkMenu structure and array of entries. However, they are linked with the - * original menu that they were cloned from. The reflect the attributes of the + * original menu that they were cloned from. They reflect the attributes of the * original, or "main", menu. So if an item is added to a menu, and that * menu has clones, then the item must be added to all of its clones also. * Menus are cloned when a menu is torn-off or when a menu is assigned as a @@ -333,7 +333,7 @@ static void DeleteMenuCloneEntries(TkMenu *menuPtr, static void DestroyMenuHashTable(ClientData clientData, Tcl_Interp *interp); static void DestroyMenuInstance(TkMenu *menuPtr); -static void DestroyMenuEntry(void *memPtr); +static Tcl_FreeProc DestroyMenuEntry; static int GetIndexFromCoords(Tcl_Interp *interp, TkMenu *menuPtr, const char *string, int *indexPtr); @@ -395,14 +395,15 @@ Tk_MenuObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { - Tk_Window tkwin = clientData; + Tk_Window tkwin = (Tk_Window)clientData; Tk_Window newWin; TkMenu *menuPtr; TkMenuReferences *menuRefPtr; - int i, index, toplevel; + int i; + int index, toplevel; const char *windowName; static const char *const typeStringList[] = {"-type", NULL}; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (objc < 2) { @@ -437,7 +438,7 @@ Tk_MenuObjCmd( * Tcl_EventuallyFree is called. */ - menuPtr = ckalloc(sizeof(TkMenu)); + menuPtr = (TkMenu *)ckalloc(sizeof(TkMenu)); memset(menuPtr, 0, sizeof(TkMenu)); menuPtr->tkwin = newWin; menuPtr->display = Tk_Display(newWin); @@ -608,11 +609,11 @@ MenuWidgetObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument strings. */ { - TkMenu *menuPtr = clientData; + TkMenu *menuPtr = (TkMenu *)clientData; TkMenuEntry *mePtr; int result = TCL_OK; int option; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (objc < 2) { @@ -861,7 +862,8 @@ MenuWidgetObjCmd( break; } case MENU_POST: { - int x, y, index = -1; + int x, y; + int index = -1; if (objc != 4 && objc != 5) { Tcl_WrongNumArgs(interp, 2, objv, "x y ?index?"); @@ -1093,7 +1095,7 @@ DestroyMenuInstance( Tcl_Obj *newObjv[2]; TkMenu *parentMainMenuPtr; TkMenuEntry *parentMainEntryPtr; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* @@ -1176,9 +1178,10 @@ DestroyMenuInstance( * for menu entries (i+1)...numEntries. */ - DestroyMenuEntry(menuPtr->entries[i]); + Tcl_EventuallyFree(menuPtr->entries[i], DestroyMenuEntry); menuPtr->numEntries = i; } + menuPtr->active = -1; if (menuPtr->entries != NULL) { ckfree(menuPtr->entries); menuPtr->entries = NULL; @@ -1199,11 +1202,10 @@ DestroyMenuInstance( * * TkDestroyMenu -- * - * This function is invoked by Tcl_EventuallyFree or Tcl_Release to clean - * up the internal structure of a menu at a safe time (when no-one is - * using it anymore). If called on a main instance, destroys all of the - * instances. If called on a non-main instance, just destroys - * that instance. + * This function is invoked to clean up the internal structure of a menu + * at a safe time (when no-one is using it anymore). If called on a main + * instance, destroys all of the instances. If called on a non-main + * instance, just destroys that instance. * * Results: * None. @@ -1375,9 +1377,9 @@ UnhookCascadeEntry( static void DestroyMenuEntry( - void *memPtr) /* Pointer to entry to be freed. */ + char *memPtr) /* Pointer to entry to be freed. */ { - TkMenuEntry *mePtr = memPtr; + TkMenuEntry *mePtr = (TkMenuEntry *)memPtr; TkMenu *menuPtr = mePtr->menuPtr; if (menuPtr->postedCascade == mePtr) { @@ -1477,7 +1479,7 @@ static void MenuWorldChanged( ClientData instanceData) /* Information about widget. */ { - TkMenu *menuPtr = instanceData; + TkMenu *menuPtr = (TkMenu *)instanceData; int i; TkMenuConfigureDrawOptions(menuPtr); @@ -1519,12 +1521,12 @@ ConfigureMenu( int i; TkMenu *menuListPtr, *cleanupPtr; int result; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL; menuListPtr = menuListPtr->nextInstancePtr) { - menuListPtr->errorStructPtr = ckalloc(sizeof(Tk_SavedOptions)); + menuListPtr->errorStructPtr = (Tk_SavedOptions *)ckalloc(sizeof(Tk_SavedOptions)); result = Tk_SetOptions(interp, (char *) menuListPtr, tsdPtr->menuOptionTable, objc, objv, menuListPtr->tkwin, menuListPtr->errorStructPtr, NULL); @@ -1616,14 +1618,13 @@ ConfigureMenu( } else if ((menuListPtr->numEntries > 0) && (menuListPtr->entries[0]->type == TEAROFF_ENTRY)) { - Tcl_EventuallyFree(menuListPtr->entries[0], (Tcl_FreeProc *) DestroyMenuEntry); + Tcl_EventuallyFree(menuListPtr->entries[0], DestroyMenuEntry); for (i = 0; i < menuListPtr->numEntries - 1; i++) { menuListPtr->entries[i] = menuListPtr->entries[i + 1]; menuListPtr->entries[i]->index = i; } - menuListPtr->numEntries--; - if (menuListPtr->numEntries == 0) { + if (--menuListPtr->numEntries == 0) { ckfree(menuListPtr->entries); menuListPtr->entries = NULL; } @@ -1728,7 +1729,7 @@ PostProcessEntry( name = Tcl_GetString(mePtr->namePtr); if (mePtr->childMenuRefPtr != NULL) { - oldHashKey = Tcl_GetHashKey(TkGetMenuHashTable(menuPtr->interp), + oldHashKey = (char *)Tcl_GetHashKey(TkGetMenuHashTable(menuPtr->interp), mePtr->childMenuRefPtr->hashEntryPtr); if (strcmp(oldHashKey, name) != 0) { UnhookCascadeEntry(mePtr); @@ -2112,24 +2113,25 @@ TkGetMenuIndex( if ((string[0] == 'a') && (strcmp(string, "active") == 0)) { *indexPtr = menuPtr->active; - goto success; + return TCL_OK; } if (((string[0] == 'l') && (strcmp(string, "last") == 0)) || ((string[0] == 'e') && (strcmp(string, "end") == 0))) { *indexPtr = menuPtr->numEntries - ((lastOK) ? 0 : 1); - goto success; + return TCL_OK; } - if ((string[0] == 'n') && (strcmp(string, "none") == 0)) { + if ((string[0] == '\0') || + ((string[0] == 'n') && (strcmp(string, "none") == 0))) { *indexPtr = -1; - goto success; + return TCL_OK; } if (string[0] == '@') { if (GetIndexFromCoords(interp, menuPtr, string, indexPtr) == TCL_OK) { - goto success; + return TCL_OK; } } @@ -2145,7 +2147,7 @@ TkGetMenuIndex( i = -1; } *indexPtr = i; - goto success; + return TCL_OK; } Tcl_ResetResult(interp); } @@ -2156,7 +2158,7 @@ TkGetMenuIndex( if ((label != NULL) && (Tcl_StringCaseMatch(label, string, 0))) { *indexPtr = i; - goto success; + return TCL_OK; } } @@ -2164,9 +2166,6 @@ TkGetMenuIndex( "bad menu entry index \"%s\"", string)); Tcl_SetErrorCode(interp, "TK", "MENU", "INDEX", NULL); return TCL_ERROR; - - success: - return TCL_OK; } /* @@ -2191,7 +2190,7 @@ static void MenuCmdDeletedProc( ClientData clientData) /* Pointer to widget record for widget. */ { - TkMenu *menuPtr = clientData; + TkMenu *menuPtr = (TkMenu *)clientData; Tk_Window tkwin = menuPtr->tkwin; /* @@ -2240,14 +2239,14 @@ MenuNewEntry( TkMenuEntry *mePtr; TkMenuEntry **newEntries; int i; - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); /* * Create a new array of entries with an empty slot for the new entry. */ - newEntries = ckalloc((menuPtr->numEntries+1) * sizeof(TkMenuEntry *)); + newEntries = (TkMenuEntry **)ckalloc((menuPtr->numEntries+1) * sizeof(TkMenuEntry *)); for (i = 0; i < index; i++) { newEntries[i] = menuPtr->entries[i]; } @@ -2260,7 +2259,7 @@ MenuNewEntry( } menuPtr->entries = newEntries; menuPtr->numEntries++; - mePtr = ckalloc(sizeof(TkMenuEntry)); + mePtr = (TkMenuEntry *)ckalloc(sizeof(TkMenuEntry)); menuPtr->entries[index] = mePtr; mePtr->type = type; mePtr->optionTable = tsdPtr->entryOptionTables[type]; @@ -2336,7 +2335,8 @@ MenuAddOrInsert( Tcl_Obj *const objv[]) /* Arguments to command: first arg is type of * entry, others are config options. */ { - int type, index; + int type; + int index; TkMenuEntry *mePtr; TkMenu *menuListPtr; @@ -2384,14 +2384,12 @@ MenuAddOrInsert( for (errorMenuPtr = menuPtr->masterMenuPtr; errorMenuPtr != NULL; errorMenuPtr = errorMenuPtr->nextInstancePtr) { - Tcl_EventuallyFree(errorMenuPtr->entries[index], - (Tcl_FreeProc *) DestroyMenuEntry); + Tcl_EventuallyFree(errorMenuPtr->entries[index], DestroyMenuEntry); for (i = index; i < errorMenuPtr->numEntries - 1; i++) { errorMenuPtr->entries[i] = errorMenuPtr->entries[i + 1]; errorMenuPtr->entries[i]->index = i; } - errorMenuPtr->numEntries--; - if (errorMenuPtr->numEntries == 0) { + if (--errorMenuPtr->numEntries == 0) { ckfree(errorMenuPtr->entries); errorMenuPtr->entries = NULL; } @@ -2476,7 +2474,7 @@ MenuVarProc( const char *name2, /* Second part of variable's name. */ int flags) /* Describes what just happened. */ { - TkMenuEntry *mePtr = clientData; + TkMenuEntry *mePtr = (TkMenuEntry *)clientData; TkMenu *menuPtr; const char *value; const char *name, *onValue; @@ -2682,7 +2680,8 @@ CloneMenu( * menubar, or a tearoff? */ { int returnResult; - int menuType, i; + int menuType; + int i; TkMenuReferences *menuRefPtr; Tcl_Obj *menuDupCommandArray[4]; @@ -2939,7 +2938,8 @@ GetIndexFromCoords( const char *string, /* The @string we are parsing. */ int *indexPtr) /* The index of the item that matches. */ { - int x, y, i; + int x, y; + int i; const char *p; char *end; int x2, borderwidth, max; @@ -2956,10 +2956,13 @@ GetIndexFromCoords( x = y; p = end + 1; y = strtol(p, &end, 0); - if (end == p) { + if ((end == p) || (*end != '\0')) { goto error; } } else { + if (*end != '\0') { + goto error; + } x = borderwidth; } @@ -3271,7 +3274,7 @@ TkSetWindowMenuBar( * menu. */ - topLevelListPtr = ckalloc(sizeof(TkMenuTopLevelList)); + topLevelListPtr = (TkMenuTopLevelList *)ckalloc(sizeof(TkMenuTopLevelList)); topLevelListPtr->tkwin = tkwin; topLevelListPtr->nextPtr = menuRefPtr->topLevelListPtr; menuRefPtr->topLevelListPtr = topLevelListPtr; @@ -3303,7 +3306,7 @@ DestroyMenuHashTable( ClientData clientData, /* The menu hash table we are destroying. */ Tcl_Interp *interp) /* The interpreter we are destroying. */ { - Tcl_DeleteHashTable(clientData); + Tcl_DeleteHashTable((Tcl_HashTable *)clientData); ckfree(clientData); } @@ -3329,11 +3332,11 @@ Tcl_HashTable * TkGetMenuHashTable( Tcl_Interp *interp) /* The interp we need the hash table in.*/ { - Tcl_HashTable *menuTablePtr = + Tcl_HashTable *menuTablePtr = (Tcl_HashTable *) Tcl_GetAssocData(interp, MENU_HASH_KEY, NULL); if (menuTablePtr == NULL) { - menuTablePtr = ckalloc(sizeof(Tcl_HashTable)); + menuTablePtr = (Tcl_HashTable *)ckalloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(menuTablePtr, TCL_STRING_KEYS); Tcl_SetAssocData(interp, MENU_HASH_KEY, DestroyMenuHashTable, menuTablePtr); @@ -3374,14 +3377,14 @@ TkCreateMenuReferences( hashEntryPtr = Tcl_CreateHashEntry(menuTablePtr, pathName, &newEntry); if (newEntry) { - menuRefPtr = ckalloc(sizeof(TkMenuReferences)); + menuRefPtr = (TkMenuReferences *)ckalloc(sizeof(TkMenuReferences)); menuRefPtr->menuPtr = NULL; menuRefPtr->topLevelListPtr = NULL; menuRefPtr->parentEntryPtr = NULL; menuRefPtr->hashEntryPtr = hashEntryPtr; Tcl_SetHashValue(hashEntryPtr, menuRefPtr); } else { - menuRefPtr = Tcl_GetHashValue(hashEntryPtr); + menuRefPtr = (TkMenuReferences *)Tcl_GetHashValue(hashEntryPtr); } return menuRefPtr; } @@ -3418,7 +3421,7 @@ TkFindMenuReferences( menuTablePtr = TkGetMenuHashTable(interp); hashEntryPtr = Tcl_FindHashEntry(menuTablePtr, pathName); if (hashEntryPtr != NULL) { - menuRefPtr = Tcl_GetHashValue(hashEntryPtr); + menuRefPtr = (TkMenuReferences *)Tcl_GetHashValue(hashEntryPtr); } return menuRefPtr; } @@ -3517,7 +3520,7 @@ DeleteMenuCloneEntries( for (menuListPtr = menuPtr->masterMenuPtr; menuListPtr != NULL; menuListPtr = menuListPtr->nextInstancePtr) { for (i = last; i >= first; i--) { - Tcl_EventuallyFree(menuListPtr->entries[i], (Tcl_FreeProc *) DestroyMenuEntry); + Tcl_EventuallyFree(menuListPtr->entries[i], DestroyMenuEntry); } for (i = last + 1; i < menuListPtr->numEntries; i++) { j = i - numDeleted; @@ -3583,7 +3586,7 @@ TkMenuCleanup( void TkMenuInit(void) { - ThreadSpecificData *tsdPtr = + ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!menusInitialized) { diff --git a/generic/tkMenubutton.h b/generic/tkMenubutton.h index 1dbacb31fd..a5a1d3ae17 100644 --- a/generic/tkMenubutton.h +++ b/generic/tkMenubutton.h @@ -165,7 +165,7 @@ typedef struct { * "right", and "flush". "flush" means that * the upper left corner of the menubutton is * where the menu pops up. "above" and "below" - * will attempt to pop the menu compleletly + * will attempt to pop the menu completely * above or below the menu respectively. * "left" and "right" will pop the menu left * or right, and the active item will be next diff --git a/generic/tkObj.c b/generic/tkObj.c index 0abf534106..4d3e04579c 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -49,7 +49,6 @@ typedef struct PixelRep { typedef struct { const Tcl_ObjType *doubleTypePtr; - const Tcl_ObjType *intTypePtr; } ThreadSpecificData; static Tcl_ThreadDataKey dataKey; @@ -153,7 +152,7 @@ GetTypeCache(void) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (tsdPtr->doubleTypePtr == NULL) { - /* Smart initialization of doubleTypePtr/intTypePtr without + /* Smart initialization of doubleTypePtr without * hash-table lookup or creating complete Tcl_Obj's */ Tcl_Obj obj; obj.length = 3; @@ -161,11 +160,6 @@ GetTypeCache(void) obj.typePtr = NULL; Tcl_GetDoubleFromObj(NULL, &obj, &obj.internalRep.doubleValue); tsdPtr->doubleTypePtr = obj.typePtr; - obj.bytes += 2; - obj.length = 1; - obj.typePtr = NULL; - Tcl_GetLongFromObj(NULL, &obj, &obj.internalRep.longValue); - tsdPtr->intTypePtr = obj.typePtr; } return tsdPtr; } @@ -207,29 +201,14 @@ GetPixelsFromObjEx( 1.0, 10.0, 25.4, 0.35278 /*25.4 / 72.0*/ }; - /* - * Special hacks where the type of the object is known to be something - * that is just numeric and cannot require distance conversion. This pokes - * holes in Tcl's abstractions, but they are just for optimization, not - * semantics. - */ - if (objPtr->typePtr != &pixelObjType) { - ThreadSpecificData *typeCache = GetTypeCache(); - if (objPtr->typePtr == typeCache->doubleTypePtr) { - (void) Tcl_GetDoubleFromObj(interp, objPtr, &d); + if (Tcl_GetDoubleFromObj(NULL, objPtr, &d) == TCL_OK) { if (dblPtr != NULL) { *dblPtr = d; } *intPtr = (int) (d<0 ? d-0.5 : d+0.5); return TCL_OK; - } else if (objPtr->typePtr == typeCache->intTypePtr) { - (void) Tcl_GetIntFromObj(interp, objPtr, intPtr); - if (dblPtr) { - *dblPtr = (double) (*intPtr); - } - return TCL_OK; } } @@ -452,42 +431,58 @@ SetPixelFromAny( Tcl_Interp *interp, /* Used for error reporting if not NULL. */ Tcl_Obj *objPtr) /* The object to convert. */ { + ThreadSpecificData *typeCache = GetTypeCache(); const Tcl_ObjType *typePtr; const char *string; char *rest; double d; int i, units; - string = Tcl_GetString(objPtr); + if (objPtr->typePtr != typeCache->doubleTypePtr + && Tcl_GetIntFromObj(NULL, objPtr, &units) == TCL_OK) { + d = (double) units; + units = -1; - d = strtod(string, &rest); - if (rest == string) { - goto error; - } - while ((*rest != '\0') && isspace(UCHAR(*rest))) { - rest++; - } + /* + * In the case of ints, we need to ensure that a valid string exists + * in order for int-but-not-string objects to be converted back to + * ints again from pixel obj types. + */ - switch (*rest) { - case '\0': + (void) Tcl_GetString(objPtr); + } else if (Tcl_GetDoubleFromObj(NULL, objPtr, &d) == TCL_OK) { units = -1; - break; - case 'm': - units = 0; - break; - case 'c': - units = 1; - break; - case 'i': - units = 2; - break; - case 'p': - units = 3; - break; - default: - goto error; - } + } else { + string = Tcl_GetString(objPtr); + + d = strtod(string, &rest); + if (rest == string) { + goto error; + } + while ((*rest != '\0') && isspace(UCHAR(*rest))) { + rest++; + } + switch (*rest) { + case '\0': + units = -1; + break; + case 'm': + units = 0; + break; + case 'c': + units = 1; + break; + case 'i': + units = 2; + break; + case 'p': + units = 3; + break; + default: + goto error; + } + } /* * Free the old internalRep before setting the new one. */ @@ -710,17 +705,14 @@ SetMMFromAny( { ThreadSpecificData *typeCache = GetTypeCache(); const Tcl_ObjType *typePtr; - const char *string; + char *string; char *rest; double d; int units; MMRep *mmPtr; - if (objPtr->typePtr == typeCache->doubleTypePtr) { - Tcl_GetDoubleFromObj(interp, objPtr, &d); - units = -1; - } else if (objPtr->typePtr == typeCache->intTypePtr) { - Tcl_GetIntFromObj(interp, objPtr, &units); + if (objPtr->typePtr != typeCache->doubleTypePtr + && Tcl_GetIntFromObj(NULL, objPtr, &units) == TCL_OK) { d = (double) units; units = -1; @@ -731,6 +723,8 @@ SetMMFromAny( */ (void) Tcl_GetString(objPtr); + } else if (Tcl_GetDoubleFromObj(NULL, objPtr, &d) == TCL_OK) { + units = -1; } else { /* * It wasn't a known int or double, so parse it. @@ -740,11 +734,6 @@ SetMMFromAny( d = strtod(string, &rest); if (rest == string) { - /* - * Must copy string before resetting the result in case a caller - * is trying to convert the interpreter's result to mms. - */ - error: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad screen distance \"%s\"", string)); diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 56dc91d31d..08c95f2124 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -14,6 +14,10 @@ #include "tkInt.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Forward declarations for functions defined later in this file: */ @@ -337,11 +341,14 @@ DoConfig( int nullValue; nullValue = 0; - if ((*value == 0) && (specPtr->specFlags & TK_CONFIG_NULL_OK)) { + if ((*value == 0) && (specPtr->specFlags & (TK_CONFIG_NULL_OK|32 /* TCL_NULL_OK */))) { nullValue = 1; } do { + if (specPtr->offset < 0) { + break; + } ptr = widgRec + specPtr->offset; switch (specPtr->type) { case TK_CONFIG_BOOLEAN: @@ -641,7 +648,7 @@ Tk_ConfigureInfo( || (specPtr->specFlags & hateFlags)) { continue; } - if (specPtr->argvName == NULL) { + if ((specPtr->argvName == NULL) || (specPtr->offset < 0)) { continue; } list = FormatConfigInfo(interp, tkwin, specPtr, widgRec); @@ -709,7 +716,7 @@ FormatConfigInfo( } result = Tcl_Merge(5, argv); if (freeProc != NULL) { - if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) { + if (freeProc == TCL_DYNAMIC) { ckfree((char *) argv[4]); } else { freeProc((char *) argv[4]); @@ -752,35 +759,39 @@ FormatConfigValue( * function to free the result, or NULL if * result is static. */ { - const char *ptr, *result; + void *ptr; + const char *result; *freeProcPtr = NULL; + if (specPtr->offset < 0) { + return NULL; + } ptr = widgRec + specPtr->offset; result = ""; switch (specPtr->type) { case TK_CONFIG_BOOLEAN: - if (*((int *) ptr) == 0) { + if (*((int *)ptr) == 0) { result = "0"; } else { result = "1"; } break; case TK_CONFIG_INT: - sprintf(buffer, "%d", *((int *) ptr)); + snprintf(buffer, 200, "%d", *((int *)ptr)); result = buffer; break; case TK_CONFIG_DOUBLE: - Tcl_PrintDouble(interp, *((double *) ptr), buffer); + Tcl_PrintDouble(interp, *((double *)ptr), buffer); result = buffer; break; case TK_CONFIG_STRING: - result = (*(char **) ptr); + result = (*(char **)ptr); if (result == NULL) { result = ""; } break; case TK_CONFIG_UID: { - Tk_Uid uid = *((Tk_Uid *) ptr); + Tk_Uid uid = *((Tk_Uid *)ptr); if (uid != NULL) { result = uid; @@ -788,7 +799,7 @@ FormatConfigValue( break; } case TK_CONFIG_COLOR: { - XColor *colorPtr = *((XColor **) ptr); + XColor *colorPtr = *((XColor **)ptr); if (colorPtr != NULL) { result = Tk_NameOfColor(colorPtr); @@ -796,7 +807,7 @@ FormatConfigValue( break; } case TK_CONFIG_FONT: { - Tk_Font tkfont = *((Tk_Font *) ptr); + Tk_Font tkfont = *((Tk_Font *)ptr); if (tkfont != NULL) { result = Tk_NameOfFont(tkfont); @@ -804,7 +815,7 @@ FormatConfigValue( break; } case TK_CONFIG_BITMAP: { - Pixmap pixmap = *((Pixmap *) ptr); + Pixmap pixmap = *((Pixmap *)ptr); if (pixmap != None) { result = Tk_NameOfBitmap(Tk_Display(tkwin), pixmap); @@ -812,7 +823,7 @@ FormatConfigValue( break; } case TK_CONFIG_BORDER: { - Tk_3DBorder border = *((Tk_3DBorder *) ptr); + Tk_3DBorder border = *((Tk_3DBorder *)ptr); if (border != NULL) { result = Tk_NameOf3DBorder(border); @@ -820,11 +831,11 @@ FormatConfigValue( break; } case TK_CONFIG_RELIEF: - result = Tk_NameOfRelief(*((int *) ptr)); + result = Tk_NameOfRelief(*((int *)ptr)); break; case TK_CONFIG_CURSOR: case TK_CONFIG_ACTIVE_CURSOR: { - Tk_Cursor cursor = *((Tk_Cursor *) ptr); + Tk_Cursor cursor = *((Tk_Cursor *)ptr); if (cursor != NULL) { result = Tk_NameOfCursor(Tk_Display(tkwin), cursor); @@ -832,27 +843,27 @@ FormatConfigValue( break; } case TK_CONFIG_JUSTIFY: - result = Tk_NameOfJustify(*((Tk_Justify *) ptr)); + result = Tk_NameOfJustify(*((Tk_Justify *)ptr)); break; case TK_CONFIG_ANCHOR: - result = Tk_NameOfAnchor(*((Tk_Anchor *) ptr)); + result = Tk_NameOfAnchor(*((Tk_Anchor *)ptr)); break; case TK_CONFIG_CAP_STYLE: - result = Tk_NameOfCapStyle(*((int *) ptr)); + result = Tk_NameOfCapStyle(*((int *)ptr)); break; case TK_CONFIG_JOIN_STYLE: - result = Tk_NameOfJoinStyle(*((int *) ptr)); + result = Tk_NameOfJoinStyle(*((int *)ptr)); break; case TK_CONFIG_PIXELS: - sprintf(buffer, "%d", *((int *) ptr)); + snprintf(buffer, 200, "%d", *((int *)ptr)); result = buffer; break; case TK_CONFIG_MM: - Tcl_PrintDouble(interp, *((double *) ptr), buffer); + Tcl_PrintDouble(interp, *((double *)ptr), buffer); result = buffer; break; case TK_CONFIG_WINDOW: { - tkwin = *((Tk_Window *) ptr); + tkwin = *((Tk_Window *)ptr); if (tkwin != NULL) { result = Tk_PathName(tkwin); } @@ -928,7 +939,7 @@ Tk_ConfigureValue( &freeProc); Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1)); if (freeProc != NULL) { - if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) { + if (freeProc == TCL_DYNAMIC) { ckfree((char *) result); } else { freeProc((char *) result); @@ -976,6 +987,9 @@ Tk_FreeOptions( if ((specPtr->specFlags & needFlags) != needFlags) { continue; } + if (specPtr->offset < 0) { + continue; + } ptr = widgRec + specPtr->offset; switch (specPtr->type) { case TK_CONFIG_STRING: diff --git a/generic/tkOldTest.c b/generic/tkOldTest.c index 8996f31cc3..1c0c575507 100644 --- a/generic/tkOldTest.c +++ b/generic/tkOldTest.c @@ -24,6 +24,10 @@ #endif #include "tkInt.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * The following data structure represents the model for a test image: */ @@ -267,7 +271,7 @@ ImageGet( char buffer[100]; XGCValues gcValues; - sprintf(buffer, "%s get", timPtr->imageName); + snprintf(buffer, sizeof(buffer), "%s get", timPtr->imageName); Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); @@ -312,7 +316,7 @@ ImageDisplay( TImageInstance *instPtr = clientData; char buffer[200 + TCL_INTEGER_SPACE * 6]; - sprintf(buffer, "%s display %d %d %d %d %d %d", + snprintf(buffer, sizeof(buffer), "%s display %d %d %d %d %d %d", instPtr->modelPtr->imageName, imageX, imageY, width, height, drawableX, drawableY); Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, @@ -357,7 +361,7 @@ ImageFree( TImageInstance *instPtr = clientData; char buffer[200]; - sprintf(buffer, "%s free", instPtr->modelPtr->imageName); + snprintf(buffer, sizeof(buffer), "%s free", instPtr->modelPtr->imageName); Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); Tk_FreeColor(instPtr->fg); @@ -391,7 +395,7 @@ ImageDelete( TImageModel *timPtr = clientData; char buffer[100]; - sprintf(buffer, "%s delete", timPtr->imageName); + snprintf(buffer, sizeof(buffer), "%s delete", timPtr->imageName); Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); diff --git a/generic/tkPack.c b/generic/tkPack.c index b3b7228dd5..1412a9d397 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -120,7 +120,7 @@ static const Tk_GeomMgr packerType = { static void ArrangePacking(ClientData clientData); static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); -static void DestroyPacker(void *memPtr); +static Tcl_FreeProc DestroyPacker; static Packer * GetPacker(Tk_Window tkwin); static int PackAfter(Tcl_Interp *interp, Packer *prevPtr, Packer *containerPtr, int objc,Tcl_Obj *const objv[]); @@ -1388,7 +1388,7 @@ Unlink( static void DestroyPacker( - void *memPtr) /* Info about packed window that is now + char *memPtr) /* Info about packed window that is now * dead. */ { Packer *packPtr = (Packer *)memPtr; @@ -1465,7 +1465,7 @@ PackStructureProc( Tcl_CancelIdleCall(ArrangePacking, packPtr); } packPtr->tkwin = NULL; - Tcl_EventuallyFree(packPtr, (Tcl_FreeProc *) DestroyPacker); + Tcl_EventuallyFree(packPtr, DestroyPacker); } else if (eventPtr->type == MapNotify) { /* * When a container gets mapped, must redo the geometry computation so diff --git a/generic/tkPointer.c b/generic/tkPointer.c index 7753c36280..122721541d 100644 --- a/generic/tkPointer.c +++ b/generic/tkPointer.c @@ -428,7 +428,7 @@ XGrabPointer( ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - display->request++; + LastKnownRequestProcessed(display)++; tsdPtr->grabWinPtr = (TkWindow *) Tk_IdToWindow(display, grab_window); tsdPtr->restrictWinPtr = NULL; TkpSetCapture(tsdPtr->grabWinPtr); @@ -463,7 +463,7 @@ XUngrabPointer( ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - display->request++; + LastKnownRequestProcessed(display)++; tsdPtr->grabWinPtr = NULL; tsdPtr->restrictWinPtr = NULL; TkpSetCapture(NULL); @@ -590,7 +590,7 @@ XDefineCursor( if (tsdPtr->cursorWinPtr == winPtr) { UpdateCursor(winPtr); } - display->request++; + LastKnownRequestProcessed(display)++; return Success; } diff --git a/generic/tkRectOval.c b/generic/tkRectOval.c index 87114c11aa..59d0a32e88 100644 --- a/generic/tkRectOval.c +++ b/generic/tkRectOval.c @@ -94,7 +94,7 @@ static const Tk_ConfigSpec configSpecs[] = { TK_CONFIG_NULL_OK, NULL}, {TK_CONFIG_BITMAP, "-disabledstipple", NULL, NULL, NULL, Tk_Offset(RectOvalItem, disabledFillStipple), TK_CONFIG_NULL_OK, NULL}, - {TK_CONFIG_PIXELS, "-disabledwidth", NULL, NULL, + {TK_CONFIG_CUSTOM, "-disabledwidth", NULL, NULL, "0.0", Tk_Offset(RectOvalItem, outline.disabledWidth), TK_CONFIG_DONT_SET_DEFAULT, &pixelOption}, {TK_CONFIG_COLOR, "-fill", NULL, NULL, diff --git a/generic/tkScale.c b/generic/tkScale.c index 79cfecb67d..2d6502db13 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -21,8 +21,8 @@ #include "tkInt.h" #include "tkScale.h" -#if defined(_WIN32) -#define snprintf _snprintf +#ifdef _WIN32 +#include "tkWinInt.h" #endif /* @@ -974,15 +974,15 @@ ComputeFormat( if (forTicks) { if (fDigits <= eDigits) { - sprintf(scalePtr->tickFormat, "%%.%df", afterDecimal); + snprintf(scalePtr->tickFormat, sizeof(scalePtr->tickFormat), "%%.%df", afterDecimal); } else { - sprintf(scalePtr->tickFormat, "%%.%de", numDigits - 1); + snprintf(scalePtr->tickFormat, sizeof(scalePtr->tickFormat), "%%.%de", numDigits - 1); } } else { if (fDigits <= eDigits) { - sprintf(scalePtr->valueFormat, "%%.%df", afterDecimal); + snprintf(scalePtr->valueFormat, sizeof(scalePtr->valueFormat), "%%.%df", afterDecimal); } else { - sprintf(scalePtr->valueFormat, "%%.%de", numDigits - 1); + snprintf(scalePtr->valueFormat, sizeof(scalePtr->valueFormat), "%%.%de", numDigits - 1); } } } diff --git a/generic/tkScale.h b/generic/tkScale.h index e68b786b6e..2ce2190789 100644 --- a/generic/tkScale.h +++ b/generic/tkScale.h @@ -73,9 +73,9 @@ typedef struct TkScale { * values. 0 means we get to choose the number * based on resolution and/or the range of the * scale. */ - char valueFormat[16]; /* Sprintf conversion specifier computed from + char valueFormat[16]; /* Snprintf conversion specifier computed from * digits and other information. */ - char tickFormat[16]; /* Sprintf conversion specifier computed from + char tickFormat[16]; /* Snprintf conversion specifier computed from * tick interval. */ double bigIncrement; /* Amount to use for large increments to scale * value. (0 means we pick a value). */ diff --git a/generic/tkSelect.c b/generic/tkSelect.c index ef636da385..1f0214e57f 100644 --- a/generic/tkSelect.c +++ b/generic/tkSelect.c @@ -14,6 +14,10 @@ #include "tkInt.h" #include "tkSelect.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * When a selection handler is set up by invoking "selection handle", one of * the following data structures is set up to hold information about the @@ -1476,7 +1480,7 @@ TkSelDefaultSelection( if (maxBytes < 20) { return -1; } - sprintf(buffer, "0x%x", (unsigned int) infoPtr->time); + snprintf(buffer, maxBytes, "0x%x", (unsigned int) infoPtr->time); *typePtr = XA_INTEGER; return strlen(buffer); } diff --git a/generic/tkSquare.c b/generic/tkSquare.c index 61f86c5cc1..9b70ba3ee6 100644 --- a/generic/tkSquare.c +++ b/generic/tkSquare.c @@ -98,7 +98,6 @@ static const Tk_OptionSpec optionSpecs[] = { static void SquareDeletedProc(ClientData clientData); static int SquareConfigure(Tcl_Interp *interp, Square *squarePtr); -static void SquareDestroy(void *memPtr); static void SquareDisplay(ClientData clientData); static void KeepInWindow(Square *squarePtr); static void SquareObjEventProc(ClientData clientData, @@ -410,7 +409,7 @@ SquareObjEventProc( if (squarePtr->updatePending) { Tcl_CancelIdleCall(SquareDisplay, squarePtr); } - Tcl_EventuallyFree(squarePtr, (Tcl_FreeProc *) SquareDestroy); + Tcl_EventuallyFree(squarePtr, TCL_DYNAMIC); } } @@ -534,33 +533,6 @@ SquareDisplay( } } -/* - *---------------------------------------------------------------------- - * - * SquareDestroy -- - * - * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release to - * clean up the internal structure of a square at a safe time (when - * no-one is using it anymore). - * - * Results: - * None. - * - * Side effects: - * Everything associated with the square is freed up. - * - *---------------------------------------------------------------------- - */ - -static void -SquareDestroy( - void *memPtr) /* Info about square widget. */ -{ - Square *squarePtr = memPtr; - - ckfree(squarePtr); -} - /* *---------------------------------------------------------------------- * diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c index 8d3588a405..8b12e052c2 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -151,7 +151,7 @@ TkpPrintWindowId( * the hex representation of a pointer. */ Window window) /* Window to be printed into buffer. */ { - sprintf(buf, "0x%" TCL_Z_MODIFIER "x", (size_t)window); + snprintf(buf, TCL_INTEGER_SPACE, "0x%" TCL_Z_MODIFIER "x", (size_t)window); } int @@ -770,7 +770,7 @@ static const TkIntXlibStubs tkIntXlibStubs = { XFilterEvent, /* 78 */ XmbLookupString, /* 79 */ TkPutImage, /* 80 */ - 0, /* 81 */ + XSetClipRectangles, /* 81 */ XParseColor, /* 82 */ XCreateGC, /* 83 */ XFreeGC, /* 84 */ diff --git a/generic/tkTest.c b/generic/tkTest.c index b652068edf..96793df9a8 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -1505,7 +1505,7 @@ ImageGet( char buffer[100]; XGCValues gcValues; - sprintf(buffer, "%s get", timPtr->imageName); + snprintf(buffer, sizeof(buffer), "%s get", timPtr->imageName); Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); @@ -1574,7 +1574,7 @@ ImageDisplay( * Log the message. */ - sprintf(instPtr->buffer, "%s display %d %d %d %d", + snprintf(instPtr->buffer, sizeof(instPtr->buffer), "%s display %d %d %d %d", instPtr->modelPtr->imageName, imageX, imageY, width, height); } Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, @@ -1589,7 +1589,7 @@ ImageDisplay( */ if (instPtr->displayFailed == False) { - sprintf(instPtr->buffer, "%s display %d %d %d %d", + snprintf(instPtr->buffer, sizeof(instPtr->buffer), "%s display %d %d %d %d", instPtr->modelPtr->imageName, imageX, imageY, width, height); } instPtr->displayFailed = True; @@ -1635,7 +1635,7 @@ ImageFree( TImageInstance *instPtr = (TImageInstance *)clientData; char buffer[200]; - sprintf(buffer, "%s free", instPtr->modelPtr->imageName); + snprintf(buffer, sizeof(buffer), "%s free", instPtr->modelPtr->imageName); Tcl_SetVar2(instPtr->modelPtr->interp, instPtr->modelPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); Tk_FreeColor(instPtr->fg); @@ -1669,7 +1669,7 @@ ImageDelete( TImageModel *timPtr = (TImageModel *)clientData; char buffer[100]; - sprintf(buffer, "%s delete", timPtr->imageName); + snprintf(buffer, sizeof(buffer), "%s delete", timPtr->imageName); Tcl_SetVar2(timPtr->interp, timPtr->varName, NULL, buffer, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); @@ -1828,7 +1828,7 @@ TestmetricsObjCmd( "\": must be cxhscroll or cyvscroll", NULL); return TCL_ERROR; } - sprintf(buf, "%d", val); + snprintf(buf, sizeof(buf), "%d", val); Tcl_AppendResult(interp, buf, NULL); return TCL_OK; } @@ -1899,7 +1899,7 @@ TestpropObjCmd( value = 0xff & *p; p += 1; } - sprintf(buffer, "0x%lx", value); + snprintf(buffer, sizeof(buffer), "0x%lx", value); Tcl_AppendElement(interp, buffer); } } diff --git a/generic/tkText.c b/generic/tkText.c index ea6c5fce7d..e56e83cd37 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -542,6 +542,7 @@ CreateWidget( sharedPtr->autoSeparators = 1; sharedPtr->lastEditMode = TK_TEXT_EDIT_OTHER; sharedPtr->stateEpoch = 0; + sharedPtr->imageCount = 0; } /* @@ -6836,7 +6837,7 @@ TkpTesttextCmd( size_t len; int lineIndex, byteIndex, byteOffset; TkTextIndex index; - char buf[64]; + char buf[TK_POS_CHARS]; Tcl_CmdInfo info; if (objc < 3) { diff --git a/generic/tkText.h b/generic/tkText.h index d3c1cc902f..9aa3282bc8 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -567,6 +567,7 @@ typedef struct TkSharedText { * start/end limits change, and means that any * cached TkTextIndex objects are no longer * valid. */ + int imageCount; /* Used for creating unique image names. */ /* * Information related to the undo/redo functionality. diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 533f1bf5a5..88924e44ca 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -614,7 +614,7 @@ static void AdjustStartEndRefs( BTree *treePtr, /* The entire B-tree. */ TkText *textPtr, /* The text widget for which we want to adjust - * it's start and end cache. */ + * its start and end cache. */ int action) /* Action to perform. */ { if (action & TEXT_REMOVE_REFS) { @@ -632,10 +632,18 @@ AdjustStartEndRefs( i++; } treePtr->startEndCount = count; - treePtr->startEnd = (TkTextLine **)ckrealloc(treePtr->startEnd, - sizeof(TkTextLine *) * count); - treePtr->startEndRef = (TkText **)ckrealloc(treePtr->startEndRef, - sizeof(TkText *) * count); + if (count > 0) { + treePtr->startEnd = (TkTextLine**)ckrealloc(treePtr->startEnd, + sizeof(TkTextLine*) * count); + treePtr->startEndRef = (TkText**)ckrealloc(treePtr->startEndRef, + sizeof(TkText*) * count); + } + else { + ckfree(treePtr->startEndRef); + treePtr->startEndRef = NULL; + ckfree(treePtr->startEnd); + treePtr->startEnd = NULL; + } } if ((action & TEXT_ADD_REFS) && (textPtr->start != NULL || textPtr->end != NULL)) { diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index cf1cb1bb84..b34a2555d8 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -291,7 +291,7 @@ typedef struct DLine { * TOP_LINE - Non-zero means that this was the top line in * in the window the last time that the window * was laid out. This is important because a line - * may be displayed differently if its at the top + * may be displayed differently if it's at the top * or bottom than if it's in the middle * (e.g. beveled edges aren't displayed for * middle lines if the adjacent line has a @@ -3064,7 +3064,7 @@ AsyncUpdateLineMetrics( if (tkTextDebug) { char buffer[2 * TCL_INTEGER_SPACE + 1]; - sprintf(buffer, "%d %d", lineNum, dInfoPtr->lastMetricUpdateLine); + snprintf(buffer, sizeof(buffer), "%d %d", lineNum, dInfoPtr->lastMetricUpdateLine); LOG("tk_textInvalidateLine", buffer); } @@ -3271,7 +3271,7 @@ TkTextUpdateLineMetrics( if (tkTextDebug) { char buffer[4 * TCL_INTEGER_SPACE + 3]; - sprintf(buffer, "%d %d %d %d", + snprintf(buffer, sizeof(buffer), "%d %d %d %d", lineNum, endLine, totalLines, count); LOG("tk_textInvalidateLine", buffer); } @@ -4141,7 +4141,7 @@ TkTextUpdateOneLine( Tcl_Panic("Mustn't ever update line height of last artificial line"); } - sprintf(buffer, "%d %d", TkBTreeLinesTo(textPtr,linePtr), pixelHeight); + snprintf(buffer, sizeof(buffer), "%d %d", TkBTreeLinesTo(textPtr,linePtr), pixelHeight); LOG("tk_textNumPixels", buffer); } if (textPtr->dInfoPtr->scrollbarTimer == NULL) { diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index 776eb04a76..b6b411c0b8 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -13,6 +13,10 @@ #include "tkPort.h" #include "tkText.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Macro that determines the size of an embedded image segment: */ @@ -329,12 +333,8 @@ EmbImageConfigure( Tk_Image image; Tcl_DString newName; Tcl_HashEntry *hPtr; - Tcl_HashSearch search; char *name; - int dummy; - int count = 0; /* The counter for picking a unique name */ - int conflict = 0; /* True if we have a name conflict */ - size_t len; /* length of image name */ + int dummy, length; if (Tk_SetOptions(textPtr->interp, (char *)&eiPtr->body.ei, eiPtr->body.ei.optionTable, @@ -385,41 +385,24 @@ EmbImageConfigure( NULL); return TCL_ERROR; } - len = strlen(name); - for (hPtr = Tcl_FirstHashEntry(&textPtr->sharedTextPtr->imageTable, - &search); hPtr != NULL; hPtr = Tcl_NextHashEntry(&search)) { - char *haveName = (char *) - Tcl_GetHashKey(&textPtr->sharedTextPtr->imageTable, hPtr); - - if (strncmp(name, haveName, len) == 0) { - int newVal = 0; - - sscanf(haveName+len, "#%d", &newVal); - if (newVal > count) { - count = newVal; - } - if (len == strlen(haveName)) { - conflict = 1; - } - } - } Tcl_DStringInit(&newName); - Tcl_DStringAppend(&newName, name, -1); - - if (conflict) { - char buf[4 + TCL_INTEGER_SPACE]; - - sprintf(buf, "#%d", count+1); + while (Tcl_FindHashEntry(&textPtr->sharedTextPtr->imageTable, name)) { + char buf[4 + TCL_INTEGER_SPACE]; + snprintf(buf, sizeof(buf), "#%d", ++textPtr->sharedTextPtr->imageCount); + Tcl_DStringSetLength(&newName, 0); + Tcl_DStringAppend(&newName, name, -1); Tcl_DStringAppend(&newName, buf, -1); + name = Tcl_DStringValue(&newName); } - name = Tcl_DStringValue(&newName); + length = strlen(name); + hPtr = Tcl_CreateHashEntry(&textPtr->sharedTextPtr->imageTable, name, &dummy); Tcl_SetHashValue(hPtr, eiPtr); + eiPtr->body.ei.name = (char *)ckalloc(length + 1); + memcpy(eiPtr->body.ei.name, name, length + 1); Tcl_SetObjResult(textPtr->interp, Tcl_NewStringObj(name, -1)); - eiPtr->body.ei.name = (char *)ckalloc(Tcl_DStringLength(&newName) + 1); - strcpy(eiPtr->body.ei.name, name); Tcl_DStringFree(&newName); return TCL_OK; diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index e6632d0b52..272f234bce 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -15,6 +15,10 @@ #include "tkText.h" #include "default.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Index to use to select last character in line (very large integer): */ @@ -1128,7 +1132,7 @@ TkTextPrintIndex( charIndex += numBytes; } - return sprintf(string, "%d.%d", + return snprintf(string, TK_POS_CHARS, "%d.%d", TkBTreeLinesTo(textPtr, indexPtr->linePtr) + 1, charIndex); } @@ -2434,6 +2438,9 @@ StartEnd( firstChar = 0; } if (offset == 0) { + if (indexPtr->byteIndex == 0) { + goto done; + } if (modifier == TKINDEX_DISPLAY) { TkTextIndexBackChars(textPtr, indexPtr, 1, indexPtr, COUNT_DISPLAY_INDICES); @@ -2446,9 +2453,6 @@ StartEnd( } offset -= chSize; if (offset < 0) { - if (indexPtr->byteIndex == 0) { - goto done; - } segPtr = TkTextIndexToSeg(indexPtr, &offset); } } diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index f77e6b40de..15eb03586f 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -411,10 +411,10 @@ TkTextMarkSegToIndex( * * Results: * The return value is TCL_OK if "name" exists as a mark in the text - * widget and is located within its -starline/-endline range. In this + * widget and is located within its -startline/-endline range. In this * case *indexPtr is filled in with the next segment who is after the * mark whose size is non-zero. TCL_ERROR is returned if the mark - * doesn't exist in the text widget, or if it is out of its -starline/ + * doesn't exist in the text widget, or if it is out of its -startline/ * -endline range. In this latter case *indexPtr still contains valid * information, in particular TkTextMarkNameToIndex called with the * "insert" or "current" mark name may return TCL_ERROR, but *indexPtr diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 16e96fc939..400b2d12a2 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -38,6 +38,202 @@ static const char *const tabStyleStrings[] = { "tabular", "wordprocessor", "", NULL }; +/* This struct can be used for booleans, relief and pixels */ +typedef struct { + char *string; + int value; +} IntStruct; + +typedef struct { + char *string; + Tk_Justify value; +} JustifyStruct; + +static int +ObjectIsEmpty( + Tcl_Obj *objPtr) /* Object to test. May be NULL. */ +{ + if (objPtr == NULL) { + return 1; + } + if (objPtr->bytes == NULL) { + Tcl_GetString(objPtr); + } + return (objPtr->length == 0); +} + +#define OPTION_NONNEG (1 << 10) + +static int +SetPixels(void *clientData, + Tcl_Interp *interp, + Tk_Window tkwin, + Tcl_Obj **value, + char *recordPtr, + int internalOffset, + char *oldInternalPtr, + int flags) +{ + IntStruct pixel = {NULL, INT_MIN}; + IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset); + + if (!(flags & TK_OPTION_NULL_OK) || !ObjectIsEmpty(*value)) { + if (Tk_GetPixelsFromObj(interp, tkwin, *value, &pixel.value) != TCL_OK) { + return TCL_ERROR; + } + if ((flags & OPTION_NONNEG) && pixel.value < 0) { + pixel.value = 0; + } + pixel.string = ckalloc((*value)->length + 1); + strcpy(pixel.string, (*value)->bytes); + } + + *((char **)oldInternalPtr) = NULL; + *internalPtr = pixel; + return TCL_OK; +}; + +static int +SetBoolean(void *clientData, + Tcl_Interp *interp, + Tk_Window tkwin, + Tcl_Obj **value, + char *recordPtr, + int internalOffset, + char *oldInternalPtr, + int flags) +{ + IntStruct booleanVal = {NULL, -1}; + IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset); + + if (!(flags & TK_OPTION_NULL_OK) || !ObjectIsEmpty(*value)) { + if (Tcl_GetBooleanFromObj(interp, *value, &booleanVal.value) != TCL_OK) { + return TCL_ERROR; + } + booleanVal.string = ckalloc((*value)->length + 1); + strcpy(booleanVal.string, (*value)->bytes); + } + + *((char **)oldInternalPtr) = NULL; + *internalPtr = booleanVal; + return TCL_OK; +}; + +static int +SetRelief(void *clientData, + Tcl_Interp *interp, + Tk_Window tkwin, + Tcl_Obj **value, + char *recordPtr, + int internalOffset, + char *oldInternalPtr, + int flags) +{ + IntStruct relief = {NULL, TK_RELIEF_NULL}; + IntStruct *internalPtr = (IntStruct *)(recordPtr + internalOffset); + + if (!(flags & TK_OPTION_NULL_OK) || !ObjectIsEmpty(*value)) { + if (Tk_GetReliefFromObj(interp, *value, &relief.value) != TCL_OK) { + return TCL_ERROR; + } + relief.string = ckalloc((*value)->length + 1); + strcpy(relief.string, (*value)->bytes); + } + + *((char **)oldInternalPtr) = NULL; + *internalPtr = relief; + return TCL_OK; +}; + +static int +SetJustify(void *clientData, + Tcl_Interp *interp, + Tk_Window tkwin, + Tcl_Obj **value, + char *recordPtr, + int internalOffset, + char *oldInternalPtr, + int flags) +{ + JustifyStruct justify = {NULL, (Tk_Justify)-1}; + JustifyStruct *internalPtr = (JustifyStruct *)(recordPtr + internalOffset); + + if (!(flags & TK_OPTION_NULL_OK) || !ObjectIsEmpty(*value)) { + if (Tk_GetJustifyFromObj(interp, *value, &justify.value) != TCL_OK) { + return TCL_ERROR; + } + justify.string = ckalloc((*value)->length + 1); + strcpy(justify.string, (*value)->bytes); + } + + *((char **)oldInternalPtr) = NULL; + *internalPtr = justify; + return TCL_OK; +}; + +static Tcl_Obj *GetStruct( + void *clientData, + Tk_Window tkwin, + char *recordPtr, + int internalOffset) +{ + char **structPtr = (char **)(recordPtr + internalOffset); + + if (*structPtr == NULL || **structPtr == '\0') { + return Tcl_NewObj(); + } + return Tcl_NewStringObj(*structPtr, -1); +}; + + +static void +FreeStruct(void *clientData, + Tk_Window tkwin, + char *internalPtr) +{ + char **structPtr = (char **)internalPtr; + if (*structPtr) { + ckfree(*structPtr); + *structPtr = NULL; + } +}; + +static const Tk_ObjCustomOption pixelsOption = { + "pixels", /* name */ + SetPixels, /* setProc */ + GetStruct, /* getProc */ + NULL, /* restoreProc */ + FreeStruct, /* freeProc */ + 0 +}; + +static const Tk_ObjCustomOption booleanOption = { + "boolean", /* name */ + SetBoolean, /* setProc */ + GetStruct, /* getProc */ + NULL, /* restoreProc */ + FreeStruct, /* freeProc */ + 0 +}; + +static const Tk_ObjCustomOption justifyOption = { + "justify", /* name */ + SetJustify, /* setProc */ + GetStruct, /* getProc */ + NULL, /* restoreProc */ + FreeStruct, /* freeProc */ + 0 +}; + +static const Tk_ObjCustomOption reliefOption = { + "relief", /* name */ + SetRelief, /* setProc */ + GetStruct, /* getProc */ + NULL, /* restoreProc */ + FreeStruct, /* freeProc */ + 0 +}; + static const Tk_OptionSpec tagOptionSpecs[] = { {TK_OPTION_BORDER, "-background", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, border), TK_OPTION_NULL_OK, 0, 0}, @@ -45,56 +241,56 @@ static const Tk_OptionSpec tagOptionSpecs[] = { NULL, -1, Tk_Offset(TkTextTag, bgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_PIXELS, "-borderwidth", NULL, NULL, NULL, Tk_Offset(TkTextTag, borderWidthPtr), Tk_Offset(TkTextTag, borderWidth), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, - {TK_OPTION_STRING, "-elide", NULL, NULL, + TK_OPTION_NULL_OK, 0, 0}, + {TK_OPTION_CUSTOM, "-elide", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, elideString), - TK_OPTION_NULL_OK|TK_OPTION_DONT_SET_DEFAULT, 0, 0}, + TK_OPTION_NULL_OK, &booleanOption, 0}, {TK_OPTION_BITMAP, "-fgstipple", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, fgStipple), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_FONT, "-font", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, tkfont), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-foreground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, fgColor), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_STRING, "-justify", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, justifyString), TK_OPTION_NULL_OK, 0,0}, - {TK_OPTION_STRING, "-lmargin1", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, lMargin1String), TK_OPTION_NULL_OK,0,0}, - {TK_OPTION_STRING, "-lmargin2", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, lMargin2String), TK_OPTION_NULL_OK,0,0}, + {TK_OPTION_CUSTOM, "-justify", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, justifyString), TK_OPTION_NULL_OK, &justifyOption, 0}, + {TK_OPTION_CUSTOM, "-lmargin1", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, lMargin1String), TK_OPTION_NULL_OK, &pixelsOption, 0}, + {TK_OPTION_CUSTOM, "-lmargin2", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, lMargin2String), TK_OPTION_NULL_OK, &pixelsOption, 0}, {TK_OPTION_BORDER, "-lmargincolor", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, lMarginColor), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_STRING, "-offset", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, offsetString), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_STRING, "-overstrike", NULL, NULL, + {TK_OPTION_CUSTOM, "-offset", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, offsetString), TK_OPTION_NULL_OK, &pixelsOption, 0}, + {TK_OPTION_CUSTOM, "-overstrike", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, overstrikeString), - TK_OPTION_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK, &booleanOption, 0}, {TK_OPTION_COLOR, "-overstrikefg", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, overstrikeColor), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_STRING, "-relief", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, reliefString), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_STRING, "-rmargin", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, rMarginString), TK_OPTION_NULL_OK, 0,0}, + {TK_OPTION_CUSTOM, "-relief", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, reliefString), TK_OPTION_NULL_OK, &reliefOption, 0}, + {TK_OPTION_CUSTOM, "-rmargin", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, rMarginString), TK_OPTION_NULL_OK, &pixelsOption, 0}, {TK_OPTION_BORDER, "-rmargincolor", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, rMarginColor), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_BORDER, "-selectbackground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selBorder), TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_COLOR, "-selectforeground", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, selFgColor), TK_OPTION_NULL_OK, 0, 0}, - {TK_OPTION_STRING, "-spacing1", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, spacing1String), TK_OPTION_NULL_OK,0,0}, - {TK_OPTION_STRING, "-spacing2", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, spacing2String), TK_OPTION_NULL_OK,0,0}, - {TK_OPTION_STRING, "-spacing3", NULL, NULL, - NULL, -1, Tk_Offset(TkTextTag, spacing3String), TK_OPTION_NULL_OK,0,0}, + {TK_OPTION_CUSTOM, "-spacing1", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, spacing1String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption, 0}, + {TK_OPTION_CUSTOM, "-spacing2", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, spacing2String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption, 0}, + {TK_OPTION_CUSTOM, "-spacing3", NULL, NULL, + NULL, -1, Tk_Offset(TkTextTag, spacing3String), TK_OPTION_NULL_OK|OPTION_NONNEG, &pixelsOption, 0}, {TK_OPTION_STRING, "-tabs", NULL, NULL, NULL, Tk_Offset(TkTextTag, tabStringPtr), -1, TK_OPTION_NULL_OK, 0, 0}, {TK_OPTION_STRING_TABLE, "-tabstyle", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, tabStyle), TK_OPTION_NULL_OK, tabStyleStrings, 0}, - {TK_OPTION_STRING, "-underline", NULL, NULL, + {TK_OPTION_CUSTOM, "-underline", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, underlineString), - TK_OPTION_NULL_OK, 0, 0}, + TK_OPTION_NULL_OK, &booleanOption, 0}, {TK_OPTION_COLOR, "-underlinefg", NULL, NULL, NULL, -1, Tk_Offset(TkTextTag, underlineColor), TK_OPTION_NULL_OK, 0, 0}, @@ -183,7 +379,7 @@ TkTextTagCmd( return TCL_ERROR; } tagPtr = TkTextCreateTag(textPtr, Tcl_GetString(objv[3]), NULL); - if (tagPtr->elide) { + if (tagPtr->elide > 0) { /* * Indices are potentially obsolete after adding or removing * elided character ranges, especially indices having "display" @@ -372,8 +568,6 @@ TkTextTagCmd( Tcl_SetObjResult(interp, objPtr); return TCL_OK; } else { - int result = TCL_OK; - if (Tk_SetOptions(interp, (char *)tagPtr, tagPtr->optionTable, objc-4, objv+4, textPtr->tkwin, NULL, NULL) != TCL_OK) { return TCL_ERROR; @@ -389,75 +583,6 @@ TkTextTagCmd( if (tagPtr->borderWidth < 0) { tagPtr->borderWidth = 0; } - if (tagPtr->reliefString != NULL) { - if (Tk_GetRelief(interp, tagPtr->reliefString, - &tagPtr->relief) != TCL_OK) { - return TCL_ERROR; - } - } - if (tagPtr->justifyString != NULL) { - if (Tk_GetJustify(interp, tagPtr->justifyString, - &tagPtr->justify) != TCL_OK) { - return TCL_ERROR; - } - } - if (tagPtr->lMargin1String != NULL) { - if (Tk_GetPixels(interp, textPtr->tkwin, - tagPtr->lMargin1String, &tagPtr->lMargin1) != TCL_OK) { - return TCL_ERROR; - } - } - if (tagPtr->lMargin2String != NULL) { - if (Tk_GetPixels(interp, textPtr->tkwin, - tagPtr->lMargin2String, &tagPtr->lMargin2) != TCL_OK) { - return TCL_ERROR; - } - } - if (tagPtr->offsetString != NULL) { - if (Tk_GetPixels(interp, textPtr->tkwin, tagPtr->offsetString, - &tagPtr->offset) != TCL_OK) { - return TCL_ERROR; - } - } - if (tagPtr->overstrikeString != NULL) { - if (Tcl_GetBoolean(interp, tagPtr->overstrikeString, - &tagPtr->overstrike) != TCL_OK) { - return TCL_ERROR; - } - } - if (tagPtr->rMarginString != NULL) { - if (Tk_GetPixels(interp, textPtr->tkwin, - tagPtr->rMarginString, &tagPtr->rMargin) != TCL_OK) { - return TCL_ERROR; - } - } - if (tagPtr->spacing1String != NULL) { - if (Tk_GetPixels(interp, textPtr->tkwin, - tagPtr->spacing1String, &tagPtr->spacing1) != TCL_OK) { - return TCL_ERROR; - } - if (tagPtr->spacing1 < 0) { - tagPtr->spacing1 = 0; - } - } - if (tagPtr->spacing2String != NULL) { - if (Tk_GetPixels(interp, textPtr->tkwin, - tagPtr->spacing2String, &tagPtr->spacing2) != TCL_OK) { - return TCL_ERROR; - } - if (tagPtr->spacing2 < 0) { - tagPtr->spacing2 = 0; - } - } - if (tagPtr->spacing3String != NULL) { - if (Tk_GetPixels(interp, textPtr->tkwin, - tagPtr->spacing3String, &tagPtr->spacing3) != TCL_OK) { - return TCL_ERROR; - } - if (tagPtr->spacing3 < 0) { - tagPtr->spacing3 = 0; - } - } if (tagPtr->tabArrayPtr != NULL) { ckfree(tagPtr->tabArrayPtr); tagPtr->tabArrayPtr = NULL; @@ -469,18 +594,7 @@ TkTextTagCmd( return TCL_ERROR; } } - if (tagPtr->underlineString != NULL) { - if (Tcl_GetBoolean(interp, tagPtr->underlineString, - &tagPtr->underline) != TCL_OK) { - return TCL_ERROR; - } - } if (tagPtr->elideString != NULL) { - if (Tcl_GetBoolean(interp, tagPtr->elideString, - &tagPtr->elide) != TCL_OK) { - return TCL_ERROR; - } - /* * Indices are potentially obsolete after changing -elide, * especially those computed with "display" or "any" @@ -564,7 +678,7 @@ TkTextTagCmd( TkTextRedrawTag(textPtr->sharedTextPtr, NULL, NULL, NULL, tagPtr, 1); } - return result; + return TCL_OK; } break; } @@ -1032,42 +1146,42 @@ TkTextCreateTag( tagPtr->borderWidth = 0; tagPtr->borderWidthPtr = NULL; tagPtr->reliefString = NULL; - tagPtr->relief = TK_RELIEF_FLAT; + tagPtr->relief = TK_RELIEF_NULL; tagPtr->bgStipple = None; tagPtr->fgColor = NULL; tagPtr->tkfont = NULL; tagPtr->fgStipple = None; tagPtr->justifyString = NULL; - tagPtr->justify = TK_JUSTIFY_LEFT; + tagPtr->justify = (Tk_Justify)-1; tagPtr->lMargin1String = NULL; - tagPtr->lMargin1 = 0; + tagPtr->lMargin1 = INT_MIN; tagPtr->lMargin2String = NULL; - tagPtr->lMargin2 = 0; + tagPtr->lMargin2 = INT_MIN; tagPtr->lMarginColor = NULL; tagPtr->offsetString = NULL; - tagPtr->offset = 0; + tagPtr->offset = INT_MIN; tagPtr->overstrikeString = NULL; - tagPtr->overstrike = 0; + tagPtr->overstrike = -1; tagPtr->overstrikeColor = NULL; tagPtr->rMarginString = NULL; - tagPtr->rMargin = 0; + tagPtr->rMargin = INT_MIN; tagPtr->rMarginColor = NULL; tagPtr->selBorder = NULL; tagPtr->selFgColor = NULL; tagPtr->spacing1String = NULL; - tagPtr->spacing1 = 0; + tagPtr->spacing1 = INT_MIN; tagPtr->spacing2String = NULL; - tagPtr->spacing2 = 0; + tagPtr->spacing2 = INT_MIN; tagPtr->spacing3String = NULL; - tagPtr->spacing3 = 0; + tagPtr->spacing3 = INT_MIN; tagPtr->tabStringPtr = NULL; tagPtr->tabArrayPtr = NULL; tagPtr->tabStyle = TK_TEXT_TABSTYLE_NONE; tagPtr->underlineString = NULL; - tagPtr->underline = 0; + tagPtr->underline = -1; tagPtr->underlineColor = NULL; tagPtr->elideString = NULL; - tagPtr->elide = 0; + tagPtr->elide = -1; tagPtr->wrapMode = TEXT_WRAPMODE_NULL; tagPtr->affectsDisplay = 0; tagPtr->affectsDisplayGeometry = 0; diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 3cc8dbf078..a673b6860a 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -13,6 +13,10 @@ #include "tkInt.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * The structure below defines the implementation of the "statekey" Tcl * object, used for quickly finding a mapping in a TkStateMap. @@ -423,7 +427,7 @@ TkOffsetPrintProc( return "end"; } p = (char *)ckalloc(32); - sprintf(p, "%d", offsetPtr->flags & ~TK_OFFSET_INDEX); + snprintf(p, 32, "%d", offsetPtr->flags & ~TK_OFFSET_INDEX); *freeProcPtr = TCL_DYNAMIC; return p; } @@ -456,7 +460,7 @@ TkOffsetPrintProc( if (offsetPtr->flags & TK_OFFSET_RELATIVE) { *q++ = '#'; } - sprintf(q, "%d,%d", offsetPtr->xoffset, offsetPtr->yoffset); + snprintf(q, 32, "%d,%d", offsetPtr->xoffset, offsetPtr->yoffset); *freeProcPtr = TCL_DYNAMIC; return p; } diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 59c12433dd..9ab59a3c1e 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -3130,6 +3130,7 @@ Initialize( Tcl_Obj *cmd; Tcl_Obj *nameObj = NULL; + Tcl_Obj* appNameObj = NULL; Tcl_Obj *classObj = NULL; Tcl_Obj *displayObj = NULL; Tcl_Obj *colorMapObj = NULL; @@ -3295,6 +3296,8 @@ Initialize( TkpGetAppName(interp, &nameDS); nameObj = Tcl_NewStringObj(Tcl_DStringValue(&nameDS), Tcl_DStringLength(&nameDS)); + appNameObj = nameObj; + Tcl_IncrRefCount(appNameObj); Tcl_DStringFree(&nameDS); } @@ -3456,6 +3459,10 @@ tkInit", -1, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(value); value = NULL; } + if (appNameObj) { + Tcl_DecrRefCount(appNameObj); + appNameObj = NULL; + } return code; } diff --git a/generic/ttk/ttkCache.c b/generic/ttk/ttkCache.c index c29007c452..41593d5eac 100644 --- a/generic/ttk/ttkCache.c +++ b/generic/ttk/ttkCache.c @@ -31,6 +31,10 @@ #include "tkInt.h" #include "ttkTheme.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + struct Ttk_ResourceCache_ { Tcl_Interp *interp; /* Interpreter for error reporting */ Tk_Window tkwin; /* Cache window. */ @@ -209,7 +213,7 @@ void Ttk_RegisterNamedColor( char nameBuf[14]; Tcl_Obj *colorNameObj; - sprintf(nameBuf, "#%04X%04X%04X", + snprintf(nameBuf, sizeof(nameBuf), "#%04X%04X%04X", colorPtr->red, colorPtr->green, colorPtr->blue); colorNameObj = Tcl_NewStringObj(nameBuf, -1); Tcl_IncrRefCount(colorNameObj); @@ -244,6 +248,16 @@ static Tcl_Obj *CheckNamedColor(Ttk_ResourceCache cache, Tcl_Obj *objPtr) */ typedef void *(*Allocator)(Tcl_Interp *, Tk_Window, Tcl_Obj *); +static void *AllocFont(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr) { + return Tk_AllocFontFromObj(interp, tkwin, objPtr); +} +static void *AllocColor(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr) { + return Tk_AllocColorFromObj(interp, tkwin, objPtr); +} +static void *AllocBorder(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr) { + return Tk_Alloc3DBorderFromObj(interp, tkwin, objPtr); +} + static Tcl_Obj *Ttk_Use( Tcl_Interp *interp, Tcl_HashTable *table, @@ -282,7 +296,7 @@ Tcl_Obj *Ttk_UseFont(Ttk_ResourceCache cache, Tk_Window tkwin, Tcl_Obj *objPtr) { InitCacheWindow(cache, tkwin); return Ttk_Use(cache->interp, - &cache->fontTable,(Allocator)Tk_AllocFontFromObj, tkwin, objPtr); + &cache->fontTable, AllocFont, tkwin, objPtr); } /* @@ -294,7 +308,7 @@ Tcl_Obj *Ttk_UseColor(Ttk_ResourceCache cache, Tk_Window tkwin, Tcl_Obj *objPtr) objPtr = CheckNamedColor(cache, objPtr); InitCacheWindow(cache, tkwin); return Ttk_Use(cache->interp, - &cache->colorTable,(Allocator)Tk_AllocColorFromObj, tkwin, objPtr); + &cache->colorTable, AllocColor, tkwin, objPtr); } /* @@ -307,7 +321,7 @@ Tcl_Obj *Ttk_UseBorder( objPtr = CheckNamedColor(cache, objPtr); InitCacheWindow(cache, tkwin); return Ttk_Use(cache->interp, - &cache->borderTable,(Allocator)Tk_Alloc3DBorderFromObj, tkwin, objPtr); + &cache->borderTable, AllocBorder, tkwin, objPtr); } /* NullImageChanged -- diff --git a/generic/ttk/ttkClamTheme.c b/generic/ttk/ttkClamTheme.c index 733a391f18..1081c4b711 100644 --- a/generic/ttk/ttkClamTheme.c +++ b/generic/ttk/ttkClamTheme.c @@ -13,9 +13,9 @@ * theme. Defining this macro as true handles this case. */ #if defined(_WIN32) && !defined(WIN32_XDRAWLINE_HACK) -# define WIN32_XDRAWLINE_HACK 1 + #define WIN32_XDRAWLINE_HACK 1 #else -# define WIN32_XDRAWLINE_HACK 0 + #define WIN32_XDRAWLINE_HACK 0 #endif #define STR(x) StR(x) @@ -854,6 +854,8 @@ static void TabElementSize( void *dummy, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; int borderWidth = 2; (void)dummy; (void)elementRecord; @@ -861,46 +863,141 @@ static void TabElementSize( (void)widthPtr; (void)heightPtr; - paddingPtr->top = paddingPtr->left = paddingPtr->right = borderWidth; - paddingPtr->bottom = 0; + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + + *paddingPtr = Ttk_UniformPadding((short)borderWidth); + switch (nbTabsStickBit) { + default: + case TTK_STICK_S: + paddingPtr->bottom = 0; + break; + case TTK_STICK_N: + paddingPtr->top = 0; + break; + case TTK_STICK_E: + paddingPtr->right = 0; + break; + case TTK_STICK_W: + paddingPtr->left = 0; + break; + } } static void TabElementDraw( void *dummy, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; + int borderWidth = 2, delta = 0; NotebookElement *tab = (NotebookElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, tab->backgroundObj); Display *display = Tk_Display(tkwin); - int borderWidth = 2, dh = 0; - int x1,y1,x2,y2; + int x1, y1, x2, y2; GC gc; const int w = WIN32_XDRAWLINE_HACK; (void)dummy; - if (state & TTK_STATE_SELECTED) { - dh = borderWidth; + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; } - if (state & TTK_STATE_USER2) { /* Rightmost tab */ - --b.width; + if (state & TTK_STATE_SELECTED) { + delta = borderWidth; } - Tk_Fill3DRectangle(tkwin, d, border, - b.x+2, b.y+2, b.width-1, b.height-2+dh, borderWidth, TK_RELIEF_FLAT); + switch (nbTabsStickBit) { + default: + case TTK_STICK_S: + if (state & TTK_STATE_USER2) { /* rightmost tab */ + --b.width; + } + + Tk_Fill3DRectangle(tkwin, d, border, + b.x+2, b.y+2, b.width-1, b.height-2+delta, + borderWidth, TK_RELIEF_FLAT); + + x1 = b.x; y1 = b.y; /* top left */ + x2 = b.x + b.width; y2 = b.y + b.height-1; /* bottom right */ + + gc = Ttk_GCForColor(tkwin, tab->borderColorObj, d); + XDrawLine(display, d, gc, x1, y1+1, x1, y2+1+w); + XDrawLine(display, d, gc, x2, y1+1, x2, y2+1+w); + XDrawLine(display, d, gc, x1+1, y1, x2-1+w, y1); + + gc = Ttk_GCForColor(tkwin, tab->lightColorObj, d); + XDrawLine(display, d, gc, x1+1, y1+1, x1+1, y2+delta+w); + XDrawLine(display, d, gc, x1+1, y1+1, x2-1+w, y1+1); + break; - x1 = b.x, x2 = b.x + b.width; - y1 = b.y, y2 = b.y + b.height; + case TTK_STICK_N: + if (state & TTK_STATE_USER2) { /* rightmost tab */ + --b.width; + } + Tk_Fill3DRectangle(tkwin, d, border, + b.x+2, b.y-delta, b.width-1, b.height-2+delta, + borderWidth, TK_RELIEF_FLAT); - gc=Ttk_GCForColor(tkwin,tab->borderColorObj,d); - XDrawLine(display,d,gc, x1,y1+1, x1,y2+w); - XDrawLine(display,d,gc, x2,y1+1, x2,y2+w); - XDrawLine(display,d,gc, x1+1,y1, x2-1+w,y1); + x1 = b.x; y1 = b.y + b.height-1; /* bottom left */ + x2 = b.x + b.width; y2 = b.y; /* top right */ - gc=Ttk_GCForColor(tkwin,tab->lightColorObj,d); - XDrawLine(display,d,gc, x1+1,y1+1, x1+1,y2-1+dh+w); - XDrawLine(display,d,gc, x1+1,y1+1, x2-1+w,y1+1); + gc = Ttk_GCForColor(tkwin, tab->borderColorObj, d); + XDrawLine(display, d, gc, x1, y1-1, x1, y2-1-w); + XDrawLine(display, d, gc, x2, y1-1, x2, y2-1-w); + XDrawLine(display, d, gc, x1+1, y1, x2-1+w, y1); + + gc = Ttk_GCForColor(tkwin, tab->lightColorObj, d); + XDrawLine(display, d, gc, x1+1, y1-1, x1+1, y2-delta-w); + XDrawLine(display, d, gc, x1+1, y1-1, x2-1+w, y1-1); + break; + + case TTK_STICK_E: + if (state & TTK_STATE_USER2) { /* bottommost tab */ + --b.height; + } + + Tk_Fill3DRectangle(tkwin, d, border, + b.x+2, b.y+2, b.width-2+delta, b.height-1, + borderWidth, TK_RELIEF_FLAT); + + x1 = b.x; y1 = b.y; /* top left */ + x2 = b.x + b.width-1; y2 = b.y + b.height; /* bottom right */ + + gc = Ttk_GCForColor(tkwin, tab->borderColorObj, d); + XDrawLine(display, d, gc, x1, y1+1, x1, y2-1+w); + XDrawLine(display, d, gc, x1+1, y1, x2+1+w, y1); + XDrawLine(display, d, gc, x1+1, y2, x2+1+w, y2); + + gc = Ttk_GCForColor(tkwin, tab->lightColorObj, d); + XDrawLine(display, d, gc, x1+1, y1+1, x1+1, y2-1+w); + XDrawLine(display, d, gc, x1+1, y1+1, x2+delta+w, y1+1); + break; + + case TTK_STICK_W: + if (state & TTK_STATE_USER2) { /* bottommost tab */ + --b.height; + } + + Tk_Fill3DRectangle(tkwin, d, border, + b.x-delta, b.y+2, b.width-2+delta, b.height-1, + borderWidth, TK_RELIEF_FLAT); + + x1 = b.x + b.width-1; y1 = b.y; /* top right */ + x2 = b.x; y2 = b.y + b.height; /* bottom left */ + + gc = Ttk_GCForColor(tkwin, tab->borderColorObj, d); + XDrawLine(display, d, gc, x1, y1+1, x1, y2-1+w); + XDrawLine(display, d, gc, x1-1, y1, x2-1-w, y1); + XDrawLine(display, d, gc, x1-1, y2, x2-1-w, y2); + + gc = Ttk_GCForColor(tkwin, tab->lightColorObj, d); + XDrawLine(display, d, gc, x1-1, y1+1, x1-1, y2-1+w); + XDrawLine(display, d, gc, x1-1, y1+1, x2-delta-w, y1+1); + break; + } } static Ttk_ElementSpec TabElementSpec = diff --git a/generic/ttk/ttkElements.c b/generic/ttk/ttkElements.c index 4dd2adb694..2520ced4e9 100644 --- a/generic/ttk/ttkElements.c +++ b/generic/ttk/ttkElements.c @@ -9,6 +9,12 @@ #include "ttkTheme.h" #include "ttkWidget.h" +#if defined(_WIN32) + #define WIN32_XDRAWLINE_HACK 1 +#else + #define WIN32_XDRAWLINE_HACK 0 +#endif + #define DEFAULT_BORDERWIDTH "2" #define DEFAULT_ARROW_SIZE "15" #define MIN_THUMB_SIZE 10 @@ -1104,63 +1110,156 @@ static void TabElementSize( void *clientData, void *elementRecord, Tk_Window tkwin, int *widthPtr, int *heightPtr, Ttk_Padding *paddingPtr) { - TabElement *tab = elementRecord; + TabElement *tab = (TabElement *)elementRecord; int borderWidth = 1; + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; + Tk_GetPixelsFromObj(0, tkwin, tab->borderWidthObj, &borderWidth); - paddingPtr->top = paddingPtr->left = paddingPtr->right = borderWidth; - paddingPtr->bottom = 0; + *paddingPtr = Ttk_UniformPadding((short)borderWidth); + + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } + + switch (nbTabsStickBit) { + default: + case TTK_STICK_S: + paddingPtr->bottom = 0; + break; + case TTK_STICK_N: + paddingPtr->top = 0; + break; + case TTK_STICK_E: + paddingPtr->right = 0; + break; + case TTK_STICK_W: + paddingPtr->left = 0; + break; + } } static void TabElementDraw( void *clientData, void *elementRecord, Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state) { - TabElement *tab = elementRecord; + Ttk_PositionSpec nbTabsStickBit = TTK_STICK_S; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; + TabElement *tab = (TabElement *)elementRecord; Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, tab->backgroundObj); - int borderWidth = 1; - int cut = 2; XPoint pts[6]; - int n = 0; + int cut = 2; + Display *disp = Tk_Display(tkwin); + int borderWidth = 1; - Tcl_GetIntFromObj(NULL, tab->borderWidthObj, &borderWidth); + if (mainInfoPtr != NULL) { + nbTabsStickBit = (Ttk_PositionSpec) mainInfoPtr->ttkNbTabsStickBit; + } if (state & TTK_STATE_SELECTED) { /* * Draw slightly outside of the allocated parcel, * to overwrite the client area border. */ - b.height += borderWidth; + switch (nbTabsStickBit) { + default: + case TTK_STICK_S: + b.height += 1; + break; + case TTK_STICK_N: + b.height += 1; b.y -= 1; + break; + case TTK_STICK_E: + b.width += 1; + break; + case TTK_STICK_W: + b.width += 1; b.x -= 1; + break; + } } - pts[n].x = b.x; pts[n].y = b.y + b.height - 1; ++n; - pts[n].x = b.x; pts[n].y = b.y + cut; ++n; - pts[n].x = b.x + cut; pts[n].y = b.y; ++n; - pts[n].x = b.x + b.width-1-cut; pts[n].y = b.y; ++n; - pts[n].x = b.x + b.width-1; pts[n].y = b.y + cut; ++n; - pts[n].x = b.x + b.width-1; pts[n].y = b.y + b.height; ++n; + switch (nbTabsStickBit) { + default: + case TTK_STICK_S: + pts[0].x = b.x; pts[0].y = b.y + b.height-1; + pts[1].x = b.x; pts[1].y = b.y + cut; + pts[2].x = b.x + cut; pts[2].y = b.y; + pts[3].x = b.x + b.width-1 - cut; pts[3].y = b.y; + pts[4].x = b.x + b.width-1; pts[4].y = b.y + cut; + pts[5].x = b.x + b.width-1; pts[5].y = b.y + b.height; + break; + case TTK_STICK_N: + pts[0].x = b.x; pts[0].y = b.y; + pts[1].x = b.x; pts[1].y = b.y + b.height-1 - cut; + pts[2].x = b.x + cut; pts[2].y = b.y + b.height-1; + pts[3].x = b.x + b.width-1 - cut; pts[3].y = b.y + b.height-1; + pts[4].x = b.x + b.width-1; pts[4].y = b.y + b.height-1 - cut; + pts[5].x = b.x + b.width-1; pts[5].y = b.y-1; + break; + case TTK_STICK_E: + pts[0].x = b.x + b.width-1; pts[0].y = b.y; + pts[1].x = b.x + cut; pts[1].y = b.y; + pts[2].x = b.x; pts[2].y = b.y + cut; + pts[3].x = b.x; pts[3].y = b.y + b.height-1 - cut; + pts[4].x = b.x + cut; pts[4].y = b.y + b.height-1; + pts[5].x = b.x + b.width; pts[5].y = b.y + b.height-1; + break; + case TTK_STICK_W: + pts[0].x = b.x; pts[0].y = b.y; + pts[1].x = b.x + b.width-1 - cut; pts[1].y = b.y; + pts[2].x = b.x + b.width-1; pts[2].y = b.y + cut; + pts[3].x = b.x + b.width-1; pts[3].y = b.y + b.height-1 - cut; + pts[4].x = b.x + b.width-1 - cut; pts[4].y = b.y + b.height-1; + pts[5].x = b.x-1; pts[5].y = b.y + b.height-1; + break; + } - XFillPolygon(Tk_Display(tkwin), d, - Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC), - pts, 6, Convex, CoordModeOrigin); + XFillPolygon(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_FLAT_GC), + pts, 6, Convex, CoordModeOrigin); -#ifndef _WIN32 - /* - * Account for whether XDrawLines draws endpoints by platform - */ - --pts[5].y; -#endif + switch (nbTabsStickBit) { + default: + case TTK_STICK_S: + pts[5].y -= 1 - WIN32_XDRAWLINE_HACK; + break; + case TTK_STICK_N: + pts[5].y += 1 - WIN32_XDRAWLINE_HACK; + break; + case TTK_STICK_E: + pts[5].x -= 1 - WIN32_XDRAWLINE_HACK; + break; + case TTK_STICK_W: + pts[5].x += 1 - WIN32_XDRAWLINE_HACK; + break; + } + Tcl_GetIntFromObj(NULL, tab->borderWidthObj, &borderWidth); while (borderWidth--) { - XDrawLines(Tk_Display(tkwin), d, - Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC), + XDrawLines(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_LIGHT_GC), pts, 4, CoordModeOrigin); - XDrawLines(Tk_Display(tkwin), d, - Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC), + XDrawLines(disp, d, Tk_3DBorderGC(tkwin, border, TK_3D_DARK_GC), pts+3, 3, CoordModeOrigin); - ++pts[0].x; ++pts[1].x; ++pts[2].x; --pts[4].x; --pts[5].x; - ++pts[2].y; ++pts[3].y; - } + switch (nbTabsStickBit) { + default: + case TTK_STICK_S: + ++pts[0].x; ++pts[1].x; ++pts[2].y; + ++pts[3].y; --pts[4].x; --pts[5].x; + break; + case TTK_STICK_N: + ++pts[0].x; ++pts[1].x; --pts[2].y; + --pts[3].y; --pts[4].x; --pts[5].x; + break; + case TTK_STICK_E: + ++pts[0].y; ++pts[1].y; ++pts[2].x; + ++pts[3].x; --pts[4].y; --pts[5].y; + break; + case TTK_STICK_W: + ++pts[0].y; ++pts[1].y; --pts[2].x; + --pts[3].x; --pts[4].y; --pts[5].y; + break; + } + } } static Ttk_ElementSpec TabElementSpec = { diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c index 6cf88c355c..85ec1da841 100644 --- a/generic/ttk/ttkEntry.c +++ b/generic/ttk/ttkEntry.c @@ -12,6 +12,10 @@ #include "ttkTheme.h" #include "ttkWidget.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + /* * Extra bits for core.flags: */ @@ -443,11 +447,11 @@ ExpandPercents( } else { number = -1; } - sprintf(numStorage, "%d", number); + snprintf(numStorage, sizeof(numStorage), "%d", number); string = numStorage; break; case 'i': /* index of insert/delete */ - sprintf(numStorage, "%d", index); + snprintf(numStorage, sizeof(numStorage), "%d", index); string = numStorage; break; case 'P': /* 'Peeked' new value of the string */ diff --git a/generic/ttk/ttkImage.c b/generic/ttk/ttkImage.c index e33a9de913..c47e432519 100644 --- a/generic/ttk/ttkImage.c +++ b/generic/ttk/ttkImage.c @@ -156,7 +156,10 @@ void TtkFreeImageSpec(Ttk_ImageSpec *imageSpec) /* TtkSelectImage -- * Return a state-specific image from an ImageSpec */ -Tk_Image TtkSelectImage(Ttk_ImageSpec *imageSpec, Ttk_State state) +Tk_Image TtkSelectImage( + Ttk_ImageSpec *imageSpec, + TCL_UNUSED(Tk_Window), + Ttk_State state) { int i; for (i = 0; i < imageSpec->mapCount; ++i) { @@ -307,10 +310,10 @@ static void ImageElementDraw( } } if (!image) { - image = TtkSelectImage(imageData->imageSpec, state); + image = TtkSelectImage(imageData->imageSpec, tkwin, state); } #else - image = TtkSelectImage(imageData->imageSpec, state); + image = TtkSelectImage(imageData->imageSpec, tkwin, state); #endif if (!image) { diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c index d37db95d73..54ecabd091 100644 --- a/generic/ttk/ttkLabel.c +++ b/generic/ttk/ttkLabel.c @@ -282,7 +282,7 @@ static int ImageSetup( if (!image->imageSpec) { return 0; } - image->tkimg = TtkSelectImage(image->imageSpec, state); + image->tkimg = TtkSelectImage(image->imageSpec, tkwin, state); if (!image->tkimg) { TtkFreeImageSpec(image->imageSpec); return 0; @@ -356,7 +356,7 @@ static void ImageDraw( if (state & TTK_STATE_DISABLED) { - if (TtkSelectImage(image->imageSpec, 0ul) == image->tkimg) { + if (TtkSelectImage(image->imageSpec, tkwin, 0ul) == image->tkimg) { #ifndef MAC_OSX_TK StippleOver(image, tkwin, d, b.x,b.y); #endif @@ -496,7 +496,7 @@ static Ttk_ElementOptionSpec LabelElementOptions[] = { */ #undef MAX -#define MAX(a,b) ((a) > (b) ? a : b); +#define MAX(a,b) ((a) > (b) ? (a) : (b)); static void LabelSetup( LabelElement *c, Tk_Window tkwin, Ttk_State state) { diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index 9cebe2d3a7..d4c14f37b2 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -9,8 +9,8 @@ #include "tkInt.h" #include "ttkThemeInt.h" -#define MAX(a,b) (a > b ? a : b) -#define MIN(a,b) (a < b ? a : b) +#define MAX(a,b) ((a) > (b) ? (a) : (b)) +#define MIN(a,b) ((a) < (b) ? (a) : (b)) /*------------------------------------------------------------------------ * +++ Ttk_Box and Ttk_Padding utilities: @@ -31,6 +31,13 @@ Ttk_BoxContains(Ttk_Box box, int x, int y) && box.y <= y && y < box.y + box.height; } +int +TtkBoxEqual(Ttk_Box box1, Ttk_Box box2) +{ + return box1.x == box2.x && box1.y == box2.y + && box1.width == box2.width && box1.height == box2.height; +} + Tcl_Obj * Ttk_NewBoxObj(Ttk_Box box) { diff --git a/generic/ttk/ttkNotebook.c b/generic/ttk/ttkNotebook.c index 71cbaddf2e..600eca91db 100644 --- a/generic/ttk/ttkNotebook.c +++ b/generic/ttk/ttkNotebook.c @@ -4,7 +4,7 @@ #include "tkInt.h" -#include "ttkTheme.h" +#include "ttkThemeInt.h" #include "ttkWidget.h" #include "ttkManager.h" @@ -136,9 +136,11 @@ typedef struct Ttk_Padding padding; /* External padding */ } NotebookStyle; -static void NotebookStyleOptions(Notebook *nb, NotebookStyle *nbstyle) +static void NotebookStyleOptions( + Notebook *nb, NotebookStyle *nbstyle, Tk_Window tkwin) { Tcl_Obj *objPtr; + TkMainInfo *mainInfoPtr = ((TkWindow *) tkwin)->mainPtr; nbstyle->tabPosition = TTK_PACK_TOP | TTK_STICK_W; if ((objPtr = Ttk_QueryOption(nb->core.layout, "-tabposition", 0)) != 0) { @@ -160,6 +162,13 @@ static void NotebookStyleOptions(Notebook *nb, NotebookStyle *nbstyle) TtkGetLabelAnchorFromObj(NULL, objPtr, &nbstyle->tabPlacement); } + /* Save the stick bit for later. One of the values + * TTK_STICK_S, TTK_STICK_N, TTK_STICK_E, or TTK_STICK_W: + */ + if (mainInfoPtr != NULL) { + mainInfoPtr->ttkNbTabsStickBit = (nbstyle->tabPlacement & 0x0f); + } + /* Compute tabOrient as function of tabPlacement: */ if (nbstyle->tabPlacement & (TTK_PACK_LEFT|TTK_PACK_RIGHT)) { @@ -386,6 +395,7 @@ static void TabrowSize( static int NotebookSize(void *clientData, int *widthPtr, int *heightPtr) { Notebook *nb = (Notebook *)clientData; + Tk_Window nbwin = nb->core.tkwin; NotebookStyle nbstyle; Ttk_Padding padding; Ttk_Element clientNode = Ttk_FindElement(nb->core.layout, "client"); @@ -394,7 +404,7 @@ static int NotebookSize(void *clientData, int *widthPtr, int *heightPtr) tabrowWidth = 0, tabrowHeight = 0; int i; - NotebookStyleOptions(nb, &nbstyle); + NotebookStyleOptions(nb, &nbstyle, nbwin); /* Compute max requested size of all content windows: */ @@ -510,6 +520,23 @@ static void PlaceTabs( } } +/* + * NotebookPlaceContent -- + * Set the position and size of a child widget + * based on the current client area and content window options: + */ +static void NotebookPlaceContent(Notebook* nb, int index) +{ + Tab* tab = (Tab*)Ttk_ContentData(nb->notebook.mgr, index); + Tk_Window window = Ttk_ContentWindow(nb->notebook.mgr, index); + Ttk_Box box = + Ttk_StickBox(Ttk_PadBox(nb->notebook.clientArea, tab->padding), + Tk_ReqWidth(window), Tk_ReqHeight(window), tab->sticky); + + Ttk_PlaceContent(nb->notebook.mgr, index, + box.x, box.y, box.width, box.height); +} + /* NotebookDoLayout -- * Computes notebook layout and places tabs. * @@ -525,8 +552,9 @@ static void NotebookDoLayout(void *recordPtr) Ttk_Element clientNode = Ttk_FindElement(nb->core.layout, "client"); Ttk_Box tabrowBox; NotebookStyle nbstyle; + int currentIndex = nb->notebook.currentIndex; - NotebookStyleOptions(nb, &nbstyle); + NotebookStyleOptions(nb, &nbstyle, nbwin); /* Notebook internal padding: */ @@ -564,24 +592,12 @@ static void NotebookDoLayout(void *recordPtr) if (cavity.height <= 0) cavity.height = 1; if (cavity.width <= 0) cavity.width = 1; - nb->notebook.clientArea = cavity; -} - -/* - * NotebookPlaceContent -- - * Set the position and size of a child widget - * based on the current client area and content window options: - */ -static void NotebookPlaceContent(Notebook *nb, int index) -{ - Tab *tab = (Tab *)Ttk_ContentData(nb->notebook.mgr, index); - Tk_Window window = Ttk_ContentWindow(nb->notebook.mgr, index); - Ttk_Box box = - Ttk_StickBox(Ttk_PadBox(nb->notebook.clientArea, tab->padding), - Tk_ReqWidth(window), Tk_ReqHeight(window),tab->sticky); - - Ttk_PlaceContent(nb->notebook.mgr, index, - box.x, box.y, box.width, box.height); + if (!TtkBoxEqual(nb->notebook.clientArea, cavity)) { + nb->notebook.clientArea = cavity; + if (currentIndex >= 0) { + NotebookPlaceContent(nb, currentIndex); + } + } } /* NotebookPlaceContents -- diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 09c7b15ebe..3cea404e4b 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -403,8 +403,6 @@ typedef struct int themeChangePending; /* scheduled ThemeChangedProc call? */ } StylePackageData; -static void ThemeChangedProc(void *); /* Forward */ - /* Ttk_StylePkgFree -- * Cleanup procedure for StylePackageData. */ @@ -479,7 +477,7 @@ static StylePackageData *GetStylePackageData(Tcl_Interp *interp) void Ttk_RegisterCleanup( Tcl_Interp *interp, ClientData clientData, Ttk_CleanupProc *cleanupProc) { - StylePackageData *pkgPtr = (StylePackageData *)GetStylePackageData(interp); + StylePackageData *pkgPtr = GetStylePackageData(interp); Cleanup *cleanup = (Cleanup *)ckalloc(sizeof(*cleanup)); cleanup->clientData = clientData; diff --git a/generic/ttk/ttkTheme.h b/generic/ttk/ttkTheme.h index cf0a07c522..c9272094fd 100644 --- a/generic/ttk/ttkTheme.h +++ b/generic/ttk/ttkTheme.h @@ -379,7 +379,7 @@ TTKAPI Ttk_ImageSpec *TtkGetImageSpec(Tcl_Interp *, Tk_Window, Tcl_Obj *); TTKAPI Ttk_ImageSpec *TtkGetImageSpecEx(Tcl_Interp *, Tk_Window, Tcl_Obj *, Tk_ImageChangedProc *, ClientData); TTKAPI void TtkFreeImageSpec(Ttk_ImageSpec *); -TTKAPI Tk_Image TtkSelectImage(Ttk_ImageSpec *, Ttk_State); +TTKAPI Tk_Image TtkSelectImage(Ttk_ImageSpec *, Tk_Window, Ttk_State); /*------------------------------------------------------------------------ * +++ Miscellaneous enumerations. diff --git a/generic/ttk/ttkThemeInt.h b/generic/ttk/ttkThemeInt.h index 3aaada8af0..cd95ebe1a4 100644 --- a/generic/ttk/ttkThemeInt.h +++ b/generic/ttk/ttkThemeInt.h @@ -39,4 +39,6 @@ MODULE_SCOPE Ttk_LayoutTemplate Ttk_FindLayoutTemplate( MODULE_SCOPE const char *Ttk_StyleName(Ttk_Style); +MODULE_SCOPE int TtkBoxEqual(Ttk_Box, Ttk_Box); + #endif /* _TTKTHEMEINT */ diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 7a5438a7a7..ce37e0447b 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -8,6 +8,12 @@ #include "ttkTheme.h" #include "ttkWidget.h" +#ifdef _WIN32 +#include "tkWinInt.h" +#endif + +#define MAX(a,b) ((a) > (b) ? (a) : (b)) + #define DEF_TREE_ROWS "10" #define DEF_COLWIDTH "200" #define DEF_MINWIDTH "20" @@ -1586,12 +1592,12 @@ static Ttk_Layout TreeviewGetLayout( Ttk_LayoutSize(tv->tree.headingLayout, 0, &unused, &tv->tree.headingHeight); /* Get item height, indent from style: - * @@@ TODO: sanity-check. */ tv->tree.rowHeight = DEFAULT_ROWHEIGHT; tv->tree.indent = DEFAULT_INDENT; if ((objPtr = Ttk_QueryOption(treeLayout, "-rowheight", 0))) { (void)Tcl_GetIntFromObj(NULL, objPtr, &tv->tree.rowHeight); + tv->tree.rowHeight = MAX(tv->tree.rowHeight, 1); } if ((objPtr = Ttk_QueryOption(treeLayout, "-indent", 0))) { (void)Tcl_GetIntFromObj(NULL, objPtr, &tv->tree.indent); @@ -1611,7 +1617,7 @@ static Ttk_Layout TreeviewGetLayout( static void TreeviewDoLayout(void *clientData) { Treeview *tv = clientData; - int visibleRows; + int totalRows, visibleRows; Ttk_PlaceLayout(tv->core.layout,tv->core.state,Ttk_WinBox(tv->core.tkwin)); tv->tree.treeArea = Ttk_ClientRegion(tv->core.layout, "treearea"); @@ -1630,12 +1636,22 @@ static void TreeviewDoLayout(void *clientData) tv->tree.headingArea = Ttk_MakeBox(0,0,0,0); } - visibleRows = tv->tree.treeArea.height / tv->tree.rowHeight; tv->tree.root->state |= TTK_STATE_OPEN; + totalRows = CountRows(tv->tree.root) - 1; + visibleRows = tv->tree.treeArea.height / tv->tree.rowHeight; + if (tv->tree.treeArea.height % tv->tree.rowHeight) { + /* When the treeview height doesn't correspond to an exact number + * of rows, the visible row count must be incremented to draw a + * partial row at the bottom. The total row count must also be + * incremented to be able to scroll all the way to the bottom. + */ + visibleRows++; + totalRows++; + } TtkScrolled(tv->tree.yscrollHandle, tv->tree.yscroll.first, tv->tree.yscroll.first + visibleRows, - CountRows(tv->tree.root) - 1); + totalRows); } /* + TreeviewSize -- @@ -2207,7 +2223,7 @@ static int TreeviewHorribleIdentify( if (dColumnNumber < 0) { goto done; } - sprintf(dcolbuf, "#%d", dColumnNumber); + snprintf(dcolbuf, sizeof(dcolbuf), "#%d", dColumnNumber); if (Ttk_BoxContains(tv->tree.headingArea,x,y)) { if (-HALO <= x1 - x && x1 - x <= HALO) { @@ -2596,7 +2612,7 @@ static int TreeviewInsertCommand( char idbuf[16]; do { ++tv->tree.serial; - sprintf(idbuf, "I%03X", tv->tree.serial); + snprintf(idbuf, sizeof(idbuf), "I%03X", tv->tree.serial); entryPtr = Tcl_CreateHashEntry(&tv->tree.items, idbuf, &isNew); } while (!isNew); } diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c index 9fa8ec0ffb..75ca39cb08 100644 --- a/generic/ttk/ttkWidget.c +++ b/generic/ttk/ttkWidget.c @@ -201,15 +201,6 @@ WidgetInstanceObjCmdDeleted(ClientData clientData) Tk_DestroyWindow(corePtr->tkwin); } -/* FreeWidget -- - * Final cleanup for widget; called via Tcl_EventuallyFree(). - */ -static void -FreeWidget(void *memPtr) -{ - ckfree(memPtr); -} - /* DestroyWidget -- * Main widget destructor; called from event handler. */ @@ -238,7 +229,7 @@ DestroyWidget(WidgetCore *corePtr) /* NB: this can reenter the interpreter via a command traces */ Tcl_DeleteCommandFromToken(corePtr->interp, cmd); } - Tcl_EventuallyFree(corePtr, (Tcl_FreeProc *) FreeWidget); + Tcl_EventuallyFree(corePtr, TCL_DYNAMIC); } /* diff --git a/library/choosedir.tcl b/library/choosedir.tcl index 68dd9b0dd0..33a66b19b3 100644 --- a/library/choosedir.tcl +++ b/library/choosedir.tcl @@ -118,7 +118,9 @@ proc ::tk::dialog::file::chooseDir:: {args} { foreach trace [trace info variable data(selectPath)] { trace remove variable data(selectPath) [lindex $trace 0] [lindex $trace 1] } - $data(dirMenuBtn) configure -textvariable {} + if {[winfo exists $data(dirMenuBtn)]} { + $data(dirMenuBtn) configure -textvariable {} + } # Return value to user # diff --git a/library/clrpick.tcl b/library/clrpick.tcl index d67c67fd4e..cc38005c74 100644 --- a/library/clrpick.tcl +++ b/library/clrpick.tcl @@ -320,7 +320,6 @@ proc ::tk::dialog::color::BuildDialog {w} { bind $w [list tk::AltKeyInDialog $w %A] wm protocol $w WM_DELETE_WINDOW [list tk::dialog::color::CancelCmd $w] - bind $lab [list tk::dialog::color::CancelCmd $w] } # ::tk::dialog::color::SetRGBValue -- diff --git a/library/console.tcl b/library/console.tcl index 83723f15f2..d73b2f5c81 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -595,7 +595,7 @@ proc ::tk::ConsoleBind {w} { tk::ConsoleInsert %W %A } bind Console { - eval destroy [winfo child .] + destroy {*}[winfo children .] source -encoding utf-8 [file join $tk_library console.tcl] } if {[tk windowingsystem] eq "aqua"} { diff --git a/library/demos/check.tcl b/library/demos/check.tcl index c0720960ec..cf21761839 100644 --- a/library/demos/check.tcl +++ b/library/demos/check.tcl @@ -65,7 +65,7 @@ proc tristate_check {n1 n2 op} { set in_check 0 } -trace variable wipers w tristate_check -trace variable brakes w tristate_check -trace variable sober w tristate_check -trace variable safety w tristate_check +trace add variable wipers write tristate_check +trace add variable brakes write tristate_check +trace add variable sober write tristate_check +trace add variable safety write tristate_check diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl index 7d0ad3bd39..4831ccf90d 100644 --- a/library/demos/floor.tcl +++ b/library/demos/floor.tcl @@ -62,6 +62,7 @@ proc floorDisplay {w active} { $w create window 600 100 -anchor w -window $w.entry $w create text 600 100 -anchor e -text "Room: " + $w config -scrollregion [$w bbox all] } @@ -1368,4 +1369,4 @@ if {[tk windowingsystem] eq "aqua" && ![package vsatisfies [package provide Tk] } bind $c "unset currentRoom" set currentRoom "" -trace variable currentRoom w "roomChanged $c" +trace add variable currentRoom write "roomChanged $c" diff --git a/library/demos/goldberg.tcl b/library/demos/goldberg.tcl index 90815fbd7f..e71b9d23c5 100644 --- a/library/demos/goldberg.tcl +++ b/library/demos/goldberg.tcl @@ -113,9 +113,9 @@ proc DoDisplay {w} { DoCtrlFrame $w DoDetailFrame $w if {[tk windowingsystem] ne "aqua"} { - ttk::button $w.show -text "\u00bb" -command [list ShowCtrl $w] -width 2 + ttk::button $w.show -text "\xbb" -command [list ShowCtrl $w] -width 2 } else { - button $w.show -text "\u00bb" -command [list ShowCtrl $w] -width 2 -highlightbackground $C(bg) + button $w.show -text "\xbb" -command [list ShowCtrl $w] -width 2 -highlightbackground $C(bg) } place $w.show -in $w.c -relx 1 -rely 0 -anchor ne update @@ -153,9 +153,9 @@ proc DoCtrlFrame {w} { raise $w.details raise $w.details.cb grid rowconfigure $w.ctrl 50 -weight 1 - trace variable ::S(mode) w [list ActiveGUI $w] - trace variable ::S(details) w [list ActiveGUI $w] - trace variable ::S(speed) w [list ActiveGUI $w] + trace add variable ::S(mode) write [list ActiveGUI $w] + trace add variable ::S(details) write [list ActiveGUI $w] + trace add variable ::S(speed) write [list ActiveGUI $w] grid $w.message -in $w.ctrl -row 98 -sticky ew -pady 5 grid $w.message.e -sticky nsew @@ -185,7 +185,6 @@ proc DoDetailFrame {w} { set w2 $w.details.f ttk::frame $w2 - set bd 2 ttk::label $w2.l -textvariable S(cnt) -background white grid $w2.l - - - -sticky ew -row 0 for {set i 1} {1} {incr i} { @@ -204,10 +203,10 @@ proc DoDetailFrame {w} { proc ShowCtrl {w} { if {[winfo ismapped $w.ctrl]} { pack forget $w.ctrl - $w.show config -text "\u00bb" + $w.show config -text "\xbb" } else { pack $w.ctrl -side right -fill both -ipady 5 - $w.show config -text "\u00ab" + $w.show config -text "\xab" } } @@ -272,7 +271,7 @@ proc Go {w {who {}}} { set now [clock clicks -milliseconds] catch {after cancel $animationCallbacks(goldberg)} if {$who ne ""} { ;# Start here for debugging - set S(active) $who; + set S(active) $who set S(mode) $MGO } if {$S(mode) == -1} return ;# Debugging diff --git a/library/demos/pendulum.tcl b/library/demos/pendulum.tcl index 9833e8f89c..2eef16222e 100644 --- a/library/demos/pendulum.tcl +++ b/library/demos/pendulum.tcl @@ -82,8 +82,8 @@ proc showPendulum {canvas {at {}} {x {}} {y {}}} { set y [expr {25 + $length*cos($angle)}] } $canvas coords rod $home 25 $x $y - $canvas coords bob \ - [expr {$x-15}] [expr {$y-15}] [expr {$x+15}] [expr {$y+15}] + $canvas coords bob [expr {$x - 15}] [expr {$y - 15}] \ + [expr {$x + 15}] [expr {$y + 15}] } showPendulum $w.c @@ -92,7 +92,7 @@ showPendulum $w.c # respect to time.) proc showPhase {canvas} { global Theta dTheta points psw psh - lappend points [expr {$Theta+$psw}] [expr {-20*$dTheta+$psh}] + lappend points [expr {$Theta + $psw}] [expr {-20*$dTheta + $psh}] if {[llength $points] > 100} { set points [lrange $points end-99 end] } @@ -127,15 +127,15 @@ bind $w.c { bind $w.c { %W coords plate 0 25 %w 25 set home [expr {%w/2}] - %W coords pivot [expr {$home-5}] 20 [expr {$home+5}] 30 + %W coords pivot [expr {$home - 5}] 20 [expr {$home + 5}] 30 } bind $w.k { set psh [expr {%h/2}] set psw [expr {%w/2}] - %W coords x_axis 2 $psh [expr {%w-2}] $psh - %W coords y_axis $psw [expr {%h-2}] $psw 2 - %W coords label_dtheta [expr {$psw-4}] 6 - %W coords label_theta [expr {%w-6}] [expr {$psh+4}] + %W coords x_axis 2 $psh [expr {%w - 2}] $psh + %W coords y_axis $psw [expr {%h - 2}] $psw 2 + %W coords label_dtheta [expr {$psw - 4}] 6 + %W coords label_theta [expr {%w - 6}] [expr {$psh + 4}] } # This procedure is the "business" part of the simulation that does diff --git a/library/demos/rolodex b/library/demos/rolodex index 89415708d8..22952a5507 100644 --- a/library/demos/rolodex +++ b/library/demos/rolodex @@ -10,7 +10,7 @@ exec wish "$0" ${1+"$@"} package require Tk -foreach i [winfo child .] { +foreach i [winfo children .] { catch {destroy $i} } diff --git a/library/demos/widget b/library/demos/widget index 13b8d0eb71..b37c70cf77 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -13,7 +13,7 @@ exec wish "$0" ${1+"$@"} package require Tk 8.5 package require msgcat -eval destroy [winfo child .] +destroy {*}[winfo children .] set tk_demoDirectory [file join [pwd] [file dirname [info script]]] ::msgcat::mcload $tk_demoDirectory namespace import ::msgcat::mc diff --git a/library/entry.tcl b/library/entry.tcl index 4140c92f73..5cb5ab912d 100644 --- a/library/entry.tcl +++ b/library/entry.tcl @@ -599,6 +599,10 @@ proc ::tk::EntryTranspose w { if {[tk windowingsystem] eq "win32"} { proc ::tk::EntryNextWord {w start} { + # the check on [winfo class] is because the spinbox also uses this proc + if {[winfo class $w] eq "Entry" && [$w cget -show] ne ""} { + return end + } set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos >= 0} { set pos [tcl_startOfNextWord [$w get] $pos] @@ -610,6 +614,10 @@ if {[tk windowingsystem] eq "win32"} { } } else { proc ::tk::EntryNextWord {w start} { + # the check on [winfo class] is because the spinbox also uses this proc + if {[winfo class $w] eq "Entry" && [$w cget -show] ne ""} { + return end + } set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos < 0} { return end @@ -628,6 +636,10 @@ if {[tk windowingsystem] eq "win32"} { # start - Position at which to start search. proc ::tk::EntryPreviousWord {w start} { + # the check on [winfo class] is because the spinbox also uses this proc + if {[winfo class $w] eq "Entry" && [$w cget -show] ne ""} { + return 0 + } set pos [tcl_startOfPreviousWord [$w get] [$w index $start]] if {$pos < 0} { return 0 diff --git a/library/fontchooser.tcl b/library/fontchooser.tcl index 27c8deffdc..8c036adb94 100644 --- a/library/fontchooser.tcl +++ b/library/fontchooser.tcl @@ -324,11 +324,11 @@ proc ::tk::fontchooser::Done {ok} { if {! $ok} { set S(result) "" } - trace vdelete S(size) w [namespace code [list Tracer]] - trace vdelete S(style) w [namespace code [list Tracer]] - trace vdelete S(font) w [namespace code [list Tracer]] - trace vdelete S(strike) w [namespace code [list Tracer]] - trace vdelete S(under) w [namespace code [list Tracer]] + trace remove variable S(size) write [namespace code [list Tracer]] + trace remove variable S(style) write [namespace code [list Tracer]] + trace remove variable S(font) write [namespace code [list Tracer]] + trace remove variable S(strike) write [namespace code [list Tracer]] + trace remove variable S(under) write [namespace code [list Tracer]] destroy $S(W) if {$ok} { if {$S(-command) ne ""} { diff --git a/library/iconlist.tcl b/library/iconlist.tcl index 6f46ba4f67..75a0741c17 100644 --- a/library/iconlist.tcl +++ b/library/iconlist.tcl @@ -377,7 +377,7 @@ package require Tk method DrawSelection {} { $canvas delete selection - $canvas itemconfigure selectionText -fill black + $canvas itemconfigure selectionText -fill $fill $canvas dtag selectionText set cbg [ttk::style lookup TEntry -selectbackground focus] set cfg [ttk::style lookup TEntry -selectforeground focus] @@ -422,12 +422,7 @@ package require Tk set noScroll 1 set selection {} set index(anchor) "" - set fg [option get $canvas foreground Foreground] - if {$fg eq ""} { - set fill black - } else { - set fill $fg - } + set fill black # Creates the event bindings. # diff --git a/library/menu.tcl b/library/menu.tcl index deca4858e4..f6ec29ad0d 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -88,7 +88,7 @@ bind Menubutton { bind Menubutton { tk::MbLeave %W } -bind Menubutton <1> { +bind Menubutton { if {$tk::Priv(inMenubutton) ne ""} { tk::MbPost $tk::Priv(inMenubutton) %X %Y } @@ -475,7 +475,7 @@ proc ::tk::MbButtonUp w { proc ::tk::MenuMotion {menu x y state} { variable ::tk::Priv if {$menu eq $Priv(window)} { - set active [$menu index active] + set activeindex [$menu index active] if {[$menu cget -type] eq "menubar"} { if {[info exists Priv(focus)] && $menu ne $Priv(focus)} { $menu activate @$x,$y @@ -488,7 +488,8 @@ proc ::tk::MenuMotion {menu x y state} { set index [$menu index @$x,$y] if {[info exists Priv(menuActivated)] \ && $index ne "none" \ - && $index ne $active} { + && $index >= 0 \ + && $index ne $activeindex} { set mode [option get $menu clickToFocus ClickToFocus] if {[string is false $mode]} { set delay [expr {[$menu cget -type] eq "menubar" ? 0 : 50}] @@ -496,10 +497,12 @@ proc ::tk::MenuMotion {menu x y state} { # Catch these postcascade commands since the menu could be # destroyed before they run. set Priv(menuActivatedTimer) \ - [after $delay "catch {$menu postcascade active}"] + [after $delay [list catch [list \ + $menu postcascade active]]] } else { set Priv(menuDeactivatedTimer) \ - [after $delay "catch {$menu postcascade none}"] + [after $delay [list catch [list + $menu postcascade none]]] } } } @@ -527,7 +530,8 @@ proc ::tk::MenuButtonDown menu { if {![winfo viewable $menu]} { return } - if {[$menu index active] eq "none"} { + set activeindex [$menu index active] + if {($activeindex eq "none") || ($activeindex < 0)} { if {[$menu cget -type] ne "menubar" } { set Priv(window) {} } @@ -585,7 +589,8 @@ proc ::tk::MenuButtonDown menu { proc ::tk::MenuLeave {menu rootx rooty state} { variable ::tk::Priv set Priv(window) {} - if {[$menu index active] eq "none"} { + set activeindex [$menu index active] + if {($activeindex eq "none") || ($activeindex < 0)} { return } if {[$menu type active] eq "cascade" \ @@ -630,8 +635,8 @@ proc ::tk::MenuInvoke {w buttonRelease} { MenuUnpost $w } elseif {[$w cget -type] eq "menubar"} { $w postcascade none - set active [$w index active] - set isCascade [string equal [$w type $active] "cascade"] + set activeindex [$w index active] + set isCascade [string equal [$w type $activeindex] "cascade"] # Only de-activate the active item if it's a cascade; this prevents # the annoying "activation flicker" you otherwise get with @@ -649,11 +654,11 @@ proc ::tk::MenuInvoke {w buttonRelease} { # but not recommended) if { !$isCascade } { - uplevel #0 [list $w invoke $active] + uplevel #0 [list $w invoke $activeindex] } } else { - set active [$w index active] - if {$Priv(popup) eq "" || $active ne "none"} { + set activeindex [$w index active] + if {($Priv(popup) eq "") || (($activeindex ne "none") && ($activeindex >= 0))} { MenuUnpost $w } uplevel #0 [list $w invoke active] @@ -797,7 +802,8 @@ proc ::tk::MenuNextMenu {menu direction} { if {[winfo class $mb] eq "Menubutton" \ && [$mb cget -state] ne "disabled" \ && [$mb cget -menu] ne "" \ - && [[$mb cget -menu] index last] ne "none"} { + && [[$mb cget -menu] index last] ne "none" \ + && [[$mb cget -menu] index last] >= 0} { break } if {$mb eq $w} { @@ -819,16 +825,17 @@ proc ::tk::MenuNextMenu {menu direction} { # -1 means go to the next higher entry. proc ::tk::MenuNextEntry {menu count} { - if {[$menu index last] eq "none"} { + set last [$menu index last] + if {($last eq "none") || ($last < 0)} { return } - set length [expr {[$menu index last]+1}] + set length [expr {$last+1}] set quitAfter $length - set active [$menu index active] - if {$active eq "none"} { + set activeindex [$menu index active] + if {($activeindex eq "none") || ($activeindex < 0)} { set i 0 } else { - set i [expr {$active + $count}] + set i [expr {$activeindex + $count}] } while {1} { if {$quitAfter <= 0} { @@ -850,7 +857,7 @@ proc ::tk::MenuNextEntry {menu count} { break } } - if {$i == $active} { + if {$i == $activeindex} { return } incr i $count @@ -903,13 +910,12 @@ proc ::tk::MenuFind {w char} { } set last [$child index last] for {set i [$child cget -tearoff]} {$i <= $last} {incr i} { - if {[$child type $i] eq "separator"} { + if {([$child type $i] eq "separator") || ([$child entrycget $i -state] eq "disabled")} { continue } - set char2 [string index [$child entrycget $i -label] \ - [$child entrycget $i -underline]] - if {$char eq [string tolower $char2] || $char eq ""} { - if {[$child entrycget $i -state] ne "disabled"} { + set underline [$child entrycget $i -underline] + if {$underline >= 0} { + if {$char eq [string tolower [string index [$child entrycget $i -label] $underline]]} { return $child } } @@ -941,7 +947,7 @@ proc ::tk::MenuFind {w char} { } } } - return "" + return {} } # ::tk::TraverseToMenu -- @@ -1068,7 +1074,8 @@ proc ::tk::MenuFirstEntry menu { return } tk_menuSetFocus $menu - if {[$menu index active] ne "none"} { + set activeindex [$menu index active] + if {($activeindex ne "none") && ($activeindex >= 0)} { return } set last [$menu index last] diff --git a/library/msgs/zh_cn.msg b/library/msgs/zh_cn.msg index 9a728b7b21..87dfe72f18 100644 --- a/library/msgs/zh_cn.msg +++ b/library/msgs/zh_cn.msg @@ -46,7 +46,7 @@ namespace eval ::tk { ::msgcat::mcset zh_cn "Invalid file name \"%1\$s\"." "无效的文件名 \"%1\$s\"。" ::msgcat::mcset zh_cn "Italic" "斜体" ::msgcat::mcset zh_cn "Log Files" "日志文件" - ::msgcat::mcset zh_cn "&No" "&取消" + ::msgcat::mcset zh_cn "&No" "&否" ::msgcat::mcset zh_cn "&OK" "&确定" ::msgcat::mcset zh_cn "OK" "确定" ::msgcat::mcset zh_cn "Ok" "确定" diff --git a/library/tearoff.tcl b/library/tearoff.tcl index 96e275f262..e52a45754b 100644 --- a/library/tearoff.tcl +++ b/library/tearoff.tcl @@ -31,10 +31,10 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} { # away when the toplevel goes away. if {$x == 0} { - set x [winfo rootx $w] + set x [winfo rootx $w] } if {$y == 0} { - set y [winfo rooty $w] + set y [winfo rooty $w] if {[tk windowingsystem] eq "aqua"} { # Shift by height of tearoff entry minus height of window titlebar catch {incr y [expr {[$w yposition 1] - 16}]} @@ -66,14 +66,14 @@ proc ::tk::TearOffMenu {w {x 0} {y 0}} { set parent [winfo parent $w] if {[$menu cget -title] ne ""} { - wm title $menu [$menu cget -title] + wm title $menu [$menu cget -title] } else { - switch -- [winfo class $parent] { + switch -- [winfo class $parent] { Menubutton { - wm title $menu [$parent cget -text] + wm title $menu [$parent cget -text] } Menu { - wm title $menu [$parent entrycget active -label] + wm title $menu [$parent entrycget active -label] } } } @@ -134,51 +134,24 @@ proc ::tk::MenuDup {src dst type} { lappend cmd [lindex $option 0] [lindex $option 4] } eval $cmd - set last [$src index last] - if {$last eq "none" || $last < 0} { - return - } - for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { - set cmd [list $dst add [$src type $i]] - foreach option [$src entryconfigure $i] { - lappend cmd [lindex $option 0] [lindex $option 4] - } - eval $cmd - } - # Duplicate the binding tags and bindings from the source menu. + # Copy the meny entries, if any - set tags [bindtags $src] - set srcLen [string length $src] - - # Copy tags to x, replacing each substring of src with dst. - - while {[set index [string first $src $tags]] >= 0} { - if {$index > 0} { - append x [string range $tags 0 $index-1]$dst + set last [$src index last] + if {$last ne "none"} { + for {set i [$src cget -tearoff]} {$i <= $last} {incr i} { + set cmd [list $dst add [$src type $i]] + foreach option [$src entryconfigure $i] { + lappend cmd [lindex $option 0] [lindex $option 4] + } + eval $cmd } - set tags [string range $tags $index+$srcLen end] } - append x $tags - - bindtags $dst $x - - foreach event [bind $src] { - unset x - set script [bind $src $event] - set eventLen [string length $event] - - # Copy script to x, replacing each substring of event with dst. - while {[set index [string first $event $script]] >= 0} { - if {$index > 0} { - append x [string range $script 0 $index-1] - } - append x $dst - set script [string range $script $index+$eventLen end] - } - append x $script + # Duplicate the binding tags from the source menu, replacing src with dst - bind $dst $event $x - } + set tags [bindtags $src] + set x [lsearch -exact $tags $src] + if {$x >= 0} {lset tags $x $dst} + bindtags $dst $tags } diff --git a/library/text.tcl b/library/text.tcl index 6cfe9d0e9b..60eab4178e 100644 --- a/library/text.tcl +++ b/library/text.tcl @@ -539,7 +539,11 @@ proc ::tk::TextClosestGap {w x y} { if {$bbox eq ""} { return $pos } - if {($x - [lindex $bbox 0]) < ([lindex $bbox 2]/2)} { + # The check on y coord of the line bbox with dlineinfo is to fix + # [a9cf210a42] to properly handle selecting and moving the mouse + # out of the widget. + if {$y < [lindex [$w dlineinfo $pos] 1] || + $x - [lindex $bbox 0] < [lindex $bbox 2]/2} { return $pos } $w index "$pos + 1 char" diff --git a/library/tk.tcl b/library/tk.tcl index 89267d66cc..7a7c29e922 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -11,7 +11,7 @@ # this file, and for a DISCLAIMER OF ALL WARRANTIES. # Verify that we have Tk binary and script components from the same release -package require -exact Tk 8.6.13 +package require -exact Tk 8.6.14 # Create a ::tk namespace namespace eval ::tk { @@ -178,16 +178,21 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} { catch {focus $oldFocus} grab release $grab - if {$destroy eq "withdraw"} { - wm withdraw $grab - } else { - destroy $grab + if {[winfo exists $grab]} { + if {$destroy eq "withdraw"} { + wm withdraw $grab + } else { + destroy $grab + } } if {[winfo exists $oldGrab] && [winfo ismapped $oldGrab]} { + # The "grab" command will fail if another application + # already holds the grab on a window with the same name. + # So catch it. See [7447ed20ec] for an example. if {$oldStatus eq "global"} { - grab -global $oldGrab + catch {grab -global $oldGrab} } else { - grab $oldGrab + catch {grab $oldGrab} } } } diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 0c3cc0c3f6..f034778822 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -226,7 +226,9 @@ proc ::tk::dialog::file:: {type args} { foreach trace [trace info variable data(selectPath)] { trace remove variable data(selectPath) {*}$trace } - $data(dirMenuBtn) configure -textvariable {} + if {[winfo exists $data(dirMenuBtn)]} { + $data(dirMenuBtn) configure -textvariable {} + } return $Priv(selectFilePath) } diff --git a/library/ttk/entry.tcl b/library/ttk/entry.tcl index 12080a3bec..a9938cdb7d 100644 --- a/library/ttk/entry.tcl +++ b/library/ttk/entry.tcl @@ -254,6 +254,10 @@ set ::ttk::entry::State(startNext) \ [string equal [tk windowingsystem] "win32"] proc ttk::entry::NextWord {w start} { + # the check on [winfo class] is because the spinbox and combobox also use this proc + if {[winfo class $w] eq "TEntry" && [$w cget -show] ne ""} { + return end + } variable State set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos >= 0 && $State(startNext)} { @@ -268,6 +272,10 @@ proc ttk::entry::NextWord {w start} { ## PrevWord -- Find the previous word position. # proc ttk::entry::PrevWord {w start} { + # the check on [winfo class] is because the spinbox and combobox also use this proc + if {[winfo class $w] eq "TEntry" && [$w cget -show] ne ""} { + return 0 + } set pos [tcl_startOfPreviousWord [$w get] [$w index $start]] if {$pos < 0} { return 0 diff --git a/library/ttk/fonts.tcl b/library/ttk/fonts.tcl index bf4ccd09ee..4f735a8beb 100644 --- a/library/ttk/fonts.tcl +++ b/library/ttk/fonts.tcl @@ -45,9 +45,6 @@ # There does not appear to be any recommendations for fixed-width fonts. # # X11: -# Need a way to tell if Xft is enabled or not. -# For now, assume patch #971980 applied. -# # "Classic" look used Helvetica bold for everything except # for entry widgets, which use Helvetica medium. # Most other toolkits use medium weight for all UI elements, diff --git a/library/ttk/menubutton.tcl b/library/ttk/menubutton.tcl index fc0ea023de..f98a5daa93 100644 --- a/library/ttk/menubutton.tcl +++ b/library/ttk/menubutton.tcl @@ -142,8 +142,7 @@ if {[tk windowingsystem] eq "aqua"} { incr y $bh # if we go offscreen to the bottom, show as 'above' if {($y + $mh) > ([winfo vrooty $mb] + [winfo vrootheight $mb])} { - set y [expr {[winfo vrooty $mb] + [winfo vrootheight $mb] \ - + [winfo rooty $mb] - $mh}] + set y [expr {[winfo vrooty $mb] + [winfo rooty $mb] - $mh}] } } left { diff --git a/library/ttk/notebook.tcl b/library/ttk/notebook.tcl index 518c6f53d5..c5e6d94f1b 100644 --- a/library/ttk/notebook.tcl +++ b/library/ttk/notebook.tcl @@ -81,9 +81,11 @@ proc ttk::notebook::MnemonicTab {nb key} { foreach tab [$nb tabs] { set label [$nb tab $tab -text] set underline [$nb tab $tab -underline] - set mnemonic [string toupper [string index $label $underline]] - if {$mnemonic ne "" && $mnemonic eq $key} { - return $tab + if {$underline >= 0} { + set mnemonic [string toupper [string index $label $underline]] + if {$mnemonic ne "" && $mnemonic eq $key} { + return $tab + } } } return "" diff --git a/macosx/README b/macosx/README index db51db2a6d..af6a65eaee 100644 --- a/macosx/README +++ b/macosx/README @@ -641,7 +641,7 @@ platforms, and the fix ultimately required changes in the generic Tk implementation (documented in the comments in the DisplayText function). -The Text widget attempts to improve perfomance when scrolling by +The Text widget attempts to improve performance when scrolling by minimizing the number of text lines which need to be redisplayed. It does this by calling the platform-specific TkScrollWindow function which uses a low-level routine to map one rectangle of the window to @@ -650,7 +650,7 @@ then used by the Text widget's DisplayText function to determine which text lines need to be redrawn. On the unix and win platforms, this damage region includes bounding rectangles for all embedded windows inside the Text widget. The way that this works is system dependent. -On unix, the low level scrolling is done by XCopyRegion, which +On unix, the low level scrolling is done by XCopyArea, which generates a GraphicsExpose event for each embedded window. These GraphicsExposed events are processsed within TkScrollWindow, using a special handler which adds the bounding rectangle of each subwindow to diff --git a/macosx/Tk.xcode/project.pbxproj b/macosx/Tk.xcode/project.pbxproj index c93b15be1d..8aa4c1f85c 100644 --- a/macosx/Tk.xcode/project.pbxproj +++ b/macosx/Tk.xcode/project.pbxproj @@ -596,7 +596,6 @@ F9FD32030CC1ADB70073837D /* tkUnixMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8808F27A3D005CB29B /* tkUnixMenu.c */; }; F9FD32040CC1ADB70073837D /* tkUnixConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */; }; F9FD32050CC1ADB70073837D /* tkUnixDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8008F27A3D005CB29B /* tkUnixDraw.c */; }; - F9FD32060CC1ADB70073837D /* tkUnixDialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */; }; F9FD32070CC1ADB70073837D /* tkUnixSelect.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8E08F27A3D005CB29B /* tkUnixSelect.c */; }; F9FD32080CC1ADB70073837D /* tkUnixEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8208F27A3D005CB29B /* tkUnixEvent.c */; }; F9FD32090CC1ADB70073837D /* tkUnixColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7B08F27A3D005CB29B /* tkUnixColor.c */; }; @@ -1189,7 +1188,6 @@ F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixConfig.c; sourceTree = ""; }; F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixCursor.c; sourceTree = ""; }; F966BC7E08F27A3D005CB29B /* tkUnixDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUnixDefault.h; sourceTree = ""; }; - F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixDialog.c; sourceTree = ""; }; F966BC8008F27A3D005CB29B /* tkUnixDraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixDraw.c; sourceTree = ""; }; F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixEmbed.c; sourceTree = ""; }; F966BC8208F27A3D005CB29B /* tkUnixEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixEvent.c; sourceTree = ""; }; @@ -2758,7 +2756,6 @@ F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */, F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */, F966BC7E08F27A3D005CB29B /* tkUnixDefault.h */, - F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */, F966BC8008F27A3D005CB29B /* tkUnixDraw.c */, F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */, F966BC8208F27A3D005CB29B /* tkUnixEvent.c */, @@ -4644,7 +4641,6 @@ F9FD32090CC1ADB70073837D /* tkUnixColor.c in Sources */, F9FD32040CC1ADB70073837D /* tkUnixConfig.c in Sources */, F9FD31F80CC1ADB70073837D /* tkUnixCursor.c in Sources */, - F9FD32060CC1ADB70073837D /* tkUnixDialog.c in Sources */, F9FD32050CC1ADB70073837D /* tkUnixDraw.c in Sources */, F9FD31FD0CC1ADB70073837D /* tkUnixEmbed.c in Sources */, F9FD32080CC1ADB70073837D /* tkUnixEvent.c in Sources */, diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index 10a9c9a5ea..31678d8ce2 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -596,7 +596,6 @@ F9FD32030CC1ADB70073837D /* tkUnixMenu.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8808F27A3D005CB29B /* tkUnixMenu.c */; }; F9FD32040CC1ADB70073837D /* tkUnixConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */; }; F9FD32050CC1ADB70073837D /* tkUnixDraw.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8008F27A3D005CB29B /* tkUnixDraw.c */; }; - F9FD32060CC1ADB70073837D /* tkUnixDialog.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */; }; F9FD32070CC1ADB70073837D /* tkUnixSelect.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8E08F27A3D005CB29B /* tkUnixSelect.c */; }; F9FD32080CC1ADB70073837D /* tkUnixEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC8208F27A3D005CB29B /* tkUnixEvent.c */; }; F9FD32090CC1ADB70073837D /* tkUnixColor.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BC7B08F27A3D005CB29B /* tkUnixColor.c */; }; @@ -1189,7 +1188,6 @@ F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixConfig.c; sourceTree = ""; }; F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixCursor.c; sourceTree = ""; }; F966BC7E08F27A3D005CB29B /* tkUnixDefault.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkUnixDefault.h; sourceTree = ""; }; - F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixDialog.c; sourceTree = ""; }; F966BC8008F27A3D005CB29B /* tkUnixDraw.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixDraw.c; sourceTree = ""; }; F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixEmbed.c; sourceTree = ""; }; F966BC8208F27A3D005CB29B /* tkUnixEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkUnixEvent.c; sourceTree = ""; }; @@ -2758,7 +2756,6 @@ F966BC7C08F27A3D005CB29B /* tkUnixConfig.c */, F966BC7D08F27A3D005CB29B /* tkUnixCursor.c */, F966BC7E08F27A3D005CB29B /* tkUnixDefault.h */, - F966BC7F08F27A3D005CB29B /* tkUnixDialog.c */, F966BC8008F27A3D005CB29B /* tkUnixDraw.c */, F966BC8108F27A3D005CB29B /* tkUnixEmbed.c */, F966BC8208F27A3D005CB29B /* tkUnixEvent.c */, @@ -4647,7 +4644,6 @@ F9FD32090CC1ADB70073837D /* tkUnixColor.c in Sources */, F9FD32040CC1ADB70073837D /* tkUnixConfig.c in Sources */, F9FD31F80CC1ADB70073837D /* tkUnixCursor.c in Sources */, - F9FD32060CC1ADB70073837D /* tkUnixDialog.c in Sources */, F9FD32050CC1ADB70073837D /* tkUnixDraw.c in Sources */, F9FD31FD0CC1ADB70073837D /* tkUnixEmbed.c in Sources */, F9FD32080CC1ADB70073837D /* tkUnixEvent.c in Sources */, diff --git a/macosx/configure b/macosx/configure index 678b27d8ce..5ab1b17f52 100755 --- a/macosx/configure +++ b/macosx/configure @@ -1,459 +1,81 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tk 8.6. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# +# Generated by GNU Autoconf 2.59 for tk 8.6. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + $as_unset $as_var fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error +done -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi -as_me=`$as_basename -- "$0" || +# Name of the executable. +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -461,91 +83,146 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + as_expr=false fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' else - as_ln_s='cp -pR' + as_ln_s='ln -s' fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_test_x='test -x' -as_executable_p=as_fn_executable_p +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -554,25 +231,38 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -test -n "$DJDIR" || exec 7<&0 &1 +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + # Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +exec 6>&1 + # # Initializations. # ac_default_prefix=/usr/local -ac_clean_files= ac_config_libobj_dir=. -LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='tk' @@ -580,223 +270,50 @@ PACKAGE_TARNAME='tk' PACKAGE_VERSION='8.6' PACKAGE_STRING='tk 8.6' PACKAGE_BUGREPORT='' -PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include -#ifdef HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H # include #endif -#ifdef STDC_HEADERS +#if STDC_HEADERS # include # include #else -# ifdef HAVE_STDLIB_H +# if HAVE_STDLIB_H # include # endif #endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H # include #endif -#ifdef HAVE_INTTYPES_H +#if HAVE_INTTYPES_H # include +#else +# if HAVE_STDINT_H +# include +# endif #endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif" -ac_subst_vars='LTLIBOBJS -REZ_FLAGS -REZ -APP_RSRC_FILE -LIB_RSRC_FILE -WISH_RSRC_FILE -TK_RSRC_FILE -CFBUNDLELOCALIZATIONS -EXTRA_WISH_LIBS -EXTRA_BUILD_HTML -EXTRA_INSTALL_BINARIES -EXTRA_INSTALL -EXTRA_APP_CC_SWITCHES -EXTRA_CC_SWITCHES -HTML_DIR -PRIVATE_INCLUDE_DIR -LIB_RUNTIME_DIR -TK_LIBRARY -TK_PKG_DIR -TK_WINDOWINGSYSTEM -LOCALES -XLIBSW -XINCLUDES -TCL_STUB_FLAGS -TK_BUILD_LIB_SPEC -LD_LIBRARY_PATH_VAR -TK_SHARED_BUILD -TK_SRC_DIR -TK_BUILD_STUB_LIB_PATH -TK_BUILD_STUB_LIB_SPEC -TK_INCLUDE_SPEC -TK_STUB_LIB_PATH -TK_STUB_LIB_SPEC -TK_STUB_LIB_FLAG -TK_STUB_LIB_FILE -TK_LIB_SPEC -TK_LIB_FLAG -TK_LIB_FILE -TK_YEAR -TK_PATCH_LEVEL -TK_MINOR_VERSION -TK_MAJOR_VERSION -TK_VERSION -UNIX_FONT_OBJS -XFT_LIBS -XFT_CFLAGS -XMKMF -LDFLAGS_DEFAULT -CFLAGS_DEFAULT -INSTALL_STUB_LIB -DLL_INSTALL_DIR -INSTALL_LIB -MAKE_STUB_LIB -MAKE_LIB -SHLIB_SUFFIX -SHLIB_CFLAGS -SHLIB_LD_LIBS -TK_SHLIB_LD_EXTRAS -TCL_SHLIB_LD_EXTRAS -SHLIB_LD -STLIB_LD -LD_SEARCH_FLAGS -CC_SEARCH_FLAGS -LDFLAGS_OPTIMIZE -LDFLAGS_DEBUG -CFLAGS_NOLTO -CFLAGS_WARNING -CFLAGS_OPTIMIZE -CFLAGS_DEBUG -LDAIX_SRC -PLAT_SRCS -PLAT_OBJS -DL_OBJS -DL_LIBS -TCL_LIBS -LIBOBJS -AR -RANLIB -SHARED_BUILD -TCL_THREADS -EGREP -GREP -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -MAN_FLAGS -BUILD_TCLSH -TCLSH_PROG -TCL_STUB_LIB_SPEC -TCL_STUB_LIB_FLAG -TCL_STUB_LIB_FILE -TCL_LIB_SPEC -TCL_LIB_FLAG -TCL_LIB_FILE -TCL_SRC_DIR -TCL_BIN_DIR -TCL_PATCH_LEVEL -TCL_VERSION -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS TCL_VERSION TCL_PATCH_LEVEL TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCLSH_PROG BUILD_TCLSH MAN_FLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP TCL_THREADS SHARED_BUILD RANLIB ac_ct_RANLIB AR ac_ct_AR LIBOBJS TCL_LIBS DL_LIBS DL_OBJS PLAT_OBJS PLAT_SRCS LDAIX_SRC CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING CFLAGS_NOLTO LDFLAGS_DEBUG LDFLAGS_OPTIMIZE CC_SEARCH_FLAGS LD_SEARCH_FLAGS STLIB_LD SHLIB_LD TCL_SHLIB_LD_EXTRAS TK_SHLIB_LD_EXTRAS SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX MAKE_LIB MAKE_STUB_LIB INSTALL_LIB DLL_INSTALL_DIR INSTALL_STUB_LIB CFLAGS_DEFAULT LDFLAGS_DEFAULT XFT_CFLAGS XFT_LIBS UNIX_FONT_OBJS TK_VERSION TK_MAJOR_VERSION TK_MINOR_VERSION TK_PATCH_LEVEL TK_YEAR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_STUB_LIB_PATH TK_INCLUDE_SPEC TK_BUILD_STUB_LIB_SPEC TK_BUILD_STUB_LIB_PATH TK_SRC_DIR TK_SHARED_BUILD LD_LIBRARY_PATH_VAR TK_BUILD_LIB_SPEC TCL_STUB_FLAGS XINCLUDES XLIBSW LOCALES TK_WINDOWINGSYSTEM TK_PKG_DIR TK_LIBRARY LIB_RUNTIME_DIR PRIVATE_INCLUDE_DIR HTML_DIR EXTRA_CC_SWITCHES EXTRA_APP_CC_SWITCHES EXTRA_INSTALL EXTRA_INSTALL_BINARIES EXTRA_BUILD_HTML EXTRA_WISH_LIBS CFBUNDLELOCALIZATIONS TK_RSRC_FILE WISH_RSRC_FILE LIB_RSRC_FILE APP_RSRC_FILE REZ REZ_FLAGS LTLIBOBJS' ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_tcl -enable_man_symlinks -enable_man_compression -enable_man_suffix -enable_threads -enable_shared -enable_64bit -enable_64bit_vis -enable_rpath -enable_corefoundation -enable_load -enable_symbols -enable_aqua -with_x -enable_xft -enable_xss -enable_framework -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -XMKMF' - # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -819,49 +336,34 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' +datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' +infodir='${prefix}/info' +mandir='${prefix}/man' ac_prev= -ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option + eval "$ac_prev=\$ac_option" ac_prev= continue fi - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -883,59 +385,33 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad) + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) datadir=$ac_optarg ;; - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; esac - eval enable_$ac_useropt=\$ac_optarg ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -962,12 +438,6 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -992,16 +462,13 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -1066,16 +533,6 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -1126,36 +583,26 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; esac - eval with_$ac_useropt=\$ac_optarg ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -1175,26 +622,27 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1202,36 +650,31 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - eval ac_val=\$$ac_var - # Remove trailing slashes. + eval ac_val=$`echo $ac_var` case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - # Be sure to have absolute directory names. +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1245,6 +688,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1256,72 +701,74 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then + if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP # # Report the --help message. @@ -1344,17 +791,20 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] +_ACEOF + + cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1364,25 +814,18 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/tk] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF @@ -1400,7 +843,6 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-man-symlinks use symlinks for the manpages (default: off) @@ -1437,537 +879,160 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory CPP C preprocessor - XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to the package provider. _ACEOF -ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. + ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d $ac_dir || continue ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir done fi -test -n "$ac_init_help" && exit $ac_status +test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF tk configure 8.6 -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.59 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit + exit 0 fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by tk $as_me 8.6, which was +generated by GNU Autoconf 2.59. Invocation command line was -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## + $ $0 $@ -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () +_ACEOF { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -} # ac_fn_c_try_compile +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval +_ASUNAME -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by tk $as_me 8.6, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done } >&5 @@ -1989,6 +1054,7 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= +ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1999,13 +1065,13 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) - as_fn_append ac_configure_args1 " '$ac_arg'" + ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -2021,115 +1087,104 @@ do -* ) ac_must_keep_next=true ;; esac fi - as_fn_append ac_configure_args " '$ac_arg'" + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " ;; esac done done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + cat <<\_ASBOX +## ---------------- ## ## Cache variables. ## -## ---------------- ##" +## ---------------- ## +_ASBOX echo # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done +{ (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) + esac; +} echo - $as_echo "## ----------------- ## + cat <<\_ASBOX +## ----------------- ## ## Output variables. ## -## ----------------- ##" +## ----------------- ## +_ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + cat <<\_ASBOX +## ----------- ## ## confdefs.h. ## -## ----------- ##" +## ----------- ## +_ASBOX echo - cat confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 + ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h # Predefined preprocessor variables. @@ -2137,137 +1192,112 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } + . "$ac_site_file" fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2279,7 +1309,34 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - ac_config_headers="$ac_config_headers tkConfig.h:../unix/tkConfig.h.in" + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers tkConfig.h:../unix/tkConfig.h.in" + + @@ -2289,7 +1346,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu TK_VERSION=8.6 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=6 -TK_PATCH_LEVEL=".13" +TK_PATCH_LEVEL=".14" VERSION=${TK_VERSION} LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" @@ -2308,15 +1365,15 @@ LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv" # we reset no_tcl in case something fails here no_tcl=true -# Check whether --with-tcl was given. -if test "${with_tcl+set}" = set; then : - withval=$with_tcl; with_tclconfig="${withval}" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 -$as_echo_n "checking for Tcl configuration... " >&6; } - if ${ac_cv_c_tclconfig+:} false; then : - $as_echo_n "(cached) " >&6 +# Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + with_tclconfig="${withval}" +fi; + echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 + if test "${ac_cv_c_tclconfig+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2325,15 +1382,17 @@ else case "${with_tclconfig}" in */tclConfig.sh ) if test -f "${with_tclconfig}"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 -$as_echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} + { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 +echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" else - as_fn_error $? "${with_tclconfig} directory doesn't contain tclConfig.sh" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} + { (exit 1); exit 1; }; } fi fi @@ -2412,26 +1471,28 @@ fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" - as_fn_error $? "Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" >&5 +echo "$as_me: error: Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh" >&2;} + { (exit 1); exit 1; }; } else no_tcl= TCL_BIN_DIR="${ac_cv_c_tclconfig}" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 -$as_echo "found ${TCL_BIN_DIR}/tclConfig.sh" >&6; } + echo "$as_me:$LINENO: result: found ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}found ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 -$as_echo_n "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... " >&6; } + echo "$as_me:$LINENO: checking for existence of ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of ${TCL_BIN_DIR}/tclConfig.sh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5 -$as_echo "loading" >&6; } + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 . "${TCL_BIN_DIR}/tclConfig.sh" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 -$as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } + echo "$as_me:$LINENO: result: could not find ${TCL_BIN_DIR}/tclConfig.sh" >&5 +echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6 fi # If the TCL_BIN_DIR is the build directory (not the install directory), @@ -2482,19 +1543,25 @@ $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } if test "${TCL_MAJOR_VERSION}" -ne 8 ; then - as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}" >&5 +echo "$as_me: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}" >&2;} + { (exit 1); exit 1; }; } fi if test "${TCL_MINOR_VERSION}" -lt 6 ; then - as_fn_error $? "${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ -Found config for Tcl ${TCL_VERSION}" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}" >&5 +echo "$as_me: error: ${PACKAGE_NAME} ${PACKAGE_VERSION} requires Tcl 8.6+ +Found config for Tcl ${TCL_VERSION}" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 -$as_echo_n "checking for tclsh... " >&6; } - if ${ac_cv_path_tclsh+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for tclsh" >&5 +echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 + if test "${ac_cv_path_tclsh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else search_path=`echo ${PATH} | sed -e 's/:/ /g'` @@ -2515,22 +1582,22 @@ fi if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLSH_PROG" >&5 -$as_echo "$TCLSH_PROG" >&6; } + echo "$as_me:$LINENO: result: $TCLSH_PROG" >&5 +echo "${ECHO_T}$TCLSH_PROG" >&6 else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: No tclsh found on PATH" >&5 -$as_echo "No tclsh found on PATH" >&6; } + echo "$as_me:$LINENO: result: No tclsh found on PATH" >&5 +echo "${ECHO_T}No tclsh found on PATH" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh in Tcl build directory" >&5 -$as_echo_n "checking for tclsh in Tcl build directory... " >&6; } + echo "$as_me:$LINENO: checking for tclsh in Tcl build directory" >&5 +echo $ECHO_N "checking for tclsh in Tcl build directory... $ECHO_C" >&6 BUILD_TCLSH="${TCL_BIN_DIR}"/tclsh - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_TCLSH" >&5 -$as_echo "$BUILD_TCLSH" >&6; } + echo "$as_me:$LINENO: result: $BUILD_TCLSH" >&5 +echo "${ECHO_T}$BUILD_TCLSH" >&6 @@ -2553,60 +1620,62 @@ TK_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use symlinks for manpages" >&5 -$as_echo_n "checking whether to use symlinks for manpages... " >&6; } - # Check whether --enable-man-symlinks was given. -if test "${enable_man_symlinks+set}" = set; then : - enableval=$enable_man_symlinks; test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" + echo "$as_me:$LINENO: checking whether to use symlinks for manpages" >&5 +echo $ECHO_N "checking whether to use symlinks for manpages... $ECHO_C" >&6 + # Check whether --enable-man-symlinks or --disable-man-symlinks was given. +if test "${enable_man_symlinks+set}" = set; then + enableval="$enable_man_symlinks" + test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" else enableval="no" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -$as_echo "$enableval" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compress the manpages" >&5 -$as_echo_n "checking whether to compress the manpages... " >&6; } - # Check whether --enable-man-compression was given. -if test "${enable_man_compression+set}" = set; then : - enableval=$enable_man_compression; case $enableval in - yes) as_fn_error $? "missing argument to --enable-man-compression" "$LINENO" 5;; +fi; + echo "$as_me:$LINENO: result: $enableval" >&5 +echo "${ECHO_T}$enableval" >&6 + + echo "$as_me:$LINENO: checking whether to compress the manpages" >&5 +echo $ECHO_N "checking whether to compress the manpages... $ECHO_C" >&6 + # Check whether --enable-man-compression or --disable-man-compression was given. +if test "${enable_man_compression+set}" = set; then + enableval="$enable_man_compression" + case $enableval in + yes) { { echo "$as_me:$LINENO: error: missing argument to --enable-man-compression" >&5 +echo "$as_me: error: missing argument to --enable-man-compression" >&2;} + { (exit 1); exit 1; }; };; no) ;; *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; esac else enableval="no" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -$as_echo "$enableval" >&6; } +fi; + echo "$as_me:$LINENO: result: $enableval" >&5 +echo "${ECHO_T}$enableval" >&6 if test "$enableval" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compressed file suffix" >&5 -$as_echo_n "checking for compressed file suffix... " >&6; } + echo "$as_me:$LINENO: checking for compressed file suffix" >&5 +echo $ECHO_N "checking for compressed file suffix... $ECHO_C" >&6 touch TeST $enableval TeST Z=`ls TeST* | sed 's/^....//'` rm -f TeST* MAN_FLAGS="$MAN_FLAGS --extension $Z" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $Z" >&5 -$as_echo "$Z" >&6; } + echo "$as_me:$LINENO: result: $Z" >&5 +echo "${ECHO_T}$Z" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to add a package name suffix for the manpages" >&5 -$as_echo_n "checking whether to add a package name suffix for the manpages... " >&6; } - # Check whether --enable-man-suffix was given. -if test "${enable_man_suffix+set}" = set; then : - enableval=$enable_man_suffix; case $enableval in + echo "$as_me:$LINENO: checking whether to add a package name suffix for the manpages" >&5 +echo $ECHO_N "checking whether to add a package name suffix for the manpages... $ECHO_C" >&6 + # Check whether --enable-man-suffix or --disable-man-suffix was given. +if test "${enable_man_suffix+set}" = set; then + enableval="$enable_man_suffix" + case $enableval in yes) enableval="tk" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; no) ;; *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; esac else enableval="no" -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 -$as_echo "$enableval" >&6; } +fi; + echo "$as_me:$LINENO: result: $enableval" >&5 +echo "${ECHO_T}$enableval" >&6 @@ -2629,10 +1698,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2642,37 +1711,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2682,50 +1749,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2735,96 +1791,134 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - - fi fi -if test -z "$CC"; then +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else - ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2834,41 +1928,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2878,78 +1970,66 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CC" && break done - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2961,108 +2041,112 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext break;; * ) break;; esac done -test "$ac_cv_exeext" = no && ac_cv_exeext= - else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } + ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3070,90 +2154,38 @@ $as_echo "$ac_try_echo"; } >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext break;; * ) break;; esac done else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3165,46 +2197,45 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3218,65 +2249,55 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_compiler_gnu=yes else - ac_compiler_gnu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3287,18 +2308,39 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3314,18 +2356,23 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_c89=no + ac_cv_prog_cc_stdc=no ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include -struct stat; +#include +#include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3348,17 +2395,12 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get + as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ + that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -3373,37 +2415,205 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break +rm -f conftest.err conftest.$ac_objext done -rm -f conftest.$ac_ext +rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3411,14 +2621,18 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; @@ -3427,16 +2641,41 @@ $ac_kw foo_t foo () {return 0; } #endif _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 + case $ac_cv_c_inline in inline | yes) ;; @@ -3464,15 +2703,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3486,7 +2725,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -3495,34 +2738,78 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then break fi @@ -3534,8 +2821,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3545,7 +2832,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -3554,40 +2845,85 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c @@ -3597,142 +2933,31 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -3747,23 +2972,51 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - + $EGREP "memchr" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -3773,14 +3026,18 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - + $EGREP "free" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -3790,13 +3047,16 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes; then : else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3816,39 +3076,109 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - return 2; - return 0; + exit(2); + exit (0); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -3856,48 +3186,196 @@ fi done -ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking stdlib.h usability" >&5 +echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking stdlib.h presence" >&5 +echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for stdlib.h" >&5 +echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_stdlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_stdlib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 + +fi +if test $ac_cv_header_stdlib_h = yes; then tk_ok=1 else tk_ok=0 fi -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtol" >/dev/null 2>&1; then : - + $EGREP "strtol" >/dev/null 2>&1; then + : else tk_ok=0 fi rm -f conftest* -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtoul" >/dev/null 2>&1; then : - + $EGREP "strtoul" >/dev/null 2>&1; then + : else tk_ok=0 fi rm -f conftest* -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "strtod" >/dev/null 2>&1; then : - + $EGREP "strtod" >/dev/null 2>&1; then + : else tk_ok=0 fi @@ -3905,7 +3383,9 @@ rm -f conftest* if test $tk_ok = 0; then -$as_echo "#define NO_STDLIB_H 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NO_STDLIB_H 1 +_ACEOF fi @@ -3915,14 +3395,18 @@ fi #------------------------------------------------------------------------ if test -z "$no_pipe" && test -n "$GCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler understands -pipe" >&5 -$as_echo_n "checking if the compiler understands -pipe... " >&6; } -if ${tcl_cv_cc_pipe+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 +echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 +if test "${tcl_cv_cc_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3933,16 +3417,40 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_cc_pipe=yes else - tcl_cv_cc_pipe=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_pipe=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_pipe" >&5 -$as_echo "$tcl_cv_cc_pipe" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_cc_pipe" >&5 +echo "${ECHO_T}$tcl_cv_cc_pipe" >&6 if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi @@ -3953,13 +3461,13 @@ fi #------------------------------------------------------------------------ - # Check whether --enable-threads was given. -if test "${enable_threads+set}" = set; then : - enableval=$enable_threads; tcl_ok=$enableval + # Check whether --enable-threads or --disable-threads was given. +if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval else tcl_ok=yes -fi - +fi; if test "${TCL_THREADS}" = 1; then tcl_threaded_core=1; @@ -3970,56 +3478,92 @@ fi # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention -$as_echo "#define USE_THREAD_ALLOC 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define USE_THREAD_ALLOC 1 +_ACEOF -$as_echo "#define _REENTRANT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF if test "`uname -s`" = "SunOS" ; then -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF fi -$as_echo "#define _THREAD_SAFE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _THREAD_SAFE 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 -$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { -return pthread_mutex_init (); +pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_mutex_init=yes else - ac_cv_lib_pthread_pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no @@ -4031,43 +3575,71 @@ fi # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_mutex_init in -lpthread" >&5 -$as_echo_n "checking for __pthread_mutex_init in -lpthread... " >&6; } -if ${ac_cv_lib_pthread___pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 +echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char __pthread_mutex_init (); int main () { -return __pthread_mutex_init (); +__pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_pthread___pthread_mutex_init=yes else - ac_cv_lib_pthread___pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthread___pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_pthread___pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread___pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 +if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no @@ -4079,43 +3651,71 @@ fi # The space is needed THREADS_LIBS=" -lpthread" else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthreads" >&5 -$as_echo_n "checking for pthread_mutex_init in -lpthreads... " >&6; } -if ${ac_cv_lib_pthreads_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 +if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { -return pthread_mutex_init (); +pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_pthreads_pthread_mutex_init=yes else - ac_cv_lib_pthreads_pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pthreads_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_pthreads_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthreads_pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 +if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no @@ -4125,86 +3725,142 @@ fi # The space is needed THREADS_LIBS=" -lpthreads" else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc" >&5 -$as_echo_n "checking for pthread_mutex_init in -lc... " >&6; } -if ${ac_cv_lib_c_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { -return pthread_mutex_init (); +pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_c_pthread_mutex_init=yes else - ac_cv_lib_c_pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_c_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_c_pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lc_r" >&5 -$as_echo_n "checking for pthread_mutex_init in -lc_r... " >&6; } -if ${ac_cv_lib_c_r_pthread_mutex_init+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 +echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 +if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { -return pthread_mutex_init (); +pthread_mutex_init (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_c_r_pthread_mutex_init=yes else - ac_cv_lib_c_r_pthread_mutex_init=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_r_pthread_mutex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_c_r_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_c_r_pthread_mutex_init" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 +if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no @@ -4215,8 +3871,8 @@ fi THREADS_LIBS=" -pthread" else TCL_THREADS=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&5 -$as_echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&2;} + { echo "$as_me:$LINENO: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&5 +echo "$as_me: WARNING: Don't know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..." >&2;} fi fi fi @@ -4227,69 +3883,164 @@ $as_echo "$as_me: WARNING: Don't know how to find pthread lib on your system - y ac_saved_libs=$LIBS LIBS="$LIBS $THREADS_LIBS" - for ac_func in pthread_attr_setstacksize pthread_atfork -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - LIBS=$ac_saved_libs - else - TCL_THREADS=0 - fi - # Do checking message here to not mess up interleaved configure output - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for building with threads" >&5 -$as_echo_n "checking for building with threads... " >&6; } - if test "${TCL_THREADS}" = 1; then -$as_echo "#define TCL_THREADS 1" >>confdefs.h - if test "${tcl_threaded_core}" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (threaded core)" >&5 -$as_echo "yes (threaded core)" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - - - - -# Add the threads support libraries -LIBS="$LIBS$THREADS_LIBS" - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to build libraries" >&5 -$as_echo_n "checking how to build libraries... " >&6; } - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; tcl_ok=$enableval +for ac_func in pthread_attr_setstacksize pthread_atfork +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - tcl_ok=yes -fi + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func - if test "$tcl_ok" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared" >&5 -$as_echo "shared" >&6; } - SHARED_BUILD=1 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5 -$as_echo "static" >&6; } - SHARED_BUILD=0 +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -$as_echo "#define STATIC_BUILD 1" >>confdefs.h +#ifdef __STDC__ +# include +#else +# include +#endif - fi +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + LIBS=$ac_saved_libs + else + TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + echo "$as_me:$LINENO: checking for building with threads" >&5 +echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 + if test "${TCL_THREADS}" = 1; then + +cat >>confdefs.h <<\_ACEOF +#define TCL_THREADS 1 +_ACEOF + + if test "${tcl_threaded_core}" = 1; then + echo "$as_me:$LINENO: result: yes (threaded core)" >&5 +echo "${ECHO_T}yes (threaded core)" >&6 + else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + fi + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi + + + + +# Add the threads support libraries +LIBS="$LIBS$THREADS_LIBS" + + + echo "$as_me:$LINENO: checking how to build libraries" >&5 +echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 + # Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval +else + tcl_ok=yes +fi; + if test "$tcl_ok" = "yes" ; then + echo "$as_me:$LINENO: result: shared" >&5 +echo "${ECHO_T}shared" >&6 + SHARED_BUILD=1 + else + echo "$as_me:$LINENO: result: static" >&5 +echo "${ECHO_T}static" >&6 + SHARED_BUILD=0 + +cat >>confdefs.h <<\_ACEOF +#define STATIC_BUILD 1 +_ACEOF + + fi @@ -4302,10 +4053,10 @@ $as_echo "#define STATIC_BUILD 1" >>confdefs.h if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4315,37 +4066,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -4355,38 +4104,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi + RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi @@ -4395,47 +4134,52 @@ fi # Step 0.a: Enable 64 bit support? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit support is requested" >&5 -$as_echo_n "checking if 64bit support is requested... " >&6; } - # Check whether --enable-64bit was given. -if test "${enable_64bit+set}" = set; then : - enableval=$enable_64bit; do64bit=$enableval + echo "$as_me:$LINENO: checking if 64bit support is requested" >&5 +echo $ECHO_N "checking if 64bit support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit or --disable-64bit was given. +if test "${enable_64bit+set}" = set; then + enableval="$enable_64bit" + do64bit=$enableval else do64bit=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bit" >&5 -$as_echo "$do64bit" >&6; } +fi; + echo "$as_me:$LINENO: result: $do64bit" >&5 +echo "${ECHO_T}$do64bit" >&6 # Step 0.b: Enable Solaris 64 bit VIS support? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 64bit Sparc VIS support is requested" >&5 -$as_echo_n "checking if 64bit Sparc VIS support is requested... " >&6; } - # Check whether --enable-64bit-vis was given. -if test "${enable_64bit_vis+set}" = set; then : - enableval=$enable_64bit_vis; do64bitVIS=$enableval + echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 +echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 + # Check whether --enable-64bit-vis or --disable-64bit-vis was given. +if test "${enable_64bit_vis+set}" = set; then + enableval="$enable_64bit_vis" + do64bitVIS=$enableval else do64bitVIS=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $do64bitVIS" >&5 -$as_echo "$do64bitVIS" >&6; } +fi; + echo "$as_me:$LINENO: result: $do64bitVIS" >&5 +echo "${ECHO_T}$do64bitVIS" >&6 # Force 64bit on with VIS - if test "$do64bitVIS" = "yes"; then : + if test "$do64bitVIS" = "yes"; then do64bit=yes fi + # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports visibility \"hidden\"" >&5 -$as_echo_n "checking if compiler supports visibility \"hidden\"... " >&6; } -if ${tcl_cv_cc_visibility_hidden+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if compiler supports visibility \"hidden\"" >&5 +echo $ECHO_N "checking if compiler supports visibility \"hidden\"... $ECHO_C" >&6 +if test "${tcl_cv_cc_visibility_hidden+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern __attribute__((__visibility__("hidden"))) void f(void); @@ -4448,50 +4192,79 @@ f(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_cc_visibility_hidden=yes else - tcl_cv_cc_visibility_hidden=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_visibility_hidden=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_visibility_hidden" >&5 -$as_echo "$tcl_cv_cc_visibility_hidden" >&6; } - if test $tcl_cv_cc_visibility_hidden = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_visibility_hidden" >&5 +echo "${ECHO_T}$tcl_cv_cc_visibility_hidden" >&6 + if test $tcl_cv_cc_visibility_hidden = yes; then -$as_echo "#define MODULE_SCOPE extern __attribute__((__visibility__(\"hidden\")))" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define MODULE_SCOPE extern __attribute__((__visibility__("hidden"))) +_ACEOF -$as_echo "#define HAVE_HIDDEN 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_HIDDEN 1 +_ACEOF fi + # Step 0.d: Disable -rpath support? - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rpath support is requested" >&5 -$as_echo_n "checking if rpath support is requested... " >&6; } - # Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; doRpath=$enableval + echo "$as_me:$LINENO: checking if rpath support is requested" >&5 +echo $ECHO_N "checking if rpath support is requested... $ECHO_C" >&6 + # Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" + doRpath=$enableval else doRpath=yes -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $doRpath" >&5 -$as_echo "$doRpath" >&6; } +fi; + echo "$as_me:$LINENO: result: $doRpath" >&5 +echo "${ECHO_T}$doRpath" >&6 # Step 1: set the variable "system" to hold the name and version number # for the system. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking system version" >&5 -$as_echo_n "checking system version... " >&6; } -if ${tcl_cv_sys_version+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking system version" >&5 +echo $ECHO_N "checking system version... $ECHO_C" >&6 +if test "${tcl_cv_sys_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -f /usr/lib/NextStep/software_version; then @@ -4499,8 +4272,8 @@ else else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find uname command" >&5 -$as_echo "$as_me: WARNING: can't find uname command" >&2;} + { echo "$as_me:$LINENO: WARNING: can't find uname command" >&5 +echo "$as_me: WARNING: can't find uname command" >&2;} tcl_cv_sys_version=unknown else # Special check for weird MP-RAS system (uname returns weird @@ -4519,51 +4292,79 @@ $as_echo "$as_me: WARNING: can't find uname command" >&2;} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_sys_version" >&5 -$as_echo "$tcl_cv_sys_version" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_sys_version" >&5 +echo "${ECHO_T}$tcl_cv_sys_version" >&6 system=$tcl_cv_sys_version # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -return dlopen (); +dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else - ac_cv_lib_dl_dlopen=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no @@ -4589,7 +4390,7 @@ fi ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g - if test "$GCC" = yes; then : + if test "$GCC" = yes; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wpointer-arith" @@ -4600,13 +4401,14 @@ else CFLAGS_WARNING="" fi + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4616,37 +4418,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. @@ -4656,38 +4456,27 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi + AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi @@ -4697,14 +4486,15 @@ fi PLAT_OBJS="" PLAT_SRCS="" LDAIX_SRC="" - if test "x${SHLIB_VERSION}" = x; then : + if test "x${SHLIB_VERSION}" = x; then SHLIB_VERSION=".1.0" else SHLIB_VERSION=".${SHLIB_VERSION}" fi + case $system in AIX-*) - if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then : + if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in @@ -4716,10 +4506,11 @@ fi CC=`echo "$CC" | sed -e 's/^\([^ ]*\)/\1_r/'` ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $CC for compiling with threads" >&5 -$as_echo "Using $CC for compiling with threads" >&6; } + echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 +echo "${ECHO_T}Using $CC for compiling with threads" >&6 fi + LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" @@ -4732,12 +4523,12 @@ fi LDAIX_SRC='$(UNIX_DIR)/ldAix' # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then : + if test "$do64bit" = yes; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else @@ -4750,15 +4541,17 @@ else fi + fi - if test "`uname -m`" = ia64; then : + + if test "`uname -m`" = ia64; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" - if test "$GCC" = yes; then : + if test "$GCC" = yes; then CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -4767,11 +4560,12 @@ else CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' else - if test "$GCC" = yes; then : + if test "$GCC" = yes; then SHLIB_LD='${CC} -shared -Wl,-bexpall' @@ -4781,12 +4575,14 @@ else LDFLAGS="$LDFLAGS -brtl" fi + SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi + ;; BeOS*) SHLIB_CFLAGS="-fPIC" @@ -4800,43 +4596,71 @@ fi # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lbind" >&5 -$as_echo_n "checking for inet_ntoa in -lbind... " >&6; } -if ${ac_cv_lib_bind_inet_ntoa+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for inet_ntoa in -lbind" >&5 +echo $ECHO_N "checking for inet_ntoa in -lbind... $ECHO_C" >&6 +if test "${ac_cv_lib_bind_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbind $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char inet_ntoa (); int main () { -return inet_ntoa (); +inet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_bind_inet_ntoa=yes else - ac_cv_lib_bind_inet_ntoa=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bind_inet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bind_inet_ntoa" >&5 -$as_echo "$ac_cv_lib_bind_inet_ntoa" >&6; } -if test "x$ac_cv_lib_bind_inet_ntoa" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_bind_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_bind_inet_ntoa" >&6 +if test $ac_cv_lib_bind_inet_ntoa = yes; then LIBS="$LIBS -lbind -lsocket" fi @@ -4861,7 +4685,7 @@ fi LD_SEARCH_FLAGS="" ;; CYGWIN_*|MINGW32_*|MSYS_*) - SHLIB_CFLAGS="" + SHLIB_CFLAGS="-fno-common" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" DL_OBJS="tclLoadDl.o" @@ -4870,15 +4694,16 @@ fi DL_LIBS="-ldl" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${VERSION}.dll.a' - SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5 -$as_echo_n "checking for Cygwin version of gcc... " >&6; } -if ${ac_cv_cygwin+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5 +echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6 +if test "${ac_cv_cygwin+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __CYGWIN__ @@ -4893,27 +4718,55 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_cygwin=no else - ac_cv_cygwin=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cygwin=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5 -$as_echo "$ac_cv_cygwin" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_cygwin" >&5 +echo "${ECHO_T}$ac_cv_cygwin" >&6 if test "$ac_cv_cygwin" = "no"; then - as_fn_error $? "${CC} is not a cygwin compiler." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: ${CC} is not a cygwin compiler." >&5 +echo "$as_me: error: ${CC} is not a cygwin compiler." >&2;} + { (exit 1); exit 1; }; } fi if test "x${TCL_THREADS}" = "x0"; then - as_fn_error $? "CYGWIN compile is only supported with --enable-threads" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: CYGWIN compile is only supported with --enable-threads" >&5 +echo "$as_me: error: CYGWIN compile is only supported with --enable-threads" >&2;} + { (exit 1); exit 1; }; } fi do64bit_ok=yes if test "x${SHARED_BUILD}" = "x1"; then - echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args" + echo "running cd ../win; ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32" # The eval makes quoting arguments work. - if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args; cd ../unix + if cd ../win; eval ${CONFIG_SHELL-/bin/sh} ./configure $ac_configure_args --enable-64bit --host=x86_64-w64-mingw32; cd ../unix then : else { echo "configure: error: configure failed for ../win" 1>&2; exit 1; } @@ -4937,43 +4790,71 @@ $as_echo "$ac_cv_cygwin" >&6; } SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' DL_OBJS="tclLoadDl.o" DL_LIBS="-lroot" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnetwork" >&5 -$as_echo_n "checking for inet_ntoa in -lnetwork... " >&6; } -if ${ac_cv_lib_network_inet_ntoa+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for inet_ntoa in -lnetwork" >&5 +echo $ECHO_N "checking for inet_ntoa in -lnetwork... $ECHO_C" >&6 +if test "${ac_cv_lib_network_inet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char inet_ntoa (); int main () { -return inet_ntoa (); +inet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_network_inet_ntoa=yes else - ac_cv_lib_network_inet_ntoa=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_network_inet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_inet_ntoa" >&5 -$as_echo "$ac_cv_lib_network_inet_ntoa" >&6; } -if test "x$ac_cv_lib_network_inet_ntoa" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_network_inet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_network_inet_ntoa" >&6 +if test $ac_cv_lib_network_inet_ntoa = yes; then LIBS="$LIBS -lnetwork" fi @@ -4981,14 +4862,18 @@ fi HP-UX-*.11.*) # Use updated header definitions where possible -$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE_EXTENDED 1 +_ACEOF -$as_echo "#define _XOPEN_SOURCE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _XOPEN_SOURCE 1 +_ACEOF LIBS="$LIBS -lxnet" # Use the XOPEN network library - if test "`uname -m`" = ia64; then : + if test "`uname -m`" = ia64; then SHLIB_SUFFIX=".so" @@ -4997,49 +4882,78 @@ else SHLIB_SUFFIX=".sl" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 + + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char shl_load (); int main () { -return shl_load (); +shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else - ac_cv_lib_dld_shl_load=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi - if test "$tcl_ok" = yes; then : + if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" @@ -5051,7 +4965,8 @@ fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi - if test "$GCC" = yes; then : + + if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} @@ -5062,28 +4977,30 @@ else fi + # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes"; then : + if test "$do64bit" = "yes"; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} ;; esac @@ -5095,52 +5012,82 @@ else fi -fi ;; + +fi + ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char shl_load (); int main () { -return shl_load (); +shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else - ac_cv_lib_dld_shl_load=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi - if test "$tcl_ok" = yes; then : + if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" @@ -5152,24 +5099,28 @@ fi LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" -fi ;; +fi + ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - case " $LIBOBJS " in + case $LIBOBJS in + "mkstemp.$ac_objext" | \ + *" mkstemp.$ac_objext" | \ + "mkstemp.$ac_objext "* | \ *" mkstemp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" - ;; + *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi + ;; IRIX-6.*) SHLIB_CFLAGS="" @@ -5177,18 +5128,21 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - case " $LIBOBJS " in + case $LIBOBJS in + "mkstemp.$ac_objext" | \ + *" mkstemp.$ac_objext" | \ + "mkstemp.$ac_objext "* | \ *" mkstemp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" - ;; + *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - if test "$GCC" = yes; then : + + if test "$GCC" = yes; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" @@ -5207,6 +5161,7 @@ else LDFLAGS="$LDFLAGS -n32" fi + ;; IRIX64-6.*) SHLIB_CFLAGS="" @@ -5214,26 +5169,29 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - case " $LIBOBJS " in + case $LIBOBJS in + "mkstemp.$ac_objext" | \ + *" mkstemp.$ac_objext" | \ + "mkstemp.$ac_objext "* | \ *" mkstemp.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" - ;; + *) LIBOBJS="$LIBOBJS mkstemp.$ac_objext" ;; esac - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi + # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then : + if test "$do64bit" = yes; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported by gcc" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 +echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else @@ -5244,10 +5202,12 @@ else fi + fi + ;; Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*) - SHLIB_CFLAGS="-fPIC" + SHLIB_CFLAGS="-fPIC -fno-common" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" @@ -5263,35 +5223,42 @@ fi case $system in DragonFly-*|FreeBSD-*) - if test "${TCL_THREADS}" = "1"; then : + if test "${TCL_THREADS}" = "1"; then # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS" fi + ;; esac - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "`uname -m`" = "alpha"; then : + if test "`uname -m`" = "alpha"; then CFLAGS="$CFLAGS -mieee" fi - if test $do64bit = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -m64 flag" >&5 -$as_echo_n "checking if compiler accepts -m64 flag... " >&6; } -if ${tcl_cv_cc_m64+:} false; then : - $as_echo_n "(cached) " >&6 + if test $do64bit = yes; then + + echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_m64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5302,35 +5269,62 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_cc_m64=yes else - tcl_cv_cc_m64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_m64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_m64" >&5 -$as_echo "$tcl_cv_cc_m64" >&6; } - if test $tcl_cv_cc_m64 = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5 +echo "${ECHO_T}$tcl_cv_cc_m64" >&6 + if test $tcl_cv_cc_m64 = yes; then CFLAGS="$CFLAGS -m64" do64bit_ok=yes fi + fi + # The combo of gcc + glibc has a bug related to inlining of # functions like strtod(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. - if test x"${USE_COMPAT}" != x; then : + if test x"${USE_COMPAT}" != x; then CFLAGS="$CFLAGS -fno-inline" fi + ;; Lynx*) SHLIB_CFLAGS="-fPIC" @@ -5340,11 +5334,12 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="-mshared -ldl" LD_FLAGS="-Wl,--export-dynamic" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi + ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" @@ -5381,15 +5376,16 @@ fi SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}' LDFLAGS="-Wl,-export-dynamic" CFLAGS_OPTIMIZE="-O2" - if test "${TCL_THREADS}" = "1"; then : + if test "${TCL_THREADS}" = "1"; then # On OpenBSD: Compile with -pthread # Don't link with -lpthread @@ -5397,6 +5393,7 @@ fi CFLAGS="$CFLAGS -pthread" fi + # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots @@ -5409,19 +5406,21 @@ fi DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' fi + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "${TCL_THREADS}" = "1"; then : + if test "${TCL_THREADS}" = "1"; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" - LDFLAGS="$LDFLAGS -pthread" + LDFLAGS="$LDFLAGS -pthread" fi + ;; Darwin-*) CFLAGS_OPTIMIZE="-O2" @@ -5435,19 +5434,23 @@ fi CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" - if test $do64bit = yes; then : + if test $do64bit = yes; then case `arch` in ppc) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch ppc64 flag" >&5 -$as_echo_n "checking if compiler accepts -arch ppc64 flag... " >&6; } -if ${tcl_cv_cc_arch_ppc64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_ppc64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5458,33 +5461,62 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_cc_arch_ppc64=yes else - tcl_cv_cc_arch_ppc64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_ppc64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_ppc64" >&5 -$as_echo "$tcl_cv_cc_arch_ppc64" >&6; } - if test $tcl_cv_cc_arch_ppc64 = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6 + if test $tcl_cv_cc_arch_ppc64 = yes; then CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes -fi;; +fi +;; i386|x86_64) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch x86_64 flag" >&5 -$as_echo_n "checking if compiler accepts -arch x86_64 flag... " >&6; } -if ${tcl_cv_cc_arch_x86_64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_x86_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5495,33 +5527,62 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_cc_arch_x86_64=yes else - tcl_cv_cc_arch_x86_64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_x86_64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_x86_64" >&5 -$as_echo "$tcl_cv_cc_arch_x86_64" >&6; } - if test $tcl_cv_cc_arch_x86_64 = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6 + if test $tcl_cv_cc_arch_x86_64 = yes; then CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes -fi;; - arm64|arm64e) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler accepts -arch arm64e flag" >&5 -$as_echo_n "checking if compiler accepts -arch arm64e flag... " >&6; } -if ${tcl_cv_cc_arch_arm64e+:} false; then : - $as_echo_n "(cached) " >&6 +fi +;; + arm64) + echo "$as_me:$LINENO: checking if compiler accepts -arch arm64 flag" >&5 +echo $ECHO_N "checking if compiler accepts -arch arm64 flag... $ECHO_C" >&6 +if test "${tcl_cv_cc_arch_arm64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS - CFLAGS="$CFLAGS -arch arm64e" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CFLAGS="$CFLAGS -arch arm64" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5532,48 +5593,79 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - tcl_cv_cc_arch_arm64e=yes +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_cc_arch_arm64=yes else - tcl_cv_cc_arch_arm64e=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_arch_arm64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_arch_arm64e" >&5 -$as_echo "$tcl_cv_cc_arch_arm64e" >&6; } - if test $tcl_cv_cc_arch_arm64e = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_arm64" >&5 +echo "${ECHO_T}$tcl_cv_cc_arch_arm64" >&6 + if test $tcl_cv_cc_arch_arm64 = yes; then - CFLAGS="$CFLAGS -arch arm64e" + CFLAGS="$CFLAGS -arch arm64" do64bit_ok=yes -fi;; +fi +;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 -$as_echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; + { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5 +echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};; esac else # Check for combined 32-bit and 64-bit fat build - if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64e) ' \ - && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then : + if echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64|arm64) ' \ + && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '; then fat_32_64=yes fi + fi + SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS}' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -single_module flag" >&5 -$as_echo_n "checking if ld accepts -single_module flag... " >&6; } -if ${tcl_cv_ld_single_module+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 +echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_single_module+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5584,35 +5676,64 @@ int i; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_ld_single_module=yes else - tcl_cv_ld_single_module=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_single_module=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_single_module" >&5 -$as_echo "$tcl_cv_ld_single_module" >&6; } - if test $tcl_cv_ld_single_module = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 +echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 + if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi + SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="$LDFLAGS -headerpad_max_install_names" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -search_paths_first flag" >&5 -$as_echo_n "checking if ld accepts -search_paths_first flag... " >&6; } -if ${tcl_cv_ld_search_paths_first+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 +echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_search_paths_first+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -5623,59 +5744,89 @@ int i; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_ld_search_paths_first=yes else - tcl_cv_ld_search_paths_first=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_search_paths_first=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_search_paths_first" >&5 -$as_echo "$tcl_cv_ld_search_paths_first" >&6; } - if test $tcl_cv_ld_search_paths_first = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 +echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 + if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi - if test "$tcl_cv_cc_visibility_hidden" != yes; then : + if test "$tcl_cv_cc_visibility_hidden" != yes; then -$as_echo "#define MODULE_SCOPE __private_extern__" >>confdefs.h + +cat >>confdefs.h <<\_ACEOF +#define MODULE_SCOPE __private_extern__ +_ACEOF tcl_cv_cc_visibility_hidden=yes fi + CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" - LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" + LD_LIBRARY_PATH_VAR="DYLD_FALLBACK_LIBRARY_PATH" -$as_echo "#define MAC_OSX_TCL 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define MAC_OSX_TCL 1 +_ACEOF PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use CoreFoundation" >&5 -$as_echo_n "checking whether to use CoreFoundation... " >&6; } - # Check whether --enable-corefoundation was given. -if test "${enable_corefoundation+set}" = set; then : - enableval=$enable_corefoundation; tcl_corefoundation=$enableval + echo "$as_me:$LINENO: checking whether to use CoreFoundation" >&5 +echo $ECHO_N "checking whether to use CoreFoundation... $ECHO_C" >&6 + # Check whether --enable-corefoundation or --disable-corefoundation was given. +if test "${enable_corefoundation+set}" = set; then + enableval="$enable_corefoundation" + tcl_corefoundation=$enableval else tcl_corefoundation=yes -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_corefoundation" >&5 -$as_echo "$tcl_corefoundation" >&6; } - if test $tcl_corefoundation = yes; then : +fi; + echo "$as_me:$LINENO: result: $tcl_corefoundation" >&5 +echo "${ECHO_T}$tcl_corefoundation" >&6 + if test $tcl_corefoundation = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CoreFoundation.framework" >&5 -$as_echo_n "checking for CoreFoundation.framework... " >&6; } -if ${tcl_cv_lib_corefoundation+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for CoreFoundation.framework" >&5 +echo $ECHO_N "checking for CoreFoundation.framework... $ECHO_C" >&6 +if test "${tcl_cv_lib_corefoundation+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_libs=$LIBS - if test "$fat_32_64" = yes; then : + if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do # On Tiger there is no 64-bit CF, so remove 64-bit @@ -5685,8 +5836,13 @@ else eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done fi + LIBS="$LIBS -framework CoreFoundation" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -5697,45 +5853,77 @@ CFBundleRef b = CFBundleGetMainBundle(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_lib_corefoundation=yes else - tcl_cv_lib_corefoundation=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_lib_corefoundation=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$fat_32_64" = yes; then : +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$fat_32_64" = yes; then for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi + LIBS=$hold_libs fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation" >&5 -$as_echo "$tcl_cv_lib_corefoundation" >&6; } - if test $tcl_cv_lib_corefoundation = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation" >&5 +echo "${ECHO_T}$tcl_cv_lib_corefoundation" >&6 + if test $tcl_cv_lib_corefoundation = yes; then LIBS="$LIBS -framework CoreFoundation" -$as_echo "#define HAVE_COREFOUNDATION 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_COREFOUNDATION 1 +_ACEOF else tcl_corefoundation=no fi - if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit CoreFoundation" >&5 -$as_echo_n "checking for 64-bit CoreFoundation... " >&6; } -if ${tcl_cv_lib_corefoundation_64+:} false; then : - $as_echo_n "(cached) " >&6 + if test "$fat_32_64" = yes -a $tcl_corefoundation = yes; then + + echo "$as_me:$LINENO: checking for 64-bit CoreFoundation" >&5 +echo $ECHO_N "checking for 64-bit CoreFoundation... $ECHO_C" >&6 +if test "${tcl_cv_lib_corefoundation_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -5746,31 +5934,60 @@ CFBundleRef b = CFBundleGetMainBundle(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_lib_corefoundation_64=yes else - tcl_cv_lib_corefoundation_64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_lib_corefoundation_64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_corefoundation_64" >&5 -$as_echo "$tcl_cv_lib_corefoundation_64" >&6; } - if test $tcl_cv_lib_corefoundation_64 = no; then : +echo "$as_me:$LINENO: result: $tcl_cv_lib_corefoundation_64" >&5 +echo "${ECHO_T}$tcl_cv_lib_corefoundation_64" >&6 + if test $tcl_cv_lib_corefoundation_64 = no; then -$as_echo "#define NO_COREFOUNDATION_64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NO_COREFOUNDATION_64 1 +_ACEOF LDFLAGS="$LDFLAGS -Wl,-no_arch_warnings" fi -fi fi + + +fi + ;; NEXTSTEP-*) SHLIB_CFLAGS="" @@ -5786,7 +6003,9 @@ fi SHLIB_LD_LIBS="" CFLAGS_OPTIMIZE="" # Optimizer is buggy -$as_echo "#define _OE_SOCKETS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _OE_SOCKETS 1 +_ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) @@ -5804,13 +6023,14 @@ $as_echo "#define _OE_SOCKETS 1" >>confdefs.h OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" - if test "$SHARED_BUILD" = 1; then : + if test "$SHARED_BUILD" = 1; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi + SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -5821,7 +6041,7 @@ fi OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" - if test "$SHARED_BUILD" = 1; then : + if test "$SHARED_BUILD" = 1; then SHLIB_LD='${CC} -shared' @@ -5830,27 +6050,30 @@ else SHLIB_LD='${CC} -non_shared' fi + SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" - if test $doRpath = yes; then : + if test $doRpath = yes; then CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' fi - if test "$GCC" = yes; then : + + if test "$GCC" = yes; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa - if test "${TCL_THREADS}" = 1; then : + if test "${TCL_THREADS}" = 1; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` - if test "$GCC" = yes; then : + if test "$GCC" = yes; then LIBS="$LIBS -lpthread -lmach -lexc" @@ -5861,7 +6084,9 @@ else fi + fi + ;; QNX-6*) # QNX RTP @@ -5880,17 +6105,18 @@ fi # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. - if test "$GCC" = yes; then : + if test "$GCC" = yes; then - SHLIB_CFLAGS="-fPIC -melf" - LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else - SHLIB_CFLAGS="-Kpic -belf" - LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi + SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" @@ -5935,17 +6161,21 @@ fi # won't define thread-safe library routines. -$as_echo "#define _REENTRANT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$GCC" = yes; then : + if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -5958,32 +6188,37 @@ else LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} fi + ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. -$as_echo "#define _REENTRANT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF -$as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = yes; then : + if test "$do64bit" = yes; then arch=`isainfo` - if test "$arch" = "sparcv9 sparc"; then : + if test "$arch" = "sparcv9 sparc"; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then - if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then : + if test "`${CC} -dumpversion | awk -F. '{print $1}'`" -lt 3; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else @@ -5994,10 +6229,11 @@ else fi + else do64bit_ok=yes - if test "$do64bitVIS" = yes; then : + if test "$do64bitVIS" = yes; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" @@ -6008,15 +6244,17 @@ else LDFLAGS_ARCH="-xarch=v9" fi + # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi + else - if test "$arch" = "amd64 i386"; then : + if test "$arch" = "amd64 i386"; then - if test "$GCC" = yes; then : + if test "$GCC" = yes; then case $system in SunOS-5.1[1-9]*|SunOS-5.[2-9][0-9]*) @@ -6024,8 +6262,8 @@ else CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported with GCC on $system" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 +echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;};; esac else @@ -6042,32 +6280,169 @@ else fi + else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit mode not supported for $arch" >&5 -$as_echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 +echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi + fi + fi + #-------------------------------------------------------------------- # On Solaris 5.x i386 with the sunpro compiler we need to link # with sunmath to get floating point rounding control #-------------------------------------------------------------------- - if test "$GCC" = yes; then : + if test "$GCC" = yes; then use_sunmath=no else arch=`isainfo` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use -lsunmath for fp rounding control" >&5 -$as_echo_n "checking whether to use -lsunmath for fp rounding control... " >&6; } - if test "$arch" = "amd64 i386" -o "$arch" = "i386"; then : + echo "$as_me:$LINENO: checking whether to use -lsunmath for fp rounding control" >&5 +echo $ECHO_N "checking whether to use -lsunmath for fp rounding control... $ECHO_C" >&6 + if test "$arch" = "amd64 i386" -o "$arch" = "i386"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 MATH_LIBS="-lsunmath $MATH_LIBS" - ac_fn_c_check_header_mongrel "$LINENO" "sunmath.h" "ac_cv_header_sunmath_h" "$ac_includes_default" -if test "x$ac_cv_header_sunmath_h" = xyes; then : + if test "${ac_cv_header_sunmath_h+set}" = set; then + echo "$as_me:$LINENO: checking for sunmath.h" >&5 +echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 +if test "${ac_cv_header_sunmath_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5 +echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sunmath.h usability" >&5 +echo $ECHO_N "checking sunmath.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sunmath.h presence" >&5 +echo $ECHO_N "checking sunmath.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sunmath.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sunmath.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sunmath.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sunmath.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sunmath.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sunmath.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sunmath.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sunmath.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sunmath.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sunmath.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sunmath.h" >&5 +echo $ECHO_N "checking for sunmath.h... $ECHO_C" >&6 +if test "${ac_cv_header_sunmath_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sunmath_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sunmath_h" >&5 +echo "${ECHO_T}$ac_cv_header_sunmath_h" >&6 fi @@ -6076,24 +6451,26 @@ fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 use_sunmath=no fi + fi + SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$GCC" = yes; then : + if test "$GCC" = yes; then SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - if test "$do64bit_ok" = yes; then : + if test "$do64bit_ok" = yes; then - if test "$arch" = "sparcv9 sparc"; then : + if test "$arch" = "sparcv9 sparc"; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. @@ -6104,22 +6481,26 @@ fi #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" else - if test "$arch" = "amd64 i386"; then : + if test "$arch" = "amd64 i386"; then SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" fi + fi + fi + else - if test "$use_sunmath" = yes; then : + if test "$use_sunmath" = yes; then textmode=textoff else textmode=text fi + case $system in SunOS-5.[1-9][0-9]*|SunOS-5.[7-9]) SHLIB_LD="\${CC} -G -z $textmode \${LDFLAGS}";; @@ -6130,6 +6511,7 @@ fi LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi + ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" @@ -6140,15 +6522,19 @@ fi DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld accepts -Bexport flag" >&5 -$as_echo_n "checking for ld accepts -Bexport flag... " >&6; } -if ${tcl_cv_ld_Bexport+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 +echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_Bexport+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6159,63 +6545,93 @@ int i; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_ld_Bexport=yes else - tcl_cv_ld_Bexport=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_Bexport=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_Bexport" >&5 -$as_echo "$tcl_cv_ld_Bexport" >&6; } - if test $tcl_cv_ld_Bexport = yes; then : +echo "$as_me:$LINENO: result: $tcl_cv_ld_Bexport" >&5 +echo "${ECHO_T}$tcl_cv_ld_Bexport" >&6 + if test $tcl_cv_ld_Bexport = yes; then LDFLAGS="$LDFLAGS -Wl,-Bexport" fi + CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac - if test "$do64bit" = yes -a "$do64bit_ok" = no; then : + if test "$do64bit" = yes -a "$do64bit_ok" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 -$as_echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} + { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 +echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi - if test "$do64bit" = yes -a "$do64bit_ok" = yes; then : + if test "$do64bit" = yes -a "$do64bit_ok" = yes; then -$as_echo "#define TCL_CFG_DO64BIT 1" >>confdefs.h + +cat >>confdefs.h <<\_ACEOF +#define TCL_CFG_DO64BIT 1 +_ACEOF fi + # Step 4: disable dynamic loading if requested via a command-line switch. - # Check whether --enable-load was given. -if test "${enable_load+set}" = set; then : - enableval=$enable_load; tcl_ok=$enableval + # Check whether --enable-load or --disable-load was given. +if test "${enable_load+set}" = set; then + enableval="$enable_load" + tcl_ok=$enableval else tcl_ok=yes -fi - - if test "$tcl_ok" = no; then : +fi; + if test "$tcl_ok" = no; then DL_OBJS="" fi - if test "x$DL_OBJS" != x; then : + + if test "x$DL_OBJS" != x; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 -$as_echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} + { echo "$as_me:$LINENO: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&5 +echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared libraries on this system." >&2;} SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" @@ -6227,13 +6643,14 @@ $as_echo "$as_me: WARNING: Can't figure out how to do dynamic loading or shared BUILD_DLTEST="" fi + LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. - if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then : + if test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes; then case $system in AIX-*) ;; @@ -6249,31 +6666,37 @@ fi esac fi - if test "$tcl_cv_cc_visibility_hidden" != yes; then : + + if test "$tcl_cv_cc_visibility_hidden" != yes; then -$as_echo "#define MODULE_SCOPE extern" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define MODULE_SCOPE extern +_ACEOF fi - if test "$SHARED_LIB_SUFFIX" = ""; then : + + if test "$SHARED_LIB_SUFFIX" = ""; then SHARED_LIB_SUFFIX='${VERSION}${SHLIB_SUFFIX}' fi - if test "$UNSHARED_LIB_SUFFIX" = ""; then : + + if test "$UNSHARED_LIB_SUFFIX" = ""; then UNSHARED_LIB_SUFFIX='${VERSION}.a' fi + DLL_INSTALL_DIR="\$(LIB_INSTALL_DIR)" - if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then : + if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - if test "${SHLIB_SUFFIX}" = ".dll"; then : + if test "${SHLIB_SUFFIX}" = ".dll"; then - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)"' DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)" else @@ -6282,11 +6705,12 @@ else fi + else LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} - if test "$RANLIB" = ""; then : + if test "$RANLIB" = ""; then MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' @@ -6295,12 +6719,14 @@ else MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' fi + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)/$(LIB_FILE)"' fi + # Stub lib does not depend on shared/static configuration - if test "$RANLIB" = ""; then : + if test "$RANLIB" = ""; then MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' @@ -6309,62 +6735,98 @@ else MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' fi + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' # Define TCL_LIBS now that we know what DL_LIBS is. # The trick here is that we don't want to change the value of TCL_LIBS if # it is already set when tclConfig.sh had been loaded by Tk. - if test "x${TCL_LIBS}" = x; then : + if test "x${TCL_LIBS}" = x; then TCL_LIBS="${DL_LIBS} ${LIBS} ${MATH_LIBS}" fi - # See if the compiler supports casting to a union type. - # This is used to stop gcc from printing a compiler - # warning when initializing a union member. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cast to union support" >&5 -$as_echo_n "checking for cast to union support... " >&6; } -if ${tcl_cv_cast_to_union+:} false; then : - $as_echo_n "(cached) " >&6 + # See if the compiler supports casting to a union type. + # This is used to stop gcc from printing a compiler + # warning when initializing a union member. + + echo "$as_me:$LINENO: checking for cast to union support" >&5 +echo $ECHO_N "checking for cast to union support... $ECHO_C" >&6 +if test "${tcl_cv_cast_to_union+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { - union foo { int i; double d; }; - union foo f = (union foo) (int) 0; + union foo { int i; double d; }; + union foo f = (union foo) (int) 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_cast_to_union=yes else - tcl_cv_cast_to_union=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cast_to_union=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cast_to_union" >&5 -$as_echo "$tcl_cv_cast_to_union" >&6; } - if test "$tcl_cv_cast_to_union" = "yes"; then +echo "$as_me:$LINENO: result: $tcl_cv_cast_to_union" >&5 +echo "${ECHO_T}$tcl_cv_cast_to_union" >&6 + if test "$tcl_cv_cast_to_union" = "yes"; then -$as_echo "#define HAVE_CAST_TO_UNION 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_CAST_TO_UNION 1 +_ACEOF - fi - hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working -fno-lto" >&5 -$as_echo_n "checking for working -fno-lto... " >&6; } -if ${ac_cv_nolto+:} false; then : - $as_echo_n "(cached) " >&6 + fi + hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto" + echo "$as_me:$LINENO: checking for working -fno-lto" >&5 +echo $ECHO_N "checking for working -fno-lto... $ECHO_C" >&6 +if test "${ac_cv_nolto+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6375,22 +6837,46 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_nolto=yes else - ac_cv_nolto=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_nolto=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_nolto" >&5 -$as_echo "$ac_cv_nolto" >&6; } - CFLAGS=$hold_cflags - if test "$ac_cv_nolto" = "yes" ; then - CFLAGS_NOLTO="-fno-lto" - else - CFLAGS_NOLTO="" - fi +echo "$as_me:$LINENO: result: $ac_cv_nolto" >&5 +echo "${ECHO_T}$ac_cv_nolto" >&6 + CFLAGS=$hold_cflags + if test "$ac_cv_nolto" = "yes" ; then + CFLAGS_NOLTO="-fno-lto" + else + CFLAGS_NOLTO="" + fi # FIXME: This subst was left in only because the TCL_DL_LIBS # entry in tclConfig.sh uses it. It is not clear why someone @@ -6435,33 +6921,37 @@ _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build with symbols" >&5 -$as_echo_n "checking for build with symbols... " >&6; } - # Check whether --enable-symbols was given. -if test "${enable_symbols+set}" = set; then : - enableval=$enable_symbols; tcl_ok=$enableval + echo "$as_me:$LINENO: checking for build with symbols" >&5 +echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 + # Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" + tcl_ok=$enableval else tcl_ok=no -fi - +fi; # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' -$as_echo "#define NDEBUG 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NDEBUG 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 -$as_echo "#define TCL_CFG_OPTIMIZED 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TCL_CFG_OPTIMIZED 1 +_ACEOF else CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' if test "$tcl_ok" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (standard debugging)" >&5 -$as_echo "yes (standard debugging)" >&6; } + echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 +echo "${ECHO_T}yes (standard debugging)" >&6 fi fi @@ -6469,7 +6959,9 @@ $as_echo "yes (standard debugging)" >&6; } if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then -$as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TCL_MEM_DEBUG 1 +_ACEOF fi @@ -6477,11 +6969,11 @@ $as_echo "#define TCL_MEM_DEBUG 1" >>confdefs.h if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled symbols mem debugging" >&5 -$as_echo "enabled symbols mem debugging" >&6; } + echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 +echo "${ECHO_T}enabled symbols mem debugging" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabled $tcl_ok debugging" >&5 -$as_echo "enabled $tcl_ok debugging" >&6; } + echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 +echo "${ECHO_T}enabled $tcl_ok debugging" >&6 fi fi @@ -6491,14 +6983,18 @@ $as_echo "enabled $tcl_ok debugging" >&6; } #-------------------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for required early compiler flags" >&5 -$as_echo_n "checking for required early compiler flags... " >&6; } + echo "$as_me:$LINENO: checking for required early compiler flags" >&5 +echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 tcl_flags="" - if ${tcl_cv_flag__isoc99_source+:} false; then : - $as_echo_n "(cached) " >&6 + if test "${tcl_cv_flag__isoc99_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -6509,10 +7005,38 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=no else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include @@ -6524,136 +7048,177 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=yes else - tcl_cv_flag__isoc99_source=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__isoc99_source=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then -$as_echo "#define _ISOC99_SOURCE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _ISOC99_SOURCE 1 +_ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi - if ${tcl_cv_flag__largefile64_source+:} false; then : - $as_echo_n "(cached) " >&6 + if test "${tcl_cv_flag__file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -struct stat64 buf; int i = stat64("/", &buf); - ; - return 0; -} + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - tcl_cv_flag__largefile64_source=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _LARGEFILE64_SOURCE 1 #include int main () { -struct stat64 buf; int i = stat64("/", &buf); +switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; } ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - tcl_cv_flag__largefile64_source=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__file_offset_bits=no else - tcl_cv_flag__largefile64_source=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then - -$as_echo "#define _LARGEFILE64_SOURCE 1" >>confdefs.h - - tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" - fi - + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - if ${tcl_cv_flag__largefile_source64+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *)open64; - ; - return 0; -} +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - tcl_cv_flag__largefile_source64=no -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#define _LARGEFILE_SOURCE64 1 +#define _FILE_OFFSET_BITS 64 #include int main () { -char *p = (char *)open64; +switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; } ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - tcl_cv_flag__largefile_source64=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_flag__file_offset_bits=yes else - tcl_cv_flag__largefile_source64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_flag__file_offset_bits=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - if test "x${tcl_cv_flag__largefile_source64}" = "xyes" ; then + if test "x${tcl_cv_flag__file_offset_bits}" = "xyes" ; then -$as_echo "#define _LARGEFILE_SOURCE64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _FILE_OFFSET_BITS 64 +_ACEOF - tcl_flags="$tcl_flags _LARGEFILE_SOURCE64" + tcl_flags="$tcl_flags _FILE_OFFSET_BITS" fi if test "x${tcl_flags}" = "x" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_flags}" >&5 -$as_echo "${tcl_flags}" >&6; } + echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 +echo "${ECHO_T}${tcl_flags}" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit integer type" >&5 -$as_echo_n "checking for 64-bit integer type... " >&6; } - if ${tcl_cv_type_64bit+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 +echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 + if test "${tcl_cv_type_64bit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6664,16 +7229,44 @@ __int64 value = (__int64) 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_type_64bit=__int64 else - tcl_type_64bit="long long" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_type_64bit="long long" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6686,35 +7279,187 @@ switch (0) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_type_64bit=${tcl_type_64bit} +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then -$as_echo "#define TCL_WIDE_INT_IS_LONG 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TCL_WIDE_INT_IS_LONG 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using long" >&5 -$as_echo "using long" >&6; } + echo "$as_me:$LINENO: result: using long" >&5 +echo "${ECHO_T}using long" >&6 else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${tcl_cv_type_64bit}" >&5 -$as_echo "${tcl_cv_type_64bit}" >&6; } + echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 +echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 # Now check for auxiliary declarations - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct dirent64" >&5 -$as_echo_n "checking for struct dirent64... " >&6; } -if ${tcl_cv_struct_dirent64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for 64-bit time_t" >&5 +echo $ECHO_N "checking for 64-bit time_t... $ECHO_C" >&6 +if test "${tcl_cv_time_t_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;} + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv_time_t_64=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_time_t_64=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv_time_t_64" >&5 +echo "${ECHO_T}$tcl_cv_time_t_64" >&6 + if test "x${tcl_cv_time_t_64}" = "xno" ; then + # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64 + # which SC_TCL_EARLY_FLAGS has defined if necessary. + echo "$as_me:$LINENO: checking if _TIME_BITS=64 enables 64-bit time_t" >&5 +echo $ECHO_N "checking if _TIME_BITS=64 enables 64-bit time_t... $ECHO_C" >&6 +if test "${tcl_cv__time_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _TIME_BITS 64 +#include +int +main () +{ +switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;} + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + tcl_cv__time_bits=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv__time_bits=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $tcl_cv__time_bits" >&5 +echo "${ECHO_T}$tcl_cv__time_bits" >&6 + if test "x${tcl_cv__time_bits}" = "xyes" ; then + +cat >>confdefs.h <<\_ACEOF +#define _TIME_BITS 64 +_ACEOF + + fi + fi + + echo "$as_me:$LINENO: checking for struct dirent64" >&5 +echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 +if test "${tcl_cv_struct_dirent64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -6726,28 +7471,58 @@ struct dirent64 p; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_struct_dirent64=yes else - tcl_cv_struct_dirent64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_dirent64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_dirent64" >&5 -$as_echo "$tcl_cv_struct_dirent64" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_struct_dirent64" >&5 +echo "${ECHO_T}$tcl_cv_struct_dirent64" >&6 if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then -$as_echo "#define HAVE_STRUCT_DIRENT64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_DIRENT64 1 +_ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DIR64" >&5 -$as_echo_n "checking for DIR64... " >&6; } -if ${tcl_cv_DIR64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for DIR64" >&5 +echo $ECHO_N "checking for DIR64... $ECHO_C" >&6 +if test "${tcl_cv_DIR64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -6760,28 +7535,58 @@ struct dirent64 *p; DIR64 d = opendir64("."); return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_DIR64=yes else - tcl_cv_DIR64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_DIR64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_DIR64" >&5 -$as_echo "$tcl_cv_DIR64" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_DIR64" >&5 +echo "${ECHO_T}$tcl_cv_DIR64" >&6 if test "x${tcl_cv_DIR64}" = "xyes" ; then -$as_echo "#define HAVE_DIR64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_DIR64 1 +_ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct stat64" >&5 -$as_echo_n "checking for struct stat64... " >&6; } -if ${tcl_cv_struct_stat64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for struct stat64" >&5 +echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 +if test "${tcl_cv_struct_stat64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -6793,40 +7598,161 @@ struct stat64 p; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_struct_stat64=yes else - tcl_cv_struct_stat64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_struct_stat64=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_struct_stat64" >&5 -$as_echo "$tcl_cv_struct_stat64" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_struct_stat64" >&5 +echo "${ECHO_T}$tcl_cv_struct_stat64" >&6 if test "x${tcl_cv_struct_stat64}" = "xyes" ; then -$as_echo "#define HAVE_STRUCT_STAT64 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_STAT64 1 +_ACEOF fi - for ac_func in open64 lseek64 -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 + + +for ac_func in open64 lseek64 +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5 -$as_echo_n "checking for off64_t... " >&6; } - if ${tcl_cv_type_off64_t+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for off64_t" >&5 +echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 + if test "${tcl_cv_type_off64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -6838,25 +7764,51 @@ off64_t offset; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_type_off64_t=yes else - tcl_cv_type_off64_t=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_type_off64_t=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then -$as_echo "#define HAVE_TYPE_OFF64_T 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_TYPE_OFF64_T 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi @@ -6865,229 +7817,235 @@ $as_echo "no" >&6; } # Check endianness because we can optimize some operations #-------------------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif + not big endian +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ; - return 0; -} +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif - + _ascii (); _ebcdic (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default int main () { - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - ac_cv_c_bigendian=yes + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) - -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac #------------------------------------------------------------------------ @@ -7102,10 +8060,10 @@ if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then fi if test "$TCL_PREFIX" != "$prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + { echo "$as_me:$LINENO: WARNING: Different --prefix selected for Tk and Tcl! [package require Tk] may not work correctly in tclsh." >&5 -$as_echo "$as_me: WARNING: +echo "$as_me: WARNING: Different --prefix selected for Tk and Tcl! [package require Tk] may not work correctly in tclsh." >&2;} fi @@ -7120,13 +8078,17 @@ fi # special flag. #-------------------------------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_set in sys/types" >&5 -$as_echo_n "checking for fd_set in sys/types... " >&6; } -if ${tcl_cv_type_fd_set+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for fd_set in sys/types" >&5 +echo $ECHO_N "checking for fd_set in sys/types... $ECHO_C" >&6 +if test "${tcl_cv_type_fd_set+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7137,30 +8099,58 @@ fd_set readMask, writeMask; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_type_fd_set=yes else - tcl_cv_type_fd_set=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_type_fd_set=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_type_fd_set" >&5 -$as_echo "$tcl_cv_type_fd_set" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_type_fd_set" >&5 +echo "${ECHO_T}$tcl_cv_type_fd_set" >&6 tk_ok=$tcl_cv_type_fd_set if test $tk_ok = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_mask in sys/select" >&5 -$as_echo_n "checking for fd_mask in sys/select... " >&6; } -if ${tcl_cv_grep_fd_mask+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for fd_mask in sys/select" >&5 +echo $ECHO_N "checking for fd_mask in sys/select... $ECHO_C" >&6 +if test "${tcl_cv_grep_fd_mask+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "fd_mask" >/dev/null 2>&1; then : + $EGREP "fd_mask" >/dev/null 2>&1; then tcl_cv_grep_fd_mask=present else tcl_cv_grep_fd_mask=missing @@ -7168,18 +8158,22 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_grep_fd_mask" >&5 -$as_echo "$tcl_cv_grep_fd_mask" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_grep_fd_mask" >&5 +echo "${ECHO_T}$tcl_cv_grep_fd_mask" >&6 if test $tcl_cv_grep_fd_mask = present; then -$as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_SYS_SELECT_H 1 +_ACEOF tk_ok=yes fi fi if test $tk_ok = no; then -$as_echo "#define NO_FD_SET 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define NO_FD_SET 1 +_ACEOF fi @@ -7187,24 +8181,166 @@ fi # Find out all about time handling differences. #------------------------------------------------------------------------------ + for ac_header in sys/time.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = xyes; then : +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIME_H 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -7219,18 +8355,44 @@ return 0; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_time=yes else - ac_cv_header_time=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_time=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF fi @@ -7240,9 +8402,64 @@ fi # they don't exist. #-------------------------------------------------------------------- -ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : +echo "$as_me:$LINENO: checking for mode_t" >&5 +echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 +if test "${ac_cv_type_mode_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((mode_t *) 0) + return 0; +if (sizeof (mode_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_mode_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_mode_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +echo "${ECHO_T}$ac_cv_type_mode_t" >&6 +if test $ac_cv_type_mode_t = yes; then + : else cat >>confdefs.h <<_ACEOF @@ -7251,100 +8468,302 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - +echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - -cat >>confdefs.h <<_ACEOF -#define pid_t int + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_pid_t=no fi - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : else cat >>confdefs.h <<_ACEOF -#define size_t unsigned int +#define pid_t int _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : - ac_cv_type_uid_t=yes -else - ac_cv_type_uid_t=no +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 +if test "${ac_cv_type_uid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then -$as_echo "#define uid_t int" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define uid_t int +_ACEOF -$as_echo "#define gid_t int" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define gid_t int +_ACEOF fi -ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" -if test "x$ac_cv_type_intptr_t" = xyes; then : +echo "$as_me:$LINENO: checking for intptr_t" >&5 +echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_intptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((intptr_t *) 0) + return 0; +if (sizeof (intptr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_intptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_intptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_intptr_t" >&6 +if test $ac_cv_type_intptr_t = yes; then -$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_INTPTR_T 1 +_ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pointer-size signed integer type" >&5 -$as_echo_n "checking for pointer-size signed integer type... " >&6; } -if ${tcl_cv_intptr_t+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pointer-size signed integer type" >&5 +echo $ECHO_N "checking for pointer-size signed integer type... $ECHO_C" >&6 +if test "${tcl_cv_intptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for tcl_cv_intptr_t in "int" "long" "long long" none; do if test "$tcl_cv_intptr_t" != none; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_intptr_t))]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_ok=yes else - tcl_ok=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_ok=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext test "$tcl_ok" = yes && break; fi done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_intptr_t" >&5 -$as_echo "$tcl_cv_intptr_t" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_intptr_t" >&5 +echo "${ECHO_T}$tcl_cv_intptr_t" >&6 if test "$tcl_cv_intptr_t" != none; then cat >>confdefs.h <<_ACEOF @@ -7355,48 +8774,132 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" -if test "x$ac_cv_type_uintptr_t" = xyes; then : +echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +if test $ac_cv_type_uintptr_t = yes; then -$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pointer-size unsigned integer type" >&5 -$as_echo_n "checking for pointer-size unsigned integer type... " >&6; } -if ${tcl_cv_uintptr_t+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for pointer-size unsigned integer type" >&5 +echo $ECHO_N "checking for pointer-size unsigned integer type... $ECHO_C" >&6 +if test "${tcl_cv_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for tcl_cv_uintptr_t in "unsigned int" "unsigned long" "unsigned long long" \ none; do if test "$tcl_cv_uintptr_t" != none; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($tcl_cv_uintptr_t))]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_ok=yes else - tcl_ok=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_ok=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext test "$tcl_ok" = yes && break; fi done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_uintptr_t" >&5 -$as_echo "$tcl_cv_uintptr_t" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_uintptr_t" >&5 +echo "${ECHO_T}$tcl_cv_uintptr_t" >&6 if test "$tcl_cv_uintptr_t" != none; then cat >>confdefs.h <<_ACEOF @@ -7412,13 +8915,17 @@ fi # In OS/390 struct pwd has no pw_gecos field #------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pw_gecos in struct pwd" >&5 -$as_echo_n "checking pw_gecos in struct pwd... " >&6; } -if ${tcl_cv_pwd_pw_gecos+:} false; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking pw_gecos in struct pwd" >&5 +echo $ECHO_N "checking pw_gecos in struct pwd... $ECHO_C" >&6 +if test "${tcl_cv_pwd_pw_gecos+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7429,18 +8936,44 @@ struct passwd pwd; (void)pwd.pw_gecos; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_pwd_pw_gecos=yes else - tcl_cv_pwd_pw_gecos=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_pwd_pw_gecos=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_pwd_pw_gecos" >&5 -$as_echo "$tcl_cv_pwd_pw_gecos" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_pwd_pw_gecos" >&5 +echo "${ECHO_T}$tcl_cv_pwd_pw_gecos" >&6 if test $tcl_cv_pwd_pw_gecos = yes; then -$as_echo "#define HAVE_PW_GECOS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_PW_GECOS 1 +_ACEOF fi @@ -7449,41 +8982,41 @@ fi #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Aqua" >&5 -$as_echo_n "checking whether to use Aqua... " >&6; } - # Check whether --enable-aqua was given. -if test "${enable_aqua+set}" = set; then : - enableval=$enable_aqua; tk_aqua=$enableval + echo "$as_me:$LINENO: checking whether to use Aqua" >&5 +echo $ECHO_N "checking whether to use Aqua... $ECHO_C" >&6 + # Check whether --enable-aqua or --disable-aqua was given. +if test "${enable_aqua+set}" = set; then + enableval="$enable_aqua" + tk_aqua=$enableval else tk_aqua=no -fi - +fi; if test $tk_aqua = yes -o $tk_aqua = cocoa; then tk_aqua=yes if test $tcl_corefoundation = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua can only be used when CoreFoundation is available" >&5 -$as_echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;} + { echo "$as_me:$LINENO: WARNING: Aqua can only be used when CoreFoundation is available" >&5 +echo "$as_me: WARNING: Aqua can only be used when CoreFoundation is available" >&2;} tk_aqua=no fi if test ! -d /System/Library/Frameworks/Cocoa.framework; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua can only be used when Cocoa is available" >&5 -$as_echo "$as_me: WARNING: Aqua can only be used when Cocoa is available" >&2;} + { echo "$as_me:$LINENO: WARNING: Aqua can only be used when Cocoa is available" >&5 +echo "$as_me: WARNING: Aqua can only be used when Cocoa is available" >&2;} tk_aqua=no fi if test "`uname -r | awk -F. '{print $1}'`" -lt 9; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Aqua requires Mac OS X 10.5 or later" >&5 -$as_echo "$as_me: WARNING: Aqua requires Mac OS X 10.5 or later" >&2;} + { echo "$as_me:$LINENO: WARNING: Aqua requires Mac OS X 10.5 or later" >&5 +echo "$as_me: WARNING: Aqua requires Mac OS X 10.5 or later" >&2;} tk_aqua=no fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tk_aqua" >&5 -$as_echo "$tk_aqua" >&6; } + echo "$as_me:$LINENO: result: $tk_aqua" >&5 +echo "${ECHO_T}$tk_aqua" >&6 if test "$fat_32_64" = yes; then if test $tk_aqua = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit X11" >&5 -$as_echo_n "checking for 64-bit X11... " >&6; } -if ${tcl_cv_lib_x11_64+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for 64-bit X11" >&5 +echo $ECHO_N "checking for 64-bit X11... $ECHO_C" >&6 +if test "${tcl_cv_lib_x11_64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for v in CFLAGS CPPFLAGS LDFLAGS; do @@ -7491,7 +9024,11 @@ else done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7502,25 +9039,49 @@ XrmInitialize(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_lib_x11_64=yes else - tcl_cv_lib_x11_64=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_lib_x11_64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_lib_x11_64" >&5 -$as_echo "$tcl_cv_lib_x11_64" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_lib_x11_64" >&5 +echo "${ECHO_T}$tcl_cv_lib_x11_64" >&6 fi # remove 64-bit arch flags from CFLAGS et al. for combined 32 & 64 bit # fat builds if configuration does not support 64-bit. if test "$tcl_cv_lib_x11_64" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Removing 64-bit architectures from compiler & linker flags" >&5 -$as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} + { echo "$as_me:$LINENO: Removing 64-bit architectures from compiler & linker flags" >&5 +echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >&6;} for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done @@ -7528,15 +9089,19 @@ $as_echo "$as_me: Removing 64-bit architectures from compiler & linker flags" >& fi if test $tk_aqua = no; then # check if weak linking whole libraries is possible. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ld accepts -weak-l flag" >&5 -$as_echo_n "checking if ld accepts -weak-l flag... " >&6; } -if ${tcl_cv_ld_weak_l+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if ld accepts -weak-l flag" >&5 +echo $ECHO_N "checking if ld accepts -weak-l flag... $ECHO_C" >&6 +if test "${tcl_cv_ld_weak_l+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-weak-lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int @@ -7547,24 +9112,186 @@ double f = sin(1.0); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_ld_weak_l=yes else - tcl_cv_ld_weak_l=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_ld_weak_l=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_ld_weak_l" >&5 -$as_echo "$tcl_cv_ld_weak_l" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_ld_weak_l" >&5 +echo "${ECHO_T}$tcl_cv_ld_weak_l" >&6 fi - for ac_header in AvailabilityMacros.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "AvailabilityMacros.h" "ac_cv_header_AvailabilityMacros_h" "$ac_includes_default" -if test "x$ac_cv_header_AvailabilityMacros_h" = xyes; then : + +for ac_header in AvailabilityMacros.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ----------------------------- ## +## Report this to the tk lists. ## +## ----------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_AVAILABILITYMACROS_H 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -7572,14 +9299,18 @@ fi done if test "$ac_cv_header_AvailabilityMacros_h" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if weak import is available" >&5 -$as_echo_n "checking if weak import is available... " >&6; } -if ${tcl_cv_cc_weak_import+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if weak import is available" >&5 +echo $ECHO_N "checking if weak import is available... $ECHO_C" >&6 +if test "${tcl_cv_cc_weak_import+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ @@ -7599,30 +9330,60 @@ rand(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_cc_weak_import=yes else - tcl_cv_cc_weak_import=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_weak_import=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_weak_import" >&5 -$as_echo "$tcl_cv_cc_weak_import" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_cc_weak_import" >&5 +echo "${ECHO_T}$tcl_cv_cc_weak_import" >&6 if test $tcl_cv_cc_weak_import = yes; then -$as_echo "#define HAVE_WEAK_IMPORT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_WEAK_IMPORT 1 +_ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Darwin SUSv3 extensions are available" >&5 -$as_echo_n "checking if Darwin SUSv3 extensions are available... " >&6; } -if ${tcl_cv_cc_darwin_c_source+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking if Darwin SUSv3 extensions are available" >&5 +echo $ECHO_N "checking if Darwin SUSv3 extensions are available... $ECHO_C" >&6 +if test "${tcl_cv_cc_darwin_c_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ @@ -7643,19 +9404,45 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then tcl_cv_cc_darwin_c_source=yes else - tcl_cv_cc_darwin_c_source=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +tcl_cv_cc_darwin_c_source=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$hold_cflags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tcl_cv_cc_darwin_c_source" >&5 -$as_echo "$tcl_cv_cc_darwin_c_source" >&6; } +echo "$as_me:$LINENO: result: $tcl_cv_cc_darwin_c_source" >&5 +echo "${ECHO_T}$tcl_cv_cc_darwin_c_source" >&6 if test $tcl_cv_cc_darwin_c_source = yes; then -$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define _DARWIN_C_SOURCE 1 +_ACEOF fi fi @@ -7665,17 +9452,21 @@ fi if test $tk_aqua = yes; then -$as_echo "#define MAC_OSX_TK 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define MAC_OSX_TK 1 +_ACEOF LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit -framework QuartzCore" if test -d "/System/Library/Frameworks/UniformTypeIdentifiers.framework"; then - LIBS="$LIBS -framework UniformTypeIdentifiers" + LIBS="$LIBS -weak_framework UniformTypeIdentifiers" fi EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c' TK_WINDOWINGSYSTEM=AQUA if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then -$as_echo "#define TK_MAC_DEBUG 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TK_MAC_DEBUG 1 +_ACEOF fi else @@ -7689,47 +9480,44 @@ else #-------------------------------------------------------------------- - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 -$as_echo_n "checking for X... " >&6; } + echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 -# Check whether --with-x was given. -if test "${with_x+set}" = set; then : - withval=$with_x; -fi +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" +fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else - case $x_includes,$x_libraries in #( - *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : - $as_echo_n "(cached) " >&6 + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no -rm -f -r conftest.dir +rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' -incroot: - @echo incroot='${INCROOT}' -usrlibdir: - @echo usrlibdir='${USRLIBDIR}' -libdir: - @echo libdir='${LIBDIR}' -_ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl dylib la dll; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done @@ -7737,41 +9525,37 @@ _ACEOF # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in - /usr/include) ac_x_includes= ;; + /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in - /usr/lib | /usr/lib64 | /lib | /lib64) ;; + /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. - rm -f -r conftest.dir + rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include -/usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 -/usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include -/usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 -/usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 @@ -7791,24 +9575,48 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. + # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then + if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then @@ -7816,85 +9624,133 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XrmInitialize () +XtMalloc (0) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else - LIBS=$ac_save_LIBS -for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl dylib la dll; do - if test -r "$ac_dir/libX11.$ac_extension"; then + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" -esac +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi -;; #( - *) have_x=yes;; - esac +fi + + fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -$as_echo "$have_x" >&6; } + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -$as_echo "libraries $x_libraries, headers $x_includes" >&6; } + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + not_really_there="yes" fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext else if test ! -r $x_includes/X11/Xlib.h; then not_really_there="yes" @@ -7902,25 +9758,49 @@ rm -f conftest.err conftest.i conftest.$ac_ext fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5 -$as_echo_n "checking for X11 header files... " >&6; } + echo "$as_me:$LINENO: checking for X11 header files" >&5 +echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 found_xincludes="no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then found_xincludes="yes" else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + found_xincludes="no" fi -rm -f conftest.err conftest.i conftest.$ac_ext +rm -f conftest.err conftest.$ac_ext if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Xlib.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 -$as_echo "$i" >&6; } + echo "$as_me:$LINENO: result: $i" >&5 +echo "${ECHO_T}$i" >&6 XINCLUDES=" -I$i" found_xincludes="yes" break @@ -7934,19 +9814,19 @@ $as_echo "$i" >&6; } fi fi if test "$found_xincludes" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: couldn't find any!" >&5 -$as_echo "couldn't find any!" >&6; } + echo "$as_me:$LINENO: result: couldn't find any!" >&5 +echo "${ECHO_T}couldn't find any!" >&6 fi if test "$no_x" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 libraries" >&5 -$as_echo_n "checking for X11 libraries... " >&6; } + echo "$as_me:$LINENO: checking for X11 libraries" >&5 +echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 -$as_echo "$i" >&6; } + echo "$as_me:$LINENO: result: $i" >&5 +echo "${ECHO_T}$i" >&6 XLIBSW="-L$i -lX11" x_libraries="$i" break @@ -7960,50 +9840,78 @@ $as_echo "$i" >&6; } fi fi if test "$XLIBSW" = nope ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCreateWindow in -lXwindow" >&5 -$as_echo_n "checking for XCreateWindow in -lXwindow... " >&6; } -if ${ac_cv_lib_Xwindow_XCreateWindow+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5 +echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6 +if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXwindow $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XCreateWindow (); int main () { -return XCreateWindow (); +XCreateWindow (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xwindow_XCreateWindow=yes else - ac_cv_lib_Xwindow_XCreateWindow=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xwindow_XCreateWindow=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 -$as_echo "$ac_cv_lib_Xwindow_XCreateWindow" >&6; } -if test "x$ac_cv_lib_Xwindow_XCreateWindow" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 +echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6 +if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then XLIBSW=-lXwindow fi fi if test "$XLIBSW" = nope ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not find any! Using -lX11." >&5 -$as_echo "could not find any! Using -lX11." >&6; } + echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5 +echo "${ECHO_T}could not find any! Using -lX11." >&6 XLIBSW=-lX11 fi @@ -8052,37 +9960,65 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXbsd" >&5 -$as_echo_n "checking for main in -lXbsd... " >&6; } -if ${ac_cv_lib_Xbsd_main+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for main in -lXbsd" >&5 +echo $ECHO_N "checking for main in -lXbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_Xbsd_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXbsd $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xbsd_main=yes else - ac_cv_lib_Xbsd_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xbsd_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xbsd_main" >&5 -$as_echo "$ac_cv_lib_Xbsd_main" >&6; } -if test "x$ac_cv_lib_Xbsd_main" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xbsd_main" >&5 +echo "${ECHO_T}$ac_cv_lib_Xbsd_main" >&6 +if test $ac_cv_lib_Xbsd_main = yes; then LIBS="$LIBS -lXbsd" fi @@ -8100,13 +10036,17 @@ fi #-------------------------------------------------------------------- if test -d /usr/include/mit -a $tk_aqua = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MIT X libraries" >&5 -$as_echo_n "checking MIT X libraries... " >&6; } + echo "$as_me:$LINENO: checking MIT X libraries" >&5 +echo $ECHO_N "checking MIT X libraries... $ECHO_C" >&6 tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS -I/usr/include/mit" tk_oldLibs=$LIBS LIBS="$LIBS -lX11-mit" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -8121,19 +10061,43 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 XLIBSW="-lX11-mit" XINCLUDES="-I/usr/include/mit" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$tk_oldCFlags LIBS=$tk_oldLibs fi @@ -8143,20 +10107,20 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use xft" >&5 -$as_echo_n "checking whether to use xft... " >&6; } - # Check whether --enable-xft was given. -if test "${enable_xft+set}" = set; then : - enableval=$enable_xft; enable_xft=$enableval + echo "$as_me:$LINENO: checking whether to use xft" >&5 +echo $ECHO_N "checking whether to use xft... $ECHO_C" >&6 + # Check whether --enable-xft or --disable-xft was given. +if test "${enable_xft+set}" = set; then + enableval="$enable_xft" + enable_xft=$enableval else enable_xft="default" -fi - +fi; XFT_CFLAGS="" XFT_LIBS="" if test "$enable_xft" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xft" >&5 -$as_echo "$enable_xft" >&6; } + echo "$as_me:$LINENO: result: $enable_xft" >&5 +echo "${ECHO_T}$enable_xft" >&6 else found_xft="yes" XFT_CFLAGS=`xft-config --cflags 2>/dev/null` || found_xft="no" @@ -8166,17 +10130,63 @@ $as_echo "$enable_xft" >&6; } XFT_CFLAGS=`pkg-config --cflags xft fontconfig 2>/dev/null` || found_xft="no" XFT_LIBS=`pkg-config --libs xft fontconfig 2>/dev/null` || found_xft="no" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_xft" >&5 -$as_echo "$found_xft" >&6; } + echo "$as_me:$LINENO: result: $found_xft" >&5 +echo "${ECHO_T}$found_xft" >&6 if test "$found_xft" = "yes" ; then tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" tk_oldLibs=$LIBS LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - ac_fn_c_check_header_compile "$LINENO" "X11/Xft/Xft.h" "ac_cv_header_X11_Xft_Xft_h" "#include -" -if test "x$ac_cv_header_X11_Xft_Xft_h" = xyes; then : + echo "$as_me:$LINENO: checking for X11/Xft/Xft.h" >&5 +echo $ECHO_N "checking for X11/Xft/Xft.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_Xft_Xft_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_X11_Xft_Xft_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_header_X11_Xft_Xft_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xft_Xft_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_Xft_Xft_h" >&6 +if test $ac_cv_header_X11_Xft_Xft_h = yes; then + : else found_xft=no @@ -8192,43 +10202,72 @@ fi CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" tk_oldLibs=$LIBS LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5 -$as_echo_n "checking for XftFontOpen in -lXft... " >&6; } -if ${ac_cv_lib_Xft_XftFontOpen+:} false; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for XftFontOpen in -lXft" >&5 +echo $ECHO_N "checking for XftFontOpen in -lXft... $ECHO_C" >&6 +if test "${ac_cv_lib_Xft_XftFontOpen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XftFontOpen (); int main () { -return XftFontOpen (); +XftFontOpen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xft_XftFontOpen=yes else - ac_cv_lib_Xft_XftFontOpen=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xft_XftFontOpen=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5 -$as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; } -if test "x$ac_cv_lib_Xft_XftFontOpen" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xft_XftFontOpen" >&5 +echo "${ECHO_T}$ac_cv_lib_Xft_XftFontOpen" >&6 +if test $ac_cv_lib_Xft_XftFontOpen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXFT 1 _ACEOF @@ -8249,43 +10288,71 @@ fi CFLAGS="$CFLAGS $XINCLUDES $XFT_CFLAGS" tk_oldLibs=$LIBS LIBS="$tk_oldLIBS $XFT_LIBS $XLIBSW -lfontconfig" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FcFontSort in -lfontconfig" >&5 -$as_echo_n "checking for FcFontSort in -lfontconfig... " >&6; } -if ${ac_cv_lib_fontconfig_FcFontSort+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for FcFontSort in -lfontconfig" >&5 +echo $ECHO_N "checking for FcFontSort in -lfontconfig... $ECHO_C" >&6 +if test "${ac_cv_lib_fontconfig_FcFontSort+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfontconfig $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char FcFontSort (); int main () { -return FcFontSort (); +FcFontSort (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_fontconfig_FcFontSort=yes else - ac_cv_lib_fontconfig_FcFontSort=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fontconfig_FcFontSort=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fontconfig_FcFontSort" >&5 -$as_echo "$ac_cv_lib_fontconfig_FcFontSort" >&6; } -if test "x$ac_cv_lib_fontconfig_FcFontSort" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_fontconfig_FcFontSort" >&5 +echo "${ECHO_T}$ac_cv_lib_fontconfig_FcFontSort" >&6 +if test $ac_cv_lib_fontconfig_FcFontSort = yes; then XFT_LIBS="$XFT_LIBS -lfontconfig" @@ -8296,8 +10363,8 @@ fi fi if test "$found_xft" = "no" ; then if test "$enable_xft" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Can't find xft configuration, or xft is unusable" >&5 -$as_echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} + { echo "$as_me:$LINENO: WARNING: Can't find xft configuration, or xft is unusable" >&5 +echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2;} fi enable_xft=no XFT_CFLAGS="" @@ -8309,7 +10376,9 @@ $as_echo "$as_me: WARNING: Can't find xft configuration, or xft is unusable" >&2 if test $enable_xft = "yes" ; then UNIX_FONT_OBJS=tkUnixRFont.o -$as_echo "#define HAVE_XFT 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_XFT 1 +_ACEOF else UNIX_FONT_OBJS=tkUnixFont.o @@ -8328,9 +10397,55 @@ if test $tk_aqua = no; then tk_oldLibs=$LIBS CFLAGS="$CFLAGS $XINCLUDES" LIBS="$LIBS $XLIBSW" - ac_fn_c_check_header_compile "$LINENO" "X11/XKBlib.h" "ac_cv_header_X11_XKBlib_h" "#include -" -if test "x$ac_cv_header_X11_XKBlib_h" = xyes; then : + echo "$as_me:$LINENO: checking for X11/XKBlib.h" >&5 +echo $ECHO_N "checking for X11/XKBlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_XKBlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_X11_XKBlib_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_X11_XKBlib_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_XKBlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_XKBlib_h" >&6 +if test $ac_cv_header_X11_XKBlib_h = yes; then xkblib_header_found=yes @@ -8342,43 +10457,71 @@ fi if test $xkblib_header_found = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XkbKeycodeToKeysym in -lX11" >&5 -$as_echo_n "checking for XkbKeycodeToKeysym in -lX11... " >&6; } -if ${ac_cv_lib_X11_XkbKeycodeToKeysym+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XkbKeycodeToKeysym in -lX11" >&5 +echo $ECHO_N "checking for XkbKeycodeToKeysym in -lX11... $ECHO_C" >&6 +if test "${ac_cv_lib_X11_XkbKeycodeToKeysym+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XkbKeycodeToKeysym (); int main () { -return XkbKeycodeToKeysym (); +XkbKeycodeToKeysym (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_X11_XkbKeycodeToKeysym=yes else - ac_cv_lib_X11_XkbKeycodeToKeysym=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_X11_XkbKeycodeToKeysym=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5 -$as_echo "$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6; } -if test "x$ac_cv_lib_X11_XkbKeycodeToKeysym" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XkbKeycodeToKeysym" >&5 +echo "${ECHO_T}$ac_cv_lib_X11_XkbKeycodeToKeysym" >&6 +if test $ac_cv_lib_X11_XkbKeycodeToKeysym = yes; then xkbkeycodetokeysym_found=yes @@ -8393,7 +10536,9 @@ fi fi if test $xkbkeycodetokeysym_found = "yes" ; then -$as_echo "#define HAVE_XKBKEYCODETOKEYSYM 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_XKBKEYCODETOKEYSYM 1 +_ACEOF fi CFLAGS=$tk_oldCFlags @@ -8405,11 +10550,15 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no && test "$GCC" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether XKeycodeToKeysym is deprecated" >&5 -$as_echo_n "checking whether XKeycodeToKeysym is deprecated... " >&6; } + echo "$as_me:$LINENO: checking whether XKeycodeToKeysym is deprecated" >&5 +echo $ECHO_N "checking whether XKeycodeToKeysym is deprecated... $ECHO_C" >&6 tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS -Werror" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -8424,22 +10573,48 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -$as_echo "#define XKEYCODETOKEYSYM_IS_DEPRECATED 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define XKEYCODETOKEYSYM_IS_DEPRECATED 1 +_ACEOF fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$tk_oldCFlags fi @@ -8459,115 +10634,306 @@ if test $tk_aqua = no; then LIBS="$tk_oldLibs $XLIBSW" xss_header_found=no xss_lib_found=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to try to use XScreenSaver" >&5 -$as_echo_n "checking whether to try to use XScreenSaver... " >&6; } - # Check whether --enable-xss was given. -if test "${enable_xss+set}" = set; then : - enableval=$enable_xss; enable_xss=$enableval + echo "$as_me:$LINENO: checking whether to try to use XScreenSaver" >&5 +echo $ECHO_N "checking whether to try to use XScreenSaver... $ECHO_C" >&6 + # Check whether --enable-xss or --disable-xss was given. +if test "${enable_xss+set}" = set; then + enableval="$enable_xss" + enable_xss=$enableval else enable_xss=yes -fi - +fi; if test "$enable_xss" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xss" >&5 -$as_echo "$enable_xss" >&6; } + echo "$as_me:$LINENO: result: $enable_xss" >&5 +echo "${ECHO_T}$enable_xss" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_xss" >&5 -$as_echo "$enable_xss" >&6; } - ac_fn_c_check_header_compile "$LINENO" "X11/extensions/scrnsaver.h" "ac_cv_header_X11_extensions_scrnsaver_h" "#include -" -if test "x$ac_cv_header_X11_extensions_scrnsaver_h" = xyes; then : + echo "$as_me:$LINENO: result: $enable_xss" >&5 +echo "${ECHO_T}$enable_xss" >&6 + echo "$as_me:$LINENO: checking for X11/extensions/scrnsaver.h" >&5 +echo $ECHO_N "checking for X11/extensions/scrnsaver.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_scrnsaver_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_X11_extensions_scrnsaver_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_X11_extensions_scrnsaver_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_scrnsaver_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_scrnsaver_h" >&6 +if test $ac_cv_header_X11_extensions_scrnsaver_h = yes; then xss_header_found=yes fi - ac_fn_c_check_func "$LINENO" "XScreenSaverQueryInfo" "ac_cv_func_XScreenSaverQueryInfo" -if test "x$ac_cv_func_XScreenSaverQueryInfo" = xyes; then : + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo... $ECHO_C" >&6 +if test "${ac_cv_func_XScreenSaverQueryInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define XScreenSaverQueryInfo to an innocuous variant, in case declares XScreenSaverQueryInfo. + For example, HP-UX 11i declares gettimeofday. */ +#define XScreenSaverQueryInfo innocuous_XScreenSaverQueryInfo + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char XScreenSaverQueryInfo (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef XScreenSaverQueryInfo + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XScreenSaverQueryInfo (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_XScreenSaverQueryInfo) || defined (__stub___XScreenSaverQueryInfo) +choke me +#else +char (*f) () = XScreenSaverQueryInfo; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != XScreenSaverQueryInfo; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_XScreenSaverQueryInfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_func_XScreenSaverQueryInfo=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_func_XScreenSaverQueryInfo" >&6 +if test $ac_cv_func_XScreenSaverQueryInfo = yes; then + : else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverQueryInfo in -lXext" >&5 -$as_echo_n "checking for XScreenSaverQueryInfo in -lXext... " >&6; } -if ${ac_cv_lib_Xext_XScreenSaverQueryInfo+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXext" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo in -lXext... $ECHO_C" >&6 +if test "${ac_cv_lib_Xext_XScreenSaverQueryInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XScreenSaverQueryInfo (); int main () { -return XScreenSaverQueryInfo (); +XScreenSaverQueryInfo (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xext_XScreenSaverQueryInfo=yes else - ac_cv_lib_Xext_XScreenSaverQueryInfo=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xext_XScreenSaverQueryInfo=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XScreenSaverQueryInfo" >&5 -$as_echo "$ac_cv_lib_Xext_XScreenSaverQueryInfo" >&6; } -if test "x$ac_cv_lib_Xext_XScreenSaverQueryInfo" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_lib_Xext_XScreenSaverQueryInfo" >&6 +if test $ac_cv_lib_Xext_XScreenSaverQueryInfo = yes; then XLIBSW="$XLIBSW -lXext" xss_lib_found=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XScreenSaverQueryInfo in -lXss" >&5 -$as_echo_n "checking for XScreenSaverQueryInfo in -lXss... " >&6; } -if ${ac_cv_lib_Xss_XScreenSaverQueryInfo+:} false; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXss" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo in -lXss... $ECHO_C" >&6 +if test "${ac_cv_lib_Xss_XScreenSaverQueryInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXss -lXext $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XScreenSaverQueryInfo (); int main () { -return XScreenSaverQueryInfo (); +XScreenSaverQueryInfo (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xss_XScreenSaverQueryInfo=yes else - ac_cv_lib_Xss_XScreenSaverQueryInfo=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xss_XScreenSaverQueryInfo=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 -$as_echo "$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6; } -if test "x$ac_cv_lib_Xss_XScreenSaverQueryInfo" = xyes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6 +if test $ac_cv_lib_Xss_XScreenSaverQueryInfo = yes; then if test "$tcl_cv_ld_weak_l" = yes; then # On Darwin, weak link libXss if possible, @@ -8589,7 +10955,9 @@ fi fi if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then -$as_echo "#define HAVE_XSS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define HAVE_XSS 1 +_ACEOF fi CFLAGS=$tk_oldCFlags @@ -8601,36 +10969,66 @@ fi # #define for __CHAR_UNSIGNED__. #-------------------------------------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 -$as_echo_n "checking whether char is unsigned... " >&6; } -if ${ac_cv_c_char_unsigned+:} false; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking whether char is unsigned" >&5 +echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6 +if test "${ac_cv_c_char_unsigned+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((char) -1) < 0)]; -test_array [0] = 0; -return test_array [0]; +test_array [0] = 0 ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_char_unsigned=no else - ac_cv_c_char_unsigned=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_char_unsigned=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 -$as_echo "$ac_cv_c_char_unsigned" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 +echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then - $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h + cat >>confdefs.h <<\_ACEOF +#define __CHAR_UNSIGNED__ 1 +_ACEOF fi @@ -8669,38 +11067,38 @@ WISH_RSRC_FILE='wish$(VERSION).rsrc' if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to package libraries" >&5 -$as_echo_n "checking how to package libraries... " >&6; } - # Check whether --enable-framework was given. -if test "${enable_framework+set}" = set; then : - enableval=$enable_framework; enable_framework=$enableval + echo "$as_me:$LINENO: checking how to package libraries" >&5 +echo $ECHO_N "checking how to package libraries... $ECHO_C" >&6 + # Check whether --enable-framework or --disable-framework was given. +if test "${enable_framework+set}" = set; then + enableval="$enable_framework" + enable_framework=$enableval else enable_framework=no -fi - +fi; if test $enable_framework = yes; then if test $SHARED_BUILD = 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 -$as_echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} + { echo "$as_me:$LINENO: WARNING: Frameworks can only be built if --enable-shared is yes" >&5 +echo "$as_me: WARNING: Frameworks can only be built if --enable-shared is yes" >&2;} enable_framework=no fi if test $tcl_corefoundation = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 -$as_echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} + { echo "$as_me:$LINENO: WARNING: Frameworks can only be used when CoreFoundation is available" >&5 +echo "$as_me: WARNING: Frameworks can only be used when CoreFoundation is available" >&2;} enable_framework=no fi fi if test $enable_framework = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: framework" >&5 -$as_echo "framework" >&6; } + echo "$as_me:$LINENO: result: framework" >&5 +echo "${ECHO_T}framework" >&6 FRAMEWORK_BUILD=1 else if test $SHARED_BUILD = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: shared library" >&5 -$as_echo "shared library" >&6; } + echo "$as_me:$LINENO: result: shared library" >&5 +echo "${ECHO_T}shared library" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: static library" >&5 -$as_echo "static library" >&6; } + echo "$as_me:$LINENO: result: static library" >&5 +echo "${ECHO_T}static library" >&6 fi FRAMEWORK_BUILD=0 fi @@ -8716,7 +11114,7 @@ $as_echo "static library" >&6; } EXTRA_WISH_LIBS=${EXTRA_WISH_LIBS}' -ObjC' fi EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic' - ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in Credits.html:../macosx/Credits.html.in" + ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in Credits.html:../macosx/Credits.html.in" for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}$l"; done TK_YEAR="`date +%Y`" @@ -8724,11 +11122,13 @@ fi if test "$FRAMEWORK_BUILD" = "1" ; then -$as_echo "#define TK_FRAMEWORK 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define TK_FRAMEWORK 1 +_ACEOF # Construct a fake local framework structure to make linking with # '-framework Tk' and running of tktest work - ac_config_commands="$ac_config_commands Tk.framework" + ac_config_commands="$ac_config_commands Tk.framework" LD_LIBRARY_PATH_VAR="DYLD_FRAMEWORK_PATH" if test "${libdir}" = '${exec_prefix}/lib'; then @@ -8795,7 +11195,7 @@ fi # Replace ${VERSION} with contents of ${TK_VERSION} eval "TK_STUB_LIB_FILE=libtkstub${TK_UNSHARED_LIB_SUFFIX}" -eval "TK_STUB_LIB_DIR=${libdir}" +eval "TK_STUB_LIB_DIR=\"${libdir}\"" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then TK_STUB_LIB_FLAG="-ltkstub${TK_VERSION}" @@ -8868,7 +11268,7 @@ TK_SHARED_BUILD=${SHARED_BUILD} -ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in tk.pc:../unix/tk.pc.in" + ac_config_files="$ac_config_files Makefile:../unix/Makefile.in tkConfig.sh:../unix/tkConfig.sh.in tk.pc:../unix/tk.pc.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -8888,70 +11288,39 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - +{ (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( + ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) | + esac; +} | sed ' - /^ac_cv_env_/b end t clear - :clear + : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + echo "not updating unwritable cache $cache_file" fi fi rm -f confcache @@ -8960,19 +11329,32 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= -U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -8982,15 +11364,12 @@ LTLIBOBJS=$ac_ltlibobjs DEFS="-DHAVE_TK_CONFIG_H -imacros tkConfig.h" CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 +: ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -9000,253 +11379,81 @@ cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false - SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - +done -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi -as_me=`$as_basename -- "$0" || +# Name of the executable. +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -9254,111 +11461,148 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' else - as_ln_s='cp -pR' + PATH_SEPARATOR=: fi -else - as_ln_s='cp -pR' + rm -f conf$$.sh fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done - case $as_dir in #( - -*) as_dir=./$as_dir;; + ;; esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file -} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -9367,20 +11611,31 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to + +# Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + This file was extended by tk $as_me 8.6, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9388,47 +11643,45 @@ generated by GNU Autoconf 2.69. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi -_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. +\`$as_me' instantiates files from templates according to the +current configuration. -Usage: $0 [OPTION]... [TAG]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages + -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -9439,89 +11692,83 @@ $config_headers Configuration commands: $config_commands -Report bugs to the package provider." - +Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ tk config.status 8.6 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -test -n "\$AWK" || AWK=awk +srcdir=$srcdir _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) + -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; esac case $ac_option in # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; + *) ac_config_targets="$ac_config_targets $1" ;; esac shift @@ -9535,56 +11782,44 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS +# INIT-COMMANDS section. # + VERSION=${TK_VERSION} && tk_aqua=${tk_aqua} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Handling of arguments. + +cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do - case $ac_config_target in - "tkConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS tkConfig.h:../unix/tkConfig.h.in" ;; - "Tk-Info.plist") CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;; - "Wish-Info.plist") CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;; - "Credits.html") CONFIG_FILES="$CONFIG_FILES Credits.html:../macosx/Credits.html.in" ;; - "Tk.framework") CONFIG_COMMANDS="$CONFIG_COMMANDS Tk.framework" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;; - "tkConfig.sh") CONFIG_FILES="$CONFIG_FILES tkConfig.sh:../unix/tkConfig.sh.in" ;; - "tk.pc") CONFIG_FILES="$CONFIG_FILES tk.pc:../unix/tk.pc.in" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + case "$ac_config_target" in + # Handling of arguments. + "Tk-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;; + "Wish-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;; + "Credits.html" ) CONFIG_FILES="$CONFIG_FILES Credits.html:../macosx/Credits.html.in" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;; + "tkConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tkConfig.sh:../unix/tkConfig.sh.in" ;; + "tk.pc" ) CONFIG_FILES="$CONFIG_FILES tk.pc:../unix/tk.pc.in" ;; + "Tk.framework" ) CONFIG_COMMANDS="$CONFIG_COMMANDS Tk.framework" ;; + "tkConfig.h" ) CONFIG_HEADERS="$CONFIG_HEADERS tkConfig.h:../unix/tkConfig.h.in" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; esac done - # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -9596,540 +11831,748 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, +# simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# Create a temporary directory, and hook for its removal unless debugging. $debug || { - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 } + # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" } || { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || { - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. +# +# CONFIG_FILES section. +# -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_PATCH_LEVEL@,$TCL_PATCH_LEVEL,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@TCLSH_PROG@,$TCLSH_PROG,;t t +s,@BUILD_TCLSH@,$BUILD_TCLSH,;t t +s,@MAN_FLAGS@,$MAN_FLAGS,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@TCL_THREADS@,$TCL_THREADS,;t t +s,@SHARED_BUILD@,$SHARED_BUILD,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@TCL_LIBS@,$TCL_LIBS,;t t +s,@DL_LIBS@,$DL_LIBS,;t t +s,@DL_OBJS@,$DL_OBJS,;t t +s,@PLAT_OBJS@,$PLAT_OBJS,;t t +s,@PLAT_SRCS@,$PLAT_SRCS,;t t +s,@LDAIX_SRC@,$LDAIX_SRC,;t t +s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t +s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t +s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t +s,@CFLAGS_NOLTO@,$CFLAGS_NOLTO,;t t +s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t +s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t +s,@CC_SEARCH_FLAGS@,$CC_SEARCH_FLAGS,;t t +s,@LD_SEARCH_FLAGS@,$LD_SEARCH_FLAGS,;t t +s,@STLIB_LD@,$STLIB_LD,;t t +s,@SHLIB_LD@,$SHLIB_LD,;t t +s,@TCL_SHLIB_LD_EXTRAS@,$TCL_SHLIB_LD_EXTRAS,;t t +s,@TK_SHLIB_LD_EXTRAS@,$TK_SHLIB_LD_EXTRAS,;t t +s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t +s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t +s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t +s,@MAKE_LIB@,$MAKE_LIB,;t t +s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t +s,@INSTALL_LIB@,$INSTALL_LIB,;t t +s,@DLL_INSTALL_DIR@,$DLL_INSTALL_DIR,;t t +s,@INSTALL_STUB_LIB@,$INSTALL_STUB_LIB,;t t +s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t +s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t +s,@XFT_CFLAGS@,$XFT_CFLAGS,;t t +s,@XFT_LIBS@,$XFT_LIBS,;t t +s,@UNIX_FONT_OBJS@,$UNIX_FONT_OBJS,;t t +s,@TK_VERSION@,$TK_VERSION,;t t +s,@TK_MAJOR_VERSION@,$TK_MAJOR_VERSION,;t t +s,@TK_MINOR_VERSION@,$TK_MINOR_VERSION,;t t +s,@TK_PATCH_LEVEL@,$TK_PATCH_LEVEL,;t t +s,@TK_YEAR@,$TK_YEAR,;t t +s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t +s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t +s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t +s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t +s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t +s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t +s,@TK_STUB_LIB_PATH@,$TK_STUB_LIB_PATH,;t t +s,@TK_INCLUDE_SPEC@,$TK_INCLUDE_SPEC,;t t +s,@TK_BUILD_STUB_LIB_SPEC@,$TK_BUILD_STUB_LIB_SPEC,;t t +s,@TK_BUILD_STUB_LIB_PATH@,$TK_BUILD_STUB_LIB_PATH,;t t +s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t +s,@TK_SHARED_BUILD@,$TK_SHARED_BUILD,;t t +s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t +s,@TK_BUILD_LIB_SPEC@,$TK_BUILD_LIB_SPEC,;t t +s,@TCL_STUB_FLAGS@,$TCL_STUB_FLAGS,;t t +s,@XINCLUDES@,$XINCLUDES,;t t +s,@XLIBSW@,$XLIBSW,;t t +s,@LOCALES@,$LOCALES,;t t +s,@TK_WINDOWINGSYSTEM@,$TK_WINDOWINGSYSTEM,;t t +s,@TK_PKG_DIR@,$TK_PKG_DIR,;t t +s,@TK_LIBRARY@,$TK_LIBRARY,;t t +s,@LIB_RUNTIME_DIR@,$LIB_RUNTIME_DIR,;t t +s,@PRIVATE_INCLUDE_DIR@,$PRIVATE_INCLUDE_DIR,;t t +s,@HTML_DIR@,$HTML_DIR,;t t +s,@EXTRA_CC_SWITCHES@,$EXTRA_CC_SWITCHES,;t t +s,@EXTRA_APP_CC_SWITCHES@,$EXTRA_APP_CC_SWITCHES,;t t +s,@EXTRA_INSTALL@,$EXTRA_INSTALL,;t t +s,@EXTRA_INSTALL_BINARIES@,$EXTRA_INSTALL_BINARIES,;t t +s,@EXTRA_BUILD_HTML@,$EXTRA_BUILD_HTML,;t t +s,@EXTRA_WISH_LIBS@,$EXTRA_WISH_LIBS,;t t +s,@CFBUNDLELOCALIZATIONS@,$CFBUNDLELOCALIZATIONS,;t t +s,@TK_RSRC_FILE@,$TK_RSRC_FILE,;t t +s,@WISH_RSRC_FILE@,$WISH_RSRC_FILE,;t t +s,@LIB_RSRC_FILE@,$LIB_RSRC_FILE,;t t +s,@APP_RSRC_FILE@,$APP_RSRC_FILE,;t t +s,@REZ@,$REZ,;t t +s,@REZ_FLAGS@,$REZ_FLAGS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done +fi # test -n "$CONFIG_FILES" -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - ac_dir=`$as_dirname -- "$ac_file" || + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - case $ac_mode in - :F) - # - # CONFIG_FILE - # -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } _ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file fi else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 + cat $tmp/config.h + rm -f $tmp/config.h fi - ;; +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - case $ac_file$ac_mode in - "Tk.framework":C) n=Tk && + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + Tk.framework ) n=Tk && f=$n.framework && v=Versions/$VERSION && rm -rf $f && mkdir -p $f/$v/Resources && ln -s $v/$n $v/Resources $f && ln -s ../../../$n $f/$v && @@ -10137,18 +12580,17 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} if test $tk_aqua = yes; then ln -s ../../../../$n.rsrc $f/$v/Resources; fi && unset n f v ;; - esac -done # for ac_tag +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -as_fn_exit 0 +{ (exit 0); exit 0; } _ACEOF +chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -10168,11 +12610,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + $ac_cs_success || { (exit 1); exit 1; } fi diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index 1951518959..54b6c7ee04 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -3,9 +3,9 @@ * * This file handles the implementation of native bitmaps. * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 1996-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -24,7 +24,7 @@ typedef struct { } BuiltInIcon; /* - * This array mapps a string name to the supported builtin icons + * This array maps a string name to the supported builtin icons * on the Macintosh. */ @@ -50,9 +50,6 @@ static BuiltInIcon builtInIcons[] = { #define builtInIconSize 32 -#define OSTYPE_TO_UTI(x) ((NSString *)UTTypeCreatePreferredIdentifierForTag( \ - kUTTagClassOSType, UTCreateStringForOSType(x), nil)) - static Tcl_HashTable iconBitmapTable = {}; typedef struct { int kind, width, height; @@ -136,7 +133,7 @@ PixmapFromImage( TkMacOSXDrawingContext dc; Pixmap pixmap; - pixmap = Tk_GetPixmap(display, None, size.width, size.height, 0); + pixmap = Tk_GetPixmap(display, None, (int)size.width, (int)size.height, 0); if (TkMacOSXSetupDrawingContext(pixmap, NULL, &dc)) { if (dc.context) { CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, @@ -175,7 +172,7 @@ TkpCreateNativeBitmap( Display *display, const void *source) /* Info about the icon to build. */ { - NSString *filetype = [NSString stringWithUTF8String:(char *)source]; + NSString *filetype = TkMacOSXOSTypeToUTI(PTR2UINT(source)); NSImage *iconImage = TkMacOSXIconForFileType(filetype); CGSize size = CGSizeMake(builtInIconSize, builtInIconSize); Pixmap pixmap = PixmapFromImage(display, iconImage, size); @@ -307,8 +304,6 @@ TkpGetNativeAppBitmap( } } if (image) { - *width = size.width; - *height = size.height; pixmap = PixmapFromImage(display, image, NSSizeToCGSize(size)); } else if (name) { /* @@ -323,6 +318,8 @@ TkpGetNativeAppBitmap( pixmap = PixmapFromImage(display, iconImage, NSSizeToCGSize(size)); } } + *width = (int)size.width; + *height = (int)size.height; return pixmap; } @@ -350,7 +347,8 @@ TkMacOSXIconBitmapObjCmd( Tcl_Obj *const objv[]) /* Argument objects. */ { Tcl_HashEntry *hPtr; - int i = 1, len, isNew, result = TCL_ERROR; + int isNew, result = TCL_ERROR; + int i = 1, len; const char *name, *value; IconBitmap ib, *iconBitmap; diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index f8f60f8758..3c91fc83e5 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -4,12 +4,12 @@ * This file implements the Macintosh specific portion of the button * widgets. * - * Copyright (c) 1996-1997 by Sun Microsystems, Inc. - * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2006-2007 Daniel A. Steffen - * Copyright 2007 Revar Desmera. - * Copyright 2015 Kevin Walzer/WordTech Communications LLC. - * Copyright 2015 Marc Culler. + * Copyright © 1996-1997 Sun Microsystems, Inc. + * Copyright © 2001 Apple Computer, Inc. + * Copyright © 2006-2007 Daniel A. Steffen + * Copyright © 2007 Revar Desmera. + * Copyright © 2015 Kevin Walzer/WordTech Communications LLC. + * Copyright © 2015 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -409,10 +409,10 @@ TkpComputeButtonGeometry( tmpRect = CGRectMake(0, 0, width + 2*HI_PADX, height + 2*HI_PADY); HIThemeGetButtonContentBounds(&tmpRect, &mbPtr->drawinfo, &contBounds); if (height < contBounds.size.height) { - height = contBounds.size.height; + height = (int)contBounds.size.height; } if (width < contBounds.size.width) { - width = contBounds.size.width; + width = (int)contBounds.size.width; } height += 2*HI_PADY; width += 2*HI_PADX; diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index b8159d6ab9..126af479ac 100644 --- a/macosx/tkMacOSXClipboard.c +++ b/macosx/tkMacOSXClipboard.c @@ -3,9 +3,9 @@ * * This file manages the clipboard for the Tk toolkit. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -37,7 +37,7 @@ static Tk_Window clipboardOwner = NULL; cbPtr; cbPtr = cbPtr->nextPtr) { NSString *s = [[TKNSString alloc] initWithTclUtfBytes:cbPtr->buffer - length:cbPtr->length]; + length:(NSUInteger)cbPtr->length]; [string appendString:s]; [s release]; } diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 2037dfbdf8..7e7a81f9c7 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -5,11 +5,11 @@ * toolkit, in order to avoid round-trips to the server to * map color names to pixel values. * - * Copyright (c) 1990-1994 The Regents of the University of California. - * Copyright (c) 1994-1996 Sun Microsystems, Inc. - * Copyright (c) 2001-2009 Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2020 Marc Culler + * Copyright © 1990-1994 The Regents of the University of California. + * Copyright © 1994-1996 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2020 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -43,7 +43,8 @@ void initColorTable() SystemColorDatum *entry, *oldEntry; Tcl_HashSearch search; Tcl_HashEntry *hPtr; - int newPtr, index = 0; + int newPtr; + int index = 0; NSColorList *systemColorList = [NSColorList colorListNamed:@"System"]; NSString *key; @@ -93,13 +94,13 @@ void initColorTable() */ for (key in [systemColorList allKeys]) { - int length = [key lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + NSUInteger length = [key lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; char *name; entry = (SystemColorDatum *)ckalloc(sizeof(SystemColorDatum)); bzero(entry, sizeof(SystemColorDatum)); name = (char *)ckalloc(length + 1); strcpy(name, key.UTF8String); - name[0] = toupper(name[0]); + name[0] = (char)toupper(UCHAR(name[0])); if (!strcmp(name, "WindowBackgroundColor")) { /* @@ -185,9 +186,9 @@ TkMacOSXRGBPixel( { MacPixel p = {0}; p.pixel.colortype = rgbColor; - p.pixel.value = ((red & 0xff) << 16) | + p.pixel.value = (unsigned int)(((red & 0xff) << 16) | ((green & 0xff) << 8) | - (blue & 0xff); + (blue & 0xff)); return p.ulong; } @@ -409,6 +410,11 @@ SetCGColorComponents( { CGFloat rgba[4] = {0, 0, 0, 1}; + if (entry->type == HIBrush) { + OSStatus err = ChkErr(HIThemeBrushCreateCGColor, entry->value, c); + return err == noErr; + } + /* * This function is called before our autorelease pool is set up, * so it needs its own pool. @@ -416,11 +422,6 @@ SetCGColorComponents( NSAutoreleasePool *pool = [NSAutoreleasePool new]; - if (entry->type == HIBrush) { - OSStatus err = ChkErr(HIThemeBrushCreateCGColor, entry->value, c); - [pool drain]; - return err == noErr; - } GetRGBA(entry, pixel, rgba); *c = CGColorCreate(sRGB.CGColorSpace, rgba); [pool drain]; @@ -531,7 +532,7 @@ TkMacOSXGetNSColor( if (cgColor) { nsColor = [NSColor colorWithColorSpace:sRGB components:CGColorGetComponents(cgColor) - count:CGColorGetNumberOfComponents(cgColor)]; + count:(NSInteger)CGColorGetNumberOfComponents(cgColor)]; CGColorRelease(cgColor); } return nsColor; @@ -661,7 +662,7 @@ TkpGetColor( CGColorRef c = NULL; p.pixel.colortype = entry->type; - p.pixel.value = entry->index; + p.pixel.value = (unsigned int)entry->index; color.pixel = p.ulong; if (entry->type == semantic) { CGFloat rgba[4]; @@ -699,9 +700,9 @@ TkpGetColor( #else GetRGBA(entry, p.ulong, rgba); #endif - color.red = rgba[0] * 65535.0; - color.green = rgba[1] * 65535.0; - color.blue = rgba[2] * 65535.0; + color.red = (unsigned short)(rgba[0] * 65535.0); + color.green = (unsigned short)(rgba[1] * 65535.0); + color.blue = (unsigned short)(rgba[2] * 65535.0); goto validXColor; } else if (SetCGColorComponents(entry, 0, &c)) { const size_t n = CGColorGetNumberOfComponents(c); @@ -709,12 +710,12 @@ TkpGetColor( switch (n) { case 4: - color.red = rgba[0] * 65535.0; - color.green = rgba[1] * 65535.0; - color.blue = rgba[2] * 65535.0; + color.red = (unsigned short)(rgba[0] * 65535.0); + color.green = (unsigned short)(rgba[1] * 65535.0); + color.blue = (unsigned short)(rgba[2] * 65535.0); break; case 2: - color.red = color.green = color.blue = rgba[0] * 65535.0; + color.red = color.green = color.blue = (unsigned short)(rgba[0] * 65535.0); break; default: Tcl_Panic("CGColor with %d components", (int) n); @@ -795,7 +796,7 @@ XAllocColor( TCL_UNUSED(Colormap), /* Not used. */ XColor *colorPtr) /* XColor struct to modify. */ { - display->request++; + LastKnownRequestProcessed(display)++; colorPtr->pixel = TkpGetPixel(colorPtr); return 1; } diff --git a/macosx/tkMacOSXConfig.c b/macosx/tkMacOSXConfig.c index 841fc54ed9..68ce85663e 100644 --- a/macosx/tkMacOSXConfig.c +++ b/macosx/tkMacOSXConfig.c @@ -4,8 +4,8 @@ * This module implements the Macintosh system defaults for * the configuration package. * - * Copyright (c) 1997 by Sun Microsystems, Inc. - * Copyright 2001, Apple Inc. + * Copyright © 1997 Sun Microsystems, Inc. + * Copyright © 2001, Apple Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -23,7 +23,7 @@ * return a string representation of the option. * * Results: - * Returns a Tk_Uid that is the string identifier that identifies + * Returns a Tcl_Obj* with the string identifier that identifies * this option. Returns NULL if there are no system defaults * that match this pair. * @@ -39,6 +39,10 @@ TkpGetSystemDefault( const char *dbName, /* The option database name. */ const char *className) /* The name of the option class. */ { + (void)tkwin; + (void)dbName; + (void)className; + return NULL; } diff --git a/macosx/tkMacOSXCursor.c b/macosx/tkMacOSXCursor.c index dc5b61a9c7..df87fd0d1b 100644 --- a/macosx/tkMacOSXCursor.c +++ b/macosx/tkMacOSXCursor.c @@ -3,9 +3,9 @@ * * This file contains Macintosh specific cursor related routines. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c index fc01ef427c..b2022b9540 100644 --- a/macosx/tkMacOSXDebug.c +++ b/macosx/tkMacOSXDebug.c @@ -4,8 +4,8 @@ * Implementation of Macintosh specific functions for debugging MacOS * events, regions, etc... * - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen + * Copyright © 2001-2009, Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 5170545aef..d6201578c2 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -262,7 +262,8 @@ getFileURL( } if (callbackInfo->cmdObj) { Tcl_Obj **objv, **tmpv; - int objc, result = Tcl_ListObjGetElements(callbackInfo->interp, + int objc; + int result = Tcl_ListObjGetElements(callbackInfo->interp, callbackInfo->cmdObj, &objc, &objv); if (result == TCL_OK && objc) { @@ -294,7 +295,8 @@ getFileURL( if (callbackInfo->cmdObj) { Tcl_Obj **objv, **tmpv; - int objc, result = Tcl_ListObjGetElements(callbackInfo->interp, + int objc; + int result = Tcl_ListObjGetElements(callbackInfo->interp, callbackInfo->cmdObj, &objc, &objv); if (result == TCL_OK && objc) { @@ -316,7 +318,7 @@ getFileURL( - (void)selectFormat:(id)sender { NSPopUpButton *button = (NSPopUpButton *)sender; - filterInfo.fileTypeIndex = [button indexOfSelectedItem]; + filterInfo.fileTypeIndex = (NSUInteger)[button indexOfSelectedItem]; if ([[filterInfo.fileTypeAllowsAll objectAtIndex:filterInfo.fileTypeIndex] boolValue]) { [openpanel setAllowsOtherFileTypes:YES]; @@ -340,7 +342,7 @@ getFileURL( - (void)saveFormat:(id)sender { NSPopUpButton *button = (NSPopUpButton *)sender; - filterInfo.fileTypeIndex = [button indexOfSelectedItem]; + filterInfo.fileTypeIndex = (NSUInteger)[button indexOfSelectedItem]; if ([[filterInfo.fileTypeAllowsAll objectAtIndex:filterInfo.fileTypeIndex] boolValue]) { [savepanel setAllowsOtherFileTypes:YES]; @@ -691,7 +693,8 @@ Tk_GetOpenFileObjCmd( Tk_Window tkwin = (Tk_Window)clientData; char *str; int i, result = TCL_ERROR, haveParentOption = 0; - int index, len, multiple = 0; + int index, multiple = 0; + int len; Tcl_Obj *cmdObj = NULL, *typeVariablePtr = NULL, *fileTypesPtr = NULL; NSString *directory = nil, *filename = nil; NSString *message = nil, *title = nil; @@ -789,7 +792,7 @@ Tk_GetOpenFileObjCmd( [message release]; } - [openpanel setAllowsMultipleSelection:multiple]; + [openpanel setAllowsMultipleSelection:multiple != 0]; if (parseFileFilters(interp, fileTypesPtr, typeVariablePtr) != TCL_OK) { goto end; @@ -820,7 +823,7 @@ Tk_GetOpenFileObjCmd( * and open the accessory view. */ - [popupButton selectItemAtIndex:filterInfo.fileTypeIndex]; + [popupButton selectItemAtIndex:(NSInteger)filterInfo.fileTypeIndex]; /* * On OSX > 10.11, the options are not visible by default. Ergo @@ -963,7 +966,8 @@ Tk_GetSaveFileObjCmd( char *str; int i, result = TCL_ERROR, haveParentOption = 0; int confirmOverwrite = 1; - int index, len; + int index; + int len; Tcl_Obj *cmdObj = NULL, *typeVariablePtr = NULL, *fileTypesPtr = NULL; NSString *directory = nil, *filename = nil, *defaultType = nil; NSString *message = nil, *title = nil; @@ -1093,7 +1097,7 @@ Tk_GetSaveFileObjCmd( initWithFrame:NSMakeRect(50.0, 2, 340, 22.0) pullsDown:NO]; [popupButton addItemsWithTitles:filterInfo.fileTypeLabels]; - [popupButton selectItemAtIndex:filterInfo.fileTypeIndex]; + [popupButton selectItemAtIndex:(NSInteger)filterInfo.fileTypeIndex]; [popupButton setTarget:NSApp]; [popupButton setAction:@selector(saveFormat:)]; [accessoryView addSubview:label]; @@ -1204,7 +1208,8 @@ Tk_ChooseDirectoryObjCmd( Tk_Window tkwin = (Tk_Window)clientData; char *str; int i, result = TCL_ERROR, haveParentOption = 0; - int index, len, mustexist = 0; + int index, mustexist = 0; + int len; Tcl_Obj *cmdObj = NULL; NSString *directory = nil; NSString *message, *title; @@ -1510,7 +1515,7 @@ Tk_MessageBoxObjCmd( } } [[buttons objectAtIndex: [buttons count]-1] setKeyEquivalent: @"\033"]; - [[buttons objectAtIndex: defaultNativeButtonIndex-1] + [[buttons objectAtIndex: (NSUInteger)(defaultNativeButtonIndex-1)] setKeyEquivalent: @"\r"]; if (cmdObj) { if (Tcl_IsShared(cmdObj)) { @@ -1657,7 +1662,7 @@ enum FontchooserOption { - (void) windowDidOrderOffScreen: (NSNotification *)notification { #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif if ([[notification object] isEqual:[[NSFontManager sharedFontManager] fontPanel:NO]]) { @@ -1706,7 +1711,8 @@ FontchooserEvent( fontPanelFont, fontPanelFontAttributes); if (fontObj) { if (fcdPtr->cmdObj) { - int objc, result; + int objc; + int result; Tcl_Obj **objv, **tmpv; result = Tcl_ListObjGetElements(fontchooserInterp, @@ -1817,7 +1823,8 @@ FontchooserConfigureCmd( Tk_Window tkwin = (Tk_Window)clientData; FontchooserData *fcdPtr = (FontchooserData *)Tcl_GetAssocData(interp, "::tk::fontchooser", NULL); - int i, r = TCL_OK; + int i; + int r = TCL_OK; /* * With no arguments we return all the options in a dict @@ -1839,7 +1846,8 @@ FontchooserConfigureCmd( } for (i = 1; i < objc; i += 2) { - int optionIndex, len; + int optionIndex; + int len; if (Tcl_GetIndexFromObjStruct(interp, objv[i], fontchooserOptionStrings, sizeof(char *), "option", 0, &optionIndex) != TCL_OK) { diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 874d3cc575..7092611a72 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -4,10 +4,10 @@ * This file contains functions that draw to windows. Many of thees * functions emulate Xlib functions. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009 Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2014-2020 Marc Culler. + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2014-2020 Marc Culler. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -133,7 +133,7 @@ TkMacOSXGetNSImageFromTkImage( { Pixmap pixmap; NSImage *nsImage; - if (width == 0 || height == 0) { + if (width <= 0 || height <= 0) { return nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0,0)]; } pixmap = Tk_GetPixmap(display, None, width, height, 0); @@ -175,7 +175,7 @@ TkMacOSXGetNSImageFromBitmap( gc->background = transparentColor; XSetClipOrigin(display, gc, 0, 0); - XCopyPlane(display, bitmap, pixmap, gc, 0, 0, width, height, 0, 0, 1); + XCopyPlane(display, bitmap, pixmap, gc, 0, 0, (unsigned)width, (unsigned)height, 0, 0, 1); gc->background = origBackground; nsImage = CreateNSImageFromPixmap(pixmap, width, height); Tk_FreePixmap(display, pixmap); @@ -248,7 +248,6 @@ TkMacOSXGetCGContextForDrawable( if (macDraw && (macDraw->flags & TK_IS_PIXMAP) && !macDraw->context) { const size_t bitsPerComponent = 8; - size_t bitsPerPixel, bytesPerRow, len; CGColorSpaceRef colorspace = NULL; CGBitmapInfo bitmapInfo = #ifdef __LITTLE_ENDIAN__ @@ -256,25 +255,17 @@ TkMacOSXGetCGContextForDrawable( #else kCGBitmapByteOrderDefault; #endif - char *data; CGRect bounds = CGRectMake(0, 0, macDraw->size.width, macDraw->size.height); if (macDraw->flags & TK_IS_BW_PIXMAP) { - bitsPerPixel = 8; bitmapInfo = (CGBitmapInfo)kCGImageAlphaOnly; } else { colorspace = CGColorSpaceCreateDeviceRGB(); - bitsPerPixel = 32; bitmapInfo |= kCGImageAlphaPremultipliedFirst; } - bytesPerRow = ((size_t) - macDraw->size.width * bitsPerPixel + 127) >> 3 & ~15; - len = macDraw->size.height * bytesPerRow; - data = (char *)ckalloc(len); - bzero(data, len); - macDraw->context = CGBitmapContextCreate(data, macDraw->size.width, - macDraw->size.height, bitsPerComponent, bytesPerRow, + macDraw->context = CGBitmapContextCreate(NULL, (unsigned)macDraw->size.width, + (unsigned)macDraw->size.height, bitsPerComponent, 0, colorspace, bitmapInfo); if (macDraw->context) { CGContextClearRect(macDraw->context, bounds); @@ -419,7 +410,7 @@ XDrawLines( return BadValue; } - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -487,7 +478,7 @@ XDrawSegments( TkMacOSXDrawingContext dc; int i, lw = gc->line_width; - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -539,7 +530,7 @@ XFillPolygon( TkMacOSXDrawingContext dc; int i; - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -603,7 +594,7 @@ XDrawRectangle( return BadDrawable; } - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -658,7 +649,7 @@ XDrawRectangles( XRectangle * rectPtr; int i, lw = gc->line_width; - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -711,7 +702,7 @@ XFillRectangles( XRectangle * rectPtr; int i; - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -816,7 +807,7 @@ XDrawArc( return BadDrawable; } - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -887,7 +878,7 @@ XDrawArcs( XArc *arcPtr; int i, lw = gc->line_width; - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -969,7 +960,7 @@ XFillArc( return BadDrawable; } - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -1043,7 +1034,7 @@ XFillArcs( XArc * arcPtr; int i, lw = gc->line_width; - display->request++; + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(d, gc, &dc)) { return BadDrawable; } @@ -1175,6 +1166,8 @@ TkScrollWindow( srcRgn = HIShapeCreateWithRect(&srcRect); dstRgn = HIShapeCreateWithRect(&dstRect); ChkErr(HIShapeDifference, srcRgn, dstRgn, dmgRgn); + CFRelease(dstRgn); + CFRelease(srcRgn); result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; } @@ -1185,10 +1178,6 @@ TkScrollWindow( TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn); - /* - * Mutable shapes are not reference counted, and must be released. - */ - CFRelease(dmgRgn); return result; } @@ -1340,15 +1329,6 @@ TkMacOSXSetupDrawingContext( * Finish configuring the drawing context. */ - drawingHeight = view ? [view bounds].size.height : - CGContextGetClipBoundingBox(dc.context).size.height; - CGAffineTransform t = { - .a = 1, .b = 0, - .c = 0, .d = -1, - .tx = 0, - .ty = drawingHeight - }; - #ifdef TK_MAC_DEBUG_CG fprintf(stderr, "TkMacOSXSetupDrawingContext: pushing GState for %s\n", macDraw->winPtr ? Tk_PathName(macDraw->winPtr) : "None"); @@ -1356,7 +1336,17 @@ TkMacOSXSetupDrawingContext( CGContextSaveGState(dc.context); CGContextSetTextDrawingMode(dc.context, kCGTextFill); - CGContextConcatCTM(dc.context, t); + { /* Restricted scope for t needed for C++ */ + drawingHeight = view ? [view bounds].size.height : + CGContextGetClipBoundingBox(dc.context).size.height; + CGAffineTransform t = { + .a = 1, .b = 0, + .c = 0, .d = -1, + .tx = 0, + .ty = drawingHeight + }; + CGContextConcatCTM(dc.context, t); + } if (dc.clipRgn) { #ifdef TK_MAC_DEBUG_DRAWING diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c index 2f04e74fc0..72f2870247 100644 --- a/macosx/tkMacOSXEmbed.c +++ b/macosx/tkMacOSXEmbed.c @@ -476,6 +476,10 @@ TkMacOSXGetHostToplevel( { TkWindow *contWinPtr, *topWinPtr; + if (!(winPtr && winPtr->privatePtr)) { + return NULL; + } + topWinPtr = winPtr->privatePtr->toplevel->winPtr; if (!Tk_IsEmbedded(topWinPtr)) { return winPtr->privatePtr->toplevel; @@ -486,9 +490,6 @@ TkMacOSXGetHostToplevel( * TODO: Here we should handle out of process embedding. */ - if (!contWinPtr) { - return NULL; - } return TkMacOSXGetHostToplevel(contWinPtr); } @@ -596,7 +597,7 @@ TkpTestembedCmd( if (containerPtr->parent == None) { Tcl_DStringAppendElement(&dString, ""); } else if (all) { - sprintf(buffer, "0x%lx", containerPtr->parent); + snprintf(buffer, sizeof(buffer), "0x%lx", containerPtr->parent); Tcl_DStringAppendElement(&dString, buffer); } else { Tcl_DStringAppendElement(&dString, "XXX"); @@ -700,7 +701,7 @@ TkpGetOtherWindow( * process... */ - if (!(winPtr->flags & TK_BOTH_HALVES)) { + if (!(winPtr && (winPtr->flags & TK_BOTH_HALVES))) { return NULL; } diff --git a/macosx/tkMacOSXEntry.c b/macosx/tkMacOSXEntry.c index 75cd1984c2..286a7fe2d0 100644 --- a/macosx/tkMacOSXEntry.c +++ b/macosx/tkMacOSXEntry.c @@ -3,9 +3,9 @@ * * This file implements the native aqua entry widget. * - * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright 2008-2009, Apple Inc. + * Copyright © 2001 Apple Computer, Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2008-2009 Apple Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -259,10 +259,10 @@ TkpDrawSpinboxButtons( */ bgGC = Tk_GCForColor(sbPtr->entry.highlightBgColorPtr, d); - rects[0].x = Tk_Width(tkwin) - incDecWidth - 1; + rects[0].x = (short)(Tk_Width(tkwin) - incDecWidth - 1); rects[0].y = 0; - rects[0].width = incDecWidth + 1; - rects[0].height = Tk_Height(tkwin); + rects[0].width = (unsigned short)(incDecWidth + 1); + rects[0].height = (unsigned short)Tk_Height(tkwin); XFillRectangles(Tk_Display(tkwin), d, bgGC, rects, 1); if (!TkMacOSXSetupDrawingContext(d, NULL, &dc)) { diff --git a/macosx/tkMacOSXEvent.c b/macosx/tkMacOSXEvent.c index 31a76638d0..74d2d9f4f4 100644 --- a/macosx/tkMacOSXEvent.c +++ b/macosx/tkMacOSXEvent.c @@ -3,9 +3,9 @@ * * This file contains the basic Mac OS X Event handling routines. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009, Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -27,7 +27,7 @@ enum { - (NSEvent *) tkProcessEvent: (NSEvent *) theEvent { #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), theEvent); #endif NSEvent *processedEvent = theEvent; NSEventType type = [theEvent type]; diff --git a/macosx/tkMacOSXFileTypes.c b/macosx/tkMacOSXFileTypes.c index 66e4fbbc17..5df7dddc93 100644 --- a/macosx/tkMacOSXFileTypes.c +++ b/macosx/tkMacOSXFileTypes.c @@ -24,44 +24,33 @@ without generating deprecation warnings. */ #include "tkMacOSXPrivate.h" -#include "tkMacOSXFileTypes.h" -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000 -#import -#endif #define CHARS_TO_OSTYPE(string) (OSType) string[0] << 24 | \ (OSType) string[1] << 16 | \ (OSType) string[2] << 8 | \ (OSType) string[3] -static BOOL initialized = false; -static Tcl_HashTable ostype2identifier; -static void initOSTypeTable(void) { - int newPtr; - Tcl_HashEntry *hPtr; - const IdentifierForOSType *entry; - Tcl_InitHashTable(&ostype2identifier, TCL_ONE_WORD_KEYS); - for (entry = OSTypeDB; entry->ostype != NULL; entry++) { - const char *key = INT2PTR(CHARS_TO_OSTYPE(entry->ostype)); - hPtr = Tcl_CreateHashEntry(&ostype2identifier, key, &newPtr); - if (newPtr) { - Tcl_SetHashValue(hPtr, entry->identifier); - } - } - initialized = true; -} - MODULE_SCOPE NSString *TkMacOSXOSTypeToUTI(OSType ostype) { - if (!initialized) { - initOSTypeTable(); + char string[5]; + string[4] = '\0'; + string[3] = ostype; + string[2] = ostype >> 8; + string[1] = ostype >> 16; + string[0] = ostype >> 24; + NSString *tag = [NSString stringWithCString:string encoding:NSMacOSRomanStringEncoding]; + if (tag == nil) { + return nil; } - Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&ostype2identifier, INT2PTR(ostype)); - if (hPtr) { - char *UTI = Tcl_GetHashValue(hPtr); - return [[NSString alloc] initWithCString:UTI - encoding:NSASCIIStringEncoding]; + NSString *result = nil; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000 + if (@available(macOS 11.0, *)) { + return [UTType typeWithTag:tag tagClass:@"com.apple.ostype" conformingToType:nil].identifier; } - return nil; +#endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < 110000 + result = (NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassOSType, (CFStringRef)tag, NULL); +#endif + return result; } /* @@ -70,9 +59,6 @@ MODULE_SCOPE NSString *TkMacOSXOSTypeToUTI(OSType ostype) { * or a Uniform Type Idenfier. This function can serve as a replacement. */ MODULE_SCOPE NSImage *TkMacOSXIconForFileType(NSString *filetype) { - if (!initialized) { - initOSTypeTable(); - } #if MAC_OS_X_VERSION_MAX_ALLOWED < 110000 // We don't have UTType but iconForFileType is not deprecated, so use it. return [[NSWorkspace sharedWorkspace] iconForFileType:filetype]; @@ -80,6 +66,13 @@ MODULE_SCOPE NSImage *TkMacOSXIconForFileType(NSString *filetype) { // We might have UTType but iconForFileType might be deprecated. if (@available(macOS 11.0, *)) { /* Yes, we do have UTType */ + if (filetype == nil) { + /* + * Bug 9be830f61b: match the behavior of + * [NSWorkspace.sharedWorkspace iconForFileType:nil] + */ + filetype = @"public.data"; + } UTType *uttype = [UTType typeWithIdentifier: filetype]; if (uttype == nil || !uttype.isDeclared) { uttype = [UTType typeWithFilenameExtension: filetype]; diff --git a/macosx/tkMacOSXFileTypes.h b/macosx/tkMacOSXFileTypes.h deleted file mode 100644 index 1c11d298d5..0000000000 --- a/macosx/tkMacOSXFileTypes.h +++ /dev/null @@ -1,144 +0,0 @@ -/* -Apple never published a database of OSType codes for File Types. However, -a database of known OSType codes representing Creators and File Types used on -Apple systems prior to 2003 is available at: - - http://www.lacikam.co.il/tcdb/download/TCDBdata.zip - -Among the 12034 distinct OSType codes for File Types that are listed in the TCDB -database, there are 121 for which the UTTypeCreatePreferredIdentifierForTag -function (deprecated in macOS 12.0) was able to generate a Uniform Type -Identifier on macOS 12.5.1. The mapping from those OSTypes to Uniform Type -identifiers is given by the following array, in which OSTypes are represented as -strings of length 4. -*/ - -typedef struct { - char *ostype; - char *identifier; -} IdentifierForOSType; - -static const IdentifierForOSType OSTypeDB[] = { - {".SGI", "com.sgi.sgi-image"}, - {".WAV", "com.microsoft.waveform-audio"}, - {"8BPS", "com.adobe.photoshop-image"}, - {"ABPR", "com.apple.addressbook.person"}, - {"AIFC", "public.aifc-audio"}, - {"AIFF", "public.aiff-audio"}, - {"APPC", "com.apple.deprecated-application-file"}, - {"APPD", "com.apple.deprecated-application-file"}, - {"APPL", "com.apple.application-bundle"}, - {"ASF_", "com.microsoft.advanced-systems-format"}, - {"ASX_", "com.microsoft.advanced-stream-redirector"}, - {"BMP ", "com.microsoft.bmp"}, - {"BMPf", "com.microsoft.bmp"}, - {"BNDL", "com.apple.generic-bundle"}, - {"DDim", "com.apple.disk-image-raw"}, - {"DICM", "org.nema.dicom"}, - {"DOTM", "org.openxmlformats.wordprocessingml.template.macro-enabled"}, - {"EM3F", "com.apple.logic-song"}, - {"EPSF", "com.adobe.encapsulated-postscript"}, - {"FFIL", "com.apple.font-suitcase"}, - {"FLI ", "public.flc-animation"}, - {"FNDR", "com.apple.legacy.finder-icon"}, - {"GIFf", "com.compuserve.gif"}, - {"HTML", "public.html"}, - {"JPEG", "public.jpeg"}, - {"LWFN", "com.adobe.postscript-lwfn-font"}, - {"MP3 ", "public.mp3"}, - {"MP3!", "public.mp3"}, - {"MP3U", "com.apple.tv.m3u-playlist"}, - {"MPEG", "public.mpeg"}, - {"MPG ", "public.mpeg"}, - {"MPG2", "com.apple.music.mp2"}, - {"MPG3", "public.mp3"}, - {"Midi", "public.midi-audio"}, - {"MooV", "com.apple.quicktime-movie"}, - {"Mp3 ", "public.mp3"}, - {"PAT ", "org.gimp.pat"}, - {"PDF ", "com.adobe.pdf"}, - {"PICT", "com.apple.pict"}, - {"PNGf", "public.png"}, - {"PNRA", "com.real.realaudio"}, - {"PNRM", "com.real.realmedia"}, - {"PNTG", "com.apple.macpaint-image"}, - {"PPOT", "com.microsoft.powerpoint.pot"}, - {"PPSS", "com.microsoft.powerpoint.pps"}, - {"RTF ", "public.rtf"}, - {"SDP ", "public.sdp"}, - {"SIT5", "com.stuffit.archive.sit"}, - {"SLD8", "com.microsoft.powerpoint.ppt"}, - {"Sd2f", "com.digidesign.sd2-audio"}, - {"TEXT", "com.apple.traditional-mac-plain-text"}, - {"TIFF", "public.tiff"}, - {"TPIC", "com.truevision.tga-image"}, - {"ULAW", "public.ulaw-audio"}, - {"VfW ", "public.avi"}, - {"W8BN", "com.microsoft.word.doc"}, - {"W8TN", "com.microsoft.word.dot"}, - {"WAVE", "com.microsoft.waveform-audio"}, - {"XLA5", "com.microsoft.excel.xla"}, - {"XLS8", "com.microsoft.excel.xls"}, - {"XLW8", "com.microsoft.excel.xlw"}, - {"alis", "com.apple.alias-record"}, - {"appe", "com.apple.deprecated-application-file"}, - {"cdev", "com.apple.deprecated-application-file"}, - {"clpp", "com.apple.finder.pictclipping"}, - {"clps", "com.apple.finder.sound-clipping"}, - {"clpt", "com.apple.finder.textclipping"}, - {"clpu", "com.apple.finder.clipping"}, - {"ctrl", "com.apple.legacy.finder-icon"}, - {"dfil", "com.apple.deprecated-application-file"}, - {"dict", "com.apple.document-type.dictionary"}, - {"disk", "public.volume"}, - {"docs", "com.apple.documents-folder"}, - {"dvc!", "public.dv-movie"}, - {"ffil", "com.apple.font-suitcase"}, - {"flpy", "com.apple.storage-removable"}, - {"fold", "public.folder"}, - {"font", "com.apple.legacy.finder-icon"}, - {"grup", "com.apple.user-group"}, - {"hdrv", "com.apple.disk-image-raw"}, - {"hdsk", "com.apple.storage-internal"}, - {"help", "com.apple.help-document"}, - {"hkdb", "com.apple.itunes.db"}, - {"hvpl", "com.apple.music.visual"}, - {"ilaf", "com.apple.afp-internet-location"}, - {"ilfi", "com.apple.file-internet-location"}, - {"ilft", "com.apple.ftp-internet-location"}, - {"ilge", "com.apple.generic-internet-location"}, - {"ilht", "com.apple.web-internet-location"}, - {"ilma", "com.apple.mail-internet-location"}, - {"ilnw", "com.apple.news-internet-location"}, - {"macD", "com.apple.legacy.finder-icon"}, - {"mp3!", "public.mp3"}, - {"mpg3", "public.mp3"}, - {"note", "com.apple.alert-note"}, - {"osas", "com.apple.applescript.script"}, - {"plug", "com.apple.plugin"}, - {"pref", "com.apple.legacy.finder-icon"}, - {"prfb", "com.apple.icon-overlay.private-folder-badge"}, - {"prof", "com.apple.colorsync-profile"}, - {"qtif", "com.apple.quicktime-image"}, - {"sLS8", "com.microsoft.excel.xlt"}, - {"sM3F", "com.apple.logic-song"}, - {"sbBF", "com.apple.finder.burn-folder"}, - {"scrp", "com.apple.legacy.finder-icon"}, - {"sdoc", "com.apple.generic-stationery"}, - {"sfnt", "com.apple.font-suitcase"}, - {"shlb", "com.apple.legacy.finder-icon"}, - {"srvr", "com.apple.file-server"}, - {"svg ", "public.svg-image"}, - {"svgz", "public.svg-image"}, - {"tDoc", "com.apple.documents-folder"}, - {"tfil", "com.apple.font-suitcase"}, - {"trsh", "com.apple.trash-empty"}, - {"ttcf", "public.truetype-collection-font"}, - {"ttro", "com.apple.traditional-mac-plain-text"}, - {"txtn", "com.apple.txn.text-multimedia-data"}, - {"url ", "public.url"}, - {"user", "com.apple.user"}, - {"utxt", "public.utf16-plain-text"}, - {"vCrd", "public.vcard"}, - {NULL, NULL} -}; diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 628782f52d..d413f0b146 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -4,9 +4,9 @@ * Contains the Macintosh implementation of the platform-independent font * package interface. * - * Copyright (c) 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2008-2009 Apple Inc. + * Copyright © 2002-2004 Benjamin Riefenstahl, Benjamin.Riefenstahl@epost.de + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2008-2009 Apple Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -47,7 +47,7 @@ typedef struct { #define MENUITEMFONT_NAME "menu" struct SystemFontMapEntry { - const ThemeFontID id; + ThemeFontID id; const char *systemName; const char *tkName; const char *tkName1; @@ -74,7 +74,7 @@ static const struct SystemFontMapEntry systemFontMap[] = { ThemeFont(MiniSystem, NULL, NULL), { kThemeSystemFontDetail, "systemDetailSystemFont", NULL, NULL }, { kThemeSystemFontDetailEmphasized, "systemDetailEmphasizedSystemFont", NULL, NULL }, - { -1, NULL, NULL, NULL } + { (ThemeFontID)-1, NULL, NULL, NULL } }; #undef ThemeFont @@ -349,9 +349,9 @@ InitFont( nsFont = [nsFont screenFontWithRenderingMode:renderingMode]; GetTkFontAttributesForNSFont(nsFont, faPtr); fmPtr = &fontPtr->font.fm; - fmPtr->ascent = floor([nsFont ascender] + [nsFont leading] + 0.5); - fmPtr->descent = floor(-[nsFont descender] + 0.5); - fmPtr->maxWidth = [nsFont maximumAdvancement].width; + fmPtr->ascent = (int)floor([nsFont ascender] + [nsFont leading] + 0.5); + fmPtr->descent = (int)floor(-[nsFont descender] + 0.5); + fmPtr->maxWidth = (int)[nsFont maximumAdvancement].width; fmPtr->fixed = [nsFont isFixedPitch]; /* Does not work for all fonts */ /* @@ -369,8 +369,8 @@ InitFont( kern = [nsFont advancementForGlyph:glyphs[2]].width - [fontPtr->nsFont advancementForGlyph:glyphs[2]].width; } - descent = floor(-bounds.origin.y + 0.5); - ascent = floor(bounds.size.height + bounds.origin.y + 0.5); + descent = (int)floor(-bounds.origin.y + 0.5); + ascent = (int)floor(bounds.size.height + bounds.origin.y + 0.5); if (ascent > fmPtr->ascent) { fmPtr->ascent = ascent; } @@ -614,7 +614,7 @@ TkpGetFontFromAttributes( /* Set of attributes to match. */ { MacFont *fontPtr; - int points = (int) (TkFontGetPoints(tkwin, faPtr->size) + 0.5); + CGFloat points = floor(TkFontGetPoints(tkwin, faPtr->size) + 0.5); NSFontTraitMask traits = GetNSFontTraitsFromTkFontAttributes(faPtr); NSInteger weight = (faPtr->weight == TK_FW_BOLD ? 9 : 5); NSFont *nsFont; @@ -636,7 +636,7 @@ TkpGetFontFromAttributes( if (tkFontPtr == NULL) { fontPtr = (MacFont *)ckalloc(sizeof(MacFont)); } else { - fontPtr = (MacFont *) tkFontPtr; + fontPtr = (MacFont *)tkFontPtr; TkpDeleteFont(tkFontPtr); } CFRetain(nsFont); /* Always needed to allow unconditional CFRelease below */ @@ -1323,6 +1323,7 @@ TkMacOSXNSFontAttributesForFont( *--------------------------------------------------------------------------- */ +#undef TkMacOSXIsCharacterMissing int TkMacOSXIsCharacterMissing( TCL_UNUSED(Tk_Font), /* The font we are looking in. */ @@ -1365,7 +1366,7 @@ TkMacOSXFontDescriptionForNSFontAndNSFontAttributes( NSStrikethroughStyleAttributeName]; objv[i++] = Tcl_NewStringObj(familyName, -1); - objv[i++] = Tcl_NewWideIntObj([nsFont pointSize]); + objv[i++] = Tcl_NewWideIntObj((Tcl_WideInt)floor([nsFont pointSize] + 0.5)); #define S(s) Tcl_NewStringObj(STRINGIFY(s), (sizeof(STRINGIFY(s))-1)) objv[i++] = (traits & NSBoldFontMask) ? S(bold) : S(normal); objv[i++] = (traits & NSItalicFontMask) ? S(italic) : S(roman); diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 5055f38492..76af97619b 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -3,11 +3,11 @@ * * Implements high level event support for the Macintosh. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2015-2019 Marc Culler - * Copyright (c) 2019 Kevin Walzer/WordTech Communications LLC. + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2015-2019 Marc Culler + * Copyright © 2019 Kevin Walzer/WordTech Communications LLC. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -54,27 +54,30 @@ static void ProcessAppleEvent(ClientData clientData); * Names of the procedures which can be used to process AppleEvents. */ -static const char *openDocumentProc = "::tk::mac::OpenDocument"; -static const char *launchURLProc = "::tk::mac::LaunchURL"; -static const char *printDocProc = "::tk::mac::PrintDocument"; -static const char *scriptFileProc = "::tk::mac::DoScriptFile"; -static const char *scriptTextProc = "::tk::mac::DoScriptText"; +static const char openDocumentProc[] = "::tk::mac::OpenDocument"; +static const char launchURLProc[] = "::tk::mac::LaunchURL"; +static const char printDocProc[] = "::tk::mac::PrintDocument"; +static const char scriptFileProc[] = "::tk::mac::DoScriptFile"; +static const char scriptTextProc[] = "::tk::mac::DoScriptText"; #pragma mark TKApplication(TKHLEvents) @implementation TKApplication(TKHLEvents) - (void) terminate: (id) sender { + (void)sender; [self handleQuitApplicationEvent:Nil withReplyEvent:Nil]; } - (void) superTerminate: (id) sender { + (void) sender; [super terminate:nil]; } - (void) preferences: (id) sender { + (void)sender; [self handleShowPreferencesEvent:Nil withReplyEvent:Nil]; } @@ -82,6 +85,8 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; withReplyEvent: (NSAppleEventDescriptor *)replyEvent { KillEvent *eventPtr; + (void)event; + (void)replyEvent; if (_eventInterp) { /* @@ -92,7 +97,7 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; * quickly as possible. */ - eventPtr = ckalloc(sizeof(KillEvent)); + eventPtr = (KillEvent *)ckalloc(sizeof(KillEvent)); eventPtr->header.proc = ReallyKillMe; eventPtr->interp = _eventInterp; @@ -103,6 +108,9 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; - (void) handleOpenApplicationEvent: (NSAppleEventDescriptor *)event withReplyEvent: (NSAppleEventDescriptor *)replyEvent { + (void)event; + (void)replyEvent; + if (_eventInterp && Tcl_FindCommand(_eventInterp, "::tk::mac::OpenApplication", NULL, 0)){ int code = Tcl_EvalEx(_eventInterp, "::tk::mac::OpenApplication", @@ -116,6 +124,9 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; - (void) handleReopenApplicationEvent: (NSAppleEventDescriptor *)event withReplyEvent: (NSAppleEventDescriptor *)replyEvent { + (void)event; + (void)replyEvent; + [NSApp activateIgnoringOtherApps: YES]; if (_eventInterp && Tcl_FindCommand(_eventInterp, "::tk::mac::ReopenApplication", NULL, 0)) { @@ -130,6 +141,9 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; - (void) handleShowPreferencesEvent: (NSAppleEventDescriptor *)event withReplyEvent: (NSAppleEventDescriptor *)replyEvent { + (void)event; + (void)replyEvent; + if (_eventInterp && Tcl_FindCommand(_eventInterp, "::tk::mac::ShowPreferences", NULL, 0)){ int code = Tcl_EvalEx(_eventInterp, "::tk::mac::ShowPreferences", @@ -153,7 +167,7 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; long count, index; AEKeyword keyword; Tcl_DString pathName; - + (void)replyEvent; /* * Do nothing if we don't have an interpreter. @@ -193,7 +207,7 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; * procedure, passing the paths contained in the AppleEvent as arguments. */ - AppleEventInfo *AEInfo = ckalloc(sizeof(AppleEventInfo)); + AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo)); Tcl_DString *openCommand = &AEInfo->command; Tcl_DStringInit(openCommand); Tcl_DStringAppend(openCommand, openDocumentProc, -1); @@ -237,8 +251,10 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; NSString* file = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; const char *printFile = [file UTF8String]; - AppleEventInfo *AEInfo = ckalloc(sizeof(AppleEventInfo)); + AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo)); Tcl_DString *printCommand = &AEInfo->command; + (void)replyEvent; + Tcl_DStringInit(printCommand); Tcl_DStringAppend(printCommand, printDocProc, -1); Tcl_DStringAppendElement(printCommand, printFile); @@ -272,14 +288,14 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; err = AEGetParamPtr(theDesc, keyDirectObject, typeWildCard, &initialType, NULL, 0, NULL); if (err != noErr) { - sprintf(errString, "AEDoScriptHandler: GetParamDesc error %d", (int)err); + snprintf(errString, sizeof(errString), "AEDoScriptHandler: GetParamDesc error %d", (int)err); AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar, errString, strlen(errString)); return; } if (MissedAnyParameters((AppleEvent*)theDesc)) { - sprintf(errString, "AEDoScriptHandler: extra parameters"); + snprintf(errString, sizeof(errString), "AEDoScriptHandler: extra parameters"); AEPutParamPtr((AppleEvent*)[replyEvent aeDesc], keyErrorString, typeChar,errString, strlen(errString)); return; @@ -299,7 +315,7 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; URLBuffer[actual] = '\0'; NSString *urlString = [NSString stringWithUTF8String:(char*)URLBuffer]; NSURL *fileURL = [NSURL URLWithString:urlString]; - AppleEventInfo *AEInfo = ckalloc(sizeof(AppleEventInfo)); + AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo)); Tcl_DString *scriptFileCommand = &AEInfo->command; Tcl_DStringInit(scriptFileCommand); Tcl_DStringAppend(scriptFileCommand, scriptFileProc, -1); @@ -320,15 +336,15 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; */ if (actual > 0) { - char *data = ckalloc(actual + 1); + char *data = (char *)ckalloc(actual + 1); if (noErr == AEGetParamPtr(theDesc, keyDirectObject, typeUTF8Text, &type, data, actual, NULL)) { - data[actual] = '\0'; - AppleEventInfo *AEInfo = ckalloc(sizeof(AppleEventInfo)); - Tcl_DString *scriptTextCommand = &AEInfo->command; - Tcl_DStringInit(scriptTextCommand); - Tcl_DStringAppend(scriptTextCommand, scriptTextProc, -1); + data[actual] = '\0'; + AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo)); + Tcl_DString *scriptTextCommand = &AEInfo->command; + Tcl_DStringInit(scriptTextCommand); + Tcl_DStringAppend(scriptTextCommand, scriptTextProc, -1); Tcl_DStringAppendElement(scriptTextCommand, data); AEInfo->interp = _eventInterp; AEInfo->procedure = scriptTextProc; @@ -351,8 +367,10 @@ static const char *scriptTextProc = "::tk::mac::DoScriptText"; NSString* url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; const char *cURL=[url UTF8String]; - AppleEventInfo *AEInfo = ckalloc(sizeof(AppleEventInfo)); + AppleEventInfo *AEInfo = (AppleEventInfo *)ckalloc(sizeof(AppleEventInfo)); Tcl_DString *launchCommand = &AEInfo->command; + (void)replyEvent; + Tcl_DStringInit(launchCommand); Tcl_DStringAppend(launchCommand, launchURLProc, -1); Tcl_DStringAppendElement(launchCommand, cURL); @@ -460,7 +478,7 @@ static void ProcessAppleEvent( void TkMacOSXInitAppleEvents( - Tcl_Interp *interp) /* not used */ + TCL_UNUSED(Tcl_Interp *)) { NSAppleEventManager *aeManager = [NSAppleEventManager sharedAppleEventManager]; static Boolean initialized = FALSE; @@ -620,7 +638,6 @@ MissedAnyParameters( return (err != errAEDescNotFound); } - /* * Local Variables: diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index fc0ffdf42e..368a3ed1d0 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -114,21 +114,20 @@ _XInitImageFuncPtrs( static void ReleaseData( void *info, TCL_UNUSED(const void *), /* data */ - TCL_UNUSED(size_t)) /* size */ + TCL_UNUSED(size_t)) /* size */ { ckfree(info); } -CGImageRef +static CGImageRef TkMacOSXCreateCGImageWithXImage( XImage *image, - uint32_t alphaInfo) + uint32_t bitmapInfo) { CGImageRef img = NULL; size_t bitsPerComponent, bitsPerPixel; size_t len = image->bytes_per_line * image->height; const CGFloat *decode = NULL; - CGBitmapInfo bitmapInfo; CGDataProviderRef provider = NULL; char *data = NULL; CGDataProviderReleaseDataCallback releaseData = ReleaseData; @@ -184,7 +183,6 @@ TkMacOSXCreateCGImageWithXImage( CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); bitsPerComponent = 8; bitsPerPixel = 32; - bitmapInfo = kCGBitmapByteOrder32Big | alphaInfo; data = (char *)ckalloc(len); if (data) { memcpy(data, image->data + image->xoffset, len); @@ -388,7 +386,7 @@ ImagePutPixel( XImage * XCreateImage( Display* display, - TCL_UNUSED(Visual*), /* visual */ + TCL_UNUSED(Visual*), /* visual */ unsigned int depth, int format, int offset, @@ -400,7 +398,7 @@ XCreateImage( { XImage *ximage; - display->request++; + LastKnownRequestProcessed(display)++; ximage = (XImage *)ckalloc(sizeof(XImage)); ximage->height = height; @@ -422,7 +420,7 @@ XCreateImage( ximage->bitmap_pad = bitmap_pad; } else { /* - * Use 16 byte alignment for best Quartz perfomance. + * Use 16 byte alignment for best Quartz performance. */ ximage->bitmap_pad = 128; @@ -483,8 +481,8 @@ XCreateImage( *---------------------------------------------------------------------- */ -#define USE_ALPHA kCGImageAlphaLast -#define IGNORE_ALPHA kCGImageAlphaNoneSkipLast +#define USE_ALPHA (kCGImageAlphaLast | kCGBitmapByteOrder32Big) +#define IGNORE_ALPHA (kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little) static int TkMacOSXPutImage( @@ -503,7 +501,8 @@ TkMacOSXPutImage( TkMacOSXDrawingContext dc; MacDrawable *macDraw = (MacDrawable *)drawable; int result = Success; - display->request++; + + LastKnownRequestProcessed(display)++; if (!TkMacOSXSetupDrawingContext(drawable, gc, &dc)) { return BadDrawable; } @@ -747,7 +746,7 @@ XGetImage( int y, unsigned int width, unsigned int height, - TCL_UNUSED(unsigned long), /* plane_mask */ + TCL_UNUSED(unsigned long), /* plane_mask */ int format) { NSBitmapImageRep* bitmapRep = nil; @@ -775,7 +774,6 @@ XGetImage( bitmap_fmt = [bitmapRep bitmapFormat]; size = [bitmapRep bytesPerPlane]; bytes_per_row = [bitmapRep bytesPerRow]; - bitmap = (char *)ckalloc(size); if ((bitmap_fmt != 0 && bitmap_fmt != NSAlphaFirstBitmapFormat) || [bitmapRep samplesPerPixel] != 4 || [bitmapRep isPlanar] != 0 @@ -785,6 +783,7 @@ XGetImage( [bitmapRep release]; return NULL; } + bitmap = (char *)ckalloc(size); memcpy(bitmap, (char *)[bitmapRep bitmapData], size); [bitmapRep release]; @@ -858,7 +857,7 @@ XCopyArea( CGImageRef img = NULL; CGRect bounds, srcRect, dstRect; - display->request++; + LastKnownRequestProcessed(display)++; if (!width || !height) { return BadDrawable; } @@ -932,7 +931,7 @@ XCopyPlane( MacDrawable *srcDraw = (MacDrawable *)src; MacDrawable *dstDraw = (MacDrawable *)dst; CGRect bounds, srcRect, dstRect; - display->request++; + LastKnownRequestProcessed(display)++; if (!width || !height) { /* TkMacOSXDbgMsg("Drawing of empty area requested"); */ return BadDrawable; diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c index a9b459af7e..e6a68356c4 100644 --- a/macosx/tkMacOSXInit.c +++ b/macosx/tkMacOSXInit.c @@ -4,10 +4,10 @@ * This file contains Mac OS X -specific interpreter initialization * functions. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright (c) 2017 Marc Culler + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen + * Copyright © 2017 Marc Culler * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -47,36 +47,36 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, @synthesize tkPointerWindow = _tkPointerWindow; - (void) setTkPointerWindow: (TkWindow *)winPtr { - if (_tkPointerWindow) { - Tcl_Release(_tkPointerWindow); - } if (winPtr) { Tcl_Preserve(winPtr); } + if (_tkPointerWindow) { + Tcl_Release(_tkPointerWindow); + } _tkPointerWindow = winPtr; return; } @synthesize tkEventTarget = _tkEventTarget; - (void) setTkEventTarget: (TkWindow *)winPtr { - if (_tkEventTarget) { - Tcl_Release(_tkEventTarget); - } if (winPtr) { Tcl_Preserve(winPtr); } + if (_tkEventTarget) { + Tcl_Release(_tkEventTarget); + } _tkEventTarget = winPtr; return; } @synthesize tkDragTarget = _tkDragTarget; - (void) setTkDragTarget: (TkWindow *)winPtr { - if (_tkDragTarget) { - Tcl_Release(_tkDragTarget); - } if (winPtr) { Tcl_Preserve(winPtr); } + if (_tkDragTarget) { + Tcl_Release(_tkDragTarget); + } _tkDragTarget = winPtr; return; } @@ -112,7 +112,7 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, #ifdef TK_MAC_DEBUG_NOTIFICATIONS - (void) _postedNotification: (NSNotification *) notification { - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); } #endif @@ -130,6 +130,16 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, #undef observe } + +/* + * Fix for 10b38a7a7c. + */ + +- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app +{ + return YES; +} + -(void)applicationWillFinishLaunching:(NSNotification *)aNotification { (void)aNotification; @@ -178,6 +188,7 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, /* * Initialize the graphics context. */ + TkMacOSXUseAntialiasedText(_eventInterp, -1); TkMacOSXInitCGDrawing(_eventInterp, TRUE, 0); @@ -249,8 +260,8 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, #else NSOperatingSystemVersion systemVersion; systemVersion = [[NSProcessInfo processInfo] operatingSystemVersion]; - majorVersion = systemVersion.majorVersion; - minorVersion = systemVersion.minorVersion; + majorVersion = (int)systemVersion.majorVersion; + minorVersion = (int)systemVersion.minorVersion; #endif if (majorVersion == 10 && minorVersion == 16) { @@ -266,7 +277,7 @@ static int TkMacOSXGetAppPathCmd(ClientData cd, Tcl_Interp *ip, struct utsname name; char *endptr; if (uname(&name) == 0) { - majorVersion = strtol(name.release, &endptr, 10) - 9; + majorVersion = (int)strtol(name.release, &endptr, 10) - 9; minorVersion = 0; } } @@ -421,7 +432,7 @@ TCL_NORETURN void TkpExitProc( if (doCleanup == YES) { [(TKApplication *)NSApp superTerminate:nil]; /* Should not return. */ } - exit((long)clientdata); /* Convince the compiler that we don't return. */ + exit((int)PTR2INT(clientdata)); /* Convince the compiler that we don't return. */ } #endif @@ -645,12 +656,10 @@ TkpInit( if (tkLibPath[0] != '\0') { Tcl_SetVar2(interp, "tk_library", NULL, tkLibPath, TCL_GLOBAL_ONLY); } - if (scriptPath[0] != '\0') { Tcl_SetVar2(interp, "auto_path", NULL, scriptPath, TCL_GLOBAL_ONLY|TCL_LIST_ELEMENT|TCL_APPEND_VALUE); } - Tcl_CreateObjCommand(interp, "::tk::mac::standardAboutPanel", TkMacOSXStandardAboutPanelObjCmd, NULL, NULL); Tcl_CreateObjCommand(interp, "::tk::mac::iconBitmap", diff --git a/macosx/tkMacOSXInt.h b/macosx/tkMacOSXInt.h index 61771a0ee0..e94ce0ee8b 100644 --- a/macosx/tkMacOSXInt.h +++ b/macosx/tkMacOSXInt.h @@ -178,7 +178,6 @@ MODULE_SCOPE TkMacOSXEmbedHandler *tkMacOSXEmbedHandler; MODULE_SCOPE void TkMacOSXDefaultStartupScript(void); MODULE_SCOPE void TkpClipDrawableToRect(Display *display, Drawable d, int x, int y, int width, int height); -MODULE_SCOPE void TkpShiftButton(NSButton *button, NSPoint delta); MODULE_SCOPE Bool TkTestLogDisplay(Drawable drawable); /* diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index 961072f6d8..7b879040fc 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -4,10 +4,10 @@ * This file implements functions that decode & handle keyboard events on * MacOS X. * - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2012 Adrian Robert. - * Copyright 2015-2020 Marc Culler. + * Copyright © 2001-2009, Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2012 Adrian Robert. + * Copyright © 2015-2020 Marc Culler. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -47,7 +47,7 @@ static NSUInteger textInputModifiers; - (NSEvent *) tkProcessKeyEvent: (NSEvent *) theEvent { #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), theEvent); #endif NSWindow *w = [theEvent window]; TkWindow *winPtr = TkMacOSXGetTkWindow(w), *grabWinPtr, *focusWinPtr; @@ -146,7 +146,7 @@ static NSUInteger textInputModifiers; #if defined(TK_MAC_DEBUG_EVENTS) || NS_KEYLOG == 1 TKLog(@"-[%@(%p) %s] repeat=%d mods=%x char=%x code=%lu c=%d type=%d", - [self class], self, _cmd, + [self class], self, sel_getName(_cmd), (type == NSKeyDown) && [theEvent isARepeat], modifiers, keychar, virt, w, type); #endif @@ -400,6 +400,9 @@ static NSUInteger textInputModifiers; - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)theRange actualRange:(NSRangePointer)thePointer { + (void)theRange; + (void)thePointer; + return nil; } @@ -414,9 +417,13 @@ static NSUInteger textInputModifiers; replacementRange: (NSRange)repRange { TkWindow *winPtr = TkMacOSXGetTkWindow([self window]); + if (!winPtr) { + return; + } Tk_Window focusWin = (Tk_Window)winPtr->dispPtr->focusPtr; NSString *temp; NSString *str; + (void)selRange; str = ([aString isKindOfClass: [NSAttributedString class]]) ? [aString string] : aString; @@ -493,6 +500,9 @@ static NSUInteger textInputModifiers; { NSRect rect; NSPoint pt; + (void)theRange; + (void)thePointer; + pt.x = caret_x; pt.y = caret_y; @@ -547,6 +557,8 @@ static NSUInteger textInputModifiers; - (NSUInteger)characterIndexForPoint: (NSPoint)thePoint { + (void)thePoint; + if (NS_KEYLOG) { TKLog(@"characterIndexForPoint request"); } @@ -556,6 +568,8 @@ static NSUInteger textInputModifiers; - (NSAttributedString *)attributedSubstringFromRange: (NSRange)theRange { static NSAttributedString *str = nil; + (void)theRange; + if (str == nil) { str = [NSAttributedString new]; } @@ -660,9 +674,12 @@ setXEventPoint( local.x -= contPtr->wmInfoPtr->xInParent; local.y -= contPtr->wmInfoPtr->yInParent; } else { - TkWindow *topPtr = TkMacOSXGetHostToplevel(winPtr)->winPtr; - local.x -= (topPtr->wmInfoPtr->xInParent + contPtr->changes.x); - local.y -= (topPtr->wmInfoPtr->yInParent + contPtr->changes.y); + MacDrawable *topMacWin = TkMacOSXGetHostToplevel(winPtr); + if (topMacWin) { + TkWindow *topPtr = topMacWin->winPtr; + local.x -= (topPtr->wmInfoPtr->xInParent + contPtr->changes.x); + local.y -= (topPtr->wmInfoPtr->yInParent + contPtr->changes.y); + } } } else if (winPtr->wmInfoPtr != NULL) { local.x -= winPtr->wmInfoPtr->xInParent; @@ -707,6 +724,10 @@ XGrabKeyboard( { keyboardGrabWinPtr = Tk_IdToWindow(display, grab_window); TkWindow *captureWinPtr = (TkWindow *) TkpGetCapture(); + (void)owner_events; + (void)pointer_mode; + (void)keyboard_mode; + (void)time; if (keyboardGrabWinPtr && captureWinPtr) { NSWindow *w = TkMacOSXGetNSWindowForDrawable(grab_window); @@ -749,6 +770,9 @@ XUngrabKeyboard( Display* display, Time time) { + (void)display; + (void)time; + if (modalSession) { [NSApp endModalSession:modalSession]; modalSession = nil; diff --git a/macosx/tkMacOSXKeyboard.c b/macosx/tkMacOSXKeyboard.c index fe2991e5e5..2a19146c9f 100644 --- a/macosx/tkMacOSXKeyboard.c +++ b/macosx/tkMacOSXKeyboard.c @@ -3,10 +3,10 @@ * * Routines to support keyboard events on the Macintosh. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright (c) 2020 Marc Culler + * Copyright © 1995-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009, Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen + * Copyright © 2020 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -153,9 +153,7 @@ static int KeyDataToUnicode(UniChar *uniChars, int maxChars, { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); -#else - (void)notification; + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif keyboardChanged = YES; UpdateKeymaps(); diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index c10944ae74..b5104222bb 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -3,10 +3,10 @@ * * This module implements the Mac-platform specific features of menus. * - * Copyright (c) 1996-1997 Sun Microsystems, Inc. - * Copyright (c) 2001-2009 Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen - * Copyright (c) 2012 Adrian Robert. + * Copyright © 1996-1997 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen + * Copyright © 2012 Adrian Robert. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -167,7 +167,6 @@ static int ModifierCharWidth(Tk_Font tkfont); TKBackgroundLoop *backgroundLoop = nil; - #pragma mark TKMenu /* @@ -501,7 +500,7 @@ static Bool runMenuCommand = true; { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif if (backgroundLoop) { [backgroundLoop cancel]; @@ -522,7 +521,7 @@ static Bool runMenuCommand = true; { (void)notification; #ifdef TK_MAC_DEBUG_NOTIFICATIONS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), notification); #endif if (backgroundLoop) { [backgroundLoop cancel]; @@ -757,9 +756,10 @@ TkpConfigureMenuEntry( [menuItem setImage:image]; if ((!image || mePtr->compound != COMPOUND_NONE) && mePtr->labelPtr && mePtr->labelLength) { - title = [[TKNSString alloc] + title = [[[TKNSString alloc] initWithTclUtfBytes:Tcl_GetString(mePtr->labelPtr) - length:mePtr->labelLength]; + length:mePtr->labelLength] + autorelease]; if ([title hasSuffix:@"..."]) { title = [NSString stringWithFormat:@"%@%C", [title substringToIndex:[title length] - 3], 0x2026]; @@ -809,6 +809,7 @@ TkpConfigureMenuEntry( attributedTitle = [[NSAttributedString alloc] initWithString:title attributes:attributes]; [menuItem setAttributedTitle:attributedTitle]; + [attributedTitle release]; [menuItem setEnabled:(mePtr->state != ENTRY_DISABLED)]; [menuItem setState:((mePtr->type == CHECK_BUTTON_ENTRY || mePtr->type == RADIO_BUTTON_ENTRY) && mePtr->indicatorOn && @@ -887,14 +888,17 @@ TkpDestroyMenuEntry( TKMenu *menu; NSInteger index; - if (mePtr->platformEntryData && mePtr->menuPtr->platformData) { - menu = (TKMenu *) mePtr->menuPtr->platformData; + if (mePtr->platformEntryData) { menuItem = (NSMenuItem *) mePtr->platformEntryData; - index = [menu indexOfItem:menuItem]; + if (mePtr->menuPtr->platformData) { + menu = (TKMenu *) mePtr->menuPtr->platformData; + index = [menu indexOfItem:menuItem]; - if (index > -1) { - [menu removeItemAtIndex:index]; + if (index > -1) { + [menu removeItemAtIndex:index]; + } } + [menuItem setTag:(NSInteger) NULL]; [menuItem release]; mePtr->platformEntryData = NULL; } @@ -1048,7 +1052,7 @@ TkpPostTearoffMenu( * at the given coordinates. */ - if (index >= menuPtr->numEntries) { + if (index < 0 || index >= menuPtr->numEntries) { index = menuPtr->numEntries - 1; } if (index >= 0) { diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c index 9fcd3b87fd..7a0e937317 100644 --- a/macosx/tkMacOSXMenus.c +++ b/macosx/tkMacOSXMenus.c @@ -330,7 +330,11 @@ GetWidgetDemoPath( Tcl_NewStringObj("widget", 6) }; Tcl_IncrRefCount(libpath); + Tcl_IncrRefCount(demo[0]); + Tcl_IncrRefCount(demo[1]); result = Tcl_FSJoinToPath(libpath, 2, demo); + Tcl_DecrRefCount(demo[1]); + Tcl_DecrRefCount(demo[0]); Tcl_DecrRefCount(libpath); } else { Tcl_ResetResult(interp); diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index e33f7879f1..9b88eb932e 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -4,8 +4,8 @@ * This file implements functions that decode & handle mouse events on * MacOS X. * - * Copyright (c) 2001-2009, Apple Inc. - * Copyright (c) 2005-2009 Daniel A. Steffen + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2005-2009 Daniel A. Steffen * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -98,7 +98,7 @@ enum { static NSTimeInterval timestamp = 0; #ifdef TK_MAC_DEBUG_EVENTS - TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, theEvent); + TKLog(@"-[%@(%p) %s] %@", [self class], self, sel_getName(_cmd), theEvent); #endif /* @@ -308,6 +308,7 @@ enum { if ([NSApp tkDragTarget]) { TkWindow *dragPtr = (TkWindow *) [NSApp tkDragTarget]; TKWindow *dragWindow = nil; + MacDrawable *topMacWin; if (dragPtr) { dragWindow = (TKWindow *)TkMacOSXGetNSWindowForDrawable( dragPtr->window); @@ -317,7 +318,10 @@ enum { target = NULL; return theEvent; } - winPtr = TkMacOSXGetHostToplevel((TkWindow *) [NSApp tkDragTarget])->winPtr; + topMacWin = TkMacOSXGetHostToplevel(dragPtr); + if (topMacWin) { + winPtr = topMacWin->winPtr; + } } else if (eventType == NSScrollWheel) { winPtr = scrollTarget; } else { @@ -357,9 +361,12 @@ enum { local.x -= contPtr->wmInfoPtr->xInParent; local.y -= contPtr->wmInfoPtr->yInParent; } else { - TkWindow *topPtr = TkMacOSXGetHostToplevel(winPtr)->winPtr; - local.x -= (topPtr->wmInfoPtr->xInParent + contPtr->changes.x); - local.y -= (topPtr->wmInfoPtr->yInParent + contPtr->changes.y); + MacDrawable *topMacWin = TkMacOSXGetHostToplevel(winPtr); + if (topMacWin) { + TkWindow* topPtr = topMacWin->winPtr; + local.x -= (topPtr->wmInfoPtr->xInParent + contPtr->changes.x); + local.y -= (topPtr->wmInfoPtr->yInParent + contPtr->changes.y); + } } } else { diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 3cb6c484d2..ecea0179f8 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -520,7 +520,6 @@ TkMacOSXEventsCheckProc( int flags) { NSString *runloopMode = [[NSRunLoop currentRunLoop] currentMode]; - int eventsFound = 0; /* * runloopMode will be nil if we are in a Tcl event loop. @@ -566,7 +565,6 @@ TkMacOSXEventsCheckProc( NSEvent *processedEvent = [NSApp tkProcessEvent:currentEvent]; if (processedEvent) { - eventsFound++; #ifdef TK_MAC_DEBUG_EVENTS TKLog(@" event: %@", currentEvent); diff --git a/macosx/tkMacOSXPort.h b/macosx/tkMacOSXPort.h index dbc9e2b949..2a50663fc1 100644 --- a/macosx/tkMacOSXPort.h +++ b/macosx/tkMacOSXPort.h @@ -129,11 +129,11 @@ #undef XGrabServer #define XGrabServer(display) (0) #undef XNoOp -#define XNoOp(display) (display->request++,0) +#define XNoOp(display) (LastKnownRequestProcessed(display)++,0) #undef XUngrabServer #define XUngrabServer(display) (0) #undef XSynchronize -#define XSynchronize(display, onoff) (display->request++,NULL) +#define XSynchronize(display, onoff) (LastKnownRequestProcessed(display)++,NULL) #undef XVisualIDFromVisual #define XVisualIDFromVisual(visual) (visual->visualid) @@ -162,7 +162,7 @@ */ #define TkpPrintWindowId(buf,w) \ - sprintf((buf), "0x%lx", (unsigned long) (w)) + snprintf((buf), TCL_INTEGER_SPACE, "0x%lx", (unsigned long) (w)) /* * Turn off Tk double-buffering as Aqua windows are already double-buffered. diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index a5055525c0..2802d40677 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -217,18 +217,8 @@ typedef struct TkMacOSXDrawingContext { MODULE_SCOPE HIShapeRef TkMacOSXGetNativeRegion(TkRegion r); MODULE_SCOPE void TkMacOSXSetWithNativeRegion(TkRegion r, HIShapeRef rgn); -MODULE_SCOPE HIShapeRef TkMacOSXHIShapeCreateEmpty(void); -MODULE_SCOPE HIMutableShapeRef TkMacOSXHIShapeCreateMutableWithRect( - const CGRect *inRect); -MODULE_SCOPE OSStatus TkMacOSXHIShapeSetWithShape( - HIMutableShapeRef inDestShape, - HIShapeRef inSrcShape); MODULE_SCOPE OSStatus TkMacOSHIShapeDifferenceWithRect( HIMutableShapeRef inShape, const CGRect *inRect); -MODULE_SCOPE OSStatus TkMacOSHIShapeUnionWithRect(HIMutableShapeRef inShape, - const CGRect *inRect); -MODULE_SCOPE OSStatus TkMacOSHIShapeUnion(HIShapeRef inShape1, - HIShapeRef inShape2, HIMutableShapeRef outResult); MODULE_SCOPE int TkMacOSXCountRectsInRegion(HIShapeRef shape); MODULE_SCOPE void TkMacOSXPrintRectsInRegion(HIShapeRef shape); /* diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c index fbb41cb953..bf3f7c733d 100644 --- a/macosx/tkMacOSXRegion.c +++ b/macosx/tkMacOSXRegion.c @@ -12,7 +12,6 @@ */ #include "tkMacOSXPrivate.h" -static void RetainRegion(TkRegion r); static void ReleaseRegion(TkRegion r); #ifdef DEBUG @@ -29,7 +28,7 @@ static int totalRegionRetainCount = 0; * * TkCreateRegion -- * - * Implements the equivelent of the X window function XCreateRegion. See + * Implements the equivalent of the X window function XCreateRegion. See * Xwindow documentation for more details. * * Results: @@ -45,8 +44,8 @@ TkRegion TkCreateRegion(void) { TkRegion region = (TkRegion) HIShapeCreateMutable(); - DebugLog("Created region: total regions = %d\n", ++totalRegions); - RetainRegion(region); + DebugLog("Created region: total regions = %d, total count is %d\n", + ++totalRegions, ++totalRegionRetainCount); return region; } @@ -55,7 +54,7 @@ TkCreateRegion(void) * * TkDestroyRegion -- * - * Implements the equivelent of the X window function XDestroyRegion. See + * Implements the equivalent of the X window function XDestroyRegion. See * Xwindow documentation for more details. * * Results: @@ -139,7 +138,7 @@ TkSubtractRegion( * * TkUnionRectWithRegion -- * - * Implements the equivelent of the X window function + * Implements the equivalent of the X window function * XUnionRectWithRegion. See Xwindow documentation for more details. * * Results: @@ -161,12 +160,12 @@ TkUnionRectWithRegion( rectangle->width, rectangle->height); if (src_region == dest_region_return) { - ChkErr(TkMacOSHIShapeUnionWithRect, + ChkErr(HIShapeUnionWithRect, (HIMutableShapeRef) dest_region_return, &r); } else { HIShapeRef rectRgn = HIShapeCreateWithRect(&r); - ChkErr(TkMacOSHIShapeUnion, rectRgn, (HIShapeRef) src_region, + ChkErr(HIShapeUnion, rectRgn, (HIShapeRef) src_region, (HIMutableShapeRef) dest_region_return); CFRelease(rectRgn); } @@ -201,7 +200,7 @@ TkMacOSXIsEmptyRegion( * * TkRectInRegion -- * - * Implements the equivelent of the X window function XRectInRegion. See + * Implements the equivalent of the X window function XRectInRegion. See * Xwindow documentation for more details. * * Results: @@ -237,7 +236,7 @@ TkRectInRegion( * * TkClipBox -- * - * Implements the equivelent of the X window function XClipBox. See + * Implements the equivalent of the X window function XClipBox. See * Xwindow documentation for more details. * * Results: @@ -331,30 +330,6 @@ TkpBuildRegionFromAlphaData( } } -/* - *---------------------------------------------------------------------- - * - * RetainRegion -- - * - * Increases reference count of region. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static void -RetainRegion( - TkRegion r) -{ - CFRetain(r); - DebugLog("Retained region: total count is %d\n", ++totalRegionRetainCount); -} - /* *---------------------------------------------------------------------- * @@ -446,7 +421,7 @@ TkMacOSXSetWithNativeRegion( TkRegion r, HIShapeRef rgn) { - ChkErr(TkMacOSXHIShapeSetWithShape, (HIMutableShapeRef) r, rgn); + ChkErr(HIShapeSetWithShape, (HIMutableShapeRef) r, rgn); } /* @@ -478,45 +453,36 @@ XOffsetRegion( /* *---------------------------------------------------------------------- * - * TkMacOSXHIShapeCreateEmpty, TkMacOSXHIShapeCreateMutableWithRect, - * TkMacOSXHIShapeSetWithShape, - * TkMacOSHIShapeDifferenceWithRect, TkMacOSHIShapeUnionWithRect, - * TkMacOSHIShapeUnion -- + * TkpCopyRegion -- * - * Wrapper functions for missing/buggy HIShape API + * Makes the destination region a copy of the source region. + * + * Results: + * None. + * + * Side effects: + * None. * *---------------------------------------------------------------------- */ -HIShapeRef -TkMacOSXHIShapeCreateEmpty(void) -{ - HIShapeRef result; - - result = HIShapeCreateEmpty(); - return result; -} - -HIMutableShapeRef -TkMacOSXHIShapeCreateMutableWithRect( - const CGRect *inRect) -{ - HIMutableShapeRef result; - - result = HIShapeCreateMutableWithRect(inRect); - return result; -} - -OSStatus -TkMacOSXHIShapeSetWithShape( - HIMutableShapeRef inDestShape, - HIShapeRef inSrcShape) +void +TkpCopyRegion( + TkRegion dst, + TkRegion src) { - OSStatus result; - - result = HIShapeSetWithShape(inDestShape, inSrcShape); - return result; + ChkErr(HIShapeSetWithShape, (HIMutableShapeRef)dst, (HIShapeRef)src); } + +/* + *---------------------------------------------------------------------- + * + * TkMacOSHIShapeDifferenceWithRect -- + * + * Wrapper functions for missing/buggy HIShape API + * + *---------------------------------------------------------------------- + */ OSStatus TkMacOSHIShapeDifferenceWithRect( @@ -531,29 +497,6 @@ TkMacOSHIShapeDifferenceWithRect( return result; } - -OSStatus -TkMacOSHIShapeUnionWithRect( - HIMutableShapeRef inShape, - const CGRect *inRect) -{ - OSStatus result; - - result = HIShapeUnionWithRect(inShape, inRect); - return result; -} - -OSStatus -TkMacOSHIShapeUnion( - HIShapeRef inShape1, - HIShapeRef inShape2, - HIMutableShapeRef outResult) -{ - OSStatus result; - - result = HIShapeUnion(inShape1, inShape2, outResult); - return result; -} static OSStatus rectCounter( diff --git a/macosx/tkMacOSXScale.c b/macosx/tkMacOSXScale.c index 5da13d4431..9885199691 100644 --- a/macosx/tkMacOSXScale.c +++ b/macosx/tkMacOSXScale.c @@ -4,10 +4,10 @@ * This file implements the Macintosh specific portion of the * scale widget. * - * Copyright (c) 1996 by Sun Microsystems, Inc. - * Copyright (c) 1998-2000 by Scriptics Corporation. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright 2008-2009, Apple Inc. + * Copyright © 1996 Sun Microsystems, Inc. + * Copyright © 1998-2000 Scriptics Corporation. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2008-2009 Apple Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -287,6 +287,7 @@ TkpDisplayScale( SetControlVisibility(macScalePtr->scaleHandle, true, true); HiliteControl(macScalePtr->scaleHandle, 0); Draw1Control(macScalePtr->scaleHandle); + done: scalePtr->flags &= ~REDRAW_ALL; } diff --git a/macosx/tkMacOSXScrlbr.c b/macosx/tkMacOSXScrlbr.c index 5cb8e03317..8173e0af45 100644 --- a/macosx/tkMacOSXScrlbr.c +++ b/macosx/tkMacOSXScrlbr.c @@ -4,11 +4,11 @@ * This file implements the Macintosh specific portion of the scrollbar * widget. * - * Copyright (c) 1996 by Sun Microsystems, Inc. - * Copyright 2001-2009, Apple Inc. - * Copyright (c) 2006-2009 Daniel A. Steffen - * Copyright (c) 2015 Kevin Walzer/WordTech Commununications LLC. - * Copyright (c) 2018-2019 Marc Culler + * Copyright © 1996 Sun Microsystems, Inc. + * Copyright © 2001-2009 Apple Inc. + * Copyright © 2006-2009 Daniel A. Steffen + * Copyright © 2015 Kevin Walzer/WordTech Commununications LLC. + * Copyright © 2018-2019 Marc Culler * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -486,6 +486,7 @@ void TkpConfigureScrollbar( TkScrollbar *scrollPtr) { + (void)scrollPtr; /* empty */ } @@ -660,7 +661,7 @@ UpdateControlValues( * * ScrollbarEvent -- * - * This procedure is invoked in response to , + * This procedure is invoked in response to