You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by fi...@apache.org on 2001/05/01 07:54:21 UTC

cvs commit: apr/test Makefile.in

fielding    01/04/30 22:54:21

  Modified:    build    rules.mk.in
               test     Makefile.in
  Log:
  Be careful not to override what was set by configure for ALL_LIBS
  and order them such that user-defined LIBS are preferred over those
  picked as EXTRA_LIBS by configure.
  
  Revision  Changes    Path
  1.12      +1 -1      apr/build/rules.mk.in
  
  Index: rules.mk.in
  ===================================================================
  RCS file: /home/cvs/apr/build/rules.mk.in,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- rules.mk.in	2001/05/01 04:52:03	1.11
  +++ rules.mk.in	2001/05/01 05:54:21	1.12
  @@ -105,7 +105,7 @@
   ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
   ALL_CFLAGS   = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
   ALL_LDFLAGS  = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
  -ALL_LIBS     = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS)
  +ALL_LIBS     = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS)
   ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
   
   ### make LTFLAGS somewhat variable?
  
  
  
  1.49      +49 -49    apr/test/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/apr/test/Makefile.in,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- Makefile.in	2001/04/30 00:10:03	1.48
  +++ Makefile.in	2001/05/01 05:54:21	1.49
  @@ -30,7 +30,7 @@
   # bring in rules.mk for standard functionality
   @INCLUDE_RULES@
   
  -ALL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS) $(EXTRA_LIBS)
  +LOCAL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la
   
   CLEAN_TARGETS = testfile.tmp
   
  @@ -38,77 +38,77 @@
   INCLUDES=-I$(INCDIR)
   
   
  -testfile@EXEEXT@: testfile.lo ../libapr.la
  -	$(LINK) testfile.lo $(ALL_LIBS)
  +testfile@EXEEXT@: testfile.lo $(LOCAL_LIBS)
  +	$(LINK) testfile.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testnames@EXEEXT@: testnames.lo ../libapr.la
  -	$(LINK) testnames.lo $(ALL_LIBS)
  +testnames@EXEEXT@: testnames.lo $(LOCAL_LIBS)
  +	$(LINK) testnames.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testflock@EXEEXT@: testflock.lo ../libapr.la
  -	$(LINK) testflock.lo $(ALL_LIBS)
  +testflock@EXEEXT@: testflock.lo $(LOCAL_LIBS)
  +	$(LINK) testflock.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
   ### why the export-dynamic?
  -testdso@EXEEXT@: testdso.lo ../libapr.la
  -	$(LINK) --export-dynamic testdso.lo $(ALL_LIBS)
  +testdso@EXEEXT@: testdso.lo $(LOCAL_LIBS)
  +	$(LINK) --export-dynamic testdso.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testoc@EXEEXT@: testoc.lo ../libapr.la
  -	$(LINK) testoc.lo $(ALL_LIBS)
  +testoc@EXEEXT@: testoc.lo $(LOCAL_LIBS)
  +	$(LINK) testoc.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -occhild@EXEEXT@: occhild.lo ../libapr.la
  -	$(LINK) occhild.lo $(ALL_LIBS)
  +occhild@EXEEXT@: occhild.lo $(LOCAL_LIBS)
  +	$(LINK) occhild.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -mod_test.so: mod_test.lo ../libapr.la
  -	$(LINK) -shared mod_test.o $(ALL_LIBS)
  +mod_test.so: mod_test.lo $(LOCAL_LIBS)
  +	$(LINK) -shared mod_test.o $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testargs@EXEEXT@: testargs.lo ../libapr.la
  -	$(LINK) testargs.lo $(ALL_LIBS)
  +testargs@EXEEXT@: testargs.lo $(LOCAL_LIBS)
  +	$(LINK) testargs.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testcontext@EXEEXT@: testcontext.lo ../libapr.la
  -	$(LINK) testcontext.lo $(ALL_LIBS)
  +testcontext@EXEEXT@: testcontext.lo $(LOCAL_LIBS)
  +	$(LINK) testcontext.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testproc@EXEEXT@: testproc.lo ../libapr.la
  -	$(LINK) testproc.lo $(ALL_LIBS)
  +testproc@EXEEXT@: testproc.lo $(LOCAL_LIBS)
  +	$(LINK) testproc.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testthread@EXEEXT@: testthread.lo ../libapr.la
  -	$(LINK) testthread.lo $(ALL_LIBS)
  +testthread@EXEEXT@: testthread.lo $(LOCAL_LIBS)
  +	$(LINK) testthread.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ ../libapr.la
  -	$(LINK) testsock.lo $(ALL_LIBS)
  +testsock@EXEEXT@: testsock.lo client@EXEEXT@ server@EXEEXT@ sendfile@EXEEXT@ $(LOCAL_LIBS)
  +	$(LINK) testsock.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -client@EXEEXT@: client.lo ../libapr.la
  -	$(LINK) client.lo $(ALL_LIBS)
  +client@EXEEXT@: client.lo $(LOCAL_LIBS)
  +	$(LINK) client.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -server@EXEEXT@: server.lo sendfile.lo ../libapr.la
  -	$(LINK) server.lo $(ALL_LIBS)
  +server@EXEEXT@: server.lo sendfile.lo $(LOCAL_LIBS)
  +	$(LINK) server.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -sendfile@EXEEXT@: sendfile.lo ../libapr.la
  -	$(LINK) sendfile.lo $(ALL_LIBS)
  +sendfile@EXEEXT@: sendfile.lo $(LOCAL_LIBS)
  +	$(LINK) sendfile.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testtime@EXEEXT@: testtime.lo ../libapr.la
  -	$(LINK) testtime.lo $(ALL_LIBS)
  +testtime@EXEEXT@: testtime.lo $(LOCAL_LIBS)
  +	$(LINK) testtime.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testmmap@EXEEXT@: testmmap.lo ../libapr.la
  -	$(LINK) testmmap.lo $(ALL_LIBS)
  +testmmap@EXEEXT@: testmmap.lo $(LOCAL_LIBS)
  +	$(LINK) testmmap.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testshmem@EXEEXT@: testshmem.lo ../libapr.la
  -	$(LINK) testshmem.lo $(ALL_LIBS)
  +testshmem@EXEEXT@: testshmem.lo $(LOCAL_LIBS)
  +	$(LINK) testshmem.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testpipe@EXEEXT@: testpipe.lo ../libapr.la
  -	$(LINK) testpipe.lo $(ALL_LIBS)
  +testpipe@EXEEXT@: testpipe.lo $(LOCAL_LIBS)
  +	$(LINK) testpipe.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testuuid@EXEEXT@: testuuid.lo ../libapr.la
  -	$(LINK) testuuid.lo $(ALL_LIBS)
  +testuuid@EXEEXT@: testuuid.lo $(LOCAL_LIBS)
  +	$(LINK) testuuid.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testsockopt@EXEEXT@: testsockopt.lo ../libapr.la
  -	$(LINK) testsockopt.lo $(ALL_LIBS)
  +testsockopt@EXEEXT@: testsockopt.lo $(LOCAL_LIBS)
  +	$(LINK) testsockopt.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testipsub@EXEEXT@: testipsub.lo ../libapr.la
  -	$(LINK) testipsub.lo $(ALL_LIBS)
  +testipsub@EXEEXT@: testipsub.lo $(LOCAL_LIBS)
  +	$(LINK) testipsub.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testmd5@EXEEXT@: testmd5.lo ../libapr.la
  -	$(LINK) testmd5.lo $(ALL_LIBS)
  +testmd5@EXEEXT@: testmd5.lo $(LOCAL_LIBS)
  +	$(LINK) testmd5.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
  -testpoll@EXEEXT@: testpoll.lo ../libapr.la
  -	$(LINK) testpoll.lo $(ALL_LIBS)
  +testpoll@EXEEXT@: testpoll.lo $(LOCAL_LIBS)
  +	$(LINK) testpoll.lo $(LOCAL_LIBS) $(ALL_LIBS)
   
   # DO NOT REMOVE
  
  
  

Re: cvs commit: apr/test Makefile.in

Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
> Basically, the LINK macro would use LOCAL_LIBS and ALL_LIBS. The Makefile
> would just need to set LOCAL_LIBS. It may have been that I did the "set"
> after including rules.mk, so it didn't "take".

I don't think that would make any difference since the variables aren't
evaluated until they are used.  That's why I can't so something like

   LIBS = locallib1.a $(LIBS)

The problem with including things like ALL_LIBS in the LINK command
itself is that it becomes hard to get the order right with overrides.

We should really have separate LINK macros for linking a library versus
linking a program, and we should be picking up program-specific make
variables instead of assuming they are all the same per directory.  Like

   testname_LDFLAGS = -dynamic
   testname_LDADD = ../libapr.a
   testname_DEPENDENCIES = ../libapr.a

   testnames: $(testnames_OBJECTS) $(testnames_DEPENDENCIES)
	@rm -f testnames
	$(LINK) $(testnames_LDFLAGS) $(testnames_OBJECTS) $(testnames_LDADD) $(LIBS)

In truth, what we'll end up with will be very much like automake except
that our stuff doesn't assume the Gnu tools are installed.

Does anyone know if nested variable refs are portable?  Like

$(PROGRAMS): $($@_OBJECTS) $($@_DEPENDENCIES)
	@rm -f $@
	$(LINK) $($@_LDFLAGS) $($@_OBJECTS) $($@_LDADD) $(LIBS)


....Roy


Re: cvs commit: apr/test Makefile.in

Posted by Greg Stein <gs...@lyra.org>.
On Tue, May 01, 2001 at 05:54:21AM -0000, fielding@apache.org wrote:
> fielding    01/04/30 22:54:21
> 
>   Modified:    build    rules.mk.in
>                test     Makefile.in
>   Log:
>   Be careful not to override what was set by configure for ALL_LIBS
>   and order them such that user-defined LIBS are preferred over those
>   picked as EXTRA_LIBS by configure.
>...
>   -ALL_LIBS     = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS)
>   +ALL_LIBS     = $(LIBS) $(NOTEST_LIBS) $(EXTRA_LIBS)
>...
>   -ALL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS) $(EXTRA_LIBS)
>   +LOCAL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la
>...
>   +testfile@EXEEXT@: testfile.lo $(LOCAL_LIBS)
>   +	$(LINK) testfile.lo $(LOCAL_LIBS) $(ALL_LIBS)

When I first set up the apr-util build stuff, I tried to put all the LIBS
stuff into the $(LINK) macro itself, so that the Makefile lines would be
much simpler. It seems that some code had a problem with it (Jeff changed
things around), but I wasn't really clear about it and never pursued it. If
that sounds reasonable to you, then you may want to take a look at it.

Basically, the LINK macro would use LOCAL_LIBS and ALL_LIBS. The Makefile
would just need to set LOCAL_LIBS. It may have been that I did the "set"
after including rules.mk, so it didn't "take".

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/