samba in makefile
[nestedvm.git] / upstream / Makefile
index 89cdbce..fa28cc0 100644 (file)
@@ -23,7 +23,7 @@ configure_binutils = --target=mips-unknown-elf
 
 version_newlib = 1.11.0
 url_newlib = http://mirrors.rcn.net/pub/sourceware/newlib/newlib-$(version_newlib).tar.gz
-patches_newlib = newlib-mips.patch newlib-tzset.patch newlib-malloc.patch newlib-vasprintf.patch newlib-nomemcpy.patch
+patches_newlib = newlib-mips.patch newlib-tzset.patch newlib-malloc.patch newlib-nomemcpy.patch newlib-unix.patch
 configure_newlib = --enable-multilib --target=mips-unknown-elf
 
 url_openbsdglob = http://www.brianweb.net/xwt/openbsdglob.tar.gz
@@ -59,7 +59,7 @@ tasks/download_%:
        touch $@
 
 tasks/extract_%: tasks/download_%
-       @[ -e $@ ] && echo "$@ already exists... something isn't right"
+       if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
        mkdir -p build
        cd build && \
                gzip -dc  ../download/$*-$(version_$*).tar.gz | $(TAR) -xf - && \
@@ -68,7 +68,7 @@ tasks/extract_%: tasks/download_%
        touch $@
 
 tasks/extract_darcs_%:
-       @[ -e $@ ] && echo "$@ already exists... something isn't right"
+       if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
        mkdir -p build
        if [ -z "$(darcs_$*)" ]; then echo "No darcs url for $*" >&2; false; fi
        if [ -d "$(root)/_darcs" ]; then \
@@ -128,7 +128,7 @@ tasks/download_gcc: tasks/download_gcc-core tasks/download_gcc-c++ tasks/downloa
        touch $@
 
 tasks/extract_gcc: tasks/download_gcc
-       @[ -e $@ ] && echo "$@ already exists... something isn't right"
+       if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
        mkdir -p build
        cd build && gzip -dc ../download/gcc-core-$(version_gcc).tar.gz | $(TAR) -xf -
        cd build && gzip -dc ../download/gcc-g++-$(version_gcc).tar.gz | $(TAR) -xf -
@@ -136,7 +136,7 @@ tasks/extract_gcc: tasks/download_gcc
        touch $@
 
 tasks/patch_%: tasks/extract_%
-       @[ -e $@ ] && echo "$@ already exists... something isn't right"
+       if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
        cd build/$*-$(version_$*) &&  \
        for p in $(patches_$*) end; do \
                [ "$$p" = "end" ] || $(PATCH) -p0 < ../../patches/$$p || exit 1; \
@@ -160,7 +160,7 @@ tasks/build_gcc_step2: tasks/patch_gcc tasks/build_libc
        touch $@
 
 tasks/extract_gpc: tasks/download_gcc tasks/download_gpc
-       @[ -e $@ ] && echo "$@ already exists... something isn't right"
+       if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi
        mkdir -p build/gpc.extract
        cd build/gpc.extract && \
                gzip -dc ../../download/gcc-core-$(version_gcc).tar.gz | $(TAR) -xf - && \
@@ -237,6 +237,10 @@ patches_busybox = busybox.patch
 version_texinputs = 1.0
 url_texinputs = http://www.megacz.com/tmp/texinputs-$(version_texinputs).tgz
 
+version_samba = 3.0.4
+url_samba = http://us4.samba.org/samba/ftp/samba-$(version_samba).tar.gz
+patches_samba = samba.patch
+
 tasks/extract_libjpeg: tasks/download_libjpeg
        mkdir -p build
        cd build && \
@@ -340,3 +344,12 @@ tasks/build_tex: tasks/build_tex_tangle tasks/build_gpc tasks/download_texinputs
                        && \
                mips-unknown-elf-gpc $(MIPS_PCFLAGS) tex.p $(MIPS_LDFLAGS) -o tex.mips
        touch $@
+
+tasks/build_samba: tasks/patch_samba
+       cd build/samba-$(version_samba)/source && \
+               test -e config.status || ./configure --host=mips-unknown-elf && \
+               fgrep -q '#define HAVE_GETTIMEOFDAY_TZ' include/config.h || \
+                       echo '#define HAVE_GETTIMEOFDAY_TZ 1' >> include/config.h && \
+               make LIBS="-lglob" CFLAGS="$(MIPS_CFLAGS)" LDFLAGS="$(MIPS_LDFLAGS)" \
+                    CONFIGFILE="smb.conf" proto_exists bin/ntlm_auth
+       touch $@