diff --git a/README.md b/README.md
index 5ca2ca5..341a28b 100644
--- a/README.md
+++ b/README.md
@@ -303,3 +303,60 @@ autoconf提供编译宏@DEFS@
 4、项目include路径

+
+AC_SUBST，AC_DEFINE，AC_DEFINE_UNQUOTED这三个宏提供了configure进程和build进程和执行进程之间的通信机制。
+
+AC_SUBST(shell_var[, value])
+替换变量和shell_var同名，但是前后加了@: @shell_var@，这个变量可以在任何模板文件中使用；有一点需要注意，这个宏不能和shell的条件表达式一起使用，原因是AC_SUBST宏的本义：已经将替代变量硬编码到模板文件中。
+
+AC_DEFINE 和 AC_DEFINE_UNQUOTED宏定义C预编译宏，这些或者被定义在config.h.in模板中(如果使用了AC_CONFIG_HEADERS)，或者是在Makefile.in模板中通过命令行传递给编译器的(@DEFS@)。
+
+AC_PORG_CC检查编译器宏
+AC_PORG_CC宏定义下面这些autoconf的替代变量:
+1、@CC@
+2、@CFLAGS@
+3、@CPPFLAGS@
+4、@EXEEXT@
+5、@OBJECT@
+注意：如果不在Makefile.in模板中使用这几个变量，执行./configure是毫无意义的。
+
+
+
+@INSTALL@: 本地install script的位置；
+@INSTALL_DATA@ == @INSTALL@ -m 0644
+@INSTALL_PROGRAM@ 和 @INSTALL_SCRIPT@ 的值 == @INSTALL@
+
+如果需要lex, yacc, sed, awk等，可以在configure.ac中添加AC_PROG_LEX, AC_PROG_YACC, AC_PROG_SED, AC_PROG_AWK。
+
+总结：
+1、可以使用AC_PROG_*宏检查程序的存在；
+2、如果找到程序，一个替代变量就会被创建；
+3、一定要在Makefile.in模板中使用这些替代变量
+
+
+AC_CHECK_PROG(varivable, prog-to-check-for, value-if-found,
+    [value-if-not-found], [path], [reject])
+
+检查prog-to-check-for是否在path中，如果是，将varivable设置为value-if-found，
+否则将varivable设置为value-if-not-found。通常跳过reject(绝对路径文件名)，即使它是搜索路径中的最先被发现的，
+如果这样的话，使用除了reject的找到的绝对路径文件名设置variable，如过variable已经被设置了，就什么也不做，
+为variable调用AC_SUBST。
+
+重新整理下流程：
+1、如果prog-to-check-for在系统search path中被找到，就将variable设置成value-if-found；否则设置成value-if-not-found；
+2、如果reject被指定了(全路径)，而且和上一步找到的路径一样，跳过它，继续在system搜索路径下查找下一个匹配程序；
+3、如果reject在path中第一个被找到，而且还找到了另一个B(和reject不相等的)，设置variable为B；
+4、如果用户已经在环境变量中设置variable，这个variable就不会被改变；
+5、AC_SUBST宏会调用，使variable成为configure替换变量
+
+value-if-found可以是命令待参数，比如[bash -x]
+
+
+AC_SEARCH_LIBS(function, search-libs, [action-if-found], [action-if-not-found], [other-libraries])
+调用这个宏，链接器将会将库加入@LIBS@
+
+添加库时，最好放在源文件的后面，因为链接器在链接时是由顺序的。
+
+
+
+将$(DEFS)放在$(CPPFLAGS)之前，可以给最终的用户选择去重载任何我命令行上的决策。
diff --git a/configure.ac b/configure.ac
index 43afb31..b8073e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,13 +8,31 @@ AC_CONFIG_HEADERS([config.h])

 # Checks for programs.
 AC_PROG_CC
+_DEBUG_START_
+AC_CHECK_PROG([bash_var], [bash], [yes], [no], , [/usr/sbin/bash])
+_DEBUG_END_
 AC_PROG_INSTALL

 # Checks for libraries.
+have_pthreads=no
+AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthreads=yes])

 # Checks for header files.
 AC_CHECK_HEADERS([stdlib.h])

+if test "x${have_pthreads}" = xyes; then
+   AC_CHECK_HEADERS([pthread.h], [], [have_pthreads=no])
+fi
+
+# 也可以报错： AC_MSG_ERROR
+if test "x${have_pthreads}" = xno; then
+   AC_MSG_WARN([
+   -------------------------------------------------------
+   Unable to find pthreads on this system.
+   Building a single-threaded version.
+   -------------------------------------------------------])
+fi
+
 # Checks for typedefs, structures, and compiler characteristics.

 # Checks for library functions.
diff --git a/src/Makefile.in b/src/Makefile.in
index 4054235..7df42ae 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -15,12 +15,20 @@ bindir = @bindir@
 srcdir = @srcdir@
 VPATH = @srcdir@

-CFLAGS ?= -g -O0
+CC = @CC@
+DEFS = @DEFS@
+LIBS = @LIBS@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@

 all: jupiter

 jupiter: main.c
-	$(CC) -I. -I$(srcdir) -I.. $(CPPFLAGS) $(CFLAGS) -o $@ $(srcdir)/main.c
+	$(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) -I. -I$(srcdir) -I.. -o $@ $(srcdir)/main.c $(LIBS)

 check: all
 	./jupiter | grep "Hello from ./jupiter!"
@@ -29,8 +37,8 @@ check: all
 # to supported staged installation, $(DESTDIR) 这个变量不用定义，提供给RPM或APT等包管理器进行处理

 install:
-	install -d $(DESTDIR)$(bindir)
-	install -m 0755 jupiter $(DESTDIR)$(bindir)
+	$(INSTALL) -d $(DESTDIR)$(bindir)
+	$(INSTALL_PROGRAM) -m 0755 jupiter $(DESTDIR)$(bindir)

 # 包管理器并不会按照DESTDIR去删除，它有自己的规则，在这里是为了完成distcheck目标
 uninstall:
diff --git a/src/main.c b/src/main.c
index 7dae3bb..64ba579 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,8 +1,26 @@
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
+#if HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+
+static void* print_it(void* data) {
+    fprintf(stdout, "Hello from %s\n", (const char *)data);
+    return NULL;
+}

 int main(int argc, char *argv[])
 {
-    fprintf(stdout, "Hello from %s!\n", argv[0]);
+#if HAVE_PTHREAD_H
+    pthread_t tid;
+    pthread_create(&tid, 0, print_it, argv[0]);
+    pthread_join(tid, 0);
+#else
+    print_it(argv[0]);
+#endif
     return 0;
 }
diff --git a/README.md b/README.md
index 341a28b..f625f41 100644
--- a/README.md
+++ b/README.md
@@ -360,3 +360,23 @@ AC_SEARCH_LIBS(function, search-libs, [action-if-found], [action-if-not-found],

 将$(DEFS)放在$(CPPFLAGS)之前，可以给最终的用户选择去重载任何我命令行上的决策。
+
+AC_CHECK_HEADERS(header-file..., [action-if-found],
+    [action-if-not-found], [includes = 'default-includes'])
+
+打印信息：
+1、AC_MSG_CHECKING(feature-description)
+2、AC_MSG_RESULT(result-description)
+3、AC_MSG_NOTICE(message)
+4、AC_MSG_ERROR(error-description[, exit-status])
+5、AC_MSG_FAILURE(error-description,[, exit-status])
+6、AC_MSG_WARN(problem-description)
+
+1,2组合使用，2根据1执行的返回值，做相应的输出。
+
+
+
+支持功能和包的可选
+AC_ARG_WITH(package, help-string, [action-if-given], [action-if-not-given])
+AC_ARG_ENABLE(feather,help-string, [action-if-given], [action-if-not-given])
+这个宏被设计成--enable-feature[yes/no] and --with-package[=arg]
diff --git a/configure.ac b/configure.ac
index b8073e3..4ffde86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,14 @@ if test "x${have_pthreads}" = xno; then
    -------------------------------------------------------])
 fi

+AC_ARG_ENABLE([async-exec],
+    [  --enable-async-exec    enable async exec],
+    [async-exec=${enableval}], [async_exec=no])
+
+#AC_ARG_ENABLE([async-exec],
+#    [  --disable-async-exec  disable async exec],
+#    [async-exec=${enableval}], [async_exec=yes])
+
 # Checks for typedefs, structures, and compiler characteristics.

 # Checks for library functions.
diff --git a/configure.ac b/configure.ac
index 4ffde86..4ffd3eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,15 @@ AC_CHECK_PROG([bash_var], [bash], [yes], [no], , [/usr/sbin/bash])
 _DEBUG_END_
 AC_PROG_INSTALL

+# Checks for command-line options
+#AC_ARG_ENABLE([async-exec],
+#    [  --enable-async-exec    enable async exec],
+#    [async_exec=${enableval}], [async_exec=no])
+
+AC_ARG_ENABLE([async-exec],
+    [  --disable-async-exec  disable async execution feature],
+    [async_exec=${enableval}], [async_exec=yes])
+
 # Checks for libraries.
 have_pthreads=no
 AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthreads=yes])
@@ -26,20 +35,15 @@ fi

 # 也可以报错： AC_MSG_ERROR
 if test "x${have_pthreads}" = xno; then
-   AC_MSG_WARN([
-   -------------------------------------------------------
-   Unable to find pthreads on this system.
-   Building a single-threaded version.
-   -------------------------------------------------------])
+    if test "x${async_exec}" = xyes; then
+        AC_MSG_WARN([
+        -------------------------------------------------------
+                Unable to find pthreads on this system.
+                 Building a single-threaded version.
+        -------------------------------------------------------])
+    fi
+    async_exec=no
 fi
-
-AC_ARG_ENABLE([async-exec],
-    [  --enable-async-exec    enable async exec],
-    [async-exec=${enableval}], [async_exec=no])
-
-#AC_ARG_ENABLE([async-exec],
-#    [  --disable-async-exec  disable async exec],
-#    [async-exec=${enableval}], [async_exec=yes])

 # Checks for typedefs, structures, and compiler characteristics.

diff --git a/src/main.c b/src/main.c
index 64ba579..15345ca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -15,7 +15,7 @@ static void* print_it(void* data) {

 int main(int argc, char *argv[])
 {
-#if HAVE_PTHREAD_H
+#if ASYNC_EXEC
     pthread_t tid;
     pthread_create(&tid, 0, print_it, argv[0]);
     pthread_join(tid, 0);
diff --git a/configure.ac b/configure.ac
index 4ffd3eb..2315aca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,29 +22,58 @@ AC_ARG_ENABLE([async-exec],
     [  --disable-async-exec  disable async execution feature],
     [async_exec=${enableval}], [async_exec=yes])

-# Checks for libraries.
-have_pthreads=no
-AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthreads=yes])
+#### always check headers and libs, then check if the user enable the function.
+#### Checks for libraries.
+###have_pthreads=no
+###AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthreads=yes])
+###
+#### Checks for header files.
+###AC_CHECK_HEADERS([stdlib.h])
+###
+###if test "x${have_pthreads}" = xyes; then
+###   AC_CHECK_HEADERS([pthread.h], [], [have_pthreads=no])
+###fi
+###
+#### 也可以报错： AC_MSG_ERROR
+###if test "x${have_pthreads}" = xno; then
+###    if test "x${async_exec}" = xyes; then
+###        AC_MSG_WARN([
+###        -------------------------------------------------------
+###                Unable to find pthreads on this system.
+###                 Building a single-threaded version.
+###        -------------------------------------------------------])
+###    fi
+###    async_exec=no
+###fi

-# Checks for header files.
-AC_CHECK_HEADERS([stdlib.h])
+######## First check if the user enable a function, then check the headers and libs, as it need!
+if test "x${async_exec}" = xyes; then
+    # Checks for libraries.
+    have_pthreads=no
+    AC_SEARCH_LIBS([pthread_create], [pthread], [have_pthreads=yes])

-if test "x${have_pthreads}" = xyes; then
-   AC_CHECK_HEADERS([pthread.h], [], [have_pthreads=no])
-fi
+    # Checks for header files.
+    AC_CHECK_HEADERS([stdlib.h])
+
+    if test "x${have_pthreads}" = xyes; then
+        AC_CHECK_HEADERS([pthread.h], [], [have_pthreads=no])
+    fi

-# 也可以报错： AC_MSG_ERROR
-if test "x${have_pthreads}" = xno; then
-    if test "x${async_exec}" = xyes; then
+    # 也可以报错： AC_MSG_ERROR
+    if test "x${have_pthreads}" = xno; then
         AC_MSG_WARN([
-        -------------------------------------------------------
-                Unable to find pthreads on this system.
-                 Building a single-threaded version.
-        -------------------------------------------------------])
+            -------------------------------------------------------
+                   Unable to find pthreads on this system.
+                    Building a single-threaded version.
+            -------------------------------------------------------])
+        async_exec=no
     fi
-    async_exec=no
 fi
-
+
+if test "x${async_exec}" = xyes; then
+    AC_DEFINE([ASYNC_EXEC], 1, [async execution enabled])
+fi
+
 # Checks for typedefs, structures, and compiler characteristics.

 # Checks for library functions.
diff --git a/README.md b/README.md
index f625f41..8ebb1c3 100644
--- a/README.md
+++ b/README.md
@@ -380,3 +380,9 @@ AC_CHECK_HEADERS(header-file..., [action-if-found],
 AC_ARG_WITH(package, help-string, [action-if-given], [action-if-not-given])
 AC_ARG_ENABLE(feather,help-string, [action-if-given], [action-if-not-given])
 这个宏被设计成--enable-feature[yes/no] and --with-package[=arg]
+
+
+
+格式化帮助字符串
+AS_HELP_STRING(left-hand-side, right-hand-side,
+    [indent-column = '26'], [wrap-column = '79'])
diff --git a/configure.ac b/configure.ac
index 2315aca..4946853 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,8 @@ AC_PROG_INSTALL
 #    [async_exec=${enableval}], [async_exec=no])

 AC_ARG_ENABLE([async-exec],
-    [  --disable-async-exec  disable async execution feature],
+    [AS_HELP_STRING([--disable-async-exec],
+        [disable asynchronous execution @<:@default: no@:>@])],
     [async_exec=${enableval}], [async_exec=yes])

 #### always check headers and libs, then check if the user enable the function.