Lines Matching +full:gcc +full:- +full:g

44     AC_ARG_WITH(gcc, [  --without-gcc           don't use gcc])  optwith
47 $1="-I\$(srcdir)"
52 if test -z "$CC" ; then
64 if test -z "$CC" -a "$with_gcc" = no ; then
71 dnl Determine which compiler we're using (cc or gcc)
72 dnl If using gcc, determine the version number
75 dnl use -O (AC_PROG_CC will use -g -O2 on gcc, so we don't need to
76 dnl do that ourselves for gcc)
77 dnl add -g flags, as appropriate
80 dnl NOTE WELL: with newer versions of autoconf, "gcc" means any compiler
81 dnl that defines __GNUC__, which means clang, for example, counts as "gcc".
100 if test "$GCC" = yes ; then
102 # -Werror forces warnings to be errors.
104 ac_lbl_cc_force_warning_errors=-Werror
111 AC_LBL_CHECK_COMPILER_OPT($1, -fvisibility=hidden)
113 $2="$$2 -I/usr/local/include"
114 LDFLAGS="$LDFLAGS -L/usr/local/lib"
120 # This is assumed either to be GCC or clang, both
121 # of which use -Werror to force warnings to be errors.
123 ac_lbl_cc_force_warning_errors=-Werror
130 AC_LBL_CHECK_COMPILER_OPT($1, -fvisibility=hidden)
136 # exit with a non-zero exit status if we hand it an
137 # invalid -W flag, can't be forced to do so even with
138 # +We, and doesn't handle GCC-style -W flags, so we
139 # don't want to try using GCC-style -W flags.
147 # necessarily exit with a non-zero exit status if we
148 # hand it an invalid -W flag, can't be forced to do
149 # so, and doesn't handle GCC-style -W flags, so we
150 # don't want to try using GCC-style -W flags.
160 # -xansi is normally the default, but the
161 # configure script was setting it; perhaps -cckr
168 # -g is equivalent to -g2, which turns off
169 # optimization; we choose -g3, which generates
174 $1="$$1 -xansi -signed -g3"
183 # using, doesn't exit with a non-zero exit status if we
184 # hand it an invalid -W flag, can't be forced to do
185 # so, and doesn't handle GCC-style -W flags, so we
186 # don't want to try using GCC-style -W flags.
190 # -g is equivalent to -g2, which turns off
191 # optimization; we choose -g3, which generates
196 $1="$$1 -g3"
201 # Assumed to be Sun C, which requires -errwarn to force
204 ac_lbl_cc_force_warning_errors=-errwarn
211 AC_LBL_CHECK_COMPILER_OPT($1, -xldscope=hidden)
230 $1="$$1 -O"
276 # XXX - yes, this depends on the way AC_LANG_WERROR works,
279 # testing compiler options - 15 years after somebody asked
282 # https://autoconf.gnu.narkive.com/gTAVmfKD/how-to-cancel-flags-set-by-ac-lang-werror
290 # as it will generate a warning with -Wold-style-definition, meaning
295 # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us
296 # https://www.postgresql.org/message-id/2192993.1591682589%40sss.pgh.pa.us
347 dnl Makefile-style dependency lines
349 dnl GCC uses -M for this. Non-GCC compilers that support this
350 dnl use a variety of flags, including but not limited to -M.
360 dnl output by default. IBM's XLC, however, supports -M but sends
361 dnl the output to {sourcefile-basename}.u, and AIX has no /dev/stdout
367 if test "$GCC" = yes ; then
369 # GCC, or a compiler deemed to be GCC by AC_PROG_CC (even
371 # would be -M.
373 ac_lbl_dependency_flag="-M"
376 # Not GCC or a compiler deemed to be GCC; what platform is
377 # this? (We're assuming that if the compiler isn't GCC
386 # MIPS C for IRIX, DEC C, and clang all use -M.
388 ac_lbl_dependency_flag="-M"
393 # Sun C uses -xM.
395 ac_lbl_dependency_flag="-xM"
425 # an unknown non-warning error, even if you pass it
426 # -Werror=unknown-warning-option. However, it always supports
427 # -M, so the fact that this test always succeeds with clang
430 if test ! -z "$ac_lbl_dependency_flag"; then
445 rm -rf conftest*
467 dnl V_SHLIB_CCOPT (modified to build position-independent code)
474 if test "$GCC" = yes ; then
478 # add options to generate position-independent code,
485 # add to the run-time search path, if that's necessary.
488 V_SHLIB_OPT="-shared"
496 # Platforms where the C compiler is GCC or accepts
497 # compatible command-line arguments, and the linker
498 # is the GNU linker or accepts compatible command-line
501 # Some instruction sets require -fPIC on some
506 PIC_OPT=-fpic
513 PIC_OPT=-fPIC
519 V_SONAME_OPT="-Wl,-soname,"
523 V_SHLIB_CCOPT="$V_SHLIB_CCOPT -fpic"
525 # XXX - this assumes GCC is using the HP linker,
527 # option is used on all HP-UX platforms, both .sl
530 V_SONAME_OPT="-Wl,+h,"
532 # By default, directories specified with -L
533 # are added to the run-time search path, so
534 # we don't add them in pcap-config.
539 V_SHLIB_CCOPT="$V_SHLIB_CCOPT -fpic"
541 # Sun/Oracle's C compiler, GCC, and GCC-compatible
542 # compilers support -Wl,{comma-separated list of options},
546 V_SONAME_OPT="-Wl,-h,"
554 # add options to generate position-independent code,
561 # add to the run-time search path, if that's necessary.
564 # some platforms the soname is passed with a GCC-like
565 # "-Wl,-soname,{soname}" option, with the soname part
574 V_SHLIB_OPT="-G -bnoentry -bexpall"
579 # Platforms where the C compiler is GCC or accepts
580 # compatible command-line arguments, and the linker
581 # is the GNU linker or accepts compatible command-line
584 # XXX - does 64-bit SPARC require -fPIC?
586 V_SHLIB_CCOPT="$V_SHLIB_CCOPT -fpic"
588 V_SHLIB_OPT="-shared"
589 V_SONAME_OPT="-Wl,-soname,"
595 V_SHLIB_OPT="-b"
598 # By default, directories specified with -L
599 # are added to the run-time search path, so
600 # we don't add them in pcap-config.
610 V_SHLIB_OPT="-shared"
611 V_SONAME_OPT="-soname "
615 V_SHLIB_CCOPT="$V_SHLIB_CCOPT -Kpic"
617 V_SHLIB_OPT="-G"
619 # Sun/Oracle's C compiler, GCC, and GCC-compatible
620 # compilers support -Wl,{comma-separated list of options},
624 V_SONAME_OPT="-Wl,-h,"
674 if test ! -z "$ac_cv_lbl_inline" ; then
722 dnl If using gcc, make sure we have ANSI ioctl definitions
729 [if test "$GCC" = yes ; then
787 dnl Checks to see if -R is used
798 [AC_MSG_CHECKING(for ${CC-cc} -R)
801 ${CC-cc} -o conftest conftest.c -R/a1/b2/c3 >conftest.out 2>&1
802 if test ! -s conftest.out ; then
807 rm -f -r conftest*])
814 dnl If an os prototype include exists, symlink os-proto.h to it
824 dnl os-proto.h (symlinked)
827 [rm -f os-proto.h
831 if test -f .devel ; then
836 AC_LBL_CHECK_COMPILER_OPT($1, -W)
837 AC_LBL_CHECK_COMPILER_OPT($1, -Wall)
838 AC_LBL_CHECK_COMPILER_OPT($1, -Wcomma)
841 # AC_LBL_CHECK_COMPILER_OPT($1, -Wcovered-switch-default)
842 AC_LBL_CHECK_COMPILER_OPT($1, -Wdocumentation)
843 AC_LBL_CHECK_COMPILER_OPT($1, -Wformat-nonliteral)
844 AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-noreturn)
845 AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-prototypes)
846 AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-variable-declarations)
847 AC_LBL_CHECK_COMPILER_OPT($1, -Wnull-pointer-subtraction)
848 AC_LBL_CHECK_COMPILER_OPT($1, -Wpointer-arith)
849 AC_LBL_CHECK_COMPILER_OPT($1, -Wpointer-sign)
850 AC_LBL_CHECK_COMPILER_OPT($1, -Wshadow)
851 AC_LBL_CHECK_COMPILER_OPT($1, -Wshorten-64-to-32)
852 AC_LBL_CHECK_COMPILER_OPT($1, -Wsign-compare)
853 AC_LBL_CHECK_COMPILER_OPT($1, -Wstrict-prototypes)
854 AC_LBL_CHECK_COMPILER_OPT($1, -Wundef)
860 # the byte-swapping involves a conditional
862 # swapped is a compile-time constant or not,
864 # on whether it is, does a compile-time swap or
865 # a run-time swap; perhaps the compiler always
879 AC_LBL_CHECK_COMPILER_OPT($1, -Wunreachable-code,
890 AC_LBL_CHECK_COMPILER_OPT($1, -Wunused-but-set-parameter)
891 AC_LBL_CHECK_COMPILER_OPT($1, -Wunused-but-set-variable)
892 AC_LBL_CHECK_COMPILER_OPT($1, -Wunused-parameter)
893 AC_LBL_CHECK_COMPILER_OPT($1, -Wused-but-marked-unused)
897 # We used to set -n32 for IRIX 6 when not using GCC (presumed
899 # the "new" faster 32-bit ABI, introduced in IRIX 6.2. I'm
904 os=`echo $host_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'`
905 name="lbl/os-$os.h"
906 if test -f $name ; then
907 ln -s $name os-proto.h
922 dnl AC_LBL_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [,
923 dnl ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
929 dnl XXX - "AC_LBL_LIBRARY_NET" was redone to use "AC_SEARCH_LIBS"
936 [AC_MSG_CHECKING([for $2 in -l$1])
942 ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'`
945 LIBS="-l$1 $5 $LIBS"
966 ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
967 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
970 LIBS="-l$1 $LIBS"
982 dnl Look for various networking-related libraries that we may need.
986 dnl thread-safe way of getting information for a host name or port;
1006 # we may need, in the default searched libraries (e.g., libc).
1026 LIBS="-lsocket -lnsl $LIBS"
1041 LIBS="-lnetwork $LIBS"
1049 ], -lnsl)
1075 LIBS="-lxnet $LIBS"
1076 ], , -lsocket -lnsl)
1080 # DLPI needs putmsg under HP-UX, so test for -lstr while we're at it.
1086 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1087 dnl serial 11 (pkg-config-0.29)
1090 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
1104 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1105 dnl 02111-1307, USA.
1113 dnl PKG_PREREQ(MIN-VERSION)
1114 dnl -----------------------
1117 dnl Verify that the version of the pkg-config macros are at least
1118 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
1119 dnl installed version of pkg-config, this checks the developer's version
1124 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
1130 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
1134 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
1135 dnl ----------------------------------
1138 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
1139 dnl first found in the path. Checks that the version of pkg-config found
1140 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.17.0 is
1141 dnl used since that's the first version where --static was supported.
1143 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1146 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1147 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1148 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1151 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1153 if test -n "$PKG_CONFIG"; then
1155 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1156 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1165 dnl PKG_CHECK_EXISTS(MODULE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1166 dnl -------------------------------------------------------------------
1173 if test -n "$PKG_CONFIG" && \
1174 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1181 dnl ---------------------------------------------
1182 dnl Internal wrapper calling pkg-config via PKG_CONFIG and, if
1183 dnl pkg-config fails, reporting the error and quitting.
1185 [if test ! -n "$$1"; then
1189 # That failed - report an error.
1190 # Re-run the command, telling pkg-config to print an error
1197 _pkg_error_string=`$PKG_CONFIG --short-errors --print-errors $2 "$3" 2>&1`
1199 _pkg_error_string=`$PKG_CONFIG --print-errors $2 "$3" 2>&1`
1208 dnl ---------------------------------------------
1209 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
1212 [if test -n "$$1"; then
1214 elif test -n "$PKG_CONFIG"; then
1225 dnl ---------------------------
1226 dnl Internal check to see if pkg-config supports short errors.
1229 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1237 dnl PKG_CHECK_MODULE(VARIABLE-PREFIX, MODULE, [ACTION-IF-FOUND],
1238 dnl [ACTION-IF-NOT-FOUND])
1239 dnl --------------------------------------------------------------
1243 AC_MSG_CHECKING([for $2 with pkg-config])
1244 if test -n "$PKG_CONFIG"; then
1245 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $2, overriding pkg-config])dnl
1246 AC_ARG_VAR([$1][_LIBS], [linker flags for $2, overriding pkg-config])dnl
1247 AC_ARG_VAR([$1][_LIBS_STATIC], [static-link linker flags for $2, overriding pkg-config])dnl
1249 if AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$2"]); then
1255 _PKG_CONFIG_WITH_FLAGS([$1][_CFLAGS], [--cflags], [$2])
1256 _PKG_CONFIG_WITH_FLAGS([$1][_LIBS], [--libs], [$2])
1257 _PKG_CONFIG_WITH_FLAGS([$1][_LIBS_STATIC], [--libs --static], [$2])
1264 # No pkg-config, so obviously not found with pkg-config.
1265 AC_MSG_RESULT([pkg-config not found])
1271 dnl PKG_CHECK_MODULE_STATIC(VARIABLE-PREFIX, MODULE, [ACTION-IF-FOUND],
1272 dnl [ACTION-IF-NOT-FOUND])
1273 dnl ---------------------------------------------------------------------
1277 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
1278 dnl and VARIABLE-PREFIX_LIBS from --libs.
1282 PKG_CONFIG="$PKG_CONFIG --static"
1289 dnl -------------------------
1293 dnl should install pkg-config .pc files. By default the directory is
1295 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
1300 [pkg-config installation directory @<:@]pkg_default[@:>@])
1302 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
1311 dnl --------------------------------
1315 dnl module should install arch-independent pkg-config .pc files. By
1318 dnl --with-noarch-pkgconfigdir parameter.
1322 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
1323 AC_ARG_WITH([noarch-pkgconfigdir],
1324 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
1332 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
1333 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1334 dnl -------------------------------------------
1337 dnl Retrieves the value of the pkg-config variable for the given module.
1340 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
1342 _PKG_CONFIG([$1], [--variable="][$3]["], [$2])