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)相關(guān)的宏的集合,它隨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牛力
          主站蜘蛛池模板: 北安市| 双流县| 昌江| 木兰县| 定结县| 屏山县| 呼和浩特市| 河源市| 北京市| 鹤峰县| 巴东县| 当阳市| 岳西县| 即墨市| 罗源县| 寿阳县| 西畴县| 彭山县| 永丰县| 鞍山市| 汽车| 西吉县| 岳池县| 依兰县| 大姚县| 浙江省| 百色市| 方山县| 怀集县| 石景山区| 三穗县| 时尚| 淮阳县| 会东县| 东乡族自治县| 新安县| 桂平市| 仁化县| 兴宁市| 蕲春县| 鱼台县|