where should i add link options

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

 



On Wed, May 7, 2008 at 6:32 AM, F <ff.pptux+sip at gmail.com> wrote:
> Hi,
>     I'm trying to build pjsip for nios2 target. I've added nios2 to
> config.sub and pjlib/include/pj/config.h. It compiles without error. But I
> want to add a link option -elf2flt to get a bflt format executable. I create
> a file build/m-nios2.mak.
>
>     export M_CFLAGS := $(CC_DEF)PJ_M_NIOS2=1
>     export M_CXXFLAGS :=
>     export M_LDFLAGS := -elf2flt
>     export M_SOURCES :=
>
> but it still produces ELF executables. Do I miss something here?
>
> I find it ok to add a line in user.mak
>       export LDFLAGS += -elf2flt
> and it works as I expect.
> I just want to know why the first method doesn't work. Thanks.
>

When you use autoconf, the machine (and os) name will be set to
"auto", hence m-auto.mak will always be used instead. FYI the whole
m-xxx.mak, os-xxx.mak have been deprecated by autoconf. It'll only be
used when ./configure-legacy is used (which I'm sure is broken by
now).

As an alternative to creating user.mak, you could also do:

  ./aconfigure LDFLAGS='-elf2flt'

I have committed your patches in r1948 and r1949, thanks!

Cheers
 Benny


> below is the changes I made
> --------------------
> svn diff
> --------------------
>
> Index: config.sub
> ===================================================================
> --- config.sub (revision 1947)
> +++ config.sub (working copy)
> @@ -1113,6 +1113,10 @@
>  pmac | pmac-mpw)
>  basic_machine=powerpc-apple
>  ;;
> + nios2*)
> + basic_machine=nios2-altera
> +# os=-linux
> + ;;
>  *-unknown)
>  # Make sure to match an already-canonicalized machine name.
>  ;;
> Index: pjlib/include/pj/config.h
> ===================================================================
>  --- pjlib/include/pj/config.h (revision 1947)
> +++ pjlib/include/pj/config.h (working copy)
> @@ -251,6 +251,18 @@
>  # define PJ_IS_LITTLE_ENDIAN 0
>  # define PJ_IS_BIG_ENDIAN 1
>  +#elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
>  + defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
> + /*
> + * Nios2, little endian
> + */
> +# undef PJ_M_NIOS2
> +# define PJ_M_NIOS2 1
> +# define PJ_M_NAME "nios2"
>  +# define PJ_HAS_PENTIUM 0
> +# define PJ_IS_LITTLE_ENDIAN 1
> +# define PJ_IS_BIG_ENDIAN 0
> +
>  #else
>  # error "Please specify target machine."
>  #endif
>
> --
> F
> _______________________________________________
>  Visit our blog: http://blog.pjsip.org
>
>  pjsip mailing list
>  pjsip at lists.pjsip.org
>  http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux