unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* using autoconf for lib-src/Makefile.in
@ 2008-08-02  4:43 Dan Nicolaescu
  2008-08-02  5:11 ` Chong Yidong
  2008-08-03  5:45 ` Miles Bader
  0 siblings, 2 replies; 12+ messages in thread
From: Dan Nicolaescu @ 2008-08-02  4:43 UTC (permalink / raw)
  To: emacs-devel


The use of the C preprocessor on the Makefiles is not ideal.

It seems that the number of #ifdefs in lib-src/Makefile.in is not too
high, and there's enough infrastructure in configure.in in place to make
it feasible to replace the use of the preprocessor.

This patch gets rid of the C_SWITCH_SYSTEM #ifdef.  It seems to work
fine on x86 Fedora.

Is this TRTD?


--- Makefile.in.~1.167.~	2008-07-21 11:34:27.000000000 -0700
+++ Makefile.in	2008-08-01 14:49:50.000000000 -0700
@@ -161,10 +161,6 @@ INSTALLABLES = etags${EXEEXT} ctags${EXE
 #define LIBS_MACHINE
 #endif
 
-#ifndef C_SWITCH_SYSTEM
-#define C_SWITCH_SYSTEM
-#endif
-
 #ifndef C_SWITCH_MACHINE
 #define C_SWITCH_MACHINE
 #endif
@@ -237,16 +233,16 @@ LOADLIBES=LIBS_SYSTEM LIBS_MACHINE
    Some other files - those shared with other GNU utilities - need
    HAVE_CONFIG_H #defined before they know they can take advantage of
    the information in ../src/config.h.  */
-ALL_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
+ALL_CFLAGS = @c_switch_system@ C_SWITCH_MACHINE -DHAVE_CONFIG_H \
    -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
-LINK_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
+LINK_CFLAGS = @c_switch_system@ C_SWITCH_MACHINE -DHAVE_CONFIG_H \
    -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CFLAGS}
-CPP_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
+CPP_CFLAGS = @c_switch_system@ C_SWITCH_MACHINE -DHAVE_CONFIG_H \
    -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
 /* This was all of CPP_CFLAGS except -Demacs.
    Now that -Demacs has been deleted from CPP_CFLAGS,
    this is actually the same as CPP_CFLAGS, but let\'s not delete it yet.  */
-BASE_CFLAGS = C_SWITCH_SYSTEM C_SWITCH_MACHINE -DHAVE_CONFIG_H \
+BASE_CFLAGS = @c_switch_system@ C_SWITCH_MACHINE -DHAVE_CONFIG_H \
    -I. -I../src -I${srcdir} -I${srcdir}/../src ${CPPFLAGS} ${CFLAGS}
 \f
 .SUFFIXES: .m




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-02  4:43 using autoconf for lib-src/Makefile.in Dan Nicolaescu
@ 2008-08-02  5:11 ` Chong Yidong
  2008-08-02  6:48   ` Dan Nicolaescu
  2008-08-03  5:45 ` Miles Bader
  1 sibling, 1 reply; 12+ messages in thread
From: Chong Yidong @ 2008-08-02  5:11 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> The use of the C preprocessor on the Makefiles is not ideal.
>
> It seems that the number of #ifdefs in lib-src/Makefile.in is not too
> high, and there's enough infrastructure in configure.in in place to make
> it feasible to replace the use of the preprocessor.
>
> This patch gets rid of the C_SWITCH_SYSTEM #ifdef.  It seems to work
> fine on x86 Fedora.
>
> Is this TRTD?

Note that such changes shouldn't be checked in right now.  During the
testing phase, checkins should fix actual bugs.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-02  5:11 ` Chong Yidong
@ 2008-08-02  6:48   ` Dan Nicolaescu
  2008-08-04 19:00     ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Nicolaescu @ 2008-08-02  6:48 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > 
  > > The use of the C preprocessor on the Makefiles is not ideal.
  > >
  > > It seems that the number of #ifdefs in lib-src/Makefile.in is not too
  > > high, and there's enough infrastructure in configure.in in place to make
  > > it feasible to replace the use of the preprocessor.
  > >
  > > This patch gets rid of the C_SWITCH_SYSTEM #ifdef.  It seems to work
  > > fine on x86 Fedora.
  > >
  > > Is this TRTD?
  > 
  > Note that such changes shouldn't be checked in right now. 

No intention to do that whatsoever.  It's just better to create a public
record of this so that it does not get completely forgotten (I probably will). 




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-02  4:43 using autoconf for lib-src/Makefile.in Dan Nicolaescu
  2008-08-02  5:11 ` Chong Yidong
@ 2008-08-03  5:45 ` Miles Bader
  2008-08-04  1:12   ` Dan Nicolaescu
  1 sibling, 1 reply; 12+ messages in thread
From: Miles Bader @ 2008-08-03  5:45 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:
> This patch gets rid of the C_SWITCH_SYSTEM #ifdef.  It seems to work
> fine on x86 Fedora.

BTW, isn't it generally considered a good idea to not use @fooo@
substitutions directly in make rules, but rather use them indirectly via
a make variable?

E.g., instead of:

   some_dep: @blargh@ other_stuff

Use:

   BLARGH = @blargh@
   ...
   some_dep: $(BLARGH) other_stuff

[Where the definition of BLARGH is near the beginning of the makefile
with other var defs.]

-Miles

-- 
Justice, n. A commodity which in a more or less adulterated condition the
State sells to the citizen as a reward for his allegiance, taxes and personal
service.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-03  5:45 ` Miles Bader
@ 2008-08-04  1:12   ` Dan Nicolaescu
  2008-08-04  5:28     ` Miles Bader
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Nicolaescu @ 2008-08-04  1:12 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

Miles Bader <miles@gnu.org> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > > This patch gets rid of the C_SWITCH_SYSTEM #ifdef.  It seems to work
  > > fine on x86 Fedora.
  > 
  > BTW, isn't it generally considered a good idea to not use @fooo@
  > substitutions directly in make rules, but rather use them indirectly via
  > a make variable?

Thanks, wasn't aware of that.
With this fixed, is the rest of the approach TRTD?




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-04  1:12   ` Dan Nicolaescu
@ 2008-08-04  5:28     ` Miles Bader
  2008-08-04  6:16       ` Dan Nicolaescu
  0 siblings, 1 reply; 12+ messages in thread
From: Miles Bader @ 2008-08-04  5:28 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:
>   > BTW, isn't it generally considered a good idea to not use @fooo@
>   > substitutions directly in make rules, but rather use them indirectly via
>   > a make variable?
>
> Thanks, wasn't aware of that.
> With this fixed, is the rest of the approach TRTD?

Er, well I dunno really; seems like there's a lot of other uses of
C_SWITCH_SYSTEM in there that you don't change...

-Miles

-- 
White, adj. and n. Black.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-04  5:28     ` Miles Bader
@ 2008-08-04  6:16       ` Dan Nicolaescu
  2008-08-04 10:21         ` Miles Bader
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Nicolaescu @ 2008-08-04  6:16 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

Miles Bader <miles.bader@necel.com> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > >   > BTW, isn't it generally considered a good idea to not use @fooo@
  > >   > substitutions directly in make rules, but rather use them indirectly via
  > >   > a make variable?
  > >
  > > Thanks, wasn't aware of that.
  > > With this fixed, is the rest of the approach TRTD?
  > 
  > Er, well I dunno really; seems like there's a lot of other uses of
  > C_SWITCH_SYSTEM in there that you don't change...

In lib-src/Makefile.in ? For this first experiment let's just look at
lib-src/Makefile.in.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-04  6:16       ` Dan Nicolaescu
@ 2008-08-04 10:21         ` Miles Bader
  2008-08-04 11:55           ` Dan Nicolaescu
  0 siblings, 1 reply; 12+ messages in thread
From: Miles Bader @ 2008-08-04 10:21 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:
> In lib-src/Makefile.in ? For this first experiment let's just look at
> lib-src/Makefile.in.

In that case, seems reasonable, at least as far as Makefile.in is
considered....

Does a proper subst get defined by configure though?  At least, I don't
see any obvious calls to AC_SUBST for C_SWITCH_SYSTEM....

-Miles

-- 
Discriminate, v.i. To note the particulars in which one person or thing is,
if possible, more objectionable than another.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-04 10:21         ` Miles Bader
@ 2008-08-04 11:55           ` Dan Nicolaescu
  0 siblings, 0 replies; 12+ messages in thread
From: Dan Nicolaescu @ 2008-08-04 11:55 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

Miles Bader <miles.bader@necel.com> writes:

  > Dan Nicolaescu <dann@ics.uci.edu> writes:
  > > In lib-src/Makefile.in ? For this first experiment let's just look at
  > > lib-src/Makefile.in.
  > 
  > In that case, seems reasonable, at least as far as Makefile.in is
  > considered....
  > 
  > Does a proper subst get defined by configure though?  At least, I don't
  > see any obvious calls to AC_SUBST for C_SWITCH_SYSTEM....

There is one for c_switch_system, and @c_switch_system@ is what the
proposal uses in lib-src/Makefile.in.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-02  6:48   ` Dan Nicolaescu
@ 2008-08-04 19:00     ` Stefan Monnier
  2008-08-07 17:33       ` Dan Nicolaescu
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2008-08-04 19:00 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Chong Yidong, emacs-devel

>> Note that such changes shouldn't be checked in right now. 

> No intention to do that whatsoever.  It's just better to create
> a public record of this so that it does not get completely forgotten
> (I probably will). 

Maybe we could create a Bzr branch for such patches?


        Stefan




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-04 19:00     ` Stefan Monnier
@ 2008-08-07 17:33       ` Dan Nicolaescu
  2008-08-07 19:31         ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Dan Nicolaescu @ 2008-08-07 17:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Chong Yidong, emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

  > >> Note that such changes shouldn't be checked in right now. 
  > 
  > > No intention to do that whatsoever.  It's just better to create
  > > a public record of this so that it does not get completely forgotten
  > > (I probably will). 
  > 
  > Maybe we could create a Bzr branch for such patches?

I'd say: YES.  Hopefully more people will join the effort.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: using autoconf for lib-src/Makefile.in
  2008-08-07 17:33       ` Dan Nicolaescu
@ 2008-08-07 19:31         ` Stefan Monnier
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2008-08-07 19:31 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Chong Yidong, emacs-devel

>> >> Note that such changes shouldn't be checked in right now. 
>> > No intention to do that whatsoever.  It's just better to create
>> > a public record of this so that it does not get completely forgotten
>> > (I probably will). 
>> Maybe we could create a Bzr branch for such patches?
> I'd say: YES.  Hopefully more people will join the effort.

Please do, then.


        Stefan




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-08-07 19:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-02  4:43 using autoconf for lib-src/Makefile.in Dan Nicolaescu
2008-08-02  5:11 ` Chong Yidong
2008-08-02  6:48   ` Dan Nicolaescu
2008-08-04 19:00     ` Stefan Monnier
2008-08-07 17:33       ` Dan Nicolaescu
2008-08-07 19:31         ` Stefan Monnier
2008-08-03  5:45 ` Miles Bader
2008-08-04  1:12   ` Dan Nicolaescu
2008-08-04  5:28     ` Miles Bader
2008-08-04  6:16       ` Dan Nicolaescu
2008-08-04 10:21         ` Miles Bader
2008-08-04 11:55           ` Dan Nicolaescu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).