# HG changeset patch # User John W. Eaton # Date 1345837814 14400 # Node ID 947cf10c94dada052f7659a910f39870d8e70b9f # Parent 28ffdc42b5504de1f87388b58d14594076e06a62# Parent fbecbce4589835d7e6bd6e96f036bf97be2c6470 maint: periodic merge of default to classdef diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -36,4 +36,4 @@ # e.g. liboctave/smx-op-inc.mk ^liboctave/[\w-]*\.mk$ -^src/DLD-FUNCTIONS/module\.mk$ +^libinterp/dldfcn/module\.mk$ diff --git a/.hgsub b/.hgsub --- a/.hgsub +++ b/.hgsub @@ -1,1 +1,2 @@ gnulib = [git]git://git.sv.gnu.org/gnulib +libgui/qterminal = [git]https://code.google.com/p/qterminal/ diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,1 +1,2 @@ 0e3af50c9e20938bd1cea0182bf749ce61cb6782 gnulib +0f7cc1d7ef5c34b146ff71207ada3ec87a24097c libgui/qterminal diff --git a/Makefile.am b/Makefile.am --- a/Makefile.am +++ b/Makefile.am @@ -67,8 +67,14 @@ include m4/module.mk +if AMCOND_BUILD_GUI +GUIDIR = libgui +else +GUIDIR = +endif + # Subdirectories in which to run `make all'. -SUBDIRS = libgnu libcruft liboctave src scripts @DOCDIR@ examples test +SUBDIRS = libgnu libcruft liboctave libinterp $(GUIDIR) src scripts @DOCDIR@ examples test if ! AMCOND_BUILD_DOCS dist-hook: diff --git a/NEWS b/NEWS --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +Summary of important user-visible changes for version 4.0: +--------------------------------------------------------- + + ** A new GUI is now available with Octave. + Summary of important user-visible changes for version 3.8: --------------------------------------------------------- @@ -72,16 +77,15 @@ January 1st of the current year. The previous default was the current day, month, and year. This may produce changes in existing scripts. - ** Other new functions added in 3.8.0: - - betaincinv erfcinv splinefit - cmpermute findfigs tetramesh - cmunique fminsearch rgbplot - colorcube lines shrinkfaces - ** The default name of the Octave crash dump file is now called octave-workspace instead of octave-core. + ** Other new functions added in 3.8.0: + + betaincinv erfcinv polyeig shrinkfaces + cmpermute findfigs splinefit + cmunique fminsearch tetramesh + colorcube lines rgbplot ** Deprecated functions. The following functions were deprecated in Octave 3.4 and have been @@ -105,6 +109,14 @@ static + The following configuration variables have been deprecated in Octave + 3.8 and will be removed from Octave 3.12 (or whatever version is the + second major release after 3.8): + + CC_VERSION (now GCC_VERSION) + CXX_VERSION (now GXX_VERSION) + + Summary of important user-visible changes for version 3.6: --------------------------------------------------------- diff --git a/autogen.sh b/autogen.sh --- a/autogen.sh +++ b/autogen.sh @@ -30,9 +30,9 @@ (cd doc/interpreter; ./config-images.sh) -echo "generating src/dldfcn/module.mk..." +echo "generating libinterp/dldfcn/module.mk..." -(cd src/dldfcn; ./config-module.sh) +(cd libinterp/dldfcn; ./config-module.sh) echo "bootstrapping..." diff --git a/build-aux/bootstrap b/build-aux/bootstrap --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh # Print a version string. -scriptversion=2011-08-11.17; # UTC +scriptversion=2012-07-19.14; # UTC # Bootstrap this package from checked-out sources. @@ -36,12 +36,12 @@ LC_ALL=C export LC_ALL +# Ensure that CDPATH is not set. Otherwise, the output from cd +# would cause trouble in at least one use below. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + local_gl_dir=gl -# Temporary directory names. -bt='._bootmp' -bt_regex=`echo "$bt"| sed 's/\./[.]/g'` -bt2=${bt}2 me=$0 usage() { @@ -77,6 +77,33 @@ EOF } +# warnf_ FORMAT-STRING ARG1... +warnf_ () +{ + warnf_format_=$1 + shift + nl=' +' + case $* in + *$nl*) me_=$(printf "$me"|tr "$nl|" '??') + printf "$warnf_format_" "$@" | sed "s|^|$me_: |" ;; + *) printf "$me: $warnf_format_" "$@" ;; + esac >&2 +} + +# warn_ WORD1... +warn_ () +{ + # If IFS does not start with ' ', set it and emit the warning in a subshell. + case $IFS in + ' '*) warnf_ '%s\n' "$*";; + *) (IFS=' '; warn_ "$@");; + esac +} + +# die WORD1... +die() { warn_ "$@"; exit 1; } + # Configuration. # Name of the Makefile.am @@ -88,9 +115,12 @@ # Any gnulib files needed that are not in modules. gnulib_files= -# A function to be called to edit gnulib.mk right after it's created. +: ${AUTOPOINT=autopoint} +: ${AUTORECONF=autoreconf} + +# A function to be called right after gnulib-tool is run. # Override it via your own definition in bootstrap.conf. -gnulib_mk_hook() { :; } +bootstrap_post_import_hook() { :; } # A function to be called after everything else in this script. # Override it via your own definition in bootstrap.conf. @@ -105,6 +135,11 @@ "rsync --delete --exclude '*.s1' -Lrtvz \ 'translationproject.org::tp/latest/%s/' '%s'" +# Fallback for downloading .po files (if rsync fails). +po_download_command_format2=\ +"wget --mirror -nd -q -np -A.po -P '%s' \ + http://translationproject.org/latest/%s/" + extract_package_name=' /^AC_INIT(/{ /.*,.*,.*, */{ @@ -122,7 +157,8 @@ p } ' -package=`sed -n "$extract_package_name" configure.ac` || exit +package=$(sed -n "$extract_package_name" configure.ac) \ + || die 'cannot find package name in configure.ac' gnulib_name=lib$package build_aux=build-aux @@ -169,10 +205,8 @@ # default. bootstrap_sync=false -# Don't use git to update gnulib sources. We keep gnulib under a -# Mercurial subrepository instead -use_git=false -GNULIB_SRCDIR=gnulib/ +# Use git to update gnulib sources +use_git=true # find_tool ENVVAR NAMES... # ------------------------- @@ -180,6 +214,8 @@ # otherwise find the first of the NAMES that can be run (i.e., # supports --version). If found, set ENVVAR to the program name, # die otherwise. +# +# FIXME: code duplication, see also gnu-web-doc-update. find_tool () { find_tool_envvar=$1 @@ -197,19 +233,15 @@ else find_tool_error_prefix="\$$find_tool_envvar: " fi - if test x"$find_tool_res" = x; then - echo >&2 "$me: one of these is required: $find_tool_names" - exit 1 - fi - ($find_tool_res --version /dev/null 2>&1 || { - echo >&2 "$me: ${find_tool_error_prefix}cannot run $find_tool_res --version" - exit 1 - } + test x"$find_tool_res" != x \ + || die "one of these is required: $find_tool_names" + ($find_tool_res --version /dev/null 2>&1 \ + || die "${find_tool_error_prefix}cannot run $find_tool_res --version" eval "$find_tool_envvar=\$find_tool_res" eval "export $find_tool_envvar" } -# Find sha1sum, named gsha1sum on MacPorts, and shasum on MacOS 10.6. +# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6. find_tool SHA1SUM sha1sum gsha1sum shasum # Override the default configuration, if necessary. @@ -224,7 +256,6 @@ test -z "${gnulib_extra_files}" && \ gnulib_extra_files=" $build_aux/install-sh - $build_aux/missing $build_aux/mdate-sh $build_aux/texinfo.tex $build_aux/depcomp @@ -250,7 +281,7 @@ usage exit;; --gnulib-srcdir=*) - GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;; + GNULIB_SRCDIR=${option#--gnulib-srcdir=};; --skip-po) SKIP_PO=t;; --force) @@ -264,21 +295,15 @@ --no-git) use_git=false;; *) - echo >&2 "$0: $option: unknown option" - exit 1;; + die "$option: unknown option";; esac done -if $use_git || test -d "$GNULIB_SRCDIR"; then - : -else - echo "$0: Error: --no-git requires --gnulib-srcdir" >&2 - exit 1 -fi +$use_git || test -d "$GNULIB_SRCDIR" \ + || die "Error: --no-git requires --gnulib-srcdir" if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then - echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2 - exit 1 + die "Bootstrapping from a non-checked-out distribution is risky." fi # Ensure that lines starting with ! sort last, per gitignore conventions @@ -301,10 +326,10 @@ file=$1 str=$2 test -f $file || touch $file - echo "$str" | sort_patterns - $file | cmp - $file > /dev/null \ + echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \ || { echo "$str" | sort_patterns - $file > $file.bak \ && mv $file.bak $file; } \ - || exit 1 + || die "insert_sorted_if_absent $file $str: failed" } # Adjust $PATTERN for $VC_IGNORE_FILE and insert it with @@ -314,10 +339,10 @@ pattern="$2" case $vc_ignore_file in *.gitignore) - # A .gitignore entry that does not start with `/' applies - # recursively to subdirectories, so prepend `/' to every + # A .gitignore entry that does not start with '/' applies + # recursively to subdirectories, so prepend '/' to every # .gitignore entry. - pattern=`echo "$pattern" | sed s,^,/,`;; + pattern=$(echo "$pattern" | sed s,^,/,);; esac insert_sorted_if_absent "$vc_ignore_file" "$pattern" } @@ -328,11 +353,8 @@ >/dev/null && found_aux_dir=yes grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \ >/dev/null && found_aux_dir=yes -if test $found_aux_dir = no; then - echo "$0: expected line not found in configure.ac. Add the following:" >&2 - echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2 - exit 1 -fi +test $found_aux_dir = yes \ + || die "configure.ac lacks 'AC_CONFIG_AUX_DIR([$build_aux])'; add it" # If $build_aux doesn't exist, create it now, otherwise some bits # below will malfunction. If creating it, also mark it as ignored. @@ -421,31 +443,48 @@ $use_git || continue fi # Honor $APP variables ($TAR, $AUTOCONF, etc.) - appvar=`echo $app | tr '[a-z]-' '[A-Z]_'` + appvar=$(echo $app | LC_ALL=C tr '[a-z]-' '[A-Z]_') test "$appvar" = TAR && appvar=AMTAR case $appvar in GZIP) ;; # Do not use $GZIP: it contains gzip options. *) eval "app=\${$appvar-$app}" ;; esac + + # Handle the still-experimental Automake-NG programs specially. + # They remain named as the mainstream Automake programs ("automake", + # and "aclocal") to avoid gratuitous incompatibilities with + # pre-existing usages (by, say, autoreconf, or custom autogen.sh + # scripts), but correctly identify themselves (as being part of + # "GNU automake-ng") when asked their version. + case $app in + automake-ng|aclocal-ng) + app=${app%-ng} + ($app --version | grep '(GNU automake-ng)') >/dev/null 2>&1 || { + warn_ "Error: '$app' not found or not from Automake-NG" + ret=1 + continue + } ;; + esac if [ "$req_ver" = "-" ]; then # Merely require app to exist; not all prereq apps are well-behaved # so we have to rely on $? rather than get_version. $app --version >/dev/null 2>&1 if [ 126 -le $? ]; then - echo "$me: Error: '$app' not found" >&2 + warn_ "Error: '$app' not found" ret=1 fi else # Require app to produce a new enough version string. inst_ver=$(get_version $app) if [ ! "$inst_ver" ]; then - echo "$me: Error: '$app' not found" >&2 + warn_ "Error: '$app' not found" ret=1 else latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2) if [ ! "$latest_ver" = "$inst_ver" ]; then - echo "$me: Error: '$app' version == $inst_ver is too old" >&2 - echo " '$app' version >= $req_ver is required" >&2 + warnf_ '%s\n' \ + "Error: '$app' version == $inst_ver is too old" \ + " '$app' version >= $req_ver is required" ret=1 fi fi @@ -475,14 +514,37 @@ find_tool LIBTOOLIZE glibtoolize libtoolize fi +# gnulib-tool requires at least automake and autoconf. +# If either is not listed, add it (with minimum version) as a prerequisite. +case $buildreq in + *automake*) ;; + *) buildreq="automake 1.9 +$buildreq" ;; +esac +case $buildreq in + *autoconf*) ;; + *) buildreq="autoconf 2.59 +$buildreq" ;; +esac + +# When we can deduce that gnulib-tool will require patch, +# and when patch is not already listed as a prerequisite, add it, too. +if test -d "$local_gl_dir" \ + && ! find "$local_gl_dir" -name '*.diff' -exec false {} +; then + case $buildreq in + *patch*) ;; + *) buildreq="patch - +$buildreq" ;; + esac +fi + if ! printf "$buildreq" | check_versions; then echo >&2 if test -f README-prereq; then - echo "$0: See README-prereq for how to get the prerequisite programs" >&2 + die "See README-prereq for how to get the prerequisite programs" else - echo "$0: Please install the prerequisite programs" >&2 + die "Please install the prerequisite programs" fi - exit 1 fi echo "$0: Bootstrapping from checked-out $package sources..." @@ -511,7 +573,7 @@ test -f .gitmodules && git config --file .gitmodules "$@" } -gnulib_path=`git_modules_config submodule.gnulib.path` +gnulib_path=$(git_modules_config submodule.gnulib.path) test -z "$gnulib_path" && gnulib_path=gnulib # Get gnulib files. @@ -576,7 +638,7 @@ fi gnulib_tool=$GNULIB_SRCDIR/gnulib-tool -<$gnulib_tool || exit +<$gnulib_tool || exit $? # Get translations. @@ -584,7 +646,10 @@ subdir=$1 domain=$2 echo "$me: getting translations into $subdir for $domain..." - cmd=`printf "$po_download_command_format" "$domain" "$subdir"` + cmd=$(printf "$po_download_command_format" "$domain" "$subdir") + eval "$cmd" && return + # Fallback to HTTP. + cmd=$(printf "$po_download_command_format2" "$subdir" "$domain") eval "$cmd" } @@ -607,7 +672,7 @@ && ls "$ref_po_dir"/*.po 2>/dev/null | sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return - langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'` + langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g') test "$langs" = '*' && langs=x for po in $langs; do case $po in x) continue;; esac @@ -644,18 +709,18 @@ # If the destination directory doesn't exist, create it. # This is required at least for "lib/uniwidth/cjk.h". - dst_dir=`dirname "$dst"` + dst_dir=$(dirname "$dst") if ! test -d "$dst_dir"; then mkdir -p "$dst_dir" # If we've just created a directory like lib/uniwidth, # tell version control system(s) it's ignorable. # FIXME: for now, this does only one level - parent=`dirname "$dst_dir"` + parent=$(dirname "$dst_dir") for dot_ig in x $vc_ignore; do test $dot_ig = x && continue ig=$parent/$dot_ig - insert_vc_ignore $ig `echo "$dst_dir"|sed 's,.*/,,'` + insert_vc_ignore $ig "${dst_dir##*/}" done fi @@ -679,10 +744,10 @@ # so that broken tools aren't confused into skipping needed builds. See # . test -h "$dst" && - src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 && - dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 && + src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 && + dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 && test "$src_i" = "$dst_i" && - both_ls=`ls -dt "$src" "$dst"` && + both_ls=$(ls -dt "$src" "$dst") && test "X$both_ls" = "X$dst$nl$src" || { dot_dots= case $src in @@ -690,11 +755,10 @@ *) case /$dst/ in *//* | */../* | */./* | /*/*/*/*/*/) - echo >&2 "$me: invalid symlink calculation: $src -> $dst" - exit 1;; - /*/*/*/*/) dot_dots=../../../;; - /*/*/*/) dot_dots=../../;; - /*/*/) dot_dots=../;; + die "invalid symlink calculation: $src -> $dst";; + /*/*/*/*/) dot_dots=../../../;; + /*/*/*/) dot_dots=../../;; + /*/*/) dot_dots=../;; esac;; esac @@ -705,151 +769,94 @@ } } -cp_mark_as_generated() -{ - cp_src=$1 - cp_dst=$2 - - if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then - symlink_to_dir "$GNULIB_SRCDIR" "$cp_dst" - elif cmp -s "$cp_src" "$local_gl_dir/$cp_dst"; then - symlink_to_dir $local_gl_dir "$cp_dst" +version_controlled_file() { + parent=$1 + file=$2 + if test -d .git; then + git rm -n "$file" > /dev/null 2>&1 + elif test -d .svn; then + svn log -r HEAD "$file" > /dev/null 2>&1 + elif test -d CVS; then + grep -F "/${file##*/}/" "$parent/CVS/Entries" 2>/dev/null | + grep '^/[^/]*/[0-9]' > /dev/null else - case $cp_dst in - *.[ch]) c1='/* '; c2=' */';; - *.texi) c1='@c '; c2= ;; - *.m4|*/Make*|Make*) c1='# ' ; c2= ;; - *) c1= ; c2= ;; - esac - - # If the destination directory doesn't exist, create it. - # This is required at least for "lib/uniwidth/cjk.h". - dst_dir=`dirname "$cp_dst"` - test -d "$dst_dir" || mkdir -p "$dst_dir" - - if test -z "$c1"; then - cmp -s "$cp_src" "$cp_dst" || { - # Copy the file first to get proper permissions if it - # doesn't already exist. Then overwrite the copy. - echo "$me: cp -f $cp_src $cp_dst" && - rm -f "$cp_dst" && - cp "$cp_src" "$cp_dst-t" && - sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" && - mv -f "$cp_dst-t" "$cp_dst" - } - else - # Copy the file first to get proper permissions if it - # doesn't already exist. Then overwrite the copy. - cp "$cp_src" "$cp_dst-t" && - ( - echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" && - echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" && - sed "s!$bt_regex/!!g" "$cp_src" - ) > $cp_dst-t && - if cmp -s "$cp_dst-t" "$cp_dst"; then - rm -f "$cp_dst-t" - else - echo "$me: cp $cp_src $cp_dst # with edits" && - mv -f "$cp_dst-t" "$cp_dst" - fi - fi + warn_ "no version control for $file?" + false fi } -version_controlled_file() { - dir=$1 - file=$2 - found=no - if test -d CVS; then - grep -F "/$file/" $dir/CVS/Entries 2>/dev/null | - grep '^/[^/]*/[0-9]' > /dev/null && found=yes - elif test -d .git; then - git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes - elif test -d .svn; then - svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes - else - echo "$me: no version control for $dir/$file?" >&2 +# NOTE: we have to be careful to run both autopoint and libtoolize +# before gnulib-tool, since gnulib-tool is likely to provide newer +# versions of files "installed" by these two programs. +# Then, *after* gnulib-tool (see below), we have to be careful to +# run autoreconf in such a way that it does not run either of these +# two just-pre-run programs. + +# Import from gettext. +with_gettext=yes +grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ + with_gettext=no + +if test $with_gettext = yes || test $use_libtool = 1; then + + tempbase=.bootstrap$$ + trap "rm -f $tempbase.0 $tempbase.1" 1 2 13 15 + + > $tempbase.0 > $tempbase.1 && + find . ! -type d -print | sort > $tempbase.0 || exit + + if test $with_gettext = yes; then + # Released autopoint has the tendency to install macros that have been + # obsoleted in current gnulib, so run this before gnulib-tool. + echo "$0: $AUTOPOINT --force" + $AUTOPOINT --force || exit fi - test $found = yes -} -slurp() { - for dir in . `(cd $1 && find * -type d -print)`; do - copied= - sep= - for file in `ls -a $1/$dir`; do - case $file in - .|..) continue;; - # FIXME: should all file names starting with "." be ignored? - .*) continue;; - esac - test -d $1/$dir/$file && continue - for excluded_file in $excluded_files; do - test "$dir/$file" = "$excluded_file" && continue 2 + # Autoreconf runs aclocal before libtoolize, which causes spurious + # warnings if the initial aclocal is confused by the libtoolized + # (or worse out-of-date) macro directory. + # libtoolize 1.9b added the --install option; but we support back + # to libtoolize 1.5.22, where the install action was default. + if test $use_libtool = 1; then + install= + case $($LIBTOOLIZE --help) in + *--install*) install=--install ;; + esac + echo "running: $LIBTOOLIZE $install --copy" + $LIBTOOLIZE $install --copy + fi + + find . ! -type d -print | sort >$tempbase.1 + old_IFS=$IFS + IFS=$nl + for file in $(comm -13 $tempbase.0 $tempbase.1); do + IFS=$old_IFS + parent=${file%/*} + version_controlled_file "$parent" "$file" || { + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + ig=$parent/$dot_ig + insert_vc_ignore "$ig" "${file##*/}" done - if test $file = Makefile.am && test "X$gnulib_mk" != XMakefile.am; then - copied=$copied${sep}$gnulib_mk; sep=$nl - remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g" - sed "$remove_intl" $1/$dir/$file | - cmp - $dir/$gnulib_mk > /dev/null || { - echo "$me: Copying $1/$dir/$file to $dir/$gnulib_mk ..." && - rm -f $dir/$gnulib_mk && - sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk && - gnulib_mk_hook $dir/$gnulib_mk - } - elif { test "${2+set}" = set && test -r $2/$dir/$file; } || - version_controlled_file $dir $file; then - echo "$me: $dir/$file overrides $1/$dir/$file" - else - copied=$copied$sep$file; sep=$nl - cp_mark_as_generated $1/$dir/$file $dir/$file - fi || exit - done + } + done + IFS=$old_IFS - for dot_ig in x $vc_ignore; do - test $dot_ig = x && continue - ig=$dir/$dot_ig - if test -n "$copied"; then - insert_vc_ignore $ig "$copied" - # If an ignored file name ends with .in.h, then also add - # the name with just ".h". Many gnulib headers are generated, - # e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc. - # Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed - f=`echo "$copied" | - sed ' - s/\.in\.h$/.h/ - s/\.sin$/.sed/ - s/\.y$/.c/ - s/\.gperf$/.h/ - ' - ` - insert_vc_ignore $ig "$f" - - # For files like sys_stat.in.h and sys_time.in.h, record as - # ignorable the directory we might eventually create: sys/. - f=`echo "$copied"|sed 's/sys_.*\.in\.h$/sys/'` - insert_vc_ignore $ig "$f" - fi - done - done -} - - -# Create boot temporary directories to import from gnulib and gettext. -rm -fr $bt $bt2 && -mkdir $bt $bt2 || exit + rm -f $tempbase.0 $tempbase.1 + trap - 1 2 13 15 +fi # Import from gnulib. gnulib_tool_options="\ --import\ --no-changelog\ - --aux-dir $bt/$build_aux\ - --doc-base $bt/$doc_base\ + --aux-dir $build_aux\ + --doc-base $doc_base\ --lib $gnulib_name\ - --m4-base $bt/$m4_base/\ - --source-base $bt/$source_base/\ - --tests-base $bt/$tests_base\ + --m4-base $m4_base/\ + --source-base $source_base/\ + --tests-base $tests_base\ --local-dir $local_gl_dir\ $gnulib_tool_option_extras\ " @@ -861,25 +868,14 @@ fi echo "$0: $gnulib_tool $gnulib_tool_options --import ..." $gnulib_tool $gnulib_tool_options --import $gnulib_modules && -slurp $bt || exit for file in $gnulib_files; do - symlink_to_dir "$GNULIB_SRCDIR" $file || exit + symlink_to_dir "$GNULIB_SRCDIR" $file \ + || die "failed to symlink $file" done - -# Import from gettext. -with_gettext=yes -grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \ - with_gettext=no - -if test $with_gettext = yes; then - echo "$0: (cd $bt2; ${AUTOPOINT-autopoint}) ..." - cp configure.ac $bt2 && - (cd $bt2 && ${AUTOPOINT-autopoint} && rm configure.ac) && - slurp $bt2 $bt || exit -fi -rm -fr $bt $bt2 || exit +bootstrap_post_import_hook \ + || die "bootstrap_post_import_hook failed" # Remove any dangling symlink matching "*.m4" or "*.[ch]" in some # gnulib-populated directories. Such .m4 files would cause aclocal to fail. @@ -893,37 +889,31 @@ -depth \( -name '*.m4' -o -name '*.[ch]' \) \ -type l -xtype l -delete > /dev/null 2>&1 -# Reconfigure, getting other files. - -# Skip autoheader if it's not needed. -grep -E '^[ ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null || - AUTOHEADER=true +# Some systems (RHEL 5) are using ancient autotools, for which the +# --no-recursive option had not been invented. Detect that lack and +# omit the option when it's not supported. FIXME in 2017: remove this +# hack when RHEL 5 autotools are updated, or when they become irrelevant. +no_recursive= +case $($AUTORECONF --help) in + *--no-recursive*) no_recursive=--no-recursive;; +esac -for command in \ - libtool \ - "${ACLOCAL-aclocal} --force -I '$m4_base' $ACLOCAL_FLAGS" \ - "${AUTOCONF-autoconf} --force" \ - "${AUTOHEADER-autoheader} --force" \ - "${AUTOMAKE-automake} --add-missing --copy --force-missing" -do - if test "$command" = libtool; then - test $use_libtool = 0 \ - && continue - command="${LIBTOOLIZE-libtoolize} -c -f" - fi - echo "$0: $command ..." - eval "$command" || exit -done - +# Tell autoreconf not to invoke autopoint or libtoolize; they were run above. +echo "running: AUTOPOINT=true LIBTOOLIZE=true " \ + "$AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS" +AUTOPOINT=true LIBTOOLIZE=true \ + $AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS \ + || die "autoreconf failed" # Get some extra files from gnulib, overriding existing files. for file in $gnulib_extra_files; do case $file in */INSTALL) dst=INSTALL;; - build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;; + build-aux/*) dst=$build_aux/${file#build-aux/};; *) dst=$file;; esac - symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit + symlink_to_dir "$GNULIB_SRCDIR" $file $dst \ + || die "failed to symlink $file" done if test $with_gettext = yes; then @@ -939,7 +929,19 @@ a\ '"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+} } - ' po/Makevars.template >po/Makevars || exit 1 + ' po/Makevars.template >po/Makevars \ + || die 'cannot generate po/Makevars' + + # If the 'gettext' module is in use, grab the latest Makefile.in.in. + # If only the 'gettext-h' module is in use, assume autopoint already + # put the correct version of this file into place. + case $gnulib_modules in + *gettext-h*) ;; + *gettext*) + cp $GNULIB_SRCDIR/build-aux/po/Makefile.in.in po/Makefile.in.in \ + || die "cannot create po/Makefile.in.in" + ;; + esac if test -d runtime-po; then # Similarly for runtime-po/Makevars, but not quite the same. @@ -953,7 +955,8 @@ a\ '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+} } - ' po/Makevars.template >runtime-po/Makevars || exit 1 + ' po/Makevars.template >runtime-po/Makevars \ + || die 'cannot generate runtime-po/Makevars' # Copy identical files from po to runtime-po. (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po) diff --git a/build-aux/common.mk b/build-aux/common.mk --- a/build-aux/common.mk +++ b/build-aux/common.mk @@ -111,14 +111,16 @@ UGLY_DEFS = @UGLY_DEFS@ CC = @CC@ +## FIXME: CC_VERSION is deprecated and should be removed in version 3.12 CC_VERSION = @CC_VERSION@ +GCC_VERSION = @GCC_VERSION@ CONFIGURE_CFLAGS = @CFLAGS@ CPICFLAG = @CPICFLAG@ XTRA_CFLAGS = @XTRA_CFLAGS@ WARN_CFLAGS = @WARN_CFLAGS@ AM_CFLAGS = $(CONFIGURE_CFLAGS) \ - $(INCFLAGS) $(DEFS) $(XTRA_CFLAGS) $(WARN_CFLAGS) $(CFLAGS) $(PTHREAD_CFLAGS) -BUG_CFLAGS = $(DEFS) $(XTRA_CFLAGS) $(WARN_CFLAGS) $(CFLAGS) + $(XTRA_CFLAGS) $(WARN_CFLAGS) +BUG_CFLAGS = $(XTRA_CFLAGS) $(WARN_CFLAGS) $(CFLAGS) BUILD_CC = @BUILD_CC@ BUILD_CFLAGS = @BUILD_CFLAGS@ @@ -133,15 +135,17 @@ GRAPHICS_CFLAGS = @GRAPHICS_CFLAGS@ CXX = @CXX@ +## FIXME: CXX_VERSION is deprecated and should be removed in version 3.12 CXX_VERSION = @CXX_VERSION@ +GXX_VERSION = @GXX_VERSION@ CXXCPP = @CXXCPP@ CONFIGURE_CXXFLAGS = @CXXFLAGS@ CXXPICFLAG = @CXXPICFLAG@ XTRA_CXXFLAGS = @XTRA_CXXFLAGS@ WARN_CXXFLAGS = @WARN_CXXFLAGS@ AM_CXXFLAGS = $(CONFIGURE_CXXFLAGS) \ - $(INCFLAGS) $(DEFS) $(XTRA_CXXFLAGS) $(WARN_CXXFLAGS) $(CXXFLAGS) $(PTHREAD_CFLAGS) -BUG_CXXFLAGS = $(DEFS) $(XTRA_CXXFLAGS) $(WARN_CXXFLAGS) $(CXXFLAGS) + $(XTRA_CXXFLAGS) $(WARN_CXXFLAGS) +BUG_CXXFLAGS = $(XTRA_CXXFLAGS) $(WARN_CXXFLAGS) $(CXXFLAGS) BUILD_CXX = @BUILD_CXX@ BUILD_CXXFLAGS = @BUILD_CXXFLAGS@ @@ -506,6 +510,8 @@ -e "s|%OCTAVE_CONF_DL_LD%|\"${DL_LD}\"|" \ -e "s|%OCTAVE_CONF_DL_LDFLAGS%|\"${DL_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_DL_LIBS%|\"${DL_LIBS}\"|" \ + -e "s|%OCTAVE_CONF_GCC_VERSION%|\"${GCC_VERSION}\"|" \ + -e "s|%OCTAVE_CONF_GXX_VERSION%|\"${GXX_VERSION}\"|" \ -e "s|%OCTAVE_CONF_EXEEXT%|\"${EXEEXT}\"|" \ -e "s|%OCTAVE_CONF_F77%|\"${F77}\"|" \ -e "s|%OCTAVE_CONF_F77_FLOAT_STORE_FLAG%|\"${F77_FLOAT_STORE_FLAG}\"|" \ @@ -529,7 +535,6 @@ -e "s|%OCTAVE_CONF_HDF5_CPPFLAGS%|\"${HDF5_CPPFLAGS}\"|" \ -e "s|%OCTAVE_CONF_HDF5_LDFLAGS%|\"${HDF5_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_HDF5_LIBS%|\"${HDF5_LIBS}\"|" \ - -e "s|%OCTAVE_CONF_INCFLAGS%|\"${INCFLAGS}\"|" \ -e "s|%OCTAVE_CONF_INCLUDEDIR%|\"${includedir}\"|" \ -e "s|%OCTAVE_CONF_LAPACK_LIBS%|\"${LAPACK_LIBS}\"|" \ -e "s|%OCTAVE_CONF_LD_CXX%|\"${LD_CXX}\"|" \ @@ -569,6 +574,8 @@ -e "s|%OCTAVE_CONF_QRUPDATE_CPPFLAGS%|\"${QRUPDATE_CPPFLAGS}\"|" \ -e "s|%OCTAVE_CONF_QRUPDATE_LDFLAGS%|\"${QRUPDATE_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_QRUPDATE_LIBS%|\"${QRUPDATE_LIBS}\"|" \ + -e "s|%OCTAVE_CONF_QT_INCDIR%|\"${QT_INCDIR}\"|" \ + -e "s|%OCTAVE_CONF_QT_LIBDIR%|\"${QT_LIBDIR}\"|" \ -e "s|%OCTAVE_CONF_RANLIB%|\"${RANLIB}\"|" \ -e "s|%OCTAVE_CONF_RDYNAMIC_FLAG%|\"${RDYNAMIC_FLAG}\"|" \ -e "s|%OCTAVE_CONF_READLINE_LIBS%|\"${READLINE_LIBS}\"|" \ diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,3 @@ -dnl configure.in -dnl dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright (C) 1993-2012 John W. Eaton @@ -27,6 +25,7 @@ EXTERN_CFLAGS="$CFLAGS" EXTERN_CXXFLAGS="$CXXFLAGS" +AC_PREREQ([2.62]) AC_INIT([GNU Octave], [3.7.0+], [http://octave.org/bugs.html], [octave]) dnl PACKAGE_VERSION is set by the AC_INIT VERSION arg @@ -41,9 +40,10 @@ AC_SUBST(OCTAVE_RELEASE_DATE) AC_SUBST(OCTAVE_COPYRIGHT) -AC_REVISION($Revision: 1.603 $) -AC_PREREQ([2.62]) -AC_CONFIG_SRCDIR([src/octave.cc]) +dnl FIXME: We should auto-insert the Mercurial changeset ID into the +dnl AC_REVISION field whenever configure.ac is modified. +dnl AC_REVISION($Revision: 1.603 $) +AC_CONFIG_SRCDIR([libinterp/octave.cc]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) @@ -54,24 +54,6 @@ AC_DEFINE(OCTAVE_SOURCE, 1, [Define to 1 if this is Octave.]) -dnl FIXME: Can this MSVC test be moved down to the section on finding a -dnl a C compiler which already has an MSVC exception test? -dnl FIXME: We should probably only generate this file if it is missing. -### Produce unistd.h for MSVC target, this simplifies changes in -### Octave source tree and avoid problems with lex-generated code. -case "$canonical_host_type" in - *-*-msdosmsvc) - AC_MSG_NOTICE([Generating replacement for for MSVC]) - cat << \EOF > unistd.h -/* File generated by configure script. */ -#include -#include -#include -EOF - CPPFLAGS="-I. $CPPFLAGS" - ;; -esac - AC_USE_SYSTEM_EXTENSIONS ### Path separator. @@ -79,7 +61,7 @@ sepchar=: AC_ARG_WITH(sepchar, [AS_HELP_STRING([--with-sepchar=], - [use as the path separation character])]) + [use as the path separation character])]) case $with_sepchar in yes | "") case "$canonical_host_type" in @@ -96,8 +78,10 @@ ;; esac AC_SUBST(sepchar) -AC_DEFINE_UNQUOTED(SEPCHAR, ['$sepchar'], [Define this to be the path separator for your system, as a character constant.]) -AC_DEFINE_UNQUOTED(SEPCHAR_STR, ["$sepchar"], [Define this to the path separator, as a string.]) +AC_DEFINE_UNQUOTED(SEPCHAR, ['$sepchar'], + [Define this to be the path separator for your system, as a character constant.]) +AC_DEFINE_UNQUOTED(SEPCHAR_STR, ["$sepchar"], + [Define this to be the path separator for your system, as a string.]) ### Set default file locations @@ -148,7 +132,7 @@ BOUNDS_CHECKING=false AC_ARG_ENABLE(bounds-check, [AS_HELP_STRING([--enable-bounds-check], - [bounds checking for indexing in internal array classes (default is no)])], + [bounds checking for indexing in internal array classes (default is no)])], [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) if $BOUNDS_CHECKING; then AC_DEFINE(BOUNDS_CHECKING, 1, [Define to 1 to use internal bounds checking.]) @@ -160,10 +144,11 @@ USE_OCTAVE_ALLOCATOR=false AC_ARG_ENABLE(octave-allocator, [AS_HELP_STRING([--enable-octave-allocator], - [use the obsolete octave_allocator class for many of Octave's objects (mostly octave_value types). You probably do NOT want to enable this feature. (default is no)])], + [use the obsolete octave_allocator class for many of Octave's objects (mostly octave_value types). You probably do NOT want to enable this feature. (default is no)])], [if test "$enableval" = yes; then USE_OCTAVE_ALLOCATOR=true; fi], []) if $USE_OCTAVE_ALLOCATOR; then - AC_DEFINE(USE_OCTAVE_ALLOCATOR, 1, [Define to 1 to use octave_allocator class.]) + AC_DEFINE(USE_OCTAVE_ALLOCATOR, 1, + [Define to 1 to use octave_allocator class.]) fi ### Use atomic operations for internal reference counting. This is required @@ -173,10 +158,11 @@ USE_ATOMIC_REFCOUNT=false AC_ARG_ENABLE(atomic-refcount, [AS_HELP_STRING([--enable-atomic-refcount], - [use atomic operations for internal reference counting. This is required for thread-safe behavior. (default is no)])], + [use atomic operations for internal reference counting. This is required for thread-safe behavior. (default is no)])], [if test "$enableval" = yes; then USE_ATOMIC_REFCOUNT=true; fi], []) if $USE_ATOMIC_REFCOUNT; then - AC_DEFINE(USE_ATOMIC_REFCOUNT, 1, [Define to 1 to use atomic operations for reference counting.]) + AC_DEFINE(USE_ATOMIC_REFCOUNT, 1, + [Define to 1 to use atomic operations for reference counting.]) fi ### Disable running Make in the doc directory. @@ -189,7 +175,8 @@ DOCDIR= warn_docs="building documentation disabled; make dist will fail" OCTAVE_CONFIGURE_WARNING([warn_docs]) - fi], []) + fi], + []) AC_SUBST(DOCDIR) ### If possible, use a 64-bit integer type for array dimensions and indexing. @@ -198,7 +185,7 @@ OCTAVE_IDX_TYPE=int AC_ARG_ENABLE(64, [AS_HELP_STRING([--enable-64], - [(EXPERIMENTAL) use 64-bit integers for array dimensions and indexing])], + [(EXPERIMENTAL) use 64-bit integers for array dimensions and indexing])], [if test "$enableval" = yes; then USE_64_BIT_IDX_T=true; fi], []) if $USE_64_BIT_IDX_T; then AC_CHECK_SIZEOF(void *) @@ -225,7 +212,8 @@ AC_DEFINE_UNQUOTED(OCTAVE_IDX_TYPE, $OCTAVE_IDX_TYPE, [Define to the type of octave_idx_type (64 or 32 bit signed integer).]) if $USE_64_BIT_IDX_T; then - AC_DEFINE(USE_64_BIT_IDX_T, 1, [Define to 1 if using 64-bit integers for array dimensions and indexing.]) + AC_DEFINE(USE_64_BIT_IDX_T, 1, + [Define to 1 if using 64-bit integers for array dimensions and indexing.]) fi AC_SUBST(USE_64_BIT_IDX_T) @@ -234,7 +222,8 @@ ### GNU libc, just disable them for all platforms. AC_MSG_NOTICE([defining __NO_MATH_INLINES avoids buggy GNU libc exp function]) -AC_DEFINE(__NO_MATH_INLINES, 1, [Define to 1 if your version of GNU libc has buggy inline assembly code for math functions like exp.]) +AC_DEFINE(__NO_MATH_INLINES, 1, + [Define to 1 if your version of GNU libc has buggy inline assembly code for math functions like exp.]) ### Determine which C++ compiler to use (we expect to find g++). @@ -243,26 +232,22 @@ ### Check version number when using g++. -gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ - sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` +GXX_VERSION= +if test "$GXX" = yes; then + gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ + sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` -case "$gxx_version" in - 1.* | 2.[[0123456789]].* | 3.[[01234]].*) - AC_MSG_ERROR([g++ version $gxx_version will probably fail to compile Octave] -) - ;; -esac + AX_COMPARE_VERSION([$gxx_version], [lt], [3.5], + [AC_MSG_ERROR([g++ version $gxx_version will probably fail to compile Octave])]) -CXX_VERSION= -if test -n "$gxx_version"; then - CXX_VERSION="$gxx_version" + GXX_VERSION="$gxx_version" fi +AC_SUBST(GXX_VERSION) + +## FIXME: CXX_VERSION is deprecated and should be removed in version 3.12 +CXX_VERSION="$gxx_version" AC_SUBST(CXX_VERSION) -OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL -OCTAVE_CXX_ISO_COMPLIANT_LIBRARY -OCTAVE_CXX_BROKEN_REINTERPRET_CAST - ### Determine which C compiler to use (we expect to find gcc). AC_PROG_CC @@ -277,37 +262,40 @@ ;; *-*-mingw*) AC_MSG_CHECKING([for MSVC compiler]) - AC_PREPROC_IFELSE([AC_LANG_SOURCE([ -#ifndef _MSC_VER -#error "Not MSVC compiler" -#endif -])], have_msvc=yes, have_msvc=no) + AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ + #ifndef _MSC_VER + #error "Not MSVC compiler" + #endif + ]])], + have_msvc=yes, have_msvc=no) AC_MSG_RESULT([$have_msvc]) ;; esac -### gnulib initialization +### gnulib initialization: part 1 +### Must take place immediately after a compiler is determined gl_EARLY -gl_INIT ### Check version number when using gcc. -gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ - sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` -case "$gcc_version" in - [12].*) - warn_gcc_version="gcc version $gcc_version is likely to cause problems" - OCTAVE_CONFIGURE_WARNING([warn_gcc_version]) - ;; -esac +GCC_VERSION= +if test "$GCC" = yes; then + gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ + sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` -CC_VERSION= -if test -n "$gcc_version"; then - CC_VERSION="$gcc_version" + AX_COMPARE_VERSION([$gcc_version], [lt], [3], + [warn_gcc_version="gcc version $gcc_version is likely to cause problems" + OCTAVE_CONFIGURE_WARNING([warn_gcc_version])]) + + GCC_VERSION="$gcc_version" fi AC_SUBST(CC_VERSION) +## FIXME: CC_VERSION is deprecated and should be removed in version 3.12 +CC_VERSION="$gcc_version" +AC_SUBST(GCC_VERSION) + ### Determine the compiler flag necessary to create dependencies ## Assume GCC. @@ -341,10 +329,11 @@ ### Check for pthread library AX_PTHREAD -## Include pthread libs and flags here in case other tests need them. +## Include pthread libs and flags early in case other tests need them. ## They seem to be required for the OpenGL tests on Debian systems. LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" ### When compiling math for x87, problems may arise in some code comparing ### floating-point intermediate results. @@ -355,47 +344,38 @@ ### doesn't suffer from this problem at all. AC_ARG_ENABLE(float-truncate, [AS_HELP_STRING([--enable-float-truncate], - [enables truncating intermediate FP results.])], - [if test "$enableval" = yes; then ac_float_truncate=volatile; - else ac_float_truncate=; fi], - ac_float_truncate=) + [enables truncating intermediate FP results.])], + [if test "$enableval" = yes; then + ac_float_truncate=volatile; + else + ac_float_truncate=; + fi], + [ac_float_truncate=]) AC_DEFINE_UNQUOTED(FLOAT_TRUNCATE, $ac_float_truncate, - [Define to volatile if you need to truncate intermediate FP results.]) + [Define to volatile if you need to truncate intermediate FP results.]) ### Determine extra CFLAGS that may be necessary for Octave. ## On Intel systems with gcc, we may need to compile with -mieee-fp -## and -ffloat-store to get full support for IEEE floating point. +## to get full support for IEEE floating point. ## ## On Alpha/OSF systems, we need -mieee. ieee_fp_flag= case "$canonical_host_type" in - ## Keep this pattern first, so that it is preferred over the - ## following pattern for x86. i[[3456789]]86-*-*) if test "$GCC" = yes; then OCTAVE_CC_FLAG(-mieee-fp, [ ieee_fp_flag=-mieee-fp XTRA_CFLAGS="$XTRA_CFLAGS -mieee-fp" AC_MSG_NOTICE([adding -mieee-fp to XTRA_CFLAGS])]) - -## OCTAVE_CC_FLAG(-ffloat-store, [ -## float_store_flag=-ffloat-store -## XTRA_CFLAGS="$XTRA_CFLAGS -ffloat-store" -## AC_MSG_RESULT([adding -ffloat-store to XTRA_CFLAGS])]) fi if test "$GXX" = yes; then OCTAVE_CXX_FLAG(-mieee-fp, [ ieee_fp_flag=-mieee-fp XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-fp" AC_MSG_NOTICE([adding -mieee-fp to XTRA_CXXFLAGS])]) - -## OCTAVE_CXX_FLAG(-ffloat-store, [ -## float_store_flag=-ffloat-store -## XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ffloat-store" -## AC_MSG_RESULT([adding -ffloat-store to XTRA_CXXFLAGS])]) fi ;; alpha*-*-*) @@ -440,35 +420,21 @@ USE_OPENMP=false AC_ARG_ENABLE(openmp, [AS_HELP_STRING([--enable-openmp], - [(EXPERIMENTAL) use OpenMP SMP multi-threading])], + [(EXPERIMENTAL) use OpenMP SMP multi-threading])], [if test "$enableval" = yes; then USE_OPENMP=true; fi], []) if $USE_OPENMP; then case "$canonical_host_type" in *-*-mingw* | *-*-cygwin* | *-*-gnu*) - OCTAVE_CHECK_OPENMP(-fopenmp) + OCTAVE_CHECK_OPENMP(-fopenmp) ;; *-*-msdosmsvc) - ## FIXME: is this the right flag for MSVC? - OCTAVE_CHECK_OPENMP(-openmp) + ## FIXME: is this the right flag for MSVC? + OCTAVE_CHECK_OPENMP(-openmp) ;; ## Add other compilers supporting OpenMP here esac fi -dnl FIXME: This is OS-specific tests. Can this be moved further down in -dnl configure.ac to reside with other similar tests? -### Use -static if compiling on Alpha OSF/1 1.3 systems. - -case "$canonical_host_type" in - alpha*-dec-osf1.3) - LD_STATIC_FLAG=-static - ;; -esac -if test -n "$LD_STATIC_FLAG"; then - AC_MSG_NOTICE([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) -fi -AC_SUBST(LD_STATIC_FLAG) - ### Defaults for cross compiling. BUILD_CC and BUILD_CXX are ### the compilers that we use for building tools on the build system. ### For now, we assume that the only cross compiling we can do is @@ -502,12 +468,18 @@ BUILD_EXEEXT='$(EXEEXT)' fi -AC_ARG_VAR(BUILD_CC, [build system C compiler (used if cross compiling)]) -AC_ARG_VAR(BUILD_CFLAGS, [build system C compiler flags (used if cross compiling)]) -AC_ARG_VAR(BUILD_CXX, [build system C++ compiler (used if cross compiling)]) -AC_ARG_VAR(BUILD_CXXFLAGS, [build system C++ compiler flags (used if cross compiling)]) -AC_ARG_VAR(BUILD_LDFLAGS, [build system C++ compiler link flags (used if cross compiling)]) -AC_ARG_VAR(BUILD_EXEEXT, [build system executable extension (used if cross compiling)]) +AC_ARG_VAR(BUILD_CC, + [build system C compiler (used if cross compiling)]) +AC_ARG_VAR(BUILD_CFLAGS, + [build system C compiler flags (used if cross compiling)]) +AC_ARG_VAR(BUILD_CXX, + [build system C++ compiler (used if cross compiling)]) +AC_ARG_VAR(BUILD_CXXFLAGS, + [build system C++ compiler flags (used if cross compiling)]) +AC_ARG_VAR(BUILD_LDFLAGS, + [build system C++ compiler link flags (used if cross compiling)]) +AC_ARG_VAR(BUILD_EXEEXT, + [build system executable extension (used if cross compiling)]) dnl This is bogus. We shouldn't have to explicitly add libc too! dnl Keep this check before the check for the Fortran compiler, @@ -555,7 +527,6 @@ i[[3456789]]86-*-*) if test "$ac_cv_f77_compiler_gnu" = yes; then OCTAVE_F77_FLAG(-mieee-fp) -### OCTAVE_F77_FLAG(-ffloat-store) fi ;; alpha*-*-*) @@ -583,16 +554,16 @@ AC_MSG_ERROR([in order to build Octave, you must have a compatible Fortran compiler or wrapper script for f2c that functions as a Fortran compiler installed and in your path. See the file INSTALL for more information.]) fi -OCTAVE_CHECK_FORTRAN_HAVE_ISNAN +OCTAVE_CHECK_FUNC_FORTRAN_ISNAN F77_ISNAN_MACRO= -if test "x$octave_cv_fortran_have_isnan" = xno; then - AC_MSG_NOTICE([substituting ISNAN(X) with X.NE.X in Fortran sources]) - F77_ISNAN_MACRO="s|ISNAN(\(@<:@^)@:>@*\))|(\1.NE.\1)|" +if test "x$octave_cv_func_fortran_isnan" = xno; then + AC_MSG_NOTICE([substituting ISNAN(X) with X.NE.X in Fortran sources]) + F77_ISNAN_MACRO="s|ISNAN(\(@<:@^)@:>@*\))|(\1.NE.\1)|" fi AC_SUBST(F77_ISNAN_MACRO) -OCTAVE_CHECK_FORTRAN_INTEGER_SIZE -if test "x$octave_cv_fortran_integer_size" = xno; then +OCTAVE_CHECK_SIZEOF_FORTRAN_INTEGER +if test "x$octave_cv_sizeof_fortran_integer" = xno; then if $USE_64_BIT_IDX_T; then case "$F77" in *gfortran*) @@ -610,17 +581,17 @@ AC_MSG_NOTICE([adding -fdefault-integer-8 to F77_INTEGER_8_FLAG]) F77_INTEGER_8_FLAG="-fdefault-integer-8" ## Invalidate the cache and try again. - $as_unset octave_cv_fortran_integer_size + $as_unset octave_cv_sizeof_fortran_integer ;; esac ;; esac ;; esac - if test -z "$octave_cv_fortran_integer_size"; then - OCTAVE_CHECK_FORTRAN_INTEGER_SIZE + if test -z "$octave_cv_sizeof_fortran_integer"; then + OCTAVE_CHECK_SIZEOF_FORTRAN_INTEGER fi - if test "x$octave_cv_fortran_integer_size" = xno; then + if test "x$octave_cv_sizeof_fortran_integer" = xno; then AC_MSG_ERROR([in order to build Octave with 64-bit indexing support your Fortran compiler must have an option for setting the default integer size to 8 bytes. See the file INSTALL for more information.]) fi else @@ -633,29 +604,23 @@ AC_SUBST(FC) OCTAVE_F77_FLAG(-ffloat-store, [ -AC_MSG_RESULT([setting F77_FLOAT_STORE_FLAG to -ffloat-store]) -F77_FLOAT_STORE_FLAG=-ffloat-store -AC_SUBST(F77_FLOAT_STORE_FLAG) + AC_MSG_RESULT([setting F77_FLOAT_STORE_FLAG to -ffloat-store]) + F77_FLOAT_STORE_FLAG=-ffloat-store + AC_SUBST(F77_FLOAT_STORE_FLAG) ]) -### Check that C compiler and libraries support IEEE754 data format. -OCTAVE_IEEE754_DATA_FORMAT - -### Check C++ library for various capabilities. -OCTAVE_CXX_BITWISE_OP_TEMPLATES -OCTAVE_CXX_COMPLEX_SETTERS -OCTAVE_CXX_COMPLEX_REFERENCE_ACCESSORS - ### Check for the Qhull library -OCTAVE_CHECK_LIBRARY(qhull, QHull, +OCTAVE_CHECK_LIB(qhull, QHull, [Qhull library not found -- this will result in loss of functionality of some geometry functions.], - [libqhull/libqhull.h qhull/libqhull.h libqhull.h qhull/qhull.h qhull.h], [qh_qhull], [], [], + [libqhull/libqhull.h qhull/libqhull.h libqhull.h qhull/qhull.h qhull.h], + [qh_qhull], [], [], [warn_qhull= - OCTAVE_CHECK_QHULL_VERSION - OCTAVE_CHECK_QHULL_OK([TEXINFO_QHULL="@set HAVE_QHULL" - AC_DEFINE(HAVE_QHULL, 1, [Define to 1 if Qhull is available.])], [ - warn_qhull="Qhull library found, but does not seem to work properly -- this will result in loss of functionality of some geometry functions. Please try recompiling the library with -fno-strict-aliasing."])]) + OCTAVE_CHECK_QHULL_VERSION + OCTAVE_CHECK_LIB_QHULL_OK( + [TEXINFO_QHULL="@set HAVE_QHULL" + AC_DEFINE(HAVE_QHULL, 1, [Define to 1 if Qhull is available.])], + [warn_qhull="Qhull library found, but does not seem to work properly -- this will result in loss of functionality of some geometry functions. Please try recompiling the library with -fno-strict-aliasing."])]) ### Check for PCRE regex library. @@ -668,17 +633,18 @@ AC_CACHE_CHECK([whether pcre.h defines the macros we need], [ac_cv_pcre_h_macros_present], [AC_EGREP_CPP([PCRE_HAS_MACROS_WE_NEED], [ -#if defined (HAVE_PCRE_H) -#include -#elif defined (HAVE_PCRE_PCRE_H) -#include -#error "NO PCRE HEADER" -#endif -#if defined (PCRE_INFO_NAMECOUNT) \ - && defined (PCRE_INFO_NAMEENTRYSIZE) \ - && defined (PCRE_INFO_NAMETABLE) -PCRE_HAS_MACROS_WE_NEED -#endif], ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)]) + #if defined (HAVE_PCRE_H) + # include + #elif defined (HAVE_PCRE_PCRE_H) + # include + #error "NO PCRE HEADER" + #endif + #if defined (PCRE_INFO_NAMECOUNT) \ + && defined (PCRE_INFO_NAMEENTRYSIZE) \ + && defined (PCRE_INFO_NAMETABLE) + PCRE_HAS_MACROS_WE_NEED + #endif], + ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)]) if test $ac_cv_pcre_h_macros_present = yes; then ## check for pcre-config, and if so, set XTRA_CXXFLAGS appropriately @@ -701,7 +667,7 @@ ### Check for ZLIB library. -OCTAVE_CHECK_LIBRARY(z, ZLIB, +OCTAVE_CHECK_LIB(z, ZLIB, [ZLIB library not found. Octave will not be able to save or load compressed data files or HDF5 files.], [zlib.h], [gzclearerr]) @@ -720,7 +686,7 @@ AC_ARG_VAR(LLVM_CONFIG, [path to llvm-config utility]) AC_ARG_ENABLE([jit-debug], - AS_HELP_STRING([--enable-jit-debug], [Enable debug printing of JIT IRs])) + AS_HELP_STRING([--enable-jit-debug], [enable debug printing of JIT IRs])) AS_IF([test "x$enable_jit_debug" = "xyes"], [ AC_DEFINE(OCTAVE_JIT_DEBUG, 1, [Define to 1 for JIT debug printing.]) @@ -758,13 +724,14 @@ AC_CHECK_HEADER([llvm/LLVMContext.h], [ AC_MSG_CHECKING([for llvm::getGlobalContext in llvm/LLVMContext.h]) AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[llvm::LLVMContext& ctx = llvm::getGlobalContext ();]])], - [ - AC_MSG_RESULT([yes]) + [AC_LANG_PROGRAM([[ + #include + ]], [[ + llvm::LLVMContext& ctx = llvm::getGlobalContext (); + ]])], + [AC_MSG_RESULT([yes]) warn_llvm= - XTRA_CXXFLAGS="$XTRA_CXXFLAGS $LLVM_CXXFLAGS $LLVM_CPPFLAGS" - ], + XTRA_CXXFLAGS="$XTRA_CXXFLAGS $LLVM_CXXFLAGS $LLVM_CPPFLAGS"], [AC_MSG_RESULT([no]) ]) ]) @@ -800,35 +767,36 @@ CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" save_LIBS="$LIBS" LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" -OCTAVE_CHECK_LIBRARY(hdf5, HDF5, +OCTAVE_CHECK_LIB(hdf5, HDF5, [HDF5 library not found. Octave will not be able to save or load HDF5 data files.], [hdf5.h], [H5Gget_num_objs], [], [], [warn_hdf5= - OCTAVE_HDF5_HAS_ENFORCED_16_API + OCTAVE_CHECK_HDF5_HAS_VER_16_API TEXINFO_HDF5="@set HAVE_HDF5" - AC_DEFINE(HAVE_HDF5, 1, [Define to 1 if HDF5 is available and newer than version 1.6.]) + AC_DEFINE(HAVE_HDF5, 1, + [Define to 1 if HDF5 is available and newer than version 1.6.]) if test "$have_msvc" = "yes"; then - OCTAVE_HDF5_DLL + OCTAVE_CHECK_LIB_HDF5_DLL fi - ]) + ]) CPPFLAGS="$save_CPPFLAGS" LIBS="$save_LIBS" ### Check for FFTW library. Default to Fortran FFTPACK if it is not available. ## Check for FFTW header and library. -OCTAVE_CHECK_LIBRARY(fftw3, FFTW3, +OCTAVE_CHECK_LIB(fftw3, FFTW3, [FFTW3 library not found. The slower FFTPACK library will be used instead.], [fftw3.h], [fftw_plan_dft_1d]) -OCTAVE_CHECK_LIBRARY(fftw3f, FFTW3F, +OCTAVE_CHECK_LIB(fftw3f, FFTW3F, [FFTW3F library not found. The slower FFTPACK library will be used instead.], [fftw3.h], [fftwf_plan_dft_1d]) AM_CONDITIONAL([AMCOND_HAVE_FFTW], [test -n "$FFTW3_LIBS" && test -n "$FFTW3F_LIBS"]) -## Subdirectory of libcruft to build if FFTW is not found: +## Subdirectory of libcruft to build if FFTW is not found. FFT_DIR="fftpack" AC_SUBST(FFT_DIR) @@ -838,7 +806,7 @@ CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" save_LIBS="$LIBS" LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" -OCTAVE_CHECK_LIBRARY(glpk, GLPK, +OCTAVE_CHECK_LIB(glpk, GLPK, [GLPK library not found. The glpk function for solving linear programs will be disabled.], [glpk/glpk.h glpk.h], [_glp_lpx_simplex]) LIBS="$save_LIBS" @@ -850,7 +818,7 @@ CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" save_LIBS="$LIBS" LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" -OCTAVE_CHECK_LIBRARY(curl, cURL, +OCTAVE_CHECK_LIB(curl, cURL, [cURL library not found. The ftp objects, urlread and urlwrite functions will be disabled.], [curl/curl.h], [curl_easy_escape]) LIBS="$save_LIBS" @@ -860,9 +828,9 @@ AC_ARG_WITH([magick], [AS_HELP_STRING([--with-magick=LIB], - [select library to use for image I/O (options: GraphicsMagick(default) or ImageMagick)])], [ - magick="$withval"], [ - magick="GraphicsMagick"]) + [select library to use for image I/O (options: GraphicsMagick(default) or ImageMagick)])], + [magick="$withval"], + [magick="GraphicsMagick"]) warn_magick="$magick++ library not found. The imread function for reading image files will not be fully functional." @@ -871,8 +839,8 @@ MAGICK_LIBS= PKG_CHECK_EXISTS([$magick++], [ - ## Make sure we only get -I, -L and -l flags. Some Graphics/ImageMagick++ - ## packages adds extra flags that are useful when building + ## Make sure we only get -I, -L, and -l flags. Some Graphics/ImageMagick++ + ## packages add extra flags that are useful when building ## Graphics/ImageMagick++ extentions. These extra flags break the ## Octave build. MAGICK_LDFLAGS=`$PKG_CONFIG --libs-only-L $magick++` @@ -889,15 +857,14 @@ AC_CHECK_HEADER([Magick++.h], [ AC_MSG_CHECKING([for Magick::ColorRGB in Magick++.h]) AC_PREPROC_IFELSE( - [AC_LANG_SOURCE( - [[#include ]], - [[Magick::ColorRGB c;]]) - ], [ - AC_MSG_RESULT(yes) - warn_magick= - ], [ - AC_MSG_RESULT(no) - ] + [AC_LANG_SOURCE([[ + #include + ]], [[ + Magick::ColorRGB c; + ]])], + [AC_MSG_RESULT(yes) + warn_magick=], + [AC_MSG_RESULT(no)] ) ]) AC_LANG_POP(C++) @@ -906,7 +873,8 @@ ]) if test -z "$warn_magick"; then - AC_DEFINE(HAVE_MAGICK, 1, [Define to 1 if Graphics/ImageMagick++ is available.]) + AC_DEFINE(HAVE_MAGICK, 1, + [Define to 1 if Graphics/ImageMagick++ is available.]) else MAGICK_CPPFLAGS= MAGICK_LDFLAGS= @@ -937,10 +905,12 @@ fi ### Check for the Carbon framework on MacOSX systems -OCTAVE_HAVE_FRAMEWORK(Carbon, [#include ], [CGMainDisplayID ()], +OCTAVE_HAVE_FRAMEWORK(Carbon, + [[#include ]], [[CGMainDisplayID ()]], [have_framework_carbon="yes"], [have_framework_carbon="no"]) if test $have_framework_carbon = "yes"; then - AC_DEFINE(HAVE_FRAMEWORK_CARBON, 1, [Define to 1 if framework CARBON is available.]) + AC_DEFINE(HAVE_FRAMEWORK_CARBON, 1, + [Define to 1 if framework CARBON is available.]) CARBON_LIBS="-Wl,-framework -Wl,Carbon" AC_MSG_NOTICE([adding -Wl,-framework -Wl,Carbon to CARBON_LIBS]) AC_SUBST(CARBON_LIBS) @@ -953,7 +923,8 @@ check_opengl=false AC_ARG_WITH([opengl], - [AS_HELP_STRING([--without-opengl], [don't use OpenGL libraries, disable native graphics])], + [AS_HELP_STRING([--without-opengl], + [don't use OpenGL libraries, disable native graphics])], [if test "x$withval" = xno; then warn_opengl="--without-opengl specified. Native graphics will be disabled." OCTAVE_CONFIGURE_WARNING([warn_opengl]) @@ -965,7 +936,7 @@ ## Check for OpenGL library if $check_opengl; then - OCTAVE_OPENGL + OCTAVE_CHECK_LIB_OPENGL fi GRAPHICS_LIBS= @@ -984,8 +955,9 @@ ## Check for FreeType 2 library - AC_CHECK_FT2([9.0.3], [AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have FreeType library.]) - XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"], + AC_CHECK_FT2([9.0.3], + [AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have FreeType library.]) + XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"], [warn_freetype="FreeType library not found. Native graphics will be disabled."]) if test -n "$warn_freetype"; then @@ -997,13 +969,13 @@ warn_fontconfig="" if test -z "$warn_freetype"; then - PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [ - have_fontconfig=yes - OPENGL_LIBS="$FONTCONFIG_LIBS $OPENGL_LIBS" - XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FONTCONFIG_CFLAGS" - AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if fontconfig is present.])], [ - have_fontconfig=no - warn_fontconfig="Fontconfig library not found. Native graphics will be disabled."]) + PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], + [have_fontconfig=yes + OPENGL_LIBS="$FONTCONFIG_LIBS $OPENGL_LIBS" + XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FONTCONFIG_CFLAGS" + AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if fontconfig is present.])], + [have_fontconfig=no + warn_fontconfig="Fontconfig library not found. Native graphics will be disabled."]) fi if test -n "$warn_fontconfig"; then @@ -1015,15 +987,15 @@ AC_ARG_WITH([fltk-prefix], [ AS_HELP_STRING([--with-fltk-prefix=PFX], - [Prefix where FLTK is installed (optional)])], [ - fltk_prefix="$withval"], [ - fltk_prefix=""]) + [prefix where FLTK is installed (optional)])], + [fltk_prefix="$withval"], + [fltk_prefix=""]) AC_ARG_WITH([fltk-exec-prefix], [ AS_HELP_STRING([--with-fltk-exec-prefix=PFX], - [Exec prefix where FLTK is installed (optional)])], [ - fltk_exec_prefix="$withval"], [ - fltk_exec_prefix=""]) + [exec prefix where FLTK is installed (optional)])], + [fltk_exec_prefix="$withval"], + [fltk_exec_prefix=""]) if test -n "$fltk_exec_prefix"; then fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix" @@ -1063,13 +1035,10 @@ CFLAGS="$CFLAGS $FLTK_CFLAGS" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[int nothing = 0;]])], - [ - AC_MSG_RESULT([no]) - warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled." - ],[ - AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.]) - AC_MSG_RESULT([yes]) - ]) + [AC_MSG_RESULT([no]) + warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled."], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.])]) if test -z "$warn_fltk_opengl"; then GRAPHICS_CFLAGS="$FLTK_CFLAGS" @@ -1087,6 +1056,17 @@ ### Start determination of shared vs. static libraries +## Use -static if compiling on Alpha OSF/1 1.3 systems. +case "$canonical_host_type" in + alpha*-dec-osf1.3) + LD_STATIC_FLAG=-static + ;; +esac +if test -n "$LD_STATIC_FLAG"; then + AC_MSG_NOTICE([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) +fi +AC_SUBST(LD_STATIC_FLAG) + OCTAVE_PROG_AR ifdef([LT_INIT], [], [ @@ -1153,25 +1133,25 @@ octave_blaswrap_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -DUSE_BLASWRAP" AC_LANG_PUSH(C) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([ -#include "libcruft/misc/blaswrap.c" -])], - [mv conftest.$ac_objext blaswrap.$ac_objext - octave_blaswrap_save_BLAS_LIBS="$BLAS_LIBS" - BLAS_LIBS="blaswrap.$ac_objext -framework vecLib" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #include "libcruft/misc/blaswrap.c" + ]])], + [mv conftest.$ac_objext blaswrap.$ac_objext + octave_blaswrap_save_BLAS_LIBS="$BLAS_LIBS" + BLAS_LIBS="blaswrap.$ac_objext -framework vecLib" - save_FFLAGS="$FFLAGS" - FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG" + save_FFLAGS="$FFLAGS" + FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG" - AX_BLAS_WITH_F77_FUNC([:], [:]) - AX_LAPACK([:], [:]) + AX_BLAS_WITH_F77_FUNC([:], [:]) + AX_LAPACK([:], [:]) - ## Restore FFLAGS. - FFLAGS="$save_FFLAGS" + ## Restore FFLAGS. + FFLAGS="$save_FFLAGS" - ## remove temp file - rm -f blaswrap.$ac_objext], - [AC_MSG_FAILURE([cannot compile libcruft/misc/blaswrap.c])]) + ## remove temp file + rm -f blaswrap.$ac_objext], + [AC_MSG_FAILURE([cannot compile libcruft/misc/blaswrap.c])]) AC_LANG_POP(C) CFLAGS="$octave_blaswrap_save_CFLAGS" @@ -1180,7 +1160,8 @@ else ## wrapper in libcruft, remove from BLAS_LIBS BLAS_LIBS="`echo $BLAS_LIBS | sed -e 's/blaswrap.[[^ ]]* //g'`" - AC_DEFINE(USE_BLASWRAP, 1, [Define to 1 if BLAS functions need to be wrapped (potentially needed for 64-bit OSX only).]) + AC_DEFINE(USE_BLASWRAP, 1, + [Define to 1 if BLAS functions need to be wrapped (potentially needed for 64-bit OSX only).]) fi ;; esac @@ -1205,7 +1186,7 @@ ## Must supply proper LIBS, however. save_LIBS="$LIBS" LIBS="$LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS" -OCTAVE_CHECK_LIBRARY(qrupdate, qrupdate, +OCTAVE_CHECK_LIB(qrupdate, qrupdate, [qrupdate not found. The QR & Cholesky updating functions will be slow.], [], [sqr1up], @@ -1216,8 +1197,7 @@ AC_LANG_PUSH([Fortran 77]) AC_MSG_CHECKING([for slup1up in $QRUPDATE_LIBS]) octave_qrupdate_luu=no - AC_LINK_IFELSE([AC_LANG_CALL([], [slup1up])], - [octave_qrupdate_luu=yes]) + AC_LINK_IFELSE([AC_LANG_CALL([], [slup1up])], [octave_qrupdate_luu=yes]) AC_MSG_RESULT([$octave_qrupdate_luu]) if test "$octave_qrupdate_luu" = yes; then AC_DEFINE(HAVE_QRUPDATE_LUU, 1, [Define to 1 if qrupdate supports LU updates.]) @@ -1228,7 +1208,7 @@ ### Check for AMD library -OCTAVE_CHECK_LIBRARY(amd, AMD, +OCTAVE_CHECK_LIB(amd, AMD, [AMD library not found. This will result in some lack of functionality for sparse matrices.], [suitesparse/amd.h ufsparse/amd.h amd/amd.h amd.h], [amd_postorder], @@ -1236,7 +1216,7 @@ ### Check for CAMD library -OCTAVE_CHECK_LIBRARY(camd, CAMD, +OCTAVE_CHECK_LIB(camd, CAMD, [CAMD library not found. This will result in some lack of functionality for sparse matrices.], [suitesparse/camd.h ufsparse/camd.h amd/camd.h camd.h], [camd_postorder], @@ -1244,7 +1224,7 @@ ### Check for COLAMD library -OCTAVE_CHECK_LIBRARY(colamd, COLAMD, +OCTAVE_CHECK_LIB(colamd, COLAMD, [COLAMD library not found. This will result in some lack of functionality for sparse matrices.], [suitesparse/colamd.h ufsparse/colamd.h amd/colamd.h colamd.h], [colamd], @@ -1252,7 +1232,7 @@ ### Check for CCOLAMD library -OCTAVE_CHECK_LIBRARY(ccolamd, CCOLAMD, +OCTAVE_CHECK_LIB(ccolamd, CCOLAMD, [CCOLAMD library not found. This will result in some lack of functionality for sparse matrices.], [suitesparse/ccolamd.h ufsparse/ccolamd.h amd/ccolamd.h ccolamd.h], [ccolamd], @@ -1263,7 +1243,7 @@ save_LIBS="$LIBS" LIBS="$COLAMD_LDFLAGS $COLAMD_LIBS $AMD_LDFLAGS $AMD_LIBS $LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS" -OCTAVE_CHECK_LIBRARY(cholmod, CHOLMOD, +OCTAVE_CHECK_LIB(cholmod, CHOLMOD, [CHOLMOD library not found. This will result in some lack of functionality for sparse matrices.], [suitesparse/cholmod.h ufsparse/cholmod.h cholmod/cholmod.h cholmod.h], [cholmod_start], @@ -1272,7 +1252,7 @@ ### Check for CXSparse library -OCTAVE_CHECK_LIBRARY(cxsparse, CXSparse, +OCTAVE_CHECK_LIB(cxsparse, CXSparse, [CXSparse library not found. This will result in some lack of functionality for sparse matrices.], [suitesparse/cs.h ufsparse/cs.h amd/cs.h cs.h], [cs_di_sqr], @@ -1284,7 +1264,7 @@ save_CPPFLAGS="$CPPFLAGS" LIBS="$AMD_LDFLAGS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" CPPFLAGS="$AMD_CPPFLAGS $CPPFLAGS" -OCTAVE_CHECK_LIBRARY(umfpack, UMFPACK, +OCTAVE_CHECK_LIB(umfpack, UMFPACK, [UMFPACK not found. This will result in some lack of functionality for sparse matrices.], [suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], [umfpack_zi_get_determinant], @@ -1297,7 +1277,7 @@ $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant save_LIBS="$LIBS" LIBS="-lcblas $AMD_LDFLAGS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" - OCTAVE_CHECK_LIBRARY(umfpack, UMFPACK, + OCTAVE_CHECK_LIB(umfpack, UMFPACK, [UMFPACK not found. This will result in some lack of functionality for sparse matrices.], [suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], [umfpack_zi_get_determinant], @@ -1311,7 +1291,7 @@ if test -n "$UMFPACK_LIBS"; then save_LIBS="$LIBS"; LIBS="$UMFPACK_LIBS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" - OCTAVE_UMFPACK_SEPERATE_SPLIT + OCTAVE_UMFPACK_SEPARATE_SPLIT LIBS="$save_LIBS" fi @@ -1319,15 +1299,15 @@ save_LIBS="$LIBS" LIBS="$LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS" -OCTAVE_CHECK_LIBRARY(arpack, ARPACK, +OCTAVE_CHECK_LIB(arpack, ARPACK, [ARPACK not found. The eigs function will be disabled.], [], [dseupd], [Fortran 77], [don't use the ARPACK library, disable eigs function], [warn_arpack= - OCTAVE_CHECK_ARPACK_OK([ - AC_DEFINE(HAVE_ARPACK, 1, [Define to 1 if ARPACK is available.])], [ - warn_arpack="ARPACK library found, but does not seem to work properly -- disabling eigs function"])]) + OCTAVE_CHECK_LIB_ARPACK_OK( + [AC_DEFINE(HAVE_ARPACK, 1, [Define to 1 if ARPACK is available.])], + [warn_arpack="ARPACK library found, but does not seem to work properly -- disabling eigs function"])]) LIBS="$save_LIBS" ### Check for readline library. @@ -1341,12 +1321,13 @@ AC_ARG_ENABLE([dl], [AS_HELP_STRING([--enable-dl], - [allow loading of dynamically linked modules (not all systems)])], [ - case "${enableval}" in - yes) ENABLE_DYNAMIC_LINKING=true ;; - no) ENABLE_DYNAMIC_LINKING=false ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-dl]) ;; - esac], [ENABLE_DYNAMIC_LINKING=true]) + [allow loading of dynamically linked modules (not all systems)])], + [case "${enableval}" in + yes) ENABLE_DYNAMIC_LINKING=true ;; + no) ENABLE_DYNAMIC_LINKING=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-dl]) ;; + esac], + [ENABLE_DYNAMIC_LINKING=true]) if $STATIC_LIBS || $SHARED_LIBS; then true @@ -1402,7 +1383,7 @@ SH_LDFLAGS="-shared -Wl,-expect_unresolved -Wl,'*'" ;; *-*-darwin*) - DL_LDFLAGS='-bundle -bundle_loader $(top_builddir)/src/octave $(LDFLAGS)' + DL_LDFLAGS='-bundle -bundle_loader $(top_builddir)/libinterp/octave $(LDFLAGS)' MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader $$BINDIR/octave-$$OCTAVE_VERSION$$EXEEXT' SH_LDFLAGS='-dynamiclib -single_module $(LDFLAGS)' case "$canonical_host_type" in @@ -1638,227 +1619,32 @@ AC_SUBST(library_path_var) AC_SUBST(ldpreloadsep) -### special checks for odd OS specific things. - -AC_CHECK_FUNCS(getpwnam, [], [AC_CHECK_LIB(sun, getpwnam)]) - -case "$canonical_host_type" in - *-*-mingw*) - if test "$have_msvc" = "yes"; then - AC_CHECK_LIB(dirent, opendir) - LIBS="$LIBS -ladvapi32 -lgdi32 -lws2_32 -luser32 -lkernel32" - else - LIBS="$LIBS -lgdi32 -lws2_32 -luser32 -lkernel32" - fi - LIBS="$LIBS -lgdi32 -lws2_32 -luser32 -lkernel32" - ;; - *-*-msdosmsvc*) - AC_CHECK_LIB(dirent, opendir) - LIBS="$LIBS -ladvapi32 -lgdi32 -lws2_32 -luser32 -lkernel32" - ;; -esac +### More configure argument checking related to linking AC_ARG_ENABLE([no-undefined], [AS_HELP_STRING([--enable-no-undefined], [pass -no-undefined to libtool when linking Octave and its shared libraries (on by default)])], [case "${enableval}" in - yes) NO_UNDEFINED_LDFLAG="-no-undefined" ;; - no) NO_UNDEFINED_LDFLAG="" ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-link-all-depenencies]) ;; - esac], [NO_UNDEFINED_LDFLAG="-no-undefined"]) + yes) NO_UNDEFINED_LDFLAG="-no-undefined" ;; + no) NO_UNDEFINED_LDFLAG="" ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-link-all-depenencies]) ;; + esac], + [NO_UNDEFINED_LDFLAG="-no-undefined"]) AC_SUBST(NO_UNDEFINED_LDFLAG) AC_ARG_ENABLE([link-all-dependencies], [AS_HELP_STRING([--enable-link-all-dependencies], [link Octave and its shared libraries with all dependencies, not just those immediately referenced (should not be needed on most systems)])], [case "${enableval}" in - yes) link_all_deps=true ;; - no) link_all_deps=false ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-link-all-depenencies]) ;; - esac], [link_all_deps=false]) + yes) link_all_deps=true ;; + no) link_all_deps=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-link-all-depenencies]) ;; + esac], + [link_all_deps=false]) AM_CONDITIONAL([AMCOND_LINK_ALL_DEPS], [test x$link_all_deps = xtrue]) -### Type stuff. - -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_TYPE_UID_T -AC_CHECK_TYPES([dev_t, ino_t]) -AC_CHECK_TYPES([long long int, unsigned long long int]) - -### How big are ints and how are they oriented? These could probably -### be eliminated in favor of run-time checks. - -AC_CHECK_SIZEOF(short) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(long) -AC_CHECK_SIZEOF(long long) - -### Does the C compiler handle alloca() and const correctly? - -AC_FUNC_ALLOCA - -### See if we should use placement delete. - -OCTAVE_PLACEMENT_DELETE - -### See if we can auto allocate variable sized arrays. - -OCTAVE_DYNAMIC_AUTO_ARRAYS - -### See if we can use fast integer arithmetics - -OCTAVE_FAST_INT_OPS - -### Check for long double type (for 64-bit integers) - -AC_CHECK_SIZEOF(long double) - -### Checks for header files. - -AC_HEADER_DIRENT -AC_HEADER_SYS_WAIT - -### C headers - -AC_CHECK_HEADERS(curses.h direct.h dlfcn.h floatingpoint.h grp.h \ - ieeefp.h inttypes.h locale.h memory.h ncurses.h poll.h pthread.h \ - pwd.h sunmath.h sys/ioctl.h sys/param.h sys/poll.h sys/resource.h \ - sys/select.h sys/utsname.h termcap.h) - -### C++ headers - -AC_LANG_PUSH(C++) -AC_CHECK_HEADERS(sstream) -AC_CHECK_HEADERS([unordered_map], [], [ - AC_CHECK_HEADERS([tr1/unordered_map])]) -AC_MSG_CHECKING([whether unordered_map requires tr1 namespace]) -unordered_map_requires_tr1_namespace=no -if test "$ac_cv_header_unordered_map" = "yes"; then - ## Have , but still have to check whether - ## tr1 namespace is required (like MSVC, for instance). - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([ - #include - ], [ - std::unordered_map m; - ])], [], [unordered_map_requires_tr1_namespace=yes]) -elif test "$ac_cv_header_tr1_unordered_map" = "yes"; then - unordered_map_requires_tr1_namespace=yes -fi -if test "$unordered_map_requires_tr1_namespace" = "yes"; then - AC_DEFINE(USE_UNORDERED_MAP_WITH_TR1, 1, [Define to 1 if unordered_map requires the use of tr1 namespace.]) -fi -AC_MSG_RESULT([$unordered_map_requires_tr1_namespace]) -AC_LANG_POP(C++) - -have_termios_h=no -AC_CHECK_HEADERS(termios.h, have_termios_h=yes) -AC_CHECK_HEADERS(termio.h, have_termio_h=yes, have_termio_h=no) -AC_CHECK_HEADERS(sgtty.h, have_sgtty_h=yes, have_sgtty_h=no) -AC_CHECK_HEADERS(fnmatch.h, have_fnmatch_h=yes, have_fnmatch_h=no) -AC_CHECK_HEADERS(conio.h, have_conio_h=yes, have_conio_h=no) - -if test "$have_termios_h" = yes \ - || test "$have_termio_h" = yes \ - || test "$have_sgtty_h" = yes; then - true -else - AC_MSG_WARN([I couldn't find termios.h, termio.h, or sgtty.h!]) -fi - -### For MSVC compilers, avoid #define of min/max from windows.h header -if test "$have_msvc" = "yes"; then - AC_DEFINE(NOMINMAX, 1, [Define to 1 if you want to avoid min/max macro definition in Windows headers.]) -fi - -### Checks for functions and variables. - -AC_CHECK_FUNCS(basename canonicalize_file_name \ - chmod dup2 endgrent endpwent execvp expm1 expm1f fork \ - getegid geteuid getgid getgrent getgrgid getgrnam getpgrp getpid \ - getppid getpwent getpwuid getuid getwd _kbhit kill \ - lgamma lgammaf lgamma_r lgammaf_r localtime_r log1p log1pf \ - mkstemp pipe putenv \ - realpath resolvepath rindex roundl select setgrent setlocale \ - setpwent setvbuf siglongjmp \ - strsignal tempnam tgammaf umask \ - uname utime waitpid \ - _chmod x_utime _utime32) - -AC_LANG_PUSH(C++) -AC_CHECK_DECLS([exp2, round, tgamma], [], [], [[#include ]]) -AC_CHECK_FUNCS([exp2 round tgamma]) -AH_VERBATIM([Z_FUNCS_AND_DECLS], [ -#if defined (__cplusplus) -extern "C" { -#endif -#if HAVE_EXP2 && ! HAVE_DECL_EXP2 -double exp2 (double ); -#endif -#if HAVE_ROUND && ! HAVE_DECL_ROUND -double round (double); -#endif -#if HAVE_TGAMMA && ! HAVE_DECL_TGAMMA -double tgamma (double); -#endif -#if defined (__cplusplus) -} -#endif -]) -AC_LANG_POP(C++) - -case "$canonical_host_type" in - *-*-mingw*) - ## MinGW does not provide a mkstemp function. However, it provides - ## the mkstemps function in libiberty. - AC_MSG_CHECKING([for mkstemps in libiberty]) - save_LIBS="$LIBS" - LIBS="-liberty $LIBS" - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[int mkstemps (char *pattern, int suffix_len);]], - [[mkstemps ("XXXXXX", 0);]] - )], - [AC_MSG_RESULT(yes) - HAVE_MKSTEMPS=yes - AC_DEFINE(HAVE_MKSTEMPS, 1, [Define to 1 if mkstemps is available in libiberty.]) - ], - [AC_MSG_RESULT(no) - HAVE_MKSTEMPS=no - LIBS="$save_LIBS" - ]) - ;; -esac - -OCTAVE_SMART_PUTENV - -case "$canonical_host_type" in - *-*-msdosmsvc | *-*-mingw*) - AC_MSG_CHECKING([for required _WIN32_WINNT]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#if _WIN32_WINNT < 0x0403 -#error "Wrong version" -#endif]], [])], - AC_MSG_RESULT([none]), [ - AC_DEFINE(_WIN32_WINNT, 0x0403, [Define to 0x0403 to access InitializeCriticalSectionAndSpinCount.]) - AC_MSG_RESULT([0x0403])]) - AC_MSG_CHECKING([whether _USE_MATH_DEFINES needs to be defined]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[int x = M_LN2;]])], - AC_MSG_RESULT([no]), [ - AC_DEFINE(_USE_MATH_DEFINES, 1, [Define to 1 if your system needs to define math constants like M_LN2.]) - AC_MSG_RESULT([yes])]) - ;; -esac - -## Check for CGDisplayBitsPerPixel function on Mac OSX systems with Carbon -OCTAVE_CARBON_CGDISPLAYBITSPERPIXEL - -### Dynamic linking is now enabled only if we are building shared -### libs and some API for dynamic linking is detected. +## Dynamic linking is now enabled only if we are building shared +## libs and some API for dynamic linking has been detected. ## FIXME: A lot of the following duplicates the functionality of ## code generated by the dlopen option for LT_INIT. @@ -1877,23 +1663,27 @@ dlopen) dlopen_api=true DL_API_MSG="(dlopen)" - AC_DEFINE(HAVE_DLOPEN_API, 1, [Define to 1 if your system has dlopen, dlsym, dlerror, and dlclose for dynamic linking.]) + AC_DEFINE(HAVE_DLOPEN_API, 1, + [Define to 1 if your system has dlopen, dlsym, dlerror, and dlclose for dynamic linking.]) OCTAVE_CXX_FLAG(-rdynamic, [RDYNAMIC_FLAG=-rdynamic]) ;; shl_load) shl_load_api=true DL_API_MSG="(shl_load)" - AC_DEFINE(HAVE_SHL_LOAD_API, 1, [Define to 1 if your system has shl_load and shl_findsym for dynamic linking.]) + AC_DEFINE(HAVE_SHL_LOAD_API, 1, + [Define to 1 if your system has shl_load and shl_findsym for dynamic linking.]) ;; LoadLibrary) loadlibrary_api=true DL_API_MSG="(LoadLibrary)" - AC_DEFINE(HAVE_LOADLIBRARY_API, 1, [Define to 1 if your system has LoadLibrary for dynamic linking.]) + AC_DEFINE(HAVE_LOADLIBRARY_API, 1, + [Define to 1 if your system has LoadLibrary for dynamic linking.]) ;; dyld) dyld_api=true DL_API_MSG="(dyld)" - AC_DEFINE(HAVE_DYLD_API, 1, [Define to 1 if your system has dyld for dynamic linking.]) + AC_DEFINE(HAVE_DYLD_API, 1, + [Define to 1 if your system has dyld for dynamic linking.]) ;; esac @@ -1916,11 +1706,11 @@ [test x$ENABLE_DYNAMIC_LINKING = xtrue]) if $SHARED_LIBS; then - LIBOCTINTERP=-loctinterp$SHLLINKEXT - LIBOCTAVE=-loctave$SHLLINKEXT - LIBCRUFT=-lcruft$SHLLINKEXT + LIBOCTINTERP=-loctinterp$SHLLINKEXT + LIBOCTAVE=-loctave$SHLLINKEXT + LIBCRUFT=-lcruft$SHLLINKEXT else - LIBOCTINTERP='$(top_builddir)/src/liboctinterp.$(LIBEXT)' + LIBOCTINTERP='$(top_builddir)/libinterp/liboctinterp.$(LIBEXT)' LIBOCTAVE='$(top_builddir)/liboctave/liboctave.$(LIBEXT)' LIBCRUFT='$(top_builddir)/libcruft/libcruft.$(LIBEXT)' fi @@ -1932,11 +1722,217 @@ AC_SUBST(LIBOCTAVE) AC_SUBST(LIBCRUFT) -dnl Maybe defines the IEEE functions we need. +### Check for existence of various libraries + +## OS-specific test for dirent, opendir. +case "$canonical_host_type" in + *-*-mingw*) + if test "$have_msvc" = "yes"; then + AC_CHECK_LIB(dirent, opendir) + LIBS="$LIBS -ladvapi32 -lgdi32 -lws2_32 -luser32 -lkernel32" + else + LIBS="$LIBS -lgdi32 -lws2_32 -luser32 -lkernel32" + fi + LIBS="$LIBS -lgdi32 -lws2_32 -luser32 -lkernel32" + ;; + *-*-msdosmsvc*) + AC_CHECK_LIB(dirent, opendir) + LIBS="$LIBS -ladvapi32 -lgdi32 -lws2_32 -luser32 -lkernel32" + ;; +esac + +## Find a termlib to use. +octave_found_termlib=no +for termlib in ncurses curses termcap terminfo termlib; do + AC_CHECK_LIB(${termlib}, tputs, [ + TERM_LIBS="-l${termlib}" + octave_found_termlib=yes + break]) +done + +if test "$octave_found_termlib" = no; then + warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, o\ +r -ltermlib!" + AC_MSG_WARN([$warn_termlibs]) +fi +AC_SUBST(TERM_LIBS) + +### Checks for header files. + +AC_HEADER_DIRENT +AC_HEADER_SYS_WAIT + +dnl FIXME: We should probably only generate this file if it is missing. +### Produce unistd.h for MSVC target, this simplifies changes in +### Octave source tree and avoid problems with lex-generated code. +case "$canonical_host_type" in + *-*-msdosmsvc) + AC_MSG_NOTICE([Generating replacement for for MSVC]) + cat << \EOF > unistd.h +/* File generated by configure script. */ +#include +#include +#include +EOF + CPPFLAGS="-I. $CPPFLAGS" + ;; +esac + +## C headers + +AC_CHECK_HEADERS(curses.h direct.h dlfcn.h floatingpoint.h grp.h \ + ieeefp.h inttypes.h locale.h memory.h ncurses.h poll.h pthread.h \ + pwd.h sunmath.h sys/ioctl.h sys/param.h sys/poll.h sys/resource.h \ + sys/select.h sys/utsname.h termcap.h) + +## C++ headers + +AC_LANG_PUSH(C++) + +AC_CHECK_HEADERS(sstream) +OCTAVE_UNORDERED_MAP_HEADERS + +AC_LANG_POP(C++) + +## Find a termio header to include. + +have_termios_h=no +AC_CHECK_HEADERS(termios.h, have_termios_h=yes) +AC_CHECK_HEADERS(termio.h, have_termio_h=yes, have_termio_h=no) +AC_CHECK_HEADERS(sgtty.h, have_sgtty_h=yes, have_sgtty_h=no) +AC_CHECK_HEADERS(fnmatch.h, have_fnmatch_h=yes, have_fnmatch_h=no) +AC_CHECK_HEADERS(conio.h, have_conio_h=yes, have_conio_h=no) + +if test "$have_termios_h" = yes \ + || test "$have_termio_h" = yes \ + || test "$have_sgtty_h" = yes; then + true +else + AC_MSG_WARN([I couldn't find termios.h, termio.h, or sgtty.h!]) +fi + +## For MSVC compilers, avoid #define of min/max from windows.h header +if test "$have_msvc" = "yes"; then + AC_DEFINE(NOMINMAX, 1, [Define to 1 if you want to avoid min/max macro definition in Windows headers.]) +fi + +### Determine types and size of types. -OCTAVE_CMATH_FUNC(isnan) -OCTAVE_CMATH_FUNC(isinf) -OCTAVE_CMATH_FUNC(isfinite) +AC_TYPE_INT64_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UID_T +AC_TYPE_UINT64_T +AC_CHECK_TYPES([dev_t, ino_t]) +AC_CHECK_TYPES([long long int, unsigned long long int]) +AC_CHECK_TYPES([ptrdiff_t]) + +## How big are ints and how are they oriented? +## These could probably be eliminated in favor of run-time checks. + +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long long) +## Check for long double type (for 64-bit integers) +AC_CHECK_SIZEOF(long double) + +### Check structures and existence of necessary members + +AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev]) +AC_CHECK_MEMBERS([struct group.gr_passwd]) + +AC_STRUCT_TIMEZONE + +### Check compiler characteristics. + +## Does compiler have support for new friend template declarations? +OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL + +## Does reinterpret_cast fail for function pointers? +OCTAVE_CXX_BROKEN_REINTERPRET_CAST + +## Check if C++ compiler allows placement delete. +OCTAVE_CXX_PLACEMENT_DELETE + +## Check if C++ compiler can auto allocate variable sized arrays. +OCTAVE_CXX_DYNAMIC_AUTO_ARRAYS + +## Check that C compiler and libraries support IEEE754 data format. +OCTAVE_IEEE754_DATA_FORMAT + +## Is C++ runtime library ISO compliant? +OCTAVE_CXX_ISO_COMPLIANT_LIBRARY + +## Are bit_and, bit_or, and bit_xor defined as templated operators? +OCTAVE_CXX_BITWISE_OP_TEMPLATES + +## Can complex class set components independently? +OCTAVE_CXX_COMPLEX_SETTERS + +## Are there functions to access real/imag parts of numbers via references? +OCTAVE_CXX_COMPLEX_REFERENCE_ACCESSORS + +## Check if fast integer arithmetics based on bit tricks is available. +OCTAVE_FAST_INT_OPS + +## Does the C compiler handle alloca() and const correctly? +AC_FUNC_ALLOCA + +## Does the C compiler support Automake subdir-objects option? +AM_PROG_CC_C_O + +### gnulib initialization: part 2 +### After all include and path modifications have taken place +### and at the same priority level as function checks. + +gl_INIT + +### Checks for functions and variables. + +AC_CHECK_FUNCS(basename canonicalize_file_name \ + chmod dup2 endgrent endpwent execvp expm1 expm1f fork \ + getegid geteuid getgid getgrent getgrgid getgrnam getpgrp getpid \ + getppid getpwent getpwuid getuid getwd _kbhit kill \ + lgamma lgammaf lgamma_r lgammaf_r localtime_r log1p log1pf \ + mkstemp pipe putenv \ + realpath resolvepath rindex roundl select setgrent setlocale \ + setpwent setvbuf siglongjmp \ + strsignal tempnam tgammaf umask \ + uname utime waitpid \ + _chmod x_utime _utime32) + +## exp2, round, tgamma function checks +AC_LANG_PUSH(C++) +AC_CHECK_DECLS([exp2, round, tgamma], [], [], [[#include ]]) +AC_CHECK_FUNCS([exp2 round tgamma]) +AH_VERBATIM([Z_FUNCS_AND_DECLS], [ +#if defined (__cplusplus) +extern "C" { +#endif +#if HAVE_EXP2 && ! HAVE_DECL_EXP2 +double exp2 (double); +#endif +#if HAVE_ROUND && ! HAVE_DECL_ROUND +double round (double); +#endif +#if HAVE_TGAMMA && ! HAVE_DECL_TGAMMA +double tgamma (double); +#endif +#if defined (__cplusplus) +} +#endif +]) +AC_LANG_POP(C++) + +## Look in for the IEEE functions isnan, isinf, isfinite that we need. + +OCTAVE_CHECK_FUNC_CMATH(isnan) +OCTAVE_CHECK_FUNC_CMATH(isinf) +OCTAVE_CHECK_FUNC_CMATH(isfinite) dnl Would like to get rid of this cruft, and just have dnl @@ -1961,62 +1957,109 @@ ;; esac -### Check for nonstandard but common math functions that we need. +## Check for nonstandard, but common math functions, that we need. + +AC_CHECK_FUNCS(acosh acoshf asinh asinhf atanh atanhf cbrt cbrtf erf erff \ + erfc erfcf exp2f hypotf _hypotf log2 log2f) -AC_CHECK_FUNCS(acosh acoshf asinh asinhf atanh atanhf erf erff erfc erfcf exp2f log2 log2f) -AC_CHECK_FUNCS(hypotf _hypotf cbrt cbrtf) +## MinGW exception for mkstemp +case "$canonical_host_type" in + *-*-mingw*) + ## MinGW does not provide a mkstemp function. However, it provides + ## the mkstemps function in libiberty. + AC_MSG_CHECKING([for mkstemps in libiberty]) + save_LIBS="$LIBS" + LIBS="-liberty $LIBS" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[ + int mkstemps (char *pattern, int suffix_len); + ]], [[ + mkstemps ("XXXXXX", 0); + ]] + )], + [AC_MSG_RESULT(yes) + HAVE_MKSTEMPS=yes + AC_DEFINE(HAVE_MKSTEMPS, 1, + [Define to 1 if mkstemps is available in libiberty.]) + ], + [AC_MSG_RESULT(no) + HAVE_MKSTEMPS=no + LIBS="$save_LIBS" + ]) + ;; +esac -### Checks for OS specific cruft. +## Windows-specific tests for extra #defines +case "$canonical_host_type" in + *-*-msdosmsvc | *-*-mingw*) + AC_MSG_CHECKING([for required _WIN32_WINNT]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #if _WIN32_WINNT < 0x0403 + #error "Wrong version" + #endif + ]], [])], + [AC_MSG_RESULT([none])], + [AC_DEFINE(_WIN32_WINNT, 0x0403, + [Define to 0x0403 to access InitializeCriticalSectionAndSpinCount.]) + AC_MSG_RESULT([0x0403])]) + AC_MSG_CHECKING([whether _USE_MATH_DEFINES needs to be defined]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + int x = M_LN2;]])], + [AC_MSG_RESULT([no])], + [AC_DEFINE(_USE_MATH_DEFINES, 1, + [Define to 1 if your system needs to define math constants like M_LN2.]) + AC_MSG_RESULT([yes])]) + ;; +esac -AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev]) +## Cygwin kluge for getrusage. +AC_CHECK_FUNCS(getrusage) +case "$canonical_host_type" in + *-*-cygwin*) + AC_DEFINE(RUSAGE_TIMES_ONLY, 1, + [Define to 1 if your struct rusage only has time information.]) + ;; +esac -AC_STRUCT_TIMEZONE +## Check for CGDisplayBitsPerPixel function on Mac OSX systems with Carbon +if test $have_framework_carbon = "yes"; then + OCTAVE_CARBON_CGDISPLAYBITSPERPIXEL +fi + +AC_CHECK_FUNCS(getpwnam, [], [AC_CHECK_LIB(sun, getpwnam)]) + AC_FUNC_CLOSEDIR_VOID -AC_CHECK_MEMBERS(struct group.gr_passwd) - -octave_found_termlib=no -for termlib in ncurses curses termcap terminfo termlib; do - AC_CHECK_LIB(${termlib}, tputs, [ - TERM_LIBS="-l${termlib}" - octave_found_termlib=yes - break]) -done - -if test "$octave_found_termlib" = no; then - warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, o\ -r -ltermlib!" - AC_MSG_WARN([$warn_termlibs]) +## Check return type of matherr() +AC_CACHE_CHECK([for struct exception in math.h], + [octave_cv_func_matherr_type], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + struct exception *x; + x->type; + x->name; + ]])], + octave_cv_func_matherr_type=yes, + octave_cv_func_matherr_type=no) + ]) +if test $octave_cv_func_matherr_type = "yes"; then + AC_DEFINE(EXCEPTION_IN_MATH, 1, + [Define to 1 if math.h declares struct exception for matherr().]) fi -AC_SUBST(TERM_LIBS) - -### Return type of matherr() -AC_MSG_CHECKING([for struct exception in math.h]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[struct exception *x; x->type; x->name;]])], - [AC_MSG_RESULT(yes) - AC_DEFINE(EXCEPTION_IN_MATH, 1, - [Define to 1 if your math.h declares struct exception for matherr().])], - [AC_MSG_RESULT(no)]) - -### Signal stuff. + +## Signal stuff. AC_CHECK_DECLS([sys_siglist], [], [], -[#include +[[#include /* NetBSD declares sys_siglist in unistd.h. */ #if HAVE_UNISTD_H # include #endif -]) - -### A system dependent kludge or two. - -AC_CHECK_FUNCS(getrusage) -case "$canonical_host_type" in - *-*-cygwin*) - AC_DEFINE(RUSAGE_TIMES_ONLY, 1, [Define to 1 if your struct rusage only has time information.]) - ;; -esac +]]) ### Checks for other programs used in building, testing, installing, and ### running Octave. @@ -2045,6 +2088,7 @@ OCTAVE_PROG_GPERF OCTAVE_PROG_GHOSTSCRIPT +OCTAVE_PROG_MAKEINFO OCTAVE_PROG_TEXI2DVI OCTAVE_PROG_TEXI2PDF @@ -2083,10 +2127,11 @@ AC_ARG_ENABLE(extra-warning-flags, [AS_HELP_STRING([--enable-extra-warning-flags], - [add -Wall, -W, -Wshadow, and -Wold-style-cast options to CFLAGS and CXXFLAGS (on by default, but only if the compiler appears to accept them)])], + [add -Wall, -W, -Wshadow, and -Wold-style-cast options to CFLAGS and CXXFLAGS (on by default, but only if the compiler appears to accept them)])], [if test "$enableval" = no; then try_extra_warning_flags=false - fi], []) + fi], + []) if $try_extra_warning_flags; then for flag in $GCC_EXTRA_FLAGS; do @@ -2109,10 +2154,11 @@ AC_ARG_ENABLE(strict-warning-flags, [AS_HELP_STRING([--enable-strict-warning-flags], - [add extra strict warning options to CFLAGS and CXXFLAGS (off by default)])], + [add extra strict warning options to CFLAGS and CXXFLAGS (off by default)])], [if test "$enableval" = yes; then try_strict_warning_flags=true - fi], []) + fi], + []) if $try_strict_warning_flags; then for flag in $GCC_STRICT_FLAGS; do @@ -2130,6 +2176,46 @@ AC_SUBST(WARN_CFLAGS) AC_SUBST(WARN_CXXFLAGS) +### GUI/Qt related tests. + +HAVE_QT=false +QT_INCDIR= +QT_LIBDIR= +build_gui=yes +win32_terminal=no +AC_ARG_ENABLE(gui, + [AS_HELP_STRING([--disable-gui], [build GUI (default is yes)])], + [if test "$enableval" = no; then build_gui=no; fi], [build_gui=yes]) + +if test $build_gui = yes; then + AC_CHECK_PROGS(QMAKE, [qmake qmake-qt4 qmake-qt5]) + if test -n "$QMAKE"; then + QT_INCDIR=`$QMAKE -query | sed -n -e 's/^QT_INSTALL_HEADERS://p'` + QT_LIBDIR=`$QMAKE -query | sed -n -e 's/^QT_INSTALL_LIBS://p'` + AC_CHECK_PROGS(MOC, [moc moc-qt4 moc-qt5]) + AC_CHECK_PROGS(UIC, [uic uic-qt4 uic-qt5]) + AC_CHECK_PROGS(RCC, [rcc]) + if test -n "$MOC" && test -n "$UIC" && test -n "$RCC"; then + HAVE_QT=true + AC_DEFINE(HAVE_QT, 1, + [Define to 1 if Qt is available (must have moc, uic, and rcc programs and developer header files and libraries installed).]) + fi + fi + + case "$canonical_host_type" in + *-*-mingw* | *-*-msdosmsvc*) win32_terminal=yes ;; + *) + AC_CHECK_HEADERS([pty.h libutil.h util.h]) + AC_SEARCH_LIBS([openpty], [util], + [AC_DEFINE(HAVE_OPENPTY, [], [Define whether openpty exists])]) + ;; + esac +fi +AM_CONDITIONAL([AMCOND_BUILD_GUI], [test $build_gui = yes]) +AM_CONDITIONAL([WIN32_TERMINAL], [test $win32_terminal = yes]) +AC_SUBST(QT_INCDIR) +AC_SUBST(QT_LIBDIR) + ### Run configure in subdirectories. export CC @@ -2138,6 +2224,8 @@ ### Some things to add to the bottom of config.h. +dnl ------------------------------------------------------------ + AH_BOTTOM([ #if !defined (GNULIB_NAMESPACE) #define GNULIB_NAMESPACE gnulib @@ -2145,8 +2233,13 @@ #if defined (__GNUC__) #define GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) +#define HAVE_ATTR_DEPRECATED + #define GCC_ATTR_NORETURN __attribute__ ((__noreturn__)) +#define HAVE_ATTR_NORETURN + #define GCC_ATTR_UNUSED __attribute__ ((__unused__)) +#define HAVE_ATTR_UNUSED #else #define GCC_ATTR_DEPRECATED #define GCC_ATTR_NORETURN @@ -2262,14 +2355,14 @@ #define OCTAVE_API OCTAVE_IMPORT #endif -/* API macro for src */ +/* API macro for libinterp */ #ifdef OCTINTERP_DLL #define OCTINTERP_API OCTAVE_EXPORT #else #define OCTINTERP_API OCTAVE_IMPORT #endif -/* API macro for src/graphics */ +/* API macro for libinterp/graphics */ #ifdef OCTGRAPHICS_DLL #define OCTGRAPHICS_API OCTAVE_EXPORT #else @@ -2286,6 +2379,9 @@ #define OCTAVE_CONFIG_INCLUDED 1 ]) +dnl end of AH_BOTTOM +dnl ------------------------------------------------------------ + ### Do the substitutions in all the Makefiles. AC_SUBST(ac_config_files) @@ -2303,6 +2399,9 @@ libcruft/Makefile libcruft/mkf77def libgnu/Makefile + libgui/Makefile + libgui/src/Makefile + libinterp/Makefile liboctave/Makefile scripts/Makefile src/Makefile @@ -2384,6 +2483,8 @@ QHULL LDFLAGS: $QHULL_LDFLAGS QHULL libraries: $QHULL_LIBS QRUPDATE libraries: $QRUPDATE_LIBS + Qt headers: $QT_INCDIR + Qt libraries: $QT_LIBDIR READLINE libraries: $READLINE_LIBS REGEX libraries: $REGEX_LIBS TERM libraries: $TERM_LIBS diff --git a/doc/icons/octave.desktop.in b/doc/icons/octave.desktop.in --- a/doc/icons/octave.desktop.in +++ b/doc/icons/octave.desktop.in @@ -6,5 +6,5 @@ Icon=%OCTAVE_IMAGEDIR%/octave-logo.svg Terminal=true Type=Application -Categories=Development;Math;Science; +Categories=Education;Science;Math; StartupNotify=false diff --git a/doc/interpreter/Makefile.am b/doc/interpreter/Makefile.am --- a/doc/interpreter/Makefile.am +++ b/doc/interpreter/Makefile.am @@ -22,7 +22,7 @@ ## Automake generated rules for documentation are not parallel-safe. ## Restrict current directory to run serially -.NOTPARALLEL: +## .NOTPARALLEL: TEXINFO_TEX = ../texinfo.tex @@ -159,16 +159,24 @@ contributors.texi \ $(MUNGED_TEXI_SRC) -octave.info octave.dvi octave.html octave.pdf: $(srcdir)/version.texi $(octave_TEXINFOS) $(EXAMPLE_FILES) $(srcdir)/images.mk +octave.info octave.dvi octave.html/index.html octave.pdf: $(srcdir)/version.texi $(octave_TEXINFOS) $(EXAMPLE_FILES) $(srcdir)/images.mk octave.info: $(IMAGES_TXT) octave.dvi octave.ps: $(IMAGES_EPS) octave_logo.eps -octave.html: $(IMAGES_PNG) +octave.html/index.html: $(IMAGES_PNG) + +octave.html: + if [ -d octave.html ]; then true; else mkdir octave.html; fi octave.pdf: $(IMAGES_PDF) octave_logo.pdf +## The texi2dvi script (used to create both PDF and DVI output formats) +## uses some fixed temporary file names, so wait for DVI file to be +## generated before creating PDF file to avoid conflicts. +octave.pdf: octave.dvi + all-local: dvi html pdf ps doc-cache $(HTMLDIR_IMAGES) # Prevent packaging of distribution unless all libraries diff --git a/doc/interpreter/arith.txi b/doc/interpreter/arith.txi --- a/doc/interpreter/arith.txi +++ b/doc/interpreter/arith.txi @@ -309,10 +309,6 @@ @DOCSTRING(pi) -@c Provide a Seealso link location for these objects in the documentation -@anchor{doc-i} -@anchor{doc-j} -@anchor{doc-J} @DOCSTRING(I) @DOCSTRING(Inf) diff --git a/doc/interpreter/contributors.in b/doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in +++ b/doc/interpreter/contributors.in @@ -48,6 +48,7 @@ Bill Denney Fabian Deutsch Christos Dimitrakakis +Vivek Dogra David M. Doolin Carnë Draug Pascal A. Dupuis @@ -294,3 +295,6 @@ Michael Zeising Federico Zenith Alex Zvoleff +Valentin Ortega-Clavero +Jacob Dawid +Júlio Hoffimann diff --git a/doc/interpreter/find-docstring-files.sh b/doc/interpreter/find-docstring-files.sh --- a/doc/interpreter/find-docstring-files.sh +++ b/doc/interpreter/find-docstring-files.sh @@ -15,8 +15,8 @@ echo "$1/scripts/DOCSTRINGS" fi -if [ -f "../../src/DOCSTRINGS" ]; then - echo "../../src/DOCSTRINGS" +if [ -f "../../libinterp/DOCSTRINGS" ]; then + echo "../../libinterp/DOCSTRINGS" else - echo "$1/src/DOCSTRINGS" + echo "$1/libinterp/DOCSTRINGS" fi diff --git a/doc/interpreter/images.awk b/doc/interpreter/images.awk --- a/doc/interpreter/images.awk +++ b/doc/interpreter/images.awk @@ -34,7 +34,7 @@ for (j = 2; j <= NF; j++) { if (ext == "png") { - printf ("octave.html/%s.png: %s.png octave.html/index.html\n", $j, $j); + printf ("octave.html/%s.png: %s.png octave.html\n", $j, $j); printf ("\tcp $< $@\n"); } printf ("%s.%s: %s\n", $j, ext, script); diff --git a/doc/interpreter/install.txi b/doc/interpreter/install.txi --- a/doc/interpreter/install.txi +++ b/doc/interpreter/install.txi @@ -275,6 +275,17 @@ provide improved performance for the functions @code{qrdelete}, @code{qrinsert}, @code{qrshift}, and @code{qrupdate}. +@item QScintilla +Source code highlighter and manipulator; a Qt port of Scintilla +(@url{http://www.riverbankcomputing.co.uk/software/qscintilla}). +QScintilla is used for syntax highlighting and code completion in the +GUI. + +@item Qt +GUI and utility libraries (@url{}). Qt is required for building the GUI. +It is a large framework, but the only components required are the GUI, +core, Webkit, and network modules. + @item SuiteSparse Sparse matrix factorization library (@url{http://www.cise.ufl.edu/research/sparse/SuiteSparse}). diff --git a/doc/interpreter/macros.texi b/doc/interpreter/macros.texi --- a/doc/interpreter/macros.texi +++ b/doc/interpreter/macros.texi @@ -27,15 +27,17 @@ @c want lots of `See also: foo, bar, and baz' strings cluttering the @c printed manual (that information should be in the supporting text for @c each group of functions and variables). +@c +@c Implementation Note: +@c For TeX, @vskip produces a nice separation. +@c For Texinfo '@sp 1' should work, but in practice produces ugly results +@c for HTML. We use a simple blank line to produce the correct behavior. @macro seealso {args} @iftex @vskip 2pt @end iftex @ifnottex -@c Texinfo @sp should work but in practice produces ugly results for HTML. -@c A simple blank line produces the correct behavior. -@c @sp 1 @end ifnottex @noindent diff --git a/doc/interpreter/poly.txi b/doc/interpreter/poly.txi --- a/doc/interpreter/poly.txi +++ b/doc/interpreter/poly.txi @@ -84,6 +84,8 @@ @DOCSTRING(roots) +@DOCSTRING(polyeig) + @DOCSTRING(compan) @DOCSTRING(mpoles) diff --git a/etc/HACKING b/etc/HACKING --- a/etc/HACKING +++ b/etc/HACKING @@ -105,88 +105,191 @@ doc -- Texinfo documentation for Octave + examples -- some example files + + gnulib -- gnulib subrepo. This is the actual gnulib source + tree, checked out with git. + + + libgnu -- gnulib sources that we use. The files here are + copied here from the gnulib directory by the + build-aux/bootstrap script that is run by the + autogen.sh script. + + libcruft -- various numerical libraries (mostly Fortran) - amos * bessel functions - blas-xtra * wrappers for blas functions used in Octave - daspk * large scale differential algebraic equation solver - dasrt * differential algebraic equation solver with root finding - dassl * differential-algebraic system solver - fftpack * subroutines for fast fourier transforms - lapack-xtra * wrappers for lapack functions used in Octave - misc * miscellaneous utilities - odepack * ordinary differential equation solver - ordered-qz * code for ordering eigenvalues for QZ factorization - quadpack * subroutines for numerical integration - ranlib * random number generators - slatec-err * slatec error handling library - slatec-fn * various special function subroutines + + amos bessel functions + + blas-xtra wrappers for blas functions used in Octave + + daspk large scale differential algebraic equation solver - liboctave -- the C++ interfaces to the numerical libraries and - various OS facilities + dasrt differential algebraic equation solver with root finding + + dassl differential-algebraic system solver + + fftpack subroutines for fast fourier transforms + + lapack-xtra wrappers for lapack functions used in Octave + + misc miscellaneous utilities - scripts -- functions written in the Octave language - audio * play and record sound files (system dependent) - deprecated * older deprecated functions - elfun * elementary mathematical functions - @ftp * ftp object class - general * utility functions - geometry * geometry algorithms - help * help subsystem functions - image * image processing - io * input/output functions - linear-algebra * linear algebra stuff - miscellaneous * stuff that doesn't fit anywhere else - optimization * zero finders and minimizers - path * functions for path manipulation - pkg * the package manager - plot * plotting functions - polynomial * polynomial manipulation - prefs * user-defined preferences - set * set manipulation - signal * signal processing - sparse * sparse matrix support - specfun * special mathematical functions - special-matrix * functions for generating special types of matrices - startup * initialization functions - statistics * statistical functions, distributions, and tests - strings * character string manipulation - testfun * unit testing - time * time and date functions + odepack ordinary differential equation solver + + ordered-qz code for ordering eigenvalues for QZ factorization + + quadpack subroutines for numerical integration + + ranlib random number generators - src -- the interpreter itself plus lots of infrastructure + slatec-err slatec error handling library + + slatec-fn various special function subroutines + + + liboctave -- The C++ interfaces to the numerical libraries and + various OS facilities. + + + libinterp -- The interpreter itself plus lots of infrastructure around it. Octave's extensive octave_value class hierarchy for polymorphically handling all Octave types is defined here. The built-in functions are - also defined here, so if "help foo" tells you foo is - built-in, its source will be somewhere in this - directory. - DLD-FUNCTIONS * Dynamically linked oct files. If you see "help foo" - telling you that foo is defined in foo.oct, then - foo.cc will be found here and contain the source - code. - OPERATORS * Definitions and template instantiations for + also defined here. + + octave-value the octave_value class hierarchy. These are the + container classes that hold various Octave data + types like struct numerical arrays, structure + arrays, and cell arrays. + + parse-tree Classes that define the parse tree for the + interpreter. + + interp-core Core utilities for the interpreter. There are no + DEFUN functions (callable from the scripting + language) defined here. + + interpfcn Functions closely related to the interpreter. + Includes DEFUN functions (callable from the + scripting language). Also may export C++ functions + that are used in other parts of the interpreter. + + corefcn Statically linked DEFUN functions (callable from + the scripting langauge). No C++ functions exported + for use in other parts of the interpreter. + + dldfcn Dynamically linked DEFUN functions (callable + from the scripting language). If you see "help + foo" telling you that foo is defined in foo.oct, + then foo.cc will be found here and contain the + source code. + + operators Definitions and template instantiations for operators for all possible Octave type combinations. - TEMPLATE-INST * Some C++ template instantiations. + + template-inst Some C++ template instantiations. + + + libgui -- the graphical user interface of GNU Octave + + src source files. + + m-editor source files for the m-file editor. + + octave-adapter souce files for the octave layer for threadsafe + communication with the octave interpreter. + qtinfo source files for the Qt texinfo browser. + + icons icon files that will be compiled into the + executable via a resource file. + + qterminal subrepository for the qterminal Qt terminal widget. + + languages translation files and list of translators. + + kb-layouts various files need by the qterminal widget that has + been derived from Konsole. + + + scripts -- functions written in the Octave language + + audio play and record sound files (system dependent) + + deprecated older deprecated functions + + elfun elementary mathematical functions + + @ftp ftp object class + + general utility functions + + geometry geometry algorithms + + help help subsystem functions + + image image processing + + io input/output functions + + linear-algebra linear algebra stuff + + miscellaneous stuff that doesn't fit anywhere else + + optimization zero finders and minimizers + + path functions for path manipulation + + pkg the package manager + + plot plotting functions + + polynomial polynomial manipulation + + prefs user-defined preferences + + set set manipulation + + signal signal processing + + sparse sparse matrix support + + specfun special mathematical functions + + special-matrix functions for generating special types of matrices + + startup initialization functions + + statistics statistical functions, distributions, and tests + + strings character string manipulation + + testfun unit testing + + time time and date functions + test -- tests for the interpreter - test_*.m * fixed tests for the interpreter - fntests.m * script to run function tests embedded in C++ and .m files + + test_ .m fixed tests for the interpreter + fntests.m script to run function tests embedded in C++ and .m + files ---- John W. Eaton jwe@octave.org -Last updated: Tue Nov 22 20:51:34 PST 2011 +Last updated: Sat, 18 Aug 2012 18:51:25 EDT ################################################################################ -Copyright (C) 2009,2012 John W. Eaton +Copyright (C) 2009-2012 John W. Eaton This file is part of Octave. diff --git a/libcruft/Makefile.am b/libcruft/Makefile.am --- a/libcruft/Makefile.am +++ b/libcruft/Makefile.am @@ -20,12 +20,11 @@ include $(top_srcdir)/build-aux/common.mk +AUTOMAKE_OPTIONS = subdir-objects + ## Search local directories before those specified by the user. AM_CPPFLAGS = \ - -I../libgnu -I$(top_srcdir)/libgnu \ - @CPPFLAGS@ - -AUTOMAKE_OPTIONS = subdir-objects + -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu octlib_LTLIBRARIES = libcruft.la @@ -43,7 +42,7 @@ libcruft_la_LIBADD = \ libranlib.la \ - ../libgnu/libgnu.la \ + $(top_builddir)/libgnu/libgnu.la \ $(LIBCRUFT_LINK_DEPS) # Increment these as needed and according to the rules in the libtool diff --git a/libcruft/misc/f77-fcn.c b/libcruft/misc/f77-fcn.c --- a/libcruft/misc/f77-fcn.c +++ b/libcruft/misc/f77-fcn.c @@ -60,5 +60,5 @@ octave_jump_to_enclosing_context (); - F77_RETURN (0) + F77_NORETURN (0) } diff --git a/libcruft/misc/f77-fcn.h b/libcruft/misc/f77-fcn.h --- a/libcruft/misc/f77-fcn.h +++ b/libcruft/misc/f77-fcn.h @@ -81,6 +81,57 @@ #define F77_FCN(f, F) F77_FUNC (f, F) #endif +/* + +The following macros are used for handling Fortran <-> C calling +conventions. They are defined below for three different types of +systems, Cray (possibly now obsolete), Visual Fortran, and any system +that is compatible with the f2c calling conventions, including g77 and +gfortran. Note that gfortran is not completely compatible with the +f2c calling conventions, but that we only use the parts that are +compatible. For example, f2c and gfortran differ in the way they +handle Fortran functions that return complex values, but Octave does +not call any Fortran functions like that directly from C or C++. + +Use these macros to pass character strings from C to Fortran: + + F77_CHAR_ARG(x) + F77_CONST_CHAR_ARG(x) + F77_CXX_STRING_ARG(x) + F77_CHAR_ARG_LEN(l) + F77_CHAR_ARG_DECL + F77_CONST_CHAR_ARG_DECL + F77_CHAR_ARG_LEN_DECL + +Use these macros to write C-language functions that accept +Fortran-style character strings: + + F77_CHAR_ARG_DEF(s, len) + F77_CONST_CHAR_ARG_DEF(s, len) + F77_CHAR_ARG_LEN_DEF(len) + F77_CHAR_ARG_USE(s) + F77_CHAR_ARG_LEN_USE(s, len) + +Use this macro to declare the return type of a C-language function +that is supposed to act like a Fortran subroutine: + + F77_RET_T int + +Use these macros to return from C-language functions that are supposed +to act like Fortran subroutines. F77_NORETURN is intended to be used +as the last statement of such a function that has been tagged with a +"noreturn" attribute. If the compiler supports the "noreturn" +attribute or if F77_RET_T is void, then it should expand to nothing so +that we avoid warnings about functions tagged as "noreturn" +containing a return statement. Otherwise, it should expand to a +statement that returns the given value so that we avoid warnings about +not returning a value from a function declared to return something. + + F77_RETURN(retval) + F77_NORETURN(retval) + +*/ + #if defined (F77_USES_CRAY_CALLING_CONVENTION) #include @@ -106,8 +157,20 @@ #define F77_CHAR_ARG_USE(s) s.ptr #define F77_CHAR_ARG_LEN_USE(s, len) (s.mask.len>>3) +/* Use this macro to declare the return type of a C-language function + that is supposed to act like a Fortran subroutine. */ #define F77_RET_T int + +/* Use these macros to return from C-language functions that are + supposed to act like Fortran subroutines. F77_NORETURN is intended + to be used as the last statement of such a function that has been + tagged with a "noreturn" attribute. */ #define F77_RETURN(retval) return retval; +#if defined (HAVE_ATTR_NORETURN) +#define F77_NORETURN(retval) +#else +#define F77_NORETURN(retval) return retval; +#endif /* FIXME -- these should work for SV1 or Y-MP systems but will need to be changed for others. */ @@ -167,8 +230,6 @@ #define F77_CONST_CHAR_ARG_DECL const char *, int #define F77_CHAR_ARG_LEN_DECL -/* Use these macros to write C-language functions that accept - Fortran-style character strings. */ #define F77_CHAR_ARG_DEF(s, len) char *s, int len #define F77_CONST_CHAR_ARG_DEF(s, len) const char *s, int len #define F77_CHAR_ARG_LEN_DEF(len) @@ -176,13 +237,14 @@ #define F77_CHAR_ARG_LEN_USE(s, len) len #define F77_RET_T void -#define F77_RETURN(retval) + +#define F77_RETURN(retval) return; +#define F77_NORETURN(retval) #else /* Assume f2c-compatible calling convention. */ -/* Use these macros to pass character strings from C to Fortran. */ #define F77_CHAR_ARG(x) x #define F77_CONST_CHAR_ARG(x) F77_CHAR_ARG (x) #define F77_CHAR_ARG2(x, l) x @@ -193,8 +255,6 @@ #define F77_CONST_CHAR_ARG_DECL const char * #define F77_CHAR_ARG_LEN_DECL , long -/* Use these macros to write C-language functions that accept - Fortran-style character strings. */ #define F77_CHAR_ARG_DEF(s, len) char *s #define F77_CONST_CHAR_ARG_DEF(s, len) const char *s #define F77_CHAR_ARG_LEN_DEF(len) , long len @@ -202,7 +262,13 @@ #define F77_CHAR_ARG_LEN_USE(s, len) len #define F77_RET_T int + #define F77_RETURN(retval) return retval; +#if defined (HAVE_ATTR_NORETURN) +#define F77_NORETURN(retval) +#else +#define F77_NORETURN(retval) return retval; +#endif #endif diff --git a/libgnu/Makefile.am b/libgnu/Makefile.am --- a/libgnu/Makefile.am +++ b/libgnu/Makefile.am @@ -1,21 +1,2986 @@ -# Copyright (C) 2009 John W. Eaton +## DO NOT EDIT! GENERATED AUTOMATICALLY! +## Process this file with automake to produce Makefile.in. +# Copyright (C) 2002-2012 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see . +# +# As a special exception to the GNU General Public License, +# this file may be distributed as part of a program that +# contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. # -# This file is part of Octave. -# -# Octave is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation; either version 3 of the License, or (at -# your option) any later version. -# -# Octave is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with Octave; see the file COPYING. If not, see -# . - -# Simply include gnulib.mk, at least for now. - -include gnulib.mk +# Generated by gnulib-tool. +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libgnu --source-base=libgnu --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --libtool --macro-prefix=gl base64 c-strcase closedir copysign copysignf crypto/md5 fclose fcntl fflush filemode fnmatch fopen fseek ftell getcwd gethostname getopt-gnu gettimeofday glob isatty link lstat mkdir mkfifo mkostemp mkstemp mktime nanosleep nproc opendir pathmax progname readdir readlink rename rewinddir rmdir round roundf sigaction signal sigprocmask sleep stat stdint stdio strftime strptime symlink sys_stat sys_time sys_times time times tmpfile trunc truncf unistd unlink vasprintf + +AUTOMAKE_OPTIONS = 1.5 gnits + +SUBDIRS = +noinst_HEADERS = +noinst_LIBRARIES = +noinst_LTLIBRARIES = +EXTRA_DIST = +BUILT_SOURCES = +SUFFIXES = +MOSTLYCLEANFILES = core *.stackdump +MOSTLYCLEANDIRS = +CLEANFILES = +DISTCLEANFILES = +MAINTAINERCLEANFILES = + +AM_CPPFLAGS = +AM_CFLAGS = + +noinst_LTLIBRARIES += libgnu.la + +libgnu_la_SOURCES = +libgnu_la_LIBADD = $(gl_LTLIBOBJS) +libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS) +EXTRA_libgnu_la_SOURCES = +libgnu_la_LDFLAGS = $(AM_LDFLAGS) +libgnu_la_LDFLAGS += -no-undefined +libgnu_la_LDFLAGS += $(COPYSIGNF_LIBM) +libgnu_la_LDFLAGS += $(COPYSIGN_LIBM) +libgnu_la_LDFLAGS += $(FLOOR_LIBM) +libgnu_la_LDFLAGS += $(GETHOSTNAME_LIB) +libgnu_la_LDFLAGS += $(LIBSOCKET) +libgnu_la_LDFLAGS += $(LIB_NANOSLEEP) +libgnu_la_LDFLAGS += $(LIB_SELECT) +libgnu_la_LDFLAGS += $(LTLIBINTL) +libgnu_la_LDFLAGS += $(ROUNDF_LIBM) +libgnu_la_LDFLAGS += $(ROUND_LIBM) +libgnu_la_LDFLAGS += $(TRUNCF_LIBM) +libgnu_la_LDFLAGS += $(TRUNC_LIBM) + +## begin gnulib module alloca + + +libgnu_la_LIBADD += @LTALLOCA@ +libgnu_la_DEPENDENCIES += @LTALLOCA@ +EXTRA_DIST += alloca.c + +EXTRA_libgnu_la_SOURCES += alloca.c + +## end gnulib module alloca + +## begin gnulib module alloca-opt + +BUILT_SOURCES += $(ALLOCA_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_ALLOCA_H +alloca.h: alloca.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/alloca.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +else +alloca.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += alloca.h alloca.h-t + +EXTRA_DIST += alloca.in.h + +## end gnulib module alloca-opt + +## begin gnulib module at-internal + + +EXTRA_DIST += openat-priv.h openat-proc.c + +EXTRA_libgnu_la_SOURCES += openat-proc.c + +## end gnulib module at-internal + +## begin gnulib module base64 + +libgnu_la_SOURCES += base64.h base64.c + +## end gnulib module base64 + +## begin gnulib module c-ctype + +libgnu_la_SOURCES += c-ctype.h c-ctype.c + +## end gnulib module c-ctype + +## begin gnulib module c-strcase + +libgnu_la_SOURCES += c-strcase.h c-strcasecmp.c c-strncasecmp.c + +## end gnulib module c-strcase + +## begin gnulib module canonicalize-lgpl + + +EXTRA_DIST += canonicalize-lgpl.c + +EXTRA_libgnu_la_SOURCES += canonicalize-lgpl.c + +## end gnulib module canonicalize-lgpl + +## begin gnulib module chdir-long + + +EXTRA_DIST += chdir-long.c chdir-long.h + +EXTRA_libgnu_la_SOURCES += chdir-long.c + +## end gnulib module chdir-long + +## begin gnulib module cloexec + +libgnu_la_SOURCES += cloexec.c + +EXTRA_DIST += cloexec.h + +## end gnulib module cloexec + +## begin gnulib module close + + +EXTRA_DIST += close.c + +EXTRA_libgnu_la_SOURCES += close.c + +## end gnulib module close + +## begin gnulib module closedir + + +EXTRA_DIST += closedir.c dirent-private.h + +EXTRA_libgnu_la_SOURCES += closedir.c + +## end gnulib module closedir + +## begin gnulib module configmake + +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+. +# The Automake-defined pkg* macros are appended, in the order +# listed in the Automake 1.10a+ documentation. +configmake.h: Makefile + $(AM_V_GEN)rm -f $@-t && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + echo '#define PREFIX "$(prefix)"'; \ + echo '#define EXEC_PREFIX "$(exec_prefix)"'; \ + echo '#define BINDIR "$(bindir)"'; \ + echo '#define SBINDIR "$(sbindir)"'; \ + echo '#define LIBEXECDIR "$(libexecdir)"'; \ + echo '#define DATAROOTDIR "$(datarootdir)"'; \ + echo '#define DATADIR "$(datadir)"'; \ + echo '#define SYSCONFDIR "$(sysconfdir)"'; \ + echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \ + echo '#define LOCALSTATEDIR "$(localstatedir)"'; \ + echo '#define INCLUDEDIR "$(includedir)"'; \ + echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \ + echo '#define DOCDIR "$(docdir)"'; \ + echo '#define INFODIR "$(infodir)"'; \ + echo '#define HTMLDIR "$(htmldir)"'; \ + echo '#define DVIDIR "$(dvidir)"'; \ + echo '#define PDFDIR "$(pdfdir)"'; \ + echo '#define PSDIR "$(psdir)"'; \ + echo '#define LIBDIR "$(libdir)"'; \ + echo '#define LISPDIR "$(lispdir)"'; \ + echo '#define LOCALEDIR "$(localedir)"'; \ + echo '#define MANDIR "$(mandir)"'; \ + echo '#define MANEXT "$(manext)"'; \ + echo '#define PKGDATADIR "$(pkgdatadir)"'; \ + echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \ + echo '#define PKGLIBDIR "$(pkglibdir)"'; \ + echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \ + } | sed '/""/d' > $@-t && \ + mv -f $@-t $@ + +BUILT_SOURCES += configmake.h +CLEANFILES += configmake.h configmake.h-t + +## end gnulib module configmake + +## begin gnulib module copysign + + +EXTRA_DIST += copysign.c + +EXTRA_libgnu_la_SOURCES += copysign.c + +## end gnulib module copysign + +## begin gnulib module copysignf + + +EXTRA_DIST += copysignf.c + +EXTRA_libgnu_la_SOURCES += copysignf.c + +## end gnulib module copysignf + +## begin gnulib module crypto/md5 + +libgnu_la_SOURCES += md5.c + +EXTRA_DIST += md5.h + +## end gnulib module crypto/md5 + +## begin gnulib module dirent + +BUILT_SOURCES += dirent.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \ + -e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \ + -e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \ + -e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \ + -e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \ + -e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \ + -e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \ + -e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \ + -e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \ + -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \ + -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \ + -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \ + -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \ + -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \ + -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \ + -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \ + -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \ + -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \ + -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \ + -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \ + -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \ + -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/dirent.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += dirent.h dirent.h-t + +EXTRA_DIST += dirent.in.h + +## end gnulib module dirent + +## begin gnulib module dirfd + + +EXTRA_DIST += dirfd.c + +EXTRA_libgnu_la_SOURCES += dirfd.c + +## end gnulib module dirfd + +## begin gnulib module dirname-lgpl + +libgnu_la_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c + +EXTRA_DIST += dirname.h + +## end gnulib module dirname-lgpl + +## begin gnulib module dosname + + +EXTRA_DIST += dosname.h + +## end gnulib module dosname + +## begin gnulib module dup + + +EXTRA_DIST += dup.c + +EXTRA_libgnu_la_SOURCES += dup.c + +## end gnulib module dup + +## begin gnulib module dup2 + + +EXTRA_DIST += dup2.c + +EXTRA_libgnu_la_SOURCES += dup2.c + +## end gnulib module dup2 + +## begin gnulib module errno + +BUILT_SOURCES += $(ERRNO_H) + +# We need the following in order to create when the system +# doesn't have one that is POSIX compliant. +if GL_GENERATE_ERRNO_H +errno.h: errno.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \ + -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \ + -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \ + -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \ + -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \ + -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \ + -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \ + < $(srcdir)/errno.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +errno.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += errno.h errno.h-t + +EXTRA_DIST += errno.in.h + +## end gnulib module errno + +## begin gnulib module error + + +EXTRA_DIST += error.c error.h + +EXTRA_libgnu_la_SOURCES += error.c + +## end gnulib module error + +## begin gnulib module exitfail + +libgnu_la_SOURCES += exitfail.c + +EXTRA_DIST += exitfail.h + +## end gnulib module exitfail + +## begin gnulib module fchdir + + +EXTRA_DIST += fchdir.c + +EXTRA_libgnu_la_SOURCES += fchdir.c + +## end gnulib module fchdir + +## begin gnulib module fclose + + +EXTRA_DIST += fclose.c + +EXTRA_libgnu_la_SOURCES += fclose.c + +## end gnulib module fclose + +## begin gnulib module fcntl + + +EXTRA_DIST += fcntl.c + +EXTRA_libgnu_la_SOURCES += fcntl.c + +## end gnulib module fcntl + +## begin gnulib module fcntl-h + +BUILT_SOURCES += fcntl.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += fcntl.h fcntl.h-t + +EXTRA_DIST += fcntl.in.h + +## end gnulib module fcntl-h + +## begin gnulib module fd-hook + +libgnu_la_SOURCES += fd-hook.c + +EXTRA_DIST += fd-hook.h + +## end gnulib module fd-hook + +## begin gnulib module fdopendir + + +EXTRA_DIST += fdopendir.c + +EXTRA_libgnu_la_SOURCES += fdopendir.c + +## end gnulib module fdopendir + +## begin gnulib module fflush + + +EXTRA_DIST += fflush.c stdio-impl.h + +EXTRA_libgnu_la_SOURCES += fflush.c + +## end gnulib module fflush + +## begin gnulib module filemode + +libgnu_la_SOURCES += filemode.c + +EXTRA_DIST += filemode.h + +## end gnulib module filemode + +## begin gnulib module filename + + +EXTRA_DIST += filename.h + +## end gnulib module filename + +## begin gnulib module filenamecat-lgpl + +libgnu_la_SOURCES += filenamecat-lgpl.c + +EXTRA_DIST += filenamecat.h + +## end gnulib module filenamecat-lgpl + +## begin gnulib module float + +BUILT_SOURCES += $(FLOAT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_FLOAT_H +float.h: float.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \ + -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \ + < $(srcdir)/float.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +float.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += float.h float.h-t + +EXTRA_DIST += float.c float.in.h itold.c + +EXTRA_libgnu_la_SOURCES += float.c itold.c + +## end gnulib module float + +## begin gnulib module floor + + +EXTRA_DIST += floor.c + +EXTRA_libgnu_la_SOURCES += floor.c + +## end gnulib module floor + +## begin gnulib module fnmatch + +BUILT_SOURCES += $(FNMATCH_H) + +# We need the following in order to create when the system +# doesn't have one that supports the required API. +if GL_GENERATE_FNMATCH_H +fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + < $(srcdir)/fnmatch.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +else +fnmatch.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t + +EXTRA_DIST += fnmatch.c fnmatch.in.h fnmatch_loop.c + +EXTRA_libgnu_la_SOURCES += fnmatch.c fnmatch_loop.c + +## end gnulib module fnmatch + +## begin gnulib module fopen + + +EXTRA_DIST += fopen.c + +EXTRA_libgnu_la_SOURCES += fopen.c + +## end gnulib module fopen + +## begin gnulib module fpurge + + +EXTRA_DIST += fpurge.c stdio-impl.h + +EXTRA_libgnu_la_SOURCES += fpurge.c + +## end gnulib module fpurge + +## begin gnulib module freading + +libgnu_la_SOURCES += freading.c + +EXTRA_DIST += freading.h stdio-impl.h + +## end gnulib module freading + +## begin gnulib module fseek + + +EXTRA_DIST += fseek.c + +EXTRA_libgnu_la_SOURCES += fseek.c + +## end gnulib module fseek + +## begin gnulib module fseeko + + +EXTRA_DIST += fseeko.c stdio-impl.h + +EXTRA_libgnu_la_SOURCES += fseeko.c + +## end gnulib module fseeko + +## begin gnulib module fstat + + +EXTRA_DIST += fstat.c + +EXTRA_libgnu_la_SOURCES += fstat.c + +## end gnulib module fstat + +## begin gnulib module fstatat + + +EXTRA_DIST += at-func.c fstatat.c openat-priv.h + +EXTRA_libgnu_la_SOURCES += at-func.c fstatat.c + +## end gnulib module fstatat + +## begin gnulib module ftell + + +EXTRA_DIST += ftell.c + +EXTRA_libgnu_la_SOURCES += ftell.c + +## end gnulib module ftell + +## begin gnulib module ftello + + +EXTRA_DIST += ftello.c stdio-impl.h + +EXTRA_libgnu_la_SOURCES += ftello.c + +## end gnulib module ftello + +## begin gnulib module getcwd + + +EXTRA_DIST += getcwd.c + +EXTRA_libgnu_la_SOURCES += getcwd.c + +## end gnulib module getcwd + +## begin gnulib module getcwd-lgpl + + +EXTRA_DIST += getcwd-lgpl.c + +EXTRA_libgnu_la_SOURCES += getcwd-lgpl.c + +## end gnulib module getcwd-lgpl + +## begin gnulib module getdtablesize + + +EXTRA_DIST += getdtablesize.c + +EXTRA_libgnu_la_SOURCES += getdtablesize.c + +## end gnulib module getdtablesize + +## begin gnulib module gethostname + + +EXTRA_DIST += gethostname.c w32sock.h + +EXTRA_libgnu_la_SOURCES += gethostname.c + +## end gnulib module gethostname + +## begin gnulib module getlogin_r + + +EXTRA_DIST += getlogin_r.c + +EXTRA_libgnu_la_SOURCES += getlogin_r.c + +## end gnulib module getlogin_r + +## begin gnulib module getopt-posix + +BUILT_SOURCES += $(GETOPT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_GETOPT_H''@|$(NEXT_GETOPT_H)|g' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + < $(srcdir)/getopt.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += getopt.h getopt.h-t + +EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h + +EXTRA_libgnu_la_SOURCES += getopt.c getopt1.c + +## end gnulib module getopt-posix + +## begin gnulib module gettext-h + +libgnu_la_SOURCES += gettext.h + +## end gnulib module gettext-h + +## begin gnulib module gettimeofday + + +EXTRA_DIST += gettimeofday.c + +EXTRA_libgnu_la_SOURCES += gettimeofday.c + +## end gnulib module gettimeofday + +## begin gnulib module glob + +BUILT_SOURCES += $(GLOB_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_GLOB_H +glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/glob.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +else +glob.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += glob.h glob.h-t + +EXTRA_DIST += glob-libc.h glob.c glob.in.h + +EXTRA_libgnu_la_SOURCES += glob.c + +## end gnulib module glob + +## begin gnulib module intprops + + +EXTRA_DIST += intprops.h + +## end gnulib module intprops + +## begin gnulib module isatty + + +EXTRA_DIST += isatty.c + +EXTRA_libgnu_la_SOURCES += isatty.c + +## end gnulib module isatty + +## begin gnulib module isnand-nolibm + + +EXTRA_DIST += float+.h isnan.c isnand-nolibm.h isnand.c + +EXTRA_libgnu_la_SOURCES += isnan.c isnand.c + +## end gnulib module isnand-nolibm + +## begin gnulib module isnanf-nolibm + + +EXTRA_DIST += float+.h isnan.c isnanf-nolibm.h isnanf.c + +EXTRA_libgnu_la_SOURCES += isnan.c isnanf.c + +## end gnulib module isnanf-nolibm + +## begin gnulib module isnanl-nolibm + + +EXTRA_DIST += float+.h isnan.c isnanl-nolibm.h isnanl.c + +EXTRA_libgnu_la_SOURCES += isnan.c isnanl.c + +## end gnulib module isnanl-nolibm + +## begin gnulib module link + + +EXTRA_DIST += link.c + +EXTRA_libgnu_la_SOURCES += link.c + +## end gnulib module link + +## begin gnulib module localcharset + +libgnu_la_SOURCES += localcharset.h localcharset.c + +# We need the following in order to install a simple file in $(libdir) +# which is shared with other installed packages. We use a list of referencing +# packages so that "make uninstall" will remove the file if and only if it +# is not used by another installed package. +# On systems with glibc-2.1 or newer, the file is redundant, therefore we +# avoid installing it. + +all-local: charset.alias ref-add.sed ref-del.sed + +charset_alias = $(DESTDIR)$(libdir)/charset.alias +charset_tmp = $(DESTDIR)$(libdir)/charset.tmp +install-exec-local: install-exec-localcharset +install-exec-localcharset: all-local + if test $(GLIBC21) = no; then \ + case '$(host_os)' in \ + darwin[56]*) \ + need_charset_alias=true ;; \ + darwin* | cygwin* | mingw* | pw32* | cegcc*) \ + need_charset_alias=false ;; \ + *) \ + need_charset_alias=true ;; \ + esac ; \ + else \ + need_charset_alias=false ; \ + fi ; \ + if $$need_charset_alias; then \ + $(mkinstalldirs) $(DESTDIR)$(libdir) ; \ + fi ; \ + if test -f $(charset_alias); then \ + sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + else \ + if $$need_charset_alias; then \ + sed -f ref-add.sed charset.alias > $(charset_tmp) ; \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \ + rm -f $(charset_tmp) ; \ + fi ; \ + fi + +uninstall-local: uninstall-localcharset +uninstall-localcharset: all-local + if test -f $(charset_alias); then \ + sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \ + if grep '^# Packages using this file: $$' $(charset_tmp) \ + > /dev/null; then \ + rm -f $(charset_alias); \ + else \ + $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \ + fi; \ + rm -f $(charset_tmp); \ + fi + +charset.alias: config.charset + $(AM_V_GEN)rm -f t-$@ $@ && \ + $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \ + mv t-$@ $@ + +SUFFIXES += .sed .sin +.sin.sed: + $(AM_V_GEN)rm -f t-$@ $@ && \ + sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \ + mv t-$@ $@ + +CLEANFILES += charset.alias ref-add.sed ref-del.sed + +EXTRA_DIST += config.charset ref-add.sin ref-del.sin + +## end gnulib module localcharset + +## begin gnulib module lseek + + +EXTRA_DIST += lseek.c + +EXTRA_libgnu_la_SOURCES += lseek.c + +## end gnulib module lseek + +## begin gnulib module lstat + + +EXTRA_DIST += lstat.c + +EXTRA_libgnu_la_SOURCES += lstat.c + +## end gnulib module lstat + +## begin gnulib module malloc-posix + + +EXTRA_DIST += malloc.c + +EXTRA_libgnu_la_SOURCES += malloc.c + +## end gnulib module malloc-posix + +## begin gnulib module malloca + +libgnu_la_SOURCES += malloca.c + +EXTRA_DIST += malloca.h malloca.valgrind + +## end gnulib module malloca + +## begin gnulib module math + +BUILT_SOURCES += math.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \ + -e 's/@''GNULIB_ACOSF''@/$(GNULIB_ACOSF)/g' \ + -e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \ + -e 's/@''GNULIB_ASINF''@/$(GNULIB_ASINF)/g' \ + -e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \ + -e 's/@''GNULIB_ATANF''@/$(GNULIB_ATANF)/g' \ + -e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \ + -e 's/@''GNULIB_ATAN2F''@/$(GNULIB_ATAN2F)/g' \ + -e 's/@''GNULIB_CBRT''@/$(GNULIB_CBRT)/g' \ + -e 's/@''GNULIB_CBRTF''@/$(GNULIB_CBRTF)/g' \ + -e 's/@''GNULIB_CBRTL''@/$(GNULIB_CBRTL)/g' \ + -e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \ + -e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \ + -e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \ + -e 's/@''GNULIB_COPYSIGN''@/$(GNULIB_COPYSIGN)/g' \ + -e 's/@''GNULIB_COPYSIGNF''@/$(GNULIB_COPYSIGNF)/g' \ + -e 's/@''GNULIB_COPYSIGNL''@/$(GNULIB_COPYSIGNL)/g' \ + -e 's/@''GNULIB_COSF''@/$(GNULIB_COSF)/g' \ + -e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \ + -e 's/@''GNULIB_COSHF''@/$(GNULIB_COSHF)/g' \ + -e 's/@''GNULIB_EXPF''@/$(GNULIB_EXPF)/g' \ + -e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \ + -e 's/@''GNULIB_EXP2''@/$(GNULIB_EXP2)/g' \ + -e 's/@''GNULIB_EXP2F''@/$(GNULIB_EXP2F)/g' \ + -e 's/@''GNULIB_EXP2L''@/$(GNULIB_EXP2L)/g' \ + -e 's/@''GNULIB_EXPM1''@/$(GNULIB_EXPM1)/g' \ + -e 's/@''GNULIB_EXPM1F''@/$(GNULIB_EXPM1F)/g' \ + -e 's/@''GNULIB_EXPM1L''@/$(GNULIB_EXPM1L)/g' \ + -e 's/@''GNULIB_FABSF''@/$(GNULIB_FABSF)/g' \ + -e 's/@''GNULIB_FABSL''@/$(GNULIB_FABSL)/g' \ + -e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \ + -e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \ + -e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \ + -e 's/@''GNULIB_FMA''@/$(GNULIB_FMA)/g' \ + -e 's/@''GNULIB_FMAF''@/$(GNULIB_FMAF)/g' \ + -e 's/@''GNULIB_FMAL''@/$(GNULIB_FMAL)/g' \ + -e 's/@''GNULIB_FMOD''@/$(GNULIB_FMOD)/g' \ + -e 's/@''GNULIB_FMODF''@/$(GNULIB_FMODF)/g' \ + -e 's/@''GNULIB_FMODL''@/$(GNULIB_FMODL)/g' \ + -e 's/@''GNULIB_FREXPF''@/$(GNULIB_FREXPF)/g' \ + -e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \ + -e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \ + -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \ + -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \ + -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \ + < $(srcdir)/math.in.h | \ + sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \ + -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \ + -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \ + -e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \ + -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \ + -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \ + -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \ + -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \ + -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \ + -e 's/@''GNULIB_LDEXPF''@/$(GNULIB_LDEXPF)/g' \ + -e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \ + -e 's/@''GNULIB_LOG''@/$(GNULIB_LOG)/g' \ + -e 's/@''GNULIB_LOGF''@/$(GNULIB_LOGF)/g' \ + -e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \ + -e 's/@''GNULIB_LOG10''@/$(GNULIB_LOG10)/g' \ + -e 's/@''GNULIB_LOG10F''@/$(GNULIB_LOG10F)/g' \ + -e 's/@''GNULIB_LOG10L''@/$(GNULIB_LOG10L)/g' \ + -e 's/@''GNULIB_LOG1P''@/$(GNULIB_LOG1P)/g' \ + -e 's/@''GNULIB_LOG1PF''@/$(GNULIB_LOG1PF)/g' \ + -e 's/@''GNULIB_LOG1PL''@/$(GNULIB_LOG1PL)/g' \ + -e 's/@''GNULIB_LOG2''@/$(GNULIB_LOG2)/g' \ + -e 's/@''GNULIB_LOG2F''@/$(GNULIB_LOG2F)/g' \ + -e 's/@''GNULIB_LOG2L''@/$(GNULIB_LOG2L)/g' \ + -e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \ + -e 's/@''GNULIB_LOGBF''@/$(GNULIB_LOGBF)/g' \ + -e 's/@''GNULIB_LOGBL''@/$(GNULIB_LOGBL)/g' \ + -e 's/@''GNULIB_MODF''@/$(GNULIB_MODF)/g' \ + -e 's/@''GNULIB_MODFF''@/$(GNULIB_MODFF)/g' \ + -e 's/@''GNULIB_MODFL''@/$(GNULIB_MODFL)/g' \ + -e 's/@''GNULIB_POWF''@/$(GNULIB_POWF)/g' \ + -e 's/@''GNULIB_REMAINDER''@/$(GNULIB_REMAINDER)/g' \ + -e 's/@''GNULIB_REMAINDERF''@/$(GNULIB_REMAINDERF)/g' \ + -e 's/@''GNULIB_REMAINDERL''@/$(GNULIB_REMAINDERL)/g' \ + -e 's/@''GNULIB_RINT''@/$(GNULIB_RINT)/g' \ + -e 's/@''GNULIB_RINTF''@/$(GNULIB_RINTF)/g' \ + -e 's/@''GNULIB_RINTL''@/$(GNULIB_RINTL)/g' \ + -e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \ + -e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \ + -e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \ + -e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \ + -e 's/@''GNULIB_SINF''@/$(GNULIB_SINF)/g' \ + -e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \ + -e 's/@''GNULIB_SINHF''@/$(GNULIB_SINHF)/g' \ + -e 's/@''GNULIB_SQRTF''@/$(GNULIB_SQRTF)/g' \ + -e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \ + -e 's/@''GNULIB_TANF''@/$(GNULIB_TANF)/g' \ + -e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \ + -e 's/@''GNULIB_TANHF''@/$(GNULIB_TANHF)/g' \ + -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \ + -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \ + -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \ + | \ + sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \ + -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \ + -e 's|@''HAVE_ASINF''@|$(HAVE_ASINF)|g' \ + -e 's|@''HAVE_ASINL''@|$(HAVE_ASINL)|g' \ + -e 's|@''HAVE_ATANF''@|$(HAVE_ATANF)|g' \ + -e 's|@''HAVE_ATANL''@|$(HAVE_ATANL)|g' \ + -e 's|@''HAVE_ATAN2F''@|$(HAVE_ATAN2F)|g' \ + -e 's|@''HAVE_CBRT''@|$(HAVE_CBRT)|g' \ + -e 's|@''HAVE_CBRTF''@|$(HAVE_CBRTF)|g' \ + -e 's|@''HAVE_CBRTL''@|$(HAVE_CBRTL)|g' \ + -e 's|@''HAVE_COPYSIGN''@|$(HAVE_COPYSIGN)|g' \ + -e 's|@''HAVE_COPYSIGNL''@|$(HAVE_COPYSIGNL)|g' \ + -e 's|@''HAVE_COSF''@|$(HAVE_COSF)|g' \ + -e 's|@''HAVE_COSL''@|$(HAVE_COSL)|g' \ + -e 's|@''HAVE_COSHF''@|$(HAVE_COSHF)|g' \ + -e 's|@''HAVE_EXPF''@|$(HAVE_EXPF)|g' \ + -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \ + -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \ + -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \ + -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \ + -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \ + -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \ + -e 's|@''HAVE_FMAF''@|$(HAVE_FMAF)|g' \ + -e 's|@''HAVE_FMAL''@|$(HAVE_FMAL)|g' \ + -e 's|@''HAVE_FMODF''@|$(HAVE_FMODF)|g' \ + -e 's|@''HAVE_FMODL''@|$(HAVE_FMODL)|g' \ + -e 's|@''HAVE_FREXPF''@|$(HAVE_FREXPF)|g' \ + -e 's|@''HAVE_HYPOTF''@|$(HAVE_HYPOTF)|g' \ + -e 's|@''HAVE_HYPOTL''@|$(HAVE_HYPOTL)|g' \ + -e 's|@''HAVE_ILOGB''@|$(HAVE_ILOGB)|g' \ + -e 's|@''HAVE_ILOGBF''@|$(HAVE_ILOGBF)|g' \ + -e 's|@''HAVE_ILOGBL''@|$(HAVE_ILOGBL)|g' \ + -e 's|@''HAVE_ISNANF''@|$(HAVE_ISNANF)|g' \ + -e 's|@''HAVE_ISNAND''@|$(HAVE_ISNAND)|g' \ + -e 's|@''HAVE_ISNANL''@|$(HAVE_ISNANL)|g' \ + -e 's|@''HAVE_LDEXPF''@|$(HAVE_LDEXPF)|g' \ + -e 's|@''HAVE_LOGF''@|$(HAVE_LOGF)|g' \ + -e 's|@''HAVE_LOGL''@|$(HAVE_LOGL)|g' \ + -e 's|@''HAVE_LOG10F''@|$(HAVE_LOG10F)|g' \ + -e 's|@''HAVE_LOG10L''@|$(HAVE_LOG10L)|g' \ + -e 's|@''HAVE_LOG1P''@|$(HAVE_LOG1P)|g' \ + -e 's|@''HAVE_LOG1PF''@|$(HAVE_LOG1PF)|g' \ + -e 's|@''HAVE_LOG1PL''@|$(HAVE_LOG1PL)|g' \ + -e 's|@''HAVE_LOGBF''@|$(HAVE_LOGBF)|g' \ + -e 's|@''HAVE_LOGBL''@|$(HAVE_LOGBL)|g' \ + -e 's|@''HAVE_MODFF''@|$(HAVE_MODFF)|g' \ + -e 's|@''HAVE_MODFL''@|$(HAVE_MODFL)|g' \ + -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \ + -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \ + -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \ + -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \ + -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \ + -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \ + -e 's|@''HAVE_SINL''@|$(HAVE_SINL)|g' \ + -e 's|@''HAVE_SINHF''@|$(HAVE_SINHF)|g' \ + -e 's|@''HAVE_SQRTF''@|$(HAVE_SQRTF)|g' \ + -e 's|@''HAVE_SQRTL''@|$(HAVE_SQRTL)|g' \ + -e 's|@''HAVE_TANF''@|$(HAVE_TANF)|g' \ + -e 's|@''HAVE_TANL''@|$(HAVE_TANL)|g' \ + -e 's|@''HAVE_TANHF''@|$(HAVE_TANHF)|g' \ + -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \ + -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \ + -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \ + -e 's|@''HAVE_DECL_CBRTF''@|$(HAVE_DECL_CBRTF)|g' \ + -e 's|@''HAVE_DECL_CBRTL''@|$(HAVE_DECL_CBRTL)|g' \ + -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \ + -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \ + -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \ + -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \ + -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \ + -e 's|@''HAVE_DECL_EXP2''@|$(HAVE_DECL_EXP2)|g' \ + -e 's|@''HAVE_DECL_EXP2F''@|$(HAVE_DECL_EXP2F)|g' \ + -e 's|@''HAVE_DECL_EXP2L''@|$(HAVE_DECL_EXP2L)|g' \ + -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \ + -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \ + -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \ + -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \ + -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \ + -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \ + -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \ + -e 's|@''HAVE_DECL_LOG2''@|$(HAVE_DECL_LOG2)|g' \ + -e 's|@''HAVE_DECL_LOG2F''@|$(HAVE_DECL_LOG2F)|g' \ + -e 's|@''HAVE_DECL_LOG2L''@|$(HAVE_DECL_LOG2L)|g' \ + -e 's|@''HAVE_DECL_LOGB''@|$(HAVE_DECL_LOGB)|g' \ + -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \ + -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \ + -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \ + -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \ + -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \ + -e 's|@''HAVE_DECL_ROUNDL''@|$(HAVE_DECL_ROUNDL)|g' \ + -e 's|@''HAVE_DECL_SINL''@|$(HAVE_DECL_SINL)|g' \ + -e 's|@''HAVE_DECL_SQRTL''@|$(HAVE_DECL_SQRTL)|g' \ + -e 's|@''HAVE_DECL_TANL''@|$(HAVE_DECL_TANL)|g' \ + -e 's|@''HAVE_DECL_TRUNC''@|$(HAVE_DECL_TRUNC)|g' \ + -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \ + -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \ + | \ + sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \ + -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \ + -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \ + -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ + -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ + -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \ + -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \ + -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \ + -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \ + -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \ + -e 's|@''REPLACE_FLOOR''@|$(REPLACE_FLOOR)|g' \ + -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \ + -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \ + -e 's|@''REPLACE_FMA''@|$(REPLACE_FMA)|g' \ + -e 's|@''REPLACE_FMAF''@|$(REPLACE_FMAF)|g' \ + -e 's|@''REPLACE_FMAL''@|$(REPLACE_FMAL)|g' \ + -e 's|@''REPLACE_FMOD''@|$(REPLACE_FMOD)|g' \ + -e 's|@''REPLACE_FMODF''@|$(REPLACE_FMODF)|g' \ + -e 's|@''REPLACE_FMODL''@|$(REPLACE_FMODL)|g' \ + -e 's|@''REPLACE_FREXPF''@|$(REPLACE_FREXPF)|g' \ + -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \ + -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \ + -e 's|@''REPLACE_HUGE_VAL''@|$(REPLACE_HUGE_VAL)|g' \ + -e 's|@''REPLACE_HYPOT''@|$(REPLACE_HYPOT)|g' \ + -e 's|@''REPLACE_HYPOTF''@|$(REPLACE_HYPOTF)|g' \ + -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \ + -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \ + -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \ + -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \ + -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \ + -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \ + -e 's|@''REPLACE_ITOLD''@|$(REPLACE_ITOLD)|g' \ + -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \ + -e 's|@''REPLACE_LOG''@|$(REPLACE_LOG)|g' \ + -e 's|@''REPLACE_LOGF''@|$(REPLACE_LOGF)|g' \ + -e 's|@''REPLACE_LOGL''@|$(REPLACE_LOGL)|g' \ + -e 's|@''REPLACE_LOG10''@|$(REPLACE_LOG10)|g' \ + -e 's|@''REPLACE_LOG10F''@|$(REPLACE_LOG10F)|g' \ + -e 's|@''REPLACE_LOG10L''@|$(REPLACE_LOG10L)|g' \ + -e 's|@''REPLACE_LOG1P''@|$(REPLACE_LOG1P)|g' \ + -e 's|@''REPLACE_LOG1PF''@|$(REPLACE_LOG1PF)|g' \ + -e 's|@''REPLACE_LOG1PL''@|$(REPLACE_LOG1PL)|g' \ + -e 's|@''REPLACE_LOG2''@|$(REPLACE_LOG2)|g' \ + -e 's|@''REPLACE_LOG2F''@|$(REPLACE_LOG2F)|g' \ + -e 's|@''REPLACE_LOG2L''@|$(REPLACE_LOG2L)|g' \ + -e 's|@''REPLACE_LOGB''@|$(REPLACE_LOGB)|g' \ + -e 's|@''REPLACE_LOGBF''@|$(REPLACE_LOGBF)|g' \ + -e 's|@''REPLACE_LOGBL''@|$(REPLACE_LOGBL)|g' \ + -e 's|@''REPLACE_MODF''@|$(REPLACE_MODF)|g' \ + -e 's|@''REPLACE_MODFF''@|$(REPLACE_MODFF)|g' \ + -e 's|@''REPLACE_MODFL''@|$(REPLACE_MODFL)|g' \ + -e 's|@''REPLACE_NAN''@|$(REPLACE_NAN)|g' \ + -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \ + -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \ + -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \ + -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \ + -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ + -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ + -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ + -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \ + -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \ + -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \ + -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += math.h math.h-t + +EXTRA_DIST += math.in.h + +## end gnulib module math + +## begin gnulib module mbrtowc + + +EXTRA_DIST += mbrtowc.c + +EXTRA_libgnu_la_SOURCES += mbrtowc.c + +## end gnulib module mbrtowc + +## begin gnulib module mbsinit + + +EXTRA_DIST += mbsinit.c + +EXTRA_libgnu_la_SOURCES += mbsinit.c + +## end gnulib module mbsinit + +## begin gnulib module mbsrtowcs + + +EXTRA_DIST += mbsrtowcs-impl.h mbsrtowcs-state.c mbsrtowcs.c + +EXTRA_libgnu_la_SOURCES += mbsrtowcs-state.c mbsrtowcs.c + +## end gnulib module mbsrtowcs + +## begin gnulib module memchr + + +EXTRA_DIST += memchr.c memchr.valgrind + +EXTRA_libgnu_la_SOURCES += memchr.c + +## end gnulib module memchr + +## begin gnulib module mempcpy + + +EXTRA_DIST += mempcpy.c + +EXTRA_libgnu_la_SOURCES += mempcpy.c + +## end gnulib module mempcpy + +## begin gnulib module memrchr + + +EXTRA_DIST += memrchr.c + +EXTRA_libgnu_la_SOURCES += memrchr.c + +## end gnulib module memrchr + +## begin gnulib module mkdir + + +EXTRA_DIST += mkdir.c + +EXTRA_libgnu_la_SOURCES += mkdir.c + +## end gnulib module mkdir + +## begin gnulib module mkfifo + + +EXTRA_DIST += mkfifo.c + +EXTRA_libgnu_la_SOURCES += mkfifo.c + +## end gnulib module mkfifo + +## begin gnulib module mkostemp + + +EXTRA_DIST += mkostemp.c + +EXTRA_libgnu_la_SOURCES += mkostemp.c + +## end gnulib module mkostemp + +## begin gnulib module mkstemp + + +EXTRA_DIST += mkstemp.c + +EXTRA_libgnu_la_SOURCES += mkstemp.c + +## end gnulib module mkstemp + +## begin gnulib module mktime + + +EXTRA_DIST += mktime-internal.h mktime.c + +EXTRA_libgnu_la_SOURCES += mktime.c + +## end gnulib module mktime + +## begin gnulib module msvc-inval + + +EXTRA_DIST += msvc-inval.c msvc-inval.h + +EXTRA_libgnu_la_SOURCES += msvc-inval.c + +## end gnulib module msvc-inval + +## begin gnulib module msvc-nothrow + + +EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h + +EXTRA_libgnu_la_SOURCES += msvc-nothrow.c + +## end gnulib module msvc-nothrow + +## begin gnulib module nanosleep + + +EXTRA_DIST += nanosleep.c + +EXTRA_libgnu_la_SOURCES += nanosleep.c + +## end gnulib module nanosleep + +## begin gnulib module nproc + +libgnu_la_SOURCES += nproc.c + +EXTRA_DIST += nproc.h + +## end gnulib module nproc + +## begin gnulib module open + + +EXTRA_DIST += open.c + +EXTRA_libgnu_la_SOURCES += open.c + +## end gnulib module open + +## begin gnulib module openat + + +EXTRA_DIST += openat-priv.h openat.c + +EXTRA_libgnu_la_SOURCES += openat.c + +## end gnulib module openat + +## begin gnulib module openat-die + +libgnu_la_SOURCES += openat-die.c + +## end gnulib module openat-die + +## begin gnulib module openat-h + + +EXTRA_DIST += openat.h + +## end gnulib module openat-h + +## begin gnulib module opendir + + +EXTRA_DIST += dirent-private.h opendir.c + +EXTRA_libgnu_la_SOURCES += opendir.c + +## end gnulib module opendir + +## begin gnulib module pathmax + + +EXTRA_DIST += pathmax.h + +## end gnulib module pathmax + +## begin gnulib module progname + +libgnu_la_SOURCES += progname.h progname.c + +## end gnulib module progname + +## begin gnulib module raise + + +EXTRA_DIST += raise.c + +EXTRA_libgnu_la_SOURCES += raise.c + +## end gnulib module raise + +## begin gnulib module readdir + + +EXTRA_DIST += dirent-private.h readdir.c + +EXTRA_libgnu_la_SOURCES += readdir.c + +## end gnulib module readdir + +## begin gnulib module readlink + + +EXTRA_DIST += readlink.c + +EXTRA_libgnu_la_SOURCES += readlink.c + +## end gnulib module readlink + +## begin gnulib module realloc-posix + + +EXTRA_DIST += realloc.c + +EXTRA_libgnu_la_SOURCES += realloc.c + +## end gnulib module realloc-posix + +## begin gnulib module rename + + +EXTRA_DIST += rename.c + +EXTRA_libgnu_la_SOURCES += rename.c + +## end gnulib module rename + +## begin gnulib module rewinddir + + +EXTRA_DIST += dirent-private.h rewinddir.c + +EXTRA_libgnu_la_SOURCES += rewinddir.c + +## end gnulib module rewinddir + +## begin gnulib module rmdir + + +EXTRA_DIST += rmdir.c + +EXTRA_libgnu_la_SOURCES += rmdir.c + +## end gnulib module rmdir + +## begin gnulib module round + + +EXTRA_DIST += round.c + +EXTRA_libgnu_la_SOURCES += round.c + +## end gnulib module round + +## begin gnulib module roundf + + +EXTRA_DIST += round.c roundf.c + +EXTRA_libgnu_la_SOURCES += round.c roundf.c + +## end gnulib module roundf + +## begin gnulib module same-inode + + +EXTRA_DIST += same-inode.h + +## end gnulib module same-inode + +## begin gnulib module save-cwd + +libgnu_la_SOURCES += save-cwd.c + +EXTRA_DIST += save-cwd.h + +## end gnulib module save-cwd + +## begin gnulib module select + + +EXTRA_DIST += select.c + +EXTRA_libgnu_la_SOURCES += select.c + +## end gnulib module select + +## begin gnulib module sigaction + + +EXTRA_DIST += sig-handler.h sigaction.c + +EXTRA_libgnu_la_SOURCES += sigaction.c + +## end gnulib module sigaction + +## begin gnulib module signal-h + +BUILT_SOURCES += signal.h + +# We need the following in order to create when the system +# doesn't have a complete one. +signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ + -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \ + -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \ + -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \ + -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \ + -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \ + -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \ + -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \ + -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \ + -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \ + -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \ + -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \ + -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \ + -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \ + -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \ + -e 's|@''REPLACE_RAISE''@|$(REPLACE_RAISE)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/signal.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += signal.h signal.h-t + +EXTRA_DIST += signal.in.h + +## end gnulib module signal-h + +## begin gnulib module signbit + + +EXTRA_DIST += float+.h signbitd.c signbitf.c signbitl.c + +EXTRA_libgnu_la_SOURCES += signbitd.c signbitf.c signbitl.c + +## end gnulib module signbit + +## begin gnulib module sigprocmask + + +EXTRA_DIST += sigprocmask.c + +EXTRA_libgnu_la_SOURCES += sigprocmask.c + +## end gnulib module sigprocmask + +## begin gnulib module size_max + +libgnu_la_SOURCES += size_max.h + +## end gnulib module size_max + +## begin gnulib module sleep + + +EXTRA_DIST += sleep.c + +EXTRA_libgnu_la_SOURCES += sleep.c + +## end gnulib module sleep + +## begin gnulib module snippet/_Noreturn + +# Because this Makefile snippet defines a variable used by other +# gnulib Makefile snippets, it must be present in all Makefile.am that +# need it. This is ensured by the applicability 'all' defined above. + +_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h + +EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h + +## end gnulib module snippet/_Noreturn + +## begin gnulib module snippet/arg-nonnull + +# The BUILT_SOURCES created by this Makefile snippet are not used via #include +# statements but through direct file reference. Therefore this snippet must be +# present in all Makefile.am that need it. This is ensured by the applicability +# 'all' defined above. + +BUILT_SOURCES += arg-nonnull.h +# The arg-nonnull.h that gets inserted into generated .h files is the same as +# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut +# off. +arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/GL_ARG_NONNULL/,$$p' \ + < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ + > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t + +ARG_NONNULL_H=arg-nonnull.h + +EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h + +## end gnulib module snippet/arg-nonnull + +## begin gnulib module snippet/c++defs + +# The BUILT_SOURCES created by this Makefile snippet are not used via #include +# statements but through direct file reference. Therefore this snippet must be +# present in all Makefile.am that need it. This is ensured by the applicability +# 'all' defined above. + +BUILT_SOURCES += c++defs.h +# The c++defs.h that gets inserted into generated .h files is the same as +# build-aux/snippet/c++defs.h, except that it has the copyright header cut off. +c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/_GL_CXXDEFS/,$$p' \ + < $(top_srcdir)/build-aux/snippet/c++defs.h \ + > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += c++defs.h c++defs.h-t + +CXXDEFS_H=c++defs.h + +EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h + +## end gnulib module snippet/c++defs + +## begin gnulib module snippet/unused-parameter + +# The BUILT_SOURCES created by this Makefile snippet are not used via #include +# statements but through direct file reference. Therefore this snippet must be +# present in all Makefile.am that need it. This is ensured by the applicability +# 'all' defined above. + +BUILT_SOURCES += unused-parameter.h +# The unused-parameter.h that gets inserted into generated .h files is the same +# as build-aux/snippet/unused-parameter.h, except that it has the copyright +# header cut off. +unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \ + < $(top_srcdir)/build-aux/snippet/unused-parameter.h \ + > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t + +UNUSED_PARAMETER_H=unused-parameter.h + +EXTRA_DIST += $(top_srcdir)/build-aux/snippet/unused-parameter.h + +## end gnulib module snippet/unused-parameter + +## begin gnulib module snippet/warn-on-use + +BUILT_SOURCES += warn-on-use.h +# The warn-on-use.h that gets inserted into generated .h files is the same as +# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut +# off. +warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h + $(AM_V_GEN)rm -f $@-t $@ && \ + sed -n -e '/^.ifndef/,$$p' \ + < $(top_srcdir)/build-aux/snippet/warn-on-use.h \ + > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t + +WARN_ON_USE_H=warn-on-use.h + +EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h + +## end gnulib module snippet/warn-on-use + +## begin gnulib module sockets + +libgnu_la_SOURCES += sockets.h sockets.c + +EXTRA_DIST += w32sock.h + +## end gnulib module sockets + +## begin gnulib module stat + + +EXTRA_DIST += stat.c + +EXTRA_libgnu_la_SOURCES += stat.c + +## end gnulib module stat + +## begin gnulib module stdalign + +BUILT_SOURCES += $(STDALIGN_H) + +# We need the following in order to create when the system +# doesn't have one that works. +if GL_GENERATE_STDALIGN_H +stdalign.h: stdalign.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + cat $(srcdir)/stdalign.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdalign.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdalign.h stdalign.h-t + +EXTRA_DIST += stdalign.in.h + +## end gnulib module stdalign + +## begin gnulib module stdbool + +BUILT_SOURCES += $(STDBOOL_H) + +# We need the following in order to create when the system +# doesn't have one that works. +if GL_GENERATE_STDBOOL_H +stdbool.h: stdbool.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdbool.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdbool.h stdbool.h-t + +EXTRA_DIST += stdbool.in.h + +## end gnulib module stdbool + +## begin gnulib module stddef + +BUILT_SOURCES += $(STDDEF_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_STDDEF_H +stddef.h: stddef.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ + -e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \ + -e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \ + < $(srcdir)/stddef.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stddef.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stddef.h stddef.h-t + +EXTRA_DIST += stddef.in.h + +## end gnulib module stddef + +## begin gnulib module stdint + +BUILT_SOURCES += $(STDINT_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +if GL_GENERATE_STDINT_H +stdint.h: stdint.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ + -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ + -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ + -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ + -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \ + -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \ + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \ + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \ + -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ + -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \ + -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \ + -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \ + -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \ + -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \ + -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \ + -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \ + -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ + -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ + -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ + < $(srcdir)/stdint.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +stdint.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += stdint.h stdint.h-t + +EXTRA_DIST += stdint.in.h + +## end gnulib module stdint + +## begin gnulib module stdio + +BUILT_SOURCES += stdio.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ + -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \ + -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \ + -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \ + -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \ + -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \ + -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \ + -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \ + -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \ + -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \ + -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \ + -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \ + -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \ + -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \ + -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \ + -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \ + -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \ + -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \ + -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \ + -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \ + -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \ + -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \ + -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \ + -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \ + -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \ + -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \ + -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \ + -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \ + -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \ + -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \ + -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \ + -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \ + -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \ + -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \ + -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \ + -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \ + -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \ + -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \ + -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \ + -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \ + -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \ + -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \ + -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \ + -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ + -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + < $(srcdir)/stdio.in.h | \ + sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ + -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \ + -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \ + -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \ + -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \ + -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \ + -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \ + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \ + -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \ + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \ + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \ + -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \ + -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \ + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \ + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \ + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \ + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \ + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \ + -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \ + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \ + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \ + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \ + -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \ + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \ + -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \ + -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \ + -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \ + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \ + -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ + -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \ + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \ + -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \ + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \ + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \ + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \ + -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += stdio.h stdio.h-t + +EXTRA_DIST += stdio.in.h + +## end gnulib module stdio + +## begin gnulib module stdlib + +BUILT_SOURCES += stdlib.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ + $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ + -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ + -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ + -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ + -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ + -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \ + -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \ + -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \ + -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ + -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ + -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ + -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ + -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ + -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \ + -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \ + -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \ + -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \ + -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \ + -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \ + -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ + -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ + -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ + -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ + -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ + -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ + -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ + -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + < $(srcdir)/stdlib.in.h | \ + sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ + -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ + -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \ + -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ + -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ + -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ + -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ + -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ + -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ + -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ + -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ + -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ + -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ + -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ + -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ + -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ + -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ + -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ + -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ + -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ + -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ + -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ + -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ + -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += stdlib.h stdlib.h-t + +EXTRA_DIST += stdlib.in.h + +## end gnulib module stdlib + +## begin gnulib module strcase + + +EXTRA_DIST += strcasecmp.c strncasecmp.c + +EXTRA_libgnu_la_SOURCES += strcasecmp.c strncasecmp.c + +## end gnulib module strcase + +## begin gnulib module strdup-posix + + +EXTRA_DIST += strdup.c + +EXTRA_libgnu_la_SOURCES += strdup.c + +## end gnulib module strdup-posix + +## begin gnulib module streq + + +EXTRA_DIST += streq.h + +## end gnulib module streq + +## begin gnulib module strerror + + +EXTRA_DIST += strerror.c + +EXTRA_libgnu_la_SOURCES += strerror.c + +## end gnulib module strerror + +## begin gnulib module strerror-override + + +EXTRA_DIST += strerror-override.c strerror-override.h + +EXTRA_libgnu_la_SOURCES += strerror-override.c + +## end gnulib module strerror-override + +## begin gnulib module strftime + +libgnu_la_SOURCES += strftime.c + +EXTRA_DIST += strftime.h + +## end gnulib module strftime + +## begin gnulib module string + +BUILT_SOURCES += string.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \ + -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \ + -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \ + -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \ + -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \ + -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \ + -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \ + -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \ + -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \ + -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \ + -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \ + -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \ + -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \ + -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \ + -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \ + -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \ + -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \ + -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \ + -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \ + -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \ + -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \ + -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \ + -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \ + -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \ + -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \ + -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \ + -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \ + -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \ + -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \ + -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \ + -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \ + -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \ + -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \ + -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ + -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ + -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ + -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + < $(srcdir)/string.in.h | \ + sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ + -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ + -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ + -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ + -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ + -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ + -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ + -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \ + -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \ + -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \ + -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \ + -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \ + -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \ + -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \ + -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \ + -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \ + -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ + -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ + -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ + -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ + -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ + -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ + -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \ + -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \ + -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \ + -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \ + -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ + -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \ + -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \ + -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \ + -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ + -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ + -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + < $(srcdir)/string.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += string.h string.h-t + +EXTRA_DIST += string.in.h + +## end gnulib module string + +## begin gnulib module strings + +BUILT_SOURCES += strings.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ + -e 's|@''GNULIB_FFS''@|$(GNULIB_FFS)|g' \ + -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ + -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ + -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/strings.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += strings.h strings.h-t + +EXTRA_DIST += strings.in.h + +## end gnulib module strings + +## begin gnulib module strnlen1 + +libgnu_la_SOURCES += strnlen1.h strnlen1.c + +## end gnulib module strnlen1 + +## begin gnulib module strptime + + +EXTRA_DIST += strptime.c + +EXTRA_libgnu_la_SOURCES += strptime.c + +## end gnulib module strptime + +## begin gnulib module symlink + + +EXTRA_DIST += symlink.c + +EXTRA_libgnu_la_SOURCES += symlink.c + +## end gnulib module symlink + +## begin gnulib module sys_select + +BUILT_SOURCES += sys/select.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \ + -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \ + -e 's/@''GNULIB_PSELECT''@/$(GNULIB_PSELECT)/g' \ + -e 's/@''GNULIB_SELECT''@/$(GNULIB_SELECT)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's|@''HAVE_PSELECT''@|$(HAVE_PSELECT)|g' \ + -e 's|@''REPLACE_PSELECT''@|$(REPLACE_PSELECT)|g' \ + -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_select.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/select.h sys/select.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_select.in.h + +## end gnulib module sys_select + +## begin gnulib module sys_socket + +BUILT_SOURCES += sys/socket.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \ + -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_SOCKET''@/$(GNULIB_SOCKET)/g' \ + -e 's/@''GNULIB_CONNECT''@/$(GNULIB_CONNECT)/g' \ + -e 's/@''GNULIB_ACCEPT''@/$(GNULIB_ACCEPT)/g' \ + -e 's/@''GNULIB_BIND''@/$(GNULIB_BIND)/g' \ + -e 's/@''GNULIB_GETPEERNAME''@/$(GNULIB_GETPEERNAME)/g' \ + -e 's/@''GNULIB_GETSOCKNAME''@/$(GNULIB_GETSOCKNAME)/g' \ + -e 's/@''GNULIB_GETSOCKOPT''@/$(GNULIB_GETSOCKOPT)/g' \ + -e 's/@''GNULIB_LISTEN''@/$(GNULIB_LISTEN)/g' \ + -e 's/@''GNULIB_RECV''@/$(GNULIB_RECV)/g' \ + -e 's/@''GNULIB_SEND''@/$(GNULIB_SEND)/g' \ + -e 's/@''GNULIB_RECVFROM''@/$(GNULIB_RECVFROM)/g' \ + -e 's/@''GNULIB_SENDTO''@/$(GNULIB_SENDTO)/g' \ + -e 's/@''GNULIB_SETSOCKOPT''@/$(GNULIB_SETSOCKOPT)/g' \ + -e 's/@''GNULIB_SHUTDOWN''@/$(GNULIB_SHUTDOWN)/g' \ + -e 's/@''GNULIB_ACCEPT4''@/$(GNULIB_ACCEPT4)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ + -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \ + -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \ + -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \ + -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_socket.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_socket.in.h + +## end gnulib module sys_socket + +## begin gnulib module sys_stat + +BUILT_SOURCES += sys/stat.h + +# We need the following in order to create when the system +# has one that is incomplete. +sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ + -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ + -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \ + -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ + -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ + -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ + -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ + -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ + -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ + -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \ + -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \ + -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ + -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ + -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ + -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ + -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ + -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ + -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ + -e 's|@''HAVE_MKFIFO''@|$(HAVE_MKFIFO)|g' \ + -e 's|@''HAVE_MKFIFOAT''@|$(HAVE_MKFIFOAT)|g' \ + -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ + -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ + -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ + -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ + -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ + -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \ + -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ + -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ + -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ + -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_stat.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_stat.in.h + +## end gnulib module sys_stat + +## begin gnulib module sys_time + +BUILT_SOURCES += sys/time.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \ + -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \ + -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_time.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/time.h sys/time.h-t + +EXTRA_DIST += sys_time.in.h + +## end gnulib module sys_time + +## begin gnulib module sys_times + +BUILT_SOURCES += sys/times.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/times.h: sys_times.in.h $(top_builddir)/config.status $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SYS_TIMES_H''@/$(HAVE_SYS_TIMES_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TIMES_H''@|$(NEXT_SYS_TIMES_H)|g' \ + -e 's/@''GNULIB_TIMES''@/$(GNULIB_TIMES)/g' \ + -e 's|@''HAVE_STRUCT_TMS''@|$(HAVE_STRUCT_TMS)|g' \ + -e 's|@''HAVE_TIMES''@|$(HAVE_TIMES)|g' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/sys_times.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/times.h sys/times.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_times.in.h + +## end gnulib module sys_times + +## begin gnulib module sys_types + +BUILT_SOURCES += sys/types.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/types.h: sys_types.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + < $(srcdir)/sys_types.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += sys/types.h sys/types.h-t + +EXTRA_DIST += sys_types.in.h + +## end gnulib module sys_types + +## begin gnulib module sys_uio + +BUILT_SOURCES += sys/uio.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +sys/uio.h: sys_uio.in.h $(top_builddir)/config.status + $(AM_V_at)$(MKDIR_P) sys + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \ + -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \ + < $(srcdir)/sys_uio.in.h; \ + } > $@-t && \ + mv -f $@-t $@ +MOSTLYCLEANFILES += sys/uio.h sys/uio.h-t +MOSTLYCLEANDIRS += sys + +EXTRA_DIST += sys_uio.in.h + +## end gnulib module sys_uio + +## begin gnulib module tempname + +libgnu_la_SOURCES += tempname.c + +EXTRA_DIST += tempname.h + +## end gnulib module tempname + +## begin gnulib module time + +BUILT_SOURCES += time.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ + -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \ + -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \ + -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ + -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ + -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ + -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ + -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ + -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \ + -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \ + -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \ + -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \ + -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/time.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += time.h time.h-t + +EXTRA_DIST += time.in.h + +## end gnulib module time + +## begin gnulib module time_r + + +EXTRA_DIST += time_r.c + +EXTRA_libgnu_la_SOURCES += time_r.c + +## end gnulib module time_r + +## begin gnulib module times + + +EXTRA_DIST += times.c + +EXTRA_libgnu_la_SOURCES += times.c + +## end gnulib module times + +## begin gnulib module tmpdir + +libgnu_la_SOURCES += tmpdir.h tmpdir.c + +## end gnulib module tmpdir + +## begin gnulib module tmpfile + + +EXTRA_DIST += tmpfile.c + +EXTRA_libgnu_la_SOURCES += tmpfile.c + +## end gnulib module tmpfile + +## begin gnulib module trunc + + +EXTRA_DIST += trunc.c + +EXTRA_libgnu_la_SOURCES += trunc.c + +## end gnulib module trunc + +## begin gnulib module truncf + + +EXTRA_DIST += trunc.c truncf.c + +EXTRA_libgnu_la_SOURCES += trunc.c truncf.c + +## end gnulib module truncf + +## begin gnulib module unistd + +BUILT_SOURCES += unistd.h + +# We need the following in order to create an empty placeholder for +# when the system doesn't have one. +unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \ + -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \ + -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \ + -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \ + -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \ + -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \ + -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ + -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ + -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ + -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ + -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ + -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \ + -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \ + -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \ + -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ + -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ + -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ + -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ + -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ + -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ + -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ + -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ + -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ + -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ + -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \ + -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \ + -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \ + -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \ + -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \ + -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \ + -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \ + -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \ + -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \ + -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \ + -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \ + -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \ + -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \ + -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \ + -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \ + -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \ + -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \ + -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \ + -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \ + -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \ + -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \ + -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ + -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ + -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + < $(srcdir)/unistd.in.h | \ + sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ + -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ + -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ + -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ + -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ + -e 's|@''HAVE_FDATASYNC''@|$(HAVE_FDATASYNC)|g' \ + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ + -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ + -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ + -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ + -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ + -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ + -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \ + -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ + -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \ + -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ + -e 's|@''HAVE_READLINKAT''@|$(HAVE_READLINKAT)|g' \ + -e 's|@''HAVE_SETHOSTNAME''@|$(HAVE_SETHOSTNAME)|g' \ + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ + -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ + -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ + -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ + -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ + -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ + -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ + -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \ + -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ + | \ + sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ + -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ + -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ + -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ + -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \ + -e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \ + -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ + -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ + -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ + -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ + -e 's|@''REPLACE_LINKAT''@|$(REPLACE_LINKAT)|g' \ + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \ + -e 's|@''REPLACE_PREAD''@|$(REPLACE_PREAD)|g' \ + -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ + -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ + -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ + -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ + -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ + -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ + -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ + -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ + -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += unistd.h unistd.h-t + +EXTRA_DIST += unistd.in.h + +## end gnulib module unistd + +## begin gnulib module unistd-safer + +libgnu_la_SOURCES += dup-safer.c fd-safer.c pipe-safer.c + +EXTRA_DIST += unistd--.h unistd-safer.h + +## end gnulib module unistd-safer + +## begin gnulib module unlink + + +EXTRA_DIST += unlink.c + +EXTRA_libgnu_la_SOURCES += unlink.c + +## end gnulib module unlink + +## begin gnulib module vasnprintf + + +EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h + +EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c + +## end gnulib module vasnprintf + +## begin gnulib module vasprintf + + +EXTRA_DIST += asprintf.c vasprintf.c + +EXTRA_libgnu_la_SOURCES += asprintf.c vasprintf.c + +## end gnulib module vasprintf + +## begin gnulib module verify + + +EXTRA_DIST += verify.h + +## end gnulib module verify + +## begin gnulib module wchar + +BUILT_SOURCES += wchar.h + +# We need the following in order to create when the system +# version does not work standalone. +wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ + -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ + -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ + -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ + -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \ + -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \ + -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \ + -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \ + -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \ + -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \ + -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \ + -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \ + -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \ + -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ + -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ + -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ + -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ + -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ + -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \ + -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \ + -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \ + -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \ + -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \ + -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \ + -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \ + -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \ + -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \ + -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \ + -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \ + -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \ + -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \ + -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \ + -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \ + -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \ + -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \ + -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \ + -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \ + -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ + -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ + < $(srcdir)/wchar.in.h | \ + sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ + -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ + -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ + -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ + -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ + -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \ + -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \ + -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \ + -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \ + -e 's|@''HAVE_WMEMCHR''@|$(HAVE_WMEMCHR)|g' \ + -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ + -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ + -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ + -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ + -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ + -e 's|@''HAVE_WCSCPY''@|$(HAVE_WCSCPY)|g' \ + -e 's|@''HAVE_WCPCPY''@|$(HAVE_WCPCPY)|g' \ + -e 's|@''HAVE_WCSNCPY''@|$(HAVE_WCSNCPY)|g' \ + -e 's|@''HAVE_WCPNCPY''@|$(HAVE_WCPNCPY)|g' \ + -e 's|@''HAVE_WCSCAT''@|$(HAVE_WCSCAT)|g' \ + -e 's|@''HAVE_WCSNCAT''@|$(HAVE_WCSNCAT)|g' \ + -e 's|@''HAVE_WCSCMP''@|$(HAVE_WCSCMP)|g' \ + -e 's|@''HAVE_WCSNCMP''@|$(HAVE_WCSNCMP)|g' \ + -e 's|@''HAVE_WCSCASECMP''@|$(HAVE_WCSCASECMP)|g' \ + -e 's|@''HAVE_WCSNCASECMP''@|$(HAVE_WCSNCASECMP)|g' \ + -e 's|@''HAVE_WCSCOLL''@|$(HAVE_WCSCOLL)|g' \ + -e 's|@''HAVE_WCSXFRM''@|$(HAVE_WCSXFRM)|g' \ + -e 's|@''HAVE_WCSDUP''@|$(HAVE_WCSDUP)|g' \ + -e 's|@''HAVE_WCSCHR''@|$(HAVE_WCSCHR)|g' \ + -e 's|@''HAVE_WCSRCHR''@|$(HAVE_WCSRCHR)|g' \ + -e 's|@''HAVE_WCSCSPN''@|$(HAVE_WCSCSPN)|g' \ + -e 's|@''HAVE_WCSSPN''@|$(HAVE_WCSSPN)|g' \ + -e 's|@''HAVE_WCSPBRK''@|$(HAVE_WCSPBRK)|g' \ + -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \ + -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \ + -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ + | \ + sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ + -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \ + -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \ + -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \ + -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \ + -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \ + -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \ + -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \ + -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \ + -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \ + -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \ + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ + -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += wchar.h wchar.h-t + +EXTRA_DIST += wchar.in.h + +## end gnulib module wchar + +## begin gnulib module wctype-h + +BUILT_SOURCES += wctype.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_WCTYPE_H''@/$(HAVE_WCTYPE_H)/g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ + -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ + -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ + -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \ + -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \ + -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \ + -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \ + -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \ + -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \ + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \ + -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \ + -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \ + -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(srcdir)/wctype.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += wctype.h wctype.h-t + +EXTRA_DIST += wctype.in.h + +## end gnulib module wctype-h + +## begin gnulib module xsize + +libgnu_la_SOURCES += xsize.h + +## end gnulib module xsize + + +mostlyclean-local: mostlyclean-generic + @for dir in '' $(MOSTLYCLEANDIRS); do \ + if test -n "$$dir" && test -d $$dir; then \ + echo "rmdir $$dir"; rmdir $$dir; \ + fi; \ + done; \ + : diff --git a/libgui/Makefile.am b/libgui/Makefile.am new file mode 100644 --- /dev/null +++ b/libgui/Makefile.am @@ -0,0 +1,25 @@ +# Copyright (C) 2012 John W. Eaton +# +# This file is part of Octave. +# +# Octave is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# Octave is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with Octave; see the file COPYING. If not, see +# . + +include $(top_srcdir)/build-aux/common.mk + +SUBDIRS = src + +octetc_DATA = default-qt-settings + +EXTRA_DIST = default-qt-settings diff --git a/libgui/default-qt-settings b/libgui/default-qt-settings new file mode 100644 --- /dev/null +++ b/libgui/default-qt-settings @@ -0,0 +1,37 @@ +[General] +connectOnStartup=true +showMessageOfTheDay=true +showTopic=true +autoIdentification=false +nickServPassword= +useCustomFileEditor=false +customFileEditor=emacs +showFilenames=true +showFileSize=false +showFileType=false +showLastModified=false +showHiddenFiles=false +useAlternatingRowColors=true +useProxyServer=false +proxyType= +proxyHostName=none +proxyPort=8080 +proxyUserName= +proxyPassword= + +[editor] +showLineNumbers=true +highlightCurrentLine=true +codeCompletion=true +fontName=Ubuntu Mono +fontSize=12 +shortWindowTitle=true +longWindowTitle=true + +[terminal] +fontSize=10 +fontName=Andale Mono + +[MainWindow] +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\0\x31\0\0\0\x18\0\0\x4\xff\0\0\x3\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xfe\xff\xff\xff\xfe\0\0\0\0\x2\0) +windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x1\0\0\0\x1\0\0\x4\xcf\0\0\x3\x91\xfc\x2\0\0\0\x1\xfc\0\0\0\x41\0\0\x3\x91\0\0\x1\xc7\0\xff\xff\xff\xfc\x1\0\0\0\x3\xfc\0\0\0\0\0\0\x1.\0\0\0R\0\xff\xff\xff\xfc\x2\0\0\0\x2\xfb\0\0\0\x1a\0W\0o\0r\0k\0s\0p\0\x61\0\x63\0\x65\0V\0i\0\x65\0w\x1\0\0\0\x41\0\0\x1\xe8\0\0\0k\0\xff\xff\xff\xfb\0\0\0\"\0H\0i\0s\0t\0o\0r\0y\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\x2/\0\0\x1\xa3\0\0\0\x8c\0\xff\xff\xff\xfc\0\0\x1\x34\0\0\x2\x81\0\0\x2\x81\0\0\x2\x81\xfa\0\0\0\0\x2\0\0\0\x2\xfb\0\0\0$\0T\0\x65\0r\0m\0i\0n\0\x61\0l\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\0\0\xff\xff\xff\xff\0\0\x1\xa9\0\xff\xff\xff\xfb\0\0\0\x14\0\x46\0i\0l\0\x65\0\x45\0\x64\0i\0t\0o\0r\x1\0\0\x1\xf0\0\0\x1\xe2\0\0\0j\0\xff\xff\xff\xfb\0\0\0\x1e\0\x46\0i\0l\0\x65\0s\0\x44\0o\0\x63\0k\0W\0i\0\x64\0g\0\x65\0t\x1\0\0\x3\xbb\0\0\x1\x14\0\0\0P\0\xff\xff\xff\0\0\0\0\0\0\x3\x91\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\xff\xff\xff\xff\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0) diff --git a/libgui/gui.pro b/libgui/gui.pro new file mode 100644 --- /dev/null +++ b/libgui/gui.pro @@ -0,0 +1,2 @@ +TEMPLATE = subdirs +SUBDIRS = qterminal src diff --git a/libgui/kb-layouts/default.keytab b/libgui/kb-layouts/default.keytab new file mode 100644 --- /dev/null +++ b/libgui/kb-layouts/default.keytab @@ -0,0 +1,133 @@ +# [README.default.Keytab] Buildin Keyboard Table +# +# To customize your keyboard, copy this file to something +# ending with .keytab and change it to meet you needs. +# Please read the README.KeyTab and the README.keyboard +# in this case. +# +# -------------------------------------------------------------- + +keyboard "Default (XFree 4)" + +# -------------------------------------------------------------- +# +# Note that this particular table is a "risc" version made to +# ease customization without bothering with obsolete details. +# See VT100.keytab for the more hairy stuff. +# +# -------------------------------------------------------------- + +# common keys + +key Escape : "\E" + +key Tab -Shift : "\t" +key Tab +Shift+Ansi : "\E[Z" +key Tab +Shift-Ansi : "\t" +key Backtab +Ansi : "\E[Z" +key Backtab -Ansi : "\t" + +key Return-Shift-NewLine : "\r" +key Return-Shift+NewLine : "\r\n" + +key Return+Shift : "\EOM" + +# Backspace and Delete codes are preserving CTRL-H. + +key Backspace : "\x7f" + +# Arrow keys in VT52 mode +# shift up/down are reserved for scrolling. +# shift left/right are reserved for switching between tabs (this is hardcoded). + +key Up -Shift-Ansi : "\EA" +key Down -Shift-Ansi : "\EB" +key Right-Shift-Ansi : "\EC" +key Left -Shift-Ansi : "\ED" + +# Arrow keys in ANSI mode with Application - and Normal Cursor Mode) + +key Up -Shift-AnyMod+Ansi+AppCuKeys : "\EOA" +key Down -Shift-AnyMod+Ansi+AppCuKeys : "\EOB" +key Right -Shift-AnyMod+Ansi+AppCuKeys : "\EOC" +key Left -Shift-AnyMod+Ansi+AppCuKeys : "\EOD" + +key Up -Shift-AnyMod+Ansi-AppCuKeys : "\E[A" +key Down -Shift-AnyMod+Ansi-AppCuKeys : "\E[B" +key Right -Shift-AnyMod+Ansi-AppCuKeys : "\E[C" +key Left -Shift-AnyMod+Ansi-AppCuKeys : "\E[D" + +key Up -Shift+AnyMod+Ansi : "\E[1;*A" +key Down -Shift+AnyMod+Ansi : "\E[1;*B" +key Right -Shift+AnyMod+Ansi : "\E[1;*C" +key Left -Shift+AnyMod+Ansi : "\E[1;*D" + +# other grey PC keys + +key Enter+NewLine : "\r\n" +key Enter-NewLine : "\r" + +key Home -AnyMod -AppCuKeys : "\E[H" +key End -AnyMod -AppCuKeys : "\E[F" +key Home -AnyMod +AppCuKeys : "\EOH" +key End -AnyMod +AppCuKeys : "\EOF" +key Home +AnyMod : "\E[1;*H" +key End +AnyMod : "\E[1;*F" + +key Insert -AnyMod : "\E[2~" +key Delete -AnyMod : "\E[3~" +key Insert +AnyMod : "\E[2;*~" +key Delete +AnyMod : "\E[3;*~" + +key Prior -Shift-AnyMod : "\E[5~" +key Next -Shift-AnyMod : "\E[6~" +key Prior -Shift+AnyMod : "\E[5;*~" +key Next -Shift+AnyMod : "\E[6;*~" + +# Function keys +key F1 -AnyMod : "\EOP" +key F2 -AnyMod : "\EOQ" +key F3 -AnyMod : "\EOR" +key F4 -AnyMod : "\EOS" +key F5 -AnyMod : "\E[15~" +key F6 -AnyMod : "\E[17~" +key F7 -AnyMod : "\E[18~" +key F8 -AnyMod : "\E[19~" +key F9 -AnyMod : "\E[20~" +key F10 -AnyMod : "\E[21~" +key F11 -AnyMod : "\E[23~" +key F12 -AnyMod : "\E[24~" + +key F1 +AnyMod : "\EO*P" +key F2 +AnyMod : "\EO*Q" +key F3 +AnyMod : "\EO*R" +key F4 +AnyMod : "\EO*S" +key F5 +AnyMod : "\E[15;*~" +key F6 +AnyMod : "\E[17;*~" +key F7 +AnyMod : "\E[18;*~" +key F8 +AnyMod : "\E[19;*~" +key F9 +AnyMod : "\E[20;*~" +key F10 +AnyMod : "\E[21;*~" +key F11 +AnyMod : "\E[23;*~" +key F12 +AnyMod : "\E[24;*~" + +# Work around dead keys + +key Space +Control : "\x00" + +# Some keys are used by konsole to cause operations. +# The scroll* operations refer to the history buffer. + +key Up +Shift-AppScreen : scrollLineUp +key Prior +Shift-AppScreen : scrollPageUp +key Down +Shift-AppScreen : scrollLineDown +key Next +Shift-AppScreen : scrollPageDown + +#key Up +Shift : scrollLineUp +#key Prior +Shift : scrollPageUp +#key Down +Shift : scrollLineDown +#key Next +Shift : scrollPageDown + +key ScrollLock : scrollLock + +# keypad characters are not offered differently by Qt. diff --git a/libgui/kb-layouts/linux.keytab b/libgui/kb-layouts/linux.keytab new file mode 100644 --- /dev/null +++ b/libgui/kb-layouts/linux.keytab @@ -0,0 +1,133 @@ +# [linux.keytab] Konsole Keyboard Table (Linux console keys) +# +# -------------------------------------------------------------- + +# NOT TESTED, MAY NEED SOME CLEANUPS +keyboard "Linux console" + +# -------------------------------------------------------------- +# +# This configuration table allows to customize the +# meaning of the keys. +# +# The syntax is that each entry has the form : +# +# "key" Keyname { ("+"|"-") Modename } ":" (String|Operation) +# +# Keynames are those defined in with the +# "Qt::Key_" removed. (We'd better insert the list here) +# +# Mode names are : +# +# - Shift +# - Alt +# - Control +# +# The VT100 emulation has two modes that can affect the +# sequences emitted by certain keys. These modes are +# under control of the client program. +# +# - Newline : effects Return and Enter key. +# - Application : effects Up and Down key. +# +# - Ansi : effects Up and Down key (This is for VT52, really). +# +# Operations are +# +# - scrollUpLine +# - scrollUpPage +# - scrollDownLine +# - scrollDownPage +# +# - emitSelection +# +# If the key is not found here, the text of the +# key event as provided by QT is emitted, possibly +# preceeded by ESC if the Alt key is pressed. +# +# -------------------------------------------------------------- + +key Escape : "\E" +key Tab : "\t" + +# VT100 can add an extra \n after return. +# The NewLine mode is set by an escape sequence. + +key Return-NewLine : "\r" +key Return+NewLine : "\r\n" + +# Some desperately try to save the ^H. + +key Backspace : "\x7f" +key Delete : "\E[3~" + +# These codes are for the VT52 mode of VT100 +# The Ansi mode (i.e. VT100 mode) is set by +# an escape sequence + +key Up -Shift-Ansi : "\EA" +key Down -Shift-Ansi : "\EB" +key Right-Shift-Ansi : "\EC" +key Left -Shift-Ansi : "\ED" + +# VT100 emits a mode bit together +# with the arrow keys.The AppCuKeys +# mode is set by an escape sequence. + +key Up -Shift+Ansi+AppCuKeys : "\EOA" +key Down -Shift+Ansi+AppCuKeys : "\EOB" +key Right-Shift+Ansi+AppCuKeys : "\EOC" +key Left -Shift+Ansi+AppCuKeys : "\EOD" + +key Up -Shift+Ansi-AppCuKeys : "\E[A" +key Down -Shift+Ansi-AppCuKeys : "\E[B" +key Right-Shift+Ansi-AppCuKeys : "\E[C" +key Left -Shift+Ansi-AppCuKeys : "\E[D" + +# linux functions keys F1-F5 differ from xterm + +key F1 : "\E[[A" +key F2 : "\E[[B" +key F3 : "\E[[C" +key F4 : "\E[[D" +key F5 : "\E[[E" + +key F6 : "\E[17~" +key F7 : "\E[18~" +key F8 : "\E[19~" +key F9 : "\E[20~" +key F10 : "\E[21~" +key F11 : "\E[23~" +key F12 : "\E[24~" + +key Home : "\E[1~" +key End : "\E[4~" + +key Prior -Shift : "\E[5~" +key Next -Shift : "\E[6~" +key Insert-Shift : "\E[2~" + +# Keypad-Enter. See comment on Return above. + +key Enter+NewLine : "\r\n" +key Enter-NewLine : "\r" + +key Space +Control : "\x00" + +# some of keys are used by konsole. + +key Up +Shift : scrollLineUp +key Prior +Shift : scrollPageUp +key Down +Shift : scrollLineDown +key Next +Shift : scrollPageDown + +key ScrollLock : scrollLock + +#---------------------------------------------------------- + +# keypad characters as offered by Qt +# cannot be recognized as such. + +#---------------------------------------------------------- + +# Following other strings as emitted by konsole. diff --git a/libgui/kb-layouts/vt420pc.keytab b/libgui/kb-layouts/vt420pc.keytab new file mode 100644 --- /dev/null +++ b/libgui/kb-layouts/vt420pc.keytab @@ -0,0 +1,163 @@ +# [vt420pc.keytab] Konsole Keyboard Table (VT420pc keys) +# adapted by ferdinand gassauer f.gassauer@aon.at +# Nov 2000 +# +################################################################ +# +# The escape sequences emmited by the +# keys Shift+F1 to Shift+F12 might not fit your needs +# +################# IMPORTANT NOTICE ############################# +# the key bindings (Kcontrol -> look and feel -> keybindgs) +# overrule the settings in this file. The key bindings might be +# changed by the user WITHOUT notification of the maintainer of +# the keytab file. Konsole will not work as expected by +# the maintainer of the keytab file. +################################################################ +# +# -------------------------------------------------------------- + +keyboard "DEC VT420 Terminal" + +# -------------------------------------------------------------- +# +# This configuration table allows to customize the +# meaning of the keys. +# +# The syntax is that each entry has the form : +# +# "key" Keyname { ("+"|"-") Modename } ":" (String|Operation) +# +# Keynames are those defined in with the +# "Qt::Key_" removed. (We'd better insert the list here) +# +# Mode names are : +# +# - Shift +# - Alt +# - Control +# +# The VT100 emulation has two modes that can affect the +# sequences emitted by certain keys. These modes are +# under control of the client program. +# +# - Newline : effects Return and Enter key. +# - Application : effects Up and Down key. +# +# - Ansi : effects Up and Down key (This is for VT52, really). +# +# Operations are +# +# - scrollUpLine +# - scrollUpPage +# - scrollDownLine +# - scrollDownPage +# +# - emitSelection +# +# If the key is not found here, the text of the +# key event as provided by QT is emitted, possibly +# preceeded by ESC if the Alt key is pressed. +# +# -------------------------------------------------------------- + +key Escape : "\E" +key Tab : "\t" +key Backtab: "\E[Z" + +# VT100 can add an extra \n after return. +# The NewLine mode is set by an escape sequence. + +key Return-NewLine : "\r" +key Return+NewLine : "\r\n" + +# Some desperately try to save the ^H. +# may be not everyone wants this + +key Backspace : "\x08" # Control H +key Delete : "\x7f" + +# These codes are for the VT420pc +# The Ansi mode (i.e. VT100 mode) is set by +# an escape sequence + +key Up -Shift-Ansi : "\EA" +key Down -Shift-Ansi : "\EB" +key Right-Shift-Ansi : "\EC" +key Left -Shift-Ansi : "\ED" + +# VT100 emits a mode bit together +# with the arrow keys.The AppCuKeys +# mode is set by an escape sequence. + +key Up -Shift+Ansi+AppCuKeys : "\EOA" +key Down -Shift+Ansi+AppCuKeys : "\EOB" +key Right-Shift+Ansi+AppCuKeys : "\EOC" +key Left -Shift+Ansi+AppCuKeys : "\EOD" + +key Up -Shift+Ansi-AppCuKeys : "\E[A" +key Down -Shift+Ansi-AppCuKeys : "\E[B" +key Right-Shift+Ansi-AppCuKeys : "\E[C" +key Left -Shift+Ansi-AppCuKeys : "\E[D" + +# function keys + +key F1 -Shift : "\E[11~" +key F2 -Shift : "\E[12~" +key F3 -Shift : "\E[13~" +key F4 -Shift : "\E[14~" +key F5 -Shift : "\E[15~" +key F6 -Shift : "\E[17~" +key F7 -Shift : "\E[18~" +key F8 -Shift : "\E[19~" +key F9 -Shift : "\E[20~" +key F10-Shift : "\E[21~" +key F11-Shift : "\E[23~" +key F12-Shift : "\E[24~" +# +# Shift F1-F12 +# +key F1 +Shift : "\E[11;2~" +key F2 +Shift : "\E[12;2~" +key F3 +Shift : "\E[13;2~" +key F4 +Shift : "\E[14;2~" +key F5 +Shift : "\E[15;2~" +key F6 +Shift : "\E[17;2~" +key F7 +Shift : "\E[18;2~" +key F8 +Shift : "\E[19;2~" +key F9 +Shift : "\E[20;2~" +key F10+Shift : "\E[21;2~" +key F11+Shift : "\E[23;2~" +key F12+Shift : "\E[24;2~" + +key Home : "\E[H" +key End : "\E[F" + +key Prior -Shift : "\E[5~" +key Next -Shift : "\E[6~" +key Insert-Shift : "\E[2~" + +# Keypad-Enter. See comment on Return above. + +key Enter+NewLine : "\r\n" +key Enter-NewLine : "\r" + +key Space +Control : "\x00" + +# some of keys are used by konsole. + +key Up +Shift : scrollLineUp +key Prior +Shift : scrollPageUp +key Down +Shift : scrollLineDown +key Next +Shift : scrollPageDown + +key ScrollLock : scrollLock + +#---------------------------------------------------------- + +# keypad characters as offered by Qt +# cannot be recognized as such. + +#---------------------------------------------------------- + +# Following other strings as emitted by konsole. diff --git a/libgui/languages/de-de.qm b/libgui/languages/de-de.qm new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a701c3df75595c1b14d890e84c3577aa8d342474 GIT binary patch literal 10151 zc$}?S3veA}6+TJt&ExhaY0{FW0n(+93~gI+A$5u??UunM}~{hm-4it_N81v*g8h zp#3LxCoehcam4YpB>|NBS)ZOsJlZbCy-LbE;-yf@cKK~Jb zGFh3=yx-Hq{hYXzrnAk+}70f2FCH!C!1EL ze7qK$F23t&{QixmiKj7N+TP*UlMgiA*NgeFcvaJzmp_NUuW5Q~{k`bV&gM(DFucER zcJ4(#H9XV&g^$pVKxKapQulH#Joe)NtFlTbj(4osHhHly5w zp3-mIlLgh8tR}nzg}(q3_-DlcO?B@s>ehmzHiX``P~3-*EAx0=_a4>ts)}HE#wlPL z1uc(8niZkjt84Z`!oL-r?-G=JMfelldwuJF6Vb>-EXXUTpqx=OiN%lSVYHh^)v1MT z4whPb5mFYzpToqk@YR5v|!>K;0WHkgHfUO6OuzZTBKS4)8Q@V!ZChYo-~Na63j z&{NXaF`!zO?J16~YRUv^RMwu^ms;D~Qw_rQ6N12*#i8FbF;G?rDASJN=_iDxvlMNv z$09vidD;y4-Bn3r5O%?P0yG1uQ1F>~nz+t2)0NVLtvI`+a^0Y<%-Fs%ty-Sq*^0}O z#LMeS)^{8ozhgG0)}E=HU7bee>djG9L)~6UZ__aM9VyhRXJjZ_7o=;06H-4(k-3a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ks7St{iN78@*prtMHn zn}Yxk8mejMNa+ZjZ+g^r^TO^5XLEBDyn~P1qoi_*!k~#(z#xatMm$Sdwbl3R0;0&O zCQ`h?=bRY@+pZCup+|LRDh^W64moq%p{U!>q0(ef0peq#Q&!ei(`XTrCU;#XOoWn} zQwMCz(z7%gueLdnB3>+0j^`KS^rvMO4Ou)q*Nj@!j*AW=5zrhL;l8?|gN)VUmVbPs!^9EzedEcx*ddkycC zA-C?;U7aGR@sokr%s*jDj1n>|0ui1+F=k?rSf3P7`q5Hn6>t$Vn;#04E9@H0B8;4JegHRsKELDcNlUcl)R#KBUG~_8hsl`WpM4ViN!#a;VKV4Ky z4-+bM;WwwlF6`j;A*yvH&C5wMn&zrG3OcJgnmQAwzYo{54Z!F+)GG!^v|ANZQ3Qgp zXCj@RT{N=$%!IJZn=kyC`=M3EWf~IkEn2XDey$mi6i3}qUJ&vCuXq3 zw&^Py87sMmbA&^^lP{hgGDKIv8PHQ!12&>8pK6oQ=bnX(|~c2Mmv{v0mtkGkSPM%=rfUocD36-pC&AvUZ70 zX;|!gltEizPg?bG{w~QhCipW;+i_+Tm5$O}J?lG$hwXvu`r>dTDj8EE-?P#~r=(s` zv$4B04cpN1HU&;P_1tFK8Q!Qa9Sb_Wiqq}3xl9tS-%bQE?|L>?+O!Wty~&++wu;*M z&xsQwNPbn;?-8&K0o{^-r}p3|ZMdE|V~>?mhvb4ZAL`vFs62K>1MboChs4P-)%53I R^zr)TNO51mA8KoA{tHnat`-0Q diff --git a/libgui/languages/de-de.ts b/libgui/languages/de-de.ts new file mode 100644 --- /dev/null +++ b/libgui/languages/de-de.ts @@ -0,0 +1,642 @@ + + + + + FileEditorMdiSubWindow + + + + File Editor + Dateieditor + + + + Cannot read file %1: +%2. + Konnte Datei %1 nicht lesen: +%2. + + + + File loaded. + Datei geladen. + + + + Do you want to save the current file +%1 ? + Möchten Sie die Datei %1 sichern ? + + + + Cannot write file %1: +%2. + Konnte Datei %1 nicht schreiben: +%2. + + + + File %1 saved + Datei %1 gesichert + + + + &Close File + &Datei schließen + + + + &New File + &Neue Datei + + + + &Open File + &Öffne Datei + + + + &Save File + &Sichere Datei + + + + Save File &As + Sichere Datei &als + + + + &Undo + &Rückgängig + + + + &Redo + &Wiederholen + + + + &Copy + &Kopieren + + + + Cu&t + &Ausschneiden + + + + &Paste + &Einfügen + + + + &Next Bookmark + &Nächstes Bookmark + + + + Pre&vious Bookmark + &Voriges Bookmark + + + + Toggle &Bookmark + &Bookmark setzen + + + + &Run File + &Ausführen + + + + &File + &Datei + + + + &Edit + &Editieren + + + + &Run + &Ausführen + + + + FilesDockWidget + + Current Folder + Aktuelles Verzeichnis + + + + Current Directory + Aktuelles Verzeichnis + + + + Move up one directory. + Ein Verzeichnis höher wechseln. + + + + Enter the path or filename. + Geben Sie einen Pfad oder Dateinamen ein. + + + + Doubleclick a file to open it. + Führen Sie einen Doppelklick aus, um eine Datei zu öffnen. + + + + HistoryDockWidget + + + Doubleclick a command to transfer it to the terminal. + Führen Sie einen Doppelklick aus, um den Befehl in das Terminal zu übertragen. + + + + Enter text to filter the command history. + Geben Sie Text ein, um die Befehlshistorie zu filtern. + + + + Command History + Befehlshistorie + + + History updated. + Befehlshistorie aktualisiert. + + + + LexerOctaveGui + + + Default + Standard + + + + Comment + Kommentar + + + + Command + Befehl + + + + Number + Zahl + + + + Keyword + Schlüsselwort + + + + Single-quoted string + Zeichenkette in einfachen Hochkommata + + + + Operator + Operator + + + + Identifier + Bezeichner + + + + Double-quoted string + Zeichenkette in doppelten Hochkommata + + + + MainWindow + + + Opening file. + Öffne Datei. + + + + Save Workspace + Speichere Arbeitsumgebung + + + + Load Workspace + Lade Arbeitsumgebung + + + + + About Octave + Ãœber Octave + + + + Saving data and shutting down. + Speichere Daten und schließe. + + + + View the variables in the active workspace. + Sehen Sie die Variablen ein, die sich in der aktiven Arbeitsumgebung befinden. + + + + Browse and search the command history. + Durchsuchen Sie die Befehlshistorie. + + + + Browse your files. + Durchsuchen Sie Ihre Dateien. + + + + Terminal + Terminal + + + + Enter your commands into the Octave terminal. + Geben Sie Ihre Befehle in das Octave Terminal ein. + + + + Browse the Octave documentation for help. + Durchsuchen Sie die Octave Dokumentation, um Hilfe zu erhalten. + + + + Chat + Chat + + + + Instantly chat with other Octave users for help. + Tauschen Sie sich direkt mit anderen Octave Benutzern aus, um Hilfe zu erhalten. + + + + Octave + Octave + + + + Settings + Einstellungen + + + + Exit + Beenden + + + + Interface + Oberfläche + + + + Align Windows + Fenster ausrichten + + + + + Workspace + Arbeitsumgebung + + + + History + Befehlshistorie + + + + File Browser + Dateibrowser + + + + Open New Editor Window + Neues Editorfenster öffnen + + + + Load + Laden + + + + Save + Sichern + + + + Clear + Löschen + + + + Community + Gemeinschaft + + + + Report Bug + Fehler melden + + + + Agora + Agora + + + + Octave Forge + Octave Forge + + + + About Qt + Ãœber Qt + + + Octave Toolbar + Octave Werkzeugleiste + + + Command Window + Konsolenfenster + + + File Editor + Dateieditor + + + + Documentation + Dokumentation + + + Service + Service + + + Established link to Octave. + Verbindung zu Octave hergestellt. + + + + NumberBar + + Stop Here + Stoppe hier + + + Current Line + Aktuelle Zeile + + + Error Line + Fehlerzeile + + + + NumberedCodeEdit + + This file name is not valid. + Dieser Dateiname ist nicht gültig. + + + Octave doesn't understand this file name: + + Octave versteht diesen Dateityp nicht: + + + +Please, change it. + Do you want to save your changes? + Bitte ändern Sie dies. Möchten Sie Ihre Änderungen sichern? + + + + SettingsDialog + + + Settings + Einstellungen + + + + Chat + Char + + + + Connect to #octave on startup + Beim Start mit #octave verbinden + + + + Show message of the day + Nachricht des Tages anzeigen (MOTD) + + + + Show topic + Thema des Chatkanals anzeigen + + + + Automatically identify on NickServ + Automatisch bei NickServ identifizieren + + + + Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues. + Warnung: Ihre Passwort wird unter ~/.octave-gui in einem menschenlesbaren Format gesichert. Hinterlegen Sie nicht Ihr Password, wenn Sie Bedenken über die Sicherheit haben. + + + + + Password: + Passwort: + + + + Editor + Editor + + + + Use custom file editor: + Benutzerdefinierten Editor verwenden: + + + + emacs + emacs + + + + File Browser + Dateibrowser + + + + Show filenames + Dateinamen anzeigen + + + + Show file size + Dateigröße anzeigen + + + + Show file type + Dateityp anzeigen + + + + Show date of last modification + Datum der letzten Änderung anzeigen + + + + Show hidden files + Versteckte Dateien anzeigen + + + + Alternating row colors + Alternierende Farben verwenden + + + + Network + + + + + Use proxy server + + + + + Proxy Type: + + + + + HttpProxy + + + + + Socks5Proxy + + + + + Hostname: + + + + + Port: + + + + + Username: + + + + + Reset to defaults + Standardeinstellungen wiederherstellen + + + + Export + Exportieren + + + + Import + Importieren + + + + VariablesDockWidget + + + Name + Bezeichner + + + + Type + Typ + + + + Value + Wert + + + + Workspace + Arbeitsumgebung + + + Save + Sichern + + + Load + Laden + + + Clear + Löschen + + + + Local + Lokal + + + + Global + Global + + + + Persistent + Persistent + + + + Hidden + Versteckt + + + diff --git a/libgui/languages/es-es.qm b/libgui/languages/es-es.qm new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7fbf74ee61166c382a369dbfe80f7d2796451295 GIT binary patch literal 9411 zc$}?S3yd6f8UOa!y~lQMuXlYPwAXUiUM*=VvortQ9XdO+ z%;Tj8QUab0>h z#P53%Abt?y&&2_HS3+W)1JHL05?j{+NLNAP8_xhN8i2$xhM)fmgZGvJU^fgtiO<8= zVDR~sczqsL-~2s**xz9FalD?<4_jXU0zmgAaOvtVqP$|b1d@lBI+worw0HpWDxA(t<^8Oota$Xi-+4b?~X70f2(fFS~ zgYs8A9e?`)^uvnx;wQWM01|g4;{1O9j>M{=Tam6eamD>;?}8f>``7;z<^Cq|;JP-v z?n=BcdjMemwTU;U-$lEO_S>KN8NkA$?I&)-`>AC6i-q?A23~Ie{Zn}Vtg((S--7xi zPIf$aU;#k;&W=BQ^RwvZ`#X~_Jb=&b?!5Q$y8t>)biVYjKjQs|JKq45-}`FU;D!GL zSh81K&)(B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+ File Editor + Editor de archivos + + + + Cannot read file %1: +%2. + No se puede leer archivo %1: +%2. + + + + File loaded. + Archivo cargado. + + + + Do you want to save the current file +%1 ? + ¿Desea guardar archivo actual +%1 ? + + + + Cannot write file %1: +%2. + No se puede escribir archivo %1: +%2. + + + + File %1 saved + Archivo %1 guardado + + + + &Close File + &Cerrar archivo + + + + &New File + Archivo &nuevo + + + + &Open File + &Abrir archivo + + + + &Save File + &Guardar archivo + + + + Save File &As + Search for proper shortcut for this command + Guardar archivo &como + + + + &Undo + &Deshacer + + + + &Redo + &Rehacer + + + + &Copy + &Copiar + + + + Cu&t + Cor&tar + + + + &Paste + &Pegar + + + + &Next Bookmark + + + + + Pre&vious Bookmark + + + + + Toggle &Bookmark + + + + + &Run File + &Ejecutar archivo + + + + &File + &Archivo + + + + &Edit + &Editar + + + + &Run + &Ejecutar + + + + FilesDockWidget + + Current Folder + Carpeta actual + + + + Current Directory + + + + + Move up one directory. + Subir un directorio. + + + + Enter the path or filename. + Introduzca dirección o nombre de archivo. + + + + Doubleclick a file to open it. + Haga doble clic para abir archivo. + + + + HistoryDockWidget + + + Doubleclick a command to transfer it to the terminal. + Haga doble clic para transferir el comando a la terminal. + + + + Enter text to filter the command history. + Introduzca texto para filtrar el historial de comandos. + + + + Command History + Historial de comandos + + + + LexerOctaveGui + + + Default + Valores predeterminados + + + + Comment + Comentario + + + + Command + Comando + + + + Number + Número + + + + Keyword + Contraseña + + + + Single-quoted string + Cadena entre comillas simples + + + + Operator + Operador + + + + Identifier + Identificador + + + + Double-quoted string + Cadena entre comillas dobles + + + + MainWindow + + + Opening file. + Abriendo archivo. + + + + Save Workspace + Guardar espacio de trabajo + + + + Load Workspace + Cargar espacio de trabajo + + + + + About Octave + Acerca de Octave + + + + Saving data and shutting down. + Guardando datos y cerrando el sistema. + + + + View the variables in the active workspace. + Ver variables en el espacio de trabajo activo. + + + + Browse and search the command history. + Navegar y buscar en el historial de comandos. + + + + Browse your files. + Explorar sus archivos. + + + + Terminal + Terminal + + + + Enter your commands into the Octave terminal. + Introducir su comando a la terminal de Octave. + + + + Documentation + Documentación + + + + Browse the Octave documentation for help. + Consultar la documentación de Octave para obtener ayuda. + + + + Chat + Chat/conversación instantanea + + + + Instantly chat with other Octave users for help. + Coversación instantanea con otros usuarios de octave para obtener ayuda. + + + + Octave + Octave + + + + Settings + Configuración + + + + Exit + Salir + + + + Interface + Interfase + + + + Align Windows + Alinear ventanas + + + + + Workspace + Espacio de trabajo + + + + History + Historial + + + + File Browser + Explorador de archivos + + + + Open New Editor Window + Abrir nueva ventana de editor + + + + Load + Cargar + + + + Save + Guardar + + + + Clear + Limpiar + + + + Community + Comunidad + + + + Report Bug + Reportar error de software/Bug + + + + Agora + Ãgora + + + + Octave Forge + Octave Forge + + + + About Qt + Acerca de Qt + + + + SettingsDialog + + + Settings + Configuración + + + + Chat + Chat/conversación instantanea + + + + Connect to #octave on startup + Conectar a #octave en el arranque + + + + Show message of the day + Mostrar mensaje del día + + + + Show topic + Mostrar tema + + + + Automatically identify on NickServ + Identificar automáticamente el NickServ + + + + Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues. + Advertencia: La contraseña se guarda en ~ / octavegui en formato legible. No introduzca su contraseña en caso de que le preocupen los aspectos de seguridad. + + + + + + Password: + Contraseña: + + + + Editor + Editor + + + + Use custom file editor: + Usar editor de archivos personalizados: + + + + emacs + emacs + + + + File Browser + Explorador de archivos + + + + Show filenames + Mostrar nombres de archivos + + + + Show file size + Mostrar tamaño de archivo + + + + Show file type + Mostrar tipo de archivo + + + + Show date of last modification + Mostrar fecha de la última modificación + + + + Show hidden files + Mostrar archivos ocultos + + + + Alternating row colors + Colores alternos de filas + + + + Network + + + + + Use proxy server + + + + + Proxy Type: + + + + + HttpProxy + + + + + Socks5Proxy + + + + + Hostname: + + + + + Port: + + + + + Username: + + + + + Reset to defaults + Restaurar los valores predeterminados + + + + Export + Exportar + + + + Import + Importar + + + + VariablesDockWidget + + + Workspace + Espacio de trabajo + + + + Name + Nombre + + + + Type + Tipo + + + + Value + Valor + + + + Local + Local + + + + Global + Global + + + + Persistent + Persistente + + + + Hidden + Oculto + + + diff --git a/libgui/languages/generic.qm b/libgui/languages/generic.qm new file mode 100644 --- /dev/null +++ b/libgui/languages/generic.qm @@ -0,0 +1,1 @@ +<¸dÊÍ!¿`¡½Ý \ No newline at end of file diff --git a/libgui/languages/generic.ts b/libgui/languages/generic.ts new file mode 100644 --- /dev/null +++ b/libgui/languages/generic.ts @@ -0,0 +1,567 @@ + + + + + FileEditorMdiSubWindow + + + + File Editor + + + + + Cannot read file %1: +%2. + + + + + File loaded. + + + + + Do you want to save the current file +%1 ? + + + + + Cannot write file %1: +%2. + + + + + File %1 saved + + + + + &Close File + + + + + &New File + + + + + &Open File + + + + + &Save File + + + + + Save File &As + + + + + &Undo + + + + + &Redo + + + + + &Copy + + + + + Cu&t + + + + + &Paste + + + + + &Next Bookmark + + + + + Pre&vious Bookmark + + + + + Toggle &Bookmark + + + + + &Run File + + + + + &File + + + + + &Edit + + + + + &Run + + + + + FilesDockWidget + + + Current Directory + + + + + Move up one directory. + + + + + Enter the path or filename. + + + + + Doubleclick a file to open it. + + + + + HistoryDockWidget + + + Doubleclick a command to transfer it to the terminal. + + + + + Enter text to filter the command history. + + + + + Command History + + + + + LexerOctaveGui + + + Default + + + + + Comment + + + + + Command + + + + + Number + + + + + Keyword + + + + + Single-quoted string + + + + + Operator + + + + + Identifier + + + + + Double-quoted string + + + + + MainWindow + + + Opening file. + + + + + Save Workspace + + + + + Load Workspace + + + + + + About Octave + + + + + Saving data and shutting down. + + + + + View the variables in the active workspace. + + + + + Browse and search the command history. + + + + + Browse your files. + + + + + Terminal + + + + + Enter your commands into the Octave terminal. + + + + + Documentation + + + + + Browse the Octave documentation for help. + + + + + Chat + + + + + Instantly chat with other Octave users for help. + + + + + Octave + + + + + Settings + + + + + Exit + + + + + Interface + + + + + Align Windows + + + + + + Workspace + + + + + History + + + + + File Browser + + + + + Open New Editor Window + + + + + Load + + + + + Save + + + + + Clear + + + + + Community + + + + + Report Bug + + + + + Agora + + + + + Octave Forge + + + + + About Qt + + + + + SettingsDialog + + + Settings + + + + + Chat + + + + + Connect to #octave on startup + + + + + Show message of the day + + + + + Show topic + + + + + Automatically identify on NickServ + + + + + Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues. + + + + + + Password: + + + + + Editor + + + + + Use custom file editor: + + + + + emacs + + + + + File Browser + + + + + Show filenames + + + + + Show file size + + + + + Show file type + + + + + Show date of last modification + + + + + Show hidden files + + + + + Alternating row colors + + + + + Network + + + + + Use proxy server + + + + + Proxy Type: + + + + + HttpProxy + + + + + Socks5Proxy + + + + + Hostname: + + + + + Port: + + + + + Username: + + + + + Reset to defaults + + + + + Export + + + + + Import + + + + + VariablesDockWidget + + + Workspace + + + + + Name + + + + + Type + + + + + Value + + + + + Local + + + + + Global + + + + + Persistent + + + + + Hidden + + + + diff --git a/libgui/languages/pt-br.qm b/libgui/languages/pt-br.qm new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..83d512baa96d8ad07afa2ef66532922ed0ddcb01 GIT binary patch literal 8860 zc$}?S4U8OR8Gi4&d%fH4-d&G!El0VIU@xV$2UH5!kdo_Ne`&9!SFX?y22!)`fr5vSDpdrIRxpaIevc!)_ndE05}0_j^MTBHrV?5Cjl1euw%`w z$Zrb9uD%K18-Z&+^<97!Yrwkr5WrdY!M*Q}0<^sbe|>Z#%HIzs%4Y!dJ=Jo~k#7QI zUTt~d^_KuTe%f+;Bg*OdRqN8HPX}0BYQ6tog8)k|Y(4Ueet@iz+S&Iq%6TyL#G*Xv z{YvWjiMs%n_N0zog>uh&A@%k{Poexw>fMeWfCb0XDSG~m^tpp~ApPId2OdOw7GIpc z=8~VF+)VoL`c{*QE!6jL zrt9btwCj;f-|G+Kd%w>Zm!QAe?Tm5h61+Z;d3fXdXy+@LCvQjpwZE1*`en4UTVJ&9 zhd)3)K9g;m5pw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B9(;EOrYjG&p?JY~j$zZy%ORG>PW&OHswnN`L?tcQAL4>4iwjSMM`bYCLR+G+`s zX=>7x;S;L9N`F@K9*( zCoT_hBpVt@$g(mGuOWKU)p8`tQ*@Rh-s%+0wf&BJ(5ob9mW}NqZOQ#(S%VL@P|y{l zEl44{#c_+VEH0`$2C?aYML6;LNPnoBCf!<})c&R$+|TwmK16yvduEP!DIj3pp_QNzA?%HF5#v8nfW zL_|~pGE^n;2z`yj=@j#Bk@-8HKb&+{F4LV%&`Mf_eHN z0>_$h69ZM${t4!q3)#%Q#?+)Se^`CW$NhA`0gFwYa4;D#i+v#Dfzbh;Du zSS4nSUc8rkocv}jY<=%jo|=>%nm8Av5U8e6eM{^g zD`7ff$;D_YXcqH)t?U@MYU{N@I8KQRXDQ)R4zk+8Tujr9G#DY2&H+7hh9?Obj1gi| z6wI5wKV3;=fBr1?)gwf&2IX7=#HnGTr)CRi+^;mXl~|OZVGt}P0VUJGswB6q`C}vt zp*SeV*-9N$I_kJGT)&r+1XSK*MRL99D+ZfRlCwO<7bnmc^;3R^xcW}T)RP$Pgeyro zw>G2IpT*CHsG`;aN3Bt^-3p_^j9z-BCw^tX6{9R2&#A&C=J&f;k0z)=JM_!S7`1Xa znaFA(KfBn+S1SB$M2w5!F&Sy2@c7aYsd@|c(i zA2-Crar1eDvfmT~Q+zK4xSOsOKZuE;L~K6TMhCSKM-#tB@o`I{F*}+v!K*a%2TcjbcG*O4CbcS}q+7dK3jT^@J(7 x2iH;Dwbf~G6WRM@F%4z!Q^m50nd6iR(ODur&a9w0+5b9;#xnjKK4@Lg@?TSErf~oO diff --git a/libgui/languages/pt-br.ts b/libgui/languages/pt-br.ts new file mode 100644 --- /dev/null +++ b/libgui/languages/pt-br.ts @@ -0,0 +1,571 @@ + + + + + FileEditorMdiSubWindow + + + + File Editor + Editor de Arquivos + + + + Cannot read file %1: +%2. + Não foi possível ler o arquivo %1: %2. + + + + File loaded. + Arquivo carregado. + + + + Do you want to save the current file +%1 ? + Você deseja salvar o arquivo atual %1 ? + + + + Cannot write file %1: +%2. + Não foi possível escrever no arquivo %1: %2. + + + + File %1 saved + Arquivo %1 salvo + + + + &Close File + &Fechar Arquivo + + + + &New File + &Novo Arquivo + + + + &Open File + &Abrir Arquivo + + + + &Save File + &Salvar Arquivo + + + + Save File &As + Salvar Arquivo &Como + + + + &Undo + &Desfazer + + + + &Redo + &Refazer + + + + &Copy + + + + + Cu&t + + + + + &Paste + + + + + &Next Bookmark + + + + + Pre&vious Bookmark + + + + + Toggle &Bookmark + + + + + &Run File + + + + + &File + + + + + &Edit + + + + + &Run + + + + + FilesDockWidget + + Current Folder + Diretório Atual + + + + Current Directory + + + + + Move up one directory. + Subir um diretório. + + + + Enter the path or filename. + Digite o caminho ou o nome do arquivo. + + + + Doubleclick a file to open it. + Clique duas vezes num arquivo para abrí-lo. + + + + HistoryDockWidget + + + Doubleclick a command to transfer it to the terminal. + Clique duas vezes num comando para transferí-lo ao terminal. + + + + Enter text to filter the command history. + Digite um texto para filtrar o hitórico de comandos. + + + + Command History + Histórico de Comandos + + + + LexerOctaveGui + + + Default + Padrão + + + + Comment + Comentário + + + + Command + Comando + + + + Number + Número + + + + Keyword + Palavra-Chave + + + + Single-quoted string + String com aspas simples + + + + Operator + Operador + + + + Identifier + Identificador + + + + Double-quoted string + String com aspas duplas + + + + MainWindow + + + Opening file. + Abrindo arquivo. + + + + Save Workspace + Salvar ambiente de trabalho + + + + Load Workspace + Carregar ambiente de trabalho + + + + + About Octave + Sobre o Octave + + + + Saving data and shutting down. + Salvando dados e encerrando a sessão. + + + + View the variables in the active workspace. + Visualizar variáveis no ambiente de trabalho. + + + + Browse and search the command history. + Pesquise no histórico de comandos. + + + + Browse your files. + Procure seus arquivos. + + + + Terminal + Terminal + + + + Enter your commands into the Octave terminal. + Digite seus comandos no terminal do Octave. + + + + Documentation + Documentação + + + + Browse the Octave documentation for help. + Procure na documentação do Octave. + + + + Chat + Chat + + + + Instantly chat with other Octave users for help. + Converse instantaneamente com outros usuários do Octave para pedir ajuda. + + + + Octave + Octave + + + + Settings + Configurações + + + + Exit + Sair + + + + Interface + Interface + + + + Align Windows + Alinhar Janelas + + + + + Workspace + Ambiente de trabalho + + + + History + Histórico + + + + File Browser + Navegador de Arquivos + + + + Open New Editor Window + Abrir nova janela de edição + + + + Load + Carregar + + + + Save + Salvar + + + + Clear + Limpar + + + + Community + Comunidade + + + + Report Bug + Reportar Bug + + + + Agora + Agora + + + + Octave Forge + Octave Forge + + + + About Qt + Sobre o Qt + + + + SettingsDialog + + + Settings + Configurações + + + + Chat + Chat + + + + Connect to #octave on startup + Conectar ao #octave ao iniciar + + + + Show message of the day + Mostrar mensagem do dia + + + + Show topic + Mostrar tópico + + + + Automatically identify on NickServ + Identificar-se automaticamente com o NickServ + + + + Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues. + Aviso: Sua senha será salva em ~/.octavegui em um formato legível. Não digite sua senha se você tem problemas com segurança. + + + + + Password: + Senha: + + + + Editor + Editor + + + + Use custom file editor: + Usar editor de arquivos personalizado: + + + + emacs + emacs + + + + File Browser + Navegador de Arquivos + + + + Show filenames + Mostrar nomes de arquivo + + + + Show file size + Mostrar tamanho do arquivo + + + + Show file type + Mostrar tipo do arquivo + + + + Show date of last modification + Mostrar data de última modificação + + + + Show hidden files + Mostrar arquivos ocultos + + + + Alternating row colors + Alternar cores das linhas + + + + Network + + + + + Use proxy server + + + + + Proxy Type: + + + + + HttpProxy + + + + + Socks5Proxy + + + + + Hostname: + + + + + Port: + + + + + Username: + + + + + Reset to defaults + Resetar ao padrão + + + + Export + Exportar + + + + Import + Importar + + + + VariablesDockWidget + + + Workspace + Ambiente de trabalho + + + + Name + Nome + + + + Type + Tipo + + + + Value + Valor + + + + Local + Local + + + + Global + Global + + + + Persistent + Persistente + + + + Hidden + Oculto + + + diff --git a/libgui/languages/ru-ru.qm b/libgui/languages/ru-ru.qm new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c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Va!(XL4wk3KO{NQOQ`+Q5ymyPB0^K0EJ{|7cAT@U~O diff --git a/libgui/languages/ru-ru.ts b/libgui/languages/ru-ru.ts new file mode 100644 --- /dev/null +++ b/libgui/languages/ru-ru.ts @@ -0,0 +1,574 @@ + + + + + FileEditorMdiSubWindow + + + + File Editor + Редактор файлов + + + + Cannot read file %1: +%2. + Ðе удалоÑÑŒ прочитать файл %1: +%2. + + + + File loaded. + Файл загружен. + + + + Do you want to save the current file +%1 ? + Сохранить текущий файл +%1? + + + + Cannot write file %1: +%2. + Ðе удалоÑÑŒ Ñохранить файл %1: +%2. + + + + File %1 saved + Файл %1 Ñохранён + + + + &Close File + &Закрыть + + + + &New File + Созд&ать + + + + &Open File + &Открыть + + + + &Save File + &Сохранить + + + + Save File &As + Сохранить &как + + + + &Undo + О&тменить + + + + &Redo + &Повторить + + + + &Copy + &Копировать + + + + Cu&t + Ð’Ñ‹&резать + + + + &Paste + &Ð’Ñтавить + + + + &Next Bookmark + С&Ð»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð·Ð°ÐºÐ»Ð°Ð´ÐºÐ° + + + + Pre&vious Bookmark + Пр&ÐµÐ´Ñ‹Ð´ÑƒÑ‰Ð°Ñ Ð·Ð°ÐºÐ»Ð°Ð´ÐºÐ° + + + + Toggle &Bookmark + &УÑтановить/ÑнÑÑ‚ÑŒ закладку + + + + &Run File + &ЗапуÑтить файл + + + + &File + &Файл + + + + &Edit + &Правка + + + + &Run + &ЗапуÑк + + + + FilesDockWidget + + Current Folder + Текущий каталог + + + + Current Directory + Текущий каталог + + + + Move up one directory. + Перейти на уровень выше. + + + + Enter the path or filename. + Введите путь или Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð°. + + + + Doubleclick a file to open it. + Двойной щелчок по файлу откроет его. + + + + HistoryDockWidget + + + Doubleclick a command to transfer it to the terminal. + Двойной щелчок по команде перенеÑÑ‘Ñ‚ её в командную Ñтроку. + + + + Enter text to filter the command history. + Введите текÑÑ‚ Ð´Ð»Ñ Ñ„Ð¸Ð»ÑŒÑ‚Ñ€Ð°Ñ†Ð¸Ð¸ выполненных команд. + + + + Command History + Журнал выполненных команд + + + + LexerOctaveGui + + + Default + По умолчанию + + + + Comment + Комментарий + + + + Command + Команда + + + + Number + ЧиÑло + + + + Keyword + Зарезервированное Ñлово + + + + Single-quoted string + Строка в одинарных кавычках + + + + Operator + Оператор + + + + Identifier + Идентификатор + + + + Double-quoted string + Строка в двойных кавычках + + + + MainWindow + + + Opening file. + ОткрываетÑÑ Ñ„Ð°Ð¹Ð». + + + + Save Workspace + Сохранить облаÑÑ‚ÑŒ переменных + + + + Load Workspace + Загрузить облаÑÑ‚ÑŒ переменных + + + + + About Octave + Об Octave + + + + Saving data and shutting down. + Сохранить и завершить работу. + + + + View the variables in the active workspace. + ПроÑмотр Ñодержимого текущей облаÑти переменных. + + + + Browse and search the command history. + ПроÑмотр и поиÑк в журнале выполненных команд. + + + + Browse your files. + ПроÑмотр файлов. + + + + Terminal + ÐšÐ¾Ð¼Ð°Ð½Ð´Ð½Ð°Ñ Ñтрока + + + + Enter your commands into the Octave terminal. + Введите команды в командной Ñтроке Octave. + + + + Documentation + Ð”Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ + + + + Browse the Octave documentation for help. + Открыть документацию по Octave. + + + + Chat + Чат + + + + Instantly chat with other Octave users for help. + Чат Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñми Octave. + + + + Octave + Octave + + + + Settings + Параметры + + + + Exit + Выход + + + + Interface + Ð˜Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ + + + + Align Windows + ВыровнÑÑ‚ÑŒ окна + + + + + Workspace + ОблаÑÑ‚ÑŒ переменных + + + + History + Журнал выполненных команд + + + + File Browser + Файловый менеджер + + + + Open New Editor Window + Открыть новое окно редактора + + + + Load + Загрузить + + + + Save + Сохранить + + + + Clear + ОчиÑтить + + + + Community + СообщеÑтво + + + + Report Bug + Сообщить об ошибке + + + + Agora + Agora + + + + Octave Forge + Octave Forge + + + + About Qt + О Qt + + + + SettingsDialog + + + Settings + Параметры + + + + Chat + Чат + + + + Connect to #octave on startup + ПодключитьÑÑ Ðº #octave при запуÑке + + + + Show message of the day + Показывать Ñовет Ð´Ð½Ñ + + + + Show topic + Показывать тему обÑÑƒÐ¶Ð´ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¸ подключении + + + + Automatically identify on NickServ + ÐвтоматичеÑки идентифицироватьÑÑ Ñƒ NickServ + + + + Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues. + Предупреждение: пароль будет Ñохранён в ~/.octavegui обычным текÑтом. Ðе вводите пароль, еÑли переживаете о возможных уÑзвимоÑÑ‚ÑÑ… в безопаÑноÑти приложениÑ. + + + + + Password: + Пароль: + + + + Editor + Редактор + + + + Use custom file editor: + Выбрать редактор: + + + + emacs + emacs + + + + File Browser + Файловый менеджер + + + + Show filenames + Показывать имена файлов + + + + Show file size + Показывать размер файлов + + + + Show file type + Показывать типы файлов + + + + Show date of last modification + Показывать дату поÑледнего Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ + + + + Show hidden files + Показывать Ñкрытые файлы + + + + Alternating row colors + ЧередующиеÑÑ Ñ†Ð²ÐµÑ‚Ð° Ñтрок + + + + Network + + + + + Use proxy server + + + + + Proxy Type: + + + + + HttpProxy + + + + + Socks5Proxy + + + + + Hostname: + + + + + Port: + + + + + Username: + + + + + Reset to defaults + УÑтановить параметры по умолчанию + + + + Export + ЭкÑпортировать + + + + Import + Импортировать + + + + VariablesDockWidget + + + Workspace + ОблаÑÑ‚ÑŒ переменных + + + + Name + Идентификатор + + + + Type + Тип + + + + Value + Значение + + + + Local + Ð›Ð¾ÐºÐ°Ð»ÑŒÐ½Ð°Ñ + + + + Global + Ð“Ð»Ð¾Ð±Ð°Ð»ÑŒÐ½Ð°Ñ + + + + Persistent + СтатичеÑÐºÐ°Ñ + + + + Hidden + Ð¡ÐºÑ€Ñ‹Ñ‚Ð°Ñ + + + diff --git a/libgui/languages/translators b/libgui/languages/translators new file mode 100644 --- /dev/null +++ b/libgui/languages/translators @@ -0,0 +1,8 @@ +# Below Octave GUI translators are listed with their e-mails +# to be able inform them about generic translation file changes +en-en Jacob Dawid +es-es Valentin Ortega-Clavero +de-de Jacob Dawid +pt-br Júlio Hoffimann Mendes +ru-ru Andriy Shinkarchuck +uk-ua Andriy Shinkarchuck diff --git a/libgui/languages/uk-ua.qm b/libgui/languages/uk-ua.qm new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..106e473c4ee5a25399cf11bc5c2f5f0a50834565 GIT binary patch literal 9884 zc$}qK3v3(Z9siPk&cn5x)J>DnM|y2(P+!4y9g@0<NlWe_bfeFCpVF;FK>qH8M5s=4+H%Uvh6fnmmMTSZ-0}Jz#Zf(+pY(G&yw-WuOVc^AIOn! z{T%4LKr$UC;rk}?JiVrJKztBQR-6=Y<`ZeJD0lg;- z^r|1BPc5GSeg8pUn!AmV)obXRhnYMF>HGJCT{hfKKducD;yLS~`20c7mbP2qe6Qz< z`#}GOnCD36uL$vvc^+u51bH6!oSi>P$cigH?O!1HzAsJ`)LkgMvV>IaUlgzJ0NfB)gvLEkrOyl3wxq~*z)dmg_F>>$*< z_R(Jnsj04chXDWJo3&ea{|EH^h+j9=)*hW10DF_#jQAn&P1Roa$*pjHZ|$QMuYz2c z)&A|ky&&%+-nuiV!On-htKWVI>=E#$JHcPeZ}g_S8sPe@_o3K-LC=4Ae{nPTd-*5c zGv5b2S57YvKlubuztczG0zXwgpTZ^8V~#C=E2U(0=}#KS-9TryYA#4 z32DCDcf-B!f}Oj4w^jTZ%BR+9`j%Ez>9GI4gche5HG4p7;XUJj_nNctyw(5S)>B~5mcWr1llS$2 zdJ61Rb7SD@&p{8*Lf~W#_`&~l;N)*oAXj(b-x=no9d+apkayLFI`3l;7s2n=C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uqHwN2X7_da^DVRfCi0ccpuEg71i04<0 zrOC7HqN{HrF60pg=zzJ4NZO|_lh^Kbt0?L0G=oiz*KVY7A@ zz7nyrzv-aHUf;m@Fv9~vLR56af{HjQYQ3r8FF@E9F^Z~L2qQp=O|Tl}^m50jPS=u) zNn1e`m?Al-SOSkPG#X!;hZO~lRby`r$hf%2pO#644T^=9R!sh8+7-*31wkGD5L!!!B z<*0Bun^tEH6ovsSlMyB$?ZFLFn)Nl;Ufjm(-BeCy-=}jh*Y031G+FDzCNC)DZ9=~y zu(ynoH36G66fB{thBC?oZx~l5^SxWqHaLhIGdlv<&JSb4FL}P6t}$}4n7e00NtIw; z&SsU40<4t~VMG2UHTG+k2;O}#EW@;J?515QRMCwL!Y!T$44__uXA?rnP(C9qwUc5d fxAfsJ))70B`!+oAuc-KJ%kpy#mGrai-j)9c_2Oqa diff --git a/libgui/languages/uk-ua.ts b/libgui/languages/uk-ua.ts new file mode 100644 --- /dev/null +++ b/libgui/languages/uk-ua.ts @@ -0,0 +1,574 @@ + + + + + FileEditorMdiSubWindow + + + + File Editor + Редактор файлів + + + + Cannot read file %1: +%2. + Ðе вдалоÑÑ Ð¿Ñ€Ð¾Ñ‡Ð¸Ñ‚Ð°Ñ‚Ð¸ файл %1: +%2. + + + + File loaded. + Файл завантажено. + + + + Do you want to save the current file +%1 ? + Справді зберегти поточний файл +%1? + + + + Cannot write file %1: +%2. + Ðе вдалоÑÑ Ð·Ð±ÐµÑ€ÐµÐ³Ñ‚Ð¸ файл %1: +%2. + + + + File %1 saved + Файл %1 збережено + + + + &Close File + За&крити + + + + &New File + &Створити + + + + &Open File + &Відкрити + + + + &Save File + &Зберегти + + + + Save File &As + Зберегти &Ñк + + + + &Undo + Ð’&ернути + + + + &Redo + П&овторити + + + + &Copy + &Копіювати + + + + Cu&t + Виріза&ти + + + + &Paste + &Ð’Ñтавити + + + + &Next Bookmark + До &наÑтупної закладки + + + + Pre&vious Bookmark + До &попередньої закладки + + + + Toggle &Bookmark + Ð’&Ñтановити/видалити закладку + + + + &Run File + &Виконати файл + + + + &File + &Файл + + + + &Edit + &Правка + + + + &Run + &Ð’Ð¸ÐºÐ¾Ð½Ð°Ð½Ð½Ñ + + + + FilesDockWidget + + Current Folder + Поточний каталог + + + + Current Directory + Поточний каталог + + + + Move up one directory. + Перейти вгору деревом каталогів. + + + + Enter the path or filename. + Введіть повний шлÑÑ… до файлу або назву файлу. + + + + Doubleclick a file to open it. + Подвійне ÐºÐ»Ð°Ñ†Ð°Ð½Ð½Ñ Ð²Ñ–Ð´ÐºÑ€Ð¸Ñ” файл. + + + + HistoryDockWidget + + + Doubleclick a command to transfer it to the terminal. + Подвійне ÐºÐ»Ð°Ñ†Ð°Ð½Ð½Ñ Ð¿ÐµÑ€ÐµÐ½ÐµÑе команду до командного Ñ€Ñдку. + + + + Enter text to filter the command history. + Введіть текÑÑ‚ Ð´Ð»Ñ Ñ„Ñ–Ð»ÑŒÑ‚Ñ€ÑƒÐ²Ð°Ð½Ð½Ñ Ñ–Ñторії виконаних команд. + + + + Command History + ІÑÑ‚Ð¾Ñ€Ñ–Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð¸Ñ… команд + + + + LexerOctaveGui + + + Default + Стандартні Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ + + + + Comment + Коментар + + + + Command + Команда + + + + Number + ЧиÑло + + + + Keyword + Зарезервоване Ñлово + + + + Single-quoted string + РÑдок в одинарних лапках + + + + Operator + Оператор + + + + Identifier + Ідентифікатор + + + + Double-quoted string + РÑдок у подвійних лапках + + + + MainWindow + + + Opening file. + ВідкриваєтьÑÑ Ñ„Ð°Ð¹Ð». + + + + Save Workspace + Зберегти облаÑÑ‚ÑŒ змінних + + + + Load Workspace + Завантажити облаÑÑ‚ÑŒ змінних + + + + + About Octave + Про Octave + + + + Saving data and shutting down. + Зберегти дані Ñ– завершити роботу. + + + + View the variables in the active workspace. + ПереглÑд зміÑту поточної облаÑÑ‚Ñ– змінних. + + + + Browse and search the command history. + ПереглÑд Ñ– пошук Ñеред Ñ–Ñторії виконаних команд. + + + + Browse your files. + ПереглÑнути файли. + + + + Terminal + Командний Ñ€Ñдок + + + + Enter your commands into the Octave terminal. + Введіть команди до командного Ñ€Ñдка Octave. + + + + Documentation + Ð”Ð¾ÐºÑƒÐ¼ÐµÐ½Ñ‚Ð°Ñ†Ñ–Ñ + + + + Browse the Octave documentation for help. + ПереглÑнути документацію до Octave. + + + + Chat + Чат + + + + Instantly chat with other Octave users for help. + Чат з кориÑтувачами Octave. + + + + Octave + Octave + + + + Settings + ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ + + + + Exit + Вийти + + + + Interface + Ð†Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ + + + + Align Windows + ВирівнÑти вікна + + + + + Workspace + ОблаÑÑ‚ÑŒ змінних + + + + History + ІÑÑ‚Ð¾Ñ€Ñ–Ñ Ð²Ð¸ÐºÐ¾Ð½Ð°Ð½Ð¸Ñ… команд + + + + File Browser + Файловий менеджер + + + + Open New Editor Window + Відкрити нове вікно редактора + + + + Load + Завантажити + + + + Save + Зберегти + + + + Clear + ОчиÑтити + + + + Community + Спільнота + + + + Report Bug + Повідомити про помилку + + + + Agora + Agora + + + + Octave Forge + Octave Forge + + + + About Qt + Про Qt + + + + SettingsDialog + + + Settings + ÐÐ°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ + + + + Chat + Чат + + + + Connect to #octave on startup + З'єднатиÑÑ Ð· #octave при запуÑку + + + + Show message of the day + Показувати пораду Ð´Ð½Ñ + + + + Show topic + Показувати тему чату при з'єднанні + + + + Automatically identify on NickServ + Ðвтоматично ідентифікуватиÑÑ Ð² NickServ + + + + Warning: Your password will be stored in ~/.octavegui in human-readable format. Do not enter your password if you worry about security issues. + ПопередженнÑ: пароль буде збережено в ~/.octavegui звичайним текÑтом. Ðе вводьте пароль, Ñкщо переймаєтеÑÑŒ потенційними проблемами із захиÑтом даних в програмі. + + + + + Password: + Пароль: + + + + Editor + Редактор + + + + Use custom file editor: + ВикориÑтовувати інший редактор: + + + + emacs + emacs + + + + File Browser + Файловий менеджер + + + + Show filenames + Показувати назви файлів + + + + Show file size + Показувати розмір файлів + + + + Show file type + Показувати типи файлів + + + + Show date of last modification + Показувати дату оÑтанньої зміни + + + + Show hidden files + Показувати приховані файли + + + + Alternating row colors + Чергувати колір Ñ€Ñдків + + + + Network + + + + + Use proxy server + + + + + Proxy Type: + + + + + HttpProxy + + + + + Socks5Proxy + + + + + Hostname: + + + + + Port: + + + + + Username: + + + + + Reset to defaults + Ð’Ñтановити Ñтандартні Ð½Ð°Ð»Ð°ÑˆÑ‚ÑƒÐ²Ð°Ð½Ð½Ñ + + + + Export + ЕкÑпортувати + + + + Import + Імпортувати + + + + VariablesDockWidget + + + Workspace + ОблаÑÑ‚ÑŒ змінних + + + + Name + Ідентифікатор + + + + Type + Тип + + + + Value + Ð—Ð½Ð°Ñ‡ÐµÐ½Ð½Ñ + + + + Local + Локальна + + + + Global + Глобальна + + + + Persistent + Статична + + + + Hidden + Прихована + + + diff --git a/libgui/src/Makefile.am b/libgui/src/Makefile.am new file mode 100644 --- /dev/null +++ b/libgui/src/Makefile.am @@ -0,0 +1,308 @@ +# Copyright (C) 2012 John W. Eaton +# +# This file is part of Octave. +# +# Octave is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# Octave is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with Octave; see the file COPYING. If not, see +# . + +include $(top_srcdir)/build-aux/common.mk + +QT_INCDIR = @QT_INCDIR@ + +QT_LIBDIR = @QT_LIBDIR@ + +QT_LIBS = -lQtCore -lQtGui -lQtNetwork -lqscintilla2 + +QT_LDFLAGS = -L$(QT_LIBDIR) + +SRCDIRS = \ + m-editor \ + qtinfo \ + octave-adapter \ + ../qterminal/libqterminal/unix \ + ../qterminal/libqterminal/win32 \ + ../qterminal/libqterminal \ + ../qterminal + +octave_gui_MOC = \ + m-editor/moc-file-editor-interface.cc \ + m-editor/moc-file-editor-tab.cc \ + m-editor/moc-file-editor.cc \ + m-editor/moc-find-dialog.cc \ + m-editor/moc-lexer-octave-gui.cc \ + moc-documentation-dockwidget.cc \ + moc-files-dockwidget.cc \ + moc-history-dockwidget.cc \ + moc-main-window.cc \ + moc-octave-qt-event-listener.cc \ + moc-settings-dialog.cc \ + moc-terminal-dockwidget.cc \ + moc-welcome-wizard.cc \ + moc-workspace-model.cc \ + moc-workspace-view.cc \ + octave-adapter/moc-octave-main-thread.cc \ + qtinfo/moc-parser.cc \ + qtinfo/moc-webinfo.cc + +octave_gui_UI = \ + settings-dialog.ui \ + welcome-wizard.ui + +octave_gui_UI_H = $(patsubst %.ui, ui-%.h, $(octave_gui_UI)) + +octave_gui_RC = qrc-resource.cc + +octlib_LTLIBRARIES = liboctgui.la + +liboctgui_la_SOURCES = \ + documentation-dockwidget.cc \ + files-dockwidget.cc \ + history-dockwidget.cc \ + m-editor/file-editor-tab.cc \ + m-editor/file-editor.cc \ + m-editor/find-dialog.cc \ + m-editor/lexer-octave-gui.cc \ + main-window.cc \ + octave-adapter/octave-event.cc \ + octave-adapter/octave-link.cc \ + octave-adapter/octave-main-thread.cc \ + octave-gui.cc \ + octave-qt-event-listener.cc \ + qtinfo/parser.cc \ + qtinfo/webinfo.cc \ + resource-manager.cc \ + settings-dialog.cc \ + symbol-information.cc \ + terminal-dockwidget.cc \ + welcome-wizard.cc \ + workspace-model.cc \ + workspace-view.cc + +nodist_liboctgui_la_SOURCES = $(octave_gui_MOC) $(octave_gui_RC) + +liboctgui_la_CPPFLAGS = \ + -I$(QT_INCDIR) \ + -I$(QT_INCDIR)/QtCore \ + -I$(QT_INCDIR)/QtGui \ + -I$(QT_INCDIR)/QtNetwork \ + -I$(srcdir)/../qterminal/libqterminal \ + -I$(srcdir)/m-editor \ + -I$(srcdir)/octave-adapter \ + -I$(srcdir)/qtinfo \ + -I$(srcdir)/../../libcruft/misc \ + -I../../liboctave \ + -I$(srcdir)/../../liboctave \ + -I../../libinterp \ + -I../../libinterp/interp-core \ + -I../../libinterp/interpfcn \ + -I../../libinterp/parse-tree \ + -I$(srcdir)/../../libinterp \ + -I$(srcdir)/../../libinterp/interp-core \ + -I$(srcdir)/../../libinterp/interpfcn \ + -I$(srcdir)/../../libinterp/octave-value \ + -I$(srcdir)/../../libtinerp/operators \ + -I$(srcdir)/../../libinterp/parse-tree + +include link-deps.mk + +liboctgui_la_LIBADD = \ + libqterminal.la \ + ../../libinterp/liboctinterp.la \ + ../../liboctave/liboctave.la \ + ../../libcruft/libcruft.la \ + $(LIBOCTGUI_LINK_DEPS) + +# Increment these as needed and according to the rules in the libtool manual: +liboctgui_current = 0 +liboctgui_revision = 0 +liboctgui_age = 0 + +liboctgui_version_info = $(liboctgui_current):$(liboctgui_revision):$(liboctgui_age) + +liboctgui_la_LDFLAGS = \ + -version-info $(liboctgui_version_info) \ + $(NO_UNDEFINED_LDFLAG) \ + -bindir $(bindir) \ + $(LIBOCTGUI_LINK_OPTS) + +noinst_HEADERS = \ + documentation-dockwidget.h \ + files-dockwidget.h \ + history-dockwidget.h \ + m-editor/file-editor-interface.h \ + m-editor/file-editor-tab.h \ + m-editor/file-editor.h \ + m-editor/find-dialog.h \ + m-editor/lexer-octave-gui.h \ + main-window.h \ + octave-adapter/octave-event-listener.h \ + octave-adapter/octave-event-observer.h \ + octave-adapter/octave-event.h \ + octave-adapter/octave-link.h \ + octave-adapter/octave-main-thread.h \ + octave-gui.h \ + octave-qt-event-listener.h \ + qtinfo/parser.h \ + qtinfo/webinfo.h \ + resource-manager.h \ + settings-dialog.h \ + symbol-information.h \ + terminal-dockwidget.h \ + welcome-wizard.h \ + workspace-model.h \ + workspace-view.h + +CLEANFILES = $(octave_gui_MOC) $(octave_gui_UI_H) $(octave_gui_RC) + +clean-local: + -if test "$(srcdir)" != "."; then \ + for d in $(SRCDIRS); do test -d $$d && rmdir $$d; done \ + fi + +BUILT_SOURCES = $(octave_gui_UI_H) + +octave_gui_ICONS = \ + icons/arrow_right.png \ + icons/artsbuilderexecute.png \ + icons/bookmark.png \ + icons/bp_next.png \ + icons/bp_prev.png \ + icons/bp_rm_all.png \ + icons/bp_toggle.png \ + icons/chat.png \ + icons/configure.png \ + icons/db_cont.png \ + icons/db_step_in.png \ + icons/db_step_out.png \ + icons/db_step.png \ + icons/db_stop.png \ + icons/editcopy.png \ + icons/editcut.png \ + icons/editpaste.png \ + icons/filenew.png \ + icons/fileopen.png \ + icons/filesaveas.png \ + icons/filesave.png \ + icons/find.png \ + icons/help_index.png \ + icons/icons_license \ + icons/jabber_protocol.png \ + icons/logo.png \ + icons/question.png \ + icons/redled.png \ + icons/redo.png \ + icons/search.png \ + icons/star.png \ + icons/stop.png \ + icons/terminal.png \ + icons/undo.png \ + icons/up.png \ + icons/zoom-in.png \ + icons/zoom-out.png + +EXTRA_DIST = \ + $(octave_gui_UI) \ + $(octave_gui_ICONS) \ + resource.qrc + +noinst_LTLIBRARIES = libqterminal.la + +noinst_HEADERS += \ + ../qterminal/libqterminal/QTerminal.h \ + ../qterminal/libqterminal/QTerminalInterface.h \ + ../qterminal/libqterminal/win32/QTerminalColors.h \ + ../qterminal/libqterminal/win32/QWinTerminalImpl.h \ + ../qterminal/libqterminal/unix/BlockArray.h \ + ../qterminal/libqterminal/unix/Character.h \ + ../qterminal/libqterminal/unix/CharacterColor.h \ + ../qterminal/libqterminal/unix/Emulation.h \ + ../qterminal/libqterminal/unix/ExtendedDefaultTranslator.h \ + ../qterminal/libqterminal/unix/Filter.h \ + ../qterminal/libqterminal/unix/History.h \ + ../qterminal/libqterminal/unix/KeyboardTranslator.h \ + ../qterminal/libqterminal/unix/konsole_wcwidth.h \ + ../qterminal/libqterminal/unix/kpty.h \ + ../qterminal/libqterminal/unix/kpty_p.h \ + ../qterminal/libqterminal/unix/LineFont.h \ + ../qterminal/libqterminal/unix/QUnixTerminalImpl.h \ + ../qterminal/libqterminal/unix/Screen.h \ + ../qterminal/libqterminal/unix/ScreenWindow.h \ + ../qterminal/libqterminal/unix/TerminalCharacterDecoder.h \ + ../qterminal/libqterminal/unix/Vt102Emulation.h \ + ../qterminal/libqterminal/unix/SelfListener.h \ + ../qterminal/libqterminal/unix/TerminalModel.h \ + ../qterminal/libqterminal/unix/TerminalView.h + +libqterminal_la_CPPFLAGS = \ + -I$(QT_INCDIR) \ + -I$(QT_INCDIR)/QtCore \ + -I$(QT_INCDIR)/QtGui \ + -I$(srcdir)/../qterminal/libqterminal + +libqterminal_la_MOC = \ + ../qterminal/libqterminal/moc-QTerminal.cc \ + ../qterminal/libqterminal/moc-QTerminalInterface.cc + +nodist_libqterminal_la_SOURCES = $(libqterminal_la_MOC) + +if WIN32_TERMINAL + +libqterminal_la_SOURCES = \ + ../qterminal/libqterminal/win32/QTerminalColors.cpp \ + ../qterminal/libqterminal/win32/QWinTerminalImpl.cpp + +libqterminal_la_MOC += ../qterminal/libqterminal/win32/moc-QWinTerminalImpl.cc + +else + +libqterminal_la_SOURCES = \ + ../qterminal/libqterminal/unix/BlockArray.cpp \ + ../qterminal/libqterminal/unix/Emulation.cpp \ + ../qterminal/libqterminal/unix/Filter.cpp \ + ../qterminal/libqterminal/unix/History.cpp \ + ../qterminal/libqterminal/unix/KeyboardTranslator.cpp \ + ../qterminal/libqterminal/unix/konsole_wcwidth.cpp \ + ../qterminal/libqterminal/unix/kpty.cpp \ + ../qterminal/libqterminal/unix/QUnixTerminalImpl.cpp \ + ../qterminal/libqterminal/unix/Screen.cpp \ + ../qterminal/libqterminal/unix/ScreenWindow.cpp \ + ../qterminal/libqterminal/unix/TerminalCharacterDecoder.cpp \ + ../qterminal/libqterminal/unix/Vt102Emulation.cpp \ + ../qterminal/libqterminal/unix/SelfListener.cpp \ + ../qterminal/libqterminal/unix/TerminalModel.cpp \ + ../qterminal/libqterminal/unix/TerminalView.cpp + +libqterminal_la_MOC += \ + ../qterminal/libqterminal/unix/moc-Emulation.cc \ + ../qterminal/libqterminal/unix/moc-Filter.cc \ + ../qterminal/libqterminal/unix/moc-QUnixTerminalImpl.cc \ + ../qterminal/libqterminal/unix/moc-ScreenWindow.cc \ + ../qterminal/libqterminal/unix/moc-SelfListener.cc \ + ../qterminal/libqterminal/unix/moc-TerminalModel.cc \ + ../qterminal/libqterminal/unix/moc-TerminalView.cc \ + ../qterminal/libqterminal/unix/moc-Vt102Emulation.cc + +endif + +moc-%.cc: %.h + test -d $(@D) || mkdir -p $(@D) + @MOC@ -o$@ $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liboctgui_la_CPPFLAGS) $< + +ui-%.h: %.ui + @UIC@ -o $@ $< + +qrc-%.cc: %.qrc + @RCC@ -o $@ $< + +CLEANFILES += $(libqterminal_la_MOC) diff --git a/libgui/src/documentation-dockwidget.cc b/libgui/src/documentation-dockwidget.cc new file mode 100644 --- /dev/null +++ b/libgui/src/documentation-dockwidget.cc @@ -0,0 +1,50 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "documentation-dockwidget.h" + +documentation_dock_widget::documentation_dock_widget (QWidget *parent) + : QDockWidget (parent) +{ + setObjectName ("DocumentationDockWidget"); + setWindowTitle (tr ("Documentation")); + + connect (this, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_visibility_changed (bool))); + + _webinfo = new webinfo (this); + setWidget (_webinfo); +} + +void +documentation_dock_widget::handle_visibility_changed (bool visible) +{ + if (visible) + emit active_changed (true); +} + +void +documentation_dock_widget::closeEvent (QCloseEvent *event) +{ + emit active_changed (false); + QDockWidget::closeEvent (event); +} diff --git a/libgui/src/documentation-dockwidget.h b/libgui/src/documentation-dockwidget.h new file mode 100644 --- /dev/null +++ b/libgui/src/documentation-dockwidget.h @@ -0,0 +1,51 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef DOCUMENTATIONDOCKWIDGET_H +#define DOCUMENTATIONDOCKWIDGET_H + +#include +#include +#include "webinfo.h" + +class documentation_dock_widget : public QDockWidget +{ + Q_OBJECT +public: + documentation_dock_widget (QWidget *parent = 0); + +public slots: + /** Slot to steer changing visibility from outside. */ + void handle_visibility_changed (bool visible); + +signals: + /** Custom signal that tells if a user has clicked away that dock widget. */ + void active_changed (bool active); + +protected: + void closeEvent (QCloseEvent *event); + +private: + webinfo *_webinfo; +}; + +#endif // DOCUMENTATIONDOCKWIDGET_H diff --git a/libgui/src/files-dockwidget.cc b/libgui/src/files-dockwidget.cc new file mode 100644 --- /dev/null +++ b/libgui/src/files-dockwidget.cc @@ -0,0 +1,193 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "resource-manager.h" +#include "files-dockwidget.h" + +#include +#include +#include +#include +#include +#include + +files_dock_widget::files_dock_widget (QWidget *parent) + : QDockWidget (parent) +{ + setObjectName ("FilesDockWidget"); + setWindowTitle (tr ("Current Directory")); + setWidget (new QWidget (this)); + + // Create a toolbar + _navigation_tool_bar = new QToolBar ("", widget ()); + _navigation_tool_bar->setAllowedAreas (Qt::TopToolBarArea); + _navigation_tool_bar->setMovable (false); + _navigation_tool_bar->setIconSize (QSize (20, 20)); + + _directory_icon = QIcon(":/actions/icons/up.png"); + _directory_up_action = new QAction (_directory_icon, "", _navigation_tool_bar); + _directory_up_action->setStatusTip (tr ("Move up one directory.")); + + _last_current_directory = ""; + _current_directory = new QLineEdit (_navigation_tool_bar); + _current_directory->setStatusTip (tr ("Enter the path or filename.")); + + _navigation_tool_bar->addAction (_directory_up_action); + _navigation_tool_bar->addWidget (_current_directory); + connect (_directory_up_action, SIGNAL (triggered ()), this, + SLOT (do_up_directory ())); + + // TODO: Add other buttons for creating directories + + // Create the QFileSystemModel starting in the home directory + QString homePath = QDir::homePath (); + + _file_system_model = new QFileSystemModel (this); + _file_system_model->setFilter (QDir::NoDotAndDotDot | QDir::AllEntries); + QModelIndex rootPathIndex = _file_system_model->setRootPath (homePath); + + // Attach the model to the QTreeView and set the root index + _file_tree_view = new QTreeView (widget ()); + _file_tree_view->setModel (_file_system_model); + _file_tree_view->setRootIndex (rootPathIndex); + _file_tree_view->setSortingEnabled (true); + _file_tree_view->setAlternatingRowColors (true); + _file_tree_view->setAnimated (true); + _file_tree_view->setColumnHidden (1, true); + _file_tree_view->setColumnHidden (2, true); + _file_tree_view->setColumnHidden (3, true); + _file_tree_view->setStatusTip (tr ("Doubleclick a file to open it.")); + + _current_directory->setText(_file_system_model->fileInfo (rootPathIndex). + absoluteFilePath ()); + + connect (_file_tree_view, SIGNAL (doubleClicked (const QModelIndex &)), this, + SLOT (item_double_clicked (const QModelIndex &))); + + // Layout the widgets vertically with the toolbar on top + QVBoxLayout * + layout = new QVBoxLayout (); + layout->setSpacing (0); + layout->addWidget (_navigation_tool_bar); + layout->addWidget (_file_tree_view); + layout->setMargin (1); + widget ()->setLayout (layout); + // TODO: Add right-click contextual menus for copying, pasting, deleting files (and others) + + connect (_current_directory, SIGNAL (returnPressed ()), + this, SLOT (handle_directory_entered ())); + + QCompleter * + completer = new QCompleter (_file_system_model, this); + _current_directory->setCompleter (completer); + + connect (this, SIGNAL (visibilityChanged (bool)), + this, SLOT (handle_visibility_changed (bool))); + + setFocusProxy (_current_directory); +} + +void +files_dock_widget::item_double_clicked (const QModelIndex & index) +{ + // Retrieve the file info associated with the model index. + QFileInfo fileInfo = _file_system_model->fileInfo (index); + display_directory (fileInfo.absoluteFilePath ()); +} + +void +files_dock_widget::set_current_directory (QString currentDirectory) +{ + display_directory (currentDirectory); +} + +void +files_dock_widget::handle_directory_entered () +{ + display_directory (_current_directory->text ()); +} + +void +files_dock_widget::do_up_directory () +{ + QDir dir = QDir (_file_system_model->filePath (_file_tree_view->rootIndex ())); + dir.cdUp (); + display_directory (dir.absolutePath ()); +} + +void +files_dock_widget::display_directory (QString directory) +{ + QFileInfo fileInfo (directory); + if (fileInfo.exists ()) + { + if (fileInfo.isDir ()) + { + _file_tree_view->setRootIndex (_file_system_model-> + index (fileInfo.absoluteFilePath ())); + _file_system_model->setRootPath (fileInfo.absoluteFilePath ()); + _current_directory->setText (fileInfo.absoluteFilePath ()); + + if (_last_current_directory != fileInfo.absoluteFilePath ()) + { + emit displayed_directory_changed (fileInfo.absoluteFilePath ()); + } + + _last_current_directory = fileInfo.absoluteFilePath (); + } + else + { + if (QFile::exists (fileInfo.absoluteFilePath ())) + emit open_file (fileInfo.absoluteFilePath ()); + } + } +} + +void +files_dock_widget::notice_settings () +{ + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + _file_tree_view->setColumnHidden (0, !settings->value ("showFilenames").toBool ()); + _file_tree_view->setColumnHidden (1, !settings->value ("showFileSize").toBool ()); + _file_tree_view->setColumnHidden (2, !settings->value ("showFileType").toBool ()); + _file_tree_view->setColumnHidden (3, !settings->value ("showLastModified").toBool ()); + _file_tree_view->setAlternatingRowColors (settings->value ("useAlternatingRowColors").toBool ()); + //if (settings.value ("showHiddenFiles").toBool ()) + // TODO: React on option for hidden files. +} + +void +files_dock_widget::handle_visibility_changed (bool visible) +{ + if (visible) + emit active_changed (true); +} + +void +files_dock_widget::closeEvent (QCloseEvent *event) +{ + emit active_changed (false); + QDockWidget::closeEvent (event); +} diff --git a/libgui/src/files-dockwidget.h b/libgui/src/files-dockwidget.h new file mode 100644 --- /dev/null +++ b/libgui/src/files-dockwidget.h @@ -0,0 +1,107 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef FILESDOCKWIDGET_H +#define FILESDOCKWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/** + \class files_dock_widget + \brief Dock widget to display files in the current directory. + */ +class files_dock_widget : public QDockWidget +{ + Q_OBJECT +public: + /** Constructs a new files_dock_widget. */ + files_dock_widget (QWidget *parent = 0); + +public slots: + /** Slot for handling a change in directory via double click. */ + void item_double_clicked (const QModelIndex & index); + + /** Slot for handling the up-directory button in the toolbar. */ + void do_up_directory (); + + /** Sets the current directory being displayed. */ + void set_current_directory (QString currentDirectory); + + /** Accepts user input a the line edit for the current directory. */ + void handle_directory_entered (); + + void display_directory (QString directory); + + /** Tells the widget to react on changed settings. */ + void notice_settings (); + + /** Slot to steer changing visibility from outside. */ + void handle_visibility_changed (bool visible); + +signals: + /** Emitted, whenever the user requested to open a file. */ + void open_file (QString fileName); + + /** Emitted, whenever the currently displayed directory changed. */ + void displayed_directory_changed (QString directory); + + /** Custom signal that tells if a user has clicke away that dock widget. */ + void active_changed (bool active); + +protected: + void closeEvent (QCloseEvent *event); + +private: + // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc + + QString _last_current_directory; + + /** Toolbar for file and directory manipulation. */ + QToolBar * _navigation_tool_bar; + + /** Variables for the up-directory action. */ + QIcon _directory_icon; + QAction * _directory_up_action; + QToolButton * _up_directory_button; + + /** The file system model. */ + QFileSystemModel *_file_system_model; + + /** The file system view. */ + QTreeView * _file_tree_view; + QLineEdit * _current_directory; +}; + +#endif // FILESDOCKWIDGET_H diff --git a/libgui/src/history-dockwidget.cc b/libgui/src/history-dockwidget.cc new file mode 100644 --- /dev/null +++ b/libgui/src/history-dockwidget.cc @@ -0,0 +1,156 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "cmd-hist.h" + +#include "history-dockwidget.h" + +history_dock_widget::history_dock_widget (QWidget * parent) + : QDockWidget (parent), octave_event_observer () +{ + setObjectName ("HistoryDockWidget"); + construct (); +} + +void +history_dock_widget::event_accepted (octave_event *e) +{ + if (dynamic_cast (e)) + { + // Determine the client's (our) history length and the one of the server. + int clientHistoryLength = _history_model->rowCount (); + int serverHistoryLength = command_history::length (); + + // If were behind the server, iterate through all new entries and add + // them to our history. + if (clientHistoryLength < serverHistoryLength) + { + for (int i = clientHistoryLength; i < serverHistoryLength; i++) + { + _history_model->insertRow (0); + _history_model->setData (_history_model->index (0), + QString (command_history::get_entry (i).c_str ())); + } + } + } + + // Post a new update event in a given time. This prevents flooding the + // event queue. + _update_history_model_timer.start (); + delete e; +} + +void +history_dock_widget::event_reject (octave_event *e) +{ + delete e; +} + +void +history_dock_widget::construct () +{ + _history_model = new QStringListModel (); + _sort_filter_proxy_model.setSourceModel (_history_model); + _history_list_view = new QListView (this); + _history_list_view->setModel (&_sort_filter_proxy_model); + _history_list_view->setAlternatingRowColors (true); + _history_list_view->setEditTriggers (QAbstractItemView::NoEditTriggers); + _history_list_view->setStatusTip (tr ("Doubleclick a command to transfer it to the terminal.")); + _filter_line_edit = new QLineEdit (this); + _filter_line_edit->setStatusTip (tr ("Enter text to filter the command history.")); + QVBoxLayout *layout = new QVBoxLayout (); + + setWindowTitle (tr ("Command History")); + setWidget (new QWidget ()); + + layout->addWidget (_history_list_view); + layout->addWidget (_filter_line_edit); + layout->setMargin (2); + + widget ()->setLayout (layout); + + connect (_filter_line_edit, + SIGNAL (textEdited (QString)), + &_sort_filter_proxy_model, + SLOT (setFilterWildcard (QString))); + + connect (_history_list_view, + SIGNAL (doubleClicked (QModelIndex)), + this, + SLOT (handle_double_click (QModelIndex))); + + connect (this, + SIGNAL (visibilityChanged (bool)), + this, + SLOT (handle_visibility_changed (bool))); + + _update_history_model_timer.setInterval (200); + _update_history_model_timer.setSingleShot (true); + + connect (&_update_history_model_timer, + SIGNAL (timeout ()), + this, + SLOT (request_history_model_update ())); + + _update_history_model_timer.start (); + + setFocusProxy (_filter_line_edit); +} + +void +history_dock_widget::handle_double_click (QModelIndex modelIndex) +{ + emit command_double_clicked (modelIndex.data().toString()); +} + +void +history_dock_widget::handle_visibility_changed (bool visible) +{ + if (visible) + emit active_changed (true); +} + +void +history_dock_widget::request_history_model_update () +{ + octave_link::instance () + ->post_event (new octave_update_history_event (*this)); +} + +void +history_dock_widget::reset_model () +{ + _history_model->setStringList (QStringList ()); +} + +void +history_dock_widget::closeEvent (QCloseEvent *event) +{ + emit active_changed (false); + QDockWidget::closeEvent (event); +} diff --git a/libgui/src/history-dockwidget.h b/libgui/src/history-dockwidget.h new file mode 100644 --- /dev/null +++ b/libgui/src/history-dockwidget.h @@ -0,0 +1,75 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef HISTORYDOCKWIDGET_H +#define HISTORYDOCKWIDGET_H + +#include +#include +#include +#include +#include +#include + +#include "octave-link.h" +#include "octave-event-observer.h" + +class history_dock_widget : public QDockWidget, public octave_event_observer +{ +Q_OBJECT +public: + history_dock_widget (QWidget *parent = 0); + + void event_accepted (octave_event *e); + void event_reject (octave_event *e); + +public slots: + void handle_visibility_changed (bool visible); + void request_history_model_update (); + void reset_model (); + +signals: + void information (QString message); + + /** Emitted, whenever the user double-clicked a command in the history. */ + void command_double_clicked (QString command); + + /** Custom signal that tells if a user has clicked away that dock widget. */ + void active_changed (bool active); +protected: + void closeEvent (QCloseEvent *event); +private slots: + void handle_double_click (QModelIndex modelIndex); + +private: + void construct (); + QListView *_history_list_view; + QLineEdit *_filter_line_edit; + QSortFilterProxyModel _sort_filter_proxy_model; + + /** Stores the current history_model. */ + QStringListModel *_history_model; + + QTimer _update_history_model_timer; +}; + +#endif // HISTORYDOCKWIDGET_H diff --git a/libgui/src/icons/arrow_right.png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LV1ZtM@KXD3DX(I?C>7h z`-fTp&g=k!sDap4UmnME4dO>5I$4IvL>;R-niw1ycZSC*|7d#bKUa&&ouhy0J~;eXx`fi0GT*7)MdpU=c*8MlU}Y zn6{#-WaS+_M zBjl0>FJox+3@sU#J;jiHyY^wC;6QR^_jMyrtm&UMr=|g&ItR467-6RV>3Oen4UHMa zODQXwUBK|}p@5-p_S^KzuD=u8$44Gt?a!7mw}I&qtNvg>v^ot^osLYs!AmI@WDUz3 zU5aCtF9v)j`}dztuk6|~{OA1Za|O>0pj!PFs349`t%+*5V}xwd;H8z;hN|-2gArft z-iL<%*QwR(Hw{0s^7wqhYXeOG56mzi)VV@KTJchbe6vGr4exwgVdP-JW>$6mmDoN# z^ze#czTve20JOTt#R!6su2&jT%95<1z0u|9Da-B?70Tc4JC$C&ZtKuP%is8ag69TM zL5zY?jBCi&D_&apMb6Naa@kdiICQv(9Uc5SwdT^ROAodUE+o7rfJjxpI!ZR<;H8yS zO%9PYyni%g^gsc}G5@aX+|XOPe_6E9@R|S?Ax7wINpN#ll4GYrJ}bo(Mnn8>_MXgi ztiSz4Z|j>sC3sE%QBX%2A5b=4n4~avhA$2tMuv-p)Y{88o!GW?!OG_eAZQ@G{a#4_ zp$Ybu_gKe~=e~R9hTg>ro)f^v!kHt=Dq|ROjt{z>>+TroS@Qm3ht~vfa;@7d1I5+D ob;W-7qAPD4>1kdx diff --git a/libgui/src/icons/bookmark.png b/libgui/src/icons/bookmark.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5e761587198608815a4625f26923e4c2c59d5ed1 GIT binary patch literal 690 zc$@*U0!{siP)5r00004XF*Lt006JZ zHwB960000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!L`g(JRCwBA zV88=DRWZzeU(PTepBjJwV#Fo!p^`y>iJ$%c@81jzzux>*l$^-$0h>C20Aj*r!2kaY z1+2RA0&IF(0)PK76yQ<^5I{H$U|?g4XLHbF;Br!C_{Yi=k4qUq0AV%YZ5cxXv#PWL zBj;lVM()Q99O?=RPntv<{{7o6fUXuGfEfREG0gw_k3r!t(64_v*&P0H^D}_h+!2-x z%pxzrivGNmV|YH}0K?zE3=H32d}Lr?=lJmP{-+B-uRQ<=AjZF)4D*8l(j07*qoM6N<$f~cq`1poj5 diff --git a/libgui/src/icons/bp_next.png b/libgui/src/icons/bp_next.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..122ea66f099371b3272cae63812cdac415557c46 GIT binary patch literal 1173 zc$@*11Zw+Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2iyn* z5gr0Dkv-M`00b3DL_t(o!_AgmXj^3%$A53m$#=4zHC5bS8!EUs#h-uRp$=+|lvAQvC-hM`iP-lOiQZlQ|-IEe9 zbvoO;%49SZ0^Tm`B@{wXP6E9Zm{o7ZQ&2`I>t?0h)2wU`NxAURi$7oa{CMh@_q#u> z6~MY#ZI^|qaqRZs-R*q(*%P059(`v2$Kxlv2WkPZQm$F$3^QqB8b~@VulMnIM@MM< zWOrz*MWu4pdtjf_8ikmahfumo9PgM+1fXEwBn^y_?GWcKWftJTG_cWpHZN|N?9U(jO zs|pLSK%WIkfWw2OHxfPjC9&(*PrNV`9N~nH=H|Lz3)an#Ox&2N>Rx3{e)bN+3L6{PkF=cBamLs~!q{?UAcG%I1E|&yfjafNY`c zb_?u<`bvNsaOBgB!ThyfG17Wu^Mzz5p_>8;fsDY3Acvsn>SiJ93h4pMgxLxB`|8Sh zN#@hYG;np=qC7Cz6PKT3K1H|H703wBZfdV{) zKv+2*_A9*A{1iUykWIquC5ZjSm=L^K6t8#;%Z>35yMuN0j6ZjTrmP8(Nm!a=Op-Z% z_;fh2^RuA*s6!xYw;}R7EX^?_$-Hu>c=a#gb_a}&Wi5sN=S5geFeKUe;P7DBy!W-d nwh=cBCX7|~17q8X|1aV{8S+Raw4Al<00000NkvXXu0mjf5!)@f diff --git a/libgui/src/icons/bp_prev.png b/libgui/src/icons/bp_prev.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a183a08ec073d4390d4f4d4a3416c184daf1326f GIT binary patch literal 1159 zc$@);1bF+2P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2iyn* z5gs-WCCOs|00aj~L_t(o!_Ai4PaJg=$3MRr_69DyxD@OflqOta8){*F&?p6oCWf>P zwJ%hO0b@#^jMit<^bcq?u`k=0cxj_gCVle7WFhTC6LpcQH3Ds2l#77i(q(Tm^PBNu z2G|gxEG)*8octz}ncw-&IcGlSCn%9wmbIhz$|#`;ApnRzoJ<{_82*K8ghEEAfG5gF{;n;rmY^5-D~tTv_P`06#wG_^Dm-zx!r zVL*1vV&T{4_AUbe=*GsFh0Ow)%-#vmB)HWA5rrkd0?Q(`u!jQ17NMo)-!ieTWc>cj z&ILrF9yky5072(=@`@1GfeRzEB*K0O`8JBMgD)C>;=^~=;Zq1l0YkvC@G4g@JXbhqCe8)1+RNO zu(x2X3=qFtMLc@#(=(Peu$_I2Az_aVncOq{4h3OjDQOxv-E`h1UEt^u`i5qhl`+!-{b#N&>{)8)7Tjl!*gbC=F zj0(&AO_T254bwFNTrCoCQ~;N z>If+JF!=)*6V;KAi$d`rj7BA`x28CMYl@!0Q;!9o?s$df{%{age4!{DtA7SW zxgFTjVP*=n?Aq9MDK>dkLr0N1yBFYyNZok1>-DKSd?|Bu*SA5L3#fp(c~(+MJ`)Pl zSXlNyO49MgqR#_c+0AoZk4l59HBZvr7=bbsZV&V4@)8{#AH>E>Hw!kg_DiuPwTzSV zlU$zo4)QC2o$^4b#_@JUXsU~M7G}8o>-UgPqbUjt|Cs=Q_KPtIe7&;Fgs$`LYOVjb Z_78p7$%OXBiSPgb002ovPDHLkV1kq945a`7 diff --git a/libgui/src/icons/bp_rm_all.png b/libgui/src/icons/bp_rm_all.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7f1731df9a0b78e661e21c0597ff862071222b9b GIT binary patch literal 803 zc$@(v1Kj+HP)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FZT01FZU(%pXi00007bV*G`2iyn* z5h4tw+G#ET00N^)L_t(o!|j$&NRwe4$3Ks3t(cS1B!oIx*f2s6cI>YmDu_Vx60vjB zbC+)7v4h>Un}h@z1d{?G>*^ux(m?|?NQc>MZTkM%eD`$Ndi(D_;N~p9yaMc3z1SHgs|a>RFZgCE0NL~=sJbd`nCdwS5mEpk{7>QQV^gm57LKFYspI zJ#ZE1l<-J^+_wX0nzQ=aD0zaP1SS+5;306U;Rp)rnmzBj5h!@ka$WfpaHnediGU9c z6Il4N>Ns@v2&yWd&mIU51Mh%qyGslRc<$~oynm5c>6d~R9q_CUlM7&4v;%`cFA!C? zb3sTa;X)9u)WAo)8Bs@=c(XyI$+Fu%pM}{Bm=@i@$3!X_b(mEqk9;{p%kQn7eak?< zfETWv(1jJZ19N?2!%>G>6?8~1!ir{>or9;R;hF1qfg5ih6=E=vN=9w7GV0*~-_M+2 z>SwXjwGjy+a1%hU!>smzb16jZY#DVvyg8u@MQyX%)FHjJ3l|kQE!K`%MLoTaT}#sx zd>K}@obZU{$*d03fm|W836o0=;mWLXz9$fXba{LRerOFVS7!Cr*AYkvmEc@(V{;dN zIRs&=&a7rL01%6=V5+)=_6}p7G9EBtVB)qPIYZ7jARFZI0LRrBL3HLZ^N$8i5mvEhb hB?;#_*0KI~{RQ@;iH5@x4O0LB002ovPDHLkV1f(iTiyTw diff --git a/libgui/src/icons/bp_toggle.png b/libgui/src/icons/bp_toggle.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7d7e2e3ad2b797f3077b65989dcd8ccfb4dcbed8 GIT binary patch literal 2608 zc$@(+3eWY4P)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FZT01FZU(%pXi00007bV*G`2iyn* z5hMl^RVTIp012>3L_t(o!=0C1Y+ToI$A5Fbc9+XtE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)JQ8FhMt?t z(9#@y*(vPWaghE%!(?ZHoEoU_dGi6f-+GAKo#`}-&@93p5t{q^wS%D$rGo}>C=y}I zt+!$XgN%OudB$gFqls|*WOQYVBQ*y=N*{WQK$Ds=xOnJ4J5DAr4TF&*-9&m!GBO-| zyz?lL#@eOMA&JK|O`~VsVnowW@|jEo6XEf2=(Lkgrwp^(&611^4s~{tW3y55)Klng zH?@lwv(xWqSh|zq-X4+iAFs#Xq;|xU@+Smqk57C4og3G$_-(85q`=|&Af5GfuR8O4 z=Z0Uo6Wt0HtL+N`OdxI;{4N@y#pR;JZdXNVX|zP646@sqxO_QUS{g@}EyI(R{ zsqX6flUvv6=)we{U^t1-ST3U zr{lQ_G%JB%mo8w@tynEqn?*FuqD0e_XmZ8@(?kpt5^=*wsCYb%B9Y=DVj#v?YGlkS9fsa`pOXiGRO{n1}T!1HN|jVb-!uJbZgx;yKT`un>5{)o|0@! zMbnZI-2sv$nx-R~j))rc$wlqNl&j?;jyDX3?O`2ljM# z|7lfs_tS!Q%AxBgEdX|%ZaqoXiAUC%4uPQ18#XjCWBRF3Ojk;*i0C4k711v*(6YE{)4FrCguj|+~9ZgREfd2*~QhUz%`(AAT0000< KMNUMnLSTaRrTcFH diff --git a/libgui/src/icons/db_cont.png b/libgui/src/icons/db_cont.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..532f4b4b8aa18a19aa29e550fe839c48e5d60689 GIT binary patch literal 1730 zc$@*k20i(SP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyn* z5(OA%gRyS_000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000IZNklu@8poY!^61oCcO8lxBY^dU$iV8003JSzEBt- zY>*ZZ0vQGs1A9Hpe(vd|&48gK!U6$k2||EWKmeo-G6X6Bh6O>uvCO3fuq+d4gD7=| z5XCN$Hpn0-yO<4COa@ugSXzL9X&~)lP$5bnx(J|xAOgj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A+;d+76#@|gRRiH0JmCkACjRdU|9hSg2{KST56D3AY;dzDTtZvE*b^eb zFhK;tECVYHb_6QnnkQT`fQs@E>Qo0xDGVu)QlXSUDTyH^Qc0AQ7)qf8#8xl=-#;Dy Y8{FuC0-DK(B>(^b07*qoM6N<$g1dnoYXATM diff --git a/libgui/src/icons/db_step.png b/libgui/src/icons/db_step.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..671e3299121eb8de50d6e0564084e05904e48a87 GIT binary patch literal 1251 zc$@*_1RVQ`P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyn* z5&;=>=tTVh000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000C&Nkl8S%Yi#H z-}(M#KJz`wd(Z7`n%msW^)K<7zHw0}Vx(NV;_VteguLDZ}rwphN zv;%UWV~~XqE{4&U-mk9%M)Yds=vC0_H7EsIfB zL2{WJ7J^i8ol9U15(1J=tg96z*tZb*csqr2=g!#s5CZ=cbzSk#Rye29_6$8 zAx4i~@}6&Ma-gvxhkW}bB7)HhtpyQP0wu=X5`c30(LTIZzLhgrT?CcgbkFqW8^$O zJkP$Ku0`H6|JrCCq6UcKY+A2KzU4j#m#I9H;bVxh`o5Gd<5v6h=kNa!UZFP%;7KY?|`6z zxxNBi1WK6z=Q7tl&Cm9#=4!P`xd0N!k6T}DpEe11uUf~_;r+P7duZzb(@1(dodYU> z9|L2cGMJ8IEhH@reX@-UCr`aKZ4#b%;9<@@wv6(|BF`N-OxvSi;%xQjfNBLu(o4fQ zpoO7bA9MWBPn$aX3cV91qQF{$90UQl@Y)kPa1lf^AdaD_31(@b|IVivKEd9>@4zS7 z73lz}0%PEE;O8>5YbVDK9qPSt@@bRsuKCT#Fl$a9W2b~Xvv3(G2bd~^5x(5au^k`q z`#|xv&c4E?S~8)U>a%=HVFY+#=rCUl?1uy(o`o;Zp}2i3Cx0pSE`PW1%0wJc*Qer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)=Nxik%z0%VKU0!^U2zQ$f$Agb6KOH`pKpwWP>EpQI~{+-6jiPc+M z_R1F2`*O;Is=}&LP9^{}W5jxo#)$O$&~BqyhBTX)B#~4Eza$Zt0%%dxCwY#F(45Z! zn9pXEA&^xSiT9{#op40~A&{gg7(=$igyjm{Y^9AxEp-Sqy+>kXT9){#VskzxiLq8< zcb6CfW;SC~RXkXdi2ofRNf41b>B^Fq g|1-J=_}>Hk1pvvDW}m?j=>Px#07*qoM6N<$f@s&a<^TWy diff --git a/libgui/src/icons/editcopy.png b/libgui/src/icons/editcopy.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8df8201ec9748822200f737fc52eb925382b0809 GIT binary patch literal 1075 zc$@(<1kC%1P)F4XY$#51Tv%gLs5t!G=w?gLnvd05%ymjJ$&pBL##A z$}rOxw=c2NZJ9WZ9ox98>aei8V>_M8ke;%R&d$fFREnok zb7_jbfuOa9QW{z-+~$*W&OOholu9K_+!`IgU@&;QP$>M6&1M&s(y?=hMi4}V+t!p$ z&*AaoZ@vTY#hm~EKuTpusSpIgjq?n{xRXDnR0;sD1=!u)Wov6|831{uR1N?et?uUK z-KC`Cc{ByU7~|P&Hn+b1-ulMI`x_4*e*S4bpR4%3-`LvP{+2Q0Ev3|*oWITx0PyJ1 zmtP$m{Px+>($c&6d_FfnpJw5N^Yae&_xEqD>%9P0S64Q-x3@kD0tuxQdc8h?Q9b+p z9;B3SCVB{Pc=*@f0B#gmSpU1$__Y9R+p?6>Fbw0`07(OcUIYMCtJPAw-5zE#nYlQj zg`JgX2F89E0QkON_kF*~Iggz;GJ@90Sm-kX2!i0$b=_mm`BbX)#P`uhCt?~D6@iUY zs~pF63g=Mgzw6mzoHI3#3x1=(mN1Ma(^TV8jAAj$;z0SG}^bibA0P#uyMa(8M5&_jx@! zoB&|V0An1B3ybi5uhnX`{t!Yi07$3P^Ut6E`e!V_ix)>n{eC|R&KO57mjmYv;oA~L zt2DqE0~Z{Eb1=q00D|EVoo*Lrt=7Q1xHx5w zvxDX3<(v#8h%}^9;Eay~2?5Rp0K)L!A=>RW{DyyCtJNB=>sD>sa*9sTtksU)X0v(R z?RJle$S0!MH{L55==FMyhVR!lKitd>g8%?QN{Mc#Lw?O`SE`j0$9Bq=ZMo(v(=1oY zcEk58gTcTD&?2H?T%ha56#yc-*xTFtT}rulczAeZS*GQ>rDC;ODSDn)?)7>efHn~& ta#*-h0ss&~yrZ>dM07?($)Cq2#(#k4+4%v4qPzeA002ovPDHLkV1jDD`{Doq diff --git a/libgui/src/icons/editcut.png b/libgui/src/icons/editcut.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..514bd97c273a2ab2f85222a0113d5aff45297b5b GIT binary patch literal 1379 zc$@)a1)TbcP)F7{{M;+TIIo?=3_a_I3=hFkLA)3Wx)$#$*y*%rX;$FTyW<8RXoXCp(O4421;y6N%A;+qt$3xmIapXw_*z^53@;g0c6M~!vsf&@m%LI^ z4gh3!lIQuQji*oF@3eMct3-EP0z(9qD?+}tc#+uO0dt!>I+FqFjw zAOd7TadC0o$sbQnIGs-P`~5gEF@X+;0|)y1(PFXK5)%`X;s!A52FtQ5Hf-2%;`}+w zgWEP64i68bdwd*6Tw_?bckc;~<6?$TDV3S2DJiSeDz!c`PG&3dpF{{za~!u~)5eV- zRc+t?s*+{l^5)G@xONRBSHCxUaNoYBE6rEBT<)=EpU?M)D2kJj->X!rj2HD;dzDJ1 z$?Nm>E0ro;AP{K1)!XxdBuT-?0?a@V0MKS-XTPznYFoA0-e*W#Rs^bb6%g=wVbAW} z;IKPD3Wq)7v}hLtqCFT2x)_Gh5`fk2aZk(Wn5!ln4&MQQw3qYpPKx66)t+{=x;FAiP5<{Uj!UIWRp2gW(7j#RCO}1@PUWL#KW?cI*oPV0oU; z)d_-`Q*%ohmd)||{TjdD4}_3x0JsDIKq;k#`KHxApKlZqV@ttYQA&jsX7i;aO_FiU z?LL0(ddr(LE&(A#4gg6E!(?fAO=$wlYzziN#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_MAvD?9k5dyYJK%zLESKz)O=7iv8Ji&qHE20mXN&8$JA-k`o> z0AyL-0VrBIX~o|}n9&j5OCRHEbqAN01_)6#J`4?# zY^vf#!3*jIR51lrL#_8Px&Tnql7&*!MaVT~bMrF$?@lpVt>A{MB%_0%hBX5g6hkp9 z1gqOn5llM)EKBi<5EOD-NUV9!pZ(`~W!JOVNR`AHttPAsbu0)d%M^Esx2?fIM-oyB zk(K~rZE`Mrj^FHkf%ws3;wJbofCSJgcyXn3EqaBmKEBhmT(>R&Z8w@imc1w+EID@n z^S7k$c)UTzCXzG-RYU+&CMFY96zx$0rnWYKLO_acC#}vWikjo#&|h&rM^#wLglzXW z`Oe`Zgy4&Y?;K4rLND)>6|ibqrx3N= zf`Kxl%l6yK3EGKSmfQwzyxL5AFi_lDmKi7?9?Q%~sd)Ftazg;t*w+G3q_5FV!gd+1 zEJ;-iEA*oKV|Ptc({;+w;Y20NvkcV;6UEeF8lffSh(pD-<@Eo{fDz-e*WUd5tJ{(& z8MC%tm7fOAj6Aq>%O`agX3_r&fOSG3J3o>A4zf25Mpz-ytsWmogzK}(-ix@X~9r$$i}FD@*6I6XZ*)q0fv7xf+NY*jU-p8x;=07*qoM6N<$g1$ZV AnE(I) diff --git a/libgui/src/icons/filenew.png b/libgui/src/icons/filenew.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4828b63375b5067b8901ecf061bb65375cafe593 GIT binary patch literal 410 zc$@*60cHM)P)AUJ+VW{ zXXzyn5dk8aak{x8loKS3_bhz}LByAzrl|(tC5eFaI1Nz(s3eRaBuELs3vMOKEQe=9 z6{uEX2;eN}=yIe1^tY`ftU#phf{}!mRzL^365^5yWFX1_BWm~b5<#Ty0)5{1_tEy! zMnpA$OmgeQ^ZGnX9Yh*P_MeF}igyZNt*MtNBTmc0C6EcTCD-G6yIcWHuLDFoB&wFS za2G_PyIq7marQ`+V>|&{He3M!f4%>$0+uc;@68VZJRwC#wC9H|qfDYJAY2X1^ZeG< zzxks-D^}Yx7hql2A7*ZuOGo!x;}H>v=%WlRtJb^h3BCK`LD4@z3jhEB07*qoM6N<$ Ef=E%W8UO$Q diff --git a/libgui/src/icons/fileopen.png b/libgui/src/icons/fileopen.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e3528f02c939db2a07723980076767c367605454 GIT binary patch literal 1365 zc$@)M1*-aqP)em6veIk|M#5#Kew(? zRjyae&d&N%Q&Y7#j%T(^PuE4<&WY;euH}_%_YFIDeXw)O#Ovn25SX2v^=q|SEso=v zTCG;M*6yg)YP*avH&?6Gok0-X7)9lJISi)-FYKgBY?X4!@Y#3gP98mU>m$K9fTvEK zx~X2TKNg1Jo=T;1^TC4$Z;Ya-9t6R35Coy```3JcN zRKS=%byO6q*MWeD5XUhh4r2^T4rB!kfB{uNu0sZlG5r$ci&dmZb*4E1Pm4JOoco^% zj2y3;*V`$^fB@DCz7bsR!tn^Wf_6`Q=4xTD2}7Q45pa?dP!*gL@IXYzCor6WK_Y{$ z7#wd!u&Q_p&bqurx=8}P3=D^=_Oqd?p!w=m6z2rzz=|LueKDqX6D8QV29%x%MIp0- zIEx{-qg7=kb(<$Joa(_6^j%;I5elT41r>||&p1O4?5l%P*ga{_6Wky)F! zTm!y=rLG`ub1slRKoRRX!C6OU9k#HcZ=jng%c~i>NgGZLzZ>3|^3^L@mge9#7hx6RPbI0zG)}w>*@BphYF>3N2=-Pzx4M;?AgW}Emw1FWJo@q7{ zU=c`w3NT5Y{)s{14U2HSOei2uQ70G`d=wAJ>>4&a(`=^u8;ykmd>TkqwY-t@!yvFR zh9C&=yk*yCMPFpwU*O` zg@yCYpS!LV1&iPO(w=X}(n`b_Bl2+&n0MAAuma2jk;zGvC!&Z_skEjD(=>H)9G{z; zn>+o{haaB)_Uo^{KL69t^W1*?>H2{!TNjtpwh2mQKUseF!pleB>wPzpz?o)KfM54F z8Y_Mf+;(Mg@z;|lPP~8k@ZsBc@7YsdU0r2)d6`zLb*|g(e%@}kKe5)Ho|&0x&dkiD z$BrN8t~>82n=q(9yd?c2HU-g~^MyB~k_&tHE0e(vK}z8p1ftle;& X7MP!rkhXXe00000NkvXXu0mjfYNeO3 diff --git a/libgui/src/icons/filesave.png b/libgui/src/icons/filesave.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..82db5055699c6c9e300a5bc6cc3e7dd936859a00 GIT binary patch literal 1440 zc$@*C1z-A!P)Z z&5vA16~%wI>b-7vkBtd2AWvc^4#*IYk?{&5F+q{SB7AHRk~c{FB`jcpvS0%v5yY1N zz!3@(5!ixkVSz{pIM|K?NZ^bCd-}asb?;?S^?JI;v{%jk-N-p10;;-vUegp*jm2Vth>+Fj`ouf$+}awzGatJ^R>!>z z9AjL2UI92MCHk%hcT61-xbVzVTLTaQGsE36GgJ-dh}oskW`>&L?hH9|*ri7zK@cHj z#VG)+j`0wH5uv+dYM2?fZ{67%z*A43C#&M-M-r^$wFIE5Wng!bDk){o?w;KmKuVdM zOJb^u>Lv!vmJFyGS?$rxf)EM=|IY)ey3{9UC9Cr8op-keaPIs$a#qZ(N}y{6Zry}c ztE@&+=V1>oRShmUWkFRDX*v7E_On0))O^`*2w_cvFrJJIsvS~Foc`d4s|*`vftn%&vSuVqQ4?YeAOQ)1uo5Cts9a%h6~xhuGR%$GG^l3W zL4s^v3&0Q&+O`1^1nBz#cL+i1y~0LG&eyJ4VI#)KbUG>EaI9u8E*m7sMFJ7QqyTAR z!&hElw%1sPZ%|pPx(AxIrVRu{u{2Hd?EZdtW5DJ62sfFlwJwX>8HDJ9H`T%~qY5I`CROcgEE zEN1|eg>M4`4rX|jz|0tip04jIAV;;hKj+La4CI{GvM*AW9hRwLAyg(DGcWmXssrv$ zsDp!(bEfNi`o71_&)yC_nyPN zR6lp4>$+t}qkqO@N|_-gYSkjfNJ;~_{G`Zn05RwE-MjyI@7q$^5JHgM-QAlvu3!Ja zd_I?&St#p)NC?XxjIpz|-OItjLDL`J`($7BFA|l+c6Ls_y!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X`0qp znA&XQpac|xgyNa6oiV)kfSC!PTrS&nYrELCwV&ReUS8Y1i+%gv=hdA%>F8Ka94Ckf zS(cJkQ_?iWIY*XdwQHKDHFE_!BAy_gP_QNva>k}NqNkqvQ)TP6Z3{PV>8HE9o0qn4 z=kSrEY~Q|vN>g6rS(?(dW-Xt5@?YXOVeQ&3P$kQ<8GFg8YOvOlW$BD03?Y!ERiZd1 zOq~n<{FlE*pILkVsLPf=U;dMRYO`Gzv9I=j*X8;y*=xBpl3Zn z6@x)FP_0&LEUGHDNH}XP&UrHD$Xlc#iXxoL@cALdnBMMFn&hsiC346p>kLE!G-iZ8YV3stwNAK#q=%#sdRy zt$_Sck|$}-R%2u3Nz>832h=|W3Z}n&SO5S307*qoM6N<$f_1>8jQ{`u diff --git a/libgui/src/icons/find.png b/libgui/src/icons/find.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a3e5175b9098d3ccb097e5c633beb1f10fe22ca9 GIT binary patch literal 1777 zc$@+81`hd&P)~85REq%Lf@44KU(|gXdKjsY1iT+2H@cZ-0 z^ZR~3`R14Bmq!vpa4So`rS7)@ZUg+^0KBmGK;_-b%14$gUeY_upR@U^?#=S&Y+kZ> zN$=gu%12(K`Gi7K==wCxADqGN zw7>6kx!zS(bq9c^X}e<4=)HPOUr|<3j@@n}CB;o35Fi?h(bLn-hK)5JDT?yFjgLOu zbJGM|igNhR$B!+os8~+R`4$Y*BsdYm<+PKXoyGKY94$1tA~%2T3ZE|>fOsta+|}M* zoGurV1iiieL}Oh{P6n~aG8GleIobHvrH^dbcoX@TG%?R%5bKNm9|{IvJUn z%*o9qJ1Ya9*8>8Ql9CB)8m$-3qlH3fp%8)2%Y-$Jq@-jJ;PZOO&dOj;ZY~*_ndosH zB}oO7l`kDUwE8O(2nK^soo)U*hH22=-im)lHY3-r(%&~gvYJe?s^Uw}z~k{SG(5zD z!fyf4*Vl{B<3+Yu>F8)DtZ9U`FgY{*czr(F+gowF-5mSV8_ZiU|0&?qmjJ4(tGB6Y z$~x_On00Hvi@*dS={2Pi5kPSW)_6TxxDMn@?wDduEj zBipub$M2tkMYb@l>j=QRpYEjiXX!Wu<#?aPTkBZhyAy)bV$C?ae>p z#DxQTKZd zr&(LN9+yQyG9{*UosJ7_abO2Oi}Z28>}N%v&ZJ=w!-|13s_uMr#{$7Z$B({m+;Fsl$|RZq{An9XV< zI6ltk@HJ-pXVE>`L%JsuRdu7PDa@ic)Gd48tiBCJX(= z$dW{|I~mzxK}}UT{pvaV`F`{y4Ov*k(CBa|8jmMT(~R`@_nk8g;~9WJAn;;N&dfVy zSym=PlU7++Qq*Ks^5^?WPE~O!E|OA`X@31YvLvz4UyMkY7>41r3L%7$;JO?}2ooU$ z0+W&6F^q&ksxJ)@H9;oc)7{-JA?*RecDubZ7K;r4IGxU)w70hv0LcQe4VgOxrZd%- zhTUNUNif_qikUDG!u+?F1VRWQ>$=`MbZy9V*d2ruVZz}s%N|@xLN|zL5ypl_aSSVT z4|GQnoHb4JEz>lc{$mahi^T>^(`+(L^DP8ty9c_Xj$wtdp;01QgoJLe?7^jk!(qaS zFb=zep=(2?uIs%L;P-euuN>I7e^tZ&Q>5j2$yBqs+BraXR~O!lG}b<|#;AF$=4Hb$ zwhAG>v`}s=Ns?R^i)CN^EA@}R{bGYUOylOZ0k#gqfIb>u4LRt=-WuJ)PJpgwSqgeglMRvsw4m z)$LldsA!STDqC%?B!y@+VqCa*VXCgK?zpCD`-Bi3U)YB8=gx+!z5Ow{4R9OaRs;MCoH_~0 Tjwl_{00000NkvXXu0mjf+=+ts diff --git a/libgui/src/icons/help_index.png b/libgui/src/icons/help_index.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cf0fd38174d6901460943a4c7e66039eb95afaae GIT binary patch literal 22733 zc$@$_K*hg_P)Z?y+TS{%Fy3+F~Kw=kjQWYVa{8~y3tc)9EVAOLUyTm?{WLq9gI-OW9jvOI52@y@|( zb6u-{Tx(w;@{5K-AH>qh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3kd@yJgGOqoboBl%QU#qfjV8V;Xc#M_XH~65A$#;2h8F*a6)zaQ^w{Vb61WZ~M`Y zAI*K}gCF?2#toMJ0B?UdP&2_vA^6;Fx81sR>(;w}(9zzGcr=D^Bm~nkQLa>w%jHoh z7C{J*&1A4@)hhJ%_G0_??KpYz6fV5rd?XU_zkT$vpZsp);>!ehXP|L9IKere`ODjH z|L(W`^;`FKc6J~Zjlnbwn5Kzhsf5|tIplJA00b>9Dz4Dc(TPVMdkmA4lX&+f7sIlw ze}3e#pIiYf6X2bM#_8ZBfcdX{`O6P}^IPAzud|~A(P&I*B2t2UK98yCDa_8z0#c%_ ztqp6}_M;`6#e+ZicjOBNocpd#Rz8>iIIz42c&DL30s#PD`SMpDEEY=D8*aGaIzow7 zDwRPgP$(1^bdj>zEZSOI;5utjtL?|(Lr1WA^QCY-cMMo2z&jC3Ng(dH+Pz2F6l*?rxXn@h&)P&Zy77V!SK^eufJ9j=cF){H~V3`2#RB!;Np(>hs z@4D-*$E($oXZyg5L7BPNI3(}IZ~+F=48uS!moI+)=9_LD930%+ zxXAJ*@STkY2?hboKKkgR&wl39pZ*6zNG{uwh3ENjT^FDP`}ZH1{P@Q|cEj%7yT7;e z0?Pz==R-o}6AS{Fdghs@_k8-(pZbS-tvcDWvImA~V*3+M9RBpDK6%5z7hd>|e2E~$ z@)Gdt0V$=NB7_J4V&A@fSG{-h#Kc75XFq%VF59-Bky8GLddFn~{2D<@ zIYS8H0Q{3fC;gK{Cyya;AW12Ip(f!n0e;OOrJN^(_)t~O4uCViXyi9=)--~a@y^8m Y1F4`rfN3>^-~a#s07*qoM6N<$f@plx0{{R3 diff --git a/libgui/src/icons/icons_license b/libgui/src/icons/icons_license new file mode 100644 --- /dev/null +++ b/libgui/src/icons/icons_license @@ -0,0 +1,323 @@ +Icons license for: chat.png help_index.png terminal.png +jabber_protocol.png + +by http://www.everaldo.com/ on 17.07.2011: + +The Crystal Project are released under LGPL. GNU General Public License. + +This License Agreement applies to any software library or other program +which contains a notice placed by the copyright holder or other +authorized party saying it may be distributed under the terms of this +Lesser General Public License (also called "this License"). Each +licensee is addressed as "you". + +A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which +has been distributed under these terms. A "work based on the Library" +means either the Library or any derivative work under copyright law: +that is to say, a work containing the Library or a portion of it, either +verbatim or with modifications and/or translated straightforwardly into +another language. (Hereinafter, translation is included without +limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making +modifications to it. For a library, complete source code means all the +source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and +installation of the library. + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of running +a program using the Library is not restricted, and output from such a +program is covered only if its contents constitute a work based on the +Library (independent of the use of the Library in a tool for writing +it). Whether that is true depends on what the Library does and what the +program that uses the Library does. + +You may copy and distribute verbatim copies of the Library's complete +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the notices +that refer to this License and to the absence of any warranty; and +distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + +You may modify your copy or copies of the Library or any portion of it, +thus forming a work based on the Library, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that +you also meet all of these conditions: + +The modified work must itself be a software library. You must cause the +files modified to carry prominent notices stating that you changed the +files and the date of any change. You must cause the whole of the work +to be licensed at no charge to all third parties under the terms of this +License. If a facility in the modified Library refers to a function or a +table of data to be supplied by an application program that uses the +facility, other than as an argument passed when the facility is invoked, +then you must make a good faith effort to ensure that, in the event an +application does not supply such function or table, the facility still +operates, and performs whatever part of its purpose remains meaningful. +(For example, a function in a library to compute square roots has a +purpose that is entirely well-defined independent of the application. +Therefore, Subsection 2d requires that any application-supplied function +or table used by this function must be optional: if the application does +not supply it, the square root function must still compute square +roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, and +can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based on +the Library, the distribution of the whole must be on the terms of this +License, whose permissions for other licensees extend to the entire +whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of a +storage or distribution medium does not bring the other work under the +scope of this License. + +You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so that +they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in these +notices. + +Once this change is made in a given copy, it is irreversible for that +copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the +Library into a program that is not a library. + +You may copy and distribute the Library (or a portion or derivative of +it, under Section 2) in object code or executable form under the terms +of Sections 1 and 2 above provided that you accompany it with the +complete corresponding machine-readable source code, which must be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source +code from the same place satisfies the requirement to distribute the +source code, even though third parties are not compelled to copy the +source along with the object code. + +A program that contains no derivative of any portion of the Library, but +is designed to work with the Library by being compiled or linked with +it, is called a "work that uses the Library". Such a work, in isolation, +is not a derivative work of the Library, and therefore falls outside the +scope of this License. + +However, linking a "work that uses the Library" with the Library creates +an executable that is a derivative of the Library (because it contains +portions of the Library), rather than a "work that uses the library". +The executable is therefore covered by this License. Section 6 states +terms for distribution of such executables. When a "work that uses the +Library" uses material from a header file that is part of the Library, +the object code for the work may be a derivative work of the Library +even though the source code is not. Whether this is true is especially +significant if the work can be linked without the Library, or if the +work is itself a library. The threshold for this to be true is not +precisely defined by law. + +If such an object file uses only numerical parameters, data structure +layouts and accessors, and small macros and small inline functions (ten +lines or less in length), then the use of the object file is +unrestricted, regardless of whether it is legally a derivative work. +(Executables containing this object code plus portions of the Library +will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, whether +or not they are linked directly with the Library itself. + +As an exception to the Sections above, you may also combine or link a +"work that uses the Library" with the Library to produce a work +containing portions of the Library, and distribute that work under terms +of your choice, provided that the terms permit modification of the work +for the customer's own use and reverse engineering for debugging such +modifications. + +You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work during +execution displays copyright notices, you must include the copyright +notice for the Library among them, as well as a reference directing the +user to the copy of this License. Also, you must do one of these things: + +Accompany the work with the complete corresponding machine-readable +source code for the Library including whatever changes were used in the +work (which must be distributed under Sections 1 and 2 above); and, if +the work is an executable linked with the Library, with the complete +machine-readable "work that uses the Library", as object code and/or +source code, so that the user can modify the Library and then relink to +produce a modified executable containing the modified Library. (It is +understood that the user who changes the contents of definitions files +in the Library will not necessarily be able to recompile the application +to use the modified definitions.) . Use a suitable shared library +mechanism for linking with the Library. A suitable mechanism is one that +(1) uses at run time a copy of the library already present on the user's +computer system, rather than copying library functions into the +executable, and (2) will operate properly with a modified version of the +library, if the user installs one, as long as the modified version is +interface-compatible with the version that the work was made with. +Accompany the work with a written offer, valid for at least three years, +to give the same user the materials specified in Subsection 6a, above, +for a charge no more than the cost of performing this distribution. If +distribution of the work is made by offering access to copy from a +designated place, offer equivalent access to copy the above specified +materials from the same place. Verify that the user has already received +a copy of these materials or that you have already sent this user a +copy. For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, the +materials to be distributed need not include anything that is normally +distributed (in either source or binary form) with the major components +(compiler, kernel, and so on) of the operating system on which the +executable runs, unless that component itself accompanies the +executable. + +It may happen that this requirement contradicts the license restrictions +of other proprietary libraries that do not normally accompany the +operating system. Such a contradiction means you cannot use both them +and the Library together in an executable that you distribute. + +You may place library facilities that are a work based on the Library +side-by-side in a single library together with other library facilities +not covered by this License, and distribute such a combined library, +provided that the separate distribution of the work based on the Library +and of the other library facilities is otherwise permitted, and provided +that you do these two things: + +Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities. This must be +distributed under the terms of the Sections above. + +Give prominent notice with the combined library of the fact that part of +it is a work based on the Library, and explaining where to find the +accompanying uncombined form of the same work. + +You may not copy, modify, sublicense, link with, or distribute the +Library except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, link with, or distribute the +Library is void, and will automatically terminate your rights under this +License. However, parties who have received copies, or rights, from you +under this License will not have their licenses terminated so long as +such parties remain in full compliance. + +You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute +the Library or its derivative works. These actions are prohibited by law +if you do not accept this License. Therefore, by modifying or +distributing the Library (or any work based on the Library), you +indicate your acceptance of this License to do so, and all its terms and +conditions for copying, distributing or modifying the Library or works +based on it. + +Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + +If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot distribute +so as to satisfy simultaneously your obligations under this License and +any other pertinent obligations, then as a consequence you may not +distribute the Library at all. For example, if a patent license would +not permit royalty-free redistribution of the Library by all those who +receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is implemented +by public license practices. Many people have made generous +contributions to the wide range of software distributed through that +system in reliance on consistent application of that system; it is up to +the author/donor to decide if he or she is willing to distribute +software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be +a consequence of the rest of this License. + +If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Library under this License may add an +explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + +The Free Software Foundation may publish revised and/or new versions of +the Lesser General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a license +version number, you may choose any version ever published by the Free +Software Foundation. + +If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the +author to ask for permission. For software which is copyrighted by the +Free Software Foundation, write to the Free Software Foundation; we +sometimes make exceptions for this. Our decision will be guided by the +two goals of preserving the free status of all derivatives of our free +software and of promoting the sharing and reuse of software generally. + +No Warranty + +Because the library is licensed free of charge, there is no warranty for +the library, to the extent permitted by applicable law. Except when +otherwise stated in writing the copyright holders and/or other parties +provide the library "as is" without warranty of any kind, either +expressed or implied, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose. The +entire risk as to the quality and performance of the library is with +you. Should the library prove defective, you assume the cost of all +necessary servicing, repair or correction. + +In no event unless required by applicable law or agreed to in writing +will any copyright holder, or any other party who may modify and/or +redistribute the library as permitted above, be liable to you for +damages, including any general, special, incidental or consequential +damages arising out of the use or inability to use the library +(including but not limited to loss of data or data being rendered +inaccurate or losses sustained by you or third parties or a failure of +the library to operate with any other software), even if such holder or +other party has been advised of the possibility of such damages. diff --git a/libgui/src/icons/jabber_protocol.png b/libgui/src/icons/jabber_protocol.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2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bc2E^~=4&7JneMi$I!U-)Cw3GHu#AA2VvB!+;yhQ2jEI9W?0{s+As#Tzn50q8XoZ#~K`p`Wm;Vsh{9N z(#CsdonCdtF|&YwDj^&@A9#){CdOR?% zuj5ckXpFK*J0GHE>_J8`{K*2X%Ig|Ax4)J|%M=Ad3(d)OrU>M`H=INFk2+=i$N!I! kQObOl|A`Aid4K){9GdcB4n7(B4S0T(71ZP_WZ#GW4-eLb>i_@% diff --git a/libgui/src/icons/question.png b/libgui/src/icons/question.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9cc2a8b0892852068bd18c7660c0e254d261ba4f GIT binary patch literal 1903 zc$@)m2ax!QP)+RX6@Hqw`fEck`UegG)G#_Xw ze~5=3gPW}ygQ|iE11}F70~;$d0}~S?&|QomZ!`P@8v74Ofbh5PzZpJ!`oXaG*lmX0 zM{YChJ8>K6hufX+F?m{ls8Xh6o=627W$v z24*HE24-ePAcoQ)2QV>$jRINx7li-*17au*khU1r>TQKq)YW{kCd?!%q7c3+I0*D#e@`NBW{*n|222mky zpd}0ti-0sEILH~m!OqA8v6qnnW+{^8Ao|~bIR78iAxd(>3~KVC42RD?)?nn**ZlS7 z1l$n-0R(mcyM)6DM{^bN^ax7^Awf=vg~*m7(TG$J!Lay;v*BV;$NYmhMqGp!5)v1m zssCe>c>eptmFpl!00a;dpKeVeFh$EJg;+4Kvok||@*l%z|Nj4nTLzD7Acl!SEJxOh zO0xi?Oi5Ol!OLEYftg#r0%*A?5VHXU5EC#g3w#{48Th!_!M=oB{10Ln$R}`%Q7lJd z|ASyu$H3AA!V#dv?Bl4#z{AZg&LQLN29)9f2p~|5>RB2pfD_g4-+v*Bp}zTtOv4@V z4=L6EgF6NzB#@#5Wce?k*`UPC3-qYAsssZwhqwjE0RRC6E{Y|9@dJ_sDf|k|%P5v2 zXD=l7A2>z}5wISZ{(oQ(fy6$4`2|hXObm)L!m#wm1rR_i;0ggO0l|NM|6}<6;|~KT z2Mbbp3p9uU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lwDV{rfg002ovPDHLkV1n(Fe$W5_ diff --git a/libgui/src/icons/redled.png b/libgui/src/icons/redled.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..afa477274e2bb7c27cb67bad87551e5910880b71 GIT binary patch literal 494 zc%17D@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa&H|6fVg?3oArNM~bhqvgP>?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx-l>?rg*wIhE&{2`t$$4J+mc)LPLZDi?Xuv4CBd-j*K2xnF|>NxE-$6Fg)UQxHIG2 zfe#ES44Zfq8YB*~1SkhgW(>&LUs%=CFl!wL^ZWPHd3f&cH?FDsJN4nUpXog5{4uPO z4>+#WFfL(NXgDC1ZfMk$V>@=j9t`)j56O7x>%#@U6O7+t%6n%_h>z z{{H_DbjFMY=T@@cWV!Z*Ggg@6e}cfj-+c!oTB8|WiLx~?G-dKISn|6HbJRPh{Z9yZ z{P!foS9@j$hK&xUTn>M}FlU_B*D-T4(0?q?7O{YlMS$C;W`Aw7*0F^jzspZ~!N8#~ zBiJ73Ox}0$JjW|3g97rDFIe2w@bVB9cxy85}Sb4q9e07w(HNB{r; diff --git a/libgui/src/icons/redo.png b/libgui/src/icons/redo.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fea4842cb2278d7d6efbc0daa3919598f2e179a3 GIT binary patch literal 1895 zc$@)e2blPYP)zUcz>FJ*C=_(FAyV-HP>xc`l^`ugD z*ZcqLU-e#9i}#-Yr^(1K3wc8XvBJj17&!)oaiKn5q1Y%eePADr*8{RwiqP|j6IwUh zsL?%xdpu4(CutVSIT)uU%b+$@#eQE_6uBfw#CLD9NOrR<7@QvcGs zi@Qe{>;r2J#_BF^c<$Cydn=H6@7fbB$E%>n;iJn}`RKq^-W)qey-|7K48mTQdZ~ur zUYj8eP=sIeBmUO=fTb%pIRDqnunNbg=4sm&)~Ft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evAqn#)bc&Cn+-^>z8E4EV228|jT(z@eZ24> zZ~%4do^2I&xkIWdFMRifVKsI%r65DM;nk;?Wc0_Se}6Foo1W2c?@(bUiJbxt0M#lQ h=+L|ETJb;Fe*x2YI^BO|KdS%$002ovPDHLkV1lFuqBj5l diff --git a/libgui/src/icons/search.png b/libgui/src/icons/search.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..88c6eb1d5eb0279b63fc845f25d3a2ba3d811e2e GIT binary patch literal 1567 zc$@(r2H^RLP)w)?Qq)4VYDY(B`s5{+h+5P&w%F43Ky(?*Ta;Puq(k(k3FiL}a~)JS-v$ zMI?E&&#W6BQGnl;mzTFLzGX>zq5!&)Tqw#M)u7zbaP-)NXS=mu<>pRV1~dbmz#!lS zPIN(_3#_NX`k{ukqH42o?k$f!^>XFQEro?&e=N}qi~uZJwCJI?>rd3I-s}!!XIMS} zngAc50YktkA1F4+uz)=Y?6xHAijGOEA77`BPMBG4w^?poeDinH69!Ne#d&>U;XG^F z?Ao=D6mN=wJq(Y>CyxT>{17%nmLAd!kY<83Go+aC5ADW>TrB35rB(z zAU|tzwmEHju>r`_!Bl}wKn-vW;MYMGpt~3{ecVhc7<4ejl^@V`wRYM(pUeiT69t%T zPt8=!Svjc;?{!TN-vR2va7MtU1KU{PQvgK)lbJxe(-qe1^~vLjK**$;REx!$0fc~X zeC)63p(O-^x>5hjXbBJ%P;>+{9I5tTFccaOK*xD+mmwoh_mwCF^~3EZAQFMh7}#~g zK*Zt}jZ=n0;J*MCm9RyPX7%;;pBfLqCkNi#+flOQ{``--7|PFNViY6>Y8X@<#3G|t z30HHM060*gXrT9 z7gs+7Xnyc|AsQl9Fqy1X&m4IFQ0@MY69M?FB*HZhJ@{i!NF?^ganb6|i2sC7w5Et? zZ6ey)xV4FB%~8?*?h~!XBU;5(?SIhgbnb*xFe()) zaDQoOX>&(Mw}^-gL`B+sBCP`=Js}xUSy`C|{08{>M~zMLyefOVd6%>RfCQsyaTRZPH9R9Yd8u#`0`!cUM0D#ZuTlJ%RR#aSD zkS|7~fj}U@KR#?MN=cbm^=Vg^eJtwBZoq`;)2DBHx2|6H?yr%?#*@(nA^>p+tIL)5qWj%CscSeQJw3hB+1(=pKHt9jh9eWMIKXERu5IqRI{B#aq=X_7 z8Swd}x7WMl$ot2VuQ)&)!jhexz4fg_?ue(gO``E4_H23iAFm2P9KxKQp1x)8{+gig zf+p)XY&ZsFUNwL?gwbZRJzYG1{!755i|v=S5dAkPieicHJpV}B)dUzz{{qwtDjYiM Ruzvsm002ovPDHLkV1mrp2BH7} diff --git a/libgui/src/icons/star.png b/libgui/src/icons/star.png new file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..058efcf4ba174495d8d89d1916c3ccebf393a2af GIT binary patch literal 1468 zc$@*e1w;CYP)}N+@!!zvcc7D~w{e$0UcZJIgN| z!l7e5>pnEVk(##CP;cHzYm8u_GjHNlElS>o0JsX<8b~EMMJo(ItBt^mu^OD-f@0Ya z0AiQV(K>TtoNo=(>G9fs5+Wse&z zFjua5faH7(Rf}3(F~~PXz%qIsIC{{ke-)8C5hzNM@g;&!hGF7{NGC420Q2w>-u5 zgu&i(5l&peCqlNEN(NxdmOKw%wr|-s_zo@RvMc8@m8XnJQlF_C6M;-gAkLU>gcmKB zgW$M&3EKX^ClOXNk^%HBsW`-ca<;5`^hGG(QmmzGDPOJ6*1;_!(-P3@v0wnUw3M*K*3`xLd&d_2j+?N=_L?U4oM4|Qt=?DT1VU=ez-oQA213vZ9ymK#;$VImb?xA@ z#05LMW50{dt_rg^|I91Kxgkp`QgR zzd~?EN1%RSDO&P<{`}(Gi7j9tJob(0uFeEYff6VP6NM4?V$)DR9ANq69tyiV4DqX+ z5TVF8S;ev&3nn6=yID|0Wi_~nnnfrBVq(%1k|Yoj70+8E?r@6YTPR-UWt4>#0Wdp0 z%N5DZkk0_nr4mtEz?MkrnP+3d@_;0((WAhqP(sueamSupQL&z;R|Ft=v;)fdgwo_T z6G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08x@3!Sz)Az1WMq>jKcQqh~xJu&KXEBIl2Ow%F?#@B(4YQoz9ox zmQe`fxByOY|GA|DN-YiUoubXYwM#hNE}2v;2x^_c+eC&~6~KlOpkSRyrc9AH#GJ*N zvo_Vc;;B?qOVAvx=BjcY8$c9ASFwUsbGs47G$*7)MPmAs##-*sTi3^OWQGqp3P3fTF2tq0S*#Rte!1M%8cr{MDN^ zHc_#QoCdqc5V#=0aHCEcS0PN04Q47-3~4`+vok`u`WlmWwl0T(zC=P?9>bDhUBR4L1hsT7JsT}Pc?ki_}9{)dA3OQyqm#M|1BMvjd5LYsom{F-E ztq@x-DZ5IG+rcYta`~*MY{3{moSmJ0ud%Ta9~>O8le`Pq`uh5UAPW2o=Ym5Q0`AV; zSW!x3HMK+$pVg@OKsM~Dbh$Pk%lK;Jd*@&25JrN|f-RLw;gQRi!$TJ@4n-o7VaWAh zadA;QE*md$EG{nGg$a7Rv9a-5a(`cHZf!-~XU=rAG&f(W zt*w19IXU^IO9_7ooC~7q@K{wAV(0Kk5GWW7+M1i2f8Ej1@d~^V@i(qsMd5Ha+S%UP zynXxjOQWNsQ!r&;P~^XhL6jl(A!3KIe|U|dLuIpB9ai~AVB!XNsr4@}En%zGiaJA~ z+U`*3+ch;c^Sisdt6r@YlYt**p!hsMe3cMl+1OY|CdrI@dV6}?+uNT9 zz1aAd9jrPxSWoeht2`9BZqqhy!zm!r^up-+%849{mpm&l_!SZpJE= z%3lED5*X19CPccXA?Sh^JaL{!PeHL*Y#%%^4iLj$5SSCeUQl5yf6Sw&qw)*<|+#@3+U-$d{82vx!Ul0{#Wq9p+B>(^b07*qoM6N<$ Eg7rj$G5`Po diff --git a/libgui/src/link-deps.mk b/libgui/src/link-deps.mk new file mode 100644 --- /dev/null +++ b/libgui/src/link-deps.mk @@ -0,0 +1,21 @@ +include $(top_srcdir)/libinterp/link-deps.mk + +if AMCOND_ENABLE_DYNAMIC_LINKING + LIBOCTGUI_LINK_DEPS = +else + LIBOCTGUI_LINK_DEPS = $(DLDFCN_LIBS) +endif + +LIBOCTGUI_LINK_DEPS += \ + $(QT_LIBS) + +LIBOCTGUI_LINK_OPTS = \ + $(QT_LDFLAGS) + +if AMCOND_LINK_ALL_DEPS + LIBOCTGUI_LINK_DEPS += $(LIBOCTINTERP_LINK_DEPS) + LIBOCTGUI_LINK_OPTS += $(LIBOCTINTERP_LINK_OPTS) + + OCTAVE_GUI_LINK_DEPS = $(LIBOCTGUI_LINK_DEPS) + OCTAVE_GUI_LINK_OPTS = $(LIBOCTGUI_LINK_OPTS) +endif diff --git a/libgui/src/m-editor/file-editor-interface.h b/libgui/src/m-editor/file-editor-interface.h new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/file-editor-interface.h @@ -0,0 +1,83 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef FILEEDITORINTERFACE_H +#define FILEEDITORINTERFACE_H + +#include +#include +#include + +class QTerminal; +class main_window; + +class file_editor_interface : public QDockWidget +{ + Q_OBJECT + + public: + file_editor_interface (QTerminal *terminal, main_window *mainWindow) + : QDockWidget ((QWidget*)mainWindow) // QDockWidget constructor is explicit, hence the cast. + { + setObjectName ("FileEditor"); + _terminal = terminal; + _main_window = mainWindow; + + connect (this, SIGNAL (visibilityChanged (bool)), this, + SLOT (handle_visibility_changed (bool))); + } + + virtual ~file_editor_interface () { } + + virtual QMenu *debug_menu () = 0; + virtual QToolBar *toolbar () = 0; + + virtual void handle_entered_debug_mode () = 0; + virtual void handle_quit_debug_mode () = 0; + + public slots: + virtual void request_new_file () = 0; + virtual void request_open_file () = 0; + virtual void request_open_file (QString fileName) = 0; + + signals: + void active_changed (bool active); + + protected: + QTerminal* _terminal; + main_window* _main_window; + + void closeEvent (QCloseEvent *event) + { + emit active_changed (false); + QDockWidget::closeEvent (event); + } + + protected slots: + void handle_visibility_changed (bool visible) + { + if (visible) + emit active_changed (true); + } +}; + +#endif // FILEEDITORINTERFACE_H diff --git a/libgui/src/m-editor/file-editor-tab.cc b/libgui/src/m-editor/file-editor-tab.cc new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -0,0 +1,821 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "file-editor-tab.h" +#include "file-editor.h" +#include "find-dialog.h" +#include "octave-link.h" + + +#include +// Not available in the Debian repos yet! +// #include +#include "lexer-octave-gui.h" +#include +#include +#include +#include +#include +#include "resource-manager.h" +#include +#include + +file_editor_tab::file_editor_tab(file_editor *fileEditor) + : QWidget ((QWidget*)fileEditor), octave_event_observer () +{ + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + _file_editor = fileEditor; + _file_name = ""; + _edit_area = new QsciScintilla (this); + + // symbols + _edit_area->setMarginType (1, QsciScintilla::SymbolMargin); + _edit_area->setMarginSensitivity (1, true); + _edit_area->markerDefine (QsciScintilla::RightTriangle, bookmark); + _edit_area->markerDefine (QPixmap (":/actions/icons/redled.png"), + breakpoint); + _edit_area->markerDefine (QPixmap (":/actions/icons/arrow_right.png"), + debugger_position); + + connect (_edit_area, SIGNAL (marginClicked (int, int, + Qt::KeyboardModifiers)), + this, SLOT (handle_margin_clicked (int, int, + Qt::KeyboardModifiers))); + + // line numbers + _edit_area->setMarginsForegroundColor(QColor(96,96,96)); + _edit_area->setMarginsBackgroundColor(QColor(232,232,220)); + if (settings->value ("editor/showLineNumbers",true).toBool ()) + { + QFont marginFont( settings->value ("editor/fontName","Courier").toString () , + settings->value ("editor/fontSize",10).toInt () ); + _edit_area->setMarginsFont( marginFont ); + QFontMetrics metrics(marginFont); + _edit_area->setMarginType (2, QsciScintilla::TextMargin); + _edit_area->setMarginWidth(2, metrics.width("9999")); + _edit_area->setMarginLineNumbers (2, true); + } + + // code folding + _edit_area->setMarginType (3, QsciScintilla::SymbolMargin); + _edit_area->setFolding (QsciScintilla::BoxedTreeFoldStyle , 3); + + // other features + if (settings->value ("editor/highlightCurrentLine",true).toBool ()) + { + _edit_area->setCaretLineVisible(true); + _edit_area->setCaretLineBackgroundColor(QColor(245,245,245)); + } + _edit_area->setBraceMatching (QsciScintilla::StrictBraceMatch); + _edit_area->setAutoIndent (true); + _edit_area->setIndentationWidth (2); + _edit_area->setIndentationsUseTabs (false); + if (settings->value ("editor/codeCompletion",true).toBool ()) + { + _edit_area->autoCompleteFromAll (); + _edit_area->setAutoCompletionSource(QsciScintilla::AcsAll); + _edit_area->setAutoCompletionThreshold (1); + } + _edit_area->setUtf8 (true); + + QVBoxLayout *layout = new QVBoxLayout (); + layout->addWidget (_edit_area); + layout->setMargin (0); + setLayout (layout); + + // connect modified signal + connect (_edit_area, SIGNAL (modificationChanged (bool)), + this, SLOT (update_window_title (bool))); + connect (_edit_area, SIGNAL (copyAvailable (bool)), + this, SLOT (handle_copy_available (bool))); + connect (&_file_system_watcher, SIGNAL (fileChanged (QString)), + this, SLOT (file_has_changed (QString))); + + _file_name = ""; + update_window_title (false); +} + +bool +file_editor_tab::copy_available () +{ + return _copy_available; +} + +void +file_editor_tab::event_accepted (octave_event *e) +{ + if (dynamic_cast (e)) + { + // File was run successfully. + } + + if (octave_add_breakpoint_event *abe + = dynamic_cast (e)) + { + // TODO: Check file. + _edit_area->markerAdd (abe->get_line (), breakpoint); + } + + if (octave_remove_breakpoint_event *rbe + = dynamic_cast (e)) + { + // TODO: Check file. + _edit_area->markerDelete (rbe->get_line (), breakpoint); + } + + if (octave_remove_all_breakpoints_event *rabe + = dynamic_cast (e)) + { + Q_UNUSED (rabe); + _edit_area->markerDeleteAll (breakpoint); + } + + delete e; +} + +void +file_editor_tab::event_reject (octave_event *e) +{ + if (dynamic_cast (e)) + { + // Running file failed. + } + delete e; +} + +void +file_editor_tab::closeEvent (QCloseEvent *event) +{ + if (_file_editor->get_main_window ()->is_closing ()) + { + // close whole application: save file or not if modified + check_file_modified ("Closing Octave", 0); // no cancel possible + event->accept (); + } + else + { + // ignore close event if file is not saved and user cancels + // closing this window + if (check_file_modified ("Close File", + QMessageBox::Cancel) == QMessageBox::Cancel) + { + event->ignore (); + } + else + { + event->accept(); + } + } +} + +void +file_editor_tab::set_file_name (QString fileName) +{ + _file_name = fileName; + update_lexer (); + update_tracked_file (); +} + +void +file_editor_tab::handle_margin_clicked(int margin, int line, + Qt::KeyboardModifiers state) +{ + Q_UNUSED (state); + if (margin == 1) + { + unsigned int mask = _edit_area->markersAtLine (line); + + if (state & Qt::ControlModifier) + { + if (mask && (1 << bookmark)) + _edit_area->markerDelete(line,bookmark); + else + _edit_area->markerAdd(line,bookmark); + } + else + { + if (mask && (1 << breakpoint)) + { + request_remove_breakpoint (line); + } + else + { + request_add_breakpoint (line); + } + } + } +} + +void +file_editor_tab::update_lexer () +{ + QsciLexer *lexer = _edit_area->lexer (); + delete lexer; + + if (_file_name.endsWith (".m") || _file_name.endsWith (".M")) + { + lexer = new lexer_octave_gui (); + + // The API info that is used for auto completion + // TODO: Where to store a file with API info (raw or prepared?)? + // TODO: Also provide infos on octave-forge functions? + // TODO: Also provide infos on function parameters? + // By now, use the keywords-list from syntax highlighting + + QsciAPIs *lexer_api = new QsciAPIs (lexer); + + QString keyword; + QStringList keywordList; + + // get whole string with all keywords + keyword = lexer->keywords (1); + // split into single strings + keywordList = keyword.split (QRegExp ("\\s+")); + + int i; + for (i = 0; i < keywordList.size (); i++) + { + // add single strings to the API + lexer_api->add (keywordList.at (i)); + } + // prepare API info ... this make take some time + lexer_api->prepare (); + } + else if (_file_name.endsWith (".c") + || _file_name.endsWith (".cc") + || _file_name.endsWith (".cpp") + || _file_name.endsWith (".cxx") + || _file_name.endsWith (".c++") + || _file_name.endsWith (".h") + || _file_name.endsWith (".hh") + || _file_name.endsWith (".hpp") + || _file_name.endsWith (".h++")) + { + lexer = new QsciLexerCPP (); + } + else if (_file_name.endsWith (".pl")) + { + lexer = new QsciLexerPerl (); + } + else if (_file_name.endsWith (".bat")) + { + lexer = new QsciLexerBatch (); + } + else if (_file_name.endsWith (".diff")) + { + lexer = new QsciLexerDiff (); + } + else // Default to bash lexer. + { + lexer = new QsciLexerBash (); + } + + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + // Editor font (default or from settings) + lexer->setDefaultFont (QFont ( + settings->value ("editor/fontName", + "Courier").toString (), + settings->value ("editor/fontSize", + 10).toInt ())); + + // TODO: Autoindent not working as it should + lexer->setAutoIndentStyle (QsciScintilla::AiMaintain || + QsciScintilla::AiOpening || + QsciScintilla::AiClosing); + + _edit_area->setLexer (lexer); +} + +void +file_editor_tab::request_add_breakpoint (int line) +{ + QFileInfo file_info (_file_name); + QString path = file_info.absolutePath (); + QString function_name = file_info.fileName (); + + // We have to cut off the suffix, because octave appends it. + function_name.chop (file_info.suffix ().length () + 1); + + octave_link::instance ()->post_event + (new octave_add_breakpoint_event (*this, + path.toStdString (), + function_name.toStdString (), + line)); +} + +void +file_editor_tab::request_remove_breakpoint (int line) +{ + QFileInfo file_info (_file_name); + QString path = file_info.absolutePath (); + QString function_name = file_info.fileName (); + + // We have to cut off the suffix, because octave appends it. + function_name.chop (file_info.suffix ().length () + 1); + + octave_link::instance ()->post_event + (new octave_remove_breakpoint_event (*this, + path.toStdString (), + function_name.toStdString (), + line)); +} + +void +file_editor_tab::comment_selected_text () +{ + do_comment_selected_text (true); +} + +void +file_editor_tab::uncomment_selected_text () +{ + do_comment_selected_text (false); +} + +void +file_editor_tab::do_comment_selected_text (bool comment) +{ + if ( _edit_area->hasSelectedText() ) + { + int lineFrom, lineTo, colFrom, colTo, i; + _edit_area->getSelection (&lineFrom,&colFrom,&lineTo,&colTo); + if ( colTo == 0 ) // the beginning of last line is not selected + lineTo--; // stop at line above + _edit_area->beginUndoAction (); + for ( i=lineFrom; i<=lineTo; i++ ) + { + if ( comment ) + _edit_area->insertAt("%",i,0); + else + { + QString line(_edit_area->text(i)); + if ( line.startsWith("%") ) + { + _edit_area->setSelection(i,0,i,1); + _edit_area->removeSelectedText(); + } + } + } + _edit_area->endUndoAction (); + } +} + +void +file_editor_tab::find () +{ + find_dialog dialog (_edit_area); + dialog.exec (); +} + +void +file_editor_tab::update_window_title (bool modified) +{ + QString title(_file_name); + if ( !_long_title ) + { + QFileInfo file(_file_name); + title = file.fileName(); + } + + if ( modified ) + { + emit file_name_changed (title.prepend("* ")); + } + else + emit file_name_changed (title); +} + +void +file_editor_tab::handle_copy_available(bool enableCopy) +{ + _copy_available = enableCopy; + emit editor_state_changed (); +} + +void +file_editor_tab::update_tracked_file () +{ + QStringList trackedFiles = _file_system_watcher.files (); + if (!trackedFiles.isEmpty ()) + _file_system_watcher.removePaths (trackedFiles); + + if (_file_name != UNNAMED_FILE) + _file_system_watcher.addPath (_file_name); +} + +int +file_editor_tab::check_file_modified (QString msg, int cancelButton) +{ + int decision = QMessageBox::Yes; + if (_edit_area->isModified ()) + { + // file is modified but not saved, aks user what to do + decision = QMessageBox::warning (this, + msg, + tr ("The file %1\n" + "has been modified. Do you want to save the changes?"). + arg (_file_name), + QMessageBox::Save, + QMessageBox::Discard, cancelButton ); + if (decision == QMessageBox::Save) + { + save_file (); + if (_edit_area->isModified ()) + { + // If the user attempted to save the file, but it's still + // modified, then probably something went wrong, so return + // cancel for cancel this operation or try to save files + // as if cancel not possible + if ( cancelButton ) + return (QMessageBox::Cancel); + else + save_file_as (); + } + } + } + return (decision); +} + +void +file_editor_tab::remove_bookmark () +{ + _edit_area->markerDeleteAll (bookmark); +} + +void +file_editor_tab::toggle_bookmark () +{ + int line, cur; + _edit_area->getCursorPosition (&line,&cur); + if ( _edit_area->markersAtLine (line) && (1 << bookmark) ) + _edit_area->markerDelete (line, bookmark); + else + _edit_area->markerAdd (line, bookmark); +} + +void +file_editor_tab::next_bookmark() +{ + int line, cur, nextline; + _edit_area->getCursorPosition (&line, &cur); + if ( _edit_area->markersAtLine (line) && (1 << bookmark) ) + line++; // we have a breakpoint here, so start search from next line + nextline = _edit_area->markerFindNext (line, (1 << bookmark)); + _edit_area->setCursorPosition (nextline, 0); +} + +void +file_editor_tab::previous_bookmark () +{ + int line, cur, prevline; + _edit_area->getCursorPosition (&line, &cur); + if ( _edit_area->markersAtLine (line) && (1 << bookmark) ) + line--; // we have a breakpoint here, so start search from prev line + prevline = _edit_area->markerFindPrevious (line, (1 << bookmark)); + _edit_area->setCursorPosition (prevline, 0); +} + +void +file_editor_tab::remove_all_breakpoints () +{ + QFileInfo file_info (_file_name); + QString path = file_info.absolutePath (); + QString function_name = file_info.fileName (); + + // We have to cut off the suffix, because octave appends it. + function_name.chop (file_info.suffix ().length () + 1); + + octave_link::instance ()->post_event + (new octave_remove_all_breakpoints_event (*this, + path.toStdString (), + function_name.toStdString ())); +} + +void +file_editor_tab::toggle_breakpoint () +{ + int line, cur; + _edit_area->getCursorPosition (&line, &cur); + if ( _edit_area->markersAtLine (line) && (1 << breakpoint) ) + request_remove_breakpoint (line); + else + request_add_breakpoint (line); +} + +void +file_editor_tab::next_breakpoint () +{ + int line, cur, nextline; + _edit_area->getCursorPosition (&line, &cur); + if ( _edit_area->markersAtLine (line) && (1 << breakpoint) ) + line++; // we have a breakpoint here, so start search from next line + nextline = _edit_area->markerFindNext (line, (1 << breakpoint)); + _edit_area->setCursorPosition (nextline, 0); +} + +void +file_editor_tab::previous_breakpoint () +{ + int line, cur, prevline; + _edit_area->getCursorPosition (&line, &cur); + if ( _edit_area->markersAtLine (line) && (1 << breakpoint) ) + line--; // we have a breakpoint here, so start search from prev line + prevline = _edit_area->markerFindPrevious (line, (1 << breakpoint)); + _edit_area->setCursorPosition (prevline, 0); +} + +void +file_editor_tab::cut () +{ + _edit_area->cut (); +} + +void +file_editor_tab::copy () +{ + _edit_area->copy (); +} + +void +file_editor_tab::paste () +{ + _edit_area->paste (); +} + +void +file_editor_tab::undo () +{ + _edit_area->undo (); +} + +void +file_editor_tab::redo () +{ + _edit_area->redo (); +} + +void +file_editor_tab::set_debugger_position (int line) +{ + _edit_area->markerDeleteAll (debugger_position); + if (line > 0) + { + _edit_area->markerAdd (line, debugger_position); + } +} + +void +file_editor_tab::set_modified (bool modified) +{ + _edit_area->setModified (modified); +} + +bool +file_editor_tab::open_file () +{ + QString openFileName; + QFileDialog fileDialog(this); + fileDialog.setNameFilter(SAVE_FILE_FILTER); + fileDialog.setAcceptMode(QFileDialog::AcceptOpen); + fileDialog.setViewMode(QFileDialog::Detail); + if (fileDialog.exec () == QDialog::Accepted) + { + openFileName = fileDialog.selectedFiles().at(0); + if (openFileName.isEmpty ()) + return false; + + load_file(openFileName); + return true; + } + else + { + return false; + } +} + +void +file_editor_tab::load_file (QString fileName) +{ + if (!_file_editor->isVisible ()) + { + _file_editor->show (); + } + + QFile file (fileName); + if (!file.open (QFile::ReadOnly)) + { + QMessageBox::warning (this, tr ("Octave Editor"), + tr ("Could not open file %1 for read:\n%2.").arg (fileName). + arg (file.errorString ())); + return; + } + + QTextStream in (&file); + QApplication::setOverrideCursor (Qt::WaitCursor); + _edit_area->setText (in.readAll ()); + QApplication::restoreOverrideCursor (); + + set_file_name (fileName); + update_tracked_file (); + + + update_window_title (false); // window title (no modification) + _edit_area->setModified (false); // loaded file is not modified yet +} + +void +file_editor_tab::new_file () +{ + if (!_file_editor->isVisible ()) + { + _file_editor->show (); + } + + set_file_name (UNNAMED_FILE); + update_window_title (false); // window title (no modification) + _edit_area->setText (""); + _edit_area->setModified (false); // new file is not modified yet +} + +bool file_editor_tab::save_file() +{ + return save_file (_file_name); +} + +bool +file_editor_tab::save_file (QString saveFileName) +{ + // it is a new file with the name "" -> call saveFielAs + if (saveFileName == UNNAMED_FILE || saveFileName.isEmpty ()) + { + return save_file_as(); + } + + QStringList watched_files = _file_system_watcher.files(); + if (!watched_files.isEmpty ()) + _file_system_watcher.removePaths(watched_files); + + // open the file for writing + QFile file (saveFileName); + if (!file.open (QFile::WriteOnly)) + { + QMessageBox::warning (this, tr ("Octave Editor"), + tr ("Could not open file %1 for write:\n%2."). + arg (saveFileName).arg (file.errorString ())); + _file_system_watcher.addPaths (watched_files); + return false; + } + + // save the contents into the file + QTextStream out (&file); + QApplication::setOverrideCursor (Qt::WaitCursor); + out << _edit_area->text (); + QApplication::restoreOverrideCursor (); + + // save file name for later use + _file_name = saveFileName; + // set the window title to actual file name (not modified) + update_window_title (false); + // files is save -> not modified + _edit_area->setModified (false); + file.close(); + + if (!watched_files.isEmpty ()) + _file_system_watcher.addPaths (watched_files); + return true; +} + +bool +file_editor_tab::save_file_as () +{ + QString saveFileName(_file_name); + QFileDialog fileDialog(this); + if (saveFileName == UNNAMED_FILE || saveFileName.isEmpty ()) + { + QString directory = QString::fromStdString + (octave_link::instance ()->get_last_working_directory ()); + + if (directory.isEmpty ()) + { + directory = QDir::homePath (); + } + + fileDialog.setDirectory (directory); + } + else + { + fileDialog.selectFile (saveFileName); + } + fileDialog.setNameFilter (SAVE_FILE_FILTER); + fileDialog.setDefaultSuffix ("m"); + fileDialog.setAcceptMode (QFileDialog::AcceptSave); + fileDialog.setViewMode (QFileDialog::Detail); + + if (fileDialog.exec ()) + { + saveFileName = fileDialog.selectedFiles ().at (0); + if (saveFileName.isEmpty ()) + return false; + + return save_file (saveFileName); + } + + return false; +} + +void +file_editor_tab::run_file () +{ + if (_edit_area->isModified ()) + save_file(_file_name); + + QFileInfo file_info (_file_name); + QString path = file_info.absolutePath (); + //QString current_path = QString::fromStdString + (octave_link::instance ()->get_last_working_directory ()); + QString function_name = file_info.fileName (); + + // We have to cut off the suffix, because octave appends it. + function_name.chop (file_info.suffix ().length () + 1); + _file_editor->terminal ()->sendText (QString ("cd \'%1\'\n%2\n") + .arg(path).arg (function_name)); + // TODO: Sending a run event crashes for long scripts. Find out why. + // octave_link::instance () + // ->post_event (new octave_run_file_event (*this, _file_name.toStdString ())); +} + +void +file_editor_tab::file_has_changed (QString fileName) +{ + Q_UNUSED (fileName); + if (QFile::exists (_file_name)) + { + // Prevent popping up multiple message boxes when the file has + // been changed multiple times. + static bool alreadyAsking = false; + if (!alreadyAsking) + { + alreadyAsking = true; + + int decision = + QMessageBox::warning (this, tr ("Octave Editor"), + tr ("It seems that \'%1\' has been modified by another application. Do you want to reload it?"). + arg (_file_name), QMessageBox::Yes, + QMessageBox::No); + + if (decision == QMessageBox::Yes) + { + load_file (_file_name); + } + + alreadyAsking = false; + } + } + else + { + int decision = + QMessageBox::warning (this, tr ("Octave Editor"), + tr ("It seems that \'%1\' has been deleted or renamed. Do you want to save it now?"). + arg (_file_name), QMessageBox::Save, + QMessageBox::Close); + if (decision == QMessageBox::Save) + { + if (!save_file_as ()) + { + set_file_name (UNNAMED_FILE); + update_window_title (true); // window title (no modification) + set_modified (true); + update_tracked_file (); + } + } + else + { + emit close_request (); + } + } +} diff --git a/libgui/src/m-editor/file-editor-tab.h b/libgui/src/m-editor/file-editor-tab.h new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/file-editor-tab.h @@ -0,0 +1,107 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef FILEEDITORTAB_H +#define FILEEDITORTAB_H + +#include +#include +#include +#include +#include "octave-event-observer.h" + +class file_editor; +class file_editor_tab : public QWidget, public octave_event_observer +{ + Q_OBJECT +public: + file_editor_tab (file_editor *fileEditor); + bool copy_available (); + + void event_accepted (octave_event *e); + void event_reject (octave_event *e); + +public slots: + void update_window_title(bool modified); + void handle_copy_available(bool enableCopy); + void handle_margin_clicked (int line, int margin, Qt::KeyboardModifiers state); + void comment_selected_text (); + void uncomment_selected_text (); + void find (); + void remove_bookmark (); + void toggle_bookmark (); + void next_bookmark (); + void previous_bookmark (); + void remove_all_breakpoints (); + void toggle_breakpoint (); + void next_breakpoint (); + void previous_breakpoint (); + void cut (); + void copy (); + void paste (); + void undo (); + void redo (); + void set_debugger_position (int line); + + void set_modified (bool modified = true); + + bool open_file (); + void load_file (QString fileName); + void new_file (); + bool save_file (); + bool save_file(QString saveFileName); + bool save_file_as(); + void run_file (); + + void file_has_changed (QString fileName); + +signals: + void file_name_changed (QString fileName); + void editor_state_changed (); + void close_request (); + +protected: + void closeEvent (QCloseEvent *event); + void set_file_name (QString fileName); + +private: + void update_lexer (); + void request_add_breakpoint (int line); + void request_remove_breakpoint (int line); + + void update_tracked_file (); + int check_file_modified (QString msg, int cancelButton); + void do_comment_selected_text (bool comment); + + file_editor * _file_editor; + QsciScintilla * _edit_area; + + QString _file_name; + QString _file_name_short; + + bool _long_title; + bool _copy_available; + + QFileSystemWatcher _file_system_watcher; +}; + +#endif // FILEEDITORTAB_H diff --git a/libgui/src/m-editor/file-editor.cc b/libgui/src/m-editor/file-editor.cc new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/file-editor.cc @@ -0,0 +1,563 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "file-editor.h" +#include +#include +#include +#include +#include +#include +#include +#include + +file_editor::file_editor (QTerminal *terminal, main_window *m) + : file_editor_interface(terminal, m) +{ + construct (); + + _terminal = terminal; + _main_window = m; + setVisible (false); +} + +file_editor::~file_editor () +{ +} + +QTerminal * +file_editor::terminal () +{ + return _terminal; +} + +main_window * +file_editor::get_main_window () +{ + return _main_window; +} + +QMenu * +file_editor::debug_menu () +{ + return _debug_menu; +} + +QToolBar * +file_editor::toolbar () +{ + return _tool_bar; +} + +void +file_editor::handle_entered_debug_mode () +{ + _run_action->setEnabled (false); +} + +void +file_editor::handle_quit_debug_mode () +{ + _run_action->setEnabled (true); +} + +void +file_editor::request_new_file () +{ + file_editor_tab *fileEditorTab = new file_editor_tab (this); + if (fileEditorTab) + { + add_file_editor_tab (fileEditorTab); + fileEditorTab->new_file (); + } +} + +void +file_editor::request_open_file () +{ + file_editor_tab *fileEditorTab = new file_editor_tab (this); + if (fileEditorTab) + { + add_file_editor_tab (fileEditorTab); + if (!fileEditorTab->open_file ()) + { + // If no file was loaded, remove the tab again. + _tab_widget->removeTab (_tab_widget->indexOf (fileEditorTab)); + } + } +} + +void +file_editor::request_open_file (QString fileName) +{ + if (!isVisible ()) + { + show (); + } + + file_editor_tab *fileEditorTab = new file_editor_tab (this); + if (fileEditorTab) + { + add_file_editor_tab (fileEditorTab); + fileEditorTab->load_file (fileName); + } +} + +void +file_editor::request_undo () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->undo (); +} + +void +file_editor::request_redo () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->redo (); +} + +void +file_editor::request_copy () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->copy (); +} + +void +file_editor::request_cut () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->cut (); +} + +void +file_editor::request_paste () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->paste (); +} + +void +file_editor::request_save_file () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->save_file (); +} + +void +file_editor::request_save_file_as () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->save_file_as (); +} + +void +file_editor::request_run_file () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->run_file (); +} + +void +file_editor::request_toggle_bookmark () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->toggle_bookmark (); +} + +void +file_editor::request_next_bookmark () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->next_bookmark (); +} + +void +file_editor::request_previous_bookmark () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->previous_bookmark (); +} + +void +file_editor::request_remove_bookmark () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->remove_bookmark (); +} + +void +file_editor::request_toggle_breakpoint () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->toggle_breakpoint (); +} + +void +file_editor::request_next_breakpoint () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->next_breakpoint (); +} + +void +file_editor::request_previous_breakpoint () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->previous_breakpoint (); +} + +void +file_editor::request_remove_breakpoint () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->remove_all_breakpoints (); +} + +void +file_editor::request_comment_selected_text () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->comment_selected_text (); +} + +void +file_editor::request_uncomment_selected_text () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->uncomment_selected_text (); +} + +void +file_editor::request_find () +{ + file_editor_tab *_active_file_editor_tab = active_editor_tab (); + if (_active_file_editor_tab) + _active_file_editor_tab->find (); +} + +void +file_editor::handle_file_name_changed (QString fileName) +{ + QObject *senderObject = sender (); + file_editor_tab *fileEditorTab + = dynamic_cast (senderObject); + if (fileEditorTab) + { + for(int i = 0; i < _tab_widget->count (); i++) + { + if (_tab_widget->widget (i) == fileEditorTab) + { + _tab_widget->setTabText (i, fileName); + } + } + } +} + +void +file_editor::handle_tab_close_request (int index) +{ + file_editor_tab *fileEditorTab + = dynamic_cast (_tab_widget->widget (index)); + if (fileEditorTab) + if (fileEditorTab->close ()) + { + _tab_widget->removeTab (index); + delete fileEditorTab; + } +} + +void +file_editor::handle_tab_close_request () +{ + file_editor_tab *fileEditorTab = dynamic_cast (sender ()); + if (fileEditorTab) + if (fileEditorTab->close ()) + { + _tab_widget->removeTab (_tab_widget->indexOf (fileEditorTab)); + delete fileEditorTab; + } +} + +void +file_editor::active_tab_changed (int index) +{ + Q_UNUSED (index); + handle_editor_state_changed (); +} + +void +file_editor::handle_editor_state_changed () +{ + file_editor_tab *f = active_editor_tab (); + if (f) + { + bool copy_available = f->copy_available (); + _copy_action->setEnabled (copy_available); + _cut_action->setEnabled (copy_available); + setFocusProxy (f); + } +} + +void +file_editor::construct () +{ + QWidget *widget = new QWidget (this); + QStyle *style = QApplication::style (); + + _menu_bar = new QMenuBar (widget); + _tool_bar = new QToolBar (widget); + _tab_widget = new QTabWidget (widget); + _tab_widget->setTabsClosable (true); + + QAction *new_action = new QAction (QIcon(":/actions/icons/filenew.png"), + tr("&New File"), _tool_bar); + + QAction *open_action = new QAction (QIcon(":/actions/icons/fileopen.png"), + tr("&Open File"), _tool_bar); + + QAction *save_action = new QAction (QIcon(":/actions/icons/filesave.png"), + tr("&Save File"), _tool_bar); + + QAction *save_as_action + = new QAction (QIcon(":/actions/icons/filesaveas.png"), + tr("Save File &As"), _tool_bar); + + QAction *undo_action = new QAction (QIcon(":/actions/icons/undo.png"), + tr("&Undo"), _tool_bar); + + QAction *redo_action = new QAction (QIcon(":/actions/icons/redo.png"), + tr("&Redo"), _tool_bar); + + _copy_action = new QAction (QIcon(":/actions/icons/editcopy.png"), + tr ("&Copy"), _tool_bar); + + _cut_action = new QAction (QIcon(":/actions/icons/editcut.png"), + tr ("Cu&t"), _tool_bar); + + QAction *paste_action + = new QAction (QIcon (":/actions/icons/editpaste.png"), + tr("Paste"), _tool_bar); + QAction *next_bookmark_action = new QAction (tr ("&Next Bookmark"),_tool_bar); + QAction *previous_bookmark_action = new QAction (tr ("Pre&vious Bookmark"),_tool_bar); + QAction *toggle_bookmark_action = new QAction (tr ("Toggle &Bookmark"),_tool_bar); + QAction *remove_bookmark_action = new QAction (tr ("&Remove All Bookmarks"),_tool_bar); + + QAction *next_breakpoint_action + = new QAction (QIcon (":/actions/icons/bp_next.png"), + tr ("&Next breakpoint"), _tool_bar); + QAction *previous_breakpoint_action + = new QAction (QIcon (":/actions/icons/bp_prev.png"), + tr ("Pre&vious breakpoint"), _tool_bar); + QAction *toggle_breakpoint_action + = new QAction (QIcon (":/actions/icons/bp_toggle.png"), + tr ("Toggle &breakpoint"), _tool_bar); + QAction *remove_all_breakpoints_action + = new QAction (QIcon (":/actions/icons/bp_rm_all.png"), + tr ("&Remove All breakpoints"), _tool_bar); + + QAction *comment_selection_action = new QAction (tr ("&Comment Selected Text"),_tool_bar); + QAction *uncomment_selection_action = new QAction (tr ("&Uncomment Selected Text"),_tool_bar); + + QAction *find_action = new QAction (QIcon(":/actions/icons/find.png"), + tr ("&Find and Replace"), _tool_bar); + + _run_action = new QAction (QIcon(":/actions/icons/artsbuilderexecute.png"), + tr("Save File And Run"), _tool_bar); + + // some actions are disabled from the beginning + _copy_action->setEnabled(false); + _cut_action->setEnabled(false); + _run_action->setShortcut (Qt::ControlModifier+ Qt::Key_R); + _run_action->setShortcutContext (Qt::WindowShortcut); + next_bookmark_action->setShortcut (Qt::Key_F2); + next_bookmark_action->setShortcutContext (Qt::WindowShortcut); + previous_bookmark_action->setShortcut (Qt::SHIFT + Qt::Key_F2); + previous_bookmark_action->setShortcutContext (Qt::WindowShortcut); + toggle_bookmark_action->setShortcut (Qt::Key_F7); + toggle_bookmark_action->setShortcutContext (Qt::WindowShortcut); + comment_selection_action->setShortcut (Qt::ControlModifier + Qt::Key_7); + comment_selection_action->setShortcutContext (Qt::WindowShortcut); + uncomment_selection_action->setShortcut (Qt::ControlModifier + Qt::Key_8); + uncomment_selection_action->setShortcutContext(Qt::WindowShortcut); + find_action->setShortcut (Qt::ControlModifier+Qt::Key_F); + find_action->setShortcutContext (Qt::WindowShortcut); + + // toolbar + _tool_bar->addAction (new_action); + _tool_bar->addAction (open_action); + _tool_bar->addAction (save_action); + _tool_bar->addAction (save_as_action); + _tool_bar->addSeparator (); + _tool_bar->addAction (undo_action); + _tool_bar->addAction (redo_action); + _tool_bar->addAction (_copy_action); + _tool_bar->addAction (_cut_action); + _tool_bar->addAction (paste_action); + _tool_bar->addSeparator (); + _tool_bar->addAction (find_action); + _tool_bar->addAction (_run_action); + _tool_bar->addSeparator (); + _tool_bar->addAction (toggle_breakpoint_action); + _tool_bar->addAction (next_breakpoint_action); + _tool_bar->addAction (previous_breakpoint_action); + _tool_bar->addAction (remove_all_breakpoints_action); + + // menu bar + QMenu *fileMenu = new QMenu (tr ("&File"), _menu_bar); + fileMenu->addAction (new_action); + fileMenu->addAction (open_action); + fileMenu->addAction (save_action); + fileMenu->addAction (save_as_action); + fileMenu->addSeparator (); + _menu_bar->addMenu (fileMenu); + + QMenu *editMenu = new QMenu (tr ("&Edit"), _menu_bar); + editMenu->addAction (undo_action); + editMenu->addAction (redo_action); + editMenu->addSeparator (); + editMenu->addAction (_copy_action); + editMenu->addAction (_cut_action); + editMenu->addAction (paste_action); + editMenu->addSeparator (); + editMenu->addAction (find_action); + editMenu->addSeparator (); + editMenu->addAction (comment_selection_action); + editMenu->addAction (uncomment_selection_action); + editMenu->addSeparator (); + editMenu->addAction (toggle_bookmark_action); + editMenu->addAction (next_bookmark_action); + editMenu->addAction (previous_bookmark_action); + editMenu->addAction (remove_bookmark_action); + _menu_bar->addMenu (editMenu); + + _debug_menu = new QMenu (tr ("&Debug"), _menu_bar); + _debug_menu->addAction (toggle_breakpoint_action); + _debug_menu->addAction (next_breakpoint_action); + _debug_menu->addAction (previous_breakpoint_action); + _debug_menu->addAction (remove_all_breakpoints_action); + _debug_menu->addSeparator (); + // The other debug actions will be added by the main window. + _menu_bar->addMenu (_debug_menu); + + QMenu *_run_menu = new QMenu (tr ("&Run"), _menu_bar); + _run_menu->addAction (_run_action); + _menu_bar->addMenu (_run_menu); + + QVBoxLayout *layout = new QVBoxLayout (); + layout->addWidget (_menu_bar); + layout->addWidget (_tool_bar); + layout->addWidget (_tab_widget); + layout->setMargin (0); + widget->setLayout (layout); + setWidget (widget); + + connect (new_action, + SIGNAL (triggered ()), this, SLOT (request_new_file ())); + connect (open_action, + SIGNAL (triggered ()), this, SLOT (request_open_file ())); + connect (undo_action, + SIGNAL (triggered ()), this, SLOT (request_undo ())); + connect (redo_action, + SIGNAL (triggered ()), this, SLOT (request_redo ())); + connect (_copy_action, + SIGNAL (triggered ()), this, SLOT (request_copy ())); + connect (_cut_action, + SIGNAL (triggered ()), this, SLOT (request_cut ())); + connect (paste_action, + SIGNAL (triggered ()), this, SLOT (request_paste ())); + connect (save_action, + SIGNAL (triggered ()), this, SLOT (request_save_file ())); + connect (save_as_action, + SIGNAL (triggered ()), this, SLOT (request_save_file_as ())); + connect (_run_action, + SIGNAL (triggered ()), this, SLOT (request_run_file ())); + connect (toggle_bookmark_action, + SIGNAL (triggered ()), this, SLOT (request_toggle_bookmark ())); + connect (next_bookmark_action, + SIGNAL (triggered ()), this, SLOT (request_next_bookmark ())); + connect (previous_bookmark_action, + SIGNAL (triggered ()), this, SLOT (request_previous_bookmark ())); + connect (remove_bookmark_action, + SIGNAL (triggered ()), this, SLOT (request_remove_bookmark ())); + connect (toggle_breakpoint_action, + SIGNAL (triggered ()), this, SLOT (request_toggle_breakpoint ())); + connect (next_breakpoint_action, + SIGNAL (triggered ()), this, SLOT (request_next_breakpoint ())); + connect (previous_breakpoint_action, + SIGNAL (triggered ()), this, SLOT (request_previous_breakpoint ())); + connect (remove_all_breakpoints_action, + SIGNAL (triggered ()), this, SLOT (request_remove_breakpoint ())); + connect (comment_selection_action, + SIGNAL (triggered ()), this, SLOT (request_comment_selected_text ())); + connect (uncomment_selection_action, + SIGNAL (triggered ()), this, SLOT (request_uncomment_selected_text ())); + connect (find_action, + SIGNAL (triggered ()), this, SLOT (request_find ())); + connect (_tab_widget, + SIGNAL (tabCloseRequested (int)), this, SLOT (handle_tab_close_request (int))); + connect (_tab_widget, + SIGNAL (currentChanged(int)), this, SLOT (active_tab_changed (int))); + + resize (500, 400); + setWindowIcon (QIcon::fromTheme ("accessories-text-editor", + style->standardIcon (QStyle::SP_FileIcon))); + setWindowTitle ("Octave Editor"); +} + +void +file_editor::add_file_editor_tab (file_editor_tab *f) +{ + _tab_widget->addTab (f, ""); + connect (f, SIGNAL (file_name_changed(QString)), + this, SLOT(handle_file_name_changed(QString))); + connect (f, SIGNAL (editor_state_changed ()), + this, SLOT (handle_editor_state_changed ())); + connect (f, SIGNAL (close_request ()), + this, SLOT (handle_tab_close_request ())); + _tab_widget->setCurrentWidget (f); +} + +file_editor_tab * +file_editor::active_editor_tab () +{ + return dynamic_cast (_tab_widget->currentWidget ()); +} diff --git a/libgui/src/m-editor/file-editor.h b/libgui/src/m-editor/file-editor.h new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/file-editor.h @@ -0,0 +1,112 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef FILEEDITORMDISUBWINDOW_H +#define FILEEDITORMDISUBWINDOW_H + +#include +#include +#include +#include +#include +#include + +#include "main-window.h" +#include "file-editor-interface.h" +#include "file-editor-tab.h" + +const char UNNAMED_FILE[] = ""; +const char SAVE_FILE_FILTER[] = "Octave Files (*.m);;All Files (*.*)"; +enum editor_markers + { + bookmark, + breakpoint, + debugger_position + }; + +class file_editor : public file_editor_interface +{ +Q_OBJECT + +public: + file_editor (QTerminal *terminal, main_window *m); + ~file_editor (); + void loadFile (QString fileName); + + QTerminal * terminal (); + main_window * get_main_window (); + + QMenu * debug_menu (); + QToolBar * toolbar (); + + void handle_entered_debug_mode (); + void handle_quit_debug_mode (); + +public slots: + void request_new_file (); + void request_open_file (); + void request_open_file (QString fileName); + + void request_undo (); + void request_redo (); + void request_copy (); + void request_cut (); + void request_paste (); + void request_save_file (); + void request_save_file_as (); + void request_run_file (); + void request_toggle_bookmark (); + void request_next_bookmark (); + void request_previous_bookmark (); + void request_remove_bookmark (); + + void request_toggle_breakpoint (); + void request_next_breakpoint (); + void request_previous_breakpoint (); + void request_remove_breakpoint (); + + void request_comment_selected_text (); + void request_uncomment_selected_text (); + void request_find (); + + void handle_file_name_changed (QString fileName); + void handle_tab_close_request (int index); + void handle_tab_close_request (); + void active_tab_changed (int index); + void handle_editor_state_changed (); + +private: + void construct (); + void add_file_editor_tab(file_editor_tab *f); + file_editor_tab *active_editor_tab(); + + QMenuBar * _menu_bar; + QToolBar * _tool_bar; + QMenu * _debug_menu; + QAction * _copy_action; + QAction * _cut_action; + QAction * _run_action; + QTabWidget * _tab_widget; + int _marker_breakpoint; +}; + +#endif // FILEEDITORMDISUBWINDOW_H diff --git a/libgui/src/m-editor/find-dialog.cc b/libgui/src/m-editor/find-dialog.cc new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/find-dialog.cc @@ -0,0 +1,195 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include "find-dialog.h" + +find_dialog::find_dialog (QsciScintilla* edit_area, QWidget *parent) + : QDialog (parent) +{ + setWindowTitle ("Find and Replace"); + setWindowIcon (QIcon(":/actions/icons/logo.png")); + + _search_label = new QLabel (tr ("Find &what:")); + _search_line_edit = new QLineEdit; + _search_label->setBuddy (_search_line_edit); + _replace_label = new QLabel (tr ("Re&place with:")); + _replace_line_edit = new QLineEdit; + _replace_label->setBuddy (_replace_line_edit); + + _case_check_box = new QCheckBox (tr ("Match &case")); + _from_start_check_box = new QCheckBox (tr ("Search from &start")); + _wrap_check_box = new QCheckBox (tr ("&Wrap while searching")); + _wrap_check_box->setChecked(true); + _find_next_button = new QPushButton (tr ("&Find Next")); + _find_next_button->setDefault (true); + _replace_button = new QPushButton (tr ("&Replace")); + _replace_all_button = new QPushButton (tr ("Replace &All")); + + _more_button = new QPushButton (tr ("&More")); + _more_button->setCheckable (true); + _more_button->setAutoDefault (false); + + _button_box = new QDialogButtonBox (Qt::Vertical); + _button_box->addButton (_find_next_button, QDialogButtonBox::ActionRole); + _button_box->addButton (_replace_button, QDialogButtonBox::ActionRole); + _button_box->addButton (_replace_all_button, QDialogButtonBox::ActionRole); + _button_box->addButton (_more_button, QDialogButtonBox::ActionRole); + + _extension = new QWidget (this); + _whole_words_check_box = new QCheckBox (tr ("&Whole words")); + _regex_check_box = new QCheckBox (tr ("Regular E&xpressions")); + _backward_check_box = new QCheckBox (tr ("Search &backward")); + _search_selection_check_box = new QCheckBox (tr ("Search se&lection")); + _search_selection_check_box->setCheckable (false); // TODO: Not implemented. + _search_selection_check_box->setEnabled (false); + + _edit_area = edit_area; + connect (_find_next_button, SIGNAL (clicked ()), + this, SLOT (search_next ())); + connect (_more_button, SIGNAL (toggled (bool)), + _extension, SLOT (setVisible (bool))); + connect (_replace_button, SIGNAL (clicked ()), + this, SLOT (replace ())); + connect (_replace_all_button, SIGNAL (clicked ()), + this, SLOT (replace_all ())); + + QVBoxLayout *extension_layout = new QVBoxLayout (); + extension_layout->setMargin (0); + extension_layout->addWidget (_whole_words_check_box); + extension_layout->addWidget (_backward_check_box); + extension_layout->addWidget (_search_selection_check_box); + _extension->setLayout (extension_layout); + + QGridLayout *top_left_layout = new QGridLayout; + top_left_layout->addWidget (_search_label, 1, 1); + top_left_layout->addWidget (_search_line_edit, 1, 2); + top_left_layout->addWidget (_replace_label, 2, 1); + top_left_layout->addWidget (_replace_line_edit, 2, 2); + + QVBoxLayout *left_layout = new QVBoxLayout; + left_layout->addLayout (top_left_layout); + left_layout->insertStretch (1, 5); + left_layout->addWidget (_case_check_box); + left_layout->addWidget (_from_start_check_box); + left_layout->addWidget (_wrap_check_box); + left_layout->addWidget (_regex_check_box); + + QGridLayout *main_layout = new QGridLayout; + main_layout->setSizeConstraint (QLayout::SetFixedSize); + main_layout->addLayout (left_layout, 0, 0); + main_layout->addWidget (_button_box, 0, 1); + main_layout->addWidget (_extension, 1, 0, 1, 2); + setLayout (main_layout); + + _extension->hide (); +} + +void +find_dialog::search_next () +{ + int line = -1, col = -1; + + _find_result_available = false; + if (_from_start_check_box->isChecked ()) + { + line = 1; + col = 1; + } + + if (_edit_area) + { + _find_result_available = _edit_area->findFirst (_search_line_edit->text (), + _regex_check_box->isChecked (), + _case_check_box->isChecked (), + _whole_words_check_box->isChecked (), + _wrap_check_box->isChecked (), + !_backward_check_box->isChecked (), + line,col, + true, + true + ); + } +} + + +void +find_dialog::replace () +{ + if (_edit_area) + { + _edit_area->replace (_replace_line_edit->text ()); + _edit_area->findNext(); + } +} + +void +find_dialog::replace_all () +{ + int count = 0; + + // check whether find & replace srings are different (avoid endless loop!) + int strDiff; + Qt::CaseSensitivity cs; + if (_case_check_box->isChecked()) + { + cs = Qt::CaseSensitive; + } + else + { + cs = Qt::CaseInsensitive; + } + strDiff = QString::compare(_search_line_edit->text(),_replace_line_edit->text(),cs); + + // replace all if strings are different + if (_edit_area && strDiff ) + { + search_next (); // find first occurence + while (_find_result_available) // while search string is found + { + _edit_area->replace (_replace_line_edit->text ()); // replace + count++; // inc counter + _find_result_available = _edit_area->findNext(); // and find next + } + } + // TODO: Show number of replaced strings +} diff --git a/libgui/src/m-editor/find-dialog.h b/libgui/src/m-editor/find-dialog.h new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/find-dialog.h @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial Usage +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Nokia. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef FIND_DIALOG_H +#define FIND_DIALOG_H + +#include +#include + +class QCheckBox; +class QDialogButtonBox; +class QGroupBox; +class QLabel; +class QLineEdit; +class QPushButton; + +class find_dialog : public QDialog +{ + Q_OBJECT +public: + find_dialog (QsciScintilla* edit_area, QWidget *parent = 0); + +private slots: + void search_next (); + void replace (); + void replace_all (); + +private: + QLabel *_search_label; + QLineEdit *_search_line_edit; + QLabel *_replace_label; + QLineEdit *_replace_line_edit; + QCheckBox *_case_check_box; + QCheckBox *_from_start_check_box; + QCheckBox *_wrap_check_box; + QCheckBox *_whole_words_check_box; + QCheckBox *_regex_check_box; + QCheckBox *_search_selection_check_box; + QCheckBox *_backward_check_box; + QDialogButtonBox *_button_box; + QPushButton *_find_next_button; + QPushButton *_replace_button; + QPushButton *_replace_all_button; + QPushButton *_more_button; + QWidget *_extension; + QsciScintilla *_edit_area; + bool _find_result_available; +}; + +#endif // FIND_DIALOG_H + diff --git a/libgui/src/m-editor/lexer-octave-gui.cc b/libgui/src/m-editor/lexer-octave-gui.cc new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/lexer-octave-gui.cc @@ -0,0 +1,146 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "lexer-octave-gui.h" +#include +#include + +// ----------------------------------------------------- +// Some basic functions +// ----------------------------------------------------- +lexer_octave_gui::lexer_octave_gui(QObject *parent) + : QsciLexer(parent) // inherit from base lexer +{ +} + +lexer_octave_gui::~lexer_octave_gui() +{ +} + +const char *lexer_octave_gui::language() const +{ + return "Octave"; // return the name of the language +} + +const char *lexer_octave_gui::lexer() const +{ + return "octave"; // return the name of the lexer +} + +// ----------------------------------------------------- +// The colors for syntax highlighting +// ----------------------------------------------------- +QColor lexer_octave_gui::defaultColor(int style) const +{ + switch (style) + { + case Default: // black + return QColor(0x00,0x00,0x00); + case Operator: // red + return QColor(0xef,0x00,0x00); + case Comment: // gray + return QColor(0x7f,0x7f,0x7f); + case Command: // blue-green + return QColor(0x00,0x7f,0x7f); + case Number: // orange + return QColor(0x7f,0x7f,0x00); + case Keyword: // blue + return QColor(0x00,0x00,0xbf); + case SingleQuotedString: // green + return QColor(0x00,0x7f,0x00); + case DoubleQuotedString: // green-yellow + return QColor(0x4f,0x7f,0x00); + } + return QsciLexer::defaultColor(style); +} + + +// ----------------------------------------------------- +// The font decorations for highlighting +// ----------------------------------------------------- +QFont lexer_octave_gui::defaultFont(int style) const +{ + QFont f; + + switch (style) + { + case Comment: // default but italic + f = QsciLexer::defaultFont(style); + f.setItalic(true); + break; + case Keyword: // default + f = QsciLexer::defaultFont(style); + break; + case Operator: // default + f = QsciLexer::defaultFont(style); + break; + default: // default + f = QsciLexer::defaultFont(style); + break; + } + return f; // return the selected font +} + + +// ----------------------------------------------------- +// Style names +// ----------------------------------------------------- +QString lexer_octave_gui::description(int style) const +{ + switch (style) + { + case Default: + return tr("Default"); + case Comment: + return tr("Comment"); + case Command: + return tr("Command"); + case Number: + return tr("Number"); + case Keyword: + return tr("Keyword"); + case SingleQuotedString: + return tr("Single-quoted string"); + case Operator: + return tr("Operator"); + case Identifier: + return tr("Identifier"); + case DoubleQuotedString: + return tr("Double-quoted string"); + } + return QString(); +} + + +// ----------------------------------------------------- +// The set of keywords for highlighting +// TODO: How to define a second set? +// ----------------------------------------------------- +const char *lexer_octave_gui::keywords(int set) const +{ + if (set == 1) + { + return resource_manager::octave_keywords (); + } + return 0; +} + diff --git a/libgui/src/m-editor/lexer-octave-gui.h b/libgui/src/m-editor/lexer-octave-gui.h new file mode 100644 --- /dev/null +++ b/libgui/src/m-editor/lexer-octave-gui.h @@ -0,0 +1,65 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef LEXEROCTAVE_H +#define LEXEROCTAVE_H + +#include "resource-manager.h" +#include +#include +#include + + +class lexer_octave_gui : public QsciLexer +{ + Q_OBJECT + +public: + // the used styles + enum + { + Default = 0, + Comment = 1, + Command = 2, + Number = 3, + Keyword = 4, + SingleQuotedString = 5, + Operator = 6, + Identifier = 7, + DoubleQuotedString = 8 + }; + + lexer_octave_gui (QObject *parent = 0); + virtual ~lexer_octave_gui (); + const char *language () const; + const char *lexer () const; + QColor defaultColor (int style) const; + QFont defaultFont (int style) const; + const char *keywords (int set) const; + QString description (int style) const; + +private: + lexer_octave_gui (const lexer_octave_gui &); + lexer_octave_gui &operator= (const lexer_octave_gui &); +}; + +#endif diff --git a/libgui/src/main-window.cc b/libgui/src/main-window.cc new file mode 100644 --- /dev/null +++ b/libgui/src/main-window.cc @@ -0,0 +1,870 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "main-window.h" +#include "file-editor.h" +#include "settings-dialog.h" + +main_window::main_window (QWidget * parent) + : QMainWindow (parent), octave_event_observer () +{ + // We have to set up all our windows, before we finally launch octave. + construct (); + octave_link::instance ()->launch_octave(); +} + +main_window::~main_window () +{ +} + +void +main_window::event_accepted (octave_event *e) +{ + if (dynamic_cast (e)) + { + // After clearing the history, we need to reset the model. + _history_dock_widget->reset_model (); + } + delete e; +} + +void +main_window::event_reject (octave_event *e) +{ + delete e; +} + +void +main_window::new_file () +{ + _file_editor->request_new_file (); + focus_editor (); +} + +void +main_window::open_file () +{ + _file_editor->request_open_file (); + focus_editor (); +} + +void +main_window::open_file (QString file_name) +{ + _file_editor->request_open_file (file_name); + focus_editor (); +} + +void +main_window::report_status_message (QString statusMessage) +{ + _status_bar->showMessage (statusMessage, 1000); +} + +void +main_window::handle_save_workspace_request () +{ + QString selectedFile = + QFileDialog::getSaveFileName (this, tr ("Save Workspace"), + resource_manager::get_home_path ()); + if (!selectedFile.isEmpty ()) + { + octave_link::instance () + ->post_event (new octave_save_workspace_event (*this, + selectedFile.toStdString())); + } +} + +void +main_window::handle_load_workspace_request () +{ + QString selectedFile = + QFileDialog::getOpenFileName (this, tr ("Load Workspace"), + resource_manager::get_home_path ()); + if (!selectedFile.isEmpty ()) + { + octave_link::instance () + ->post_event (new octave_load_workspace_event (*this, + selectedFile.toStdString())); + } +} + +void +main_window::handle_clear_workspace_request () +{ + octave_link::instance () + ->post_event (new octave_clear_workspace_event (*this)); +} + +void +main_window::handle_clear_history_request() +{ + octave_link::instance () + ->post_event (new octave_clear_history_event (*this)); +} + +void +main_window::handle_command_double_clicked (QString command) +{ + _terminal->sendText (command); + _terminal->setFocus (); +} + +void +main_window::open_bug_tracker_page () +{ + QDesktopServices::openUrl (QUrl ("http://bugs.octave.org")); +} + +void +main_window::open_agora_page () +{ + QDesktopServices::openUrl (QUrl ("http://agora.octave.org/")); +} + +void +main_window::open_octave_forge_page () +{ + QDesktopServices::openUrl (QUrl ("http://octave.sourceforge.net/")); +} + +void +main_window::process_settings_dialog_request () +{ + settings_dialog *settingsDialog = new settings_dialog (this); + settingsDialog->exec (); + delete settingsDialog; + emit settings_changed (); +} + +void +main_window::notice_settings () +{ + // Set terminal font: + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + QFont font = QFont(); + font.setFamily(settings->value("terminal/fontName").toString()); + font.setPointSize(settings->value("terminal/fontSize").toInt ()); + _terminal->setTerminalFont(font); + + QString cursorType = settings->value ("terminal/cursorType").toString (); + bool cursorBlinking = settings->value ("terminal/cursorBlinking").toBool (); + if (cursorType == "ibeam") + _terminal->setCursorType(QTerminalInterface::IBeamCursor, cursorBlinking); + else if (cursorType == "block") + _terminal->setCursorType(QTerminalInterface::BlockCursor, cursorBlinking); + else if (cursorType == "underline") + _terminal->setCursorType(QTerminalInterface::UnderlineCursor, + cursorBlinking); + + resource_manager::update_network_settings (); +} + +void +main_window::prepare_for_quit () +{ + write_settings (); +} + +void +main_window::reset_windows () +{ + // TODO: Implement. +} + +void +main_window::current_working_directory_has_changed (QString directory) +{ + if (_current_directory_combo_box->count () > 31) + { + _current_directory_combo_box->removeItem (0); + } + _current_directory_combo_box->addItem (directory); + int index = _current_directory_combo_box->findText (directory); + _current_directory_combo_box->setCurrentIndex (index); + + _files_dock_widget->set_current_directory (directory); +} + +void +main_window::change_current_working_directory () +{ + QString selectedDirectory = + QFileDialog::getExistingDirectory(this, tr ("Set working direcotry")); + + if (!selectedDirectory.isEmpty ()) + { + octave_link::instance () + ->post_event (new octave_change_directory_event (*this, + selectedDirectory.toStdString ())); + } +} + +void +main_window::set_current_working_directory (QString directory) +{ + octave_link::instance () + ->post_event (new octave_change_directory_event (*this, + directory.toStdString ())); +} + +void +main_window::current_working_directory_up () +{ + set_current_working_directory (".."); +} + +void +main_window::focus_command_window () +{ + if (!_terminal_dock_widget->isVisible ()) + { + _terminal_dock_widget->setVisible (true); + } + + _terminal_dock_widget->setFocus (); + _terminal_dock_widget->activateWindow (); + _terminal_dock_widget->raise (); + + _terminal->setFocus (); + _terminal->activateWindow (); + _terminal->raise (); +} + +void +main_window::focus_command_history () +{ + if (!_history_dock_widget->isVisible ()) + { + _history_dock_widget->setVisible (true); + } + + _history_dock_widget->setFocus (); + _history_dock_widget->activateWindow (); + _history_dock_widget->raise (); +} + +void +main_window::focus_current_directory () +{ + if (!_files_dock_widget->isVisible ()) + { + _files_dock_widget->setVisible (true); + } + + _files_dock_widget->setFocus (); + _files_dock_widget->activateWindow (); + _files_dock_widget->raise (); +} + +void +main_window::focus_workspace () +{ + if (!_workspace_view->isVisible ()) + { + _workspace_view->setVisible (true); + } + + _workspace_view->setFocus (); + _workspace_view->activateWindow (); + _workspace_view->raise (); +} + +void +main_window::focus_editor () +{ + if (!_file_editor->isVisible ()) + { + _file_editor->setVisible (true); + } + + _file_editor->setFocus (); + _file_editor->activateWindow (); + _file_editor->raise (); +} + +void +main_window::focus_documentation () +{ + if (!_documentation_dock_widget->isVisible ()) + { + _documentation_dock_widget->setVisible (true); + } + + _documentation_dock_widget->setFocus (); + _documentation_dock_widget->activateWindow (); + _documentation_dock_widget->raise (); +} + +void +main_window::handle_entered_debug_mode () +{ + setWindowTitle ("Octave (Debugging)"); + _debug_continue->setEnabled (true); + _debug_step_into->setEnabled (true); + _debug_step_over->setEnabled (true); + _debug_step_out->setEnabled (true); + _debug_quit->setEnabled (true); + _file_editor->handle_entered_debug_mode (); +} + +void +main_window::handle_quit_debug_mode () +{ + setWindowTitle ("Octave"); + _debug_continue->setEnabled (false); + _debug_step_into->setEnabled (false); + _debug_step_over->setEnabled (false); + _debug_step_out->setEnabled (false); + _debug_quit->setEnabled (false); + _file_editor->handle_quit_debug_mode (); +} + +void +main_window::debug_continue () +{ + octave_link::instance () + ->post_event (new octave_debug_continue_event (*this)); +} + +void +main_window::debug_step_into () +{ + octave_link::instance () + ->post_event (new octave_debug_step_into_event (*this)); +} + +void +main_window::debug_step_over () +{ + octave_link::instance () + ->post_event (new octave_debug_step_over_event (*this)); +} + +void +main_window::debug_step_out () +{ + octave_link::instance () + ->post_event (new octave_debug_step_out_event (*this)); +} + +void +main_window::debug_quit () +{ + octave_link::instance () + ->post_event (new octave_debug_quit_event (*this)); +} + +void +main_window::show_about_octave () +{ + QString message = + "GNU Octave\n" + "Copyright (C) 2009 John W. Eaton and others.\n" + "This is free software; see the source code for copying conditions." + "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or" + "FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.\n" + "\n" + "Additional information about Octave is available at http://www.octave.org.\n" + "\n" + "Please contribute if you find this software useful." + "For more information, visit http://www.octave.org/help-wanted.html\n" + "\n" + "Report bugs to (but first, please read" + "http://www.octave.org/bugs.html to learn how to write a helpful report).\n" + "\n" + "For information about changes from previous versions, type `news'.\n"; + + QMessageBox::about (this, tr ("About Octave"), message); +} + +void +main_window::closeEvent (QCloseEvent * closeEvent) +{ + closeEvent->ignore (); + octave_link::instance ()->post_event (new octave_exit_event (*this)); + } + +void +main_window::read_settings () +{ + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ()); + restoreState (settings->value ("MainWindow/windowState").toByteArray ()); + emit settings_changed (); +} + +void +main_window::write_settings () +{ + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + settings->setValue ("MainWindow/geometry", saveGeometry ()); + settings->setValue ("MainWindow/windowState", saveState ()); + settings->sync (); +} + +void +main_window::construct () +{ + _closing = false; // flag for editor files when closed + setWindowIcon (QIcon(":/actions/icons/logo.png")); + + // Setup dockable widgets and the status bar. + _workspace_view = new workspace_view (this); + _workspace_view->setStatusTip (tr ("View the variables in the active workspace.")); + _history_dock_widget = new history_dock_widget (this); + _history_dock_widget->setStatusTip (tr ("Browse and search the command history.")); + _files_dock_widget = new files_dock_widget (this); + _files_dock_widget->setStatusTip (tr ("Browse your files.")); + _documentation_dock_widget= new documentation_dock_widget (this); + _documentation_dock_widget->setStatusTip (tr ("See the documentation for help.")); + _status_bar = new QStatusBar (this); + + _current_directory_combo_box = new QComboBox (this); + _current_directory_combo_box->setFixedWidth (300); + _current_directory_combo_box->setEditable (true); + _current_directory_combo_box->setInsertPolicy (QComboBox::InsertAtTop); + _current_directory_combo_box->setMaxVisibleItems (14); + + _current_directory_tool_button = new QToolButton (this); + _current_directory_tool_button->setIcon (QIcon(":/actions/icons/search.png")); + + _current_directory_up_tool_button = new QToolButton (this); + _current_directory_up_tool_button->setIcon (QIcon(":/actions/icons/up.png")); + + // Octave Terminal subwindow. + _terminal = new QTerminal (this); + _terminal->setObjectName ("OctaveTerminal"); + _terminal->setFocusPolicy (Qt::StrongFocus); + _terminal_dock_widget = new terminal_dock_widget (_terminal, this); + _terminal_dock_widget->setWindowIcon (QIcon(":/actions/icons/terminal.png")); + + QWidget *dummyWidget = new QWidget (); + dummyWidget->setObjectName ("CentralDummyWidget"); + dummyWidget->resize (10, 10); + dummyWidget->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum); + dummyWidget->hide (); + setCentralWidget (dummyWidget); + + _file_editor = new file_editor (_terminal, this); + + QMenu *file_menu = menuBar ()->addMenu (tr ("&File")); + + QMenu *new_menu = file_menu->addMenu(tr ("New")); + + QAction *new_script_action + = new_menu->addAction (QIcon(":/actions/icons/filenew.png"), tr ("Script")); + new_script_action->setShortcut (Qt::ControlModifier + Qt::Key_N); + + QAction *new_function_action = new_menu->addAction (tr ("Function")); + new_function_action->setEnabled (false); // TODO: Make this work. + QAction *new_class_action = new_menu->addAction (tr ("Class")); + new_class_action->setEnabled (false); // TODO: Make this work. + QAction *new_enumeration_action = new_menu->addAction (tr ("Enumeration")); + new_enumeration_action->setEnabled (false); // TODO: Make this work. + QAction *new_figure_action = new_menu->addAction (tr ("Figure")); + new_figure_action->setEnabled (false); // TODO: Make this work. + QAction *new_variable_action = new_menu->addAction (tr ("Variable")); + new_variable_action->setEnabled (false); // TODO: Make this work. + QAction *new_model_action = new_menu->addAction (tr ("Model")); + new_model_action->setEnabled (false); // TODO: Make this work. + QAction *new_gui_action = new_menu->addAction (tr ("GUI")); + new_gui_action->setEnabled (false); // TODO: Make this work. + + QAction *open_action + = file_menu->addAction (QIcon(":/actions/icons/fileopen.png"), tr ("Open...")); + open_action->setShortcut (Qt::ControlModifier + Qt::Key_O); + + QAction *close_command_window_action + = file_menu->addAction (tr ("Close Command Window")); + close_command_window_action->setShortcut (Qt::ControlModifier + Qt::Key_W); + close_command_window_action->setEnabled (false); // TODO: Make this work. + + file_menu->addSeparator (); + QAction *import_data_action + = file_menu->addAction (tr ("Import Data...")); + import_data_action->setEnabled (false); // TODO: Make this work. + + QAction *save_workspace_action + = file_menu->addAction (tr ("Save Workspace...")); + save_workspace_action->setShortcut (Qt::ControlModifier + Qt::Key_S); + file_menu->addSeparator (); + + QAction *preferences_action + = file_menu->addAction (QIcon(":/actions/icons/configure.png"), + tr ("Preferences...")); + file_menu->addSeparator (); + QAction *page_setup_action + = file_menu->addAction (tr ("Page Setup...")); + page_setup_action->setEnabled (false); // TODO: Make this work. + QAction *print_action + = file_menu->addAction (tr ("Print")); + print_action->setShortcut (Qt::ControlModifier + Qt::Key_P); + print_action->setEnabled (false); // TODO: Make this work. + QAction *print_selection_action + = file_menu->addAction (tr ("Print Selection...")); + print_selection_action->setEnabled (false); // TODO: Make this work. + + file_menu->addSeparator (); + QAction *exit_action = file_menu->addAction (tr ("Exit")); + exit_action->setShortcut (Qt::ControlModifier + Qt::Key_Q); + + + QMenu *edit_menu = menuBar ()->addMenu (tr ("&Edit")); + QAction *undo_action + = edit_menu->addAction (QIcon(":/actions/icons/undo.png"), tr ("Undo")); + undo_action->setShortcut (QKeySequence::Undo); + + QAction *redo_action + = edit_menu->addAction (QIcon(":/actions/icons/redo.png"), tr ("Redo")); + redo_action->setShortcut (QKeySequence::Redo); + edit_menu->addSeparator (); + + QAction *cut_action + = edit_menu->addAction (QIcon(":/actions/icons/editcut.png"), tr ("Cut")); + cut_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_X); + + QAction *copy_action + = edit_menu->addAction (QIcon(":/actions/icons/editcopy.png"), tr ("Copy")); + copy_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_C); + + QAction *paste_action + = edit_menu->addAction (QIcon(":/actions/icons/editpaste.png"), tr ("Paste")); + paste_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_V); + + QAction *paste_to_workspace_action + = edit_menu->addAction (tr ("Paste To Workspace...")); + paste_to_workspace_action->setEnabled (false); // TODO: Make this work. + edit_menu->addSeparator (); + + QAction *select_all_action + = edit_menu->addAction (tr ("Select All")); + select_all_action->setEnabled (false); // TODO: Make this work. + QAction *delete_action + = edit_menu->addAction (tr ("Delete")); + delete_action->setShortcut (Qt::Key_Delete); + delete_action->setEnabled (false); // TODO: Make this work. + edit_menu->addSeparator (); + + QAction *find_action + = edit_menu->addAction (tr ("Find...")); + find_action->setEnabled (false); // TODO: Make this work. + QAction *find_files_action + = edit_menu->addAction (tr ("Find Files...")); + find_files_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + + Qt::Key_F); + find_files_action->setEnabled (false); // TODO: Make this work. + edit_menu->addSeparator (); + + QAction *clear_command_window_action + = edit_menu->addAction (tr ("Clear Command Window")); + clear_command_window_action->setEnabled (false); // TODO: Make this work. + QAction *clear_command_history + = edit_menu->addAction(tr ("Clear Command History")); + QAction * clear_workspace_action + = edit_menu->addAction (tr ("Clear Workspace")); + + _debug_menu = menuBar ()->addMenu (tr ("De&bug")); + + _debug_step_over = _debug_menu->addAction (QIcon (":/actions/icons/db_step.png"), tr ("Step")); + _debug_step_over->setEnabled (false); + _file_editor->debug_menu ()->addAction (_debug_step_over); + _file_editor->toolbar ()->addAction (_debug_step_over); + _debug_step_over->setShortcut (Qt::Key_F10); + + _debug_step_into = _debug_menu->addAction (QIcon (":/actions/icons/db_step_in.png"), tr ("Step in")); + _debug_step_into->setEnabled (false); + _file_editor->debug_menu ()->addAction (_debug_step_into); + _file_editor->toolbar ()->addAction (_debug_step_into); + _debug_step_into->setShortcut (Qt::Key_F11); + + _debug_step_out = _debug_menu->addAction (QIcon (":/actions/icons/db_step_out.png"), tr ("Step out")); + _debug_step_out->setEnabled (false); + _file_editor->debug_menu ()->addAction (_debug_step_out); + _file_editor->toolbar ()->addAction (_debug_step_out); + _debug_step_out->setShortcut (Qt::ShiftModifier + Qt::Key_F11); + + _debug_continue = _debug_menu->addAction (QIcon (":/actions/icons/db_cont.png"), tr ("Continue")); + _debug_continue->setEnabled (false); + _file_editor->debug_menu ()->addAction (_debug_continue); + _file_editor->toolbar ()->addAction (_debug_continue); + _debug_continue->setShortcut (Qt::Key_F5); + + _debug_menu->addSeparator (); + _file_editor->debug_menu ()->addSeparator (); + + _debug_quit = _debug_menu->addAction (QIcon (":/actions/icons/db_stop.png"), tr ("Exit Debug Mode")); + _debug_quit->setEnabled (false); + _file_editor->debug_menu ()->addAction (_debug_quit); + _file_editor->toolbar ()->addAction (_debug_quit); + _debug_quit->setShortcut (Qt::ShiftModifier + Qt::Key_F5); + + //QMenu *parallelMenu = menuBar ()->addMenu (tr ("&Parallel")); + + QMenu * desktop_menu = menuBar ()->addMenu (tr ("&Desktop")); + QAction * load_workspace_action = desktop_menu->addAction (tr ("Load workspace")); + + + // Window menu + QMenu * window_menu = menuBar ()->addMenu (tr ("&Window")); + QAction * show_command_window_action + = window_menu->addAction (tr ("Show Command Window")); + show_command_window_action->setCheckable (true); + show_command_window_action->setShortcut (Qt::ControlModifier + + Qt::ShiftModifier + Qt::Key_0); + + QAction * show_history_action + = window_menu->addAction (tr ("Show Command History")); + show_history_action->setCheckable (true); + show_history_action->setShortcut (Qt::ControlModifier + + Qt::ShiftModifier + Qt::Key_1); + QAction * show_file_browser_action + = window_menu->addAction (tr ("Show Current Directory")); + show_file_browser_action->setCheckable (true); + show_file_browser_action->setShortcut (Qt::ControlModifier + + Qt::ShiftModifier + Qt::Key_2); + + QAction * show_workspace_action + = window_menu->addAction (tr ("Show Workspace")); + show_workspace_action->setCheckable (true); + show_workspace_action->setShortcut (Qt::ControlModifier + + Qt::ShiftModifier + Qt::Key_3); + + QAction * show_editor_action = window_menu->addAction (tr ("Show Editor")); + show_editor_action->setCheckable (true); + show_editor_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + + Qt::Key_4); + + QAction * show_documentation_action = window_menu->addAction (tr ("Show Documentation")); + show_documentation_action->setCheckable (true); + show_documentation_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + + Qt::Key_5); + window_menu->addSeparator (); + + QAction * command_window_action + = window_menu->addAction (tr ("Command Window")); + command_window_action->setShortcut (Qt::ControlModifier + Qt::Key_0); + + QAction * history_action + = window_menu->addAction (tr ("Command History")); + history_action->setShortcut (Qt::ControlModifier + Qt::Key_1); + + QAction * file_browser_action + = window_menu->addAction (tr ("Current Directory")); + file_browser_action->setShortcut (Qt::ControlModifier + Qt::Key_2); + + QAction * workspace_action + = window_menu->addAction (tr ("Workspace")); + workspace_action->setShortcut (Qt::ControlModifier + Qt::Key_3); + + QAction * editor_action + = window_menu->addAction (tr ("Editor")); + editor_action->setShortcut (Qt::ControlModifier + Qt::Key_4); + + QAction * documentation_action + = window_menu->addAction (tr ("Documentation")); + documentation_action->setShortcut (Qt::ControlModifier + Qt::Key_5); + + window_menu->addSeparator (); + QAction * reset_windows_action + = window_menu->addAction (tr ("Reset Windows")); + reset_windows_action->setEnabled (false); // TODO: Make this work. + + // Help menu + QMenu * help_menu = menuBar ()->addMenu (tr ("&Help")); + QAction * report_bug_action + = help_menu->addAction (tr ("Report Bug")); + QAction * agora_action + = help_menu->addAction (tr ("Visit Agora")); + QAction * octave_forge_action + = help_menu->addAction (tr ("Visit Octave Forge")); + help_menu->addSeparator (); + + QAction * about_octave_action + = help_menu->addAction (tr ("About Octave")); + + // Toolbars + QToolBar *main_tool_bar = addToolBar ("Main"); + main_tool_bar->addAction (new_script_action); + main_tool_bar->addAction (open_action); + main_tool_bar->addSeparator (); + main_tool_bar->addAction (cut_action); + main_tool_bar->addAction (copy_action); + main_tool_bar->addAction (paste_action); + main_tool_bar->addAction (undo_action); + main_tool_bar->addAction (redo_action); + main_tool_bar->addSeparator (); + main_tool_bar->addWidget (new QLabel (tr ("Current Directory:"))); + main_tool_bar->addWidget (_current_directory_combo_box); + main_tool_bar->addWidget (_current_directory_tool_button); + main_tool_bar->addWidget (_current_directory_up_tool_button); + + connect (qApp, SIGNAL (aboutToQuit ()), + this, SLOT (prepare_for_quit ())); + connect (preferences_action, SIGNAL (triggered ()), + this, SLOT (process_settings_dialog_request ())); + connect (exit_action, SIGNAL (triggered ()), + this, SLOT (close ())); + connect (new_script_action, SIGNAL (triggered ()), + this, SLOT (new_file ())); + connect (open_action, SIGNAL (triggered ()), + this, SLOT (open_file ())); + connect (report_bug_action, SIGNAL (triggered ()), + this, SLOT (open_bug_tracker_page ())); + connect (agora_action, SIGNAL (triggered ()), + this, SLOT (open_agora_page ())); + connect (octave_forge_action, SIGNAL (triggered ()), + this, SLOT (open_octave_forge_page ())); + connect (about_octave_action, SIGNAL (triggered ()), + this, SLOT (show_about_octave ())); + connect (show_command_window_action, SIGNAL (toggled (bool)), + _terminal_dock_widget, SLOT (setVisible (bool))); + connect (_terminal_dock_widget, SIGNAL (active_changed (bool)), + show_command_window_action, SLOT (setChecked (bool))); + connect (show_workspace_action, SIGNAL (toggled (bool)), + _workspace_view, SLOT (setVisible (bool))); + connect (_workspace_view, SIGNAL (active_changed (bool)), + show_workspace_action, SLOT (setChecked (bool))); + connect (show_history_action, SIGNAL (toggled (bool)), + _history_dock_widget, SLOT (setVisible (bool))); + connect (_history_dock_widget, SIGNAL (active_changed (bool)), + show_history_action, SLOT (setChecked (bool))); + connect (show_file_browser_action, SIGNAL (toggled (bool)), + _files_dock_widget, SLOT (setVisible (bool))); + connect (_files_dock_widget, SIGNAL (active_changed (bool)), + show_file_browser_action, SLOT (setChecked (bool))); + connect (show_editor_action, SIGNAL (toggled (bool)), + _file_editor, SLOT (setVisible (bool))); + connect (_file_editor, SIGNAL (active_changed (bool)), + show_editor_action, SLOT (setChecked (bool))); + connect (show_documentation_action, SIGNAL (toggled (bool)), + _documentation_dock_widget, SLOT (setVisible (bool))); + connect (_documentation_dock_widget, SIGNAL (active_changed (bool)), + show_documentation_action, SLOT (setChecked (bool))); + + connect (command_window_action, SIGNAL (triggered ()), + this, SLOT (focus_command_window ())); + connect (workspace_action, SIGNAL (triggered ()), + this, SLOT (focus_workspace ())); + connect (history_action, SIGNAL (triggered ()), + this, SLOT (focus_command_history ())); + connect (file_browser_action, SIGNAL (triggered ()), + this, SLOT (focus_current_directory ())); + connect (editor_action, SIGNAL (triggered ()), + this, SLOT (focus_editor ())); + connect (documentation_action, SIGNAL (triggered ()), + this, SLOT (focus_documentation ())); + + connect (reset_windows_action, SIGNAL (triggered ()), + this, SLOT (reset_windows ())); + connect (this, SIGNAL (settings_changed ()), + _files_dock_widget, SLOT (notice_settings ())); + connect (this, SIGNAL (settings_changed ()), + this, SLOT (notice_settings ())); + connect (_files_dock_widget, SIGNAL (open_file (QString)), + this, SLOT (open_file (QString))); + connect (_files_dock_widget, SIGNAL (displayed_directory_changed(QString)), + this, SLOT (set_current_working_directory(QString))); + connect (_history_dock_widget, SIGNAL (information (QString)), + this, SLOT (report_status_message (QString))); + connect (_history_dock_widget, SIGNAL (command_double_clicked (QString)), + this, SLOT (handle_command_double_clicked (QString))); + connect (save_workspace_action, SIGNAL (triggered ()), + this, SLOT (handle_save_workspace_request ())); + connect (load_workspace_action, SIGNAL (triggered ()), + this, SLOT (handle_load_workspace_request ())); + connect (clear_workspace_action, SIGNAL (triggered ()), + this, SLOT (handle_clear_workspace_request ())); + connect (_current_directory_tool_button, SIGNAL (clicked ()), + this, SLOT (change_current_working_directory ())); + connect (_current_directory_up_tool_button, SIGNAL (clicked ()), + this, SLOT (current_working_directory_up())); + connect (copy_action, SIGNAL (triggered()), + _terminal, SLOT (copyClipboard ())); + connect (paste_action, SIGNAL (triggered()), + _terminal, SLOT (pasteClipboard ())); + connect (_current_directory_combo_box, SIGNAL (activated (QString)), + this, SLOT (set_current_working_directory (QString))); + connect (_debug_continue, SIGNAL (triggered ()), + this, SLOT (debug_continue ())); + connect (_debug_step_into, SIGNAL (triggered ()), + this, SLOT (debug_step_into ())); + connect (_debug_step_over, SIGNAL (triggered ()), + this, SLOT (debug_step_over ())); + connect (_debug_step_out, SIGNAL (triggered ()), + this, SLOT (debug_step_out ())); + connect (_debug_quit, SIGNAL (triggered ()), + this, SLOT (debug_quit ())); + + connect (clear_command_history, SIGNAL (triggered ()), + this, SLOT (handle_clear_history_request ())); + + setWindowTitle ("Octave"); + setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks); + addDockWidget (Qt::LeftDockWidgetArea, _workspace_view); + addDockWidget (Qt::LeftDockWidgetArea, _history_dock_widget); + addDockWidget (Qt::RightDockWidgetArea, _files_dock_widget); + addDockWidget (Qt::RightDockWidgetArea, _file_editor); + addDockWidget (Qt::BottomDockWidgetArea, _terminal_dock_widget); + addDockWidget (Qt::RightDockWidgetArea, _documentation_dock_widget); + setStatusBar (_status_bar); + read_settings (); + + _octave_qt_event_listener = new octave_qt_event_listener (); + octave_link::instance ()->register_event_listener (_octave_qt_event_listener); + + connect (_octave_qt_event_listener, + SIGNAL (current_directory_has_changed_signal (QString)), + this, + SLOT (current_working_directory_has_changed (QString))); + + connect (_octave_qt_event_listener, + SIGNAL (entered_debug_mode_signal ()), + this, + SLOT(handle_entered_debug_mode ())); + + connect (_octave_qt_event_listener, + SIGNAL (quit_debug_mode_signal ()), + this, + SLOT (handle_quit_debug_mode ())); +} + diff --git a/libgui/src/main-window.h b/libgui/src/main-window.h new file mode 100644 --- /dev/null +++ b/libgui/src/main-window.h @@ -0,0 +1,161 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +// Qt includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Editor includes +#include "file-editor-interface.h" + +// QTerminal includes +#include "QTerminal.h" + +// Own includes +#include "resource-manager.h" +#include "octave-link.h" +#include "workspace-view.h" +#include "history-dockwidget.h" +#include "files-dockwidget.h" +#include "terminal-dockwidget.h" +#include "documentation-dockwidget.h" +#include "octave-qt-event-listener.h" +#include "octave-event-observer.h" + +/** + * \class MainWindow + * + * Represents the main window. + */ +class main_window + : public QMainWindow, public octave_event_observer +{ +Q_OBJECT public: + main_window (QWidget * parent = 0); + ~main_window (); + + void event_accepted (octave_event *e); + void event_reject (octave_event *e); + + QTerminal *get_terminal_view () { return _terminal; } + history_dock_widget *get_history_dock_widget () + { + return _history_dock_widget; + } + files_dock_widget *get_files_dock_widget () + { + return _files_dock_widget; + } + bool is_closing () { return _closing; } + +signals: + void settings_changed (); + +public slots: + void report_status_message (QString statusMessage); + void handle_save_workspace_request (); + void handle_load_workspace_request (); + void handle_clear_workspace_request (); + void handle_clear_history_request (); + void handle_command_double_clicked (QString command); + void new_file (); + void open_file (); + void open_file (QString file_name); + void open_bug_tracker_page (); + void open_agora_page (); + void open_octave_forge_page (); + void process_settings_dialog_request (); + void show_about_octave (); + void notice_settings (); + void prepare_for_quit (); + void reset_windows (); + void current_working_directory_has_changed (QString directory); + void change_current_working_directory (); + void set_current_working_directory (QString directory); + void current_working_directory_up (); + + void focus_command_window (); + void focus_command_history (); + void focus_current_directory (); + void focus_workspace (); + void focus_editor (); + void focus_documentation (); + + void handle_entered_debug_mode (); + void handle_quit_debug_mode (); + void debug_continue (); + void debug_step_into (); + void debug_step_over (); + void debug_step_out (); + void debug_quit (); + +protected: + void closeEvent (QCloseEvent * closeEvent); + void read_settings (); + void write_settings (); + +private: + void construct (); + void establish_octave_link (); + + QTerminal * _terminal; + file_editor_interface * _file_editor; + QMenu * _debug_menu; + + QAction * _debug_continue; + QAction * _debug_step_into; + QAction * _debug_step_over; + QAction * _debug_step_out; + QAction * _debug_quit; + + // Dock widgets. + workspace_view * _workspace_view; + history_dock_widget * _history_dock_widget; + files_dock_widget * _files_dock_widget; + terminal_dock_widget * _terminal_dock_widget; + documentation_dock_widget*_documentation_dock_widget; + + // Toolbars. + QStatusBar * _status_bar; + QComboBox * _current_directory_combo_box; + QToolButton * _current_directory_tool_button; + QToolButton * _current_directory_up_tool_button; + + octave_qt_event_listener *_octave_qt_event_listener; + + // Flag for closing whole application + bool _closing; +}; + +#endif // MAINWINDOW_H diff --git a/libgui/src/octave-adapter/octave-event-listener.h b/libgui/src/octave-adapter/octave-event-listener.h new file mode 100644 --- /dev/null +++ b/libgui/src/octave-adapter/octave-event-listener.h @@ -0,0 +1,41 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef OCTAVEEVENTLISTENER_H +#define OCTAVEEVENTLISTENER_H + +#include + +class octave_event_listener +{ + public: + octave_event_listener () { } + virtual ~octave_event_listener () { } + + virtual void current_directory_has_changed (std::string directory) = 0; + virtual void about_to_exit () = 0; + + virtual void entered_debug_mode () = 0; + virtual void quit_debug_mode () = 0; +}; + +#endif // OCTAVEEVENTLISTENER_H diff --git a/libgui/src/octave-adapter/octave-event-observer.h b/libgui/src/octave-adapter/octave-event-observer.h new file mode 100644 --- /dev/null +++ b/libgui/src/octave-adapter/octave-event-observer.h @@ -0,0 +1,53 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef OCTAVEEVENTOBSERVER_H +#define OCTAVEEVENTOBSERVER_H + +class octave_event; + +/** + * \class octave_event_observer + * \brief Implements the observer part for the observer pattern. + */ +class octave_event_observer +{ + public: + octave_event_observer () { } + virtual ~octave_event_observer () { } + + /** + * This will be called when an event has been accepted. Operations + * in this routine will be processed in the octave thread. + */ + virtual void event_accepted (octave_event *e) = 0; + + /** + * This will be called when an event has been rejected. Operations + * in this routine will be processed in the octave thread. + */ + virtual void event_reject (octave_event *e) = 0; +}; + +#include "octave-event.h" + +#endif // OCTAVEEVENTOBSERVER_H diff --git a/libgui/src/octave-adapter/octave-event.cc b/libgui/src/octave-adapter/octave-event.cc new file mode 100644 --- /dev/null +++ b/libgui/src/octave-adapter/octave-event.cc @@ -0,0 +1,176 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid +Copyright (C) 2011-2012 John P. Swensen + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "cmd-hist.h" +#include "oct-env.h" + +#include "debug.h" +#include "oct-obj.h" +#include "parse.h" +#include "symtab.h" +#include "toplev.h" + +#include "octave-event.h" + +#include + +void +octave_event::call_octave_function (std::string name) +{ + call_octave_function (name, octave_value_list ()); +} + +void +octave_event::call_octave_function (std::string name, + const octave_value_list& args, + int nargout) +{ + try + { + feval (name, args, nargout); + } catch (...) { } // Ignore exceptions. Crashes without that. +} + +void +octave_event::finish_readline_event () const +{ + rl_line_buffer[0] = '\0'; + rl_point = rl_end = 0; + rl_done = 1; + //rl_forced_update_display (); +} + +bool +octave_clear_history_event::perform () +{ + int i; + while ((i = command_history::length ()) > 0) { + command_history::remove (i - 1); + } + return true; +} + +bool +octave_debug_step_into_event::perform () +{ + octave_value_list args; + args.append (octave_value ("in")); + call_octave_function ("dbstep", args); + finish_readline_event (); + return true; +} + +bool +octave_debug_step_out_event::perform () +{ + octave_value_list args; + args.append (octave_value ("out")); + call_octave_function ("dbstep", args); + finish_readline_event (); + return true; +} + + +bool +octave_exit_event::perform () +{ + clean_up_and_exit (0); + return true; +} + +bool +octave_run_file_event::perform () +{ + octave_value_list args; + args.append (octave_value (_file)); + call_octave_function ("run", args); + finish_readline_event (); + return true; +} + +bool +octave_change_directory_event::perform () +{ + return octave_env::chdir (_directory); +} + +bool +octave_load_workspace_event::perform () +{ + octave_value_list args; + args.append (octave_value (_file)); + call_octave_function ("load", args); + return true; +} + +bool +octave_save_workspace_event::perform () +{ + octave_value_list args; + args.append (octave_value (_file)); + call_octave_function ("save", args); + return true; +} + +bool +octave_add_breakpoint_event::perform () +{ + bp_table::intmap intmap; + intmap[0] = _line + 1; + + std::string previous_directory = octave_env::get_current_directory (); + octave_env::chdir (_path); + intmap = bp_table::add_breakpoint (_function_name, intmap); + octave_env::chdir (previous_directory); + return intmap.size () > 0; +} + +bool +octave_remove_breakpoint_event::perform () +{ + bp_table::intmap intmap; + intmap[0] = _line; + + std::string previous_directory = octave_env::get_current_directory (); + octave_env::chdir (_path); + bp_table::remove_breakpoint (_function_name, intmap); + octave_env::chdir (previous_directory); + return true; // TODO: Check result. +} + +bool +octave_remove_all_breakpoints_event::perform () +{ + bp_table::intmap intmap; + std::string previous_directory = octave_env::get_current_directory (); + octave_env::chdir (_path); + intmap = bp_table::remove_all_breakpoints_in_file (_function_name, true); + octave_env::chdir (previous_directory); + return intmap.size() > 0; +} diff --git a/libgui/src/octave-adapter/octave-event.h b/libgui/src/octave-adapter/octave-event.h new file mode 100644 --- /dev/null +++ b/libgui/src/octave-adapter/octave-event.h @@ -0,0 +1,383 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid +Copyright (C) 2011-2012 John P. Swensen + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef OCTAVEEVENT_H +#define OCTAVEEVENT_H + +#include + +class octave_value_list; + +#include "octave-event-observer.h" + +/** + * \class octave_event + * \brief Base class for an octave event. + * In order to make communication with octave threadsafe, comunication is + * implemented via events. An application may create events and post them, + * however there is no guarantee events will be processed in a given time. + * + * In order to create an event, there must be an event observer. The event + * observer will be given the opportunity to react on the event as soon as + * it has been processed in the octave thread. Accepting and ignoring takes + * places in the octave thread. + */ +class octave_event +{ + public: + octave_event (octave_event_observer& o) + : _octave_event_observer (o) + { } + + virtual ~octave_event () + { } + + /** Performs what is necessary to make this event happen. This + * code is thread-safe since it will be executed in the octave + * thread. However, you should take care to keep this code as + * short as possible. */ + virtual bool perform () = 0; + + /** + * Accepts this event. This allows the event observer to react properly + * onto the event. + */ + void accept () + { _octave_event_observer.event_accepted (this); } + + /** + * Rejects this event. This allows the event observer to react properly + * onto the event. + */ + void reject () + { _octave_event_observer.event_reject (this); } + + protected: + void call_octave_function (std::string name); + + void call_octave_function (std::string name, + const octave_value_list& args, + int nargout = 0); + + void finish_readline_event () const; + + private: + octave_event_observer& _octave_event_observer; +}; + +class octave_update_history_event : public octave_event +{ + public: + /** Creates a new octave_exit_event. */ + octave_update_history_event (octave_event_observer& o) + : octave_event (o) + { } + + bool perform () + { return true; /* Always grant. */ } +}; + +class octave_update_workspace_event : public octave_event +{ + public: + /** Creates a new octave_exit_event. */ + octave_update_workspace_event (octave_event_observer& o) + : octave_event (o) + { } + + bool perform () + { return true; /* Always grant. */ } +}; + +/** Implements an octave exit event. */ +class octave_exit_event : public octave_event +{ + public: + /** Creates a new octave_exit_event. */ + octave_exit_event (octave_event_observer& o) + : octave_event (o) + { } + + bool perform (); +}; + +/** Implements an octave run file event. */ +class octave_run_file_event : public octave_event +{ + public: + /** Creates a new octave_run_file_event. */ + octave_run_file_event (octave_event_observer& o, + std::string file) + : octave_event (o) + { _file = file; } + + bool perform (); + + private: + std::string _file; +}; + +/** Implements a change directory event. */ +class octave_change_directory_event : public octave_event +{ + public: + /** Creates a new octave_change_directory_event. */ + octave_change_directory_event (octave_event_observer& o, + std::string directory) + : octave_event (o) + { _directory = directory; } + + bool perform (); + + private: + std::string _directory; +}; + +/** Implements a clear workspace event. */ +class octave_clear_workspace_event : public octave_event +{ + public: + /** Creates a new octave_run_file_event. */ + octave_clear_workspace_event (octave_event_observer& o) + : octave_event (o) + { } + + bool perform () + { + call_octave_function ("clear"); + return true; + } +}; + +/** Implements a load workspace event. */ +class octave_load_workspace_event : public octave_event +{ + public: + /** Creates a new octave_change_directory_event. */ + octave_load_workspace_event (octave_event_observer& o, + std::string file) + : octave_event (o) + { _file = file; } + + bool perform (); + + private: + std::string _file; +}; + +/** Implements a save workspace event. */ +class octave_save_workspace_event : public octave_event +{ + public: + /** Creates a new octave_change_directory_event. */ + octave_save_workspace_event (octave_event_observer& o, + std::string file) + : octave_event (o) + { _file = file; } + + bool perform (); + + private: + std::string _file; +}; + +class octave_clear_history_event : public octave_event +{ + public: + /** Creates a new octave_clear_history_event. */ + octave_clear_history_event (octave_event_observer& o) + : octave_event (o) + { } + + bool perform (); +}; + +class octave_add_breakpoint_event : public octave_event +{ + public: + octave_add_breakpoint_event (octave_event_observer& o, + std::string path, + std::string function_name, + int line) + : octave_event (o) + { + _path = path; + _function_name = function_name; + _line = line; + } + + bool perform (); + + std::string get_path () + { + return _path; + } + + std::string get_function_name () + { + return _function_name; + } + + int get_line () + { + return _line; + } + + private: + std::string _path; + std::string _function_name; + int _line; +}; + +class octave_remove_breakpoint_event : public octave_event +{ + public: + octave_remove_breakpoint_event (octave_event_observer& o, + std::string path, + std::string function_name, + int line) + : octave_event (o) + { + _path = path; + _function_name = function_name; + _line = line; + } + + bool perform (); + + std::string get_path () + { + return _path; + } + + std::string get_function_name () + { + return _function_name; + } + + int get_line () + { + return _line; + } + + private: + std::string _path; + std::string _function_name; + int _line; +}; + +class octave_remove_all_breakpoints_event : public octave_event +{ + public: + octave_remove_all_breakpoints_event (octave_event_observer& o, + std::string path, + std::string function_name) + : octave_event (o) + { + _path = path; + _function_name = function_name; + } + + bool perform (); + + std::string get_path () + { + return _path; + } + + std::string get_function_name () + { + return _function_name; + } + + private: + std::string _path; + std::string _function_name; +}; + +class octave_debug_step_into_event : public octave_event +{ + public: + /** Creates a new octave_debug_step_into_event. */ + octave_debug_step_into_event (octave_event_observer& o) + : octave_event (o) { } + + bool perform (); +}; + +class octave_debug_step_over_event : public octave_event +{ + public: + /** Creates a new octave_debug_step_over_event. */ + octave_debug_step_over_event (octave_event_observer& o) + : octave_event (o) { } + + bool perform () + { + call_octave_function ("dbnext"); + finish_readline_event (); + return true; + } +}; + +class octave_debug_step_out_event : public octave_event +{ + public: + /** Creates a new octave_debug_step_out_event. */ + octave_debug_step_out_event (octave_event_observer& o) + : octave_event (o) { } + + bool perform (); +}; + +class octave_debug_continue_event : public octave_event +{ + public: + /** Creates a new octave_debug_step_out_event. */ + octave_debug_continue_event (octave_event_observer& o) + : octave_event (o) { } + + bool perform () + { + call_octave_function ("dbcont"); + finish_readline_event (); + return true; + } +}; + +class octave_debug_quit_event : public octave_event +{ + public: + /** Creates a new octave_debug_step_out_event. */ + octave_debug_quit_event (octave_event_observer& o) + : octave_event (o) { } + + bool perform () + { + call_octave_function ("dbquit"); + finish_readline_event (); + return true; + } +}; + +#endif // OCTAVEEVENT_H diff --git a/libgui/src/octave-adapter/octave-link.cc b/libgui/src/octave-adapter/octave-link.cc new file mode 100644 --- /dev/null +++ b/libgui/src/octave-adapter/octave-link.cc @@ -0,0 +1,167 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid +Copyright (C) 2011-2012 John P. Swensen + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "cmd-edit.h" +#include "oct-env.h" +#include "oct-mutex.h" +#include "symtab.h" +#include "toplev.h" + +#include "octave-link.h" + +int octave_readline_hook () +{ + octave_link::instance ()->entered_readline_hook (); + octave_link::instance ()->generate_events (); + octave_link::instance ()->process_events (); + octave_link::instance ()->finished_readline_hook (); + return 0; +} + +void octave_exit_hook (int status) +{ + (void) status; + octave_link::instance ()->about_to_exit (); +} + +octave_link octave_link::_singleton; + +octave_link::octave_link () +{ + _event_queue_mutex = new octave_mutex (); + _last_working_directory = ""; + _debugging_mode_active = false; +} + +octave_link::~octave_link () +{ +} + +void +octave_link::launch_octave () +{ + // Create both threads. + _octave_main_thread = new octave_main_thread (); + command_editor::add_event_hook (octave_readline_hook); + octave_exit = octave_exit_hook; + + // Start the first one. + _octave_main_thread->start (); +} + +void +octave_link::register_event_listener (octave_event_listener *oel) +{ _octave_event_listener = oel; } + +void +octave_link::generate_events () +{ + std::string current_working_directory = octave_env::get_current_directory (); + if (current_working_directory != _last_working_directory) + { + _last_working_directory = current_working_directory; + if (_octave_event_listener) + _octave_event_listener + ->current_directory_has_changed (_last_working_directory); + } + + if (_debugging_mode_active != Vdebugging) + { + _debugging_mode_active = Vdebugging; + if (_octave_event_listener) + { + if (_debugging_mode_active) + _octave_event_listener->entered_debug_mode (); + else + _octave_event_listener->quit_debug_mode (); + } + } +} + +void +octave_link::process_events () +{ + _event_queue_mutex->lock (); + + while (_event_queue.size () > 0) + { + octave_event * e = _event_queue.front (); + _event_queue.pop (); + if (e->perform ()) + e->accept (); + else + e->reject (); + } + _event_queue_mutex->unlock (); +} + +void +octave_link::post_event (octave_event *e) +{ + if (e) + { + _event_queue_mutex->lock (); + _event_queue.push (e); + _event_queue_mutex->unlock (); + } +} + +void +octave_link::event_accepted (octave_event *e) +{ delete e; } + +void +octave_link::event_reject (octave_event *e) +{ delete e; } + +void +octave_link::about_to_exit () +{ + _event_queue_mutex->lock (); + while (!_event_queue.empty ()) + _event_queue.pop (); + + _event_queue_mutex->unlock (); + + if (_octave_event_listener) + _octave_event_listener->about_to_exit (); +} + +void +octave_link::entered_readline_hook () +{ } + +void +octave_link::finished_readline_hook () +{ +} + +std::string +octave_link::get_last_working_directory () +{ + return _last_working_directory; +} diff --git a/libgui/src/octave-adapter/octave-link.h b/libgui/src/octave-adapter/octave-link.h new file mode 100644 --- /dev/null +++ b/libgui/src/octave-adapter/octave-link.h @@ -0,0 +1,94 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid +Copyright (C) 2011-2012 John P. Swensen + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef OCTAVELINK_H +#define OCTAVELINK_H + +#include +#include + +class octave_mutex; + +#include "octave-main-thread.h" +#include "octave-event.h" +#include "octave-event-observer.h" +#include "octave-event-listener.h" + +/** + * \class OctaveLink + * \brief Provides threadsafe access to octave. + * \author Jacob Dawid + * This class is a wrapper around octave and provides threadsafety by + * buffering access operations to octave and executing them in the readline + * event hook, which lives in the octave thread. + */ +class octave_link : public octave_event_observer +{ +public: + /** Provides a way to access the unique octave_link object. */ + static octave_link * instance () { return &_singleton; } + + /** Starts octave. */ + void launch_octave (); + void register_event_listener (octave_event_listener *oel); + + void generate_events (); + void process_events (); + void post_event (octave_event *e); + void event_accepted (octave_event *e); + void event_reject (octave_event *e); + + void about_to_exit (); + + void entered_readline_hook (); + void finished_readline_hook (); + + std::string get_last_working_directory (); + +private: + /** Singleton. */ + octave_link (); + ~octave_link (); + + octave_event_listener *_octave_event_listener; + + /** Thread running octave_main. */ + octave_main_thread *_octave_main_thread; + + /** Semaphore to lock access to the event queue. */ + octave_mutex *_event_queue_mutex; + + /** Buffer for queueing events until they will be processed. */ + std::queue _event_queue; + + /** Stores the last known current working directory of octave. */ + std::string _last_working_directory; + bool _debugging_mode_active; + + /** Semaphore to lock access to the performance information. */ + octave_mutex *_performance_information_mutex; + + /** Unique instance. Singelton! */ + static octave_link _singleton; +}; +#endif // OCTAVELINK_H diff --git a/libgui/src/octave-adapter/octave-main-thread.cc b/libgui/src/octave-adapter/octave-main-thread.cc new file mode 100644 --- /dev/null +++ b/libgui/src/octave-adapter/octave-main-thread.cc @@ -0,0 +1,49 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "octave.h" + +#include "octave-main-thread.h" +#include "octave-link.h" + +octave_main_thread::octave_main_thread () : QThread () +{ +} + +void +octave_main_thread::run () +{ + setlocale (LC_ALL, "en_US.UTF-8"); + + emit ready (); + + octave_initialize_interpreter (octave_cmdline_argc, octave_cmdline_argv, + octave_embedded); + + octave_execute_interpreter (); +} diff --git a/libgui/src/octave-adapter/octave-main-thread.h b/libgui/src/octave-adapter/octave-main-thread.h new file mode 100644 --- /dev/null +++ b/libgui/src/octave-adapter/octave-main-thread.h @@ -0,0 +1,50 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef OCTAVEMAINTHREAD_H +#define OCTAVEMAINTHREAD_H + +#include + +/** + * \class octave_main + * \brief This class represents a thread just running octave_main. + * \author Jacob Dawid + */ +class octave_main_thread : public QThread +{ + Q_OBJECT +public: + /** Creates a new thread running octave_main. */ + octave_main_thread (); + +signals: + /** This signal will be emitted when the thread is about to actually + * run octave_main. */ + void ready(); + +protected: + /** Runs octave_main. */ + void run (); +}; + +#endif // OCTAVEMAINTHREAD_H diff --git a/libgui/src/octave-gui.cc b/libgui/src/octave-gui.cc new file mode 100644 --- /dev/null +++ b/libgui/src/octave-gui.cc @@ -0,0 +1,115 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include + +#include + +#include "welcome-wizard.h" +#include "resource-manager.h" +#include "main-window.h" +#include "octave-gui.h" + +// Dissociate from the controlling terminal, if any. + +static void +dissociate_terminal (void) +{ +#if ! defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) + + pid_t pid = fork (); + + if (pid < 0) + { + std::cerr << "fork failed!" << std::endl;; + exit (1); + } + else if (pid == 0) + { + // Child. + + if (setsid () < 0) + { + std::cerr << "setsid error" << std::endl; + exit (1); + } + } + else + { + // Parent + + int status; + + waitpid (pid, &status, 0); + + exit (WIFEXITED (status) ? WEXITSTATUS (status) : 127); + } + +#endif +} + +int +octave_start_gui (int argc, char *argv[]) +{ + dissociate_terminal (); + + QApplication application (argc, argv); + + while (true) + { + if (resource_manager::is_first_run ()) + { + welcome_wizard welcomeWizard; + welcomeWizard.exec (); + resource_manager::reload_settings (); + } + else + { + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + QString language = settings->value ("language").toString (); + + QString translatorFile = resource_manager::find_translator_file (language); + QTranslator translator; + translator.load (translatorFile); + application.installTranslator (&translator); + + resource_manager::update_network_settings (); + + main_window w; + w.show (); + w.focus_command_window (); + + return application.exec (); + } + } +} diff --git a/libgui/src/octave-gui.h b/libgui/src/octave-gui.h new file mode 100644 --- /dev/null +++ b/libgui/src/octave-gui.h @@ -0,0 +1,28 @@ +/* + +Copyright (C) 2012 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#if !defined (octave_octave_gui_h) +#define octave_octave_gui_h 1 + +extern int octave_start_gui (int argc, char **argv); + +#endif diff --git a/libgui/src/octave-qt-event-listener.cc b/libgui/src/octave-qt-event-listener.cc new file mode 100644 --- /dev/null +++ b/libgui/src/octave-qt-event-listener.cc @@ -0,0 +1,51 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "octave-qt-event-listener.h" +#include + +octave_qt_event_listener::octave_qt_event_listener (QObject *parent) + : QObject (parent), octave_event_listener () +{ +} + +void +octave_qt_event_listener::current_directory_has_changed (std::string directory) +{ + emit current_directory_has_changed_signal + (QString::fromStdString (directory)); +} + +void +octave_qt_event_listener::about_to_exit () +{ + qApp->quit (); +} + +void +octave_qt_event_listener::entered_debug_mode () +{ emit entered_debug_mode_signal (); } + +void +octave_qt_event_listener::quit_debug_mode () +{ emit quit_debug_mode_signal (); } + diff --git a/libgui/src/octave-qt-event-listener.h b/libgui/src/octave-qt-event-listener.h new file mode 100644 --- /dev/null +++ b/libgui/src/octave-qt-event-listener.h @@ -0,0 +1,49 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef OCTAVEQTEVENTLISTENER_H +#define OCTAVEQTEVENTLISTENER_H + +#include +#include +#include "octave-event-listener.h" + +class octave_qt_event_listener + : public QObject, public octave_event_listener +{ + Q_OBJECT + public: + octave_qt_event_listener (QObject *parent = 0); + + void current_directory_has_changed (std::string directory); + void about_to_exit (); + + void entered_debug_mode (); + void quit_debug_mode (); + + signals: + void current_directory_has_changed_signal (QString directory); + void entered_debug_mode_signal (); + void quit_debug_mode_signal (); +}; + +#endif // OCTAVEQTEVENTLISTENER_H diff --git a/libgui/src/qtinfo/parser.cc b/libgui/src/qtinfo/parser.cc new file mode 100644 --- /dev/null +++ b/libgui/src/qtinfo/parser.cc @@ -0,0 +1,578 @@ +/* Copyright (C) 2009 P.L. Lucas + * Copyright (C) 2012 Jacob Dawid + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "parser.h" +#include +#include +#include +#include +#include +#include +#include + +parser::parser(QObject *parent) + : QObject(parent) +{ + _compressors_map.insert ("bz2", "bzip2 -dc \"%1\""); + _compressors_map.insert ("gz", "gzip -dc \"%1\""); + _compressors_map.insert ("lzma", "lzma -dc \"%1\""); + _compressors_map.insert ("xz", "xz -dc \"%1\""); + _compressors_map.insert ("Z", "gunzip -c \"%1\""); +} + +void +parser::set_info_path (QString infoPath) +{ + this->_info_path = infoPath; + + _info_files.clear (); + + QFileInfo info (infoPath); + + QString path = info.absolutePath (); + QString fileName = info.fileName (); + + QDir infoDir (path); + QStringList filter; + filter.append (fileName + "*"); + + _info_files = infoDir.entryInfoList (filter, QDir::Files); + parse_info_map (); +} + +QString +parser::get_info_path () +{ + return _info_path; +} + +QIODevice * +parser::open_file (QFileInfo & file_info) +{ + QIODevice *iodevice=NULL; + if ( _compressors_map.contains(file_info.suffix ())) + { + QProcess gzip; + gzip.start (_compressors_map.value (file_info.suffix ()).arg (file_info.absoluteFilePath ())); + + if (!gzip.waitForFinished ()) + return NULL; + + QByteArray result = gzip.readAll (); + + QBuffer *io = new QBuffer (this); + io->setData (result); + + if (!io->open (QIODevice::ReadOnly | QIODevice::Text)) + return NULL; + + iodevice = io; + } + else + { + QFile *io = new QFile (file_info.absoluteFilePath ()); + if (!io->open (QIODevice::ReadOnly | QIODevice::Text)) + return NULL; + iodevice = io; + } + + return iodevice; +} + +int +parser::is_ref (QString node) +{ + if (_ref_map.contains (node)) + { + node_position ref = _ref_map [node]; + + return ref.pos-_node_map [ref._node_name].pos; + } + return -1; +} + +QString +parser::search_node (QString node) +{ + QFileInfo file_info; + QString ref; + + if (_ref_map.contains (node)) + { + ref = node; + node = _ref_map [ref]._node_name; + } + + if (_node_map.contains (node)) + { + int pos = _node_map [node].pos; + int realPos; + + real_position (pos, file_info, realPos); + + QIODevice *io = open_file (file_info); + if (io == NULL) + { + return QString (); + } + + seek (io, realPos); + + QString text = get_next_node (io); + if (!text.isEmpty()) + { + return text; + } + + io->close (); + delete io; + } + + return QString (); +} + +QString +parser::search_node (QString node, QIODevice *io) +{ + while (!io->atEnd ()) + { + QString text = get_next_node (io); + if(node == get_node_name (text)) + { + return text; + } + } + + return QString (); +} + +QString +parser::get_next_node (QIODevice *io) +{ + QString text; + while (!io->atEnd ()) + { + QByteArray line = io->readLine (); + if (line.at(0) == 31) + { + break; + } + else + { + text.append (line); + } + } + return text; +} + +static QString +get_first_line (QString text) +{ + int n = text.indexOf ("\n"); + + if (n < 0) + { + return QString (); + } + + QString first_line = text.left (n); + return first_line; +} + +static QString +parser_node (QString text, QString node_name) +{ + QString firstLine = get_first_line (text); + QStringList nodes = firstLine.split (","); + for (int i = 0;i < nodes.size (); i++) + { + QString node = nodes.at (i).trimmed (); + + if (node.startsWith (node_name)) + { + return node.remove (0, node_name.size ()).trimmed (); + } + } + return QString (); +} + +QString +parser::get_node_name (QString text) +{ + return parser_node (text, "Node:"); +} + +QString +parser::get_node_up (QString text) +{ + return parser_node (text, "Up:"); +} + +QString +parser::get_node_next (QString text) +{ + return parser_node (text, "Next:"); +} + +QString +parser::get_node_prev (QString text) +{ + return parser_node (text, "Prev:"); +} + +static void +replace_links (QString &text) +{ + QRegExp re ("(\\*[N|n]ote|\n\\*)([ |\n]+)([^:]+):([^:\\.,]*)([:,\\.])"); + int i = 0, f; + + while ( (i = re.indexIn (text,i)) != -1) + { + QString type = re.cap (1); + QString note = re.cap (3); + QString url_link = re.cap (4); + QString link = re.cap (4); + + if (url_link.isEmpty ()) + { + url_link = note; + } + + url_link = url_link.trimmed (); + url_link.replace ("\n"," "); + url_link.replace (QRegExp (" +")," "); + url_link.replace ("",""); + url_link.replace ("",""); + url_link = QUrl::toPercentEncoding (url_link, "", "'"); + + QString href; + if (type=="\n*") + { + href="\n"; + } + else + { + href=""; + } + href += re.cap (2) + "" + note + ":" + link + re.cap (5) + ""; + f = re.matchedLength (); + text.replace (i,f,href); + i += href.size (); + } +} + +static void +replace_colons (QString &text) +{ + QRegExp re ("`([^']+)'"); + int i = 0, f; + while ( (i = re.indexIn (text, i)) != -1) + { + QString t = re.cap (1); + QString bold = "`" + t + "'"; + + f = re.matchedLength (); + text.replace (i,f,bold); + i += bold.size (); + } +} + +static void +info_to_html (QString &text) +{ + text.replace ("&", "&"); + text.replace ("<", "<"); + text.replace (">", ">"); + + text.replace ("\n* Menu:", "\nMenu:"); + text.replace ("*See also:*", "See also:"); + replace_colons (text); + replace_links (text); +} + +QString +parser::node_text_to_html (QString text, int anchorPos, QString anchor) +{ + QString nodeName = get_node_name (text); + QString nodeUp = get_node_up (text); + QString nodeNext = get_node_next (text); + QString nodePrev = get_node_prev (text); + + if (anchorPos > -1) + { + QString text1 = text.left (anchorPos); + QString text2 = text.mid (anchorPos); + + int n = text1.indexOf ("\n"); + text1.remove (0, n); + + info_to_html (text1); + info_to_html (text2); + + text = text1 + "" + text2; + } + else + { + int n = text.indexOf ("\n"); + text.remove (0, n); + info_to_html (text); + } + + QString navigationLinks = QString ( + " Section: %1
" + "Previous Section:
%3
" + "Next Section: %5
" + "Up: %7
\n" + ) + .arg (nodeName) + .arg (QString (QUrl::toPercentEncoding (nodePrev, "", "'"))) + .arg (nodePrev) + .arg (QString (QUrl::toPercentEncoding (nodeNext, "", "'"))) + .arg (nodeNext) + .arg (QString (QUrl::toPercentEncoding (nodeUp, "", "'"))) + .arg (nodeUp); + + + text.prepend ("
\n
");
+  text.append ("
\n

\n"); + text.prepend (navigationLinks); + text.append (navigationLinks); + text.prepend ("\n"); + text.append ("\n"); + return text; +} + +void +parser::parse_info_map () +{ + QRegExp re ("(Node|Ref): ([^\\0177]+)\\0177(\\d+)\n"); + QRegExp re_files ("([^:]+): (\\d+)\n"); + int foundCount = 0; + + for(int i = 0; i < _info_files.size (); i++) + { + QFileInfo fileInfo = _info_files.at (i); + + QIODevice *io = open_file (fileInfo); + if (io == NULL) + { + continue; + } + + QString nodeText; + while (! (nodeText=get_next_node (io)).isEmpty () && foundCount < 2) + { + QString first_line = get_first_line (nodeText); + if (first_line.startsWith ("Tag") ) + { + foundCount++; + int pos = 0; + QString last_node; + + while ((pos = re.indexIn (nodeText, pos)) != -1) { + QString type = re.cap (1); + QString node = re.cap (2); + int index = re.cap (3).toInt (); + + if (type == "Node") + { + node_map_item item; + item.pos = index; + _node_map [node] = item; + last_node = node; + } + else if (type == "Ref") + { + node_position item; + item._node_name = last_node; + item.pos = index; + _ref_map [node] = item; + } + pos += re.matchedLength (); + } + break; + } + else if (first_line.startsWith ("Indirect:")) + { + foundCount++; + int pos = 0; + + while ( (pos = re_files.indexIn (nodeText, pos)) != -1) { + QString fileCap = re_files.cap (1).trimmed (); + int index = re_files.cap (2).toInt (); + + info_file_item item; + for (int j = 0;j < _info_files.size (); j++) + { + QFileInfo info = _info_files.at (j); + if (info.fileName ().startsWith (fileCap)) + { + item.file_info = info; + break; + } + } + item.real_size = index; + _info_file_real_size_list.append (item); + pos += re_files.matchedLength (); + } + + } + } + io->close (); + delete io; + } +} + +void +parser::real_position (int pos, QFileInfo & file_info, int & real_pos) +{ + int header = -1, sum = 0; + for (int i = 0; i < _info_file_real_size_list.size (); i++) + { + info_file_item item = _info_file_real_size_list.at (i); + if (header == -1) + { + file_info = item.file_info; + header = item.real_size; + } + + if (pos < item.real_size) + { + break; + } + + file_info = item.file_info; + sum = item.real_size; + } + real_pos = pos - sum + header + 2; +} + +void +parser::seek (QIODevice *io, int pos) +{ + char ch; + while (!io->atEnd () && pos > 0) + { + io->getChar (&ch); + pos--; + } +} + +static void +replace (QString &text, QRegExp re, QString after) +{ + int pos = 0; + + while ( (pos = re.indexIn (text, pos)) != -1) + { + QString cap = text.mid (pos,re.matchedLength ()); + QString a (after); + a = a.arg (cap); + text.remove (pos, re.matchedLength ()); + text.insert (pos, a); + pos += a.size (); + } +} + +QString +parser::global_search (QString text, int max_founds) +{ + QString results; + QStringList words = text.split (" ",QString::SkipEmptyParts); + + QString re_program ("(" + words.at (0)); + for (int i = 1; i < words.size (); i++) + { + re_program += "|" + words.at (i); + } + re_program += ")"; + + QRegExp re (re_program, Qt::CaseInsensitive); + + results.append ("\n

Search results

\nResults for: "); + results.append (text); + results.append ("
\n"); + + for (int i = 0; i < _info_files.size (); i++) + { + QFileInfo file_info = _info_files.at (i); + QIODevice *io = open_file (file_info); + if (io == NULL) + { + continue; + } + + QString node_text; + while ( !(node_text = get_next_node (io)).isEmpty ()) + { + QString firstLine = get_first_line (node_text); + QString node = get_node_name (node_text); + if (node.isEmpty ()) + { + continue; + } + + int n = node_text.indexOf ("\n"); + node_text.remove (0, n); + + int pos = 0; + int founds = 0; + + for (; founds < words.size () && node_text.indexOf (words.at (founds)) >= 0; founds++) + { } + + if (founds\n "); + results.append (node); + results.append ("
\n"); + } + + replace (line, re, "%1"); + results.append (line); + results.append ("
\n"); + + founds++; + + pos += re.matchedLength (); + } + } + io->close (); + delete io; + } + + results.append (""); + return results; +} diff --git a/libgui/src/qtinfo/parser.h b/libgui/src/qtinfo/parser.h new file mode 100644 --- /dev/null +++ b/libgui/src/qtinfo/parser.h @@ -0,0 +1,111 @@ +/* Copyright (C) 2009 P.L. Lucas + * Copyright (C) 2012 Jacob Dawid + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include +#include +#include + +/** + * \class parser + * This class gets nodes and searchs inside of `info files'. + *

Each info file has nodes. Every node has the documentation. + * Info files contains a map with position of each node.

+ *

What is position? + * There is a simple answer: + * If you make a queue with info files, position will be the number of bytes + * from begining to node position.

+ *

+ * But is not so easy. There is headers, and qtinfo must not take these headers into account. + *

+ *

+ * This class also translates info files to html. + *

+ */ +class parser + : public QObject +{ + Q_OBJECT + +public: + parser (QObject *parent = 0); + void set_info_path (QString _info_path); + QString get_info_path (); + QString search_node (QString node); + QString global_search (QString text, int maxFounds); + + /** Checks if this node is reference. If node is reference, it will be returned its position + * in text, else it will be returned -1. + */ + int is_ref (QString node); + + /**Translates text of node to Html. If anchorPos is not -1, then anchor is inserted in that + * position. + */ + QString node_text_to_html (QString text, int anchorPos=-1, QString anchor=QString()); + +private: + struct node_position + { + QString _node_name; + int pos; + }; + + struct node_map_item + { + int pos; + }; + + struct info_file_item + { + QFileInfo file_info; + int real_size; + }; + + QString search_node (QString node, QIODevice * io); + QString get_next_node (QIODevice * io); + QString get_node_name (QString text); + QString get_node_up (QString text); + QString get_node_next (QString text); + QString get_node_prev (QString text); + + /** Parses info files and gets map of node positions.*/ + void parse_info_map(); + + /** Open info files and uncompress them. */ + QIODevice *open_file(QFileInfo & fileInfo); + + /** Calculates real position of nodes. + * \param pos position from info file. + * \param fileInfo returns file what contains that position. + * \param realPos returns real position inside of fileInfo. + */ + void real_position (int pos, QFileInfo & file_info, int & real_pos); + + /** Seeks to position pos. */ + void seek (QIODevice *io, int pos); + + + QString _info_path; + QFileInfoList _info_files; + QHash _node_map; + QHash _ref_map; + QList _info_file_real_size_list; + QHash _compressors_map; +}; diff --git a/libgui/src/qtinfo/webinfo.cc b/libgui/src/qtinfo/webinfo.cc new file mode 100644 --- /dev/null +++ b/libgui/src/qtinfo/webinfo.cc @@ -0,0 +1,211 @@ +/* Copyright (C) 2009 P.L. Lucas + * Copyright (C) 2012 Jacob Dawid + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "webinfo.h" +#include +#include + + +webinfo::webinfo (QWidget *parent) + :QWidget (parent) +{ + _font_web = font (); + + QVBoxLayout *layout = new QVBoxLayout (); + layout->setMargin (0); + setLayout (layout); + + QHBoxLayout *hboxLayout = new QHBoxLayout (); + hboxLayout->setMargin (2); + layout->addLayout (hboxLayout); + + _close_tab_button = new QPushButton (this); + _close_tab_button->setSizePolicy (QSizePolicy::Fixed,QSizePolicy::Preferred); + _close_tab_button->setIcon (QIcon (":/actions/icons/stop.png")); + hboxLayout->addWidget (_close_tab_button); + + _tab_bar = new QTabBar (this); + _tab_bar->setSizePolicy (QSizePolicy::Preferred,QSizePolicy::Preferred); + _tab_bar->setExpanding (false); + hboxLayout->addWidget (_tab_bar); + + _zoom_in_button = new QToolButton (this); + _zoom_in_button->setSizePolicy (QSizePolicy::Fixed,QSizePolicy::Preferred); + _zoom_in_button->setIcon (QIcon (":/actions/icons/zoom-in.png")); + hboxLayout->addWidget (_zoom_in_button); + + _zoom_out_button = new QToolButton (this); + _zoom_out_button->setSizePolicy (QSizePolicy::Fixed,QSizePolicy::Preferred); + _zoom_out_button->setIcon (QIcon (":/actions/icons/zoom-out.png")); + hboxLayout->addWidget (_zoom_out_button); + + _stacked_widget = new QStackedWidget (this); + layout->addWidget (_stacked_widget); + + hboxLayout = new QHBoxLayout (); + layout->addLayout (hboxLayout); + + _search_line_edit = new QLineEdit(this); + _search_line_edit->setPlaceholderText (tr ("Type here and press \'Return\' to search")); + hboxLayout->addWidget (_search_line_edit); + + _search_check_box = new QCheckBox (tr ("Global search")); + hboxLayout->addWidget (_search_check_box); + + connect (_close_tab_button, SIGNAL (clicked ()), this, SLOT (close_tab ())); + connect (_tab_bar, SIGNAL (currentChanged (int)), this, SLOT (current_tab_changed (int))); + connect (_zoom_in_button, SIGNAL (clicked ()), this, SLOT (zoom_in ())); + connect (_zoom_out_button, SIGNAL (clicked ()), this, SLOT (zoom_out ())); + connect (_search_line_edit, SIGNAL (returnPressed ()), this, SLOT (search ())); + + resize (500, 300); + + set_info_path ("../../doc/interpreter/octave.info"); +} + +void +webinfo::set_info_path (QString info_path) +{ + _parser.set_info_path (info_path); + load_node ("Top"); +} + +void +webinfo::load_node (QString node_name) +{ + //Check if node has been already opened. + for (int i = 0;i < _tab_bar->count (); i++) + { + if (node_name == _tab_bar->tabText (i)) + { + _tab_bar->setCurrentIndex (i); + return; + } + } + + QString text = _parser.search_node (node_name); + int i = _parser.is_ref (node_name); + _text_browser = addNewTab (node_name); + _text_browser->setHtml (_parser.node_text_to_html (text, i - 1, "anchor")); + + if (i != -1) + { + _text_browser->scrollToAnchor ("anchor"); + } +} + +void +webinfo::link_clicked (const QUrl & link) +{ + QString node = link.toString (); + load_node (node); +} + +void +webinfo::current_tab_changed (int index) +{ + QVariant data = _tab_bar->tabData (index); + _text_browser = (QTextBrowser*) (data.value ()); + + _stacked_widget->setCurrentIndex (_stacked_widget->indexOf (_text_browser)); + + if (_text_browser->font () != _font_web) + { + _text_browser->setFont (_font_web); + } +} + +QTextBrowser * +webinfo::addNewTab(QString name) +{ + _text_browser = new QTextBrowser (this); + _text_browser->setOpenLinks (false); + _text_browser->show (); + + connect (_text_browser, SIGNAL (anchorClicked (const QUrl &)), this, SLOT (link_clicked (const QUrl &)) ); + disconnect(_tab_bar, SIGNAL (currentChanged(int)), this, SLOT (current_tab_changed (int))); + + int ns = _stacked_widget->addWidget (_text_browser); + _stacked_widget->setCurrentIndex (ns); + + int nt = _tab_bar->addTab (name); + _tab_bar->setCurrentIndex (nt); + QVariant data; + data.setValue ( (void*)_text_browser); + _tab_bar->setTabData (nt, data); + + connect (_tab_bar, SIGNAL (currentChanged (int)), this, SLOT (current_tab_changed (int))); + + if (_text_browser->font () != _font_web) + { + _text_browser->setFont (_font_web); + } + return _text_browser; +} + +void +webinfo::close_tab () +{ + int index = _tab_bar->currentIndex (); + if (_tab_bar->tabText (index) != "Top") + closeTab (index); +} + +void +webinfo::closeTab (int index) +{ + QVariant data = _tab_bar->tabData (index); + QWidget *w = (QWidget*) (data.value ()); + _stacked_widget->removeWidget (w); + delete w; + + _tab_bar->removeTab (index); +} + +void +webinfo::search () +{ + if (_search_check_box->isChecked ()) + { + // Global search + QString results = _parser.global_search (_search_line_edit->text (), 5); + _text_browser=addNewTab ("Results for: " + _search_line_edit->text ()); + _text_browser->setHtml (results); + } + else + { + // Local search + _text_browser->find (_search_line_edit->text ()); + } +} + +void +webinfo::zoom_in () +{ + _font_web.setPointSize (_font_web.pointSize() + 1); + _text_browser->setFont (_font_web); +} + +void +webinfo::zoom_out () +{ + _font_web.setPointSize (_font_web.pointSize() - 1); + _text_browser->setFont (_font_web); +} + diff --git a/libgui/src/qtinfo/webinfo.h b/libgui/src/qtinfo/webinfo.h new file mode 100644 --- /dev/null +++ b/libgui/src/qtinfo/webinfo.h @@ -0,0 +1,60 @@ +/* Copyright (C) 2009 P.L. Lucas + * Copyright (C) 2012 Jacob Dawid + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include +#include "parser.h" +#include +#include +#include +#include +#include +#include + +class webinfo : public QWidget +{ + Q_OBJECT +public: + webinfo (QWidget *parent = 0); + void set_info_path (QString info_path); + void load_node (QString node_name); + +public slots: + void link_clicked (const QUrl &link); + void current_tab_changed (int index); + void close_tab (); + void search (); + void zoom_in (); + void zoom_out (); + +private: + QTextBrowser *_text_browser; + QTabBar *_tab_bar; + QStackedWidget *_stacked_widget; + QPushButton *_close_tab_button; + QLineEdit *_search_line_edit; + QCheckBox *_search_check_box; + QToolButton *_zoom_in_button; + QToolButton *_zoom_out_button; + + parser _parser; + QFont _font_web; + + QTextBrowser *addNewTab (QString name); + void closeTab(int index); +}; diff --git a/libgui/src/resource-manager.cc b/libgui/src/resource-manager.cc new file mode 100644 --- /dev/null +++ b/libgui/src/resource-manager.cc @@ -0,0 +1,1726 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include +#include +#include + +#include "error.h" +#include "file-ops.h" +#include "oct-env.h" +#include "singleton-cleanup.h" + +#include "defaults.h" + +#include "resource-manager.h" + +resource_manager *resource_manager::instance = 0; + +resource_manager::resource_manager (void) + : settings (0), home_path (), first_run (false) +{ + do_reload_settings (); +} + +resource_manager::~resource_manager (void) +{ + delete settings; +} + +QString +resource_manager::find_translator_file (QString language) +{ + // TODO: Quick hack to be able to test language files. + return QString ("../languages/%1.qm").arg (language); +} + +bool +resource_manager::instance_ok (void) +{ + bool retval = true; + + if (! instance) + { + instance = new resource_manager (); + + if (instance) + singleton_cleanup_list::add (cleanup_instance); + } + + if (! instance) + { + ::error ("unable to create resource_manager object!"); + + retval = false; + } + + return retval; +} + +QSettings * +resource_manager::do_get_settings (void) +{ + return settings; +} + +QString +resource_manager::do_get_home_path (void) +{ + return home_path; +} + +static std::string +default_qt_settings_file (void) +{ + std::string dsf = octave_env::getenv ("OCTAVE_DEFAULT_QT_SETTINGS"); + + if (dsf.empty ()) + dsf = Voct_etc_dir + file_ops::dir_sep_str () + "default-qt-settings"; + + return dsf; +} + +void +resource_manager::do_reload_settings (void) +{ + QDesktopServices desktopServices; + home_path = desktopServices.storageLocation (QDesktopServices::HomeLocation); + QString settings_path = home_path + "/.config/octave/"; + QString settings_file = settings_path + "qt-settings"; + + if (!QFile::exists (settings_file)) + { + QDir("/").mkpath (settings_path); + QFile::copy (QString::fromStdString (default_qt_settings_file ()), + settings_file); + first_run = true; + } + else + first_run = false; + + do_set_settings (settings_file); +} + +void +resource_manager::do_set_settings (QString file) +{ + delete settings; + settings = new QSettings (file, QSettings::IniFormat); +} + +bool +resource_manager::do_is_first_run (void) +{ + return first_run; +} + +void +resource_manager::do_update_network_settings (void) +{ + QNetworkProxy::ProxyType proxyType = QNetworkProxy::NoProxy; + + if (settings->value ("useProxyServer").toBool ()) + { + QString proxyTypeString = settings->value ("proxyType").toString (); + + if (proxyTypeString == "Socks5Proxy") + proxyType = QNetworkProxy::Socks5Proxy; + else if (proxyTypeString == "HttpProxy") + proxyType = QNetworkProxy::HttpProxy; + } + + QNetworkProxy proxy; + + proxy.setType (proxyType); + proxy.setHostName (settings->value ("proxyHostName").toString ()); + proxy.setPort (settings->value ("proxyPort").toInt ()); + proxy.setUser (settings->value ("proxyUserName").toString ()); + proxy.setPassword (settings->value ("proxyPassword").toString ()); + + QNetworkProxy::setApplicationProxy (proxy); +} + +const char* +resource_manager::octave_keywords (void) +{ + return + ".nargin. " + "EDITOR " + "EXEC_PATH " + "F_DUPFD " + "F_GETFD " + "F_GETFL " + "F_SETFD " + "F_SETFL " + "I " + "IMAGE_PATH " + "Inf " + "J " + "NA " + "NaN " + "OCTAVE_HOME " + "OCTAVE_VERSION " + "O_APPEND " + "O_ASYNC " + "O_CREAT " + "O_EXCL " + "O_NONBLOCK " + "O_RDONLY " + "O_RDWR " + "O_SYNC " + "O_TRUNC " + "O_WRONLY " + "PAGER " + "PAGER_FLAGS " + "PS1 " + "PS2 " + "PS4 " + "P_tmpdir " + "SEEK_CUR " + "SEEK_END " + "SEEK_SET " + "SIG " + "S_ISBLK " + "S_ISCHR " + "S_ISDIR " + "S_ISFIFO " + "S_ISLNK " + "S_ISREG " + "S_ISSOCK " + "WCONTINUE " + "WCOREDUMP " + "WEXITSTATUS " + "WIFCONTINUED " + "WIFEXITED " + "WIFSIGNALED " + "WIFSTOPPED " + "WNOHANG " + "WSTOPSIG " + "WTERMSIG " + "WUNTRACED " + "__accumarray_max__ " + "__accumarray_min__ " + "__accumarray_sum__ " + "__accumdim_sum__ " + "__all_opts__ " + "__builtins__ " + "__calc_dimensions__ " + "__contourc__ " + "__current_scope__ " + "__delaunayn__ " + "__dispatch__ " + "__display_tokens__ " + "__dsearchn__ " + "__dump_symtab_info__ " + "__end__ " + "__error_text__ " + "__finish__ " + "__fltk_ginput__ " + "__fltk_print__ " + "__fltk_uigetfile__ " + "__ftp__ " + "__ftp_ascii__ " + "__ftp_binary__ " + "__ftp_close__ " + "__ftp_cwd__ " + "__ftp_delete__ " + "__ftp_dir__ " + "__ftp_mget__ " + "__ftp_mkdir__ " + "__ftp_mode__ " + "__ftp_mput__ " + "__ftp_pwd__ " + "__ftp_rename__ " + "__ftp_rmdir__ " + "__get__ " + "__glpk__ " + "__gnuplot_drawnow__ " + "__gnuplot_get_var__ " + "__gnuplot_ginput__ " + "__gnuplot_has_feature__ " + "__gnuplot_open_stream__ " + "__gnuplot_print__ " + "__gnuplot_version__ " + "__go_axes__ " + "__go_axes_init__ " + "__go_close_all__ " + "__go_delete__ " + "__go_draw_axes__ " + "__go_draw_figure__ " + "__go_execute_callback__ " + "__go_figure__ " + "__go_figure_handles__ " + "__go_handles__ " + "__go_hggroup__ " + "__go_image__ " + "__go_line__ " + "__go_patch__ " + "__go_surface__ " + "__go_text__ " + "__go_uimenu__ " + "__gud_mode__ " + "__image_pixel_size__ " + "__init_fltk__ " + "__isa_parent__ " + "__keywords__ " + "__lexer_debug_flag__ " + "__lin_interpn__ " + "__list_functions__ " + "__magick_finfo__ " + "__magick_format_list__ " + "__magick_read__ " + "__magick_write__ " + "__makeinfo__ " + "__marching_cube__ " + "__next_line_color__ " + "__next_line_style__ " + "__operators__ " + "__parent_classes__ " + "__parser_debug_flag__ " + "__pathorig__ " + "__pchip_deriv__ " + "__plt_get_axis_arg__ " + "__print_parse_opts__ " + "__qp__ " + "__request_drawnow__ " + "__sort_rows_idx__ " + "__strip_html_tags__ " + "__token_count__ " + "__varval__ " + "__version_info__ " + "__voronoi__ " + "__which__ " + "abs " + "accumarray " + "accumdim " + "acos " + "acosd " + "acosh " + "acot " + "acotd " + "acoth " + "acsc " + "acscd " + "acsch " + "add_input_event_hook " + "addlistener " + "addpath " + "addproperty " + "addtodate " + "airy " + "all " + "allchild " + "allow_noninteger_range_as_index " + "amd " + "ancestor " + "and " + "angle " + "anova " + "ans " + "any " + "arch_fit " + "arch_rnd " + "arch_test " + "area " + "arg " + "argnames " + "argv " + "arma_rnd " + "arrayfun " + "asctime " + "asec " + "asecd " + "asech " + "asin " + "asind " + "asinh " + "assert " + "assignin " + "atan " + "atan2 " + "atand " + "atanh " + "atexit " + "autocor " + "autocov " + "autoload " + "autoreg_matrix " + "autumn " + "available_graphics_toolkits " + "axes " + "axis " + "balance " + "bar " + "barh " + "bartlett " + "bartlett_test " + "base2dec " + "beep " + "beep_on_error " + "bessel " + "besselh " + "besseli " + "besselj " + "besselk " + "bessely " + "beta " + "betacdf " + "betai " + "betainc " + "betainv " + "betaln " + "betapdf " + "betarnd " + "bicgstab " + "bicubic " + "bin2dec " + "bincoeff " + "binocdf " + "binoinv " + "binopdf " + "binornd " + "bitand " + "bitcmp " + "bitget " + "bitmax " + "bitor " + "bitpack " + "bitset " + "bitshift " + "bitunpack " + "bitxor " + "blackman " + "blanks " + "blkdiag " + "blkmm " + "bone " + "box " + "break " + "brighten " + "bsxfun " + "bug_report " + "builtin " + "bunzip2 " + "bzip2 " + "calendar " + "canonicalize_file_name " + "cart2pol " + "cart2sph " + "case " + "cast " + "cat " + "catch " + "cauchy_cdf " + "cauchy_inv " + "cauchy_pdf " + "cauchy_rnd " + "caxis " + "cbrt " + "ccolamd " + "cd " + "ceil " + "cell " + "cell2mat " + "cell2struct " + "celldisp " + "cellfun " + "cellidx " + "cellindexmat " + "cellslices " + "cellstr " + "center " + "cgs " + "char " + "chdir " + "chi2cdf " + "chi2inv " + "chi2pdf " + "chi2rnd " + "chisquare_test_homogeneity " + "chisquare_test_independence " + "chol " + "chol2inv " + "choldelete " + "cholinsert " + "cholinv " + "cholshift " + "cholupdate " + "chop " + "circshift " + "cla " + "clabel " + "class " + "clc " + "clear " + "clf " + "clg " + "clock " + "cloglog " + "close " + "closereq " + "colamd " + "colloc " + "colon " + "colorbar " + "colormap " + "colperm " + "colstyle " + "columns " + "comet " + "comet3 " + "comma " + "command_line_path " + "common_size " + "commutation_matrix " + "compan " + "compare_versions " + "compass " + "complement " + "completion_append_char " + "completion_matches " + "complex " + "computer " + "cond " + "condest " + "confirm_recursive_rmdir " + "conj " + "continue " + "contour " + "contour3 " + "contourc " + "contourf " + "contrast " + "conv " + "conv2 " + "convhull " + "convhulln " + "convn " + "cool " + "copper " + "copyfile " + "cor " + "cor_test " + "corrcoef " + "cos " + "cosd " + "cosh " + "cot " + "cotd " + "coth " + "cov " + "cplxpair " + "cputime " + "cquad " + "crash_dumps_octave_core " + "create_set " + "cross " + "csc " + "cscd " + "csch " + "cstrcat " + "csvread " + "csvwrite " + "csymamd " + "ctime " + "ctranspose " + "cummax " + "cummin " + "cumprod " + "cumsum " + "cumtrapz " + "curl " + "cut " + "cylinder " + "daspect " + "daspk " + "daspk_options " + "dasrt " + "dasrt_options " + "dassl " + "dassl_options " + "date " + "datenum " + "datestr " + "datetick " + "datevec " + "dbclear " + "dbcont " + "dbdown " + "dblquad " + "dbnext " + "dbquit " + "dbstack " + "dbstatus " + "dbstep " + "dbstop " + "dbtype " + "dbup " + "dbwhere " + "deal " + "deblank " + "debug " + "debug_on_error " + "debug_on_interrupt " + "debug_on_warning " + "dec2base " + "dec2bin " + "dec2hex " + "deconv " + "default_save_options " + "del2 " + "delaunay " + "delaunay3 " + "delaunayn " + "delete " + "dellistener " + "demo " + "det " + "detrend " + "diag " + "diary " + "diff " + "diffpara " + "diffuse " + "dir " + "discrete_cdf " + "discrete_inv " + "discrete_pdf " + "discrete_rnd " + "disp " + "dispatch " + "display " + "divergence " + "dlmread " + "dlmwrite " + "dmperm " + "dmult " + "do " + "do_braindead_shortcircuit_evaluation " + "do_string_escapes " + "doc " + "doc_cache_file " + "dos " + "dot " + "double " + "drawnow " + "dsearch " + "dsearchn " + "dump_prefs " + "dup2 " + "duplication_matrix " + "durbinlevinson " + "e " + "echo " + "echo_executing_commands " + "edit " + "edit_history " + "eig " + "eigs " + "ellipsoid " + "else " + "elseif " + "empirical_cdf " + "empirical_inv " + "empirical_pdf " + "empirical_rnd " + "end " + "end_try_catch " + "end_unwind_protect " + "endfor " + "endfunction " + "endgrent " + "endif " + "endpwent " + "endswitch " + "endwhile " + "eomday " + "eps " + "eq " + "erf " + "erfc " + "erfcx " + "erfinv " + "errno " + "errno_list " + "error " + "error_text " + "errorbar " + "etime " + "etree " + "etreeplot " + "eval " + "evalin " + "example " + "exec " + "exist " + "exit " + "exp " + "expcdf " + "expinv " + "expm " + "expm1 " + "exppdf " + "exprnd " + "eye " + "ezcontour " + "ezcontourf " + "ezmesh " + "ezmeshc " + "ezplot " + "ezplot3 " + "ezpolar " + "ezsurf " + "ezsurfc " + "f_test_regression " + "factor " + "factorial " + "fail " + "false " + "fcdf " + "fclear " + "fclose " + "fcntl " + "fdisp " + "feather " + "feof " + "ferror " + "feval " + "fflush " + "fft " + "fft2 " + "fftconv " + "fftfilt " + "fftn " + "fftshift " + "fftw " + "fgetl " + "fgets " + "fieldnames " + "figure " + "file_in_loadpath " + "file_in_path " + "fileattrib " + "filemarker " + "fileparts " + "fileread " + "filesep " + "fill " + "filter " + "filter2 " + "find " + "find_dir_in_path " + "findall " + "findobj " + "findstr " + "finite " + "finv " + "fix " + "fixed_point_format " + "flag " + "flipdim " + "fliplr " + "flipud " + "floor " + "fminbnd " + "fminunc " + "fmod " + "fnmatch " + "fopen " + "for " + "fork " + "format " + "formula " + "fpdf " + "fplot " + "fprintf " + "fputs " + "fractdiff " + "fread " + "freport " + "freqz " + "freqz_plot " + "frewind " + "frnd " + "fscanf " + "fseek " + "fskipl " + "fsolve " + "fstat " + "ftell " + "full " + "fullfile " + "func2str " + "function " + "functions " + "fwrite " + "fzero " + "gamcdf " + "gaminv " + "gamma " + "gammai " + "gammainc " + "gammaln " + "gampdf " + "gamrnd " + "gca " + "gcbf " + "gcbo " + "gcd " + "gcf " + "ge " + "gen_doc_cache " + "genpath " + "genvarname " + "geocdf " + "geoinv " + "geopdf " + "geornd " + "get " + "get_first_help_sentence " + "get_help_text " + "get_help_text_from_file " + "getappdata " + "getegid " + "getenv " + "geteuid " + "getfield " + "getgid " + "getgrent " + "getgrgid " + "getgrnam " + "gethostname " + "getpgrp " + "getpid " + "getppid " + "getpwent " + "getpwnam " + "getpwuid " + "getrusage " + "getuid " + "ginput " + "givens " + "glob " + "global " + "glpk " + "glpkmex " + "gls " + "gmap40 " + "gmres " + "gmtime " + "gnuplot_binary " + "gplot " + "gradient " + "graphics_toolkit " + "gray " + "gray2ind " + "grid " + "griddata " + "griddata3 " + "griddatan " + "gt " + "gtext " + "gunzip " + "gzip " + "hadamard " + "hamming " + "hankel " + "hanning " + "help " + "hess " + "hex2dec " + "hex2num " + "hggroup " + "hidden " + "hilb " + "hist " + "histc " + "history " + "history_control " + "history_file " + "history_size " + "history_timestamp_format_string " + "hold " + "home " + "horzcat " + "hot " + "hotelling_test " + "hotelling_test_2 " + "housh " + "hsv " + "hsv2rgb " + "hurst " + "hygecdf " + "hygeinv " + "hygepdf " + "hygernd " + "hypot " + "i " + "idivide " + "if " + "ifelse " + "ifft " + "ifft2 " + "ifftn " + "ifftshift " + "ignore_function_time_stamp " + "imag " + "image " + "imagesc " + "imfinfo " + "imread " + "imshow " + "imwrite " + "ind2gray " + "ind2rgb " + "ind2sub " + "index " + "inf " + "inferiorto " + "info " + "info_file " + "info_program " + "inline " + "inpolygon " + "input " + "inputname " + "int16 " + "int2str " + "int32 " + "int64 " + "int8 " + "interp1 " + "interp1q " + "interp2 " + "interp3 " + "interpft " + "interpn " + "intersect " + "intmax " + "intmin " + "intwarning " + "inv " + "inverse " + "invhilb " + "ipermute " + "iqr " + "is_absolute_filename " + "is_duplicate_entry " + "is_global " + "is_leap_year " + "is_rooted_relative_filename " + "is_valid_file_id " + "isa " + "isalnum " + "isalpha " + "isappdata " + "isargout " + "isascii " + "isbool " + "iscell " + "iscellstr " + "ischar " + "iscntrl " + "iscolumn " + "iscommand " + "iscomplex " + "isdebugmode " + "isdefinite " + "isdeployed " + "isdigit " + "isdir " + "isempty " + "isequal " + "isequalwithequalnans " + "isfield " + "isfigure " + "isfinite " + "isfloat " + "isglobal " + "isgraph " + "ishandle " + "ishermitian " + "ishghandle " + "ishold " + "isieee " + "isindex " + "isinf " + "isinteger " + "iskeyword " + "isletter " + "islogical " + "islower " + "ismac " + "ismatrix " + "ismember " + "ismethod " + "isna " + "isnan " + "isnull " + "isnumeric " + "isobject " + "isocolors " + "isonormals " + "isosurface " + "ispc " + "isprime " + "isprint " + "isprop " + "ispunct " + "israwcommand " + "isreal " + "isrow " + "isscalar " + "issorted " + "isspace " + "issparse " + "issquare " + "isstr " + "isstrprop " + "isstruct " + "issymmetric " + "isunix " + "isupper " + "isvarname " + "isvector " + "isxdigit " + "j " + "jet " + "kbhit " + "kendall " + "keyboard " + "kill " + "kolmogorov_smirnov_cdf " + "kolmogorov_smirnov_test " + "kolmogorov_smirnov_test_2 " + "kron " + "kruskal_wallis_test " + "krylov " + "krylovb " + "kurtosis " + "laplace_cdf " + "laplace_inv " + "laplace_pdf " + "laplace_rnd " + "lasterr " + "lasterror " + "lastwarn " + "lchol " + "lcm " + "ldivide " + "le " + "legend " + "legendre " + "length " + "lgamma " + "license " + "lin2mu " + "line " + "link " + "linkprop " + "linspace " + "list " + "list_in_columns " + "list_primes " + "load " + "loadaudio " + "loadimage " + "loadobj " + "localtime " + "log " + "log10 " + "log1p " + "log2 " + "logical " + "logistic_cdf " + "logistic_inv " + "logistic_pdf " + "logistic_regression " + "logistic_rnd " + "logit " + "loglog " + "loglogerr " + "logm " + "logncdf " + "logninv " + "lognpdf " + "lognrnd " + "logspace " + "lookfor " + "lookup " + "lower " + "ls " + "ls_command " + "lsode " + "lsode_options " + "lsqnonneg " + "lstat " + "lt " + "lu " + "luinc " + "luupdate " + "magic " + "mahalanobis " + "make_absolute_filename " + "makeinfo_program " + "manova " + "mark_as_command " + "mark_as_rawcommand " + "mat2cell " + "mat2str " + "matlabroot " + "matrix_type " + "max " + "max_recursion_depth " + "mcnemar_test " + "md5sum " + "mean " + "meansq " + "median " + "menu " + "merge " + "mesh " + "meshc " + "meshgrid " + "meshz " + "methods " + "mex " + "mexext " + "mfilename " + "mgorth " + "min " + "minus " + "mislocked " + "missing_function_hook " + "mist " + "mkdir " + "mkfifo " + "mkoctfile " + "mkpp " + "mkstemp " + "mktime " + "mldivide " + "mlock " + "mod " + "mode " + "moment " + "more " + "most " + "movefile " + "mpoles " + "mpower " + "mrdivide " + "mtimes " + "mu2lin " + "munlock " + "namelengthmax " + "nan " + "nargchk " + "nargin " + "nargout " + "nargoutchk " + "native_float_format " + "nbincdf " + "nbininv " + "nbinpdf " + "nbinrnd " + "nchoosek " + "ndgrid " + "ndims " + "ne " + "newplot " + "news " + "nextpow2 " + "nfields " + "nnz " + "nonzeros " + "norm " + "normcdf " + "normest " + "norminv " + "normpdf " + "normrnd " + "not " + "now " + "nproc " + "nth_element " + "nthroot " + "ntsc2rgb " + "null " + "num2cell " + "num2hex " + "num2str " + "numel " + "nzmax " + "ocean " + "octave_config_info " + "octave_core_file_limit " + "octave_core_file_name " + "octave_core_file_options " + "octave_tmp_file_name " + "ols " + "onCleanup " + "onenormest " + "ones " + "optimget " + "optimize_subsasgn_calls " + "optimset " + "or " + "orderfields " + "orient " + "orth " + "otherwise " + "output_max_field_width " + "output_precision " + "pack " + "page_output_immediately " + "page_screen_output " + "paren " + "pareto " + "parseparams " + "pascal " + "patch " + "path " + "pathdef " + "pathsep " + "pause " + "pbaspect " + "pcg " + "pchip " + "pclose " + "pcolor " + "pcr " + "peaks " + "periodogram " + "perl " + "perms " + "permute " + "perror " + "persistent " + "pi " + "pie " + "pie3 " + "pink " + "pinv " + "pipe " + "pkg " + "planerot " + "playaudio " + "plot " + "plot3 " + "plotmatrix " + "plotyy " + "plus " + "poisscdf " + "poissinv " + "poisspdf " + "poissrnd " + "pol2cart " + "polar " + "poly " + "polyaffine " + "polyarea " + "polyder " + "polyderiv " + "polyfit " + "polygcd " + "polyint " + "polyout " + "polyreduce " + "polyval " + "polyvalm " + "popen " + "popen2 " + "postpad " + "pow2 " + "power " + "powerset " + "ppder " + "ppint " + "ppjumps " + "ppplot " + "ppval " + "pqpnonneg " + "prctile " + "prepad " + "primes " + "print " + "print_empty_dimensions " + "print_struct_array_contents " + "print_usage " + "printf " + "prism " + "probit " + "prod " + "program_invocation_name " + "program_name " + "prop_test_2 " + "putenv " + "puts " + "pwd " + "qp " + "qqplot " + "qr " + "qrdelete " + "qrinsert " + "qrshift " + "qrupdate " + "quad " + "quad_options " + "quadcc " + "quadgk " + "quadl " + "quadv " + "quantile " + "quit " + "quiver " + "quiver3 " + "qz " + "qzhess " + "rainbow " + "rand " + "rande " + "randg " + "randi " + "randn " + "randp " + "randperm " + "range " + "rank " + "ranks " + "rat " + "rats " + "rcond " + "rdivide " + "re_read_readline_init_file " + "read_readline_init_file " + "readdir " + "readlink " + "real " + "reallog " + "realmax " + "realmin " + "realpow " + "realsqrt " + "record " + "rectangle " + "rectint " + "refresh " + "refreshdata " + "regexp " + "regexpi " + "regexprep " + "regexptranslate " + "rehash " + "rem " + "remove_input_event_hook " + "rename " + "repelems " + "replot " + "repmat " + "reset " + "reshape " + "residue " + "resize " + "restoredefaultpath " + "rethrow " + "return " + "rgb2hsv " + "rgb2ind " + "rgb2ntsc " + "ribbon " + "rindex " + "rmappdata " + "rmdir " + "rmfield " + "rmpath " + "roots " + "rose " + "rosser " + "rot90 " + "rotdim " + "round " + "roundb " + "rows " + "rref " + "rsf2csf " + "run " + "run_count " + "run_history " + "run_test " + "rundemos " + "runlength " + "runtests " + "save " + "save_header_format_string " + "save_precision " + "saveas " + "saveaudio " + "saveimage " + "saveobj " + "savepath " + "saving_history " + "scanf " + "scatter " + "scatter3 " + "schur " + "sec " + "secd " + "sech " + "semicolon " + "semilogx " + "semilogxerr " + "semilogy " + "semilogyerr " + "set " + "setappdata " + "setaudio " + "setdiff " + "setenv " + "setfield " + "setgrent " + "setpwent " + "setstr " + "setxor " + "shading " + "shell_cmd " + "shg " + "shift " + "shiftdim " + "sighup_dumps_octave_core " + "sign " + "sign_test " + "sigterm_dumps_octave_core " + "silent_functions " + "sin " + "sinc " + "sind " + "sinetone " + "sinewave " + "single " + "sinh " + "size " + "size_equal " + "sizemax " + "sizeof " + "skewness " + "sleep " + "slice " + "sombrero " + "sort " + "sortrows " + "source " + "spalloc " + "sparse " + "sparse_auto_mutate " + "spatan2 " + "spaugment " + "spchol " + "spchol2inv " + "spcholinv " + "spconvert " + "spcumprod " + "spcumsum " + "spdet " + "spdiag " + "spdiags " + "spearman " + "spectral_adf " + "spectral_xdf " + "specular " + "speed " + "spencer " + "speye " + "spfind " + "spfun " + "sph2cart " + "sphcat " + "sphere " + "spinmap " + "spinv " + "spkron " + "splchol " + "spline " + "split " + "split_long_rows " + "splu " + "spmax " + "spmin " + "spones " + "spparms " + "spprod " + "spqr " + "sprand " + "sprandn " + "sprandsym " + "sprank " + "spring " + "sprintf " + "spstats " + "spsum " + "spsumsq " + "spvcat " + "spy " + "sqp " + "sqrt " + "sqrtm " + "squeeze " + "sscanf " + "stairs " + "stat " + "static " + "statistics " + "std " + "stderr " + "stdin " + "stdnormal_cdf " + "stdnormal_inv " + "stdnormal_pdf " + "stdnormal_rnd " + "stdout " + "stem " + "stem3 " + "stft " + "str2double " + "str2func " + "str2mat " + "str2num " + "strcat " + "strchr " + "strcmp " + "strcmpi " + "strerror " + "strfind " + "strftime " + "string_fill_char " + "strjust " + "strmatch " + "strncmp " + "strncmpi " + "strptime " + "strread " + "strrep " + "strsplit " + "strtok " + "strtrim " + "strtrunc " + "struct " + "struct2cell " + "struct_levels_to_print " + "structfun " + "strvcat " + "studentize " + "sub2ind " + "subplot " + "subsasgn " + "subsindex " + "subspace " + "subsref " + "substr " + "substruct " + "sum " + "summer " + "sumsq " + "superiorto " + "suppress_verbose_help_message " + "surf " + "surface " + "surfc " + "surfl " + "surfnorm " + "svd " + "svd_driver " + "svds " + "swapbytes " + "switch " + "syl " + "sylvester_matrix " + "symamd " + "symbfact " + "symlink " + "symrcm " + "symvar " + "synthesis " + "system " + "t_test " + "t_test_2 " + "t_test_regression " + "table " + "tan " + "tand " + "tanh " + "tar " + "tcdf " + "tempdir " + "tempname " + "terminal_size " + "test " + "test2 " + "test3 " + "text " + "textread " + "textscan " + "tic " + "tilde_expand " + "time " + "times " + "tinv " + "title " + "tmpfile " + "tmpnam " + "toascii " + "toc " + "toeplitz " + "tolower " + "toupper " + "tpdf " + "trace " + "transpose " + "trapz " + "treelayout " + "treeplot " + "tril " + "trimesh " + "triplequad " + "triplot " + "trisurf " + "triu " + "trnd " + "true " + "try " + "tsearch " + "tsearchn " + "type " + "typecast " + "typeinfo " + "u_test " + "uigetdir " + "uigetfile " + "uimenu " + "uint16 " + "uint32 " + "uint64 " + "uint8 " + "uiputfile " + "umask " + "uminus " + "uname " + "undo_string_escapes " + "unidcdf " + "unidinv " + "unidpdf " + "unidrnd " + "unifcdf " + "unifinv " + "unifpdf " + "unifrnd " + "unimplemented " + "union " + "unique " + "unix " + "unlink " + "unmark_command " + "unmark_rawcommand " + "unmkpp " + "unpack " + "untabify " + "untar " + "until " + "unwind_protect " + "unwind_protect_cleanup " + "unwrap " + "unzip " + "uplus " + "upper " + "urlread " + "urlwrite " + "usage " + "usleep " + "validatestring " + "values " + "vander " + "var " + "var_test " + "varargin " + "varargout " + "vec " + "vech " + "vectorize " + "ver " + "version " + "vertcat " + "view " + "voronoi " + "voronoin " + "waitforbuttonpress " + "waitpid " + "warning " + "warning_ids " + "warranty " + "wavread " + "wavwrite " + "wblcdf " + "wblinv " + "wblpdf " + "wblrnd " + "weekday " + "weibcdf " + "weibinv " + "weibpdf " + "weibrnd " + "welch_test " + "what " + "which " + "while " + "white " + "whitebg " + "who " + "whos " + "whos_line_format " + "wienrnd " + "wilcoxon_test " + "wilkinson " + "winter " + "xlabel " + "xlim " + "xor " + "yes_or_no " + "ylabel " + "ylim " + "yulewalker " + "z_test " + "z_test_2 " + "zeros " + "zip " + "zlabel " + "zlim "; + /* "break case catch continue do else elseif end end_unwind_protect " + "endfor endfunction endif endswitch endwhile for function " + "global if otherwise persistent return switch try until " + "unwind_protect unwind_protect_cleanup while"; + */ +} diff --git a/libgui/src/resource-manager.h b/libgui/src/resource-manager.h new file mode 100644 --- /dev/null +++ b/libgui/src/resource-manager.h @@ -0,0 +1,111 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef RESOURCEMANAGER_H +#define RESOURCEMANAGER_H + +#include +#include +#include +#include + +class resource_manager +{ +protected: + + resource_manager (void); + +public: + + ~resource_manager (); + + static QSettings *get_settings (void) + { + return instance_ok () ? instance->do_get_settings () : 0; + } + + static QString get_home_path (void) + { + return instance_ok () ? instance->do_get_home_path () : QString (); + } + + static void reload_settings (void) + { + if (instance_ok ()) + instance->do_reload_settings (); + } + + static void set_settings (QString file) + { + if (instance_ok ()) + instance->do_set_settings (file); + } + + static QString find_translator_file (QString language); + + static void update_network_settings (void) + { + if (instance_ok ()) + instance->do_update_network_settings (); + } + + static bool is_first_run (void) + { + return instance_ok () ? instance->do_is_first_run () : true; + } + + static const char *octave_keywords (void); + +private: + + static resource_manager *instance; + + static void cleanup_instance (void) { delete instance; instance = 0; } + + // No copying! + + resource_manager (const resource_manager&); + + resource_manager& operator = (const resource_manager&); + + static bool instance_ok (void); + + QSettings *settings; + + QString home_path; + + bool first_run; + + QSettings *do_get_settings (void); + + QString do_get_home_path (void); + + void do_reload_settings (void); + + void do_set_settings (QString file); + + void do_update_network_settings (void); + + bool do_is_first_run (void); +}; + +#endif // RESOURCEMANAGER_H diff --git a/libgui/src/resource.qrc b/libgui/src/resource.qrc new file mode 100644 --- /dev/null +++ b/libgui/src/resource.qrc @@ -0,0 +1,40 @@ + + + icons/artsbuilderexecute.png + icons/editcopy.png + icons/editcut.png + icons/editpaste.png + icons/filenew.png + icons/fileopen.png + icons/filesave.png + icons/redo.png + icons/search.png + icons/undo.png + icons/up.png + icons/configure.png + icons/filesaveas.png + icons/redled.png + icons/arrow_right.png + icons/bookmark.png + icons/question.png + icons/star.png + icons/stop.png + icons/zoom-in.png + icons/zoom-out.png + icons/find.png + icons/chat.png + icons/help_index.png + icons/jabber_protocol.png + icons/logo.png + icons/terminal.png + icons/bp_toggle.png + icons/bp_rm_all.png + icons/bp_prev.png + icons/bp_next.png + icons/db_cont.png + icons/db_step.png + icons/db_step_in.png + icons/db_step_out.png + icons/db_stop.png + + diff --git a/libgui/src/settings-dialog.cc b/libgui/src/settings-dialog.cc new file mode 100644 --- /dev/null +++ b/libgui/src/settings-dialog.cc @@ -0,0 +1,126 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "resource-manager.h" +#include "settings-dialog.h" +#include "ui-settings-dialog.h" +#include + +settings_dialog::settings_dialog (QWidget * parent): +QDialog (parent), ui (new Ui::settings_dialog) +{ + ui->setupUi (this); + + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor").toBool ()); + ui->customFileEditor->setText (settings->value ("customFileEditor").toString ()); + ui->editor_showLineNumbers->setChecked (settings->value ("editor/showLineNumbers",true).toBool () ); + ui->editor_highlightCurrentLine->setChecked (settings->value ("editor/highlightCurrentLine",true).toBool () ); + ui->editor_codeCompletion->setChecked (settings->value ("editor/codeCompletion",true).toBool () ); + ui->editor_fontName->setCurrentFont (QFont (settings->value ("editor/fontName","Courier").toString()) ); + ui->editor_fontSize->setValue (settings->value ("editor/fontSize",10).toInt ()); + ui->editor_longWindowTitle->setChecked (settings->value ("editor/longWindowTitle",true).toBool ()); + ui->terminal_fontName->setCurrentFont (QFont (settings->value ("terminal/fontName","Courier").toString()) ); + ui->terminal_fontSize->setValue (settings->value ("terminal/fontSize",10).toInt ()); + ui->showFilenames->setChecked (settings->value ("showFilenames").toBool()); + ui->showFileSize->setChecked (settings->value ("showFileSize").toBool()); + ui->showFileType->setChecked (settings->value ("showFileType").toBool()); + ui->showLastModified->setChecked (settings->value ("showLastModified").toBool()); + ui->showHiddenFiles->setChecked (settings->value ("showHiddenFiles").toBool()); + ui->useAlternatingRowColors->setChecked (settings->value ("useAlternatingRowColors").toBool()); + ui->useProxyServer->setChecked (settings->value ("useProxyServer").toBool ()); + ui->proxyHostName->setText (settings->value ("proxyHostName").toString ()); + ui->terminal_cursorBlinking->setChecked (settings->value ("terminal/cursorBlinking").toBool ()); + + QString cursorType = settings->value ("terminal/cursorType").toString (); + + QStringList items; + items << QString("0") << QString("1") << QString("2"); + ui->terminal_cursorType->addItems(items); + ui->terminal_cursorType->setItemText (0, "IBeam Cursor"); + ui->terminal_cursorType->setItemText (1, "Block Cursor"); + ui->terminal_cursorType->setItemText (2, "Underline Cursor"); + + if (cursorType == "ibeam") + ui->terminal_cursorType->setCurrentIndex (0); + else if (cursorType == "block") + ui->terminal_cursorType->setCurrentIndex (1); + else if (cursorType == "underline") + ui->terminal_cursorType->setCurrentIndex (2); + + int currentIndex = 0; + QString proxyTypeString = settings->value ("proxyType").toString (); + while ( (currentIndex < ui->proxyType->count ()) && (ui->proxyType->currentText () != proxyTypeString)) + { + currentIndex++; + ui->proxyType->setCurrentIndex (currentIndex); + } + + ui->proxyPort->setText (settings->value ("proxyPort").toString ()); + ui->proxyUserName->setText (settings->value ("proxyUserName").toString ()); + ui->proxyPassword->setText (settings->value ("proxyPassword").toString ()); +} + +settings_dialog::~settings_dialog () +{ + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + settings->setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ()); + settings->setValue ("customFileEditor", ui->customFileEditor->text ()); + settings->setValue ("editor/showLineNumbers", ui->editor_showLineNumbers->isChecked ()); + settings->setValue ("editor/highlightCurrentLine", ui->editor_highlightCurrentLine->isChecked ()); + settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ()); + settings->setValue ("editor/fontName", ui->editor_fontName->currentFont().family()); + settings->setValue ("editor/fontSize", ui->editor_fontSize->value()); + settings->setValue ("editor/longWindowTitle", ui->editor_longWindowTitle->isChecked()); + settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value()); + settings->setValue ("terminal/fontName", ui->terminal_fontName->currentFont().family()); + settings->setValue ("showFilenames", ui->showFilenames->isChecked ()); + settings->setValue ("showFileSize", ui->showFileSize->isChecked ()); + settings->setValue ("showFileType", ui->showFileType->isChecked ()); + settings->setValue ("showLastModified", ui->showLastModified->isChecked ()); + settings->setValue ("showHiddenFiles", ui->showHiddenFiles->isChecked ()); + settings->setValue ("useAlternatingRowColors", ui->useAlternatingRowColors->isChecked ()); + settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ()); + settings->setValue ("proxyType", ui->proxyType->currentText ()); + settings->setValue ("proxyHostName", ui->proxyHostName->text ()); + settings->setValue ("proxyPort", ui->proxyPort->text ()); + settings->setValue ("proxyUserName", ui->proxyUserName->text ()); + settings->setValue ("proxyPassword", ui->proxyPassword->text ()); + settings->setValue ("terminal/cursorBlinking", ui->terminal_cursorBlinking->isChecked ()); + + QString cursorType; + switch (ui->terminal_cursorType->currentIndex ()) + { + case 0: cursorType = "ibeam"; break; + case 1: cursorType = "block"; break; + case 2: cursorType = "underline"; break; + } + settings->setValue ("terminal/cursorType", cursorType); + settings->sync (); + delete ui; +} diff --git a/libgui/src/settings-dialog.h b/libgui/src/settings-dialog.h new file mode 100644 --- /dev/null +++ b/libgui/src/settings-dialog.h @@ -0,0 +1,43 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include + +namespace Ui +{ + class settings_dialog; +} + +class settings_dialog:public QDialog +{ +Q_OBJECT public: + explicit settings_dialog (QWidget * parent); + ~settings_dialog (); + +private: + Ui::settings_dialog * ui; +}; + +#endif // SETTINGSDIALOG_H diff --git a/libgui/src/settings-dialog.ui b/libgui/src/settings-dialog.ui new file mode 100644 --- /dev/null +++ b/libgui/src/settings-dialog.ui @@ -0,0 +1,719 @@ + + + settings_dialog + + + Qt::ApplicationModal + + + + 0 + 0 + 600 + 400 + + + + + 600 + 400 + + + + + 600 + 400 + + + + Settings + + + + + + 0 + + + + Editor + + + + + + + + + + Font + + + + + + + false + + + QFontComboBox::MonospacedFonts + + + + + + + Font Size + + + + + + + 2 + + + 96 + + + 10 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + true + + + Show line numbers + + + false + + + + + + + true + + + Highlight current line + + + false + + + + + + + true + + + Code completion + + + false + + + + + + + Show complete path in window title + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + true + + + Use custom file editor: + + + + + + + false + + + emacs + + + + + + + + + + Terminal + + + + + + + + Font + + + + + + + false + + + QFontComboBox::MonospacedFonts + + + + + + + Font Size + + + + + + + 2 + + + 96 + + + 10 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Cursor type: + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Cursor blinking + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 321 + + + + + + + + + File Browser + + + + + + Show filenames + + + + + + + Show file size + + + + + + + Show file type + + + + + + + Show date of last modification + + + + + + + Show hidden files + + + + + + + Alternating row colors + + + + + + + Qt::Vertical + + + + 20 + 360 + + + + + + + + + Network + + + + + + Use proxy server + + + + + + + + + false + + + Proxy Type: + + + + + + + false + + + + HttpProxy + + + + + Socks5Proxy + + + + + + + + false + + + Hostname: + + + + + + + false + + + + + + + false + + + Port: + + + + + + + false + + + + + + + false + + + Username: + + + + + + + false + + + + + + + false + + + Password: + + + + + + + false + + + QLineEdit::Password + + + + + + + + + + + + + + + useProxyServer + toggled(bool) + label_4 + setEnabled(bool) + + + 249 + 59 + + + 69 + 122 + + + + + useProxyServer + toggled(bool) + label_3 + setEnabled(bool) + + + 249 + 59 + + + 59 + 91 + + + + + useProxyServer + toggled(bool) + label_5 + setEnabled(bool) + + + 249 + 59 + + + 44 + 152 + + + + + useProxyServer + toggled(bool) + proxyType + setEnabled(bool) + + + 249 + 59 + + + 291 + 91 + + + + + useProxyServer + toggled(bool) + proxyHostName + setEnabled(bool) + + + 249 + 59 + + + 291 + 124 + + + + + useProxyServer + toggled(bool) + proxyPort + setEnabled(bool) + + + 249 + 59 + + + 364 + 154 + + + + + useCustomFileEditor + toggled(bool) + customFileEditor + setEnabled(bool) + + + 111 + 62 + + + 343 + 63 + + + + + useProxyServer + toggled(bool) + label_7 + setEnabled(bool) + + + 249 + 59 + + + 67 + 212 + + + + + editor_showLineNumbers + toggled(bool) + editor_showLineNumbers + setEnabled(bool) + + + 249 + 87 + + + 249 + 87 + + + + + editor_highlightCurrentLine + toggled(bool) + editor_highlightCurrentLine + setEnabled(bool) + + + 249 + 112 + + + 249 + 112 + + + + + useProxyServer + toggled(bool) + proxyUserName + setEnabled(bool) + + + 249 + 59 + + + 364 + 184 + + + + + useProxyServer + toggled(bool) + proxyPassword + setEnabled(bool) + + + 249 + 59 + + + 364 + 214 + + + + + useProxyServer + toggled(bool) + label_6 + setEnabled(bool) + + + 249 + 59 + + + 68 + 182 + + + + + editor_codeCompletion + toggled(bool) + editor_codeCompletion + setEnabled(bool) + + + 249 + 137 + + + 249 + 137 + + + + + diff --git a/libgui/src/symbol-information.cc b/libgui/src/symbol-information.cc new file mode 100644 --- /dev/null +++ b/libgui/src/symbol-information.cc @@ -0,0 +1,105 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "ov.h" +#include "symtab.h" + +#include "symbol-information.h" + +bool +symbol_information::from_symbol_record + (const symbol_table::symbol_record& symbol_record) +{ + if (symbol_record.is_local () && !symbol_record.is_global () && !symbol_record.is_hidden ()) + _scope = local; + else if (symbol_record.is_global ()) + _scope = global; + else if (symbol_record.is_persistent ()) + _scope = persistent; + else if (symbol_record.is_hidden ()) + _scope = hidden; + + _symbol = QString (symbol_record.name ().c_str ()); + _type = QString (symbol_record.varval ().type_name ().c_str ()); + octave_value ov = symbol_record.varval (); + + // In case we have really large matrices or strings, cut them down + // for performance reasons. + QString short_value_string; + bool use_short_value_string = false; + if (ov.is_matrix_type () || ov.is_cell ()) + { + if (ov.rows () * ov.columns () > 10) + { + use_short_value_string = true; + short_value_string + = QString ("%1x%2 items").arg (ov.rows ()).arg (ov.columns ()); + } + } + else if (ov.is_string ()) + { + if (ov.string_value ().length () > 40) + { + use_short_value_string = true; + short_value_string + = QString::fromStdString (ov.string_value ().substr (0, 40)); + } + } + + if (use_short_value_string) + { + _value = short_value_string; + } + else + { + std::stringstream buffer; + ov.print (buffer, true); + _value = QString::fromStdString (buffer.str ()); + } + _value.replace("\n", " "); + + if (ov.is_string ()) + _dimension = QString ("%1").arg (ov.string_value ().length ()); + else if (ov.is_range ()) + _dimension = QString ("%1 : %2 : %3").arg (ov.range_value ().base ()) + .arg (ov.range_value ().inc ()) + .arg (ov.range_value ().limit ()); + else if (ov.is_matrix_type () || ov.is_cell ()) + _dimension = QString ("%1x%2").arg (ov.rows ()) + .arg (ov.columns ()); + else if (ov.is_function_handle ()) + // See code for func2str for a possible solution + _dimension = QString ("func handle"); + else if (ov.is_inline_function ()) + // See code for formula for a possible solution + _dimension = QString ("inline func"); + else + _dimension = "1"; + + return true; +} diff --git a/libgui/src/symbol-information.h b/libgui/src/symbol-information.h new file mode 100644 --- /dev/null +++ b/libgui/src/symbol-information.h @@ -0,0 +1,91 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef SYMBOLINFORMATION_H +#define SYMBOLINFORMATION_H + +// FIXME -- we should not be including config.h in header files. + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include + +#include "symtab.h" + +/** + * \struct symbol_information + * \brief Meta-information over a symbol-table entry. + * \author Jacob Dawid + * This struct is used to store meta information over a symbol entry. + * It reduces memory consumption, since it only stores relevant data + * about a symbol-table entry that will be used in the model for the + * graphical user interface. + */ +struct symbol_information +{ + enum Scope + { + local = 0, + global = 1, + persistent = 2, + hidden = 3 + }; + + QString _symbol; + QString _type; + QString _value; + QString _dimension; + Scope _scope; + + /** Hashes the symbol information for quickly comparing it. */ + int + hash () const + { + return qHash (_symbol) + qHash (_type) + qHash (_value) + + qHash (_dimension) + (int)_scope; + } + + /** Compares two symbol information objects. */ + bool + equals (const symbol_information& other) const + { + if (hash () == other.hash ()) + { + return _symbol == other._symbol + && _type == other._type + && _value == other._value + && _scope == other._scope + && _dimension == other._dimension; + } + } + + /** Extracts meta information from a given symbol record. */ + bool + from_symbol_record (const symbol_table::symbol_record& symbol_record); +}; + +#endif // SYMBOLINFORMATION_H diff --git a/libgui/src/terminal-dockwidget.cc b/libgui/src/terminal-dockwidget.cc new file mode 100644 --- /dev/null +++ b/libgui/src/terminal-dockwidget.cc @@ -0,0 +1,33 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "terminal-dockwidget.h" + +terminal_dock_widget::terminal_dock_widget (QTerminal *terminal, QWidget *parent) + : QDockWidget (parent) +{ + setObjectName ("TerminalDockWidget"); + setWindowTitle (tr ("Command Window")); + setWidget (terminal); + + connect (this, SIGNAL (visibilityChanged (bool)), this, SLOT (handle_visibility_changed (bool))); +} diff --git a/libgui/src/terminal-dockwidget.h b/libgui/src/terminal-dockwidget.h new file mode 100644 --- /dev/null +++ b/libgui/src/terminal-dockwidget.h @@ -0,0 +1,46 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef TERMINALDOCKWIDGET_H +#define TERMINALDOCKWIDGET_H + +#include +#include "QTerminal.h" + +class terminal_dock_widget : public QDockWidget +{ + Q_OBJECT +public: + terminal_dock_widget (QTerminal *terminal, QWidget *parent = 0); + +signals: + void active_changed (bool active); + +public slots: + void handle_visibility_changed (bool visible) + { + if (visible) + emit active_changed (true); + } +}; + +#endif // TERMINALDOCKWIDGET_H diff --git a/libgui/src/welcome-wizard.cc b/libgui/src/welcome-wizard.cc new file mode 100644 --- /dev/null +++ b/libgui/src/welcome-wizard.cc @@ -0,0 +1,58 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "welcome-wizard.h" +#include "ui-welcome-wizard.h" + +welcome_wizard::welcome_wizard (QWidget *parent) : + QDialog (parent), + _ui (new Ui::welcome_wizard) +{ + _ui->setupUi (this); + connect (_ui->nextButton1, SIGNAL (clicked ()), this, SLOT (next ())); + connect (_ui->nextButton2, SIGNAL (clicked ()), this, SLOT (next ())); + connect (_ui->nextButton3, SIGNAL (clicked ()), this, SLOT (next ())); + connect (_ui->nextButton4, SIGNAL (clicked ()), this, SLOT (next ())); + + connect (_ui->previousButton2, SIGNAL (clicked ()), this, SLOT (previous ())); + connect (_ui->previousButton3, SIGNAL (clicked ()), this, SLOT (previous ())); + connect (_ui->previousButton4, SIGNAL (clicked ()), this, SLOT (previous ())); + connect (_ui->previousButton5, SIGNAL (clicked ()), this, SLOT (previous ())); +} + +welcome_wizard::~welcome_wizard() +{ + delete _ui; +} + +void +welcome_wizard::next () +{ + _ui->stackedWidget->setCurrentIndex (_ui->stackedWidget->currentIndex () + 1); +} + +void +welcome_wizard::previous () +{ + _ui->stackedWidget->setCurrentIndex (_ui->stackedWidget->currentIndex () - 1); +} + diff --git a/libgui/src/welcome-wizard.h b/libgui/src/welcome-wizard.h new file mode 100644 --- /dev/null +++ b/libgui/src/welcome-wizard.h @@ -0,0 +1,48 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef WELCOMEWIZARD_H +#define WELCOMEWIZARD_H + +#include + +namespace Ui { + class welcome_wizard; +} + +class welcome_wizard : public QDialog +{ + Q_OBJECT + +public: + explicit welcome_wizard (QWidget *parent = 0); + ~welcome_wizard (); + +public slots: + void next (); + void previous (); + +private: + Ui::welcome_wizard *_ui; +}; + +#endif // WELCOMEWIZARD_H diff --git a/libgui/src/welcome-wizard.ui b/libgui/src/welcome-wizard.ui new file mode 100644 --- /dev/null +++ b/libgui/src/welcome-wizard.ui @@ -0,0 +1,354 @@ + + + welcome_wizard + + + + 0 + 0 + 647 + 400 + + + + + 647 + 400 + + + + + 647 + 400 + + + + Welcome to GNU Octave + + + + + + 4 + + + + + + + It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file. + + + Qt::AlignJustify|Qt::AlignVCenter + + + true + + + + + + + Qt::Vertical + + + + 20 + 218 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Next + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Previous + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Next + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Previous + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Next + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Previous + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Next + + + + + + + + + + + + + + + + + + 20 + + + + Welcome to Octave! + + + + + + + This is the development version of Octave with the first official GUI. + + + true + + + + + + + You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI. + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + false + + + Previous + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Finish + + + + + + + + + + + + + + + + + finishButton + clicked() + welcome_wizard + accept() + + + 577 + 372 + + + 323 + 199 + + + + + diff --git a/libgui/src/workspace-model.cc b/libgui/src/workspace-model.cc new file mode 100644 --- /dev/null +++ b/libgui/src/workspace-model.cc @@ -0,0 +1,229 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include + +#include + +#include "workspace-model.h" +#include "octave-link.h" + +workspace_model::workspace_model(QObject *parent) + : QAbstractItemModel(parent), octave_event_observer () +{ + QList rootData; + rootData << tr ("Name") << tr ("Type") << tr("Dimension") << tr ("Value"); + _rootItem = new tree_item(rootData); + + insert_top_level_item(0, new tree_item ("Local")); + insert_top_level_item(1, new tree_item ("Global")); + insert_top_level_item(2, new tree_item ("Persistent")); + insert_top_level_item(3, new tree_item ("Hidden")); + + connect(&_update_workspace_model_timer, + SIGNAL (timeout ()), + this, + SLOT (request_update_workspace())); + + _update_workspace_model_timer.setInterval (500); + _update_workspace_model_timer.setSingleShot (true); + _update_workspace_model_timer.start (); +} + +workspace_model::~workspace_model() +{ + delete _rootItem; +} + +void +workspace_model::request_update_workspace () +{ + octave_link::instance () + ->post_event (new octave_update_workspace_event (*this)); +} + +void +workspace_model::event_accepted (octave_event *e) +{ + if (dynamic_cast (e)) + { + std::list < symbol_table::symbol_record > symbolTable = symbol_table::all_variables (); + + _symbol_information.clear (); + for (std::list < symbol_table::symbol_record > ::iterator iterator = symbolTable.begin (); + iterator != symbolTable.end (); iterator++) + { + symbol_information symbolInformation; + symbolInformation.from_symbol_record (*iterator); + _symbol_information.push_back (symbolInformation); + } + + beginResetModel(); + top_level_item (0)->delete_child_items (); + top_level_item (1)->delete_child_items (); + top_level_item (2)->delete_child_items (); + top_level_item (3)->delete_child_items (); + + foreach (const symbol_information& s, _symbol_information) + { + tree_item *child = new tree_item (); + + child->set_data (0, s._symbol); + child->set_data (1, s._type); + child->set_data (2, s._dimension); + child->set_data (3, s._value); + + switch (s._scope) + { + case symbol_information::local: top_level_item (0)->add_child (child); break; + case symbol_information::global: top_level_item (1)->add_child (child); break; + case symbol_information::persistent: top_level_item (2)->add_child (child); break; + case symbol_information::hidden: top_level_item (3)->add_child (child); break; + } + } + + endResetModel(); + emit model_changed(); + } + + // Post a new event in a given time. + // This prevents flooding the event queue when no events are being processed. + _update_workspace_model_timer.start (); + delete e; +} + +void +workspace_model::event_reject (octave_event *e) +{ + delete e; +} + +QModelIndex +workspace_model::index(int row, int column, const QModelIndex &parent) const +{ + if (!hasIndex(row, column, parent)) + return QModelIndex(); + + tree_item *parentItem; + + if (!parent.isValid()) + parentItem = _rootItem; + else + parentItem = static_cast(parent.internalPointer()); + + tree_item *childItem = parentItem->child(row); + if (childItem) + return createIndex(row, column, childItem); + else + return QModelIndex(); +} + +QModelIndex +workspace_model::parent(const QModelIndex &index) const +{ + if (!index.isValid()) + return QModelIndex(); + + tree_item *childItem = static_cast(index.internalPointer()); + tree_item *parentItem = childItem->parent(); + + if (parentItem == _rootItem) + return QModelIndex(); + + return createIndex(parentItem->row(), 0, parentItem); +} + +int +workspace_model::rowCount(const QModelIndex &parent) const +{ + tree_item *parentItem; + if (parent.column() > 0) + return 0; + + if (!parent.isValid()) + parentItem = _rootItem; + else + parentItem = static_cast(parent.internalPointer()); + + return parentItem->child_count(); +} + +int +workspace_model::columnCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return static_cast(parent.internalPointer())->column_count(); + else + return _rootItem->column_count(); +} + +void +workspace_model::insert_top_level_item(int at, tree_item *treeItem) +{ + _rootItem->insert_child_item(at, treeItem); +} + +tree_item * +workspace_model::top_level_item (int at) +{ + return _rootItem->child(at); +} + +Qt::ItemFlags +workspace_model::flags(const QModelIndex &index) const +{ + if (!index.isValid()) + return 0; + + return Qt::ItemIsEnabled | Qt::ItemIsSelectable; +} + +QVariant +workspace_model::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) + return _rootItem->data(section); + + return QVariant(); +} + +QVariant +workspace_model::data(const QModelIndex &index, int role) const +{ + if (!index.isValid()) + return QVariant(); + + if (role != Qt::DisplayRole) + return QVariant(); + + tree_item *item = static_cast(index.internalPointer()); + + return item->data(index.column()); +} + diff --git a/libgui/src/workspace-model.h b/libgui/src/workspace-model.h new file mode 100644 --- /dev/null +++ b/libgui/src/workspace-model.h @@ -0,0 +1,155 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef WORKSPACEMODEL_H +#define WORKSPACEMODEL_H + +// Qt includes +#include +#include +#include +#include + +#include "symbol-information.h" +#include "octave-event-observer.h" + +class tree_item +{ +public: + tree_item (const QList &data, tree_item *parent = 0) { + _parent_item = parent; + _item_data = data; + } + + tree_item (QVariant data = QVariant(), tree_item *parent = 0) { + QList variantList; + variantList << data << QVariant () << QVariant () << QVariant (); + _parent_item = parent; + _item_data = variantList; + } + + ~tree_item () { + qDeleteAll (_child_items); + } + + void insert_child_item (int at, tree_item *item) { + item->_parent_item = this; + _child_items.insert (at, item); + } + + void add_child (tree_item *item) { + item->_parent_item = this; + _child_items.append (item); + } + + void delete_child_items () { + qDeleteAll (_child_items); + _child_items.clear (); + } + + void remove_child (tree_item *item) { + _child_items.removeAll (item); + } + + QVariant data (int column) const + { + return _item_data[column]; + } + + void set_data (int column, QVariant data) + { + _item_data[column] = data; + } + + tree_item *child (int row) { + return _child_items[row]; + } + + int child_count () const { + return _child_items.count(); + } + + int column_count () const + { + return _item_data.count(); + } + + int row () const { + if (_parent_item) + return _parent_item->_child_items.indexOf (const_cast(this)); + + return 0; + } + + tree_item *parent () + { + return _parent_item; + } + +private: + QList _child_items; + QList _item_data; + tree_item *_parent_item; +}; + +class workspace_model + : public QAbstractItemModel, public octave_event_observer +{ + Q_OBJECT + +public: + workspace_model (QObject *parent = 0); + ~workspace_model (); + + void event_accepted (octave_event *e); + void event_reject (octave_event *e); + + QVariant data (const QModelIndex &index, int role) const; + Qt::ItemFlags flags (const QModelIndex &index) const; + QVariant headerData (int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const; + QModelIndex index (int row, int column, + const QModelIndex &parent = QModelIndex ()) const; + QModelIndex parent (const QModelIndex &index) const; + int rowCount (const QModelIndex &parent = QModelIndex ()) const; + int columnCount (const QModelIndex &parent = QModelIndex ()) const; + + void insert_top_level_item (int at, tree_item *treeItem); + tree_item *top_level_item (int at); + +public slots: + void request_update_workspace (); + +signals: + void model_changed (); + +private: + /** Timer for periodically updating the workspace model from the current + * symbol information. */ + QTimer _update_workspace_model_timer; + + /** Stores the current symbol information. */ + QList _symbol_information; + tree_item *_rootItem; +}; + +#endif // WORKSPACEMODEL_H diff --git a/libgui/src/workspace-view.cc b/libgui/src/workspace-view.cc new file mode 100644 --- /dev/null +++ b/libgui/src/workspace-view.cc @@ -0,0 +1,221 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#include "workspace-view.h" +#include "resource-manager.h" +#include +#include +#include + +workspace_view::workspace_view (QWidget * parent) : QDockWidget + (parent) +{ + setObjectName ("WorkspaceView"); + setWindowTitle (tr ("Workspace")); + + // Create a new workspace model. + _workspace_model = new workspace_model (); + + _workspace_tree_view = new QTreeView (this); // Create a new tree view. + _workspace_tree_view->setHeaderHidden (false); // Do not show header columns. + _workspace_tree_view->setAlternatingRowColors (true); // Activate alternating row colors. + _workspace_tree_view->setAnimated (false); // Deactivate animations because of strange glitches. + _workspace_tree_view->setTextElideMode (Qt::ElideRight);// Elide text to the right side of the cells. + _workspace_tree_view->setWordWrap (false); // No wordwrapping in cells. + _workspace_tree_view->setModel (_workspace_model); // Assign model. + + // Set an empty widget, so we can assign a layout to it. + setWidget (new QWidget (this)); + + // Create a new layout and add widgets to it. + QVBoxLayout *layout = new QVBoxLayout (); + layout->addWidget (_workspace_tree_view); + layout->setMargin (2); + + // Set the empty widget to have our layout. + widget ()->setLayout (layout); + + // Initialize collapse/expand state of the workspace subcategories. + + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + _explicit_collapse.local = settings->value ("workspaceview/local_collapsed", false).toBool (); + _explicit_collapse.global = settings->value ("workspaceview/global_collapsed", false).toBool ();; + _explicit_collapse.persistent = settings->value ("workspaceview/persistent_collapsed", false).toBool ();; + _explicit_collapse.hidden = settings->value ("workspaceview/hidden_collapsed", false).toBool ();; + + // Connect signals and slots. + connect (this, SIGNAL (visibilityChanged (bool)), + this, SLOT(handle_visibility_changed (bool))); + + connect (_workspace_model, SIGNAL (model_changed ()), + this, SLOT (model_changed ())); + + connect (_workspace_tree_view, SIGNAL (collapsed (QModelIndex)), + this, SLOT (collapse_requested (QModelIndex))); + connect (_workspace_tree_view, SIGNAL (expanded (QModelIndex)), + this, SLOT (expand_requested (QModelIndex))); + + connect (_workspace_tree_view, SIGNAL (doubleClicked (QModelIndex)), + this, SLOT (item_double_clicked (QModelIndex))); + +} + +workspace_view::~workspace_view () +{ + QSettings *settings = resource_manager::get_settings (); + + // FIXME -- what should happen if settings is 0? + + settings->setValue("workspaceview/local_collapsed", _explicit_collapse.local); + settings->setValue("workspaceview/global_collapsed", _explicit_collapse.global); + settings->setValue("workspaceview/persistent_collapsed", _explicit_collapse.persistent); + settings->setValue("workspaceview/hidden_collapsed", _explicit_collapse.hidden); +} + +void +workspace_view::handle_visibility_changed (bool visible) +{ + if (visible) + emit active_changed (true); +} + +void +workspace_view::model_changed () +{ + // This code is very quirky and requires some explanation. + // Usually, we should not deal with collapsing or expanding ourselves, + // because the view itself determines (based on the model) whether it + // is appropriate to collapse or expand items. + // + // Now, the logic requires that we update our model item by item, which + // would make it work correctly, but this is extremely slow and scales + // very bad (O(n^2)). That's why we throw away our model and rebuild it + // completely from scratch (O(n)), which is why the view renders all + // displayed data as invalid. + // + // In order to make collapsing/expanding work again, we need to set + // flags ourselves here. + + QModelIndex local_model_index = _workspace_model->index (0, 0); + QModelIndex global_model_index = _workspace_model->index (1, 0); + QModelIndex persistent_model_index = _workspace_model->index (2, 0); + QModelIndex hidden_model_index = _workspace_model->index (3, 0); + + if (_explicit_collapse.local) { + _workspace_tree_view->collapse (local_model_index); + } else { + _workspace_tree_view->expand (local_model_index); + } + + if (_explicit_collapse.global) { + _workspace_tree_view->collapse (global_model_index); + } else { + _workspace_tree_view->expand (global_model_index); + } + + if (_explicit_collapse.persistent) { + _workspace_tree_view->collapse (persistent_model_index); + } else { + _workspace_tree_view->expand (persistent_model_index); + } + + if (_explicit_collapse.hidden) { + _workspace_tree_view->collapse (hidden_model_index); + } else { + _workspace_tree_view->expand (hidden_model_index); + } +} + +void +workspace_view::collapse_requested (QModelIndex index) +{ + // This code is very quirky and requires some explanation. + // Usually, we should not deal with collapsing or expanding ourselves, + // because the view itself determines (based on the model) whether it + // is appropriate to collapse or expand items. + // + // Now, the logic requires that we update our model item by item, which + // would make it work correctly, but this is extremely slow and scales + // very bad (O(n^2)). That's why we throw away our model and rebuild it + // completely from scratch (O(n)), which is why the view renders all + // displayed data as invalid. + // + // In order to make collapsing/expanding work again, we need to set + // flags ourselves here. + QMap item_data + = _workspace_model->itemData (index); + + if (item_data[0] == "Local") + _explicit_collapse.local = true; + if (item_data[0] == "Global") + _explicit_collapse.global = true; + if (item_data[0] == "Persistent") + _explicit_collapse.persistent = true; + if (item_data[0] == "Hidden") + _explicit_collapse.hidden = true; +} + +void +workspace_view::expand_requested (QModelIndex index) +{ + // This code is very quirky and requires some explanation. + // Usually, we should not deal with collapsing or expanding ourselves, + // because the view itself determines (based on the model) whether it + // is appropriate to collapse or expand items. + // + // Now, the logic requires that we update our model item by item, which + // would make it work correctly, but this is extremely slow and scales + // very bad (O(n^2)). That's why we throw away our model and rebuild it + // completely from scratch (O(n)), which is why the view renders all + // displayed data as invalid. + // + // In order to make collapsing/expanding work again, we need to do set + // flags ourselves here. + QMap item_data + = _workspace_model->itemData (index); + + if (item_data[0] == "Local") + _explicit_collapse.local = false; + if (item_data[0] == "Global") + _explicit_collapse.global = false; + if (item_data[0] == "Persistent") + _explicit_collapse.persistent = false; + if (item_data[0] == "Hidden") + _explicit_collapse.hidden = false; +} + +void +workspace_view::item_double_clicked (QModelIndex index) +{ + Q_UNUSED (index); + // TODO: Implement opening a dialog that allows the user to change a variable in the workspace. +} + +void +workspace_view::closeEvent (QCloseEvent *event) +{ + emit active_changed (false); + QDockWidget::closeEvent (event); +} diff --git a/libgui/src/workspace-view.h b/libgui/src/workspace-view.h new file mode 100644 --- /dev/null +++ b/libgui/src/workspace-view.h @@ -0,0 +1,70 @@ +/* + +Copyright (C) 2011-2012 Jacob Dawid + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifndef WORKSPACEVIEW_H +#define WORKSPACEVIEW_H + +#include +#include +#include +#include "octave-link.h" +#include "workspace-model.h" + +class workspace_view : public QDockWidget +{ + Q_OBJECT +public: + workspace_view (QWidget * parent = 0); + ~workspace_view (); + +public slots: + void handle_visibility_changed (bool visible); + void model_changed (); + +signals: + /** Custom signal that tells if a user has clicke away that dock widget. */ + void active_changed (bool active); + +protected: + void closeEvent (QCloseEvent *event); + +protected slots: + void collapse_requested (QModelIndex index); + void expand_requested (QModelIndex index); + void item_double_clicked (QModelIndex index); + +private: + QTreeView *_workspace_tree_view; + + /** Stores the current workspace model. */ + workspace_model *_workspace_model; + + struct + { + bool local; + bool global; + bool persistent; + bool hidden; + } _explicit_collapse; +}; + +#endif // WORKSPACEVIEW_H diff --git a/src/Makefile.am b/libinterp/Makefile.am copy from src/Makefile.am copy to libinterp/Makefile.am --- a/src/Makefile.am +++ b/libinterp/Makefile.am @@ -20,50 +20,22 @@ include $(top_srcdir)/build-aux/common.mk +AUTOMAKE_OPTIONS = subdir-objects + ## Search local directories before those specified by the user. AM_CPPFLAGS = \ -I$(top_srcdir)/libcruft/misc \ -I../liboctave -I$(top_srcdir)/liboctave \ - -Ioctave-value -I$(srcdir)/octave-value \ + -I$(srcdir)/octave-value \ + -I$(srcdir)/operators \ -Iparse-tree -I$(srcdir)/parse-tree \ - -Ioperators -I$(srcdir)/operators \ -Iinterp-core -I$(srcdir)/interp-core \ -Iinterpfcn -I$(srcdir)/interpfcn \ -Icorefcn \ - -I. -I$(srcdir) \ - -I../libgnu -I$(top_srcdir)/libgnu \ - @CPPFLAGS@ - -AUTOMAKE_OPTIONS = subdir-objects + -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu octlib_LTLIBRARIES = liboctinterp.la -if AMCOND_BUILD_COMPILED_AUX_PROGRAMS -bin_PROGRAMS = \ - mkoctfile \ - octave \ - octave-config - -mkoctfile_SOURCES = -nodist_mkoctfile_SOURCES = mkoctfile.cc -mkoctfile_LDADD = ../libgnu/libgnu.la $(LIBS) - -octave_config_SOURCES = -nodist_octave_config_SOURCES = octave-config.cc -octave_config_LDADD = corefcn/libcorefcn.la ../libgnu/libgnu.la $(LIBS) - -BUILT_SOURCES_EXTRA = \ - mkoctfile.cc \ - octave-config.cc -else -bin_PROGRAMS = \ - octave - -bin_SCRIPTS = \ - mkoctfile \ - octave-config -endif - ## Order matters here. Leave builtins.cc last, because it depends on ## $(DEF_FILES), and building those requires all the sources ## (except builtins.cc) to be available. @@ -111,12 +83,8 @@ mk-pkg-add \ mkbuiltins \ mkdefs \ - mkoctfile.in.cc \ - mkoctfile.in.sh \ mkops \ oct-conf.in.h \ - octave-config.in.cc \ - octave-config.in.sh \ version.in.h \ $(BUILT_DISTFILES) @@ -217,18 +185,6 @@ ## FIXME: Does this rule need to be uncommented? #fft.df fft.lo fft2.df fft2.lo fftn.df fftn.lo: CPPFLAGS += $(FFTW_XCPPFLAGS) -octave_SOURCES = main.c - -octave_LDADD = \ - liboctinterp.la \ - ../liboctave/liboctave.la \ - ../libcruft/libcruft.la \ - $(OCTAVE_LINK_DEPS) - -octave_LDFLAGS = \ - $(NO_UNDEFINED_LDFLAG) \ - $(OCTAVE_LINK_OPTS) - ## Section for defining and creating DEF_FILES SRC_DEF_FILES := $(shell $(srcdir)/find-defun-files.sh "$(srcdir)" $(DIST_SRC)) @@ -258,6 +214,12 @@ -DMAKE_BUILTINS $< | $(srcdir)/mkdefs $(srcdir) $< > $@-t mv $@-t $@ +## Override Automake's rule that forces a .hh extension on us even +## though we don't want it. It would be super awesome if automake +## would allow users to choose the header file extension. +.yy.cc: + $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) + ## Special rules: ## Mostly for sources which must be built before rest of compilation. @@ -305,53 +267,9 @@ all-local: $(OCT_STAMP_FILES) $(DLDFCN_PKG_ADD_FILE) endif -if AMCOND_BUILD_COMPILED_AUX_PROGRAMS -octave-config.cc: octave-config.in.cc Makefile - @$(do_subst_default_vals) - -mkoctfile.cc: mkoctfile.in.cc Makefile - @$(do_subst_config_vals) -else -octave-config: octave-config.in.sh Makefile - @$(do_subst_default_vals) - chmod a+rx $@ - -mkoctfile: mkoctfile.in.sh Makefile - @$(do_subst_config_vals) - chmod a+rx $@ -endif - -install-exec-hook: make-version-links - install-data-hook: install-oct -uninstall-local: remove-version-links uninstall-oct - -make-version-links: - cd $(DESTDIR)$(bindir) && \ - for f in $(basename $(bin_PROGRAMS)); do \ - mv $$f$(EXEEXT) $$f-$(version)$(EXEEXT) && \ - $(LN_S) $$f-$(version)$(EXEEXT) $$f$(EXEEXT); \ - done -if ! AMCOND_BUILD_COMPILED_AUX_PROGRAMS - cd $(DESTDIR)$(bindir) && \ - for f in $(basename $(bin_SCRIPTS)); do \ - mv $$f $$f-$(version) && \ - $(LN_S) $$f-$(version) $$f; \ - done -endif - -remove-version-links: - for f in $(basename $(bin_PROGRAMS)); do \ - rm -f $(DESTDIR)$(bindir)/$$f-$(version)$(EXEEXT); \ - done -if ! AMCOND_BUILD_COMPILED_AUX_PROGRAMS - for f in $(basename $(bin_SCRIPTS)); do \ - rm -f $(DESTDIR)$(bindir)/$$f-$(version); \ - done -endif - -.PHONY: make-version-links remove-version-links +uninstall-local: uninstall-oct if AMCOND_ENABLE_DYNAMIC_LINKING install-oct: @@ -384,7 +302,6 @@ .PHONY: install-oct uninstall-oct CLEANFILES = \ - $(bin_SCRIPTS) \ $(DLDFCN_PKG_ADD_FILE) \ interpfcn/graphics-props.cc \ parse-tree/oct-parse.output diff --git a/src/builtins.h b/libinterp/builtins.h rename from src/builtins.h rename to libinterp/builtins.h diff --git a/src/corefcn/__contourc__.cc b/libinterp/corefcn/__contourc__.cc rename from src/corefcn/__contourc__.cc rename to libinterp/corefcn/__contourc__.cc --- a/src/corefcn/__contourc__.cc +++ b/libinterp/corefcn/__contourc__.cc @@ -229,8 +229,8 @@ f[2] = Z(r+1, c+1) - lvl; for (unsigned int i = 0; i < 4; i++) - if (fabs(f[i]) < DBL_EPSILON) - f[i] = DBL_EPSILON; + if (fabs(f[i]) < std::numeric_limits::epsilon ()) + f[i] = std::numeric_limits::epsilon (); if (f[1] * f[2] < 0) mark(r, c) += 2; @@ -248,8 +248,8 @@ f[2] = Z(r+1, c+1) - lvl; for (unsigned int i = 0; i < 4; i++) - if (fabs(f[i]) < DBL_EPSILON) - f[i] = DBL_EPSILON; + if (fabs(f[i]) < std::numeric_limits::epsilon ()) + f[i] = std::numeric_limits::epsilon (); if (f[0] * f[1] < 0) mark(r, c) += 1; diff --git a/src/corefcn/__dispatch__.cc b/libinterp/corefcn/__dispatch__.cc rename from src/corefcn/__dispatch__.cc rename to libinterp/corefcn/__dispatch__.cc diff --git a/src/corefcn/__lin_interpn__.cc b/libinterp/corefcn/__lin_interpn__.cc rename from src/corefcn/__lin_interpn__.cc rename to libinterp/corefcn/__lin_interpn__.cc diff --git a/src/corefcn/__pchip_deriv__.cc b/libinterp/corefcn/__pchip_deriv__.cc rename from src/corefcn/__pchip_deriv__.cc rename to libinterp/corefcn/__pchip_deriv__.cc diff --git a/src/corefcn/__qp__.cc b/libinterp/corefcn/__qp__.cc rename from src/corefcn/__qp__.cc rename to libinterp/corefcn/__qp__.cc --- a/src/corefcn/__qp__.cc +++ b/libinterp/corefcn/__qp__.cc @@ -60,7 +60,7 @@ octave_idx_type tmp = A_nr > A_nc ? A_nr : A_nc; - double tol = tmp * s(0) * DBL_EPSILON; + double tol = tmp * s(0) * std::numeric_limits::epsilon (); octave_idx_type n = s.length (); @@ -76,7 +76,7 @@ retval.resize (A_nc, 0); for (octave_idx_type i = 0; i < retval.numel (); i++) - if (std::abs (retval(i)) < DBL_EPSILON) + if (std::abs (retval(i)) < std::numeric_limits::epsilon ()) retval(i) = 0; } @@ -94,7 +94,7 @@ iter = 0; - double rtol = sqrt (DBL_EPSILON); + double rtol = sqrt (std::numeric_limits::epsilon ()); // Problem dimension. octave_idx_type n = x.length (); @@ -209,7 +209,7 @@ // Following the negative curvature of H. - if (p.transpose () * g > DBL_EPSILON) + if (p.transpose () * g > std::numeric_limits::epsilon ()) p = -p; info = 1; @@ -307,7 +307,7 @@ // Computing the step pz. p = Z * eVrH; - if (p.transpose () * g > DBL_EPSILON) + if (p.transpose () * g > std::numeric_limits::epsilon ()) p = -p; } } diff --git a/src/corefcn/balance.cc b/libinterp/corefcn/balance.cc rename from src/corefcn/balance.cc rename to libinterp/corefcn/balance.cc diff --git a/src/corefcn/besselj.cc b/libinterp/corefcn/besselj.cc rename from src/corefcn/besselj.cc rename to libinterp/corefcn/besselj.cc diff --git a/src/corefcn/betainc.cc b/libinterp/corefcn/betainc.cc rename from src/corefcn/betainc.cc rename to libinterp/corefcn/betainc.cc diff --git a/src/corefcn/bitfcns.cc b/libinterp/corefcn/bitfcns.cc rename from src/corefcn/bitfcns.cc rename to libinterp/corefcn/bitfcns.cc diff --git a/src/corefcn/bsxfun.cc b/libinterp/corefcn/bsxfun.cc rename from src/corefcn/bsxfun.cc rename to libinterp/corefcn/bsxfun.cc diff --git a/src/corefcn/cellfun.cc b/libinterp/corefcn/cellfun.cc rename from src/corefcn/cellfun.cc rename to libinterp/corefcn/cellfun.cc diff --git a/src/corefcn/colloc.cc b/libinterp/corefcn/colloc.cc rename from src/corefcn/colloc.cc rename to libinterp/corefcn/colloc.cc diff --git a/src/corefcn/conv2.cc b/libinterp/corefcn/conv2.cc rename from src/corefcn/conv2.cc rename to libinterp/corefcn/conv2.cc diff --git a/src/corefcn/daspk.cc b/libinterp/corefcn/daspk.cc rename from src/corefcn/daspk.cc rename to libinterp/corefcn/daspk.cc diff --git a/src/corefcn/dasrt.cc b/libinterp/corefcn/dasrt.cc rename from src/corefcn/dasrt.cc rename to libinterp/corefcn/dasrt.cc diff --git a/src/corefcn/dassl.cc b/libinterp/corefcn/dassl.cc rename from src/corefcn/dassl.cc rename to libinterp/corefcn/dassl.cc diff --git a/src/corefcn/det.cc b/libinterp/corefcn/det.cc rename from src/corefcn/det.cc rename to libinterp/corefcn/det.cc diff --git a/src/corefcn/dlmread.cc b/libinterp/corefcn/dlmread.cc rename from src/corefcn/dlmread.cc rename to libinterp/corefcn/dlmread.cc diff --git a/src/corefcn/dot.cc b/libinterp/corefcn/dot.cc rename from src/corefcn/dot.cc rename to libinterp/corefcn/dot.cc diff --git a/src/corefcn/eig.cc b/libinterp/corefcn/eig.cc rename from src/corefcn/eig.cc rename to libinterp/corefcn/eig.cc diff --git a/src/corefcn/fft.cc b/libinterp/corefcn/fft.cc rename from src/corefcn/fft.cc rename to libinterp/corefcn/fft.cc diff --git a/src/corefcn/fft2.cc b/libinterp/corefcn/fft2.cc rename from src/corefcn/fft2.cc rename to libinterp/corefcn/fft2.cc diff --git a/src/corefcn/fftn.cc b/libinterp/corefcn/fftn.cc rename from src/corefcn/fftn.cc rename to libinterp/corefcn/fftn.cc diff --git a/src/corefcn/filter.cc b/libinterp/corefcn/filter.cc rename from src/corefcn/filter.cc rename to libinterp/corefcn/filter.cc diff --git a/src/corefcn/find.cc b/libinterp/corefcn/find.cc rename from src/corefcn/find.cc rename to libinterp/corefcn/find.cc diff --git a/src/corefcn/gammainc.cc b/libinterp/corefcn/gammainc.cc rename from src/corefcn/gammainc.cc rename to libinterp/corefcn/gammainc.cc diff --git a/src/corefcn/gcd.cc b/libinterp/corefcn/gcd.cc rename from src/corefcn/gcd.cc rename to libinterp/corefcn/gcd.cc diff --git a/src/corefcn/getgrent.cc b/libinterp/corefcn/getgrent.cc rename from src/corefcn/getgrent.cc rename to libinterp/corefcn/getgrent.cc diff --git a/src/corefcn/getpwent.cc b/libinterp/corefcn/getpwent.cc rename from src/corefcn/getpwent.cc rename to libinterp/corefcn/getpwent.cc diff --git a/src/corefcn/getrusage.cc b/libinterp/corefcn/getrusage.cc rename from src/corefcn/getrusage.cc rename to libinterp/corefcn/getrusage.cc diff --git a/src/corefcn/givens.cc b/libinterp/corefcn/givens.cc rename from src/corefcn/givens.cc rename to libinterp/corefcn/givens.cc diff --git a/src/corefcn/hess.cc b/libinterp/corefcn/hess.cc rename from src/corefcn/hess.cc rename to libinterp/corefcn/hess.cc diff --git a/src/corefcn/hex2num.cc b/libinterp/corefcn/hex2num.cc rename from src/corefcn/hex2num.cc rename to libinterp/corefcn/hex2num.cc diff --git a/src/corefcn/inv.cc b/libinterp/corefcn/inv.cc rename from src/corefcn/inv.cc rename to libinterp/corefcn/inv.cc diff --git a/src/corefcn/kron.cc b/libinterp/corefcn/kron.cc rename from src/corefcn/kron.cc rename to libinterp/corefcn/kron.cc diff --git a/src/corefcn/lookup.cc b/libinterp/corefcn/lookup.cc rename from src/corefcn/lookup.cc rename to libinterp/corefcn/lookup.cc diff --git a/src/corefcn/lsode.cc b/libinterp/corefcn/lsode.cc rename from src/corefcn/lsode.cc rename to libinterp/corefcn/lsode.cc diff --git a/src/corefcn/lu.cc b/libinterp/corefcn/lu.cc rename from src/corefcn/lu.cc rename to libinterp/corefcn/lu.cc diff --git a/src/corefcn/luinc.cc b/libinterp/corefcn/luinc.cc rename from src/corefcn/luinc.cc rename to libinterp/corefcn/luinc.cc diff --git a/src/corefcn/mappers.cc b/libinterp/corefcn/mappers.cc rename from src/corefcn/mappers.cc rename to libinterp/corefcn/mappers.cc diff --git a/src/corefcn/matrix_type.cc b/libinterp/corefcn/matrix_type.cc rename from src/corefcn/matrix_type.cc rename to libinterp/corefcn/matrix_type.cc diff --git a/src/corefcn/max.cc b/libinterp/corefcn/max.cc rename from src/corefcn/max.cc rename to libinterp/corefcn/max.cc diff --git a/src/corefcn/md5sum.cc b/libinterp/corefcn/md5sum.cc rename from src/corefcn/md5sum.cc rename to libinterp/corefcn/md5sum.cc diff --git a/src/corefcn/mgorth.cc b/libinterp/corefcn/mgorth.cc rename from src/corefcn/mgorth.cc rename to libinterp/corefcn/mgorth.cc diff --git a/src/corefcn/module.mk b/libinterp/corefcn/module.mk rename from src/corefcn/module.mk rename to libinterp/corefcn/module.mk diff --git a/src/corefcn/nproc.cc b/libinterp/corefcn/nproc.cc rename from src/corefcn/nproc.cc rename to libinterp/corefcn/nproc.cc diff --git a/src/corefcn/pinv.cc b/libinterp/corefcn/pinv.cc rename from src/corefcn/pinv.cc rename to libinterp/corefcn/pinv.cc diff --git a/src/corefcn/quad.cc b/libinterp/corefcn/quad.cc rename from src/corefcn/quad.cc rename to libinterp/corefcn/quad.cc diff --git a/src/corefcn/quadcc.cc b/libinterp/corefcn/quadcc.cc rename from src/corefcn/quadcc.cc rename to libinterp/corefcn/quadcc.cc --- a/src/corefcn/quadcc.cc +++ b/libinterp/corefcn/quadcc.cc @@ -1885,7 +1885,7 @@ /* Should we drop this interval? */ if ((m + h * xi[0]) >= (m + h * xi[1]) || (m + h * xi[31]) >= (m + h * xi[32]) - || iv->err < fabs (iv->igral) * DBL_EPSILON * 10) + || iv->err < fabs (iv->igral) * std::numeric_limits::epsilon () * 10) { /* printf diff --git a/src/corefcn/qz.cc b/libinterp/corefcn/qz.cc rename from src/corefcn/qz.cc rename to libinterp/corefcn/qz.cc --- a/src/corefcn/qz.cc +++ b/libinterp/corefcn/qz.cc @@ -849,7 +849,7 @@ nn, nn, aa.data (), nn, work.fortran_vec (), inf_norm F77_CHAR_ARG_LEN (1))); - double eps = DBL_EPSILON * inf_norm * nn; + double eps = std::numeric_limits::epsilon () * inf_norm * nn; #ifdef DEBUG_SORT std::cout << "qz: calling dsubsp: aa=" << std::endl; diff --git a/src/corefcn/rand.cc b/libinterp/corefcn/rand.cc rename from src/corefcn/rand.cc rename to libinterp/corefcn/rand.cc diff --git a/src/corefcn/rcond.cc b/libinterp/corefcn/rcond.cc rename from src/corefcn/rcond.cc rename to libinterp/corefcn/rcond.cc diff --git a/src/corefcn/regexp.cc b/libinterp/corefcn/regexp.cc rename from src/corefcn/regexp.cc rename to libinterp/corefcn/regexp.cc --- a/src/corefcn/regexp.cc +++ b/libinterp/corefcn/regexp.cc @@ -596,10 +596,7 @@ end (@code{$}) of the string.\n\ @end table\n\ \n\ -In addition, the following escaped characters have special meaning. Note,\n\ -it is recommended to quote @var{pat} in single quotes, rather than double\n\ -quotes, to avoid the escape sequences being interpreted by Octave before\n\ -being passed to @code{regexp}.\n\ +In addition, the following escaped characters have special meaning.\n\ \n\ @table @code\n\ @item \\b\n\ @@ -633,6 +630,12 @@ Match any non-digit\n\ @end table\n\ \n\ +Implementation Note: For compatibility with @sc{matlab}, ordinary escape\n\ +sequences (e.g., \"\\n\" => newline) are processed in @var{pat}\n\ +regardless of whether @var{pat} has been defined within single quotes. Use\n\ +a second backslash to stop interpolation of the escape sequence (e.g.,\n\ +\"\\\\n\") or use the @code{regexptranslate} function.\n\ +\n\ The outputs of @code{regexp} default to the order given below\n\ \n\ @table @var\n\ @@ -1258,6 +1261,11 @@ This option is present for compatibility but is ignored.\n\ \n\ @end table\n\ +\n\ +Implementation Note: For compatibility with @sc{matlab}, ordinary escape\n\ +sequences (e.g., \"\\n\" => newline) are processed in both @var{pat}\n\ +and @var{repstr} regardless of whether they were defined within single quotes. Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\ +\"\\\\n\") or use the @code{regexptranslate} function.\n\ @seealso{regexp, regexpi, strrep}\n\ @end deftypefn") { diff --git a/src/corefcn/schur.cc b/libinterp/corefcn/schur.cc rename from src/corefcn/schur.cc rename to libinterp/corefcn/schur.cc diff --git a/src/corefcn/sparse.cc b/libinterp/corefcn/sparse.cc rename from src/corefcn/sparse.cc rename to libinterp/corefcn/sparse.cc diff --git a/src/corefcn/spparms.cc b/libinterp/corefcn/spparms.cc rename from src/corefcn/spparms.cc rename to libinterp/corefcn/spparms.cc diff --git a/src/corefcn/sqrtm.cc b/libinterp/corefcn/sqrtm.cc rename from src/corefcn/sqrtm.cc rename to libinterp/corefcn/sqrtm.cc diff --git a/src/corefcn/str2double.cc b/libinterp/corefcn/str2double.cc rename from src/corefcn/str2double.cc rename to libinterp/corefcn/str2double.cc diff --git a/src/corefcn/strfind.cc b/libinterp/corefcn/strfind.cc rename from src/corefcn/strfind.cc rename to libinterp/corefcn/strfind.cc --- a/src/corefcn/strfind.cc +++ b/libinterp/corefcn/strfind.cc @@ -25,10 +25,10 @@ #include #endif -#include -#include #include #include +#include +#include #include "Cell.h" #include "ov.h" @@ -39,13 +39,13 @@ // This allows safe indexing with char. In C++, char may be (and often is) signed! #define ORD(ch) static_cast(ch) -#define TABSIZE (UCHAR_MAX + 1) +#define TABSIZE (std::numeric_limits::max () + 1) // This is the quick search algorithm, as described at // http://www-igm.univ-mlv.fr/~lecroq/string/node19.html static void qs_preprocess (const Array& needle, - octave_idx_type table[TABSIZE]) + octave_idx_type *table) { const char *x = needle.data (); octave_idx_type m = needle.numel (); @@ -60,7 +60,7 @@ static Array qs_search (const Array& needle, const Array& haystack, - const octave_idx_type table[TABSIZE], + const octave_idx_type *table, bool overlaps = true) { const char *x = needle.data (); @@ -261,7 +261,7 @@ static Array qs_replace (const Array& str, const Array& pat, const Array& rep, - const octave_idx_type table[TABSIZE], + const octave_idx_type *table, bool overlaps = true) { Array ret = str; diff --git a/src/corefcn/strfns.cc b/libinterp/corefcn/strfns.cc rename from src/corefcn/strfns.cc rename to libinterp/corefcn/strfns.cc diff --git a/src/corefcn/sub2ind.cc b/libinterp/corefcn/sub2ind.cc rename from src/corefcn/sub2ind.cc rename to libinterp/corefcn/sub2ind.cc diff --git a/src/corefcn/svd.cc b/libinterp/corefcn/svd.cc rename from src/corefcn/svd.cc rename to libinterp/corefcn/svd.cc diff --git a/src/corefcn/syl.cc b/libinterp/corefcn/syl.cc rename from src/corefcn/syl.cc rename to libinterp/corefcn/syl.cc diff --git a/src/corefcn/syscalls.cc b/libinterp/corefcn/syscalls.cc rename from src/corefcn/syscalls.cc rename to libinterp/corefcn/syscalls.cc --- a/src/corefcn/syscalls.cc +++ b/libinterp/corefcn/syscalls.cc @@ -1376,21 +1376,17 @@ @seealso{waitpid, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\ @end deftypefn") { - octave_value retval = 0.0; + octave_value retval = false; -#if defined (WIFEXITED) if (args.length () == 1) { int status = args(0).int_value (); if (! error_state) - retval = WIFEXITED (status); + retval = octave_wait::ifexited (status); else error ("WIFEXITED: STATUS must be an integer"); } -#else - warning ("WIFEXITED always returns false in this version of Octave"); -#endif return retval; } @@ -1404,21 +1400,17 @@ @seealso{waitpid, WIFEXITED, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\ @end deftypefn") { - octave_value retval = 0.0; + octave_value retval = 0; -#if defined (WEXITSTATUS) if (args.length () == 1) { int status = args(0).int_value (); if (! error_state) - retval = WEXITSTATUS (status); + retval = octave_wait::exitstatus (status); else error ("WEXITSTATUS: STATUS must be an integer"); } -#else - warning ("WEXITSTATUS always returns false in this version of Octave"); -#endif return retval; } @@ -1431,21 +1423,17 @@ @seealso{waitpid, WIFEXITED, WEXITSTATUS, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\ @end deftypefn") { - octave_value retval = 0.0; + octave_value retval = false; -#if defined (WIFSIGNALED) if (args.length () == 1) { int status = args(0).int_value (); if (! error_state) - retval = WIFSIGNALED (status); + retval = octave_wait::ifsignaled (status); else error ("WIFSIGNALED: STATUS must be an integer"); } -#else - warning ("WIFSIGNALED always returns false in this version of Octave"); -#endif return retval; } @@ -1459,21 +1447,17 @@ @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WCOREDUMP, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\ @end deftypefn") { - octave_value retval = 0.0; + octave_value retval = 0; -#if defined (WTERMSIG) if (args.length () == 1) { int status = args(0).int_value (); if (! error_state) - retval = WTERMSIG (status); + retval = octave_wait::termsig (status); else error ("WTERMSIG: STATUS must be an integer"); } -#else - warning ("WTERMSIG always returns false in this version of Octave"); -#endif return retval; } @@ -1489,21 +1473,17 @@ @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WIFSTOPPED, WSTOPSIG, WIFCONTINUED}\n\ @end deftypefn") { - octave_value retval = 0.0; + octave_value retval = false; -#if defined (WCOREDUMP) if (args.length () == 1) { int status = args(0).int_value (); if (! error_state) - retval = WCOREDUMP (status); + retval = octave_wait::coredump (status); else error ("WCOREDUMP: STATUS must be an integer"); } -#else - warning ("WCOREDUMP always returns false in this version of Octave"); -#endif return retval; } @@ -1518,21 +1498,17 @@ @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WSTOPSIG, WIFCONTINUED}\n\ @end deftypefn") { - octave_value retval = 0.0; + octave_value retval = false; -#if defined (WIFSTOPPED) if (args.length () == 1) { int status = args(0).int_value (); if (! error_state) - retval = WIFSTOPPED (status); + retval = octave_wait::ifstopped (status); else error ("WIFSTOPPED: STATUS must be an integer"); } -#else - warning ("WIFSTOPPED always returns false in this version of Octave"); -#endif return retval; } @@ -1546,21 +1522,17 @@ @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WIFCONTINUED}\n\ @end deftypefn") { - octave_value retval = 0.0; + octave_value retval = 0; -#if defined (WSTOPSIG) if (args.length () == 1) { int status = args(0).int_value (); if (! error_state) - retval = WSTOPSIG (status); + retval = octave_wait::stopsig (status); else error ("WSTOPSIG: STATUS must be an integer"); } -#else - warning ("WSTOPSIG always returns false in this version of Octave"); -#endif return retval; } @@ -1573,21 +1545,17 @@ @seealso{waitpid, WIFEXITED, WEXITSTATUS, WIFSIGNALED, WTERMSIG, WCOREDUMP, WIFSTOPPED, WSTOPSIG}\n\ @end deftypefn") { - octave_value retval = 0.0; + octave_value retval = false; -#if defined (WIFCONTINUED) if (args.length () == 1) { int status = args(0).int_value (); if (! error_state) - retval = WIFCONTINUED (status); + retval = octave_wait::ifcontinued (status); else error ("WIFCONTINUED: STATUS must be an integer"); } -#else - warning ("WIFCONTINUED always returns false in this version of Octave"); -#endif return retval; } diff --git a/src/corefcn/time.cc b/libinterp/corefcn/time.cc rename from src/corefcn/time.cc rename to libinterp/corefcn/time.cc diff --git a/src/corefcn/tril.cc b/libinterp/corefcn/tril.cc rename from src/corefcn/tril.cc rename to libinterp/corefcn/tril.cc diff --git a/src/corefcn/typecast.cc b/libinterp/corefcn/typecast.cc rename from src/corefcn/typecast.cc rename to libinterp/corefcn/typecast.cc diff --git a/src/dldfcn/__delaunayn__.cc b/libinterp/dldfcn/__delaunayn__.cc rename from src/dldfcn/__delaunayn__.cc rename to libinterp/dldfcn/__delaunayn__.cc diff --git a/src/dldfcn/__dsearchn__.cc b/libinterp/dldfcn/__dsearchn__.cc rename from src/dldfcn/__dsearchn__.cc rename to libinterp/dldfcn/__dsearchn__.cc diff --git a/src/dldfcn/__fltk_uigetfile__.cc b/libinterp/dldfcn/__fltk_uigetfile__.cc rename from src/dldfcn/__fltk_uigetfile__.cc rename to libinterp/dldfcn/__fltk_uigetfile__.cc diff --git a/src/dldfcn/__glpk__.cc b/libinterp/dldfcn/__glpk__.cc rename from src/dldfcn/__glpk__.cc rename to libinterp/dldfcn/__glpk__.cc --- a/src/dldfcn/__glpk__.cc +++ b/libinterp/dldfcn/__glpk__.cc @@ -118,8 +118,8 @@ 1e-7, 1e-7, 1e-9, - -DBL_MAX, - DBL_MAX, + -std::numeric_limits::max (), + std::numeric_limits::max (), -1.0, 0.0, 1e-6, diff --git a/src/dldfcn/__init_fltk__.cc b/libinterp/dldfcn/__init_fltk__.cc rename from src/dldfcn/__init_fltk__.cc rename to libinterp/dldfcn/__init_fltk__.cc diff --git a/src/dldfcn/__init_gnuplot__.cc b/libinterp/dldfcn/__init_gnuplot__.cc rename from src/dldfcn/__init_gnuplot__.cc rename to libinterp/dldfcn/__init_gnuplot__.cc diff --git a/src/dldfcn/__magick_read__.cc b/libinterp/dldfcn/__magick_read__.cc rename from src/dldfcn/__magick_read__.cc rename to libinterp/dldfcn/__magick_read__.cc diff --git a/src/dldfcn/__voronoi__.cc b/libinterp/dldfcn/__voronoi__.cc rename from src/dldfcn/__voronoi__.cc rename to libinterp/dldfcn/__voronoi__.cc diff --git a/src/dldfcn/amd.cc b/libinterp/dldfcn/amd.cc rename from src/dldfcn/amd.cc rename to libinterp/dldfcn/amd.cc diff --git a/src/dldfcn/ccolamd.cc b/libinterp/dldfcn/ccolamd.cc rename from src/dldfcn/ccolamd.cc rename to libinterp/dldfcn/ccolamd.cc diff --git a/src/dldfcn/chol.cc b/libinterp/dldfcn/chol.cc rename from src/dldfcn/chol.cc rename to libinterp/dldfcn/chol.cc --- a/src/dldfcn/chol.cc +++ b/libinterp/dldfcn/chol.cc @@ -197,7 +197,7 @@ if (! error_state) { - octave_idx_type info; + octave_idx_type info = nargout; SparseCHOL fact (m, info, natural); if (nargout == 3) { @@ -225,7 +225,7 @@ if (! error_state) { - octave_idx_type info; + octave_idx_type info = nargout; SparseComplexCHOL fact (m, info, natural); if (nargout == 3) diff --git a/src/dldfcn/colamd.cc b/libinterp/dldfcn/colamd.cc rename from src/dldfcn/colamd.cc rename to libinterp/dldfcn/colamd.cc diff --git a/src/dldfcn/config-module.awk b/libinterp/dldfcn/config-module.awk rename from src/dldfcn/config-module.awk rename to libinterp/dldfcn/config-module.awk diff --git a/src/dldfcn/config-module.sh b/libinterp/dldfcn/config-module.sh rename from src/dldfcn/config-module.sh rename to libinterp/dldfcn/config-module.sh --- a/src/dldfcn/config-module.sh +++ b/libinterp/dldfcn/config-module.sh @@ -12,7 +12,7 @@ move_if_change="$top_srcdir/build-aux/move-if-change" -dld_dir=$top_srcdir/src/dldfcn +dld_dir=$top_srcdir/libinterp/dldfcn $AWK -f $dld_dir/config-module.awk < $dld_dir/module-files > $dld_dir/module.mk-t diff --git a/src/dldfcn/convhulln.cc b/libinterp/dldfcn/convhulln.cc rename from src/dldfcn/convhulln.cc rename to libinterp/dldfcn/convhulln.cc diff --git a/src/dldfcn/dmperm.cc b/libinterp/dldfcn/dmperm.cc rename from src/dldfcn/dmperm.cc rename to libinterp/dldfcn/dmperm.cc diff --git a/src/dldfcn/eigs.cc b/libinterp/dldfcn/eigs.cc rename from src/dldfcn/eigs.cc rename to libinterp/dldfcn/eigs.cc --- a/src/dldfcn/eigs.cc +++ b/libinterp/dldfcn/eigs.cc @@ -329,7 +329,7 @@ bool a_is_sparse = false; ColumnVector permB; int arg_offset = 0; - double tol = DBL_EPSILON; + double tol = std::numeric_limits::epsilon (); int maxit = 300; int disp = 0; octave_idx_type p = -1; diff --git a/src/dldfcn/fftw.cc b/libinterp/dldfcn/fftw.cc rename from src/dldfcn/fftw.cc rename to libinterp/dldfcn/fftw.cc diff --git a/src/dldfcn/module-files b/libinterp/dldfcn/module-files rename from src/dldfcn/module-files rename to libinterp/dldfcn/module-files diff --git a/src/dldfcn/oct-qhull.h b/libinterp/dldfcn/oct-qhull.h rename from src/dldfcn/oct-qhull.h rename to libinterp/dldfcn/oct-qhull.h diff --git a/src/dldfcn/qr.cc b/libinterp/dldfcn/qr.cc rename from src/dldfcn/qr.cc rename to libinterp/dldfcn/qr.cc diff --git a/src/dldfcn/symbfact.cc b/libinterp/dldfcn/symbfact.cc rename from src/dldfcn/symbfact.cc rename to libinterp/dldfcn/symbfact.cc diff --git a/src/dldfcn/symrcm.cc b/libinterp/dldfcn/symrcm.cc rename from src/dldfcn/symrcm.cc rename to libinterp/dldfcn/symrcm.cc diff --git a/src/dldfcn/tsearch.cc b/libinterp/dldfcn/tsearch.cc rename from src/dldfcn/tsearch.cc rename to libinterp/dldfcn/tsearch.cc diff --git a/src/dldfcn/urlwrite.cc b/libinterp/dldfcn/urlwrite.cc rename from src/dldfcn/urlwrite.cc rename to libinterp/dldfcn/urlwrite.cc diff --git a/src/find-defun-files.sh b/libinterp/find-defun-files.sh rename from src/find-defun-files.sh rename to libinterp/find-defun-files.sh diff --git a/src/gendoc.pl b/libinterp/gendoc.pl rename from src/gendoc.pl rename to libinterp/gendoc.pl diff --git a/src/genprops.awk b/libinterp/genprops.awk rename from src/genprops.awk rename to libinterp/genprops.awk diff --git a/src/interp-core/Cell.cc b/libinterp/interp-core/Cell.cc rename from src/interp-core/Cell.cc rename to libinterp/interp-core/Cell.cc diff --git a/src/interp-core/Cell.h b/libinterp/interp-core/Cell.h rename from src/interp-core/Cell.h rename to libinterp/interp-core/Cell.h diff --git a/src/interp-core/c-file-ptr-stream.cc b/libinterp/interp-core/c-file-ptr-stream.cc rename from src/interp-core/c-file-ptr-stream.cc rename to libinterp/interp-core/c-file-ptr-stream.cc diff --git a/src/interp-core/c-file-ptr-stream.h b/libinterp/interp-core/c-file-ptr-stream.h rename from src/interp-core/c-file-ptr-stream.h rename to libinterp/interp-core/c-file-ptr-stream.h diff --git a/src/interp-core/comment-list.cc b/libinterp/interp-core/comment-list.cc rename from src/interp-core/comment-list.cc rename to libinterp/interp-core/comment-list.cc diff --git a/src/interp-core/comment-list.h b/libinterp/interp-core/comment-list.h rename from src/interp-core/comment-list.h rename to libinterp/interp-core/comment-list.h diff --git a/src/interp-core/cutils.c b/libinterp/interp-core/cutils.c rename from src/interp-core/cutils.c rename to libinterp/interp-core/cutils.c diff --git a/src/interp-core/cutils.h b/libinterp/interp-core/cutils.h rename from src/interp-core/cutils.h rename to libinterp/interp-core/cutils.h diff --git a/src/interp-core/defun-dld.h b/libinterp/interp-core/defun-dld.h rename from src/interp-core/defun-dld.h rename to libinterp/interp-core/defun-dld.h diff --git a/src/interp-core/defun-int.h b/libinterp/interp-core/defun-int.h rename from src/interp-core/defun-int.h rename to libinterp/interp-core/defun-int.h diff --git a/src/interp-core/display.cc b/libinterp/interp-core/display.cc rename from src/interp-core/display.cc rename to libinterp/interp-core/display.cc --- a/src/interp-core/display.cc +++ b/libinterp/interp-core/display.cc @@ -79,6 +79,8 @@ rx = wd * 25.4 / wd_mm; ry = ht * 25.4 / ht_mm; + + dpy_avail = true; } else warning ("no graphical display found"); @@ -109,6 +111,8 @@ rx = wd * 25.4 / wd_mm; ry = ht * 25.4 / ht_mm; + + dpy_avail = true; } else warning ("no graphical display found"); @@ -144,6 +148,8 @@ warning ("X11 display has no default screen"); XCloseDisplay (display); + + dpy_avail = true; } else warning ("unable to open X11 DISPLAY"); diff --git a/src/interp-core/display.h b/libinterp/interp-core/display.h rename from src/interp-core/display.h rename to libinterp/interp-core/display.h --- a/src/interp-core/display.h +++ b/libinterp/interp-core/display.h @@ -30,7 +30,7 @@ protected: display_info (bool query = true) - : ht (1), wd (1), dp (0), rx (72), ry (72) + : ht (1), wd (1), dp (0), rx (72), ry (72), dpy_avail (false) { init (query); } @@ -62,6 +62,11 @@ return instance_ok () ? instance->do_y_dpi () : 0; } + static bool display_available (void) + { + return instance_ok () ? instance->do_display_available () : false; + } + // To disable querying the window system for defaults, this function // must be called before any other display_info function. static void no_window_system (void) @@ -84,6 +89,8 @@ double rx; double ry; + bool dpy_avail; + int do_height (void) const { return ht; } int do_width (void) const { return wd; } int do_depth (void) const { return dp; } @@ -91,6 +98,8 @@ double do_x_dpi (void) const { return rx; } double do_y_dpi (void) const { return ry; } + bool do_display_available (void) const { return dpy_avail; } + void init (bool query = true); static bool instance_ok (bool query = true); diff --git a/src/interp-core/dynamic-ld.cc b/libinterp/interp-core/dynamic-ld.cc rename from src/interp-core/dynamic-ld.cc rename to libinterp/interp-core/dynamic-ld.cc diff --git a/src/interp-core/dynamic-ld.h b/libinterp/interp-core/dynamic-ld.h rename from src/interp-core/dynamic-ld.h rename to libinterp/interp-core/dynamic-ld.h diff --git a/src/interp-core/gl-render.cc b/libinterp/interp-core/gl-render.cc rename from src/interp-core/gl-render.cc rename to libinterp/interp-core/gl-render.cc --- a/src/interp-core/gl-render.cc +++ b/libinterp/interp-core/gl-render.cc @@ -135,7 +135,7 @@ { int m = 1; - while (m < n && m < INT_MAX) + while (m < n && m < std::numeric_limits::max ()) m <<= 1; return m; @@ -1425,7 +1425,7 @@ Matrix z = xform.zscale (props.get_zdata ().matrix_value ()); bool has_z = (z.numel () > 0); - int n = static_cast (::xmin (::xmin (x.numel (), y.numel ()), (has_z ? z.numel () : INT_MAX))); + int n = static_cast (::xmin (::xmin (x.numel (), y.numel ()), (has_z ? z.numel () : std::numeric_limits::max ()))); octave_uint8 clip_mask = (props.is_clipping () ? 0x7F : 0x40), clip_ok (0x40); std::vector clip (n); diff --git a/src/interp-core/gl-render.h b/libinterp/interp-core/gl-render.h rename from src/interp-core/gl-render.h rename to libinterp/interp-core/gl-render.h diff --git a/src/interp-core/gl2ps-renderer.cc b/libinterp/interp-core/gl2ps-renderer.cc rename from src/interp-core/gl2ps-renderer.cc rename to libinterp/interp-core/gl2ps-renderer.cc diff --git a/src/interp-core/gl2ps-renderer.h b/libinterp/interp-core/gl2ps-renderer.h rename from src/interp-core/gl2ps-renderer.h rename to libinterp/interp-core/gl2ps-renderer.h diff --git a/src/interp-core/gl2ps.c b/libinterp/interp-core/gl2ps.c rename from src/interp-core/gl2ps.c rename to libinterp/interp-core/gl2ps.c diff --git a/src/interp-core/gl2ps.h b/libinterp/interp-core/gl2ps.h rename from src/interp-core/gl2ps.h rename to libinterp/interp-core/gl2ps.h diff --git a/src/interp-core/gripes.cc b/libinterp/interp-core/gripes.cc rename from src/interp-core/gripes.cc rename to libinterp/interp-core/gripes.cc diff --git a/src/interp-core/gripes.h b/libinterp/interp-core/gripes.h rename from src/interp-core/gripes.h rename to libinterp/interp-core/gripes.h diff --git a/src/interp-core/jit-ir.cc b/libinterp/interp-core/jit-ir.cc rename from src/interp-core/jit-ir.cc rename to libinterp/interp-core/jit-ir.cc --- a/src/interp-core/jit-ir.cc +++ b/libinterp/interp-core/jit-ir.cc @@ -36,7 +36,88 @@ #include #include "error.h" -#include "pt-jit.h" + +// -------------------- jit_factory -------------------- +jit_factory::~jit_factory (void) +{ + for (value_list::iterator iter = all_values.begin (); + iter != all_values.end (); ++iter) + delete *iter; +} + +void +jit_factory::track_value (jit_value *value) +{ + if (value->type ()) + mconstants.push_back (value); + all_values.push_back (value); +} + +// -------------------- jit_block_list -------------------- +void +jit_block_list::insert_after (iterator iter, jit_block *ablock) +{ + ++iter; + insert_before (iter, ablock); +} + +void +jit_block_list::insert_after (jit_block *loc, jit_block *ablock) +{ + insert_after (loc->location (), ablock); +} + +void +jit_block_list::insert_before (iterator iter, jit_block *ablock) +{ + iter = mlist.insert (iter, ablock); + ablock->stash_location (iter); +} + +void +jit_block_list::insert_before (jit_block *loc, jit_block *ablock) +{ + insert_before (loc->location (), ablock); +} + +std::ostream& +jit_block_list::print (std::ostream& os, const std::string& header) const +{ + os << "-------------------- " << header << " --------------------\n"; + return os << *this; +} + +std::ostream& +jit_block_list::print_dom (std::ostream& os) const +{ + os << "-------------------- dom info --------------------\n"; + for (const_iterator iter = begin (); iter != end (); ++iter) + { + assert (*iter); + (*iter)->print_dom (os); + } + os << std::endl; +} + +void +jit_block_list::push_back (jit_block *b) +{ + mlist.push_back (b); + iterator iter = mlist.end (); + b->stash_location (--iter); +} + +std::ostream& +operator<<(std::ostream& os, const jit_block_list& blocks) +{ + for (jit_block_list::const_iterator iter = blocks.begin (); + iter != blocks.end (); ++iter) + { + assert (*iter); + (*iter)->print (os, 0); + } + return os << std::endl; +} // -------------------- jit_use -------------------- jit_block * @@ -396,22 +477,20 @@ } jit_block * -jit_block::maybe_split (jit_convert& convert, jit_block *asuccessor) +jit_block::maybe_split (jit_factory& factory, jit_block_list& blocks, + jit_block *asuccessor) { if (successor_count () > 1) { jit_terminator *term = terminator (); size_t idx = term->successor_index (asuccessor); - jit_block *split = convert.create ("phi_split", mvisit_count); + jit_block *split = factory.create ("phi_split", mvisit_count); - // try to place splits where they make sense - if (id () < asuccessor->id ()) - convert.insert_before (asuccessor, split); - else - convert.insert_after (this, split); + // place after this to ensure define before use in the blocks list + blocks.insert_after (this, split); term->stash_argument (idx, split); - jit_branch *br = split->append (convert.create (asuccessor)); + jit_branch *br = split->append (factory.create (asuccessor)); replace_in_phi (asuccessor, split); if (alive ()) @@ -599,10 +678,10 @@ } // -------------------- jit_magic_end -------------------- -jit_magic_end::context::context (jit_convert& convert, jit_value *avalue, +jit_magic_end::context::context (jit_factory& factory, jit_value *avalue, size_t aindex, size_t acount) - : value (avalue), index (convert.create (aindex)), - count (convert.create (acount)) + : value (avalue), index (factory.create (aindex)), + count (factory.create (acount)) {} jit_magic_end::jit_magic_end (const std::vector& full_context) @@ -619,9 +698,19 @@ jit_magic_end::context jit_magic_end::resolve_context (void) const { - // FIXME: We need to have a way of marking functions so we can skip them here - context ret = contexts[0]; - ret.value = argument (0); + size_t idx; + for (idx = 0; idx < contexts.size (); ++idx) + { + jit_type *ctx_type = contexts[idx].value->type (); + if (! ctx_type || ctx_type->skip_paren ()) + break; + } + + if (idx >= contexts.size ()) + idx = 0; + + context ret = contexts[idx]; + ret.value = argument (idx); return ret; } diff --git a/src/interp-core/jit-ir.h b/libinterp/interp-core/jit-ir.h rename from src/interp-core/jit-ir.h rename to libinterp/interp-core/jit-ir.h --- a/src/interp-core/jit-ir.h +++ b/libinterp/interp-core/jit-ir.h @@ -69,8 +69,6 @@ #undef JIT_METH -class jit_convert; - // ABCs which aren't included in JIT_VISIT_IR_ALL class jit_instruction; class jit_terminator; @@ -92,6 +90,95 @@ class jit_ir_walker; class jit_use; +// Creates and tracks memory for jit_value and subclasses. +// Memory managment is simple, all values that are created live as long as the +// factory. +class +jit_factory +{ + typedef std::list value_list; +public: + ~jit_factory (void); + + const value_list& constants (void) const { return mconstants; } + + template + T *create (void) + { + T *ret = new T (); + track_value (ret); + return ret; + } + +#define DECL_ARG(n) const ARG ## n& arg ## n +#define JIT_CREATE(N) \ + template \ + T *create (OCT_MAKE_LIST (DECL_ARG, N)) \ + { \ + T *ret = new T (OCT_MAKE_ARG_LIST (arg, N)); \ + track_value (ret); \ + return ret; \ + } + + JIT_CREATE (1) + JIT_CREATE (2) + JIT_CREATE (3) + JIT_CREATE (4) + +#undef JIT_CREATE +#undef DECL_ARG +private: + void track_value (jit_value *v); + + value_list all_values; + + value_list mconstants; +}; + +// A list of basic blocks (jit_block) which form some body of code. +// +// We do not directly inherit from std::list because we need to update the +// blocks stashed location in push_back and insert. +class +jit_block_list +{ +public: + typedef std::list::iterator iterator; + typedef std::list::const_iterator const_iterator; + + jit_block *back (void) const { return mlist.back (); } + + iterator begin (void) { return mlist.begin (); } + + const_iterator begin (void) const { return mlist.begin (); } + + iterator end (void) { return mlist.end (); } + + const_iterator end (void) const { return mlist.end (); } + + iterator erase (iterator iter) { return mlist.erase (iter); } + + jit_block *front (void) const { return mlist.front (); } + + void insert_after (iterator iter, jit_block *ablock); + + void insert_after (jit_block *loc, jit_block *ablock); + + void insert_before (iterator iter, jit_block *ablock); + + void insert_before (jit_block *loc, jit_block *ablock); + + std::ostream& print (std::ostream& os, const std::string& header) const; + + std::ostream& print_dom (std::ostream& os) const; + + void push_back (jit_block *b); +private: + std::list mlist; +}; + +std::ostream& operator<<(std::ostream& os, const jit_block_list& blocks); + class jit_value : public jit_internal_list { @@ -579,10 +666,10 @@ // See for idom computation algorithm // Cooper, Keith D.; Harvey, Timothy J; and Kennedy, Ken (2001). // "A Simple, Fast Dominance Algorithm" - void compute_idom (jit_block *entry_block) + void compute_idom (jit_block& entry_block) { bool changed; - entry_block->idom = entry_block; + entry_block.idom = &entry_block; do changed = update_idom (mvisit_count); while (changed); @@ -633,12 +720,13 @@ return os; } - // ... - jit_block *maybe_split (jit_convert& convert, jit_block *asuccessor); + jit_block *maybe_split (jit_factory& factory, jit_block_list& blocks, + jit_block *asuccessor); - jit_block *maybe_split (jit_convert& convert, jit_block& asuccessor) + jit_block *maybe_split (jit_factory& factory, jit_block_list& blocks, + jit_block& asuccessor) { - return maybe_split (convert, &asuccessor); + return maybe_split (factory, blocks, &asuccessor); } // print dominator infomration @@ -1162,7 +1250,7 @@ context (void) : value (0), index (0), count (0) {} - context (jit_convert& convert, jit_value *avalue, size_t aindex, + context (jit_factory& factory, jit_value *avalue, size_t aindex, size_t acount); jit_value *value; diff --git a/src/interp-core/jit-typeinfo.cc b/libinterp/interp-core/jit-typeinfo.cc rename from src/interp-core/jit-typeinfo.cc rename to libinterp/interp-core/jit-typeinfo.cc --- a/src/interp-core/jit-typeinfo.cc +++ b/libinterp/interp-core/jit-typeinfo.cc @@ -381,8 +381,8 @@ xisint (double x) { return (D_NINT (x) == x - && ((x >= 0 && x < INT_MAX) - || (x <= 0 && x > INT_MIN))); + && ((x >= 0 && x < std::numeric_limits::max ()) + || (x <= 0 && x > std::numeric_limits::min ()))); } extern "C" Complex @@ -441,26 +441,16 @@ ovl = fn (ovl, 1); - // These type checks are not strictly required, but I'm guessing that - // incorrect types will be entered on occasion. This will be very difficult to - // debug unless we do the sanity check here. + // FIXME: Check result_type somehow if (result_type) { - if (ovl.length () != 1) + if (ovl.length () < 1) { gripe_bad_result (); return 0; } - octave_value& result = ovl.xelem (0); - jit_type *jtype = jit_typeinfo::join (jit_typeinfo::type_of (result), - result_type); - if (jtype != result_type) - { - gripe_bad_result (); - return 0; - } - + octave_value result = ovl.xelem(0); octave_base_value *ret = result.internal_rep (); ret->grab (); return ret; @@ -500,9 +490,9 @@ // -------------------- jit_type -------------------- jit_type::jit_type (const std::string& aname, jit_type *aparent, - llvm::Type *allvm_type, int aid) : + llvm::Type *allvm_type, bool askip_paren, int aid) : mname (aname), mparent (aparent), llvm_type (allvm_type), mid (aid), - mdepth (aparent ? aparent->mdepth + 1 : 0) + mdepth (aparent ? aparent->mdepth + 1 : 0), mskip_paren (askip_paren) { std::memset (msret, 0, sizeof (msret)); std::memset (mpointer_arg, 0, sizeof (mpointer_arg)); @@ -837,7 +827,7 @@ } jit_function * -jit_operation::generate (const signature_vec& types) const +jit_operation::generate (const signature_vec&) const { return 0; } @@ -1041,6 +1031,7 @@ complex = new_type ("complex", any, complex_t); scalar = new_type ("scalar", complex, scalar_t); scalar_ptr = new_type ("scalar_ptr", 0, scalar_t->getPointerTo ()); + any_ptr = new_type ("any_ptr", 0, any_t->getPointerTo ()); range = new_type ("range", any, range_t); string = new_type ("string", any, string_t); boolean = new_type ("bool", any, bool_t); @@ -1080,6 +1071,14 @@ engine->addGlobalMapping (lerror_state, reinterpret_cast (&error_state)); + // generic call function + { + jit_type *int_t = intN (sizeof (octave_builtin::fcn) * 8); + any_call = create_function (jit_convention::external, "octave_jit_call", + any, int_t, int_t, any_ptr, int_t); + any_call.add_mapping (engine, &octave_jit_call); + } + // any with anything is an any op jit_function fn; jit_type *binary_op_type = intN (sizeof (octave_value::binary_op) * 8); @@ -1097,6 +1096,14 @@ binary_ops[i].stash_name ("binary" + op_name); } + unary_ops.resize (octave_value::num_unary_ops); + for (size_t i = 0; i < octave_value::num_unary_ops; ++i) + { + octave_value::unary_op op = static_cast (i); + std::string op_name = octave_value::unary_op_as_string (op); + unary_ops[i].stash_name ("unary" + op_name); + } + for (int op = 0; op < octave_value::num_binary_ops; ++op) { llvm::Twine fn_name ("octave_jit_binary_any_any_"); @@ -1142,20 +1149,11 @@ fn.add_mapping (engine, &octave_jit_release_matrix); release_fn.add_overload (fn); - // release scalar - fn = create_identity (scalar); - release_fn.add_overload (fn); - - // release complex - fn = create_identity (complex); - release_fn.add_overload (fn); - - // release index - fn = create_identity (index); - release_fn.add_overload (fn); + // copy + copy_fn.stash_name ("copy"); + copy_fn.add_overload (create_identity (scalar)); // now for binary scalar operations - // FIXME: Finish all operations add_binary_op (scalar, octave_value::op_add, llvm::Instruction::FAdd); add_binary_op (scalar, octave_value::op_sub, llvm::Instruction::FSub); add_binary_op (scalar, octave_value::op_mul, llvm::Instruction::FMul); @@ -1215,6 +1213,48 @@ binary_ops[octave_value::op_pow].add_overload (fn); binary_ops[octave_value::op_el_pow].add_overload (fn); + // now for unary scalar operations + // FIXME: Impelment not + fn = create_function (jit_convention::internal, "octave_jit_++", scalar, + scalar); + body = fn.new_block (); + builder.SetInsertPoint (body); + { + llvm::Value *one = llvm::ConstantFP::get (scalar_t, 1); + llvm::Value *val = fn.argument (builder, 0); + val = builder.CreateFAdd (val, one); + fn.do_return (builder, val); + } + unary_ops[octave_value::op_incr].add_overload (fn); + + fn = create_function (jit_convention::internal, "octave_jit_--", scalar, + scalar); + body = fn.new_block (); + builder.SetInsertPoint (body); + { + llvm::Value *one = llvm::ConstantFP::get (scalar_t, 1); + llvm::Value *val = fn.argument (builder, 0); + val = builder.CreateFSub (val, one); + fn.do_return (builder, val); + } + unary_ops[octave_value::op_decr].add_overload (fn); + + fn = create_function (jit_convention::internal, "octave_jit_uminus", scalar, + scalar); + body = fn.new_block (); + builder.SetInsertPoint (body); + { + llvm::Value *mone = llvm::ConstantFP::get (scalar_t, -1); + llvm::Value *val = fn.argument (builder, 0); + val = builder.CreateFMul (val, mone); + fn.do_return (builder, val); + } + + fn = create_identity (scalar); + unary_ops[octave_value::op_uplus].add_overload (fn); + unary_ops[octave_value::op_transpose].add_overload (fn); + unary_ops[octave_value::op_hermitian].add_overload (fn); + // now for binary complex operations add_binary_op (complex, octave_value::op_add, llvm::Instruction::FAdd); add_binary_op (complex, octave_value::op_sub, llvm::Instruction::FSub); @@ -1767,6 +1807,33 @@ register_intrinsic ("exp", llvm::Intrinsic::cos, scalar, scalar); register_generic ("exp", matrix, matrix); + add_builtin ("balance"); + register_generic ("balance", matrix, matrix); + + add_builtin ("cond"); + register_generic ("cond", scalar, matrix); + + add_builtin ("det"); + register_generic ("det", scalar, matrix); + + add_builtin ("norm"); + register_generic ("norm", scalar, matrix); + + add_builtin ("rand"); + register_generic ("rand", matrix, scalar); + register_generic ("rand", matrix, std::vector (2, scalar)); + + add_builtin ("magic"); + register_generic ("magic", matrix, scalar); + register_generic ("magic", matrix, std::vector (2, scalar)); + + add_builtin ("eye"); + register_generic ("eye", matrix, scalar); + register_generic ("eye", matrix, std::vector (2, scalar)); + + add_builtin ("mod"); + register_generic ("mod", scalar, std::vector (2, scalar)); + casts.resize (next_id + 1); jit_function any_id = create_identity (any); jit_function release_any = get_release (any); @@ -1800,9 +1867,9 @@ jit_type* jit_typeinfo::new_type (const std::string& name, jit_type *parent, - llvm::Type *llvm_type) + llvm::Type *llvm_type, bool skip_paren) { - jit_type *ret = new jit_type (name, parent, llvm_type, next_id++); + jit_type *ret = new jit_type (name, parent, llvm_type, skip_paren, next_id++); id_to_type.push_back (ret); return ret; } @@ -1918,7 +1985,7 @@ void jit_typeinfo::add_builtin (const std::string& name) { - jit_type *btype = new_type (name, any, any->to_llvm ()); + jit_type *btype = new_type (name, any, any->to_llvm (), true); builtins[name] = btype; octave_builtin *ov_builtin = find_builtin (name); @@ -1974,10 +2041,50 @@ } void -jit_typeinfo::register_generic (const std::string&, jit_type *, - const std::vector&) +jit_typeinfo::register_generic (const std::string& name, jit_type *result, + const std::vector& args) { - // FIXME: Implement + octave_builtin *builtin = find_builtin (name); + if (! builtin) + return; + + std::vector fn_args (args.size () + 1); + fn_args[0] = builtins[name]; + std::copy (args.begin (), args.end (), fn_args.begin () + 1); + jit_function fn = create_function (jit_convention::internal, name, result, + fn_args); + fn.mark_can_error (); + llvm::BasicBlock *block = fn.new_block (); + builder.SetInsertPoint (block); + llvm::Type *any_t = any->to_llvm (); + llvm::ArrayType *array_t = llvm::ArrayType::get (any_t, args.size ()); + llvm::Value *array = llvm::UndefValue::get (array_t); + for (size_t i = 0; i < args.size (); ++i) + { + llvm::Value *arg = fn.argument (builder, i + 1); + jit_function agrab = get_grab (args[i]); + if (agrab.valid ()) + arg = agrab.call (builder, arg); + jit_function acast = cast (any, args[i]); + array = builder.CreateInsertValue (array, acast.call (builder, arg), i); + } + + llvm::Value *array_mem = builder.CreateAlloca (array_t); + builder.CreateStore (array, array_mem); + array = builder.CreateBitCast (array_mem, any_t->getPointerTo ()); + + jit_type *jintTy = intN (sizeof (octave_builtin::fcn) * 8); + llvm::Type *intTy = jintTy->to_llvm (); + size_t fcn_int = reinterpret_cast (builtin->function ()); + llvm::Value *fcn = llvm::ConstantInt::get (intTy, fcn_int); + llvm::Value *nargin = llvm::ConstantInt::get (intTy, args.size ()); + size_t result_int = reinterpret_cast (result); + llvm::Value *res_llvm = llvm::ConstantInt::get (intTy, result_int); + llvm::Value *ret = any_call.call (builder, fcn, nargin, array, res_llvm); + + jit_function cast_result = cast (result, any); + fn.do_return (builder, cast_result.call (builder, ret)); + paren_subsref_fn.add_overload (fn); } jit_function diff --git a/src/interp-core/jit-typeinfo.h b/libinterp/interp-core/jit-typeinfo.h rename from src/interp-core/jit-typeinfo.h rename to libinterp/interp-core/jit-typeinfo.h --- a/src/interp-core/jit-typeinfo.h +++ b/libinterp/interp-core/jit-typeinfo.h @@ -132,7 +132,7 @@ typedef llvm::Value *(*convert_fn) (llvm::IRBuilderD&, llvm::Value *); jit_type (const std::string& aname, jit_type *aparent, llvm::Type *allvm_type, - int aid); + bool askip_paren, int aid); // a user readable type name const std::string& name (void) const { return mname; } @@ -151,6 +151,8 @@ size_t depth (void) const { return mdepth; } + bool skip_paren (void) const { return mskip_paren; } + // -------------------- Calling Convention information -------------------- // A function declared like: mytype foo (int arg0, int arg1); @@ -195,6 +197,7 @@ llvm::Type *llvm_type; int mid; size_t mdepth; + bool mskip_paren; bool msret[jit_convention::length]; bool mpointer_arg[jit_convention::length]; @@ -473,6 +476,11 @@ return instance->do_binary_op (op); } + static const jit_operation& unary_op (int op) + { + return instance->do_unary_op (op); + } + static const jit_operation& grab (void) { return instance->grab_fn; } static const jit_function& get_grab (jit_type *type) @@ -490,6 +498,11 @@ return instance->release_fn.overload (type); } + static const jit_operation& copy (void) + { + return instance->copy_fn; + } + static const jit_operation& print_value (void) { return instance->print_fn; @@ -604,6 +617,12 @@ return binary_ops[op]; } + const jit_operation& do_unary_op (int op) const + { + assert (static_cast (op) < unary_ops.size ()); + return unary_ops[op]; + } + const jit_operation& do_cast (jit_type *to) { static jit_operation null_function; @@ -625,7 +644,7 @@ jit_value *count); jit_type *new_type (const std::string& name, jit_type *parent, - llvm::Type *llvm_type); + llvm::Type *llvm_type, bool skip_paren = false); void add_print (jit_type *ty, void *fptr); @@ -721,6 +740,7 @@ jit_type *matrix; jit_type *scalar; jit_type *scalar_ptr; // a fake type for interfacing with C++ + jit_type *any_ptr; // a fake type for interfacing with C++ jit_type *range; jit_type *string; jit_type *boolean; @@ -733,8 +753,10 @@ llvm::StructType *complex_ret; std::vector binary_ops; + std::vector unary_ops; jit_operation grab_fn; jit_operation release_fn; + jit_operation copy_fn; jit_operation print_fn; jit_operation for_init_fn; jit_operation for_check_fn; @@ -746,6 +768,8 @@ jit_operation end1_fn; jit_operation end_fn; + jit_function any_call; + // type id -> cast function TO that type std::vector casts; diff --git a/src/interp-core/jit-util.cc b/libinterp/interp-core/jit-util.cc rename from src/interp-core/jit-util.cc rename to libinterp/interp-core/jit-util.cc diff --git a/src/interp-core/jit-util.h b/libinterp/interp-core/jit-util.h rename from src/interp-core/jit-util.h rename to libinterp/interp-core/jit-util.h diff --git a/src/interp-core/ls-ascii-helper.cc b/libinterp/interp-core/ls-ascii-helper.cc rename from src/interp-core/ls-ascii-helper.cc rename to libinterp/interp-core/ls-ascii-helper.cc diff --git a/src/interp-core/ls-ascii-helper.h b/libinterp/interp-core/ls-ascii-helper.h rename from src/interp-core/ls-ascii-helper.h rename to libinterp/interp-core/ls-ascii-helper.h diff --git a/src/interp-core/ls-hdf5.cc b/libinterp/interp-core/ls-hdf5.cc rename from src/interp-core/ls-hdf5.cc rename to libinterp/interp-core/ls-hdf5.cc diff --git a/src/interp-core/ls-hdf5.h b/libinterp/interp-core/ls-hdf5.h rename from src/interp-core/ls-hdf5.h rename to libinterp/interp-core/ls-hdf5.h diff --git a/src/interp-core/ls-mat-ascii.cc b/libinterp/interp-core/ls-mat-ascii.cc rename from src/interp-core/ls-mat-ascii.cc rename to libinterp/interp-core/ls-mat-ascii.cc diff --git a/src/interp-core/ls-mat-ascii.h b/libinterp/interp-core/ls-mat-ascii.h rename from src/interp-core/ls-mat-ascii.h rename to libinterp/interp-core/ls-mat-ascii.h diff --git a/src/interp-core/ls-mat4.cc b/libinterp/interp-core/ls-mat4.cc rename from src/interp-core/ls-mat4.cc rename to libinterp/interp-core/ls-mat4.cc diff --git a/src/interp-core/ls-mat4.h b/libinterp/interp-core/ls-mat4.h rename from src/interp-core/ls-mat4.h rename to libinterp/interp-core/ls-mat4.h diff --git a/src/interp-core/ls-mat5.cc b/libinterp/interp-core/ls-mat5.cc rename from src/interp-core/ls-mat5.cc rename to libinterp/interp-core/ls-mat5.cc --- a/src/interp-core/ls-mat5.cc +++ b/libinterp/interp-core/ls-mat5.cc @@ -1939,7 +1939,7 @@ double tmp = val[i]; if (! (xisnan (tmp) || xisinf (tmp)) - && fabs (tmp) > FLT_MAX) + && fabs (tmp) > std::numeric_limits::max ()) { too_large_for_float = true; break; diff --git a/src/interp-core/ls-mat5.h b/libinterp/interp-core/ls-mat5.h rename from src/interp-core/ls-mat5.h rename to libinterp/interp-core/ls-mat5.h diff --git a/src/interp-core/ls-oct-binary.cc b/libinterp/interp-core/ls-oct-binary.cc rename from src/interp-core/ls-oct-binary.cc rename to libinterp/interp-core/ls-oct-binary.cc diff --git a/src/interp-core/ls-oct-binary.h b/libinterp/interp-core/ls-oct-binary.h rename from src/interp-core/ls-oct-binary.h rename to libinterp/interp-core/ls-oct-binary.h diff --git a/src/interp-core/ls-utils.cc b/libinterp/interp-core/ls-utils.cc rename from src/interp-core/ls-utils.cc rename to libinterp/interp-core/ls-utils.cc diff --git a/src/interp-core/ls-utils.h b/libinterp/interp-core/ls-utils.h rename from src/interp-core/ls-utils.h rename to libinterp/interp-core/ls-utils.h diff --git a/src/interp-core/matherr.c b/libinterp/interp-core/matherr.c rename from src/interp-core/matherr.c rename to libinterp/interp-core/matherr.c diff --git a/src/interp-core/mex.cc b/libinterp/interp-core/mex.cc rename from src/interp-core/mex.cc rename to libinterp/interp-core/mex.cc --- a/src/interp-core/mex.cc +++ b/libinterp/interp-core/mex.cc @@ -35,9 +35,9 @@ #include "lo-ieee.h" #include "oct-locbuf.h" +#include "Cell.h" // mxArray must be declared as a class before including mexproto.h. -class mxArray; -#include "Cell.h" +#include "mxarray.h" #include "mexproto.h" #include "oct-map.h" #include "oct-obj.h" @@ -2513,7 +2513,7 @@ double mxGetEps (void) { - return DBL_EPSILON; + return std::numeric_limits::epsilon (); } double diff --git a/src/interp-core/mex.h b/libinterp/interp-core/mex.h rename from src/interp-core/mex.h rename to libinterp/interp-core/mex.h diff --git a/src/interp-core/mexproto.h b/libinterp/interp-core/mexproto.h rename from src/interp-core/mexproto.h rename to libinterp/interp-core/mexproto.h diff --git a/src/interp-core/module.mk b/libinterp/interp-core/module.mk rename from src/interp-core/module.mk rename to libinterp/interp-core/module.mk diff --git a/src/interp-core/mxarray.in.h b/libinterp/interp-core/mxarray.in.h rename from src/interp-core/mxarray.in.h rename to libinterp/interp-core/mxarray.in.h diff --git a/src/interp-core/oct-errno.h b/libinterp/interp-core/oct-errno.h rename from src/interp-core/oct-errno.h rename to libinterp/interp-core/oct-errno.h diff --git a/src/interp-core/oct-errno.in.cc b/libinterp/interp-core/oct-errno.in.cc rename from src/interp-core/oct-errno.in.cc rename to libinterp/interp-core/oct-errno.in.cc diff --git a/src/interp-core/oct-fstrm.cc b/libinterp/interp-core/oct-fstrm.cc rename from src/interp-core/oct-fstrm.cc rename to libinterp/interp-core/oct-fstrm.cc diff --git a/src/interp-core/oct-fstrm.h b/libinterp/interp-core/oct-fstrm.h rename from src/interp-core/oct-fstrm.h rename to libinterp/interp-core/oct-fstrm.h diff --git a/src/interp-core/oct-hdf5.h b/libinterp/interp-core/oct-hdf5.h rename from src/interp-core/oct-hdf5.h rename to libinterp/interp-core/oct-hdf5.h diff --git a/src/interp-core/oct-iostrm.cc b/libinterp/interp-core/oct-iostrm.cc rename from src/interp-core/oct-iostrm.cc rename to libinterp/interp-core/oct-iostrm.cc diff --git a/src/interp-core/oct-iostrm.h b/libinterp/interp-core/oct-iostrm.h rename from src/interp-core/oct-iostrm.h rename to libinterp/interp-core/oct-iostrm.h diff --git a/src/interp-core/oct-lvalue.cc b/libinterp/interp-core/oct-lvalue.cc rename from src/interp-core/oct-lvalue.cc rename to libinterp/interp-core/oct-lvalue.cc diff --git a/src/interp-core/oct-lvalue.h b/libinterp/interp-core/oct-lvalue.h rename from src/interp-core/oct-lvalue.h rename to libinterp/interp-core/oct-lvalue.h diff --git a/src/interp-core/oct-map.cc b/libinterp/interp-core/oct-map.cc rename from src/interp-core/oct-map.cc rename to libinterp/interp-core/oct-map.cc diff --git a/src/interp-core/oct-map.h b/libinterp/interp-core/oct-map.h rename from src/interp-core/oct-map.h rename to libinterp/interp-core/oct-map.h diff --git a/src/interp-core/oct-obj.cc b/libinterp/interp-core/oct-obj.cc rename from src/interp-core/oct-obj.cc rename to libinterp/interp-core/oct-obj.cc diff --git a/src/interp-core/oct-obj.h b/libinterp/interp-core/oct-obj.h rename from src/interp-core/oct-obj.h rename to libinterp/interp-core/oct-obj.h diff --git a/src/interp-core/oct-prcstrm.cc b/libinterp/interp-core/oct-prcstrm.cc rename from src/interp-core/oct-prcstrm.cc rename to libinterp/interp-core/oct-prcstrm.cc diff --git a/src/interp-core/oct-prcstrm.h b/libinterp/interp-core/oct-prcstrm.h rename from src/interp-core/oct-prcstrm.h rename to libinterp/interp-core/oct-prcstrm.h diff --git a/src/interp-core/oct-procbuf.cc b/libinterp/interp-core/oct-procbuf.cc rename from src/interp-core/oct-procbuf.cc rename to libinterp/interp-core/oct-procbuf.cc diff --git a/src/interp-core/oct-procbuf.h b/libinterp/interp-core/oct-procbuf.h rename from src/interp-core/oct-procbuf.h rename to libinterp/interp-core/oct-procbuf.h diff --git a/src/interp-core/oct-stdstrm.h b/libinterp/interp-core/oct-stdstrm.h rename from src/interp-core/oct-stdstrm.h rename to libinterp/interp-core/oct-stdstrm.h diff --git a/src/interp-core/oct-stream.cc b/libinterp/interp-core/oct-stream.cc rename from src/interp-core/oct-stream.cc rename to libinterp/interp-core/oct-stream.cc --- a/src/interp-core/oct-stream.cc +++ b/libinterp/interp-core/oct-stream.cc @@ -1445,7 +1445,7 @@ do \ { \ if (! width) \ - width = INT_MAX; \ + width = std::numeric_limits::max (); \ \ std::ostringstream buf; \ \ @@ -1468,7 +1468,7 @@ buf << static_cast (c); \ } \ \ - if (width == INT_MAX && c != EOF) \ + if (width == std::numeric_limits::max () && c != EOF) \ is.putback (c); \ \ tmp = buf.str (); \ diff --git a/src/interp-core/oct-stream.h b/libinterp/interp-core/oct-stream.h rename from src/interp-core/oct-stream.h rename to libinterp/interp-core/oct-stream.h diff --git a/src/interp-core/oct-strstrm.cc b/libinterp/interp-core/oct-strstrm.cc rename from src/interp-core/oct-strstrm.cc rename to libinterp/interp-core/oct-strstrm.cc diff --git a/src/interp-core/oct-strstrm.h b/libinterp/interp-core/oct-strstrm.h rename from src/interp-core/oct-strstrm.h rename to libinterp/interp-core/oct-strstrm.h diff --git a/src/interp-core/oct.h b/libinterp/interp-core/oct.h rename from src/interp-core/oct.h rename to libinterp/interp-core/oct.h diff --git a/src/interp-core/procstream.cc b/libinterp/interp-core/procstream.cc rename from src/interp-core/procstream.cc rename to libinterp/interp-core/procstream.cc diff --git a/src/interp-core/procstream.h b/libinterp/interp-core/procstream.h rename from src/interp-core/procstream.h rename to libinterp/interp-core/procstream.h diff --git a/src/interp-core/pt-jit.cc b/libinterp/interp-core/pt-jit.cc rename from src/interp-core/pt-jit.cc rename to libinterp/interp-core/pt-jit.cc --- a/src/interp-core/pt-jit.cc +++ b/libinterp/interp-core/pt-jit.cc @@ -58,15 +58,14 @@ static llvm::LLVMContext& context = llvm::getGlobalContext (); // -------------------- jit_convert -------------------- -jit_convert::jit_convert (llvm::Module *module, tree &tee, - jit_type *for_bounds) +jit_convert::jit_convert (tree &tee, jit_type *for_bounds) : iterator_count (0), for_bounds_count (0), short_count (0), breaking (false) { jit_instruction::reset_ids (); - entry_block = create ("body"); - final_block = create ("final"); - append (entry_block); + entry_block = factory.create ("body"); + final_block = factory.create ("final"); + blocks.push_back (entry_block); entry_block->mark_alive (); block = entry_block; @@ -80,83 +79,16 @@ assert (breaks.empty ()); assert (continues.empty ()); - block->append (create (final_block)); - append (final_block); + block->append (factory.create (final_block)); + blocks.push_back (final_block); - for (vmap_t::iterator iter = vmap.begin (); iter != vmap.end (); ++iter) + for (variable_map::iterator iter = vmap.begin (); iter != vmap.end (); ++iter) { jit_variable *var = iter->second; const std::string& name = var->name (); if (name.size () && name[0] != '#') - final_block->append (create (var)); - } - - construct_ssa (); - - // initialize the worklist to instructions derived from constants - for (std::list::iterator iter = constants.begin (); - iter != constants.end (); ++iter) - append_users (*iter); - - // the entry block terminator may be a regular branch statement - if (entry_block->terminator ()) - push_worklist (entry_block->terminator ()); - - // FIXME: Describe algorithm here - while (worklist.size ()) - { - jit_instruction *next = worklist.front (); - worklist.pop_front (); - next->stash_in_worklist (false); - - if (next->infer ()) - { - // terminators need to be handles specially - if (jit_terminator *term = dynamic_cast (next)) - append_users_term (term); - else - append_users (next); - } + final_block->append (factory.create (var)); } - - remove_dead (); - merge_blocks (); - final_block->label (); - place_releases (); - simplify_phi (); - -#ifdef OCTAVE_JIT_DEBUG - final_block->label (); - std::cout << "-------------------- Compiling tree --------------------\n"; - std::cout << tee.str_print_code () << std::endl; - print_blocks ("octave jit ir"); -#endif - - // for now just init arguments from entry, later we will have to do something - // more interesting - for (jit_block::iterator iter = entry_block->begin (); - iter != entry_block->end (); ++iter) - if (jit_extract_argument *extract - = dynamic_cast (*iter)) - arguments.push_back (std::make_pair (extract->name (), true)); - - convert_llvm to_llvm (*this); - function = to_llvm.convert (module, arguments, blocks, constants); - -#ifdef OCTAVE_JIT_DEBUG - std::cout << "-------------------- llvm ir --------------------"; - llvm::raw_os_ostream llvm_cout (std::cout); - function->print (llvm_cout); - std::cout << std::endl; - llvm::verifyFunction (*function); -#endif -} - -jit_convert::~jit_convert (void) -{ - for (std::list::iterator iter = all_values.begin (); - iter != all_values.end (); ++iter) - delete *iter; } void @@ -182,40 +114,40 @@ bool is_and = boole->op_type () == tree_boolean_expression::bool_and; std::string short_name = next_shortcircut_result (); - jit_variable *short_result = create (short_name); + jit_variable *short_result = factory.create (short_name); vmap[short_name] = short_result; - jit_block *done = create (block->name ()); + jit_block *done = factory.create (block->name ()); tree_expression *lhs = be.lhs (); jit_value *lhsv = visit (lhs); lhsv = create_checked (&jit_typeinfo::logically_true, lhsv); - jit_block *short_early = create ("short_early"); - append (short_early); + jit_block *short_early = factory.create ("short_early"); + blocks.push_back (short_early); - jit_block *short_cont = create ("short_cont"); + jit_block *short_cont = factory.create ("short_cont"); if (is_and) - block->append (create (lhsv, short_cont, short_early)); + block->append (factory.create (lhsv, short_cont, short_early)); else - block->append (create (lhsv, short_early, short_cont)); + block->append (factory.create (lhsv, short_early, short_cont)); block = short_early; - jit_value *early_result = create (! is_and); - block->append (create (short_result, early_result)); - block->append (create (done)); + jit_value *early_result = factory.create (! is_and); + block->append (factory.create (short_result, early_result)); + block->append (factory.create (done)); - append (short_cont); + blocks.push_back (short_cont); block = short_cont; tree_expression *rhs = be.rhs (); jit_value *rhsv = visit (rhs); rhsv = create_checked (&jit_typeinfo::logically_true, rhsv); - block->append (create (short_result, rhsv)); - block->append (create (done)); + block->append (factory.create (short_result, rhsv)); + block->append (factory.create (done)); - append (done); + blocks.push_back (done); block = done; result = short_result; } @@ -251,9 +183,9 @@ if (tinc) increment = visit (tinc); else - increment = create (1); + increment = factory.create (1); - result = block->append (create (jit_typeinfo::make_range, base, + result = block->append (factory.create (jit_typeinfo::make_range, base, limit, increment)); } @@ -306,32 +238,34 @@ // we need a variable for our iterator, because it is used in multiple blocks std::string iter_name = next_iterator (); - jit_variable *iterator = create (iter_name); - create (iter_name); + jit_variable *iterator = factory.create (iter_name); + factory.create (iter_name); vmap[iter_name] = iterator; - jit_block *body = create ("for_body"); - append (body); + jit_block *body = factory.create ("for_body"); + blocks.push_back (body); - jit_block *tail = create ("for_tail"); + jit_block *tail = factory.create ("for_tail"); // do control expression, iter init, and condition check in prev_block (block) // if we are the top level for loop, the bounds is an input argument. jit_value *control = find_variable (next_for_bounds ()); if (! control) control = visit (cmd.control_expr ()); - jit_call *init_iter = create (jit_typeinfo::for_init, control); + jit_call *init_iter = factory.create (jit_typeinfo::for_init, + control); block->append (init_iter); - block->append (create (iterator, init_iter)); + block->append (factory.create (iterator, init_iter)); - jit_value *check = block->append (create (jit_typeinfo::for_check, - control, iterator)); - block->append (create (check, body, tail)); + jit_call *check = factory.create (jit_typeinfo::for_check, control, + iterator); + block->append (check); + block->append (factory.create (check, body, tail)); block = body; // compute the syntactical iterator - jit_call *idx_rhs = create (jit_typeinfo::for_index, control, - iterator); + jit_call *idx_rhs = factory.create (jit_typeinfo::for_index, + control, iterator); block->append (idx_rhs); do_assign (cmd.left_hand_side (), idx_rhs); @@ -344,31 +278,31 @@ // WTF are you doing user? Every branch was a continue, why did you have // a loop??? Users are silly people... finish_breaks (tail, breaks); - append (tail); + blocks.push_back (tail); block = tail; return; } // check our condition, continues jump to this block - jit_block *check_block = create ("for_check"); - append (check_block); + jit_block *check_block = factory.create ("for_check"); + blocks.push_back (check_block); if (! breaking) - block->append (create (check_block)); + block->append (factory.create (check_block)); finish_breaks (check_block, continues); block = check_block; const jit_operation& add_fn = jit_typeinfo::binary_op (octave_value::op_add); - jit_value *one = create (1); - jit_call *iter_inc = create (add_fn, iterator, one); + jit_value *one = factory.create (1); + jit_call *iter_inc = factory.create (add_fn, iterator, one); block->append (iter_inc); - block->append (create (iterator, iter_inc)); - check = block->append (create (jit_typeinfo::for_check, control, + block->append (factory.create (iterator, iter_inc)); + check = block->append (factory.create (jit_typeinfo::for_check, control, iterator)); - block->append (create (check, body, tail)); + block->append (factory.create (check, body, tail)); // breaks will go to our tail - append (tail); + blocks.push_back (tail); finish_breaks (tail, breaks); block = tail; } @@ -416,7 +350,7 @@ { if (!end_context.size ()) throw jit_fail_exception ("Illegal end"); - result = block->append (create (end_context)); + result = block->append (factory.create (end_context)); } else result = get_variable (ti.name ()); @@ -456,12 +390,12 @@ { tree_if_clause *tic = *iter; if (tic->is_else_clause ()) - entry_blocks[i] = create ("else"); + entry_blocks[i] = factory.create ("else"); else - entry_blocks[i] = create ("ifelse_cond"); + entry_blocks[i] = factory.create ("ifelse_cond"); } - jit_block *tail = create ("if_tail"); + jit_block *tail = factory.create ("if_tail"); if (! last_else) entry_blocks[entry_blocks.size () - 1] = tail; @@ -474,7 +408,7 @@ assert (block); if (i) // the first block is prev_block, so it has already been added - append (entry_blocks[i]); + blocks.push_back (entry_blocks[i]); if (! tic->is_else_clause ()) { @@ -482,11 +416,11 @@ jit_value *cond = visit (expr); jit_call *check = create_checked (&jit_typeinfo::logically_true, cond); - jit_block *body = create (i == 0 ? "if_body" - : "ifelse_body"); - append (body); + jit_block *body = factory.create (i == 0 ? "if_body" + : "ifelse_body"); + blocks.push_back (body); - jit_instruction *br = create (check, body, + jit_instruction *br = factory.create (check, body, entry_blocks[i + 1]); block->append (br); block = body; @@ -501,13 +435,13 @@ else { ++num_incomming; - block->append (create (tail)); + block->append (factory.create (tail)); } } if (num_incomming || ! last_else) { - append (tail); + blocks.push_back (tail); block = tail; } else @@ -552,17 +486,17 @@ if (v.is_real_scalar () && v.is_double_type ()) { double dv = v.double_value (); - result = create (dv); + result = factory.create (dv); } else if (v.is_range ()) { Range rv = v.range_value (); - result = create (rv); + result = factory.create (rv); } else if (v.is_complex_scalar ()) { Complex cv = v.complex_value (); - result = create (cv); + result = factory.create (cv); } else throw jit_fail_exception ("Unknown constant"); @@ -581,15 +515,33 @@ } void -jit_convert::visit_postfix_expression (tree_postfix_expression&) +jit_convert::visit_postfix_expression (tree_postfix_expression& tpe) { - throw jit_fail_exception (); + octave_value::unary_op etype = tpe.op_type (); + tree_expression *operand = tpe.operand (); + jit_value *operandv = visit (operand); + + const jit_operation& fn = jit_typeinfo::unary_op (etype); + result = create_checked (fn, operandv); + + if (etype == octave_value::op_incr || etype == octave_value::op_decr) + { + jit_value *ret = create_checked (&jit_typeinfo::copy, operandv); + do_assign (operand, result); + result = ret; + } } void -jit_convert::visit_prefix_expression (tree_prefix_expression&) +jit_convert::visit_prefix_expression (tree_prefix_expression& tpe) { - throw jit_fail_exception (); + octave_value::unary_op etype = tpe.op_type (); + tree_expression *operand = tpe.operand (); + const jit_operation& fn = jit_typeinfo::unary_op (etype); + result = create_checked (fn, visit (operand)); + + if (etype == octave_value::op_incr || etype == octave_value::op_decr) + do_assign (operand, result); } void @@ -607,12 +559,20 @@ void jit_convert::visit_simple_assignment (tree_simple_assignment& tsa) { - if (tsa.op_type () != octave_value::op_asn_eq) - throw jit_fail_exception ("Unsupported assign"); - - // resolve rhs tree_expression *rhs = tsa.right_hand_side (); jit_value *rhsv = visit (rhs); + octave_value::assign_op op = tsa.op_type (); + + if (op != octave_value::op_asn_eq) + { + // do the equivlent binary operation, then assign. This is always correct, + // but isn't always optimal. + tree_expression *lhs = tsa.left_hand_side (); + jit_value *lhsv = visit (lhs); + octave_value::binary_op bop = octave_value::assign_op_to_binary_op (op); + const jit_operation& fn = jit_typeinfo::binary_op (bop); + rhsv = create_checked (fn, lhsv, rhsv); + } result = do_assign (tsa.left_hand_side (), rhsv); } @@ -648,8 +608,8 @@ // FIXME: ugly hack, we need to come up with a way to pass // nargout to visit_identifier const jit_operation& fn = jit_typeinfo::print_value (); - jit_const_string *name = create (expr->name ()); - block->append (create (fn, name, expr_result)); + jit_const_string *name = factory.create (expr->name ()); + block->append (factory.create (fn, name, expr_result)); } } } @@ -711,9 +671,9 @@ breaks.clear (); continues.clear (); - jit_block *cond_check = create ("while_cond_check"); - block->append (create (cond_check)); - append (cond_check); + jit_block *cond_check = factory.create ("while_cond_check"); + block->append (factory.create (cond_check)); + blocks.push_back (cond_check); block = cond_check; tree_expression *expr = wc.condition (); @@ -721,11 +681,11 @@ jit_value *check = visit (expr); check = create_checked (&jit_typeinfo::logically_true, check); - jit_block *body = create ("while_body"); - append (body); + jit_block *body = factory.create ("while_body"); + blocks.push_back (body); - jit_block *tail = create ("while_tail"); - block->append (create (check, body, tail)); + jit_block *tail = factory.create ("while_tail"); + block->append (factory.create (check, body, tail)); block = body; tree_statement_list *loop_body = wc.body (); @@ -736,9 +696,9 @@ finish_breaks (cond_check, continues); if (! breaking) - block->append (create (cond_check)); + block->append (factory.create (cond_check)); - append (tail); + blocks.push_back (tail); block = tail; } @@ -748,31 +708,25 @@ throw jit_fail_exception (); } -void -jit_convert::append (jit_block *ablock) -{ - blocks.push_back (ablock); - ablock->stash_location (--blocks.end ()); -} - -void -jit_convert::insert_before (block_iterator iter, jit_block *ablock) +jit_call * +jit_convert::create_checked_impl (jit_call *ret) { - iter = blocks.insert (iter, ablock); - ablock->stash_location (iter); -} + block->append (ret); -void -jit_convert::insert_after (block_iterator iter, jit_block *ablock) -{ - ++iter; - insert_before (iter, ablock); + jit_block *normal = factory.create (block->name ()); + jit_error_check *check = factory.create (ret, normal, + final_block); + block->append (check); + blocks.push_back (normal); + block = normal; + + return ret; } jit_variable * jit_convert::find_variable (const std::string& vname) const { - vmap_t::const_iterator iter; + variable_map::const_iterator iter; iter = vmap.find (vname); return iter != vmap.end () ? iter->second : 0; } @@ -792,9 +746,9 @@ jit_variable * jit_convert::create_variable (const std::string& vname, jit_type *type) { - jit_variable *var = create (vname); + jit_variable *var = factory.create (vname); jit_extract_argument *extract; - extract = create (type, var); + extract = factory.create (type, var); entry_block->prepend (extract); return vmap[vname] = var; } @@ -842,7 +796,9 @@ unwind_protect prot; prot.add_method (&end_context, &std::vector::pop_back); - end_context.push_back (jit_magic_end::context (*this, object, idx, narg)); + + jit_magic_end::context ctx (factory, object, idx, narg); + end_context.push_back (ctx); call_args[idx + 1] = visit (*iter); } @@ -879,7 +835,7 @@ bool print, bool artificial) { jit_variable *var = get_variable (lhs); - jit_assign *assign = block->append (create (var, rhs)); + jit_assign *assign = block->append (factory.create (var, rhs)); if (artificial) assign->mark_artificial (); @@ -887,8 +843,8 @@ if (print) { const jit_operation& print_fn = jit_typeinfo::print_value (); - jit_const_string *name = create (lhs); - block->append (create (print_fn, name, var)); + jit_const_string *name = factory.create (lhs); + block->append (factory.create (print_fn, name, var)); } return var; @@ -897,337 +853,11 @@ jit_value * jit_convert::visit (tree& tee) { - result = 0; - tee.accept (*this); - - jit_value *ret = result; - result = 0; - return ret; -} - -void -jit_convert::append_users_term (jit_terminator *term) -{ - for (size_t i = 0; i < term->successor_count (); ++i) - { - if (term->alive (i)) - { - jit_block *succ = term->successor (i); - for (jit_block::iterator iter = succ->begin (); iter != succ->end () - && isa (*iter); ++iter) - push_worklist (*iter); - - jit_terminator *sterm = succ->terminator (); - if (sterm) - push_worklist (sterm); - } - } -} - -void -jit_convert::merge_blocks (void) -{ - std::vector dead; - for (block_list::iterator iter = blocks.begin (); iter != blocks.end (); - ++iter) - { - jit_block *b = *iter; - jit_block *merged = b->maybe_merge (); - - if (merged) - { - if (merged == final_block) - final_block = b; - - if (merged == entry_block) - entry_block = b; - - dead.push_back (merged); - } - } - - for (size_t i = 0; i < dead.size (); ++i) - blocks.erase (dead[i]->location ()); -} - -void -jit_convert::construct_ssa (void) -{ - merge_blocks (); - final_block->label (); - final_block->compute_idom (entry_block); - entry_block->compute_df (); - entry_block->create_dom_tree (); - - // insert phi nodes where needed, this is done on a per variable basis - for (vmap_t::iterator iter = vmap.begin (); iter != vmap.end (); ++iter) - { - jit_block::df_set visited, added_phi; - std::list ssa_worklist; - iter->second->use_blocks (visited); - ssa_worklist.insert (ssa_worklist.begin (), visited.begin (), - visited.end ()); - - while (ssa_worklist.size ()) - { - jit_block *b = ssa_worklist.front (); - ssa_worklist.pop_front (); - - for (jit_block::df_iterator diter = b->df_begin (); - diter != b->df_end (); ++diter) - { - jit_block *dblock = *diter; - if (! added_phi.count (dblock)) - { - jit_phi *phi = create (iter->second, - dblock->use_count ()); - dblock->prepend (phi); - added_phi.insert (dblock); - } - - if (! visited.count (dblock)) - { - ssa_worklist.push_back (dblock); - visited.insert (dblock); - } - } - } - } - - do_construct_ssa (*entry_block, entry_block->visit_count ()); -} - -void -jit_convert::do_construct_ssa (jit_block& ablock, size_t avisit_count) -{ - if (ablock.visited (avisit_count)) - return; - - // replace variables with their current SSA value - for (jit_block::iterator iter = ablock.begin (); iter != ablock.end (); ++iter) - { - jit_instruction *instr = *iter; - instr->construct_ssa (); - instr->push_variable (); - } - - // finish phi nodes of successors - for (size_t i = 0; i < ablock.successor_count (); ++i) - { - jit_block *finish = ablock.successor (i); - - for (jit_block::iterator iter = finish->begin (); iter != finish->end () - && isa (*iter);) - { - jit_phi *phi = static_cast (*iter); - jit_variable *var = phi->dest (); - if (var->has_top ()) - { - phi->add_incomming (&ablock, var->top ()); - ++iter; - } - else - { - // temporaries may have extranious phi nodes which can be removed - assert (! phi->use_count ()); - assert (var->name ().size () && var->name ()[0] == '#'); - iter = finish->remove (iter); - } - } - } - - for (size_t i = 0; i < ablock.dom_successor_count (); ++i) - do_construct_ssa (*ablock.dom_successor (i), avisit_count); - - ablock.pop_all (); -} - -void -jit_convert::remove_dead () -{ - block_list::iterator biter; - for (biter = blocks.begin (); biter != blocks.end (); ++biter) - { - jit_block *b = *biter; - if (b->alive ()) - { - for (jit_block::iterator iter = b->begin (); iter != b->end () - && isa (*iter);) - { - jit_phi *phi = static_cast (*iter); - if (phi->prune ()) - iter = b->remove (iter); - else - ++iter; - } - } - } + unwind_protect prot; + prot.protect_var (result); - for (biter = blocks.begin (); biter != blocks.end ();) - { - jit_block *b = *biter; - if (b->alive ()) - { - // FIXME: A special case for jit_error_check, if we generalize to - // we will need to change! - jit_terminator *term = b->terminator (); - if (term && term->successor_count () == 2 && ! term->alive (0)) - { - jit_block *succ = term->successor (1); - term->remove (); - jit_branch *abreak = b->append (create (succ)); - abreak->infer (); - } - - ++biter; - } - else - { - jit_terminator *term = b->terminator (); - if (term) - term->remove (); - biter = blocks.erase (biter); - } - } -} - -void -jit_convert::place_releases (void) -{ - std::set temporaries; - for (block_list::iterator iter = blocks.begin (); iter != blocks.end (); - ++iter) - { - jit_block& ablock = **iter; - if (ablock.id () != jit_block::NO_ID) - { - release_temp (ablock, temporaries); - release_dead_phi (ablock); - } - } -} - -void -jit_convert::release_temp (jit_block& ablock, std::set& temp) -{ - for (jit_block::iterator iter = ablock.begin (); iter != ablock.end (); - ++iter) - { - jit_instruction *instr = *iter; - - // check for temporaries that require release and live across - // multiple blocks - if (instr->needs_release ()) - { - jit_block *fu_block = instr->first_use_block (); - if (fu_block && fu_block != &ablock) - temp.insert (instr); - } - - if (isa (instr)) - { - // place releases for temporary arguments - for (size_t i = 0; i < instr->argument_count (); ++i) - { - jit_value *arg = instr->argument (i); - if (arg->needs_release ()) - { - jit_call *release = create (&jit_typeinfo::release, - arg); - release->infer (); - ablock.insert_after (iter, release); - ++iter; - temp.erase (arg); - } - } - } - } - - if (! temp.size () || ! isa (ablock.terminator ())) - return; - - // FIXME: If we support try/catch or unwind_protect final_block may not be the - // destination - jit_block *split = ablock.maybe_split (*this, final_block); - jit_terminator *term = split->terminator (); - for (std::set::const_iterator iter = temp.begin (); - iter != temp.end (); ++iter) - { - jit_value *value = *iter; - jit_call *release = create (&jit_typeinfo::release, value); - split->insert_before (term, release); - release->infer (); - } -} - -void -jit_convert::release_dead_phi (jit_block& ablock) -{ - jit_block::iterator iter = ablock.begin (); - while (iter != ablock.end () && isa (*iter)) - { - jit_phi *phi = static_cast (*iter); - ++iter; - - jit_use *use = phi->first_use (); - if (phi->use_count () == 1 && isa (use->user ())) - { - // instead of releasing on assign, release on all incomming branches, - // this can get rid of casts inside loops - for (size_t i = 0; i < phi->argument_count (); ++i) - { - jit_value *arg = phi->argument (i); - jit_block *inc = phi->incomming (i); - jit_block *split = inc->maybe_split (*this, ablock); - jit_terminator *term = split->terminator (); - jit_call *release = create (jit_typeinfo::release, arg); - release->infer (); - split->insert_before (term, release); - } - - phi->replace_with (0); - phi->remove (); - } - } -} - -void -jit_convert::simplify_phi (void) -{ - for (block_list::iterator biter = blocks.begin (); biter != blocks.end (); - ++biter) - { - jit_block &ablock = **biter; - for (jit_block::iterator iter = ablock.begin (); iter != ablock.end () - && isa (*iter); ++iter) - simplify_phi (*static_cast (*iter)); - } -} - -void -jit_convert::simplify_phi (jit_phi& phi) -{ - jit_block& pblock = *phi.parent (); - const jit_operation& cast_fn = jit_typeinfo::cast (phi.type ()); - jit_variable *dest = phi.dest (); - for (size_t i = 0; i < phi.argument_count (); ++i) - { - jit_value *arg = phi.argument (i); - if (arg->type () != phi.type ()) - { - jit_block *pred = phi.incomming (i); - jit_block *split = pred->maybe_split (*this, pblock); - jit_terminator *term = split->terminator (); - jit_instruction *cast = create (cast_fn, arg); - jit_assign *assign = create (dest, cast); - - split->insert_before (term, cast); - split->insert_before (term, assign); - cast->infer (); - assign->infer (); - phi.stash_argument (i, assign); - } - } + tee.accept (*this); + return result; } void @@ -1237,17 +867,26 @@ ++iter) { jit_block *b = *iter; - b->append (create (dest)); + b->append (factory.create (dest)); } } -// -------------------- jit_convert::convert_llvm -------------------- +// -------------------- jit_convert_llvm -------------------- llvm::Function * -jit_convert::convert_llvm::convert (llvm::Module *module, - const std::vector >& args, - const std::list& blocks, - const std::list& constants) +jit_convert_llvm::convert (llvm::Module *module, + const jit_block_list& blocks, + const std::list& constants) { + // for now just init arguments from entry, later we will have to do something + // more interesting + jit_block *entry_block = blocks.front (); + for (jit_block::iterator iter = entry_block->begin (); + iter != entry_block->end (); ++iter) + if (jit_extract_argument *extract + = dynamic_cast (*iter)) + argument_vec.push_back (std::make_pair (extract->name (), true)); + + jit_type *any = jit_typeinfo::get_any (); // argument is an array of octave_base_value*, or octave_base_value** @@ -1264,10 +903,10 @@ builder.SetInsertPoint (prelude); llvm::Value *arg = function->arg_begin (); - for (size_t i = 0; i < args.size (); ++i) + for (size_t i = 0; i < argument_vec.size (); ++i) { llvm::Value *loaded_arg = builder.CreateConstInBoundsGEP1_32 (arg, i); - arguments[args[i].first] = loaded_arg; + arguments[argument_vec[i].first] = loaded_arg; } std::list::const_iterator biter; @@ -1318,7 +957,7 @@ } void -jit_convert::convert_llvm::finish_phi (jit_phi *phi) +jit_convert_llvm::finish_phi (jit_phi *phi) { llvm::PHINode *llvm_phi = phi->to_llvm (); for (size_t i = 0; i < phi->argument_count (); ++i) @@ -1329,25 +968,25 @@ } void -jit_convert::convert_llvm::visit (jit_const_string& cs) +jit_convert_llvm::visit (jit_const_string& cs) { cs.stash_llvm (builder.CreateGlobalStringPtr (cs.value ())); } void -jit_convert::convert_llvm::visit (jit_const_bool& cb) +jit_convert_llvm::visit (jit_const_bool& cb) { cb.stash_llvm (llvm::ConstantInt::get (cb.type_llvm (), cb.value ())); } void -jit_convert::convert_llvm::visit (jit_const_scalar& cs) +jit_convert_llvm::visit (jit_const_scalar& cs) { cs.stash_llvm (llvm::ConstantFP::get (cs.type_llvm (), cs.value ())); } void -jit_convert::convert_llvm::visit (jit_const_complex& cc) +jit_convert_llvm::visit (jit_const_complex& cc) { llvm::Type *scalar_t = jit_typeinfo::get_scalar_llvm (); llvm::Constant *values[2]; @@ -1357,13 +996,13 @@ cc.stash_llvm (llvm::ConstantVector::get (values)); } -void jit_convert::convert_llvm::visit (jit_const_index& ci) +void jit_convert_llvm::visit (jit_const_index& ci) { ci.stash_llvm (llvm::ConstantInt::get (ci.type_llvm (), ci.value ())); } void -jit_convert::convert_llvm::visit (jit_const_range& cr) +jit_convert_llvm::visit (jit_const_range& cr) { llvm::StructType *stype = llvm::cast(cr.type_llvm ()); llvm::Type *scalar_t = jit_typeinfo::get_scalar_llvm (); @@ -1383,7 +1022,7 @@ } void -jit_convert::convert_llvm::visit (jit_block& b) +jit_convert_llvm::visit (jit_block& b) { llvm::BasicBlock *block = b.to_llvm (); builder.SetInsertPoint (block); @@ -1392,13 +1031,13 @@ } void -jit_convert::convert_llvm::visit (jit_branch& b) +jit_convert_llvm::visit (jit_branch& b) { b.stash_llvm (builder.CreateBr (b.successor_llvm ())); } void -jit_convert::convert_llvm::visit (jit_cond_branch& cb) +jit_convert_llvm::visit (jit_cond_branch& cb) { llvm::Value *cond = cb.cond_llvm (); llvm::Value *br; @@ -1408,7 +1047,7 @@ } void -jit_convert::convert_llvm::visit (jit_call& call) +jit_convert_llvm::visit (jit_call& call) { const jit_function& ol = call.overload (); @@ -1421,7 +1060,7 @@ } void -jit_convert::convert_llvm::visit (jit_extract_argument& extract) +jit_convert_llvm::visit (jit_extract_argument& extract) { llvm::Value *arg = arguments[extract.name ()]; assert (arg); @@ -1432,7 +1071,7 @@ } void -jit_convert::convert_llvm::visit (jit_store_argument& store) +jit_convert_llvm::visit (jit_store_argument& store) { const jit_function& ol = store.overload (); llvm::Value *arg_value = ol.call (builder, store.result ()); @@ -1441,7 +1080,7 @@ } void -jit_convert::convert_llvm::visit (jit_phi& phi) +jit_convert_llvm::visit (jit_phi& phi) { // we might not have converted all incoming branches, so we don't // set incomming branches now @@ -1452,13 +1091,13 @@ } void -jit_convert::convert_llvm::visit (jit_variable&) +jit_convert_llvm::visit (jit_variable&) { throw jit_fail_exception ("ERROR: SSA construction should remove all variables"); } void -jit_convert::convert_llvm::visit (jit_error_check& check) +jit_convert_llvm::visit (jit_error_check& check) { llvm::Value *cond = jit_typeinfo::insert_error_check (builder); llvm::Value *br = builder.CreateCondBr (cond, check.successor_llvm (0), @@ -1467,7 +1106,7 @@ } void -jit_convert::convert_llvm::visit (jit_assign& assign) +jit_convert_llvm::visit (jit_assign& assign) { jit_value *new_value = assign.src (); assign.stash_llvm (new_value->to_llvm ()); @@ -1486,16 +1125,17 @@ if (isa (overwrite)) { const jit_function& ol = jit_typeinfo::get_release (overwrite->type ()); - ol.call (builder, overwrite); + if (ol.valid ()) + ol.call (builder, overwrite); } } void -jit_convert::convert_llvm::visit (jit_argument&) +jit_convert_llvm::visit (jit_argument&) {} void -jit_convert::convert_llvm::visit (jit_magic_end& me) +jit_convert_llvm::visit (jit_magic_end& me) { const jit_function& ol = me.overload (); @@ -1504,6 +1144,372 @@ me.stash_llvm (ret); } +// -------------------- jit_infer -------------------- +jit_infer::jit_infer (jit_factory& afactory, jit_block_list& ablocks, + const variable_map& avmap) + : blocks (ablocks), factory (afactory), vmap (avmap) {} + +void +jit_infer::infer (void) +{ + construct_ssa (); + + // initialize the worklist to instructions derived from constants + const std::list& constants = factory.constants (); + for (std::list::const_iterator iter = constants.begin (); + iter != constants.end (); ++iter) + append_users (*iter); + + // the entry block terminator may be a regular branch statement + if (entry_block ().terminator ()) + push_worklist (entry_block ().terminator ()); + + // FIXME: Describe algorithm here + while (worklist.size ()) + { + jit_instruction *next = worklist.front (); + worklist.pop_front (); + next->stash_in_worklist (false); + + if (next->infer ()) + { + // terminators need to be handles specially + if (jit_terminator *term = dynamic_cast (next)) + append_users_term (term); + else + append_users (next); + } + } + + remove_dead (); + final_block ().label (); + place_releases (); + simplify_phi (); +} + +void +jit_infer::append_users (jit_value *v) +{ + for (jit_use *use = v->first_use (); use; use = use->next ()) + push_worklist (use->user ()); +} + +void +jit_infer::append_users_term (jit_terminator *term) +{ + for (size_t i = 0; i < term->successor_count (); ++i) + { + if (term->alive (i)) + { + jit_block *succ = term->successor (i); + for (jit_block::iterator iter = succ->begin (); iter != succ->end () + && isa (*iter); ++iter) + push_worklist (*iter); + + jit_terminator *sterm = succ->terminator (); + if (sterm) + push_worklist (sterm); + } + } +} + +void +jit_infer::construct_ssa (void) +{ + final_block ().label (); + final_block ().compute_idom (entry_block ()); + entry_block ().compute_df (); + entry_block ().create_dom_tree (); + + // insert phi nodes where needed, this is done on a per variable basis + for (variable_map::const_iterator iter = vmap.begin (); iter != vmap.end (); + ++iter) + { + jit_block::df_set visited, added_phi; + std::list ssa_worklist; + iter->second->use_blocks (visited); + ssa_worklist.insert (ssa_worklist.begin (), visited.begin (), + visited.end ()); + + while (ssa_worklist.size ()) + { + jit_block *b = ssa_worklist.front (); + ssa_worklist.pop_front (); + + for (jit_block::df_iterator diter = b->df_begin (); + diter != b->df_end (); ++diter) + { + jit_block *dblock = *diter; + if (! added_phi.count (dblock)) + { + jit_phi *phi = factory.create (iter->second, + dblock->use_count ()); + dblock->prepend (phi); + added_phi.insert (dblock); + } + + if (! visited.count (dblock)) + { + ssa_worklist.push_back (dblock); + visited.insert (dblock); + } + } + } + } + + do_construct_ssa (entry_block (), entry_block ().visit_count ()); +} + +void +jit_infer::do_construct_ssa (jit_block& ablock, size_t avisit_count) +{ + if (ablock.visited (avisit_count)) + return; + + // replace variables with their current SSA value + for (jit_block::iterator iter = ablock.begin (); iter != ablock.end (); + ++iter) + { + jit_instruction *instr = *iter; + instr->construct_ssa (); + instr->push_variable (); + } + + // finish phi nodes of successors + for (size_t i = 0; i < ablock.successor_count (); ++i) + { + jit_block *finish = ablock.successor (i); + + for (jit_block::iterator iter = finish->begin (); iter != finish->end () + && isa (*iter);) + { + jit_phi *phi = static_cast (*iter); + jit_variable *var = phi->dest (); + if (var->has_top ()) + { + phi->add_incomming (&ablock, var->top ()); + ++iter; + } + else + { + // temporaries may have extranious phi nodes which can be removed + assert (! phi->use_count ()); + assert (var->name ().size () && var->name ()[0] == '#'); + iter = finish->remove (iter); + } + } + } + + for (size_t i = 0; i < ablock.dom_successor_count (); ++i) + do_construct_ssa (*ablock.dom_successor (i), avisit_count); + + ablock.pop_all (); +} + +void +jit_infer::place_releases (void) +{ + std::set temporaries; + for (jit_block_list::iterator iter = blocks.begin (); iter != blocks.end (); + ++iter) + { + jit_block& ablock = **iter; + if (ablock.id () != jit_block::NO_ID) + { + release_temp (ablock, temporaries); + release_dead_phi (ablock); + } + } +} + +void +jit_infer::push_worklist (jit_instruction *instr) +{ + if (! instr->in_worklist ()) + { + instr->stash_in_worklist (true); + worklist.push_back (instr); + } +} + +void +jit_infer::remove_dead () +{ + jit_block_list::iterator biter; + for (biter = blocks.begin (); biter != blocks.end (); ++biter) + { + jit_block *b = *biter; + if (b->alive ()) + { + for (jit_block::iterator iter = b->begin (); iter != b->end () + && isa (*iter);) + { + jit_phi *phi = static_cast (*iter); + if (phi->prune ()) + iter = b->remove (iter); + else + ++iter; + } + } + } + + for (biter = blocks.begin (); biter != blocks.end ();) + { + jit_block *b = *biter; + if (b->alive ()) + { + // FIXME: A special case for jit_error_check, if we generalize to + // we will need to change! + jit_terminator *term = b->terminator (); + if (term && term->successor_count () == 2 && ! term->alive (0)) + { + jit_block *succ = term->successor (1); + term->remove (); + jit_branch *abreak = factory.create (succ); + b->append (abreak); + abreak->infer (); + } + + ++biter; + } + else + { + jit_terminator *term = b->terminator (); + if (term) + term->remove (); + biter = blocks.erase (biter); + } + } +} + +void +jit_infer::release_dead_phi (jit_block& ablock) +{ + jit_block::iterator iter = ablock.begin (); + while (iter != ablock.end () && isa (*iter)) + { + jit_phi *phi = static_cast (*iter); + ++iter; + + jit_use *use = phi->first_use (); + if (phi->use_count () == 1 && isa (use->user ())) + { + // instead of releasing on assign, release on all incomming branches, + // this can get rid of casts inside loops + for (size_t i = 0; i < phi->argument_count (); ++i) + { + jit_value *arg = phi->argument (i); + if (! arg->needs_release ()) + continue; + + jit_block *inc = phi->incomming (i); + jit_block *split = inc->maybe_split (factory, blocks, ablock); + jit_terminator *term = split->terminator (); + jit_call *release + = factory.create (jit_typeinfo::release, arg); + release->infer (); + split->insert_before (term, release); + } + + phi->replace_with (0); + phi->remove (); + } + } +} + +void +jit_infer::release_temp (jit_block& ablock, std::set& temp) +{ + for (jit_block::iterator iter = ablock.begin (); iter != ablock.end (); + ++iter) + { + jit_instruction *instr = *iter; + + // check for temporaries that require release and live across + // multiple blocks + if (instr->needs_release ()) + { + jit_block *fu_block = instr->first_use_block (); + if (fu_block && fu_block != &ablock && instr->needs_release ()) + temp.insert (instr); + } + + if (isa (instr)) + { + // place releases for temporary arguments + for (size_t i = 0; i < instr->argument_count (); ++i) + { + jit_value *arg = instr->argument (i); + if (! arg->needs_release ()) + continue; + + jit_call *release + = factory.create (&jit_typeinfo::release, arg); + release->infer (); + ablock.insert_after (iter, release); + ++iter; + temp.erase (arg); + } + } + } + + if (! temp.size () || ! isa (ablock.terminator ())) + return; + + // FIXME: If we support try/catch or unwind_protect final_block may not be the + // destination + jit_block *split = ablock.maybe_split (factory, blocks, final_block ()); + jit_terminator *term = split->terminator (); + for (std::set::const_iterator iter = temp.begin (); + iter != temp.end (); ++iter) + { + jit_value *value = *iter; + jit_call *release + = factory.create (&jit_typeinfo::release, value); + split->insert_before (term, release); + release->infer (); + } +} + +void +jit_infer::simplify_phi (void) +{ + for (jit_block_list::iterator biter = blocks.begin (); biter != blocks.end (); + ++biter) + { + jit_block &ablock = **biter; + for (jit_block::iterator iter = ablock.begin (); iter != ablock.end () + && isa (*iter); ++iter) + simplify_phi (*static_cast (*iter)); + } +} + +void +jit_infer::simplify_phi (jit_phi& phi) +{ + jit_block& pblock = *phi.parent (); + const jit_operation& cast_fn = jit_typeinfo::cast (phi.type ()); + jit_variable *dest = phi.dest (); + for (size_t i = 0; i < phi.argument_count (); ++i) + { + jit_value *arg = phi.argument (i); + if (arg->type () != phi.type ()) + { + jit_block *pred = phi.incomming (i); + jit_block *split = pred->maybe_split (factory, blocks, pblock); + jit_terminator *term = split->terminator (); + jit_instruction *cast = factory.create (cast_fn, arg); + jit_assign *assign = factory.create (dest, cast); + + split->insert_before (term, cast); + split->insert_before (term, assign); + cast->infer (); + assign->infer (); + phi.stash_argument (i, assign); + } + } +} + // -------------------- tree_jit -------------------- tree_jit::tree_jit (void) : module (0), engine (0) @@ -1579,6 +1585,7 @@ pass_manager = new llvm::FunctionPassManager (module); pass_manager->add (new llvm::TargetData(*engine->getTargetData ())); + pass_manager->add (llvm::createCFGSimplificationPass ()); pass_manager->add (llvm::createBasicAliasAnalysisPass ()); pass_manager->add (llvm::createPromoteMemoryToRegisterPass ()); pass_manager->add (llvm::createInstructionCombiningPass ()); @@ -1624,36 +1631,13 @@ jit_info::jit_info (tree_jit& tjit, tree& tee) : engine (tjit.get_engine ()), function (0), llvm_function (0) { - try - { - jit_convert conv (tjit.get_module (), tee); - initialize (tjit, conv); - } - catch (const jit_fail_exception& e) - { -#ifdef OCTAVE_JIT_DEBUG - if (e.known ()) - std::cout << "jit fail: " << e.what () << std::endl; -#endif - } + compile (tjit, tee); } jit_info::jit_info (tree_jit& tjit, tree& tee, const octave_value& for_bounds) : engine (tjit.get_engine ()), function (0), llvm_function (0) { - try - { - jit_convert conv (tjit.get_module (), tee, - jit_typeinfo::type_of (for_bounds)); - initialize (tjit, conv); - } - catch (const jit_fail_exception& e) - { -#ifdef OCTAVE_JIT_DEBUG - if (e.known ()) - std::cout << "jit fail: " << e.what () << std::endl; -#endif - } + compile (tjit, tee, jit_typeinfo::type_of (for_bounds)); } jit_info::~jit_info (void) @@ -1715,14 +1699,48 @@ } void -jit_info::initialize (tree_jit& tjit, jit_convert& conv) +jit_info::compile (tree_jit& tjit, tree& tee, jit_type *for_bounds) { - llvm_function = conv.get_function (); - arguments = conv.get_arguments (); - bounds = conv.get_bounds (); + try + { + jit_convert conv (tee, for_bounds); + jit_infer infer (conv.get_factory (), conv.get_blocks (), + conv.get_variable_map ()); + + infer.infer (); +#ifdef OCTAVE_JIT_DEBUG + jit_block *entry_block = infer.get_blocks ().front (); + entry_block->label (); + std::cout << "-------------------- Compiling tree --------------------\n"; + std::cout << tee.str_print_code () << std::endl; + entry_block->print (std::cout, "octave jit ir"); +#endif + + jit_factory& factory = conv.get_factory (); + jit_convert_llvm to_llvm; + llvm_function = to_llvm.convert (tjit.get_module (), infer.get_blocks (), + factory.constants ()); + arguments = to_llvm.get_arguments (); + bounds = conv.get_bounds (); + } + catch (const jit_fail_exception& e) + { +#ifdef OCTAVE_JIT_DEBUG + if (e.known ()) + std::cout << "jit fail: " << e.what () << std::endl; +#endif + } if (llvm_function) { +#ifdef OCTAVE_JIT_DEBUG + std::cout << "-------------------- llvm ir --------------------"; + llvm::raw_os_ostream llvm_cout (std::cout); + function->print (llvm_cout); + std::cout << std::endl; + llvm::verifyFunction (*function); +#endif + tjit.optimize (llvm_function); #ifdef OCTAVE_JIT_DEBUG @@ -1940,4 +1958,58 @@ %! m2(2, :) = 1:1001; %! assert (m, m2); +%!test +%! m = [1 2 3]; +%! for i=1:1001 +%! m = sin (m); +%! break; +%! endfor +%! assert (m == sin ([1 2 3])); + +%!test +%! i = 0; +%! while i < 10 +%! i += 1; +%! endwhile +%! assert (i == 10); + +%!test +%! i = 0; +%! while i < 10 +%! a = ++i; +%! endwhile +%! assert (i == 10); +%! assert (a == 10); +%!test +%! i = 0; +%! while i < 10 +%! a = i++; +%! endwhile +%! assert (i == 10); +%! assert (a == 9); + +%!test +%! num = 2; +%! a = zeros (1, num); +%! i = 1; +%! while i <= num +%! a(i) = norm (eye (i)); +%! ++i; +%! endwhile +%! assert (a, ones (1, num)); + +%!function test_compute_idom () +%! while (li <= length (l1) && si <= length (s1)) +%! if (l1 (li) < s1 (si)) +%! if (li == si) +%! break; +%! endif; +%! li++; +%! else +%! si++; +%! endif; +%! endwhile + +%!error test_compute_idom () + */ diff --git a/src/interp-core/pt-jit.h b/libinterp/interp-core/pt-jit.h rename from src/interp-core/pt-jit.h rename to libinterp/interp-core/pt-jit.h --- a/src/interp-core/pt-jit.h +++ b/libinterp/interp-core/pt-jit.h @@ -29,51 +29,43 @@ #include "pt-walk.h" -// -------------------- Current status -------------------- -// Simple binary operations (+-*/) on octave_scalar's (doubles) are optimized. -// a = 5; -// b = a * 5 + a; -// -// Indexing matrices with scalars works. -// -// if, elseif, else, break, continue, and for compile. Compilation is triggered -// at the start of a simple for loop. -// -// The octave low level IR is a linear IR, it works by converting everything to -// calls to jit_operations. This turns expressions like c = a + b into -// c = call binary+ (a, b) -// The jit_operations contain information about overloads for different types. -// For, example, if we know a and b are scalars, then c must also be a scalar. -// -// Support for function calls is in progress. Currently, calls to sin with a -// scalar argument will compile. -// -// TODO: -// 1. Function calls (In progress) -// 2. Cleanup/documentation -// 3. ... -// --------------------------------------------------------- - -// convert between IRs -// FIXME: Class relationships are messy from here on down. They need to be -// cleaned up. +// Convert from the parse tree (AST) to the low level Octave IR. class jit_convert : public tree_walker { public: typedef std::pair type_bound; typedef std::vector type_bound_vector; + typedef std::map variable_map; - jit_convert (llvm::Module *module, tree &tee, jit_type *for_bounds = 0); + jit_convert (tree &tee, jit_type *for_bounds = 0); + +#define DECL_ARG(n) const ARG ## n& arg ## n +#define JIT_CREATE_CHECKED(N) \ + template \ + jit_call *create_checked (OCT_MAKE_LIST (DECL_ARG, N)) \ + { \ + jit_call *ret = factory.create (OCT_MAKE_ARG_LIST (arg, N)); \ + return create_checked_impl (ret); \ + } - ~jit_convert (void); + JIT_CREATE_CHECKED (1) + JIT_CREATE_CHECKED (2) + JIT_CREATE_CHECKED (3) + JIT_CREATE_CHECKED (4) + +#undef JIT_CREATE_CHECKED +#undef DECL_ARG + + jit_block_list& get_blocks (void) { return blocks; } + + const type_bound_vector& get_bounds (void) const { return bounds; } + + jit_factory& get_factory (void) { return factory; } llvm::Function *get_function (void) const { return function; } - const std::vector >& get_arguments(void) const - { return arguments; } - - const type_bound_vector& get_bounds (void) const { return bounds; } + const variable_map &get_variable_map (void) const { return vmap; } void visit_anon_fcn_handle (tree_anon_fcn_handle&); @@ -160,71 +152,12 @@ void visit_while_command (tree_while_command&); void visit_do_until_command (tree_do_until_command&); - - // this would be easier with variadic templates - template - T *create (void) - { - T *ret = new T(); - track_value (ret); - return ret; - } - -#define DECL_ARG(n) const ARG ## n& arg ## n -#define JIT_CREATE(N) \ - template \ - T *create (OCT_MAKE_LIST (DECL_ARG, N)) \ - { \ - T *ret = new T (OCT_MAKE_ARG_LIST (arg, N)); \ - track_value (ret); \ - return ret; \ - } - - JIT_CREATE (1) - JIT_CREATE (2) - JIT_CREATE (3) - JIT_CREATE (4) - -#undef JIT_CREATE - -#define JIT_CREATE_CHECKED(N) \ - template \ - jit_call *create_checked (OCT_MAKE_LIST (DECL_ARG, N)) \ - { \ - jit_call *ret = create (OCT_MAKE_ARG_LIST (arg, N)); \ - return create_checked_impl (ret); \ - } - - JIT_CREATE_CHECKED (1) - JIT_CREATE_CHECKED (2) - JIT_CREATE_CHECKED (3) - JIT_CREATE_CHECKED (4) - -#undef JIT_CREATE_CHECKED -#undef DECL_ARG - - typedef std::list block_list; - typedef block_list::iterator block_iterator; - - void append (jit_block *ablock); - - void insert_before (block_iterator iter, jit_block *ablock); - - void insert_before (jit_block *loc, jit_block *ablock) - { - insert_before (loc->location (), ablock); - } - - void insert_after (block_iterator iter, jit_block *ablock); - - void insert_after (jit_block *loc, jit_block *ablock) - { - insert_after (loc->location (), ablock); - } private: std::vector > arguments; type_bound_vector bounds; + jit_factory factory; + // used instead of return values from visit_* functions jit_value *result; @@ -236,13 +169,7 @@ llvm::Function *function; - std::list blocks; - - std::list worklist; - - std::list constants; - - std::list all_values; + jit_block_list blocks; std::vector end_context; @@ -250,26 +177,9 @@ size_t for_bounds_count; size_t short_count; - typedef std::map vmap_t; - vmap_t vmap; - - jit_call *create_checked_impl (jit_call *ret) - { - block->append (ret); - create_check (ret); - return ret; - } + variable_map vmap; - jit_error_check *create_check (jit_call *call) - { - jit_block *normal = create (block->name ()); - jit_error_check *ret - = block->append (create (call, normal, final_block)); - append (normal); - block = normal; - - return ret; - } + jit_call *create_checked_impl (jit_call *ret); // get an existing vairable. If the variable does not exist, it will not be // created @@ -310,120 +220,102 @@ jit_value *visit (tree& tee); - void push_worklist (jit_instruction *instr) + bool breaking; // true if we are breaking OR continuing + + typedef std::list block_list; + block_list breaks; + block_list continues; + + void finish_breaks (jit_block *dest, const block_list& lst); +}; + +// Convert from the low level Octave IR to LLVM +class +jit_convert_llvm : public jit_ir_walker +{ +public: + llvm::Function *convert (llvm::Module *module, + const jit_block_list& blocks, + const std::list& constants); + + const std::vector >& get_arguments(void) const + { return argument_vec; } + +#define JIT_METH(clname) \ + virtual void visit (jit_ ## clname&); + + JIT_VISIT_IR_CLASSES; + +#undef JIT_METH +private: + std::vector > argument_vec; + + // name -> llvm argument + std::map arguments; + llvm::Function *function; + llvm::BasicBlock *prelude; + + void finish_phi (jit_phi *phi); + + void visit (jit_value *jvalue) { - if (! instr->in_worklist ()) - { - instr->stash_in_worklist (true); - worklist.push_back (instr); - } + return visit (*jvalue); } - void append_users (jit_value *v) + void visit (jit_value &jvalue) { - for (jit_use *use = v->first_use (); use; use = use->next ()) - push_worklist (use->user ()); + jvalue.accept (*this); } +}; + +// type inference and SSA construction on the low level Octave IR +class +jit_infer +{ +public: + typedef jit_convert::variable_map variable_map; + + jit_infer (jit_factory& afactory, jit_block_list& ablocks, + const variable_map& avmap); + + jit_block_list& get_blocks (void) const { return blocks; } + + jit_factory& get_factory (void) const { return factory; } + + void infer (void); +private: + jit_block_list& blocks; + jit_factory& factory; + const variable_map& vmap; + std::list worklist; + + void append_users (jit_value *v); void append_users_term (jit_terminator *term); - void track_value (jit_value *value) - { - if (value->type ()) - constants.push_back (value); - all_values.push_back (value); - } - - void merge_blocks (void); - void construct_ssa (void); void do_construct_ssa (jit_block& block, size_t avisit_count); - void remove_dead (); + jit_block& entry_block (void) { return *blocks.front (); } + + jit_block& final_block (void) { return *blocks.back (); } void place_releases (void); - void release_temp (jit_block& ablock, std::set& temp); + void push_worklist (jit_instruction *instr); + + void remove_dead (); void release_dead_phi (jit_block& ablock); + void release_temp (jit_block& ablock, std::set& temp); + void simplify_phi (void); void simplify_phi (jit_phi& phi); - - void print_blocks (const std::string& header) - { - std::cout << "-------------------- " << header << " --------------------\n"; - for (std::list::iterator iter = blocks.begin (); - iter != blocks.end (); ++iter) - { - assert (*iter); - (*iter)->print (std::cout, 0); - } - std::cout << std::endl; - } - - void print_dom (void) - { - std::cout << "-------------------- dom info --------------------\n"; - for (std::list::iterator iter = blocks.begin (); - iter != blocks.end (); ++iter) - { - assert (*iter); - (*iter)->print_dom (std::cout); - } - std::cout << std::endl; - } - - bool breaking; // true if we are breaking OR continuing - block_list breaks; - block_list continues; - - void finish_breaks (jit_block *dest, const block_list& lst); - - // this case is much simpler, just convert from the jit ir to llvm - class - convert_llvm : public jit_ir_walker - { - public: - convert_llvm (jit_convert& jc) : jthis (jc) {} - - llvm::Function *convert (llvm::Module *module, - const std::vector >& args, - const std::list& blocks, - const std::list& constants); - -#define JIT_METH(clname) \ - virtual void visit (jit_ ## clname&); - - JIT_VISIT_IR_CLASSES; - -#undef JIT_METH - private: - // name -> llvm argument - std::map arguments; - - void finish_phi (jit_phi *phi); - - void visit (jit_value *jvalue) - { - return visit (*jvalue); - } - - void visit (jit_value &jvalue) - { - jvalue.accept (*this); - } - private: - jit_convert &jthis; - llvm::Function *function; - llvm::BasicBlock *prelude; - }; }; -class jit_info; - class tree_jit { @@ -446,8 +338,6 @@ size_t trip_count (const octave_value& bounds) const; - // FIXME: Temorary hack to test - typedef std::map compiled_map; llvm::Module *module; llvm::PassManager *module_pass_manager; llvm::FunctionPassManager *pass_manager; @@ -475,7 +365,7 @@ typedef jit_convert::type_bound_vector type_bound_vector; typedef void (*jited_function)(octave_base_value**); - void initialize (tree_jit& tjit, jit_convert& conv); + void compile (tree_jit& tjit, tree& tee, jit_type *for_bounds = 0); octave_value find (const vmap& extra_vars, const std::string& vname) const; diff --git a/src/interp-core/siglist.c b/libinterp/interp-core/siglist.c rename from src/interp-core/siglist.c rename to libinterp/interp-core/siglist.c diff --git a/src/interp-core/siglist.h b/libinterp/interp-core/siglist.h rename from src/interp-core/siglist.h rename to libinterp/interp-core/siglist.h diff --git a/src/interp-core/sparse-xdiv.cc b/libinterp/interp-core/sparse-xdiv.cc rename from src/interp-core/sparse-xdiv.cc rename to libinterp/interp-core/sparse-xdiv.cc diff --git a/src/interp-core/sparse-xdiv.h b/libinterp/interp-core/sparse-xdiv.h rename from src/interp-core/sparse-xdiv.h rename to libinterp/interp-core/sparse-xdiv.h diff --git a/src/interp-core/sparse-xpow.cc b/libinterp/interp-core/sparse-xpow.cc rename from src/interp-core/sparse-xpow.cc rename to libinterp/interp-core/sparse-xpow.cc --- a/src/interp-core/sparse-xpow.cc +++ b/libinterp/interp-core/sparse-xpow.cc @@ -26,7 +26,8 @@ #endif #include -#include + +#include #include "Array-util.h" #include "oct-cmplx.h" @@ -46,8 +47,8 @@ xisint (double x) { return (D_NINT (x) == x - && ((x >= 0 && x < INT_MAX) - || (x <= 0 && x > INT_MIN))); + && ((x >= 0 && x < std::numeric_limits::max ()) + || (x <= 0 && x > std::numeric_limits::min ()))); } diff --git a/src/interp-core/sparse-xpow.h b/libinterp/interp-core/sparse-xpow.h rename from src/interp-core/sparse-xpow.h rename to libinterp/interp-core/sparse-xpow.h diff --git a/src/interp-core/txt-eng-ft.cc b/libinterp/interp-core/txt-eng-ft.cc rename from src/interp-core/txt-eng-ft.cc rename to libinterp/interp-core/txt-eng-ft.cc diff --git a/src/interp-core/txt-eng-ft.h b/libinterp/interp-core/txt-eng-ft.h rename from src/interp-core/txt-eng-ft.h rename to libinterp/interp-core/txt-eng-ft.h diff --git a/src/interp-core/txt-eng.h b/libinterp/interp-core/txt-eng.h rename from src/interp-core/txt-eng.h rename to libinterp/interp-core/txt-eng.h diff --git a/src/interp-core/unwind-prot.cc b/libinterp/interp-core/unwind-prot.cc rename from src/interp-core/unwind-prot.cc rename to libinterp/interp-core/unwind-prot.cc diff --git a/src/interp-core/unwind-prot.h b/libinterp/interp-core/unwind-prot.h rename from src/interp-core/unwind-prot.h rename to libinterp/interp-core/unwind-prot.h diff --git a/src/interp-core/xdiv.cc b/libinterp/interp-core/xdiv.cc rename from src/interp-core/xdiv.cc rename to libinterp/interp-core/xdiv.cc diff --git a/src/interp-core/xdiv.h b/libinterp/interp-core/xdiv.h rename from src/interp-core/xdiv.h rename to libinterp/interp-core/xdiv.h diff --git a/src/interp-core/xgl2ps.c b/libinterp/interp-core/xgl2ps.c rename from src/interp-core/xgl2ps.c rename to libinterp/interp-core/xgl2ps.c diff --git a/src/interp-core/xnorm.cc b/libinterp/interp-core/xnorm.cc rename from src/interp-core/xnorm.cc rename to libinterp/interp-core/xnorm.cc diff --git a/src/interp-core/xnorm.h b/libinterp/interp-core/xnorm.h rename from src/interp-core/xnorm.h rename to libinterp/interp-core/xnorm.h diff --git a/src/interp-core/xpow.cc b/libinterp/interp-core/xpow.cc rename from src/interp-core/xpow.cc rename to libinterp/interp-core/xpow.cc --- a/src/interp-core/xpow.cc +++ b/libinterp/interp-core/xpow.cc @@ -26,7 +26,8 @@ #endif #include -#include + +#include #include "Array-util.h" #include "CColVector.h" @@ -59,8 +60,8 @@ xisint (double x) { return (D_NINT (x) == x - && ((x >= 0 && x < INT_MAX) - || (x <= 0 && x > INT_MIN))); + && ((x >= 0 && x < std::numeric_limits::max ()) + || (x <= 0 && x > std::numeric_limits::min ()))); } // Safer pow functions. @@ -1508,8 +1509,8 @@ xisint (float x) { return (D_NINT (x) == x - && ((x >= 0 && x < INT_MAX) - || (x <= 0 && x > INT_MIN))); + && ((x >= 0 && x < std::numeric_limits::max ()) + || (x <= 0 && x > std::numeric_limits::min ()))); } // Safer pow functions. diff --git a/src/interp-core/xpow.h b/libinterp/interp-core/xpow.h rename from src/interp-core/xpow.h rename to libinterp/interp-core/xpow.h diff --git a/src/interp-core/zfstream.cc b/libinterp/interp-core/zfstream.cc rename from src/interp-core/zfstream.cc rename to libinterp/interp-core/zfstream.cc diff --git a/src/interp-core/zfstream.h b/libinterp/interp-core/zfstream.h rename from src/interp-core/zfstream.h rename to libinterp/interp-core/zfstream.h diff --git a/src/interpfcn/data.cc b/libinterp/interpfcn/data.cc rename from src/interpfcn/data.cc rename to libinterp/interpfcn/data.cc --- a/src/interpfcn/data.cc +++ b/libinterp/interpfcn/data.cc @@ -4060,7 +4060,7 @@ arguments specify additional matrix dimensions.\n\ The optional argument @var{class} specifies the return type and may be\n\ either \"double\" or \"single\".\n\ -@seealso{log, exp, pi, i, j}\n\ +@seealso{log, exp, pi, I}\n\ @end deftypefn") { #if defined (M_E) @@ -4120,7 +4120,7 @@ retval = fill_matrix (octave_value ("single"), lo_ieee_nan_value (), lo_ieee_float_nan_value (), "eps"); - else if (val < FLT_MIN) + else if (val < std::numeric_limits::min ()) retval = fill_matrix (octave_value ("single"), 0e0, powf (2.0, -149e0), "eps"); else @@ -4129,7 +4129,8 @@ frexpf (val, &expon); val = std::pow (static_cast (2.0), static_cast (expon - 24)); - retval = fill_matrix (octave_value ("single"), DBL_EPSILON, + retval = fill_matrix (octave_value ("single"), + std::numeric_limits::epsilon (), val, "eps"); } } @@ -4145,7 +4146,7 @@ retval = fill_matrix (octave_value_list (), lo_ieee_nan_value (), lo_ieee_float_nan_value (), "eps"); - else if (val < DBL_MIN) + else if (val < std::numeric_limits::min ()) retval = fill_matrix (octave_value_list (), pow (2.0, -1074e0), 0e0, "eps"); else @@ -4155,13 +4156,15 @@ val = std::pow (static_cast (2.0), static_cast (expon - 53)); retval = fill_matrix (octave_value_list (), val, - FLT_EPSILON, "eps"); + std::numeric_limits::epsilon (), + "eps"); } } } } else - retval = fill_matrix (args, DBL_EPSILON, FLT_EPSILON, "eps"); + retval = fill_matrix (args, std::numeric_limits::epsilon (), + std::numeric_limits::epsilon (), "eps"); return retval; } @@ -4217,7 +4220,7 @@ arguments specify additional matrix dimensions.\n\ The optional argument @var{class} specifies the return type and may be\n\ either \"double\" or \"single\".\n\ -@seealso{e, i, j}\n\ +@seealso{e, I}\n\ @end deftypefn") { #if defined (M_PI) @@ -4259,7 +4262,8 @@ @seealso{realmin, intmax, bitmax, eps}\n\ @end deftypefn") { - return fill_matrix (args, DBL_MAX, FLT_MAX, "realmax"); + return fill_matrix (args, std::numeric_limits::max (), + std::numeric_limits::max (), "realmax"); } DEFUN (realmin, args, , @@ -4292,7 +4296,8 @@ @seealso{realmax, intmin, eps}\n\ @end deftypefn") { - return fill_matrix (args, DBL_MIN, FLT_MIN, "realmin"); + return fill_matrix (args, std::numeric_limits::min (), + std::numeric_limits::min (), "realmin"); } DEFUN (I, args, , @@ -4326,7 +4331,7 @@ arguments specify additional matrix dimensions.\n\ The optional argument @var{class} specifies the return type and may be\n\ either \"double\" or \"single\".\n\ -@seealso{e, pi, log, exp, i, j, J}\n\ +@seealso{e, pi, log, exp}\n\ @end deftypefn") { return fill_matrix (args, Complex (0.0, 1.0), "I"); @@ -7230,52 +7235,111 @@ return retval; } +bool do_base64_encode (const char * inc, const size_t inlen, char *& out) +{ + bool ret = false; + size_t outlen = base64_encode_alloc (inc, inlen, &out); + + if (! out && outlen == 0 && inlen != 0) + error ("base64_encode: input array too large"); + else if (! out) + error ("base64_encode: memory allocation error"); + else + ret = true; + + return ret; +} + DEFUN (base64_encode, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{s} =} base64_encode (@var{x})\n\ Encode a double matrix or array @var{x} into the base64 format string\n\ @var{s}.\n\ \n\ -@strong{Warning:} Encoding different numeric types, such as single or\n\ -integer, is not currently supported. Any non-double input will be converted\n\ -to type double before encoding.\n\ @seealso{base64_decode}\n\ @end deftypefn") { octave_value_list retval; - int nargin = args.length (); if (nargin != 1) print_usage (); else { - const Array in = args(0).array_value (); - if (! error_state) + if (! args(0).is_numeric_type ()) + error ("base64_encode: encoding is supported only for numeric arrays"); + else if (args(0).is_complex_type () + || args(0).is_sparse_type ()) + error ("base64_encode: encoding complex or sparse data is not supported"); + else if (args(0).is_integer_type ()) { - const char* inc = reinterpret_cast (in.data ()); - size_t inlen = in.numel () * sizeof (double) / sizeof (char); +#define MAKE_INT_BRANCH(X) \ + if (args(0).is_ ## X ## _type ()) \ + { \ + const X##NDArray in = args(0). X## _array_value (); \ + size_t inlen = \ + in.numel () * sizeof (X## _t) / sizeof (char); \ + const char* inc = \ + reinterpret_cast (in.data ()); \ + char* out; \ + if (! error_state \ + && do_base64_encode (inc, inlen, out)) \ + retval(0) = octave_value (out); \ + } + + MAKE_INT_BRANCH(int8) + else MAKE_INT_BRANCH(int16) + else MAKE_INT_BRANCH(int32) + else MAKE_INT_BRANCH(int64) + else MAKE_INT_BRANCH(uint8) + else MAKE_INT_BRANCH(uint16) + else MAKE_INT_BRANCH(uint32) + else MAKE_INT_BRANCH(uint64) +#undef MAKE_INT_BRANCH + + else + panic_impossible (); + } + else if (args(0).is_single_type ()) + { + const Array in = args(0).float_array_value (); + size_t inlen; + inlen = in.numel () * sizeof (float) / sizeof (char); + const char* inc; + inc = reinterpret_cast (in.data ()); char* out; - size_t outlen = base64_encode_alloc (inc, inlen, &out); - - if (! out && outlen == 0 && inlen != 0) - error ("base64_encode: input array too large"); - else if (! out) - error ("base64_encode: memory allocation error"); - else + if (! error_state + && do_base64_encode (inc, inlen, out)) + retval(0) = octave_value (out); + } + else + { + const Array in = args(0).array_value (); + size_t inlen; + inlen = in.numel () * sizeof (double) / sizeof (char); + const char* inc; + inc = reinterpret_cast (in.data ()); + char* out; + if (! error_state + && do_base64_encode (inc, inlen, out)) retval(0) = octave_value (out); } - } - + } return retval; } /* -%!assert (base64_encode (single (pi)), "AAAAYPshCUA=") -%!assert (base64_encode (uint8 (pi)), base64_encode (double (uint8 (pi)))) +%!assert (base64_encode (single (pi)), "2w9JQA==") +%!assert (base64_encode (uint8 ([0 0 0])), "AAAA") +%!assert (base64_encode (uint16 ([0 0 0])), "AAAAAAAA") +%!assert (base64_encode (uint32 ([0 0 0])), "AAAAAAAAAAAAAAAA") +%!assert (base64_encode (uint64 ([0 0 0])), "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") +%!assert (base64_encode (uint8 ([255 255 255])), "////") %!error base64_encode () %!error base64_encode (1,2) %!error base64_encode ("A string") +%!error base64_encode ({"A cell array"}) +%!error base64_encode (struct ()) */ DEFUN (base64_decode, args, , "-*- texinfo -*-\n\ @@ -7301,7 +7365,7 @@ if (nargin > 1) { const Array new_size = - args(1).octave_idx_type_vector_value (); + args(1).octave_idx_type_vector_value (); if (! error_state) { new_dims = dim_vector::alloc (new_size.length ()); diff --git a/src/interpfcn/data.h b/libinterp/interpfcn/data.h rename from src/interpfcn/data.h rename to libinterp/interpfcn/data.h diff --git a/src/interpfcn/debug.cc b/libinterp/interpfcn/debug.cc rename from src/interpfcn/debug.cc rename to libinterp/interpfcn/debug.cc --- a/src/interpfcn/debug.cc +++ b/libinterp/interpfcn/debug.cc @@ -825,7 +825,8 @@ dbg_fcn = get_user_code (); if (dbg_fcn) - do_dbtype (octave_stdout, dbg_fcn->name (), 0, INT_MAX); + do_dbtype (octave_stdout, dbg_fcn->name (), 0, + std::numeric_limits::max ()); else error ("dbtype: must be inside a user function to give no arguments to dbtype\n"); break; @@ -848,7 +849,7 @@ int start, end; start = atoi (start_str.c_str ()); if (end_str == "end") - end = INT_MAX; + end = std::numeric_limits::max (); else end = atoi (end_str.c_str ()); @@ -866,7 +867,8 @@ dbg_fcn = get_user_code (arg); if (dbg_fcn) - do_dbtype (octave_stdout, dbg_fcn->name (), 0, INT_MAX); + do_dbtype (octave_stdout, dbg_fcn->name (), 0, + std::numeric_limits::max ()); else error ("dbtype: function <%s> not found\n", arg.c_str ()); } @@ -889,7 +891,7 @@ start = atoi (start_str.c_str ()); if (end_str == "end") - end = INT_MAX; + end = std::numeric_limits::max (); else end = atoi (end_str.c_str ()); } diff --git a/src/interpfcn/debug.h b/libinterp/interpfcn/debug.h rename from src/interpfcn/debug.h rename to libinterp/interpfcn/debug.h diff --git a/src/interpfcn/defaults.cc b/libinterp/interpfcn/defaults.cc rename from src/interpfcn/defaults.cc rename to libinterp/interpfcn/defaults.cc --- a/src/interpfcn/defaults.cc +++ b/libinterp/interpfcn/defaults.cc @@ -74,6 +74,8 @@ std::string Vlocal_api_fcn_file_dir; std::string Vlocal_fcn_file_dir; +std::string Voct_etc_dir; + std::string Voct_file_dir; std::string Vfcn_file_dir; @@ -214,6 +216,12 @@ } static void +set_default_oct_etc_dir (void) +{ + Voct_etc_dir = subst_octave_home (OCTAVE_OCTETCDIR); +} + +static void set_default_oct_file_dir (void) { Voct_file_dir = subst_octave_home (OCTAVE_OCTFILEDIR); @@ -390,6 +398,8 @@ set_default_local_api_fcn_file_dir (); set_default_local_fcn_file_dir (); + set_default_oct_etc_dir (); + set_default_fcn_file_dir (); set_default_oct_file_dir (); diff --git a/src/interpfcn/defaults.in.h b/libinterp/interpfcn/defaults.in.h rename from src/interpfcn/defaults.in.h rename to libinterp/interpfcn/defaults.in.h --- a/src/interpfcn/defaults.in.h +++ b/libinterp/interpfcn/defaults.in.h @@ -194,6 +194,8 @@ extern std::string Vlocal_api_fcn_file_dir; extern std::string Vlocal_fcn_file_dir; +extern std::string Voct_etc_dir; + extern std::string Voct_file_dir; extern std::string Vfcn_file_dir; diff --git a/src/interpfcn/defun.cc b/libinterp/interpfcn/defun.cc rename from src/interpfcn/defun.cc rename to libinterp/interpfcn/defun.cc diff --git a/src/interpfcn/defun.h b/libinterp/interpfcn/defun.h rename from src/interpfcn/defun.h rename to libinterp/interpfcn/defun.h diff --git a/src/interpfcn/dirfns.cc b/libinterp/interpfcn/dirfns.cc rename from src/interpfcn/dirfns.cc rename to libinterp/interpfcn/dirfns.cc diff --git a/src/interpfcn/dirfns.h b/libinterp/interpfcn/dirfns.h rename from src/interpfcn/dirfns.h rename to libinterp/interpfcn/dirfns.h diff --git a/src/interpfcn/error.cc b/libinterp/interpfcn/error.cc rename from src/interpfcn/error.cc rename to libinterp/interpfcn/error.cc --- a/src/interpfcn/error.cc +++ b/libinterp/interpfcn/error.cc @@ -1068,6 +1068,14 @@ error: nargin != 1\n\ @end group\n\ @end example\n\ +\n\ +Implementation Note: For compatibility with @sc{matlab}, escape\n\ +sequences (e.g., \"\\n\" => newline) are processed in @var{template}\n\ +regardless of whether @var{template} has been defined within single quotes\n\ +as long as there are two or more input arguments.\n\ +Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\ +\"\\\\n\") or use the @code{regexptranslate} function.\n\ +@seealso{warning, lasterror}\n\ @end deftypefn") { octave_value retval; @@ -1167,7 +1175,14 @@ warning (\"error\");\n\ @end group\n\ @end example\n\ -@seealso{warning_ids}\n\ +\n\ +Implementation Note: For compatibility with @sc{matlab}, escape\n\ +sequences (e.g., \"\\n\" => newline) are processed in @var{template}\n\ +regardless of whether @var{template} has been defined within single quotes\n\ +as long as there are two or more input arguments.\n\ +Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\ +\"\\\\n\") or use the @code{regexptranslate} function.\n\ +@seealso{warning_ids, lastwarn, error}\n\ @end deftypefn") { octave_value retval; @@ -1553,7 +1568,7 @@ \n\ If @code{lasterror} is called with the argument \"reset\", all fields are\n\ set to their default values.\n\ -@seealso{lasterr}\n\ +@seealso{lasterr, error, lastwarn}\n\ @end deftypefn") { octave_value retval; @@ -1678,7 +1693,7 @@ return the last error message and message identifier. With one\n\ argument, set the last error message to @var{msg}. With two arguments,\n\ also set the last message identifier.\n\ -@seealso{lasterror}\n\ +@seealso{lasterror, error, lastwarn}\n\ @end deftypefn") { octave_value_list retval; @@ -1722,10 +1737,14 @@ DEFUN (lastwarn, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lastwarn (@var{msg}, @var{msgid})\n\ -Without any arguments, return the last warning message. With one\n\ +@deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lastwarn ()\n\ +@deftypefnx {Built-in Function} {} lastwarn (@var{msg})\n\ +@deftypefnx {Built-in Function} {} lastwarn (@var{msg}, @var{msgid})\n\ +Query or set the last warning message. When called without input arguments,\n\ +return the last warning message and message identifier. With one\n\ argument, set the last warning message to @var{msg}. With two arguments,\n\ also set the last message identifier.\n\ +@seealso{warning, lasterror, lasterr}\n\ @end deftypefn") { octave_value_list retval; diff --git a/src/interpfcn/error.h b/libinterp/interpfcn/error.h rename from src/interpfcn/error.h rename to libinterp/interpfcn/error.h diff --git a/src/interpfcn/file-io.cc b/libinterp/interpfcn/file-io.cc rename from src/interpfcn/file-io.cc rename to libinterp/interpfcn/file-io.cc --- a/src/interpfcn/file-io.cc +++ b/libinterp/interpfcn/file-io.cc @@ -39,10 +39,10 @@ #endif #include -#include #include #include +#include #include #include #include diff --git a/src/interpfcn/file-io.h b/libinterp/interpfcn/file-io.h rename from src/interpfcn/file-io.h rename to libinterp/interpfcn/file-io.h diff --git a/src/interpfcn/graphics.cc b/libinterp/interpfcn/graphics.cc rename from src/interpfcn/graphics.cc rename to libinterp/interpfcn/graphics.cc --- a/src/interpfcn/graphics.cc +++ b/libinterp/interpfcn/graphics.cc @@ -5930,7 +5930,7 @@ min_val = min_pos; } // FIXME -- maybe this test should also be relative? - if (std::abs (min_val - max_val) < sqrt (DBL_EPSILON)) + if (std::abs (min_val - max_val) < sqrt (std::numeric_limits::epsilon ())) { // Widen range when too small if (min_val >= 0) @@ -5965,7 +5965,7 @@ max_val = 1; } // FIXME -- maybe this test should also be relative? - else if (std::abs (min_val - max_val) < sqrt (DBL_EPSILON)) + else if (std::abs (min_val - max_val) < sqrt (std::numeric_limits::epsilon ())) { min_val -= 0.1 * std::abs (min_val); max_val += 0.1 * std::abs (max_val); diff --git a/src/interpfcn/graphics.in.h b/libinterp/interpfcn/graphics.in.h rename from src/interpfcn/graphics.in.h rename to libinterp/interpfcn/graphics.in.h diff --git a/src/interpfcn/help.cc b/libinterp/interpfcn/help.cc rename from src/interpfcn/help.cc rename to libinterp/interpfcn/help.cc diff --git a/src/interpfcn/help.h b/libinterp/interpfcn/help.h rename from src/interpfcn/help.h rename to libinterp/interpfcn/help.h diff --git a/src/interpfcn/input.cc b/libinterp/interpfcn/input.cc rename from src/interpfcn/input.cc rename to libinterp/interpfcn/input.cc diff --git a/src/interpfcn/input.h b/libinterp/interpfcn/input.h rename from src/interpfcn/input.h rename to libinterp/interpfcn/input.h diff --git a/src/interpfcn/load-path.cc b/libinterp/interpfcn/load-path.cc rename from src/interpfcn/load-path.cc rename to libinterp/interpfcn/load-path.cc diff --git a/src/interpfcn/load-path.h b/libinterp/interpfcn/load-path.h rename from src/interpfcn/load-path.h rename to libinterp/interpfcn/load-path.h diff --git a/src/interpfcn/load-save.cc b/libinterp/interpfcn/load-save.cc rename from src/interpfcn/load-save.cc rename to libinterp/interpfcn/load-save.cc diff --git a/src/interpfcn/load-save.h b/libinterp/interpfcn/load-save.h rename from src/interpfcn/load-save.h rename to libinterp/interpfcn/load-save.h diff --git a/src/interpfcn/ls-oct-ascii.cc b/libinterp/interpfcn/ls-oct-ascii.cc rename from src/interpfcn/ls-oct-ascii.cc rename to libinterp/interpfcn/ls-oct-ascii.cc --- a/src/interpfcn/ls-oct-ascii.cc +++ b/libinterp/interpfcn/ls-oct-ascii.cc @@ -428,5 +428,6 @@ variable value is restored when exiting the function.\n\ @end deftypefn") { - return SET_INTERNAL_VARIABLE_WITH_LIMITS (save_precision, -1, INT_MAX); + return SET_INTERNAL_VARIABLE_WITH_LIMITS (save_precision, -1, + std::numeric_limits::max ()); } diff --git a/src/interpfcn/ls-oct-ascii.h b/libinterp/interpfcn/ls-oct-ascii.h rename from src/interpfcn/ls-oct-ascii.h rename to libinterp/interpfcn/ls-oct-ascii.h --- a/src/interpfcn/ls-oct-ascii.h +++ b/libinterp/interpfcn/ls-oct-ascii.h @@ -38,7 +38,7 @@ // Used when converting Inf to something that gnuplot can read. #ifndef OCT_RBV -#define OCT_RBV DBL_MAX / 100.0 +#define OCT_RBV (std::numeric_limits::max () / 100.0) #endif extern OCTINTERP_API std::string diff --git a/src/interpfcn/module.mk b/libinterp/interpfcn/module.mk rename from src/interpfcn/module.mk rename to libinterp/interpfcn/module.mk diff --git a/src/interpfcn/oct-hist.cc b/libinterp/interpfcn/oct-hist.cc rename from src/interpfcn/oct-hist.cc rename to libinterp/interpfcn/oct-hist.cc --- a/src/interpfcn/oct-hist.cc +++ b/libinterp/interpfcn/oct-hist.cc @@ -698,7 +698,8 @@ int tmp = old_history_size; octave_value retval = set_internal_variable (tmp, args, nargout, - "history_size", -1, INT_MAX); + "history_size", -1, + std::numeric_limits::max ()); if (tmp != old_history_size) command_history::set_size (tmp); diff --git a/src/interpfcn/oct-hist.h b/libinterp/interpfcn/oct-hist.h rename from src/interpfcn/oct-hist.h rename to libinterp/interpfcn/oct-hist.h diff --git a/src/interpfcn/pager.cc b/libinterp/interpfcn/pager.cc rename from src/interpfcn/pager.cc rename to libinterp/interpfcn/pager.cc --- a/src/interpfcn/pager.cc +++ b/libinterp/interpfcn/pager.cc @@ -108,7 +108,7 @@ if (pid > 0) { - if (WIFEXITED (status) || WIFSIGNALLED (status)) + if (octave_wait::ifexited (status) || octave_wait::ifsignaled (status)) { // Avoid warning() since that will put us back in the pager, // which would be bad news. diff --git a/src/interpfcn/pager.h b/libinterp/interpfcn/pager.h rename from src/interpfcn/pager.h rename to libinterp/interpfcn/pager.h diff --git a/src/interpfcn/pr-output.cc b/libinterp/interpfcn/pr-output.cc rename from src/interpfcn/pr-output.cc rename to libinterp/interpfcn/pr-output.cc --- a/src/interpfcn/pr-output.cc +++ b/libinterp/interpfcn/pr-output.cc @@ -356,7 +356,9 @@ s = "1/0"; else if (xisnan (val)) s = "0/0"; - else if (val < INT_MIN || val > INT_MAX || D_NINT (val) == val) + else if (val < std::numeric_limits::min () + || val > std::numeric_limits::max () + || D_NINT (val) == val) { std::ostringstream buf; buf.flags (std::ios::fixed); @@ -385,7 +387,7 @@ double nextd = d; // Have we converged to 1/intmax ? - if (m > 100 || fabs (frac) < 1 / static_cast(INT_MAX)) + if (m > 100 || fabs (frac) < 1 / static_cast (std::numeric_limits::max ())) { lastn = n; lastd = d; @@ -483,7 +485,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.columns (); - double result = -DBL_MAX; + double result = -std::numeric_limits::max (); bool all_inf_or_nan = true; @@ -512,7 +514,7 @@ octave_idx_type nr = m.rows (); octave_idx_type nc = m.columns (); - double result = DBL_MAX; + double result = std::numeric_limits::max (); bool all_inf_or_nan = true; @@ -4068,7 +4070,8 @@ @seealso{format, fixed_point_format, output_precision}\n\ @end deftypefn") { - return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_max_field_width, 0, INT_MAX); + return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_max_field_width, 0, + std::numeric_limits::max ()); } DEFUN (output_precision, args, nargout, @@ -4085,5 +4088,6 @@ @seealso{format, fixed_point_format, output_max_field_width}\n\ @end deftypefn") { - return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_precision, -1, INT_MAX); + return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_precision, -1, + std::numeric_limits::max ()); } diff --git a/src/interpfcn/pr-output.h b/libinterp/interpfcn/pr-output.h rename from src/interpfcn/pr-output.h rename to libinterp/interpfcn/pr-output.h diff --git a/src/interpfcn/profiler.cc b/libinterp/interpfcn/profiler.cc rename from src/interpfcn/profiler.cc rename to libinterp/interpfcn/profiler.cc diff --git a/src/interpfcn/profiler.h b/libinterp/interpfcn/profiler.h rename from src/interpfcn/profiler.h rename to libinterp/interpfcn/profiler.h diff --git a/src/interpfcn/sighandlers.cc b/libinterp/interpfcn/sighandlers.cc rename from src/interpfcn/sighandlers.cc rename to libinterp/interpfcn/sighandlers.cc diff --git a/src/interpfcn/sighandlers.h b/libinterp/interpfcn/sighandlers.h rename from src/interpfcn/sighandlers.h rename to libinterp/interpfcn/sighandlers.h diff --git a/src/interpfcn/symtab.cc b/libinterp/interpfcn/symtab.cc rename from src/interpfcn/symtab.cc rename to libinterp/interpfcn/symtab.cc diff --git a/src/interpfcn/symtab.h b/libinterp/interpfcn/symtab.h rename from src/interpfcn/symtab.h rename to libinterp/interpfcn/symtab.h diff --git a/src/interpfcn/sysdep.cc b/libinterp/interpfcn/sysdep.cc rename from src/interpfcn/sysdep.cc rename to libinterp/interpfcn/sysdep.cc diff --git a/src/interpfcn/sysdep.h b/libinterp/interpfcn/sysdep.h rename from src/interpfcn/sysdep.h rename to libinterp/interpfcn/sysdep.h diff --git a/src/interpfcn/toplev.cc b/libinterp/interpfcn/toplev.cc rename from src/interpfcn/toplev.cc rename to libinterp/interpfcn/toplev.cc --- a/src/interpfcn/toplev.cc +++ b/libinterp/interpfcn/toplev.cc @@ -808,8 +808,8 @@ int cmd_status = cmd->close (); - if (WIFEXITED (cmd_status)) - cmd_status = WEXITSTATUS (cmd_status); + if (octave_wait::ifexited (cmd_status)) + cmd_status = octave_wait::exitstatus (cmd_status); else cmd_status = 127; @@ -988,8 +988,8 @@ // status of the command. Otherwise, return 127 as a // failure code. - if (WIFEXITED (status)) - status = WEXITSTATUS (status); + if (octave_wait::ifexited (status)) + status = octave_wait::exitstatus (status); retval(0) = status; } @@ -1254,6 +1254,7 @@ { false, "CAMD_LDFLAGS", OCTAVE_CONF_CAMD_LDFLAGS }, { false, "CAMD_LIBS", OCTAVE_CONF_CAMD_LIBS }, { false, "CC", OCTAVE_CONF_CC }, + // FIXME: CC_VERSION is deprecated. Remove in version 3.12 { false, "CC_VERSION", OCTAVE_CONF_CC_VERSION }, { false, "CCOLAMD_CPPFLAGS", OCTAVE_CONF_CCOLAMD_CPPFLAGS }, { false, "CCOLAMD_LDFLAGS", OCTAVE_CONF_CCOLAMD_LDFLAGS }, @@ -1277,12 +1278,15 @@ { false, "CXXCPP", OCTAVE_CONF_CXXCPP }, { false, "CXXFLAGS", OCTAVE_CONF_CXXFLAGS }, { false, "CXXPICFLAG", OCTAVE_CONF_CXXPICFLAG }, + // FIXME: CXX_VERSION is deprecated. Remove in version 3.12 { false, "CXX_VERSION", OCTAVE_CONF_CXX_VERSION }, { false, "DEFAULT_PAGER", OCTAVE_DEFAULT_PAGER }, { false, "DEFS", OCTAVE_CONF_DEFS }, { false, "DL_LD", OCTAVE_CONF_DL_LD }, { false, "DL_LDFLAGS", OCTAVE_CONF_DL_LDFLAGS }, { false, "DL_LIBS", OCTAVE_CONF_DL_LIBS }, + { false, "GCC_VERSION", OCTAVE_CONF_GCC_VERSION }, + { false, "GXX_VERSION", OCTAVE_CONF_GXX_VERSION }, { false, "ENABLE_DYNAMIC_LINKING", OCTAVE_CONF_ENABLE_DYNAMIC_LINKING }, { false, "EXEEXT", OCTAVE_CONF_EXEEXT }, { false, "F77", OCTAVE_CONF_F77 }, @@ -1307,7 +1311,6 @@ { false, "HDF5_CPPFLAGS", OCTAVE_CONF_HDF5_CPPFLAGS }, { false, "HDF5_LDFLAGS", OCTAVE_CONF_HDF5_LDFLAGS }, { false, "HDF5_LIBS", OCTAVE_CONF_HDF5_LIBS }, - { false, "INCFLAGS", OCTAVE_CONF_INCFLAGS }, { false, "LAPACK_LIBS", OCTAVE_CONF_LAPACK_LIBS }, { false, "LDFLAGS", OCTAVE_CONF_LDFLAGS }, { false, "LD_CXX", OCTAVE_CONF_LD_CXX }, @@ -1342,6 +1345,8 @@ { false, "QRUPDATE_CPPFLAGS", OCTAVE_CONF_QRUPDATE_CPPFLAGS }, { false, "QRUPDATE_LDFLAGS", OCTAVE_CONF_QRUPDATE_LDFLAGS }, { false, "QRUPDATE_LIBS", OCTAVE_CONF_QRUPDATE_LIBS }, + { false, "QT_INCDIR", OCTAVE_CONF_QT_INCDIR }, + { false, "QT_LIBDIR", OCTAVE_CONF_QT_LIBDIR }, { false, "RANLIB", OCTAVE_CONF_RANLIB }, { false, "RDYNAMIC_FLAG", OCTAVE_CONF_RDYNAMIC_FLAG }, { false, "READLINE_LIBS", OCTAVE_CONF_READLINE_LIBS }, diff --git a/src/interpfcn/toplev.h b/libinterp/interpfcn/toplev.h rename from src/interpfcn/toplev.h rename to libinterp/interpfcn/toplev.h diff --git a/src/interpfcn/utils.cc b/libinterp/interpfcn/utils.cc rename from src/interpfcn/utils.cc rename to libinterp/interpfcn/utils.cc --- a/src/interpfcn/utils.cc +++ b/libinterp/interpfcn/utils.cc @@ -26,11 +26,11 @@ #endif #include -#include #include #include #include +#include #include #include @@ -1266,7 +1266,9 @@ = static_cast (modf (seconds, &t) * 1000000); unsigned int sec - = (t > UINT_MAX) ? UINT_MAX : static_cast (t); + = ((t > std::numeric_limits::max ()) + ? std::numeric_limits::max () + : static_cast (t)); // Versions of these functions that accept unsigned int args are // defined in cutils.c. diff --git a/src/interpfcn/utils.h b/libinterp/interpfcn/utils.h rename from src/interpfcn/utils.h rename to libinterp/interpfcn/utils.h diff --git a/src/interpfcn/variables.cc b/libinterp/interpfcn/variables.cc rename from src/interpfcn/variables.cc rename to libinterp/interpfcn/variables.cc diff --git a/src/interpfcn/variables.h b/libinterp/interpfcn/variables.h rename from src/interpfcn/variables.h rename to libinterp/interpfcn/variables.h --- a/src/interpfcn/variables.h +++ b/libinterp/interpfcn/variables.h @@ -32,11 +32,13 @@ class octave_builtin; class string_vector; -#include #include +#include #include +#include "lo-ieee.h" + #include "ov.h" #include "ov-builtin.h" #include "symtab.h" @@ -97,12 +99,14 @@ extern OCTINTERP_API octave_value set_internal_variable (int& var, const octave_value_list& args, int nargout, const char *nm, - int minval = INT_MIN, int maxval = INT_MAX); + int minval = std::numeric_limits::min (), + int maxval = std::numeric_limits::max ()); extern OCTINTERP_API octave_value set_internal_variable (double& var, const octave_value_list& args, int nargout, const char *nm, - double minval = DBL_MIN, double maxval = DBL_MAX); + double minval = -octave_Inf, + double maxval = octave_Inf); extern OCTINTERP_API octave_value set_internal_variable (std::string& var, const octave_value_list& args, diff --git a/src/link-deps.mk b/libinterp/link-deps.mk rename from src/link-deps.mk rename to libinterp/link-deps.mk --- a/src/link-deps.mk +++ b/libinterp/link-deps.mk @@ -1,4 +1,4 @@ -include ../liboctave/link-deps.mk +include $(top_srcdir)/liboctave/link-deps.mk if AMCOND_ENABLE_DYNAMIC_LINKING LIBOCTINTERP_LINK_DEPS = diff --git a/src/mk-errno-list b/libinterp/mk-errno-list rename from src/mk-errno-list rename to libinterp/mk-errno-list diff --git a/src/mk-pkg-add b/libinterp/mk-pkg-add rename from src/mk-pkg-add rename to libinterp/mk-pkg-add diff --git a/src/mkbuiltins b/libinterp/mkbuiltins rename from src/mkbuiltins rename to libinterp/mkbuiltins diff --git a/src/mkdefs b/libinterp/mkdefs rename from src/mkdefs rename to libinterp/mkdefs diff --git a/src/mkdocs b/libinterp/mkdocs rename from src/mkdocs rename to libinterp/mkdocs diff --git a/src/mkops b/libinterp/mkops rename from src/mkops rename to libinterp/mkops diff --git a/src/oct-conf.in.h b/libinterp/oct-conf.in.h rename from src/oct-conf.in.h rename to libinterp/oct-conf.in.h --- a/src/oct-conf.in.h +++ b/libinterp/oct-conf.in.h @@ -96,6 +96,7 @@ #define OCTAVE_CONF_CC %OCTAVE_CONF_CC% #endif +// FIXME: OCTAVE_CONF_CCC_VERSION is deprecated. Remove in version 3.12 #ifndef OCTAVE_CONF_CC_VERSION #define OCTAVE_CONF_CC_VERSION %OCTAVE_CONF_CC_VERSION% #endif @@ -188,6 +189,7 @@ #define OCTAVE_CONF_CXX %OCTAVE_CONF_CXX% #endif +// FIXME: OCTAVE_CONF_CXX_VERSION is deprecated. Remove in version 3.12 #ifndef OCTAVE_CONF_CXX_VERSION #define OCTAVE_CONF_CXX_VERSION %OCTAVE_CONF_CXX_VERSION% #endif @@ -212,6 +214,14 @@ #define OCTAVE_CONF_DL_LIBS %OCTAVE_CONF_DL_LIBS% #endif +#ifndef OCTAVE_CONF_GCC_VERSION +#define OCTAVE_CONF_GCC_VERSION %OCTAVE_CONF_GCC_VERSION% +#endif + +#ifndef OCTAVE_CONF_GXX_VERSION +#define OCTAVE_CONF_GXX_VERSION %OCTAVE_CONF_GXX_VERSION% +#endif + #ifndef OCTAVE_CONF_EXEEXT #define OCTAVE_CONF_EXEEXT %OCTAVE_CONF_EXEEXT% #endif @@ -464,6 +474,14 @@ #define OCTAVE_CONF_QRUPDATE_LIBS %OCTAVE_CONF_QRUPDATE_LIBS% #endif +#ifndef OCTAVE_CONF_QT_INCDIR +#define OCTAVE_CONF_QT_INCDIR %OCTAVE_CONF_QT_INCDIR% +#endif + +#ifndef OCTAVE_CONF_QT_LIBDIR +#define OCTAVE_CONF_QT_LIBDIR %OCTAVE_CONF_QT_LIBDIR% +#endif + #ifndef OCTAVE_CONF_RANLIB #define OCTAVE_CONF_RANLIB %OCTAVE_CONF_RANLIB% #endif diff --git a/src/octave-value/module.mk b/libinterp/octave-value/module.mk rename from src/octave-value/module.mk rename to libinterp/octave-value/module.mk diff --git a/src/octave-value/ov-base-diag.cc b/libinterp/octave-value/ov-base-diag.cc rename from src/octave-value/ov-base-diag.cc rename to libinterp/octave-value/ov-base-diag.cc --- a/src/octave-value/ov-base-diag.cc +++ b/libinterp/octave-value/ov-base-diag.cc @@ -29,6 +29,7 @@ #include "mach-info.h" #include "lo-ieee.h" +#include "mxarray.h" #include "ov-base.h" #include "ov-base-mat.h" #include "pr-output.h" diff --git a/src/octave-value/ov-base-diag.h b/libinterp/octave-value/ov-base-diag.h rename from src/octave-value/ov-base-diag.h rename to libinterp/octave-value/ov-base-diag.h diff --git a/src/octave-value/ov-base-int.cc b/libinterp/octave-value/ov-base-int.cc rename from src/octave-value/ov-base-int.cc rename to libinterp/octave-value/ov-base-int.cc --- a/src/octave-value/ov-base-int.cc +++ b/libinterp/octave-value/ov-base-int.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include #include "lo-ieee.h" @@ -65,7 +64,10 @@ struct octave_base_int_helper { static bool - char_value_out_of_range (T val) { return val < 0 || val > UCHAR_MAX; } + char_value_out_of_range (T val) + { + return val < 0 || val > std::numeric_limits::max (); + } }; template @@ -77,7 +79,10 @@ template struct octave_base_int_helper { - static bool char_value_out_of_range (T val) { return val > UCHAR_MAX; } + static bool char_value_out_of_range (T val) + { + return val > std::numeric_limits::max (); + } }; template diff --git a/src/octave-value/ov-base-int.h b/libinterp/octave-value/ov-base-int.h rename from src/octave-value/ov-base-int.h rename to libinterp/octave-value/ov-base-int.h diff --git a/src/octave-value/ov-base-mat.cc b/libinterp/octave-value/ov-base-mat.cc rename from src/octave-value/ov-base-mat.cc rename to libinterp/octave-value/ov-base-mat.cc diff --git a/src/octave-value/ov-base-mat.h b/libinterp/octave-value/ov-base-mat.h rename from src/octave-value/ov-base-mat.h rename to libinterp/octave-value/ov-base-mat.h diff --git a/src/octave-value/ov-base-scalar.cc b/libinterp/octave-value/ov-base-scalar.cc rename from src/octave-value/ov-base-scalar.cc rename to libinterp/octave-value/ov-base-scalar.cc diff --git a/src/octave-value/ov-base-scalar.h b/libinterp/octave-value/ov-base-scalar.h rename from src/octave-value/ov-base-scalar.h rename to libinterp/octave-value/ov-base-scalar.h diff --git a/src/octave-value/ov-base-sparse.cc b/libinterp/octave-value/ov-base-sparse.cc rename from src/octave-value/ov-base-sparse.cc rename to libinterp/octave-value/ov-base-sparse.cc diff --git a/src/octave-value/ov-base-sparse.h b/libinterp/octave-value/ov-base-sparse.h rename from src/octave-value/ov-base-sparse.h rename to libinterp/octave-value/ov-base-sparse.h diff --git a/src/octave-value/ov-base.cc b/libinterp/octave-value/ov-base.cc rename from src/octave-value/ov-base.cc rename to libinterp/octave-value/ov-base.cc --- a/src/octave-value/ov-base.cc +++ b/libinterp/octave-value/ov-base.cc @@ -25,15 +25,15 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-mappers.h" #include "defun.h" #include "gripes.h" +#include "mxarray.h" #include "oct-map.h" #include "oct-obj.h" #include "oct-lvalue.h" @@ -449,7 +449,7 @@ os << "no info for type: " << type_name () << "\n"; } -#define INT_CONV_METHOD(T, F, MIN_LIMIT, MAX_LIMIT) \ +#define INT_CONV_METHOD(T, F) \ T \ octave_base_value::F ## _value (bool require_int, bool frc_str_conv) const \ { \ @@ -461,10 +461,10 @@ { \ if (require_int && D_NINT (d) != d) \ error_with_cfn ("conversion of %g to " #T " value failed", d); \ - else if (d < MIN_LIMIT) \ - retval = MIN_LIMIT; \ - else if (d > MAX_LIMIT) \ - retval = MAX_LIMIT; \ + else if (d < std::numeric_limits::min ()) \ + retval = std::numeric_limits::min (); \ + else if (d > std::numeric_limits::max ()) \ + retval = std::numeric_limits::max (); \ else \ retval = static_cast (::fix (d)); \ } \ @@ -475,14 +475,14 @@ return retval; \ } -INT_CONV_METHOD (short int, short, SHRT_MIN, SHRT_MAX) -INT_CONV_METHOD (unsigned short int, ushort, 0, USHRT_MAX) +INT_CONV_METHOD (short int, short) +INT_CONV_METHOD (unsigned short int, ushort) -INT_CONV_METHOD (int, int, INT_MIN, INT_MAX) -INT_CONV_METHOD (unsigned int, uint, 0, UINT_MAX) +INT_CONV_METHOD (int, int) +INT_CONV_METHOD (unsigned int, uint) -INT_CONV_METHOD (long int, long, LONG_MIN, LONG_MAX) -INT_CONV_METHOD (unsigned long int, ulong, 0, ULONG_MAX) +INT_CONV_METHOD (long int, long) +INT_CONV_METHOD (unsigned long int, ulong) int octave_base_value::nint_value (bool frc_str_conv) const diff --git a/src/octave-value/ov-base.h b/libinterp/octave-value/ov-base.h rename from src/octave-value/ov-base.h rename to libinterp/octave-value/ov-base.h --- a/src/octave-value/ov-base.h +++ b/libinterp/octave-value/ov-base.h @@ -32,7 +32,6 @@ #include "Range.h" #include "data-conv.h" -#include "mxarray.h" #include "mx-base.h" #include "str-vec.h" @@ -40,6 +39,7 @@ #include "oct-hdf5.h" class Cell; +class mxArray; class octave_map; class octave_scalar_map; class octave_value; @@ -341,8 +341,6 @@ virtual bool is_real_matrix (void) const { return false; } - virtual bool is_real_nd_array (void) const { return false; } - virtual bool is_complex_scalar (void) const { return false; } virtual bool is_complex_matrix (void) const { return false; } diff --git a/src/octave-value/ov-bool-mat.cc b/libinterp/octave-value/ov-bool-mat.cc rename from src/octave-value/ov-bool-mat.cc rename to libinterp/octave-value/ov-bool-mat.cc --- a/src/octave-value/ov-bool-mat.cc +++ b/libinterp/octave-value/ov-bool-mat.cc @@ -34,6 +34,7 @@ #include "defun.h" #include "gripes.h" +#include "mxarray.h" #include "oct-obj.h" #include "ops.h" #include "ov-base.h" diff --git a/src/octave-value/ov-bool-mat.h b/libinterp/octave-value/ov-bool-mat.h rename from src/octave-value/ov-bool-mat.h rename to libinterp/octave-value/ov-bool-mat.h diff --git a/src/octave-value/ov-bool-sparse.cc b/libinterp/octave-value/ov-bool-sparse.cc rename from src/octave-value/ov-bool-sparse.cc rename to libinterp/octave-value/ov-bool-sparse.cc --- a/src/octave-value/ov-bool-sparse.cc +++ b/libinterp/octave-value/ov-bool-sparse.cc @@ -25,11 +25,13 @@ #include #endif -#include - #include +#include #include +#include "dim-vector.h" + +#include "mxarray.h" #include "ov-base.h" #include "ov-scalar.h" #include "ov-bool.h" diff --git a/src/octave-value/ov-bool-sparse.h b/libinterp/octave-value/ov-bool-sparse.h rename from src/octave-value/ov-bool-sparse.h rename to libinterp/octave-value/ov-bool-sparse.h diff --git a/src/octave-value/ov-bool.cc b/libinterp/octave-value/ov-bool.cc rename from src/octave-value/ov-bool.cc rename to libinterp/octave-value/ov-bool.cc --- a/src/octave-value/ov-bool.cc +++ b/libinterp/octave-value/ov-bool.cc @@ -29,6 +29,7 @@ #include "mx-base.h" #include "gripes.h" +#include "mxarray.h" #include "oct-obj.h" #include "ops.h" #include "ov-bool.h" diff --git a/src/octave-value/ov-bool.h b/libinterp/octave-value/ov-bool.h rename from src/octave-value/ov-bool.h rename to libinterp/octave-value/ov-bool.h diff --git a/src/octave-value/ov-builtin.cc b/libinterp/octave-value/ov-builtin.cc rename from src/octave-value/ov-builtin.cc rename to libinterp/octave-value/ov-builtin.cc diff --git a/src/octave-value/ov-builtin.h b/libinterp/octave-value/ov-builtin.h rename from src/octave-value/ov-builtin.h rename to libinterp/octave-value/ov-builtin.h diff --git a/src/octave-value/ov-cell.cc b/libinterp/octave-value/ov-cell.cc rename from src/octave-value/ov-cell.cc rename to libinterp/octave-value/ov-cell.cc --- a/src/octave-value/ov-cell.cc +++ b/libinterp/octave-value/ov-cell.cc @@ -39,6 +39,7 @@ #include "defun.h" #include "error.h" +#include "mxarray.h" #include "ov-cell.h" #include "oct-obj.h" #include "unwind-prot.h" diff --git a/src/octave-value/ov-cell.h b/libinterp/octave-value/ov-cell.h rename from src/octave-value/ov-cell.h rename to libinterp/octave-value/ov-cell.h diff --git a/src/octave-value/ov-ch-mat.cc b/libinterp/octave-value/ov-ch-mat.cc rename from src/octave-value/ov-ch-mat.cc rename to libinterp/octave-value/ov-ch-mat.cc --- a/src/octave-value/ov-ch-mat.cc +++ b/libinterp/octave-value/ov-ch-mat.cc @@ -31,6 +31,7 @@ #include "lo-ieee.h" #include "mx-base.h" +#include "mxarray.h" #include "ov-base.h" #include "ov-base-mat.h" #include "ov-base-mat.cc" diff --git a/src/octave-value/ov-ch-mat.h b/libinterp/octave-value/ov-ch-mat.h rename from src/octave-value/ov-ch-mat.h rename to libinterp/octave-value/ov-ch-mat.h diff --git a/src/octave-value/ov-class.cc b/libinterp/octave-value/ov-class.cc rename from src/octave-value/ov-class.cc rename to libinterp/octave-value/ov-class.cc --- a/src/octave-value/ov-class.cc +++ b/libinterp/octave-value/ov-class.cc @@ -42,6 +42,7 @@ #include "ls-oct-ascii.h" #include "ls-oct-binary.h" #include "ls-utils.h" +#include "mxarray.h" #include "oct-lvalue.h" #include "ov-class.h" #include "ov-fcn.h" diff --git a/src/octave-value/ov-class.h b/libinterp/octave-value/ov-class.h rename from src/octave-value/ov-class.h rename to libinterp/octave-value/ov-class.h diff --git a/src/octave-value/ov-colon.cc b/libinterp/octave-value/ov-colon.cc rename from src/octave-value/ov-colon.cc rename to libinterp/octave-value/ov-colon.cc diff --git a/src/octave-value/ov-colon.h b/libinterp/octave-value/ov-colon.h rename from src/octave-value/ov-colon.h rename to libinterp/octave-value/ov-colon.h diff --git a/src/octave-value/ov-complex.cc b/libinterp/octave-value/ov-complex.cc rename from src/octave-value/ov-complex.cc rename to libinterp/octave-value/ov-complex.cc --- a/src/octave-value/ov-complex.cc +++ b/libinterp/octave-value/ov-complex.cc @@ -30,6 +30,7 @@ #include "lo-specfun.h" #include "lo-mappers.h" +#include "mxarray.h" #include "oct-obj.h" #include "oct-stream.h" #include "ops.h" diff --git a/src/octave-value/ov-complex.h b/libinterp/octave-value/ov-complex.h rename from src/octave-value/ov-complex.h rename to libinterp/octave-value/ov-complex.h diff --git a/src/octave-value/ov-cs-list.cc b/libinterp/octave-value/ov-cs-list.cc rename from src/octave-value/ov-cs-list.cc rename to libinterp/octave-value/ov-cs-list.cc diff --git a/src/octave-value/ov-cs-list.h b/libinterp/octave-value/ov-cs-list.h rename from src/octave-value/ov-cs-list.h rename to libinterp/octave-value/ov-cs-list.h diff --git a/src/octave-value/ov-cx-diag.cc b/libinterp/octave-value/ov-cx-diag.cc rename from src/octave-value/ov-cx-diag.cc rename to libinterp/octave-value/ov-cx-diag.cc diff --git a/src/octave-value/ov-cx-diag.h b/libinterp/octave-value/ov-cx-diag.h rename from src/octave-value/ov-cx-diag.h rename to libinterp/octave-value/ov-cx-diag.h diff --git a/src/octave-value/ov-cx-mat.cc b/libinterp/octave-value/ov-cx-mat.cc rename from src/octave-value/ov-cx-mat.cc rename to libinterp/octave-value/ov-cx-mat.cc --- a/src/octave-value/ov-cx-mat.cc +++ b/libinterp/octave-value/ov-cx-mat.cc @@ -37,6 +37,7 @@ #include "oct-locbuf.h" #include "gripes.h" +#include "mxarray.h" #include "oct-obj.h" #include "oct-stream.h" #include "ops.h" diff --git a/src/octave-value/ov-cx-mat.h b/libinterp/octave-value/ov-cx-mat.h rename from src/octave-value/ov-cx-mat.h rename to libinterp/octave-value/ov-cx-mat.h diff --git a/src/octave-value/ov-cx-sparse.cc b/libinterp/octave-value/ov-cx-sparse.cc rename from src/octave-value/ov-cx-sparse.cc rename to libinterp/octave-value/ov-cx-sparse.cc --- a/src/octave-value/ov-cx-sparse.cc +++ b/libinterp/octave-value/ov-cx-sparse.cc @@ -25,15 +25,15 @@ #include #endif -#include - #include +#include #include #include "lo-specfun.h" #include "lo-mappers.h" #include "oct-locbuf.h" +#include "mxarray.h" #include "ov-base.h" #include "ov-scalar.h" #include "ov-complex.h" diff --git a/src/octave-value/ov-cx-sparse.h b/libinterp/octave-value/ov-cx-sparse.h rename from src/octave-value/ov-cx-sparse.h rename to libinterp/octave-value/ov-cx-sparse.h diff --git a/src/octave-value/ov-dld-fcn.cc b/libinterp/octave-value/ov-dld-fcn.cc rename from src/octave-value/ov-dld-fcn.cc rename to libinterp/octave-value/ov-dld-fcn.cc diff --git a/src/octave-value/ov-dld-fcn.h b/libinterp/octave-value/ov-dld-fcn.h rename from src/octave-value/ov-dld-fcn.h rename to libinterp/octave-value/ov-dld-fcn.h diff --git a/src/octave-value/ov-fcn-handle.cc b/libinterp/octave-value/ov-fcn-handle.cc rename from src/octave-value/ov-fcn-handle.cc rename to libinterp/octave-value/ov-fcn-handle.cc diff --git a/src/octave-value/ov-fcn-handle.h b/libinterp/octave-value/ov-fcn-handle.h rename from src/octave-value/ov-fcn-handle.h rename to libinterp/octave-value/ov-fcn-handle.h diff --git a/src/octave-value/ov-fcn-inline.cc b/libinterp/octave-value/ov-fcn-inline.cc rename from src/octave-value/ov-fcn-inline.cc rename to libinterp/octave-value/ov-fcn-inline.cc diff --git a/src/octave-value/ov-fcn-inline.h b/libinterp/octave-value/ov-fcn-inline.h rename from src/octave-value/ov-fcn-inline.h rename to libinterp/octave-value/ov-fcn-inline.h diff --git a/src/octave-value/ov-fcn.cc b/libinterp/octave-value/ov-fcn.cc rename from src/octave-value/ov-fcn.cc rename to libinterp/octave-value/ov-fcn.cc diff --git a/src/octave-value/ov-fcn.h b/libinterp/octave-value/ov-fcn.h rename from src/octave-value/ov-fcn.h rename to libinterp/octave-value/ov-fcn.h diff --git a/src/octave-value/ov-float.cc b/libinterp/octave-value/ov-float.cc rename from src/octave-value/ov-float.cc rename to libinterp/octave-value/ov-float.cc --- a/src/octave-value/ov-float.cc +++ b/libinterp/octave-value/ov-float.cc @@ -33,6 +33,7 @@ #include "defun.h" #include "gripes.h" +#include "mxarray.h" #include "oct-obj.h" #include "oct-stream.h" #include "ov-scalar.h" @@ -114,7 +115,7 @@ { int ival = NINT (scalar); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits::max ()) { // FIXME -- is there something better we could do? diff --git a/src/octave-value/ov-float.h b/libinterp/octave-value/ov-float.h rename from src/octave-value/ov-float.h rename to libinterp/octave-value/ov-float.h diff --git a/src/octave-value/ov-flt-complex.cc b/libinterp/octave-value/ov-flt-complex.cc rename from src/octave-value/ov-flt-complex.cc rename to libinterp/octave-value/ov-flt-complex.cc --- a/src/octave-value/ov-flt-complex.cc +++ b/libinterp/octave-value/ov-flt-complex.cc @@ -30,6 +30,7 @@ #include "lo-specfun.h" #include "lo-mappers.h" +#include "mxarray.h" #include "oct-obj.h" #include "oct-stream.h" #include "ops.h" diff --git a/src/octave-value/ov-flt-complex.h b/libinterp/octave-value/ov-flt-complex.h rename from src/octave-value/ov-flt-complex.h rename to libinterp/octave-value/ov-flt-complex.h diff --git a/src/octave-value/ov-flt-cx-diag.cc b/libinterp/octave-value/ov-flt-cx-diag.cc rename from src/octave-value/ov-flt-cx-diag.cc rename to libinterp/octave-value/ov-flt-cx-diag.cc diff --git a/src/octave-value/ov-flt-cx-diag.h b/libinterp/octave-value/ov-flt-cx-diag.h rename from src/octave-value/ov-flt-cx-diag.h rename to libinterp/octave-value/ov-flt-cx-diag.h diff --git a/src/octave-value/ov-flt-cx-mat.cc b/libinterp/octave-value/ov-flt-cx-mat.cc rename from src/octave-value/ov-flt-cx-mat.cc rename to libinterp/octave-value/ov-flt-cx-mat.cc --- a/src/octave-value/ov-flt-cx-mat.cc +++ b/libinterp/octave-value/ov-flt-cx-mat.cc @@ -37,6 +37,7 @@ #include "oct-locbuf.h" #include "gripes.h" +#include "mxarray.h" #include "oct-obj.h" #include "oct-stream.h" #include "ops.h" diff --git a/src/octave-value/ov-flt-cx-mat.h b/libinterp/octave-value/ov-flt-cx-mat.h rename from src/octave-value/ov-flt-cx-mat.h rename to libinterp/octave-value/ov-flt-cx-mat.h diff --git a/src/octave-value/ov-flt-re-diag.cc b/libinterp/octave-value/ov-flt-re-diag.cc rename from src/octave-value/ov-flt-re-diag.cc rename to libinterp/octave-value/ov-flt-re-diag.cc diff --git a/src/octave-value/ov-flt-re-diag.h b/libinterp/octave-value/ov-flt-re-diag.h rename from src/octave-value/ov-flt-re-diag.h rename to libinterp/octave-value/ov-flt-re-diag.h diff --git a/src/octave-value/ov-flt-re-mat.cc b/libinterp/octave-value/ov-flt-re-mat.cc rename from src/octave-value/ov-flt-re-mat.cc rename to libinterp/octave-value/ov-flt-re-mat.cc --- a/src/octave-value/ov-flt-re-mat.cc +++ b/libinterp/octave-value/ov-flt-re-mat.cc @@ -25,9 +25,8 @@ #include #endif -#include - #include +#include #include #include "data-conv.h" @@ -42,6 +41,7 @@ #include "defun.h" #include "gripes.h" +#include "mxarray.h" #include "oct-obj.h" #include "oct-lvalue.h" #include "oct-stream.h" @@ -68,10 +68,6 @@ #include "ls-utils.h" #include "ls-hdf5.h" -#if ! defined (UCHAR_MAX) -#define UCHAR_MAX 255 -#endif - template class octave_base_matrix; DEFINE_OCTAVE_ALLOCATOR (octave_float_matrix); @@ -307,7 +303,7 @@ { int ival = NINT (d); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits::max ()) { // FIXME -- is there something // better we could do? diff --git a/src/octave-value/ov-flt-re-mat.h b/libinterp/octave-value/ov-flt-re-mat.h rename from src/octave-value/ov-flt-re-mat.h rename to libinterp/octave-value/ov-flt-re-mat.h diff --git a/src/octave-value/ov-int-traits.h b/libinterp/octave-value/ov-int-traits.h rename from src/octave-value/ov-int-traits.h rename to libinterp/octave-value/ov-int-traits.h diff --git a/src/octave-value/ov-int16.cc b/libinterp/octave-value/ov-int16.cc rename from src/octave-value/ov-int16.cc rename to libinterp/octave-value/ov-int16.cc --- a/src/octave-value/ov-int16.cc +++ b/libinterp/octave-value/ov-int16.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff --git a/src/octave-value/ov-int16.h b/libinterp/octave-value/ov-int16.h rename from src/octave-value/ov-int16.h rename to libinterp/octave-value/ov-int16.h diff --git a/src/octave-value/ov-int32.cc b/libinterp/octave-value/ov-int32.cc rename from src/octave-value/ov-int32.cc rename to libinterp/octave-value/ov-int32.cc --- a/src/octave-value/ov-int32.cc +++ b/libinterp/octave-value/ov-int32.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff --git a/src/octave-value/ov-int32.h b/libinterp/octave-value/ov-int32.h rename from src/octave-value/ov-int32.h rename to libinterp/octave-value/ov-int32.h diff --git a/src/octave-value/ov-int64.cc b/libinterp/octave-value/ov-int64.cc rename from src/octave-value/ov-int64.cc rename to libinterp/octave-value/ov-int64.cc --- a/src/octave-value/ov-int64.cc +++ b/libinterp/octave-value/ov-int64.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff --git a/src/octave-value/ov-int64.h b/libinterp/octave-value/ov-int64.h rename from src/octave-value/ov-int64.h rename to libinterp/octave-value/ov-int64.h diff --git a/src/octave-value/ov-int8.cc b/libinterp/octave-value/ov-int8.cc rename from src/octave-value/ov-int8.cc rename to libinterp/octave-value/ov-int8.cc --- a/src/octave-value/ov-int8.cc +++ b/libinterp/octave-value/ov-int8.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff --git a/src/octave-value/ov-int8.h b/libinterp/octave-value/ov-int8.h rename from src/octave-value/ov-int8.h rename to libinterp/octave-value/ov-int8.h diff --git a/src/octave-value/ov-intx.h b/libinterp/octave-value/ov-intx.h rename from src/octave-value/ov-intx.h rename to libinterp/octave-value/ov-intx.h --- a/src/octave-value/ov-intx.h +++ b/libinterp/octave-value/ov-intx.h @@ -31,6 +31,7 @@ #include "str-vec.h" #include "error.h" +#include "mxarray.h" #include "oct-stream.h" #include "ov-base.h" #include "ov-base-int.h" diff --git a/src/octave-value/ov-lazy-idx.cc b/libinterp/octave-value/ov-lazy-idx.cc rename from src/octave-value/ov-lazy-idx.cc rename to libinterp/octave-value/ov-lazy-idx.cc diff --git a/src/octave-value/ov-lazy-idx.h b/libinterp/octave-value/ov-lazy-idx.h rename from src/octave-value/ov-lazy-idx.h rename to libinterp/octave-value/ov-lazy-idx.h diff --git a/src/octave-value/ov-mex-fcn.cc b/libinterp/octave-value/ov-mex-fcn.cc rename from src/octave-value/ov-mex-fcn.cc rename to libinterp/octave-value/ov-mex-fcn.cc diff --git a/src/octave-value/ov-mex-fcn.h b/libinterp/octave-value/ov-mex-fcn.h rename from src/octave-value/ov-mex-fcn.h rename to libinterp/octave-value/ov-mex-fcn.h diff --git a/src/octave-value/ov-null-mat.cc b/libinterp/octave-value/ov-null-mat.cc rename from src/octave-value/ov-null-mat.cc rename to libinterp/octave-value/ov-null-mat.cc diff --git a/src/octave-value/ov-null-mat.h b/libinterp/octave-value/ov-null-mat.h rename from src/octave-value/ov-null-mat.h rename to libinterp/octave-value/ov-null-mat.h diff --git a/src/octave-value/ov-oncleanup.cc b/libinterp/octave-value/ov-oncleanup.cc rename from src/octave-value/ov-oncleanup.cc rename to libinterp/octave-value/ov-oncleanup.cc diff --git a/src/octave-value/ov-oncleanup.h b/libinterp/octave-value/ov-oncleanup.h rename from src/octave-value/ov-oncleanup.h rename to libinterp/octave-value/ov-oncleanup.h diff --git a/src/octave-value/ov-perm.cc b/libinterp/octave-value/ov-perm.cc rename from src/octave-value/ov-perm.cc rename to libinterp/octave-value/ov-perm.cc --- a/src/octave-value/ov-perm.cc +++ b/libinterp/octave-value/ov-perm.cc @@ -25,7 +25,9 @@ #endif #include "byte-swap.h" +#include "dim-vector.h" +#include "mxarray.h" #include "ov-perm.h" #include "ov-re-mat.h" #include "ov-scalar.h" diff --git a/src/octave-value/ov-perm.h b/libinterp/octave-value/ov-perm.h rename from src/octave-value/ov-perm.h rename to libinterp/octave-value/ov-perm.h diff --git a/src/octave-value/ov-range.cc b/libinterp/octave-value/ov-range.cc rename from src/octave-value/ov-range.cc rename to libinterp/octave-value/ov-range.cc --- a/src/octave-value/ov-range.cc +++ b/libinterp/octave-value/ov-range.cc @@ -32,6 +32,7 @@ #include "defun.h" #include "variables.h" #include "gripes.h" +#include "mxarray.h" #include "ops.h" #include "oct-obj.h" #include "ov-range.h" diff --git a/src/octave-value/ov-range.h b/libinterp/octave-value/ov-range.h rename from src/octave-value/ov-range.h rename to libinterp/octave-value/ov-range.h diff --git a/src/octave-value/ov-re-diag.cc b/libinterp/octave-value/ov-re-diag.cc rename from src/octave-value/ov-re-diag.cc rename to libinterp/octave-value/ov-re-diag.cc diff --git a/src/octave-value/ov-re-diag.h b/libinterp/octave-value/ov-re-diag.h rename from src/octave-value/ov-re-diag.h rename to libinterp/octave-value/ov-re-diag.h diff --git a/src/octave-value/ov-re-mat.cc b/libinterp/octave-value/ov-re-mat.cc rename from src/octave-value/ov-re-mat.cc rename to libinterp/octave-value/ov-re-mat.cc --- a/src/octave-value/ov-re-mat.cc +++ b/libinterp/octave-value/ov-re-mat.cc @@ -25,9 +25,8 @@ #include #endif -#include - #include +#include #include #include "data-conv.h" @@ -42,6 +41,7 @@ #include "defun.h" #include "gripes.h" +#include "mxarray.h" #include "oct-obj.h" #include "oct-lvalue.h" #include "oct-stream.h" @@ -68,10 +68,6 @@ #include "ls-utils.h" #include "ls-hdf5.h" -#if ! defined (UCHAR_MAX) -#define UCHAR_MAX 255 -#endif - template class octave_base_matrix; DEFINE_OCTAVE_ALLOCATOR (octave_matrix); @@ -409,7 +405,7 @@ { int ival = NINT (d); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits::max ()) { // FIXME -- is there something // better we could do? diff --git a/src/octave-value/ov-re-mat.h b/libinterp/octave-value/ov-re-mat.h rename from src/octave-value/ov-re-mat.h rename to libinterp/octave-value/ov-re-mat.h diff --git a/src/octave-value/ov-re-sparse.cc b/libinterp/octave-value/ov-re-sparse.cc rename from src/octave-value/ov-re-sparse.cc rename to libinterp/octave-value/ov-re-sparse.cc --- a/src/octave-value/ov-re-sparse.cc +++ b/libinterp/octave-value/ov-re-sparse.cc @@ -25,15 +25,15 @@ #include #endif -#include - #include +#include #include #include "lo-specfun.h" #include "lo-mappers.h" #include "oct-locbuf.h" +#include "mxarray.h" #include "ov-base.h" #include "ov-scalar.h" #include "gripes.h" @@ -232,7 +232,7 @@ { int ival = NINT (d); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits::max ()) { // FIXME -- is there something // better we could do? diff --git a/src/octave-value/ov-re-sparse.h b/libinterp/octave-value/ov-re-sparse.h rename from src/octave-value/ov-re-sparse.h rename to libinterp/octave-value/ov-re-sparse.h diff --git a/src/octave-value/ov-scalar.cc b/libinterp/octave-value/ov-scalar.cc rename from src/octave-value/ov-scalar.cc rename to libinterp/octave-value/ov-scalar.cc --- a/src/octave-value/ov-scalar.cc +++ b/libinterp/octave-value/ov-scalar.cc @@ -33,6 +33,7 @@ #include "defun.h" #include "gripes.h" +#include "mxarray.h" #include "oct-obj.h" #include "oct-stream.h" #include "ov-scalar.h" @@ -129,7 +130,7 @@ { int ival = NINT (scalar); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits::max ()) { // FIXME -- is there something better we could do? diff --git a/src/octave-value/ov-scalar.h b/libinterp/octave-value/ov-scalar.h rename from src/octave-value/ov-scalar.h rename to libinterp/octave-value/ov-scalar.h diff --git a/src/octave-value/ov-str-mat.cc b/libinterp/octave-value/ov-str-mat.cc rename from src/octave-value/ov-str-mat.cc rename to libinterp/octave-value/ov-str-mat.cc diff --git a/src/octave-value/ov-str-mat.h b/libinterp/octave-value/ov-str-mat.h rename from src/octave-value/ov-str-mat.h rename to libinterp/octave-value/ov-str-mat.h diff --git a/src/octave-value/ov-struct.cc b/libinterp/octave-value/ov-struct.cc rename from src/octave-value/ov-struct.cc rename to libinterp/octave-value/ov-struct.cc --- a/src/octave-value/ov-struct.cc +++ b/libinterp/octave-value/ov-struct.cc @@ -30,6 +30,7 @@ #include "defun.h" #include "error.h" #include "gripes.h" +#include "mxarray.h" #include "oct-lvalue.h" #include "ov-struct.h" #include "unwind-prot.h" @@ -2211,8 +2212,8 @@ variable value is restored when exiting the function.\n\ @end deftypefn") { - return SET_INTERNAL_VARIABLE_WITH_LIMITS (struct_levels_to_print, - -1, INT_MAX); + return SET_INTERNAL_VARIABLE_WITH_LIMITS (struct_levels_to_print, -1, + std::numeric_limits::max ()); } DEFUN (print_struct_array_contents, args, nargout, diff --git a/src/octave-value/ov-struct.h b/libinterp/octave-value/ov-struct.h rename from src/octave-value/ov-struct.h rename to libinterp/octave-value/ov-struct.h diff --git a/src/octave-value/ov-type-conv.h b/libinterp/octave-value/ov-type-conv.h rename from src/octave-value/ov-type-conv.h rename to libinterp/octave-value/ov-type-conv.h diff --git a/src/octave-value/ov-typeinfo.cc b/libinterp/octave-value/ov-typeinfo.cc rename from src/octave-value/ov-typeinfo.cc rename to libinterp/octave-value/ov-typeinfo.cc diff --git a/src/octave-value/ov-typeinfo.h b/libinterp/octave-value/ov-typeinfo.h rename from src/octave-value/ov-typeinfo.h rename to libinterp/octave-value/ov-typeinfo.h diff --git a/src/octave-value/ov-uint16.cc b/libinterp/octave-value/ov-uint16.cc rename from src/octave-value/ov-uint16.cc rename to libinterp/octave-value/ov-uint16.cc --- a/src/octave-value/ov-uint16.cc +++ b/libinterp/octave-value/ov-uint16.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff --git a/src/octave-value/ov-uint16.h b/libinterp/octave-value/ov-uint16.h rename from src/octave-value/ov-uint16.h rename to libinterp/octave-value/ov-uint16.h diff --git a/src/octave-value/ov-uint32.cc b/libinterp/octave-value/ov-uint32.cc rename from src/octave-value/ov-uint32.cc rename to libinterp/octave-value/ov-uint32.cc --- a/src/octave-value/ov-uint32.cc +++ b/libinterp/octave-value/ov-uint32.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff --git a/src/octave-value/ov-uint32.h b/libinterp/octave-value/ov-uint32.h rename from src/octave-value/ov-uint32.h rename to libinterp/octave-value/ov-uint32.h diff --git a/src/octave-value/ov-uint64.cc b/libinterp/octave-value/ov-uint64.cc rename from src/octave-value/ov-uint64.cc rename to libinterp/octave-value/ov-uint64.cc --- a/src/octave-value/ov-uint64.cc +++ b/libinterp/octave-value/ov-uint64.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff --git a/src/octave-value/ov-uint64.h b/libinterp/octave-value/ov-uint64.h rename from src/octave-value/ov-uint64.h rename to libinterp/octave-value/ov-uint64.h diff --git a/src/octave-value/ov-uint8.cc b/libinterp/octave-value/ov-uint8.cc rename from src/octave-value/ov-uint8.cc rename to libinterp/octave-value/ov-uint8.cc --- a/src/octave-value/ov-uint8.cc +++ b/libinterp/octave-value/ov-uint8.cc @@ -24,9 +24,8 @@ #include #endif -#include - #include +#include #include "lo-ieee.h" #include "lo-utils.h" diff --git a/src/octave-value/ov-uint8.h b/libinterp/octave-value/ov-uint8.h rename from src/octave-value/ov-uint8.h rename to libinterp/octave-value/ov-uint8.h diff --git a/src/octave-value/ov-usr-fcn.cc b/libinterp/octave-value/ov-usr-fcn.cc rename from src/octave-value/ov-usr-fcn.cc rename to libinterp/octave-value/ov-usr-fcn.cc diff --git a/src/octave-value/ov-usr-fcn.h b/libinterp/octave-value/ov-usr-fcn.h rename from src/octave-value/ov-usr-fcn.h rename to libinterp/octave-value/ov-usr-fcn.h diff --git a/src/octave-value/ov.cc b/libinterp/octave-value/ov.cc rename from src/octave-value/ov.cc rename to libinterp/octave-value/ov.cc --- a/src/octave-value/ov.cc +++ b/libinterp/octave-value/ov.cc @@ -484,6 +484,45 @@ return retval; } +octave_value::binary_op +octave_value::assign_op_to_binary_op (assign_op op) +{ + switch (op) + { + case op_add_eq: + return op_add; + case op_sub_eq: + return op_sub; + case op_mul_eq: + return op_mul; + case op_div_eq: + return op_div; + case op_ldiv_eq: + return op_ldiv; + case op_pow_eq: + return op_pow; + case op_lshift_eq: + return op_lshift; + case op_rshift_eq: + return op_rshift; + case op_el_mul_eq: + return op_el_mul; + case op_el_div_eq: + return op_el_div; + case op_el_ldiv_eq: + return op_el_ldiv; + case op_el_pow_eq: + return op_el_pow; + case op_el_and_eq: + return op_el_and; + case op_el_or_eq: + return op_el_or; + default: + return unknown_binary_op; + } + +} + octave_value::assign_op octave_value::binary_op_to_assign_op (binary_op op) { diff --git a/src/octave-value/ov.h b/libinterp/octave-value/ov.h rename from src/octave-value/ov.h rename to libinterp/octave-value/ov.h --- a/src/octave-value/ov.h +++ b/libinterp/octave-value/ov.h @@ -34,7 +34,6 @@ #include "data-conv.h" #include "idx-vector.h" #include "mach-info.h" -#include "mxarray.h" #include "mx-base.h" #include "oct-alloc.h" #include "oct-time.h" @@ -44,6 +43,7 @@ #include "oct-sort.h" class Cell; +class mxArray; class octave_map; class octave_scalar_map; class Octave_map; @@ -145,6 +145,8 @@ unknown_assign_op }; + static binary_op assign_op_to_binary_op (assign_op); + static assign_op binary_op_to_assign_op (binary_op); static std::string unary_op_as_string (unary_op); @@ -518,9 +520,6 @@ bool is_real_matrix (void) const { return rep->is_real_matrix (); } - bool is_real_nd_array (void) const - { return rep->is_real_nd_array (); } - bool is_complex_scalar (void) const { return rep->is_complex_scalar (); } diff --git a/src/octave.cc b/libinterp/octave.cc rename from src/octave.cc rename to libinterp/octave.cc --- a/src/octave.cc +++ b/libinterp/octave.cc @@ -56,6 +56,7 @@ #include "lex.h" #include "load-path.h" #include "octave.h" +#include "oct-conf.h" #include "oct-hist.h" #include "oct-map.h" #include "oct-mutex.h" @@ -82,6 +83,10 @@ extern void install_builtins (void); +int octave_cmdline_argc; +char **octave_cmdline_argv; +int octave_embedded; + // The command-line options. static string_vector octave_argv; @@ -116,14 +121,68 @@ // (--verbose; -V) static bool verbose_flag = false; +// If TRUE, force the GUI to start. +// (--force-gui) +static bool force_gui_option = false; + +// If TRUE don't start the GUI. +// (--no-gui) +static bool no_gui_option = false; + +// If TRUE, force readline command line editing. +// (--line-editing) +static bool forced_line_editing = false; + +// If TRUE, initialize history list from saved history file. +// (--no-history; -H) +static bool read_history_file = true; + +// The value of "path" specified on the command line. +// (--path; -p) +static std::list command_line_path; + +// Flags used to determine what commands should be echoed when they are +// parsed and executed. +// (--echo-commands; -x) +static int echo_executing_commands = 0; + +// The file used for the doc string cache. +// (--doc-cache-file) +static std::string doc_cache_file; + +// The value for "EXEC_PATH" specified on the command line. +// (--exec-path) +static std::string exec_path; + +// The value for "IMAGE_PATH" specified on the command line. +// (--image-path) +static std::string image_path; + +// The value for "info_file" specified on the command line. +// (--info-file) +static std::string info_file; + +// The value for "info_program" specified on the command line. +// (--info-program) +static std::string info_program; + +// If TRUE, ignore the window system even if it is available. +// (--no-window-system) +static bool no_window_system = false; + +// The value for "texi_macros_file" specified on the command line. +// (--texi-macros-file) +static std::string texi_macros_file; + // Usage message static const char *usage_string = "octave [-HVdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\ - [--exec-path path] [--help] [--image-path path] [--info-file file]\n\ - [--info-program prog] [--interactive] [--line-editing]\n\ - [--no-history] [--no-init-file] [--no-init-path] [--no-line-editing]\n\ - [--no-site-file] [--no-window-system] [-p path] [--path path]\n\ - [--silent] [--traditional] [--verbose] [--version] [file]"; + [--exec-path path] [--force-gui] [--help] [--image-path path]\n\ + [--info-file file] [--info-program prog] [--interactive]\n\ + [--line-editing] [--no-gui] [--no-history] [--no-init-file]\n\ + [--no-init-path] [--no-line-editing] [--no-site-file]\n\ + [--no-window-system] [-p path] [--path path] [--silent]\n\ + [--traditional] [--verbose] [--version] [file]"; // This is here so that it's more likely that the usage message and // the real set of options will agree. Note: the `+' must come first @@ -141,18 +200,20 @@ #define DOC_CACHE_FILE_OPTION 1 #define EVAL_OPTION 2 #define EXEC_PATH_OPTION 3 -#define IMAGE_PATH_OPTION 4 -#define INFO_FILE_OPTION 5 -#define INFO_PROG_OPTION 6 -#define LINE_EDITING_OPTION 7 -#define NO_INIT_FILE_OPTION 8 -#define NO_INIT_PATH_OPTION 9 -#define NO_LINE_EDITING_OPTION 10 -#define NO_SITE_FILE_OPTION 11 -#define NO_WINDOW_SYSTEM_OPTION 12 -#define PERSIST_OPTION 13 -#define TEXI_MACROS_FILE_OPTION 14 -#define TRADITIONAL_OPTION 15 +#define FORCE_GUI_OPTION 4 +#define IMAGE_PATH_OPTION 5 +#define INFO_FILE_OPTION 6 +#define INFO_PROG_OPTION 7 +#define LINE_EDITING_OPTION 8 +#define NO_GUI_OPTION 9 +#define NO_INIT_FILE_OPTION 10 +#define NO_INIT_PATH_OPTION 11 +#define NO_LINE_EDITING_OPTION 12 +#define NO_SITE_FILE_OPTION 13 +#define NO_WINDOW_SYSTEM_OPTION 14 +#define PERSIST_OPTION 15 +#define TEXI_MACROS_FILE_OPTION 16 +#define TRADITIONAL_OPTION 17 struct option long_opts[] = { { "braindead", no_argument, 0, TRADITIONAL_OPTION }, @@ -161,12 +222,14 @@ { "echo-commands", no_argument, 0, 'x' }, { "eval", required_argument, 0, EVAL_OPTION }, { "exec-path", required_argument, 0, EXEC_PATH_OPTION }, + { "force-gui", no_argument, 0, FORCE_GUI_OPTION }, { "help", no_argument, 0, 'h' }, { "image-path", required_argument, 0, IMAGE_PATH_OPTION }, { "info-file", required_argument, 0, INFO_FILE_OPTION }, { "info-program", required_argument, 0, INFO_PROG_OPTION }, { "interactive", no_argument, 0, 'i' }, { "line-editing", no_argument, 0, LINE_EDITING_OPTION }, + { "no-gui", no_argument, 0, NO_GUI_OPTION }, { "no-history", no_argument, 0, 'H' }, { "no-init-file", no_argument, 0, NO_INIT_FILE_OPTION }, { "no-init-path", no_argument, 0, NO_INIT_PATH_OPTION }, @@ -521,12 +584,14 @@ --echo-commands, -x Echo commands as they are executed.\n\ --eval CODE Evaluate CODE. Exit when done unless --persist.\n\ --exec-path PATH Set path for executing subprograms.\n\ + --force-gui Force graphical user interface to start.\n\ --help, -h, Print short help message and exit.\n\ --image-path PATH Add PATH to head of image search path.\n\ --info-file FILE Use top-level info file FILE.\n\ --info-program PROGRAM Use PROGRAM for reading info files.\n\ --interactive, -i Force interactive behavior.\n\ --line-editing Force readline use for command-line editing.\n\ + --no-gui Disable the graphical user interface.\n\ --no-history, -H Don't save commands to the history list\n\ --no-init-file Don't read the ~/.octaverc or .octaverc files.\n\ --no-init-path Don't initialize function search path.\n\ @@ -629,11 +694,192 @@ disable_warning ("Octave:possible-matlab-short-circuit-operator"); } -// You guessed it. +// EMBEDDED is declared int instead of bool because this function is +// declared extern "C". int octave_main (int argc, char **argv, int embedded) { + octave_process_command_line (argc, argv); + + octave_initialize_interpreter (argc, argv, embedded); + + return octave_execute_interpreter (); +} + +void +octave_process_command_line (int argc, char **argv) +{ + octave_cmdline_argc = argc; + octave_cmdline_argv = argv; + + while (true) + { + int long_idx; + + int optc = getopt_long (argc, argv, short_opts, long_opts, &long_idx); + + if (optc < 0) + break; + + switch (optc) + { + case '?': + // Unrecognized option. getopt_long already printed a + // message about that, so we will just print the usage string + // and exit. + usage (); + break; + + case 'H': + read_history_file = false; + break; + + case 'V': + verbose_flag = true; + break; + + case 'd': + // This is the same as yydebug in parse.y. + octave_debug++; + break; + + case 'f': + read_init_files = false; + read_site_files = false; + break; + + case 'h': + verbose_usage (); + break; + + case 'i': + forced_interactive = true; + break; + + case 'p': + if (optarg) + command_line_path.push_back (optarg); + break; + + case 'q': + inhibit_startup_message = true; + break; + + case 'x': + echo_executing_commands + = (ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE); + break; + + case 'v': + print_version_and_exit (); + break; + + case DOC_CACHE_FILE_OPTION: + if (optarg) + doc_cache_file = optarg; + break; + + case EVAL_OPTION: + if (optarg) + { + if (code_to_eval.empty ()) + code_to_eval = optarg; + else + code_to_eval += std::string (" ") + optarg; + } + break; + + case EXEC_PATH_OPTION: + if (optarg) + exec_path = optarg; + break; + + case FORCE_GUI_OPTION: + force_gui_option = true; + break; + + case IMAGE_PATH_OPTION: + if (optarg) + image_path = optarg; + break; + + case INFO_FILE_OPTION: + if (optarg) + info_file = optarg; + break; + + case INFO_PROG_OPTION: + if (optarg) + info_program = optarg; + break; + + case LINE_EDITING_OPTION: + forced_line_editing = true; + break; + + case NO_INIT_FILE_OPTION: + read_init_files = false; + break; + + case NO_GUI_OPTION: + no_gui_option = true; + break; + + case NO_INIT_PATH_OPTION: + set_initial_path = false; + break; + + case NO_LINE_EDITING_OPTION: + line_editing = false; + break; + + case NO_SITE_FILE_OPTION: + read_site_files = 0; + break; + + case NO_WINDOW_SYSTEM_OPTION: + no_window_system = true; + break; + + case PERSIST_OPTION: + persist = true; + break; + + case TEXI_MACROS_FILE_OPTION: + if (optarg) + texi_macros_file = optarg; + break; + + case TRADITIONAL_OPTION: + traditional = true; + break; + + default: + // getopt_long should print a message about unrecognized + // options and return '?', which is handled above. So if we + // end up here, it is because there was an option but we + // forgot to handle it. That should be fatal. + panic_impossible (); + break; + } + } + + if (force_gui_option && no_gui_option) + { + error ("error: only one of --force-gui and --no-gui may be used"); + usage (); + } +} + +// EMBEDDED is declared int instead of bool because this function is +// declared extern "C". + +void +octave_initialize_interpreter (int argc, char **argv, int embedded) +{ + octave_embedded = embedded; + octave_env::set_program_name (argv[0]); octave_program_invocation_name = octave_env::get_program_invocation_name (); @@ -683,158 +929,37 @@ install_builtins (); - install_classdef (); - - bool forced_line_editing = false; - - bool read_history_file = true; - - while (true) - { - int long_idx; - - int optc = getopt_long (argc, argv, short_opts, long_opts, &long_idx); - - if (optc < 0) - break; + if (! read_history_file) + bind_internal_variable ("saving_history", false); - switch (optc) - { - case '?': - // Unrecognized option. getopt_long already printed a - // message about that, so we will just print the usage string - // and exit. - usage (); - break; - - case 'H': - read_history_file = false; - bind_internal_variable ("saving_history", false); - break; - - case 'V': - verbose_flag = true; - break; - - case 'd': - // This is the same as yydebug in parse.y. - octave_debug++; - break; + for (std::list::const_iterator it = command_line_path.begin (); + it != command_line_path.end (); it++) + load_path::set_command_line_path (*it); - case 'f': - read_init_files = false; - read_site_files = false; - break; - - case 'h': - verbose_usage (); - break; - - case 'i': - forced_interactive = true; - break; - - case 'p': - if (optarg) - load_path::set_command_line_path (optarg); - break; + if (echo_executing_commands) + bind_internal_variable ("echo_executing_commands", + echo_executing_commands); - case 'q': - inhibit_startup_message = true; - break; - - case 'x': - { - double tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE); - bind_internal_variable ("echo_executing_commands", tmp); - } - break; - - case 'v': - print_version_and_exit (); - break; - - case DOC_CACHE_FILE_OPTION: - if (optarg) - bind_internal_variable ("doc_cache_file", optarg); - break; + if (! doc_cache_file.empty ()) + bind_internal_variable ("doc_cache_file", doc_cache_file); - case EVAL_OPTION: - if (optarg) - { - if (code_to_eval.empty ()) - code_to_eval = optarg; - else - code_to_eval += std::string (" ") + optarg; - } - break; - - case EXEC_PATH_OPTION: - if (optarg) - set_exec_path (optarg); - break; + if (! exec_path.empty ()) + set_exec_path (exec_path); - case IMAGE_PATH_OPTION: - if (optarg) - set_image_path (optarg); - break; - - case INFO_FILE_OPTION: - if (optarg) - bind_internal_variable ("info_file", optarg); - break; + if (! image_path.empty ()) + set_exec_path (image_path); - case INFO_PROG_OPTION: - if (optarg) - bind_internal_variable ("info_program", optarg); - break; - - case LINE_EDITING_OPTION: - forced_line_editing = true; - break; - - case NO_INIT_FILE_OPTION: - read_init_files = false; - break; + if (! info_file.empty ()) + bind_internal_variable ("info_file", info_file); - case NO_INIT_PATH_OPTION: - set_initial_path = false; - break; - - case NO_LINE_EDITING_OPTION: - line_editing = false; - break; - - case NO_SITE_FILE_OPTION: - read_site_files = 0; - break; - - case NO_WINDOW_SYSTEM_OPTION: - display_info::no_window_system (); - break; + if (! info_program.empty ()) + bind_internal_variable ("info_program", info_program); - case PERSIST_OPTION: - persist = true; - break; - - case TEXI_MACROS_FILE_OPTION: - if (optarg) - bind_internal_variable ("texi_macros_file", optarg); - break; + if (no_window_system) + display_info::no_window_system (); - case TRADITIONAL_OPTION: - traditional = true; - break; - - default: - // getopt_long should print a message about unrecognized - // options and return '?', which is handled above. So if we - // end up here, it is because there was an option but we - // forgot to handle it. That should be fatal. - panic_impossible (); - break; - } - } + if (! texi_macros_file.empty ()) + bind_internal_variable ("texi_macros_file", texi_macros_file); // Make sure we clean up when we exit. Also allow users to register // functions. If we don't have atexit or on_exit, we're going to @@ -865,9 +990,6 @@ if (line_editing) initialize_command_input (); - if (! inhibit_startup_message) - std::cout << OCTAVE_STARTUP_MESSAGE "\n" << std::endl; - if (traditional) maximum_braindamage (); @@ -883,6 +1005,13 @@ load_path::initialize (set_initial_path); initialize_history (read_history_file); +} + +int +octave_execute_interpreter (void) +{ + if (! inhibit_startup_message) + std::cout << OCTAVE_STARTUP_MESSAGE "\n" << std::endl; execute_startup_files (); @@ -895,7 +1024,7 @@ int last_arg_idx = optind; - int remaining_args = argc - last_arg_idx; + int remaining_args = octave_cmdline_argc - last_arg_idx; if (! code_to_eval.empty ()) { @@ -910,9 +1039,9 @@ // If we are running an executable script (#! /bin/octave) then // we should only see the args passed to the script. - intern_argv (remaining_args, argv+last_arg_idx); + intern_argv (remaining_args, octave_cmdline_argv+last_arg_idx); - execute_command_line_file (argv[last_arg_idx]); + execute_command_line_file (octave_cmdline_argv[last_arg_idx]); if (! persist) { @@ -927,9 +1056,9 @@ command_editor::reset_current_command_number (1); // Now argv should have the full set of args. - intern_argv (argc, argv); + intern_argv (octave_cmdline_argc, octave_cmdline_argv); - if (! embedded) + if (! octave_embedded) switch_to_buffer (create_buffer (get_input_from_stdin ())); // Force input to be echoed if not really interactive, but the user @@ -944,7 +1073,7 @@ bind_internal_variable ("echo_executing_commands", ECHO_CMD_LINE); } - if (embedded) + if (octave_embedded) { // FIXME -- do we need to do any cleanup here before // returning? If we don't, what will happen to Octave functions @@ -965,6 +1094,45 @@ return 0; } +// Return int instead of bool because this function is declared +// extern "C". + +int +octave_starting_gui (void) +{ + if (! display_info::display_available ()) + return false; + + if (force_gui_option) + return true; + + if (no_gui_option) + return false; + + if (persist) + return true; + + // If stdin is not a tty, then assume we are reading commands from a + // pipe or a redirected file and the GUI should not start. If this is + // not the case (for example, starting from a desktop "launcher" with + // no terminal) and you want to start the GUI, you may use the + // --force-gui option to start the GUI. + + if (! gnulib::isatty (fileno (stdin))) + return false; + + // If we have code to eval or execute from a file, and we are going to + // exit immediately after executing it, don't start the gui. + + int last_arg_idx = optind; + int remaining_args = octave_cmdline_argc - last_arg_idx; + + if (! code_to_eval.empty () || remaining_args > 0) + return false; + + return true; +} + DEFUN (argv, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} argv ()\n\ diff --git a/src/octave.h b/libinterp/octave.h rename from src/octave.h rename to libinterp/octave.h --- a/src/octave.h +++ b/libinterp/octave.h @@ -29,6 +29,19 @@ extern OCTINTERP_API int octave_main (int argc, char **argv, int embedded); +extern OCTINTERP_API void octave_process_command_line (int argc, char **argv); + +extern OCTINTERP_API void +octave_initialize_interpreter (int argc, char **argv, int embedded); + +extern OCTINTERP_API int octave_execute_interpreter (void); + +extern OCTINTERP_API int octave_cmdline_argc; +extern OCTINTERP_API char **octave_cmdline_argv; +extern OCTINTERP_API int octave_embedded; + +extern OCTINTERP_API int octave_starting_gui (void); + #ifdef __cplusplus } #endif diff --git a/src/operators/module.mk b/libinterp/operators/module.mk rename from src/operators/module.mk rename to libinterp/operators/module.mk diff --git a/src/operators/op-b-b.cc b/libinterp/operators/op-b-b.cc rename from src/operators/op-b-b.cc rename to libinterp/operators/op-b-b.cc diff --git a/src/operators/op-b-bm.cc b/libinterp/operators/op-b-bm.cc rename from src/operators/op-b-bm.cc rename to libinterp/operators/op-b-bm.cc diff --git a/src/operators/op-b-sbm.cc b/libinterp/operators/op-b-sbm.cc rename from src/operators/op-b-sbm.cc rename to libinterp/operators/op-b-sbm.cc diff --git a/src/operators/op-bm-b.cc b/libinterp/operators/op-bm-b.cc rename from src/operators/op-bm-b.cc rename to libinterp/operators/op-bm-b.cc diff --git a/src/operators/op-bm-bm.cc b/libinterp/operators/op-bm-bm.cc rename from src/operators/op-bm-bm.cc rename to libinterp/operators/op-bm-bm.cc diff --git a/src/operators/op-bm-sbm.cc b/libinterp/operators/op-bm-sbm.cc rename from src/operators/op-bm-sbm.cc rename to libinterp/operators/op-bm-sbm.cc diff --git a/src/operators/op-cdm-cdm.cc b/libinterp/operators/op-cdm-cdm.cc rename from src/operators/op-cdm-cdm.cc rename to libinterp/operators/op-cdm-cdm.cc diff --git a/src/operators/op-cdm-cm.cc b/libinterp/operators/op-cdm-cm.cc rename from src/operators/op-cdm-cm.cc rename to libinterp/operators/op-cdm-cm.cc diff --git a/src/operators/op-cdm-cs.cc b/libinterp/operators/op-cdm-cs.cc rename from src/operators/op-cdm-cs.cc rename to libinterp/operators/op-cdm-cs.cc diff --git a/src/operators/op-cdm-dm.cc b/libinterp/operators/op-cdm-dm.cc rename from src/operators/op-cdm-dm.cc rename to libinterp/operators/op-cdm-dm.cc diff --git a/src/operators/op-cdm-m.cc b/libinterp/operators/op-cdm-m.cc rename from src/operators/op-cdm-m.cc rename to libinterp/operators/op-cdm-m.cc diff --git a/src/operators/op-cdm-s.cc b/libinterp/operators/op-cdm-s.cc rename from src/operators/op-cdm-s.cc rename to libinterp/operators/op-cdm-s.cc diff --git a/src/operators/op-cell.cc b/libinterp/operators/op-cell.cc rename from src/operators/op-cell.cc rename to libinterp/operators/op-cell.cc diff --git a/src/operators/op-chm.cc b/libinterp/operators/op-chm.cc rename from src/operators/op-chm.cc rename to libinterp/operators/op-chm.cc diff --git a/src/operators/op-class.cc b/libinterp/operators/op-class.cc rename from src/operators/op-class.cc rename to libinterp/operators/op-class.cc diff --git a/src/operators/op-cm-cdm.cc b/libinterp/operators/op-cm-cdm.cc rename from src/operators/op-cm-cdm.cc rename to libinterp/operators/op-cm-cdm.cc diff --git a/src/operators/op-cm-cm.cc b/libinterp/operators/op-cm-cm.cc rename from src/operators/op-cm-cm.cc rename to libinterp/operators/op-cm-cm.cc diff --git a/src/operators/op-cm-cs.cc b/libinterp/operators/op-cm-cs.cc rename from src/operators/op-cm-cs.cc rename to libinterp/operators/op-cm-cs.cc diff --git a/src/operators/op-cm-dm.cc b/libinterp/operators/op-cm-dm.cc rename from src/operators/op-cm-dm.cc rename to libinterp/operators/op-cm-dm.cc diff --git a/src/operators/op-cm-m.cc b/libinterp/operators/op-cm-m.cc rename from src/operators/op-cm-m.cc rename to libinterp/operators/op-cm-m.cc diff --git a/src/operators/op-cm-pm.cc b/libinterp/operators/op-cm-pm.cc rename from src/operators/op-cm-pm.cc rename to libinterp/operators/op-cm-pm.cc diff --git a/src/operators/op-cm-s.cc b/libinterp/operators/op-cm-s.cc rename from src/operators/op-cm-s.cc rename to libinterp/operators/op-cm-s.cc diff --git a/src/operators/op-cm-scm.cc b/libinterp/operators/op-cm-scm.cc rename from src/operators/op-cm-scm.cc rename to libinterp/operators/op-cm-scm.cc diff --git a/src/operators/op-cm-sm.cc b/libinterp/operators/op-cm-sm.cc rename from src/operators/op-cm-sm.cc rename to libinterp/operators/op-cm-sm.cc diff --git a/src/operators/op-cs-cm.cc b/libinterp/operators/op-cs-cm.cc rename from src/operators/op-cs-cm.cc rename to libinterp/operators/op-cs-cm.cc diff --git a/src/operators/op-cs-cs.cc b/libinterp/operators/op-cs-cs.cc rename from src/operators/op-cs-cs.cc rename to libinterp/operators/op-cs-cs.cc diff --git a/src/operators/op-cs-m.cc b/libinterp/operators/op-cs-m.cc rename from src/operators/op-cs-m.cc rename to libinterp/operators/op-cs-m.cc diff --git a/src/operators/op-cs-s.cc b/libinterp/operators/op-cs-s.cc rename from src/operators/op-cs-s.cc rename to libinterp/operators/op-cs-s.cc diff --git a/src/operators/op-cs-scm.cc b/libinterp/operators/op-cs-scm.cc rename from src/operators/op-cs-scm.cc rename to libinterp/operators/op-cs-scm.cc diff --git a/src/operators/op-cs-sm.cc b/libinterp/operators/op-cs-sm.cc rename from src/operators/op-cs-sm.cc rename to libinterp/operators/op-cs-sm.cc diff --git a/src/operators/op-dm-cdm.cc b/libinterp/operators/op-dm-cdm.cc rename from src/operators/op-dm-cdm.cc rename to libinterp/operators/op-dm-cdm.cc diff --git a/src/operators/op-dm-cm.cc b/libinterp/operators/op-dm-cm.cc rename from src/operators/op-dm-cm.cc rename to libinterp/operators/op-dm-cm.cc diff --git a/src/operators/op-dm-cs.cc b/libinterp/operators/op-dm-cs.cc rename from src/operators/op-dm-cs.cc rename to libinterp/operators/op-dm-cs.cc diff --git a/src/operators/op-dm-dm.cc b/libinterp/operators/op-dm-dm.cc rename from src/operators/op-dm-dm.cc rename to libinterp/operators/op-dm-dm.cc diff --git a/src/operators/op-dm-m.cc b/libinterp/operators/op-dm-m.cc rename from src/operators/op-dm-m.cc rename to libinterp/operators/op-dm-m.cc diff --git a/src/operators/op-dm-s.cc b/libinterp/operators/op-dm-s.cc rename from src/operators/op-dm-s.cc rename to libinterp/operators/op-dm-s.cc diff --git a/src/operators/op-dm-scm.cc b/libinterp/operators/op-dm-scm.cc rename from src/operators/op-dm-scm.cc rename to libinterp/operators/op-dm-scm.cc diff --git a/src/operators/op-dm-sm.cc b/libinterp/operators/op-dm-sm.cc rename from src/operators/op-dm-sm.cc rename to libinterp/operators/op-dm-sm.cc diff --git a/src/operators/op-dm-template.cc b/libinterp/operators/op-dm-template.cc rename from src/operators/op-dm-template.cc rename to libinterp/operators/op-dm-template.cc diff --git a/src/operators/op-dms-template.cc b/libinterp/operators/op-dms-template.cc rename from src/operators/op-dms-template.cc rename to libinterp/operators/op-dms-template.cc diff --git a/src/operators/op-double-conv.cc b/libinterp/operators/op-double-conv.cc rename from src/operators/op-double-conv.cc rename to libinterp/operators/op-double-conv.cc diff --git a/src/operators/op-fcdm-fcdm.cc b/libinterp/operators/op-fcdm-fcdm.cc rename from src/operators/op-fcdm-fcdm.cc rename to libinterp/operators/op-fcdm-fcdm.cc diff --git a/src/operators/op-fcdm-fcm.cc b/libinterp/operators/op-fcdm-fcm.cc rename from src/operators/op-fcdm-fcm.cc rename to libinterp/operators/op-fcdm-fcm.cc diff --git a/src/operators/op-fcdm-fcs.cc b/libinterp/operators/op-fcdm-fcs.cc rename from src/operators/op-fcdm-fcs.cc rename to libinterp/operators/op-fcdm-fcs.cc diff --git a/src/operators/op-fcdm-fdm.cc b/libinterp/operators/op-fcdm-fdm.cc rename from src/operators/op-fcdm-fdm.cc rename to libinterp/operators/op-fcdm-fdm.cc diff --git a/src/operators/op-fcdm-fm.cc b/libinterp/operators/op-fcdm-fm.cc rename from src/operators/op-fcdm-fm.cc rename to libinterp/operators/op-fcdm-fm.cc diff --git a/src/operators/op-fcdm-fs.cc b/libinterp/operators/op-fcdm-fs.cc rename from src/operators/op-fcdm-fs.cc rename to libinterp/operators/op-fcdm-fs.cc diff --git a/src/operators/op-fcm-fcdm.cc b/libinterp/operators/op-fcm-fcdm.cc rename from src/operators/op-fcm-fcdm.cc rename to libinterp/operators/op-fcm-fcdm.cc diff --git a/src/operators/op-fcm-fcm.cc b/libinterp/operators/op-fcm-fcm.cc rename from src/operators/op-fcm-fcm.cc rename to libinterp/operators/op-fcm-fcm.cc diff --git a/src/operators/op-fcm-fcs.cc b/libinterp/operators/op-fcm-fcs.cc rename from src/operators/op-fcm-fcs.cc rename to libinterp/operators/op-fcm-fcs.cc diff --git a/src/operators/op-fcm-fdm.cc b/libinterp/operators/op-fcm-fdm.cc rename from src/operators/op-fcm-fdm.cc rename to libinterp/operators/op-fcm-fdm.cc diff --git a/src/operators/op-fcm-fm.cc b/libinterp/operators/op-fcm-fm.cc rename from src/operators/op-fcm-fm.cc rename to libinterp/operators/op-fcm-fm.cc diff --git a/src/operators/op-fcm-fs.cc b/libinterp/operators/op-fcm-fs.cc rename from src/operators/op-fcm-fs.cc rename to libinterp/operators/op-fcm-fs.cc diff --git a/src/operators/op-fcm-pm.cc b/libinterp/operators/op-fcm-pm.cc rename from src/operators/op-fcm-pm.cc rename to libinterp/operators/op-fcm-pm.cc diff --git a/src/operators/op-fcn.cc b/libinterp/operators/op-fcn.cc rename from src/operators/op-fcn.cc rename to libinterp/operators/op-fcn.cc diff --git a/src/operators/op-fcs-fcm.cc b/libinterp/operators/op-fcs-fcm.cc rename from src/operators/op-fcs-fcm.cc rename to libinterp/operators/op-fcs-fcm.cc diff --git a/src/operators/op-fcs-fcs.cc b/libinterp/operators/op-fcs-fcs.cc rename from src/operators/op-fcs-fcs.cc rename to libinterp/operators/op-fcs-fcs.cc diff --git a/src/operators/op-fcs-fm.cc b/libinterp/operators/op-fcs-fm.cc rename from src/operators/op-fcs-fm.cc rename to libinterp/operators/op-fcs-fm.cc diff --git a/src/operators/op-fcs-fs.cc b/libinterp/operators/op-fcs-fs.cc rename from src/operators/op-fcs-fs.cc rename to libinterp/operators/op-fcs-fs.cc diff --git a/src/operators/op-fdm-fcdm.cc b/libinterp/operators/op-fdm-fcdm.cc rename from src/operators/op-fdm-fcdm.cc rename to libinterp/operators/op-fdm-fcdm.cc diff --git a/src/operators/op-fdm-fcm.cc b/libinterp/operators/op-fdm-fcm.cc rename from src/operators/op-fdm-fcm.cc rename to libinterp/operators/op-fdm-fcm.cc diff --git a/src/operators/op-fdm-fcs.cc b/libinterp/operators/op-fdm-fcs.cc rename from src/operators/op-fdm-fcs.cc rename to libinterp/operators/op-fdm-fcs.cc diff --git a/src/operators/op-fdm-fdm.cc b/libinterp/operators/op-fdm-fdm.cc rename from src/operators/op-fdm-fdm.cc rename to libinterp/operators/op-fdm-fdm.cc diff --git a/src/operators/op-fdm-fm.cc b/libinterp/operators/op-fdm-fm.cc rename from src/operators/op-fdm-fm.cc rename to libinterp/operators/op-fdm-fm.cc diff --git a/src/operators/op-fdm-fs.cc b/libinterp/operators/op-fdm-fs.cc rename from src/operators/op-fdm-fs.cc rename to libinterp/operators/op-fdm-fs.cc diff --git a/src/operators/op-float-conv.cc b/libinterp/operators/op-float-conv.cc rename from src/operators/op-float-conv.cc rename to libinterp/operators/op-float-conv.cc diff --git a/src/operators/op-fm-fcdm.cc b/libinterp/operators/op-fm-fcdm.cc rename from src/operators/op-fm-fcdm.cc rename to libinterp/operators/op-fm-fcdm.cc diff --git a/src/operators/op-fm-fcm.cc b/libinterp/operators/op-fm-fcm.cc rename from src/operators/op-fm-fcm.cc rename to libinterp/operators/op-fm-fcm.cc diff --git a/src/operators/op-fm-fcs.cc b/libinterp/operators/op-fm-fcs.cc rename from src/operators/op-fm-fcs.cc rename to libinterp/operators/op-fm-fcs.cc diff --git a/src/operators/op-fm-fdm.cc b/libinterp/operators/op-fm-fdm.cc rename from src/operators/op-fm-fdm.cc rename to libinterp/operators/op-fm-fdm.cc diff --git a/src/operators/op-fm-fm.cc b/libinterp/operators/op-fm-fm.cc rename from src/operators/op-fm-fm.cc rename to libinterp/operators/op-fm-fm.cc diff --git a/src/operators/op-fm-fs.cc b/libinterp/operators/op-fm-fs.cc rename from src/operators/op-fm-fs.cc rename to libinterp/operators/op-fm-fs.cc diff --git a/src/operators/op-fm-pm.cc b/libinterp/operators/op-fm-pm.cc rename from src/operators/op-fm-pm.cc rename to libinterp/operators/op-fm-pm.cc diff --git a/src/operators/op-fs-fcm.cc b/libinterp/operators/op-fs-fcm.cc rename from src/operators/op-fs-fcm.cc rename to libinterp/operators/op-fs-fcm.cc diff --git a/src/operators/op-fs-fcs.cc b/libinterp/operators/op-fs-fcs.cc rename from src/operators/op-fs-fcs.cc rename to libinterp/operators/op-fs-fcs.cc diff --git a/src/operators/op-fs-fm.cc b/libinterp/operators/op-fs-fm.cc rename from src/operators/op-fs-fm.cc rename to libinterp/operators/op-fs-fm.cc diff --git a/src/operators/op-fs-fs.cc b/libinterp/operators/op-fs-fs.cc rename from src/operators/op-fs-fs.cc rename to libinterp/operators/op-fs-fs.cc diff --git a/src/operators/op-i16-i16.cc b/libinterp/operators/op-i16-i16.cc rename from src/operators/op-i16-i16.cc rename to libinterp/operators/op-i16-i16.cc diff --git a/src/operators/op-i32-i32.cc b/libinterp/operators/op-i32-i32.cc rename from src/operators/op-i32-i32.cc rename to libinterp/operators/op-i32-i32.cc diff --git a/src/operators/op-i64-i64.cc b/libinterp/operators/op-i64-i64.cc rename from src/operators/op-i64-i64.cc rename to libinterp/operators/op-i64-i64.cc diff --git a/src/operators/op-i8-i8.cc b/libinterp/operators/op-i8-i8.cc rename from src/operators/op-i8-i8.cc rename to libinterp/operators/op-i8-i8.cc diff --git a/src/operators/op-int-concat.cc b/libinterp/operators/op-int-concat.cc rename from src/operators/op-int-concat.cc rename to libinterp/operators/op-int-concat.cc diff --git a/src/operators/op-int-conv.cc b/libinterp/operators/op-int-conv.cc rename from src/operators/op-int-conv.cc rename to libinterp/operators/op-int-conv.cc diff --git a/src/operators/op-int.h b/libinterp/operators/op-int.h rename from src/operators/op-int.h rename to libinterp/operators/op-int.h diff --git a/src/operators/op-m-cdm.cc b/libinterp/operators/op-m-cdm.cc rename from src/operators/op-m-cdm.cc rename to libinterp/operators/op-m-cdm.cc diff --git a/src/operators/op-m-cm.cc b/libinterp/operators/op-m-cm.cc rename from src/operators/op-m-cm.cc rename to libinterp/operators/op-m-cm.cc diff --git a/src/operators/op-m-cs.cc b/libinterp/operators/op-m-cs.cc rename from src/operators/op-m-cs.cc rename to libinterp/operators/op-m-cs.cc diff --git a/src/operators/op-m-dm.cc b/libinterp/operators/op-m-dm.cc rename from src/operators/op-m-dm.cc rename to libinterp/operators/op-m-dm.cc diff --git a/src/operators/op-m-m.cc b/libinterp/operators/op-m-m.cc rename from src/operators/op-m-m.cc rename to libinterp/operators/op-m-m.cc diff --git a/src/operators/op-m-pm.cc b/libinterp/operators/op-m-pm.cc rename from src/operators/op-m-pm.cc rename to libinterp/operators/op-m-pm.cc diff --git a/src/operators/op-m-s.cc b/libinterp/operators/op-m-s.cc rename from src/operators/op-m-s.cc rename to libinterp/operators/op-m-s.cc diff --git a/src/operators/op-m-scm.cc b/libinterp/operators/op-m-scm.cc rename from src/operators/op-m-scm.cc rename to libinterp/operators/op-m-scm.cc diff --git a/src/operators/op-m-sm.cc b/libinterp/operators/op-m-sm.cc rename from src/operators/op-m-sm.cc rename to libinterp/operators/op-m-sm.cc diff --git a/src/operators/op-pm-cm.cc b/libinterp/operators/op-pm-cm.cc rename from src/operators/op-pm-cm.cc rename to libinterp/operators/op-pm-cm.cc diff --git a/src/operators/op-pm-fcm.cc b/libinterp/operators/op-pm-fcm.cc rename from src/operators/op-pm-fcm.cc rename to libinterp/operators/op-pm-fcm.cc diff --git a/src/operators/op-pm-fm.cc b/libinterp/operators/op-pm-fm.cc rename from src/operators/op-pm-fm.cc rename to libinterp/operators/op-pm-fm.cc diff --git a/src/operators/op-pm-m.cc b/libinterp/operators/op-pm-m.cc rename from src/operators/op-pm-m.cc rename to libinterp/operators/op-pm-m.cc diff --git a/src/operators/op-pm-pm.cc b/libinterp/operators/op-pm-pm.cc rename from src/operators/op-pm-pm.cc rename to libinterp/operators/op-pm-pm.cc diff --git a/src/operators/op-pm-scm.cc b/libinterp/operators/op-pm-scm.cc rename from src/operators/op-pm-scm.cc rename to libinterp/operators/op-pm-scm.cc diff --git a/src/operators/op-pm-sm.cc b/libinterp/operators/op-pm-sm.cc rename from src/operators/op-pm-sm.cc rename to libinterp/operators/op-pm-sm.cc diff --git a/src/operators/op-pm-template.cc b/libinterp/operators/op-pm-template.cc rename from src/operators/op-pm-template.cc rename to libinterp/operators/op-pm-template.cc diff --git a/src/operators/op-range.cc b/libinterp/operators/op-range.cc rename from src/operators/op-range.cc rename to libinterp/operators/op-range.cc diff --git a/src/operators/op-s-cm.cc b/libinterp/operators/op-s-cm.cc rename from src/operators/op-s-cm.cc rename to libinterp/operators/op-s-cm.cc diff --git a/src/operators/op-s-cs.cc b/libinterp/operators/op-s-cs.cc rename from src/operators/op-s-cs.cc rename to libinterp/operators/op-s-cs.cc diff --git a/src/operators/op-s-m.cc b/libinterp/operators/op-s-m.cc rename from src/operators/op-s-m.cc rename to libinterp/operators/op-s-m.cc diff --git a/src/operators/op-s-s.cc b/libinterp/operators/op-s-s.cc rename from src/operators/op-s-s.cc rename to libinterp/operators/op-s-s.cc diff --git a/src/operators/op-s-scm.cc b/libinterp/operators/op-s-scm.cc rename from src/operators/op-s-scm.cc rename to libinterp/operators/op-s-scm.cc diff --git a/src/operators/op-s-sm.cc b/libinterp/operators/op-s-sm.cc rename from src/operators/op-s-sm.cc rename to libinterp/operators/op-s-sm.cc diff --git a/src/operators/op-sbm-b.cc b/libinterp/operators/op-sbm-b.cc rename from src/operators/op-sbm-b.cc rename to libinterp/operators/op-sbm-b.cc diff --git a/src/operators/op-sbm-bm.cc b/libinterp/operators/op-sbm-bm.cc rename from src/operators/op-sbm-bm.cc rename to libinterp/operators/op-sbm-bm.cc diff --git a/src/operators/op-sbm-sbm.cc b/libinterp/operators/op-sbm-sbm.cc rename from src/operators/op-sbm-sbm.cc rename to libinterp/operators/op-sbm-sbm.cc diff --git a/src/operators/op-scm-cm.cc b/libinterp/operators/op-scm-cm.cc rename from src/operators/op-scm-cm.cc rename to libinterp/operators/op-scm-cm.cc diff --git a/src/operators/op-scm-cs.cc b/libinterp/operators/op-scm-cs.cc rename from src/operators/op-scm-cs.cc rename to libinterp/operators/op-scm-cs.cc diff --git a/src/operators/op-scm-m.cc b/libinterp/operators/op-scm-m.cc rename from src/operators/op-scm-m.cc rename to libinterp/operators/op-scm-m.cc diff --git a/src/operators/op-scm-s.cc b/libinterp/operators/op-scm-s.cc rename from src/operators/op-scm-s.cc rename to libinterp/operators/op-scm-s.cc diff --git a/src/operators/op-scm-scm.cc b/libinterp/operators/op-scm-scm.cc rename from src/operators/op-scm-scm.cc rename to libinterp/operators/op-scm-scm.cc diff --git a/src/operators/op-scm-sm.cc b/libinterp/operators/op-scm-sm.cc rename from src/operators/op-scm-sm.cc rename to libinterp/operators/op-scm-sm.cc diff --git a/src/operators/op-sm-cm.cc b/libinterp/operators/op-sm-cm.cc rename from src/operators/op-sm-cm.cc rename to libinterp/operators/op-sm-cm.cc diff --git a/src/operators/op-sm-cs.cc b/libinterp/operators/op-sm-cs.cc rename from src/operators/op-sm-cs.cc rename to libinterp/operators/op-sm-cs.cc diff --git a/src/operators/op-sm-m.cc b/libinterp/operators/op-sm-m.cc rename from src/operators/op-sm-m.cc rename to libinterp/operators/op-sm-m.cc diff --git a/src/operators/op-sm-s.cc b/libinterp/operators/op-sm-s.cc rename from src/operators/op-sm-s.cc rename to libinterp/operators/op-sm-s.cc diff --git a/src/operators/op-sm-scm.cc b/libinterp/operators/op-sm-scm.cc rename from src/operators/op-sm-scm.cc rename to libinterp/operators/op-sm-scm.cc diff --git a/src/operators/op-sm-sm.cc b/libinterp/operators/op-sm-sm.cc rename from src/operators/op-sm-sm.cc rename to libinterp/operators/op-sm-sm.cc diff --git a/src/operators/op-str-m.cc b/libinterp/operators/op-str-m.cc rename from src/operators/op-str-m.cc rename to libinterp/operators/op-str-m.cc diff --git a/src/operators/op-str-s.cc b/libinterp/operators/op-str-s.cc rename from src/operators/op-str-s.cc rename to libinterp/operators/op-str-s.cc diff --git a/src/operators/op-str-str.cc b/libinterp/operators/op-str-str.cc rename from src/operators/op-str-str.cc rename to libinterp/operators/op-str-str.cc diff --git a/src/operators/op-struct.cc b/libinterp/operators/op-struct.cc rename from src/operators/op-struct.cc rename to libinterp/operators/op-struct.cc diff --git a/src/operators/op-ui16-ui16.cc b/libinterp/operators/op-ui16-ui16.cc rename from src/operators/op-ui16-ui16.cc rename to libinterp/operators/op-ui16-ui16.cc diff --git a/src/operators/op-ui32-ui32.cc b/libinterp/operators/op-ui32-ui32.cc rename from src/operators/op-ui32-ui32.cc rename to libinterp/operators/op-ui32-ui32.cc diff --git a/src/operators/op-ui64-ui64.cc b/libinterp/operators/op-ui64-ui64.cc rename from src/operators/op-ui64-ui64.cc rename to libinterp/operators/op-ui64-ui64.cc diff --git a/src/operators/op-ui8-ui8.cc b/libinterp/operators/op-ui8-ui8.cc rename from src/operators/op-ui8-ui8.cc rename to libinterp/operators/op-ui8-ui8.cc diff --git a/src/operators/ops.h b/libinterp/operators/ops.h rename from src/operators/ops.h rename to libinterp/operators/ops.h diff --git a/src/parse-tree/lex.h b/libinterp/parse-tree/lex.h rename from src/parse-tree/lex.h rename to libinterp/parse-tree/lex.h diff --git a/src/parse-tree/lex.ll b/libinterp/parse-tree/lex.ll rename from src/parse-tree/lex.ll rename to libinterp/parse-tree/lex.ll diff --git a/src/parse-tree/module.mk b/libinterp/parse-tree/module.mk rename from src/parse-tree/module.mk rename to libinterp/parse-tree/module.mk diff --git a/src/parse-tree/oct-parse.yy b/libinterp/parse-tree/oct-parse.yy rename from src/parse-tree/oct-parse.yy rename to libinterp/parse-tree/oct-parse.yy diff --git a/src/parse-tree/octave.gperf b/libinterp/parse-tree/octave.gperf rename from src/parse-tree/octave.gperf rename to libinterp/parse-tree/octave.gperf diff --git a/src/parse-tree/parse-private.h b/libinterp/parse-tree/parse-private.h rename from src/parse-tree/parse-private.h rename to libinterp/parse-tree/parse-private.h diff --git a/src/parse-tree/parse.h b/libinterp/parse-tree/parse.h rename from src/parse-tree/parse.h rename to libinterp/parse-tree/parse.h diff --git a/src/parse-tree/pt-all.h b/libinterp/parse-tree/pt-all.h rename from src/parse-tree/pt-all.h rename to libinterp/parse-tree/pt-all.h diff --git a/src/parse-tree/pt-arg-list.cc b/libinterp/parse-tree/pt-arg-list.cc rename from src/parse-tree/pt-arg-list.cc rename to libinterp/parse-tree/pt-arg-list.cc diff --git a/src/parse-tree/pt-arg-list.h b/libinterp/parse-tree/pt-arg-list.h rename from src/parse-tree/pt-arg-list.h rename to libinterp/parse-tree/pt-arg-list.h diff --git a/src/parse-tree/pt-assign.cc b/libinterp/parse-tree/pt-assign.cc rename from src/parse-tree/pt-assign.cc rename to libinterp/parse-tree/pt-assign.cc diff --git a/src/parse-tree/pt-assign.h b/libinterp/parse-tree/pt-assign.h rename from src/parse-tree/pt-assign.h rename to libinterp/parse-tree/pt-assign.h diff --git a/src/parse-tree/pt-binop.cc b/libinterp/parse-tree/pt-binop.cc rename from src/parse-tree/pt-binop.cc rename to libinterp/parse-tree/pt-binop.cc diff --git a/src/parse-tree/pt-binop.h b/libinterp/parse-tree/pt-binop.h rename from src/parse-tree/pt-binop.h rename to libinterp/parse-tree/pt-binop.h diff --git a/src/parse-tree/pt-bp.cc b/libinterp/parse-tree/pt-bp.cc rename from src/parse-tree/pt-bp.cc rename to libinterp/parse-tree/pt-bp.cc diff --git a/src/parse-tree/pt-bp.h b/libinterp/parse-tree/pt-bp.h rename from src/parse-tree/pt-bp.h rename to libinterp/parse-tree/pt-bp.h diff --git a/src/parse-tree/pt-cbinop.cc b/libinterp/parse-tree/pt-cbinop.cc rename from src/parse-tree/pt-cbinop.cc rename to libinterp/parse-tree/pt-cbinop.cc diff --git a/src/parse-tree/pt-cbinop.h b/libinterp/parse-tree/pt-cbinop.h rename from src/parse-tree/pt-cbinop.h rename to libinterp/parse-tree/pt-cbinop.h diff --git a/src/parse-tree/pt-cell.cc b/libinterp/parse-tree/pt-cell.cc rename from src/parse-tree/pt-cell.cc rename to libinterp/parse-tree/pt-cell.cc diff --git a/src/parse-tree/pt-cell.h b/libinterp/parse-tree/pt-cell.h rename from src/parse-tree/pt-cell.h rename to libinterp/parse-tree/pt-cell.h diff --git a/src/parse-tree/pt-check.cc b/libinterp/parse-tree/pt-check.cc rename from src/parse-tree/pt-check.cc rename to libinterp/parse-tree/pt-check.cc diff --git a/src/parse-tree/pt-check.h b/libinterp/parse-tree/pt-check.h rename from src/parse-tree/pt-check.h rename to libinterp/parse-tree/pt-check.h diff --git a/src/parse-tree/pt-cmd.cc b/libinterp/parse-tree/pt-cmd.cc rename from src/parse-tree/pt-cmd.cc rename to libinterp/parse-tree/pt-cmd.cc diff --git a/src/parse-tree/pt-cmd.h b/libinterp/parse-tree/pt-cmd.h rename from src/parse-tree/pt-cmd.h rename to libinterp/parse-tree/pt-cmd.h diff --git a/src/parse-tree/pt-colon.cc b/libinterp/parse-tree/pt-colon.cc rename from src/parse-tree/pt-colon.cc rename to libinterp/parse-tree/pt-colon.cc diff --git a/src/parse-tree/pt-colon.h b/libinterp/parse-tree/pt-colon.h rename from src/parse-tree/pt-colon.h rename to libinterp/parse-tree/pt-colon.h diff --git a/src/parse-tree/pt-const.cc b/libinterp/parse-tree/pt-const.cc rename from src/parse-tree/pt-const.cc rename to libinterp/parse-tree/pt-const.cc diff --git a/src/parse-tree/pt-const.h b/libinterp/parse-tree/pt-const.h rename from src/parse-tree/pt-const.h rename to libinterp/parse-tree/pt-const.h diff --git a/src/parse-tree/pt-decl.cc b/libinterp/parse-tree/pt-decl.cc rename from src/parse-tree/pt-decl.cc rename to libinterp/parse-tree/pt-decl.cc diff --git a/src/parse-tree/pt-decl.h b/libinterp/parse-tree/pt-decl.h rename from src/parse-tree/pt-decl.h rename to libinterp/parse-tree/pt-decl.h diff --git a/src/parse-tree/pt-eval.cc b/libinterp/parse-tree/pt-eval.cc rename from src/parse-tree/pt-eval.cc rename to libinterp/parse-tree/pt-eval.cc diff --git a/src/parse-tree/pt-eval.h b/libinterp/parse-tree/pt-eval.h rename from src/parse-tree/pt-eval.h rename to libinterp/parse-tree/pt-eval.h diff --git a/src/parse-tree/pt-except.cc b/libinterp/parse-tree/pt-except.cc rename from src/parse-tree/pt-except.cc rename to libinterp/parse-tree/pt-except.cc diff --git a/src/parse-tree/pt-except.h b/libinterp/parse-tree/pt-except.h rename from src/parse-tree/pt-except.h rename to libinterp/parse-tree/pt-except.h diff --git a/src/parse-tree/pt-exp.cc b/libinterp/parse-tree/pt-exp.cc rename from src/parse-tree/pt-exp.cc rename to libinterp/parse-tree/pt-exp.cc diff --git a/src/parse-tree/pt-exp.h b/libinterp/parse-tree/pt-exp.h rename from src/parse-tree/pt-exp.h rename to libinterp/parse-tree/pt-exp.h diff --git a/src/parse-tree/pt-fcn-handle.cc b/libinterp/parse-tree/pt-fcn-handle.cc rename from src/parse-tree/pt-fcn-handle.cc rename to libinterp/parse-tree/pt-fcn-handle.cc diff --git a/src/parse-tree/pt-fcn-handle.h b/libinterp/parse-tree/pt-fcn-handle.h rename from src/parse-tree/pt-fcn-handle.h rename to libinterp/parse-tree/pt-fcn-handle.h diff --git a/src/parse-tree/pt-id.cc b/libinterp/parse-tree/pt-id.cc rename from src/parse-tree/pt-id.cc rename to libinterp/parse-tree/pt-id.cc diff --git a/src/parse-tree/pt-id.h b/libinterp/parse-tree/pt-id.h rename from src/parse-tree/pt-id.h rename to libinterp/parse-tree/pt-id.h diff --git a/src/parse-tree/pt-idx.cc b/libinterp/parse-tree/pt-idx.cc rename from src/parse-tree/pt-idx.cc rename to libinterp/parse-tree/pt-idx.cc diff --git a/src/parse-tree/pt-idx.h b/libinterp/parse-tree/pt-idx.h rename from src/parse-tree/pt-idx.h rename to libinterp/parse-tree/pt-idx.h diff --git a/src/parse-tree/pt-jump.cc b/libinterp/parse-tree/pt-jump.cc rename from src/parse-tree/pt-jump.cc rename to libinterp/parse-tree/pt-jump.cc diff --git a/src/parse-tree/pt-jump.h b/libinterp/parse-tree/pt-jump.h rename from src/parse-tree/pt-jump.h rename to libinterp/parse-tree/pt-jump.h diff --git a/src/parse-tree/pt-loop.cc b/libinterp/parse-tree/pt-loop.cc rename from src/parse-tree/pt-loop.cc rename to libinterp/parse-tree/pt-loop.cc diff --git a/src/parse-tree/pt-loop.h b/libinterp/parse-tree/pt-loop.h rename from src/parse-tree/pt-loop.h rename to libinterp/parse-tree/pt-loop.h diff --git a/src/parse-tree/pt-mat.cc b/libinterp/parse-tree/pt-mat.cc rename from src/parse-tree/pt-mat.cc rename to libinterp/parse-tree/pt-mat.cc diff --git a/src/parse-tree/pt-mat.h b/libinterp/parse-tree/pt-mat.h rename from src/parse-tree/pt-mat.h rename to libinterp/parse-tree/pt-mat.h diff --git a/src/parse-tree/pt-misc.cc b/libinterp/parse-tree/pt-misc.cc rename from src/parse-tree/pt-misc.cc rename to libinterp/parse-tree/pt-misc.cc diff --git a/src/parse-tree/pt-misc.h b/libinterp/parse-tree/pt-misc.h rename from src/parse-tree/pt-misc.h rename to libinterp/parse-tree/pt-misc.h diff --git a/src/parse-tree/pt-pr-code.cc b/libinterp/parse-tree/pt-pr-code.cc rename from src/parse-tree/pt-pr-code.cc rename to libinterp/parse-tree/pt-pr-code.cc diff --git a/src/parse-tree/pt-pr-code.h b/libinterp/parse-tree/pt-pr-code.h rename from src/parse-tree/pt-pr-code.h rename to libinterp/parse-tree/pt-pr-code.h diff --git a/src/parse-tree/pt-select.cc b/libinterp/parse-tree/pt-select.cc rename from src/parse-tree/pt-select.cc rename to libinterp/parse-tree/pt-select.cc diff --git a/src/parse-tree/pt-select.h b/libinterp/parse-tree/pt-select.h rename from src/parse-tree/pt-select.h rename to libinterp/parse-tree/pt-select.h diff --git a/src/parse-tree/pt-stmt.cc b/libinterp/parse-tree/pt-stmt.cc rename from src/parse-tree/pt-stmt.cc rename to libinterp/parse-tree/pt-stmt.cc diff --git a/src/parse-tree/pt-stmt.h b/libinterp/parse-tree/pt-stmt.h rename from src/parse-tree/pt-stmt.h rename to libinterp/parse-tree/pt-stmt.h diff --git a/src/parse-tree/pt-unop.cc b/libinterp/parse-tree/pt-unop.cc rename from src/parse-tree/pt-unop.cc rename to libinterp/parse-tree/pt-unop.cc diff --git a/src/parse-tree/pt-unop.h b/libinterp/parse-tree/pt-unop.h rename from src/parse-tree/pt-unop.h rename to libinterp/parse-tree/pt-unop.h diff --git a/src/parse-tree/pt-walk.h b/libinterp/parse-tree/pt-walk.h rename from src/parse-tree/pt-walk.h rename to libinterp/parse-tree/pt-walk.h diff --git a/src/parse-tree/pt.cc b/libinterp/parse-tree/pt.cc rename from src/parse-tree/pt.cc rename to libinterp/parse-tree/pt.cc diff --git a/src/parse-tree/pt.h b/libinterp/parse-tree/pt.h rename from src/parse-tree/pt.h rename to libinterp/parse-tree/pt.h diff --git a/src/parse-tree/token.cc b/libinterp/parse-tree/token.cc rename from src/parse-tree/token.cc rename to libinterp/parse-tree/token.cc diff --git a/src/parse-tree/token.h b/libinterp/parse-tree/token.h rename from src/parse-tree/token.h rename to libinterp/parse-tree/token.h diff --git a/src/template-inst/Array-jit.cc b/libinterp/template-inst/Array-jit.cc rename from src/template-inst/Array-jit.cc rename to libinterp/template-inst/Array-jit.cc diff --git a/src/template-inst/Array-os.cc b/libinterp/template-inst/Array-os.cc rename from src/template-inst/Array-os.cc rename to libinterp/template-inst/Array-os.cc diff --git a/src/template-inst/Array-sym.cc b/libinterp/template-inst/Array-sym.cc rename from src/template-inst/Array-sym.cc rename to libinterp/template-inst/Array-sym.cc diff --git a/src/template-inst/Array-tc.cc b/libinterp/template-inst/Array-tc.cc rename from src/template-inst/Array-tc.cc rename to libinterp/template-inst/Array-tc.cc diff --git a/src/template-inst/module.mk b/libinterp/template-inst/module.mk rename from src/template-inst/module.mk rename to libinterp/template-inst/module.mk diff --git a/src/version.in.h b/libinterp/version.in.h rename from src/version.in.h rename to libinterp/version.in.h diff --git a/liboctave/Array.cc b/liboctave/Array.cc --- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -28,7 +28,6 @@ #endif #include -#include #include #include diff --git a/liboctave/Array.h b/liboctave/Array.h --- a/liboctave/Array.h +++ b/liboctave/Array.h @@ -237,7 +237,7 @@ public: - ~Array (void) + virtual ~Array (void) { if (--rep->count == 0) delete rep; @@ -646,30 +646,7 @@ template bool test (F fcn) const { - octave_idx_type len = length (); - - const T *m = data (); - - octave_idx_type i; - for (i = 0; i < len - 3; i += 4) - { - octave_quit (); - - if (fcn (m[i]) != zero - || fcn (m[i+1]) != zero - || fcn (m[i+2]) != zero - || fcn (m[i+3]) != zero) - return ! zero; - - } - - octave_quit (); - - for (; i < len; i++) - if (fcn (m[i]) != zero) - return ! zero; - - return zero; + return any_all_test (fcn, data (), length ()); } // Simpler calls. diff --git a/liboctave/CMatrix.cc b/liboctave/CMatrix.cc --- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -1192,9 +1192,9 @@ if (tol <= 0.0) { if (nr > nc) - tol = nr * sigma.elem (0) * DBL_EPSILON; + tol = nr * sigma.elem (0) * std::numeric_limits::epsilon (); else - tol = nc * sigma.elem (0) * DBL_EPSILON; + tol = nc * sigma.elem (0) * std::numeric_limits::epsilon (); } while (r >= 0 && sigma.elem (r) < tol) @@ -3162,25 +3162,7 @@ bool ComplexMatrix::too_large_for_float (void) const { - octave_idx_type nr = rows (); - octave_idx_type nc = cols (); - - for (octave_idx_type j = 0; j < nc; j++) - for (octave_idx_type i = 0; i < nr; i++) - { - Complex val = elem (i, j); - - double r_val = std::real (val); - double i_val = std::imag (val); - - if ((! (xisnan (r_val) || xisinf (r_val)) - && fabs (r_val) > FLT_MAX) - || (! (xisnan (i_val) || xisinf (i_val)) - && fabs (i_val) > FLT_MAX)) - return true; - } - - return false; + return test_any (xtoo_large_for_float); } // FIXME Do these really belong here? Maybe they should be diff --git a/liboctave/CNDArray.cc b/liboctave/CNDArray.cc --- a/liboctave/CNDArray.cc +++ b/liboctave/CNDArray.cc @@ -584,23 +584,7 @@ bool ComplexNDArray::too_large_for_float (void) const { - octave_idx_type nel = nelem (); - - for (octave_idx_type i = 0; i < nel; i++) - { - Complex val = elem (i); - - double r_val = std::real (val); - double i_val = std::imag (val); - - if ((! (xisnan (r_val) || xisinf (r_val)) - && fabs (r_val) > FLT_MAX) - || (! (xisnan (i_val) || xisinf (i_val)) - && fabs (i_val) > FLT_MAX)) - return true; - } - - return false; + return test_any (xtoo_large_for_float); } boolNDArray diff --git a/liboctave/CSparse.cc b/liboctave/CSparse.cc --- a/liboctave/CSparse.cc +++ b/liboctave/CSparse.cc @@ -7299,23 +7299,7 @@ bool SparseComplexMatrix::too_large_for_float (void) const { - octave_idx_type nel = nnz (); - - for (octave_idx_type i = 0; i < nel; i++) - { - Complex val = data (i); - - double r_val = std::real (val); - double i_val = std::imag (val); - - if (r_val > FLT_MAX - || i_val > FLT_MAX - || r_val < FLT_MIN - || i_val < FLT_MIN) - return true; - } - - return false; + return test_any (xtoo_large_for_float); } // FIXME Do these really belong here? Maybe they should be diff --git a/liboctave/CollocWt.cc b/liboctave/CollocWt.cc --- a/liboctave/CollocWt.cc +++ b/liboctave/CollocWt.cc @@ -230,12 +230,12 @@ if (++k > 100 || xisnan (z)) return false; - if (std::abs (z) <= 100 * DBL_EPSILON) + if (std::abs (z) <= 100 * std::numeric_limits::epsilon ()) done = true; } root[i] = x; - x = x + sqrt (DBL_EPSILON); + x = x + sqrt (std::numeric_limits::epsilon ()); } // Add interpolation points at x = 0 and/or x = 1. diff --git a/liboctave/DASPK-opts.in b/liboctave/DASPK-opts.in --- a/liboctave/DASPK-opts.in +++ b/liboctave/DASPK-opts.in @@ -32,13 +32,13 @@ SET_ARG_TYPE = "const $TYPE&" INIT_BODY $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = ::sqrt (DBL_EPSILON); + $OPTVAR(0) = ::sqrt (std::numeric_limits::epsilon ()); END_INIT_BODY SET_CODE void set_$OPT (double val) { $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); + $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits::epsilon ()); reset = true; } @@ -68,13 +68,13 @@ SET_ARG_TYPE = "const $TYPE&" INIT_BODY $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = ::sqrt (DBL_EPSILON); + $OPTVAR(0) = ::sqrt (std::numeric_limits::epsilon ()); END_INIT_BODY SET_CODE void set_$OPT (double val) { $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); + $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits::epsilon ()); reset = true; } @@ -172,7 +172,7 @@ $OPTVAR(1) = 6.0; $OPTVAR(2) = 5.0; $OPTVAR(3) = 0.0; - $OPTVAR(4) = ::pow (DBL_EPSILON, 2.0/3.0); + $OPTVAR(4) = ::pow (std::numeric_limits::epsilon (), 2.0/3.0); $OPTVAR(5) = 0.01; END_INIT_BODY SET_EXPR = "val" diff --git a/liboctave/DASRT-opts.in b/liboctave/DASRT-opts.in --- a/liboctave/DASRT-opts.in +++ b/liboctave/DASRT-opts.in @@ -32,13 +32,13 @@ SET_ARG_TYPE = "const $TYPE&" INIT_BODY $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = ::sqrt (DBL_EPSILON); + $OPTVAR(0) = ::sqrt (std::numeric_limits::epsilon ()); END_INIT_BODY SET_CODE void set_$OPT (double val) { $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); + $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits::epsilon ()); reset = true; } @@ -68,13 +68,13 @@ SET_ARG_TYPE = "const $TYPE&" INIT_BODY $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = ::sqrt (DBL_EPSILON); + $OPTVAR(0) = ::sqrt (std::numeric_limits::epsilon ()); END_INIT_BODY SET_CODE void set_$OPT (double val) { $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); + $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits::epsilon ()); reset = true; } diff --git a/liboctave/DASSL-opts.in b/liboctave/DASSL-opts.in --- a/liboctave/DASSL-opts.in +++ b/liboctave/DASSL-opts.in @@ -32,13 +32,13 @@ SET_ARG_TYPE = "const $TYPE&" INIT_BODY $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = ::sqrt (DBL_EPSILON); + $OPTVAR(0) = ::sqrt (std::numeric_limits::epsilon ()); END_INIT_BODY SET_CODE void set_$OPT (double val) { $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); + $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits::epsilon ()); reset = true; } @@ -68,13 +68,13 @@ SET_ARG_TYPE = "const $TYPE&" INIT_BODY $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = ::sqrt (DBL_EPSILON); + $OPTVAR(0) = ::sqrt (std::numeric_limits::epsilon ()); END_INIT_BODY SET_CODE void set_$OPT (double val) { $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); + $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits::epsilon ()); reset = true; } diff --git a/liboctave/LSODE-opts.in b/liboctave/LSODE-opts.in --- a/liboctave/LSODE-opts.in +++ b/liboctave/LSODE-opts.in @@ -31,13 +31,13 @@ SET_ARG_TYPE = "const $TYPE&" INIT_BODY $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = ::sqrt (DBL_EPSILON); + $OPTVAR(0) = ::sqrt (std::numeric_limits::epsilon ()); END_INIT_BODY SET_CODE void set_$OPT (double val) { $OPTVAR.resize (dim_vector (1, 1)); - $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); + $OPTVAR(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits::epsilon ()); reset = true; } @@ -63,8 +63,8 @@ END_DOC_ITEM TYPE = "double" - INIT_VALUE = "::sqrt (DBL_EPSILON)" - SET_EXPR = "(val > 0.0) ? val : ::sqrt (DBL_EPSILON)" + INIT_VALUE = "::sqrt (std::numeric_limits::epsilon ())" + SET_EXPR = "(val > 0.0) ? val : ::sqrt (std::numeric_limits::epsilon ())" END_OPTION OPTION diff --git a/liboctave/Makefile.am b/liboctave/Makefile.am --- a/liboctave/Makefile.am +++ b/liboctave/Makefile.am @@ -22,9 +22,8 @@ ## Search local directories before those specified by the user. AM_CPPFLAGS = \ - -I../libgnu -I$(top_srcdir)/libgnu \ - -I$(top_srcdir)/libcruft/misc \ - @CPPFLAGS@ + -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu \ + -I$(top_srcdir)/libcruft/misc EXTRA_DIST = \ config-ops.sh \ diff --git a/liboctave/Quad-opts.in b/liboctave/Quad-opts.in --- a/liboctave/Quad-opts.in +++ b/liboctave/Quad-opts.in @@ -25,7 +25,7 @@ END_DOC_ITEM TYPE = "double" - INIT_VALUE = "::sqrt (DBL_EPSILON)" + INIT_VALUE = "::sqrt (std::numeric_limits::epsilon ())" SET_EXPR = "val" END_OPTION @@ -38,7 +38,7 @@ END_DOC_ITEM TYPE = "double" - INIT_VALUE = "::sqrt (DBL_EPSILON)" + INIT_VALUE = "::sqrt (std::numeric_limits::epsilon ())" SET_EXPR = "val" END_OPTION @@ -50,7 +50,7 @@ END_DOC_ITEM TYPE = "float" - INIT_VALUE = "::sqrt (FLT_EPSILON)" + INIT_VALUE = "::sqrt (std::numeric_limits::epsilon ())" SET_EXPR = "val" END_OPTION @@ -62,6 +62,6 @@ @w{@code{max (50*eps, 0.5e-28)}}. END_DOC_ITEM TYPE = "float" - INIT_VALUE = "::sqrt (FLT_EPSILON)" + INIT_VALUE = "::sqrt (std::numeric_limits::epsilon ())" SET_EXPR = "val" END_OPTION diff --git a/liboctave/Range.cc b/liboctave/Range.cc --- a/liboctave/Range.cc +++ b/liboctave/Range.cc @@ -456,7 +456,7 @@ } static inline bool -teq (double u, double v, double ct = 3.0 * DBL_EPSILON) +teq (double u, double v, double ct = 3.0 * std::numeric_limits::epsilon ()) { double tu = fabs (u); double tv = fabs (v); @@ -477,7 +477,7 @@ } else { - double ct = 3.0 * DBL_EPSILON; + double ct = 3.0 * std::numeric_limits::epsilon (); double tmp = tfloor ((rng_limit - rng_base + rng_inc) / rng_inc, ct); diff --git a/liboctave/Sparse.cc b/liboctave/Sparse.cc --- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -28,10 +28,10 @@ #endif #include -#include #include #include +#include #include #include diff --git a/liboctave/Sparse.h b/liboctave/Sparse.h --- a/liboctave/Sparse.h +++ b/liboctave/Sparse.h @@ -584,6 +584,35 @@ Array array_value (void) const; + // Generic any/all test functionality with arbitrary predicate. + template + bool test (F fcn) const + { + return any_all_test (fcn, data (), nnz ()); + } + + // Simpler calls. + template + bool test_any (F fcn) const + { return test (fcn); } + + template + bool test_all (F fcn) const + { return test (fcn); } + + // Overloads for function references. + bool test_any (bool (&fcn) (T)) const + { return test (fcn); } + + bool test_any (bool (&fcn) (const T&)) const + { return test (fcn); } + + bool test_all (bool (&fcn) (T)) const + { return test (fcn); } + + bool test_all (bool (&fcn) (const T&)) const + { return test (fcn); } + template Sparse map (F fcn) const diff --git a/liboctave/chNDArray.cc b/liboctave/chNDArray.cc --- a/liboctave/chNDArray.cc +++ b/liboctave/chNDArray.cc @@ -79,7 +79,7 @@ { octave_idx_type ival = NINTbig (d); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits::max ()) // FIXME -- is there something // better we could do? Should we warn the user? ival = 0; diff --git a/liboctave/dMatrix.cc b/liboctave/dMatrix.cc --- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -865,9 +865,9 @@ if (tol <= 0.0) { if (nr > nc) - tol = nr * sigma.elem (0) * DBL_EPSILON; + tol = nr * sigma.elem (0) * std::numeric_limits::epsilon (); else - tol = nc * sigma.elem (0) * DBL_EPSILON; + tol = nc * sigma.elem (0) * std::numeric_limits::epsilon (); } while (r >= 0 && sigma.elem (r) < tol) @@ -2723,7 +2723,7 @@ bool Matrix::too_large_for_float (void) const { - return test_all (xtoo_large_for_float); + return test_any (xtoo_large_for_float); } // FIXME Do these really belong here? Maybe they should be diff --git a/liboctave/dNDArray.cc b/liboctave/dNDArray.cc --- a/liboctave/dNDArray.cc +++ b/liboctave/dNDArray.cc @@ -632,7 +632,7 @@ bool NDArray::too_large_for_float (void) const { - return test_all (xtoo_large_for_float); + return test_any (xtoo_large_for_float); } // FIXME -- this is not quite the right thing. @@ -776,7 +776,7 @@ { octave_idx_type ival = NINTbig (d); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits::max ()) // FIXME -- is there something // better we could do? Should we warn the user? ival = 0; diff --git a/liboctave/dSparse.cc b/liboctave/dSparse.cc --- a/liboctave/dSparse.cc +++ b/liboctave/dSparse.cc @@ -7418,17 +7418,7 @@ bool SparseMatrix::too_large_for_float (void) const { - octave_idx_type nel = nnz (); - - for (octave_idx_type i = 0; i < nel; i++) - { - double val = data (i); - - if (val > FLT_MAX || val < FLT_MIN) - return true; - } - - return false; + return test_any (xtoo_large_for_float); } SparseBoolMatrix diff --git a/liboctave/data-conv.cc b/liboctave/data-conv.cc --- a/liboctave/data-conv.cc +++ b/liboctave/data-conv.cc @@ -25,6 +25,7 @@ #endif #include +#include #include #include diff --git a/liboctave/data-conv.h b/liboctave/data-conv.h --- a/liboctave/data-conv.h +++ b/liboctave/data-conv.h @@ -23,7 +23,7 @@ #if !defined (octave_data_conv_h) #define octave_data_conv_h 1 -#include +#include #include "mach-info.h" diff --git a/liboctave/eigs-base.cc b/liboctave/eigs-base.cc --- a/liboctave/eigs-base.cc +++ b/liboctave/eigs-base.cc @@ -3672,7 +3672,8 @@ octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, const Matrix& b, ColumnVector &permB, ColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3682,7 +3683,8 @@ octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, const SparseMatrix& b, ColumnVector &permB, ColumnVector &resid, - std::ostream& os, double tol = DBL_EPSILON, + std::ostream& os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3692,7 +3694,8 @@ octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, const Matrix& b, ColumnVector &permB, ColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3702,7 +3705,8 @@ octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, const SparseMatrix& b, ColumnVector &permB, ColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3713,8 +3717,9 @@ octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, ColumnVector &resid, std::ostream &os, - double tol = DBL_EPSILON, bool rvec = false, - bool cholB = 0, int disp = 0, int maxit = 300); + double tol = std::numeric_limits::epsilon (), + bool rvec = false, bool cholB = 0, int disp = 0, + int maxit = 300); extern octave_idx_type EigsRealNonSymmetricMatrix (const Matrix& m, const std::string typ, @@ -3722,7 +3727,8 @@ octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, const Matrix& b, ColumnVector &permB, ColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3733,7 +3739,8 @@ ComplexColumnVector &eig_val, const SparseMatrix& b, ColumnVector &permB, ColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3744,7 +3751,8 @@ ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, const Matrix& b, ColumnVector &permB, ColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3756,7 +3764,8 @@ ComplexColumnVector &eig_val, const SparseMatrix& b, ColumnVector &permB, ColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3767,8 +3776,9 @@ octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, ColumnVector &resid, std::ostream& os, - double tol = DBL_EPSILON, bool rvec = false, - bool cholB = 0, int disp = 0, int maxit = 300); + double tol = std::numeric_limits::epsilon (), + bool rvec = false, bool cholB = 0, int disp = 0, + int maxit = 300); extern octave_idx_type EigsComplexNonSymmetricMatrix (const ComplexMatrix& m, const std::string typ, @@ -3777,7 +3787,8 @@ ComplexColumnVector &eig_val, const ComplexMatrix& b, ColumnVector &permB, ComplexColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3790,7 +3801,8 @@ const SparseComplexMatrix& b, ColumnVector &permB, ComplexColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3803,7 +3815,8 @@ const ComplexMatrix& b, ColumnVector &permB, ComplexColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3817,7 +3830,8 @@ const SparseComplexMatrix& b, ColumnVector &permB, ComplexColumnVector &resid, - std::ostream &os, double tol = DBL_EPSILON, + std::ostream &os, + double tol = std::numeric_limits::epsilon (), bool rvec = false, bool cholB = 0, int disp = 0, int maxit = 300); @@ -3828,8 +3842,9 @@ octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, ComplexColumnVector &resid, std::ostream& os, - double tol = DBL_EPSILON, bool rvec = false, - bool cholB = 0, int disp = 0, int maxit = 300); + double tol = std::numeric_limits::epsilon (), + bool rvec = false, bool cholB = 0, + int disp = 0, int maxit = 300); #endif #ifndef _MSC_VER diff --git a/liboctave/fCMatrix.cc b/liboctave/fCMatrix.cc --- a/liboctave/fCMatrix.cc +++ b/liboctave/fCMatrix.cc @@ -1194,9 +1194,9 @@ if (tol <= 0.0) { if (nr > nc) - tol = nr * sigma.elem (0) * DBL_EPSILON; + tol = nr * sigma.elem (0) * std::numeric_limits::epsilon (); else - tol = nc * sigma.elem (0) * DBL_EPSILON; + tol = nc * sigma.elem (0) * std::numeric_limits::epsilon (); } while (r >= 0 && sigma.elem (r) < tol) @@ -3158,24 +3158,6 @@ bool FloatComplexMatrix::too_large_for_float (void) const { - octave_idx_type nr = rows (); - octave_idx_type nc = cols (); - - for (octave_idx_type j = 0; j < nc; j++) - for (octave_idx_type i = 0; i < nr; i++) - { - FloatComplex val = elem (i, j); - - float r_val = std::real (val); - float i_val = std::imag (val); - - if ((! (xisnan (r_val) || xisinf (r_val)) - && fabs (r_val) > FLT_MAX) - || (! (xisnan (i_val) || xisinf (i_val)) - && fabs (i_val) > FLT_MAX)) - return true; - } - return false; } diff --git a/liboctave/fCNDArray.cc b/liboctave/fCNDArray.cc --- a/liboctave/fCNDArray.cc +++ b/liboctave/fCNDArray.cc @@ -581,22 +581,6 @@ bool FloatComplexNDArray::too_large_for_float (void) const { - octave_idx_type nel = nelem (); - - for (octave_idx_type i = 0; i < nel; i++) - { - FloatComplex val = elem (i); - - float r_val = std::real (val); - float i_val = std::imag (val); - - if ((! (xisnan (r_val) || xisinf (r_val)) - && fabs (r_val) > FLT_MAX) - || (! (xisnan (i_val) || xisinf (i_val)) - && fabs (i_val) > FLT_MAX)) - return true; - } - return false; } diff --git a/liboctave/fMatrix.cc b/liboctave/fMatrix.cc --- a/liboctave/fMatrix.cc +++ b/liboctave/fMatrix.cc @@ -865,9 +865,9 @@ if (tol <= 0.0) { if (nr > nc) - tol = nr * sigma.elem (0) * DBL_EPSILON; + tol = nr * sigma.elem (0) * std::numeric_limits::epsilon (); else - tol = nc * sigma.elem (0) * DBL_EPSILON; + tol = nc * sigma.elem (0) * std::numeric_limits::epsilon (); } while (r >= 0 && sigma.elem (r) < tol) diff --git a/liboctave/fNDArray.cc b/liboctave/fNDArray.cc --- a/liboctave/fNDArray.cc +++ b/liboctave/fNDArray.cc @@ -736,7 +736,7 @@ { octave_idx_type ival = NINTbig (d); - if (ival < 0 || ival > UCHAR_MAX) + if (ival < 0 || ival > std::numeric_limits::max ()) // FIXME -- is there something // better we could do? Should we warn the user? ival = 0; diff --git a/liboctave/kpse.cc b/liboctave/kpse.cc --- a/liboctave/kpse.cc +++ b/liboctave/kpse.cc @@ -129,7 +129,6 @@ #include #include #include -#include #include #include diff --git a/liboctave/link-deps.mk b/liboctave/link-deps.mk --- a/liboctave/link-deps.mk +++ b/liboctave/link-deps.mk @@ -1,4 +1,4 @@ -include ../libcruft/link-deps.mk +include $(top_srcdir)/libcruft/link-deps.mk LIBOCTAVE_LINK_DEPS = \ $(SPARSE_XLIBS) \ diff --git a/liboctave/lo-cutils.c b/liboctave/lo-cutils.c --- a/liboctave/lo-cutils.c +++ b/liboctave/lo-cutils.c @@ -24,6 +24,8 @@ #include #endif +#include "lo-error.h" + /* This gives us a better chance of finding a prototype for strptime on some systems. */ @@ -76,3 +78,123 @@ { return WAITPID (pid, status, options); } + +static void +gripe_missing_wait_macro (const char *id, int status) +{ + (*current_liboctave_warning_handler) + ("%s always returns false in this version of Octave; status = %d", + id, status); +} + +OCTAVE_API int +octave_wifexited (int status) +{ + int retval = 0; + +#if defined (WIFEXITED) + retval = WIFEXITED (status); +#else + gripe_missing_wait_macro ("WIFEXITED", status); +#endif + + return retval; +} + +OCTAVE_API int +octave_wexitstatus (int status) +{ + int retval = 0; + +#if defined (WEXITSTATUS) + retval = WEXITSTATUS (status); +#else + gripe_missing_wait_macro ("WEXITSTATUS", status); +#endif + + return retval; +} + +OCTAVE_API int +octave_wifsignaled (int status) +{ + int retval = 0; + +#if defined (WIFSIGNALED) + retval = WIFSIGNALED (status); +#else + gripe_missing_wait_macro ("WIFSIGNALED", status); +#endif + + return retval; +} + +OCTAVE_API int +octave_wtermsig (int status) +{ + int retval = 0; + +#if defined (WTERMSIG) + retval = WTERMSIG (status); +#else + gripe_missing_wait_macro ("WTERMSIG", status); +#endif + + return retval; +} + +OCTAVE_API int +octave_wcoredump (int status) +{ + int retval = 0; + +#if defined (WCOREDUMP) + retval = WCOREDUMP (status); +#else + gripe_missing_wait_macro ("WCOREDUMP", status); +#endif + + return retval; +} + +OCTAVE_API int +octave_wifstopped (int status) +{ + int retval = 0; + +#if defined (WIFSTOPPED) + retval = WIFSTOPPED (status); +#else + gripe_missing_wait_macro ("WIFSTOPPED", status); +#endif + + return retval; +} + +OCTAVE_API int +octave_wstopsig (int status) +{ + int retval = 0; + +#if defined (WSTOPSIG) + retval = WSTOPSIG (status); +#else + gripe_missing_wait_macro ("WSTOPSIG", status); +#endif + + return retval; +} + +OCTAVE_API int +octave_wifcontinued (int status) +{ + int retval = 0; + +#if defined (WIFCONTINUED) + retval = WIFCONTINUED (status); +#else + gripe_missing_wait_macro ("WIFCONTINUED", status); +#endif + + return retval; +} diff --git a/liboctave/lo-cutils.h b/liboctave/lo-cutils.h --- a/liboctave/lo-cutils.h +++ b/liboctave/lo-cutils.h @@ -50,6 +50,15 @@ OCTAVE_API pid_t octave_waitpid (pid_t pid, int *status, int options); +OCTAVE_API int octave_wifexited (int status); +OCTAVE_API int octave_wexitstatus (int status); +OCTAVE_API int octave_wifsignaled (int status); +OCTAVE_API int octave_wtermsig (int status); +OCTAVE_API int octave_wcoredump (int status); +OCTAVE_API int octave_wifstopped (int status); +OCTAVE_API int octave_wstopsig (int status); +OCTAVE_API int octave_wifcontinued (int status); + #ifdef __cplusplus } #endif diff --git a/liboctave/lo-specfun.cc b/liboctave/lo-specfun.cc --- a/liboctave/lo-specfun.cc +++ b/liboctave/lo-specfun.cc @@ -3195,7 +3195,7 @@ term = 1.0; ai = 1.0; value = 1.0; - ns = (int) (qq + cx * psq); + ns = static_cast (qq + cx * psq); // Use the Soper reduction formula. @@ -3263,7 +3263,8 @@ // Volume 26, Number 1, 1977, pages 111-114. // double -betaincinv (double y, double p, double q) { +betaincinv (double y, double p, double q) +{ double a, acu, adj, fpu, g, h; int iex; bool indx; diff --git a/liboctave/lo-utils.cc b/liboctave/lo-utils.cc --- a/liboctave/lo-utils.cc +++ b/liboctave/lo-utils.cc @@ -54,7 +54,16 @@ { return x == 0; } bool xtoo_large_for_float (double x) -{ return (! (xisnan (x) || xisinf (x)) && fabs (x) > FLT_MAX); } +{ + return (! (xisnan (x) || xisinf (x)) + && fabs (x) > std::numeric_limits::max ()); +} + +bool xtoo_large_for_float (const Complex& x) +{ + return (xtoo_large_for_float (x.real ()) + || xtoo_large_for_float (x.imag ())); +} bool xis_int_or_inf_or_nan (float x) { return xisnan (x) || D_NINT (x) == x; } diff --git a/liboctave/lo-utils.h b/liboctave/lo-utils.h --- a/liboctave/lo-utils.h +++ b/liboctave/lo-utils.h @@ -28,14 +28,46 @@ #include #include +#include "quit.h" + #include "lo-cutils.h" #include "oct-cmplx.h" +// Generic any/all test functionality with arbitrary predicate. + +template +bool +any_all_test (F fcn, const T *m, octave_idx_type len) +{ + octave_idx_type i; + + for (i = 0; i < len - 3; i += 4) + { + octave_quit (); + + if (fcn (m[i]) != zero + || fcn (m[i+1]) != zero + || fcn (m[i+2]) != zero + || fcn (m[i+3]) != zero) + return ! zero; + } + + octave_quit (); + + for (; i < len; i++) + if (fcn (m[i]) != zero) + return ! zero; + + return zero; +} + extern OCTAVE_API bool xis_int_or_inf_or_nan (double x); extern OCTAVE_API bool xis_one_or_zero (double x); extern OCTAVE_API bool xis_zero (double x); extern OCTAVE_API bool xtoo_large_for_float (double x); +extern OCTAVE_API bool xtoo_large_for_float (const Complex& x); + extern OCTAVE_API bool xis_int_or_inf_or_nan (float x); extern OCTAVE_API bool xis_one_or_zero (float x); extern OCTAVE_API bool xis_zero (float x); @@ -103,4 +135,52 @@ extern OCTAVE_API void octave_write_float_complex (std::ostream& os, const FloatComplex& cval); +// Maybe this is overkill, but it allos + +class +octave_wait +{ +public: + + static bool ifexited (int status) + { + return octave_wifexited (status); + } + + static int exitstatus (int status) + { + return octave_wexitstatus (status); + } + + static bool ifsignaled (int status) + { + return octave_wifsignaled (status); + } + + static int termsig (int status) + { + return octave_wtermsig (status); + } + + static bool coredump (int status) + { + return octave_wcoredump (status); + } + + static bool ifstopped (int status) + { + return octave_wifstopped (status); + } + + static int stopsig (int status) + { + return octave_wstopsig (status); + } + + static bool ifcontinued (int status) + { + return octave_wifcontinued (status); + } +}; + #endif diff --git a/liboctave/oct-inttypes.h b/liboctave/oct-inttypes.h --- a/liboctave/oct-inttypes.h +++ b/liboctave/oct-inttypes.h @@ -24,7 +24,6 @@ #if !defined (octave_inttypes_h) #define octave_inttypes_h 1 -#include #include #include diff --git a/liboctave/oct-time.cc b/liboctave/oct-time.cc --- a/liboctave/oct-time.cc +++ b/liboctave/oct-time.cc @@ -24,7 +24,8 @@ #include #endif -#include +#include + #include #include @@ -121,7 +122,8 @@ DEFINE_SET_INT_FIELD_FCN (hour, 0, 23) DEFINE_SET_INT_FIELD_FCN (mday, 1, 31) DEFINE_SET_INT_FIELD_FCN (mon, 0, 11) -DEFINE_SET_INT_FIELD_FCN (year, INT_MIN, INT_MAX) +DEFINE_SET_INT_FIELD_FCN (year, std::numeric_limits::min (), + std::numeric_limitd::max ()) DEFINE_SET_INT_FIELD_FCN (wday, 0, 6) DEFINE_SET_INT_FIELD_FCN (yday, 0, 365) DEFINE_SET_INT_FIELD_FCN (isdst, 0, 1) @@ -256,7 +258,7 @@ t.tm_hour = 0; t.tm_mday = 0; t.tm_mon = -1; - t.tm_year = INT_MIN; + t.tm_year = std::numeric_limits::min (); t.tm_wday = 0; t.tm_yday = 0; t.tm_isdst = 0; @@ -276,7 +278,8 @@ // Fill in wday and yday, but only if mday is valid and the mon and year // are filled in, avoiding issues with mktime and invalid dates. - if (t.tm_mday != 0 && t.tm_mon >= 0 && t.tm_year != INT_MIN) + if (t.tm_mday != 0 && t.tm_mon >= 0 + && t.tm_year != std::numeric_limits::min ()) { t.tm_isdst = -1; gnulib::mktime (&t); @@ -285,7 +288,7 @@ if (t.tm_mon < 0) t.tm_mon = 0; - if (t.tm_year == INT_MIN) + if (t.tm_year == std::numeric_limits::min ()) t.tm_year = 0; if (q) diff --git a/liboctave/sparse-base-chol.cc b/liboctave/sparse-base-chol.cc --- a/liboctave/sparse-base-chol.cc +++ b/liboctave/sparse-base-chol.cc @@ -80,7 +80,7 @@ template octave_idx_type sparse_base_chol::sparse_base_chol_rep::init - (const chol_type& a, bool natural) + (const chol_type& a, bool natural, octave_idx_type nargout) { volatile octave_idx_type info = 0; #ifdef HAVE_CHOLMOD @@ -170,7 +170,7 @@ is_pd = cm->status == CHOLMOD_OK; info = (is_pd ? 0 : cm->status); - if (is_pd) + if (is_pd || nargout > 1) { BEGIN_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE; cond = CHOLMOD_NAME(rcond) (Lfactor, cm); diff --git a/liboctave/sparse-base-chol.h b/liboctave/sparse-base-chol.h --- a/liboctave/sparse-base-chol.h +++ b/liboctave/sparse-base-chol.h @@ -53,7 +53,7 @@ : count (1), Lsparse (0), Common (), is_pd (false), minor_p (0), perms (), cond (0) { - info = init (a, natural); + info = init (a, natural, info); } ~sparse_base_chol_rep (void) @@ -93,7 +93,8 @@ double cond; - octave_idx_type init (const chol_type& a, bool natural = true); + octave_idx_type init (const chol_type& a, bool natural = true, + octave_idx_type nargout = 1); void drop_zeros (const cholmod_sparse* S); @@ -113,12 +114,16 @@ sparse_base_chol_rep (const chol_type& a, const bool natural) : count (1), is_pd (false), minor_p (0), perms (), cond (0) - { init (a, natural); } + { + init (a, natural); + } sparse_base_chol_rep (const chol_type& a, octave_idx_type& info, const bool natural) : count (1), is_pd (false), minor_p (0), perms (), cond (0) - { info = init (a, natural); } + { + info = init (a, natural, info); + } ~sparse_base_chol_rep (void) { } @@ -143,7 +148,8 @@ double cond; - octave_idx_type init (const chol_type& a, bool natural = true); + octave_idx_type init (const chol_type& a, bool natural = true, + octave_idx_type nargout = 0); // No copying! diff --git a/liboctave/sparse-util.cc b/liboctave/sparse-util.cc --- a/liboctave/sparse-util.cc +++ b/liboctave/sparse-util.cc @@ -28,6 +28,7 @@ #include #include #include "lo-error.h" +#include "oct-sparse.h" #include "sparse-util.h" // FIXME this overload is here due to API change in SuiteSparse (3.1 -> 3.2) @@ -40,10 +41,15 @@ void SparseCholError (int status, const char *file, int line, const char *message) { - (*current_liboctave_warning_handler)("warning %i, at line %i in file %s", - status, line, file); + // Ignore CHOLMOD_NOT_POSDEF, since we handle that in Fchol as an + // error or exit status. + if (status != CHOLMOD_NOT_POSDEF) + { + (*current_liboctave_warning_handler)("warning %i, at line %i in file %s", + status, line, file); - (*current_liboctave_warning_handler)(message); + (*current_liboctave_warning_handler)(message); + } } int diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -37,271 +37,55 @@ dnl dnl ---------------------------------------------------------------------- dnl -dnl Figure out the hardware-vendor-os info. -dnl -dnl OCTAVE_HOST_TYPE -AC_DEFUN([OCTAVE_HOST_TYPE], -[AC_CANONICAL_HOST -if test -z "$host"; then - host=unknown -fi -canonical_host_type=$host -if test "$host" = unknown; then - AC_MSG_WARN([configuring Octave for unknown system type -]) -fi -AC_SUBST(canonical_host_type)]) -dnl -dnl Set default value for a variable and substitute it. -dnl -dnl OCTAVE_SET_DEFAULT -AC_DEFUN([OCTAVE_SET_DEFAULT], -[ifelse($#, 2, [: ${$1=$2} -])dnl -AC_MSG_RESULT([defining $1 to be $$1]) -AC_SUBST($1)]) -dnl -dnl Check for ar. -dnl -AC_DEFUN([OCTAVE_PROG_AR], -[if test -z "$AR"; then - AR=ar -fi -AC_SUBST(AR) -if test -z "$ARFLAGS"; then - ARFLAGS="rc" -fi -AC_SUBST(ARFLAGS) -]) -dnl -dnl See if the compiler supports placement delete dnl -AC_DEFUN([OCTAVE_PLACEMENT_DELETE], -[AC_CACHE_CHECK([whether defines placement delete operator], -octave_cv_placement_delete, -[AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[operator delete((void *)0, (void *)0);]])], -octave_cv_placement_delete=yes, octave_cv_placement_delete=no)]) -if test $octave_cv_placement_delete = yes; then -AC_DEFINE(HAVE_PLACEMENT_DELETE,1,[Define to 1 if C++ supports operator delete(void *, void *).]) -fi -AC_LANG_POP(C++) -]) -dnl -dnl See if the compiler dynamic auto arrays +dnl Alphabetical list of macros in the OCTAVE_ namespace dnl -AC_DEFUN([OCTAVE_DYNAMIC_AUTO_ARRAYS], -[AC_CACHE_CHECK([whether C++ supports dynamic auto arrays], -octave_cv_dynamic_auto_arrays, -[AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], -[[void test(char *); int length(); char x[length()]; test(x);]])], -octave_cv_dynamic_auto_arrays=yes, octave_cv_dynamic_auto_arrays=no)]) -if test $octave_cv_dynamic_auto_arrays = yes; then -AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS,1,[Define to 1 if C++ supports dynamic auto arrays.]) -fi -AC_LANG_POP(C++) -]) -dnl -dnl See if the C++ library has the bit_and, bit_or and bit_xor -dnl templates defined. -dnl -AC_DEFUN([OCTAVE_CXX_BITWISE_OP_TEMPLATES], -[AC_CACHE_CHECK([whether bit_and, bit_or and bit_xor are defined in the c++ library], -octave_cv_cxx_bitwise_op_templates, -[AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[int x = 0; -int y = 1; -int z1 = std::bit_and() (x, y); -int z2 = std::bit_or() (x, y); -int z3 = std::bit_xor() (x, y);]])], -octave_cv_cxx_bitwise_op_templates=yes, octave_cv_cxx_bitwise_op_templates=no)]) -if test $octave_cv_cxx_bitwise_op_templates = yes; then -AC_DEFINE(HAVE_CXX_BITWISE_OP_TEMPLATES,1,[Define to 1 if C++ library has templated bitwise operators.]) -fi -AC_LANG_POP(C++) -]) dnl -dnl See if the C++ library has functions to set real and imaginary -dnl parts of complex numbers independently. -dnl -AC_DEFUN([OCTAVE_CXX_COMPLEX_SETTERS], -[AC_CACHE_CHECK([whether complex class can set components independently], -octave_cv_cxx_complex_setters, -[AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[std::complex x; x.real (1.0); x.imag (2.0);]])], -octave_cv_cxx_complex_setters=yes, octave_cv_cxx_complex_setters=no)]) -if test $octave_cv_cxx_complex_setters = yes; then -AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS,1,[Define to 1 if C++ complex class has void real (T) and void imag (T) methods.]) -fi -AC_LANG_POP(C++) -]) -dnl -dnl See if the C++ library has functions to access real and imaginary -dnl parts of complex numbers independently via references. -dnl -AC_DEFUN([OCTAVE_CXX_COMPLEX_REFERENCE_ACCESSORS], -[AC_CACHE_CHECK([whether complex class can reference components independently], -octave_cv_cxx_complex_reference_accessors, -[AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], -[[std::complex x; x.real () = 1.0; x.imag () = 1.0;]])], -octave_cv_cxx_complex_reference_accessors=yes, octave_cv_cxx_complex_reference_accessors=no)]) -if test $octave_cv_cxx_complex_reference_accessors = yes; then -AC_DEFINE(HAVE_CXX_COMPLEX_REFERENCE_ACCESSORS,1,[Define to 1 if C++ complex class has T& real (void) and T& imag (void) methods.]) -fi -AC_LANG_POP(C++) -]) -dnl -dnl See if the Carbon Framework defines CGDisplayBitsPerPixel. -dnl -AC_DEFUN([OCTAVE_CARBON_CGDISPLAYBITSPERPIXEL], -[AC_CACHE_CHECK([whether CGDisplayBitsPerPixel is defined in the Carbon Framework], -octave_cv_carbon_cgdisplaybitsperpixel, -[AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -]], [[ -CGDirectDisplayID display = CGMainDisplayID (); -size_t depth = CGDisplayBitsPerPixel (display); -]])], -octave_cv_carbon_cgdisplaybitsperpixel=yes, octave_cv_carbon_cgdisplaybitsperpixel=no)]) -if test $octave_cv_carbon_cgdisplaybitsperpixel = yes; then -AC_DEFINE(HAVE_CARBON_CGDISPLAYBITSPERPIXEL,1,[Define to 1 if Carbon Framework has CGDisplayBitsPerPixel.]) -fi -AC_LANG_POP(C++) -]) -dnl -dnl The following test is from Karl Berry's Kpathseach library. I'm -dnl including it here in case we someday want to make the use of -dnl kpathsea optional. +dnl Check if the Carbon Framework defines CGDisplayBitsPerPixel. dnl -dnl Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment. -dnl This test program is due to Mike Hibler . -dnl We don't actually need to run this if we don't have putenv, but it -dnl doesn't hurt. -AC_DEFUN([OCTAVE_SMART_PUTENV], -[AC_MSG_CHECKING([whether putenv uses malloc]) -AC_CACHE_VAL(octave_cv_func_putenv_malloc, -[AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#define VAR "YOW_VAR" -#define STRING1 "GabbaGabbaHey" -#define STRING2 "Yow!!" /* should be shorter than STRING1 */ -extern char *getenv (); /* in case char* and int don't mix gracefully */ -main () -{ - char *str1, *rstr1, *str2, *rstr2; - str1 = getenv (VAR); - if (str1) - exit (1); - str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1); - if (str1 == 0) - exit (2); - strcpy (str1, VAR); - strcat (str1, "="); - strcat (str1, STRING1); - if (putenv (str1) < 0) - exit (3); - rstr1 = getenv (VAR); - if (rstr1 == 0) - exit (4); - rstr1 -= strlen (VAR) + 1; - if (strncmp (rstr1, VAR, strlen (VAR))) - exit (5); - str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1); - if (str2 == 0 || str1 == str2) - exit (6); - strcpy (str2, VAR); - strcat (str2, "="); - strcat (str2, STRING2); - if (putenv (str2) < 0) - exit (7); - rstr2 = getenv (VAR); - if (rstr2 == 0) - exit (8); - rstr2 -= strlen (VAR) + 1; -#if 0 - printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2); - /* - * If string from first call was reused for the second call, - * you had better not do a free on the first string! - */ - if (rstr1 == rstr2) - printf ("#define SMART_PUTENV\n"); - else - printf ("#undef SMART_PUTENV\n"); -#endif - exit (rstr1 == rstr2 ? 0 : 1); -}]])], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no, - octave_cv_func_putenv_malloc=no)])dnl -AC_MSG_RESULT([$octave_cv_func_putenv_malloc]) -if test $octave_cv_func_putenv_malloc = yes; then - AC_DEFINE(SMART_PUTENV,1,[To quiet autoheader.]) -fi]) -dnl -dnl Check to see if C++ compiler needs the new friend template declaration -dnl syntax. -dnl -dnl OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL -AC_DEFUN([OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL], [ - AC_REQUIRE([AC_PROG_CXX]) - AC_MSG_CHECKING([for C++ support for new friend template declaration]) - AC_CACHE_VAL(octave_cv_cxx_new_friend_template_decl, [ - AC_LANG_PUSH(C++) - rm -f conftest.h - cat > conftest.h < int - operator== (const T&, const T&) - { - return 0; - } -EOB - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "conftest.h"]], - [[A a (1); - return a == A(1);]])], - [octave_cv_cxx_new_friend_template_decl=no], - [octave_cv_cxx_new_friend_template_decl=yes]) +AC_DEFUN([OCTAVE_CARBON_CGDISPLAYBITSPERPIXEL], [ + AC_CACHE_CHECK([whether CGDisplayBitsPerPixel is defined in the Carbon Framework], + [octave_cv_func_carbon_cgdisplaybitsperpixel], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + CGDirectDisplayID display = CGMainDisplayID (); + size_t depth = CGDisplayBitsPerPixel (display); + ]])], + octave_cv_func_carbon_cgdisplaybitsperpixel=yes, + octave_cv_func_carbon_cgdisplaybitsperpixel=no) AC_LANG_POP(C++) ]) - AC_MSG_RESULT([$octave_cv_cxx_new_friend_template_decl]) - if test $octave_cv_cxx_new_friend_template_decl = yes; then - AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL,1,[Define to 1 if your compiler supports `<>' stuff for template friends.]) + if test $octave_cv_func_carbon_cgdisplaybitsperpixel = yes; then + AC_DEFINE(HAVE_CARBON_CGDISPLAYBITSPERPIXEL, 1, + [Define to 1 if Carbon Framework has CGDisplayBitsPerPixel.]) fi ]) dnl -dnl Check to see if C compiler handles FLAG command line option. If -dnl two arguments are specified, execute the second arg as shell -dnl commands. Otherwise, add FLAG to CFLAGS if the compiler accepts -dnl the flag. +dnl Check if C compiler handles FLAG command line option. If two +dnl arguments are specified, execute the second arg as shell commands. +dnl Otherwise, add FLAG to CFLAGS if the compiler accepts the flag. dnl -dnl OCTAVE_CC_FLAG AC_DEFUN([OCTAVE_CC_FLAG], [ ac_safe=`echo "$1" | sed 'y% ./+-:=%___p___%'` AC_MSG_CHECKING([whether ${CC-cc} accepts $1]) - AC_CACHE_VAL(octave_cv_cc_flag_$ac_safe, [ - AC_LANG_PUSH(C) + AC_CACHE_VAL([octave_cv_cc_flag_$ac_safe], + [AC_LANG_PUSH(C) XCFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], - eval "octave_cv_cc_flag_$ac_safe=yes", - eval "octave_cv_cc_flag_$ac_safe=no") + [eval "octave_cv_cc_flag_$ac_safe=yes"], + [eval "octave_cv_cc_flag_$ac_safe=no"]) CFLAGS="$XCFLAGS" AC_LANG_POP(C) ]) if eval "test \"`echo '$octave_cv_cc_flag_'$ac_safe`\" = yes"; then AC_MSG_RESULT(yes) - ifelse([$2], , [ - CFLAGS="$CFLAGS $1" + ifelse([$2], , + [CFLAGS="$CFLAGS $1" AC_MSG_RESULT([adding $1 to CFLAGS])], [$2]) else AC_MSG_RESULT(no) @@ -309,166 +93,129 @@ fi ]) dnl -dnl Check to see if C++ compiler handles FLAG command line option. If -dnl two arguments are specified, execute the second arg as shell -dnl commands. Otherwise, add FLAG to CXXFLAGS if the compiler accepts -dnl the flag. +dnl Check whether a math mapper function is available in . +dnl Will define HAVE_CMATH_FUNC if there is a double variant and +dnl HAVE_CMATH_FUNCF if there is a float variant. +dnl Currently capable of checking for functions with single +dnl argument and returning bool/int/real. dnl -dnl OCTAVE_CXX_FLAG -AC_DEFUN([OCTAVE_CXX_FLAG], [ - ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'` - AC_MSG_CHECKING([whether ${CXX-g++} accepts $1]) - AC_CACHE_VAL(octave_cv_cxx_flag_$ac_safe, [ - AC_LANG_PUSH(C++) - XCXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $1" - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], - eval "octave_cv_cxx_flag_$ac_safe=yes", - eval "octave_cv_cxx_flag_$ac_safe=no") - CXXFLAGS="$XCXXFLAGS" +AC_DEFUN([OCTAVE_CHECK_FUNC_CMATH], [ + ac_safe=`echo "$1" | sed 'y% ./+-:=%___p___%'` + + AC_CACHE_CHECK([for std::$1 in ], + [octave_cv_func_cmath_$ac_safe], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + void take_func (bool (*func) (double x)); + void take_func (int (*func) (double x)); + void take_func (double (*func) (double x)); + ]], [[ + take_func(std::$1); + ]])], + [eval "octave_cv_func_cmath_$ac_safe=yes"], + [eval "octave_cv_func_cmath_$ac_safe=no"]) AC_LANG_POP(C++) ]) - if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then - AC_MSG_RESULT(yes) - ifelse([$2], , [ - CXXFLAGS="$CXXFLAGS $1" - AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2]) - else - AC_MSG_RESULT(no) - ifelse([$3], , , [$3]) + if eval "test \"`echo '$octave_cv_func_cmath_'$ac_safe`\" = yes"; then + AC_DEFINE(AS_TR_CPP([[HAVE_CMATH_][$1]]), 1, + [Define to 1 if provides $1.]) + fi + + AC_CACHE_CHECK([for std::$1 (float variant) in ], + [octave_cv_func_cmath_f$ac_safe], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + void take_func (bool (*func) (float x)); + void take_func (int (*func) (float x)); + void take_func (float (*func) (float x)); + ]], [[ + take_func(std::$1); + ]])], + [eval "octave_cv_func_cmath_f$ac_safe=yes"], + [eval "octave_cv_func_cmath_f$ac_safe=no"]) + AC_LANG_POP(C++) + ]) + if eval "test \"`echo '$octave_cv_func_cmath_f'$ac_safe`\" = yes"; then + AC_DEFINE(AS_TR_CPP([[HAVE_CMATH_][$1][F]]), 1, + [Define to 1 if provides float variant of $1.]) fi ]) dnl -dnl Check to see if Fortran compiler handles FLAG command line option. If -dnl two arguments are specified, execute the second arg as shell -dnl commands. Otherwise, add FLAG to FFLAGS if the compiler accepts -dnl the flag. +dnl Check if Fortran compiler has the intrinsic function ISNAN. dnl -dnl OCTAVE_F77_FLAG -AC_DEFUN([OCTAVE_F77_FLAG], [ - ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'` - AC_MSG_CHECKING([whether ${F77-g77} accepts $1]) - AC_CACHE_VAL(octave_cv_f77_flag_$ac_safe, [ - AC_LANG_PUSH(Fortran 77) - XFFLAGS="$FFLAGS" - FFLAGS="$FFLAGS $1" - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], - eval "octave_cv_f77_flag_$ac_safe=yes", - eval "octave_cv_f77_flag_$ac_safe=no") - FFLAGS="$XFFLAGS" - AC_LANG_POP(Fortran 77) - ]) - if eval "test \"`echo '$octave_cv_f77_flag_'$ac_safe`\" = yes"; then - AC_MSG_RESULT(yes) - ifelse([$2], , [ - FFLAGS="$FFLAGS $1" - AC_MSG_RESULT([adding $1 to FFLAGS])], [$2]) - else - AC_MSG_RESULT(no) - ifelse([$3], , , [$3]) - fi -]) -dnl -dnl Check to see whether Fortran compiler has the intrinsic function ISNAN. -dnl -AC_DEFUN([OCTAVE_CHECK_FORTRAN_HAVE_ISNAN], [ - AC_LANG_PUSH(Fortran 77) +AC_DEFUN([OCTAVE_CHECK_FUNC_FORTRAN_ISNAN], [ AC_CACHE_CHECK([whether $F77 has the intrinsic function ISNAN], - [octave_cv_fortran_have_isnan], -[AC_COMPILE_IFELSE( -[ program foo + [octave_cv_func_fortran_isnan], + [AC_LANG_PUSH(Fortran 77) + AC_COMPILE_IFELSE( +[[ program foo implicit none real x double precision y if (isnan(x)) then - print *, 'x is NaN' + print *, 'x is NaN' end if if (isnan(y)) then - print *, 'y is NaN' + print *, 'y is NaN' end if - end program], [octave_cv_fortran_have_isnan=yes], [octave_cv_fortran_have_isnan=no] -)]) - AC_LANG_POP(Fortran 77) + end program +]], + octave_cv_func_fortran_isnan=yes, octave_cv_func_fortran_isnan=no) + AC_LANG_POP(Fortran 77) + ]) ]) dnl -dnl Check to see whether the default Fortran INTEGER is 64 bits wide. +dnl Check if function gluTessCallback is called with "(...)". dnl -AC_DEFUN([OCTAVE_CHECK_FORTRAN_INTEGER_SIZE], [ - octave_fintsize_save_FFLAGS="$FFLAGS" - FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG" - AC_LANG_PUSH(Fortran 77) - AC_CACHE_CHECK([whether $F77 generates correct size integers], - [octave_cv_fortran_integer_size], -[AC_COMPILE_IFELSE( -[ subroutine foo(n, in, out) - integer n, in(n), out(n) - integer i - do 10 i = 1, n - out(i) = in(i) - 10 continue - return - end], -[mv conftest.$ac_objext fintsize.$ac_objext - - octave_fintsize_save_LIBS="$LIBS" - LIBS="fintsize.$ac_objext $[]_AC_LANG_PREFIX[]LIBS" - AC_LANG_PUSH(C)dnl - AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ -#ifdef USE_64_BIT_IDX_T -#if IDX_TYPE_LONG - typedef long octave_idx_type; -#else - typedef int octave_idx_type; -#endif -#else - typedef int octave_idx_type; -#endif - octave_idx_type n = 2; - octave_idx_type in[2]; - octave_idx_type out[2]; - in[0] = 13; - in[0] = 42; - F77_FUNC(foo,FOO) (&n, &in, &out); - assert (in[0] == out[0] && in[1] == out[1]); -]])], - [octave_cv_fortran_integer_size=yes], - [octave_cv_fortran_integer_size=no], - [octave_cv_fortran_integer_size=yes]) - AC_LANG_POP(C)dnl - LIBS="$octave_fintsize_save_LIBS" -rm -f conftest.$ac_objext fintsize.$ac_objext -], [ - rm -f conftest.$ac_objext - AC_MSG_FAILURE([cannot compile a simple Fortran program]) - octave_cv_fortran_integer_size=no])]) - AC_LANG_POP(Fortran 77) - FFLAGS="$octave_fintsize_save_FFLAGS" +AC_DEFUN([OCTAVE_CHECK_FUNC_GLUTESSCALLBACK_THREEDOTS], [ + AC_CACHE_CHECK([whether gluTessCallback is called with "(...)"], + [octave_cv_func_glutesscallback_threedots], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #ifdef HAVE_GL_GLU_H + # include + #elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL + # include + #endif + ]], [[ + GLvoid (*func)(...); + gluTessCallback(0, 0, func); + ]])], + octave_cv_func_glutesscallback_threedots=yes, + octave_cv_func_glutesscallback_threedots=no) + AC_LANG_POP(C++) + ]) + if test $octave_cv_func_glutesscallback_threedots = "yes"; then + AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1, + [Define to 1 if gluTessCallback is called with (...).]) + fi ]) dnl -dnl -dnl Adds warnings to final summary +dnl Check whether HDF5 library has version 1.6 API functions. dnl -AC_DEFUN([OCTAVE_CONFIGURE_WARNING], [ - AC_MSG_WARN([$][$1]) - m4_set_add([summary_warning_list], [$1]) +AC_DEFUN([OCTAVE_CHECK_HDF5_HAS_VER_16_API], [ + AC_CACHE_CHECK([whether HDF5 library has enforced version 1.6 API], + [octave_cv_hdf5_has_ver_16_api], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + H5Eset_auto (0, 0); + ]])], + octave_cv_hdf5_has_ver_16_api=yes, + octave_cv_hdf5_has_ver_16_api=no) + ]) + if test "$octave_cv_hdf5_has_ver_16_api" != "yes"; then + AC_DEFINE(HAVE_HDF5_18, 1, [Define to 1 if >=HDF5-1.8 is available.]) + fi ]) dnl -dnl -dnl Prints final summary +dnl Usage: +dnl OCTAVE_CHECK_LIB(LIBRARY, DOC-NAME, WARN-MSG, HEADER, FUNC, +dnl LANG, DOC-STRING, EXTRA-CHECK) dnl -AC_DEFUN([OCTAVE_CONFIGURE_WARNING_SUMMARY], [ - m4_set_foreach([summary_warning_list], [elt], [ - if test -n "[$]elt"; then - AC_MSG_WARN([$]elt) - warn_msg_printed=true - fi]) -]) -dnl -dnl -dnl -dnl OCTAVE_CHECK_LIBRARY(LIBRARY, DOC-NAME, WARN-MSG, HEADER, FUNC, -dnl LANG, DOC-STRING, EXTRA-CHECK) -AC_DEFUN([OCTAVE_CHECK_LIBRARY], [ +AC_DEFUN([OCTAVE_CHECK_LIB], [ AC_ARG_WITH([$1-includedir], [AS_HELP_STRING([--with-$1-includedir=DIR], [look for $2 include files in DIR])], @@ -508,34 +255,34 @@ m4_set_add([summary_warning_list], [warn_$1]) if test -n "$m4_toupper([$1])_LIBS"; then - octave_check_library_save_CPPFLAGS="$CPPFLAGS" + octave_check_lib_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$m4_toupper([$1])_CPPFLAGS $CPPFLAGS" m4_ifnblank([$6], [AC_LANG_PUSH($6)]) octave_$1_check_for_lib=false m4_ifblank([$4], [octave_$1_check_for_lib=true], [AC_CHECK_HEADERS($4, [octave_$1_check_for_lib=true; break])]) if $octave_$1_check_for_lib; then - octave_check_library_save_LDFLAGS="$LDFLAGS" + octave_check_lib_save_LDFLAGS="$LDFLAGS" LDFLAGS="$m4_toupper([$1])_LDFLAGS $LDFLAGS" - octave_check_library_save_LIBS="$LIBS" + octave_check_lib_save_LIBS="$LIBS" LIBS="$m4_toupper([$1])_LIBS $LIBS" octave_$1_ok=no AC_MSG_CHECKING([for $5 in $m4_toupper([$1])_LIBS]) AC_LINK_IFELSE([AC_LANG_CALL([], [$5])], - [octave_$1_ok=yes]) + [octave_$1_ok=yes]) AC_MSG_RESULT([$octave_$1_ok]) if test $octave_$1_ok = yes; then - m4_ifblank([$8], [ - warn_$1= - AC_DEFINE([HAVE_]m4_toupper([$1]), 1, + m4_ifblank([$8], [ + warn_$1= + AC_DEFINE([HAVE_]m4_toupper([$1]), 1, [Define to 1 if $2 is available.]) - [TEXINFO_]m4_toupper([$1])="@set [HAVE_]m4_toupper([$1])"], [$8]) + [TEXINFO_]m4_toupper([$1])="@set [HAVE_]m4_toupper([$1])"], [$8]) fi - LIBS="$octave_check_library_save_LIBS" - LDFLAGS="$octave_check_library_save_LDFLAGS" + LIBS="$octave_check_lib_save_LIBS" + LDFLAGS="$octave_check_lib_save_LDFLAGS" fi m4_ifnblank([$6], [AC_LANG_POP($6)]) - CPPFLAGS="$octave_check_library_save_CPPFLAGS" + CPPFLAGS="$octave_check_lib_save_CPPFLAGS" fi AC_SUBST(m4_toupper([$1])_LIBS) AC_SUBST([TEXINFO_]m4_toupper([$1])) @@ -545,612 +292,18 @@ fi ]) dnl -dnl Check for flex -dnl -AC_DEFUN([OCTAVE_PROG_FLEX], [ -### For now, don't define LEXLIB to be -lfl -- we don't use anything in -### it, and it might not be installed. -### -### Also make sure that we generate an interactive scanner if we are -### using flex. - AC_PROG_LEX - case "$LEX" in - flex*) - LFLAGS="-I" - AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) - LEXLIB= - ;; - *) - LEX='$(top_srcdir)/build-aux/missing flex' - warn_flex=" - -I didn't find flex, but it's only a problem if you need to reconstruct -lex.cc, which is the case if you're building from VCS sources. -" - OCTAVE_CONFIGURE_WARNING([warn_flex]) - ;; - esac - AC_SUBST(LFLAGS) -]) -dnl -dnl Check for bison -dnl -AC_DEFUN([OCTAVE_PROG_BISON], [ - AC_PROG_YACC - case "$YACC" in - bison*) - ;; - *) - YACC='$(top_srcdir)/build-aux/missing bison' - warn_bison=" - -I didn't find bison, but it's only a problem if you need to -reconstruct parse.cc, which is the case if you're building from VCS -sources. - -" - OCTAVE_CONFIGURE_WARNING([warn_bison]) - ;; - esac -]) -dnl -dnl What pager should we use? -dnl -AC_DEFUN([OCTAVE_PROG_PAGER], -[if test "$cross_compiling" = yes; then - DEFAULT_PAGER=less - AC_MSG_RESULT([assuming $DEFAULT_PAGER exists on $canonical_host_type host]) - AC_SUBST(DEFAULT_PAGER) -else - octave_possible_pagers="less more page pg" - case "$canonical_host_type" in - *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc) - octave_possible_pagers="$octave_possible_pagers more.com" - ;; - esac - - AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, []) - if test -z "$DEFAULT_PAGER"; then - warn_less="I couldn't find \`less', \`more', \`page', or \`pg'" - OCTAVE_CONFIGURE_WARNING([warn_less]) - fi -fi -]) -dnl -dnl Does gnuplot exist? -dnl -AC_DEFUN([OCTAVE_PROG_GNUPLOT], [ -gp_names="gnuplot" -gp_default="gnuplot" -if test "$cross_compiling" = yes; then - GNUPLOT="$gp_default" - AC_MSG_RESULT([assuming $GNUPLOT exists on $canonical_host_type host]) -else - AC_CHECK_PROGS(GNUPLOT, [$gp_names]) - if test -z "$GNUPLOT"; then - GNUPLOT="$gp_default" - warn_gnuplot=" - -gnuplot not found. It isn't necessary to have gnuplot installed, but -without native graphics or gnuplot you won't be able to use any of -Octave's plotting commands. -" - OCTAVE_CONFIGURE_WARNING([warn_gnuplot]) - fi -fi -AC_SUBST(GNUPLOT) -]) -dnl -dnl Is gperf installed? -dnl -dnl OCTAVE_PROG_GPERF -AC_DEFUN([OCTAVE_PROG_GPERF], [ - AC_CHECK_PROG(GPERF, gperf, gperf, []) - if test -z "$GPERF"; then - GPERF='$(top_srcdir)/build-aux/missing gperf' - warn_gperf=" - -I didn't find gperf, but it's only a problem if you need to -reconstruct oct-gperf.h -" - OCTAVE_CONFIGURE_WARNING([warn_gperf]) - fi - AC_SUBST(GPERF) -]) -dnl -dnl Is ghostscript installed? -dnl -dnl OCTAVE_PROG_GHOSTSCRIPT -AC_DEFUN([OCTAVE_PROG_GHOSTSCRIPT], [ - case "$canonical_host_type" in - *-*-mingw* | *-*-msdosmsvc) - gs_names="gswin32c gs mgs" - ;; - *) - gs_names="gs" - ;; - esac - AC_CHECK_PROGS(GHOSTSCRIPT, [$gs_names]) - if test -z "$GHOSTSCRIPT"; then - GHOSTSCRIPT='$(top_srcdir)/build-aux/missing gs' - warn_ghostscript=" - -I didn't find ghostscript, so reconstructing figures for the manual -will fail, and saving graphics in some output formats will fail when -using Octave -" - - OCTAVE_CONFIGURE_WARNING([warn_ghostscript]) - fi - AC_SUBST(GHOSTSCRIPT) -]) -dnl -dnl Is texi2dvi installed? -dnl -dnl OCTAVE_PROG_TEXI2DVI -AC_DEFUN([OCTAVE_PROG_TEXI2DVI], [ - AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, []) - if test -z "$TEXI2DVI"; then - TEXI2DVI='$(top_srcdir)/build-aux/missing texi2dvi' - warn_texi2dvi=" - -I didn't find texi2dvi, but it's only a problem if you need to -reconstruct the DVI version of the manual -" - OCTAVE_CONFIGURE_WARNING([warn_texi2dvi]) - fi - AC_SUBST(TEXI2DVI) -]) -dnl -dnl Is texi2pdf installed? -dnl -dnl OCTAVE_PROG_TEXI2PDF -AC_DEFUN([OCTAVE_PROG_TEXI2PDF], [ - AC_REQUIRE([OCTAVE_PROG_TEXI2DVI]) - AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, []) - if test -z "$TEXI2PDF"; then - missing=true; - if test -n "$TEXI2DVI"; then - TEXI2PDF="$TEXI2DVI --pdf" - missing=false; - fi - else - missing=false; - fi - if $missing; then - TEXI2PDF='$(top_srcdir)/build-aux/missing texi2pdf' - warn_texi2pdf=" - -I didn't find texi2pdf, but it's only a problem if you need to -reconstruct the PDF version of the manual -" - OCTAVE_CONFIGURE_WARNING([warn_texi2pdf]) - fi - AC_SUBST(TEXI2PDF) -]) -dnl -dnl See if the C++ library is ISO compliant. -dnl FIXME: This is obviously very simplistic, and trivially fooled. -dnl -dnl OCTAVE_CXX_ISO_COMPLIANT_LIBRARY -AC_DEFUN([OCTAVE_CXX_ISO_COMPLIANT_LIBRARY], [ - AC_REQUIRE([AC_PROG_CXX]) - AC_MSG_CHECKING([if C++ library is ISO compliant]) - AC_CACHE_VAL(octave_cv_cxx_iso_compliant_library, [ - AC_LANG_PUSH(C++) - rm -f conftest.h -### Omitting cwctype for now, since it is broken with gcc-3.0.x and -### possibly other versions... - for inc in algorithm bitset cassert cctype cerrno cfloat ciso646 \ - climits clocale cmath complex csetjmp csignal cstdarg cstddef \ - cstdio cstdlib cstring ctime cwchar deque exception \ - fstream functional iomanip ios iosfwd iostream istream iterator \ - limits list locale map memory new numeric ostream queue set \ - sstream stack stdexcept streambuf string strstream typeinfo \ - utility valarray vector; do - echo "#include <$inc>" >> conftest.h - done - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "conftest.h"]], - [[std::bitset<50> flags; - flags.set(); - int digits = std::numeric_limits::digits; - digits = 0;]])], - [octave_cv_cxx_iso_compliant_library=yes], - [octave_cv_cxx_iso_compliant_library=no]) - AC_LANG_POP(C++) - ]) - AC_MSG_RESULT([$octave_cv_cxx_iso_compliant_library]) - if test $octave_cv_cxx_iso_compliant_library = yes; then - AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1, [Define to 1 if your C++ runtime library is ISO compliant.]) - fi -]) -dnl -dnl Allow the user disable support for command line editing using GNU -dnl readline. -dnl -dnl OCTAVE_ENABLE_READLINE -AC_DEFUN([OCTAVE_ENABLE_READLINE], [ - USE_READLINE=true - READLINE_LIBS= - AC_ARG_ENABLE(readline, - [ --enable-readline use readline library (default is yes)], - [if test "$enableval" = no; then - USE_READLINE=false - warn_readline="command editing and history features require GNU Readline" - fi]) - if $USE_READLINE; then - save_LIBS="$LIBS" - LIBS="$TERM_LIBS" - AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, [ - READLINE_LIBS="-lreadline" - AC_DEFINE(USE_READLINE, 1, [Define to 1 to use the readline library.]) - ], [ - AC_MSG_WARN([I need GNU Readline 4.2 or later]) - AC_MSG_ERROR([this is fatal unless you specify --disable-readline]) - ]) - LIBS="$save_LIBS" - fi - AC_SUBST(READLINE_LIBS) -]) -dnl -dnl Check to see if C++ reintrepret cast works for function pointers. -dnl -dnl OCTAVE_CXX_BROKEN_REINTERPRET_CAST -dnl -AC_DEFUN([OCTAVE_CXX_BROKEN_REINTERPRET_CAST], [ - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH(C++) - AC_CACHE_CHECK([for broken C++ reinterpret_cast], - octave_cv_cxx_broken_reinterpret_cast, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ - typedef double (*fptr) (double); - fptr psin = sin; - void *vptr = reinterpret_cast (psin); - psin = reinterpret_cast (vptr);]])], - octave_cv_cxx_broken_reinterpret_cast=no, - octave_cv_cxx_broken_reinterpret_cast=yes)]) - if test $octave_cv_cxx_broken_reinterpret_cast = yes ; then - AC_DEFINE(CXX_BROKEN_REINTERPRET_CAST, 1, [Define to 1 if C++ reinterpret_cast fails for function pointers.]) -fi - AC_LANG_POP(C++)]) -dnl -dnl Find find. -dnl -# Prefer GNU find if found. -AN_MAKEVAR([FIND], [OCTAVE_PROG_FIND]) -AN_PROGRAM([gfind], [OCTAVE_PROG_FIND]) -AN_PROGRAM([find], [OCTAVE_PROG_FIND]) -AC_DEFUN([OCTAVE_PROG_FIND], -[AC_CHECK_PROGS(FIND, gfind find, )]) -dnl -dnl Find sed. -dnl -# Check for a fully-functional sed program, that truncates -# as few characters as possible and that supports "\(X\|Y\)" -# style regular expression alternation. Prefer GNU sed if found. -AC_DEFUN([OCTAVE_PROG_SED], -[AC_MSG_CHECKING([for a usable sed]) -if test -z "$SED"; then - AC_CACHE_VAL(ac_cv_path_sed, [ - # Loop through the user's path and test for sed and gsed. - # Then use that list of sed's as ones to test for truncation. - _AS_PATH_WALK([$PATH], - [for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then - _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" - fi - done - done - ]) - AS_TMPDIR(sed) - _max=0 - _count=0 - # Add /usr/xpg4/bin/sed as it is typically found on Solaris - # along with /bin/sed that truncates output. - for _sed in $_sed_list /usr/xpg4/bin/sed; do - test ! -f ${_sed} && break - cat /dev/null > "$tmp/sed.in" - _count=0 - echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in" - # Check for GNU sed and select it if it is found. - if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then - octave_cv_path_sed=${_sed} - break; - fi - # Reject if RE alternation is not handled. - if test "`echo 'this and that' | ${_sed} -n 's/\(this\|that\).*$/\1/p'`" != "this"; then - continue; - fi - while true; do - cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" - mv "$tmp/sed.tmp" "$tmp/sed.in" - cp "$tmp/sed.in" "$tmp/sed.nl" - echo >>"$tmp/sed.nl" - ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break - cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break - # 10000 chars as input seems more than enough - test $_count -gt 10 && break - _count=`expr $_count + 1` - if test $_count -gt $_max; then - _max=$_count - octave_cv_path_sed=$_sed - fi - done - done - rm -rf "$tmp" - ]) - SED=$octave_cv_path_sed - if test -z "$SED"; then - AC_MSG_ERROR([no usable version of sed found]) - fi -fi -AC_SUBST(SED) -AC_MSG_RESULT([$SED]) -]) -dnl -dnl Find Perl. -dnl -dnl OCTAVE_PROG_PERL -AC_DEFUN([OCTAVE_PROG_PERL], -[AC_CHECK_PROG(PERL, perl, perl, []) - AC_SUBST(PERL) -]) -dnl -dnl Find Python. -dnl -dnl OCTAVE_PROG_PYTHON -AC_DEFUN([OCTAVE_PROG_PYTHON], -[AC_CHECK_PROG(PYTHON, python, python, []) - AC_SUBST(PYTHON) -]) -dnl -dnl Find desktop-file-install. -dnl -dnl OCTAVE_PROG_DESKTOP_FILE_INSTALL -AC_DEFUN([OCTAVE_PROG_DESKTOP_FILE_INSTALL], -[AC_CHECK_PROG(DESKTOP_FILE_INSTALL, desktop-file-install, desktop-file-install, []) - AC_SUBST(DESKTOP_FILE_INSTALL) -]) -dnl -dnl Check for IEEE 754 data format. -dnl -AC_DEFUN([OCTAVE_IEEE754_DATA_FORMAT], -[AC_MSG_CHECKING([for IEEE 754 data format]) -AC_CACHE_VAL(octave_cv_ieee754_data_format, -[AC_RUN_IFELSE([AC_LANG_SOURCE([[ -int -main (void) -{ - typedef union { unsigned char c[8]; double d; } ieeebytes; - - ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43}; - ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c}; - - return l.d != 1234567891234567.0 && b.d != 1234567891234567.0; -}]])], - octave_cv_ieee754_data_format=yes, - octave_cv_ieee754_data_format=no, - octave_cv_ieee754_data_format=yes)]) -if test "$cross_compiling" = yes; then - AC_MSG_RESULT([$octave_cv_ieee754_data_format assumed for cross compilation]) -else - AC_MSG_RESULT([$octave_cv_ieee754_data_format]) -fi -if test "$octave_cv_ieee754_data_format" = yes; then - AC_DEFINE(HAVE_IEEE754_DATA_FORMAT, 1, [Define to 1 if your system uses IEEE 754 data format.]) -else - ## If the format is unknown, then you will probably not have a - ## useful system, so we will abort here. Anyone wishing to - ## experiment with building Octave on a system without IEEE - ## floating point should be capable of removing this check and - ## the one in the octave_ieee_init function in liboctave/lo-ieee.cc. - AC_MSG_ERROR([IEEE 754 data format required for building Octave]) -fi -]) -dnl -dnl Check for UMFPACK seperately split complex matrix and RHS. Note -dnl that as umfpack.h can be in three different places, rather than -dnl include it, just declare the functions needed. -dnl -dnl Assumes that the check for umfpack has already been performed. -dnl -AC_DEFUN([OCTAVE_UMFPACK_SEPERATE_SPLIT], -[AC_MSG_CHECKING([for UMFPACK seperate complex matrix and rhs split]) -AC_CACHE_VAL(octave_cv_umfpack_seperate_split, -[AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#if defined (HAVE_UFSPARSE_UMFPACK_h) -#include -#elif defined (HAVE_UMFPACK_UMFPACK_H) -#include -#elif defined (HAVE_UMFPACK_H) -#include -#endif -int n = 5; -int Ap[] = {0, 2, 5, 9, 10, 12}; -int Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4}; -double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0., - -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.}; -double br[] = {8., 45., -3., 3., 19.}; -double bi[] = {0., 0., 0., 0., 0.}; -int main (void) -{ - double *null = (double *) NULL ; - double *x = (double *)malloc (2 * n * sizeof(double)); - int i ; - void *Symbolic, *Numeric ; - (void) umfpack_zi_symbolic (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ; - (void) umfpack_zi_numeric (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ; - umfpack_zi_free_symbolic (&Symbolic) ; - (void) umfpack_zi_solve (0, Ap, Ai, Ax, null, x, null, br, bi, - Numeric, null, null) ; - umfpack_zi_free_numeric (&Numeric) ; - for (i = 0; i < n; i++, x+=2) - if (fabs(*x - i - 1.) > 1.e-13) - return (1); - return (0) ; -} -]])], - octave_cv_umfpack_seperate_split=yes, - octave_cv_umfpack_seperate_split=no, - octave_cv_umfpack_seperate_split=yes)]) -if test "$cross_compiling" = yes; then - AC_MSG_RESULT([$octave_cv_umfpack_seperate_split assumed for cross compilation]) -else - AC_MSG_RESULT([$octave_cv_umfpack_seperate_split]) -fi -if test "$octave_cv_umfpack_seperate_split" = yes; then - AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, [Define to 1 if the UMFPACK Complex solver allow matrix and RHS to be split independently.]) -fi -]) -dnl -dnl Check whether using HDF5 DLL under Windows. This is done by -dnl testing for a data symbol in the HDF5 library, which would -dnl requires the definition of _HDF5USEDL_ under MSVC compiler. -dnl -AC_DEFUN([OCTAVE_HDF5_DLL], [ - AC_CACHE_CHECK([if _HDF5USEDLL_ needs to be defined],octave_cv_hdf5_dll, [ - AC_TRY_LINK([#include ], [hid_t x = H5T_NATIVE_DOUBLE; return x], - octave_cv_hdf5_dll=no, [ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -DWIN32 -D_HDF5USEDLL_" - save_LIBS="$LIBS" - LIBS="$HDF5_LIBS $LIBS" - AC_TRY_LINK([#include ], [hid_t x = H5T_NATIVE_DOUBLE; return x], - octave_cv_hdf5_dll=yes, - octave_cv_hdf5_dll=no) - CFLAGS="$save_CFLAGS" - LIBS="$save_LIBS"])]) - if test "$octave_cv_hdf5_dll" = yes; then - AC_DEFINE(_HDF5USEDLL_, 1, [Define to 1 if using HDF5 dll (Win32).]) - fi]) -dnl -dnl Check whether HDF5 library has version 1.6 API functions. -dnl -AC_DEFUN([OCTAVE_HDF5_HAS_ENFORCED_16_API], [ - AC_CACHE_CHECK([whether HDF5 library has enforced version 1.6 API], - octave_cv_hdf5_has_enforced_16_api, [ - AC_TRY_LINK([ -#include -], [ - H5Eset_auto (0, 0);], [ - octave_cv_hdf5_has_enforced_16_api=yes], [ - octave_cv_hdf5_has_enforced_16_api=no])]) - if test "$octave_cv_hdf5_has_enforced_16_api" != "yes"; then - AC_DEFINE(HAVE_HDF5_18, 1, [Define to 1 if >=HDF5-1.8 is available.]) - fi -]) -dnl -dnl Check for the Qhull version. -dnl -AC_DEFUN([OCTAVE_CHECK_QHULL_VERSION], - [AC_CACHE_CHECK([for qh_version in $QHULL_LIBS], - octave_cv_lib_qhull_version, [ - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ -#include -#if defined (HAVE_LIBQHULL_LIBQHULL_H) -# include -# include -# include -# include -# include -#elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H) -# if defined (HAVE_QHULL_LIBQHULL_H) -# include -# else -# include -# endif -# include -# include -# include -# include -#elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H) -# if defined (HAVE_LIBQHULL_H) -# include -# else -# include -# endif -# include -# include -# include -# include -#endif -]], [[ -const char *tmp = qh_version; -]])], [octave_cv_lib_qhull_version=yes], [octave_cv_lib_qhull_version=no])]) - if test "$octave_cv_lib_qhull_version" = no; then - AC_DEFINE(NEED_QHULL_VERSION, 1, - [Define to 1 if the Qhull library needs a qh_version variable defined.]) - fi -]) -dnl -dnl Check whether Qhull works (does not crash) -dnl -AC_DEFUN([OCTAVE_CHECK_QHULL_OK], - [AC_CACHE_CHECK([whether the qhull library works], - octave_cv_lib_qhull_ok, [ - AC_RUN_IFELSE([AC_LANG_PROGRAM([[ -#include -#if defined (HAVE_LIBQHULL_LIBQHULL_H) -# include -# include -# include -# include -# include -#elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H) -# if defined (HAVE_QHULL_LIBQHULL_H) -# include -# else -# include -# endif -# include -# include -# include -# include -#elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H) -# if defined (HAVE_LIBQHULL_H) -# include -# else -# include -# endif -# include -# include -# include -# include -#endif -#ifdef NEED_QHULL_VERSION -char *qh_version = "version"; -#endif -]], [[ -int dim = 2; -int n = 4; -coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 }; -boolT ismalloc = 0; -return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr); -]])], - [octave_cv_lib_qhull_ok=yes], - [octave_cv_lib_qhull_ok=no], - [octave_cv_lib_qhull_ok=yes])]) - if test "$octave_cv_lib_qhull_ok" = "yes"; then - $1 - else - $2 - fi -]) -dnl -dnl Check whether ARPACK works (does not crash) +dnl Check whether ARPACK works (does not crash). dnl dnl Using a pure Fortran program doesn't seem to crash when linked -dnl with the buggy ARPACK library but the C++ program does. Maybe -dnl it is the memory allocation that exposes the bug and using statically +dnl with the buggy ARPACK library but the C++ program does. Maybe it +dnl is the memory allocation that exposes the bug and using statically dnl allocated arrays in Fortran does not? dnl -AC_DEFUN([OCTAVE_CHECK_ARPACK_OK], [ +AC_DEFUN([OCTAVE_CHECK_LIB_ARPACK_OK], [ AC_LANG_PUSH(C++) AC_CACHE_CHECK([whether the arpack library works], - [octave_cv_lib_arpack_ok], [ - AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + [octave_cv_lib_arpack_ok], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ // External functions from ARPACK library extern "C" int F77_FUNC (dnaupd, DNAUPD) (int&, const char *, const int&, const char *, @@ -1266,7 +419,7 @@ double sigmar = 0.0; double sigmai = 0.0; - // In Octave, this is n*(k+1), but k+2 avoids segfault + // In Octave, this is n*(k+1), but n*(k+2) avoids segfault double *z = new double [n * (k + 1)]; F77_FUNC (dneupd, DNEUPD) (rvec, "A", sel, dr, di, z, n, sigmar, @@ -1274,13 +427,16 @@ resid, p, v, n, ip, ipntr, workd, workl, lwork, info, 1L, 1L, 2L); } + ]], [[ + for (int i = 0; i < 10; i++) doit (); -]])], - [octave_cv_lib_arpack_ok=yes], - [octave_cv_lib_arpack_ok=no], - [octave_cv_lib_arpack_ok=yes])]) + ]])], + octave_cv_lib_arpack_ok=yes, + octave_cv_lib_arpack_ok=no, + octave_cv_lib_arpack_ok=yes) + ]) AC_LANG_POP(C++) if test "$octave_cv_lib_arpack_ok" = "yes"; then $1 @@ -1289,7 +445,42 @@ fi ]) dnl -dnl Check for OpenGL. If found, define OPENGL_LIBS +dnl Check whether using HDF5 DLL under Windows. This is done by +dnl testing for a data symbol in the HDF5 library, which would +dnl require the definition of _HDF5USEDL_ under MSVC compiler. +dnl +AC_DEFUN([OCTAVE_CHECK_LIB_HDF5_DLL], [ + AC_CACHE_CHECK([if _HDF5USEDLL_ needs to be defined], + [octave_cv_lib_hdf5_dll], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + hid_t x = H5T_NATIVE_DOUBLE; + return x + ]])], + [octave_cv_lib_hdf5_dll=no], + [save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -DWIN32 -D_HDF5USEDLL_" + save_LIBS="$LIBS" + LIBS="$HDF5_LIBS $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + hid_t x = H5T_NATIVE_DOUBLE; + return x + ]])], + octave_cv_lib_hdf5_dll=yes, + octave_cv_lib_hdf5_dll=no) + CFLAGS="$save_CFLAGS" + LIBS="$save_LIBS" + ]) + ]) + if test "$octave_cv_lib_hdf5_dll" = yes; then + AC_DEFINE(_HDF5USEDLL_, 1, [Define to 1 if using HDF5 dll (Win32).]) + fi +]) +dnl +dnl Check for OpenGL. If found, define OPENGL_LIBS. dnl dnl FIXME: The following tests should probably check for the dnl libraries separately. @@ -1297,124 +488,1161 @@ dnl FIXME: Should we allow a way to specify a directory for OpenGL dnl libraries and header files? dnl -AC_DEFUN([OCTAVE_OPENGL], [ -OPENGL_LIBS= +AC_DEFUN([OCTAVE_CHECK_LIB_OPENGL], [ + OPENGL_LIBS= -### On MacOSX systems the OpenGL framework can be used -OCTAVE_HAVE_FRAMEWORK(OpenGL, [ -#include -#include ], [GLint par; glGetIntegerv (GL_VIEWPORT, &par);], - [have_framework_opengl="yes"], [have_framework_opengl="no"]) + ## On MacOSX systems the OpenGL framework can be used + OCTAVE_HAVE_FRAMEWORK(OpenGL, [[ + #include + #include + ]], [[ + GLint par; glGetIntegerv (GL_VIEWPORT, &par); + ]], + have_framework_opengl=yes, have_framework_opengl=no) -if test $have_framework_opengl = "yes"; then - AC_DEFINE(HAVE_FRAMEWORK_OPENGL, 1, [Define to 1 if framework OPENGL is available.]) - OPENGL_LIBS="-Wl,-framework -Wl,OpenGL" - AC_MSG_NOTICE([adding -Wl,-framework -Wl,OpenGL to OPENGL_LIBS]) - OCTAVE_GLUTESSCALLBACK_THREEDOTS -else - case $canonical_host_type in - *-*-mingw32* | *-*-msdosmsvc) - AC_CHECK_HEADERS(windows.h) - ;; - esac - have_opengl_incs=no - AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], [ - AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], [ - have_opengl_incs=yes; break], [], [ + if test $have_framework_opengl = "yes"; then + AC_DEFINE(HAVE_FRAMEWORK_OPENGL, 1, + [Define to 1 if framework OPENGL is available.]) + OPENGL_LIBS="-Wl,-framework -Wl,OpenGL" + AC_MSG_NOTICE([adding -Wl,-framework -Wl,OpenGL to OPENGL_LIBS]) + OCTAVE_CHECK_FUNC_GLUTESSCALLBACK_THREEDOTS + else + case $canonical_host_type in + *-*-mingw32* | *-*-msdosmsvc) + AC_CHECK_HEADERS(windows.h) + ;; + esac + have_opengl_incs=no + AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], + [AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h], + [have_opengl_incs=yes; break], [], [ #ifdef HAVE_WINDOWS_H #include #endif - ]) - break - ], [], [ + ]) + break + ], [], [ #ifdef HAVE_WINDOWS_H -#include +# include #endif ]) - if test "$have_opengl_incs" = "yes"; then - case $canonical_host_type in - *-*-mingw32* | *-*-msdosmsvc) - save_LIBS="$LIBS" - LIBS="$LIBS -lopengl32" - AC_MSG_CHECKING([for glEnable in -lopengl32]) - AC_TRY_LINK([ -#if HAVE_WINDOWS_H -#include -#endif -#if defined (HAVE_GL_GL_H) -#include -#elif defined (HAVE_OPENGL_GL_H) -#include -#endif -], [glEnable(GL_SMOOTH);], OPENGL_LIBS="-lopengl32 -lglu32") - LIBS="$save_LIBS" - if test "x$OPENGL_LIBS" != "x"; then - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - ;; - *) - AC_CHECK_LIB(GL, glEnable, OPENGL_LIBS="-lGL -lGLU") - ;; - esac + if test "$have_opengl_incs" = "yes"; then + case $canonical_host_type in + *-*-mingw32* | *-*-msdosmsvc) + save_LIBS="$LIBS" + LIBS="$LIBS -lopengl32" + AC_MSG_CHECKING([for glEnable in -lopengl32]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #if HAVE_WINDOWS_H + # include + #endif + #if defined (HAVE_GL_GL_H) + # include + #elif defined (HAVE_OPENGL_GL_H) + # include + #endif + ]], [[ + glEnable(GL_SMOOTH); + ]])], [OPENGL_LIBS="-lopengl32 -lglu32"]) + + LIBS="$save_LIBS" + if test "x$OPENGL_LIBS" != "x"; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + ;; + *) + ## Non-Mac, Non-Windows systems use this check + AC_CHECK_LIB(GL, [glEnable], [OPENGL_LIBS="-lGL -lGLU"]) + ;; + esac + fi + fi + AC_SUBST(OPENGL_LIBS) +]) +dnl +dnl Check whether Qhull works (does not crash). +dnl +AC_DEFUN([OCTAVE_CHECK_LIB_QHULL_OK], [ + AC_CACHE_CHECK([whether the qhull library works], + [octave_cv_lib_qhull_ok], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include + #if defined (HAVE_LIBQHULL_LIBQHULL_H) + # include + # include + # include + # include + # include + #elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H) + # if defined (HAVE_QHULL_LIBQHULL_H) + # include + # else + # include + # endif + # include + # include + # include + # include + #elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H) + # if defined (HAVE_LIBQHULL_H) + # include + # else + # include + # endif + # include + # include + # include + # include + #endif + #ifdef NEED_QHULL_VERSION + char *qh_version = "version"; + #endif + ]], [[ + int dim = 2; + int n = 4; + coordT points[8] = { -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5 }; + boolT ismalloc = 0; + return qh_new_qhull (dim, n, points, ismalloc, "qhull ", 0, stderr); + ]])], + octave_cv_lib_qhull_ok=yes, + octave_cv_lib_qhull_ok=no, + octave_cv_lib_qhull_ok=yes) + ]) + if test "$octave_cv_lib_qhull_ok" = "yes"; then + $1 + else + $2 + fi +]) +dnl +dnl Check for support of OpenMP with a given compiler flag. +dnl If found define HAVE_OPENMP and add the compile flag +dnl to CFLAGS and CXXFLAGS. +dnl +AC_DEFUN([OCTAVE_CHECK_OPENMP], [ + AC_MSG_CHECKING([for support of OpenMP]) + XCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_CACHE_VAL([octave_cv_check_openmp], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ + int main(int argc, char* argv[]) + { + _Pragma("omp parallel") + printf("Hello, world.\n"); + return 0; + } + ]])], + octave_cv_openmp=yes, octave_cv_openmmp=no, octave_cv_openmp=no) + ]) + AC_MSG_RESULT([$octave_cv_openmp]) + if test "$octave_cv_openmp" = yes; then + AC_DEFINE(HAVE_OPENMP, 1, [Define to 1 if compiler supports OpenMP.]) + CXXFLAGS="$CXXFLAGS $1" + else + CFLAGS="$XCFLAGS" + fi +]) +dnl +dnl Check for the Qhull version. +dnl +AC_DEFUN([OCTAVE_CHECK_QHULL_VERSION], [ + AC_CACHE_CHECK([for qh_version in $QHULL_LIBS], + [octave_cv_lib_qhull_version], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #if defined (HAVE_LIBQHULL_LIBQHULL_H) + # include + # include + # include + # include + # include + #elif defined (HAVE_QHULL_LIBQHULL_H) || defined (HAVE_QHULL_QHULL_H) + # if defined (HAVE_QHULL_LIBQHULL_H) + # include + # else + # include + # endif + # include + # include + # include + # include + #elif defined (HAVE_LIBQHULL_H) || defined (HAVE_QHULL_H) + # if defined (HAVE_LIBQHULL_H) + # include + # else + # include + # endif + # include + # include + # include + # include + #endif + ]], [[ + const char *tmp = qh_version; + ]])], + octave_cv_lib_qhull_version=yes, octave_cv_lib_qhull_version=no) + ]) + if test "$octave_cv_lib_qhull_version" = no; then + AC_DEFINE(NEED_QHULL_VERSION, 1, + [Define to 1 if the Qhull library needs a qh_version variable defined.]) + fi +]) +dnl +dnl Check if the default Fortran INTEGER is 64 bits wide. +dnl +AC_DEFUN([OCTAVE_CHECK_SIZEOF_FORTRAN_INTEGER], [ + AC_CACHE_CHECK([whether $F77 generates correct size integers], + [octave_cv_sizeof_fortran_integer], + [octave_fintsize_save_FFLAGS="$FFLAGS" + FFLAGS="$FFLAGS $F77_INTEGER_8_FLAG" + AC_LANG_PUSH(Fortran 77) + AC_COMPILE_IFELSE( +[[ subroutine foo(n, in, out) + integer n, in(n), out(n) + integer i + do 10 i = 1, n + out(i) = in(i) + 10 continue + return + end +]], + [mv conftest.$ac_objext fintsize.$ac_objext + octave_fintsize_save_LIBS="$LIBS" + LIBS="fintsize.$ac_objext $[]_AC_LANG_PREFIX[]LIBS" + AC_LANG_PUSH(C) + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include ]], [[ + #ifdef USE_64_BIT_IDX_T + #if IDX_TYPE_LONG + typedef long octave_idx_type; + #else + typedef int octave_idx_type; + #endif + #else + typedef int octave_idx_type; + #endif + octave_idx_type n = 2; + octave_idx_type in[2]; + octave_idx_type out[2]; + in[0] = 13; + in[0] = 42; + F77_FUNC(foo,FOO) (&n, &in, &out); + assert (in[0] == out[0] && in[1] == out[1]); + ]])], + octave_cv_sizeof_fortran_integer=yes, + octave_cv_sizeof_fortran_integer=no, + octave_cv_sizeof_fortran_integer=yes) + AC_LANG_POP(C) + LIBS="$octave_fintsize_save_LIBS" + rm -f conftest.$ac_objext fintsize.$ac_objext], + [rm -f conftest.$ac_objext + AC_MSG_FAILURE([cannot compile a simple Fortran program]) + octave_cv_sizeof_fortran_integer=no]) + AC_LANG_POP(Fortran 77) + FFLAGS="$octave_fintsize_save_FFLAGS" + ]) +]) +dnl +dnl Add warning to final summary. +dnl +AC_DEFUN([OCTAVE_CONFIGURE_WARNING], [ + AC_MSG_WARN([$][$1]) + m4_set_add([summary_warning_list], [$1]) +]) +dnl +dnl Print final summary. +dnl +AC_DEFUN([OCTAVE_CONFIGURE_WARNING_SUMMARY], [ + m4_set_foreach([summary_warning_list], [elt], [ + if test -n "[$]elt"; then + AC_MSG_WARN([$]elt) + warn_msg_printed=true + fi]) +]) +dnl +dnl Check if the C++ library has the bit_and, bit_or, and bit_xor +dnl templates defined. +dnl +AC_DEFUN([OCTAVE_CXX_BITWISE_OP_TEMPLATES], [ + AC_CACHE_CHECK([whether bit_and, bit_or, bit_xor are defined in the C++ library], + [octave_cv_cxx_bitwise_op_templates], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + int x = 0; + int y = 1; + int z1 = std::bit_and() (x, y); + int z2 = std::bit_or() (x, y); + int z3 = std::bit_xor() (x, y); + ]])], + octave_cv_cxx_bitwise_op_templates=yes, + octave_cv_cxx_bitwise_op_templates=no) + AC_LANG_POP(C++) + ]) + if test $octave_cv_cxx_bitwise_op_templates = yes; then + AC_DEFINE(HAVE_CXX_BITWISE_OP_TEMPLATES, 1, + [Define to 1 if C++ library has templated bitwise operators.]) fi -fi -AC_SUBST(OPENGL_LIBS) +]) +dnl +dnl Check if C++ reinterpret cast works for function pointers. +dnl +AC_DEFUN([OCTAVE_CXX_BROKEN_REINTERPRET_CAST], + [AC_REQUIRE([AC_PROG_CXX]) + AC_CACHE_CHECK([for broken C++ reinterpret_cast], + [octave_cv_cxx_broken_reinterpret_cast], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include ]], [[ + typedef double (*fptr) (double); + fptr psin = sin; + void *vptr = reinterpret_cast (psin); + psin = reinterpret_cast (vptr); + ]])], + octave_cv_cxx_broken_reinterpret_cast=no, + octave_cv_cxx_broken_reinterpret_cast=yes) + AC_LANG_POP(C++) + ]) + if test $octave_cv_cxx_broken_reinterpret_cast = yes ; then + AC_DEFINE(CXX_BROKEN_REINTERPRET_CAST, 1, + [Define to 1 if C++ reinterpret_cast fails for function pointers.]) + fi +]) +dnl +dnl Check if the C++ library has functions to access real and imaginary +dnl parts of complex numbers independently via references. +dnl +AC_DEFUN([OCTAVE_CXX_COMPLEX_REFERENCE_ACCESSORS], [ + AC_CACHE_CHECK([whether complex class can reference components independently], + [octave_cv_cxx_complex_reference_accessors], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + std::complex x; + x.real () = 1.0; + x.imag () = 1.0; + ]])], + octave_cv_cxx_complex_reference_accessors=yes, + octave_cv_cxx_complex_reference_accessors=no) + AC_LANG_POP(C++) + ]) + if test $octave_cv_cxx_complex_reference_accessors = yes; then + AC_DEFINE(HAVE_CXX_COMPLEX_REFERENCE_ACCESSORS, 1, + [Define to 1 if C++ complex class has T& real (void) and T& imag (void) methods.]) + fi +]) +dnl +dnl Check if the C++ library has functions to set real and imaginary +dnl parts of complex numbers independently. +dnl +AC_DEFUN([OCTAVE_CXX_COMPLEX_SETTERS], [ + AC_CACHE_CHECK([whether complex class can set components independently], + [octave_cv_cxx_complex_setters], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + std::complex x; + x.real (1.0); + x.imag (2.0); + ]])], + octave_cv_cxx_complex_setters=yes, octave_cv_cxx_complex_setters=no) + AC_LANG_POP(C++) + ]) + if test $octave_cv_cxx_complex_setters = yes; then + AC_DEFINE(HAVE_CXX_COMPLEX_SETTERS, 1, + [Define to 1 if C++ complex class has void real (T) and void imag (T) methods.]) + fi +]) +dnl +dnl Check if the compiler supports dynamic auto arrays. +dnl +AC_DEFUN([OCTAVE_CXX_DYNAMIC_AUTO_ARRAYS], [ + AC_CACHE_CHECK([whether C++ supports dynamic auto arrays], + [octave_cv_cxx_dynamic_auto_arrays], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ + void test(char *); + int length(); + char x[length()]; + test(x); + ]])], + octave_cv_cxx_dynamic_auto_arrays=yes, + octave_cv_cxx_dynamic_auto_arrays=no) + AC_LANG_POP(C++) + ]) + if test $octave_cv_cxx_dynamic_auto_arrays = yes; then + AC_DEFINE(HAVE_DYNAMIC_AUTO_ARRAYS, 1, + [Define to 1 if C++ supports dynamic auto arrays.]) + fi +]) +dnl +dnl Check if C++ compiler handles FLAG command line option. If two +dnl arguments are specified, execute the second arg as shell commands. +dnl Otherwise, add FLAG to CXXFLAGS if the compiler accepts the flag. +dnl +AC_DEFUN([OCTAVE_CXX_FLAG], [ + ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'` + AC_MSG_CHECKING([whether ${CXX-g++} accepts $1]) + AC_CACHE_VAL([octave_cv_cxx_flag_$ac_safe], + [AC_LANG_PUSH(C++) + XCXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $1" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + eval "octave_cv_cxx_flag_$ac_safe=yes", + eval "octave_cv_cxx_flag_$ac_safe=no") + CXXFLAGS="$XCXXFLAGS" + AC_LANG_POP(C++) + ]) + if eval "test \"`echo '$octave_cv_cxx_flag_'$ac_safe`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$2], , + [CXXFLAGS="$CXXFLAGS $1" + AC_MSG_RESULT([adding $1 to CXXFLAGS])], [$2]) + else + AC_MSG_RESULT(no) + ifelse([$3], , , [$3]) + fi +]) +dnl +dnl Check if the C++ library is ISO compliant. +dnl FIXME: This is obviously very simplistic, and trivially fooled. +dnl +AC_DEFUN([OCTAVE_CXX_ISO_COMPLIANT_LIBRARY], [ + AC_REQUIRE([AC_PROG_CXX]) + AC_MSG_CHECKING([if C++ library is ISO compliant]) + AC_CACHE_VAL([octave_cv_cxx_iso_compliant_library], + [AC_LANG_PUSH(C++) + rm -f conftest.h + ## Omitting cwctype for now, since it is broken with gcc-3.0.x and + ## possibly other versions... + for inc in algorithm bitset cassert cctype cerrno cfloat ciso646 \ + climits clocale cmath complex csetjmp csignal cstdarg cstddef \ + cstdio cstdlib cstring ctime cwchar deque exception \ + fstream functional iomanip ios iosfwd iostream istream iterator \ + limits list locale map memory new numeric ostream queue set \ + sstream stack stdexcept streambuf string strstream typeinfo \ + utility valarray vector; do + echo "#include <$inc>" >> conftest.h + done + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include "conftest.h" + ]], [[ + std::bitset<50> flags; + flags.set(); + int digits = std::numeric_limits::digits; + digits = 0; + ]])], + octave_cv_cxx_iso_compliant_library=yes, + octave_cv_cxx_iso_compliant_library=no) + AC_LANG_POP(C++) + ]) + AC_MSG_RESULT([$octave_cv_cxx_iso_compliant_library]) + if test $octave_cv_cxx_iso_compliant_library = yes; then + AC_DEFINE(CXX_ISO_COMPLIANT_LIBRARY, 1, + [Define to 1 if your C++ runtime library is ISO compliant.]) + fi +]) +dnl +dnl Check if C++ compiler needs the new friend template declaration +dnl syntax. +dnl +AC_DEFUN([OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL], [ + AC_REQUIRE([AC_PROG_CXX]) + AC_MSG_CHECKING([for C++ support for new friend template declaration]) + AC_CACHE_VAL([octave_cv_cxx_new_friend_template_decl], + [AC_LANG_PUSH(C++) + rm -f conftest.h + cat > conftest.h < int + operator== (const T&, const T&) + { + return 0; + } +EOB + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include "conftest.h" + ]], [[ + A a (1); + return a == A(1); + ]])], + octave_cv_cxx_new_friend_template_decl=no, + octave_cv_cxx_new_friend_template_decl=yes) + AC_LANG_POP(C++) + ]) + AC_MSG_RESULT([$octave_cv_cxx_new_friend_template_decl]) + if test $octave_cv_cxx_new_friend_template_decl = yes; then + AC_DEFINE(CXX_NEW_FRIEND_TEMPLATE_DECL, 1, + [Define to 1 if your compiler supports `<>' stuff for template friends.]) + fi +]) +dnl +dnl Check if the compiler supports placement delete. +dnl +AC_DEFUN([OCTAVE_CXX_PLACEMENT_DELETE], [ + AC_CACHE_CHECK([whether defines placement delete operator], + [octave_cv_cxx_placement_delete], + [AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + operator delete((void *)0, (void *)0); + ]])], + octave_cv_cxx_placement_delete=yes, + octave_cv_cxx_placement_delete=no) + AC_LANG_POP(C++) + ]) + if test $octave_cv_cxx_placement_delete = yes; then + AC_DEFINE(HAVE_PLACEMENT_DELETE, 1, + [Define to 1 if C++ supports operator delete(void *, void *).]) + fi +]) +dnl +dnl Allow the user disable support for command line editing using GNU +dnl readline. +dnl +AC_DEFUN([OCTAVE_ENABLE_READLINE], [ + USE_READLINE=true + READLINE_LIBS= + AC_ARG_ENABLE(readline, + [AS_HELP_STRING([--enable-readline], + [use readline library (default is yes)])], + [if test "$enableval" = no; then + USE_READLINE=false + warn_readline="command editing and history features require GNU Readline" + fi]) + if $USE_READLINE; then + save_LIBS="$LIBS" + LIBS="$TERM_LIBS" + AC_CHECK_LIB(readline, rl_set_keyboard_input_timeout, + [READLINE_LIBS="-lreadline" + AC_DEFINE(USE_READLINE, 1, [Define to 1 to use the readline library.]) + ], + [AC_MSG_WARN([I need GNU Readline 4.2 or later]) + AC_MSG_ERROR([this is fatal unless you specify --disable-readline]) + ]) + LIBS="$save_LIBS" + fi + AC_SUBST(READLINE_LIBS) +]) +dnl +dnl Check if Fortran compiler handles FLAG command line option. If +dnl two arguments are specified, execute the second arg as shell +dnl commands. Otherwise, add FLAG to FFLAGS if the compiler accepts +dnl the flag. +dnl +AC_DEFUN([OCTAVE_F77_FLAG], [ + ac_safe=`echo "$1" | sed 'y%./+-:=%__p___%'` + AC_MSG_CHECKING([whether ${F77-g77} accepts $1]) + AC_CACHE_VAL(octave_cv_f77_flag_$ac_safe, [ + AC_LANG_PUSH(Fortran 77) + XFFLAGS="$FFLAGS" + FFLAGS="$FFLAGS $1" + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + eval "octave_cv_f77_flag_$ac_safe=yes", + eval "octave_cv_f77_flag_$ac_safe=no") + FFLAGS="$XFFLAGS" + AC_LANG_POP(Fortran 77) + ]) + if eval "test \"`echo '$octave_cv_f77_flag_'$ac_safe`\" = yes"; then + AC_MSG_RESULT(yes) + ifelse([$2], , + [FFLAGS="$FFLAGS $1" + AC_MSG_RESULT([adding $1 to FFLAGS])], [$2]) + else + AC_MSG_RESULT(no) + ifelse([$3], , , [$3]) + fi ]) dnl -dnl See if function gluTessCallback is called with "(...)" +dnl Check whether fast signed integer arithmetics using bit tricks +dnl can be used in oct-inttypes.h. Defines HAVE_FAST_INT_OPS if +dnl the following conditions hold: +dnl 1. Signed numbers are represented by twos complement +dnl (see ) +dnl 2. static_cast to unsigned int counterpart works like interpreting +dnl the signed bit pattern as unsigned (and is thus zero-cost). +dnl 3. Signed addition and subtraction yield the same bit results as unsigned. +dnl (We use casts to prevent optimization interference, so there is no +dnl need for things like -ftrapv). +dnl 4. Bit operations on signed integers work like on unsigned integers, +dnl except for the shifts. Shifts are arithmetic. +dnl +AC_DEFUN([OCTAVE_FAST_INT_OPS], [ + AC_CACHE_CHECK([whether fast integer arithmetics is usable], + [octave_cv_fast_int_ops], + [AC_LANG_PUSH(C++) + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include + template + static bool + do_test (UT, ST) + { + volatile ST s = std::numeric_limits::min () / 3; + volatile UT u = static_cast (s); + if (*(reinterpret_cast (&u)) != s) return true; + + u = 0; u = ~u; + if (*(reinterpret_cast (&u)) != -1) return true; + + ST sx, sy; + sx = std::numeric_limits::max () / 2 + 1; + sy = std::numeric_limits::max () / 2 + 2; + if (static_cast (static_cast (sx) + static_cast (sy)) + != std::numeric_limits::min () + 1) return true; + if (static_cast (static_cast (sx) - static_cast (sy)) + != -1) return true; + + if ((sx & sy) != (static_cast (sx) & static_cast (sy))) + return true; + if ((sx | sy) != (static_cast (sx) | static_cast (sy))) + return true; + if ((sx ^ sy) != (static_cast (sx) ^ static_cast (sy))) + return true; + if ((-1 >> 1) != -1) return true; + return false; + } + + #define DO_TEST(T) \ + if (do_test (static_cast (0), static_cast (0)))\ + return sizeof (T); + + ]],[[ + + DO_TEST(char) + DO_TEST(short) + DO_TEST(int) + DO_TEST(long) + #if (defined(HAVE_LONG_LONG_INT) && defined(HAVE_UNSIGNED_LONG_LONG_INT)) + DO_TEST(long long) + #endif + ]])], + octave_cv_fast_int_ops=yes, + octave_cv_fast_int_ops=no, + octave_cv_fast_int_ops=yes) + AC_LANG_POP(C++) + ]) + if test $octave_cv_fast_int_ops = yes; then + AC_DEFINE(HAVE_FAST_INT_OPS, 1, + [Define to 1 if signed integers use two's complement.]) + fi +]) +dnl +dnl Check to see if the compiler and the linker can handle the flags +dnl "-framework $1" for the given prologue $2 and the given body $3 of +dnl a source file. Arguments 2 and 3 optionally can also be empty. +dnl Add options (lower case letters $1) "--with-framework-$1" and +dnl "--without-framework-$1". If this test is successful then perform +dnl $4, otherwise do $5. +dnl +AC_DEFUN([OCTAVE_HAVE_FRAMEWORK], [ + AC_MSG_CHECKING([whether ${LD-ld} accepts -framework $1]) + AC_CACHE_VAL([octave_cv_framework_$1], + [XLDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -framework $1" + AC_LANG_PUSH(C++) + AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])], + eval "octave_cv_framework_$1=yes", + eval "octave_cv_framework_$1=no") + AC_LANG_POP(C++) + LDFLAGS="$XLDFLAGS" + ]) + if test "$octave_cv_framework_$1" = "yes"; then + AC_MSG_RESULT(yes) + AC_ARG_WITH(framework-m4_tolower($1), + [AS_HELP_STRING([--without-framework-m4_tolower($1)], + [don't use framework $1])], + with_have_framework=$withval, with_have_framework=yes) + if test "$with_have_framework" = "yes"; then + [$4] + else + AC_MSG_NOTICE([framework rejected by --without-framework-m4_tolower($1)]) + [$5] + fi + else + AC_MSG_RESULT(no) + [$5] + fi +]) +dnl +dnl Figure out the hardware-vendor-os info. +dnl +dnl Hanging '])' in AC_MSG_WARN is for adding newline to output +dnl +AC_DEFUN([OCTAVE_HOST_TYPE], [ + AC_CANONICAL_HOST + if test -z "$host"; then + host=unknown + fi + canonical_host_type=$host + if test "$host" = unknown; then + AC_MSG_WARN([configuring Octave for unknown system type +]) + fi + AC_SUBST(canonical_host_type) +]) +dnl +dnl Check for IEEE 754 data format. dnl -dnl OCTAVE_GLUTESSCALLBACK_THREEDOTS -AC_DEFUN([OCTAVE_GLUTESSCALLBACK_THREEDOTS], -[AC_CACHE_CHECK([whether gluTessCallback is called with "(...)"], -octave_cv_glutesscallback_threedots, -[AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#ifdef HAVE_GL_GLU_H -#include -#elif defined HAVE_OPENGL_GLU_H || defined HAVE_FRAMEWORK_OPENGL -#include -#endif]], -[[GLvoid (*func)(...); gluTessCallback(0, 0, func);]])], -octave_cv_glutesscallback_threedots="yes", octave_cv_glutesscallback_threedots="no")]) -AC_LANG_POP(C++) -if test $octave_cv_glutesscallback_threedots = "yes"; then - AC_DEFINE(HAVE_GLUTESSCALLBACK_THREEDOTS, 1, - [Define to 1 if gluTessCallback is called with (...).]) -fi +AC_DEFUN([OCTAVE_IEEE754_DATA_FORMAT], [ + AC_MSG_CHECKING([for IEEE 754 data format]) + AC_CACHE_VAL([octave_cv_ieee754_data_format], + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + int + main (void) + { + typedef union { unsigned char c[8]; double d; } ieeebytes; + + ieeebytes l = {0x1c, 0xbc, 0x6e, 0xf2, 0x54, 0x8b, 0x11, 0x43}; + ieeebytes b = {0x43, 0x11, 0x8b, 0x54, 0xf2, 0x6e, 0xbc, 0x1c}; + + return l.d != 1234567891234567.0 && b.d != 1234567891234567.0; + } + ]])], + octave_cv_ieee754_data_format=yes, + octave_cv_ieee754_data_format=no, + octave_cv_ieee754_data_format=yes) + ]) + if test "$cross_compiling" = yes; then + AC_MSG_RESULT([$octave_cv_ieee754_data_format assumed for cross compilation]) + else + AC_MSG_RESULT([$octave_cv_ieee754_data_format]) + fi + if test "$octave_cv_ieee754_data_format" = yes; then + AC_DEFINE(HAVE_IEEE754_DATA_FORMAT, 1, + [Define to 1 if your system uses IEEE 754 data format.]) + else + ## If the format is unknown, then you will probably not have a + ## useful system, so we will abort here. Anyone wishing to + ## experiment with building Octave on a system without IEEE + ## floating point should be capable of removing this check and + ## the one in the octave_ieee_init function in liboctave/lo-ieee.cc. + AC_MSG_ERROR([IEEE 754 data format required for building Octave]) + fi +]) +dnl +dnl Check for ar. +dnl +AC_DEFUN([OCTAVE_PROG_AR], [ + if test -z "$AR"; then + AR=ar + fi + AC_SUBST(AR) + + if test -z "$ARFLAGS"; then + ARFLAGS="rc" + fi + AC_SUBST(ARFLAGS) +]) +dnl +dnl Check for bison. +dnl +AC_DEFUN([OCTAVE_PROG_BISON], [ + AC_PROG_YACC + case "$YACC" in + bison*) + ;; + *) + YACC='$(top_srcdir)/build-aux/missing bison' + warn_bison=" + +I didn't find bison, but it's only a problem if you need to +reconstruct parse.cc, which is the case if you're building from VCS +sources. +" + OCTAVE_CONFIGURE_WARNING([warn_bison]) + ;; + esac +]) +dnl +dnl Find desktop-file-install program. +dnl +AC_DEFUN([OCTAVE_PROG_DESKTOP_FILE_INSTALL], [ + AC_CHECK_PROG(DESKTOP_FILE_INSTALL, desktop-file-install, desktop-file-install, []) + AC_SUBST(DESKTOP_FILE_INSTALL) +]) +dnl +dnl Find find program. +dnl +# Prefer GNU find if found. +AN_MAKEVAR([FIND], [OCTAVE_PROG_FIND]) +AN_PROGRAM([gfind], [OCTAVE_PROG_FIND]) +AN_PROGRAM([find], [OCTAVE_PROG_FIND]) +AC_DEFUN([OCTAVE_PROG_FIND], [ + AC_CHECK_PROGS(FIND, [gfind find]) +]) +dnl +dnl Check for flex. +dnl +AC_DEFUN([OCTAVE_PROG_FLEX], [ + ## For now, don't define LEXLIB to be -lfl -- we don't use anything in + ## it, and it might not be installed. + ## + ## Also make sure that we generate an interactive scanner if we are + ## using flex. + AC_PROG_LEX + case "$LEX" in + flex*) + LFLAGS="-I" + AC_MSG_RESULT([defining LFLAGS to be $LFLAGS]) + LEXLIB= + ;; + *) + LEX='$(top_srcdir)/build-aux/missing flex' + warn_flex=" + +I didn't find flex, but it's only a problem if you need to reconstruct +lex.cc, which is the case if you're building from VCS sources. +" + OCTAVE_CONFIGURE_WARNING([warn_flex]) + ;; + esac + AC_SUBST(LFLAGS) +]) +dnl +dnl Check for ghostscript. +dnl +AC_DEFUN([OCTAVE_PROG_GHOSTSCRIPT], [ + case "$canonical_host_type" in + *-*-mingw* | *-*-msdosmsvc) + gs_names="gswin32c gs mgs" + ;; + *) + gs_names="gs" + ;; + esac + AC_CHECK_PROGS(GHOSTSCRIPT, [$gs_names]) + if test -z "$GHOSTSCRIPT"; then + GHOSTSCRIPT='$(top_srcdir)/build-aux/missing gs' + warn_ghostscript=" + +I didn't find ghostscript, so reconstructing figures for the manual +will fail, and saving graphics in some output formats will fail when +using Octave +" + OCTAVE_CONFIGURE_WARNING([warn_ghostscript]) + fi + AC_SUBST(GHOSTSCRIPT) ]) dnl -dnl Check for support of OpenMP with a given compiler flag. If -dnl found define HAVE_OPENMP and add the compile flag to CFLAGS -dnl and CXXFLAGS. +dnl Check for gnuplot. +dnl +AC_DEFUN([OCTAVE_PROG_GNUPLOT], [ + gp_names="gnuplot" + gp_default="gnuplot" + if test "$cross_compiling" = yes; then + GNUPLOT="$gp_default" + AC_MSG_RESULT([assuming $GNUPLOT exists on $canonical_host_type host]) + else + AC_CHECK_PROGS(GNUPLOT, [$gp_names]) + if test -z "$GNUPLOT"; then + GNUPLOT="$gp_default" + warn_gnuplot=" + +gnuplot not found. It isn't necessary to have gnuplot installed, but +without native graphics or gnuplot you won't be able to use any of +Octave's plotting commands. +" + OCTAVE_CONFIGURE_WARNING([warn_gnuplot]) + fi + fi + AC_SUBST(GNUPLOT) +]) +dnl +dnl Check for gperf. +dnl +AC_DEFUN([OCTAVE_PROG_GPERF], [ + AC_CHECK_PROG(GPERF, gperf, gperf, []) + if test -z "$GPERF"; then + GPERF='$(top_srcdir)/build-aux/missing gperf' + warn_gperf=" + +I didn't find gperf, but it's only a problem if you need to +reconstruct oct-gperf.h +" + OCTAVE_CONFIGURE_WARNING([warn_gperf]) + fi + AC_SUBST(GPERF) +]) +dnl +dnl Check for makeinfo. +dnl +AC_DEFUN([OCTAVE_PROG_MAKEINFO], [ + dnl use MKINFO, not MAKEINFO, for variable name because Automake + dnl automatically defines a value for MAKEINFO even when it does not + dnl exist which will then fool the 'test -z' line. + AC_CHECK_PROG(MKINFO, makeinfo, makeinfo, []) + if test -z "$MKINFO"; then + AC_MSG_ERROR([makeinfo program required for reading documentation]) + fi +]) +dnl +dnl What pager should we use? +dnl +AC_DEFUN([OCTAVE_PROG_PAGER], [ + if test "$cross_compiling" = yes; then + DEFAULT_PAGER=less + AC_MSG_RESULT([assuming $DEFAULT_PAGER exists on $canonical_host_type host]) + AC_SUBST(DEFAULT_PAGER) + else + octave_possible_pagers="less more page pg" + case "$canonical_host_type" in + *-*-cygwin* | *-*-mingw32* | *-*-msdosmsvc) + octave_possible_pagers="$octave_possible_pagers more.com" + ;; + esac + + AC_CHECK_PROGS(DEFAULT_PAGER, $octave_possible_pagers, []) + if test -z "$DEFAULT_PAGER"; then + warn_less="I couldn't find \`less', \`more', \`page', or \`pg'" + OCTAVE_CONFIGURE_WARNING([warn_less]) + fi + fi +]) +dnl +dnl Find Perl program. +dnl +AC_DEFUN([OCTAVE_PROG_PERL], [ + AC_CHECK_PROG(PERL, perl, perl, []) + AC_SUBST(PERL) +]) +dnl +dnl Find Python program. +dnl +AC_DEFUN([OCTAVE_PROG_PYTHON], [ + AC_CHECK_PROG(PYTHON, python, python, []) + AC_SUBST(PYTHON) +]) +dnl +dnl Find sed program. dnl -AC_DEFUN([OCTAVE_CHECK_OPENMP], -[AC_MSG_CHECKING([for support of OpenMP]) -XCFLAGS="$CFLAGS" -CFLAGS="$CFLAGS $1" -AC_CACHE_VAL(octave_cv_check_openmp,[ -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -]], [[ -int main(int argc, char* argv[]) -{ - _Pragma("omp parallel") - printf("Hello, world.\n"); - return 0; -} -]])],octave_cv_openmp=yes, octave_cv_openmmp=no, octave_cv_openmp=no)]) -AC_MSG_RESULT($octave_cv_openmp) -if test "$octave_cv_openmp" = yes; then - AC_DEFINE(HAVE_OPENMP,1,[Define to 1 if compiler supports OpenMP.]) - CXXFLAGS="$CXXFLAGS $1" -else - CFLAGS="$XCFLAGS" -fi +# Check for a fully-functional sed program, that truncates +# as few characters as possible and that supports "\(X\|Y\)" +# style regular expression alternation. Prefer GNU sed if found. +AC_DEFUN([OCTAVE_PROG_SED], [ + AC_MSG_CHECKING([for a usable sed]) + if test -z "$SED"; then + AC_CACHE_VAL([octave_cv_prog_sed], + [# Loop through the user's path and search for sed and gsed. + # Next, test potential sed programs in list for truncation. + _AS_PATH_WALK([$PATH], + [for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if AS_EXECUTABLE_P(["$as_dir/$ac_prog$ac_exec_ext"]); then + _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext" + fi + done + done + ]) + AS_TMPDIR(sed) + _max=0 + _count=0 + # Add /usr/xpg4/bin/sed as it is typically found on Solaris + # along with /bin/sed that truncates output. + for _sed in $_sed_list /usr/xpg4/bin/sed; do + test ! -f ${_sed} && break + cat /dev/null > "$tmp/sed.in" + _count=0 + echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in" + # Check for GNU sed and select it if it is found. + if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then + octave_cv_prog_sed=${_sed} + break; + fi + # Reject if RE alternation is not handled. + if test "`echo 'this and that' | ${_sed} -n 's/\(this\|that\).*$/\1/p'`" != "this"; then + continue; + fi + while true; do + cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp" + mv "$tmp/sed.tmp" "$tmp/sed.in" + cp "$tmp/sed.in" "$tmp/sed.nl" + echo >>"$tmp/sed.nl" + ${_sed} -e 's/a$//' < "$tmp/sed.nl" >"$tmp/sed.out" || break + cmp -s "$tmp/sed.out" "$tmp/sed.nl" || break + # 10000 chars as input seems more than enough + test $_count -gt 10 && break + _count=`expr $_count + 1` + if test $_count -gt $_max; then + _max=$_count + octave_cv_prog_sed=$_sed + fi + done + done + rm -rf "$tmp" + ]) + SED=$octave_cv_prog_sed + if test -z "$SED"; then + AC_MSG_ERROR([no usable version of sed found]) + fi + fi + AC_SUBST(SED) + AC_MSG_RESULT([$SED]) +]) +dnl +dnl Check for texi2dvi. +dnl +AC_DEFUN([OCTAVE_PROG_TEXI2DVI], [ + AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, []) + if test -z "$TEXI2DVI"; then + TEXI2DVI='$(top_srcdir)/build-aux/missing texi2dvi' + warn_texi2dvi=" + +I didn't find texi2dvi, but it's only a problem if you need to +reconstruct the DVI version of the manual +" + OCTAVE_CONFIGURE_WARNING([warn_texi2dvi]) + fi + AC_SUBST(TEXI2DVI) +]) +dnl +dnl Check for texi2pdf. +dnl +AC_DEFUN([OCTAVE_PROG_TEXI2PDF], [ + AC_REQUIRE([OCTAVE_PROG_TEXI2DVI]) + AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, []) + if test -z "$TEXI2PDF"; then + missing=true; + if test -n "$TEXI2DVI"; then + TEXI2PDF="$TEXI2DVI --pdf" + missing=false; + fi + else + missing=false; + fi + if $missing; then + TEXI2PDF='$(top_srcdir)/build-aux/missing texi2pdf' + warn_texi2pdf=" + +I didn't find texi2pdf, but it's only a problem if you need to +reconstruct the PDF version of the manual +" + OCTAVE_CONFIGURE_WARNING([warn_texi2pdf]) + fi + AC_SUBST(TEXI2PDF) ]) dnl +dnl Set default value for a variable and substitute it. +dnl +AC_DEFUN([OCTAVE_SET_DEFAULT], [ + ifelse($#, 2, [: ${$1=$2} +])dnl + AC_MSG_RESULT([defining $1 to be $$1]) + AC_SUBST($1) +]) +dnl +dnl Check for UMFPACK separately split complex matrix and RHS. +dnl +dnl Macro assumes that the check for umfpack has already been performed. +dnl +AC_DEFUN([OCTAVE_UMFPACK_SEPARATE_SPLIT], [ + AC_MSG_CHECKING([for UMFPACK separate complex matrix and rhs split]) + AC_CACHE_VAL(octave_cv_umfpack_separate_split, + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #if defined (HAVE_SUITESPARSE_UMFPACK_H) + # include + #elif defined (HAVE_UFSPARSE_UMFPACK_H) + # include + #elif defined (HAVE_UMFPACK_UMFPACK_H) + # include + #elif defined (HAVE_UMFPACK_H) + # include + #endif + int n = 5; + int Ap[] = {0, 2, 5, 9, 10, 12}; + int Ai[] = {0, 1, 0, 2, 4, 1, 2, 3, 4, 2, 1, 4}; + double Ax[] = {2., 0., 3., 0., 3., 0., -1., 0., 4., 0., 4., 0., + -3., 0., 1., 0., 2., 0., 2., 0., 6., 0., 1., 0.}; + double br[] = {8., 45., -3., 3., 19.}; + double bi[] = {0., 0., 0., 0., 0.}; + int main (void) + { + double *null = (double *) NULL ; + double *x = (double *)malloc (2 * n * sizeof(double)); + int i ; + void *Symbolic, *Numeric ; + (void) umfpack_zi_symbolic (n, n, Ap, Ai, Ax, null, &Symbolic, null, null) ; + (void) umfpack_zi_numeric (Ap, Ai, Ax, null, Symbolic, &Numeric, null, null) ; + umfpack_zi_free_symbolic (&Symbolic) ; + (void) umfpack_zi_solve (0, Ap, Ai, Ax, null, x, null, br, bi, + Numeric, null, null) ; + umfpack_zi_free_numeric (&Numeric) ; + for (i = 0; i < n; i++, x+=2) + if (fabs(*x - i - 1.) > 1.e-13) + return (1); + return (0) ; + } + ]])], + octave_cv_umfpack_separate_split=yes, + octave_cv_umfpack_separate_split=no, + octave_cv_umfpack_separate_split=yes) + ]) + if test "$cross_compiling" = yes; then + AC_MSG_RESULT([$octave_cv_umfpack_separate_split assumed for cross compilation]) + else + AC_MSG_RESULT([$octave_cv_umfpack_separate_split]) + fi + if test "$octave_cv_umfpack_separate_split" = yes; then + AC_DEFINE(UMFPACK_SEPARATE_SPLIT, 1, + [Define to 1 if the UMFPACK Complex solver allows matrix and RHS to be split independently.]) + fi +]) +dnl +dnl Check for unordered map headers and whether tr1 namespace is +dnl required. +dnl +AC_DEFUN([OCTAVE_UNORDERED_MAP_HEADERS], [ + AC_CHECK_HEADERS([unordered_map], [], + [AC_CHECK_HEADERS([tr1/unordered_map])]) + AC_CACHE_CHECK([whether unordered_map requires tr1 namespace], + [octave_cv_header_require_tr1_namespace], + [AC_LANG_PUSH(C++) + octave_cv_header_require_tr1_namespace=no + if test "$ac_cv_header_unordered_map" = "yes"; then + ## Have , but still have to check whether + ## tr1 namespace is required (like MSVC, for instance). + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include + ]], [[ + std::unordered_map m; + ]])], + octave_cv_header_require_tr1_namespace=no, + octave_cv_header_require_tr1_namespace=yes) + elif test "$ac_cv_header_tr1_unordered_map" = "yes"; then + octave_cv_header_require_tr1_namespace=yes + fi + AC_LANG_POP(C++) + ]) + if test "$octave_cv_header_require_tr1_namespace" = "yes"; then + AC_DEFINE(USE_UNORDERED_MAP_WITH_TR1, 1, + [Define to 1 if unordered_map requires the use of tr1 namespace.]) + fi +]) + +dnl End of macros written by Octave developers +dnl ------------------------------------------------------------ +dnl + +dnl +dnl The following macros were taken from other sources. +dnl ------------------------------------------------------------ + +dnl dnl Configure paths for FreeType2 dnl Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor dnl @@ -1439,96 +1667,93 @@ dnl MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is dnl FreeType 2.0.4). dnl -AC_DEFUN([AC_CHECK_FT2], - [dnl Get the cflags and libraries from the freetype-config script - dnl - AC_ARG_WITH([ft-prefix], - dnl don't quote AS_HELP_STRING! - AS_HELP_STRING([--with-ft-prefix=PREFIX], - [Prefix where FreeType is installed (optional)]), - [ft_config_prefix="$withval"], - [ft_config_prefix=""]) - - AC_ARG_WITH([ft-exec-prefix], - dnl don't quote AS_HELP_STRING! - AS_HELP_STRING([--with-ft-exec-prefix=PREFIX], - [Exec prefix where FreeType is installed (optional)]), - [ft_config_exec_prefix="$withval"], - [ft_config_exec_prefix=""]) +AC_DEFUN([AC_CHECK_FT2], [ + dnl + dnl Get the cflags and libraries from the freetype-config script + dnl + AC_ARG_WITH([ft-prefix], + [AS_HELP_STRING([--with-ft-prefix=PREFIX], + [Prefix where FreeType is installed (optional)])], + [ft_config_prefix="$withval"], + [ft_config_prefix=""]) + + AC_ARG_WITH([ft-exec-prefix], + [AS_HELP_STRING([--with-ft-exec-prefix=PREFIX], + [Exec prefix where FreeType is installed (optional)])], + [ft_config_exec_prefix="$withval"], + [ft_config_exec_prefix=""]) - AC_ARG_ENABLE([freetypetest], - dnl don't quote AS_HELP_STRING! - AS_HELP_STRING([--disable-freetypetest], - [Do not try to compile and run a test FreeType program]), - [], - [enable_fttest=yes]) + AC_ARG_ENABLE([freetypetest], + [AS_HELP_STRING([--disable-freetypetest], + [Do not try to compile and run a test FreeType program])], + [], + [enable_fttest=yes]) - if test x$ft_config_exec_prefix != x ; then - ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" - if test x${FT2_CONFIG+set} != xset ; then - FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config - fi - fi + if test x$ft_config_exec_prefix != x ; then + ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config + fi + fi - if test x$ft_config_prefix != x ; then - ft_config_args="$ft_config_args --prefix=$ft_config_prefix" - if test x${FT2_CONFIG+set} != xset ; then - FT2_CONFIG=$ft_config_prefix/bin/freetype-config - fi - fi + if test x$ft_config_prefix != x ; then + ft_config_args="$ft_config_args --prefix=$ft_config_prefix" + if test x${FT2_CONFIG+set} != xset ; then + FT2_CONFIG=$ft_config_prefix/bin/freetype-config + fi + fi - AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no]) + AC_PATH_PROG([FT2_CONFIG], [freetype-config], [no]) - min_ft_version=m4_if([$1], [], [7.0.1], [$1]) - AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version]) - no_ft="" - if test "$FT2_CONFIG" = "no" ; then - no_ft=yes - else - FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` - FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` - ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - ft_min_major_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - ft_min_minor_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - ft_min_micro_version=`echo $min_ft_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test x$enable_fttest = xyes ; then - ft_config_is_lt="" - if test $ft_config_major_version -lt $ft_min_major_version ; then - ft_config_is_lt=yes - else - if test $ft_config_major_version -eq $ft_min_major_version ; then - if test $ft_config_minor_version -lt $ft_min_minor_version ; then - ft_config_is_lt=yes - else + min_ft_version=m4_if([$1], [], [7.0.1], [$1]) + AC_MSG_CHECKING([for FreeType -- version >= $min_ft_version]) + no_ft="" + if test "$FT2_CONFIG" = "no" ; then + no_ft=yes + else + FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` + FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` + ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + ft_min_major_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + ft_min_minor_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + ft_min_micro_version=`echo $min_ft_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test x$enable_fttest = xyes ; then + ft_config_is_lt="" + if test $ft_config_major_version -lt $ft_min_major_version ; then + ft_config_is_lt=yes + else + if test $ft_config_major_version -eq $ft_min_major_version ; then + if test $ft_config_minor_version -lt $ft_min_minor_version ; then + ft_config_is_lt=yes + else if test $ft_config_minor_version -eq $ft_min_minor_version ; then - if test $ft_config_micro_version -lt $ft_min_micro_version ; then - ft_config_is_lt=yes - fi - fi - fi - fi - fi - if test x$ft_config_is_lt = xyes ; then - no_ft=yes - else - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $FT2_CFLAGS" - LIBS="$FT2_LIBS $LIBS" - - dnl - dnl Sanity checks for the results of freetype-config to some extent. - dnl - AC_RUN_IFELSE([ - AC_LANG_SOURCE([[ + if test $ft_config_micro_version -lt $ft_min_micro_version ; then + ft_config_is_lt=yes + fi + fi + fi + fi + fi + if test x$ft_config_is_lt = xyes ; then + no_ft=yes + else + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $FT2_CFLAGS" + LIBS="$FT2_LIBS $LIBS" + dnl + dnl Sanity checks for the results of freetype-config to some extent. + dnl + AC_RUN_IFELSE([ + AC_LANG_SOURCE([[ #include #include FT_FREETYPE_H @@ -1552,206 +1777,64 @@ } } - ]]) - ], - [], - [no_ft=yes], - [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"]) + ]] + )], + [], + [no_ft=yes], + [echo $ECHO_N "cross compiling; assuming OK... $ECHO_C"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi dnl test $ft_config_version -lt $ft_min_version - fi dnl test x$enable_fttest = xyes - fi dnl test "$FT2_CONFIG" = "no" + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi dnl test $ft_config_version -lt $ft_min_version + fi dnl test x$enable_fttest = xyes + fi dnl test "$FT2_CONFIG" = "no" - if test x$no_ft = x ; then - AC_MSG_RESULT([yes]) - m4_if([$2], [], [:], [$2]) - else - AC_MSG_RESULT([no]) - if test "$FT2_CONFIG" = "no" ; then - warn_ft2_config = " + if test x$no_ft = x ; then + AC_MSG_RESULT([yes]) + m4_if([$2], [], [:], [$2]) + else + AC_MSG_RESULT([no]) + if test "$FT2_CONFIG" = "no" ; then + warn_ft2_config = " The freetype-config script installed by FreeType 2 could not be found. If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in your path, or set the FT2_CONFIG environment variable to the full path to freetype-config. " - OCTAVE_CONFIGURE_WARNING([warn_ft2_config]) - else - if test x$ft_config_is_lt = xyes ; then - warn_ft2_too_old=" + OCTAVE_CONFIGURE_WARNING([warn_ft2_config]) + else + if test x$ft_config_is_lt = xyes ; then + warn_ft2_too_old=" Your installed version of the FreeType 2 library is too old. If you have different versions of FreeType 2, make sure that correct values for --with-ft-prefix or --with-ft-exec-prefix are used, or set the FT2_CONFIG environment variable to the full path to freetype-config. " - OCTAVE_CONFIGURE_WARNING([warn_ft2_too_old]) - else - warn_ft2_failed=" + OCTAVE_CONFIGURE_WARNING([warn_ft2_too_old]) + else + warn_ft2_failed=" The FreeType test program failed to run. If your system uses shared libraries and they are installed outside the normal system library path, make sure the variable LD_LIBRARY_PATH (or whatever is appropiate for your system) is correctly set. " - OCTAVE_CONFIGURE_WARNING([warn_ft2_failed]) - fi - fi + OCTAVE_CONFIGURE_WARNING([warn_ft2_failed]) + fi + fi - FT2_CFLAGS="" - FT2_LIBS="" - m4_if([$3], [], [:], [$3]) - fi + FT2_CFLAGS="" + FT2_LIBS="" + m4_if([$3], [], [:], [$3]) + fi - AC_SUBST([FT2_CFLAGS]) - AC_SUBST([FT2_LIBS])]) + AC_SUBST([FT2_CFLAGS]) + AC_SUBST([FT2_LIBS]) +]) dnl end of freetype2.m4 -dnl Check whether a math mapper function is available in . -dnl Will define HAVE_CMATH_FUNC if there is a double variant and -dnl HAVE_CMATH_FUNCF if there is a float variant. -dnl Currently capable of checking for functions with single -dnl argument and returning bool/int/real. -AC_DEFUN([OCTAVE_CMATH_FUNC],[ -AC_MSG_CHECKING([for std::$1 in ]) -AC_LANG_PUSH(C++) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -void take_func (bool (*func) (double x)); -void take_func (int (*func) (double x)); -void take_func (double (*func) (double x)); -]], -[[ -take_func(std::$1); -]])], -[AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_CMATH_[]AS_TR_CPP($1),1,[Define to 1 if provides $1.])], -[AC_MSG_RESULT([no])]) -AC_MSG_CHECKING([for std::$1 (float variant) in ]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -void take_func (bool (*func) (float x)); -void take_func (int (*func) (float x)); -void take_func (float (*func) (float x)); -]], -[[ -take_func(std::$1); -]])], -[AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_CMATH_[]AS_TR_CPP($1)F,1,[Define to 1 if provides float variant of $1.])], -[AC_MSG_RESULT([no])]) -AC_LANG_POP(C++) -]) - -dnl Check whether fast signed integer arithmetics using bit tricks -dnl can be used in oct-inttypes.h. Defines HAVE_FAST_INT_OPS if -dnl the following conditions hold: -dnl 1. Signed numbers are represented by twos complement -dnl (see ) -dnl 2. static_cast to unsigned int counterpart works like interpreting -dnl the signed bit pattern as unsigned (and is thus zero-cost). -dnl 3. Signed addition and subtraction yield the same bit results as unsigned. -dnl (We use casts to prevent optimization interference, so there is no -dnl need for things like -ftrapv). -dnl 4. Bit operations on signed integers work like on unsigned integers, -dnl except for the shifts. Shifts are arithmetic. -dnl -AC_DEFUN([OCTAVE_FAST_INT_OPS], -[AC_CACHE_CHECK([whether fast integer arithmetics is usable], -octave_cv_fast_int_ops, -[AC_LANG_PUSH(C++) -AC_RUN_IFELSE([AC_LANG_PROGRAM([[ -#include -template -static bool -do_test (UT, ST) -{ - volatile ST s = std::numeric_limits::min () / 3; - volatile UT u = static_cast (s); - if (*(reinterpret_cast (&u)) != s) return true; - - u = 0; u = ~u; - if (*(reinterpret_cast (&u)) != -1) return true; - - ST sx, sy; - sx = std::numeric_limits::max () / 2 + 1; - sy = std::numeric_limits::max () / 2 + 2; - if (static_cast (static_cast (sx) + static_cast (sy)) - != std::numeric_limits::min () + 1) return true; - if (static_cast (static_cast (sx) - static_cast (sy)) - != -1) return true; - - if ((sx & sy) != (static_cast (sx) & static_cast (sy))) - return true; - if ((sx | sy) != (static_cast (sx) | static_cast (sy))) - return true; - if ((sx ^ sy) != (static_cast (sx) ^ static_cast (sy))) - return true; - if ((-1 >> 1) != -1) return true; - return false; -} - -#define DO_TEST(T) \ -if (do_test (static_cast (0), static_cast (0))) \ - return sizeof (T); -]],[[ - DO_TEST(char) - DO_TEST(short) - DO_TEST(int) - DO_TEST(long) -#if (defined(HAVE_LONG_LONG_INT) && defined(HAVE_UNSIGNED_LONG_LONG_INT)) - DO_TEST(long long) -#endif -]])], - [octave_cv_fast_int_ops=yes], - [octave_cv_fast_int_ops=no], - [octave_cv_fast_int_ops=yes]) -AC_LANG_POP(C++)]) -if test $octave_cv_fast_int_ops = yes; then - AC_DEFINE(HAVE_FAST_INT_OPS, 1, - [Define to 1 if signed integers use two's complement.]) -fi -]) -dnl -dnl Check to see if the compiler and the linker can handle the flags -dnl "-framework $1" for the given prologue $2 and the given body $3 of -dnl a source file. Arguments 2 and 3 optionally can also be empty. -dnl Add options (lower case letters $1) "--with-framework-$1" and -dnl "--without-framework-$1". If this test is successful then perform -dnl $4, otherwise do $5. -dnl -dnl OCTAVE_HAVE_FRAMEWORK -AC_DEFUN([OCTAVE_HAVE_FRAMEWORK], [ - AC_MSG_CHECKING([whether ${LD-ld} accepts -framework $1]) - AC_CACHE_VAL(octave_cv_framework_$1, [ - XLDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -framework $1" - AC_LANG_PUSH(C++) - AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])], - eval "octave_cv_framework_$1=yes", - eval "octave_cv_framework_$1=no") - AC_LANG_POP(C++) - LDFLAGS="$XLDFLAGS" - ]) - if test "$octave_cv_framework_$1" = "yes"; then - AC_MSG_RESULT(yes) - AC_ARG_WITH(framework-m4_tolower($1), - [AS_HELP_STRING([--without-framework-m4_tolower($1)], - [don't use framework $1])], - with_have_framework=$withval, with_have_framework="yes") - if test "$with_have_framework" = "yes"; then - [$4] - else - AC_MSG_NOTICE([framework rejected by --without-framework-m4_tolower($1)]) - [$5] - fi - else - AC_MSG_RESULT(no) - [$5] - fi -]) ############################################################################## ############################################################################## @@ -1913,12 +1996,5 @@ ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES - -dnl -dnl External macros. -dnl +dnl end of pkg.m4 -m4_include([m4/ax_pthread.m4]) -m4_include([m4/ax_blas.m4]) -m4_include([m4/ax_blas_f77_func.m4]) -m4_include([m4/ax_lapack.m4]) diff --git a/m4/ax_blas.m4 b/m4/ax_blas.m4 --- a/m4/ax_blas.m4 +++ b/m4/ax_blas.m4 @@ -63,7 +63,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 11 +#serial 12 AU_ALIAS([ACX_BLAS], [AX_BLAS]) AC_DEFUN([AX_BLAS], [ @@ -130,7 +130,7 @@ # BLAS in Intel MKL library? if test $ax_blas_ok = no; then - AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl"]) + AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl -lguide -lpthread"],,[-lguide -lpthread]) fi # BLAS in Apple vecLib library? diff --git a/m4/ax_blas_f77_func.m4 b/m4/ax_blas_f77_func.m4 --- a/m4/ax_blas_f77_func.m4 +++ b/m4/ax_blas_f77_func.m4 @@ -52,7 +52,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 5 +#serial 8 AU_ALIAS([ACX_BLAS_F77_FUNC], [AX_BLAS_F77_FUNC]) AC_DEFUN([AX_BLAS_F77_FUNC], [ diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4 new file mode 100644 --- /dev/null +++ b/m4/ax_compare_version.m4 @@ -0,0 +1,177 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# This macro compares two version strings. Due to the various number of +# minor-version numbers that can exist, and the fact that string +# comparisons are not compatible with numeric comparisons, this is not +# necessarily trivial to do in a autoconf script. This macro makes doing +# these comparisons easy. +# +# The six basic comparisons are available, as well as checking equality +# limited to a certain number of minor-version levels. +# +# The operator OP determines what type of comparison to do, and can be one +# of: +# +# eq - equal (test A == B) +# ne - not equal (test A != B) +# le - less than or equal (test A <= B) +# ge - greater than or equal (test A >= B) +# lt - less than (test A < B) +# gt - greater than (test A > B) +# +# Additionally, the eq and ne operator can have a number after it to limit +# the test to that number of minor versions. +# +# eq0 - equal up to the length of the shorter version +# ne0 - not equal up to the length of the shorter version +# eqN - equal up to N sub-version levels +# neN - not equal up to N sub-version levels +# +# When the condition is true, shell commands ACTION-IF-TRUE are run, +# otherwise shell commands ACTION-IF-FALSE are run. The environment +# variable 'ax_compare_version' is always set to either 'true' or 'false' +# as well. +# +# Examples: +# +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +# +# would both be true. +# +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +# +# would both be false. +# +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +# +# would be true because it is only comparing two minor versions. +# +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +# +# would be true because it is only comparing the lesser number of minor +# versions of the two values. +# +# Note: The characters that separate the version numbers do not matter. An +# empty string is the same as version 0. OP is evaluated by autoconf, not +# configure, so must be a string, not a variable. +# +# The author would like to acknowledge Guido Draheim whose advice about +# the m4_case and m4_ifvaln functions make this macro only include the +# portions necessary to perform the specific comparison specified by the +# OP argument in the final configure script. +# +# LICENSE +# +# Copyright (c) 2008 Tim Toolan +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + AC_REQUIRE([AC_PROG_AWK]) + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [illegal OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([illegal OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 @@ -33,6 +33,10 @@ # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name # (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action @@ -45,9 +49,12 @@ # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # +# Updated for Autoconf 2.68 by Daniel Richard G. +# # LICENSE # # Copyright (c) 2008 Steven G. Johnson +# Copyright (c) 2011 Daniel Richard G. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -75,13 +82,12 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 9 +#serial 18 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_SAVE -AC_LANG_C +AC_LANG_PUSH([C]) ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h @@ -139,8 +145,8 @@ # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case "${host_cpu}-${host_os}" in - *solaris*) +case ${host_os} in + solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based @@ -153,9 +159,9 @@ ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; - *-darwin*) - ax_pthread_flags="-pthread $ax_pthread_flags" - ;; + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; esac if test x"$ax_pthread_ok" = xno; then @@ -171,12 +177,12 @@ PTHREAD_CFLAGS="$flag" ;; - pthread-config) - AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) - if test x"$ax_pthread_config" = xno; then continue; fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; + pthread-config) + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) @@ -198,16 +204,17 @@ # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. - AC_TRY_LINK([#include - static void routine(void* a) {a=0;} - static void* start_routine(void* a) {return a;}], - [pthread_t th; pthread_attr_t attr; - pthread_create(&th,0,start_routine,0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0); ], - [ax_pthread_ok=yes]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" @@ -230,12 +237,14 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_TRY_LINK([#include ], [int attr=$attr; return attr;], - [attr_name=$attr; break]) - done + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], + [int attr = $attr; return attr /* ; */])], + [attr_name=$attr; break], + []) + done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, @@ -245,24 +254,41 @@ AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + ax_cv_PTHREAD_PRIO_INHERIT, [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[#include ]], [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], + AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) + LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r - if test x"$GCC" != xyes; then + if test x"$GCC" != xyes; then AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) else PTHREAD_CC=$CC - fi + fi else PTHREAD_CC="$CC" fi @@ -279,5 +305,5 @@ ax_pthread_ok=no $2 fi -AC_LANG_RESTORE +AC_LANG_POP ])dnl AX_PTHREAD diff --git a/m4/module.mk b/m4/module.mk --- a/m4/module.mk +++ b/m4/module.mk @@ -2,6 +2,7 @@ m4/module.mk \ m4/ax_blas.m4 \ m4/ax_blas_f77_func.m4 \ + m4/ax_compare_version.m4 \ m4/ax_lapack.m4 \ m4/ax_pthread.m4 \ m4/gnulib-cache.m4 \ diff --git a/run-octave.in b/run-octave.in --- a/run-octave.in +++ b/run-octave.in @@ -32,7 +32,7 @@ d1="$top_srcdir/scripts" d2="$builddir/scripts" -d3="$builddir/src" +d3="$builddir/libinterp" d1_list=`$FIND "$d1" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` d2_list=`$FIND "$d2" -type d -a ! \( \( -name private -o -name '@*' \) -a -prune \) -exec echo '{}' ';' | $SED 's/$/:/'` @@ -42,6 +42,8 @@ d2_path=`echo "$d2_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` d3_path=`echo "$d3_list" | $AWK '{ t = (s $0); s = t; } END { sub (/:$/, "", s); print s; }'` +octave_executable="$builddir/src/octave" + LOADPATH="$d1_path:$d2_path:$d3_path" IMAGEPATH="$top_srcdir/scripts/image" DOCFILE="$builddir/doc/interpreter/doc-cache" @@ -64,11 +66,15 @@ elif [ "x$1" = "x-strace" ]; then driver="strace -o octave.trace" shift + elif [ "x$1" = "x-cli" ]; then + octave_executable="$builddir/src/octave-cli" + shift fi fi OCTAVE_SITE_INITFILE="$top_srcdir/scripts/startup/main-rcfile" \ +OCTAVE_DEFAULT_QT_SETTINGS="$top_srcdir/gui/default-qt-settings" \ exec $builddir/libtool --mode=execute $driver \ - "$builddir/src/octave" --no-init-path --path="$LOADPATH" \ + "$octave_executable" --no-init-path --path="$LOADPATH" \ --image-path="$IMAGEPATH" --doc-cache-file="$DOCFILE" \ --texi-macros-file="$TEXIMACROSFILE" --info-file="$INFOFILE" "$@" diff --git a/scripts/Makefile.am b/scripts/Makefile.am --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -371,6 +371,12 @@ done ) | ../run-octave -qf .PHONY: check-missing-semicolon +## Add rule to generate ctags. +## Automake would normally generate such a rule, but only if there is a +## xxx_SOURCES target +ctags: + ctags $(addprefix $(srcdir)/, $(FCN_FILES)) $(GEN_FCN_FILES) + install-data-local: install-startup-files install-pkg-add uninstall-local: uninstall-startup-files uninstall-pkg-add diff --git a/scripts/audio/playaudio.m b/scripts/audio/playaudio.m --- a/scripts/audio/playaudio.m +++ b/scripts/audio/playaudio.m @@ -47,7 +47,7 @@ fclose (fid); [status, out] = system (sprintf ('cat "%s" > /dev/dsp', file)); if (status != 0) - system (sprintf ("paplay --raw \"%s\"", file)) + system (sprintf ("paplay --raw \"%s\"", file)); endif unwind_protect_cleanup unlink (file); @@ -62,12 +62,12 @@ if (any (strcmp (ext, {"lin", "raw"}))) [status, out] = system (sprintf ('cat "%s" > /dev/dsp', name)); if (status != 0) - system (sprintf ('paplay --raw "%s"', name)) + system (sprintf ('paplay --raw "%s"', name)); endif elseif (any (strcmp (ext, {"mu", "au" "snd", "ul"}))) [status, out] = system (sprintf ('cat "%s" > /dev/audio', name)); if (status != 0) - system (sprintf ('paplay "%s"', name)) + system (sprintf ('paplay "%s"', name)); endif else error ("playaudio: unsupported extension '%s'", ext); diff --git a/scripts/general/accumarray.m b/scripts/general/accumarray.m --- a/scripts/general/accumarray.m +++ b/scripts/general/accumarray.m @@ -150,7 +150,7 @@ else ndims = columns (subs); if (lenvals > 1 && lenvals != rows (subs)) - error ("accumarray: dimension mismatch") + error ("accumarray: dimension mismatch"); endif endif diff --git a/scripts/general/accumdim.m b/scripts/general/accumdim.m --- a/scripts/general/accumdim.m +++ b/scripts/general/accumdim.m @@ -93,7 +93,7 @@ sz(dim) = n; if (length (subs) != size (vals, dim)) - error ("accumdim: dimension mismatch") + error ("accumdim: dimension mismatch"); endif if (isempty (func) || func == @sum) diff --git a/scripts/general/bicubic.m b/scripts/general/bicubic.m --- a/scripts/general/bicubic.m +++ b/scripts/general/bicubic.m @@ -94,7 +94,7 @@ elseif (all (diff (x) > 0)) flipx = false; else - error ("bicubic:nonmonotonic", "bicubic: X values must be monotonic") + error ("bicubic:nonmonotonic", "bicubic: X values must be monotonic"); endif if (all (diff (y) < 0)) flipy = true; @@ -102,7 +102,7 @@ elseif (all (diff (y) > 0)) flipy = false; else - error ("bicubic:nonmonotonic", "bicubic: Y values must be monotonic") + error ("bicubic:nonmonotonic", "bicubic: Y values must be monotonic"); endif ## Mark values outside the lookup table. diff --git a/scripts/general/interp1.m b/scripts/general/interp1.m --- a/scripts/general/interp1.m +++ b/scripts/general/interp1.m @@ -24,10 +24,9 @@ ## @deftypefnx {Function File} {@var{yi} =} interp1 (@dots{}, @var{extrap}) ## @deftypefnx {Function File} {@var{pp} =} interp1 (@dots{}, "pp") ## -## One-dimensional interpolation. Interpolate @var{y}, defined at the -## points @var{x}, at the points @var{xi}. The sample points @var{x} -## must be monotonic. If not specified, @var{x} is taken to be the -## indices of @var{y}. If @var{y} is an array, treat the columns +## One-dimensional interpolation. Interpolates to determine the value of +## @var{yi} at the points, @var{xi}. If not specified, @var{x} is taken +## to be the indices of @var{y}. If @var{y} is an array, treat the columns ## of @var{y} separately. ## ## Method is one of: @@ -51,8 +50,8 @@ ## @end table ## ## Appending '*' to the start of the above method forces @code{interp1} -## to assume that @var{x} is uniformly spaced, and only @code{@var{x} -## (1)} and @code{@var{x} (2)} are referenced. This is usually faster, +## to assume that @var{x} is uniformly spaced, and only @code{@var{x}(1)} +## and @code{@var{x}(2)} are referenced. This is usually faster, ## and is never slower. The default method is "linear". ## ## If @var{extrap} is the string "extrap", then extrapolate values beyond @@ -67,11 +66,15 @@ ## @var{xi}, @var{method}, "extrap")}. ## ## Duplicate points in @var{x} specify a discontinuous interpolant. There -## should be at most 2 consecutive points with the same value. -## The discontinuous interpolant is right-continuous if @var{x} is increasing, -## left-continuous if it is decreasing. -## Discontinuities are (currently) only allowed for "nearest" and "linear" -## methods; in all other cases, @var{x} must be strictly monotonic. +## may be at most 2 consecutive points with the same value. +## If @var{x} is increasing, the default discontinuous interpolant is +## right-continuous. If @var{x} is decreasing, the default discontinuous +## interpolant is left-continuous. +## The continuity condition of the interpolant may be specified by using +## the options, "-left" or "-right", to select a left-continuous +## or right-continuous interpolant, respectively. +## Discontinuous interpolation is only allowed for "nearest" and "linear" +## methods; in all other cases, the @var{x}-values must be unique. ## ## An example of the use of @code{interp1} is ## @@ -114,6 +117,7 @@ xi = []; ispp = false; firstnumeric = true; + rightcontinuous = []; if (nargin > 2) for i = 1:length (varargin) @@ -124,6 +128,10 @@ extrap = "extrap"; elseif (strcmp ("pp", arg)) ispp = true; + elseif (any (strcmp ({"right", "-right"}, arg))) + rightcontinuous = true; + elseif (any (strcmp ({"left", "-left"}, arg))) + rightcontinuous = false; else method = arg; endif @@ -168,26 +176,41 @@ y = y(p,:); endif + if (isempty (rightcontinuous)) + ## If not specified, set the continuity condition + if (x(end) < x(1)) + rightcontinuous = false; + else + rightcontinuous = true; + end + endif + + if ((rightcontinuous && (x(end) < x(1))) + || (~ rightcontinuous && (x(end) > x(1)))) + ## Switch between left-continuous and right-continuous + x = flipud (x); + y = flipud (y); + end + starmethod = method(1) == "*"; if (starmethod) dx = x(2) - x(1); else - jumps = x(1:nx-1) == x(2:nx); + jumps = x(1:end-1) == x(2:end); have_jumps = any (jumps); if (have_jumps) if (any (strcmp (method, {"nearest", "linear"}))) if (any (jumps(1:nx-2) & jumps(2:nx-1))) - warning ("interp1: extra points in discontinuities"); + error ("interp1: extra points in discontinuities"); endif else - error ("interp1: discontinuities not supported for method %s", method); + error ("interp1: discontinuities not supported for method `%s'", method); endif endif endif ## Proceed with interpolating by all methods. - switch (method) case "nearest" pp = mkpp ([x(1); (x(1:nx-1)+x(2:nx))/2; x(nx)], shiftdim (y, 1), szy(2:end)); @@ -348,6 +371,23 @@ %! %-------------------------------------------------------- %! % confirm that interpolated function matches the original +%!demo +%! clf; +%! x = 0:0.5:3; +%! x1 = [3 2 2 1]; +%! x2 = [1 2 2 3]; +%! y1 = [1 1 0 0]; +%! y2 = [0 0 1 1]; +%! h = plot (x, interp1 (x1, y1, x), 'b', x1, y1, 'sb'); +%! hold on +%! g = plot (x, interp1 (x2, y2, x), 'r', x2, y2, '*r'); +%! xlim ([1 3]) +%! legend ([h(1), g(1)], {'left-continous', 'right-continuous'}, ... +%! 'location', 'east') +%! legend boxoff +%! %-------------------------------------------------------- +%! % red curve is left-continuos and blue is right-continuous at x = 2 + ##FIXME: add test for n-d arguments here ## For each type of interpolated test, confirm that the interpolated @@ -436,6 +476,8 @@ %! interp1 (fliplr (xp),fliplr (yp),xi,style),100*eps) %!assert (ppval (interp1 (xp,yp,style,"pp"),xi), %! interp1 (xp,yp,xi,style,"extrap"),10*eps) +%!assert (interp1 ([1 2 2 3], [1 2 3 4], 2), 3); +%!assert (interp1 ([3 2 2 1], [4 3 2 1], 2), 2); %!error interp1 (1,1,1, style) ## ENDBLOCK diff --git a/scripts/general/narginchk.m b/scripts/general/narginchk.m --- a/scripts/general/narginchk.m +++ b/scripts/general/narginchk.m @@ -42,7 +42,7 @@ elseif (!isnumeric (maxargs) || !isscalar (maxargs)) error ("maxargs must be a numeric scalar"); elseif (minargs > maxargs) - error ("minargs cannot be larger than maxargs") + error ("minargs cannot be larger than maxargs"); endif args = evalin ("caller", "nargin;"); diff --git a/scripts/general/nargoutchk.m b/scripts/general/nargoutchk.m --- a/scripts/general/nargoutchk.m +++ b/scripts/general/nargoutchk.m @@ -87,7 +87,7 @@ elseif (!isnumeric (maxargs) || !isscalar (maxargs)) error ("maxargs must be a numeric scalar"); elseif (minargs > maxargs) - error ("minargs cannot be larger than maxargs") + error ("minargs cannot be larger than maxargs"); endif args = evalin ("caller", "nargout;"); diff --git a/scripts/general/nthargout.m b/scripts/general/nthargout.m --- a/scripts/general/nthargout.m +++ b/scripts/general/nthargout.m @@ -84,7 +84,7 @@ endif if (any (n != fix (n)) || ntot != fix (ntot) || any (n <= 0) || ntot <= 0) - error ("nthargout: N and NTOT must consist of positive integers") + error ("nthargout: N and NTOT must consist of positive integers"); endif outargs = cell (1, ntot); diff --git a/scripts/help/help.m b/scripts/help/help.m --- a/scripts/help/help.m +++ b/scripts/help/help.m @@ -44,7 +44,7 @@ if (nargin == 0) - puts ("\n\ + text = "\n\ For help with individual commands and functions type\n\ \n\ help NAME\n\ @@ -58,7 +58,13 @@ doc\n\ \n\ GNU Octave is supported and developed by its user community.\n\ - For more information visit http://www.octave.org.\n\n"); + For more information visit http://www.octave.org.\n\n"; + + if (nargout == 0) + puts (text); + else + retval = text; + endif elseif (nargin == 1 && ischar (name)) diff --git a/scripts/help/unimplemented.m b/scripts/help/unimplemented.m --- a/scripts/help/unimplemented.m +++ b/scripts/help/unimplemented.m @@ -310,7 +310,6 @@ "plotbrowser", "plotedit", "plottools", - "polyeig", "prefdir", "preferences", "printdlg", diff --git a/scripts/image/image.m b/scripts/image/image.m --- a/scripts/image/image.m +++ b/scripts/image/image.m @@ -127,7 +127,7 @@ dy = std (dy) / mean (abs (dy)); tol = 100*eps; if (any (dx > tol) || any (dy > tol)) - warning ("Image does not map to non-linearly spaced coordinates") + warning ("Image does not map to non-linearly spaced coordinates"); endif ca = gca (); diff --git a/scripts/pkg/pkg.m b/scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -317,6 +317,9 @@ ## Send verbose output to pager immediately. Change setting locally. page_output_immediately (true, "local"); case "-forge" + if (! octave_config_info ("CURL_LIBS")) + error ("pkg: can't download from forge without the cURL library"); + endif octave_forge = true; case "-local" global_install = false; diff --git a/scripts/plot/__gnuplot_drawnow__.m b/scripts/plot/__gnuplot_drawnow__.m diff --git a/scripts/plot/colorbar.m b/scripts/plot/colorbar.m --- a/scripts/plot/colorbar.m +++ b/scripts/plot/colorbar.m @@ -197,13 +197,13 @@ function resetaxis (cax, d, ax, orig_props) if (ishandle (ax) && strcmp (get (ax, "type"), "axes")) - dellistener (ax, "position") + dellistener (ax, "position"); units = get (ax, "units"); - set (ax, "units", orig_props.units) + set (ax, "units", orig_props.units); set (ax, "position", orig_props.position, ... "outerposition", orig_props.outerposition, ... "activepositionproperty", orig_props.activepositionproperty); - set (ax, "units", units) + set (ax, "units", units); endif endfunction diff --git a/scripts/plot/hdl2struct.m b/scripts/plot/hdl2struct.m --- a/scripts/plot/hdl2struct.m +++ b/scripts/plot/hdl2struct.m @@ -91,7 +91,7 @@ ii++; s.children(ii) = hdl2struct (lg); elseif (nlg > 1) - error ("hdl2struct: more than one legend found") + error ("hdl2struct: more than one legend found"); endif cb = findobj (par, "-depth", 1, "tag", "colorbar"); @@ -105,7 +105,7 @@ ii++; s.children(ii) = hdl2struct (cb); elseif (nlg > 1) - error ("hdl2struct: more than one colorbar found") + error ("hdl2struct: more than one colorbar found"); endif endif @@ -120,9 +120,9 @@ hdlist = []; regkids = get ( h, "children"); - set (0, "showhiddenhandles", "on") + set (0, "showhiddenhandles", "on"); allkids = get ( h, "children"); - set (0, "showhiddenhandles", "off") + set (0, "showhiddenhandles", "off"); speckids = arrayfun (@(x) ! any (x == regkids), allkids); hdlist = allkids (find (speckids)); hdlist = reshape (hdlist, 1, numel (hdlist)); diff --git a/scripts/plot/legend.m b/scripts/plot/legend.m --- a/scripts/plot/legend.m +++ b/scripts/plot/legend.m @@ -131,7 +131,7 @@ elseif (all (ishandle (plty))) ca = [ca, plty(:).']; else - error ("legend.m: This should not happen. File a bug report.") + error ("legend.m: This should not happen. File a bug report."); endif ## Remove duplicates while preserving order [~, n] = unique (ca); diff --git a/scripts/plot/plotyy.m b/scripts/plot/plotyy.m --- a/scripts/plot/plotyy.m +++ b/scripts/plot/plotyy.m @@ -91,7 +91,7 @@ ax = ax(1:2); elseif (length (ax) == 1) ax(2) = axes (); - set (ax(2), "nextplot", get (ax(1), "nextplot")) + set (ax(2), "nextplot", get (ax(1), "nextplot")); elseif (isempty (ax)) ax(1) = axes (); ax(2) = axes (); @@ -157,7 +157,7 @@ axes (ax(2)); else ax(2) = axes (); - set (ax(2), "nextplot", get (ax(1), "nextplot")) + set (ax(2), "nextplot", get (ax(1), "nextplot")); endif newplot (); @@ -218,14 +218,14 @@ elseif (ishandle (ax(1))) set (ax(1), "__plotyy_axes__", ax); else - error ("plotyy.m: This shouldn't happen. File a bug report.") + error ("plotyy.m: This shouldn't happen. File a bug report."); endif if (ishandle (ax(2)) && ! isprop (ax(2), "__plotyy_axes__")) addproperty ("__plotyy_axes__", ax(2), "data", ax); elseif (ishandle (ax(2))) set (ax(2), "__plotyy_axes__", ax); else - error ("plotyy.m: This shouldn't happen. File a bug report.") + error ("plotyy.m: This shouldn't happen. File a bug report."); endif endfunction diff --git a/scripts/plot/print.m b/scripts/plot/print.m --- a/scripts/plot/print.m +++ b/scripts/plot/print.m @@ -401,7 +401,7 @@ else fontsize = opts.fontsize; endif - if (! isempty (opts.scalefontsize) && ! opt.scalefontsize != 1) + if (! isempty (opts.scalefontsize) && ! opts.scalefontsize != 1) ## This is done to work around the bbox being whole numbers. fontsize = fontsize * opts.scalefontsize; endif diff --git a/scripts/plot/private/__go_draw_axes__.m b/scripts/plot/private/__go_draw_axes__.m --- a/scripts/plot/private/__go_draw_axes__.m +++ b/scripts/plot/private/__go_draw_axes__.m @@ -48,7 +48,7 @@ h = axis_obj.__plotyy_axes__; h = h(ishandle (h)); h = h(isprop (h, "__ploty_axes__")); - rmappdata (h, "__plotyy_axes__") + rmappdata (h, "__plotyy_axes__"); endif endif diff --git a/scripts/plot/private/__pie__.m b/scripts/plot/private/__pie__.m --- a/scripts/plot/private/__pie__.m +++ b/scripts/plot/private/__pie__.m @@ -117,16 +117,16 @@ if (strncmp (caller, "pie3", 4)) ln = length (xn); zlvl = 0.35; - sx = repmat (xoff + [0, - sind(xn), 0], [2 1]); - sy = repmat (yoff + [0, cosd(xn), 0], [2 1]); + sx = repmat (xoff + [0, -sind(xn), 0], [2, 1]); + sy = repmat (yoff + [0, cosd(xn), 0], [2, 1]); sz = [zeros(1, ln + 2); zlvl * ones(1, ln + 2)]; sc = i * ones (size (sz)); hlist = [hlist; - patch (xoff + [0, - sind(xn)], yoff + [0, cosd(xn)], zeros (1, ln + 1), i); - surface (sx, sy, sz, sc); - patch (xoff + [0, - sind(xn)], yoff + [0, cosd(xn)], zlvl * ones (1, ln + 1), i); - text (xt, yt, zlvl, labels{i})]; + patch(xoff + [0, -sind(xn)], yoff + [0, cosd(xn)], zeros (1, ln + 1), i); + surface(sx, sy, sz, sc); + patch(xoff + [0, -sind(xn)], yoff + [0, cosd(xn)], zlvl * ones (1, ln + 1), i); + text(xt, yt, zlvl, labels{i})]; elseif (strncmp (caller, "pie", 3)) if (xt > 0) @@ -135,8 +135,8 @@ align = "right"; endif - hlist = [hlist; patch(xoff + [0, - sind(xn)], yoff + [0, cosd(xn)], i); - text (xt, yt, labels{i}, "horizontalalignment", align)]; + hlist = [hlist; patch(xoff + [0, -sind(xn)], yoff + [0, cosd(xn)], i); + text(xt, yt, labels{i}, "horizontalalignment", align)]; else error ("__pie__: unknown caller `%s'", caller); diff --git a/scripts/plot/private/__print_parse_opts__.m b/scripts/plot/private/__print_parse_opts__.m --- a/scripts/plot/private/__print_parse_opts__.m +++ b/scripts/plot/private/__print_parse_opts__.m @@ -125,14 +125,14 @@ if (! isempty (n) && n == numel (arg) - 1 && ismember (arg(end), "124")) arg_st.ghostscript.antialiasing_textalphabits = str2num (arg(end)); else - error ("print: improper syntax, or value, for TextAlphaBits") + error ("print: improper syntax, or value, for TextAlphaBits"); endif elseif (strncmpi (arg, "-graphicsalphabits=", 19)) n = find (arg == "="); if (! isempty (n) && n == numel (arg) - 1 && ismember (arg(end), "124")) arg_st.ghostscript.antialiasing_graphicsalphabits = str2num (arg(end)); else - error ("print: improper syntax, or value, for GraphicsAlphaBits") + error ("print: improper syntax, or value, for GraphicsAlphaBits"); endif elseif ((length (arg) > 2) && arg(1:2) == "-G") arg_st.ghostscript.binary = file_in_path (getenv ("PATH"), arg(3:end)); diff --git a/scripts/plot/shrinkfaces.m b/scripts/plot/shrinkfaces.m --- a/scripts/plot/shrinkfaces.m +++ b/scripts/plot/shrinkfaces.m @@ -101,17 +101,17 @@ endif if (! isscalar (sf) || sf <= 0) - error ("shrinkfaces: scale factor must be a positive scalar") + error ("shrinkfaces: scale factor must be a positive scalar"); endif n = columns (vertices); if (n < 2 || n > 3) - error ("shrinkfaces: only 2D and 3D patches are supported") + error ("shrinkfaces: only 2D and 3D patches are supported"); endif m = columns (faces); if (m < 3) - error ("shrinkfaces: faces must consist of at least 3 vertices") + error ("shrinkfaces: faces must consist of at least 3 vertices"); endif v = vertices(faces'(:), :); @@ -134,8 +134,9 @@ switch (nargout) case 0 if (ishandle (p)) - set (p, "FaceVertexCData", [], "CData", []) # avoid exceptions - set (p, "Vertices", v, "Faces", f, "FaceVertexCData", c) + ## avoid exceptions + set (p, "FaceVertexCData", [], "CData", []); + set (p, "Vertices", v, "Faces", f, "FaceVertxCData", c); else nf = struct ("faces", f, "vertices", v, "facevertexcdata", c); endif diff --git a/scripts/plot/sombrero.m b/scripts/plot/sombrero.m --- a/scripts/plot/sombrero.m +++ b/scripts/plot/sombrero.m @@ -31,32 +31,26 @@ ## Author: jwe -function [x, y, z] = sombrero (n) +function [x, y, z] = sombrero (n = 41) - if (nargin == 0) - n = 41; + if (nargin > 2) + print_usage (); + elseif (n <= 1) + error ("sombrero: number of grid lines N must be greater than 1"); endif - if (nargin < 2) - if (n > 1) - tx = linspace (-8, 8, n)'; - ty = tx; - [xx, yy] = meshgrid (tx, ty); - r = sqrt (xx .^ 2 + yy .^ 2) + eps; - tz = sin (r) ./ r; - if (nargout == 0) - surf (tx, ty, tz); - box ("off"); - else - x = tx; - y = ty; - z = tz; - endif - else - error ("sombrero: number of grid lines must be greater than 1"); - endif + tx = linspace (-8, 8, n)'; + ty = tx; + [xx, yy] = meshgrid (tx, ty); + r = sqrt (xx .^ 2 + yy .^ 2) + eps; + tz = sin (r) ./ r; + if (nargout == 0) + surf (tx, ty, tz); + box ("off"); else - print_usage (); + x = tx; + y = ty; + z = tz; endif endfunction @@ -67,3 +61,7 @@ %! colormap ('default'); %! sombrero (); +## Test input validation +%!error sombrero (1,2,3) +%!error sombrero (1) + diff --git a/scripts/polynomial/module.mk b/scripts/polynomial/module.mk --- a/scripts/polynomial/module.mk +++ b/scripts/polynomial/module.mk @@ -13,6 +13,7 @@ polynomial/poly.m \ polynomial/polyaffine.m \ polynomial/polyder.m \ + polynomial/polyeig.m \ polynomial/polyfit.m \ polynomial/polygcd.m \ polynomial/polyint.m \ diff --git a/scripts/polynomial/pchip.m b/scripts/polynomial/pchip.m --- a/scripts/polynomial/pchip.m +++ b/scripts/polynomial/pchip.m @@ -80,12 +80,12 @@ y = y(:).'; ##row vector szy = size (y); if (! size_equal (x, y)) - error ("pchip: length of X and Y must match") + error ("pchip: length of X and Y must match"); endif else szy = size (y); if (n != szy(end)) - error ("pchip: length of X and last dimension of Y must match") + error ("pchip: length of X and last dimension of Y must match"); endif y = reshape (y, [prod(szy(1:end-1)), szy(end)]); endif diff --git a/scripts/polynomial/polyeig.m b/scripts/polynomial/polyeig.m new file mode 100644 --- /dev/null +++ b/scripts/polynomial/polyeig.m @@ -0,0 +1,91 @@ +## Copyright (C) 2012 Fotios Kasolis +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## . + +## -*- texinfo -*- +## @deftypefn {Function File} {@var{z} =} polyeig (@var{C0}, @var{C1}, @dots{}, @var{Cl}) +## @deftypefnx {Function File} {[@var{v}, @var{z}] =} polyeig (@var{C0}, @var{C1}, @dots{}, @var{Cl}) +## +## Solve the polynomial eigenvalue problem of degree @var{l}. +## +## Given an @var{n*n} matrix polynomial +## @code{@var{C}(s) = @var{C0} + @var{C1} s + @dots{} + @var{Cl} s^l} +## polyeig solves the eigenvalue problem +## @code{(@var{C0} + @var{C1} + @dots{} + @var{Cl})v = 0}. +## Note that the eigenvalues @var{z} are the zeros of the matrix polynomial. +## @var{z} is an @var{lxn} vector and @var{v} is an (@var{n} x @var{n})l matrix +## with columns that correspond to the eigenvectors. +## +## @seealso{eig, eigs, compan} +## @end deftypefn + +## Author: Fotios Kasolis + +function [ z, varargout ] = polyeig (varargin) + + if ( nargout > 2 ) + print_usage (); + endif + + nin = numel (varargin); + + n = zeros (1, nin); + + for cnt = 1 : nin + if ! ( issquare (varargin{cnt}) ) + error ("polyeig: coefficients must be square matrices"); + endif + n(cnt) = size (varargin{cnt}, 1); + endfor + + if numel (unique (n)) > 1 + error ("polyeig: coefficients must have the same dimensions"); + endif + n = unique (n); + + ## matrix polynomial degree + l = nin - 1; + + ## form needed matrices + C = [ zeros(n * (l - 1), n), eye(n * (l - 1)); + -cell2mat(varargin(1 : end - 1)) ]; + + D = [ eye(n * (l - 1)), zeros(n * (l - 1), n); + zeros(n, n * (l - 1)), varargin{end} ]; + + ## solve generalized eigenvalue problem + if ( isequal (nargout, 1) ) + z = eig (C, D); + else + [ z, v ] = eig (C, D); + varargout{1} = v; + ## return n-element eigenvectors normalized so + ## that the infinity-norm = 1 + z = z(1:n,:); + ## max() takes the abs if complex: + t = max (z); + z /= diag (t); + endif + +endfunction + +%!test +%! C0 = [8, 0; 0, 4]; C1 = [1, 0; 0, 1]; +%! [v,z] = polyeig (C0, C1); +%! assert (isequal (z(1), -8), true); +%! d = C0*v + C1*v*z; +%! assert (isequal (norm(d), 0.0), true); diff --git a/scripts/polynomial/polyval.m b/scripts/polynomial/polyval.m --- a/scripts/polynomial/polyval.m +++ b/scripts/polynomial/polyval.m @@ -79,10 +79,10 @@ dy = reshape (dy, size (x)); catch if (isempty (s)) - error ("polyval: third input is required.") + error ("polyval: third input is required."); elseif (isstruct (s) && all (ismember ({"R", "normr", "df"}, fieldnames (s)))) - error (lasterr ()) + error (lasterr ()); elseif (isstruct (s)) error ("polyval: third input is missing the required fields."); else diff --git a/scripts/testfun/rundemos.m b/scripts/testfun/rundemos.m --- a/scripts/testfun/rundemos.m +++ b/scripts/testfun/rundemos.m @@ -65,7 +65,7 @@ try demo (f); catch - printf ("error: %s\n\n", lasterror().message) + printf ("error: %s\n\n", lasterror().message); end_try_catch if (i != numel (flist)) input ("Press to continue: ", "s"); diff --git a/src/Makefile.am b/src/Makefile.am --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,288 +22,84 @@ ## Search local directories before those specified by the user. AM_CPPFLAGS = \ - -I$(top_srcdir)/libcruft/misc \ - -I../liboctave -I$(top_srcdir)/liboctave \ - -Ioctave-value -I$(srcdir)/octave-value \ - -Iparse-tree -I$(srcdir)/parse-tree \ - -Ioperators -I$(srcdir)/operators \ - -Iinterp-core -I$(srcdir)/interp-core \ - -Iinterpfcn -I$(srcdir)/interpfcn \ - -Icorefcn \ - -I. -I$(srcdir) \ - -I../libgnu -I$(top_srcdir)/libgnu \ - @CPPFLAGS@ - -AUTOMAKE_OPTIONS = subdir-objects - -octlib_LTLIBRARIES = liboctinterp.la + -I$(srcdir)/../libinterp \ + -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu if AMCOND_BUILD_COMPILED_AUX_PROGRAMS bin_PROGRAMS = \ mkoctfile \ - octave \ + $(OCTAVE_PROGRAMS) \ octave-config mkoctfile_SOURCES = nodist_mkoctfile_SOURCES = mkoctfile.cc -mkoctfile_LDADD = ../libgnu/libgnu.la $(LIBS) +mkoctfile_LDADD = $(top_builddir)/libgnu/libgnu.la $(LIBS) octave_config_SOURCES = nodist_octave_config_SOURCES = octave-config.cc -octave_config_LDADD = corefcn/libcorefcn.la ../libgnu/libgnu.la $(LIBS) +octave_config_LDADD = \ + corefcn/libcorefcn.la \ + $(top_builddir)/libgnu/libgnu.la \ + $(LIBS) BUILT_SOURCES_EXTRA = \ mkoctfile.cc \ octave-config.cc else bin_PROGRAMS = \ - octave + octave \ + octave-cli bin_SCRIPTS = \ mkoctfile \ octave-config endif -## Order matters here. Leave builtins.cc last, because it depends on -## $(DEF_FILES), and building those requires all the sources -## (except builtins.cc) to be available. -BUILT_SOURCES = \ - interp-core/mxarray.h \ - interp-core/oct-errno.cc \ - interpfcn/defaults.h \ - interpfcn/graphics-props.cc \ - interpfcn/graphics.h \ - operators/ops.cc \ - parse-tree/lex.cc \ - parse-tree/oct-gperf.h \ - parse-tree/oct-parse.cc \ - oct-conf.h \ - version.h \ - $(BUILT_SOURCES_EXTRA) \ - builtins.cc - -BUILT_DISTFILES = \ - parse-tree/oct-gperf.h \ - parse-tree/oct-parse.h - -## Files that are created during build process and installed, -## BUT not distributed in tarball. -BUILT_NODISTFILES = \ - interp-core/mxarray.h \ - interp-core/oct-errno.cc \ - interpfcn/defaults.h \ - interpfcn/graphics.h \ - operators/ops.cc \ - oct-conf.h \ - version.h \ - $(OPT_HANDLERS) \ - $(OPT_INC) \ - $(ALL_DEF_FILES) \ - builtins.cc - EXTRA_DIST = \ - Makefile.in \ - DOCSTRINGS \ - find-defun-files.sh \ - gendoc.pl \ - genprops.awk \ - mk-errno-list \ - mk-pkg-add \ - mkbuiltins \ - mkdefs \ mkoctfile.in.cc \ mkoctfile.in.sh \ - mkops \ - oct-conf.in.h \ octave-config.in.cc \ - octave-config.in.sh \ - version.in.h \ - $(BUILT_DISTFILES) + octave-config.in.sh -octinclude_HEADERS = \ - interpfcn/graphics-props.cc \ - parse-tree/oct-gperf.h \ - builtins.h \ - octave.h \ - $(OV_INCLUDES) \ - $(OV_SPARSE_INCLUDES) \ - $(PT_INCLUDES) \ - $(OPERATOR_INCLUDES) \ - $(INTERP_CORE_INCLUDES) \ - $(INTERPFCN_INCLUDES) +OCTAVE_CORE_LIBS = \ + ../libinterp/liboctinterp.la \ + ../liboctave/liboctave.la \ + ../libcruft/libcruft.la -nodist_octinclude_HEADERS = \ - interp-core/mxarray.h \ - interpfcn/defaults.h \ - interpfcn/graphics.h \ - oct-conf.h \ - version.h +include ../libgui/src/link-deps.mk + +octave_cli_SOURCES = main-cli.cc -DIST_SRC = \ - octave.cc \ - $(OCTAVE_VALUE_SRC) \ - $(PARSE_TREE_SRC) \ - $(INTERP_CORE_SRC) \ - $(INTERPFCN_SRC) \ - $(COREFCN_SRC) +octave_cli_LDADD = \ + $(OCTAVE_CORE_LIBS) + $(OCTAVE_LINK_DEPS) -noinst_LTLIBRARIES = +octave_cli_LDFLAGS = \ + $(NO_UNDEFINED_LDFLAG) \ + $(OCTAVE_LINK_OPTS) -include parse-tree/module.mk -include octave-value/module.mk -include operators/module.mk -include template-inst/module.mk -include interp-core/module.mk -include interpfcn/module.mk -include corefcn/module.mk -include dldfcn/module.mk - -$(srcdir)/dldfcn/module.mk: $(srcdir)/dldfcn/config-module.sh $(srcdir)/dldfcn/config-module.awk $(srcdir)/dldfcn/module-files - $(srcdir)/dldfcn/config-module.sh $(top_srcdir) - -if AMCOND_ENABLE_DYNAMIC_LINKING - OCT_FILES = $(DLDFCN_LIBS:.la=.oct) - OCT_STAMP_FILES = $(subst dldfcn/,dldfcn/$(am__leading_dot),$(DLDFCN_LIBS:.la=.oct-stamp)) - DLD_LIBOCTINTERP_LIBADD = liboctinterp.la +if AMCOND_BUILD_GUI + octave_SOURCES = main.cc + OCTAVE_GUI_LIBS = ../libgui/src/liboctgui.la + OCTAVE_GUI_CPPFLAGS = -I$(top_srcdir)/libgui/src else - OCT_FILES = - OCT_STAMP_FILES = - DLD_LIBOCTINTERP_LIBADD = + octave_SOURCES = main-cli.cc + OCTAVE_GUI_LIBS = + OCTAVE_GUI_CPPFLAGS = endif -liboctinterp_la_SOURCES = \ - octave.cc \ - $(OPERATORS_SRC) \ - $(TEMPLATE_INST_SRC) - -nodist_liboctinterp_la_SOURCES = \ - interp-core/mxarray.h \ - interp-core/oct-errno.cc \ - interpfcn/defaults.h \ - interpfcn/graphics.h \ - operators/ops.cc \ - builtins.cc \ - oct-conf.h \ - version.h \ - $(OPT_INC) - -liboctinterp_la_CPPFLAGS = @OCTINTERP_DLL_DEFS@ $(AM_CPPFLAGS) - -include link-deps.mk - -liboctinterp_la_LIBADD = \ - octave-value/liboctave-value.la \ - parse-tree/libparse-tree.la \ - interp-core/libinterp-core.la \ - interpfcn/libinterpfcn.la \ - corefcn/libcorefcn.la \ - ../liboctave/liboctave.la \ - ../libcruft/libcruft.la \ - $(LIBOCTINTERP_LINK_DEPS) - -# Increment these as needed and according to the rules in the libtool manual: -liboctinterp_current = 1 -liboctinterp_revision = 1 -liboctinterp_age = 0 - -liboctinterp_version_info = $(liboctinterp_current):$(liboctinterp_revision):$(liboctinterp_age) - -liboctinterp_la_LDFLAGS = \ - -version-info $(liboctinterp_version_info) \ - $(NO_UNDEFINED_LDFLAG) \ - -bindir $(bindir) \ - $(LIBOCTINTERP_LINK_OPTS) - -## FIXME: Does this rule need to be uncommented? -#fft.df fft.lo fft2.df fft2.lo fftn.df fftn.lo: CPPFLAGS += $(FFTW_XCPPFLAGS) - -octave_SOURCES = main.c +octave_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + $(OCTAVE_GUI_CPPFLAGS) octave_LDADD = \ - liboctinterp.la \ - ../liboctave/liboctave.la \ - ../libcruft/libcruft.la \ - $(OCTAVE_LINK_DEPS) + $(OCTAVE_GUI_LIBS) \ + $(OCTAVE_CORE_LIBS) \ + $(OCTAVE_GUI_LINK_DEPS) octave_LDFLAGS = \ $(NO_UNDEFINED_LDFLAG) \ - $(OCTAVE_LINK_OPTS) - -## Section for defining and creating DEF_FILES -SRC_DEF_FILES := $(shell $(srcdir)/find-defun-files.sh "$(srcdir)" $(DIST_SRC)) - -DLDFCN_DEF_FILES = $(DLDFCN_SRC:.cc=.df) - -## builtins.cc depends on $(DEF_FILES), so DEF_FILES should only include -## .df files that correspond to sources included in liboctave. -if AMCOND_ENABLE_DYNAMIC_LINKING - DEF_FILES = $(SRC_DEF_FILES) -else - DEF_FILES = $(SRC_DEF_FILES) $(DLDFCN_DEF_FILES) -endif - -ALL_DEF_FILES = $(SRC_DEF_FILES) $(DLDFCN_DEF_FILES) - -$(SRC_DEF_FILES): mkdefs Makefile - -$(DEF_FILES): $(OPT_HANDLERS) $(OPT_INC) - -DLL_CDEFS = @OCTINTERP_DLL_DEFS@ -DLL_CXXDEFS = @OCTINTERP_DLL_DEFS@ - -## Rule to build a DEF file from a .cc file -%.df: %.cc - $(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \ - -DMAKE_BUILTINS $< | $(srcdir)/mkdefs $(srcdir) $< > $@-t - mv $@-t $@ - -## Special rules: -## Mostly for sources which must be built before rest of compilation. - -## oct-conf.h must depend on Makefile. Calling configure -## may change default/config values. However, calling configure will also -## regenerate the Makefiles from Makefile.am and trigger the rules below. -oct-conf.h: oct-conf.in.h Makefile - @$(do_subst_config_vals) - -version.h: version.in.h Makefile - $(SED) < $< \ - -e "s|%NO_EDIT_WARNING%|DO NOT EDIT! Generated automatically from $( $@-t - mv $@-t $@ - -builtins.cc: $(DEF_FILES) mkbuiltins - $(srcdir)/mkbuiltins $(DEF_FILES) > $@-t - mv $@-t $@ - -if AMCOND_ENABLE_DYNAMIC_LINKING -DLDFCN_PKG_ADD_FILE = dldfcn/PKG_ADD - -dldfcn/PKG_ADD: $(DLDFCN_DEF_FILES) mk-pkg-add - $(srcdir)/mk-pkg-add $(DLDFCN_DEF_FILES) > $@-t - mv $@-t $@ -endif - -if AMCOND_BUILD_DOCS -.DOCSTRINGS: $(ALL_DEF_FILES) gendoc.pl - if [ "x$(srcdir)" != "x." ] && [ -f $(srcdir)/DOCSTRINGS ] && [ ! -f DOCSTRINGS ]; then \ - cp $(srcdir)/DOCSTRINGS DOCSTRINGS; \ - touch -r $(srcdir)/DOCSTRINGS DOCSTRINGS; \ - fi - @echo "creating .DOCSTRINGS from .cc source files" - @$(PERL) $(srcdir)/gendoc.pl $(ALL_DEF_FILES) > $@ - $(top_srcdir)/build-aux/move-if-change $@ DOCSTRINGS - touch $@ - -all-local: $(OCT_STAMP_FILES) $(DLDFCN_PKG_ADD_FILE) .DOCSTRINGS -else -all-local: $(OCT_STAMP_FILES) $(DLDFCN_PKG_ADD_FILE) -endif + $(OCTAVE_GUI_LINK_OPTS) if AMCOND_BUILD_COMPILED_AUX_PROGRAMS octave-config.cc: octave-config.in.cc Makefile @@ -323,9 +119,7 @@ install-exec-hook: make-version-links -install-data-hook: install-oct - -uninstall-local: remove-version-links uninstall-oct +uninstall-local: remove-version-links make-version-links: cd $(DESTDIR)$(bindir) && \ @@ -353,48 +147,5 @@ .PHONY: make-version-links remove-version-links -if AMCOND_ENABLE_DYNAMIC_LINKING -install-oct: - $(top_srcdir)/build-aux/mkinstalldirs $(DESTDIR)$(octfiledir) - if [ -n "`cat $(DLDFCN_PKG_ADD_FILE)`" ]; then \ - $(INSTALL_DATA) $(DLDFCN_PKG_ADD_FILE) $(DESTDIR)$(octfiledir)/PKG_ADD; \ - fi - cd $(DESTDIR)$(octlibdir) && \ - for ltlib in $(DLDFCN_LIBS); do \ - f=`echo $$ltlib | $(SED) 's,.*/,,'`; \ - dl=`$(SED) -n -e "s/dlname='\([^']*\)'/\1/p" < $$f`; \ - if [ -n "$$dl" ]; then \ - $(INSTALL_PROGRAM) $$dl $(DESTDIR)$(octfiledir)/`echo $$f | $(SED) 's,^lib,,; s,\.la$$,.oct,'`; \ - else \ - echo "error: dlname is empty in $$ltlib!"; \ - exit 1; \ - fi; \ - lnames=`$(SED) -n -e "s/library_names='\([^']*\)'/\1/p" < $$f`; \ - if [ -n "$$lnames" ]; then \ - rm -f $$f $$lnames $$dl; \ - fi \ - done - -uninstall-oct: - for f in $(notdir $(OCT_FILES)); do \ - rm -f $(DESTDIR)$(octfiledir)/$$f; \ - done - rm -f $(DESTDIR)$(octfiledir)/PKG_ADD -endif -.PHONY: install-oct uninstall-oct - CLEANFILES = \ - $(bin_SCRIPTS) \ - $(DLDFCN_PKG_ADD_FILE) \ - interpfcn/graphics-props.cc \ - parse-tree/oct-parse.output - -DISTCLEANFILES = \ - .DOCSTRINGS \ - DOCSTRINGS \ - $(BUILT_NODISTFILES) \ - $(OCT_FILES) \ - $(OCT_STAMP_FILES) - -MAINTAINERCLEANFILES = \ - $(BUILT_DISTFILES) + $(bin_SCRIPTS) diff --git a/src/main-cli.cc b/src/main-cli.cc new file mode 100644 --- /dev/null +++ b/src/main-cli.cc @@ -0,0 +1,37 @@ +/* + +Copyright (C) 2012 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +int +main (int argc, char **argv) +{ + octave_process_command_line (argc, argv); + + octave_initialize_interpreter (argc, argv, 0); + + return octave_execute_interpreter (); +} diff --git a/src/main.c b/src/main.c deleted file mode 100644 --- a/src/main.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - -Copyright (C) 2002-2012 John W. Eaton - -This file is part of Octave. - -Octave is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 3 of the License, or (at your -option) any later version. - -Octave is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -You should have received a copy of the GNU General Public License -along with Octave; see the file COPYING. If not, see -. - -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "f77-fcn.h" -#include "lo-ieee.h" - -#include "octave.h" - -int -main (int argc, char **argv) -{ - return octave_main (argc, argv, 0); -} diff --git a/src/main.cc b/src/main.cc new file mode 100644 --- /dev/null +++ b/src/main.cc @@ -0,0 +1,47 @@ +/* + +Copyright (C) 2012 John W. Eaton + +This file is part of Octave. + +Octave is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +Octave is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Octave; see the file COPYING. If not, see +. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +int +main (int argc, char **argv) +{ + int retval = 0; + + octave_process_command_line (argc, argv); + + if (octave_starting_gui ()) + retval = octave_start_gui (argc, argv); + else + { + octave_initialize_interpreter (argc, argv, 0); + + retval = octave_execute_interpreter (); + } + + return retval; +} diff --git a/test/fntests.m b/test/fntests.m --- a/test/fntests.m +++ b/test/fntests.m @@ -41,7 +41,7 @@ testdirs = {currdir, srcdir}; endif -src_tree = canonicalize_file_name (fullfile (topsrcdir, "src")); +src_tree = canonicalize_file_name (fullfile (topsrcdir, "libinterp")); liboctave_tree = canonicalize_file_name (fullfile (topsrcdir, "liboctave")); script_tree = canonicalize_file_name (fullfile (topsrcdir, "scripts")); local_script_tree = canonicalize_file_name (fullfile (currdir, "../scripts"));