Skip to content

Commit

Permalink
s3-build: Move generated config.h and config.h.in to include/autoconf
Browse files Browse the repository at this point in the history
This ensures that these are not found by the waf build, which causes
issues when the wrong config.h is used by the recursive smbtorture build

Andrew Bartlett
  • Loading branch information
abartlet committed May 9, 2011
1 parent 8aab926 commit 7e8f086
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ source3/exports/libtalloc.syms
source3/exports/libtdb.syms
source3/exports/libwbclient.syms
source3/include/build_env.h
source3/include/config.h
source3/include/config.h.in
source3/include/autoconf/config.h
source3/include/autoconf/config.h.in
source3/include/includes.h.gch
source3/include/stamp-h
source3/include/version.h
Expand Down
2 changes: 1 addition & 1 deletion source3/Makefile-smbtorture4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SAMBA4_BINARIES="smbtorture,ndrdump"
samba4-configure:
@(cd .. && \
CFLAGS='' $(WAF) reconfigure || \
CFLAGS='' $(WAF) configure --enable-socket-wrapper --enable-nss-wrapper --enable-uid-wrapper --nonshared-binary=$(SAMBA4_BINARIES) --enable-auto-reconfigure --disable-s3build --enable-developer)
CFLAGS='' $(WAF) configure --enable-socket-wrapper --enable-nss-wrapper --enable-uid-wrapper --nonshared-binary=$(SAMBA4_BINARIES) --enable-auto-reconfigure --enable-developer)

.PHONY: samba4-configure

Expand Down
10 changes: 5 additions & 5 deletions source3/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1766,16 +1766,16 @@ lib/version.o: lib/version.c include/version.h
echo "$(COMPILE_CC_PATH)" 1>&2;\
$(COMPILE_CC_PATH) >/dev/null 2>&1

smbd/build_options.o: smbd/build_options.c Makefile include/config.h include/build_env.h include/proto.h
smbd/build_options.o: smbd/build_options.c Makefile include/autoconf/config.h include/build_env.h include/proto.h
@echo Compiling $*.c
@$(COMPILE_CC_PATH) && exit 0;\
echo "The following command failed:" 1>&2;\
echo "$(COMPILE_CC_PATH)" 1>&2;\
$(COMPILE_CC_PATH) >/dev/null 2>&1

smbd/build_options.c: include/config.h.in script/mkbuildoptions.awk
smbd/build_options.c: include/autoconf/config.h.in script/mkbuildoptions.awk
@echo Generating $@
@dir=smbd $(MAKEDIR) && $(AWK) -f $(srcdir)/script/mkbuildoptions.awk > $(builddir)/smbd/build_options.c < $(srcdir)/include/config.h.in
@dir=smbd $(MAKEDIR) && $(AWK) -f $(srcdir)/script/mkbuildoptions.awk > $(builddir)/smbd/build_options.c < $(srcdir)/include/autoconf/config.h.in

bin/.dummy:
@if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \
Expand Down Expand Up @@ -3362,12 +3362,12 @@ realclean:: clean

distclean:: realclean
-rm -f smbadduser
-rm -f include/config.h Makefile
-rm -f include/autoconf/config.h Makefile
-rm -f config.status config.cache so_locations
-rm -rf .deps TAGS

realdistclean:: distclean
-rm -f include/config.h.in
-rm -f include/autoconf/config.h.in
-rm -f include/version.h
-rm -f configure

Expand Down
4 changes: 2 additions & 2 deletions source3/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AC_PREREQ(2.54)
AC_INIT([Samba],[3],[[email protected]])

AC_CONFIG_SRCDIR([include/includes.h])
AC_CONFIG_HEADER(include/config.h)
AC_CONFIG_HEADER(include/autoconf/config.h)
AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h])

case "$PATH" in
Expand Down Expand Up @@ -34,7 +34,7 @@ done
AC_SUBST(LIBTEVENT_OBJ0)
LIBS="${LIBS} ${TEVENT_LIBS}"

SAMBA_CPPFLAGS="-Iinclude -I${srcdir-.}/include -I. -I${srcdir-.}"
SAMBA_CPPFLAGS="-Iinclude/autoconf -Iinclude -I${srcdir-.}/include -I. -I${srcdir-.}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/../lib/replace"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${TEVENT_CFLAGS}"
SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} -I${srcdir-.}/librpc"
Expand Down
5 changes: 5 additions & 0 deletions source3/include/autoconf/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This directory added so that the autoconf build can generate a
config.h in a location that the recursive waf build for smbtorture
won't find.

Andrew Bartlett
2 changes: 1 addition & 1 deletion source3/script/mkbuildoptions.awk
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function output(ARRAY, ELEMENTS, TITLE) {
END {
##################################################
# add code to show various options
print "/* Output various other options (as gleaned from include/config.h.in) */";
print "/* Output various other options (as gleaned from include/autoconf/config.h.in) */";
output(sys_ary, sys_i, "System Headers");
output(headers_ary, headers_i, "Headers");
output(utmp_ary, utmp_i, "UTMP Options");
Expand Down

0 comments on commit 7e8f086

Please sign in to comment.