Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Commit

Permalink
change the CFLAGS controlled by menuselect to be placed in a header file
Browse files Browse the repository at this point in the history
instead of being added to the compiler commands.  This header file will be
installed and modules built outside of the main tree will be able to use the
same build options used to build the rest of Asterisk.


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@26808 f38db490-d61c-443f-a65b-d21fe96a405b
  • Loading branch information
russellb committed May 11, 2006
1 parent 2a577b9 commit ec18299
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .cleancount
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15
16
21 changes: 14 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ ifneq ($(wildcard makeopts),)
include makeopts
endif

ASTCFLAGS+=$(MENUSELECT_CFLAGS)
TOPDIR_CFLAGS=-include include/autoconfig.h -Iinclude
MOD_SUBDIR_CFLAGS=-include ../include/autoconfig.h -I../include -I..
OTHER_SUBDIR_CFLAGS=-include ../include/autoconfig.h -I../include -I..
Expand Down Expand Up @@ -432,7 +431,7 @@ _all: all
@echo " + make install +"
@echo " +-------------------------------------------+"

all: config.status menuselect.makeopts cleantest depend asterisk subdirs
all: cleantest config.status menuselect.makeopts depend asterisk subdirs

config.status: configure
@CFLAGS="" ./configure
Expand Down Expand Up @@ -525,10 +524,17 @@ include/asterisk/version.h:
fi
@rm -f $@.tmp

include/asterisk/buildopts.h: menuselect.makeopts
@build_tools/make_buildopts_h > $@.tmp
@if cmp -s $@.tmp $@ ; then echo; else \
mv $@.tmp $@ ; \
fi
@rm -f $@.tmp

stdtime/libtime.a:
CFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) -C stdtime libtime.a

asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
asterisk: include/asterisk/buildopts.h editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
build_tools/make_build_h > include/asterisk/build.h.tmp
if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
Expand Down Expand Up @@ -567,6 +573,7 @@ dist-clean: clean
rm -f menuselect.makeopts makeopts makeopts.xml
rm -f config.log config.status
rm -f include/autoconfig.h
rm -f include/asterisk/buildopts.h
$(MAKE) -C mxml clean
$(MAKE) -C build_tools dist-clean

Expand Down Expand Up @@ -862,7 +869,7 @@ spec:

rpm: __rpm

__rpm: include/asterisk/version.h spec
__rpm: include/asterisk/version.h include/asterisk/buildopts.h spec
rm -rf /tmp/asterisk ; \
mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
$(MAKE) DESTDIR=/tmp/asterisk install ; \
Expand Down Expand Up @@ -911,10 +918,10 @@ dont-optimize: _all

valgrind: dont-optimize

depend: include/asterisk/version.h .depend defaults.h
depend: include/asterisk/version.h include/asterisk/buildopts.h .depend defaults.h
@for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done

.depend: include/asterisk/version.h defaults.h
.depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h
build_tools/mkdep $(CFLAGS) $(wildcard *.c)

.tags-depend:
Expand Down Expand Up @@ -958,7 +965,7 @@ env:

cleantest:
@if cmp -s .cleancount .lastclean ; then echo ; else \
$(MAKE) clean; cp -f .cleancount .lastclean;\
$(MAKE) dist-clean; cp -f .cleancount .lastclean;\
fi

_uninstall:
Expand Down
2 changes: 1 addition & 1 deletion build_tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MENUSELECT_OBJS=menuselect.o menuselect_curses.o
MENUSELECT_CFLAGS=-g -c -D_GNU_SOURCE -I../ -I../include/
MENUSELECT_CFLAGS=-g -c -D_GNU_SOURCE -DMENUSELECT -I../ -I../include/
MENUSELECT_LIBS=../mxml/libmxml.a

ifeq ($(OSARCH),SunOS)
Expand Down
18 changes: 9 additions & 9 deletions build_tools/cflags.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
<member name="-DDEBUG_SCHEDULER">
<member name="DEBUG_SCHEDULER">
</member>
<member name="-DDEBUG_THREADS">
<member name="DEBUG_THREADS">
</member>
<member name="-DDETECT_DEADLOCKS">
<member name="DETECT_DEADLOCKS">
</member>
<member name="-DDUMP_SCHEDULER">
<member name="DUMP_SCHEDULER">
</member>
<member name="-DLOW_MEMORY">
<member name="LOW_MEMORY">
</member>
<member name="-DMALLOC_DEBUG">
<member name="MALLOC_DEBUG">
</member>
<member name="-DRADIO_RELAX">
<member name="RADIO_RELAX">
</member>
<member name="-DTRACE_FRAMES">
<member name="TRACE_FRAMES">
</member>
<member name="-DMTX_PROFILE">
<member name="MTX_PROFILE">
</member>
</category>
13 changes: 13 additions & 0 deletions build_tools/make_buildopts_h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

cat << END
/*
* buildopts.h
* Automatically generated
*/
END
TMP=`grep MENUSELECT_CFLAGS menuselect.makeopts | sed s/MENUSELECT_CFLAGS\=//g`
for x in ${TMP}; do
echo "#define ${x}"
done
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ AC_SUBST(PBX_OSTYPE)
AC_GNU_SOURCE

AH_TOP(
#ifndef MENUSELECT
#include "asterisk/buildopts.h"
#endif

#ifndef _REENTRANT
#define _REENTRANT
#endif
Expand Down
4 changes: 4 additions & 0 deletions include/autoconfig.h.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* include/autoconfig.h.in. Generated from configure.ac by autoheader. */

#ifndef MENUSELECT
#include "asterisk/buildopts.h"
#endif

#ifndef _REENTRANT
#define _REENTRANT
#endif
Expand Down

0 comments on commit ec18299

Please sign in to comment.