Commit 0fb356fd authored by Colin Tuckley's avatar Colin Tuckley Committed by Christoph Berg

Import Debian changes 3.4.1-1

unixcw (3.4.1-1) unstable; urgency=medium

  * New upstream release.
  * Bump standards version to 3.9.6.
parents ddb8292f 7af96175
See README for authorship and acknowledgements.
See THANKS for authorship and acknowledgements.
This diff is collapsed.
This is HISTORY file for unixcw. It describes major changes in unixcw
releases. For detailed description of changes see NEWS file.
The original UnixCW package, version 1, grew out of a desire to have a program
available under Linux that was very similar to the one I was used to under DOS.
While several Linux Morse Tutors were, in fact, still are, available, I never
quite found one that did the stuff I wanted.
From the original UnixCW package came version 2. This was almost a total
rewrite, although it included the same basic binaries as were in version 1.
The two major changes for this version were the addition of an extensive,
general purpose CW library, and also an X Window-based CW tutor program.
With version 2.1, finally, came full sound card support, built into the CW
library itself. All three main user level programs that use the library were
enhanced to allow control over the sound card tone volume. Console speaker
sound is still there, if needed, but sound card tones became the default mode.
Version 2.2 was a bug-fixed version of 2.1. It seems that some sound card
drivers (some later OSS drivers) couldn't handle the volume control ioctls that
the CW library uses, and this meant sound card tones would not work for these
systems. To solve this, version 2.2 uses the /dev/mixer device to control
volumes if it finds that it cannot do this with the main sound card device.
Version 2.3 is a thorough overhaul, cleanup, and refactoring of version 2.2.
All the code has been reformatted for correct Gnu style, and programs now take
a lot more care over what they do, and don't do, in signal handler context.
cwcp and xcwcp now offer fully configurable modes and dictionaries through a
configuration file option, and xcwcp has been rewritten in proper C++ style.
Version 3.0 has been prepared and released by new lead developer,
Kamil Ignacak. The takeover of unixcw has been discussed with and
approved by Simon Baldwin. Main changes in 3.0 are:
o rewriting parts of libcw so that using OSS is less probable to cause
problems (this should solve at least one Debian bug)
o adding support for ALSA to libcw; libcw uses OSS as default audio system,
but there are no differences in support of OSS and ALSA in terms of
functionality
o porting xcwcp to Qt4
The fact that there is a new maintainer should take some burden off of
shoulders of Kamal Mostafa, who was responsible for (among other things)
patching unixcw.
Version 3.0 introduces some changes in API, and there should be some
more API changes in 3.1. Hopefully things will be more stable in 3.2.
Version 3.0.1 contains small fixes that don't influence core capabilities
of any application, but are still important. Patches for this release were
provided mainly by Kamal Mostafa (thanks Kamal!).
Version 3.1.0 adds support for PulseAudio.
Plenty of other changes in library code improve timings of tones produced
by the library.
Few library functions are deprecated, they are replaced by new functions.
Version 3.1.1 fixes small problem with interlocks in thread code.
Version 3.2.0 introduces small fixes and improvements in libcw, and
implements new debug facilities (the old ones are being deprecated).
It also fixes faulty logic checking "--disable-feature" flags in
configure.ac. The problem was spotted by Thomas Beierlein.
Version 3.3.0 is mostly fixes. More fixes in configuration flags
(thanks again to Thomas Beierlein). Patches fixing compilation under
FreeBSD (thanks to Diane Bruce). Fixes and improvements of handling of
iambic keying in libcw and xcwcp. Fixing compilation error in
cwutils/dictionary.h.
Version 3.3.1 is just one fix in libcw. Thanks to Pino Zollo ZP4KFX
for reporting a bug and testing solution.
Version 3.4.0 contains two changes in source code:
- refreshment of cwcp code;
- splitting libcw.c into parts.
Additionally the build system has been updated to correctly build
unixcw on:
- FreeBSD 10 (x86_64-unknown-freebsd10.0, with clang 3.3);
- FreeBSD 9.3 (freebsd9.3 with gcc 4.2.1);
- OpenBSD 5.5 (amd64-unknown-openbsd5.5 with gcc 4.2.1);
Version 3.4.1 focused on internal changes in libcw. All library code
is now split between separate module files. Some test code from
libcw_test_public.c has been moved to respective modules.
\ No newline at end of file
This diff is collapsed.
SUBDIRS=src
EXTRA_DIST = configure.qt.inc \
EXTRA_DIST = \
icon_unixcw.svg icon_unixcw.xpm \
unixcw-2.3.spec unixcw-3.3.1.lsm \
unixcw-2.3.spec unixcw-3.4.1.lsm \
po/UnixCW.po \
THANKS HISTORY \
debian
This diff is collapsed.
# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com)
# Copyright (C) 2011-2014 Kamil Ignacak (acerion@wp.pl)
# Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
......@@ -27,8 +27,9 @@ AC_LDCONFIG = @LDCONFIG@
AC_LIBS = @LIBS@
AC_AWK = @AWK@
AC_QT4CFLAGS = @QT4CFLAGS@
AC_QT4MOC = @QT4MOC@
AC_QT4_CFLAGS = @QT4_CFLAGS@
AC_QT4_LIBS = @QT4_LIBS@
AC_QT4_MOC = @MOC@
AC_SRC_SUBDIRS = @SRC_SUBDIRS@
AC_CFLAG_PIC = @CFLAG_PIC@
......
version 3.4.1 / 2015-01-02
libcw:
- The remainder of code from libcw.c has been moved to respective
module files. New module file has been created: libcw_rec.c - it
contains receiver code. I think that number of modules won't
change anymore. libcw.c has been removed, all functionality is now
implemented by module files.
- A number of unit test functions has been moved from
libcw_test_public.c to respective module files. These functions
can be executed independently, so there is no reason to keep them
in libcw_test_public.c. They can be kept in module files, close to
tested library functions. libcw_test_public.c is now less
difficult to work with. The moved test functions are now executed
while building "make check" target, so they should be called more
often, increasing the chances of catching problems early.
- Data sets for some of receiver's unit tests are now generated by
helper functions. This allowed me to increase size of the data
sets and increase variation of the data (both for fixed speed
receiving and for adaptive receiving).
The data sets are basically timing tables used to drive the
receiver - to test main functions of the receiver, responsible for
accepting mark/space events from client code.
The increased size and variation of the test data gives me more
confidence that the core functionality of the receiver works as
expected.
- If you run libcw in debugging mode and you depend on Receiver
State names (strings starting with RS_) printed by library's debug
messages, you may want to check changed values of RS enum and
corresponding strings on top of libcw_rec.c - they have been
changed.
- Some changes have been made to library functions (mainly in
generator and receiver modules) to ensure that the code separated
between modules can be compiled and that it works as expected.
Since receiver code has been put in a separate file, it was
possible to review and refactor the receiver code a bit.
No functionality of the library has been changed, with an
exception described in next point.
- Data type of receiver's speed is now internally a float instead of
int. This change improves behaviour of adaptive receiving
algorithm a bit. It's not a big change, but it may positively
impact client code using receiver functions.
- libcw_test_public test executable now accepts '-m' command line
option (for selecting module(s)) to test. Check output of
'libcw_test_public -h' for more details.
- Since the modification described above does not change how the
library works, nor does it change any API, there is no reason for
any major revision changes. Library soname/version has been
changed from 6.2.1 to 6.3.1.
----------------------------------------------------------------------------
version 3.4.0 / 2014-11-11
unixcw:
- Build system files have been modified to correctly configure and
compile unixcw (or at least parts of it) on following platforms
(in addition to Debian GNU/Linux):
- FreeBSD 10.0 (x86_64-unknown-freebsd10.0, with clang 3.3);
- FreeBSD 9.3 (freebsd9.3 with gcc 4.2.1);
- OpenBSD 5.5 (amd64-unknown-openbsd5.5 with gcc 4.2.1);
See INSTALL file for more information.
- QT4 configuration flags (CFLAGS, LIBS, MOC) are now detected only
by using pkg-config. My hand-made script that searched for QT4
files has been reduced to simple call to PKG_CHECK_MODULES().
This means that the following arguments are no longer accepted by
configure script:
--with-qt-cflags=<string>
--with-qt-libraries=<path>
If you want to override pkg-config settings, you can still use
environment variables. Check output of "./configure --help" for
details
libcw:
- Large parts of libcw.c have been moved to new files:
- libcw_gen.c (generator)
- libcw_tq.c (tone queue)
- libcw_data.c (representations and lookup)
- libcw_key.c (straight key, iambic keyer)
- libcw_signal.c (signal handling)
- libcw_utils.c (utility functions)
Benefits of this move:
- I won't have to use a table of contents to move around in
libcw.c (the file had 10kLOC before this operation);
- it will be easier to define boundaries between functionality of
modules, and it will be easier to reason about how these modules
should function and interact with each other;
Check ChangeLog entry from 2014-07-28 for more information on this
subject.
Separation of libcw modules is not yet completed. Receiver code is
still mixed with generator code, and there are still some
functions left in libcw.c. I expect to finish the separation in
one or two development cycles.
- "make check" now builds three executables in libcw directory:
- libcw_test_internal
- libcw_test_public
- libcw_test_simple_gen
main() functions for test executables have been moved outside of
libcw.c.
- fixed bug in OSS code on BSD systems (found under FreeBSD 10). As
part of configuring OSS device, libcw made this call:
ioctl(*fd, SNDCTL_DSP_POST, &parameter)
It turns out that this call was unnecessary and returned error
value. This prevented libcw from correctly opening OSS device.
Now OSS device should be again available to unixcw applications.
Notice that this bug most probably affected only BSD systems.
- Library soname/version changed from 6.1.1 to 6.2.1.
All these changes described above did not change API of the
library in any way. Functionality of the library is
intact. libcw.h header file has not been changed at all.
cwcp:
- cwcp ignored CWCP_OPTIONS environment variable. Now it should read
it and use it as intended.
- cwcp code has been reviewed. Code has been modified to ensure that
each call to ncurses' newwin() is matched with delwin(). valgrind
may still complain, but now the situation is a bit better.
----------------------------------------------------------------------------
version 3.3.1 / 2014-04-23
libcw:
......
This diff is collapsed.
unixcw was developed by Simon Baldwin, G0FRD <simon_baldwin@yahoo.com>.
----------
Thanks to...
Kamal Mostafa, KA6MAL, for reviewing the libcw API, showing me the errors of my
ways with 64-bit integers, and hounding me to add the adaptive receive speed
tracking...
Joop Stakenborg, PG4I, for being a willing "guinea pig" with various snapshots
of unfinished versions of the package, for help in isolating various sound card
problems, and for his continued enthusiasm and interest in maintaining UnixCW
as a Debian Linux package...
Paolo Cravero, IK1ZYW, for very kindly making the first sound card patch
available for UnixCW 2. His tone generation code is now fully embedded inside
the CW library, and it's no exaggeration to say that without his help, there
would still be no sound card support in UnixCW...
Michael D. Ivey, for identifying a problem with CW sending rhythm when sending
in 'Farnsworth' mode, and for taking the time and trouble to test the patches
I sent him...
Wolf-Ruediger Juergens, for ideas on implementing CW weighting...
Diane Bruce and Jason L. Wright, for adding support for assorted BSD flavors...
Dan Jacobson, for making improvement suggestions above and beyond the call of
duty...
And finally, everyone else who has sent feedback about UnixCW. If not for your
interest, and fairly frequent requests for a version that works with a sound
card, the package would not have progressed at all.
Simon Baldwin, G0FRD <simon_baldwin@yahoo.com>
TODO:
Add to configure.ac a check for GNU make on build machine. unixcw's
Makefiles may not work with non-GNU make on non Linux machines.
Add to configure.ac a check for pkg-config. It is necessary for
configuring QT4 application (xcwcp).
Make qa_test_configure_flags.sh portable. Some shells (on FreeBSD)
don't like the options[] table.
After finalizing split of libcw into modules, add configure flags for
disabling modules (e.g. --disable-libcw-receiver,
--disable-libcw-key).
Check if it's possible to use pkg-config to get ncurses compilation
flags.
----------
DONE:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com)
# Copyright (C) 2011-2014 Kamil Ignacak (acerion@wp.pl)
# Copyright (C) 2011-2015 Kamil Ignacak (acerion@wp.pl)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
......@@ -19,10 +19,13 @@
# General initializations.
AC_PREREQ(2.57)
AC_INIT([unixcw], [3.3.1])
AC_CONFIG_SRCDIR([src/libcw/libcw.c])
AC_INIT([unixcw], [3.4.1])
AC_CONFIG_SRCDIR([src/libcw/libcw_gen.c])
AM_INIT_AUTOMAKE
# Libtool initialization, added during tests on FreeBSD
LT_INIT
# Specify a configuration header.
AC_CONFIG_HEADERS(src/config.h)
......@@ -33,11 +36,70 @@ AC_PROG_CC
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_LIBTOOL
AC_PROG_RANLIB # Added during tests on FreeBSD
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
AM_PROG_CC_C_O
# OS-specific configuration. On top there are default values of some
# flags, to be modified per host type.
# General notice: FreeBSD 9.3 doesn't like empty quotes
# (e.g. DL_LIB=\"\"). Empty string should be totally empty.
# libcw on Linux needs "-ldl" library (dlopen() and related symbols)
# for dynamic loading of ALSA and PulseAudio libraries. Tested BSD
# systems (FreeBSD and OpenBSD) don't have a separate -ldl library
# (and since they don't support ALSA and PulseAudio, libcw on BSDs
# wouldn't even need the library).
DL_LIB=
# libcw on OpenBSD (tested on 5.5) needs -lossaudio for _oss_ioctl
# symbol. No explicit OSS library needed by libcw on FreeBSD and
# Linux. Quick and short googling suggests that NetBSD also uses
# ossaudio library.
# TODO: consider using AC_CHECK_LIB(ossaudio, _oss_ioctl)
OSS_LIB=
AC_CANONICAL_HOST
case $host_os in
*linux*|*Linux*)
AC_MSG_NOTICE([Detected Linux: $host_os])
# Needed because of dynamic loading of libraries in libcw.
DL_LIB=\"-ldl\"
;;
*freebsd*|*FreeBSD*)
AC_MSG_NOTICE([Detected FreeBSD: $host_os])
;;
*openbsd*|*OpenBSD*)
AC_MSG_NOTICE([Detected OpenBSD: $host_os])
OSS_LIB=\"-lossaudio\"
;;
*netbsd*|*NetBSD*)
# I didn't test unixcw on NetBSD, but let's give it a
# chance.
AC_MSG_NOTICE([Detected NetBSD: $host_os])
OSS_LIB=\"-lossaudio\"
;;
*)
AC_MSG_NOTICE([Detected other OS: $host_os])
# Until someone complains, for other OSes we will configure
# the flags the same way as on Linux.
DL_LIB=\"-ldl\"
;;
esac
AC_SUBST(DL_LIB)
AC_SUBST(OSS_LIB)
# Check specifically for gzip and ldconfig, and substitute the harmless ":"
# if absent.
AC_PATH_PROG(GZIP, gzip, ,)
......@@ -74,7 +136,7 @@ fi
# I'm defining it here so that it's available in config.h and can be
# used in libcw's cw_version() function that should return the
# numbers.
LIBCW_VERSION=\"6:1:1\"
LIBCW_VERSION=\"6:3:1\"
AC_DEFINE_UNQUOTED([LIBCW_VERSION], $LIBCW_VERSION, [Library version, libtool notation])
AC_SUBST(LIBCW_VERSION)
......@@ -90,7 +152,7 @@ AC_ARG_ENABLE([console],
[],
[enable_console=yes])
AC_MSG_CHECKING([whether to include console buzzer audio suport])
AC_MSG_CHECKING([whether to include console buzzer audio support])
if test "$enable_console" = "yes" ; then
AC_MSG_RESULT(yes)
else
......@@ -199,6 +261,7 @@ fi
if test "$enable_console" = "no" ; then
WITH_CONSOLE='no'
else
# Search for header that provides KIOCSOUND
AC_CHECK_HEADERS([sys/kd.h sys/vtkd.h sys/kbio.h])
if test "$ac_cv_header_sys_kd_h" = 'no' \
&& test "$ac_cv_header_sys_vtkd_h" = 'no' \
......@@ -300,17 +363,26 @@ fi
if test "$enable_xcwcp" = "no" ; then
WITH_XCWCP='no'
else
# autodetection of Qt4 dependencies
m4_include([configure.qt.inc])
# http://stackoverflow.com/questions/5178511/integrate-qt-project-with-autotool
PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.4.0], [
AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
if [[ "$QT4CFLAGS" -a "$QT4MOC" ]] ; then
# we have moc4 and path to Qt4 include files,
# so we can build xcwcp
WITH_XCWCP='yes'
else
WITH_XCWCP='no'
AC_MSG_WARN([Cannot find Qt4 files - unable to build xcwcp])
fi
AC_MSG_RESULT([QT4 CLFAGS is $QT4_CFLAGS])
AC_MSG_RESULT([QT4 LIBS is $QT4_LIBS])
AC_SUBST(QT4_CFLAGS)
AC_SUBST(QT4_LIBS)
AC_SUBST(MOC)
WITH_XCWCP='yes'
], [
AC_MSG_WARN([Cannot find Qt4 files - unable to build xcwcp])
WITH_XCWCP='no'
])
fi
......@@ -335,13 +407,12 @@ LIBS=
# Checks for header files, and refuse to go on if no KIOCSOUND is available.
# Checks for header files
AC_HEADER_STDC
AC_HEADER_STDBOOL
AC_HEADER_TIME
AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h strings.h sys/ioctl.h \
sys/param.h sys/time.h unistd.h locale.h libintl.h])
AC_CHECK_HEADERS([getopt.h])
AC_CHECK_HEADERS([string.h strings.h])
if test "$ac_cv_header_string_h" = 'no' \
......@@ -350,14 +421,12 @@ if test "$ac_cv_header_string_h" = 'no' \
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_C_VOLATILE
AC_PROG_GCC_TRADITIONAL
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRCOLL
......@@ -494,6 +563,7 @@ AC_SUBST(LD_LINKS_SO)
AC_CONFIG_FILES([Makefile.inc
Makefile
src/Makefile
......@@ -511,23 +581,33 @@ fi
AC_MSG_NOTICE([----------------------------------------------------])
AC_MSG_NOTICE([------------ unixcw build configuration ------------])
AC_MSG_NOTICE([build libcw: ................................. yes])
AC_MSG_NOTICE([build cw & cwgen: ............................ yes])
AC_MSG_NOTICE([build cwcp: .................................. $WITH_CWCP])
AC_MSG_NOTICE([build xcwcp: ................................. $WITH_XCWCP])
AC_OUTPUT
# Put this at the very end, so that these are the last lines seen by
# user on console with low number of rows.
AC_MSG_NOTICE([----------------------------------------------])
AC_MSG_NOTICE([------ $PACKAGE_NAME $PACKAGE_VERSION build configuration ------])
AC_MSG_NOTICE([operating system: ...................... $host_os])
AC_MSG_NOTICE([build libcw: ........................... yes])
AC_MSG_NOTICE([build cw & cwgen: ...................... yes])
AC_MSG_NOTICE([build cwcp: ............................ $WITH_CWCP])
AC_MSG_NOTICE([build xcwcp: ........................... $WITH_XCWCP])
if test "$WITH_XCWCP" = 'yes' ; then
AC_MSG_NOTICE([ Qt4 CFLAGS is $QT4CFLAGS])
AC_MSG_NOTICE([ Qt4 moc is $QT4MOC])
fi
AC_MSG_NOTICE([include console buzzer support: .............. $WITH_CONSOLE])
AC_MSG_NOTICE([include OSS support: ......................... $WITH_OSS])
AC_MSG_NOTICE([include ALSA support: ........................ $WITH_ALSA])
AC_MSG_NOTICE([include PulseAudio support: .................. $WITH_PULSEAUDIO])
AC_MSG_NOTICE([----------------------------------------------------])
AC_MSG_NOTICE([ Qt4 CFLAGS is $QT4_CFLAGS])
AC_MSG_NOTICE([ Qt4 LIBS is $QT4_LIBS])
AC_MSG_NOTICE([ Qt4 MOC is $MOC])
fi
AC_MSG_NOTICE([include console buzzer support: ........ $WITH_CONSOLE])
AC_MSG_NOTICE([include OSS support: ................... $WITH_OSS])
AC_MSG_NOTICE([include ALSA support: .................. $WITH_ALSA])
AC_MSG_NOTICE([include PulseAudio support: ............ $WITH_PULSEAUDIO])
if test "$WITH_DEV" = 'yes' ; then
AC_MSG_NOTICE([enable dev support: ........................... yes])
AC_MSG_NOTICE([enable dev support: ..................... yes])
fi
AC_OUTPUT
AC_MSG_NOTICE([----------------------------------------------])
# Copyright (C) 2001-2006 Simon Baldwin (simon_baldwin@yahoo.com)
# Copyright (C) 2011-2014 Kamil Ignacak (acerion@wp.pl)
#
# 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.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Script that detects some paths/files necessary to build
# Qt4 application using autotools.
# On success, the script sets three variables for build system by making
# these two calls:
# AC_SUBST(QT4CFLAGS, $QT4_CFLAGS)
# AC_SUBST(QT4LIBS)
# AC_SUBST(QT4MOC)
# You can include this file to your configure.ac file like this:
# # detection of Qt4 moc and Qt4 include dir
# m4_include([configure.qt.inc])
MOC_MAJOR_EARLIEST=4
# There are four major tasks performed by this script:
# Task 1: find Qt4 include directory, and for QT4 library
# Task 2: find Qt4 moc
# Task 3: make sure that major version of the moc is >= MOC_MAJOR_EARLIEST
# Task 4: on success set up some build system variables (AC_SUBST)
QT4CFLAGS="" # QT4-related define flags, and full path to directory with QT4 QtCore + QtGui subdirs and include files, e.g. /usr/include/qt4/
QT4MOC="" # full path to Qt4 moc
# QT4DIR="" # for testing purposes
AC_ARG_WITH([qt-cflags],
AC_HELP_STRING([--with-qt-cflags=<string>],
[Qt4-related defines, and path to Qt4 include files]),
[QT4CFLAGS=$with_qt_cflags])
AC_ARG_WITH([qt-libraries],
AC_HELP_STRING([--with-qt-libraries=<path>],
[path to qt4 libraries]),
[QT4LIBS=$with_qt_libraries])
# Task 1: find Qt4 include directory, and for QT4 library
PKG_CHECK_MODULES([QT4], [ "QtCore QtGui"],
[ AC_SUBST(QT4CFLAGS, $QT4_CFLAGS) AC_SUBST(QT4LIBS) ],
[ AC_MSG_ERROR([Qt4 libs not found])
])
# Task 2: find Qt4 moc
QT4MOC=""
QT4MOC_PATH=""
QT4MOC_PATH=${MOC}
if [[ $MOC ]] ; then
QT4MOC_PATH=${MOC}
ac_cv_path_QT4MOC_PATH=$MOC
echo ac_cv_path_QT4MOC_PATH $ac_cv_path_QT4MOC_PATH
elif [[ -z $QT4DIR ]] ; then
# we should guess where Qt4 moc binary is;
# first we see if we are lucky and Qt4 moc installed on build machine
# is called moc-qt4;
# on my system /usr/bin/moc links to /etc/alternatives/moc, which links
# to /usr/binary/moc-qt4 - the real binary
AC_PATH_PROG(QT4MOC_PATH, moc-qt4, , $PATH)
if [[[ "$QT4MOC_PATH" = "" ]]] ; then
# there is no moc-qt4, so let's try to find "regular" moc;
# we will check its version below
AC_PATH_PROG(QT4MOC_PATH, moc, , $PATH)
fi
else
# There is a decent build environment on this build machine, it
# defines/provides a $QT4DIR environment variable. Use it to find
# Qt4 moc, and to locate Qt4 include dir (which should be trivial).
# Look for moc, either on $PATH (?), or in $QT4DIR/bin.
AC_PATH_PROG(QT4MOC_PATH, moc, , $QT4DIR/bin:$PATH)
fi
# Task 3: make sure that major version of the moc is >= MOC_MAJOR_EARLIEST
if [[ "$QT4MOC_PATH" ]] ; then
MOC_VERSION="`$QT4MOC_PATH -v 2>&1 | sed -e 's;.*(Qt ;;' -e 's;).*;;'`"
if [[ "$MOC_VERSION" ]] ; then
MOC_MAJOR="`echo $MOC_VERSION | sed -e 's;\..*;;'`"
expr "$MOC_MAJOR" + 0 >/dev/null 2>/dev/null
status=$?
if [[ "$MOC_MAJOR" -a $status = "0" ]] ; then
if [[ "$MOC_MAJOR" -lt "$MOC_MAJOR_EARLIEST" ]] ; then
AC_MSG_WARN("Found moc $MOC_VERSION - unable to build xcwcp")
AC_MSG_WARN(["xcwcp requires moc version >= $MOC_MAJOR_EARLIEST"])
</