diff options
Diffstat (limited to 'tools')
100 files changed, 946 insertions, 4061 deletions
diff --git a/tools/android/packaging/Makefile.in b/tools/android/packaging/Makefile.in index c28638bfd1..69bc9ffc54 100644 --- a/tools/android/packaging/Makefile.in +++ b/tools/android/packaging/Makefile.in @@ -2,7 +2,6 @@ include ../../depends/Makefile.include OBJS = libcurl.so \ librtmp.so \ - libafpclient.so \ libplist.so libshairplay.so \ libxbogg.so libxbvorbis.so libxbvorbisfile.so libxbmpeg2.so \ libxbmpeg2convert.so libnfs.so libass.so libbluray.so @@ -11,7 +10,7 @@ PLATFORM_OBJS = EXCLUDED_ADDONS = screensaver.rsxs.euphoria visualization.dxspectrum visualization.milkdrop visualization.projectm XBMCROOT = $(shell cd $(CURDIR)/../../..; pwd) -COPYDIRS = system addons language media +COPYDIRS = system addons media GCC_VERSION=$(shell $(CC) -dumpversion) ZIP=zip @@ -106,7 +105,6 @@ res: cp -fp media/drawable-xhdpi/ic_launcher.png xbmc/res/drawable-xhdpi/ic_launcher.png cp -fp media/drawable-xxhdpi/ic_launcher.png xbmc/res/drawable-xxhdpi/ic_launcher.png cp -fp media/drawable-xhdpi/banner.png xbmc/res/drawable-xhdpi/banner.png - cp -fp media/drawable-xhdpi/ouya_icon.png xbmc/res/drawable-xhdpi/ouya_icon.png cp xbmc/strings.xml xbmc/res/values/ mkdir -p tmp/res; $(AAPT) c -S xbmc/res -C tmp/res; cp -r -n xbmc/res tmp/ || true $(AAPT) p -f -I $(SDKROOT)/platforms/$(SDK_PLATFORM)/android.jar -S tmp/res/ -M xbmc/AndroidManifest.xml -F images/@APP_NAME_LC@app-debug-skeleton.apk -J xbmc/src diff --git a/tools/android/packaging/media/drawable-xhdpi/ouya_icon.png b/tools/android/packaging/media/drawable-xhdpi/ouya_icon.png Binary files differdeleted file mode 100644 index d446eab237..0000000000 --- a/tools/android/packaging/media/drawable-xhdpi/ouya_icon.png +++ /dev/null diff --git a/tools/android/packaging/xbmc/AndroidManifest.xml.in b/tools/android/packaging/xbmc/AndroidManifest.xml.in index 4232f1a852..8e94e3a0c8 100644 --- a/tools/android/packaging/xbmc/AndroidManifest.xml.in +++ b/tools/android/packaging/xbmc/AndroidManifest.xml.in @@ -6,7 +6,7 @@ android:versionName="@APP_VERSION@" > <!-- This is the platform API where NativeActivity was introduced. --> - <uses-sdk android:minSdkVersion="14" /> + <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="21" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> @@ -35,7 +35,6 @@ <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> - <category android:name="tv.ouya.intent.category.APP"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> diff --git a/tools/buildsteps/android/configure-depends b/tools/buildsteps/android/configure-depends index 344750c04e..746c11f73d 100644 --- a/tools/buildsteps/android/configure-depends +++ b/tools/buildsteps/android/configure-depends @@ -7,7 +7,7 @@ NDK_ARCH="arm" CURRENT_NDK_PATH=$ANDROID_DEV_ROOT/android-ndk-r$NDK_VERSION CURRENT_TOOLCHAIN=$ANDROID_DEV_ROOT/android-toolchain-$NDK_ARCH-$SDK_VERSION-r$NDK_VERSION -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends;./configure \ --with-tarballs=$TARBALLS \ diff --git a/tools/buildsteps/android/make-binary-addons b/tools/buildsteps/android/make-binary-addons new file mode 100644 index 0000000000..6e46dcc1fe --- /dev/null +++ b/tools/buildsteps/android/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=android +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/android/make-depends b/tools/buildsteps/android/make-depends index 2d5509e7ac..c5869b26e2 100644 --- a/tools/buildsteps/android/make-depends +++ b/tools/buildsteps/android/make-depends @@ -2,8 +2,8 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=android . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then - cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulDependsBuild + cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends fi diff --git a/tools/buildsteps/android/make-native-depends b/tools/buildsteps/android/make-native-depends new file mode 100644 index 0000000000..f67ced0eef --- /dev/null +++ b/tools/buildsteps/android/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=android +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi diff --git a/tools/buildsteps/android/prepare-depends b/tools/buildsteps/android/prepare-depends index babe7e4d63..933ea4592e 100644 --- a/tools/buildsteps/android/prepare-depends +++ b/tools/buildsteps/android/prepare-depends @@ -3,9 +3,11 @@ XBMC_PLATFORM_DIR=android . $WORKSPACE/tools/buildsteps/defaultenv #clean without depends for skipping depends build if possible -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" +#also skip binary addons (pvr, audioencoder) as long as they are deployed in tree +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} -if [ "$(rebuildDepends)" == "1" ] +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd diff --git a/tools/buildsteps/android/prepare-xbmc b/tools/buildsteps/android/prepare-xbmc index 3a82e5c600..b6402ee3c9 100644 --- a/tools/buildsteps/android/prepare-xbmc +++ b/tools/buildsteps/android/prepare-xbmc @@ -9,3 +9,6 @@ then rm -r $WORKSPACE/addons/skin.re-touched fi git submodule update --init $WORKSPACE/addons/skin.re-touched + +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/androidx86/configure-depends b/tools/buildsteps/androidx86/configure-depends index 89fd36f34b..5c35987fad 100644 --- a/tools/buildsteps/androidx86/configure-depends +++ b/tools/buildsteps/androidx86/configure-depends @@ -7,7 +7,7 @@ NDK_ARCH=x86 CURRENT_NDK_PATH=$ANDROID_DEV_ROOT/android-ndk-r$NDK_VERSION CURRENT_TOOLCHAIN=$ANDROID_DEV_ROOT/android-toolchain-$NDK_ARCH-$SDK_VERSION-r$NDK_VERSION -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends;./configure \ --with-tarballs=$TARBALLS \ diff --git a/tools/buildsteps/androidx86/make-binary-addons b/tools/buildsteps/androidx86/make-binary-addons new file mode 100644 index 0000000000..fa1f446bdb --- /dev/null +++ b/tools/buildsteps/androidx86/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=android +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/androidx86/make-depends b/tools/buildsteps/androidx86/make-depends index 2d5509e7ac..c5869b26e2 100644 --- a/tools/buildsteps/androidx86/make-depends +++ b/tools/buildsteps/androidx86/make-depends @@ -2,8 +2,8 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=android . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then - cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulDependsBuild + cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends fi diff --git a/tools/buildsteps/androidx86/make-native-depends b/tools/buildsteps/androidx86/make-native-depends new file mode 100644 index 0000000000..549ad2becb --- /dev/null +++ b/tools/buildsteps/androidx86/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=android +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi
\ No newline at end of file diff --git a/tools/buildsteps/androidx86/prepare-depends b/tools/buildsteps/androidx86/prepare-depends index babe7e4d63..933ea4592e 100644 --- a/tools/buildsteps/androidx86/prepare-depends +++ b/tools/buildsteps/androidx86/prepare-depends @@ -3,9 +3,11 @@ XBMC_PLATFORM_DIR=android . $WORKSPACE/tools/buildsteps/defaultenv #clean without depends for skipping depends build if possible -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" +#also skip binary addons (pvr, audioencoder) as long as they are deployed in tree +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} -if [ "$(rebuildDepends)" == "1" ] +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd diff --git a/tools/buildsteps/androidx86/prepare-xbmc b/tools/buildsteps/androidx86/prepare-xbmc index 3a82e5c600..b6402ee3c9 100644 --- a/tools/buildsteps/androidx86/prepare-xbmc +++ b/tools/buildsteps/androidx86/prepare-xbmc @@ -9,3 +9,6 @@ then rm -r $WORKSPACE/addons/skin.re-touched fi git submodule update --init $WORKSPACE/addons/skin.re-touched + +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/atv2/configure-depends b/tools/buildsteps/atv2/configure-depends index 2c9aa26b4e..e12bc54f97 100755 --- a/tools/buildsteps/atv2/configure-depends +++ b/tools/buildsteps/atv2/configure-depends @@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=atv2 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends;./configure \ --with-tarballs=/Users/Shared/xbmc-depends/tarballs \ @@ -10,4 +10,3 @@ then --with-sdk=$SDK_VERSION \ --prefix=$XBMC_DEPENDS_ROOT fi - diff --git a/tools/buildsteps/atv2/make-binary-addons b/tools/buildsteps/atv2/make-binary-addons new file mode 100755 index 0000000000..62c4b8bf99 --- /dev/null +++ b/tools/buildsteps/atv2/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=atv2 +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/atv2/make-native-depends b/tools/buildsteps/atv2/make-native-depends new file mode 100755 index 0000000000..416c14f3cb --- /dev/null +++ b/tools/buildsteps/atv2/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=atv2 +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi
\ No newline at end of file diff --git a/tools/buildsteps/atv2/make-xbmc b/tools/buildsteps/atv2/make-xbmc index 5b8bb111f7..4f03e615c1 100755 --- a/tools/buildsteps/atv2/make-xbmc +++ b/tools/buildsteps/atv2/make-xbmc @@ -4,5 +4,6 @@ XBMC_PLATFORM_DIR=atv2 cd $WORKSPACE;make -j$BUILDTHREADS xcode_depends cd $WORKSPACE;xcodebuild -project Kodi.xcodeproj -target Kodi-ATV2 -configuration $Configuration build \ - ONLY_ACTIVE_ARCH=YES ARCHS=armv7 VALID_ARCHS=armv7 IPHONEOS_DEPLOYMENT_TARGET=4.2 \ + ONLY_ACTIVE_ARCH=YES ARCHS=armv7 VALID_ARCHS=armv7 \ SDKROOT=iphoneos$SDK_VERSION XBMC_DEPENDS_ROOT=$XBMC_DEPENDS_ROOT CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO + diff --git a/tools/buildsteps/atv2/prepare-depends b/tools/buildsteps/atv2/prepare-depends index 3224fcf5ad..c390d3bb76 100755 --- a/tools/buildsteps/atv2/prepare-depends +++ b/tools/buildsteps/atv2/prepare-depends @@ -4,12 +4,12 @@ XBMC_PLATFORM_DIR=atv2 #clean without depends for skipping depends build if possible #also skip binary addons (pvr, audioencoder) as long as they are deployed in tree -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" -e "addons/pvr.*" -e "addons/audioencoder.*" +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} -if [ "$(rebuildDepends)" == "1" ] +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd cd $WORKSPACE/tools/depends/;./bootstrap fi - diff --git a/tools/buildsteps/atv2/prepare-xbmc b/tools/buildsteps/atv2/prepare-xbmc index c3738f9e7a..b24df067fd 100755 --- a/tools/buildsteps/atv2/prepare-xbmc +++ b/tools/buildsteps/atv2/prepare-xbmc @@ -2,5 +2,6 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=atv2 . $WORKSPACE/tools/buildsteps/defaultenv -#nothing on ios +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/defaultenv b/tools/buildsteps/defaultenv index 6b9f29d583..11791f0f69 100644 --- a/tools/buildsteps/defaultenv +++ b/tools/buildsteps/defaultenv @@ -4,9 +4,14 @@ NDK_VERSION=${NDK_VERSION:-"Default"} Configuration=${Configuration:-"Default"} XBMC_DEPENDS_ROOT=${XBMC_DEPENDS_ROOT:-"Default"} PATH_CHANGE_REV_FILENAME=".last_success_revision" +FAILED_BUILD_FILENAME=".last_failed_revision" #TARBALLS ENV-VAR is only used by android scripts atm TARBALLS=${TARBALLS:-"/opt/xbmc-tarballs"} +BINARY_ADDONS_ROOT=tools/depends/target +BINARY_ADDONS="binary-addons" +DEPLOYED_BINARY_ADDONS="-e addons" + #set platform defaults #$XBMC_PLATFORM_DIR matches the platform subdirs! case $XBMC_PLATFORM_DIR in @@ -35,7 +40,7 @@ case $XBMC_PLATFORM_DIR in ;; android) - DEFAULT_SDK_VERSION="14" + DEFAULT_SDK_VERSION="17" DEFAULT_NDK_VERSION="10d" DEFAULT_XBMC_DEPENDS_ROOT=$WORKSPACE/tools/depends/xbmc-depends DEFAULT_CONFIGURATION="Debug" @@ -76,6 +81,7 @@ fi #helper functions #hash a dir based on the git revision, SDK_PATH, NDK_PATH, NDK_VERSION, SDK_VERSION, TOOLCHAIN TOOLCHAIN_X86 (for droidx86) and XBMC_DEPENDS_ROOT +#param1 path to be hashed function getBuildHash () { local checkPath @@ -86,6 +92,7 @@ function getBuildHash () echo $hashStr } +#param1 path to be checked for changes function pathChanged () { local ret @@ -112,26 +119,24 @@ function pathChanged () echo $ret } -function rebuildDepends () +#param1 path to be tagged with hash +function tagSuccessFulBuild () { - local ret - ret="0" - # check if depends need to be rebuilt - this is done by checking last - # successfull build revision of depends and cmake dir - if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] || [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] - then - ret="1" - fi - - echo $ret + local pathToTag + pathToTag="$1" + # tag last successful build with revisions of the given dir + # needs to match the checks in function getBuildHash + echo "$(getBuildHash $pathToTag)" > $pathToTag/$PATH_CHANGE_REV_FILENAME } -function tagSuccessFulDependsBuild () +#param1 path to be tagged with hash +function tagFailedBuild () { - # tag last successful build of depends by marking the revisions of depends and cmake dir - # needs to match the checks in function rebuildDepends - echo "$(getBuildHash $WORKSPACE/tools/depends)" > $WORKSPACE/tools/depends/$PATH_CHANGE_REV_FILENAME - echo "$(getBuildHash $WORKSPACE/project/cmake)" > $WORKSPACE/project/cmake/$PATH_CHANGE_REV_FILENAME + local pathToTag + pathToTag="$1" + # tag last failed build with revisions of the given dir + # needs to match the checks in function getBuildHash + echo "$(getBuildHash $pathToTag)" > $pathToTag/$FAILED_BUILD_FILENAME } function getBranchName () diff --git a/tools/buildsteps/ios/configure-depends b/tools/buildsteps/ios/configure-depends index 998f80a354..d09f0cb269 100755 --- a/tools/buildsteps/ios/configure-depends +++ b/tools/buildsteps/ios/configure-depends @@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=ios . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends;./configure \ --with-tarballs=/Users/Shared/xbmc-depends/tarballs \ diff --git a/tools/buildsteps/ios/make-binary-addons b/tools/buildsteps/ios/make-binary-addons new file mode 100755 index 0000000000..edf4ec8ea2 --- /dev/null +++ b/tools/buildsteps/ios/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=ios +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/ios/make-depends b/tools/buildsteps/ios/make-depends index ce3bdf6bc3..eb36ee2a16 100755 --- a/tools/buildsteps/ios/make-depends +++ b/tools/buildsteps/ios/make-depends @@ -2,8 +2,8 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=ios . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then - cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulDependsBuild + cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends fi diff --git a/tools/buildsteps/ios/make-native-depends b/tools/buildsteps/ios/make-native-depends new file mode 100755 index 0000000000..36ebea8bb3 --- /dev/null +++ b/tools/buildsteps/ios/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=ios +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi
\ No newline at end of file diff --git a/tools/buildsteps/ios/make-xbmc b/tools/buildsteps/ios/make-xbmc index 90003383bc..6f1e7dc242 100755 --- a/tools/buildsteps/ios/make-xbmc +++ b/tools/buildsteps/ios/make-xbmc @@ -4,6 +4,6 @@ XBMC_PLATFORM_DIR=ios cd $WORKSPACE;make -j$BUILDTHREADS xcode_depends cd $WORKSPACE;xcodebuild -project Kodi.xcodeproj -target Kodi-iOS -configuration $Configuration build \ - ONLY_ACTIVE_ARCH=YES ARCHS=armv7 VALID_ARCHS=armv7 IPHONEOS_DEPLOYMENT_TARGET=4.2 \ + ONLY_ACTIVE_ARCH=YES ARCHS=armv7 VALID_ARCHS=armv7 \ SDKROOT=iphoneos$SDK_VERSION XBMC_DEPENDS_ROOT=$XBMC_DEPENDS_ROOT CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO diff --git a/tools/buildsteps/ios/prepare-depends b/tools/buildsteps/ios/prepare-depends index ff83e1213d..01aa9ed766 100755 --- a/tools/buildsteps/ios/prepare-depends +++ b/tools/buildsteps/ios/prepare-depends @@ -4,9 +4,10 @@ XBMC_PLATFORM_DIR=ios #clean without depends for skipping depends build if possible #also skip binary addons (pvr, audioencoder) as long as they are deployed in tree -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" -e "addons/pvr.*" -e "addons/audioencoder.*" +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} -if [ "$(rebuildDepends)" == "1" ] +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd diff --git a/tools/buildsteps/ios/prepare-xbmc b/tools/buildsteps/ios/prepare-xbmc index 1b93c2bdb7..9497ceab6b 100755 --- a/tools/buildsteps/ios/prepare-xbmc +++ b/tools/buildsteps/ios/prepare-xbmc @@ -9,3 +9,6 @@ then rm -r $WORKSPACE/addons/skin.re-touched fi git submodule update --init $WORKSPACE/addons/skin.re-touched + +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/linux32/configure-depends b/tools/buildsteps/linux32/configure-depends index 9382b9514e..4e143d6992 100755 --- a/tools/buildsteps/linux32/configure-depends +++ b/tools/buildsteps/linux32/configure-depends @@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=linux32 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends;./configure \ --with-toolchain=/usr --prefix=$XBMC_DEPENDS_ROOT --host=i686-linux-gnu --with-tarballs=$TARBALLS diff --git a/tools/buildsteps/linux32/configure-xbmc b/tools/buildsteps/linux32/configure-xbmc index 5e532760bf..de0247a9cf 100755 --- a/tools/buildsteps/linux32/configure-xbmc +++ b/tools/buildsteps/linux32/configure-xbmc @@ -2,4 +2,4 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=linux32 . $WORKSPACE/tools/buildsteps/defaultenv -cd $WORKSPACE/;./configure +make -C $WORKSPACE/tools/depends/target/xbmc diff --git a/tools/buildsteps/linux32/make-binary-addons b/tools/buildsteps/linux32/make-binary-addons new file mode 100755 index 0000000000..baa520dc33 --- /dev/null +++ b/tools/buildsteps/linux32/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=linux32 +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/linux32/make-depends b/tools/buildsteps/linux32/make-depends index b7f1320260..d5371e837d 100755 --- a/tools/buildsteps/linux32/make-depends +++ b/tools/buildsteps/linux32/make-depends @@ -2,8 +2,8 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=linux32 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then - cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulDependsBuild + cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS || make && tagSuccessFulBuild $WORKSPACE/tools/depends fi diff --git a/tools/buildsteps/linux32/make-native-depends b/tools/buildsteps/linux32/make-native-depends new file mode 100755 index 0000000000..1f21d53375 --- /dev/null +++ b/tools/buildsteps/linux32/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=linux32 +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi
\ No newline at end of file diff --git a/tools/buildsteps/linux32/make-xbmc b/tools/buildsteps/linux32/make-xbmc index a2bc0a7afc..79f07e2dc4 100755 --- a/tools/buildsteps/linux32/make-xbmc +++ b/tools/buildsteps/linux32/make-xbmc @@ -2,4 +2,4 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=linux32 . $WORKSPACE/tools/buildsteps/defaultenv -cd $WORKSPACE;make -j$BUILDTHREADS +cd $WORKSPACE;make -j$BUILDTHREADS || make diff --git a/tools/buildsteps/linux32/package b/tools/buildsteps/linux32/package index 45dc4c34cf..b073061176 100755 --- a/tools/buildsteps/linux32/package +++ b/tools/buildsteps/linux32/package @@ -3,8 +3,3 @@ XBMC_PLATFORM_DIR=linux32 . $WORKSPACE/tools/buildsteps/defaultenv #nothing for linux atm - -#rename for upload -#e.x. xbmc-20130314-8c2fb31-Frodo-armeabi-v7a.apk -UPLOAD_FILENAME="xbmc-$(getBuildRevDateStr)-armeabi-v7a.apk" -#mv xbmcapp-armeabi-*.apk $UPLOAD_FILENAME diff --git a/tools/buildsteps/linux32/prepare-depends b/tools/buildsteps/linux32/prepare-depends index 13df413142..525d78b325 100755 --- a/tools/buildsteps/linux32/prepare-depends +++ b/tools/buildsteps/linux32/prepare-depends @@ -3,9 +3,11 @@ XBMC_PLATFORM_DIR=linux32 . $WORKSPACE/tools/buildsteps/defaultenv #clean without depends for skipping depends build if possible -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" +#also skip binary addons (pvr, audioencoder) as long as they are deployed in tree +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} -if [ "$(rebuildDepends)" == "1" ] +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd diff --git a/tools/buildsteps/linux32/prepare-xbmc b/tools/buildsteps/linux32/prepare-xbmc index ca3a3d2774..0fbd21ee35 100755 --- a/tools/buildsteps/linux32/prepare-xbmc +++ b/tools/buildsteps/linux32/prepare-xbmc @@ -2,4 +2,5 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=linux32 . $WORKSPACE/tools/buildsteps/defaultenv -#nothing on linux +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/linux64/configure-depends b/tools/buildsteps/linux64/configure-depends index 80e990b427..44edac1431 100755 --- a/tools/buildsteps/linux64/configure-depends +++ b/tools/buildsteps/linux64/configure-depends @@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=linux64 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends;./configure \ --with-toolchain=/usr --prefix=$XBMC_DEPENDS_ROOT --host=x86_64-linux-gnu --with-tarballs=$TARBALLS diff --git a/tools/buildsteps/linux64/make-binary-addons b/tools/buildsteps/linux64/make-binary-addons new file mode 100755 index 0000000000..0f57b9ad15 --- /dev/null +++ b/tools/buildsteps/linux64/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=linux64 +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/linux64/make-depends b/tools/buildsteps/linux64/make-depends index ef58af723f..1730a618c7 100755 --- a/tools/buildsteps/linux64/make-depends +++ b/tools/buildsteps/linux64/make-depends @@ -2,8 +2,8 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=linux64 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then - cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS || make && tagSuccessFulDependsBuild + cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS || make && tagSuccessFulBuild $WORKSPACE/tools/depends fi diff --git a/tools/buildsteps/linux64/make-native-depends b/tools/buildsteps/linux64/make-native-depends new file mode 100755 index 0000000000..c05850f7f3 --- /dev/null +++ b/tools/buildsteps/linux64/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=linux64 +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi
\ No newline at end of file diff --git a/tools/buildsteps/linux64/prepare-depends b/tools/buildsteps/linux64/prepare-depends index 31fde7a0f5..ae0a027a06 100755 --- a/tools/buildsteps/linux64/prepare-depends +++ b/tools/buildsteps/linux64/prepare-depends @@ -3,9 +3,11 @@ XBMC_PLATFORM_DIR=linux64 . $WORKSPACE/tools/buildsteps/defaultenv #clean without depends for skipping depends build if possible -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" +#also skip binary addons (pvr, audioencoder) as long as they are deployed in tree +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} -if [ "$(rebuildDepends)" == "1" ] +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd diff --git a/tools/buildsteps/linux64/prepare-xbmc b/tools/buildsteps/linux64/prepare-xbmc index f71fcf6fef..6d6db0fcb2 100755 --- a/tools/buildsteps/linux64/prepare-xbmc +++ b/tools/buildsteps/linux64/prepare-xbmc @@ -2,4 +2,5 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=linux64 . $WORKSPACE/tools/buildsteps/defaultenv -#nothing on linux +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/osx32/configure-depends b/tools/buildsteps/osx32/configure-depends index b475a1db8a..3ccfc3553c 100755 --- a/tools/buildsteps/osx32/configure-depends +++ b/tools/buildsteps/osx32/configure-depends @@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=osx32 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends;./configure \ --with-tarballs=/Users/Shared/xbmc-depends/tarballs \ diff --git a/tools/buildsteps/osx32/make-binary-addons b/tools/buildsteps/osx32/make-binary-addons new file mode 100755 index 0000000000..c677cefb93 --- /dev/null +++ b/tools/buildsteps/osx32/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=osx32 +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/osx32/make-depends b/tools/buildsteps/osx32/make-depends index ecddc6dcde..ac149d74c3 100755 --- a/tools/buildsteps/osx32/make-depends +++ b/tools/buildsteps/osx32/make-depends @@ -2,8 +2,8 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=osx32 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then - cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulDependsBuild + cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends fi diff --git a/tools/buildsteps/osx32/make-native-depends b/tools/buildsteps/osx32/make-native-depends new file mode 100755 index 0000000000..6bdbc6665e --- /dev/null +++ b/tools/buildsteps/osx32/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=osx32 +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi
\ No newline at end of file diff --git a/tools/buildsteps/osx32/prepare-depends b/tools/buildsteps/osx32/prepare-depends index 2e356226f0..3feb117e4a 100755 --- a/tools/buildsteps/osx32/prepare-depends +++ b/tools/buildsteps/osx32/prepare-depends @@ -4,9 +4,10 @@ XBMC_PLATFORM_DIR=osx32 #clean without depends for skipping depends build if possible #also skip binary addons (pvr, audioencoder) as long as they are deployed in tree -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" -e "addons/pvr.*" -e "addons/audioencoder.*" +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} -if [ "$(rebuildDepends)" == "1" ] +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd diff --git a/tools/buildsteps/osx32/prepare-xbmc b/tools/buildsteps/osx32/prepare-xbmc index 01f97dac74..59431ddb17 100755 --- a/tools/buildsteps/osx32/prepare-xbmc +++ b/tools/buildsteps/osx32/prepare-xbmc @@ -2,4 +2,5 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=osx32 . $WORKSPACE/tools/buildsteps/defaultenv -#nothing on osx +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/osx64/configure-depends b/tools/buildsteps/osx64/configure-depends index 840643c33f..62f97700b3 100755 --- a/tools/buildsteps/osx64/configure-depends +++ b/tools/buildsteps/osx64/configure-depends @@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=osx64 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends;./configure \ --with-tarballs=/Users/Shared/xbmc-depends/tarballs \ diff --git a/tools/buildsteps/osx64/make-binary-addons b/tools/buildsteps/osx64/make-binary-addons new file mode 100755 index 0000000000..2e0724df6e --- /dev/null +++ b/tools/buildsteps/osx64/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=osx64 +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/osx64/make-depends b/tools/buildsteps/osx64/make-depends index 6749356afc..5a325e16e9 100755 --- a/tools/buildsteps/osx64/make-depends +++ b/tools/buildsteps/osx64/make-depends @@ -2,8 +2,8 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=osx64 . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then - cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulDependsBuild + cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends fi diff --git a/tools/buildsteps/osx64/make-native-depends b/tools/buildsteps/osx64/make-native-depends new file mode 100755 index 0000000000..d74c80ee26 --- /dev/null +++ b/tools/buildsteps/osx64/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=osx64 +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi
\ No newline at end of file diff --git a/tools/buildsteps/osx64/prepare-depends b/tools/buildsteps/osx64/prepare-depends index 03b10ea823..60df95379d 100755 --- a/tools/buildsteps/osx64/prepare-depends +++ b/tools/buildsteps/osx64/prepare-depends @@ -4,9 +4,10 @@ XBMC_PLATFORM_DIR=osx64 #clean without depends for skipping depends build if possible #also skip binary addons (pvr, audioencoder) as long as they are deployed in tree -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" -e "addons/pvr.*" -e "addons/audioencoder.*" +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} -if [ "$(rebuildDepends)" == "1" ] +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd diff --git a/tools/buildsteps/osx64/prepare-xbmc b/tools/buildsteps/osx64/prepare-xbmc index 6eea638e97..2c30e4924c 100755 --- a/tools/buildsteps/osx64/prepare-xbmc +++ b/tools/buildsteps/osx64/prepare-xbmc @@ -2,4 +2,5 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=osx64 . $WORKSPACE/tools/buildsteps/defaultenv -#nothing on osx +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/rbpi/configure-depends b/tools/buildsteps/rbpi/configure-depends index 96c75e1f9e..556469f359 100755 --- a/tools/buildsteps/rbpi/configure-depends +++ b/tools/buildsteps/rbpi/configure-depends @@ -2,7 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=rbpi . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then cd $WORKSPACE/tools/depends; diff --git a/tools/buildsteps/rbpi/make-binary-addons b/tools/buildsteps/rbpi/make-binary-addons new file mode 100755 index 0000000000..604a276652 --- /dev/null +++ b/tools/buildsteps/rbpi/make-binary-addons @@ -0,0 +1,28 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=rbpi +. $WORKSPACE/tools/buildsteps/defaultenv + +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-native-depends + +#clear the build failed file +rm -f $WORKSPACE/project/cmake/$FAILED_BUILD_FILENAME + +ALL_BINARY_ADDONS_BUILT="1" +#only build binary addons if something in the addons metadata changed +if [ "$(pathChanged $WORKSPACE/project/cmake)" == "1" ] +then + for addon in $BINARY_ADDONS + do + echo "building $addon" + git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon + cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS || ALL_BINARY_ADDONS_BUILT="0" + done +fi + +if [ "$ALL_BINARY_ADDONS_BUILT" == "1" ] +then + tagSuccessFulBuild $WORKSPACE/project/cmake +else + #mark the build failure in the filesystem but leave jenkins running + tagFailedBuild $WORKSPACE/project/cmake +fi diff --git a/tools/buildsteps/rbpi/make-depends b/tools/buildsteps/rbpi/make-depends index 4eb47575b7..ceeee09234 100755 --- a/tools/buildsteps/rbpi/make-depends +++ b/tools/buildsteps/rbpi/make-depends @@ -2,8 +2,8 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=rbpi . $WORKSPACE/tools/buildsteps/defaultenv -if [ "$(rebuildDepends)" == "1" ] +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then - cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS || make && tagSuccessFulDependsBuild + cd $WORKSPACE/tools/depends;make -j $BUILDTHREADS || make && tagSuccessFulBuild $WORKSPACE/tools/depends fi diff --git a/tools/buildsteps/rbpi/make-native-depends b/tools/buildsteps/rbpi/make-native-depends new file mode 100755 index 0000000000..5f6d64c452 --- /dev/null +++ b/tools/buildsteps/rbpi/make-native-depends @@ -0,0 +1,9 @@ +WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} +XBMC_PLATFORM_DIR=rbpi +. $WORKSPACE/tools/buildsteps/defaultenv + +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] +then + git clean -xffd $WORKSPACE/tools/depends/native + cd $WORKSPACE/tools/depends/native;make -j $BUILDTHREADS && tagSuccessFulBuild $WORKSPACE/tools/depends +fi
\ No newline at end of file diff --git a/tools/buildsteps/rbpi/prepare-depends b/tools/buildsteps/rbpi/prepare-depends index c084909dfa..8205432d65 100755 --- a/tools/buildsteps/rbpi/prepare-depends +++ b/tools/buildsteps/rbpi/prepare-depends @@ -3,7 +3,8 @@ XBMC_PLATFORM_DIR=rbpi . $WORKSPACE/tools/buildsteps/defaultenv #clean without depends for skipping depends build if possible -cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" +#also skip binary addons (pvr, audioencoder) as long as they are deployed in tree +cd $WORKSPACE;git clean -xfd -e "project/cmake/.last_success_revision" -e "tools/depends" ${DEPLOYED_BINARY_ADDONS} if [ -d $JENKINS_RBPI_DEVENV/firmware ] then @@ -12,7 +13,10 @@ else cd $JENKINS_RBPI_DEVENV;git clone git://github.com/raspberrypi/firmware.git --depth=1 -b master fi -if [ "$(rebuildDepends)" == "1" ] +cd $WORKSPACE + +# if depends path has changed - cleanout everything and do a full rebuild +if [ "$(pathChanged $WORKSPACE/tools/depends)" == "1" ] then #clean up the rest too cd $WORKSPACE;git clean -xffd diff --git a/tools/buildsteps/rbpi/prepare-xbmc b/tools/buildsteps/rbpi/prepare-xbmc index c47ee7dd9d..468c7ed5cb 100755 --- a/tools/buildsteps/rbpi/prepare-xbmc +++ b/tools/buildsteps/rbpi/prepare-xbmc @@ -4,3 +4,6 @@ XBMC_PLATFORM_DIR=rbpi cd $WORKSPACE JSON_BUILDER=$XBMC_DEPENDS_ROOT/i686-linux-gnu-native/bin/JsonSchemaBuilder ./bootstrap + +#build binary addons before building xbmc... +. $WORKSPACE/tools/buildsteps/$XBMC_PLATFORM_DIR/make-binary-addons diff --git a/tools/buildsteps/win32/make-addons.bat b/tools/buildsteps/win32/make-addons.bat index a123b377bb..2cf9a5b765 100644 --- a/tools/buildsteps/win32/make-addons.bat +++ b/tools/buildsteps/win32/make-addons.bat @@ -7,15 +7,18 @@ SET EXITCODE=0 SET install=false SET clean=false SET addon= -FOR %%b in (%1, %2, %3, %4) DO ( + +SETLOCAL EnableDelayedExpansion +FOR %%b IN (%*) DO ( IF %%b == install ( SET install=true ) ELSE ( IF %%b == clean ( SET clean=true ) ELSE ( - SET addon=%%b + SET addon=!addon! %%b )) ) +SETLOCAL DisableDelayedExpansion rem set Visual C++ build environment call "%VS120COMNTOOLS%..\..\VC\bin\vcvars32.bat" @@ -33,8 +36,16 @@ SET SCRIPTS_PATH=%BASE_PATH%\scripts\windows SET ADDONS_PATH=%BASE_PATH%\addons SET ADDON_DEPENDS_PATH=%ADDONS_PATH%\output SET ADDONS_BUILD_PATH=%ADDONS_PATH%\build +SET ADDONS_DEFINITION_PATH=%ADDONS_PATH%\addons + +SET ADDONS_SUCCESS_FILE=%ADDONS_PATH%\.success +SET ADDONS_FAILURE_FILE=%ADDONS_PATH%\.failure + +SET ERRORFILE=%ADDONS_PATH%\make-addons.error -SET ERRORFILE=%BASE_PATH%\make-addons.error +rem remove the success and failure files from a previous build +DEL /F %ADDONS_SUCCESS_FILE% > NUL 2>&1 +DEL /F %ADDONS_FAILURE_FILE% > NUL 2>&1 IF %clean% == true ( rem remove the build directory if it exists @@ -70,9 +81,15 @@ ECHO -------------------------------------------------- ECHO Building addons ECHO -------------------------------------------------- -SET ADDONS_TO_BUILD="all" +SET ADDONS_TO_BUILD= IF "%addon%" NEQ "" ( - SET ADDONS_TO_BUILD="%addon%" + SET ADDONS_TO_BUILD=%addon% +) ELSE ( + SETLOCAL EnableDelayedExpansion + FOR /D %%a IN (%ADDONS_DEFINITION_PATH%\*) DO ( + SET ADDONS_TO_BUILD=!ADDONS_TO_BUILD! %%~nxa + ) + SETLOCAL DisableDelayedExpansion ) rem execute cmake to generate makefiles processable by nmake @@ -85,18 +102,23 @@ cmake "%ADDONS_PATH%" -G "NMake Makefiles" ^ -DBUILD_DIR=%ADDONS_BUILD_PATH% ^ -DDEPENDS_PATH=%ADDON_DEPENDS_PATH% ^ -DPACKAGE_ZIP=1 ^ - -DARCH_DEFINES="-DTARGET_WINDOWS -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_USE_32BIT_TIME_T -D_WINSOCKAPI_" ^ -DADDONS_TO_BUILD="%ADDONS_TO_BUILD%" IF ERRORLEVEL 1 ( ECHO cmake error level: %ERRORLEVEL% > %ERRORFILE% GOTO ERROR ) -rem execute nmake to build the addons -nmake %addon% -IF ERRORLEVEL 1 ( - ECHO nmake error level: %ERRORLEVEL% > %ERRORFILE% - GOTO ERROR +rem loop over all addons to build +FOR %%a IN (%ADDONS_TO_BUILD%) DO ( + ECHO Building %%a... + rem execute nmake to build the addons + nmake %%a + IF ERRORLEVEL 1 ( + ECHO nmake %%a error level: %ERRORLEVEL% > %ERRORFILE% + ECHO %%a >> %ADDONS_FAILURE_FILE% + ) ELSE ( + ECHO %%a >> %ADDONS_SUCCESS_FILE% + ) ) rem everything was fine @@ -104,6 +126,9 @@ GOTO END :ERROR rem something went wrong +FOR %%a IN (%ADDONS_TO_BUILD%) DO ( + ECHO %%a >> %ADDONS_FAILURE_FILE% +) ECHO Failed to build addons ECHO See %ERRORFILE% for more details SET EXITCODE=1 diff --git a/tools/codegenerator/Helper.groovy b/tools/codegenerator/Helper.groovy index 8b471067f7..cdb7b3ed0e 100644 --- a/tools/codegenerator/Helper.groovy +++ b/tools/codegenerator/Helper.groovy @@ -85,10 +85,10 @@ public class Helper def ret = '' // make the class name or namespace - String doxygenId = findFullClassName(methodOrClass,'_1_1') + String doxygenId = findFullClassName(methodOrClass,'_1_1',true) boolean isInClass = doxygenId != null if (!doxygenId) - doxygenId = findNamespace(methodOrClass,'_1_1',false) + doxygenId = findNamespace(methodOrClass,'_1_1',false,true) doxygenId = (isInClass ? 'class' : 'namespace') + doxygenId String doxygenFilename = doxygenId + '.xml' @@ -593,7 +593,7 @@ public class Helper * If this node is a class node, or a child of a class name (for example, a method) then * the full classname, with the namespace will be returned. Otherwise, null. */ - public static String findFullClassName(Node node, String separator = '::') + public static String findFullClassName(Node node, String separator = '::', boolean filename = false) { String ret = null List rents = parents(node, { it.name() == 'class' }) @@ -605,21 +605,24 @@ public class Helper ret += separator + it.@sym_name } - return ret ? findNamespace(node,separator) + ret : null + return ret ? findNamespace(node,separator,true,filename) + ret : null } /** * Given the Node this method looks to see if it occurs within namespace and returns * the namespace as a String. It includes the trailing '::' */ - public static String findNamespace(Node node, String separator = '::', boolean endingSeparator = true) + public static String findNamespace(Node node, String separator = '::', boolean endingSeparator = true, boolean filename = false) { String ret = null parents(node, { it.name() == 'namespace' }).each { + String data = it.@name + if (filename) + data = data.replaceAll("_", "__") if (ret == null) - ret = it.@name + ret = data else - ret += separator + it.@name + ret += separator + data } return ret == null ? '' : (ret + (endingSeparator ? separator : '')) @@ -665,6 +668,19 @@ public class Helper } /** + * Because the return type of a property is a combination of the function + * 'decl' and the function 'type,' this method will construct a valid Swig + * typestring from the two. + */ + public static String getPropertyReturnSwigType(Node method) + { + // we're going to take a shortcut here because it appears only the pointer indicator + // ends up attached to the decl. + String prefix = (method.@decl != null && method.@decl == 'p.') ? 'p.' : '' + return method.@type != null ? prefix + method.@type : 'void' + } + + /** * Because the return type is a combination of the function 'decl' and the * function 'type,' this method will construct a valid Swig typestring from * the two. diff --git a/tools/darwin/Configurations/App-OSX.xcconfig b/tools/darwin/Configurations/App-OSX.xcconfig index 101454f460..29cc6f71d5 100644 --- a/tools/darwin/Configurations/App-OSX.xcconfig +++ b/tools/darwin/Configurations/App-OSX.xcconfig @@ -24,10 +24,10 @@ ARCHS = i386 x86_64 ONLY_ACTIVE_ARCH = YES SDKROOT = macosx -MACOSX_DEPLOYMENT_TARGET = 10.6 +MACOSX_DEPLOYMENT_TARGET = 10.7 OTHER_LDFLAGS = -Wl,-search_paths_first $(XBMC_OTHER_LDFLAGS_COMMON) -lcdio -lfontconfig -lGLEW -lSDL -GCC_PREPROCESSOR_DEFINITIONS = TARGET_DARWIN_OSX $(inherited)
\ No newline at end of file +GCC_PREPROCESSOR_DEFINITIONS = TARGET_DARWIN_OSX $(inherited) diff --git a/tools/darwin/Configurations/App-iOS.xcconfig b/tools/darwin/Configurations/App-iOS.xcconfig index 8a2cc41f50..ce7e788052 100644 --- a/tools/darwin/Configurations/App-iOS.xcconfig +++ b/tools/darwin/Configurations/App-iOS.xcconfig @@ -23,7 +23,7 @@ PRODUCT_NAME = $(APP_NAME) //build against latest SDKROOT = iphoneos -IPHONEOS_DEPLOYMENT_TARGET = 4.2 +IPHONEOS_DEPLOYMENT_TARGET = 5.1 ARCHS = armv7 VALID_ARCHS = armv7 diff --git a/tools/darwin/Configurations/App.xcconfig.in b/tools/darwin/Configurations/App.xcconfig.in index 94946d3daf..bdf04a6ab8 100644 --- a/tools/darwin/Configurations/App.xcconfig.in +++ b/tools/darwin/Configurations/App.xcconfig.in @@ -25,6 +25,7 @@ HEADER_SEARCH_PATHS = $(inherited) $SRCROOT xbmc xbmc/linux xbmc/osx xbmc/cores/ LIBRARY_SEARCH_PATHS = $(inherited) $(SRCROOT) $(SRCROOT)/lib/libRTV $(SRCROOT)/lib/libXDAAP $(SRCROOT)/lib/cmyth/libcmyth $(SRCROOT)/lib/cmyth/librefmem $(SRCROOT)/lib/SlingboxLib $(SRCROOT)/xbmc/interfaces/json-rpc "$(SRCROOT)/xbmc/interfaces/python" "$(SRCROOT)/xbmc/interfaces/legacy" FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/System/Library/PrivateFrameworks/" "$(SDKROOT)/System/Library/Frameworks/" -XBMC_OTHER_LDFLAGS_COMMON = $(inherited) -Wl,-headerpad_max_install_names -Wl,-all_load -L$XBMC_DEPENDS/lib -lbz2 -lintl -lexpat -lssl -lgpg-error -lresolv -lffi -lssh -llzo2 -lpcre -lpcrecpp -lfribidi -lfreetype -lfontconfig -lsqlite3 -ltinyxml -lmicrohttpd -lsmbclient -lpython2.6 -lyajl -ljpeg -lcrypto -lgcrypt -lavdevice -lavfilter -lavcodec -lavformat -lpostproc -lavutil -lswresample -lswscale -ltag -L$XBMC_DEPENDS/lib/mysql -lmysqlclient -lxml2 -lxslt -lnettle -lgmp -lhogweed -lgnutls - +XBMC_OTHER_LDFLAGS_COMMON = $(inherited) -Wl,-headerpad_max_install_names -Wl,-all_load -L$XBMC_DEPENDS/lib -lbz2 -lintl -lexpat -lssl -lgpg-error -lresolv -lffi -lssh -llzo2 -lpcre -lpcrecpp -lfribidi -lfreetype -lfontconfig -lsqlite3 -ltinyxml -lmicrohttpd -lsmbclient -lpython2.6 -lyajl -ljpeg -lcrypto -lgcrypt -lavdevice -lavfilter -lavcodec -lavformat -lpostproc -lavutil -lswresample -lswscale -ltag -L$XBMC_DEPENDS/lib/mysql -lmysqlclient -lxml2 -lxslt -lnettle -lgmp -lhogweed -lgnutls -lsquish +CLANG_CXX_LANGUAGE_STANDARD = c++0x +CLANG_CXX_LIBRARY = libc++ diff --git a/tools/darwin/Support/CopyRootFiles-atv2.command b/tools/darwin/Support/CopyRootFiles-atv2.command index 3ebb6ab668..8bb385524d 100755 --- a/tools/darwin/Support/CopyRootFiles-atv2.command +++ b/tools/darwin/Support/CopyRootFiles-atv2.command @@ -24,7 +24,6 @@ mv $TARGET_BUILD_DIR/$TARGET_NAME/$APP_NAME.bin $TARGET_BUILD_DIR/$TARGET_NAME/$ mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/addons" -mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/language" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/media" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/sounds" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/system" @@ -37,7 +36,6 @@ ${SYNC} "$SRCROOT/xbmc/osx/Credits.html" "$TARGET_BUILD_DIR/$TARGET_NAME/AppDat ${ADDONSYNC} "$SRCROOT/addons" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome" ${SYNC} "$SRCROOT/addons/visualization.glspectrum" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/addons" ${SYNC} "$SRCROOT/addons/visualization.waveform" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/addons" -${SYNC} "$SRCROOT/language" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome" ${SYNC} "$SRCROOT/media" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome" SYNCSKIN_A=${SKINSYNC} diff --git a/tools/darwin/Support/CopyRootFiles-ios.command b/tools/darwin/Support/CopyRootFiles-ios.command index 81bccd6ceb..d034593557 100755 --- a/tools/darwin/Support/CopyRootFiles-ios.command +++ b/tools/darwin/Support/CopyRootFiles-ios.command @@ -24,7 +24,6 @@ mv $TARGET_BUILD_DIR/$TARGET_NAME/$APP_NAME.bin $TARGET_BUILD_DIR/$TARGET_NAME/$ mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/addons" -mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/language" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/media" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/sounds" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/system" @@ -37,7 +36,6 @@ ${SYNC} "$SRCROOT/xbmc/osx/Credits.html" "$TARGET_BUILD_DIR/$TARGET_NAME/AppDat ${ADDONSYNC} "$SRCROOT/addons" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome" ${SYNC} "$SRCROOT/addons/visualization.glspectrum" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/addons" ${SYNC} "$SRCROOT/addons/visualization.waveform" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome/addons" -${SYNC} "$SRCROOT/language" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome" ${SYNC} "$SRCROOT/media" "$TARGET_BUILD_DIR/$TARGET_NAME/AppData/AppHome" # sync touch skin if it exists diff --git a/tools/darwin/Support/CopyRootFiles-osx.command b/tools/darwin/Support/CopyRootFiles-osx.command index 8c10364cbe..3ee6fcc1dc 100755 --- a/tools/darwin/Support/CopyRootFiles-osx.command +++ b/tools/darwin/Support/CopyRootFiles-osx.command @@ -21,7 +21,6 @@ ADDONSYNC="rsync -aq --exclude .git* --exclude .DS_Store* --exclude addons/skin. mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/addons" -mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/language" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/media" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/sounds" mkdir -p "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/system" @@ -34,7 +33,6 @@ ${SYNC} "$SRCROOT/LICENSE.GPL" "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resourc ${SYNC} "$SRCROOT/xbmc/osx/Credits.html" "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/" ${SYNC} "$SRCROOT/tools/darwin/runtime" "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/tools/darwin" ${ADDONSYNC} "$SRCROOT/addons" "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME" -${SYNC} "$SRCROOT/language" "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME" ${SYNC} "$SRCROOT/media" "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME" ${SYNCSKIN} "$SRCROOT/addons/skin.confluence" "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/addons" ${SYNC} "$SRCROOT/addons/skin.confluence/backgrounds" "$TARGET_BUILD_DIR/$TARGET_NAME/Contents/Resources/$APP_NAME/addons/skin.confluence" diff --git a/tools/darwin/packaging/atv2/mkdeb-atv2.sh.in b/tools/darwin/packaging/atv2/mkdeb-atv2.sh.in index fefc6ce0a7..c309036b39 100644 --- a/tools/darwin/packaging/atv2/mkdeb-atv2.sh.in +++ b/tools/darwin/packaging/atv2/mkdeb-atv2.sh.in @@ -4,7 +4,7 @@ XBMC_DEPENDS_ROOT=@DEPENDS_ROOT_FOR_XCODE@ SWITCH=`echo $1 | tr [A-Z] [a-z]` DIRNAME=`dirname $0` -DSYM_TARGET_DIR=${XBMC_DEPENDS_ROOT}/dSyms +DSYM_TARGET_DIR=/Users/Shared/xbmc-depends/dSyms DSYM_FILENAME=@APP_NAME@.frappliance.dSYM if [ ${SWITCH:-""} = "debug" ]; then diff --git a/tools/darwin/packaging/ios/mkdeb-ios.sh.in b/tools/darwin/packaging/ios/mkdeb-ios.sh.in index f159bf9a19..c868141889 100644 --- a/tools/darwin/packaging/ios/mkdeb-ios.sh.in +++ b/tools/darwin/packaging/ios/mkdeb-ios.sh.in @@ -5,7 +5,7 @@ XBMC_DEPENDS_ROOT=@DEPENDS_ROOT_FOR_XCODE@ SWITCH=`echo $1 | tr [A-Z] [a-z]` DIRNAME=`dirname $0` -DSYM_TARGET_DIR=${XBMC_DEPENDS_ROOT}/dSyms +DSYM_TARGET_DIR=/Users/Shared/xbmc-depends/dSyms DSYM_FILENAME=@APP_NAME@.app.dSYM if [ ${SWITCH:-""} = "debug" ]; then diff --git a/tools/depends/configure.in b/tools/depends/configure.in index 37be22712c..f21af0bad8 100644 --- a/tools/depends/configure.in +++ b/tools/depends/configure.in @@ -2,9 +2,12 @@ AC_PREREQ(2.59) AC_INIT([xbmc-depends], [2.00], [http://trac.xbmc.org]) :${CFLAGS=""} AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_FILES([target/config.site native/config.site.native Makefile.include target/Toolchain.cmake]) +AC_CONFIG_FILES([target/config.site native/config.site.native Makefile.include target/Toolchain.cmake + target/config-binaddons.site target/Toolchain_binaddons.cmake]) AC_CANONICAL_HOST m4_include([../../m4/xbmc_arch.m4]) +m4_include([../../m4/ax_cxx_compile_stdcxx_11.m4]) +AX_CXX_COMPILE_STDCXX_11(,[optional]) AC_ARG_WITH([toolchain], [AS_HELP_STRING([--with-toolchain], @@ -115,7 +118,7 @@ case $host in if test "x$use_cpu" = "xauto"; then use_cpu="armeabi-v7a" fi - use_sdk="${use_sdk:-android-14}" + use_sdk="${use_sdk:-android-17}" deps_dir="$use_host-$use_sdk" platform_cflags="-DANDROID -Os -fexceptions" if test "x$use_cpu" = "xarmeabi-v7a"; then @@ -135,7 +138,7 @@ case $host in if test "x$use_cpu" = "xauto"; then use_cpu=$host_cpu fi - use_sdk="${use_sdk:-android-14}" + use_sdk="${use_sdk:-android-17}" deps_dir="$use_host-$use_sdk" platform_cflags="-DANDROID -Os -fexceptions" platform_ldflags="-L$prefix/$deps_dir/lib/$use_sdk" @@ -250,7 +253,7 @@ case $host in AC_MSG_ERROR(error in configure of --with-arch=$use_cpu) esac platform_os="osx" - platform_min_version=macosx-version-min=10.6 + platform_min_version=macosx-version-min=10.7 ;; arm-apple-darwin*) @@ -260,7 +263,7 @@ case $host in if test "$use_cpu" != "armv7"; then AC_MSG_ERROR(error in configure of --with-arch=$use_cpu) fi - platform_min_version="iphoneos-version-min=4.2" + platform_min_version="iphoneos-version-min=5.1" found_sdk_version=[`$use_xcodebuild -showsdks | grep iphoneos | sort | tail -n 1 | awk '{ print $2}'`] use_sdk="${use_sdk:-$found_sdk_version}" sdk_name=iphoneos$use_sdk @@ -293,7 +296,7 @@ case $host in esac platform_cflags+=" -arch $use_cpu -m$platform_min_version" platform_ldflags+=" -arch $use_cpu -m$platform_min_version -isysroot $use_sdk_path" - platform_cxxflags+=" -arch $use_cpu -m$platform_min_version" + platform_cxxflags+=" -arch $use_cpu -m$platform_min_version -std=c++11 -stdlib=libc++" platform_includes="-isysroot $use_sdk_path" deps_dir=$sdk_name"_"$use_cpu-target tool_dir=buildtools-native; @@ -496,6 +499,7 @@ AC_SUBST(use_toolchain) AC_SUBST(use_build_toolchain) AC_SUBST(use_tarballs) AC_SUBST(use_platform) +AC_SUBST(use_firmware) AC_SUBST(cross_compiling) AC_SUBST(platform_cflags) AC_SUBST(platform_cxxflags) diff --git a/tools/depends/native/TexturePacker/src/TexturePacker.cpp b/tools/depends/native/TexturePacker/src/TexturePacker.cpp index 9d093f280d..a345ebd2dd 100644 --- a/tools/depends/native/TexturePacker/src/TexturePacker.cpp +++ b/tools/depends/native/TexturePacker/src/TexturePacker.cpp @@ -389,7 +389,7 @@ int createBundle(const std::string& InputDir, const std::string& OutputFile, dou CXBTFFrame frame = createXBTFFrame(frames.frameList[j].rgbaImage, writer, maxMSE, flags); frame.SetDuration(frames.frameList[j].delay); file.GetFrames().push_back(frame); - printf("%s%c (%d,%d @ %"PRIu64" bytes)\n", GetFormatString(frame.GetFormat()), frame.HasAlpha() ? ' ' : '*', + printf("%s%c (%d,%d @ %" PRIu64 " bytes)\n", GetFormatString(frame.GetFormat()), frame.HasAlpha() ? ' ' : '*', frame.GetWidth(), frame.GetHeight(), frame.GetUnpackedSize()); } } diff --git a/tools/depends/native/tar-native/Makefile b/tools/depends/native/tar-native/Makefile index 274c74c588..5064d3f765 100644 --- a/tools/depends/native/tar-native/Makefile +++ b/tools/depends/native/tar-native/Makefile @@ -12,7 +12,7 @@ ARCHIVE=$(SOURCE).tar.gz export LIBTOOL=builds/unix/libtool export PATH:=$(PREFIX)/bin:$(PATH) CONFIGURE=./configure --prefix=$(PREFIX) \ ---program-transform-name=s/tar/gtar/ --disable-dependency-tracking +--program-transform-name=s/tar/gtar/ --disable-dependency-tracking ac_cv_func_fdopendir=no APP=$(SOURCE)/src/tar APPBIN=$(PREFIX)/bin/tar diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index d1a0e69044..18f6897cca 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -12,10 +12,9 @@ DEPENDS = \ libogg libvorbis libflac fribidi libmpeg2 \ libass libsquish \ libmodplug librtmp libxml2 yajl libmicrohttpd mysql libffi \ - python26 afpfs-ng libshairplay \ + python26 libshairplay \ libplist libcec libbluray boost tinyxml dummy-libxbmc \ libamplayer libssh taglib libusb libnfs libmp3lame \ - xbmc-pvr-addons xbmc-audioencoder-addons \ pythonmodule-pil libxslt ffmpeg FFMPEG_DEPENDS = gnutls @@ -84,12 +83,9 @@ librtmp: openssl libmicrohttpd: openssl libgpg-error libgcrypt python26: expat gettext libxml2 sqlite3 openssl libffi libcdio: $(ICONV) -afpfs-ng: libgcrypt $(ICONV) libplist: libxml2 $(ZLIB) libbluray: $(ICONV) libxml2 libssh: openssl -xbmc-pvr-addons: boost mysql -xbmc-audioencoder-addons: libvorbis libflac libmp3lame libogg mysql: openssl libzip: $(ZLIB) libmp3lame: $(ICONV) diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in index 857c21bf80..943be731d3 100644 --- a/tools/depends/target/Toolchain.cmake.in +++ b/tools/depends/target/Toolchain.cmake.in @@ -29,6 +29,12 @@ SET(CMAKE_LINKER @LD@ CACHE FILEPATH "Linker") SET(CMAKE_FIND_ROOT_PATH @prefix@/@deps_dir@ @use_toolchain@ @use_toolchain@/usr @use_sdk_path@ @use_sdk_path@/usr @use_toolchain@/sysroot/usr) SET(CMAKE_LIBRARY_PATH @prefix@/@deps_dir@/lib:@use_toolchain@/usr/lib/@use_host@:@use_toolchain@/lib/@use_host@) +# add RBPI's firmware directories +IF("${CORE_SYSTEM_NAME}" STREQUAL "rbpi") + LIST(APPEND CMAKE_FIND_ROOT_PATH @use_firmware@/opt/vc) + LIST(APPEND CMAKE_LIBRARY_PATH @use_firmware@/opt/vc/lib) +ENDIF() + SET(CMAKE_C_FLAGS "@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") SET(CMAKE_CXX_FLAGS "@platform_cxxflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") SET(CMAKE_CPP_FLAGS "@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") diff --git a/tools/depends/target/Toolchain_binaddons.cmake.in b/tools/depends/target/Toolchain_binaddons.cmake.in new file mode 100644 index 0000000000..cdc2fe4f6c --- /dev/null +++ b/tools/depends/target/Toolchain_binaddons.cmake.in @@ -0,0 +1,53 @@ +set(CMAKE_SYSTEM_VERSION 1) +set(OS "@platform_os@") +set(CPU "@use_cpu@") +set(PLATFORM "@use_platform@") +if("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android") + set(CMAKE_SYSTEM_NAME Linux) +endif() + +set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@) + +# set special CORE_SYSTEM_NAME +if("${OS}" STREQUAL "android") + set(CORE_SYSTEM_NAME android) + list(APPEND CMAKE_FIND_ROOT_PATH @use_toolchain@/sysroot/usr) +elseif("${OS}" STREQUAL "ios") + set(CORE_SYSTEM_NAME ios) +elseif("${PLATFORM}" STREQUAL "raspberry-pi") + set(CORE_SYSTEM_NAME rbpi) + list(APPEND CMAKE_FIND_ROOT_PATH @use_firmware@/opt/vc) + set(CMAKE_LIBRARY_PATH @CMAKE_FIND_ROOT_PATH@/lib:@use_firmware@/opt/vc/lib) + set(CMAKE_INCLUDE_PATH @CMAKE_FIND_ROOT_PATH@/include:@use_firmware@/opt/vc/include) +endif() + + +if("${OS}" STREQUAL "ios" OR "${OS}" STREQUAL "osx") + set(CMAKE_OSX_SYSROOT @use_sdk_path@) + list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT} ${CMAKE_OSX_SYSROOT}/usr) + set(CMAKE_LIBRARY_PATH @CMAKE_FIND_ROOT_PATH@/lib:@use_sdk_path@/lib) + set(CMAKE_INCLUDE_PATH @CMAKE_FIND_ROOT_PATH@/include:@use_sdk_path@/include) +endif() + +# specify the cross compiler +set(CMAKE_C_COMPILER @CC@) +set(CMAKE_CXX_COMPILER @CXX@) +set(CMAKE_AR @AR@ CACHE FILEPATH "Archiver") +set(CMAKE_LINKER @LD@ CACHE FILEPATH "Linker") +set(CMAKE_C_FLAGS "@platform_cflags@ @platform_includes@") +set(CMAKE_CXX_FLAGS "@platform_cxxflags@ @platform_includes@") +set(CMAKE_CPP_FLAGS "@platform_cflags@ @platform_includes@") +set(ENV{CFLAGS} ${CMAKE_C_FLAGS}) +set(ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS}) +set(ENV{CPPFLAGS} ${CMAKE_CPP_FLAGS}) +SET(ENV{LDFLAGS} "@platform_ldflags@") + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +if(NOT OS STREQUAL "linux") + set(ADDONS_PREFER_STATIC_LIBS ON) +endif() diff --git a/tools/depends/target/afpfs-ng/01-gcrypt.patch b/tools/depends/target/afpfs-ng/01-gcrypt.patch deleted file mode 100644 index 7bcace2812..0000000000 --- a/tools/depends/target/afpfs-ng/01-gcrypt.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ru afpfs-ng-0.8.1/configure.ac afpfs-ng-0.8.1+iPhone/configure.ac ---- afpfs-ng-0.8.1/configure.ac 2008-03-08 16:23:12.000000000 +0000 -+++ afpfs-ng-0.8.1+iPhone/configure.ac 2010-10-24 05:26:15.000000000 +0000 -@@ -50,21 +50,6 @@ - case $host in - *-*-darwin*) - AC_MSG_CHECKING([for correct gcrypt version]) -- AC_RUN_IFELSE( -- [AC_LANG_PROGRAM([ -- #include <gcrypt.h> -- #include <stdio.h>],[ -- char*p= GCRYPT_VERSION; -- unsigned int vers; -- vers=atoi(p)*10000; -- p=strchr(p,'.')+1; -- vers+=atoi(p)*100; -- p=strchr(p,'.')+1; -- vers+=atoi(p); -- if (vers<10400) return 1; -- ])], -- [AC_MSG_RESULT([yes])], -- [AC_MSG_ERROR([version is < 1.4.0])]) - AM_CONDITIONAL(HAVE_LIBGCRYPT, true) - AC_DEFINE([HAVE_LIBGCRYPT], [1] ) - ;; - diff --git a/tools/depends/target/afpfs-ng/02-pointer.patch b/tools/depends/target/afpfs-ng/02-pointer.patch deleted file mode 100644 index 80507b5725..0000000000 --- a/tools/depends/target/afpfs-ng/02-pointer.patch +++ /dev/null @@ -1,280 +0,0 @@ -diff -up afpfs-ng-0.8.1/cmdline/getstatus.c.pointer afpfs-ng-0.8.1/cmdline/getstatus.c ---- afpfs-ng-0.8.1/cmdline/getstatus.c.pointer 2011-06-14 17:06:35.000000000 +0200 -+++ afpfs-ng-0.8.1/cmdline/getstatus.c 2011-06-14 17:07:25.000000000 +0200 -@@ -1,4 +1,5 @@ - #include <stdio.h> -+#include <stdlib.h> - #include <string.h> - #include <pthread.h> - -diff -up afpfs-ng-0.8.1/fuse/client.c.pointer afpfs-ng-0.8.1/fuse/client.c ---- afpfs-ng-0.8.1/fuse/client.c.pointer 2008-03-08 03:44:16.000000000 +0100 -+++ afpfs-ng-0.8.1/fuse/client.c 2011-06-14 17:02:15.000000000 +0200 -@@ -61,8 +61,9 @@ static int start_afpfsd(void) - snprintf(filename, PATH_MAX, - "/usr/local/bin/%s",AFPFSD_FILENAME); - if (access(filename,X_OK)) { -- snprintf(filename, "/usr/bin/%s", -+ snprintf(filename, sizeof(filename), "/usr/bin/%s", - AFPFSD_FILENAME); -+ filename[sizeof(filename) - 1] = 0; - if (access(filename,X_OK)) { - printf("Could not find server (%s)\n", - filename); -diff -up afpfs-ng-0.8.1/fuse/fuse_int.c.pointer afpfs-ng-0.8.1/fuse/fuse_int.c ---- afpfs-ng-0.8.1/fuse/fuse_int.c.pointer 2008-03-02 06:06:24.000000000 +0100 -+++ afpfs-ng-0.8.1/fuse/fuse_int.c 2011-06-14 17:02:15.000000000 +0200 -@@ -197,7 +197,7 @@ static int fuse_open(const char *path, s - ret = ml_open(volume,path,flags,&fp); - - if (ret==0) -- fi->fh=(void *) fp; -+ fi->fh=(unsigned long) fp; - - return ret; - } -diff -up afpfs-ng-0.8.1/include/afpfs-ng/afp.h.pointer afpfs-ng-0.8.1/include/afp.h ---- afpfs-ng-0.8.1/include/afpfs-ng/afp.h.pointer 2008-03-08 17:08:18.000000000 +0100 -+++ afpfs-ng-0.8.1/include/afpfs-ng/afp.h 2011-06-14 17:02:15.000000000 +0200 -@@ -370,7 +370,7 @@ int afp_unmount_all_volumes(struct afp_s - - int afp_opendt(struct afp_volume *volume, unsigned short * refnum); - --int afp_closedt(struct afp_server * server, unsigned short * refnum); -+int afp_closedt(struct afp_server * server, unsigned short refnum); - - int afp_getcomment(struct afp_volume *volume, unsigned int did, - const char * pathname, struct afp_comment * comment); -diff -up afpfs-ng-0.8.1/include/afpfs-gn/utils.h.pointer afpfs-ng-0.8.1/include/utils.h ---- afpfs-ng-0.8.1/include/afpfs-ng/utils.h.pointer 2008-02-18 04:33:58.000000000 +0100 -+++ afpfs-ng-0.8.1/include/afpfs-ng/utils.h 2011-06-14 17:02:15.000000000 +0200 -@@ -8,8 +8,8 @@ - #define hton64(x) (x) - #define ntoh64(x) (x) - #else /* BYTE_ORDER == BIG_ENDIAN */ --#define hton64(x) ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \ -- (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32)) -+#define hton64(x) ((u_int64_t) (htonl((((unsigned long long)(x)) >> 32) & 0xffffffffLL)) | \ -+ (u_int64_t) ((htonl((unsigned long long)(x)) & 0xffffffffLL) << 32)) - #define ntoh64(x) (hton64(x)) - #endif /* BYTE_ORDER == BIG_ENDIAN */ - -diff -up afpfs-ng-0.8.1/lib/afp_url.c.pointer afpfs-ng-0.8.1/lib/afp_url.c ---- afpfs-ng-0.8.1/lib/afp_url.c.pointer 2008-03-04 21:16:49.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/afp_url.c 2011-06-14 17:02:15.000000000 +0200 -@@ -33,7 +33,7 @@ static int check_port(char * port) - static int check_uamname(const char * uam) - { - char * p; -- for (p=uam;*p;p++) { -+ for (p=(char *)uam;*p;p++) { - if (*p==' ') continue; - if ((*p<'A') || (*p>'z')) return -1; - } -@@ -188,7 +188,7 @@ int afp_parse_url(struct afp_url * url, - return -1; - - } -- if (p==NULL) p=toparse; -+ if (p==NULL) p=(char *)toparse; - - /* Now split on the first / */ - if (sscanf(p,"%[^/]/%[^$]", -diff -up afpfs-ng-0.8.1/lib/did.c.pointer afpfs-ng-0.8.1/lib/did.c ---- afpfs-ng-0.8.1/lib/did.c.pointer 2008-02-18 04:39:17.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/did.c 2011-06-14 17:02:15.000000000 +0200 -@@ -226,7 +226,7 @@ int get_dirid(struct afp_volume * volume - - - /* Go to the end of last known entry */ -- p=path+(p-copy); -+ p=(char *)path+(p-copy); - p2=p; - - while ((p=strchr(p+1,'/'))) { -diff -up afpfs-ng-0.8.1/lib/dsi.c.pointer afpfs-ng-0.8.1/lib/dsi.c ---- afpfs-ng-0.8.1/lib/dsi.c.pointer 2008-02-18 04:53:03.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/dsi.c 2011-06-14 17:02:15.000000000 +0200 -@@ -474,7 +474,7 @@ void dsi_getstatus_reply(struct afp_serv - } - server->flags=ntohs(reply1->flags); - -- p=(void *)((unsigned int) server->incoming_buffer + sizeof(*reply1)); -+ p=(void *)((unsigned long) server->incoming_buffer + sizeof(*reply1)); - p+=copy_from_pascal(server->server_name,p,AFP_SERVER_NAME_LEN)+1; - - /* Now work our way through the variable bits */ -@@ -757,7 +757,7 @@ gotenough: - printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read); - #endif - ret = read(server->fd, (void *) -- (((unsigned int) server->incoming_buffer)+server->data_read), -+ (((unsigned long) server->incoming_buffer)+server->data_read), - amount_to_read); - if (ret<0) return -1; - if (ret==0) { -diff -up afpfs-ng-0.8.1/lib/loop.c.pointer afpfs-ng-0.8.1/lib/loop.c ---- afpfs-ng-0.8.1/lib/loop.c.pointer 2008-02-18 04:40:11.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/loop.c 2011-06-14 17:02:15.000000000 +0200 -@@ -25,7 +25,7 @@ - static unsigned char exit_program=0; - - static pthread_t ending_thread; --static pthread_t main_thread = NULL; -+static pthread_t main_thread = (pthread_t)NULL; - - static int loop_started=0; - static pthread_cond_t loop_started_condition; -diff -up afpfs-ng-0.8.1/lib/lowlevel.c.pointer afpfs-ng-0.8.1/lib/lowlevel.c ---- afpfs-ng-0.8.1/lib/lowlevel.c.pointer 2008-02-20 02:33:17.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/lowlevel.c 2011-06-14 17:02:15.000000000 +0200 -@@ -582,7 +582,7 @@ int ll_getattr(struct afp_volume * volum - if (volume->server->using_version->av_number>=30) - stbuf->st_mode |= fp.unixprivs.permissions; - else -- set_nonunix_perms(stbuf,&fp); -+ set_nonunix_perms(&stbuf->st_mode,&fp); - - stbuf->st_uid=fp.unixprivs.uid; - stbuf->st_gid=fp.unixprivs.gid; -diff -up afpfs-ng-0.8.1/lib/midlevel.c.pointer afpfs-ng-0.8.1/lib/midlevel.c ---- afpfs-ng-0.8.1/lib/midlevel.c.pointer 2008-03-08 17:08:18.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/midlevel.c 2011-06-14 17:02:15.000000000 +0200 -@@ -713,7 +713,7 @@ int ml_write(struct afp_volume * volume, - { - - int ret,err=0; -- int totalwritten = 0; -+ size_t totalwritten = 0; - uint64_t sizetowrite, ignored; - unsigned char flags = 0; - unsigned int max_packet_size=volume->server->tx_quantum; -diff -up afpfs-ng-0.8.1/lib/proto_attr.c.pointer afpfs-ng-0.8.1/lib/proto_attr.c ---- afpfs-ng-0.8.1/lib/proto_attr.c.pointer 2008-01-30 05:37:58.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/proto_attr.c 2011-06-14 17:02:15.000000000 +0200 -@@ -166,7 +166,7 @@ int afp_getextattr(struct afp_volume * v - copy_path(server,p,pathname,strlen(pathname)); - unixpath_to_afppath(server,p); - p2=p+sizeof_path_header(server)+strlen(pathname); -- if (((unsigned int ) p2) & 0x1) p2++; -+ if (((unsigned long) p2) & 0x1) p2++; - req2=(void *) p2; - - req2->len=htons(namelen); -diff -up afpfs-ng-0.8.1/lib/proto_desktop.c.pointer afpfs-ng-0.8.1/lib/proto_desktop.c ---- afpfs-ng-0.8.1/lib/proto_desktop.c.pointer 2008-02-18 04:44:11.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/proto_desktop.c 2011-06-14 17:02:15.000000000 +0200 -@@ -168,7 +168,7 @@ int afp_getcomment_reply(struct afp_serv - return 0; - } - --int afp_closedt(struct afp_server * server, unsigned short * refnum) -+int afp_closedt(struct afp_server * server, unsigned short refnum) - { - struct { - struct dsi_header dsi_header __attribute__((__packed__)); -diff -up afpfs-ng-0.8.1/lib/proto_directory.c.pointer afpfs-ng-0.8.1/lib/proto_directory.c ---- afpfs-ng-0.8.1/lib/proto_directory.c.pointer 2008-02-19 03:39:29.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/proto_directory.c 2011-06-14 17:02:15.000000000 +0200 -@@ -248,6 +248,7 @@ int afp_enumerate_reply(struct afp_serve - - return 0; - } -+ - int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other) - { - -@@ -266,8 +267,7 @@ int afp_enumerateext2_reply(struct afp_s - char * p = buf + sizeof(*reply); - int i; - char *max=buf+size; -- struct afp_file_info * filebase = NULL, *filecur=NULL, *new_file=NULL; -- void ** x = other; -+ struct afp_file_info * filebase = NULL, *filecur = NULL, *new_file = NULL, **x = (struct afp_file_info **) other; - - if (reply->dsi_header.return_code.error_code) { - return reply->dsi_header.return_code.error_code; -diff -up afpfs-ng-0.8.1/lib/proto_map.c.pointer afpfs-ng-0.8.1/lib/proto_map.c ---- afpfs-ng-0.8.1/lib/proto_map.c.pointer 2008-01-30 05:37:59.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/proto_map.c 2011-06-14 17:02:15.000000000 +0200 -@@ -122,7 +122,7 @@ int afp_mapid_reply(struct afp_server *s - - if (reply->header.return_code.error_code!=kFPNoErr) return -1; - -- copy_from_pascal_two(name,&reply->name,255); -+ copy_from_pascal_two(name,reply->name,255); - - return 0; - } -diff -up afpfs-ng-0.8.1/lib/proto_session.c.pointer afpfs-ng-0.8.1/lib/proto_session.c ---- afpfs-ng-0.8.1/lib/proto_session.c.pointer 2008-02-18 04:46:19.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/proto_session.c 2011-06-14 17:02:15.000000000 +0200 -@@ -39,7 +39,7 @@ int afp_getsessiontoken(struct afp_serve - switch (type) { - case kLoginWithTimeAndID: - case kReconnWithTimeAndID: { -- uint32_t *p = (void *) (((unsigned int) request)+ -+ uint32_t *p = (void *) (((unsigned long) request)+ - sizeof(*request)); - - offset=sizeof(timestamp); -@@ -63,7 +63,7 @@ int afp_getsessiontoken(struct afp_serve - goto error; - } - -- data=(void *) (((unsigned int) request)+sizeof(*request)+offset); -+ data=(void *) (((unsigned long) request)+sizeof(*request)+offset); - request->idlength=htonl(datalen); - request->pad=0; - request->type=htons(type); -@@ -127,7 +127,7 @@ int afp_disconnectoldsession(struct afp_ - if ((request=malloc(sizeof(*request) + AFP_TOKEN_MAX_LEN))==NULL) - return -1; - -- token_data = request + sizeof(*request); -+ token_data = (char *)request + sizeof(*request); - - request->type=htons(type); - -diff -up afpfs-ng-0.8.1/lib/uams.c.pointer afpfs-ng-0.8.1/lib/uams.c ---- afpfs-ng-0.8.1/lib/uams.c.pointer 2008-01-04 04:52:44.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/uams.c 2011-06-14 17:02:15.000000000 +0200 -@@ -180,7 +180,7 @@ static int cleartxt_login(struct afp_ser - goto cleartxt_fail; - - p += copy_to_pascal(p, username) + 1; -- if ((int)p & 0x1) -+ if ((long)p & 0x1) - len--; - else - p++; -@@ -230,7 +230,7 @@ static int cleartxt_passwd(struct afp_se - goto cleartxt_fail; - - p += copy_to_pascal(p, username) + 1; -- if ((int)p & 0x1) -+ if ((long)p & 0x1) - len--; - else - p++; -@@ -580,7 +580,7 @@ static int dhx_login(struct afp_server * - if (ai == NULL) - goto dhx_noctx_fail; - d += copy_to_pascal(ai, username) + 1; -- if (((int)d) % 2) -+ if (((long)d) % 2) - d++; - else - ai_len--; -diff -up afpfs-ng-0.8.1/lib/utils.c.pointer afpfs-ng-0.8.1/lib/utils.c ---- afpfs-ng-0.8.1/lib/utils.c.pointer 2008-02-18 04:53:37.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/utils.c 2011-06-14 17:02:15.000000000 +0200 -@@ -196,7 +196,7 @@ int invalid_filename(struct afp_server * - maxlen=255; - - -- p=filename+1; -+ p=(char *)filename+1; - while ((q=strchr(p,'/'))) { - if (q>p+maxlen) - return 1; diff --git a/tools/depends/target/afpfs-ng/04-boxee1.patch b/tools/depends/target/afpfs-ng/04-boxee1.patch deleted file mode 100644 index 9f3c20f35e..0000000000 --- a/tools/depends/target/afpfs-ng/04-boxee1.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- afpfs-ng-0.8.1/include/afpfs-ng/dsi.h 2008-02-18 04:33:24.000000000 +0100 -+++ afpfs-ng-0.8.1/include/afpfs-ng/dsi.h 2011-08-26 21:33:33.000000000 +0200 -@@ -6,13 +6,15 @@ - - struct dsi_request - { -- unsigned short requestid; -- unsigned char subcommand; -- void * other; -- unsigned char wait; -- pthread_cond_t condition_cond; -- struct dsi_request * next; -- int return_code; -+ unsigned short requestid; -+ unsigned char subcommand; -+ void * other; -+ int wait; -+ int done_waiting; -+ pthread_cond_t waiting_cond; -+ pthread_mutex_t waiting_mutex; -+ struct dsi_request * next; -+ int return_code; - }; - - int dsi_receive(struct afp_server * server, void * data, int size); diff --git a/tools/depends/target/afpfs-ng/05-boxee2.patch b/tools/depends/target/afpfs-ng/05-boxee2.patch deleted file mode 100644 index 50250bc0af..0000000000 --- a/tools/depends/target/afpfs-ng/05-boxee2.patch +++ /dev/null @@ -1,89 +0,0 @@ ---- afpfs-ng-0.8.1/lib/afp.c 2008-03-08 03:44:16.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/afp.c 2011-08-26 21:33:33.000000000 +0200 -@@ -68,7 +68,7 @@ - afp_getsessiontoken_reply,afp_blank_reply, NULL, NULL, - afp_enumerateext2_reply, NULL, NULL, NULL, /*64 - 71 */ - afp_listextattrs_reply, NULL, NULL, NULL, -- afp_blank_reply, NULL, NULL, NULL, /*72 - 79 */ -+ afp_blank_reply, NULL, afp_blank_reply, afp_blank_reply, /*72 - 79 */ - - NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, -@@ -320,8 +320,16 @@ - - struct dsi_request * p; - struct afp_server *s2; -+ -+ -+ if (s==NULL) -+ goto out; -+ - for (p=s->command_requests;p;p=p->next) { -- pthread_cond_signal(&p->condition_cond); -+ pthread_mutex_lock(&p->waiting_mutex); -+ p->done_waiting=1; -+ pthread_cond_signal(&p->waiting_cond); -+ pthread_mutex_unlock(&p->waiting_mutex); - } - - if (s==server_base) { -@@ -354,7 +362,7 @@ - s->exit_flag = 0; - s->path_encoding=kFPUTF8Name; /* This is a default */ - s->next=NULL; -- s->bufsize=2048; -+ s->bufsize=4096; - s->incoming_buffer=malloc(s->bufsize); - - s->attention_quantum=AFP_DEFAULT_ATTENTION_QUANTUM; -@@ -524,13 +532,14 @@ - kFPVolCreateDateBit|kFPVolIDBit | - kFPVolNameBit; - char new_encoding; -+ int ret; - - if (server->using_version->av_number>=30) - bitmap|= kFPVolNameBit|kFPVolBlockSizeBit; - -- switch (afp_volopen(volume,bitmap, -- (strlen(volume->volpassword)>0) ? volume->volpassword : NULL)) -- { -+ ret = afp_volopen(volume,bitmap, -+ (strlen(volume->volpassword)>0) ? volume->volpassword : NULL); -+ switch(ret){ - case kFPAccessDenied: - *l+=snprintf(mesg,max-*l, - "Incorrect volume password\n"); -@@ -544,6 +553,10 @@ - *l+=snprintf(mesg,max-*l, - "Could not open volume\n"); - goto error; -+ case ETIMEDOUT: -+ *l+=snprintf(mesg,max-*l, -+ "Timed out waiting to open volume\n"); -+ goto error; - } - - /* It is said that if a volume's encoding will be the same -@@ -641,7 +654,6 @@ - add_server(server); - - add_fd_and_signal(server->fd); -- - if (!full) { - return 0; - } -@@ -649,10 +661,13 @@ - /* Get the status, and calculate the transmit time. We use this to - * calculate our rx quantum. */ - gettimeofday(&t1,NULL); -+ - if ((error=dsi_getstatus(server))!=0) - goto error; - gettimeofday(&t2,NULL); - -+ afp_server_identify(server); -+ - if ((t2.tv_sec - t1.tv_sec) > 0) - server->tx_delay= (t2.tv_sec - t1.tv_sec) * 1000; - else diff --git a/tools/depends/target/afpfs-ng/06-boxee3.patch b/tools/depends/target/afpfs-ng/06-boxee3.patch deleted file mode 100644 index 4b7c916da3..0000000000 --- a/tools/depends/target/afpfs-ng/06-boxee3.patch +++ /dev/null @@ -1,141 +0,0 @@ ---- afpfs-ng-0.8.1/lib/dsi.c 2011-08-26 17:27:16.000000000 +0200 -+++ afpfs-ng-0.8.1/lib/dsi.c 2011-08-26 21:33:33.000000000 +0200 -@@ -64,7 +64,7 @@ - rx.size=0; - dsi_setup_header(server,&header,DSI_DSIGetStatus); - /* We're intentionally ignoring the results */ -- ret=dsi_send(server,(char *) &header,sizeof(struct dsi_header),20, -+ ret=dsi_send(server,(char *) &header,sizeof(struct dsi_header),60, - 0,(void *) &rx); - - free(rx.data); -@@ -197,6 +197,7 @@ - new_request->other=other; - new_request->wait=wait; - new_request->next=NULL; -+ new_request->done_waiting=0; - - pthread_mutex_lock(&server->request_queue_mutex); - if (server->command_requests==NULL) { -@@ -208,7 +209,8 @@ - server->stats.requests_pending++; - pthread_mutex_unlock(&server->request_queue_mutex); - -- pthread_cond_init(&new_request->condition_cond,NULL); -+ pthread_cond_init(&new_request->waiting_cond,NULL); -+ pthread_mutex_init(&new_request->waiting_mutex,NULL); - - if (server->connect_state==SERVER_STATE_DISCONNECTED) { - char mesg[1024]; -@@ -240,16 +242,12 @@ - server->stats.tx_bytes+=size; - pthread_mutex_unlock(&server->send_mutex); - -- int tmpwait=new_request->wait; - #ifdef DEBUG_DSI - printf("=== Waiting for response for %d %s\n", - new_request->requestid, - afp_get_command_name(new_request->subcommand)); - #endif -- if (tmpwait<0) { -- -- pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -- pthread_mutex_lock(&mutex); -+ if (new_request->wait<0) { - - /* Wait forever */ - #ifdef DEBUG_DSI -@@ -258,14 +256,17 @@ - afp_get_command_name(new_request->subcommand)); - #endif - -- rc=pthread_cond_wait( -- &new_request->condition_cond, -- &mutex ); -- pthread_mutex_unlock(&mutex); -- -- } else if (tmpwait>0) { -- pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -- pthread_mutex_lock(&mutex); -+ pthread_mutex_lock(&new_request->waiting_mutex); -+ -+ if (new_request->done_waiting==0) -+ rc=pthread_cond_wait( -+ &new_request->waiting_cond, -+ &new_request->waiting_mutex ); -+ -+ pthread_mutex_unlock(&new_request->waiting_mutex); -+ -+ } else if (new_request->wait>0) { -+ /* wait for new_request->wait seconds */ - - #ifdef DEBUG_DSI - printf("=== Waiting for %d %s, for %ds\n", -@@ -283,13 +284,15 @@ - printf("=== Changing my mind, no longer waiting for %d\n", - new_request->requestid); - #endif -- pthread_mutex_unlock(&mutex); - goto skip; - } -- rc=pthread_cond_timedwait( -- &new_request->condition_cond, -- &mutex,&ts); -- pthread_mutex_unlock(&mutex); -+ pthread_mutex_lock(&new_request->waiting_mutex); -+ if (new_request->done_waiting==0) -+ rc=pthread_cond_timedwait( -+ &new_request->waiting_cond, -+ &new_request->waiting_mutex,&ts); -+ pthread_mutex_unlock(&new_request->waiting_mutex); -+ - if (rc==ETIMEDOUT) { - /* FIXME: should handle this case properly */ - #ifdef DEBUG_DSI -@@ -299,6 +302,7 @@ - goto out; - } - } else { -+ /* Don't wait */ - #ifdef DEBUG_DSI - printf("=== Skipping wait altogether for %d\n",new_request->requestid); - #endif -@@ -474,7 +478,7 @@ - } - server->flags=ntohs(reply1->flags); - -- p=(void *)((unsigned long) server->incoming_buffer + sizeof(*reply1)); -+ p=(void *)((unsigned int) server->incoming_buffer + sizeof(*reply1)); - p+=copy_from_pascal(server->server_name,p,AFP_SERVER_NAME_LEN)+1; - - /* Now work our way through the variable bits */ -@@ -577,6 +581,7 @@ - unsigned char mins=0; - unsigned char checkmessage=0; - -+ memset(mesg,0,AFP_LOGINMESG_LEN); - - /* The logic here's undocumented. If we get an attention packet and - there's no flag, then go check the message. Also, go check the -@@ -757,7 +762,7 @@ - printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read); - #endif - ret = read(server->fd, (void *) -- (((unsigned long) server->incoming_buffer)+server->data_read), -+ (((unsigned int) server->incoming_buffer)+server->data_read), - amount_to_read); - if (ret<0) return -1; - if (ret==0) { -@@ -862,8 +867,11 @@ - #ifdef DEBUG_DSI - printf("<<< Signalling %d, returning %d or %d\n",request->requestid,request->return_code,rc); - #endif -+ pthread_mutex_lock(&request->waiting_mutex); - request->wait=0; -- pthread_cond_signal(&request->condition_cond); -+ request->done_waiting=1; -+ pthread_cond_signal(&request->waiting_cond); -+ pthread_mutex_unlock(&request->waiting_mutex); - } else { - dsi_remove_from_request_queue(server,request); - } diff --git a/tools/depends/target/afpfs-ng/07-boxee4.patch b/tools/depends/target/afpfs-ng/07-boxee4.patch deleted file mode 100644 index 3e09f40dc5..0000000000 --- a/tools/depends/target/afpfs-ng/07-boxee4.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- afpfs-ng-0.8.1/lib/identify.c 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/identify.c 2011-08-26 21:33:33.000000000 +0200 -@@ -0,0 +1,24 @@ -+#include <string.h> -+#include <afpfs-ng/afp.h> -+ -+ -+/* -+ * afp_server_identify() -+ * -+ * Identifies a server -+ * -+ * Right now, this only does identification using the machine_type -+ * given in getsrvrinfo, but this could later use mDNS to get -+ * more details. -+ */ -+void afp_server_identify(struct afp_server * s) -+{ -+ if (strcmp(s->machine_type,"Netatalk")==0) -+ s->server_type=AFPFS_SERVER_TYPE_NETATALK; -+ else if (strcmp(s->machine_type,"AirPort")==0) -+ s->server_type=AFPFS_SERVER_TYPE_AIRPORT; -+ else if (strcmp(s->machine_type,"Macintosh")==0) -+ s->server_type=AFPFS_SERVER_TYPE_MACINTOSH; -+ else -+ s->server_type=AFPFS_SERVER_TYPE_UNKNOWN; -+} diff --git a/tools/depends/target/afpfs-ng/08-boxee5.patch b/tools/depends/target/afpfs-ng/08-boxee5.patch deleted file mode 100644 index 253fb05c97..0000000000 --- a/tools/depends/target/afpfs-ng/08-boxee5.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- afpfs-ng-0.8.1/lib/Makefile.am 2008-02-18 04:34:32.000000000 +0100 -+++ afpfs-ng-0.8.1/lib/Makefile.am 2011-08-26 21:33:33.000000000 +0200 -@@ -4,7 +4,7 @@ - - lib_LTLIBRARIES = libafpclient.la - --libafpclient_la_SOURCES = afp.c codepage.c did.c dsi.c map_def.c uams.c uams_def.c unicode.c users.c utils.c resource.c log.c client.c server.c connect.c loop.c midlevel.c proto_attr.c proto_desktop.c proto_directory.c proto_files.c proto_fork.c proto_login.c proto_map.c proto_replyblock.c proto_server.c proto_volume.c proto_session.c afp_url.c status.c forklist.c debug.c lowlevel.c -+libafpclient_la_SOURCES = afp.c codepage.c did.c dsi.c map_def.c uams.c uams_def.c unicode.c users.c utils.c resource.c log.c client.c server.c connect.c loop.c midlevel.c proto_attr.c proto_desktop.c proto_directory.c proto_files.c proto_fork.c proto_login.c proto_map.c proto_replyblock.c proto_server.c proto_volume.c proto_session.c afp_url.c status.c forklist.c debug.c lowlevel.c identify.c - - # libafpclient_la_LDFLAGS = -module -avoid-version - diff --git a/tools/depends/target/afpfs-ng/10-fix-errno.patch b/tools/depends/target/afpfs-ng/10-fix-errno.patch deleted file mode 100644 index ff7ce44bdb..0000000000 --- a/tools/depends/target/afpfs-ng/10-fix-errno.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- afpfs-ng-0.8.1/lib/afp.c 2011-09-04 19:42:42.000000000 +0200 -+++ afpfs-ng-0.8.1/lib/afp.c 2011-09-04 19:39:44.000000000 +0200 -@@ -19,7 +19,6 @@ - #include <sys/time.h> - #include <sys/types.h> - #include <sys/socket.h> --#include <errno.h> - - #include <afpfs-ng/afp_protocol.h> - #include <afpfs-ng/libafpclient.h> ---- afpfs-ng-0.8.1/lib/afp_url.c 2011-09-04 19:42:42.000000000 +0200 -+++ afpfs-ng-0.8.1/lib/afp_url.c 2011-09-04 19:40:27.000000000 +0200 -@@ -21,7 +21,9 @@ - - static int check_port(char * port) - { -- long long ret = strtol(port,NULL,10); -+ long long ret = 0; -+ errno = 0; -+ ret = strtol(port,NULL,10); - if ((ret<0) || (ret>32767)) return -1; - if (errno) { - printf("port error\n"); diff --git a/tools/depends/target/afpfs-ng/11-fix-stat.patch b/tools/depends/target/afpfs-ng/11-fix-stat.patch deleted file mode 100644 index 09e9a35231..0000000000 --- a/tools/depends/target/afpfs-ng/11-fix-stat.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- afpfs-ng-0.8.1/lib/lowlevel.c 2011-10-01 20:36:55.000000000 +0200 -+++ afpfs-ng-0.8.1/lib/lowlevel.c 2011-10-01 20:46:00.000000000 +0200 -@@ -579,7 +579,7 @@ - return -EIO; - } - -- if (volume->server->using_version->av_number>=30) -+ if (volume->server->using_version->av_number>=30 && fp.unixprivs.permissions != 0) - stbuf->st_mode |= fp.unixprivs.permissions; - else - set_nonunix_perms(&stbuf->st_mode,&fp); diff --git a/tools/depends/target/afpfs-ng/Makefile b/tools/depends/target/afpfs-ng/Makefile deleted file mode 100644 index 1b6a664d98..0000000000 --- a/tools/depends/target/afpfs-ng/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -include ../../Makefile.include -DEPS= ../../Makefile.include 01-gcrypt.patch 02-pointer.patch 04-boxee1.patch \ - 05-boxee2.patch 06-boxee3.patch 07-boxee4.patch \ - 08-boxee5.patch 10-fix-errno.patch 11-fix-stat.patch \ - android.patch fix_afpfs-ng_includes.patch Makefile - -# lib name, version -LIBNAME=afpfs-ng -VERSION=0.8.1 -SOURCE=$(LIBNAME)-$(VERSION) -ARCHIVE=$(SOURCE).tar.bz2 - -# configuration settings -export LIBS+=$(LINK_ICONV) - -CONFIGURE=./configure --prefix=$(PREFIX) \ - --disable-fuse - -LIBDYLIB=$(PLATFORM)/lib/.libs/libafpclient.a - -all: .installed-$(PLATFORM) - -$(TARBALLS_LOCATION)/$(ARCHIVE): - cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) - -$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM) - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); patch -p1 <../fix_afpfs-ng_includes.patch - cd $(PLATFORM); patch -p1 <../01-gcrypt.patch - cd $(PLATFORM); patch -p1 <../02-pointer.patch - cd $(PLATFORM); patch -p1 <../04-boxee1.patch - cd $(PLATFORM); patch -p1 <../05-boxee2.patch - cd $(PLATFORM); patch -p1 <../06-boxee3.patch - cd $(PLATFORM); patch -p1 <../07-boxee4.patch - cd $(PLATFORM); patch -p1 <../08-boxee5.patch - cd $(PLATFORM); patch -p1 <../10-fix-errno.patch - cd $(PLATFORM); patch -p1 <../11-fix-stat.patch - cd $(PLATFORM); patch -p0 < ../android.patch - cd $(PLATFORM); $(AUTORECONF) -vif - cd $(PLATFORM); $(CONFIGURE) - -$(LIBDYLIB): $(PLATFORM) - $(MAKE) -j 1 -C $(PLATFORM)/lib - -.installed-$(PLATFORM): $(LIBDYLIB) - $(MAKE) -C $(PLATFORM)/lib install - $(MAKE) -C $(PLATFORM)/include install -ifeq ($(OS),android) - rm -f $(PREFIX)/lib/libafpclient.la $(PREFIX)/lib/libafpclient.so $(PREFIX)/lib/libafpclient.so.0 - mv -f $(PREFIX)/lib/libafpclient.so.0.0.0 $(PREFIX)/lib/libafpclient.so - $(RPL) -e "libafpclient.so.0" "libafpclient.so\x00\x00" $(PREFIX)/lib/libafpclient.so - -$(READELF) --dynamic $(PREFIX)/lib/libafpclient.so | grep ibrary -endif - touch $@ - -clean: - $(MAKE) -C $(PLATFORM) clean - rm -f .installed-$(PLATFORM) - -distclean:: - rm -rf $(PLATFORM) .installed-$(PLATFORM) diff --git a/tools/depends/target/afpfs-ng/android.patch b/tools/depends/target/afpfs-ng/android.patch deleted file mode 100644 index 85dcfce4d6..0000000000 --- a/tools/depends/target/afpfs-ng/android.patch +++ /dev/null @@ -1,70 +0,0 @@ ---- include/afpfs-ng/afp.h 2012-06-03 22:47:49.014348648 -0400 -+++ include/afpfs-ng/afp.h 2012-06-03 22:46:28.924348698 -0400 -@@ -5,7 +5,13 @@ - #include <arpa/inet.h> - #include <pthread.h> - #include <netdb.h> -+#ifndef ANDROID - #include <sys/statvfs.h> -+#else -+#include <sys/vfs.h> -+#define statvfs statfs -+#define fstatvfs fstatfs -+#endif - #include <pwd.h> - #include <afpfs-ng/afp_protocol.h> - #include <afpfs-ng/libafpclient.h> ---- lib/midlevel.c 2012-06-03 22:47:49.014348648 -0400 -+++ lib/midlevel.c 2012-06-03 22:46:28.924348698 -0400 -@@ -1388,10 +1388,12 @@ - stat->f_frsize=0; - stat->f_files=0; - stat->f_ffree=0; -+#ifndef ANDROID - stat->f_favail=0; - stat->f_fsid=0; - stat->f_flag=0; - stat->f_namemax=255; -+#endif - return 0; - - } ---- lib/lowlevel.c 2012-06-03 22:47:49.054348648 -0400 -+++ lib/lowlevel.c 2012-06-03 22:46:28.914348698 -0400 -@@ -612,7 +612,7 @@ - modification_date=fp.modification_date; - } - --#ifdef __linux__ -+#if defined(__linux__) && !defined(ANDROID) - stbuf->st_ctim.tv_sec=creation_date; - stbuf->st_mtim.tv_sec=modification_date; - #else ---- lib/dsi.c 2012-06-03 23:24:15.454347269 -0400 -+++ lib/dsi.c 2012-06-03 23:25:01.634347240 -0400 -@@ -610,7 +610,11 @@ - afp_getsrvrmsg(server,AFPMESG_SERVER, - ((server->using_version->av_number>=30)?1:0), - DSI_DEFAULT_TIMEOUT,mesg); -+#if defined(ANDROID) -+ if(memcmp(mesg,"The server is going down for maintenance.",41)==0) -+#else - if(bcmp(mesg,"The server is going down for maintenance.",41)==0) -+#endif - shutdown=1; - } - ---- lib/afp.c 2012-06-03 23:24:15.474347269 -0400 -+++ lib/afp.c 2012-06-03 23:25:12.464347233 -0400 -@@ -205,7 +205,11 @@ - { - struct afp_server *s; - for (s=server_base;s;s=s->next) { -+#if defined(ANDROID) -+ if (memcmp(&s->address,address,sizeof(struct sockaddr_in))==0) -+#else - if (bcmp(&s->address,address,sizeof(struct sockaddr_in))==0) -+#endif - return s; - } - return NULL; diff --git a/tools/depends/target/afpfs-ng/fix_afpfs-ng_includes.patch b/tools/depends/target/afpfs-ng/fix_afpfs-ng_includes.patch deleted file mode 100644 index 08c6f024c2..0000000000 --- a/tools/depends/target/afpfs-ng/fix_afpfs-ng_includes.patch +++ /dev/null @@ -1,3092 +0,0 @@ -diff -Naur afpfs-ng-0.8.1/cmdline/cmdline_afp.c afpfs-ng-0.8.1.patch/cmdline/cmdline_afp.c ---- afpfs-ng-0.8.1/cmdline/cmdline_afp.c 2008-02-19 02:54:19.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/cmdline/cmdline_afp.c 2011-09-10 12:13:50.102124369 +0200 -@@ -3,9 +3,9 @@ - - */ - --#include "afp.h" --#include "midlevel.h" --#include "map_def.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/midlevel.h" -+#include "afpfs-ng/map_def.h" - - #include <string.h> - #include <stdio.h> -diff -Naur afpfs-ng-0.8.1/cmdline/cmdline_testafp.c afpfs-ng-0.8.1.patch/cmdline/cmdline_testafp.c ---- afpfs-ng-0.8.1/cmdline/cmdline_testafp.c 2008-03-04 21:16:50.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/cmdline/cmdline_testafp.c 2011-09-10 12:13:50.102124369 +0200 -@@ -3,8 +3,8 @@ - - */ - --#include "afp.h" --#include "midlevel.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/midlevel.h" - - #include "cmdline_main.h" - -diff -Naur afpfs-ng-0.8.1/cmdline/getstatus.c afpfs-ng-0.8.1.patch/cmdline/getstatus.c ---- afpfs-ng-0.8.1/cmdline/getstatus.c 2008-02-18 04:28:09.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/cmdline/getstatus.c 2011-09-10 12:13:50.109124463 +0200 -@@ -2,7 +2,7 @@ - #include <string.h> - #include <pthread.h> - --#include "afp.h" -+#include "afpfs-ng/afp.h" - - static int getstatus(char * address_string, unsigned int port) - { -diff -Naur afpfs-ng-0.8.1/configure.ac afpfs-ng-0.8.1.patch/configure.ac ---- afpfs-ng-0.8.1/configure.ac 2008-03-08 17:23:12.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/configure.ac 2011-09-10 12:13:50.109124463 +0200 -@@ -11,6 +11,7 @@ - AC_PROG_CC - AC_PROG_INSTALL - AC_PROG_LIBTOOL -+AM_PROG_CC_C_O - - # Checks for libraries. - # FIXME: Replace `main' with a function in `-lncurses': -@@ -105,7 +106,7 @@ - - - --AC_CONFIG_FILES([lib/Makefile fuse/Makefile cmdline/Makefile Makefile docs/Makefile]) -+AC_CONFIG_FILES([lib/Makefile fuse/Makefile cmdline/Makefile Makefile include/Makefile include/afpfs-ng/Makefile docs/Makefile]) - - AC_OUTPUT - -diff -Naur afpfs-ng-0.8.1/fuse/client.c afpfs-ng-0.8.1.patch/fuse/client.c ---- afpfs-ng-0.8.1/fuse/client.c 2008-03-08 03:44:16.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/fuse/client.c 2011-09-10 12:13:50.110124477 +0200 -@@ -12,11 +12,11 @@ - #include <grp.h> - - #include "config.h" --#include <afp.h> -+#include <afpfs-ng/afp.h> - #include "afp_server.h" --#include "uams_def.h" --#include "map_def.h" --#include "libafpclient.h" -+#include "afpfs-ng/uams_def.h" -+#include "afpfs-ng/map_def.h" -+#include "afpfs-ng/libafpclient.h" - - #define default_uam "Cleartxt Passwrd" - -diff -Naur afpfs-ng-0.8.1/fuse/commands.c afpfs-ng-0.8.1.patch/fuse/commands.c ---- afpfs-ng-0.8.1/fuse/commands.c 2008-03-08 17:06:25.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/fuse/commands.c 2011-09-10 12:13:50.110124477 +0200 -@@ -19,15 +19,15 @@ - #include <getopt.h> - #include <signal.h> - --#include "afp.h" --#include "dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/dsi.h" - #include "afp_server.h" --#include "utils.h" -+#include "afpfs-ng/utils.h" - #include "daemon.h" --#include "uams_def.h" --#include "codepage.h" --#include "libafpclient.h" --#include "map_def.h" -+#include "afpfs-ng/uams_def.h" -+#include "afpfs-ng/codepage.h" -+#include "afpfs-ng/libafpclient.h" -+#include "afpfs-ng/map_def.h" - #include "fuse_int.h" - #include "fuse_error.h" - #include "fuse_internal.h" -diff -Naur afpfs-ng-0.8.1/fuse/daemon.c afpfs-ng-0.8.1.patch/fuse/daemon.c ---- afpfs-ng-0.8.1/fuse/daemon.c 2008-03-04 18:26:05.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/fuse/daemon.c 2011-09-10 12:13:50.110124477 +0200 -@@ -23,11 +23,11 @@ - #include <signal.h> - #include <sys/socket.h> - --#include "afp.h" -+#include "afpfs-ng/afp.h" - --#include "dsi.h" -+#include "afpfs-ng/dsi.h" - #include "afp_server.h" --#include "utils.h" -+#include "afpfs-ng/utils.h" - #include "daemon.h" - #include "commands.h" - -diff -Naur afpfs-ng-0.8.1/fuse/fuse_error.c afpfs-ng-0.8.1.patch/fuse/fuse_error.c ---- afpfs-ng-0.8.1/fuse/fuse_error.c 2008-01-18 05:40:10.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/fuse/fuse_error.c 2011-09-10 12:13:50.111124491 +0200 -@@ -4,7 +4,7 @@ - #include <unistd.h> - #include <string.h> - #include <stdio.h> --#include "libafpclient.h" -+#include "afpfs-ng/libafpclient.h" - #include "fuse_internal.h" - - #define TMP_FILE "/tmp/fuse_stderr" -diff -Naur afpfs-ng-0.8.1/fuse/fuse_int.c afpfs-ng-0.8.1.patch/fuse/fuse_int.c ---- afpfs-ng-0.8.1/fuse/fuse_int.c 2008-03-02 06:06:24.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/fuse/fuse_int.c 2011-09-10 12:13:50.111124491 +0200 -@@ -18,7 +18,7 @@ - #define FUSE_USE_VERSION 25 - - --#include "afp.h" -+#include "afpfs-ng/afp.h" - - #include <fuse.h> - #include <stdio.h> -@@ -39,10 +39,10 @@ - #include <pwd.h> - #include <stdarg.h> - --#include "dsi.h" --#include "afp_protocol.h" --#include "codepage.h" --#include "midlevel.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp_protocol.h" -+#include "afpfs-ng/codepage.h" -+#include "afpfs-ng/midlevel.h" - #include "fuse_error.h" - - /* Uncomment the following line to enable full debugging: */ -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/afp.h afpfs-ng-0.8.1.patch/include/afpfs-ng/afp.h ---- afpfs-ng-0.8.1/include/afpfs-ng/afp.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/afp.h 2011-09-10 12:13:50.112124505 +0200 -@@ -0,0 +1,533 @@ -+ -+#ifndef _AFP_H_ -+#define _AFP_H_ -+ -+#include <arpa/inet.h> -+#include <pthread.h> -+#include <netdb.h> -+#include <sys/statvfs.h> -+#include <pwd.h> -+#include <afpfs-ng/afp_protocol.h> -+#include <afpfs-ng/libafpclient.h> -+#include <sys/types.h> -+#include <sys/stat.h> -+#include <unistd.h> -+#include <netinet/in.h> -+ -+ -+#define AFPFS_VERSION "0.8.1" -+ -+/* This is the maximum AFP version this library supports */ -+#define AFP_MAX_SUPPORTED_VERSION 32 -+ -+/* afp_url is used to pass locations around */ -+struct afp_url { -+ enum {TCPIP,AT} protocol; -+ char username[AFP_MAX_USERNAME_LEN]; -+ char uamname[50]; -+ char password[AFP_MAX_PASSWORD_LEN]; -+ char servername[AFP_SERVER_NAME_UTF8_LEN]; -+ int port; -+ char volumename[AFP_VOLUME_NAME_UTF8_LEN]; -+ char path[AFP_MAX_PATH]; -+ -+ int requested_version; -+ char zone[AFP_ZONE_LEN]; /* Only used for Appletalk */ -+ char volpassword[9];; -+}; -+ -+struct afp_token { -+ unsigned int length; -+ char data[AFP_TOKEN_MAX_LEN]; -+}; -+ -+#define SERVER_MAX_VERSIONS 10 -+#define SERVER_MAX_UAMS 10 -+ -+struct afp_rx_buffer { -+ unsigned int size; -+ unsigned int maxsize; -+ char * data; -+ int errorcode; -+}; -+ -+ -+struct afp_file_info { -+ unsigned short attributes; -+ unsigned int did; -+ unsigned int creation_date; -+ unsigned int modification_date; -+ unsigned int backup_date; -+ unsigned int fileid; -+ unsigned short offspring; -+ char sync; -+ char finderinfo[32]; -+ char name[AFP_MAX_PATH]; -+ char basename[AFP_MAX_PATH]; -+ char translated_name[AFP_MAX_PATH]; -+ struct afp_unixprivs unixprivs; -+ unsigned int accessrights; -+ struct afp_file_info * next; -+ struct afp_file_info * largelist_next; -+ unsigned char isdir; -+ unsigned long long size; -+ unsigned short resourcesize; -+ unsigned int resource; -+ unsigned short forkid; -+ struct afp_icon * icon; -+ int eof; -+}; -+ -+ -+#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_KNOWN 0x1 -+#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_BROKEN 0x2 -+#define VOLUME_EXTRA_FLAGS_SHOW_APPLEDOUBLE 0x4 -+#define VOLUME_EXTRA_FLAGS_VOL_SUPPORTS_UNIX 0x8 -+#define VOLUME_EXTRA_FLAGS_NO_LOCKING 0x10 -+#define VOLUME_EXTRA_FLAGS_IGNORE_UNIXPRIVS 0x20 -+#define VOLUME_EXTRA_FLAGS_READONLY 0x40 -+ -+#define AFP_VOLUME_UNMOUNTED 0 -+#define AFP_VOLUME_MOUNTED 1 -+#define AFP_VOLUME_UNMOUNTING 2 -+ -+struct afp_volume { -+ unsigned short volid; -+ char flags; /* This is from afpGetSrvrParms */ -+ unsigned short attributes; /* This is from VolOpen */ -+ unsigned short signature; /* This is fixed or variable */ -+ unsigned int creation_date; -+ unsigned int modification_date; -+ unsigned int backup_date; -+ struct statvfs stat; -+ unsigned char mounted; -+ char mountpoint[255]; -+ struct afp_server * server; -+ char volume_name[AFP_VOLUME_NAME_LEN]; -+ char volume_name_printable[AFP_VOLUME_NAME_UTF8_LEN]; -+ unsigned short dtrefnum; -+ char volpassword[AFP_VOLPASS_LEN]; -+ unsigned int extra_flags; /* This is an afpfs-ng specific field */ -+ -+ /* Our directory ID cache */ -+ struct did_cache_entry * did_cache_base; -+ pthread_mutex_t did_cache_mutex; -+ -+ /* Our journal of open forks */ -+ struct afp_file_info * open_forks; -+ pthread_mutex_t open_forks_mutex; -+ -+ /* Used to trigger startup */ -+ pthread_cond_t startup_condition_cond; -+ -+ struct { -+ uint64_t hits; -+ uint64_t misses; -+ uint64_t expired; -+ uint64_t force_removed; -+ } did_cache_stats; -+ -+ void * priv; /* This is a private structure for fuse/cmdline, etc */ -+ pthread_t thread; /* This is the per-volume thread */ -+ -+ int mapping; -+ -+}; -+ -+#define SERVER_STATE_CONNECTED 1 -+#define SERVER_STATE_DISCONNECTED 2 -+ -+enum server_type{ -+ AFPFS_SERVER_TYPE_UNKNOWN, -+ AFPFS_SERVER_TYPE_NETATALK, -+ AFPFS_SERVER_TYPE_AIRPORT, -+ AFPFS_SERVER_TYPE_MACINTOSH, -+}; -+ -+#define is_netatalk(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_NETATALK ) -+#define is_airport(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_AIRPORT ) -+#define is_macintosh(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_MACINTOSH ) -+ -+ -+ -+struct afp_versions { -+ char *av_name; -+ int av_number; -+}; -+extern struct afp_versions afp_versions[]; -+ -+struct afp_server { -+ -+ /* Our buffer sizes */ -+ unsigned int tx_quantum; -+ unsigned int rx_quantum; -+ -+ unsigned int tx_delay; -+ -+ /* Connection information */ -+ struct sockaddr_in address; -+ int fd; -+ -+ /* Some stats, for information only */ -+ struct { -+ uint64_t runt_packets; -+ uint64_t incoming_dsi; -+ uint64_t rx_bytes; -+ uint64_t tx_bytes; -+ uint64_t requests_pending; -+ } stats; -+ -+ /* General information */ -+ char server_name[AFP_SERVER_NAME_LEN]; -+ char server_name_utf8[AFP_SERVER_NAME_UTF8_LEN]; -+ char server_name_printable[AFP_SERVER_NAME_UTF8_LEN]; -+ -+ char machine_type[17]; -+ char icon[256]; -+ char signature[16]; -+ unsigned short flags; -+ int connect_state; -+ enum server_type server_type; -+ -+ /* This is the time we connected */ -+ time_t connect_time; -+ -+ /* UAMs */ -+ unsigned int supported_uams; -+ unsigned int using_uam; -+ -+ /* Authentication */ -+ char username[AFP_MAX_USERNAME_LEN]; -+ char password[AFP_MAX_PASSWORD_LEN]; -+ -+ /* Session */ -+ struct afp_token token; -+ char need_resume; -+ -+ /* Versions */ -+ unsigned char requested_version; -+ unsigned char versions[SERVER_MAX_VERSIONS]; -+ struct afp_versions *using_version; -+ -+ /* Volumes */ -+ unsigned char num_volumes; -+ struct afp_volume * volumes; -+ -+ void * dsi; -+ unsigned int exit_flag; -+ -+ /* Our DSI request queue */ -+ pthread_mutex_t requestid_mutex; -+ pthread_mutex_t request_queue_mutex; -+ unsigned short lastrequestid; -+ unsigned short expectedrequestid; -+ struct dsi_request * command_requests; -+ -+ -+ char loginmesg[200]; -+ char servermesg[200]; -+ char path_encoding; -+ -+ /* This is the data for the incoming buffer */ -+ char * incoming_buffer; -+ int data_read; -+ int bufsize; -+ -+ /* And this is for the outgoing queue */ -+ pthread_mutex_t send_mutex; -+ -+ /* This is for user mapping */ -+ struct passwd passwd; -+ unsigned int server_uid, server_gid; -+ int server_gid_valid; -+ -+ struct afp_server *next; -+ -+ /* These are for DSI attention packets */ -+ unsigned int attention_quantum; -+ unsigned int attention_len; -+ char * attention_buffer; -+ -+}; -+ -+struct afp_extattr_info { -+ unsigned int maxsize; -+ unsigned int size; -+ char data[1024]; -+}; -+struct afp_comment { -+ unsigned int maxsize; -+ unsigned int size; -+ char *data; -+}; -+ -+struct afp_icon { -+ unsigned int maxsize; -+ unsigned int size; -+ char *data; -+}; -+ -+#define AFP_DEFAULT_ATTENTION_QUANTUM 1024 -+ -+void afp_unixpriv_to_stat(struct afp_file_info *fp, -+ struct stat *stat); -+ -+int init_uams(void) ; -+ -+unsigned int find_uam_by_name(const char * name); -+char * uam_bitmap_to_string(unsigned int bitmap); -+ -+ -+char * get_uam_names_list(void); -+ -+unsigned int default_uams_mask(void); -+ -+struct afp_volume * find_volume_by_name(struct afp_server * server, -+ const char * volname); -+ -+struct afp_connection_request { -+ unsigned int uam_mask; -+ struct afp_url url; -+}; -+ -+void afp_default_url(struct afp_url *url); -+int afp_parse_url(struct afp_url * url, const char * toparse, int verbose); -+void afp_print_url(struct afp_url * url); -+int afp_url_validate(char * url_string, struct afp_url * valid_url); -+ -+int afp_list_volnames(struct afp_server * server, char * names, int max); -+ -+/* User mapping */ -+int afp_detect_mapping(struct afp_volume * volume); -+ -+/* These are some functions that help with simple status text generation */ -+ -+int afp_status_header(char * text, int * len); -+int afp_status_server(struct afp_server * s,char * text, int * len); -+ -+ -+struct afp_server * afp_server_full_connect(void * priv, struct afp_connection_request * req); -+ -+void just_end_it_now(void *other); -+void add_fd_and_signal(int fd); -+void loop_disconnect(struct afp_server *s); -+void afp_wait_for_started_loop(void); -+ -+ -+struct afp_versions * pick_version(unsigned char *versions, -+ unsigned char requested) ; -+int pick_uam(unsigned int u1, unsigned int u2); -+ -+int afp_server_login(struct afp_server *server, -+ char * mesg, unsigned int *l, unsigned int max); -+ -+ -+int afp_dologin(struct afp_server *server, -+ unsigned int uam, char * username, char * passwd); -+ -+void afp_free_server(struct afp_server **server); -+ -+struct afp_server * afp_server_init(struct sockaddr_in * address); -+int afp_get_address(void * priv, const char * hostname, unsigned int port, -+ struct sockaddr_in * address); -+ -+ -+int afp_main_loop(int command_fd); -+int afp_main_quick_startup(pthread_t * thread); -+ -+int afp_server_destroy(struct afp_server *s) ; -+int afp_server_reconnect(struct afp_server * s, char * mesg, -+ unsigned int *l, unsigned int max); -+int afp_server_connect(struct afp_server *s, int full); -+ -+struct afp_server * afp_server_complete_connection( -+ void * priv, -+ struct afp_server * server, -+ struct sockaddr_in * address, unsigned char * versions, -+ unsigned int uams, char * username, char * password, -+ unsigned int requested_version, unsigned int uam_mask); -+ -+int afp_connect_volume(struct afp_volume * volume, struct afp_server * server, -+ char * mesg, unsigned int * l, unsigned int max); -+int something_is_mounted(struct afp_server * server); -+ -+int add_cache_entry(struct afp_file_info * file) ; -+struct afp_file_info * get_cache_by_name(char * name); -+struct afp_server * find_server_by_address(struct sockaddr_in * address); -+struct afp_server * find_server_by_signature(char * signature); -+struct afp_server * find_server_by_name(char * name); -+int server_still_valid(struct afp_server * server); -+ -+ -+struct afp_server * get_server_base(void); -+int afp_server_remove(struct afp_server * server); -+ -+int afp_unmount_volume(struct afp_volume * volume); -+int afp_unmount_all_volumes(struct afp_server * server); -+ -+#define volume_is_readonly(x) (((x)->attributes&kReadOnly) || \ -+ ((x)->extra_flags & VOLUME_EXTRA_FLAGS_READONLY)) -+ -+int afp_opendt(struct afp_volume *volume, unsigned short * refnum); -+ -+int afp_closedt(struct afp_server * server, unsigned short * refnum); -+ -+int afp_getcomment(struct afp_volume *volume, unsigned int did, -+ const char * pathname, struct afp_comment * comment); -+ -+int afp_addcomment(struct afp_volume *volume, unsigned int did, -+ const char * pathname, char * comment,uint64_t *size); -+ -+int afp_geticon(struct afp_volume * volume, unsigned int filecreator, -+ unsigned int filetype, unsigned char icontype, -+ unsigned short length, struct afp_icon * icon); -+ -+/* Things you want to do to a server */ -+ -+int afp_getsrvrmsg(struct afp_server *server, unsigned short messagetype,unsigned char utf8, unsigned char block, char * mesg); -+ -+int afp_login(struct afp_server *server, char * uaname, -+ char * userauthinfo, unsigned int userauthinfo_len, -+ struct afp_rx_buffer *rx); -+ -+int afp_changepassword(struct afp_server *server, char * uaname, -+ char * userauthinfo, unsigned int userauthinfo_len, -+ struct afp_rx_buffer *rx); -+ -+int afp_logincont(struct afp_server *server, unsigned short id, -+ char * userauthinfo, unsigned int userauthinfo_len, -+ struct afp_rx_buffer *rx); -+ -+int afp_getsessiontoken(struct afp_server * server, int type, -+ unsigned int timestamp, struct afp_token *outgoing_token, -+ struct afp_token * incoming_token); -+ -+int afp_getsrvrparms(struct afp_server *server); -+ -+int afp_logout(struct afp_server *server,unsigned char wait); -+ -+int afp_mapname(struct afp_server * server, unsigned char subfunction, -+ char * name, unsigned int * id); -+ -+int afp_mapid(struct afp_server * server, unsigned char subfunction, -+ unsigned int id, char *name); -+ -+int afp_getuserinfo(struct afp_server * server, int thisuser, -+ unsigned int userid, unsigned short bitmap, -+ unsigned int *newuid, unsigned int *newgid); -+ -+int afp_zzzzz(struct afp_server *server); -+ -+int afp_volopen(struct afp_volume * volume, -+ unsigned short bitmap, char * password); -+ -+int afp_flush(struct afp_volume * volume); -+ -+int afp_getfiledirparms(struct afp_volume *volume, unsigned int did, -+ unsigned int filebitmap, unsigned int dirbitmap, const char * pathname, -+ struct afp_file_info *fp); -+ -+int afp_enumerate(struct afp_volume * volume, -+ unsigned int dirid, -+ unsigned int filebitmap, unsigned int dirbitmap, -+ unsigned short reqcount, -+ unsigned short startindex, -+ char * path, -+ struct afp_file_info ** file_p); -+ -+int afp_enumerateext2(struct afp_volume * volume, -+ unsigned int dirid, -+ unsigned int filebitmap, unsigned int dirbitmap, -+ unsigned short reqcount, -+ unsigned long startindex, -+ char * path, -+ struct afp_file_info ** file_p); -+ -+int afp_openfork(struct afp_volume * volume, -+ unsigned char forktype, -+ unsigned int dirid, -+ unsigned short accessmode, -+ char * filename, -+ struct afp_file_info *fp); -+ -+int afp_read(struct afp_volume * volume, unsigned short forkid, -+ uint32_t offset, -+ uint32_t count, struct afp_rx_buffer * rx); -+ -+int afp_readext(struct afp_volume * volume, unsigned short forkid, -+ uint64_t offset, -+ uint64_t count, struct afp_rx_buffer * rx); -+ -+int afp_getvolparms(struct afp_volume * volume, unsigned short bitmap); -+ -+ -+int afp_createdir(struct afp_volume * volume, unsigned int dirid, const char * pathname, unsigned int *did_p); -+ -+int afp_delete(struct afp_volume * volume, -+ unsigned int dirid, char * pathname); -+ -+ -+int afp_createfile(struct afp_volume * volume, unsigned char flag, -+ unsigned int did, char * pathname); -+ -+int afp_write(struct afp_volume * volume, unsigned short forkid, -+ uint32_t offset, uint32_t reqcount, -+ char * data, uint32_t * written); -+ -+int afp_writeext(struct afp_volume * volume, unsigned short forkid, -+ uint64_t offset, uint64_t reqcount, -+ char * data, uint64_t * written); -+ -+int afp_flushfork(struct afp_volume * volume, unsigned short forkid); -+ -+int afp_closefork(struct afp_volume * volume, unsigned short forkid); -+int afp_setfileparms(struct afp_volume * volume, -+ unsigned int dirid, const char * pathname, unsigned short bitmap, -+ struct afp_file_info *fp); -+int afp_setfiledirparms(struct afp_volume * volume, -+ unsigned int dirid, const char * pathname, unsigned short bitmap, -+ struct afp_file_info *fp); -+ -+int afp_setdirparms(struct afp_volume * volume, -+ unsigned int dirid, const char * pathname, unsigned short bitmap, -+ struct afp_file_info *fp); -+ -+int afp_volclose(struct afp_volume * volume); -+ -+ -+int afp_setforkparms(struct afp_volume *volume, -+ unsigned short forkid, unsigned short bitmap, unsigned long len); -+ -+int afp_byterangelock(struct afp_volume * volume, -+ unsigned char flag, -+ unsigned short forkid, -+ uint32_t offset, -+ uint32_t len, uint32_t *generated_offset); -+ -+int afp_byterangelockext(struct afp_volume * volume, -+ unsigned char flag, -+ unsigned short forkid, -+ uint64_t offset, -+ uint64_t len, uint64_t *generated_offset); -+ -+int afp_moveandrename(struct afp_volume *volume, -+ unsigned int src_did, -+ unsigned int dst_did, -+ char * src_path, char * dst_path, char *new_name); -+ -+int afp_rename(struct afp_volume * volume, -+ unsigned int dirid, -+ char * path_from, char * path_to); -+ -+int afp_listextattr(struct afp_volume * volume, -+ unsigned int dirid, unsigned short bitmap, -+ char * pathname, struct afp_extattr_info * info); -+ -+/* This is a currently undocumented command */ -+int afp_newcommand76(struct afp_volume * volume, unsigned int dlen, char * data); -+ -+/* For debugging */ -+char * afp_get_command_name(char code); -+ -+ -+#endif -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/afp_protocol.h afpfs-ng-0.8.1.patch/include/afpfs-ng/afp_protocol.h ---- afpfs-ng-0.8.1/include/afpfs-ng/afp_protocol.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/afp_protocol.h 2011-09-10 12:13:50.112124505 +0200 -@@ -0,0 +1,361 @@ -+ -+#ifndef _AFP_PROTOCOL_H_ -+#define _AFP_PROTOCOL_H_ -+ -+#include <sys/types.h> -+#include <stddef.h> -+#include <unistd.h> -+#include <stdint.h> -+ -+/* This file defines constants for the Apple File Protocol. -+ All page references are from "Apple Filing Protocol Programming" version 3.2. -+ except where noted. -+*/ -+ -+#define AFP_SERVER_NAME_LEN 33 -+#define AFP_SERVER_NAME_UTF8_LEN 255 -+#define AFP_VOLUME_NAME_LEN 33 -+#define AFP_VOLUME_NAME_UTF8_LEN 33 -+#define AFP_SIGNATURE_LEN 16 -+#define AFP_MACHINETYPE_LEN 33 -+#define AFP_LOGINMESG_LEN 200 -+#define AFP_VOLPASS_LEN 8 -+#define AFP_HOSTNAME_LEN 255 -+/* This is actually just a guess, and only used for appletalk */ -+#define AFP_ZONE_LEN 255 -+ -+#define AFP_SERVER_ICON_LEN 256 -+ -+ -+#define AFP_MAX_USERNAME_LEN 127 -+#define AFP_MAX_PASSWORD_LEN 127 -+ -+ -+/* This is the maximum length of any UAM string */ -+#define AFP_UAM_LENGTH 24 -+ -+/* This is the maximum length of any path description */ -+#define AFP_MAX_PATH 768 -+ -+#define AFP_VOL_FLAT 1 -+#define AFP_VOL_FIXED 2 -+#define AFP_VOL_VARIABLE 3 -+ -+/* The root directory ID, p.26 */ -+ -+#define AFP_ROOT_DID 2 -+ -+/* Path type constants, p.249 */ -+ -+enum { -+kFPShortName = 1, -+kFPLongName = 2, -+kFPUTF8Name = 3 -+}; -+ -+/* fork types */ -+ -+#define AFP_FORKTYPE_DATA 0x0 -+#define AFP_FORKTYPE_RESOURCE 0x80 -+ -+/* openfork access modes, from p.196 */ -+ -+#define AFP_OPENFORK_ALLOWREAD 1 -+#define AFP_OPENFORK_ALLOWWRITE 2 -+#define AFP_OPENFORK_DENYREAD 0x10 -+#define AFP_OPENFORK_DENYWRITE 0x20 -+ -+/* Message type for getsrvmesg, p. 169*/ -+ -+typedef enum { -+ AFPMESG_LOGIN = 0, -+ AFPMESG_SERVER = 1 -+} afpmessage_t; -+ -+/* Message bitmap for getsrvrmsg */ -+ -+#define AFP_GETSRVRMSG_UTF8 0x2 -+#define AFP_GETSRVRMSG_GETMSG 0x1 -+ -+ -+/* Maximum Version length, p.17 */ -+#define AFP_MAX_VERSION_LENGTH 16 -+ -+/* Maximum length of a token, this is undocumented */ -+#define AFP_TOKEN_MAX_LEN 256 -+ -+/* The maximum size of a file for AFP 2 */ -+#define AFP_MAX_AFP2_FILESIZE (4294967296) -+ -+/* Unix privs, p.240 */ -+ -+struct afp_unixprivs { -+ uint32_t uid __attribute__((__packed__)); -+ uint32_t gid __attribute__((__packed__)); -+ uint32_t permissions __attribute__((__packed__)); -+ uint32_t ua_permissions __attribute__((__packed__)); -+ -+}; -+ -+ -+/* AFP Volume attributes bitmap, p.241 */ -+ -+enum { -+ kReadOnly = 0x01, -+ kHasVolumePassword = 0x02, -+ kSupportsFileIDs = 0x04, -+ kSupportsCatSearch = 0x08, -+ kSupportsBlankAccessPrivs = 0x10, -+ kSupportsUnixPrivs = 0x20, -+ kSupportsUTF8Names = 0x40, -+ kNoNetworkUserIDs = 0x80, -+ kDefaultPrivsFromParent = 0x100, -+ kNoExchangeFiles = 0x200, -+ kSupportsExtAttrs = 0x400, -+ kSupportsACLs=0x800 -+}; -+ -+/* AFP file creation constantes, p.250 */ -+enum { -+kFPSoftCreate = 0, -+kFPHardCreate = 0x80 -+}; -+ -+/* AFP Directory attributes, taken from the protocol guide p.236 */ -+ -+enum { -+ kFPAttributeBit = 0x1, -+ kFPParentDirIDBit = 0x2, -+ kFPCreateDateBit = 0x4, -+ kFPModDateBit = 0x8, -+ kFPBackupDateBit = 0x10, -+ kFPFinderInfoBit = 0x20, -+ kFPLongNameBit = 0x40, -+ kFPShortNameBit = 0x80, -+ kFPNodeIDBit = 0x100, -+ kFPOffspringCountBit = 0x0200, -+ kFPOwnerIDBit = 0x0400, -+ kFPGroupIDBit = 0x0800, -+ kFPAccessRightsBit = 0x1000, -+ kFPProDOSInfoBit = 0x2000, // AFP version 2.2 and earlier -+ kFPUTF8NameBit = 0x2000, // AFP version 3.0 and later -+ kFPUnixPrivsBit = 0x8000 // AFP version 3.0 and later -+}; -+ -+/* AFP File bitmap, p.238. These are the ones not in the AFP Directory -+ attributes map. */ -+ -+enum { -+ kFPDataForkLenBit = 0x0200, -+ kFPRsrcForkLenBit = 0x0400, -+ kFPExtDataForkLenBit = 0x0800, // AFP version 3.0 and later -+ kFPLaunchLimitBit = 0x1000, -+ kFPExtRsrcForkLenBit = 0x4000, // AFP version 3.0 and later -+}; -+ -+/* AFP Extended Attributes Bitmap, p.238 */ -+ -+enum { -+ kXAttrNoFollow = 0x1, -+ kXAttrCreate = 0x2, -+ kXAttrREplace=0x4 -+}; -+ -+ -+/* AFP function codes */ -+enum AFPFunction -+{ -+ afpByteRangeLock = 1, afpCloseVol, afpCloseDir, afpCloseFork, -+ afpCopyFile, afpCreateDir, afpCreateFile, -+ afpDelete, afpEnumerate, afpFlush, afpFlushFork, -+ afpGetForkParms = 14, afpGetSrvrInfo, afpGetSrvrParms, -+ afpGetVolParms, afpLogin, afpLoginCont, afpLogout, afpMapID, -+ afpMapName, afpMoveAndRename, afpOpenVol, afpOpenDir, afpOpenFork, -+ afpRead, afpRename, afpSetDirParms, afpSetFileParms, -+ afpSetForkParms, afpSetVolParms, afpWrite, afpGetFileDirParms, -+ afpSetFileDirParms, afpChangePassword, -+ afpGetUserInfo=37,afpGetSrvrMsg = 38, -+ afpOpenDT=48, -+ afpCloseDT=49, -+ afpGetIcon=51, afpGetIconInfo=52, -+ afpAddComment=56, afpRemoveComment=57, afpGetComment=58, -+ afpByteRangeLockExt=59, afpReadExt, afpWriteExt, -+ afpGetAuthMethods=62, -+ afp_LoginExt=63, -+ afpGetSessionToken=64, -+ afpDisconnectOldSession=65, -+ afpEnumerateExt=66, -+ afpCatSearchExt = 67, -+ afpEnumerateExt2 = 68, afpGetExtAttr, afpSetExtAttr, -+ afpRemoveExtAttr , afpListExtAttrs, -+ afpZzzzz = 122, -+ afpAddIcon=192, -+}; -+ -+/* AFP Volume bitmap. Take from 242 of the protocol guide. */ -+enum { -+ kFPBadVolPre222Bitmap = 0xFe00, -+ kFPBadVolBitmap = 0xF000, -+ kFPVolAttributeBit = 0x1, -+ kFPVolSignatureBit = 0x2, -+ kFPVolCreateDateBit = 0x4, -+ kFPVolModDateBit = 0x8, -+ kFPVolBackupDateBit = 0x10, -+ kFPVolIDBit = 0x20, -+ kFPVolBytesFreeBit = 0x40, -+ kFPVolBytesTotalBit = 0x80, -+ kFPVolNameBit = 0x100, -+ kFPVolExtBytesFreeBit = 0x200, -+ kFPVolExtBytesTotalBit = 0x400, -+ kFPVolBlockSizeBit = 0x800 -+}; -+ -+/* AFP Attention Codes -- 4 bits */ -+#define AFPATTN_SHUTDOWN (1 << 15) /* shutdown/disconnect */ -+#define AFPATTN_CRASH (1 << 14) /* server crashed */ -+#define AFPATTN_MESG (1 << 13) /* server has message */ -+#define AFPATTN_NORECONNECT (1 << 12) /* don't reconnect */ -+/* server notification */ -+#define AFPATTN_NOTIFY (AFPATTN_MESG | AFPATTN_NORECONNECT) -+ -+/* extended bitmap -- 12 bits. volchanged is only useful w/ a server -+ * notification, and time is only useful for shutdown. */ -+#define AFPATTN_VOLCHANGED (1 << 0) /* volume has changed */ -+#define AFPATTN_TIME(x) ((x) & 0xfff) /* time in minutes */ -+ -+#define kFPNoErr 0 -+ -+/* AFP result codes, p252 */ -+#define kASPSessClosed -1072 -+#define kFPAccessDenied -5000 -+#define kFPAuthContinue -5001 -+#define kFPBadUAM -5002 -+#define kFPBadVersNum -5003 -+#define kFPBitmapErr -5004 -+#define kFPCantMove -5005 -+#define kFPDenyConflict -5006 -+#define kFPDirNotEmpty -5007 -+#define kFPDiskFull -5008 -+#define kFPEOFErr -5009 -+#define kFPFileBusy -5010 -+#define kFPFlatVol -5011 -+#define kFPItemNotFound -5012 -+#define kFPLockErr -5013 -+#define kFPMiscErr -5014 -+#define kFPNoMoreLocks -5015 -+#define kFPNoServer -5016 -+#define kFPObjectExists -5017 -+#define kFPObjectNotFound -5018 -+#define kFPParamErr -5019 -+#define kFPRangeNotLocked -5020 -+#define kFPRangeOverlap -5021 -+#define kFPSessClosed -5022 -+#define kFPUserNotAuth -5023 -+#define kFPCallNotSupported -5024 -+#define kFPObjectTypeErr -5025 -+#define kFPTooManyFilesOpen -5026 -+#define kFPServerGoingDown -5027 -+#define kFPCantRename -5028 -+#define kFPDirNotFound -5029 -+#define kFPIconTypeError -5030 -+#define kFPVolLocked -5031 -+#define kFPObjectLocked -5032 -+#define kFPContainsSharedErr -5033 -+#define kFPIDNotFound -5034 -+#define kFPIDExists -5035 -+#define kFPDiffVolErr -5036 -+#define kFPCatalogChanged -5037 -+#define kFPSameObjectErr -5038 -+#define kFPBadIDErr -5039 -+#define kFPPwdSameErr -5040 -+#define kFPPwdTooShortErr -5041 -+#define kFPPwdExpiredErr -5042 -+#define kFPInsideSharedErr -5043 -+#define kFPInsideTrashErr -5044 -+#define kFPPwdNeedsChangeErr -5045 -+#define kFPPwdPolicyErr -5046 -+#define kFPDiskQuotaExceeded –5047 -+ -+ -+ -+/* These flags determine to lock or unlock in ByteRangeLock(Ext) */ -+ -+enum { -+ByteRangeLock_Lock = 0, -+ByteRangeLock_Unlock = 1 -+}; -+ -+/* These flags are used in volopen and getsrvrparm replies, p.171 */ -+ -+#define HasConfigInfo 0x1 -+#define HasPassword 0x80 -+ -+/* These are the subfunction for kFPMapID, as per p.248 */ -+ -+enum { -+kUserIDToName = 1, -+kGroupIDToName = 2, -+kUserIDToUTF8Name = 3, -+kGroupIDToUTF8Name = 4, -+kUserUUIDToUTF8Name = 5, -+kGroupUUIDToUTF8Name = 6 -+}; -+ -+ -+/* These are the subfunction flags described in the FPMapName command, p.286. -+ Note that this is different than what's described on p. 186. */ -+ -+enum { -+kNameToUserID = 1, -+kNameToGroupID = 2, -+kUTF8NameToUserID = 3, -+kUTF8NameToGroupID = 4, -+kUTF8NameToUserUUID = 5, -+kUTF8NameToGroupUUID = 6 -+}; -+ -+/* These are bits for FPGetUserInfo, p.173. */ -+#define kFPGetUserInfo_USER_ID 1 -+#define kFPGetUserInfo_PRI_GROUPID 2 -+ -+/* Flags for the replies of GetSrvrInfo and DSI GetStatus, p.240 */ -+ -+enum { -+ kSupportsCopyfile = 0x01, -+ kSupportsChgPwd = 0x02, -+ kDontAllowSavePwd = 0x04, -+ kSupportsSrvrMsg = 0x08, -+ kSrvrSig = 0x10, -+ kSupportsTCP = 0x20, -+ kSupportsSrvrNotify = 0x40, -+ kSupportsReconnect = 0x80, -+ kSupportsDirServices = 0x100, -+ kSupportsUTF8SrvrName = 0x200, -+ kSupportsUUIDs = 0x400, -+ kSupportsSuperClient = 0x8000 -+}; -+ -+ -+/* p.247 */ -+ -+enum { -+ kLoginWithoutID = 0, -+ kLoginWithID = 1, -+ kReconnWithID = 2, -+ kLoginWithTimeAndID = 3, -+ kReconnWithTimeAndID = 4, -+ kRecon1Login = 5, -+ kRecon1ReconnectLogin = 6, -+ kRecon1Refresh = 7, kGetKerberosSessionKey = 8 -+}; -+ -+ -+#define AFP_CHMOD_ALLOWED_BITS_22 \ -+ (S_IRUSR |S_IWUSR | S_IRGRP | S_IWGRP |S_IROTH | S_IWOTH | S_IFREG ) -+ -+ -+#endif -+ -+ -+ -+ -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/codepage.h afpfs-ng-0.8.1.patch/include/afpfs-ng/codepage.h ---- afpfs-ng-0.8.1/include/afpfs-ng/codepage.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/codepage.h 2011-09-10 12:13:50.113124518 +0200 -@@ -0,0 +1,11 @@ -+#ifndef __CODE_PAGE_H_ -+#define __CODE_PAGE_H_ -+int convert_utf8dec_to_utf8pre(const char *src, int src_len, -+ char * dest, int dest_len); -+int convert_utf8pre_to_utf8dec(const char * src, int src_len, -+ char * dest, int dest_len); -+int convert_path_to_unix(char encoding, char * dest, -+ char * src, int dest_len); -+int convert_path_to_afp(char encoding, char * dest, -+ char * src, int dest_len); -+#endif -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/dsi.h afpfs-ng-0.8.1.patch/include/afpfs-ng/dsi.h ---- afpfs-ng-0.8.1/include/afpfs-ng/dsi.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/dsi.h 2011-09-10 12:13:50.115124544 +0200 -@@ -0,0 +1,33 @@ -+ -+#ifndef __DSI_H_ -+#define __DSI_H_ -+ -+#include "afpfs-ng/afp.h" -+ -+struct dsi_request -+{ -+ unsigned short requestid; -+ unsigned char subcommand; -+ void * other; -+ unsigned char wait; -+ pthread_cond_t condition_cond; -+ struct dsi_request * next; -+ int return_code; -+}; -+ -+int dsi_receive(struct afp_server * server, void * data, int size); -+int dsi_getstatus(struct afp_server * server); -+ -+int dsi_opensession(struct afp_server *server); -+ -+int dsi_send(struct afp_server *server, char * msg, int size,int wait,unsigned char subcommand, void ** other); -+struct dsi_session * dsi_create(struct afp_server *server); -+int dsi_restart(struct afp_server *server); -+int dsi_recv(struct afp_server * server); -+ -+#define DSI_BLOCK_TIMEOUT -1 -+#define DSI_DONT_WAIT 0 -+#define DSI_DEFAULT_TIMEOUT 5 -+ -+ -+#endif -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/libafpclient.h afpfs-ng-0.8.1.patch/include/afpfs-ng/libafpclient.h ---- afpfs-ng-0.8.1/include/afpfs-ng/libafpclient.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/libafpclient.h 2011-09-10 12:13:50.115124544 +0200 -@@ -0,0 +1,50 @@ -+ -+#ifndef __CLIENT_H_ -+#define __CLIENT_H_ -+ -+#include <unistd.h> -+#include <syslog.h> -+ -+#define MAX_CLIENT_RESPONSE 2048 -+ -+ -+enum loglevels { -+ AFPFSD, -+}; -+ -+struct afp_server; -+struct afp_volume; -+ -+struct libafpclient { -+ int (*unmount_volume) (struct afp_volume * volume); -+ void (*log_for_client)(void * priv, -+ enum loglevels loglevel, int logtype, const char *message); -+ void (*forced_ending_hook)(void); -+ int (*scan_extra_fds)(int command_fd,fd_set *set, int * max_fd); -+ void (*loop_started)(void); -+} ; -+ -+extern struct libafpclient * libafpclient; -+ -+void libafpclient_register(struct libafpclient * tmpclient); -+ -+ -+void signal_main_thread(void); -+ -+/* These are logging functions */ -+ -+#define MAXLOGSIZE 2048 -+ -+#define LOG_METHOD_SYSLOG 1 -+#define LOG_METHOD_STDOUT 2 -+ -+void set_log_method(int m); -+ -+ -+void log_for_client(void * priv, -+ enum loglevels loglevel, int logtype, char * message,...); -+ -+void stdout_log_for_client(void * priv, -+ enum loglevels loglevel, int logtype, const char *message); -+ -+#endif -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/Makefile.am afpfs-ng-0.8.1.patch/include/afpfs-ng/Makefile.am ---- afpfs-ng-0.8.1/include/afpfs-ng/Makefile.am 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/Makefile.am 2011-09-10 12:13:50.115124544 +0200 -@@ -0,0 +1,6 @@ -+## Process this file with automake to produce Makefile.in -+ -+afpfsincludedir = $(includedir)/afpfs-ng -+ -+afpfsinclude_HEADERS = afp.h afp_protocol.h libafpclient.h -+nodist_afpfsinclude_HEADERS = codepage.h dsi.h map_def.h midlevel.h uams_def.h utils.h -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/map_def.h afpfs-ng-0.8.1.patch/include/afpfs-ng/map_def.h ---- afpfs-ng-0.8.1/include/afpfs-ng/map_def.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/map_def.h 2011-09-10 12:13:50.116124557 +0200 -@@ -0,0 +1,15 @@ -+#ifndef __MAP_H_ -+#define __MAP_H_ -+ -+#include "afpfs-ng/afp.h" -+ -+#define AFP_MAPPING_UNKNOWN 0 -+#define AFP_MAPPING_COMMON 1 -+#define AFP_MAPPING_LOGINIDS 2 -+#define AFP_MAPPING_NAME 3 -+ -+unsigned int map_string_to_num(char * name); -+char * get_mapping_name(struct afp_volume * volume); -+ -+ -+#endif -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/midlevel.h afpfs-ng-0.8.1.patch/include/afpfs-ng/midlevel.h ---- afpfs-ng-0.8.1/include/afpfs-ng/midlevel.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/midlevel.h 2011-09-10 12:13:50.116124557 +0200 -@@ -0,0 +1,64 @@ -+#ifndef __MIDLEVEL_H_ -+#define __MIDLEVEL_H_ -+ -+#include <utime.h> -+#include "afpfs-ng/afp.h" -+ -+int ml_open(struct afp_volume * volume, const char *path, int flags, -+ struct afp_file_info **newfp); -+ -+int ml_creat(struct afp_volume * volume, const char *path,mode_t mode); -+ -+int ml_readdir(struct afp_volume * volume, -+ const char *path, -+ struct afp_file_info **base); -+ -+int ml_read(struct afp_volume * volume, const char *path, -+ char *buf, size_t size, off_t offset, -+ struct afp_file_info *fp, int * eof); -+ -+int ml_chmod(struct afp_volume * vol, const char * path, mode_t mode); -+ -+int ml_unlink(struct afp_volume * vol, const char *path); -+ -+int ml_mkdir(struct afp_volume * vol, const char * path, mode_t mode); -+ -+int ml_close(struct afp_volume * volume, const char * path, -+ struct afp_file_info * fp); -+ -+int ml_getattr(struct afp_volume * volume, const char *path, -+ struct stat *stbuf); -+ -+int ml_write(struct afp_volume * volume, const char * path, -+ const char *data, size_t size, off_t offset, -+ struct afp_file_info * fp, uid_t uid, -+ gid_t gid); -+ -+int ml_readlink(struct afp_volume * vol, const char * path, -+ char *buf, size_t size); -+ -+int ml_rmdir(struct afp_volume * vol, const char *path); -+ -+int ml_chown(struct afp_volume * vol, const char * path, -+ uid_t uid, gid_t gid); -+ -+int ml_truncate(struct afp_volume * vol, const char * path, off_t offset); -+ -+int ml_utime(struct afp_volume * vol, const char * path, -+ struct utimbuf * timebuf); -+ -+int ml_symlink(struct afp_volume *vol, const char * path1, const char * path2); -+ -+int ml_rename(struct afp_volume * vol, -+ const char * path_from, const char * path_to); -+ -+int ml_statfs(struct afp_volume * vol, const char *path, struct statvfs *stat); -+ -+void afp_ml_filebase_free(struct afp_file_info **filebase); -+ -+int ml_passwd(struct afp_server *server, -+ char * username, char * oldpasswd, char * newpasswd); -+ -+ -+ -+#endif -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/uams_def.h afpfs-ng-0.8.1.patch/include/afpfs-ng/uams_def.h ---- afpfs-ng-0.8.1/include/afpfs-ng/uams_def.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/uams_def.h 2011-09-10 12:13:50.116124557 +0200 -@@ -0,0 +1,16 @@ -+#ifndef __UAM_DEFS_H_ -+#define __UAM_DEFS_H_ -+ -+#define UAM_NOUSERAUTHENT 0x1 -+#define UAM_CLEARTXTPASSWRD 0x2 -+#define UAM_RANDNUMEXCHANGE 0x4 -+#define UAM_2WAYRANDNUM 0x8 -+#define UAM_DHCAST128 0x10 -+#define UAM_CLIENTKRB 0x20 -+#define UAM_DHX2 0x40 -+#define UAM_RECON1 0x80 -+ -+int uam_string_to_bitmap(char * name); -+char * uam_bitmap_to_string(unsigned int bitmap); -+ -+#endif -diff -Naur afpfs-ng-0.8.1/include/afpfs-ng/utils.h afpfs-ng-0.8.1.patch/include/afpfs-ng/utils.h ---- afpfs-ng-0.8.1/include/afpfs-ng/utils.h 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afpfs-ng/utils.h 2011-09-10 12:13:50.116124557 +0200 -@@ -0,0 +1,43 @@ -+#ifndef __UTILS_H_ -+#define __UTILS_H_ -+#include <stdio.h> -+ -+#include "afpfs-ng/afp.h" -+ -+#if BYTE_ORDER == BIG_ENDIAN -+#define hton64(x) (x) -+#define ntoh64(x) (x) -+#else /* BYTE_ORDER == BIG_ENDIAN */ -+#define hton64(x) ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \ -+ (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32)) -+#define ntoh64(x) (hton64(x)) -+#endif /* BYTE_ORDER == BIG_ENDIAN */ -+ -+#define min(a,b) (((a)<(b)) ? (a) : (b)) -+#define max(a,b) (((a)>(b)) ? (a) : (b)) -+ -+ -+ -+unsigned char unixpath_to_afppath( -+ struct afp_server * server, -+ char * buf); -+ -+unsigned char sizeof_path_header(struct afp_server * server); -+ -+ -+ -+unsigned char copy_from_pascal(char *dest, char *pascal,unsigned int max_len) ; -+unsigned short copy_from_pascal_two(char *dest, char *pascal,unsigned int max_len); -+ -+unsigned char copy_to_pascal(char *dest, const char *src); -+unsigned short copy_to_pascal_two(char *dest, const char *src); -+ -+void copy_path(struct afp_server * server, char * dest, const char * pathname, unsigned char len); -+ -+ -+char * create_path(struct afp_server * server, char * pathname, unsigned short * len); -+ -+ -+int invalid_filename(struct afp_server * server, const char * filename); -+ -+#endif -diff -Naur afpfs-ng-0.8.1/include/afp.h afpfs-ng-0.8.1.patch/include/afp.h ---- afpfs-ng-0.8.1/include/afp.h 2008-03-08 17:08:18.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afp.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,533 +0,0 @@ -- --#ifndef _AFP_H_ --#define _AFP_H_ -- --#include <arpa/inet.h> --#include <pthread.h> --#include <netdb.h> --#include <sys/statvfs.h> --#include <pwd.h> --#include <afp_protocol.h> --#include <libafpclient.h> --#include <sys/types.h> --#include <sys/stat.h> --#include <unistd.h> --#include <netinet/in.h> -- -- --#define AFPFS_VERSION "0.8.1" -- --/* This is the maximum AFP version this library supports */ --#define AFP_MAX_SUPPORTED_VERSION 32 -- --/* afp_url is used to pass locations around */ --struct afp_url { -- enum {TCPIP,AT} protocol; -- char username[AFP_MAX_USERNAME_LEN]; -- char uamname[50]; -- char password[AFP_MAX_PASSWORD_LEN]; -- char servername[AFP_SERVER_NAME_UTF8_LEN]; -- int port; -- char volumename[AFP_VOLUME_NAME_UTF8_LEN]; -- char path[AFP_MAX_PATH]; -- -- int requested_version; -- char zone[AFP_ZONE_LEN]; /* Only used for Appletalk */ -- char volpassword[9];; --}; -- --struct afp_token { -- unsigned int length; -- char data[AFP_TOKEN_MAX_LEN]; --}; -- --#define SERVER_MAX_VERSIONS 10 --#define SERVER_MAX_UAMS 10 -- --struct afp_rx_buffer { -- unsigned int size; -- unsigned int maxsize; -- char * data; -- int errorcode; --}; -- -- --struct afp_file_info { -- unsigned short attributes; -- unsigned int did; -- unsigned int creation_date; -- unsigned int modification_date; -- unsigned int backup_date; -- unsigned int fileid; -- unsigned short offspring; -- char sync; -- char finderinfo[32]; -- char name[AFP_MAX_PATH]; -- char basename[AFP_MAX_PATH]; -- char translated_name[AFP_MAX_PATH]; -- struct afp_unixprivs unixprivs; -- unsigned int accessrights; -- struct afp_file_info * next; -- struct afp_file_info * largelist_next; -- unsigned char isdir; -- unsigned long long size; -- unsigned short resourcesize; -- unsigned int resource; -- unsigned short forkid; -- struct afp_icon * icon; -- int eof; --}; -- -- --#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_KNOWN 0x1 --#define VOLUME_EXTRA_FLAGS_VOL_CHMOD_BROKEN 0x2 --#define VOLUME_EXTRA_FLAGS_SHOW_APPLEDOUBLE 0x4 --#define VOLUME_EXTRA_FLAGS_VOL_SUPPORTS_UNIX 0x8 --#define VOLUME_EXTRA_FLAGS_NO_LOCKING 0x10 --#define VOLUME_EXTRA_FLAGS_IGNORE_UNIXPRIVS 0x20 --#define VOLUME_EXTRA_FLAGS_READONLY 0x40 -- --#define AFP_VOLUME_UNMOUNTED 0 --#define AFP_VOLUME_MOUNTED 1 --#define AFP_VOLUME_UNMOUNTING 2 -- --struct afp_volume { -- unsigned short volid; -- char flags; /* This is from afpGetSrvrParms */ -- unsigned short attributes; /* This is from VolOpen */ -- unsigned short signature; /* This is fixed or variable */ -- unsigned int creation_date; -- unsigned int modification_date; -- unsigned int backup_date; -- struct statvfs stat; -- unsigned char mounted; -- char mountpoint[255]; -- struct afp_server * server; -- char volume_name[AFP_VOLUME_NAME_LEN]; -- char volume_name_printable[AFP_VOLUME_NAME_UTF8_LEN]; -- unsigned short dtrefnum; -- char volpassword[AFP_VOLPASS_LEN]; -- unsigned int extra_flags; /* This is an afpfs-ng specific field */ -- -- /* Our directory ID cache */ -- struct did_cache_entry * did_cache_base; -- pthread_mutex_t did_cache_mutex; -- -- /* Our journal of open forks */ -- struct afp_file_info * open_forks; -- pthread_mutex_t open_forks_mutex; -- -- /* Used to trigger startup */ -- pthread_cond_t startup_condition_cond; -- -- struct { -- uint64_t hits; -- uint64_t misses; -- uint64_t expired; -- uint64_t force_removed; -- } did_cache_stats; -- -- void * priv; /* This is a private structure for fuse/cmdline, etc */ -- pthread_t thread; /* This is the per-volume thread */ -- -- int mapping; -- --}; -- --#define SERVER_STATE_CONNECTED 1 --#define SERVER_STATE_DISCONNECTED 2 -- --enum server_type{ -- AFPFS_SERVER_TYPE_UNKNOWN, -- AFPFS_SERVER_TYPE_NETATALK, -- AFPFS_SERVER_TYPE_AIRPORT, -- AFPFS_SERVER_TYPE_MACINTOSH, --}; -- --#define is_netatalk(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_NETATALK ) --#define is_airport(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_AIRPORT ) --#define is_macintosh(x) ( (x)->machine_type == AFPFS_SERVER_TYPE_MACINTOSH ) -- -- -- --struct afp_versions { -- char *av_name; -- int av_number; --}; --extern struct afp_versions afp_versions[]; -- --struct afp_server { -- -- /* Our buffer sizes */ -- unsigned int tx_quantum; -- unsigned int rx_quantum; -- -- unsigned int tx_delay; -- -- /* Connection information */ -- struct sockaddr_in address; -- int fd; -- -- /* Some stats, for information only */ -- struct { -- uint64_t runt_packets; -- uint64_t incoming_dsi; -- uint64_t rx_bytes; -- uint64_t tx_bytes; -- uint64_t requests_pending; -- } stats; -- -- /* General information */ -- char server_name[AFP_SERVER_NAME_LEN]; -- char server_name_utf8[AFP_SERVER_NAME_UTF8_LEN]; -- char server_name_printable[AFP_SERVER_NAME_UTF8_LEN]; -- -- char machine_type[17]; -- char icon[256]; -- char signature[16]; -- unsigned short flags; -- int connect_state; -- enum server_type server_type; -- -- /* This is the time we connected */ -- time_t connect_time; -- -- /* UAMs */ -- unsigned int supported_uams; -- unsigned int using_uam; -- -- /* Authentication */ -- char username[AFP_MAX_USERNAME_LEN]; -- char password[AFP_MAX_PASSWORD_LEN]; -- -- /* Session */ -- struct afp_token token; -- char need_resume; -- -- /* Versions */ -- unsigned char requested_version; -- unsigned char versions[SERVER_MAX_VERSIONS]; -- struct afp_versions *using_version; -- -- /* Volumes */ -- unsigned char num_volumes; -- struct afp_volume * volumes; -- -- void * dsi; -- unsigned int exit_flag; -- -- /* Our DSI request queue */ -- pthread_mutex_t requestid_mutex; -- pthread_mutex_t request_queue_mutex; -- unsigned short lastrequestid; -- unsigned short expectedrequestid; -- struct dsi_request * command_requests; -- -- -- char loginmesg[200]; -- char servermesg[200]; -- char path_encoding; -- -- /* This is the data for the incoming buffer */ -- char * incoming_buffer; -- int data_read; -- int bufsize; -- -- /* And this is for the outgoing queue */ -- pthread_mutex_t send_mutex; -- -- /* This is for user mapping */ -- struct passwd passwd; -- unsigned int server_uid, server_gid; -- int server_gid_valid; -- -- struct afp_server *next; -- -- /* These are for DSI attention packets */ -- unsigned int attention_quantum; -- unsigned int attention_len; -- char * attention_buffer; -- --}; -- --struct afp_extattr_info { -- unsigned int maxsize; -- unsigned int size; -- char data[1024]; --}; --struct afp_comment { -- unsigned int maxsize; -- unsigned int size; -- char *data; --}; -- --struct afp_icon { -- unsigned int maxsize; -- unsigned int size; -- char *data; --}; -- --#define AFP_DEFAULT_ATTENTION_QUANTUM 1024 -- --void afp_unixpriv_to_stat(struct afp_file_info *fp, -- struct stat *stat); -- --int init_uams(void) ; -- --unsigned int find_uam_by_name(const char * name); --char * uam_bitmap_to_string(unsigned int bitmap); -- -- --char * get_uam_names_list(void); -- --unsigned int default_uams_mask(void); -- --struct afp_volume * find_volume_by_name(struct afp_server * server, -- const char * volname); -- --struct afp_connection_request { -- unsigned int uam_mask; -- struct afp_url url; --}; -- --void afp_default_url(struct afp_url *url); --int afp_parse_url(struct afp_url * url, const char * toparse, int verbose); --void afp_print_url(struct afp_url * url); --int afp_url_validate(char * url_string, struct afp_url * valid_url); -- --int afp_list_volnames(struct afp_server * server, char * names, int max); -- --/* User mapping */ --int afp_detect_mapping(struct afp_volume * volume); -- --/* These are some functions that help with simple status text generation */ -- --int afp_status_header(char * text, int * len); --int afp_status_server(struct afp_server * s,char * text, int * len); -- -- --struct afp_server * afp_server_full_connect(void * priv, struct afp_connection_request * req); -- --void * just_end_it_now(void *other); --void add_fd_and_signal(int fd); --void loop_disconnect(struct afp_server *s); --void afp_wait_for_started_loop(void); -- -- --struct afp_versions * pick_version(unsigned char *versions, -- unsigned char requested) ; --int pick_uam(unsigned int u1, unsigned int u2); -- --int afp_server_login(struct afp_server *server, -- char * mesg, unsigned int *l, unsigned int max); -- -- --int afp_dologin(struct afp_server *server, -- unsigned int uam, char * username, char * passwd); -- --void afp_free_server(struct afp_server **server); -- --struct afp_server * afp_server_init(struct sockaddr_in * address); --int afp_get_address(void * priv, const char * hostname, unsigned int port, -- struct sockaddr_in * address); -- -- --int afp_main_loop(int command_fd); --int afp_main_quick_startup(pthread_t * thread); -- --int afp_server_destroy(struct afp_server *s) ; --int afp_server_reconnect(struct afp_server * s, char * mesg, -- unsigned int *l, unsigned int max); --int afp_server_connect(struct afp_server *s, int full); -- --struct afp_server * afp_server_complete_connection( -- void * priv, -- struct afp_server * server, -- struct sockaddr_in * address, unsigned char * versions, -- unsigned int uams, char * username, char * password, -- unsigned int requested_version, unsigned int uam_mask); -- --int afp_connect_volume(struct afp_volume * volume, struct afp_server * server, -- char * mesg, unsigned int * l, unsigned int max); --int something_is_mounted(struct afp_server * server); -- --int add_cache_entry(struct afp_file_info * file) ; --struct afp_file_info * get_cache_by_name(char * name); --struct afp_server * find_server_by_address(struct sockaddr_in * address); --struct afp_server * find_server_by_signature(char * signature); --struct afp_server * find_server_by_name(char * name); --int server_still_valid(struct afp_server * server); -- -- --struct afp_server * get_server_base(void); --int afp_server_remove(struct afp_server * server); -- --int afp_unmount_volume(struct afp_volume * volume); --int afp_unmount_all_volumes(struct afp_server * server); -- --#define volume_is_readonly(x) (((x)->attributes&kReadOnly) || \ -- ((x)->extra_flags & VOLUME_EXTRA_FLAGS_READONLY)) -- --int afp_opendt(struct afp_volume *volume, unsigned short * refnum); -- --int afp_closedt(struct afp_server * server, unsigned short * refnum); -- --int afp_getcomment(struct afp_volume *volume, unsigned int did, -- const char * pathname, struct afp_comment * comment); -- --int afp_addcomment(struct afp_volume *volume, unsigned int did, -- const char * pathname, char * comment,uint64_t *size); -- --int afp_geticon(struct afp_volume * volume, unsigned int filecreator, -- unsigned int filetype, unsigned char icontype, -- unsigned short length, struct afp_icon * icon); -- --/* Things you want to do to a server */ -- --int afp_getsrvrmsg(struct afp_server *server, unsigned short messagetype,unsigned char utf8, unsigned char block, char * mesg); -- --int afp_login(struct afp_server *server, char * uaname, -- char * userauthinfo, unsigned int userauthinfo_len, -- struct afp_rx_buffer *rx); -- --int afp_changepassword(struct afp_server *server, char * uaname, -- char * userauthinfo, unsigned int userauthinfo_len, -- struct afp_rx_buffer *rx); -- --int afp_logincont(struct afp_server *server, unsigned short id, -- char * userauthinfo, unsigned int userauthinfo_len, -- struct afp_rx_buffer *rx); -- --int afp_getsessiontoken(struct afp_server * server, int type, -- unsigned int timestamp, struct afp_token *outgoing_token, -- struct afp_token * incoming_token); -- --int afp_getsrvrparms(struct afp_server *server); -- --int afp_logout(struct afp_server *server,unsigned char wait); -- --int afp_mapname(struct afp_server * server, unsigned char subfunction, -- char * name, unsigned int * id); -- --int afp_mapid(struct afp_server * server, unsigned char subfunction, -- unsigned int id, char *name); -- --int afp_getuserinfo(struct afp_server * server, int thisuser, -- unsigned int userid, unsigned short bitmap, -- unsigned int *newuid, unsigned int *newgid); -- --int afp_zzzzz(struct afp_server *server); -- --int afp_volopen(struct afp_volume * volume, -- unsigned short bitmap, char * password); -- --int afp_flush(struct afp_volume * volume); -- --int afp_getfiledirparms(struct afp_volume *volume, unsigned int did, -- unsigned int filebitmap, unsigned int dirbitmap, const char * pathname, -- struct afp_file_info *fp); -- --int afp_enumerate(struct afp_volume * volume, -- unsigned int dirid, -- unsigned int filebitmap, unsigned int dirbitmap, -- unsigned short reqcount, -- unsigned short startindex, -- char * path, -- struct afp_file_info ** file_p); -- --int afp_enumerateext2(struct afp_volume * volume, -- unsigned int dirid, -- unsigned int filebitmap, unsigned int dirbitmap, -- unsigned short reqcount, -- unsigned long startindex, -- char * path, -- struct afp_file_info ** file_p); -- --int afp_openfork(struct afp_volume * volume, -- unsigned char forktype, -- unsigned int dirid, -- unsigned short accessmode, -- char * filename, -- struct afp_file_info *fp); -- --int afp_read(struct afp_volume * volume, unsigned short forkid, -- uint32_t offset, -- uint32_t count, struct afp_rx_buffer * rx); -- --int afp_readext(struct afp_volume * volume, unsigned short forkid, -- uint64_t offset, -- uint64_t count, struct afp_rx_buffer * rx); -- --int afp_getvolparms(struct afp_volume * volume, unsigned short bitmap); -- -- --int afp_createdir(struct afp_volume * volume, unsigned int dirid, const char * pathname, unsigned int *did_p); -- --int afp_delete(struct afp_volume * volume, -- unsigned int dirid, char * pathname); -- -- --int afp_createfile(struct afp_volume * volume, unsigned char flag, -- unsigned int did, char * pathname); -- --int afp_write(struct afp_volume * volume, unsigned short forkid, -- uint32_t offset, uint32_t reqcount, -- char * data, uint32_t * written); -- --int afp_writeext(struct afp_volume * volume, unsigned short forkid, -- uint64_t offset, uint64_t reqcount, -- char * data, uint64_t * written); -- --int afp_flushfork(struct afp_volume * volume, unsigned short forkid); -- --int afp_closefork(struct afp_volume * volume, unsigned short forkid); --int afp_setfileparms(struct afp_volume * volume, -- unsigned int dirid, const char * pathname, unsigned short bitmap, -- struct afp_file_info *fp); --int afp_setfiledirparms(struct afp_volume * volume, -- unsigned int dirid, const char * pathname, unsigned short bitmap, -- struct afp_file_info *fp); -- --int afp_setdirparms(struct afp_volume * volume, -- unsigned int dirid, const char * pathname, unsigned short bitmap, -- struct afp_file_info *fp); -- --int afp_volclose(struct afp_volume * volume); -- -- --int afp_setforkparms(struct afp_volume *volume, -- unsigned short forkid, unsigned short bitmap, unsigned long len); -- --int afp_byterangelock(struct afp_volume * volume, -- unsigned char flag, -- unsigned short forkid, -- uint32_t offset, -- uint32_t len, uint32_t *generated_offset); -- --int afp_byterangelockext(struct afp_volume * volume, -- unsigned char flag, -- unsigned short forkid, -- uint64_t offset, -- uint64_t len, uint64_t *generated_offset); -- --int afp_moveandrename(struct afp_volume *volume, -- unsigned int src_did, -- unsigned int dst_did, -- char * src_path, char * dst_path, char *new_name); -- --int afp_rename(struct afp_volume * volume, -- unsigned int dirid, -- char * path_from, char * path_to); -- --int afp_listextattr(struct afp_volume * volume, -- unsigned int dirid, unsigned short bitmap, -- char * pathname, struct afp_extattr_info * info); -- --/* This is a currently undocumented command */ --int afp_newcommand76(struct afp_volume * volume, unsigned int dlen, char * data); -- --/* For debugging */ --char * afp_get_command_name(char code); -- -- --#endif -diff -Naur afpfs-ng-0.8.1/include/afp_protocol.h afpfs-ng-0.8.1.patch/include/afp_protocol.h ---- afpfs-ng-0.8.1/include/afp_protocol.h 2008-02-18 04:33:43.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/afp_protocol.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,361 +0,0 @@ -- --#ifndef _AFP_PROTOCOL_H_ --#define _AFP_PROTOCOL_H_ -- --#include <sys/types.h> --#include <stddef.h> --#include <unistd.h> --#include <stdint.h> -- --/* This file defines constants for the Apple File Protocol. -- All page references are from "Apple Filing Protocol Programming" version 3.2. -- except where noted. --*/ -- --#define AFP_SERVER_NAME_LEN 33 --#define AFP_SERVER_NAME_UTF8_LEN 255 --#define AFP_VOLUME_NAME_LEN 33 --#define AFP_VOLUME_NAME_UTF8_LEN 33 --#define AFP_SIGNATURE_LEN 16 --#define AFP_MACHINETYPE_LEN 33 --#define AFP_LOGINMESG_LEN 200 --#define AFP_VOLPASS_LEN 8 --#define AFP_HOSTNAME_LEN 255 --/* This is actually just a guess, and only used for appletalk */ --#define AFP_ZONE_LEN 255 -- --#define AFP_SERVER_ICON_LEN 256 -- -- --#define AFP_MAX_USERNAME_LEN 127 --#define AFP_MAX_PASSWORD_LEN 127 -- -- --/* This is the maximum length of any UAM string */ --#define AFP_UAM_LENGTH 24 -- --/* This is the maximum length of any path description */ --#define AFP_MAX_PATH 768 -- --#define AFP_VOL_FLAT 1 --#define AFP_VOL_FIXED 2 --#define AFP_VOL_VARIABLE 3 -- --/* The root directory ID, p.26 */ -- --#define AFP_ROOT_DID 2 -- --/* Path type constants, p.249 */ -- --enum { --kFPShortName = 1, --kFPLongName = 2, --kFPUTF8Name = 3 --}; -- --/* fork types */ -- --#define AFP_FORKTYPE_DATA 0x0 --#define AFP_FORKTYPE_RESOURCE 0x80 -- --/* openfork access modes, from p.196 */ -- --#define AFP_OPENFORK_ALLOWREAD 1 --#define AFP_OPENFORK_ALLOWWRITE 2 --#define AFP_OPENFORK_DENYREAD 0x10 --#define AFP_OPENFORK_DENYWRITE 0x20 -- --/* Message type for getsrvmesg, p. 169*/ -- --typedef enum { -- AFPMESG_LOGIN = 0, -- AFPMESG_SERVER = 1 --} afpmessage_t; -- --/* Message bitmap for getsrvrmsg */ -- --#define AFP_GETSRVRMSG_UTF8 0x2 --#define AFP_GETSRVRMSG_GETMSG 0x1 -- -- --/* Maximum Version length, p.17 */ --#define AFP_MAX_VERSION_LENGTH 16 -- --/* Maximum length of a token, this is undocumented */ --#define AFP_TOKEN_MAX_LEN 256 -- --/* The maximum size of a file for AFP 2 */ --#define AFP_MAX_AFP2_FILESIZE (4294967296) -- --/* Unix privs, p.240 */ -- --struct afp_unixprivs { -- uint32_t uid __attribute__((__packed__)); -- uint32_t gid __attribute__((__packed__)); -- uint32_t permissions __attribute__((__packed__)); -- uint32_t ua_permissions __attribute__((__packed__)); -- --}; -- -- --/* AFP Volume attributes bitmap, p.241 */ -- --enum { -- kReadOnly = 0x01, -- kHasVolumePassword = 0x02, -- kSupportsFileIDs = 0x04, -- kSupportsCatSearch = 0x08, -- kSupportsBlankAccessPrivs = 0x10, -- kSupportsUnixPrivs = 0x20, -- kSupportsUTF8Names = 0x40, -- kNoNetworkUserIDs = 0x80, -- kDefaultPrivsFromParent = 0x100, -- kNoExchangeFiles = 0x200, -- kSupportsExtAttrs = 0x400, -- kSupportsACLs=0x800 --}; -- --/* AFP file creation constantes, p.250 */ --enum { --kFPSoftCreate = 0, --kFPHardCreate = 0x80 --}; -- --/* AFP Directory attributes, taken from the protocol guide p.236 */ -- --enum { -- kFPAttributeBit = 0x1, -- kFPParentDirIDBit = 0x2, -- kFPCreateDateBit = 0x4, -- kFPModDateBit = 0x8, -- kFPBackupDateBit = 0x10, -- kFPFinderInfoBit = 0x20, -- kFPLongNameBit = 0x40, -- kFPShortNameBit = 0x80, -- kFPNodeIDBit = 0x100, -- kFPOffspringCountBit = 0x0200, -- kFPOwnerIDBit = 0x0400, -- kFPGroupIDBit = 0x0800, -- kFPAccessRightsBit = 0x1000, -- kFPProDOSInfoBit = 0x2000, // AFP version 2.2 and earlier -- kFPUTF8NameBit = 0x2000, // AFP version 3.0 and later -- kFPUnixPrivsBit = 0x8000 // AFP version 3.0 and later --}; -- --/* AFP File bitmap, p.238. These are the ones not in the AFP Directory -- attributes map. */ -- --enum { -- kFPDataForkLenBit = 0x0200, -- kFPRsrcForkLenBit = 0x0400, -- kFPExtDataForkLenBit = 0x0800, // AFP version 3.0 and later -- kFPLaunchLimitBit = 0x1000, -- kFPExtRsrcForkLenBit = 0x4000, // AFP version 3.0 and later --}; -- --/* AFP Extended Attributes Bitmap, p.238 */ -- --enum { -- kXAttrNoFollow = 0x1, -- kXAttrCreate = 0x2, -- kXAttrREplace=0x4 --}; -- -- --/* AFP function codes */ --enum AFPFunction --{ -- afpByteRangeLock = 1, afpCloseVol, afpCloseDir, afpCloseFork, -- afpCopyFile, afpCreateDir, afpCreateFile, -- afpDelete, afpEnumerate, afpFlush, afpFlushFork, -- afpGetForkParms = 14, afpGetSrvrInfo, afpGetSrvrParms, -- afpGetVolParms, afpLogin, afpLoginCont, afpLogout, afpMapID, -- afpMapName, afpMoveAndRename, afpOpenVol, afpOpenDir, afpOpenFork, -- afpRead, afpRename, afpSetDirParms, afpSetFileParms, -- afpSetForkParms, afpSetVolParms, afpWrite, afpGetFileDirParms, -- afpSetFileDirParms, afpChangePassword, -- afpGetUserInfo=37,afpGetSrvrMsg = 38, -- afpOpenDT=48, -- afpCloseDT=49, -- afpGetIcon=51, afpGetIconInfo=52, -- afpAddComment=56, afpRemoveComment=57, afpGetComment=58, -- afpByteRangeLockExt=59, afpReadExt, afpWriteExt, -- afpGetAuthMethods=62, -- afp_LoginExt=63, -- afpGetSessionToken=64, -- afpDisconnectOldSession=65, -- afpEnumerateExt=66, -- afpCatSearchExt = 67, -- afpEnumerateExt2 = 68, afpGetExtAttr, afpSetExtAttr, -- afpRemoveExtAttr , afpListExtAttrs, -- afpZzzzz = 122, -- afpAddIcon=192, --}; -- --/* AFP Volume bitmap. Take from 242 of the protocol guide. */ --enum { -- kFPBadVolPre222Bitmap = 0xFe00, -- kFPBadVolBitmap = 0xF000, -- kFPVolAttributeBit = 0x1, -- kFPVolSignatureBit = 0x2, -- kFPVolCreateDateBit = 0x4, -- kFPVolModDateBit = 0x8, -- kFPVolBackupDateBit = 0x10, -- kFPVolIDBit = 0x20, -- kFPVolBytesFreeBit = 0x40, -- kFPVolBytesTotalBit = 0x80, -- kFPVolNameBit = 0x100, -- kFPVolExtBytesFreeBit = 0x200, -- kFPVolExtBytesTotalBit = 0x400, -- kFPVolBlockSizeBit = 0x800 --}; -- --/* AFP Attention Codes -- 4 bits */ --#define AFPATTN_SHUTDOWN (1 << 15) /* shutdown/disconnect */ --#define AFPATTN_CRASH (1 << 14) /* server crashed */ --#define AFPATTN_MESG (1 << 13) /* server has message */ --#define AFPATTN_NORECONNECT (1 << 12) /* don't reconnect */ --/* server notification */ --#define AFPATTN_NOTIFY (AFPATTN_MESG | AFPATTN_NORECONNECT) -- --/* extended bitmap -- 12 bits. volchanged is only useful w/ a server -- * notification, and time is only useful for shutdown. */ --#define AFPATTN_VOLCHANGED (1 << 0) /* volume has changed */ --#define AFPATTN_TIME(x) ((x) & 0xfff) /* time in minutes */ -- --#define kFPNoErr 0 -- --/* AFP result codes, p252 */ --#define kASPSessClosed -1072 --#define kFPAccessDenied -5000 --#define kFPAuthContinue -5001 --#define kFPBadUAM -5002 --#define kFPBadVersNum -5003 --#define kFPBitmapErr -5004 --#define kFPCantMove -5005 --#define kFPDenyConflict -5006 --#define kFPDirNotEmpty -5007 --#define kFPDiskFull -5008 --#define kFPEOFErr -5009 --#define kFPFileBusy -5010 --#define kFPFlatVol -5011 --#define kFPItemNotFound -5012 --#define kFPLockErr -5013 --#define kFPMiscErr -5014 --#define kFPNoMoreLocks -5015 --#define kFPNoServer -5016 --#define kFPObjectExists -5017 --#define kFPObjectNotFound -5018 --#define kFPParamErr -5019 --#define kFPRangeNotLocked -5020 --#define kFPRangeOverlap -5021 --#define kFPSessClosed -5022 --#define kFPUserNotAuth -5023 --#define kFPCallNotSupported -5024 --#define kFPObjectTypeErr -5025 --#define kFPTooManyFilesOpen -5026 --#define kFPServerGoingDown -5027 --#define kFPCantRename -5028 --#define kFPDirNotFound -5029 --#define kFPIconTypeError -5030 --#define kFPVolLocked -5031 --#define kFPObjectLocked -5032 --#define kFPContainsSharedErr -5033 --#define kFPIDNotFound -5034 --#define kFPIDExists -5035 --#define kFPDiffVolErr -5036 --#define kFPCatalogChanged -5037 --#define kFPSameObjectErr -5038 --#define kFPBadIDErr -5039 --#define kFPPwdSameErr -5040 --#define kFPPwdTooShortErr -5041 --#define kFPPwdExpiredErr -5042 --#define kFPInsideSharedErr -5043 --#define kFPInsideTrashErr -5044 --#define kFPPwdNeedsChangeErr -5045 --#define kFPPwdPolicyErr -5046 --#define kFPDiskQuotaExceeded –5047 -- -- -- --/* These flags determine to lock or unlock in ByteRangeLock(Ext) */ -- --enum { --ByteRangeLock_Lock = 0, --ByteRangeLock_Unlock = 1 --}; -- --/* These flags are used in volopen and getsrvrparm replies, p.171 */ -- --#define HasConfigInfo 0x1 --#define HasPassword 0x80 -- --/* These are the subfunction for kFPMapID, as per p.248 */ -- --enum { --kUserIDToName = 1, --kGroupIDToName = 2, --kUserIDToUTF8Name = 3, --kGroupIDToUTF8Name = 4, --kUserUUIDToUTF8Name = 5, --kGroupUUIDToUTF8Name = 6 --}; -- -- --/* These are the subfunction flags described in the FPMapName command, p.286. -- Note that this is different than what's described on p. 186. */ -- --enum { --kNameToUserID = 1, --kNameToGroupID = 2, --kUTF8NameToUserID = 3, --kUTF8NameToGroupID = 4, --kUTF8NameToUserUUID = 5, --kUTF8NameToGroupUUID = 6 --}; -- --/* These are bits for FPGetUserInfo, p.173. */ --#define kFPGetUserInfo_USER_ID 1 --#define kFPGetUserInfo_PRI_GROUPID 2 -- --/* Flags for the replies of GetSrvrInfo and DSI GetStatus, p.240 */ -- --enum { -- kSupportsCopyfile = 0x01, -- kSupportsChgPwd = 0x02, -- kDontAllowSavePwd = 0x04, -- kSupportsSrvrMsg = 0x08, -- kSrvrSig = 0x10, -- kSupportsTCP = 0x20, -- kSupportsSrvrNotify = 0x40, -- kSupportsReconnect = 0x80, -- kSupportsDirServices = 0x100, -- kSupportsUTF8SrvrName = 0x200, -- kSupportsUUIDs = 0x400, -- kSupportsSuperClient = 0x8000 --}; -- -- --/* p.247 */ -- --enum { -- kLoginWithoutID = 0, -- kLoginWithID = 1, -- kReconnWithID = 2, -- kLoginWithTimeAndID = 3, -- kReconnWithTimeAndID = 4, -- kRecon1Login = 5, -- kRecon1ReconnectLogin = 6, -- kRecon1Refresh = 7, kGetKerberosSessionKey = 8 --}; -- -- --#define AFP_CHMOD_ALLOWED_BITS_22 \ -- (S_IRUSR |S_IWUSR | S_IRGRP | S_IWGRP |S_IROTH | S_IWOTH | S_IFREG ) -- -- --#endif -- -- -- -- -diff -Naur afpfs-ng-0.8.1/include/codepage.h afpfs-ng-0.8.1.patch/include/codepage.h ---- afpfs-ng-0.8.1/include/codepage.h 2007-09-23 16:21:30.000000000 +0200 -+++ afpfs-ng-0.8.1.patch/include/codepage.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,11 +0,0 @@ --#ifndef __CODE_PAGE_H_ --#define __CODE_PAGE_H_ --int convert_utf8dec_to_utf8pre(const char *src, int src_len, -- char * dest, int dest_len); --int convert_utf8pre_to_utf8dec(const char * src, int src_len, -- char * dest, int dest_len); --int convert_path_to_unix(char encoding, char * dest, -- char * src, int dest_len); --int convert_path_to_afp(char encoding, char * dest, -- char * src, int dest_len); --#endif -diff -Naur afpfs-ng-0.8.1/include/dsi.h afpfs-ng-0.8.1.patch/include/dsi.h ---- afpfs-ng-0.8.1/include/dsi.h 2008-02-18 04:33:24.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/dsi.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,33 +0,0 @@ -- --#ifndef __DSI_H_ --#define __DSI_H_ -- --#include "afp.h" -- --struct dsi_request --{ -- unsigned short requestid; -- unsigned char subcommand; -- void * other; -- unsigned char wait; -- pthread_cond_t condition_cond; -- struct dsi_request * next; -- int return_code; --}; -- --int dsi_receive(struct afp_server * server, void * data, int size); --int dsi_getstatus(struct afp_server * server); -- --int dsi_opensession(struct afp_server *server); -- --int dsi_send(struct afp_server *server, char * msg, int size,int wait,unsigned char subcommand, void ** other); --struct dsi_session * dsi_create(struct afp_server *server); --int dsi_restart(struct afp_server *server); --int dsi_recv(struct afp_server * server); -- --#define DSI_BLOCK_TIMEOUT -1 --#define DSI_DONT_WAIT 0 --#define DSI_DEFAULT_TIMEOUT 5 -- -- --#endif -diff -Naur afpfs-ng-0.8.1/include/libafpclient.h afpfs-ng-0.8.1.patch/include/libafpclient.h ---- afpfs-ng-0.8.1/include/libafpclient.h 2008-01-30 05:37:59.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/libafpclient.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,50 +0,0 @@ -- --#ifndef __CLIENT_H_ --#define __CLIENT_H_ -- --#include <unistd.h> --#include <syslog.h> -- --#define MAX_CLIENT_RESPONSE 2048 -- -- --enum loglevels { -- AFPFSD, --}; -- --struct afp_server; --struct afp_volume; -- --struct libafpclient { -- int (*unmount_volume) (struct afp_volume * volume); -- void (*log_for_client)(void * priv, -- enum loglevels loglevel, int logtype, const char *message); -- void (*forced_ending_hook)(void); -- int (*scan_extra_fds)(int command_fd,fd_set *set, int * max_fd); -- void (*loop_started)(void); --} ; -- --extern struct libafpclient * libafpclient; -- --void libafpclient_register(struct libafpclient * tmpclient); -- -- --void signal_main_thread(void); -- --/* These are logging functions */ -- --#define MAXLOGSIZE 2048 -- --#define LOG_METHOD_SYSLOG 1 --#define LOG_METHOD_STDOUT 2 -- --void set_log_method(int m); -- -- --void log_for_client(void * priv, -- enum loglevels loglevel, int logtype, char * message,...); -- --void stdout_log_for_client(void * priv, -- enum loglevels loglevel, int logtype, const char *message); -- --#endif -diff -Naur afpfs-ng-0.8.1/include/Makefile.am afpfs-ng-0.8.1.patch/include/Makefile.am ---- afpfs-ng-0.8.1/include/Makefile.am 1970-01-01 01:00:00.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/Makefile.am 2011-09-10 12:13:50.126124692 +0200 -@@ -0,0 +1,3 @@ -+## Process this file with automake to produce Makefile.in -+ -+SUBDIRS = afpfs-ng -diff -Naur afpfs-ng-0.8.1/include/map_def.h afpfs-ng-0.8.1.patch/include/map_def.h ---- afpfs-ng-0.8.1/include/map_def.h 2008-01-17 05:55:46.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/map_def.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,15 +0,0 @@ --#ifndef __MAP_H_ --#define __MAP_H_ -- --#include "afp.h" -- --#define AFP_MAPPING_UNKNOWN 0 --#define AFP_MAPPING_COMMON 1 --#define AFP_MAPPING_LOGINIDS 2 --#define AFP_MAPPING_NAME 3 -- --unsigned int map_string_to_num(char * name); --char * get_mapping_name(struct afp_volume * volume); -- -- --#endif -diff -Naur afpfs-ng-0.8.1/include/midlevel.h afpfs-ng-0.8.1.patch/include/midlevel.h ---- afpfs-ng-0.8.1/include/midlevel.h 2007-12-24 20:39:25.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/midlevel.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,64 +0,0 @@ --#ifndef __MIDLEVEL_H_ --#define __MIDLEVEL_H_ -- --#include <utime.h> --#include "afp.h" -- --int ml_open(struct afp_volume * volume, const char *path, int flags, -- struct afp_file_info **newfp); -- --int ml_creat(struct afp_volume * volume, const char *path,mode_t mode); -- --int ml_readdir(struct afp_volume * volume, -- const char *path, -- struct afp_file_info **base); -- --int ml_read(struct afp_volume * volume, const char *path, -- char *buf, size_t size, off_t offset, -- struct afp_file_info *fp, int * eof); -- --int ml_chmod(struct afp_volume * vol, const char * path, mode_t mode); -- --int ml_unlink(struct afp_volume * vol, const char *path); -- --int ml_mkdir(struct afp_volume * vol, const char * path, mode_t mode); -- --int ml_close(struct afp_volume * volume, const char * path, -- struct afp_file_info * fp); -- --int ml_getattr(struct afp_volume * volume, const char *path, -- struct stat *stbuf); -- --int ml_write(struct afp_volume * volume, const char * path, -- const char *data, size_t size, off_t offset, -- struct afp_file_info * fp, uid_t uid, -- gid_t gid); -- --int ml_readlink(struct afp_volume * vol, const char * path, -- char *buf, size_t size); -- --int ml_rmdir(struct afp_volume * vol, const char *path); -- --int ml_chown(struct afp_volume * vol, const char * path, -- uid_t uid, gid_t gid); -- --int ml_truncate(struct afp_volume * vol, const char * path, off_t offset); -- --int ml_utime(struct afp_volume * vol, const char * path, -- struct utimbuf * timebuf); -- --int ml_symlink(struct afp_volume *vol, const char * path1, const char * path2); -- --int ml_rename(struct afp_volume * vol, -- const char * path_from, const char * path_to); -- --int ml_statfs(struct afp_volume * vol, const char *path, struct statvfs *stat); -- --void afp_ml_filebase_free(struct afp_file_info **filebase); -- --int ml_passwd(struct afp_server *server, -- char * username, char * oldpasswd, char * newpasswd); -- -- -- --#endif -diff -Naur afpfs-ng-0.8.1/include/uams_def.h afpfs-ng-0.8.1.patch/include/uams_def.h ---- afpfs-ng-0.8.1/include/uams_def.h 2007-09-07 15:10:51.000000000 +0200 -+++ afpfs-ng-0.8.1.patch/include/uams_def.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,16 +0,0 @@ --#ifndef __UAM_DEFS_H_ --#define __UAM_DEFS_H_ -- --#define UAM_NOUSERAUTHENT 0x1 --#define UAM_CLEARTXTPASSWRD 0x2 --#define UAM_RANDNUMEXCHANGE 0x4 --#define UAM_2WAYRANDNUM 0x8 --#define UAM_DHCAST128 0x10 --#define UAM_CLIENTKRB 0x20 --#define UAM_DHX2 0x40 --#define UAM_RECON1 0x80 -- --int uam_string_to_bitmap(char * name); --char * uam_bitmap_to_string(unsigned int bitmap); -- --#endif -diff -Naur afpfs-ng-0.8.1/include/utils.h afpfs-ng-0.8.1.patch/include/utils.h ---- afpfs-ng-0.8.1/include/utils.h 2008-02-18 04:33:58.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/include/utils.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,43 +0,0 @@ --#ifndef __UTILS_H_ --#define __UTILS_H_ --#include <stdio.h> -- --#include "afp.h" -- --#if BYTE_ORDER == BIG_ENDIAN --#define hton64(x) (x) --#define ntoh64(x) (x) --#else /* BYTE_ORDER == BIG_ENDIAN */ --#define hton64(x) ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \ -- (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32)) --#define ntoh64(x) (hton64(x)) --#endif /* BYTE_ORDER == BIG_ENDIAN */ -- --#define min(a,b) (((a)<(b)) ? (a) : (b)) --#define max(a,b) (((a)>(b)) ? (a) : (b)) -- -- -- --unsigned char unixpath_to_afppath( -- struct afp_server * server, -- char * buf); -- --unsigned char sizeof_path_header(struct afp_server * server); -- -- -- --unsigned char copy_from_pascal(char *dest, char *pascal,unsigned int max_len) ; --unsigned short copy_from_pascal_two(char *dest, char *pascal,unsigned int max_len); -- --unsigned char copy_to_pascal(char *dest, const char *src); --unsigned short copy_to_pascal_two(char *dest, const char *src); -- --void copy_path(struct afp_server * server, char * dest, const char * pathname, unsigned char len); -- -- --char * create_path(struct afp_server * server, char * pathname, unsigned short * len); -- -- --int invalid_filename(struct afp_server * server, const char * filename); -- --#endif -diff -Naur afpfs-ng-0.8.1/lib/afp.c afpfs-ng-0.8.1.patch/lib/afp.c ---- afpfs-ng-0.8.1/lib/afp.c 2008-03-08 03:44:16.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/afp.c 2011-09-10 12:13:50.131124759 +0200 -@@ -9,7 +9,7 @@ - - - --#include "afp.h" -+#include "afpfs-ng/afp.h" - #include <config.h> - - #include <stdio.h> -@@ -21,17 +21,17 @@ - #include <sys/socket.h> - #include <errno.h> - --#include "afp_protocol.h" --#include "libafpclient.h" -+#include "afpfs-ng/afp_protocol.h" -+#include "afpfs-ng/libafpclient.h" - #include "server.h" --#include "dsi.h" -+#include "afpfs-ng/dsi.h" - #include "dsi_protocol.h" --#include "utils.h" -+#include "afpfs-ng/utils.h" - #include "afp_replies.h" - #include "afp_internal.h" - #include "did.h" - #include "forklist.h" --#include "codepage.h" -+#include "afpfs-ng/codepage.h" - - struct afp_versions afp_versions[] = { - { "AFPVersion 1.1", 11 }, -diff -Naur afpfs-ng-0.8.1/lib/afp_internal.h afpfs-ng-0.8.1.patch/lib/afp_internal.h ---- afpfs-ng-0.8.1/lib/afp_internal.h 2007-11-09 05:27:20.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/afp_internal.h 2011-09-10 12:13:50.132124772 +0200 -@@ -1,7 +1,7 @@ - #ifndef _AFP_INTERNAL_H_ - #define _AFP_INTERNAL_H_ - --#include "afp.h" -+#include "afpfs-ng/afp.h" - - extern struct afp_versions afp_versions[]; - -diff -Naur afpfs-ng-0.8.1/lib/afp_url.c afpfs-ng-0.8.1.patch/lib/afp_url.c ---- afpfs-ng-0.8.1/lib/afp_url.c 2008-03-04 21:16:49.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/afp_url.c 2011-09-10 12:13:50.132124772 +0200 -@@ -3,7 +3,7 @@ - #include <stdio.h> - #include <stdlib.h> - #include <errno.h> --#include "afp.h" -+#include "afpfs-ng/afp.h" - - void afp_default_url(struct afp_url *url) - { -diff -Naur afpfs-ng-0.8.1/lib/client.c afpfs-ng-0.8.1.patch/lib/client.c ---- afpfs-ng-0.8.1/lib/client.c 2008-02-18 04:36:30.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/client.c 2011-09-10 12:13:50.132124772 +0200 -@@ -1,5 +1,5 @@ --#include <afp.h> --#include <libafpclient.h> -+#include <afpfs-ng/afp.h> -+#include <afpfs-ng/libafpclient.h> - - - struct libafpclient * libafpclient = NULL; -diff -Naur afpfs-ng-0.8.1/lib/codepage.c afpfs-ng-0.8.1.patch/lib/codepage.c ---- afpfs-ng-0.8.1/lib/codepage.c 2008-02-18 04:36:54.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/codepage.c 2011-09-10 12:13:50.133124786 +0200 -@@ -14,8 +14,8 @@ - - #include <string.h> - #include <stdlib.h> --#include "afp_protocol.h" --#include "utils.h" -+#include "afpfs-ng/afp_protocol.h" -+#include "afpfs-ng/utils.h" - #include "unicode.h" - - int convert_utf8dec_to_utf8pre(const char *src, int src_len, -diff -Naur afpfs-ng-0.8.1/lib/connect.c afpfs-ng-0.8.1.patch/lib/connect.c ---- afpfs-ng-0.8.1/lib/connect.c 2008-02-18 04:38:59.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/connect.c 2011-09-10 12:13:50.133124786 +0200 -@@ -10,13 +10,13 @@ - #include <string.h> - #include <sys/socket.h> - --#include "afp.h" --#include "dsi.h" --#include "utils.h" --#include "uams_def.h" --#include "codepage.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/utils.h" -+#include "afpfs-ng/uams_def.h" -+#include "afpfs-ng/codepage.h" - #include "users.h" --#include "libafpclient.h" -+#include "afpfs-ng/libafpclient.h" - #include "server.h" - - -diff -Naur afpfs-ng-0.8.1/lib/did.c afpfs-ng-0.8.1.patch/lib/did.c ---- afpfs-ng-0.8.1/lib/did.c 2008-02-18 04:39:17.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/did.c 2011-09-10 12:13:50.133124786 +0200 -@@ -9,8 +9,8 @@ - #include <string.h> - #include <stdio.h> - --#include "afp.h" --#include "afp_protocol.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/afp_protocol.h" - - #undef DID_CACHE_DISABLE - -diff -Naur afpfs-ng-0.8.1/lib/dsi.c afpfs-ng-0.8.1.patch/lib/dsi.c ---- afpfs-ng-0.8.1/lib/dsi.c 2008-02-18 04:53:03.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/dsi.c 2011-09-10 12:13:50.134124800 +0200 -@@ -19,12 +19,12 @@ - #include <signal.h> - #include <iconv.h> - --#include "utils.h" --#include "dsi.h" --#include "afp.h" --#include "uams_def.h" -+#include "afpfs-ng/utils.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/uams_def.h" - #include "dsi_protocol.h" --#include "libafpclient.h" -+#include "afpfs-ng/libafpclient.h" - #include "afp_internal.h" - #include "afp_replies.h" - -diff -Naur afpfs-ng-0.8.1/lib/forklist.c afpfs-ng-0.8.1.patch/lib/forklist.c ---- afpfs-ng-0.8.1/lib/forklist.c 2008-01-17 05:49:16.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/forklist.c 2011-09-10 12:13:50.135124814 +0200 -@@ -10,7 +10,7 @@ - */ - - --#include "afp.h" -+#include "afpfs-ng/afp.h" - - #include <stdlib.h> - #include <pthread.h> -diff -Naur afpfs-ng-0.8.1/lib/log.c afpfs-ng-0.8.1.patch/lib/log.c ---- afpfs-ng-0.8.1/lib/log.c 2008-01-30 05:37:58.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/log.c 2011-09-10 12:13:50.135124814 +0200 -@@ -3,7 +3,7 @@ - #include <stdarg.h> - #include <string.h> - #include <stdlib.h> --#include "libafpclient.h" -+#include "afpfs-ng/libafpclient.h" - - void log_for_client(void * priv, - enum loglevels loglevel, int logtype, char *format, ...) { -diff -Naur afpfs-ng-0.8.1/lib/loop.c afpfs-ng-0.8.1.patch/lib/loop.c ---- afpfs-ng-0.8.1/lib/loop.c 2008-02-18 04:40:11.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/loop.c 2011-09-10 12:13:50.135124814 +0200 -@@ -16,9 +16,9 @@ - #include <sys/time.h> - #include <signal.h> - --#include "afp.h" --#include "dsi.h" --#include "utils.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/utils.h" - - #define SIGNAL_TO_USE SIGUSR2 - -@@ -85,7 +85,7 @@ void signal_main_thread(void) - } - - static int ending=0; --void * just_end_it_now(void * ignore) -+void just_end_it_now(void * ignore) - { - if (ending) return; - ending=1; - -diff -Naur afpfs-ng-0.8.1/lib/lowlevel.c afpfs-ng-0.8.1.patch/lib/lowlevel.c ---- afpfs-ng-0.8.1/lib/lowlevel.c 2008-02-20 02:33:17.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/lowlevel.c 2011-09-10 12:13:50.136124828 +0200 -@@ -19,10 +19,10 @@ - #else - #include <fcntl.h> - #endif --#include "afp.h" --#include "afp_protocol.h" --#include "codepage.h" --#include "utils.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/afp_protocol.h" -+#include "afpfs-ng/codepage.h" -+#include "afpfs-ng/utils.h" - #include "did.h" - #include "users.h" - -diff -Naur afpfs-ng-0.8.1/lib/map_def.c afpfs-ng-0.8.1.patch/lib/map_def.c ---- afpfs-ng-0.8.1/lib/map_def.c 2007-09-07 15:10:59.000000000 +0200 -+++ afpfs-ng-0.8.1.patch/lib/map_def.c 2011-09-10 12:13:50.136124828 +0200 -@@ -1,6 +1,6 @@ - #include <string.h> --#include "afp.h" --#include "map_def.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/map_def.h" - - static char *afp_map_strings[] = { - "Unknown", -diff -Naur afpfs-ng-0.8.1/lib/meta.c afpfs-ng-0.8.1.patch/lib/meta.c ---- afpfs-ng-0.8.1/lib/meta.c 2008-01-04 04:52:44.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/meta.c 2011-09-10 12:13:50.137124841 +0200 -@@ -17,10 +17,10 @@ - #include <unistd.h> - #include <sys/time.h> - --#include "afp.h" --#include "dsi.h" --#include "afp_protocol.h" --#include "utils.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp_protocol.h" -+#include "afpfs-ng/utils.h" - - - int afp_meta_getattr(const char *path, struct stat *stbuf) -diff -Naur afpfs-ng-0.8.1/lib/midlevel.c afpfs-ng-0.8.1.patch/lib/midlevel.c ---- afpfs-ng-0.8.1/lib/midlevel.c 2008-03-08 17:08:18.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/midlevel.c 2011-09-10 12:13:50.160125150 +0200 -@@ -10,7 +10,7 @@ - */ - - --#include "afp.h" -+#include "afpfs-ng/afp.h" - - #include <sys/stat.h> - #include <string.h> -@@ -28,9 +28,9 @@ - #include "users.h" - #include "did.h" - #include "resource.h" --#include "utils.h" --#include "codepage.h" --#include "midlevel.h" -+#include "afpfs-ng/utils.h" -+#include "afpfs-ng/codepage.h" -+#include "afpfs-ng/midlevel.h" - #include "afp_internal.h" - #include "forklist.h" - #include "uams.h" -diff -Naur afpfs-ng-0.8.1/lib/proto_attr.c afpfs-ng-0.8.1.patch/lib/proto_attr.c ---- afpfs-ng-0.8.1/lib/proto_attr.c 2008-01-30 05:37:58.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_attr.c 2011-09-10 12:13:50.168125257 +0200 -@@ -7,10 +7,10 @@ - - #include <string.h> - #include <stdlib.h> --#include "dsi.h" --#include "afp.h" --#include "utils.h" --#include "afp_protocol.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" -+#include "afpfs-ng/afp_protocol.h" - #include "dsi_protocol.h" - - /* This is a new command, function 76. There are currently no docs, so this -diff -Naur afpfs-ng-0.8.1/lib/proto_desktop.c afpfs-ng-0.8.1.patch/lib/proto_desktop.c ---- afpfs-ng-0.8.1/lib/proto_desktop.c 2008-02-18 04:44:11.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_desktop.c 2011-09-10 12:13:50.168125257 +0200 -@@ -9,10 +9,10 @@ - #include <string.h> - #include <stdlib.h> - --#include "dsi.h" --#include "afp.h" --#include "utils.h" --#include "afp_protocol.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" -+#include "afpfs-ng/afp_protocol.h" - #include "dsi_protocol.h" - - /* closedt, addicon, geticoninfo, addappl, removeappl */ -diff -Naur afpfs-ng-0.8.1/lib/proto_directory.c afpfs-ng-0.8.1.patch/lib/proto_directory.c ---- afpfs-ng-0.8.1/lib/proto_directory.c 2008-02-19 03:39:29.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_directory.c 2011-09-10 12:13:50.168125257 +0200 -@@ -9,10 +9,10 @@ - #include <string.h> - #include <stdlib.h> - --#include "dsi.h" --#include "afp.h" --#include "utils.h" --#include "afp_protocol.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" -+#include "afpfs-ng/afp_protocol.h" - #include "dsi_protocol.h" - #include "afp_replies.h" - -diff -Naur afpfs-ng-0.8.1/lib/proto_files.c afpfs-ng-0.8.1.patch/lib/proto_files.c ---- afpfs-ng-0.8.1/lib/proto_files.c 2008-02-18 04:46:18.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_files.c 2011-09-10 12:13:50.169125270 +0200 -@@ -8,11 +8,11 @@ - - #include <stdlib.h> - #include <string.h> --#include "dsi.h" --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - #include "dsi_protocol.h" --#include "afp_protocol.h" -+#include "afpfs-ng/afp_protocol.h" - #include "afp_internal.h" - - /* afp_setfileparms, afp_setdirparms and afpsetfiledirparms are all remarkably -diff -Naur afpfs-ng-0.8.1/lib/proto_fork.c afpfs-ng-0.8.1.patch/lib/proto_fork.c ---- afpfs-ng-0.8.1/lib/proto_fork.c 2008-01-30 05:37:58.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_fork.c 2011-09-10 12:13:50.169125270 +0200 -@@ -9,11 +9,11 @@ - #include <stdlib.h> - #include <string.h> - --#include "dsi.h" --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - #include "dsi_protocol.h" --#include "afp_protocol.h" -+#include "afpfs-ng/afp_protocol.h" - - int afp_setforkparms(struct afp_volume * volume, - unsigned short forkid, unsigned short bitmap, unsigned long len) -diff -Naur afpfs-ng-0.8.1/lib/proto_login.c afpfs-ng-0.8.1.patch/lib/proto_login.c ---- afpfs-ng-0.8.1/lib/proto_login.c 2008-01-30 05:37:59.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_login.c 2011-09-10 12:13:50.169125270 +0200 -@@ -10,10 +10,10 @@ - - #include <stdlib.h> - #include <string.h> --#include "dsi.h" -+#include "afpfs-ng/dsi.h" - #include "dsi_protocol.h" --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - #include "afp_internal.h" - - -diff -Naur afpfs-ng-0.8.1/lib/proto_map.c afpfs-ng-0.8.1.patch/lib/proto_map.c ---- afpfs-ng-0.8.1/lib/proto_map.c 2008-01-30 05:37:59.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_map.c 2011-09-10 12:13:50.170125283 +0200 -@@ -9,11 +9,11 @@ - #include <stdlib.h> - #include <string.h> - --#include "dsi.h" --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - #include "dsi_protocol.h" --#include "afp_protocol.h" -+#include "afpfs-ng/afp_protocol.h" - - /* This is used to pass the return values back from afp_getuserinfo_reply() */ - struct uidgid { -diff -Naur afpfs-ng-0.8.1/lib/proto_replyblock.c afpfs-ng-0.8.1.patch/lib/proto_replyblock.c ---- afpfs-ng-0.8.1/lib/proto_replyblock.c 2008-02-18 04:46:19.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_replyblock.c 2011-09-10 12:13:50.170125283 +0200 -@@ -6,9 +6,9 @@ - */ - - #include <string.h> --#include "dsi.h" --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - #include "afp_internal.h" - - -diff -Naur afpfs-ng-0.8.1/lib/proto_server.c afpfs-ng-0.8.1.patch/lib/proto_server.c ---- afpfs-ng-0.8.1/lib/proto_server.c 2008-02-19 02:56:21.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_server.c 2011-09-10 12:13:50.170125283 +0200 -@@ -7,12 +7,12 @@ - */ - #include <stdlib.h> - #include <string.h> --#include "dsi.h" --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - #include "dsi_protocol.h" --#include "afp_protocol.h" --#include "codepage.h" -+#include "afpfs-ng/afp_protocol.h" -+#include "afpfs-ng/codepage.h" - #include "afp_internal.h" - - int afp_getsrvrparms(struct afp_server *server) -diff -Naur afpfs-ng-0.8.1/lib/proto_session.c afpfs-ng-0.8.1.patch/lib/proto_session.c ---- afpfs-ng-0.8.1/lib/proto_session.c 2008-02-18 04:46:19.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_session.c 2011-09-10 12:13:50.170125283 +0200 -@@ -8,10 +8,10 @@ - */ - #include <stdlib.h> - #include <string.h> --#include "dsi.h" -+#include "afpfs-ng/dsi.h" - #include "dsi_protocol.h" --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - - int afp_getsessiontoken(struct afp_server * server, int type, - unsigned int timestamp, struct afp_token *outgoing_token, -diff -Naur afpfs-ng-0.8.1/lib/proto_volume.c afpfs-ng-0.8.1.patch/lib/proto_volume.c ---- afpfs-ng-0.8.1/lib/proto_volume.c 2008-02-18 04:47:48.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/proto_volume.c 2011-09-10 12:13:50.171125296 +0200 -@@ -8,13 +8,13 @@ - - #include <string.h> - #include <stdlib.h> --#include "dsi.h" --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - #include "dsi_protocol.h" --#include "afp_protocol.h" -+#include "afpfs-ng/afp_protocol.h" - #include "afp_internal.h" --#include "codepage.h" -+#include "afpfs-ng/codepage.h" - - static int parse_volbitmap_reply(struct afp_server * server, - struct afp_volume * tmpvol, -diff -Naur afpfs-ng-0.8.1/lib/resource.c afpfs-ng-0.8.1.patch/lib/resource.c ---- afpfs-ng-0.8.1/lib/resource.c 2008-02-18 04:46:56.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/resource.c 2011-09-10 12:13:50.171125296 +0200 -@@ -3,11 +3,11 @@ - #include <string.h> - #include <errno.h> - #include <fcntl.h> --#include "afp.h" -+#include "afpfs-ng/afp.h" - #include "resource.h" - #include "lowlevel.h" - #include "did.h" --#include "midlevel.h" -+#include "afpfs-ng/midlevel.h" - - #define appledouble ".AppleDouble" - #define finderinfo_string ".finderinfo" -diff -Naur afpfs-ng-0.8.1/lib/server.c afpfs-ng-0.8.1.patch/lib/server.c ---- afpfs-ng-0.8.1/lib/server.c 2008-02-19 02:56:21.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/server.c 2011-09-10 12:13:50.172125310 +0200 -@@ -8,15 +8,15 @@ - #include <string.h> - #include <time.h> - --#include "afp.h" --#include "dsi.h" --#include "utils.h" --#include "uams_def.h" --#include "codepage.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/utils.h" -+#include "afpfs-ng/uams_def.h" -+#include "afpfs-ng/codepage.h" - #include "users.h" --#include "libafpclient.h" -+#include "afpfs-ng/libafpclient.h" - #include "afp_internal.h" --#include "dsi.h" -+#include "afpfs-ng/dsi.h" - - - struct afp_server * afp_server_complete_connection( -diff -Naur afpfs-ng-0.8.1/lib/status.c afpfs-ng-0.8.1.patch/lib/status.c ---- afpfs-ng-0.8.1/lib/status.c 2008-03-08 17:08:38.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/status.c 2011-09-10 12:13:50.172125310 +0200 -@@ -1,8 +1,8 @@ - #include <string.h> - #include <stdio.h> --#include "map_def.h" --#include "dsi.h" --#include "afp.h" -+#include "afpfs-ng/map_def.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" - - int afp_status_header(char * text, int * len) - { -diff -Naur afpfs-ng-0.8.1/lib/uams.c afpfs-ng-0.8.1.patch/lib/uams.c ---- afpfs-ng-0.8.1/lib/uams.c 2008-01-04 04:52:44.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/uams.c 2011-09-10 12:13:50.173125324 +0200 -@@ -8,10 +8,10 @@ - - #include <string.h> - #include <stdlib.h> --#include "dsi.h" --#include "afp.h" --#include "utils.h" --#include "uams_def.h" -+#include "afpfs-ng/dsi.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" -+#include "afpfs-ng/uams_def.h" - #include "config.h" - - #ifdef HAVE_LIBGCRYPT -diff -Naur afpfs-ng-0.8.1/lib/users.c afpfs-ng-0.8.1.patch/lib/users.c ---- afpfs-ng-0.8.1/lib/users.c 2008-02-18 04:48:56.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/users.c 2011-09-10 12:13:50.174125338 +0200 -@@ -3,8 +3,8 @@ - #include <grp.h> - #include <string.h> - --#include "afp.h" --#include "map_def.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/map_def.h" - - /* How mapping works - * -diff -Naur afpfs-ng-0.8.1/lib/utils.c afpfs-ng-0.8.1.patch/lib/utils.c ---- afpfs-ng-0.8.1/lib/utils.c 2008-02-18 04:53:37.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/lib/utils.c 2011-09-10 12:13:50.174125338 +0200 -@@ -8,10 +8,10 @@ - #include <stdio.h> - #include <string.h> - #include <stdlib.h> --#include "afp.h" --#include "utils.h" -+#include "afpfs-ng/afp.h" -+#include "afpfs-ng/utils.h" - #include "afp_internal.h" --#include "afp_protocol.h" -+#include "afpfs-ng/afp_protocol.h" - - struct afp_path_header_long { - unsigned char type; -diff -Naur afpfs-ng-0.8.1/Makefile.am afpfs-ng-0.8.1.patch/Makefile.am ---- afpfs-ng-0.8.1/Makefile.am 2008-02-18 04:24:14.000000000 +0100 -+++ afpfs-ng-0.8.1.patch/Makefile.am 2011-09-10 12:13:50.176125365 +0200 -@@ -1,5 +1,5 @@ - if HAVE_LIBFUSE --SUBDIRS = lib fuse cmdline docs -+SUBDIRS = lib fuse cmdline include docs - else --SUBDIRS = lib cmdline docs -+SUBDIRS = lib cmdline include docs - endif diff --git a/tools/depends/target/xbmc-audioencoder-addons/Makefile b/tools/depends/target/binary-addons/Makefile index bd9307375e..717bfa6058 100644 --- a/tools/depends/target/xbmc-audioencoder-addons/Makefile +++ b/tools/depends/target/binary-addons/Makefile @@ -1,5 +1,5 @@ BUILDDIR := $(shell pwd) -ADDONS = "audioencoder.flac audioencoder.lame audioencoder.vorbis audioencoder.wav" +ADDONS := "$(shell cd $(BUILDDIR)/../../../../project/cmake/addons/addons/; echo *)" -include ../../Makefile.include include ../../xbmc-addons.include diff --git a/tools/depends/target/config-binaddons.site.in b/tools/depends/target/config-binaddons.site.in new file mode 100644 index 0000000000..b26e8a688d --- /dev/null +++ b/tools/depends/target/config-binaddons.site.in @@ -0,0 +1,175 @@ +if test "@cross_compiling@" = "yes"; then +cross_compiling=yes +host=@use_host@ +host_alias=@use_host@ +fi + +LD="@LD@" +CC="@CC@" +CXX="@CXX@" +CPP="@CPP@" +AR="@AR@" +AS="@AS@" +NM="@NM@" +STRIP="@STRIP@" +RANLIB="@RANLIB@" +OBJDUMP="@OBJDUMP@" + +if test "@platform_os@" = "ios" ; then + export AS="@prefix@/@tool_dir@/bin/gas-preprocessor.pl @CC@ -arch @use_cpu@" + export CCAS="--tag CC @prefix@/@tool_dir@/bin/gas-preprocessor.pl @CC@ -arch @use_cpu@" +fi + +CFLAGS="@platform_cflags@ @platform_includes@ $CFLAGS" +LDFLAGS="@platform_ldflags@ $LDFLAGS" +CXXFLAGS="@platform_cxxflags@ @platform_includes@ $CXXFLAGS" +CPPFLAGS="@platform_cflags@ @platform_includes@ $CPPFLAGS" + +export PKG_CONFIG=@prefix@/@tool_dir@/bin/pkg-config +export YASM=@prefix@/@tool_dir@/bin/yasm +export NASM=@prefix@/@tool_dir@/bin/yasm + +PATH=@prefix@/@tool_dir@/bin:@use_toolchain@/usr/bin:@use_toolchain@/bin:$PATH +LD_LIBRARY_PATH=@prefix@/@tool_dir@/lib:$LD_LIBRARY_PATH + +NATIVE_ROOT=@prefix@/@tool_dir@ + +#libomxil-bellagio +ac_cv_func_malloc_0_nonnull=yes + +#curl +ac_cv_file__dev_urandom=yes +ac_cv_lib_ssl_SSL_connect=yes + +#gettext and libiconv +gl_cv_header_working_stdint_h=yes + +#libcec +ac_cv_search_dlopen=-ldl + +#libgcrypt +if test "${PACKAGE_NAME}" = "libgcrypt"; then + ac_cv_path_GPG_ERROR_CONFIG=@prefix@/@deps_dir@/bin/gpg-error-config + ac_cv_sys_symbol_underscore=no + CFLAGS="$CFLAGS -std=gnu99" +fi + +#python +ac_cv_func_gethostbyname_r=no +ac_cv_header_sys_un_h=yes + +#rsxs/projectm +jm_cv_func_gettimeofday_clobber=no +mac_cv_pkg_ldflags=-lz +if test "@platform_os@" = "osx"; then + ac_cv_func_strnlen_working=no + ac_cv_header_stdbool_h=yes +fi + +#gnutls +gl_cv_func_gettimeofday_clobber=no + + +#samba +SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes +samba_cv_CC_NEGATIVE_ENUM_VALUES=yes +libreplace_cv_HAVE_C99_VSNPRINTF=yes +samba_cv_HAVE_C99_VSNPRINTF=yes +ac_cv_header_standards_h=no + +ac_cv_file__proc_sys_kernel_core_pattern=no +samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=no +libreplace_cv_HAVE_GETADDRINFO=no + +if test "${PACKAGE_NAME}" = "Samba" -a "@platform_os@" = "ios"; then + # disable python support + export PYTHON_VER=0.0 + # ios/osx-10.6 issue with collision of _MD5 exported from a system lib + export LDFLAGS="${LDFLAGS} -Wl,-unexported_symbol,_MD5* -lc" +fi + +if test "${PACKAGE_NAME}" = "Samba" -a "@platform_os@" = "osx"; then + # disable python support + export PYTHON_VER=0.0 + # ios/osx-10.6 issue with collision of _MD5 exported from a system lib + export LDFLAGS="${LDFLAGS} -Wl,-unexported_symbol,_MD5* -lc" + # uses OPT instead of CFLAGS + export OPT="${CFLAGS}" + # various configure overrides + ac_cv_header_libunwind_h=no + ac_cv_header_execinfo_h=no + # fixes crash on 10.6 if xbmc is built using 10.7 SDK with 10.6 min + ac_cv_func_vdprintf=no +fi + +if test "@platform_os@" = "android"; then + #samba + SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes + libreplace_cv_READDIR_GETDIRENTRIES=no + libreplace_cv_READDIR_GETDENTS=no + samba_cv_REPLACE_READDIR=no + samba_cv_HAVE_WRFILE_KEYTAB=yes + samba_cv_HAVE_GETTIMEOFDAY_TZ=yes + samba_cv_USE_SETREUID=yes + samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes + samba_cv_HAVE_IFACE_IFCONF=yes + samba_cv_HAVE_MMAP=yes + samba_cv_HAVE_FCNTL_LOCK=yes + samba_cv_HAVE_SECURE_MKSTEMP=yes + samba_cv_CC_NEGATIVE_ENUM_VALUES=yes + samba_cv_fpie=no + samba_cv_have_longlong=yes + samba_cv_HAVE_OFF64_T=yes + samba_cv_HAVE_UT_UT_TYPE=no + ac_cv_func_srand=yes + ac_cv_func_rand=yes + + #python: android doesn't have libutil + PYTHON_LDFLAGS="-L@prefix@/@deps_dir@/lib -lpython${PYTHON_VERSION} -lc -ldl -lm -lexpat -lffi -lintl -lssl -lcrypto" + +fi + +if test "@platform_os@" = "ios"; then + # tweaks for libffi (ios must use llvm-gcc-4.2) + if test "${PACKAGE_NAME}" = "libffi" ; then + case "@use_xcode@" in + 3.*.* | 4.* | 4.*.*) + export CC="@use_toolchain@/usr/bin/llvm-gcc-4.2" + export CPP="@use_toolchain@/usr/bin/llvm-gcc-4.2 -E" + ;; + *) + export CC="@use_toolchain@/usr/bin/clang" + export CPP="@use_toolchain@/usr/bin/clang -E" + ;; + esac + unset AS + unset CCAS + fi + + # tweaks for flac + if test "${ac_unique_file}" = "src/flac/main.c" ; then + # compiler barfs if we use -O3/O2 for flac + export CFLAGS=`echo ${CFLAGS} | sed 's/-O3/-Os/'` + export CPPFLAGS=`echo ${CPPFLAGS} | sed 's/-O3/-Os/'` + fi + + # tweaks for libmpeg2 + if test "${PACKAGE_NAME}" = "libmpeg2" ; then + export LDFLAGS="${LDFLAGS} -Wl,-read_only_relocs,suppress" + fi +fi + +#Fix for older, broken android toolchains +if test "${PACKAGE_NAME}" = "FreeType" -a "@platform_os@" = "android"; then + CFLAGS="$CFLAGS -std=gnu99" +fi + +# These libs do not correctly export their symbols. Force them in case +# -fvisibility=hidden is set. +if test "${ac_unique_file}" = "src/flac/main.c" || \ + test "${ac_unique_file}" = "src/framing.c" || \ + test "${ac_unique_file}" = "src/libdvdcss.c" || \ + test "${PACKAGE_NAME}" = "libmpeg2" || \ + test "${PACKAGE_NAME}" = "libssh2" ; then + CFLAGS="$CFLAGS -fvisibility=default" +fi diff --git a/tools/depends/target/config.site.in b/tools/depends/target/config.site.in index 252a4dcd04..7b9ff28c57 100644 --- a/tools/depends/target/config.site.in +++ b/tools/depends/target/config.site.in @@ -41,7 +41,7 @@ PYTHON_SITE_PKG=@prefix@/@deps_dir@/lib/python${PYTHON_VERSION}/site-packages PYTHON_NOVERSIONCHECK=no-check NATIVE_ROOT=@prefix@/@tool_dir@ -#afps-ng and libomxil-bellagio +#libomxil-bellagio ac_cv_func_malloc_0_nonnull=yes #curl @@ -70,6 +70,7 @@ jm_cv_func_gettimeofday_clobber=no mac_cv_pkg_ldflags=-lz if test "@platform_os@" = "osx"; then ac_cv_func_strnlen_working=no + ac_cv_header_stdbool_h=yes fi #gnutls diff --git a/tools/depends/target/ffmpeg/FFMPEG-VERSION b/tools/depends/target/ffmpeg/FFMPEG-VERSION index a2df8328bd..4e6d32845d 100644 --- a/tools/depends/target/ffmpeg/FFMPEG-VERSION +++ b/tools/depends/target/ffmpeg/FFMPEG-VERSION @@ -1,5 +1,5 @@ LIBNAME=ffmpeg BASE_URL=https://github.com/xbmc/FFmpeg/archive -VERSION=2.5.2-Isengard-alpha +VERSION=2.6.0-Isengard-alpha ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz diff --git a/tools/depends/target/libplist/0003-fixc++1.patch b/tools/depends/target/libplist/0003-fixc++1.patch new file mode 100644 index 0000000000..69fdbf0620 --- /dev/null +++ b/tools/depends/target/libplist/0003-fixc++1.patch @@ -0,0 +1,11 @@ +--- a/src/Dictionary.cpp.orig 2014-12-31 14:05:09.000000000 -0600 ++++ b/src/Dictionary.cpp 2014-12-31 14:09:58.000000000 -0600 +@@ -151,7 +151,7 @@ + _map[key] = clone; + return _map.find(key); + } +- return iterator(NULL); ++ return iterator(); + } + + void Dictionary::Remove(Node* node) diff --git a/tools/depends/target/libplist/Makefile b/tools/depends/target/libplist/Makefile index 3c69e5e49d..1159d3e800 100644 --- a/tools/depends/target/libplist/Makefile +++ b/tools/depends/target/libplist/Makefile @@ -23,6 +23,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) cd $(PLATFORM); patch -p1 < ../0001-dontbuildswig.patch cd $(PLATFORM); patch -p1 < ../0002-fixclang.diff + cd $(PLATFORM); patch -p1 < ../0003-fixc++1.patch cd $(PLATFORM); sed -ie 's/TARGET_LINK_LIBRARIES( plist \(.*\))/TARGET_LINK_LIBRARIES( plist \1 z m) /' src/CMakeLists.txt cd $(PLATFORM); rm -rf build; mkdir -p build cd $(PLATFORM)/build; $(CMAKE) VERBOSE=1 -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_LD_FLAGS="$(LDFLAGS)" .. diff --git a/tools/depends/target/pythonmodule-pil/Makefile b/tools/depends/target/pythonmodule-pil/Makefile index 0f1e32f7ed..0c40bb9cbb 100644 --- a/tools/depends/target/pythonmodule-pil/Makefile +++ b/tools/depends/target/pythonmodule-pil/Makefile @@ -40,8 +40,14 @@ $(LIBDYLIB): $(PLATFORM) cd $(PLATFORM); $(CROSSFLAGS) $(NATIVEPREFIX)/bin/python setup.py build -x bdist_egg --plat-name $(OS)-$(CPU) .installed-$(PLATFORM): $(LIBDYLIB) +ifeq ($(OS),android) mkdir -p $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib/PIL/ unzip -oq $(LIBDYLIB) -d $(PREFIX)/share/$(APP_NAME)/addons/script.module.pil/lib/PIL/ +else + mkdir -p $(PREFIX)/lib/python2.6/site-packages/PIL + unzip -oq $(LIBDYLIB) -d $(PREFIX)/lib/python2.6/site-packages/PIL/ + echo 'PIL' > $(PREFIX)/lib/python2.6/site-packages/PIL.pth +endif touch $@ clean: diff --git a/tools/depends/target/xbmc-pvr-addons/Makefile b/tools/depends/target/xbmc-pvr-addons/Makefile deleted file mode 100644 index 2dc8eba520..0000000000 --- a/tools/depends/target/xbmc-pvr-addons/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -include ../../Makefile.include -#DEPS= ../../Makefile.include Makefile - -LIBNAME=xbmc-pvr-addons -VERSION=1d60b822d132ac4a8f9fbfc1f4048e941ad6371e -GIT_DIR=$(TARBALLS_LOCATION)/$(LIBNAME).git -BASE_URL=git://github.com/opdenkamp/$(LIBNAME).git -DYLIB=$(PLATFORM)/addons/pvr.demo/.libs/libpvrdemo-addon.so -XBMC_ADDONSDIR=../../../../addons - -#tell git to use the addons repo rather than xbmc's repo -export GIT_DIR -export GIT_WORK_TREE=$(PLATFORM) - -#mysql_config is remarkably useless. Help configure find the right one. -export MYSQL_CONFIG=$(PREFIX)/bin/mysql_config - -# configuration settings -VERSION.TXT := $(XBMCROOT)/version.txt -APP_NAME=$(shell awk '/APP_NAME/ {print tolower($$2)}' $(VERSION.TXT)) -CONFIGURE=./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/lib/$(APP_NAME)/addons --datadir=$(PREFIX)/share/$(APP_NAME)/addons --enable-addons-with-dependencies - -all: .installed-$(PLATFORM) - -$(GIT_DIR)/HEAD: - cd $(TARBALLS_LOCATION); git clone --bare $(BASE_URL) - -$(GIT_DIR)/current/$(VERSION): $(GIT_DIR)/HEAD $(DEPS) - git rev-list -1 $(VERSION) >/dev/null || git fetch origin "+refs/heads/*:refs/remotes/origin/*" - git rev-list -1 $(VERSION) >/dev/null - rm -rf $(GIT_DIR)/current; mkdir -p $(GIT_DIR)/current - touch $@ - -$(PLATFORM)/bootstrap: $(GIT_DIR)/current/$(VERSION) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM) - git checkout $(VERSION) -- . - -$(PLATFORM)/configure: $(PLATFORM)/bootstrap - cd $(PLATFORM); ./bootstrap - -$(PLATFORM)/Makefile: $(PLATFORM)/configure - cd $(PLATFORM); $(CONFIGURE) - -$(DYLIB): $(PLATFORM)/Makefile - make -C $(PLATFORM) - touch $@ - -.installed-$(PLATFORM): $(DYLIB) -ifeq (darwin, $(findstring darwin, $(HOST))) - for ADDON in `find $(PLATFORM)/addons -type d -name "pvr.*"`; do \ - ADDON=`basename $$ADDON` ; \ - mkdir -p $(XBMC_ADDONSDIR)/$$ADDON ; \ - cp -PRf $(PLATFORM)/addons/$$ADDON/addon/* $(XBMC_ADDONSDIR)/$$ADDON ; \ - cp -Pf $(PLATFORM)/addons/$$ADDON/*.pvr $(XBMC_ADDONSDIR)/$$ADDON ; \ - install_name_tool -id "$$ADDON" `find "$(XBMC_ADDONSDIR)/$$ADDON" -type f -name "*.pvr"` ; \ - done -else - $(MAKE) -C $(PLATFORM) install -endif - touch $@ - -clean: - -make -C $(PLATFORM) clean - rm -f .installed-$(PLATFORM) - -distclean:: - rm -rf $(PLATFORM) .installed-$(PLATFORM) - rm -rf $(GIT_DIR)/current - diff --git a/tools/depends/xbmc-addons.include b/tools/depends/xbmc-addons.include index abd9f2a21a..9e1361b879 100644 --- a/tools/depends/xbmc-addons.include +++ b/tools/depends/xbmc-addons.include @@ -1,3 +1,17 @@ +ADDON_DEPS_DIR := $(BUILDDIR)/$(PLATFORM)/build/depends +TOOLCHAIN_FILE = $(ADDON_DEPS_DIR)/share/Toolchain_binaddons.cmake +ADDON_PROJECT_DIR = $(BUILDDIR)/../../../../project/cmake/addons + +ifeq ($(CROSS_COMPILING),yes) + DEPS = $(TOOLCHAIN_FILE) $(abs_top_srcdir)/target/config-binaddons.site $(abs_top_srcdir)/target/Toolchain_binaddons.cmake $(CONFIG_SUB) $(CONFIG_GUESS) + TOOLCHAIN = -DCMAKE_TOOLCHAIN_FILE=$(TOOLCHAIN_FILE) + ifeq ($(OS),linux) + ifneq ($(TARGET_PLATFORM),raspberry-pi) + DEPS += linux-system-libs + endif + endif +endif + ifeq ($(PLATFORM),) PLATFORM = native endif @@ -16,9 +30,10 @@ ifneq ($(PREFIX),) INSTALL_PREFIX = $(PREFIX) endif - CMAKE_EXTRA += -DDEPENDS_PATH=$(PREFIX) -DAUTOCONF_FILES="$(CONFIG_SUB) $(CONFIG_GUESS)" + CMAKE_EXTRA += -DAUTOCONF_FILES="$(CONFIG_SUB) $(CONFIG_GUESS)" endif + all: .installed-$(PLATFORM) @@ -28,16 +43,53 @@ clean: distclean: rm -rf $(PLATFORM) .installed-$(PLATFORM) native -.installed-$(PLATFORM): +.installed-$(PLATFORM): $(DEPS) + cd $(ADDON_PROJECT_DIR) && (git clean -xfd || rm -rf CMakeCache.txt CMakeFiles cmake_install.cmake build/*) + mkdir -p $(PLATFORM) ifeq ($(PREFIX),) @echo @echo "ERROR: please set PREFIX to the xbmc install path e.g. make PREFIX=/usr/local" @exit 1 endif - cd ../../../../project/cmake/addons/ && (git clean -xfd || rm -rf CMakeCache.txt CMakeFiles cmake_install.cmake build/*) - mkdir -p $(PLATFORM); \ - cd $(PLATFORM); \ +ifeq ($(CROSS_COMPILING),yes) + mkdir -p $(PLATFORM)/build/depends/share; \ + cp -f $(abs_top_srcdir)/target/config-binaddons.site $(PLATFORM)/build/depends/share/config.site +endif + cd $(PLATFORM); \ $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) $(CMAKE_EXTRA) \ - -DADDONS_TO_BUILD=$(ADDONS) ../../../../../project/cmake/addons/ -DBUILD_DIR=$(BUILDDIR)/$(PLATFORM)/build ;\ - $(MAKE); + $(TOOLCHAIN) \ + -DADDONS_TO_BUILD=$(ADDONS) $(ADDON_PROJECT_DIR) -DBUILD_DIR=$(BUILDDIR)/$(PLATFORM)/build ;\ + for addon in "$(ADDONS)"; do \ + $(MAKE) $$addon && echo $$addon >> $(ADDON_PROJECT_DIR)/.success || echo $$addon >> $(ADDON_PROJECT_DIR)/.failure ;\ + done +ifneq ($(CROSS_COMPILING),yes) + @[ -f $(ADDON_PROJECT_DIR)/.failure ] && echo "Following Addons failed to build: $(shell cat $(ADDON_PROJECT_DIR)/.failure)" + @[ -w $(INSTALL_PREFIX) ] || $(MAKE) -C $(PLATFORM) install +endif touch $@ + +$(TOOLCHAIN_FILE): $(abs_top_srcdir)/target/Toolchain_binaddons.cmake + mkdir -p $(ADDON_DEPS_DIR)/share + sed "s|@CMAKE_FIND_ROOT_PATH@|$(ADDON_DEPS_DIR)|g" $(abs_top_srcdir)/target/Toolchain_binaddons.cmake > $@ + +linux-system-libs: + mkdir -p $(ADDON_DEPS_DIR)/lib/pkgconfig $(ADDON_DEPS_DIR)/include + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/x11.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/x11.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc ] || ln -s /usr/share/pkgconfig/xproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xproto.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc ] || ln -s /usr/share/pkgconfig/kbproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/kbproto.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xcb.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xcb.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xcb.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/pthread-stubs.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/pthread-stubs.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xau.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xau.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xau.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xdmcp.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xdmcp.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xdmcp.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xext.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xext.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xext.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xextproto.pc ] || ln -s /usr/share/pkgconfig/xextproto.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xextproto.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xt.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xt.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xt.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/ice.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/ice.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/sm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/sm.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/xmu.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/xmu.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/xmu.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/libdrm.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/libdrm.pc + [ -f $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc ] || ln -s /usr/lib/$(HOST)/pkgconfig/gl.pc $(ADDON_DEPS_DIR)/lib/pkgconfig/gl.pc + [ -f $(ADDON_DEPS_DIR)/lib/libGL.so ] || \ + (ln -s /usr/lib/$(HOST)/mesa $(ADDON_DEPS_DIR)/lib/mesa && ln -s $(ADDON_DEPS_DIR)/lib/mesa/libGL.so $(ADDON_DEPS_DIR)/lib/libGL.so) + [ -f $(ADDON_DEPS_DIR)/include/GL ] || ln -s /usr/include/GL $(ADDON_DEPS_DIR)/include/GL + diff --git a/tools/windows/prepare-binary-addons-dev.bat b/tools/windows/prepare-binary-addons-dev.bat new file mode 100644 index 0000000000..ff7d916941 --- /dev/null +++ b/tools/windows/prepare-binary-addons-dev.bat @@ -0,0 +1,108 @@ +@ECHO OFF + +SETLOCAL + +SET EXITCODE=0 + +SET clean=false +SET addon= + +SETLOCAL EnableDelayedExpansion +FOR %%b IN (%*) DO ( + IF %%b == clean ( + SET clean=true + ) ELSE ( + SET addon=!addon! %%b + ) +) +SETLOCAL DisableDelayedExpansion + +rem set Visual C++ build environment +call "%VS120COMNTOOLS%..\..\VC\bin\vcvars32.bat" + +SET WORKDIR=%WORKSPACE% + +IF "%WORKDIR%" == "" ( + SET WORKDIR=%CD%\..\.. +) + +rem setup some paths that we need later +SET CUR_PATH=%CD% +SET BASE_PATH=%WORKDIR%\project\cmake +SET SCRIPTS_PATH=%BASE_PATH%\scripts\windows +SET ADDONS_PATH=%BASE_PATH%\addons +SET ADDON_DEPENDS_PATH=%ADDONS_PATH%\output +SET ADDONS_BUILD_PATH=%ADDONS_PATH%\build +SET ADDONS_DEFINITION_PATH=%ADDONS_PATH%\addons + +SET ERRORFILE=%ADDONS_PATH%\make-addons.error + +IF %clean% == true ( + rem remove the build directory if it exists + IF EXIST "%ADDONS_BUILD_PATH%" ( + RMDIR "%ADDONS_BUILD_PATH%" /S /Q > NUL + ) + + rem remove the build directory if it exists + IF EXIST "%ADDON_DEPENDS_PATH%" ( + RMDIR "%ADDON_DEPENDS_PATH%" /S /Q > NUL + ) + + GOTO END +) + +rem create the depends directory +IF NOT EXIST "%ADDON_DEPENDS_PATH%" MKDIR "%ADDON_DEPENDS_PATH%" + +rem create the build directory +IF NOT EXIST "%ADDONS_BUILD_PATH%" MKDIR "%ADDONS_BUILD_PATH%" + +rem go into the build directory +CD "%ADDONS_BUILD_PATH%" + +ECHO -------------------------------------------------- +ECHO Preparing addons development environment +ECHO -------------------------------------------------- + +SET ADDONS_TO_BUILD= +IF "%addon%" NEQ "" ( + SET ADDONS_TO_BUILD=%addon% +) ELSE ( + SETLOCAL EnableDelayedExpansion + FOR /D %%a IN (%ADDONS_DEFINITION_PATH%\*) DO ( + SET ADDONS_TO_BUILD=!ADDONS_TO_BUILD! %%~nxa + ) + SETLOCAL DisableDelayedExpansion +) + +rem execute cmake to generate Visual Studio 12 project files +cmake "%ADDONS_PATH%" -G "Visual Studio 12" ^ + -DCMAKE_BUILD_TYPE=Debug ^ + -DCMAKE_USER_MAKE_RULES_OVERRIDE="%SCRIPTS_PATH%/c-flag-overrides.cmake" ^ + -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%SCRIPTS_PATH%/cxx-flag-overrides.cmake" ^ + -DCMAKE_INSTALL_PREFIX=%WORKDIR%\addons ^ + -DAPP_ROOT=%WORKDIR% ^ + -DBUILD_DIR=%ADDONS_BUILD_PATH% ^ + -DDEPENDS_PATH=%ADDON_DEPENDS_PATH% ^ + -DPACKAGE_ZIP=1 ^ + -DADDONS_TO_BUILD="%ADDONS_TO_BUILD%" +IF ERRORLEVEL 1 ( + ECHO cmake error level: %ERRORLEVEL% > %ERRORFILE% + GOTO ERROR +) + +rem everything was fine +GOTO END + +:ERROR +rem something went wrong +ECHO Failed to prepare addons development environment +ECHO See %ERRORFILE% for more details +SET EXITCODE=1 + +:END +rem go back to the original directory +cd %CUR_PATH% + +rem exit the script with the defined exitcode +EXIT /B %EXITCODE% |