LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 678|回复: 1

我的autotool生成的makefile在make时会自己加入-g参数不知道是否正常。

[复制链接]
发表于 2010-11-3 16:14:53 | 显示全部楼层 |阅读模式
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(hello2,1.0.0,newman0708@gmail.com)
AM_INIT_AUTOMAKE(hello2,1.0.0,newman0708@gmail.com)
AC_CONFIG_SRCDIR([src/main/main.c])
AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC
#AC_PROG_RANLIB                 ### Added if static libary used
AC_PROG_LIBTOOL                 ### Added if dynamic libary used

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.

AC_OUTPUT(Makefile
        include/Makefile
        src/Makefile
        src/main/Makefile
        src/foo/Makefile
        src/bar/Makefile
)


Makefile.am
### Makefile.am ###
SUBDIRS = include src
AUTOMAKE_OPTIONS=foreign


make时
make[3]: Entering directory `/mnt/mybag/doc/C.Language/hello2/src/main'
/bin/sh ../../libtool --tag=CC   --mode=link gcc  -g -O2 -g -D_DEBUG -L../../src/bar  -o hello2 main.o ../../src/foo/libfoo.a -lbar
gcc -g -O2 -o .libs/hello2 main.o  -L/home/newman0708/doc/C.Language/hello2/src/bar ../../src/foo/libfoo.a /home/newman0708/doc/C.Language/hello2/src/bar/.libs/libbar.so
creating hello2

自动加入了-g参数, 不知道 为什么呀
发表于 2010-11-4 19:20:45 | 显示全部楼层
默认的行为就是这样的。可以自己加strip步骤。或者可以用autoreconf重新配置,增加CFLAGS='-O2'选项。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表