|
From: Petr M. <mi...@ph...> - 2006-06-10 17:33:22
|
Somebody has added new file bin_hook.o into makefile.all. This strange file does just #include "binary.c". Consequently, makefiles including makefile.all fail to link gnuplot because of multiple definitions from bin_hook.o and binary.o (e.g. makefile.mgw). Which one to remove from makefile.all? Or another action to take? --- PM |
|
From: Ethan A M. <merritt@u.washington.edu> - 2006-06-10 17:54:21
|
On Saturday 10 June 2006 10:33 am, Petr Mikulik wrote: > Somebody has added new file bin_hook.o into makefile.all. Huh? It was added in 2004. > This strange file > does just #include "binary.c". Consequently, makefiles including > makefile.all fail to link gnuplot because of multiple definitions from > bin_hook.o and binary.o (e.g. makefile.mgw). According to the ChangeLog comment, bin_hook.o was supposed to replace binary.o > Which one to remove from makefile.all? Or another action to take? But you are correct. That doesn't seem to be what really happened. So far as I can tell, bin_hook is not used anywhere and should be deleted altogether. Both the source file and the mention of it in the Makefiles are superfluous. Daniel: This was your addition, correct? Is it really correct that bin_hook is not referred to anywhere, in any source file? I take it that the idea was to make inclusion of the routines in binary.o into the final executable be conditional on BINARY_DATA_FILE. It doesn't seem to have worked, and anyhow I don't think that is the proper way to do it. The Makefiles produced by ./configure should either include binary.o, or not, depending on whether BINARY_DATA_FILE was selected. It should not require any extra source files. -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |
|
From: Daniel J S. <dan...@ie...> - 2006-06-13 06:13:17
|
Ethan A Merritt wrote: > On Saturday 10 June 2006 10:33 am, Petr Mikulik wrote: > >>Somebody has added new file bin_hook.o into makefile.all. > > > Huh? It was added in 2004. > > >>This strange file >>does just #include "binary.c". Consequently, makefiles including >>makefile.all fail to link gnuplot because of multiple definitions from >>bin_hook.o and binary.o (e.g. makefile.mgw). Hmm, that seems like something isn't programmed correctly. What platform is makefile.mgw, i.e., what variables are defined for the compilation you are trying? > According to the ChangeLog comment, bin_hook.o was supposed to replace > binary.o Yes, well not so much replace, but be a form of conditionally including binary.c. But it does replace binary.c in the list of gnuplot_SOURCES = alloc.c alloc.h ansichek.h axis.c axis.h bin_hook.c \ breaders.c breaders.h bitmap.c bitmap.h color.c color.h command.c \... > >>Which one to remove from makefile.all? Or another action to take? > > > But you are correct. That doesn't seem to be what really happened. > So far as I can tell, bin_hook is not used anywhere and should > be deleted altogether. Both the source file and the mention of it in > the Makefiles are superfluous. > > Daniel: > This was your addition, correct? Yes, that was from pretty far back. I don't see how Lars' name got tied in with that. > Is it really correct > that bin_hook is not referred to anywhere, in any source file? > > I take it that the idea was to make inclusion of the routines in binary.o > into the final executable be conditional on BINARY_DATA_FILE. Yes, the reason for this hook is that binary.c is needed for two programs, that special C program to generate binary data and gnuplot in the case BINARY_DATA_FILE is not active. When BINARY_DATA_FILE is active, from what I recall, a few extra lines of code achieved what the code in binary.c does. The reason for the hook is that binary.c must be present for the bf_test.c program that generates binary data. From the Makefile.am: bf_test_SOURCES = bf_test.c binary.c binary.h alloc.c so we can't put any type of defined conditional around the code inside binary.c, i.e., bf_test.c always needs it. Hence, this bin_hook.c accomplishes the defined conditional for gnuplot while leaving the code compiled in binary.o for bf_test. > It doesn't seem to have worked, and anyhow I don't think that is the > proper way to do it. There may be a better way. I didn't put too much effort into a better method because I hoped that eventually gnuplot wouldn't need the code inside binary.c anymore, in which case binary.c could be dedicated simply to the C program for creating binary files (bf_test), and bin_hook.c would get the heav-ho from gnuplot_SOURCES. > The Makefiles produced by ./configure should either > include binary.o, or not, depending on whether BINARY_DATA_FILE was selected. > It should not require any extra source files. I suppose the best thing is that based upon BINARY_DATA_FILE in ./configure, the file binary.c would or wouldn't be present in the list where bin_hook.c is. That is: gnuplot_SOURCES = alloc.c alloc.h ansichek.h axis.c axis.h bin_hook.c \ breaders.c breaders.h bitmap.c bitmap.h color.c color.h command.c \... becomes gnuplot_SOURCES = alloc.c alloc.h ansichek.h axis.c axis.h binary.c \ breaders.c breaders.h bitmap.c bitmap.h color.c color.h command.c \... or gnuplot_SOURCES = alloc.c alloc.h ansichek.h axis.c axis.h \ breaders.c breaders.h bitmap.c bitmap.h color.c color.h command.c \... whichever is appropriate. I don't know how to do that in configure. Dan |
|
From: <tim...@en...> - 2006-06-13 06:23:44
|
Daniel J Sebald wrote:
> I suppose the best thing is that based upon BINARY_DATA_FILE in=20
> ./configure, the file binary.c would or wouldn't be present in the=20
> list where bin_hook.c is. That is:
> gnuplot_SOURCES =3D alloc.c alloc.h ansichek.h axis.c axis.h bin_hook.c=
\
> breaders.c breaders.h bitmap.c bitmap.h color.c color.h command.c \...
>
> becomes
>
> gnuplot_SOURCES =3D alloc.c alloc.h ansichek.h axis.c axis.h binary.c \
> breaders.c breaders.h bitmap.c bitmap.h color.c color.h command.c \...
>
> or
>
> gnuplot_SOURCES =3D alloc.c alloc.h ansichek.h axis.c axis.h \
> breaders.c breaders.h bitmap.c bitmap.h color.c color.h command.c \...
>
> whichever is appropriate. I don't know how to do that in configure.
> =20
You add in configure.in, just after the "if test=20
"$enable_binary_data_file" =3D yes ... fi" code :
AM_CONDITIONAL(BUILD_BINARY_C, test "$enable_binary_data_file" =3D yes=
)
And in src/Makefile.am, you add :
if BUILD_BINARY_C
gnuplot_SOURCES +=3D binary.c
endif
=20
This is (one of) the standard way(s) to do conditional compilation=20
according to the autotools doc.
Timoth=E9e
|
|
From: Daniel J S. <dan...@ie...> - 2006-06-13 18:47:26
|
Timoth=E9e Lecomte wrote: > You add in configure.in, just after the "if test=20 > "$enable_binary_data_file" =3D yes ... fi" code : >=20 > AM_CONDITIONAL(BUILD_BINARY_C, test "$enable_binary_data_file" =3D ye= s) >=20 > And in src/Makefile.am, you add : >=20 > if BUILD_BINARY_C > gnuplot_SOURCES +=3D binary.c > endif > =20 > This is (one of) the standard way(s) to do conditional compilation=20 > according to the autotools doc. A-ha! Thank you... Patch on SourceForge to rid bin_hook.c. Dan |
|
From: <br...@ph...> - 2006-06-10 17:56:26
|
Petr Mikulik wrote: > Somebody has added new file bin_hook.o into makefile.all. "Somebody" was actually Lars Hecking (--> "cvs annotate" helps to find out such things), or, to be more precise, Lars just checked in what the automatic mechanism in src/Makefile.maint generates. This is one of those pitfalls that tend to show up only when we gear up for a release cycle --- auto-maintenance techniques never used in between releases suddenly turn out to need maintenance of their own. |