Port configure scripts to C99. Some of the incompatible shell
code stems from using an outdated autoconf version and has
already been fixed upstream. However, the aclocal.m4 change
and the fix to readline detection have to be applied manually.
Submitted upstream: <https://sourceforge.net/p/bochs/patches/566/>
diff --git a/aclocal.m4 b/aclocal.m4
index b899ec9ad4280acf..b7b4b04199fabc1d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -855,10 +855,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -872,7 +868,7 @@ int main ()
/* dlclose (self); */
}
- exit (status);
+ return status;
}]
EOF
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
diff --git a/configure b/configure
index 5cc4088d208d7c1e..8442fc5b17dce9ff 100755
--- a/configure
+++ b/configure
@@ -9030,10 +9030,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -9047,7 +9043,7 @@ int main ()
/* dlclose (self); */
}
- exit (status);
+ return status;
}
EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -9128,10 +9124,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -9145,7 +9137,7 @@ int main ()
/* dlclose (self); */
}
- exit (status);
+ return status;
}
EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -12335,10 +12327,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -12352,7 +12340,7 @@ int main ()
/* dlclose (self); */
}
- exit (status);
+ return status;
}
EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -12433,10 +12421,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -12450,7 +12434,7 @@ int main ()
/* dlclose (self); */
}
- exit (status);
+ return status;
}
EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -17378,10 +17362,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -17395,7 +17375,7 @@ int main ()
/* dlclose (self); */
}
- exit (status);
+ return status;
}
EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -17476,10 +17456,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -17493,7 +17469,7 @@ int main ()
/* dlclose (self); */
}
- exit (status);
+ return status;
}
EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -19163,10 +19139,6 @@ else
# endif
#endif
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
void fnord() { int i=42;}
int main ()
{
@@ -19180,7 +19152,7 @@ int main ()
/* dlclose (self); */
}
- exit (status);
+ return status;
}
EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -22589,7 +22561,7 @@ else
#include <stdio.h>
#include <readline/readline.h>
- int main() { rl_initialize(); exit(0); }
+ int main() { rl_initialize(); return 0; }
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
@@ -22619,7 +22591,7 @@ else
#include <stdio.h>
#include <readline/readline.h>
- int main() { rl_initialize(); exit(0); }
+ int main() { rl_initialize(); return 0; }
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
diff --git a/configure.in b/configure.in
index 41948739e41d6514..d94d994fb3c5db28 100644
--- a/configure.in
+++ b/configure.in
@@ -1001,7 +1001,7 @@ if test "$want_readline" = yes; then
AC_TRY_RUN([
#include <stdio.h>
#include <readline/readline.h>
- int main() { rl_initialize(); exit(0); }
+ int main() { rl_initialize(); return 0; }
],
[ AC_MSG_RESULT(yes)
rl_without_curses_ok=yes ],
@@ -1012,7 +1012,7 @@ if test "$want_readline" = yes; then
AC_TRY_RUN([
#include <stdio.h>
#include <readline/readline.h>
- int main() { rl_initialize(); exit(0); }
+ int main() { rl_initialize(); return 0; }
],
[AC_MSG_RESULT(yes)
rl_with_curses_ok=yes ],