ivaneeo's blog

          自由的力量,自由的生活。

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            669 Posts :: 0 Stories :: 64 Comments :: 0 Trackbacks
          代碼清單 bogusapp.c
          #include <stdio.h>
          #include <stdlib.h>
          #ifdef HAVE_RESOLV_H
          #include <resolv.h>
          #endif /* HAVE_RESOLV_H */
          #include "config.h"

          int main(void)
          {
              int reval;
          #ifdef HAVE_MMAP
               fprintf(stdout, "have mmap()\n");
          #else
               fprintf(stderr, "no mmap()\n");
          #endif

          if(HAVE_UTIME_NULL)
            fprintf(stdout, "utime() allows NULL\n");
          else
            fprintf(stderr, "utime doesn't allow NULL\n");

          if(SYS_SIGLIST_DECLARED)
            fprintf(stdout, "sys_siglist() declared\n");
          else
            fprinf(stderr, "sys_siglist() not declared\n");

          #ifdef HAVE_NCURSES_H
            fprintf(stdout, "ncurses.h found\n");
          #else
            fprintf(stderr, "ncurses.h not found\n);

          if(HAVE_FCNTL_H)
            fprintf(stdout, "fcntl.h found\n");
          else
            fprintf(stderr, "fcntl.h not found\n");

          if(HAVE_SYS_FCNTL_H)
            fprintf(stdout, "sys/fcntl.h found\n");
          else
            fprintf(stderr, "sys/fcntl.h not found\n");

          #ifdef NLIST_NAME_UNION
            fprintf(stdout, "nlist.n_un member found\n");
          #else
            fprintf(stdout, "nlist.n_un member not found\n");
          #endif

          if(HAVE_VOID_POINTER)
            fprintf(stdout, "Yep, we have a usable void pointer type\n");
          else
            fprintf(stderr, "Nope, no usable void pointer type\n");
          exit(EXIT_SUCCESS);
          }
          .Makefiel.in--用于創(chuàng)建真正的makefile文件的模板
          .acconfig.h--與特定系統(tǒng)相關的宏的集合,它隨autoconf軟件一起提供
          .bogusapp.c--bogusapp的源代碼,這是個示例程序
          .config.h--包含bogusapp.c中用到的所有宏的頭文件
          .configure.in--創(chuàng)建最終的configure腳本的模板
          .install.sh--安裝腳本,用在不帶兼容BSD的install程序的系統(tǒng)上

          在目錄下運行autoscan產(chǎn)生的configure.scan如下:
          $autoscan
          $cat configure.scan
          dnl Process this file with autoconf to produce a configure script.
          AC_INIT(acconfig.h)
          dnl Checks for programs.
          dnl Checks for libraries.
          dnl Checks for header files.
          AC_HEADER_STDC
          dnl Checks for typedefs, structures, and compiler characteristics.
          dnl Checks for library functions.
          AC_OUTPUT(Makefile)

          ifnames的輸出如下:
          HAVE_MMAP bogusapp.c
          HAVE_NCURSES_H bogusapp.c
          HAVE_RESOLV_H bogusapp.c
          HAVE_NAME_UNION bogusapp.c
          posted on 2005-08-04 21:24 ivaneeo 閱讀(320) 評論(0)  編輯  收藏 所屬分類: GNU牛力
          主站蜘蛛池模板: 洞口县| 奎屯市| 嘉兴市| 和政县| 邢台市| 枝江市| 互助| 江西省| 寿光市| 津市市| 永胜县| 九寨沟县| 泽普县| 怀来县| 温泉县| 合山市| 柘荣县| 娄烦县| 荣昌县| 杭州市| 温泉县| 清远市| 耒阳市| 兴安盟| 元朗区| 祁东县| 永宁县| 英德市| 伊通| 远安县| 潞西市| 吉林市| 理塘县| 杂多县| 清水河县| 宁国市| 舟山市| 治县。| 凭祥市| 舞阳县| 信宜市|