Force 32 bit build

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

 



Hi,

I want to write a "autoconf/automake" script for an application ONLY for 32 bit on 64 bit Linux.
This meant that the default for configure must be 32 bit and nothing else.


I know that a user can do "configure CC="gcc -m32"... etc but this is NOT what I want.
I want that the 'configure' script set the 32bin once at start and fix.


---------------------------------
my FIRST try fails, the "CCT-MARK" does NOT show up in configure :

# CCT-MARK
# https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
# force 32 bit only
export CFLAGS="$CFLAGS -m32 -O2"
export CXXFLAGS="$CXXFLAGS -m32 -O2"
export LDFLAGS="$LDFLAGS -m32 -O2"

# set CCT3 VERSION information also in:
AC_INIT(....)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([gnu tar-ustar no-dist-gzip dist-bzip2 -Wno-portability subdir-objects])


---------------------------------------
my SECOND try fails to, the "CCT-MARK" show up but too late :


# set CCT3 VERSION information also in:
AC_INIT(....)

# CCT-MARK
# https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
# force 32 bit only
export CFLAGS="$CFLAGS -m32 -O2"
export CXXFLAGS="$CXXFLAGS -m32 -O2"
export LDFLAGS="$LDFLAGS -m32 -O2"

AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([gnu tar-ustar no-dist-gzip dist-bzip2 -Wno-portability subdir-objects])


The "CCT-MARK" section is AFTER the ac_XXXX definition, I think this mean that tests are done
with 64 bit.

created 'configure' script
===============================================
...
## -------------------- ##
## Main body of script. ##
## -------------------- ##

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

# CCT-MARK
# https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
# force 32 bit only
export CFLAGS="$CFLAGS -m32 -O2"
export CXXFLAGS="$CXXFLAGS -m32 -O2"
export LDFLAGS="$LDFLAGS -m32 -O2"
...
=================================================

> Question, what I have to do to force 32 bit ?


mfg.





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

  Powered by Linux