diff options
Diffstat (limited to '')
-rw-r--r-- | bs/README | 69 | ||||
-rw-r--r-- | bs/config.mk.default | 64 | ||||
-rwxr-xr-x | bs/cross-arch.sh | 82 | ||||
-rw-r--r-- | bs/deps-audio.mk | 38 | ||||
-rw-r--r-- | bs/deps-conflicts.mk | 14 | ||||
-rw-r--r-- | bs/deps-input.mk | 46 | ||||
-rw-r--r-- | bs/deps-misc.mk | 17 | ||||
-rwxr-xr-x | bs/mkconfig-header.sh | 88 | ||||
-rw-r--r-- | bs/mkconfig.h.mk | 55 | ||||
-rwxr-xr-x | bs/mkdep.sh | 58 | ||||
-rwxr-xr-x | bs/mkdir_p.sh | 37 | ||||
-rwxr-xr-x | bs/mkdist.sh | 50 | ||||
-rwxr-xr-x | bs/pkginfo-header.sh | 16 | ||||
-rwxr-xr-x | bs/pkginfo.sh | 19 |
14 files changed, 0 insertions, 653 deletions
diff --git a/bs/README b/bs/README deleted file mode 100644 index c5992e34c..000000000 --- a/bs/README +++ /dev/null @@ -1,69 +0,0 @@ -bs - build system ------------------ - -bs is an attempt at a fast and reliable build system that will let -developers build mpd without having to deal with the complexity of -autotools. It is still a work in progress, but it seems to be -reasonably usable (to developers) and fast. - -It is designed from the ground up to work with cross-compilation, as well as -multiple build targets/configurations from the same source tree (using the O -variable). - -It is NOT intended to replace autotools for distribution maintainers -or end users who are satisfied with autotools. - -SYNOPSIS --------- - -# To build mpd in a directory "output" -./build.mk O=output defconfig -$EDITOR output/config.mk -./build.mk O=output - - -FEATURES --------- - -* Designed for cross-compilation from the ground up -* Designed to easily handle multiple build directories from the same source - tree. Just set the O variable when invoking make (see synopsis). -* Automatic dependency analysis (if using GCC) -* Highly configurable (no auto-detection of dependencies to get wrong) -* Simple, no archaic M4 macros or unreadable auto-generated shell or makefiles - just human-maintained GNU Make and POSIX shell. - - -config.mk ---------- - -This is the configuration file a user should edit if they wish to -enable/disable features or tune settings. Once created, this -will NOT be modified by the build system, so user settings will -always be preserved. - - -VARIABLES ---------- - -These are conventions, not hard and fast rules (as there's no good way to -enforce them :) -mixed-case or lower-case variables are used by bs internally. -ALL_CAPS variables are designed to be changed by users. - - -REQUIREMENTS ------------- - -GNU Make, POSIX shell + common UNIX tools (awk, sed, mv, rm, mkdir). -git (version control system) is only required if you wish to autodownload -external dependencies (flac, tremor, mad, etc...) for static linking. - - -BUGS ----- - -Modifications to config.mk will over-rebuild. - -Changes to CFLAGS/LDFLAGS from the command-line are not yet checked in -rebuilds. diff --git a/bs/config.mk.default b/bs/config.mk.default deleted file mode 100644 index 52c5829d6..000000000 --- a/bs/config.mk.default +++ /dev/null @@ -1,64 +0,0 @@ -# config.mk file for the bs build-system this is the only file a user should -# need to edit -# report bugs to Eric Wong <normalperson@yhbt.net> - -# change this if cross compiling, default: @@HOST@@ -# HOST := @@HOST@@ - -# default compiler and linker settings -CC = gcc -CFLAGS = -O2 -Wall \ - -Wmissing-prototypes -Wextra -Wno-unused-parameter \ - -Wno-deprecated-declarations -Wmissing-prototypes \ - -Wdeclaration-after-statement -Wshadow -Wpointer-arith \ - -Wstrict-prototypes -Wcast-qual -Wwrite-strings - -LDFLAGS = -Wl,-O1 - -# TCP or UNIX domain sockets support. MPD needs at least one of these -HAVE_TCP := 1 -HAVE_UN := - -# miscellaneous dependencies and features, mpd does not -# require any of these: -# -HAVE_LANGINFO_CODESET := -HAVE_IPV6 := -HAVE_ICONV := -HAVE_ID3TAG := - -MPD_PATH_MAX := 255 - -# audio output features, at least one of these must be defined to 1 -# (and usable) -# -HAVE_ALSA := -HAVE_AO := -HAVE_FIFO := -HAVE_JACK := -HAVE_MVP := -HAVE_NULL := -HAVE_OSS := -HAVE_OSX := -HAVE_PULSE := -HAVE_SHOUT := - -# input file format support, at least one of these must be defined to 1 -# (and usable) -# -HAVE_AUDIOFILE := -HAVE_FAAD := -HAVE_FAAD_BUFLEN_FUNCS := -HAVE_MP4AUDIOSPECIFICCONFIG := -HAVE_FAACDECCONFIGURATION_DONTUPSAMPLEIMPLICITSBR := -HAVE_FAACDECCONFIGURATION_DOWNMATRIX := -HAVE_FAACDECFRAMEINFO_SAMPLERATE := -HAVE_FLAC := -HAVE_HELIXMP3 := -HAVE_MIKMOD := -HAVE_MAD := -HAVE_MPCDEC := -HAVE_OGGFLAC := -HAVE_OGGVORBIS := -HAVE_TREMOR := -HAVE_WAVPACK := diff --git a/bs/cross-arch.sh b/bs/cross-arch.sh deleted file mode 100755 index c520433a5..000000000 --- a/bs/cross-arch.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -# many parts of this blatantly ripped from GNU Autoconf macros -# Use this for cross-compiling, as we can't run cross-compiled binaries -# on our host. -if test -z "$O" || ! cd "$O"; then - echo '$O= not defined or not a directory' >&2 - exit 1 -fi - -echo '/* architecture-specific settings (auto-detected): */' -# check sizes of various types we care for -# this is slightly slower but much easier to read and follow than the -# bisecting autoconf version -for t in short int long 'long long'; do - > out - for s in 2 4 6 8 12 1 16 24 32 0; do - cat > t.c <<EOF -int main(void) -{ - static int x[(long int)(sizeof($t)) == $s ? 1 : -1]; - x[0] = 0; - return 0; -} -EOF - echo "trying sizeof($t) == $s" >> out - $CC -o t.o $CFLAGS $CPPFLAGS t.c \ - >> out 2>&1 && break - done - if test $s -eq 0; then - echo "Unable to calculate sizeof($t) for cross-compiling" >&2 - cat out >&2 - exit 1 - fi - t=`echo $t | tr a-z A-Z | tr ' ' _` - echo "#define SIZEOF_$t $s" - echo "SIZEOF_$t := $s" >> config_detected.mk -done - -# check endian-ness -cat > t.c <<EOF -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii(void) -{ - char *s = (char *)ascii_mm; - s = (char *)ascii_ii; -} - -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic(void) -{ - char *s = (char *)ebcdic_mm; - s = (char *)ebcdic_ii; -} - -int main(void) -{ - _ascii(); - _ebcdic(); - - return 0; -} -EOF - -echo "compiling endian test" > out -$CC -o t.o $CFLAGS $CPPFLAGS t.c >> out 2>&1 -if grep BIGenDianSyS t.o >/dev/null 2>&1; then - echo "#define WORDS_BIGENDIAN 1" - echo "WORDS_BIGENDIAN := 1" >> config_detected.mk -elif grep LiTTleEnDian t.o >/dev/null 2>&1; then - echo "/* #undef WORDS_BIGENDIAN */" - echo "# WORDS_BIGENDIAN :=" >> config_detected.mk -else - echo "Unable to determine endian-ness for cross compiling" >&2 - cat out >&2 - exit 1 -fi - -echo '' - -exec rm -f t.o out t.c diff --git a/bs/deps-audio.mk b/bs/deps-audio.mk deleted file mode 100644 index 6f26c124e..000000000 --- a/bs/deps-audio.mk +++ /dev/null @@ -1,38 +0,0 @@ -ifeq ($(HAVE_ALSA),1) - mpd_CFLAGS += $(ALSA_CFLAGS) -DHAVE_LIBASOUND=1 - mpd_LDFLAGS += $(ALSA_LDFLAGS) -lasound -endif - -ifeq ($(HAVE_AO),1) - # mpd_CFLAGS += -pthread - mpd_LDFLAGS += -lao -lpthread -endif - -ifeq ($(HAVE_FIFO),1) -endif - -ifeq ($(HAVE_JACK),1) - mpd_LDFLAGS += -ljack -endif - -ifeq ($(HAVE_MVP),1) -endif - -ifeq ($(HAVE_OSX),1) - mpd_LDFLAGS += -framework AudioUnit -framework CoreServices -endif -ifeq ($(HAVE_OSS),1) - # check some BSDs (-lossaudio?) -endif -ifeq ($(HAVE_PULSE),1) - mpd_LDFLAGS += -lpulse -lpulse-simple -endif -ifeq ($(HAVE_SHOUT),1) - mpd_CFLAGS += -DHAVE_SHOUT_SHOUT_H=1 - # XXX -ltheora, -lspeex - mpd_LDFLAGS += -lshout -logg -lvorbis -lvorbisenc -ltheora -lspeex -lpthread -endif -ifeq ($(HAVE_SUN),1) - mpd_CFLAGS += $(SUN_CFLAGS) - mpd_LDFLAGS += $(SUN_LDFLAGS) -endif diff --git a/bs/deps-conflicts.mk b/bs/deps-conflicts.mk deleted file mode 100644 index 91dfa2a06..000000000 --- a/bs/deps-conflicts.mk +++ /dev/null @@ -1,14 +0,0 @@ -ifeq ($(HAVE_TREMOR),1) - ifeq ($(HAVE_SHOUT),1) - $(error Tremor and Shout are incompatible, enable one or the other) - endif - ifeq ($(HAVE_OGGFLAC),1) - $(error Tremor and OggFLAC are incompatible, enable one or the other) - endif -endif - -ifeq ($(HAVE_HELIXMP3),1) - ifeq ($(HAVE_MAD),1) - $(error Helix MP3 and MAD are incompatible, enable one or the other) - endif -endif diff --git a/bs/deps-input.mk b/bs/deps-input.mk deleted file mode 100644 index c45a788b6..000000000 --- a/bs/deps-input.mk +++ /dev/null @@ -1,46 +0,0 @@ -ifeq ($(HAVE_AUDIOFILE),1) - mpd_LDFLAGS += -laudiofile -lm -endif - -ifeq ($(HAVE_FAAD),1) - # XXX needs work - mpd_CFLAGS += $(FAAD_CFLAGS) - mpd_LDFLAGS += -lfaad -lmp4ff -endif - -ifeq ($(HAVE_FLAC),1) - mpd_LDFLAGS += -lFLAC -lm -endif - -ifeq ($(HAVE_HELIXMP3),1) - mpd_CFLAGS += $(HELIXMP3_CFLAGS) - mpd_LDFLAGS += $(HELIXMP3_LDFLAGS) -lmp3codecfixpt -endif - -ifeq ($(HAVE_MIKMOD),1) - mpd_LDFLAGS += -lmikmod -lm -endif - -ifeq ($(HAVE_MAD),1) - mpd_LDFLAGS += -lmad -lm -endif - -ifeq ($(HAVE_MPCDEC),1) - mpd_LDFLAGS += -lmpcdec -endif - -ifeq ($(HAVE_OGGFLAC),1) - mpd_LDFLAGS += $(OGGFLAC_LDFLAGS) -lOggFLAC -logg -lFLAC -lm -endif - -ifeq ($(HAVE_OGGVORBIS),1) - ifeq ($(HAVE_TREMOR),1) - mpd_LDFLAGS += $(TREMOR_LDFLAGS) -lvorbisidec - else - mpd_LDFLAGS += $(OGGVORBIS_LDFLAGS) -lvorbis -logg -lvorbisfile - endif -endif - -ifeq ($(HAVE_WAVPACK),1) - mpd_LDFLAGS += -lwavpack -endif diff --git a/bs/deps-misc.mk b/bs/deps-misc.mk deleted file mode 100644 index 7af441839..000000000 --- a/bs/deps-misc.mk +++ /dev/null @@ -1,17 +0,0 @@ -ifeq ($(HAVE_ID3TAG),1) - mpd_LDFLAGS += -lid3tag -lz -endif - -ifeq ($(HAVE_ICONV),1) - ifeq ($(NEED_LIBICONV),1) - mpd_LDFLAGS += -liconv - endif -endif - -ifeq ($(HAVE_IPV6),1) -endif - -ifeq ($(HAVE_LANGINFO_CODESET),1) -endif - -mpd_LDFLAGS += -lpthread diff --git a/bs/mkconfig-header.sh b/bs/mkconfig-header.sh deleted file mode 100755 index ff0809ffb..000000000 --- a/bs/mkconfig-header.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# detect the uninteresting (unlikely to be manually changed by the user) -# parts of config.h - -if test -z "$O" || ! cd "$O"; then - echo '$O= not defined or not a directory' >&2 - exit 1 -fi - -> config_detected.mk - -ansi_headers='assert ctype errno limits locale math signal -stdarg stddef stdint stdio stdlib string' -common_headers='dlfcn inttypes memory strings sched -sys/inttypes sys/stat sys/types unistd' - -all_ansi=t -echo '/* ANSI C headers: */' -for h in $ansi_headers; do - if test x$h = xlocale; then - H=HAVE_LOCALE - else - H="HAVE_`echo $h | tr a-z A-Z | tr / _`_H" - fi - cat > t.c <<EOF -#include <$h.h> -int main(void) { return 0; } -EOF - if $CC -o t.o $CFLAGS $CPPFLAGS t.c >> out 2>&1; then - echo "#define $H 1" - echo "$H := 1" >> config_detected.mk - else - echo "/* #undef $H */" - echo "# $H := " >> config_detected.mk - all_ansi= - fi -done -if test x$all_ansi = xt; then - echo '#define STDC_HEADERS 1' -else - echo '/* #undef STDC_HEADERS */' -fi -echo '' -echo '/* common system headers/features on UNIX and UNIX-like system: */' -for h in $common_headers; do - H="HAVE_`echo $h | tr a-z A-Z | tr / _`_H" - cat > t.c <<EOF -#include <$h.h> -int main(void) { return 0; } -EOF - if $CC -o t.o $CFLAGS $CPPFLAGS t.c >> out 2>&1; then - echo "#define $H 1" - echo "$H := 1" >> config_detected.mk - else - echo "/* #undef $H */" - echo "# $H :=" >> config_detected.mk - fi -done - -# test for setenv -cat > t.c <<EOF -#include <stdlib.h> -int main(void) { setenv("mpd","rocks", 1); return 0; } -EOF -if $CC -o t.o $CFLAGS $CPPFLAGS t.c >> out 2>&1; then - echo '#define HAVE_SETENV 1' - echo "HAVE_SETENV := 1" >> config_detected.mk -else - echo '/* #undef HAVE_SETENV */' - echo "# HAVE_SETENV :=" >> config_detected.mk -fi -echo '' - -# test for alloca -cat > t.c <<EOF -#include <alloca.h> -int main(void) { char *x = (char *)alloca(2 * sizeof(int)); return 0; } -EOF -if $CC -o t.o $CFLAGS $CPPFLAGS t.c >> out 2>&1; then - echo '#define HAVE_ALLOCA_H 1' - echo "HAVE_ALLOCA_H := 1" >> config_detected.mk -else - echo '/* #undef HAVE_ALLOCA_H */' - echo "# HAVE_ALLOCA_H :=" >> config_detected.mk -fi -echo '' - -exec rm -f out t.c t.o diff --git a/bs/mkconfig.h.mk b/bs/mkconfig.h.mk deleted file mode 100644 index 8466fb83c..000000000 --- a/bs/mkconfig.h.mk +++ /dev/null @@ -1,55 +0,0 @@ -have += TCP -have += UN - -have += AUDIOFILE -have += FAAD -have += FAACDECCONFIGURATION_DONTUPSAMPLEIMPLICITSBR -have += FAACDECCONFIGURATION_DOWNMATRIX -have += FAACDECFRAMEINFO_SAMPLERATE -have += MP4AUDIOSPECIFICCONFIG -have += FAAD_BUFLEN_FUNCS -have += FLAC -have += HELIXMP3 -have += MIKMOD -have += MAD -have += MPCDEC -have += OGGFLAC -have += OGGVORBIS -have += TREMOR -have += WAVPACK -have += ALSA -have += AO -have += FIFO -have += JACK -have += MVP -have += OSX -have += OSS -have += PULSE -have += SHOUT -have += SUN - -have += ID3TAG -have += ICONV -have += IPV6 -have += LANGINFO_CODESET - -MPD_PATH_MAX ?= 255 -req_vars += MPD_PATH_MAX - -export - -include $(O)/config.mk -$(O)/config.h: $(O)/config_detected.h $(O)/config.mk - echo '#ifndef CONFIG_H' > $@+ - echo '#define CONFIG_H' >> $@+ - $(SHELL) ./bs/pkginfo-header.sh >> $@+ - cat $(O)/config_detected.h >> $@+ - echo '/* user-enabled features: */' >> $@+ - for d in $(have); do eval "val=`echo '$$'HAVE_$$d` var=HAVE_$$d"; \ - if test -n "$$val"; then echo "#define $$var 1" >> $@+; \ - else echo "/* #undef $$var */" >> $@+; fi ; done - for d in $(req_vars); do eval "val=`echo '$$'$$d`"; \ - echo "#define $$d $$val" >> $@+; done - echo '#endif /* CONFIG_H */' >> $@+ - mv $@+ $@ -.NOTPARALLEL: diff --git a/bs/mkdep.sh b/bs/mkdep.sh deleted file mode 100755 index 019b4bc4c..000000000 --- a/bs/mkdep.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# $d must have a trailing slash $(dir file) in GNU Make -f="$1" -d="$2" -x="$3" -if test -z "$O"; then - echo '$O= not defined or not a directory' >&2 - exit 1 -fi -test -d "$O/$d" || "$SHELL" ./bs/mkdir_p.sh "$O/$d" -t="$O/t.$$.d" -depmode= -out= -if test -e "$O/depmode"; then - . "$O/depmode" -fi - -case "$depmode" in -mm) - $CC -MM $CPPFLAGS $CFLAGS "$f" > "$t" 2>/dev/null - ;; -m) - $CC -M $CPPFLAGS $CFLAGS "$f" > "$t" 2>/dev/null - ;; -none) - echo "$O/$f: $f $HDR_DEP_HACK" | sed -e 's#c:#o:#' > "$x"+ - ;; -*) - # detect our depmode - # -MM is gcc-specific... - $CC -MM $CPPFLAGS $CFLAGS "$f" > "$t" 2>/dev/null - if test $? -eq 0; then - depmode=mm - else - # ok, maybe -M is supported... - $CC -M $CPPFLAGS $CFLAGS "$f" \ - > "$t" 2>/dev/null - if test $? -eq 0; then - depmode=m - else - depmode=none - # don't guess, fudge the dependencies by using - # all headers - echo "$O/$f: $f $HDR_DEP_HACK" \ - | sed -e 's#c:#o:#' > "$x"+ - fi - fi - echo "depmode=$depmode" > "$O/depmode" - ;; -esac - -case "$depmode" in -m|mm) - sed -e 's#.c$#.o#' -e "1s#^#$O/$d&#" < "$t" > "$x"+ - ;; -esac -rm -f "$t" -exec mv "$x"+ "$x" diff --git a/bs/mkdir_p.sh b/bs/mkdir_p.sh deleted file mode 100755 index cb9e94ca7..000000000 --- a/bs/mkdir_p.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# based on mkinstalldirs: -# Original author: Noah Friedman <friedman@prep.ai.mit.edu> -# Created: 1993-05-16 -# Public domain. -errstatus=0 -for file -do - test -d "$file" && continue - case $file in - /*) pathcomp=/ ;; - *) pathcomp= ;; - esac - oIFS=$IFS - IFS=/ - set fnord $file - shift - IFS=$oIFS - for d - do - test "x$d" = x && continue - pathcomp=$pathcomp$d - case $pathcomp in - -*) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - mkdir "$pathcomp" || lasterr=$? - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - pathcomp=$pathcomp/ - done -done - -exit $errstatus diff --git a/bs/mkdist.sh b/bs/mkdist.sh deleted file mode 100755 index 130871345..000000000 --- a/bs/mkdist.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -set -e -. bs/pkginfo.sh -head=${1-'HEAD'} -git_ver= -if git rev-parse --git-dir > /dev/null 2>&1; then - git_ver=`git describe $head` - git_ver=`expr "z$git_ver" : 'z.*\(-g[0-9a-f].*\)' || true` - if test -n "$git_ver"; then - dirty=`git diff-index --name-only HEAD 2>/dev/null || true` - if test -n "$dirty"; then - git_ver=$git_ver-dirty - fi - fi -fi - -v=$v$git_ver -dir=$O/$p-$v -rm -rf "$dir" -git tar-tree $head $dir | tar x - -at_files=' -Makefile.in -aclocal.m4 -compile -config.guess -config.h.in -config.sub -configure -depcomp -doc/Makefile.in -install-sh -ltmain.sh -missing -mkinstalldirs -src/Makefile.in -src/mp4ff/Makefile.in -' - -for i in $at_files; do - if test -f $i; then - echo cp $i $dir/$i - cp $i $dir/$i - fi -done - -cd $O -tar c $p-$v | gzip -9 > $p-$v.tar.gz -rm -rf $p-$v -echo "Generated tarball in: $p-$v.tar.gz" diff --git a/bs/pkginfo-header.sh b/bs/pkginfo-header.sh deleted file mode 100755 index 0d5e4059d..000000000 --- a/bs/pkginfo-header.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -# basic package info: -. bs/pkginfo.sh -cat <<EOF -/* Basic package info: */ -#define PACKAGE "$p" -#define VERSION "$v" -#define PACKAGE_BUGREPORT "$b" -#define PACKAGE_NAME "$p" -#define PACKAGE_STRING "$p $v" -#define PACKAGE_TARNAME "$p" -#define PACKAGE_VERSION "$v" -#define PROTOCOL_VERSION "$pv" - -EOF - diff --git a/bs/pkginfo.sh b/bs/pkginfo.sh deleted file mode 100755 index f04dded8f..000000000 --- a/bs/pkginfo.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# sourcing this defines the folling variables: -# p: package, v: version, b: bugreport email, pv: protocol version - -script=' -/^AC_INIT\(/ { - gsub("[() ]","",$0); - gsub("AC_INIT","",$1); - print "p="$1; - print "v="$2; - print "b="$3; -} -/^AC_DEFINE\(PROTOCOL_VERSION, / { - gsub("[\" ]", "", $2); - print "pv="$2; -} -' - -eval $(awk -F, "$script" < configure.ac) |