ref: d356142c8d2e4518614ea28acce1f9a5d7b8044c
parent: 95ad5c77a146a99179e4f553662a4203d070adfa
author: Philip McGrath <philip@philipmcgrath.com>
date: Sat Apr 23 13:20:35 CDT 2022
zuo: configure.ac: fix `--disable-embed` It should set `EMBED_LIBS=""`, not `EMBED_LIBS="no"`. Also, ensure that `config.status` can regenerate `main.zuo`.
--- a/configure
+++ b/configure
@@ -585,6 +585,7 @@
PACKAGE_URL='https://github.com/racket/zuo'
ac_unique_file="zuo.c"
+enable_embed="zuo"
ac_subst_vars='LTLIBOBJS
LIBOBJS
EMBED_LIBS
@@ -1744,6 +1745,7 @@
# Check whether --enable-embed was given.
if test "${enable_embed+set}" = set; then :
enableval=$enable_embed;
+ :
fi
# Check whether --enable-big was given.
@@ -1752,12 +1754,13 @@
fi
-if test "${enable_embed}" != "" ; then
+EMBED_LIBS="zuo"
+if test "x$enable_embed" = xno; then :
+ EMBED_LIBS=""
+elif test "x$enable_big" = xyes; then :
+ EMBED_LIBS="zuo zuo/hygenic"
+elif test "x$enable_embed" != xyes; then :
EMBED_LIBS="${enable_embed}"
-elif test "${enable_big}" != "" ; then
- EMBED_LIBS="zuo zuo/hygienic"
-else
- EMBED_LIBS="zuo"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
@@ -2582,8 +2585,10 @@
+{ $as_echo "$as_me:${as_lineno-$LINENO}: zuo libraries to embed: \"${EMBED_LIBS}\"" >&5
+$as_echo "$as_me: zuo libraries to embed: \"${EMBED_LIBS}\"" >&6;}
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile main.zuo"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -3292,6 +3297,7 @@
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "main.zuo") CONFIG_FILES="$CONFIG_FILES main.zuo" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -3741,7 +3747,3 @@
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
-echo "#lang zuo" > main.zuo
-echo "(require "'"'"${srcdir}/build.zuo"'"'")" >> main.zuo
-echo "(build/command-line* targets-at at-source)" >> main.zuo
--- a/configure.ac
+++ b/configure.ac
@@ -1,3 +1,4 @@
+# Process this file with autoconf to produce a configure script.
AC_INIT([Zuo],
[1],
[https://github.com/racket/racket/issues],
@@ -5,25 +6,27 @@
[https://github.com/racket/zuo])
AC_CONFIG_SRCDIR(zuo.c)
-AC_ARG_ENABLE(embed, [ --enable-embed=<libs> embed <libs>; defaults to "zuo"])
-AC_ARG_ENABLE(big, [ --enable-big embed "zuo/hygienic" as well as "zuo"])
+AC_ARG_ENABLE(embed,
+ [AS_HELP_STRING([--enable-embed=<libs>],
+ [embed <libs>; defaults to "zuo"])],
+ []
+ [: m4_divert_text([DEFAULTS], [enable_embed="zuo"])])
+AC_ARG_ENABLE(big,[AS_HELP_STRING([--enable-big],
+ [embed "zuo/hygienic" as well as "zuo"])])
-if test "${enable_embed}" != "" ; then
- EMBED_LIBS="${enable_embed}"
-elif test "${enable_big}" != "" ; then
- EMBED_LIBS="zuo zuo/hygienic"
-else
- EMBED_LIBS="zuo"
-fi
+EMBED_LIBS="zuo"
+AS_IF([test "x$enable_embed" = xno],
+ [EMBED_LIBS=""],
+ [test "x$enable_big" = xyes],
+ [EMBED_LIBS="zuo zuo/hygenic"],
+ [test "x$enable_embed" != xyes],
+ [EMBED_LIBS="${enable_embed}"])
AC_PROG_MAKE_SET()
AC_PROG_CC
AC_SUBST(EMBED_LIBS)
+AC_MSG_NOTICE([zuo libraries to embed: "${EMBED_LIBS}"])
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile main.zuo])
AC_OUTPUT()
-
-echo "#lang zuo" > main.zuo
-echo "(require "'"'"${srcdir}/build.zuo"'"'")" >> main.zuo
-echo "(build/command-line* targets-at at-source)" >> main.zuo
--- /dev/null
+++ b/main.zuo.in
@@ -1,0 +1,5 @@
+#lang zuo
+;; @configure_input@
+;; `configure` modifies the following line:
+(require "@srcdir@/build.zuo")
+(build/command-line* targets-at at-source)