Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-tkdefs not working correctly (can't find tk.h) #3081

Closed
vicuna opened this issue Dec 14, 2001 · 5 comments
Closed

-tkdefs not working correctly (can't find tk.h) #3081

vicuna opened this issue Dec 14, 2001 · 5 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Dec 14, 2001

Original bug ID: 716
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hello, ...

In ocaml 3.04 and previous, the -tkdefs option don't seem to work properly for
tk.h files not in the standard place.

for example, consider the tcl/tk stuff in /usr/include/tcl8.3.

./configure -tkdefs "-I /usr/include/tcl8.3" -tklibs "-L/usr/lib -ltk8.3 -ltcl8.3"

gives :

...
Configuring LablTk...
tcl.h version 8.3 found.
tk.h not found.
Configuration failed, LablTk will not be built.
...

The problem is due in :

if test $has_tk = true; then
if sh ./hasgot $tk_x11_include $tk_defs -i tk.h; then
echo "tk.h found."
else
echo "tk.h not found."
has_tk=false
fi
fi

where the cc variables don't make it to the hasgot script, nor does it seem to
work well when both $tk_x11_include and $tk_defs are defined.

doing :

  • if sh ./hasgot $tk_x11_include $tk_defs -i tk.h; then
  • if cc="$cc" sh ./hasgot "$tk_x11_include $tk_defs" -i tk.h; then

as in the attached patch, make it work well for me, but may not be the best
solution around. Also notice that this problem may be present also in other
places of the configure script, i have not checked further.

(Sorry for not having discovered this before the 3.04 release, i had not the
time :((()

Friendly,

Sven Luther


--- configure.orig Fri Dec 14 15:20:48 2001
+++ configure Fri Dec 14 15:26:09 2001
@@ -1148,7 +1148,7 @@
fi

if test $has_tk = true; then

  • if sh ./hasgot $tk_x11_include $tk_defs -i tk.h; then
  • if cc="$cc" sh ./hasgot "$tk_x11_include $tk_defs" -i tk.h; then
    echo "tk.h found."
    else
    echo "tk.h not found."


@vicuna
Copy link
Author

vicuna commented Dec 16, 2001

Comment author: administrator

From: luther@dpt-info.u-strasbg.fr

In ocaml 3.04 and previous, the -tkdefs option don't seem to work
properly for tk.h files not in the standard place.

for example, consider the tcl/tk stuff in /usr/include/tcl8.3.

./configure -tkdefs "-I /usr/include/tcl8.3" -tklibs "-L/usr/lib
-ltk8.3 -ltcl8.3"
...
Configuring LablTk...
tcl.h version 8.3 found.
tk.h not found.

Are you sure that tk.h is in /usr/include/tcl8.3 ?
I would expect it to be in /usr/include/tk8.3, which would explain why
you can find tcl.h but not tk.h.

Jacques Garrigue

@vicuna
Copy link
Author

vicuna commented Dec 16, 2001

Comment author: administrator

On Sun, Dec 16, 2001 at 08:20:43AM +0900, Jacques Garrigue wrote:

From: luther@dpt-info.u-strasbg.fr

In ocaml 3.04 and previous, the -tkdefs option don't seem to work
properly for tk.h files not in the standard place.

for example, consider the tcl/tk stuff in /usr/include/tcl8.3.

./configure -tkdefs "-I /usr/include/tcl8.3" -tklibs "-L/usr/lib
-ltk8.3 -ltcl8.3"
...
Configuring LablTk...
tcl.h version 8.3 found.
tk.h not found.

Are you sure that tk.h is in /usr/include/tcl8.3 ?
I would expect it to be in /usr/include/tk8.3, which would explain why
you can find tcl.h but not tk.h.

No it is in the right place :

$ dpkg -L tk8.3-dev
/.
/usr
/usr/include
/usr/include/tcl8.3
/usr/include/tcl8.3/tk-private
/usr/include/tcl8.3/tk-private/generic
/usr/include/tcl8.3/tk-private/generic/default.h
/usr/include/tcl8.3/tk-private/generic/ks_names.h
/usr/include/tcl8.3/tk-private/generic/tk3d.h
/usr/include/tcl8.3/tk-private/generic/tkButton.h
/usr/include/tcl8.3/tk-private/generic/tkCanvas.h
/usr/include/tcl8.3/tk-private/generic/tkColor.h
...
/usr/include/tcl8.3/tk.h
...

The problem i have traced is that the hasgot.sh script don't has cc set, and
that it will only parse the first part of the $tk_defs if you don't put ""
around them.

As said, my solution may not be the best there is, i don't fully understand
how all this tcl/tk detection stuff is working in the configure script.

I had the following lines added in :

if test -z "$tcl_version"; then
tk_defs="-I/usr/include/tcl8.3 -I/usr/include/tk8.3"
tcl_version=sh ./runtest $tk_defs $tk_x11_include tclversion.c
fi

to detect tcl/tk in the right place (since then the tcl/tk maintainer moved
the tk stuff to the tcl8.3 directory also), but since it was last in the
search path, it worked fine on architectures were only 8.3 is installed.

But on some of the debian autobuilders there is 8.3 and 8.2 installed and
something even 8.0 or others, so to workaround this, i decided to use against
-tk_defs, and faced the above problem.

Friendly,

Sven Luther

@vicuna
Copy link
Author

vicuna commented Jan 4, 2002

Comment author: administrator

In ocaml 3.04 and previous, the -tkdefs option don't seem to work properly
for
tk.h files not in the standard place.

for example, consider the tcl/tk stuff in /usr/include/tcl8.3.

./configure -tkdefs "-I /usr/include/tcl8.3" -tklibs "-L/usr/lib -ltk8.3
-ltcl8.3"

Sorry for the delay. The above line contains an evident error: there should be
no space between -I and /usr/include/tcl8.3: this is the way the hasgot script
works.
Some C compilers accept the extra space, some others may not.

Maybe we should write somewhere about that, but you can have a look at
config/auto-aux/hasgot to see what is accepted.

Cheers,

Jacques Garrigue

@vicuna
Copy link
Author

vicuna commented Jan 4, 2002

Comment author: administrator

spurious space in parameter to configrue

@vicuna vicuna closed this as completed Jan 4, 2002
@vicuna
Copy link
Author

vicuna commented Jan 7, 2002

Comment author: administrator

On Fri, Jan 04, 2002 at 09:57:39AM +0100, Jacques Garrigue wrote:

In ocaml 3.04 and previous, the -tkdefs option don't seem to work properly
for
tk.h files not in the standard place.

for example, consider the tcl/tk stuff in /usr/include/tcl8.3.

./configure -tkdefs "-I /usr/include/tcl8.3" -tklibs "-L/usr/lib -ltk8.3
-ltcl8.3"

Sorry for the delay. The above line contains an evident error: there should be

I was not really back at work this year, so the delay don't really is a
problem (just need to remember why i wrote you this mail :)))

no space between -I and /usr/include/tcl8.3: this is the way the hasgot script
works.
Some C compilers accept the extra space, some others may not.

Ok, thanks, i will look into it.

Maybe we should write somewhere about that, but you can have a look at
config/auto-aux/hasgot to see what is accepted.

Yes, that would be nice, mmm, i think the tcl/tk detection stuff needs some
rework anyway, it is pretty messy, and doesn't cope well with multiple
installs of different versions of tcl/tk which may or not be in the expected
place.

BTW, do you know why i have to add -cclib -lgtkgl, when building a program
using gtkgl with the native code compiler ? Was this kind of stuff not
supposed to be taken care of in the .cmxa library ?

Friendly,

Sven Luther

@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant