From: Todd C. Miller Date: Sun, 4 Apr 2010 18:01:21 +0000 (-0400) Subject: Fix out-of-tree builds X-Git-Tag: SUDO_1_8_0~748 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43b6359df395d0f6c1153bf460488db98ab51303;p=sudo Fix out-of-tree builds --- diff --git a/compat/Makefile.in b/compat/Makefile.in index 86f717966..7c3b40e20 100644 --- a/compat/Makefile.in +++ b/compat/Makefile.in @@ -34,7 +34,7 @@ SED=@SED@ RANLIB=@RANLIB@ # C preprocessor flags -CPPFLAGS = -I. -I$(top_srcdir) -I$(incdir) @CPPFLAGS@ +CPPFLAGS = -I. -I$(top_builddir) -I$(incdir) @CPPFLAGS@ # Usually -O and/or -g CFLAGS = @CFLAGS@ @@ -46,7 +46,7 @@ DEFS = @OSDEFS@ SHELL = /bin/sh -LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/ +LIBOBJDIR = LTLIBOBJS = @LTLIBOBJS@ @@ -69,29 +69,29 @@ mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/compat.h $(top_ @DEV@$(srcdir)/mksiglist.h: $(srcdir)/siglist.in @DEV@ awk 'BEGIN {print "/* public domain */\n"} /^ [A-Z]/ {printf("#ifdef SIG%s\n if (my_sys_siglist[SIG%s] == NULL)\n\tmy_sys_siglist[SIG%s] = \"%s\";\n#endif\n", $1, $1, $1, substr($0, 13))}' < $(srcdir)/siglist.in > $@ -$(LIBOBJDIR)siglist.lo: siglist.c $(incdir)/compat.h $(top_builddir)/config.h +siglist.lo: siglist.c $(incdir)/compat.h $(top_builddir)/config.h # Dependencies -$(LIBOBJDIR)closefrom.lo: $(compat)/closefrom.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)fnmatch.lo: $(compat)/fnmatch.c $(compat)/fnmatch.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)getcwd.lo: $(compat)/getcwd.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)getline.lo: $(compat)/getline.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)getprogname.lo: $(compat)/getprogname.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)glob.lo: $(compat)/glob.c $(compat)/glob.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)isblank.lo: $(compat)/isblank.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)memrchr.lo: $(compat)/memrchr.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)mkstemp.lo: $(compat)/mkstemp.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)nanosleep.lo: $(compat)/nanosleep.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)sigaction.lo: $(compat)/sigaction.c $(incdir)/compat.h $(incdir)/compat.h -$(LIBOBJDIR)snprintf.lo: $(compat)/snprintf.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)strcasecmp.lo: $(compat)/strcasecmp.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)strdup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)strndup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)strerror.lo: $(compat)/strerror.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)strlcat.lo: $(compat)/strlcat.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)strlcpy.lo: $(compat)/strlcpy.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)strsignal.lo: $(compat)/strsignal.c $(incdir)/compat.h $(top_builddir)/config.h -$(LIBOBJDIR)utimes.lo: $(compat)/utimes.c $(incdir)/compat.h $(compat)/utime.h $(top_builddir)/config.h +closefrom.lo: $(compat)/closefrom.c $(incdir)/compat.h $(top_builddir)/config.h +fnmatch.lo: $(compat)/fnmatch.c $(compat)/fnmatch.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h +getcwd.lo: $(compat)/getcwd.c $(incdir)/compat.h $(top_builddir)/config.h +getline.lo: $(compat)/getline.c $(incdir)/compat.h $(top_builddir)/config.h +getprogname.lo: $(compat)/getprogname.c $(incdir)/compat.h $(top_builddir)/config.h +glob.lo: $(compat)/glob.c $(compat)/glob.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h +isblank.lo: $(compat)/isblank.c $(incdir)/compat.h $(top_builddir)/config.h +memrchr.lo: $(compat)/memrchr.c $(incdir)/compat.h $(top_builddir)/config.h +mkstemp.lo: $(compat)/mkstemp.c $(incdir)/compat.h $(top_builddir)/config.h +nanosleep.lo: $(compat)/nanosleep.c $(incdir)/compat.h $(top_builddir)/config.h +sigaction.lo: $(compat)/sigaction.c $(incdir)/compat.h $(incdir)/compat.h +snprintf.lo: $(compat)/snprintf.c $(incdir)/compat.h $(top_builddir)/config.h +strcasecmp.lo: $(compat)/strcasecmp.c $(incdir)/compat.h $(top_builddir)/config.h +strdup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h +strndup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h +strerror.lo: $(compat)/strerror.c $(incdir)/compat.h $(top_builddir)/config.h +strlcat.lo: $(compat)/strlcat.c $(incdir)/compat.h $(top_builddir)/config.h +strlcpy.lo: $(compat)/strlcpy.c $(incdir)/compat.h $(top_builddir)/config.h +strsignal.lo: $(compat)/strsignal.c $(incdir)/compat.h $(top_builddir)/config.h +utimes.lo: $(compat)/utimes.c $(incdir)/compat.h $(compat)/utime.h $(top_builddir)/config.h install: diff --git a/doc/Makefile.in b/doc/Makefile.in index 7d4b35822..32133d6d8 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -54,7 +54,7 @@ DOCS = sudo.man visudo.man sudoers.man sudoers.ldap.man sudoers.man \ VERSION = @PACKAGE_VERSION@ -# XXX - add DEV dependencies to build .man.in and .cat files +# XXX - add DEV dependencies to avoid always building .man.in and .cat files all: $(DOCS) .SUFFIXES: .man .cat @@ -63,59 +63,59 @@ all: $(DOCS) @rm -f $@ sed '1s/^/.if n .ll 78n/' $< | $(NROFF) -man > $@ -sudo.man.in: $(srcdir)/sudo.pod +$(srcdir)/sudo.man.in: $(srcdir)/sudo.pod @rm -f $(srcdir)/$@ ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" | perl -p sudo.man.pl >> $@ ) -sudo.man: sudo.man.in - CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status +sudo.man: $(srcdir)/sudo.man.in + (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status) -sudo.cat: sudo.man +$(srcdir)/sudo.cat: sudo.man -visudo.man.in: $(srcdir)/visudo.pod +$(srcdir)/visudo.man.in: $(srcdir)/visudo.pod @rm -f $(srcdir)/$@ ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' visudo.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" visudo.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ ) -visudo.man: visudo.man.in - CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status +visudo.man: $(srcdir)/visudo.man.in + (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status) -visudo.cat: visudo.man +$(srcdir)/visudo.cat: visudo.man -sudoers.man.in: $(srcdir)/sudoers.pod +$(srcdir)/sudoers.man.in: $(srcdir)/sudoers.pod @rm -f $(srcdir)/$@ ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoers.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoers.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" | perl -p sudoers.man.pl >> $@ ) -sudoers.man:: sudoers.man.in - CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status +sudoers.man:: $(srcdir)/sudoers.man.in + (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status) -sudoers.cat: sudoers.man +$(srcdir)/sudoers.cat: sudoers.man -sudoers.ldap.man.in: $(srcdir)/sudoers.ldap.pod +$(srcdir)/sudoers.ldap.man.in: $(srcdir)/sudoers.ldap.pod @rm -f $(srcdir)/$@ ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoers.ldap.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectform --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoers.ldap.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ ) -sudoers.ldap.man:: sudoers.ldap.man.in - CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status +sudoers.ldap.man:: $(srcdir)/sudoers.ldap.man.in + (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status) -sudoers.ldap.cat: sudoers.ldap.man +$(srcdir)/sudoers.ldap.cat: sudoers.ldap.man -sudoreplay.man.in: $(srcdir)/sudoreplay.pod +$(srcdir)/sudoreplay.man.in: $(srcdir)/sudoreplay.pod @rm -f $(srcdir)/$@ ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudoreplay.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudoreplay.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ ) -sudoreplay.man:: sudoreplay.man.in - CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status +sudoreplay.man:: $(srcdir)/sudoreplay.man.in + (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status) -sudoreplay.cat: sudoreplay.man +$(srcdir)/sudoreplay.cat: sudoreplay.man -sudo_plugin.man.in: $(srcdir)/sudo_plugin.pod +$(srcdir)/sudo_plugin.man.in: $(srcdir)/sudo_plugin.pod @rm -f $(srcdir)/$@ ( cd $(srcdir); mansectsu=`echo @MANSECTSU@|tr A-Z a-z`; mansectform=`echo @MANSECTFORM@|tr A-Z a-z`; sed -n -e '/^=pod/q' -e 's/^/.\\" /p' sudo_plugin.pod > $@; pod2man --quotes=none --date="`date '+%B %e, %Y'`" --section=$$mansectsu --release=$(VERSION) --center="MAINTENANCE COMMANDS" sudo_plugin.pod | sed -e "s/(5)/($$mansectform)/" -e "s/(8)/($$mansectsu)/" -e 's|\\fI\\f\((CW*\)*I@\([^@]*\)\\fI@|\\fI@\2@|g' >> $@ ) -sudo_plugin.man:: sudo_plugin.man.in - CONFIG_FILES=$@ CONFIG_HEADERS= sh $(top_builddir)/config.status +sudo_plugin.man:: $(srcdir)/sudo_plugin.man.in + (cd $(top_builddir) && CONFIG_FILES=doc/$@ CONFIG_HEADERS= sh config.status) -sudo_plugin.cat: sudo_plugin.man +$(srcdir)/sudo_plugin.cat: sudo_plugin.man @DEV@HISTORY: history.pod @DEV@ pod2text -l -i0 $> > $@ diff --git a/plugins/sample/Makefile.in b/plugins/sample/Makefile.in index cae6ab6e3..5fbc4de5c 100644 --- a/plugins/sample/Makefile.in +++ b/plugins/sample/Makefile.in @@ -24,7 +24,6 @@ devdir = @devdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include -compat = $(top_srcdir)/compat # Compiler & tools to use CC = @CC@ @@ -64,7 +63,7 @@ SHELL = /bin/sh OBJS = sample_plugin.lo -LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/ +LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/ VERSION = @PACKAGE_VERSION@ diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index 022b53264..e8a4ec2ee 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -30,7 +30,6 @@ authdir = $(srcdir)/auth top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include -compat = $(top_srcdir)/compat # Compiler & tools to use CC = @CC@ @@ -42,7 +41,7 @@ YACC = @YACC@ INSTALL = $(SHELL) $(top_srcdir)/install-sh -c # Libraries -LIBS = $(top_srcdir)/@ac_config_libobj_dir@/libreplace.la +LIBS = $(top_builddir)/@ac_config_libobj_dir@/libreplace.la NET_LIBS = @NET_LIBS@ SUDOERS_LIBS = @SUDOERS_LIBS@ @AFS_LIBS@ @GETGROUPS_LIB@ $(LIBS) $(NET_LIBS) @ZLIB@ REPLAY_LIBS = @REPLAY_LIBS@ @ZLIB@ @@ -106,7 +105,6 @@ SUDOERS_OBJS = $(AUTH_OBJS) boottime.lo check.lo fmt_string.lo \ logging.lo parse.lo set_perms.lo sudoers.lo sudo_nss.lo \ iolog.lo @SUDOERS_OBJS@ -# XXX - need top level error.o; perhaps make #ifdef PIC? VISUDO_OBJS = visudo.o fileops.o gettime.o goodpath.o find_path.o error.o REPLAY_OBJS = getdate.o sudoreplay.o term.o error.o @@ -194,8 +192,6 @@ env.lo: $(srcdir)/env.c $(SUDODEP) $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/env.c find_path.lo: $(srcdir)/find_path.c $(SUDODEP) $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/find_path.c -getdate.lo: $(srcdir)/getdate.c $(incdir)/compat.h $(top_builddir)/config.h - $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getdate.c getspwuid.lo: $(srcdir)/getspwuid.c $(SUDODEP) $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getspwuid.c gettime.lo: $(srcdir)/gettime.c $(SUDODEP) @@ -250,9 +246,6 @@ lbuf.lo: $(top_srcdir)/src/lbuf.c $(SUDODEP) $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/lbuf.c zero_bytes.lo: $(top_srcdir)/src/zero_bytes.c $(incdir)/compat.h $(top_builddir)/config.h $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/zero_bytes.c -# XXX - for sudoreplay -term.o: $(top_srcdir)/src/term.c $(incdir)/compat.h $(top_builddir)/config.h - $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/term.c # Auth dependencies sudo_auth.lo: $(authdir)/sudo_auth.c $(AUTHDEP) $(INSDEP) @@ -286,8 +279,26 @@ securid5.lo: $(authdir)/securid5.c $(AUTHDEP) sia.lo: $(authdir)/sia.c $(AUTHDEP) $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(authdir)/sia.c +# Command dependencies (sudoreplay, testsudoers, visudo) error.o: $(top_srcdir)/src/error.c $(incdir)/error.h $(incdir)/compat.h $(top_builddir)/config.h - $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/error.c + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/error.c +fileops.o: fileops.lo +find_path.o: find_path.lo +getdate.o: $(srcdir)/getdate.c $(incdir)/compat.h $(top_builddir)/config.h + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/getdate.c +gettime.o: gettime.lo +goodpath.o: goodpath.lo +interfaces.o: interfaces.lo +sudoreplay.o: $(srcdir)/sudoreplay.c $(incdir)/alloc.h $(incdir)/compat.h $(incdir)/error.h $(incdir)/missing.h $(top_builddir)/config.h + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudoreplay.c +term.o: $(top_srcdir)/src/term.c $(incdir)/compat.h $(top_builddir)/config.h + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(top_srcdir)/src/term.c +testsudoers.o: $(srcdir)/testsudoers.c $(SUDODEP) $(srcdir)/parse.h $(incdir)/list.h $(srcdir)/interfaces.h $(devdir)/gram.h + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/testsudoers.c +tsgetgrpw.o: $(srcdir)/tsgetgrpw.c $(SUDODEP) + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/tsgetgrpw.c +visudo.o: $(srcdir)/visudo.c $(SUDODEP) $(devdir)/gram.h + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/visudo.c install: install-dirs install-plugin install-binaries install-sudoers diff --git a/src/Makefile.in b/src/Makefile.in index 89020dee8..c656aa6d1 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -24,7 +24,6 @@ devdir = @devdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ incdir = $(top_srcdir)/include -compat = $(top_srcdir)/compat # Compiler & tools to use CC = @CC@ @@ -77,7 +76,7 @@ OBJS = sudo.o parse_args.o lbuf.o alloc.o error.o zero_bytes.o \ load_plugins.o conversation.o list.o fmt_string.o tgetpass.o \ fileops.o term.o ttysize.o atobool.o script.o pty.o @SUDO_OBJS@ -LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/ +LIBOBJDIR = $(top_builddir)/@ac_config_libobj_dir@/ VERSION = @PACKAGE_VERSION@