pulseaudio build error (curious/strange)

Christoph Mallon christoph.mallon at gmx.de
Sat Aug 22 17:26:32 UTC 2009


Andriy Gapon schrieb:
> ...
> /bin/sh /usr/obj/ports/usr/ports/audio/pulseaudio/work/gnome-libtool --tag=CC
> --mode=compile cc -std=gnu99 -DHAVE_CONFIG_H -I. -I..   -I/usr/local/include
> -I../src -I../src -I../src/modules -I../src/modules -I../src/modules/rtp
> -I../src/modules/rtp -I../src/modules/gconf -I../src/modules/gconf
> -I../src/modules/bluetooth -I../src/modules/bluetooth -I../src/modules/alsa
> -I../src/modules/alsa -I../src/modules/raop -D_THREAD_SAFE
> -D_POSIX_PTHREAD_SEMANTICS -I/usr/local/include   -I/usr/local/include
> -I/usr/local/include   -DPA_DLSEARCHPATH=\"/usr/local/lib/pulse-0.9.15/modules/\"
> -DPA_DEFAULT_CONFIG_DIR=\"/usr/local/etc/pulse\"
> -DPA_BINARY=\"/usr/local/bin/pulseaudio\"
> -DPA_SYSTEM_RUNTIME_PATH=\"/var/run/pulse\"
> -DPA_SYSTEM_CONFIG_PATH=\"/var/lib/pulse\"
> -DPA_SYSTEM_STATE_PATH=\"/var/lib/pulse\" -DAO_REQUIRE_CAS
> -DPULSE_LOCALEDIR=\"/usr/local/share/locale\"
> -DPA_MACHINE_ID=\"/var/lib/dbus/machine-id\" -O2 -fno-strict-aliasing -pipe -O2
> -fno-strict-aliasing -pipe -march=nocona -Wall -W -Wextra -pipe -Wno-long-long
> -Winline -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2
> -Wsign-compare -Wformat-security -Wformat-nonliteral -Wold-style-definition
> -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal
> -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations
> -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2
> -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2
> -fno-common -fdiagnostics-show-option -MT module-raop-sink.lo -MD -MP -MF
> .deps/module-raop-sink.Tpo -c -o module-raop-sink.lo `test -f
> 'modules/module-raop-sink.c' || echo './'`modules/module-raop-sink.c
> gnome-libtool: compile:  cc -std=gnu99 -DHAVE_CONFIG_H -I. -I..
> -I/usr/local/include -I../src -I../src -I../src/modules -I../src/modules
> -I../src/modules/rtp -I../src/modules/rtp -I../src/modules/gconf
> -I../src/modules/gconf -I../src/modules/bluetooth -I../src/modules/bluetooth
> -I../src/modules/alsa -I../src/modules/alsa -I../src/modules/raop -D_THREAD_SAFE
> -D_POSIX_PTHREAD_SEMANTICS -I/usr/local/include -I/usr/local/include
> -I/usr/local/include -DPA_DLSEARCHPATH=\"/usr/local/lib/pulse-0.9.15/modules/\"
> -DPA_DEFAULT_CONFIG_DIR=\"/usr/local/etc/pulse\"
> -DPA_BINARY=\"/usr/local/bin/pulseaudio\"
> -DPA_SYSTEM_RUNTIME_PATH=\"/var/run/pulse\"
> -DPA_SYSTEM_CONFIG_PATH=\"/var/lib/pulse\"
> -DPA_SYSTEM_STATE_PATH=\"/var/lib/pulse\" -DAO_REQUIRE_CAS
> -DPULSE_LOCALEDIR=\"/usr/local/share/locale\"
> -DPA_MACHINE_ID=\"/var/lib/dbus/machine-id\" -O2 -fno-strict-aliasing -pipe -O2
> -fno-strict-aliasing -pipe -march=nocona -Wall -W -Wextra -pipe -Wno-long-long
> -Winline -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2
> -Wsign-compare -Wformat-security -Wformat-nonliteral -Wold-style-definition
> -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal
> -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations
> -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2
> -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2
> -fno-common -fdiagnostics-show-option -MT module-raop-sink.lo -MD -MP -MF
> .deps/module-raop-sink.Tpo -c modules/module-raop-sink.c  -fPIC -DPIC -o
> .libs/module-raop-sink.o
> In file included from /usr/local/include/sdp.h:26,
>                  from modules/module-raop-sink.c:65:
> /usr/local/include/mpeg4ip.h:126: warning: redundant redeclaration of 'strcasestr'
> [-Wredundant-decls]
> /usr/include/string.h:72: warning: previous declaration of 'strcasestr' was here
> modules/module-raop-sink.c: In function 'module_raop_sink_LTX_pa__get_version':
> modules/module-raop-sink.c:71: error: 'PACKAGE_VERSION' undeclared (first use in
> this function)
> modules/module-raop-sink.c:71: error: (Each undeclared identifier is reported only
> once
> modules/module-raop-sink.c:71: error: for each function it appears in.)
> 
> 
> The thing is that PACKAGE_VERSION is actually defined in config.h.
> But there is something strange/curios.
> module-raop-sink.c includes /usr/local/include/sdp.h that in turn includes
> /usr/local/include/mpeg4ip.h.
> mpeg4ip.h has the following code:
> 
> #ifndef _WIN32
> #ifdef PACKAGE_BUGREPORT
> #define TEMP_PACKAGE_BUGREPORT PACKAGE_BUGREPORT
> #define TEMP_PACKAGE_NAME PACKAGE_NAME
> #define TEMP_PACKAGE_STRING PACKAGE_STRING
> #define TEMP_PACKAGE_TARNAME PACKAGE_TARNAME
> #define TEMP_PACKAGE_VERSION PACKAGE_VERSION
> #undef PACKAGE_BUGREPORT
> #undef PACKAGE_NAME
> #undef PACKAGE_STRING
> #undef PACKAGE_TARNAME
> #undef PACKAGE_VERSION
> #include <mpeg4ip_config.h>
> #undef PACKAGE_BUGREPORT
> #undef PACKAGE_NAME
> #undef PACKAGE_STRING
> #undef PACKAGE_TARNAME
> #undef PACKAGE_VERSION
> #define PACKAGE_BUGREPORT TEMP_PACKAGE_BUGREPORT
> #define PACKAGE_NAME TEMP_PACKAGE_NAME
> #define PACKAGE_STRING TEMP_PACKAGE_STRING
> #define PACKAGE_TARNAME TEMP_PACKAGE_TARNAME
> #define PACKAGE_VERSION TEMP_PACKAGE_VERSION
> #else
> #include <mpeg4ip_config.h>
> #endif
> #endif
> 
> 
> In our case PACKAGE_BUGREPORT is actually defined (in config.h).
> So this whole block is enabled.
> But after pre-processor goes through it PACKAGE_VERSION becomes 'simply defined',
> that is, it is defined, but not to any particular value.
> So apparently the witty macro code doesn't work like its authors intended it to
> work (akin to push/pop).
> Ideas?

You are right, the macro code cannot work by design of the preprocssor:
#define TEMP_PACKAGE_VERSION PACKAGE_VERSION tells TEMP_PACKAGE_VERSION 
to expand to PACKAGE_VERSION. This will in turn expand to whatever 
PACKAGE_VERSION is defined _at the point where TEMP_PACKAGE_VERSION is 
used_. PACKAGE_VERSION is later defined to expand to TEMP_PACKAGE_VERSION.
So when using PACKAGE_VERSION, it will first expand to 
TEMP_PACKAGE_VERSION, which in turn expands to PACKAGE_VERSION. The 
preprocessors forbids recursion on macros, therefore macro expansion 
stops right there, because in this chain of expansion we already 
expanded PACKAGE_VERSION. So in the end we get the word PACKAGE_VERSION 
in the preprocessed source code.
Long story short: The above preprocessing directives cannot work.
Do you know, where/why PACKAGE_BUGREPORT is defined?

	Christoph


More information about the freebsd-ports mailing list