|
发表于 2003-8-23 16:01:14
|
显示全部楼层
回复: 想自动生成一个makefile,但是make时出现错误,请帮忙,多谢
最初由 xiaoniao9312 发表
psh% ./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... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output... 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 ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc
configure: creating ./config.status
config.status: creating Makefile
config.status: executing default-1 commands
psh% make
gcc -g -O2 -o hello hello.o
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x82): undefined reference to `main'
*** Error code 1
Stop in /usr/dan/scr/devel/hello.
[1] Error 3556 make
psh%
这个是在freebsd4.8上执行的结果,
bash# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets $(MAKE)... yes
checking for working aclocal... found
checking for working autoconf... missing
checking for working automake... found
checking for working autoheader... missing
checking for working makeinfo... found
checking for gcc... gcc
checking for C compiler default output... 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 ANSI C... none needed
configure: creating ./config.status
config.status: creating Makefile
bash# make
"Makefile", line 247: Need an operator
make: fatal errors encountered -- cannot continue
bash#
这是在freebsd5.1版本中执行的结果,
按下面的教程做的,
http://www.linuxeden.com/edu/doctext.php?docid=2839
发现5.1版本中跟教程中的configure有几个地方不一样,关键是那个autoconf那里,在5.1中显示为missing,但是在教程中显示为found,5.1版本中存在autoconf257,没有autoconf,请问跟这个有关系嘛,
还有在生成 makefile时,跟
1. GNU Automake
2. GNU Autoconf
3. GNU m4
4. perl
5. GNU Libtool (如果你需要产生 shared library)
这几个软件的版本有没有关系,各个软件的版本是不是需要匹配,
多谢
//=====================
高亮部分是不是 make 编写的有问题?
从出错提示看, hello.c 没有main 函数, 但你的编译选项 是 -o
换成 -c ?
//===================
247 行 make文件中需要一个分隔符号.
检查一下你的 脚本是否对? |
|