Oops
[asterisk/asterisk.git] / build_tools / make_buildopts_h
index fc7fdd2..ace4045 100755 (executable)
@@ -21,5 +21,17 @@ then
        echo "#define AST_DEVMODE 1"
        TMP="${TMP} AST_DEVMODE"
 fi
-BUILDSUM=`echo ${TMP} | md5sum`
-echo "#define AST_BUILDOPT_SUM {0x${BUILDSUM:0:8}, 0x${BUILDSUM:8:8}, 0x${BUILDSUM:16:8}, 0x${BUILDSUM:24:8}}"
+
+case ${OSARCH} in      # actually we should check build_os
+*BSD|mingw|darwin*)
+       BUILDSUM=`echo ${TMP} | md5 | cut -c1-32`
+       ;;
+SunOS)
+       BUILDSUM=`echo ${TMP} | digest -a md5 | cut -c1-32`
+       ;;
+*)
+       BUILDSUM=`echo ${TMP} | md5sum | cut -c1-32`
+       ;;
+esac
+
+echo "#define AST_BUILDOPT_SUM \"${BUILDSUM}\""