sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: Jan Stary <hans@stare.cz>
Cc: sox-devel@lists.sourceforge.net
Subject: Re: Build system cleanup
Date: Thu, 27 Aug 2020 12:52:57 +0100	[thread overview]
Message-ID: <yw1xmu2gjofa.fsf@mansr.com> (raw)
In-Reply-To: <20200827092158.GA5768@www.stare.cz> (Jan Stary's message of "Thu, 27 Aug 2020 11:21:58 +0200")

Jan Stary <hans@stare.cz> writes:

>> The result is in the 'new-build' git branch.
>> I'd appreciate if people, especially on BSD,
>> could give it a try and report any problems.
>
> Testing on NetBSD 8.0, with the latest commits
> to the new-build branch pulled in.
>
> It seems that the recent commit regarding audioio.h and soundcard.h,
> while it makes the build not fail, also mis-detects NetBSD's output
> audio driver. The result is a sox that builds but cannot play;
> full log below, comments inline.
>
> 	Jan
>
> It's cc (nb2 20180327) 5.5.0, with the following packages
> as installed by NetBSD's packaging system:

[...]

> checking for strdup... yes
>
> 	Not specific to NetBSD of course, but why are we running these
> 	tests (taking strdup as a random example)? Is there a POSIX
> 	system without strdup? And if we miss strdup, then what?
> 	With that configure.ac line changed to check for xstrdup instead,
> 	this will just become
>
> 		checking for xstrdup... no
>
> 	but everyting follows as before. Which means we have checked for
> 	a function (via AC_CHECK_FUNCS), found out it does not exist,
> 	and ignored the result. What is that for?

I already explained this about five times.

> checking for popen... yes
> checking for vsnprintf... yes
> checking for gettimeofday... yes
> checking for mkstemp... yes
> checking for fmemopen... yes
> checking for sigaction... yes
> checking for library containing pow... -lm
> checking for library containing lrint... none required
>
> 	This seems to be the same error as on OpenBSD:
>
> 	$ nm /lib/libc.so | grep -Fw lrint
> 	$ nm /lib/libm.so | grep -Fw lrint 
> 	000000000000f4f9 T lrint
>
> 	So -lm _is_ required for lrint() - it works by accident,
> 	because -lm is pulled in anyway to have pow().

If the text said "no additional libraries required", would you be happy?
That's what it actually means, and I don't consider it a bug.  It's
checking if those functions exist and if they require -lm.  They're now
standard C99, so this can probably be safely simplified to simply check
whether -lm is required at all.

> checking for magic.h... yes
> checking for magic_open in -lmagic... yes
>
> 	That's /usr/include/magic.h and /usr/lib/libmagic.so,
> 	found in the default paths.

Is that a problem?

> checking for zlib.h... yes
> checking for uncompress in -lz... yes
>
> 	/usr/include/zlib.h
> 	/usr/lib/libz.so

Yes, and?

> checking for png.h... no
>
> 	On NetBSD, the third-party packages are installed into /usr/pkg
> 	- I will run a separate test with the external libraries.

If the compiler doesn't look there by default, some environment
variables will have to be set.

> checking for id3tag.h... no
> checking for gsm/gsm.h... no
> checking for gsm.h... no
> checking for opencore-amrnb/interf_dec.h... no
> checking for opencore-amrwb/dec_if.h... no
> checking for vo-amrwbenc/enc_if.h... no
> checking for flac... yes
>
> 	Found in /usr/pkg via pkg-config:
>
> 	$ pkg-config --cflags --libs flac
> 	-I/usr/pkg/include -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lFLAC

Is this a problem?

> checking for sys/soundcard.h... yes
>
> 	On NetBSD, sys/soundcard.h says
>
> 		This is an OSS (Linux) audio emulator.
>  		Use the Native NetBSD API for developing new code,
> 		and this only for compiling Linux programs.
>
> 	The check is
>
> 	SOX_FMT_HEADERS([oss], [sys/soundcard.h], [SOUND_MIXER_MUTE],
> 		[], [devices])
>
> 	so at least we correctly recognize this as OSS emulation.
> 	But the check does not work universaly: NetBSD has
> 	/usr/include/sys/soundcard.h -> ../soundcard.h, but e.g.
> 	OpenBSD only has /usr/include/soundcard.h (same code though).
> 	Apparently, the name makes a difference:
> 	a test for "sys/soundcard.h" will fail on OpenBSD.
>
> checking whether SOUND_MIXER_MUTE is declared... no
>
> 	Why SOUND_MIXER_MUTE, specificaly, out of all the others?
> 	For example, SOUND_MIXER_INFO is declared, which would
> 	make the oss emulation detected (not saying this is
> 	the correct test).
>
> 	Lastly, oss requires a library to be linked:
> 	https://netbsd.gw.com/cgi-bin/man-cgi?ossaudio
> 	That would be /usr/lib/libossaudio.so - I believe a recent
> 	commit has concluded that oss does not require any library
> 	(being a bunch of defined ioctls); on NetBSD, it maybe does.
>
> 	$ nm /usr/lib/libossaudio.so | grep oss
> 	0000000000001f60 T _oss_ioctl

Real OSS does _not_ need a library.  That is _only_ used for the
incomplete emulation that we don't want.  The test is chosen such that
it passes on Linux, FreeBSD, and Solaris while failing on NetBSD and
OpenBSD.

> checking for sndio.h... no
>
> checking for sys/audioio.h... yes
>
> 	This seems to be NetBSD's native audio interface.
> 	https://netbsd.gw.com/cgi-bin/man-cgi?audio
> 	It's what the NetBSD port of SoX uses:
> 	http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/audio/sox/
>
> checking whether AUDIO_HWFEATURE_DUPLEX is declared... no
>
> 	... but we miss that, because of this.
> 	It seems NetBSD's audio system came from Sun audio
> 	(/usr/pkg/bin/sox reports AUDIO DEVICE DRIVERS: sunau),
> 	but it's not quite the same; in particular,
> 	AUDIO_HWFEATURE_DUPLEX is not defined.

Already fixed.

> 	Maybe we can backport some patches from the NetBSD port.
> 	http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/audio/sox/patches/

I'll take a look.

> /bin/sh ../libtool  --tag=CC	--mode=link gcc	 -g -O2 -fstack-protector-strong -Wall -Wmissing-prototypes -Wstrict-prototypes -fopenmp   -Wl,--as-needed -o sox sox.o	 libsox.la			-lm
> libtool: link: gcc -g -O2 -fstack-protector-strong -Wall -Wmissing-prototypes -Wstrict-prototypes -fopenmp -Wl,--as-needed -o .libs/sox sox.o  ./.libs/libsox.so -L/usr/pkg/lib -lmagic /usr/pkg/lib/libFLAC.so /usr/pkg/lib/libopusfile.so /usr/pkg/lib/libopus.so /usr/pkg/lib/libvorbisenc.so /usr/pkg/lib/libvorbisfile.so /usr/pkg/lib/libvorbis.so /usr/pkg/lib/libogg.so -lm -fopenmp -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/pkg/lib
>
> 	Full path of .libs/libsox.so and the external libraries,
> 	-lm -lmagic for the system libraries.
> 	Not sure how /usr/local/lib got there
> 	- /usr/local doesn't even exist here.

You used the (default) /usr/local installation prefix.  An rpath entry
for this is added to the linked executable so the shared library will be
found once installed.  This is reasonable.

-- 
Måns Rullgård


_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

  parent reply	other threads:[~2020-08-27 11:53 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27  9:21 Build system cleanup Jan Stary
2020-08-27 10:54 ` Jan Stary
2020-08-27 11:52 ` Måns Rullgård [this message]
2020-08-27 12:40   ` Jan Stary
2020-08-27 12:44     ` Jan Stary
2020-08-27 12:45     ` Måns Rullgård
2020-08-27 17:45 ` Jan Stary
2020-08-27 18:59   ` Måns Rullgård
2020-08-27 19:51     ` Jan Stary
2020-08-27 20:01 ` Jan Stary
2020-08-28  9:21   ` Måns Rullgård
2020-08-28  9:35     ` Jan Stary
2020-08-28  9:43       ` Måns Rullgård
  -- strict thread matches above, loose matches on Subject: below --
2020-08-21  8:52 Jan Stary
2020-08-21 10:36 ` Måns Rullgård
2020-08-21 12:22   ` Jan Stary
2020-08-21 12:27     ` Måns Rullgård
2020-08-19 20:40 Måns Rullgård
2020-08-20 20:40 ` Wolfgang Stoeggl via SoX-devel
2020-08-20 21:22   ` Måns Rullgård
2020-08-20 22:15     ` Wolfgang Stoeggl via SoX-devel
2020-08-21  8:24     ` Jan Stary
2020-08-21  8:16 ` Jan Stary
2020-08-21  8:31   ` Jan Stary
2020-08-21 10:28     ` Måns Rullgård
2020-08-21 12:24       ` Jan Stary
2020-08-21 12:46         ` Måns Rullgård
2020-08-21  8:49   ` Jan Stary
2020-08-21 10:33     ` Måns Rullgård
2020-08-21 12:49       ` Jan Stary
2020-08-21 12:50         ` Jan Stary
2020-08-21 13:32         ` Måns Rullgård
2020-08-21 14:09         ` Jan Stary
2020-08-21 11:15   ` Måns Rullgård
2020-08-21 14:04     ` Jan Stary
2020-08-21 14:47       ` Måns Rullgård
2020-08-21 19:26       ` Wolfgang Stoeggl
2020-08-21 20:20       ` Jan Stary
2020-08-21 15:16   ` Jan Stary
2020-08-21 15:21     ` Jan Stary
2020-08-21 17:08       ` Måns Rullgård
2020-08-21 17:43         ` Jan Stary
2020-08-21 17:52           ` Måns Rullgård
2020-08-21 17:57             ` Jan Stary
2020-08-21 20:17             ` Jan Stary
2020-08-21 20:45               ` Jan Stary
2020-08-21 21:43                 ` Måns Rullgård
2020-08-22  8:17                   ` Jan Stary
2020-08-22 10:10                     ` Måns Rullgård
2020-08-22 15:35                       ` Jan Stary
2020-08-22 15:44                         ` Jan Stary
2020-08-22 20:54                         ` Måns Rullgård
2020-08-23 14:07                           ` Jan Stary
2020-08-23 17:13                             ` Måns Rullgård
2020-08-23 19:46                               ` Jan Stary
2020-08-24 11:04                                 ` Måns Rullgård
2020-08-24 11:19                                   ` Jan Stary
2020-08-27  9:38                                     ` Jan Stary
2020-08-27 10:53                                       ` Måns Rullgård
2020-08-23 21:55                               ` Jan Stary
2020-08-24  6:56                                 ` Jan Stary
2020-08-27  9:40                                   ` Jan Stary
2020-08-27 11:08                                     ` Måns Rullgård
2020-08-27 11:37                                       ` Jan Stary
2020-08-27 11:53                                         ` Måns Rullgård
2020-08-27 13:05                                     ` Jan Stary
2020-08-27 13:31                                       ` Måns Rullgård
2020-08-27 14:10                                         ` Jan Stary
2020-08-27 14:38                                           ` Jan Stary
2020-08-27 15:11                                         ` Måns Rullgård
2020-08-27 17:41                                           ` Jan Stary
2020-08-27 18:50                                             ` Måns Rullgård
2020-08-27 19:18                                               ` Jan Stary
2020-08-28  4:54                                                 ` Jan Stary
2020-08-28  9:13                                                 ` Måns Rullgård
2020-08-24 12:19                                 ` Måns Rullgård
2020-08-24 14:43                                   ` Jan Stary
2020-08-24 14:59                                     ` Måns Rullgård
2020-08-27  9:44                                       ` Jan Stary
2020-08-27 11:08                                         ` Måns Rullgård
2020-08-24 17:22                                     ` Måns Rullgård
2020-08-22 15:43                     ` Jan Stary
2020-08-22 15:48                       ` Jan Stary
2020-08-24 12:18                   ` Jan Stary
2020-08-24 12:27                     ` Måns Rullgård
2020-08-24 13:16                       ` Jan Stary
2020-08-24 14:15                         ` Måns Rullgård
2020-08-27  9:52                           ` Jan Stary
2020-08-27 11:10                             ` Måns Rullgård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yw1xmu2gjofa.fsf@mansr.com \
    --to=sox-devel@lists.sourceforge.net \
    --cc=hans@stare.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).