Files
asterisk/build_tools/make_buildopts_h
Corey Farrell 5c1d07baf0 Astobj2: Allow reference debugging to be enabled/disabled by config.
* The REF_DEBUG compiler flag no longer has any effect on code that uses
  Astobj2.  It is used to determine if reference debugging is enabled by
  default.  Reference debugging can be enabled or disabled in asterisk.conf.
* Caller information is provided in logger errors for ao2 bad magic numbers.
* Optimizes AO2 by merging internal functions with the public counterpart.
  This was possible now that we no longer require a dual ABI.

ASTERISK-24974 #close
Reported by: Corey Farrell

Change-Id: Icf3552721fe999365ba8a8cf00a965aa6b897cc1
2015-04-27 18:37:26 -04:00

51 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
GREP=${GREP:-grep}
MD5=${MD5:-md5sum}
cat << END
/*
* buildopts.h
* Automatically generated
*/
END
TMP=`${GREP} -e "^MENUSELECT_CFLAGS" menuselect.makeopts | sed 's/MENUSELECT_CFLAGS\=//g' | sed 's/-D//g'`
for x in ${TMP}; do
echo "#define ${x} 1"
if test "${x}" = "DONT_OPTIMIZE" \
-o "${x}" = "BETTER_BACKTRACES" \
-o "${x}" = "LOTS_OF_SPANS" \
-o "${x}" = "BUILD_NATIVE" \
-o "${x}" = "REF_DEBUG" \
-o "${x}" = "AO2_DEBUG" \
-o "${x}" = "REBUILD_PARSERS" \
-o "${x}" = "RADIO_RELAX" \
-o "${x}" = "DEBUG_SCHEDULER" \
-o "${x}" = "DETECT_DEADLOCKS" \
-o "${x}" = "DUMP_SCHEDULER" ; then
# These aren't ABI affecting options, keep them out of AST_BUILDOPTS
continue
fi
if test "x${BUILDOPTS}" != "x" ; then
BUILDOPTS="${BUILDOPTS}, ${x}"
else
BUILDOPTS="${x}"
fi
done
TMP=`${GREP} -e "^MENUSELECT_BUILD_DEPS" menuselect.makeopts | sed 's/MENUSELECT_BUILD_DEPS\=//g'`
for x in ${TMP}; do
x2=`echo ${x} | tr a-z A-Z`
echo "#define AST_MODULE_${x2} 1"
done
if ${GREP} "AST_DEVMODE" makeopts | ${GREP} -q "yes"
then
echo "#define AST_DEVMODE 1"
TMP="${TMP} AST_DEVMODE"
fi
BUILDSUM=`echo ${TMP} | ${MD5} | cut -c1-32`
echo "#define AST_BUILDOPT_SUM \"${BUILDSUM}\""
echo "#define AST_BUILDOPTS \"${BUILDOPTS}\""