Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* stopping ./configure from choking on use of ccc/cxx
@ 2001-01-03  2:29 Peter Petrakis
  2001-01-03 10:18 ` Alan Young
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Petrakis @ 2001-01-03  2:29 UTC (permalink / raw)
  To: axp-list

I know it's a long subject. Plenty enough keywords for a search engine
to pick up.

Alan Young had posted to the list previously  a procedure that would
allow configure
to proceed when you used ccc. I've found a little easier way of doing
the same thing.

Say you want to build something using ccc. First alias gcc to ccc

alias gcc=ccc

Now configure depends on libtool (which defaults are usually NOT
changed). What happens
is autoconf doesnt recognize ccc and  returns "can't build shared
libraries". The quick 
and easy workaround? 

In the top level of the package you're trying to build do. 

./ltconfig --with-gcc ltmain.sh

You could use your own libtool instead (recommended) which is probably
more up to date than whats provide with some packages. 

/usr/share/libtool/ltconfig   --with-gcc /usr/share/libtool/ltmain.sh

now when you run ./configure it will load what libtool has configured
and 
accept it. Once you do this ccc and cxx work. 

I hope someone finds this usefull and if anyone needs further
clarification
just email. 

Peter
-- 
www.alphalinux.org
Peter Petrakis         Warrior/Engineer        ppetrakis@alphalinux.org
"Oh my God! They killed Xena! You bastards!!"
"<BLAM!!> Who the hell are you!? Name's Ash <click clock> Housewares..."




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

* Re: stopping ./configure from choking on use of ccc/cxx
  2001-01-03  2:29 stopping ./configure from choking on use of ccc/cxx Peter Petrakis
@ 2001-01-03 10:18 ` Alan Young
  2001-01-03 12:22   ` Peter Petrakis
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Young @ 2001-01-03 10:18 UTC (permalink / raw)
  To: axp-list

Interesting...I had not time to look into the libtool issue.  What you
have found is interesting.  I'm a bit confused about the steps you have
described.  Are you saying to do  1) alias gcc=ccc, 2) run ./configure,
then 3) run ./ltconfig or are you saying do 3) before 2).  If I do 3
before 2, then configure wipes out the libtool that ltconfig built.
It's doing it when I try this procedure on SDL.  Also if I do 3 after
2, then the libtool file does not match what came out of configure.
(I'm not sure if the mismatch is really a problem or not.)

Something strange is going on in configure.  There's something in
configure that says if I'm not gcc, then don't create a shared lib.
It gets worse if you specify CFLAGS in the environment, then it
doesn't work at all (gcc pukes on my -arch switch).  It seems to
be calling /usr/bin/gcc directly.

Alan

Peter Petrakis wrote:
> 
> I know it's a long subject. Plenty enough keywords for a search engine
> to pick up.
> 
> Alan Young had posted to the list previously  a procedure that would
> allow configure to proceed when you used ccc. I've found a little
> easier way of doing the same thing.
> 
> Say you want to build something using ccc. First alias gcc to ccc
> 
> alias gcc=ccc
> 
> Now configure depends on libtool (which defaults are usually NOT
> changed). What happens is autoconf doesnt recognize ccc and  
> returns "can't build shared libraries". The quick and easy workaround?
> 
> In the top level of the package you're trying to build do.
> 
> ./ltconfig --with-gcc ltmain.sh
> 
> You could use your own libtool instead (recommended) which is probably
> more up to date than whats provide with some packages.
> 
> /usr/share/libtool/ltconfig   --with-gcc /usr/share/libtool/ltmain.sh
> 
> now when you run ./configure it will load what libtool has configured
> and accept it. Once you do this ccc and cxx work.
> 
> I hope someone finds this usefull and if anyone needs further
> clarification just email.
> 
> Peter
> --
> www.alphalinux.org
> Peter Petrakis         Warrior/Engineer        ppetrakis@alphalinux.org
> "Oh my God! They killed Xena! You bastards!!"
> "<BLAM!!> Who the hell are you!? Name's Ash <click clock> Housewares..."




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

* Re: stopping ./configure from choking on use of ccc/cxx
  2001-01-03 10:18 ` Alan Young
@ 2001-01-03 12:22   ` Peter Petrakis
  2001-01-03 19:04     ` Alan Young
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Petrakis @ 2001-01-03 12:22 UTC (permalink / raw)
  To: axp-list

> Interesting...I had not time to look into the libtool issue.  What you
> have found is interesting.  I'm a bit confused about the steps you have
> described.  Are you saying to do  1) alias gcc=ccc, 2) run ./configure,
> then 3) run ./ltconfig or are you saying do 3) before 2).  If I do 3
> before 2, then configure wipes out the libtool that ltconfig built.


The procedure is 1) 3) 2) :-).

> It's doing it when I try this procedure on SDL.  Also if I do 3 after
> 2, then the libtool file does not match what came out of configure.
> (I'm not sure if the mismatch is really a problem or not.)


It shouldnt do that. configure should load the libtool previously
created unless
it's creating it's own libtool as "part" of the script. 
It works here with MySQL and php consistantly.
 
> Something strange is going on in configure.  There's something in
> configure that says if I'm not gcc, then don't create a shared lib.
> It gets worse if you specify CFLAGS in the environment, then it
> doesn't work at all (gcc pukes on my -arch switch).  It seems to
> be calling /usr/bin/gcc directly.

You see. The whole idea of libtool is to use "it" to call your compiler
so your makefile remains independant of such things and thus more
flexiable.

The configure file that comes with SDL is doing something wrong. Is this
just the SDL tarball or the current SDL rpm from RH? I want to try and
reproduce 
what you're seeing. 

Peter
-- 
www.alphalinux.org
Peter Petrakis         Warrior/Engineer        ppetrakis@alphalinux.org
"Oh my God! They killed Xena! You bastards!!"
"<BLAM!!> Who the hell are you!? Name's Ash <click clock> Housewares..."




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

* Re: stopping ./configure from choking on use of ccc/cxx
  2001-01-03 12:22   ` Peter Petrakis
@ 2001-01-03 19:04     ` Alan Young
  2001-01-04  7:50       ` stopping ./configure from choking on use of ccc/cxx (LONG) Alan Young
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Young @ 2001-01-03 19:04 UTC (permalink / raw)
  To: axp-list

Peter Petrakis wrote:
> 
> > Interesting...I had not time to look into the libtool issue.  What you
> > have found is interesting.  I'm a bit confused about the steps you have
> > described.  Are you saying to do  1) alias gcc=ccc, 2) run ./configure,
> > then 3) run ./ltconfig or are you saying do 3) before 2).  If I do 3
> > before 2, then configure wipes out the libtool that ltconfig built.
> 
> The procedure is 1) 3) 2) :-).

ok.
 
> > It's doing it when I try this procedure on SDL.  Also if I do 3 after
> > 2, then the libtool file does not match what came out of configure.
> > (I'm not sure if the mismatch is really a problem or not.)
> 
> It shouldnt do that. configure should load the libtool previously
> created unless it's creating it's own libtool as "part" of the script.
> It works here with MySQL and php consistantly.

I think most of the packages I build recreate libtool.  It's getting
tiresome editing libtool after configure has run... :\
 
> > Something strange is going on in configure.  There's something in
> > configure that says if I'm not gcc, then don't create a shared lib.
> > It gets worse if you specify CFLAGS in the environment, then it
> > doesn't work at all (gcc pukes on my -arch switch).  It seems to
> > be calling /usr/bin/gcc directly.
> 
> You see. The whole idea of libtool is to use "it" to call your compiler
> so your makefile remains independant of such things and thus more
> flexiable.

Personally, I've never been real thrilled with libtool.
 
> The configure file that comes with SDL is doing something wrong. Is this
> just the SDL tarball or the current SDL rpm from RH? I want to try and
> reproduce what you're seeing.

It's the SDL tarball from the SDL web site.

Alan




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

* Re: stopping ./configure from choking on use of ccc/cxx (LONG)
  2001-01-03 19:04     ` Alan Young
@ 2001-01-04  7:50       ` Alan Young
  2001-01-04 13:43         ` Adam C Powell IV
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Young @ 2001-01-04  7:50 UTC (permalink / raw)
  To: axp-list, Peter Petrakis

Alan Young wrote:
> 
> > Something strange is going on in configure.  There's something in
> > > configure that says if I'm not gcc, then don't create a shared lib.
> > > It gets worse if you specify CFLAGS in the environment, then it
> > > doesn't work at all (gcc pukes on my -arch switch).  It seems to
> > > be calling /usr/bin/gcc directly.
> >
> > You see. The whole idea of libtool is to use "it" to call your compiler
> > so your makefile remains independant of such things and thus more
> > flexiable.
> 
> Personally, I've never been real thrilled with libtool.

I think I've pinned down what is causing shared libraries to be turned off.
I found a message in the configure log - "checking if libtool supports
shared libraries..."  which is getting "no" printed after it.  It did some
spelunking into configure and found that this test is actually coming out
of ltconfig and not configure.  By adding a --debug switch to the command
line that is built in configure to call ltconfig, I was able to generate
a trace and I think I see what might is going wrong.  In ltconfig there
is a flag called "can_build_shared".  This is set by a number of 
different conditions.  It seems we are hitting the default in a test that
is trying to figure out what switch the compiler needs to produce position
independent code (PIC).  Specifically, it's this test:

echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
pic_flag=
special_shlib_compile_flags=
wl=
link_static_flag=
no_builtin_flag=

if test "$with_gcc" = yes; then
  wl='-Wl,'
  link_static_flag='-static'

  case "$host_os" in
  beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
    # PIC is the default for these OSes.
    ;;
  aix*)
    # Below there is a dirty hack to force normal static linking with -ldl
    # The problem is because libdl dynamically linked with both libc and
    # libC (AIX C++ library), which obviously doesn't included in libraries
    # list by gcc. This cause undefined symbols with -static flags.
    # This hack allows C programs to be linked with "-static -ldl", but
    # we not sure about C++ programs.
    link_static_flag="$link_static_flag ${wl}-lC"
    ;;
  cygwin* | mingw* | os2*)
    # We can build DLLs from non-PIC.
    ;;
  amigaos*)
    # FIXME: we need at least 68020 code to build shared libraries, but
    # adding the `-m68020' flag to GCC prevents building anything better,
    # like `-m68040'.
    pic_flag='-m68020 -resident32 -malways-restore-a4'
    ;;
  sysv4*MP*)
    if test -d /usr/nec; then
       pic_flag=-Kconform_pic
    fi
    ;;
  *)
    pic_flag='-fPIC'
    ;;
  esac
else
  # PORTME Check for PIC flags for the system compiler.
  case "$host_os" in
  aix3* | aix4*)
    # All AIX code is PIC.
    link_static_flag='-bnso -bI:/lib/syscalls.exp'
    ;;

  hpux9* | hpux10* | hpux11*)
    # Is there a better link_static_flag that works with the bundled CC?
    wl='-Wl,'
    link_static_flag="${wl}-a ${wl}archive"
    pic_flag='+Z'
    ;;

  irix5* | irix6*)
    wl='-Wl,'
    link_static_flag='-non_shared'
    # PIC (with -KPIC) is the default.
    ;;

  cygwin* | mingw* | os2*)
    # We can build DLLs from non-PIC.
    ;;

  osf3* | osf4* | osf5*)
    # All OSF/1 code is PIC.
    wl='-Wl,'
    link_static_flag='-non_shared'
    ;;

  sco3.2v5*)
    pic_flag='-Kpic'
    link_static_flag='-dn'
    special_shlib_compile_flags='-belf'
    ;;

  solaris*)
    pic_flag='-KPIC'
    link_static_flag='-Bstatic'
    wl='-Wl,'
    ;;

  sunos4*)
    pic_flag='-PIC'
    link_static_flag='-Bstatic'
    wl='-Qoption ld '
    ;;

  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
    pic_flag='-KPIC'
    link_static_flag='-Bstatic'
    wl='-Wl,'
    ;;

  uts4*)
    pic_flag='-pic'
    link_static_flag='-Bstatic'
    ;;
  sysv4*MP*)
    if test -d /usr/nec ;then
      pic_flag='-Kconform_pic'
      link_static_flag='-Bstatic'
    fi
    ;;
  *)
    can_build_shared=no
    # I added this next echo - Alan 
    echo "ACK... we hit a default case.  can_build_shared=no!"
    ;;
  esac
fi


As you can see since CCC is not GCC, we fall into the else half of the
if.  And since there's no Alpha Linux test in the else statement's case,
we hit the default which sets can_build_shared to NO.  Peter's trick
works because it fools the script into thinking we are compiling with 
GCC when we really are not and the program logic goes to the true part
of the if.

I'd like to propose that we add a case to ltconfig that will check for
Compaq C (ccc).  Unfortunately, this will mean everyone will need to
update their libtools and people will have to update packages with the
new libtool until the maintainers catch up, but I think this will solve
the problem.  In the above case, I suggest this additional code be
added before the default case so the code looks like:

  linux-gnu)
    # Should really test the cpu type here too, but for now we'll assume
    # that ccc is only on the Alpha platform.  If a non Alpha compiler  
    # called ccc comes along, well, then, this will need to be fixed.    
    case "$compiler" in
        ccc)
          # according to the ccc manpage -shared is the default
          # do we need -call_shared too?
          pic_flag='-shared'
          can_build_shared=yes
          ;;

        gcc)
         echo "Huh? how did we get here? - shared test" 1>&6
         can_build_shared=yes
         ;;

        *)
         can_build_shared=no
         echo "Could not identify your Linux compiler - shared libraries will
not be built" 1>&6
         ;;
    esac   
    ;;     

  *)
    can_build_shared=no
    echo "Could not identify your compiler - shared libraries will not be
built" 1>&6
    ;;
  esac
fi

I tested this with a modified ltconfig from libtool 1.3.5 and SDL 1.1.6.  I
called
configure with "CC=ccc CFLAGS='-fast -arch ev56' ./configure".  In my configure
log
I have the shared messages as "yes" and make build a shared library without my
intervention.  So it seems to work for me.  Please beat on it and see what it
does for you.  If this looks good, then I think we can approach the libtool
maintainer and see if we can get this included in the next version.

Alan




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

* Re: stopping ./configure from choking on use of ccc/cxx (LONG)
  2001-01-04  7:50       ` stopping ./configure from choking on use of ccc/cxx (LONG) Alan Young
@ 2001-01-04 13:43         ` Adam C Powell IV
  2001-01-05  3:32           ` Alan Young
  0 siblings, 1 reply; 7+ messages in thread
From: Adam C Powell IV @ 2001-01-04 13:43 UTC (permalink / raw)
  To: axp-list

Alan Young wrote:

> I think I've pinned down what is causing shared libraries to be turned off.
> [snip]
> I'd like to propose that we add a case to ltconfig that will check for
> Compaq C (ccc).  Unfortunately, this will mean everyone will need to
> update their libtools and people will have to update packages with the
> new libtool until the maintainers catch up, but I think this will solve
> the problem.  In the above case, I suggest this additional code be
> added before the default case so the code looks like:
>
>   linux-gnu)
>     # Should really test the cpu type here too, but for now we'll assume
>     # that ccc is only on the Alpha platform.  If a non Alpha compiler
>     # called ccc comes along, well, then, this will need to be fixed.
>     case "$compiler" in
>         ccc)
>           # according to the ccc manpage -shared is the default
>           # do we need -call_shared too?
>           pic_flag='-shared'
>           can_build_shared=yes

Looks good to me.  Can you produce a patch against libtool so we can easily
build/test it with this feature?

Thank you very much for doing this!

-Adam P.

               Welcome to the best software in the world today cafe!




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

* Re: stopping ./configure from choking on use of ccc/cxx (LONG)
  2001-01-04 13:43         ` Adam C Powell IV
@ 2001-01-05  3:32           ` Alan Young
  0 siblings, 0 replies; 7+ messages in thread
From: Alan Young @ 2001-01-05  3:32 UTC (permalink / raw)
  To: axp-list

[-- Attachment #1: Type: text/plain, Size: 361 bytes --]

Adam C Powell IV wrote:
> 
> Looks good to me.  Can you produce a patch against libtool so we can easily
> build/test it with this feature?

Try the attached patch against libtool-1.3.5 and let me know how it works...

> Thank you very much for doing this!

You are welcome!  Thanks also to Peter Petrakis for "motivating" me into
fixing an annoyance! :-)

Alan

[-- Attachment #2: libtool-1.3.5-Compaq-ccc.patch --]
[-- Type: application/octet-stream, Size: 1109 bytes --]

--- ./ltconfig.orig	Wed Jan  3 01:33:19 2001
+++ ./ltconfig	Thu Jan  4 19:15:12 2001
@@ -758,8 +758,31 @@
       link_static_flag='-Bstatic'
     fi
     ;;
+  linux-gnu)
+    # Should really test the cpu type here too, but for now we'll assume
+    # that Compaq C (ccc) is only on the Alpha platform.  If a non Alpha
+    # Linux compiler called ccc comes along, well, then this will need to
+    # be updated.
+    case "$compiler" in
+        ccc)
+          # According to the ccc manpage -shared is the default
+          # Do we need -call_shared too?
+          pic_flag='-shared'  
+          can_build_shared=yes
+          ;;
+        gcc)
+          echo "Strange error in shared test - --with-gcc=no, but gcc has been selected" 1>&6
+          can_build_shared=yes
+          ;;
+        *)
+          can_build_shared=no
+          echo "Could not identify your Linux compiler - shared libraries will not be built" 1>&6
+          ;;
+    esac   
+    ;;  
   *)
     can_build_shared=no
+    echo "Could not identify your compiler - shared libraries will not be built" 1>&6
     ;;
   esac
 fi

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

end of thread, other threads:[~2001-01-05  3:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-03  2:29 stopping ./configure from choking on use of ccc/cxx Peter Petrakis
2001-01-03 10:18 ` Alan Young
2001-01-03 12:22   ` Peter Petrakis
2001-01-03 19:04     ` Alan Young
2001-01-04  7:50       ` stopping ./configure from choking on use of ccc/cxx (LONG) Alan Young
2001-01-04 13:43         ` Adam C Powell IV
2001-01-05  3:32           ` Alan Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox