mirror of
				https://github.com/troglobit/editline.git
				synced 2025-10-31 08:18:11 +08:00 
			
		
		
		
	Improve GCC warning and error triggers and also improve check of GCC version.
Configure snippets shamelessly stolen from http://www.libusb.org/browser/configure.ac
This commit is contained in:
		
							
								
								
									
										104
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										104
									
								
								configure
									
									
									
									
										vendored
									
									
								
							| @@ -746,6 +746,7 @@ ac_includes_default="\ | ||||
| ac_subst_vars='am__EXEEXT_FALSE | ||||
| am__EXEEXT_TRUE | ||||
| LTLIBOBJS | ||||
| AM_CFLAGS | ||||
| CONFIG_DEFAULT_COMPLETE_FALSE | ||||
| CONFIG_DEFAULT_COMPLETE_TRUE | ||||
| LIBOBJS | ||||
| @@ -4554,13 +4555,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : | ||||
| else | ||||
|   lt_cv_nm_interface="BSD nm" | ||||
|   echo "int some_variable = 0;" > conftest.$ac_ext | ||||
|   (eval echo "\"\$as_me:4557: $ac_compile\"" >&5) | ||||
|   (eval echo "\"\$as_me:4558: $ac_compile\"" >&5) | ||||
|   (eval "$ac_compile" 2>conftest.err) | ||||
|   cat conftest.err >&5 | ||||
|   (eval echo "\"\$as_me:4560: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | ||||
|   (eval echo "\"\$as_me:4561: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | ||||
|   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) | ||||
|   cat conftest.err >&5 | ||||
|   (eval echo "\"\$as_me:4563: output\"" >&5) | ||||
|   (eval echo "\"\$as_me:4564: output\"" >&5) | ||||
|   cat conftest.out >&5 | ||||
|   if $GREP 'External.*some_variable' conftest.out > /dev/null; then | ||||
|     lt_cv_nm_interface="MS dumpbin" | ||||
| @@ -5766,7 +5767,7 @@ ia64-*-hpux*) | ||||
|   ;; | ||||
| *-*-irix6*) | ||||
|   # Find out which ABI we are using. | ||||
|   echo '#line 5769 "configure"' > conftest.$ac_ext | ||||
|   echo '#line 5770 "configure"' > conftest.$ac_ext | ||||
|   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 | ||||
|   (eval $ac_compile) 2>&5 | ||||
|   ac_status=$? | ||||
| @@ -7296,11 +7297,11 @@ else | ||||
|    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||||
|    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||||
|    -e 's:$: $lt_compiler_flag:'` | ||||
|    (eval echo "\"\$as_me:7299: $lt_compile\"" >&5) | ||||
|    (eval echo "\"\$as_me:7300: $lt_compile\"" >&5) | ||||
|    (eval "$lt_compile" 2>conftest.err) | ||||
|    ac_status=$? | ||||
|    cat conftest.err >&5 | ||||
|    echo "$as_me:7303: \$? = $ac_status" >&5 | ||||
|    echo "$as_me:7304: \$? = $ac_status" >&5 | ||||
|    if (exit $ac_status) && test -s "$ac_outfile"; then | ||||
|      # The compiler can only warn and ignore the option if not recognized | ||||
|      # So say no if there are warnings other than the usual output. | ||||
| @@ -7635,11 +7636,11 @@ else | ||||
|    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||||
|    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||||
|    -e 's:$: $lt_compiler_flag:'` | ||||
|    (eval echo "\"\$as_me:7638: $lt_compile\"" >&5) | ||||
|    (eval echo "\"\$as_me:7639: $lt_compile\"" >&5) | ||||
|    (eval "$lt_compile" 2>conftest.err) | ||||
|    ac_status=$? | ||||
|    cat conftest.err >&5 | ||||
|    echo "$as_me:7642: \$? = $ac_status" >&5 | ||||
|    echo "$as_me:7643: \$? = $ac_status" >&5 | ||||
|    if (exit $ac_status) && test -s "$ac_outfile"; then | ||||
|      # The compiler can only warn and ignore the option if not recognized | ||||
|      # So say no if there are warnings other than the usual output. | ||||
| @@ -7740,11 +7741,11 @@ else | ||||
|    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||||
|    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||||
|    -e 's:$: $lt_compiler_flag:'` | ||||
|    (eval echo "\"\$as_me:7743: $lt_compile\"" >&5) | ||||
|    (eval echo "\"\$as_me:7744: $lt_compile\"" >&5) | ||||
|    (eval "$lt_compile" 2>out/conftest.err) | ||||
|    ac_status=$? | ||||
|    cat out/conftest.err >&5 | ||||
|    echo "$as_me:7747: \$? = $ac_status" >&5 | ||||
|    echo "$as_me:7748: \$? = $ac_status" >&5 | ||||
|    if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||||
|    then | ||||
|      # The compiler can only warn and ignore the option if not recognized | ||||
| @@ -7795,11 +7796,11 @@ else | ||||
|    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | ||||
|    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | ||||
|    -e 's:$: $lt_compiler_flag:'` | ||||
|    (eval echo "\"\$as_me:7798: $lt_compile\"" >&5) | ||||
|    (eval echo "\"\$as_me:7799: $lt_compile\"" >&5) | ||||
|    (eval "$lt_compile" 2>out/conftest.err) | ||||
|    ac_status=$? | ||||
|    cat out/conftest.err >&5 | ||||
|    echo "$as_me:7802: \$? = $ac_status" >&5 | ||||
|    echo "$as_me:7803: \$? = $ac_status" >&5 | ||||
|    if (exit $ac_status) && test -s out/conftest2.$ac_objext | ||||
|    then | ||||
|      # The compiler can only warn and ignore the option if not recognized | ||||
| @@ -10179,7 +10180,7 @@ else | ||||
|   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||||
|   lt_status=$lt_dlunknown | ||||
|   cat > conftest.$ac_ext <<_LT_EOF | ||||
| #line 10182 "configure" | ||||
| #line 10183 "configure" | ||||
| #include "confdefs.h" | ||||
|  | ||||
| #if HAVE_DLFCN_H | ||||
| @@ -10275,7 +10276,7 @@ else | ||||
|   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||||
|   lt_status=$lt_dlunknown | ||||
|   cat > conftest.$ac_ext <<_LT_EOF | ||||
| #line 10278 "configure" | ||||
| #line 10279 "configure" | ||||
| #include "confdefs.h" | ||||
|  | ||||
| #if HAVE_DLFCN_H | ||||
| @@ -11104,6 +11105,81 @@ $as_echo "#define CONFIG_ANNOYING_NOISE /**/" >>confdefs.h | ||||
| fi | ||||
|  | ||||
|  | ||||
| # Restore gnu89 inline semantics on gcc 4.3 and newer | ||||
| saved_cflags="$CFLAGS" | ||||
| CFLAGS="$CFLAGS -fgnu89-inline" | ||||
| cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||||
| /* end confdefs.h.  */ | ||||
|  | ||||
| int | ||||
| main () | ||||
| { | ||||
|  | ||||
|   ; | ||||
|   return 0; | ||||
| } | ||||
| _ACEOF | ||||
| if ac_fn_c_try_compile "$LINENO"; then : | ||||
|   inline_cflags="-fgnu89-inline" | ||||
| else | ||||
|   inline_cflags="" | ||||
| fi | ||||
| rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | ||||
| CFLAGS="$saved_cflags" | ||||
|  | ||||
| # check for -fvisibility=hidden compiler support (GCC >= 3.4) | ||||
| saved_cflags="$CFLAGS" | ||||
| CFLAGS="$CFLAGS -fvisibility=hidden" | ||||
| cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||||
| /* end confdefs.h.  */ | ||||
|  | ||||
| int | ||||
| main () | ||||
| { | ||||
|  | ||||
|   ; | ||||
|   return 0; | ||||
| } | ||||
| _ACEOF | ||||
| if ac_fn_c_try_compile "$LINENO"; then : | ||||
|   VISIBILITY_CFLAGS="-fvisibility=hidden" | ||||
|  | ||||
| $as_echo "#define API_EXPORTED __attribute__((visibility(\"default\")))" >>confdefs.h | ||||
|  | ||||
| else | ||||
|    VISIBILITY_CFLAGS="" | ||||
|  | ||||
| $as_echo "#define API_EXPORTED /**/" >>confdefs.h | ||||
|  | ||||
| fi | ||||
| rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | ||||
| CFLAGS="$saved_cflags" | ||||
|  | ||||
| # check for -Wno-pointer-sign compiler support (GCC >= 4) | ||||
| saved_cflags="$CFLAGS" | ||||
| CFLAGS="$CFLAGS -Wno-pointer-sign" | ||||
| cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||||
| /* end confdefs.h.  */ | ||||
|  | ||||
| int | ||||
| main () | ||||
| { | ||||
|  | ||||
|   ; | ||||
|   return 0; | ||||
| } | ||||
| _ACEOF | ||||
| if ac_fn_c_try_compile "$LINENO"; then : | ||||
|   nopointersign_cflags="-Wno-pointer-sign" | ||||
| else | ||||
|   nopointersign_cflags="" | ||||
| fi | ||||
| rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | ||||
| CFLAGS="$saved_cflags" | ||||
|  | ||||
| AM_CFLAGS="-std=gnu99 $inline_cflags -W -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow" | ||||
|  | ||||
|  | ||||
| ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile man/Makefile examples/Makefile" | ||||
|  | ||||
| cat >confcache <<\_ACEOF | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Joachim Nilsson
					Joachim Nilsson