IT业行者,行者无疆
分类: LINUX
2010-11-20 10:41:23
1. autoscan 2. 修改configure.scan,重命名为configure.in,编辑Makefile.am 3. 运行aclocal 4. autoconf 5. automake --add-missing 6. ./configure && make && make install了。
helight@helight:myshell$ ls src helight@helight:myshell$ ls src/ myshell.c helight@helight:myshell$
helight@helight:myshell$ autoscan helight@helight:myshell$ ls autoscan.log configure.scan src helight@helight:myshell$ mv configure.scan configure.in helight@helight:myshell$ vim configure.in helight@helight:myshell$ vim Makefile.am helight@helight:myshell$ vim src/Makefile.am
# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) AC_INIT("myshell", "0.01", "helight.xu@gmail.com") AC_CONFIG_SRCDIR([src/myshell.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE("myshell", "0.01") # Checks for programs. AC_PROG_CC # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_PID_T AC_TYPE_UID_T # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_CHECK_FUNCS([memset strrchr]) AC_CONFIG_FILES(Makefile src/Makefile) AC_OUTPUT
AC_INIT("myshell", "0.01", "helight.xu@gmail.com") AM_INIT_AUTOMAKE("myshell", "0.01") AC_CONFIG_FILES(Makefile src/Makefile)
helight@helight:myshell$ cat Makefile.am #Makefile.am SUBDIRS = src helight@helight:myshell$
helight@helight:myshell$ cat src/Makefile.am #src/Makefiel.am bin_PROGRAMS = myshell myshell_SOURCES = myshell.c helight@helight:myshell$
helight@helight:myshell$ aclocal helight@helight:myshell$ ls aclocal.m4 autoscan.log configure.in Makefile.am src helight@helight:myshell$
helight@helight:myshell$ autoconf helight@helight:myshell$ ls aclocal.m4 autoscan.log configure.in src autom4te.cache configure Makefile.am helight@helight:myshell$
helight@helight:myshell$ autoheader helight@helight:myshell$ ls aclocal.m4 autoscan.log configure Makefile.am autom4te.cache config.h.in configure.in src helight@helight:myshell$
helight@helight:myshell$ automake --add-missing configure.in: installing `./install-sh' configure.in: installing `./mkinstalldirs' configure.in: installing `./missing' Makefile.am: installing `./COPYING' Makefile.am: installing `./INSTALL' Makefile.am: required file `./NEWS' not found Makefile.am: required file `./README' not found Makefile.am: required file `./AUTHORS' not found Makefile.am: required file `./ChangeLog' not found src/Makefile.am: installing `./depcomp' helight@helight:myshell$ ls aclocal.m4 config.h.in COPYING install-sh missing autom4te.cache configure depcomp Makefile.am mkinstalldirs autoscan.log configure.in INSTALL Makefile.in src helight@helight:myshell$这里可以看到提示缺少一些文件。但这些文件是可以不要的。
helight@helight:myshell$ ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for ANSI C header files... yes checking for sys/wait.h that is POSIX.1 compatible... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for unistd.h... (cached) yes checking for pid_t... yes checking for uid_t in sys/types.h... yes checking vfork.h usability... no checking vfork.h presence... no checking for vfork.h... no checking for fork... yes checking for vfork... yes checking for working fork... yes checking for working vfork... (cached) yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for memset... yes checking for strrchr... yes configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating config.h config.status: executing depfiles commands helight@helight:myshell$
helight@helight:myshell$ make
chinaunix网友2010-11-22 17:50:26
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com