comparison host/acinclude.m4 @ 159:511f4dc167f6

Merge from eCos master repository on 2001-05-18-01:30:05-BST
author jlarmour
date Fri, 18 May 2001 06:32:28 +0000
parents 25e238959bae
children f58bc1b2c2bc
comparison
equal deleted inserted replaced
158:f2545e5de153 159:511f4dc167f6
9 dnl 9 dnl
10 dnl ==================================================================== 10 dnl ====================================================================
11 dnl####COPYRIGHTBEGIN#### 11 dnl####COPYRIGHTBEGIN####
12 dnl 12 dnl
13 dnl ---------------------------------------------------------------------------- 13 dnl ----------------------------------------------------------------------------
14 dnl Copyright (C) 1998, 1999, 2000 Red Hat, Inc. 14 dnl Copyright (C) 1998, 1999, 2000, 2001 Red Hat, Inc.
15 dnl 15 dnl
16 dnl This file is part of the eCos host tools. 16 dnl This file is part of the eCos host tools.
17 dnl 17 dnl
18 dnl This program is free software; you can redistribute it and/or modify it 18 dnl This program is free software; you can redistribute it and/or modify it
19 dnl under the terms of the GNU General Public License as published by the Free 19 dnl under the terms of the GNU General Public License as published by the Free
75 AC_MSG_RESULT(${MSVC}) 75 AC_MSG_RESULT(${MSVC})
76 ]) 76 ])
77 77
78 dnl ==================================================================== 78 dnl ====================================================================
79 dnl Set up sensible flags for the various different compilers. This 79 dnl Set up sensible flags for the various different compilers. This
80 dnl is achieved by redefining CC and CXX. 80 dnl is achieved by manipulating AM-CFLAGS and AM-CXXFLAGS via a subst,
81 dnl 81 dnl plus undoing the setting of CFLAGS and CXXFLAGS done by
82 dnl A better way of doing this sort of thing would be to detect 82 dnl the AC_PROC_CC and AC_PROG_CXX macros. Note that this relies
83 dnl arguments to add and remove to the set of compiler flags, and 83 dnl on knowing about the internals of those macros.
84 dnl then update CFLAGS and CXXFLAGS (or even better, the AM
85 dnl versions of those flags?)
86 dnl 84 dnl
87 dnl There is no point in checking the cache, this macro does 85 dnl There is no point in checking the cache, this macro does
88 dnl not do any feature tests. 86 dnl not do any feature tests.
89 dnl 87 dnl
90 dnl The VC++ variant might benefit from -Za, but the header files 88 dnl The VC++ variant might benefit from -Za, but the header files
118 yes) cygflags_enable_ansi="yes" ;; 116 yes) cygflags_enable_ansi="yes" ;;
119 *) cygflags_enable_ansi="no" ;; 117 *) cygflags_enable_ansi="no" ;;
120 esac]) 118 esac])
121 fi 119 fi
122 120
121 dnl Now we know what the user is after.
123 if test "${GCC}" = "yes" ; then 122 if test "${GCC}" = "yes" ; then
124 CC="$CC -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" 123 cyg_CFLAGS="-pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs"
125 CXX="$CXX -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual" 124 cyg_CXXFLAGS="-pipe -Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual"
126 elif test "${MSVC}" = "yes" ; then 125 elif test "${MSVC}" = "yes" ; then
127 CC="$CC -nologo -W3" 126 cyg_CFLAGS="-nologo -W3"
128 CXX="$CXX -nologo -W3 -GR -GX" 127 cyg_CXXFLAGS="-nologo -W3 -GR -GX"
129 if test "${cygflags_enable_debug}" = "yes" ; then 128 else
130 CC="$CC -MDd -Zi" 129 AC_MSG_ERROR("default flags for ${CC} are not known")
131 CXX="$CXX -MDd -Zi" 130 fi
132 else 131
133 CC="$CC -MD -O2" 132 dnl Choose between debugging and optimization.
134 CXX="$CXX -MD -O2" 133 if test "${cygflags_enable_debug}" = "yes" ; then
134 if test "${GCC}" = "yes" ; then
135 cyg_CFLAGS="${cyg_CFLAGS} -g -O0"
136 cyg_CXXFLAGS="${cyg_CXXFLAGS} -g -O0"
137 elif test "${MSVC}" = "yes" ; then
138 cyg_CFLAGS="${cyg_CFLAGS} -MDd -Zi"
139 cyg_CXXFLAGS="${cyg_CXXFLAGS} -MDd -Zi"
135 fi 140 fi
136 else 141 else
137 AC_MSG_ERROR("default flags for ${CC} are not known") 142 if test "${GCC}" = "yes" ; then
138 fi 143 cyg_CFLAGS="${cyg_CFLAGS} -O0"
144 cyg_CXXFLAGS="${cyg_CXXFLAGS} -O0"
145 elif test "${MSVC}" = "yes" ; then
146 cyg_CFLAGS="${cyg_CFLAGS} -MD -O2"
147 cyg_CXXFLAGS="${cyg_CXXFLAGS} -MD -O2"
148 fi
149 fi
150
151 CFLAGS="${ac_save_CFLAGS}"
152 CXXFLAGS="${ac_save_CXXFLAGS}"
153 AC_SUBST(cyg_CFLAGS)
154 AC_SUBST(cyg_CXXFLAGS)
139 AC_MSG_RESULT(done) 155 AC_MSG_RESULT(done)
140 ]) 156 ])
141 157
142 dnl -------------------------------------------------------------------- 158 dnl --------------------------------------------------------------------
143 dnl User-settable options for assertions and tracing. 159 dnl User-settable options for assertions and tracing.
343 AC_SUBST(cyg_ac_tcl_version) 359 AC_SUBST(cyg_ac_tcl_version)
344 360
345 dnl Where is the Tcl installation? By default assume Tcl is already 361 dnl Where is the Tcl installation? By default assume Tcl is already
346 dnl installed in the same place as the eCos host-side. 362 dnl installed in the same place as the eCos host-side.
347 363
348 AC_ARG_WITH(tcl,[ --with-tcl-header=<path> location of Tcl header]) 364 AC_ARG_WITH(tcl,[ --with-tcl-header=<path> location of Tcl header])
349 AC_ARG_WITH(tcl,[ --with-tcl-lib=<path> location of Tcl libraries]) 365 AC_ARG_WITH(tcl,[ --with-tcl-lib=<path> location of Tcl libraries])
350 AC_ARG_WITH(tcl,[ --with-tcl=<path> location of Tcl header and libraries]) 366 AC_ARG_WITH(tcl,[ --with-tcl=<path> location of Tcl header and libraries])
351 367
352 AC_MSG_CHECKING(for Tcl installation) 368 AC_MSG_CHECKING(for Tcl installation)
353 369
354 tcl_incdirs="${with_tcl_header} ${with_tcl}/include ${prefix}/include /usr/include/tcl$cyg_ac_tcl_version /usr/include" 370 dnl If using VC++ then there are no sensible default directories
355 AC_FIND_FILE(tcl.h, $tcl_incdirs, cyg_ac_tcl_incdir) 371 dnl to search for a Tcl installation. Instead the user must
356 372 dnl supply either --with-tcl, or both --with-tcl-header and
357 dnl Sanity check, make sure that there is a tcl.h header file. 373 dnl --with-tcl-lib.
358 dnl If not then there is no point in proceeding. 374 dnl
359 if test \! -r ${cyg_ac_tcl_incdir}/tcl.h ; then 375 dnl Also when using VC++ there is no tclConfig.sh file to
360 AC_MSG_ERROR(unable to locate Tcl header file tcl.h) 376 dnl consult about which libraries are needed. Instead that
361 fi 377 dnl information is hard-wired here.
362 378
363 tcl_libdirs="${with_tcl_lib} ${with_tcl}/lib ${prefix}/lib /usr/lib/tcl$cyg_ac_tcl_version /usr/lib"
364 AC_FIND_FILE(tclConfig.sh, $tcl_libdirs, cyg_ac_tcl_libdir)
365
366 AC_MSG_RESULT(${cyg_ac_tcl_libdir})
367
368 dnl If using VC++ then there is no tclConfig.sh file, so the
369 dnl library information has to be hard-wired. Otherwise ther
370 dnl should be a tclConfig.sh file containing the necessary information.
371 if test "${MSVC}" = "yes" ; then 379 if test "${MSVC}" = "yes" ; then
380 if test "${with_tcl_header+set}" = set; then
381 cyg_ac_tcl_incdir=${with_tcl_header}
382 else
383 if test "${with_tcl+set}" = set; then
384 cyg_ac_tcl_incdir="${with_tcl}/include"
385 else
386 AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-header=<path>)
387 fi
388 fi
389 if test "${with_tcl_lib+set}" = set; then
390 cyg_ac_tcl_libdir=${with_tcl_lib}
391 else
392 if test "${with_tcl+set}" = set; then
393 cyg_ac_tcl_libdir="${with_tcl}/lib"
394 else
395 AC_MSG_ERROR(You must specify a Tcl installation with either --with-tcl=<path> or --with-tcl-lib=<path>)
396 fi
397 fi
372 cyg_ac_tcl_libs="tcl${cyg_ac_tcl_version}.lib" 398 cyg_ac_tcl_libs="tcl${cyg_ac_tcl_version}.lib"
373 CYG_AC_MSVC_PATH(cyg_ac_tcl_incdir)
374 CYG_AC_MSVC_PATH(cyg_ac_tcl_libdir)
375 else 399 else
400 tcl_incdirs="${with_tcl_header} ${with_tcl}/include ${prefix}/include /usr/include/tcl$cyg_ac_tcl_version /usr/include"
401 AC_FIND_FILE(tcl.h, $tcl_incdirs, cyg_ac_tcl_incdir)
402 tcl_libdirs="${with_tcl_lib} ${with_tcl}/lib ${libdir} ${prefix}/lib /usr/lib/tcl$cyg_ac_tcl_version /usr/lib"
403 AC_FIND_FILE(tclConfig.sh, $tcl_libdirs, cyg_ac_tcl_libdir)
376 if test \! -r ${cyg_ac_tcl_libdir}/tclConfig.sh ; then 404 if test \! -r ${cyg_ac_tcl_libdir}/tclConfig.sh ; then
377 AC_MSG_ERROR(unable to locate Tcl config file tclConfig.sh) 405 AC_MSG_ERROR(unable to locate Tcl config file tclConfig.sh)
378 else 406 else
379 . ${cyg_ac_tcl_libdir}/tclConfig.sh 407 . ${cyg_ac_tcl_libdir}/tclConfig.sh
380 cyg_ac_tcl_libs="-ltcl${cyg_ac_tcl_version} ${TCL_LIBS}" 408 cyg_ac_tcl_libs="-ltcl${cyg_ac_tcl_version} ${TCL_LIBS}"
381 fi 409 fi
382 fi 410 fi
383 411
412 dnl Sanity check, make sure that there is a tcl.h header file.
413 dnl If not then there is no point in proceeding.
414 if test \! -r ${cyg_ac_tcl_incdir}/tcl.h ; then
415 AC_MSG_ERROR(unable to locate Tcl header file tcl.h)
416 fi
417
418 if test "${MSVC}" = "yes" ; then
419 CYG_AC_MSVC_PATH(cyg_ac_tcl_incdir)
420 CYG_AC_MSVC_PATH(cyg_ac_tcl_libdir)
421 fi
422
423 AC_MSG_RESULT(${cyg_ac_tcl_libdir})
424
384 AC_SUBST(cyg_ac_tcl_incdir) 425 AC_SUBST(cyg_ac_tcl_incdir)
385 AC_SUBST(cyg_ac_tcl_libdir) 426 AC_SUBST(cyg_ac_tcl_libdir)
386 AC_SUBST(cyg_ac_tcl_libs) 427 AC_SUBST(cyg_ac_tcl_libs)
387 AC_SUBST(cyg_ac_tk_libs) 428 AC_SUBST(cyg_ac_tk_libs)
388 ]) 429 ])