Delivered-To: listarch-cygwin-developers AT sourceware DOT cygnus DOT com Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com X-Authentication-Warning: modi.xraylith.wisc.edu: khan owned process doing -bs Date: Mon, 15 Feb 1999 15:53:42 -0600 (CST) From: Mumit Khan To: cygwin-developers AT sourceware DOT cygnus DOT com Subject: tiny winsup config patch Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII The following is a trivial patch to winsup configuration that handles a few glitches currently in the snapshots. Note that I've not included patch to regenerated configure. Against 1999-02-08 snapshot. Sun Feb 14 17:22:09 1999 Mumit Khan * configure.in (EXE_LDFLAGS): Always add newlib if part of the build tree. * utils/Makefile.in (INCLUDES): Add newlib include directories. (LDFLAGS): Replace this with (ALL_LDFLAGS): this to avoid being overridden from higher level Makefiles. --- winsup/configure.in.~1 Sun Feb 14 17:08:03 1999 +++ winsup/configure.in Mon Feb 15 11:17:24 1999 @@ -145,22 +145,35 @@ dnl because crt0.o hasn't been installed dnl newlib. Newlib is ../newlib when configure runs, but is ../../newlib dnl from the perspective of subdirectory makes. -AC_MSG_CHECKING([if newlib needed]) +dnl +dnl If newlib is part of build tree, always set EXE_LDFLAGS to point to +dnl it; this is important in cases where the installed newlib is perhaps +dnl not compatible. Check and warn for installed newlib only if it's not +dnl part of the build tree. +dnl + +AC_MSG_CHECKING([if newlib is part of the build tree]) EXE_LDFLAGS= -AC_TRY_LINK(, - [/* main already defined */] - , - AC_MSG_RESULT(no) - , - AC_MSG_RESULT(yes) - if test -d ../newlib - then - EXE_LDFLAGS="-B../../newlib/ -L.." - else - AC_MSG_WARN(newlib not found - utility .exe's may not link) - fi -) +if test -d ../newlib +then + AC_MSG_RESULT(yes) + EXE_LDFLAGS="-B../../newlib/ -L.." +else + AC_MSG_RESULT(no) +fi AC_SUBST(EXE_LDFLAGS) + +if test x"$EXE_LDFLAGS" = x +then + AC_MSG_CHECKING([if installed newlib needed]) + AC_TRY_LINK(, + [/* main already defined */] + , + AC_MSG_RESULT(no) + , + AC_MSG_RESULT(yes) + AC_MSG_WARN(newlib not found - utility .exe's may not link)) +fi case "$target_cpu" in i386|i486|i586|i686) DLL_ENTRY="_dll_entry AT 12" --- winsup/utils/Makefile.in.~1 Sun Feb 14 17:00:55 1999 +++ winsup/utils/Makefile.in Sun Feb 14 17:03:06 1999 @@ -30,13 +30,15 @@ CC = @CC@ CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ -INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../include +INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../include \ + -I$(srcdir)/../../newlib/libc/sys/cygwin \ + -I$(srcdir)/../../newlib/libc/include ALL_CFLAGS = $(CFLAGS) $(INCLUDES) ALL_CXXFLAGS = $(CXXFLAGS) $(INCLUDES) # Passed in from ../Makefile. -LDFLAGS:=$(EXE_LDFLAGS) ../libcygwin.a +ALL_LDFLAGS := $(LDFLAGS) $(EXE_LDFLAGS) ../libcygwin.a PROGS = mount$(EXEEXT) umount$(EXEEXT) ps$(EXEEXT) kill$(EXEEXT) \ mkpasswd$(EXEEXT) mkgroup$(EXEEXT) cygpath$(EXEEXT) cygcheck$(EXEEXT) \ @@ -48,34 +50,34 @@ WINSUP_DEPS = $(srcdir)/../winsup.h all: $(PROGS) mount$(EXEEXT): mount.cc $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/mount.cc $(ALL_CXXFLAGS) $(LDFLAGS) + $(CC) -o $@ $(srcdir)/mount.cc $(ALL_CXXFLAGS) $(ALL_LDFLAGS) umount$(EXEEXT): umount.cc $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/umount.cc $(ALL_CXXFLAGS) $(LDFLAGS) + $(CC) -o $@ $(srcdir)/umount.cc $(ALL_CXXFLAGS) $(ALL_LDFLAGS) ps$(EXEEXT): ps.cc $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/ps.cc $(ALL_CXXFLAGS) $(LDFLAGS) + $(CC) -o $@ $(srcdir)/ps.cc $(ALL_CXXFLAGS) $(ALL_LDFLAGS) kill$(EXEEXT): kill.cc $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/kill.cc $(ALL_CXXFLAGS) $(LDFLAGS) + $(CC) -o $@ $(srcdir)/kill.cc $(ALL_CXXFLAGS) $(ALL_LDFLAGS) cygwin$(EXEEXT): cygwin.cc $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/cygwin.cc $(ALL_CXXFLAGS) $(LDFLAGS) + $(CC) -o $@ $(srcdir)/cygwin.cc $(ALL_CXXFLAGS) $(ALL_LDFLAGS) mkpasswd$(EXEEXT): mkpasswd.c $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/mkpasswd.c $(ALL_CXXFLAGS) $(LDFLAGS) -lnetapi32 -ladvapi32 + $(CC) -o $@ $(srcdir)/mkpasswd.c $(ALL_CXXFLAGS) $(ALL_LDFLAGS) -lnetapi32 -ladvapi32 mkgroup$(EXEEXT): mkgroup.c $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/mkgroup.c $(ALL_CXXFLAGS) $(LDFLAGS) -lnetapi32 -ladvapi32 + $(CC) -o $@ $(srcdir)/mkgroup.c $(ALL_CXXFLAGS) $(ALL_LDFLAGS) -lnetapi32 -ladvapi32 cygpath$(EXEEXT): cygpath.cc $(WINSUP_DEFS) - $(CC) -o $@ $(srcdir)/cygpath.cc $(ALL_CXXFLAGS) $(LDFLAGS) + $(CC) -o $@ $(srcdir)/cygpath.cc $(ALL_CXXFLAGS) $(ALL_LDFLAGS) cygcheck$(EXEEXT): cygcheck.cc $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/cygcheck.cc $(ALL_CXXFLAGS) $(LDFLAGS) + $(CC) -o $@ $(srcdir)/cygcheck.cc $(ALL_CXXFLAGS) $(ALL_LDFLAGS) passwd$(EXEEXT): passwd.c $(WINSUP_DEPS) - $(CC) -o $@ $(srcdir)/passwd.c $(ALL_CXXFLAGS) $(LDFLAGS) -lnetapi32 + $(CC) -o $@ $(srcdir)/passwd.c $(ALL_CXXFLAGS) $(ALL_LDFLAGS) -lnetapi32 clean: rm -f *.o $(PROGS)