/[gcl]/gcl/configure.in
ViewVC logotype

Diff of /gcl/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by mjthomas, Fri Aug 9 03:59:25 2002 UTC revision 1.68 by camm, Fri Aug 9 05:49:32 2002 UTC
# Line 34  AC_ARG_ENABLE(tclconfig,[ --enable-tclco Line 34  AC_ARG_ENABLE(tclconfig,[ --enable-tclco
34  AC_ARG_ENABLE(infodir,[ --enable-infodir=XXXX will force the use of a INFO_DIR=XXXXX as place to look for info ] ,  AC_ARG_ENABLE(infodir,[ --enable-infodir=XXXX will force the use of a INFO_DIR=XXXXX as place to look for info ] ,
35  [INFO_DIR=$enableval],[INFO_DIR="unknown"])  [INFO_DIR=$enableval],[INFO_DIR="unknown"])
36    
 AC_ARG_ENABLE(dlopen,  
         [ --enable-dlopen uses dlopen for loading objects, which can then not be retained  in saved images ] ,,enable_dlopen="no")  
 AC_ARG_ENABLE(bfd,  
         [ --disable-bfd prevents gcl from using libbfd.a for fast object loading and symbol table lookups ] ,,enable_bfd="yes")  
   
37  #  #
38  # Host information  # Host information
39  #  #
# Line 201  if test "x$enable_machine" != "x" ; then Line 196  if test "x$enable_machine" != "x" ; then
196    use=$enable_machine    use=$enable_machine
197  fi  fi
198    
199  EXTRA_CFLAGS=""  def_dlopen="no"
200    def_statsysbfd="yes"
201  case $use in  case $use in
202       *linux)       *linux)
203          ln -snf linux.defs h/$use.defs;          ln -snf linux.defs h/$use.defs;
204          case $use in          case $use in
205                  alpha*)                  alpha*)
206                          EXTRA_CFLAGS=-mieee;                          def_dlopen="yes" ; def_statsysbfd="no" ;;
                         enable_dlopen="yes" ;;  
207                  mips*)                  mips*)
208                          enable_dlopen="yes" ;;                          def_dlopen="yes" ; def_statsysbfd="no" ;;
209                  ia64*)                  ia64*)
210                          enable_dlopen="yes" ;;                          def_dlopen="yes" ; def_statsysbfd="no" ;;
211                  hppa*)                  hppa*)
212                          EXTRA_CFLAGS=-fPIC;                          def_dlopen="yes" ; def_statsysbfd="no" ;;
                         enable_dlopen="yes" ;;  
213          esac;;          esac;;
214  esac  esac
215    
216    AC_ARG_ENABLE(dlopen,
217            [ --enable-dlopen uses dlopen for loading objects, which can then not be retained  in saved images ]
218            ,,enable_dlopen="$def_dlopen")
219    AC_ARG_ENABLE(statsysbfd,
220            [ --enable-statsysbfd uses a static sytem bfd library for loading and relocationing object files ]
221            ,,enable_statsysbfd="$def_statsysbfd")
222    AC_ARG_ENABLE(dynsysbfd,
223            [ --enable-dynsysbfd uses a dynamic shared sytem bfd library for loading and relocationing object files ]
224            ,,enable_dynsysbfd="no")
225    AC_ARG_ENABLE(locbfd,
226            [ --enable-locbfd uses a static bfd library built from this source tree for loading and relocationing object files ]
227            ,,enable_locbfd="no")
228    AC_ARG_ENABLE(debug,
229            [ --enable-debug builds gcl with -g in CFLAGS to enable running under gdb ]
230            ,,enable_debug="no")
231    
232    load_opt="0"
233    if test "$enable_dlopen" = "yes" ; then
234            load_opt=$(($load_opt+1))
235    fi
236    if test "$enable_statsysbfd" = "yes" ; then
237            load_opt=$(($load_opt+1))
238    fi
239    if test "$enable_dynsysbfd" = "yes" ; then
240            load_opt=$(($load_opt+1))
241    fi
242    if test "$enable_locbfd" = "yes" ; then
243            load_opt=$(($load_opt+1))
244    fi
245    
246    if test "$load_opt" != "1" ; then
247            echo "Exactly one loader option must be chosen: dlopen=$enable_dlopen statsysbfd=$enable_statsysbfd dynsysbfd=$enable_dynsysbfd locbfd=$enable_locbfd"
248            exit 1
249    fi
250    
251  ## finally warn if we did not find a recognized machine.s  ## finally warn if we did not find a recognized machine.s
252  ##  ##
253  #if test "$use" = "unknown" ; then  #if test "$use" = "unknown" ; then
# Line 235  AC_MSG_RESULT(use=$use) Line 264  AC_MSG_RESULT(use=$use)
264  # System programs  # System programs
265  #  #
266    
   
267  AC_PROG_CC  AC_PROG_CC
268  AC_PROG_CPP  AC_PROG_CPP
269    AC_SUBST(CC)
270    
271    
272  # can only test for numbers -- CM  # can only test for numbers -- CM
273  # if test "${GCC}" -eq "yes" ; then  # if test "${GCC}" -eq "yes" ; then
274  if [[ "${GCC}" = "yes" ]] ; then  #if [[ "${GCC}" = "yes" ]] ; then
275  # Allog for environment variable overrides on compiler selection -- CM  # Allog for environment variable overrides on compiler selection -- CM
276  GCC=$CC  #GCC=$CC
277    #else
278    #GCC=""
279    #fi
280    # subst GCC not only under 386-linux, but where available -- CM
281    
282    
283    TCFLAGS="-Wall -DVOL=volatile -I\$(GCLDIR)/o -fsigned-char"
284    if test "$GCC" = "yes" ; then
285            TCFLAGS="$TCFLAGS -fwritable-strings -pipe"
286    fi
287    
288    if test "$enable_debug" = "yes" ; then
289            TCFLAGS="$TCFLAGS -g"
290            # for subconfigurations
291            CFLAGS=-g
292  else  else
293  GCC=""          TCFLAGS="$TCFLAGS -O6 -fomit-frame-pointer"
294  fi  fi
295  # subst GCC not only under 386-linux, but where available -- CM  
296  AC_SUBST(GCC)  case $use in
297         *linux)
298            case $use in
299                    alpha*)
300                            TCFLAGS="$TCFLAGS -mieee";;
301                    hppa*)
302                            TCFLAGS="$TCFLAGS -fPIC";;
303            esac;;
304    esac
305    
306    
307    
308  # Step 1: set the variable "system" to hold the name and version number  # Step 1: set the variable "system" to hold the name and version number
# Line 284  else Line 339  else
339  fi  fi
340    
341    
342    #
343    # GMP
344    #
345    
346    rm -f makedefsafter
347    
348    MP_INLCUDE=""
349    if test $use_gmp = yes ; then
350     AC_MSG_CHECKING([use_gmp=yes, doing configure in gmp directory])
351     echo
352     echo "#"
353     echo "#"
354     echo "# -------------------"
355     echo "# Subconfigure of GMP"
356     echo "#"
357     echo "#"
358     case "$use" in
359    #  Seem to be some problems with gmp3 on 68060 machines.  CM
360    #   m68k-linux)
361    #      (cd gmp3 && ./configure --build=none-unknown-linux-gnu) ;;
362       *)
363          (cd gmp3 && ./configure) ;;
364     esac
365     echo "#"
366     echo "#"
367     echo "#"
368     echo "# Subconfigure of GMP done"
369     echo "# ------------------------"
370     echo "#"
371     cp gmp3/gmp.h h/gmp.h
372     AC_MSG_CHECKING("for size of gmp limbs")
373     AC_TRY_RUN([#include <stdio.h>
374            #include "h/gmp.h"
375            int main() {
376            FILE *fp=fopen("conftest1","w");
377            fprintf(fp,"%u",sizeof(mp_limb_t));
378            fclose(fp);
379            return 0;
380    }],mpsize=`cat conftest1`,mpsize=0,mpsize=0)
381     if test "$mpsize" = "0" ; then
382            echo "Cannot determine mpsize"
383            exit 1
384     fi
385     AC_DEFINE_UNQUOTED(MP_LIMB_BYTES,$mpsize)
386     AC_MSG_RESULT($mpsize)
387     GMP=1
388     AC_DEFINE(GMP)
389     AC_SUBST(GMP)
390     MP_INCLUDE=h/gmp.h
391     echo > makedefsafter
392     echo 'MPFILES=${GMP_DIR}libgmp.a' >> makedefsafter
393     echo >> makedefsafter
394    fi
395    AC_SUBST(MP_INCLUDE)
396    
397    
398    
399  #  #
400  # Dynamic loading  # Dynamic loading
# Line 297  if test "$enable_dlopen" = "yes" ; then Line 408  if test "$enable_dlopen" = "yes" ; then
408                  exit 1                  exit 1
409          fi          fi
410    
411          LIBS="$LIBS -ldl -rdynamic"          TLIBS="$TLIBS -ldl -rdynamic"
412          AC_DEFINE(USE_DLOPEN)          AC_DEFINE(USE_DLOPEN)
413    fi
414    
415  else      if test "$enable_statsysbfd" = "yes" || test "$enable_dynsysbfd" = "yes" ; then
416            AC_CHECK_HEADER(bfd.h,
417          if test "$enable_bfd" = "yes" ; then                  AC_CHECK_LIB(bfd,bfd_init,
418                  AC_CHECK_HEADER(bfd.h,                  #
419                                  AC_CHECK_LIB(bfd,bfd_init,                  # Old binutils appear to need CONST defined to const
420                                          if $CC -v 2>&1 | fgrep ming > /dev/null ; then                  #
421                                                 BFDLIB="-lbfd"                          AC_MSG_CHECKING(if need to define CONST for bfd)
422                                                 IBRLIB="-liberty"                          AC_TRY_RUN([#define IN_GCC
423                                          else                                      #include <bfd.h>
424                                                  echo 'int main() {bfd_init();bfd_openr("/dev/null",0);return 0;}' >foo.c                                      int main() { symbol_info t; return 0;}],
425                                                  MP=`$GCC [[ -Wl,-M ]] -static -o foo foo.c -lbfd -liberty 2>&1 | tr '()' '\012\012' | $AWK '{print $NF}' | sort | uniq`                                  AC_MSG_RESULT(no),
                                                 rm -f foo.c foo  
                                                 BFDLIB=`echo $MP | tr ' ' '\012' | grep libbfd.a`  
                                                 IBRLIB=`echo $MP | tr ' ' '\012' | grep libiberty.a`  
                                         fi  
         #  
         # Old binutils appear to need CONST defined to const  
         #  
                                 AC_MSG_CHECKING(if need to define CONST for bfd)  
426                                  AC_TRY_RUN([#define IN_GCC                                  AC_TRY_RUN([#define IN_GCC
427                                              #include <bfd.h>                                              #include <bfd.h>
428                                              int main() { symbol_info t; return 0;}],                                              #define CONST const
429                                          AC_MSG_RESULT(no)                                              int main() {symbol_info t; return 0;}],
430                                          AC_DEFINE(HAVE_LIBBFD)                                          AC_MSG_RESULT(yes)
431                                          LIBS="$LIBS  $BFDLIB $IBRLIB",                                          AC_DEFINE(NEED_CONST),
432                                          AC_TRY_RUN([#define IN_GCC                                          AC_MSG_RESULT(cannot use bfd) exit 1;,
433                                                      #include <bfd.h>                                          AC_MSG_RESULT(cannot use bfd) exit 1;),
434                                                      #define CONST const                                  AC_MSG_RESULT(cannot use bfd) exit 1;)
435                                                      int main() {symbol_info t; return 0;}],                          ,,-liberty))
436                                                  AC_MSG_RESULT(yes)  
437                                                  AC_DEFINE(NEED_CONST)          AC_DEFINE(HAVE_LIBBFD)
438                                                  AC_DEFINE(HAVE_LIBBFD)  
439                                                  LIBS="$LIBS  $BFDLIB $IBRLIB",  #
440                                                  AC_MSG_RESULT(cannot use bfd),AC_MSG_RESULT(cannot use bfd)),  # FIXME: Need to workaround mingw before this point -- CM
441                                          AC_MSG_RESULT(cannot use bfd))  #
442                                                            if test "$enable_statsysbfd" = "yes" && ! $CC -v 2>&1 | fgrep ming > /dev/null ; then
443                                  ,,-liberty))                  echo 'int main() {bfd_init();bfd_openr("/dev/null",0);return 0;}' >foo.c
444                    MP=`$CC [ -Wl,-M ] -static -o foo foo.c -lbfd -liberty 2>&1 | tr '()' '\012\012' | $AWK '{print $NF}' | sort | uniq`
445                    rm -f foo.c foo
446                    TLIBS="$TLIBS `echo $MP | tr ' ' '\012' | grep libbfd.a`"
447                    TLIBS="$TLIBS `echo $MP | tr ' ' '\012' | grep libiberty.a`"
448            else
449                    TLIBS="$TLIBS -lbfd -liberty"
450          fi          fi
451    fi
452    
453    if test "$enable_locbfd" = "yes" ; then
454            echo "#"
455            echo "#"
456            echo "# -------------------"
457            echo "# Subconfigure of BFD"
458            echo "#"
459            echo "#"
460            cd binutils/bfd && ./configure && cd ../..
461            echo "#"
462            echo "#"
463            echo "#"
464            echo "# Subconfigure of BFD done"
465            echo "# ------------------------"
466            echo "#"
467            echo "#"
468            echo "#"
469            echo "# -------------------------"
470            echo "# Subconfigure of LIBIBERTY"
471            echo "#"
472            echo "#"
473            cd binutils/libiberty && ./configure && cd ../..
474            echo "#"
475            echo "#"
476            echo "#"
477            echo "# Subconfigure of LIBIBERTY done"
478            echo "# ------------------------------"
479            echo "#"
480            TLIBS="$TLIBS `pwd`/binutils/bfd/libbfd.a `pwd`/binutils/libiberty/libiberty.a"
481            AC_DEFINE(HAVE_LIBBFD)
482            BUILD_BFD="h/bfd.h h/bfdlink.h"
483            AC_SUBST(BUILD_BFD)
484  fi  fi
485    
486  # Find where Data begins.  This is used by the storage allocation  # Find where Data begins.  This is used by the storage allocation
# Line 554  AC_MSG_CHECKING([for sockets]) Line 696  AC_MSG_CHECKING([for sockets])
696  tcl_checkBoth=0  tcl_checkBoth=0
697  AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)  AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
698  if test "$tcl_checkSocket" = 1; then  if test "$tcl_checkSocket" = 1; then
699      AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", tcl_checkBoth=1)      AC_CHECK_LIB(socket, main, TLIBS="$TLIBS -lsocket", tcl_checkBoth=1)
700  fi  fi
701    
702    
703  if test "$tcl_checkBoth" = 1; then  if test "$tcl_checkBoth" = 1; then
704      tk_oldLibs=$LIBS      tk_oldLibs=$TLIBS
705      LIBS="$LIBS -lsocket -lnsl"      TLIBS="$TLIBS -lsocket -lnsl"
706      AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])      AC_CHECK_FUNC(accept, tcl_checkNsl=0, [TLIBS=$tk_oldLibs])
707  fi  fi
708  AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))  AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [TLIBS="$TLIBS -lnsl"]))
709    
710  if test "$enable_readline" = "yes" ; then  if test "$enable_readline" = "yes" ; then
711          AC_CHECK_LIB(readline,main,          AC_CHECK_LIB(readline,main,
712                  AC_DEFINE(HAVE_READLINE)                  AC_DEFINE(HAVE_READLINE)
713                  LIBS="$LIBS -lreadline -lncurses"                  TLIBS="$TLIBS -lreadline -lncurses"
714                  RL_OBJS=readline.o                  RL_OBJS=readline.o
715                  RL_LIB=lsp/readline.o,,-lncurses)                  RL_LIB=lsp/readline.o,,-lncurses)
716  fi  fi
717    
 AC_SUBST(LIBS)  
718  AC_SUBST(RL_OBJS)  AC_SUBST(RL_OBJS)
719  AC_SUBST(RL_LIB)  AC_SUBST(RL_LIB)
720    
# Line 674  int joe=SV_ONSTACK; Line 815  int joe=SV_ONSTACK;
815   AC_SUBST(HAVE_SV_ONSTACK)   AC_SUBST(HAVE_SV_ONSTACK)
816   AC_MSG_RESULT(yes)],   AC_MSG_RESULT(yes)],
817  AC_MSG_RESULT(no))  AC_MSG_RESULT(no))
 AC_SUBST(EXTRA_CFLAGS)  
818    
819  AC_MSG_CHECKING(check for SIGSYS)  AC_MSG_CHECKING(check for SIGSYS)
820  AC_TRY_COMPILE([#include <signal.h>  AC_TRY_COMPILE([#include <signal.h>
# Line 1026  if test $gcl_ok = no ; then     AC_MSG_R Line 1166  if test $gcl_ok = no ; then     AC_MSG_R
1166    
1167  # fionread or block  # fionread or block
1168    
 rm -f makedefsafter  
   
 MP_INLCUDE=""  
 if test $use_gmp = yes ; then  
  AC_MSG_CHECKING([use_gmp=yes, doing configure in gmp directory])  
  case "$use" in  
 #   i[[5-9]]86* | pentium* | k6* | athlon*)  
 #      (cd gmp3 ; ./configure --target=i486) ;;  
 #  Seem to be some problems with gmp3 on 68060 machines.  CM  
    m68k-linux)  
       (cd gmp3 && ./configure --build=none-unknown-linux-gnu) ;;  
    *)  
       (cd gmp3 && ./configure) ;;  
  esac  
 # [[ "`ls -1 gmp3/mpn/add_n.* 2>/dev/null`" != "" ]] || cp gmp3/mpn/generic/*.c gmp3/mpn/  
  cp gmp3/gmp.h h/gmp.h  
  AC_MSG_CHECKING("for size of gmp limbs")  
  AC_TRY_RUN([#include <stdio.h>  
         #include "h/gmp.h"  
           
         int main() {  
         FILE *fp=fopen("conftest1","w");  
         fprintf(fp,"%u",sizeof(mp_limb_t));  
         fclose(fp);  
         return 0;  
 }],mpsize=`cat conftest1`,mpsize=0,mpsize=0)  
  if test "$mpsize" = "0" ; then  
         echo "Cannot determine mpsize"  
         exit 1  
  fi  
  AC_DEFINE_UNQUOTED(MP_LIMB_BYTES,$mpsize)  
  AC_MSG_RESULT($mpsize)  
  GMP=1  
  AC_DEFINE(GMP)  
  AC_SUBST(GMP)  
  MP_INCLUDE=h/gmp.h  
  echo > makedefsafter  
  echo 'MPFILES=${GMP_DIR}libgmp.a' >> makedefsafter  
  echo >> makedefsafter  
 fi  
 AC_SUBST(MP_INCLUDE)  
   
1169  # redhat/cygnus released for some reason a buggy version of gcc,  # redhat/cygnus released for some reason a buggy version of gcc,
1170  # which no one else released.   Catch that here.  # which no one else released.   Catch that here.
1171  AC_MSG_CHECKING([Checking for buggy gcc version from redhat])  AC_MSG_CHECKING([Checking for buggy gcc version from redhat])
# Line 1083  if  2>&1 $CC -v | fgrep "gcc version 2.9 Line 1181  if  2>&1 $CC -v | fgrep "gcc version 2.9
1181          AC_MSG_RESULT([no])          AC_MSG_RESULT([no])
1182  fi  fi
1183    
1184    LIBS="$LIBS $TLIBS"
1185    AC_SUBST(LIBS)
1186    CFLAGS="$TCFLAGS"
1187    AC_SUBST(CFLAGS)
1188    
1189  if test -f h/$use.defs  ; then  if test -f h/$use.defs  ; then
1190    
# Line 1098  else Line 1200  else
1200    echo "Unable to guess machine type"    echo "Unable to guess machine type"
1201    echo use configure --enable-machine=XXX,  for XXX such that h/XXX.defs exists, ie in h/*.defs    echo use configure --enable-machine=XXX,  for XXX such that h/XXX.defs exists, ie in h/*.defs
1202  fi  fi
1203    

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26