Re: using autoconf to create build scripts for Assembly language programs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 7, 2018 at 7:27 PM, Eric Blake <eblake@xxxxxxxxxx> wrote:

> On 06/07/2018 12:45 AM, mallapadi niranjan wrote:
>
>> Greetings,
>>
>> i am newbie trying to learn autoconf, I would like to autoconf to have
>> build scripts created to compile assembly language programs written using
>> GNU Assembler:
>>
>
> This is probably more a question for the automake list, since...
>
>
>> Below are my configurations
>>
>> configure:ac
>>
>>     AC_INIT([hello], [0.01]])
>>     AC_CONFIG_SRCDIR([hello.s])
>>     AC_CONFIG_HEADERS([config.h])
>>     AC_CONFIG_AUX_DIR([build-aux])
>>
>>     AM_INIT_AUTOMAKE([-Wall -Werror])
>>     AC_CONFIG_FILES([Makefile])
>>     AM_PROG_AS
>>
>
> ...AM_PROG_AS is an automake macro, and...
>
>     AC_OUTPUT
>>
>> Makefile.am
>>
>> bin_PROGRAMS = hello
>> hello_SOURCES = hello.s
>> AM_CCAS = /usr/bin/as
>> AM_CCASFLAGS = --gstabs+
>>
>
> ...AM_CCAS is a variable for use by automake, not autoconf.
>
> [ashok@mydevel foobar]$ make
>> make  all-am
>> make[1]: Entering directory `/home/ashok/practice/ia32/mya
>> sm/autotools/foobar'
>> gcc  -g -O2   -o hello hello.o
>>
>
> According to the automake manual, AM_CCAS sets $CCAS to a default of $CC
> unless you define it to something else.  However, I have no idea why
> $AM_CCASFLAGS doesn't seem to be honored in this line; you'll have to ask
> the automake developers for help in debugging it.
>
>
>> How do i override to use /usr/bin/as instead of gcc and pass -gstabs+
>> flag to /usr/bin/as.
>>
>
> The easiest way there, per documentation (although I have not tested), is
> to run './configure CCAS=/usr/bin/as' to force configure to use your choice
> of assembler in place of the default (since the automake documentation said
> the default would be $CC which is typically gcc on a GNU/Linux system).
>
> Thanks for the reply, that did help  a bit but  was not able to remove the
-c option

I passed./configure CCAS=/usr/bin/as CFLAGS=''


 [ashok@mydevel foobar]$ make
make  all-am
make[1]: Entering directory
`/home/ashok/practice/ia32/myasm/autotools/foobar'
/usr/bin/as --gstabs+  -c -o hello.o hello.s
/usr/bin/as: unrecognized option '-c'
make[1]: *** [hello.o] Error 1
make[1]: Leaving directory
`/home/ashok/practice/ia32/myasm/autotools/foobar'
make: *** [all] Error 2

I could not remove the -c option, .



-- 
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
>
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf



[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux