# !/bin/bash RO_CPARAMS= RO_RECURSE=no # Check Parameters for recurse option for param in $@ ; do if [ "$param" == "--ro-recurse" ] ; then RO_RECURSE=yes else RO_CPARAMS="$RO_CPARAMS $param" fi done # Add onto exeext with ,ff8 extension addff8() { if grep "exeext=$" $ff8PATH >/dev/null ; then echo RISC OS: Adding filetype for exeext for $ff8PATH sed s#exeext=\$#"exeext=,ff8;"# < $ff8PATH > /tmp/new-configure mv /tmp/new-configure $ff8PATH chmod +x $ff8PATH fi # Fix some tests that assume no file extension for binaries if grep -- "-s conftest;" >/dev/null $ff8PATH; then echo RISC OS: Adding filetype for binary tests for $ff8PATH sed s#-s\ conftest\;#"-s conftest\$\{ac_exeext\}\;"# < $ff8PATH > /tmp/new-configure mv /tmp/new-configure $ff8PATH chmod +x $ff8PATH fi } # Binary install path ROBIN=/home/riscos/cross/bin # If the path for the configure script wasn't set, then use . if [ -z "$RO_CPATH" ] ; then RO_CPATH=. fi # Also check .. if it doesn't exist. This is useful for some setups # (e.g. bash) if ! [ -e $RO_CPATH/configure ] ; then if [ -e ../configure ] ; then RO_CPATH=.. else echo "No configure script found" 1>&2 exit 1 fi fi # Massage the configure scripts if [ "$RO_RECURSE" == "yes" ] ; then # Search for more configure files RO_CFILES=$(find $RO_PATH -type f) for ff8PATH in $RO_CFILES ; do if echo $ff8PATH | grep "configure$" > /dev/null ; then addff8 fi done else # Otherwise, just the single one at the top ff8PATH=$RO_CPATH/configure addff8 fi # Record configure options so switches can be added if needed $RO_CPATH/configure --help > /tmp/out-configure # Set target type if grep -- --target $RO_CPATH/configure >/dev/null ; then TARGET="--target=arm-riscos-aof" else TARGET= fi if grep -- --build $RO_CPATH/configure >/dev/null; then BUILD="--build=arm-elf-linux-gnu" else BUILD= fi if grep -- --host $RO_CPATH/configure >/dev/null; then HOST="--host=arm-riscos-aof" else HOST= fi # Well, this should ideally be set. But some things (e.g. ncurses) get # confused and think we're no longer cross compiling. OTOH, the Tiff # library needs it set, so we do so manually for its configure switches TARGET= # Set Prefix if grep -- --prefix /tmp/out-configure >/dev/null; then PREFIX="--prefix=/home/riscos/env" else if grep -- -prefix /tmp/out-configure >/dev/null; then PREFIX="--prefix=/home/riscos/env" else PREFIX= fi fi # Set WITHLIBS if grep -- --with-libs /tmp/out-configure >/dev/null; then WITHLIBS="--with-libs=/home/riscos/env" else WITHLIBS= fi # Add X paths if needed if grep -- -x-includes $RO_CPATH/configure >/dev/null; then echo RISC OS: Adding X Paths X="--x-libraries=/home/riscos/env/X11R6/lib/ --x-includes=/home/riscos/env/X11R6/include" else X= fi # Set Static and Dynamic options if grep -- --enable-shared /tmp/out-configure >/dev/null; then echo RISC OS: Disabling shared libraries SHARED=--enable-shared=no else if grep -- --disable-shared /tmp/out-configure > /dev/null; then echo RISC OS: Disabling shared libraries SHARED=--disable-shared else SHARED= fi fi if grep enable-static /tmp/out-configure >/dev/null; then echo RISC OS: Enabling static libraries STATIC=--enable-static=yes else if grep -- "-static" /tmp/out-configure >/dev/null; then STATIC=-static else STATIC= fi fi # Glib location if grep with-glib-prefix /tmp/out-configure >/dev/null; then echo RISC OS: Setting Glib path GLIB=--with-glib-prefix=/home/riscos/env else GLIB= fi # GTK location if grep with-gtk-prefix /tmp/out-configure >/dev/null; then echo RISC OS: Setting GTK path GTK=--with-gtk-prefix=/home/riscos/env else GTK= fi # TCL if grep with-tclconfig /tmp/out-configure >/dev/null; then echo RISC OS: Setting TCL path TCLTK="--with-tclconfig=/home/riscos/env/lib/tcl8.4" else TCLTK= fi # TK if grep with-tkconfig /tmp/out-configure >/dev/null; then echo RISC OS: Setting TK path TCLTK="$TCLTK --with-tkconfig=/home/riscos/env/lib/tk8.4" fi # Threading # We probably want this on in future. if grep -- "--enable-thread" /tmp/out-configure >/dev/null; then echo RISC OS: Disabling threads THREADS=--disable-threads else THREADS= fi # Native compilers if grep -- "--with-build-cc" /tmp/out-configure >/dev/null; then echo RISC OS: Setting native compiler NATIVE="--with-build-cc=$(which cc)" else NATIVE= fi # Remove configure options rm /tmp/out-configure # Set tool chain variables picked up by configure export CC=$ROBIN/gcc export CPPFLAGS=-I/home/riscos/env/include export LDFLAGS=-L/home/riscos/env/lib export CXX=$ROBIN/g++ export CXXLIBS=-liostream export config_BUILD_CC=/usr/bin/cc export AR=$ROBIN/ar export NM=$ROBIN/nm export RANLIB=echo export INSTALL=/home/riscos/env/ro-install export STRIP=string # Used by Mozilla export CROSS_COMPILE=1 # Set autoconf variables to avoid configure scripts complaining about running # programs during cross compile export ac_cv_prog_system=riscos export ac_cv_sizeof_char=1 export ac_cv_sizeof_unsigned_char=1 export ac_cv_sizeof_short=2 export ac_cv_sizeof_short_int=2 export ac_cv_sizeof_unsigned_short_int=2 export ac_cv_sizeof_int=4 export ac_cv_sizeof_unsigned_int=4 export ac_cv_sizeof_unsigned_long_int=4 export ac_cv_sizeof_long=4 export ac_cv_sizeof_long_int=4 export ac_cv_sizeof_long_long=8 export ac_cv_sizeof_long_long_int=8 export ac_cv_sizeof_unsigned_long_long=8 export ac_cv_sizeof_void_p=4 export ac_cv_sizeof_char_p=4 export ac_cv_sizeof_unsigned_char_p=4 export ac_cv_sizeof_off_t=4 export ac_cv_sizeof_pid_t=4 export ac_cv_sizeof_size_t=4 export ac_cv_sizeof_ssize_t=4 export ac_cv_have_int64_t=yes export ac_cv_have_accrights_in_msghdr=no export ac_cv_have_control_in_msghdr=no export ac_exeext=,ff8 export ac_cv_exeext=,ff8 export ac_cv_file___dev_ptmx_=no export ac_cv_file___dev_ptc_=no export ac_cv_need_trio=no export ac_cv_prog_cc_works=yes export ac_cv_prog_cc_cross=yes export ac_cv_prog_cc_g=no export lt_cv_prog_cc_can_build_shared=no export lt_cv_prog_cc_pic_works=no export ac_cv_func_setvbuf_reversed=no export ac_cv_func_getpgrp_void=yes export ac_cv_func_setpgrp_void=yes export ac_cv_func_mlock=no export ac_cv_func_mlockall=no export ac_cv_func_ecvt=no export ac_cv_func_fcvt=no export ac_cv_func_gcvt=no export ac_cv_func_dtoa=yes export ac_cv_func_dtoa_r=yes export ac_cv_func_sys_siglist=yes export ac_cv_func_bsd_getpgrp=yes export ac_cv_func_bsd_setpgrp=yes export ac_cv_func_snprintf=yes export ac_cv_func_getpgrp_void=yes export ac_cv_func_malloc_works=yes export ac_cv_func_realloc_works=yes export ac_cv_func_memcmp_clean=yes export ac_cv_func_strtod=yes export ac_cv_func_strtoul=yes export ac_cv_func_strstr=yes export ac_cv_func_getpwuid_r=yes export ac_cv_no_user_malloc=no export ac_cv_c_char_unsigned=yes export ac_cv_c_bitfields_htol=no export ac_cv_dev_minor_bits=0 export ac_cv_dev_minor_noncontig=no export ac_cv_type_prototypes=yes export ac_cv_sctp=no export bash_cv_have_mbstate_t=no export bash_cv_getenv_redef=no export kde_cv_shortsetgroups=no export kde_cv_prog_uic_nounload=yes export kde_cv_defines_imake="" export glib_cv_hasinline=yes export glib_cv_has__inline=yes export glib_cv_has__inline__=yes export glib_cv_sane_realloc=yes export glib_cv_va_copy="" export glib_cv___va_copy="" export glib_cv_va_val_copy="" export ac_cv_alignof_CORBA_char=1 export ac_cv_alignof_CORBA_boolean=1 export ac_cv_alignof_CORBA_octet=1 export ac_cv_alignof_CORBA_short=2 export ac_cv_alignof_CORBA_long=4 export ac_cv_alignof_CORBA_unsigned_short=2 export ac_cv_alignof_CORBA_unsigned_long=4 export ac_cv_alignof_CORBA_float=4 export ac_cv_alignof_CORBA_double=4 export ac_cv_alignof_CORBA_long_double=4 export ac_cv_alignof_CORBA_wchar=2 export ac_cv_alignof_CORBA_long_long=4 export ac_cv_alignof_CORBA_unsigned_long_long=4 export ac_cv_alignof_CORBA_struct=4 export ac_cv_alignof_CORBA_pointer=4 export lftp_cv_va_copy=no export lftp_cv___va_copy=yes export lftp_cv_precompiled_readline=yes export rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes export rsync_cv_HAVE_C99_VSNPRINTF=yes export ac_cv_path_db_cv_path_ar=ar export ac_cv_path_db_cv_path_ranlib=: export ac_cv_path_db_cv_path_cp=$INSTALL export ac_cv_path_db_cv_path_chmod=/bin/echo export ac_cv_path_db_cv_path_strip=: export db_cv_alignp_t=int export db_cv_mutex=no export db_cv_fcntl_f_setfd=yes export db_cv_sprintf_count=yes export tcl_cv_strtod_buggy=1 export ac_cv_header_wctype_h=no /home/riscos/env/ro-path $RO_CPATH/configure \ $HOST $BUILD $TARGET $PREFIX $WITHLIBS $X $SHARED $STATIC $GLIB $GTK \ $TCLTK $THREADS $NATIVE $RO_CPARAMS