Ticket #10: x86_64.diff

File x86_64.diff, 12.2 kB (added by Jan-Nik, 8 months ago)

adding x86_64 support; apgcc64.patch needs to be applied too

  • release/autopackage-build

    old new  
    409409 
    410410tar -c --bzip2 --file "autopackage.tar.bz2" "autopackage/" 
    411411! "$autopackage_silent" && out "finished." 
    412 # copy to native x86 architecture directory for downloading 
    413 mkdir -p "$target/x86" 
    414 cp -f "autopackage.tar.bz2" "$target/x86/" 
     412# copy to native architecture directory for downloading 
     413 
     414cpu_architecture="x86" 
     415if [[ $(uname -m) == "x86_64" ]]; then cpu_architecture="x86_64"; fi 
     416 
     417mkdir -p "$target/$cpu_architecture" 
     418cp -f "autopackage.tar.bz2" "$target/$cpu_architecture/" 
    415419! "$autopackage_silent" && out " " 
    416420 
    417 cd "$target/x86
     421cd "$target/$cpu_architecture
    418422! "$autopackage_silent" && out "Moved tools package to $PWD/autopackage.tar.bz2 ." 
    419423 
    420424rm -fr "$apkg_build_dir" 
  • makepackage

    old new  
    694694                return 1 
    695695        fi 
    696696 
    697         if [[ "$CPUARCHITECTURES" != "x86" ]] && [[ "$CPUARCHITECTURES" != "" ]]; then 
    698                 red; outn "ERROR: "; normal; out "Sorry, autopackage is x86 only for now. Please do not request non-x86 architectures." 
    699                 return 1 
    700         fi 
    701697 
    702  
    703698        # ********************************************************** 
    704699        #  2.4 Set Meta Defaults 
    705700        # ********************************************************** 
     
    750745                COMPRESSION="bzip2" 
    751746        fi 
    752747 
    753         CPUARCHITECTURE=x86 
    754         CPUARCHITECTURES=x86 
     748        cpu_architecture=x86 
     749        if [[ $(uname -r) == "x86_64" ]]; then 
     750                cpu_architecture=x86_64 
     751        fi 
     752        if [[ -n $CPUARCHITECTURE ]]; then 
     753                red; outn "WARNING: "; normal; out "CPUArchitecture is deprecated. Use CPUArchitectures instead." 
     754        else 
     755                CPUARCHITECTURE=$cpu_architecture 
     756        fi 
     757         
     758        CPUARCHITECTURES=$cpu_architecture 
    755759 
    756760        # determine interface version and normalize 
    757761        local interfaceversion_major=`getMajor "$INTERFACEVERSION"` 
     
    903907        stub=$( echo "$stub" | replaceStr "%SoftwareVersion%" "$SOFTWAREVERSION" ) 
    904908        stub=$( echo "$stub" | replaceStr "%InterfaceVersion%" "$INTERFACEVERSION" ) 
    905909        stub=$( echo "$stub" | replaceStr "%PackageVersion%" "$PACKAGEVERSION" ) 
    906         stub=$( echo "$stub" | replaceStr "%CPUArchitecture%" "$CPUARCHITECTURE" ) 
     910        stub=$( echo "$stub" | replaceStr "%CPUArchitectures%" "$CPUARCHITECTURES" ) 
    907911        stub=$( echo "$stub" | replaceStr "%AutopackageTarget%" "$AUTOPACKAGETARGET" ) 
    908912 
    909913        # Make the built package require the current autopackage version 
  • share/apkg-script-utils

    old new  
    419419 
    420420 
    421421## 
     422# _getLibraryPath <LIBRARY> 
     423# LIBRARY: The name of the library 
     424# Outputs: Paths of the library 
     425# Returns: non-zero if the library isn't found at all 
     426# 
     427# Get's the path of a library and automatically filters by the architecture. 
     428# For example if $cpu_architecture is "x86_64" it will return the path of the 64 bit library. 
     429# If $cpu_architecture is "x86" or isn't set, only 32 bit libraries will be returned. 
     430### START GETLIBRARYPATHS 
     431function _getLibraryPaths() { 
     432        local lib="" 
     433        lib=$1 
     434        if [[ "$lib" == "" ]]; then 
     435                err "must specify the library to check for" 
     436                popOptE 
     437                return 1 
     438        fi 
     439         
     440    local cacheresult 
     441    cacheresult=$( /sbin/ldconfig -p | grep "${lib}\(\.[[:digit:]\.]*\)\?$" | awk 'BEGIN {FS=" => "} { print $2 }' | while read; do test -f "$REPLY" && echo $REPLY; done ) 
     442        local libpathresult=`_scanLDLibPath "${lib}"` 
     443    local liblist=`echo -e "${libpathresult}\n${cacheresult}" | grep "\(.\)" | sort | uniq` 
     444    local result=""; 
     445    if [[ "$liblist" == "" ]]; then warn "$1 not found"; popOptE; return 1; fi; # not found in cache 
     446 
     447    # make sure that libraries in $liblist are compatible with our architecture 
     448    local proper_architecture=false 
     449 
     450    local oIFS="$IFS" 
     451    IFS=$'\n'; 
     452 
     453    local l 
     454    local -a liblist_array 
     455    liblist_array=($liblist); 
     456    liblist="" 
     457    for l in "${liblist_array[@]}"; do 
     458        if isLibrary32 "$l"; then 
     459                if [[ "$cpu_architecture" != "x86_64" ]]; then 
     460                proper_architecture=true 
     461                liblist=$(echo -e "$liblist$l\n") 
     462            fi 
     463        else 
     464                if [[ "$cpu_architecture" == "x86_64" ]]; then 
     465                proper_architecture=true 
     466                liblist=$(echo -e "$liblist$l\n") 
     467            fi 
     468        fi 
     469    done 
     470 
     471    IFS="$oIFS" 
     472     
     473    echo $liblist 
     474} 
     475### END GETLIBRARYPATHS 
     476 
     477## 
    422478# testForLib [-v] [-i] LibraryName 
    423479# -v: Verbose mode. Print each version number out on stdout. 
    424480# -i: Print each unique interface version found on stdout. 
     
    471527        return 1 
    472528    fi 
    473529 
    474     local cacheresult 
    475     cacheresult=$( /sbin/ldconfig -p | grep "${lib}\(\.[[:digit:]\.]*\)\?$" | awk 'BEGIN {FS=" => "} { print $2 }' | while read; do test -f "$REPLY" && echo $REPLY; done ) 
    476     trace cacheresult=$cacheresult 
    477     local libpathresult=`_scanLDLibPath "${lib}"` 
    478     trace libpathresult=$libpathresult 
    479     local liblist=`echo -e "${libpathresult}\n${cacheresult}" | grep "\(.\)" | sort | uniq` 
    480     local result=""; 
    481     if [[ "$liblist" == "" ]]; then warn "$1 not found"; popOptE; return 1; fi; # not found in cache 
    482     trace liblist=$liblist 
     530    liblist=$(_getLibraryPaths $lib) 
    483531 
    484     # make sure that libraries in $liblist are only valid 32-bit libs 
    485     local found_32bit=false 
    486  
    487     local oIFS="$IFS" 
    488     IFS=$'\n'; 
    489  
    490     local l 
    491     local -a liblist_array 
    492     liblist_array=($liblist); 
    493     for l in "${liblist_array[@]}"; do 
    494         if isLibrary32 "$l"; then 
    495             found_32bit=true 
    496             break; 
    497         fi 
    498     done 
    499  
    500     IFS="$oIFS" 
    501  
    502     trace $found_32bit 
    503  
    504     if ! $found_32bit; then 
    505         warn "only 64-bit libraries were found, returning 1" 
    506         popOptE; 
    507         return 1 
    508     fi 
    509  
    510     if ! $verbose && ! $verbose_i; then 
    511         popOptE 
    512         return 0 
    513     fi 
    514  
    515532    # we want to loop over the results until we find a library that matches the required version 
    516533    ( 
    517534    echo "$liblist" | while read; do 
     
    33603377# Checks the system C library for the given version symbols. The missing symbols, if any 
    33613378# will be output to stdout. 
    33623379function _checkForGlibcVersions() { 
    3363     if isLibrary32 /lib/libc.so.6; then 
    3364         dumpverdefs32 /lib/libc.so.6 $@ 
     3380        local lib=$(_getLibraryPaths libc.so.6) 
     3381        #FIXME: _getLibraryPaths might return more then one path 
     3382 
     3383    if isLibrary32 $lib; then 
     3384        dumpverdefs32 $lib $@ 
    33653385    else 
    3366         dumpverdefs64 /lib/libc.so.6 $@ 
     3386        dumpverdefs64 $lib $@ 
    33673387    fi 
    33683388} 
     3389         
    33693390 
    33703391## 
    33713392# getPythonLibDir 
  • share/apkg-dep

    old new  
    377377 
    378378        # Verify package matches machine cpu architecture 
    379379        c=$( echo "$header" | grep CPUArchitecture | sed 's/# CPUArchitecture //' ) 
    380         trace package cpuarchitecture is \"$c\" 
    381         if [[ "$cpu_architecture" != "$c" ]]; then 
     380        if [[ $c != "" ]]; then 
     381                trace package cpuarchitecture is \"$c\" 
     382                if [[ "$cpu_architecture" != "$c" ]]; then 
     383                        continue 
     384                fi 
     385        fi 
     386        # TODO: I haven't tested this: 
     387        c=$( echo "$header" | grep CPUArchitectures | sed 's/# CPUArchitectures //' ) 
     388        trace package cpuarchitectures are \"$c\" 
     389        local found=false 
     390        for a in $c; do 
     391                if [[ "$a" == "$c" ]]; then found=true; fi 
     392        done 
     393        if ! $found; then 
    382394                continue 
    383395        fi 
    384396 
  • share/backend.template

    old new  
    9797 
    9898    # check if binary is usable on target machine, if not error 
    9999    found=false 
     100    x86found=false 
    100101    for a in $CPUARCHITECTURES; do 
    101102        if [[ "$a" == "$cpu_architecture" ]]; then 
    102103            found=true 
     104            break 
    103105        fi 
     106        if [[ "$a" == "x86" ]]; then 
     107                x86found=true 
     108        fi 
    104109    done 
    105110    if ! $found; then 
    106         err failed cpu architecture payload check 
    107         __cleanup_backend 
    108         exit 1 
     111                if $x86found && [[ "$cpu_architecture" == "x86_64" ]]; then 
     112                    # if we are on x86_64 we are able to run x86 code 
     113                        cpu_architecture="x86" 
     114                        trace cpu architecture changed to x86 
     115                        found=true 
     116                        break 
     117                else 
     118                        err failed cpu architecture payload check 
     119                        __cleanup_backend 
     120                        exit 1 
     121                fi 
    109122    fi 
    110123    trace passed cpu architecture payload check 
    111124 
  • share/apkg-funclib

    old new  
    403403            # like Fedora. But, it's not right for pure64 distros like 
    404404            # Debian/Ubuntu or Gentoo 
    405405 
    406             i386 | i486 | i586 | i686 | x86_64 | athlon) 
     406            i386 | i486 | i586 | i686 | athlon) 
    407407                export cpu_architecture="x86";; 
     408            x86_64) 
     409                export cpu_architexture="x86_64";; 
    408410 
    409411        esac 
    410412    fi 
     
    22062208                # check CPU arch is OK before we run any native code 
    22072209                needed_archs=$( echo "$tmp" | sed -n '1p' ) 
    22082210                local found=false 
     2211                                local x86found=false 
    22092212                for a in $needed_archs; do 
    22102213                    if [[ "$a" == "$cpu_architecture" ]]; then found=true; fi 
     2214                                        if [[ "$a" == "x86" ]]; then x86found=true; fi 
    22112215                done 
    2212  
     2216                                trace "needed: $needed_archs arch: $cpu_architecture x86found: $x86found found: $found" 
    22132217                if ! $found; then 
    2214  
    2215                     # arch command is not consistent like ia32.linux != i686 so use uname 
    2216                     locateCommand uname 
    2217                     this_arch=`"$lc_location" -m` 
    2218                     out 
    2219                     out "$intl_UNSUPPORTED_CPU_ARCH" "$needed_archs" "$this_arch" 
    2220                     out 
    2221                     unset this_arch 
    2222                     return 1 
     2218                                        if $x86found && [[ "$cpu_architecture" == "x86_64" ]]; then 
     2219                                                # if we are on x86_64 we are able to run x86 code 
     2220                                                cpu_architecture="x86" 
     2221                                                trace cpu architecture changed to x86 
     2222                                                found=true 
     2223                                        else 
     2224                                # arch command is not consistent like ia32.linux != i686 so use uname 
     2225                                locateCommand uname 
     2226                                this_arch=`"$lc_location" -m` 
     2227                                out 
     2228                                out "$intl_UNSUPPORTED_CPU_ARCH" "$needed_archs" "$this_arch" 
     2229                                out 
     2230                                unset this_arch 
     2231                                return 1 
     2232                            fi 
    22232233                fi 
    22242234 
    22252235                trace passed cpu arch test 
  • share/installer.template

    old new  
    2424 
    2525%ErrorMessage% 
    2626 
    27 # are we on 32bit (or 64bit + compat libs?) 
    28 locateCommand uname 
    29 cpu_architecture=`"$lc_location" -m` 
    30 case "$cpu_architecture" in 
    31         i386 | i486 | i586 | i686 ) 
    32                 export cpu_architecture="x86";; 
    33 esac 
    34  
    35 if [[ "$cpu_architecture" != "x86" ]]; then 
    36         if [ ! -d /usr/lib32 ]; then 
    37                 errorMessage "Sorry, Autopackage only supports x86 32-bit systems, or 64-bit systems with compatibility libraries installed. Please install the compatibility libraries and rerun install." "Error Installing Autopackage" 
    38                 rm -rf "$WORKING_DIRECTORY" 
    39                 exit 1 
    40         fi 
    41 fi 
    42  
    4327# setup XDG configuration variables scoped for autopackage 
    4428# 
    4529#   AUTOPACKAGE_CONFIG_HOME     User configuration directory 
  • share/installer.2.template

    old new  
    2424 
    2525%ErrorMessage% 
    2626 
    27 # are we on 32bit (or 64bit + compat libs?) 
    28 locateCommand uname 
    29 cpu_architecture=`"$lc_location" -m` 
    30 case "$cpu_architecture" in 
    31         i386 | i486 | i586 | i686 ) 
    32                 export cpu_architecture="x86";; 
    33 esac 
    34  
    35 if [[ "$cpu_architecture" != "x86" ]]; then 
    36         if [ ! -d /usr/lib32 ]; then 
    37                 errorMessage "Sorry, Autopackage only supports x86 32-bit systems, or 64-bit systems with compatibility libraries installed. Please install the compatibility libraries and rerun install." "Error Installing Autopackage" 
    38                 rm -rf "$WORKING_DIRECTORY" 
    39                 exit 1 
    40         fi 
    41 fi 
    42  
    4327# setup XDG configuration variables scoped for autopackage 
    4428# 
    4529#   AUTOPACKAGE_CONFIG_HOME     User configuration directory