Changeset 3fbce97 for configure


Ignore:
Timestamp:
2016-09-24T20:14:34Z (8 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
ba52ac5
Parents:
63cad66 (diff), 82cb190 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into parson

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure

    r63cad66 r3fbce97  
    2424pcdir='$prefix/lib/pkgconfig'
    2525systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib"
     26sysroot=''
     27
     28configure_args="$@"
    2629
    2730# Set these to default-on to let it be overriden by either the user or purple
     
    5356pie=1
    5457
    55 arch=`uname -s`
    56 cpu=`uname -m`
     58arch=$(uname -s)
     59cpu=$(uname -m)
    5760
    5861GLIB_MIN_VERSION=2.16
     
    105108
    106109while [ -n "$1" ]; do
    107         e="`expr "X$1" : 'X--\(.*=.*\)'`"
     110        e="$(expr "X$1" : 'X--\(.*=.*\)')"
    108111        if [ -z "$e" ]; then
    109112                cat<<EOF
     
    153156
    154157--target=...    Cross compilation target                same as host
     158--sysroot=...   Cross compilation sysroot               $sysroot
    155159EOF
    156160                exit;
     
    161165
    162166# Expand $prefix and get rid of double slashes
    163 bindir=`eval echo "$bindir/" | sed 's/\/\{1,\}/\//g'`
    164 sbindir=`eval echo "$sbindir/" | sed 's/\/\{1,\}/\//g'`
    165 etcdir=`eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g'`
    166 mandir=`eval echo "$mandir/" | sed 's/\/\{1,\}/\//g'`
    167 datadir=`eval echo "$datadir/" | sed 's/\/\{1,\}/\//g'`
    168 config=`eval echo "$config/" | sed 's/\/\{1,\}/\//g'`
    169 plugindir=`eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g'`
     167bindir=$(eval echo "$bindir/" | sed 's/\/\{1,\}/\//g')
     168sbindir=$(eval echo "$sbindir/" | sed 's/\/\{1,\}/\//g')
     169etcdir=$(eval echo "$etcdir/" | sed 's/\/\{1,\}/\//g')
     170mandir=$(eval echo "$mandir/" | sed 's/\/\{1,\}/\//g')
     171datadir=$(eval echo "$datadir/" | sed 's/\/\{1,\}/\//g')
     172config=$(eval echo "$config/" | sed 's/\/\{1,\}/\//g')
     173plugindir=$(eval echo "$plugindir/" | sed 's/\/\{1,\}/\//g')
    170174rpcplugindir=$(eval echo "$rpcplugindir/" | sed 's/\/\{1,\}/\//g')
    171 includedir=`eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g'`
    172 libevent=`eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g'`
    173 
    174 pidfile=`eval echo "$pidfile" | sed 's/\/\{1,\}/\//g'`
    175 ipcsocket=`eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g'`
    176 pcdir=`eval echo "$pcdir" | sed 's/\/\{1,\}/\//g'`
     175includedir=$(eval echo "$includedir"/ | sed 's/\/\{1,\}/\//g')
     176libevent=$(eval echo "$libevent"/ | sed 's/\/\{1,\}/\//g')
     177
     178pidfile=$(eval echo "$pidfile" | sed 's/\/\{1,\}/\//g')
     179ipcsocket=$(eval echo "$ipcsocket" | sed 's/\/\{1,\}/\//g')
     180pcdir=$(eval echo "$pcdir" | sed 's/\/\{1,\}/\//g')
    177181
    178182protocols_mods=""
     
    180184cat <<EOF >Makefile.settings
    181185## BitlBee settings, generated by configure
     186
     187# ./configure $configure_args
     188
    182189PREFIX=$prefix
    183190BINDIR=$bindir
     
    233240   of them can/will be overridden at run-time */
    234241
     242#define BITLBEE_CONFIGURE_ARGS "$configure_args"
     243
    235244#define CONFIG "$config"
    236245#define ETCDIR "$etcdir"
     
    247256
    248257if [ -n "$target" ]; then
    249         PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
    250         export PKG_CONFIG_LIBDIR
    251         PATH=/usr/$target/bin:$PATH
     258        # prepend sysroot to system lib dirs
     259
     260        systemlibdirs_cross=''
     261        for i in $systemlibdirs; do
     262                systemlibdirs_cross="$systemlibdirs_cross $sysroot$i"
     263        done
     264        systemlibdirs=$systemlibdirs_cross
     265        unset systemlibdirs_cross
     266
     267        # backward compatibility
     268
     269        if [ -z "$PKG_CONFIG_LIBDIR" ]; then
     270                PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig
     271                export PKG_CONFIG_LIBDIR
     272        fi
     273
     274        if [ -d /usr/$target/bin ]; then
     275                PATH=/usr/$target/bin:$PATH
     276        fi
     277
     278        if [ -d /usr/$target/lib ]; then
     279                systemlibdirs="$systemlibdirs /usr/$target/lib"
     280        fi
     281
    252282        CC=$target-cc
    253283        LD=$target-ld
    254         systemlibdirs="/usr/$target/lib"
     284        STRIP=$target-strip
    255285fi
    256286
     
    321351        if $PKG_CONFIG glib-2.0 --atleast-version=$GLIB_MIN_VERSION; then
    322352                cat<<EOF >>Makefile.settings
    323 EFLAGS+=`$PKG_CONFIG --libs glib-2.0 gmodule-2.0`
    324 CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
     353EFLAGS+=$($PKG_CONFIG --libs glib-2.0 gmodule-2.0)
     354CFLAGS+=$($PKG_CONFIG --cflags glib-2.0 gmodule-2.0)
    325355EOF
    326356        else
    327357                echo
    328                 echo 'Found glib2 '`$PKG_CONFIG glib-2.0 --modversion`', but version '$GLIB_MIN_VERSION' or newer is required.'
     358                echo 'Found glib2 '$($PKG_CONFIG glib-2.0 --modversion)', but version '$GLIB_MIN_VERSION' or newer is required.'
    329359                exit 1
    330360        fi
     
    362392        if $PKG_CONFIG --exists gnutls; then
    363393                cat <<EOF >>Makefile.settings
    364 EFLAGS+=`$PKG_CONFIG --libs gnutls` `libgcrypt-config --libs`
    365 CFLAGS+=`$PKG_CONFIG --cflags gnutls` `libgcrypt-config --cflags`
     394EFLAGS+=$($PKG_CONFIG --libs gnutls) $(libgcrypt-config --libs)
     395CFLAGS+=$($PKG_CONFIG --cflags gnutls) $(libgcrypt-config --cflags)
    366396EOF
    367397                ssl=gnutls
    368                 if ! pkg-config gnutls --atleast-version=2.8; then
     398                if ! $PKG_CONFIG gnutls --atleast-version=2.8; then
    369399                        echo
    370400                        echo 'Warning: With GnuTLS versions <2.8, certificate expire dates are not verified.'
     
    373403        elif libgnutls-config --version > /dev/null 2> /dev/null; then
    374404                cat <<EOF >>Makefile.settings
    375 EFLAGS+=`libgnutls-config --libs` `libgcrypt-config --libs`
    376 CFLAGS+=`libgnutls-config --cflags` `libgcrypt-config --cflags`
     405EFLAGS+=$(libgnutls-config --libs) $(libgcrypt-config --libs)
     406CFLAGS+=$(libgnutls-config --cflags) $(libgcrypt-config --cflags)
    377407EOF
    378408               
     
    388418        if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG nss; then
    389419                cat<<EOF >>Makefile.settings
    390 EFLAGS+=`$PKG_CONFIG --libs nss`
    391 CFLAGS+=`$PKG_CONFIG --cflags nss`
     420EFLAGS+=$($PKG_CONFIG --libs nss)
     421CFLAGS+=$($PKG_CONFIG --cflags nss)
    392422EOF
    393423               
     
    634664if [ -z "$systemdsystemunitdir" ]; then
    635665        if $PKG_CONFIG --exists systemd; then
    636                 systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
     666                systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
    637667        fi
    638668fi
     
    662692
    663693otrprefix=""
    664 for i in / /usr /usr/local; do
    665         if [ -f ${i}/lib/libotr.a ]; then
    666                 otrprefix=${i}
    667                 break
    668         fi
    669 done
    670694if [ "$otr" = "auto" ]; then
    671         if [ -n "$otrprefix" ]; then
    672                 otr=1
    673         else
    674                 otr=0
    675         fi
    676 fi
     695        ! $PKG_CONFIG --exists libotr
     696        otr=$?
     697fi
     698
     699if [ "$otr" != 0 ] && ! $PKG_CONFIG --atleast-version=4.0 --print-errors libotr; then
     700        exit 1
     701fi
     702
    677703if [ "$otr" = 1 ]; then
    678704        # BI == built-in
    679705        echo '#define OTR_BI' >> config.h
    680         echo "EFLAGS+=-L${otrprefix}/lib -lotr -lgcrypt" >> Makefile.settings
    681         echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
     706        echo "EFLAGS+=$($PKG_CONFIG --libs libotr) $(libgcrypt-config --libs)" >> Makefile.settings
     707        echo "CFLAGS+=$($PKG_CONFIG --cflags libotr) $(libgcrypt-config --cflags)" >> Makefile.settings
    682708        echo 'OTR_BI=otr.o' >> Makefile.settings
    683709elif [ "$otr" = "plugin" ]; then
     710        # for some mysterious reason beyond the comprehension of my mortal mind,
     711        # the libgcrypt flags aren't needed when building as plugin. add them anyway.
    684712        echo '#define OTR_PI' >> config.h
    685         echo "OTRFLAGS=-L${otrprefix}/lib -lotr" >> Makefile.settings
    686         echo "CFLAGS+=-I${otrprefix}/include" >> Makefile.settings
     713        echo "OTRFLAGS=$($PKG_CONFIG --libs libotr) $(libgcrypt-config --libs)" >> Makefile.settings
     714        echo "CFLAGS+=$($PKG_CONFIG --cflags libotr) $(libgcrypt-config --cflags)" >> Makefile.settings
    687715        echo 'OTR_PI=otr.so' >> Makefile.settings
    688 fi
    689 if [ "$otr" != 0 ] && ! pkg-config libotr --atleast-version=4.0; then
    690         echo
    691         echo 'WARNING: Your libotr seems to be old. BitlBee now needs at least libotr 4.0.'
    692         # Not hard-failing because the code above doesn't use pkg-config, so who knows
    693         # what's true at this point...
    694716fi
    695717
Note: See TracChangeset for help on using the changeset viewer.