hrkfdn/mpdas

compiling mpdas in buildroot

Closed this issue · 3 comments

I have latest buildroot, and I got such mistake:

PATH="/root/buildroot-2017.11/buildroot/output/host/bin:/root/buildroot-2017.11/buildroot/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" /usr/bin/make -j5 PATH="/root/buildroot-2017.11/buildroot/output/host/bin:/root/buildroot-2017.11/buildroot/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" AR="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-ar" AS="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-as" LD="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-ld" NM="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-nm" CC="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-gcc" GCC="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-gcc" CPP="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-cpp" CXX="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-g++" FC="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-gfortran" F77="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-gfortran" RANLIB="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-ranlib" READELF="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-readelf" STRIP="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-strip" OBJCOPY="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-objcopy" OBJDUMP="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/usr/bin/gcc" GCC_FOR_BUILD="/usr/bin/gcc" CXX_FOR_BUILD="/usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I/root/buildroot-2017.11/buildroot/output/host/include" CFLAGS_FOR_BUILD="-O2 -I/root/buildroot-2017.11/buildroot/output/host/include" CXXFLAGS_FOR_BUILD="-O2 -I/root/buildroot-2017.11/buildroot/output/host/include" LDFLAGS_FOR_BUILD="-L/root/buildroot-2017.11/buildroot/output/host/lib -Wl,-rpath,/root/buildroot-2017.11/buildroot/output/host/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-as" DEFAULT_LINKER="/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os " CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os " LDFLAGS="" FCFLAGS=" -Os " FFLAGS=" -Os " PKG_CONFIG="/root/buildroot-2017.11/buildroot/output/host/bin/pkg-config" STAGING_DIR="/root/buildroot-2017.11/buildroot/output/host/i586-buildroot-linux-musl/sysroot" INTLTOOL_PERL=/usr/bin/perl -C /root/buildroot-2017.11/buildroot/output/build/mpdas-0.4.4
make[1]: Entering directory '/root/buildroot-2017.11/buildroot/output/build/mpdas-0.4.4'
/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-g++ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -c -o main.o main.cpp
/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-g++ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -c -o md5.o md5.cpp
/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-g++ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -c -o utils.o utils.cpp
/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-g++ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -c -o mpd.o mpd.cpp
/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-g++ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -c -o audioscrobbler.o audioscrobbler.cpp
/root/buildroot-2017.11/buildroot/output/host/bin/i586-buildroot-linux-musl-g++ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -c -o cache.o cache.cpp
main.cpp: In function ‘void printversion()’:
main.cpp:48:30: error: expected ‘)’ before ‘VERSION’
fprintf(stdout, "mpdas-" VERSION", (C) 2010-2017 Henrik Friedrichsen.\n");
^~~~~~~
main.cpp:49:62: error: ‘CONFDIR’ was not declared in this scope
fprintf(stdout, "Global config path is set to "%s"\n", CONFDIR);
^~~~~~~
main.cpp:49:62: note: suggested alternative: ‘S_IFDIR’
fprintf(stdout, "Global config path is set to "%s"\n", CONFDIR);
^~~~~~~
S_IFDIR
Makefile:19: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/root/buildroot-2017.11/buildroot/output/build/mpdas-0.4.4'
package/pkg-generic.mk:234: recipe for target '/root/buildroot-2017.11/buildroot/output/build/mpdas-0.4.4/.stamp_built' failed
make: *** [/root/buildroot-2017.11/buildroot/output/build/mpdas-0.4.4/.stamp_built] Error 2

Not sure what build environment this is, but something is off. Are you using GNU make and the provided Makefile?

CONFDIR as well as VERSION are defined in and provided by the Makefile.

Yes, and somehow buildroot generic-package framework does not use them. I don't speak c++, could you tell me what to put at the beginning of main.cpp and config.cpp to enjoy working version and config file in /etc ?
I know that this is dirty hack but I made small embedded system using buildroot to listen music with mpd. Buildroot can utilise musl and is based on cross compilation. Mpdas is in fact the last thing I need but I can not get.

#ifndef VERSION
#define CONFDIR "/etc"
#define VERSION "0.4.5"
#endif

in mpdas.h should work. I'm closing this issue.