Changeset 59c9fa4d
- Timestamp:
- 2023-03-08T19:09:13Z (21 months ago)
- Branches:
- master
- Children:
- a4ac9c4
- Parents:
- bea6db0
- git-author:
- Jelmer Vernooij <jelmer@…> (08-03-23 19:09:13)
- git-committer:
- GitHub <noreply@…> (08-03-23 19:09:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
configure
rbea6db0 r59c9fa4d 8 8 ############################## 9 9 10 prefix= "/usr/local/"11 bindir= "$prefix/bin/"12 sbindir= "$prefix/sbin/"13 etcdir= "$prefix/etc/bitlbee/"14 mandir= "$prefix/share/man/"15 datadir= "$prefix/share/bitlbee/"16 config= "/var/lib/bitlbee/"17 libdir= "$prefix/lib/"18 plugindir= "$prefix/lib/bitlbee/"19 includedir= "$prefix/include/bitlbee/"20 systemdsystemunitdir= ""21 sysusersdir= ""22 libevent= "/usr/"23 pidfile= "/var/run/bitlbee.pid"24 ipcsocket= ""25 pcdir= "$prefix/lib/pkgconfig"10 prefix='/usr/local/' 11 bindir='$prefix/bin/' 12 sbindir='$prefix/sbin/' 13 etcdir='$prefix/etc/bitlbee/' 14 mandir='$prefix/share/man/' 15 datadir='$prefix/share/bitlbee/' 16 config='/var/lib/bitlbee/' 17 libdir='$prefix/lib/' 18 plugindir='$prefix/lib/bitlbee/' 19 includedir='$prefix/include/bitlbee/' 20 systemdsystemunitdir='' 21 sysusersdir='' 22 libevent='/usr/' 23 pidfile='/var/run/bitlbee.pid' 24 ipcsocket='' 25 pcdir='$prefix/lib/pkgconfig' 26 26 systemlibdirs="/lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib" 27 sysroot= ""28 29 configure_args="$ *"27 sysroot='' 28 29 configure_args="$@" 30 30 31 31 # Set these to default-on to let it be overriden by either the user or purple … … 78 78 79 79 get_version() { 80 REAL_BITLBEE_VERSION=$(grep '^#define BITLBEE_VERSION ' "$srcdir"/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/')80 REAL_BITLBEE_VERSION=$(grep '^#define BITLBEE_VERSION ' $srcdir/bitlbee.h | sed 's/.*\"\(.*\)\".*/\1/') 81 81 82 82 if [ -n "$BITLBEE_VERSION" ]; then … … 88 88 BITLBEE_VERSION=$REAL_BITLBEE_VERSION 89 89 90 if [ -d "$srcdir"/.git ] && type git > /dev/null 2> /dev/null; then91 timestamp=$(cd "$srcdir" || exit 1; git show -s --format=%ci HEAD | sed 's/ .*$//; s/-//g')92 branch=$(cd "$srcdir" || exit 1; git rev-parse --abbrev-ref HEAD)90 if [ -d $srcdir/.git ] && type git > /dev/null 2> /dev/null; then 91 timestamp=$(cd $srcdir; git show -s --format=%ci HEAD | sed 's/ .*$//; s/-//g') 92 branch=$(cd $srcdir; git rev-parse --abbrev-ref HEAD) 93 93 94 94 search='\(.*\)-\([0-9]*\)-\(g[0-9a-f]*\)' 95 95 replace="\1+$timestamp+$branch+\2-\3-git" 96 96 97 if ! describe=$(cd "$srcdir" || exit 1; git describe --long --tags 2>/dev/null) ; then 98 describe=${REAL_BITLBEE_VERSION}-0-g$(cd "$srcdir" || exit; git rev-parse --short HEAD) 97 describe=$(cd $srcdir; git describe --long --tags 2>/dev/null) 98 if [ $? -ne 0 ]; then 99 describe=${REAL_BITLBEE_VERSION}-0-g$(cd $srcdir; git rev-parse --short HEAD) 99 100 fi 100 101 101 BITLBEE_VERSION=$(echo "$describe"| sed "s#$search#$replace#")102 BITLBEE_VERSION=$(echo $describe | sed "s#$search#$replace#") 102 103 103 104 unset timestamp branch search replace describe … … 106 107 107 108 if [ "$1" = "--dump-version" ]; then 108 srcdir=$(cd "$(dirname "$0")" || exit;pwd)109 srcdir=$(cd $(dirname $0);pwd) 109 110 get_version 110 echo "$BITLBEE_VERSION"111 echo $BITLBEE_VERSION 111 112 exit 112 113 fi … … 216 217 EOF 217 218 218 srcdir=$(cd "$(dirname "$0")" || exit;pwd)219 srcdir=$(cd $(dirname $0);pwd) 219 220 currdir=$(pwd) 220 if [ ! "$srcdir"= "$currdir" ]; then221 if [ "$srcdir" != "$currdir" ]; then 221 222 echo 222 223 echo "configure script run from a different directory. Will create some symlinks..." 223 if [ ! -e Makefile ] || [-L Makefile ]; then224 if [ ! -e Makefile -o -L Makefile ]; then 224 225 COPYDIRS="doc lib protocols tests utils" 225 mkdir -p $(cd "$srcdir" || exit 1; find $COPYDIRS -type d)226 mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d) 226 227 find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null 227 228 dst="$PWD" 228 cd "$srcdir" || exit 1229 f ind . -type f -name Makefile -print | while read -r i; do229 cd "$srcdir" 230 for i in $(find . -name Makefile -type f); do 230 231 ln -s "$PWD${i#.}" "$dst/$i"; 231 232 done 232 cd "$dst" || exit 1233 cd "$dst" 233 234 rm -rf .bzr 234 235 fi … … 272 273 273 274 if [ -z "$PKG_CONFIG_LIBDIR" ]; then 274 PKG_CONFIG_LIBDIR=/usr/ "$target"/lib/pkgconfig275 PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig 275 276 export PKG_CONFIG_LIBDIR 276 277 fi 277 278 278 if [ -d /usr/ "$target"/bin ]; then279 PATH=/usr/ "$target"/bin:$PATH280 fi 281 282 if [ -d /usr/ "$target"/lib ]; then279 if [ -d /usr/$target/bin ]; then 280 PATH=/usr/$target/bin:$PATH 281 fi 282 283 if [ -d /usr/$target/lib ]; then 283 284 systemlibdirs="$systemlibdirs /usr/$target/lib" 284 285 fi … … 326 327 fi 327 328 328 # shellcheck disable=SC2129 329 echo "LDFLAGS=$LDFLAGS" >> Makefile.settings 330 331 echo "CFLAGS=$CFLAGS $CPPFLAGS">> Makefile.settings329 echo LDFLAGS=$LDFLAGS >> Makefile.settings 330 331 echo CFLAGS=$CFLAGS $CPPFLAGS >> Makefile.settings 332 echo CFLAGS+=-I${srcdir} -I${srcdir}/lib -I${srcdir}/protocols -I. >> Makefile.settings 332 333 333 334 echo CFLAGS+=-DHAVE_CONFIG_H -D_GNU_SOURCE >> Makefile.settings 334 335 335 if type gcc > /dev/null 2> /dev/null; then 336 if [ -n "$CC" ]; then 337 CC=$CC 338 elif type gcc > /dev/null 2> /dev/null; then 336 339 CC=gcc 337 340 elif type cc > /dev/null 2> /dev/null; then … … 377 380 else 378 381 echo 379 echo "Found glib2 $($PKG_CONFIG glib-2.0 --modversion), but version $GLIB_MIN_VERSION or newer is required."382 echo 'Found glib2 '$($PKG_CONFIG glib-2.0 --modversion)', but version '$GLIB_MIN_VERSION' or newer is required.' 380 383 exit 1 381 384 fi … … 418 421 echo "EXTERNAL_JSON_PARSER=$external_json_parser" >> Makefile.settings 419 422 if [ "$external_json_parser" = "1" ]; then 420 # shellcheck disable=SC2129421 423 echo "CFLAGS+=$(pkg-config --cflags json-parser)" >> Makefile.settings 422 424 echo "CFLAGS+=-DUSE_EXTERNAL_JSON_PARSER" >> Makefile.settings … … 538 540 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 539 541 ret=1 540 if echo "$RESOLV_TESTCODE" | $CC -o "$TMPFILE" -x c - $LIBRESOLV >/dev/null 2>/dev/null ; then 542 echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null 543 if [ "$?" = "0" ]; then 541 544 echo "EFLAGS+=$LIBRESOLV" >> Makefile.settings 542 545 ret=0 543 546 fi 544 547 545 rm -f "$TMPFILE"548 rm -f $TMPFILE 546 549 return $ret 547 550 } … … 552 555 ret=1 553 556 for i in $systemlibdirs; do 554 if [ -f "$i"/libresolv.a ]; then 555 if echo "$RESOLV_TESTCODE" | $CC -o "$TMPFILE" -x c - -Wl,"$i"/libresolv.a >/dev/null 2>/dev/null ; then 556 echo "EFLAGS+=$i/libresolv.a" >> Makefile.settings 557 if [ -f $i/libresolv.a ]; then 558 echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null 559 if [ "$?" = "0" ]; then 560 echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings 557 561 ret=0 558 562 fi … … 560 564 done 561 565 562 rm -f "$TMPFILE"566 rm -f $TMPFILE 563 567 return $ret 564 568 } … … 575 579 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 576 580 ret=1 577 if echo "$RESOLV_NS_TESTCODE" | $CC -o "$TMPFILE" -x c - $LIBRESOLV >/dev/null 2>/dev/null ; then 581 echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null 582 if [ "$?" = "0" ]; then 578 583 ret=0 579 584 fi 580 585 581 rm -f "$TMPFILE"586 rm -f $TMPFILE 582 587 return $ret 583 588 } … … 588 593 ret=1 589 594 for i in $systemlibdirs; do 590 if [ -f "$i"/libresolv.a ]; then 591 if echo "$RESOLV_NS_TESTCODE" | $CC -o "$TMPFILE" -x c - -Wl,"$i"/libresolv.a >/dev/null 2>/dev/null ; then 595 if [ -f $i/libresolv.a ]; then 596 echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null 597 if [ "$?" = "0" ]; then 592 598 ret=0 593 599 fi … … 595 601 done 596 602 597 rm -f "$TMPFILE"603 rm -f $TMPFILE 598 604 return $ret 599 605 } … … 605 611 # since we aren't actually linking with ns_* routines 606 612 # we can just compile the test code 607 if echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o "$TMPFILE" -x c - >/dev/null 2>/dev/null ; then 613 echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c - >/dev/null 2>/dev/null 614 if [ "$?" = "0" ]; then 608 615 ret=0 609 616 fi 610 617 611 rm -f "$TMPFILE"618 rm -f $TMPFILE 612 619 return $ret 613 620 } … … 617 624 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 618 625 ret=1 619 if echo "$BACKTRACE_TESTCODE" | $CC -o "$TMPFILE" -x c - >/dev/null 2>/dev/null ; then 626 echo "$BACKTRACE_TESTCODE" | $CC -o $TMPFILE -x c - >/dev/null 2>/dev/null 627 if [ "$?" = "0" ]; then 620 628 ret=0 621 629 fi 622 630 623 rm -f "$TMPFILE"631 rm -f $TMPFILE 624 632 return $ret 625 633 } … … 692 700 if detect_backtrace; then 693 701 echo '#define HAVE_BACKTRACE' >> config.h 694 echo "#define CRASHFILE \"${config}crash.log\"">> config.h702 echo '#define CRASHFILE "'$config'crash.log"' >> config.h 695 703 fi 696 704 … … 700 708 STORAGE_OBJS="$STORAGE_OBJS storage_$i.o" 701 709 done 702 echo "STORAGE_OBJS= $STORAGE_OBJS">> Makefile.settings710 echo "STORAGE_OBJS="$STORAGE_OBJS >> Makefile.settings 703 711 704 712 authobjs= 705 713 authlibs= 706 if [ "$pam" = "0"]; then714 if [ "$pam" = 0 ]; then 707 715 echo '#undef WITH_PAM' >> config.h 708 716 else … … 715 723 authlibs=$authlibs'-lpam ' 716 724 fi 717 if [ "$ldap" = "0"]; then725 if [ "$ldap" = 0 ]; then 718 726 echo '#undef WITH_LDAP' >> config.h 719 727 else … … 726 734 authlibs=$authlibs'-lldap ' 727 735 fi 728 echo AUTH_OBJS= "$authobjs">> Makefile.settings729 echo EFLAGS+= "$authlibs">> Makefile.settings730 731 if [ "$strip" = "0"]; then736 echo AUTH_OBJS=$authobjs >> Makefile.settings 737 echo EFLAGS+=$authlibs >> Makefile.settings 738 739 if [ "$strip" = 0 ]; then 732 740 echo "STRIP=\# skip strip" >> Makefile.settings; 733 741 else 734 if [ "$debug" = "1"]; then742 if [ "$debug" = 1 ]; then 735 743 echo 736 744 echo 'Stripping binaries does not make sense when debugging. Stripping disabled.' … … 749 757 fi 750 758 751 if [ ! "$systemd" = "0"]; then759 if [ ! "$systemd" = 0 ]; then 752 760 if ! $PKG_CONFIG --exists systemd ; then 753 761 if [ $systemd -eq 1 ]; then … … 764 772 pkgconf_systemd_var() { 765 773 # First try deprecated variable, use newer variable if not found 766 if $PKG_CONFIG --print-variables systemd | grep -q "$1"; then767 $PKG_CONFIG --variable= "$1"systemd774 if $PKG_CONFIG --print-variables systemd | grep -q $1 ; then 775 $PKG_CONFIG --variable=$1 systemd 768 776 else 769 $PKG_CONFIG --variable= "$2"systemd777 $PKG_CONFIG --variable=$2 systemd 770 778 fi 771 779 } 772 780 773 if [ "$systemd" = "1"]; then781 if [ "$systemd" -eq 1 ]; then 774 782 if [ -z "$systemdsystemunitdir" ]; then 775 783 systemdsystemunitdir=$(pkgconf_systemd_var systemdsystemunitdir systemd_system_unit_dir) … … 792 800 fi 793 801 794 if [ "$plugins" = "0"]; then802 if [ "$plugins" = 0 ]; then 795 803 plugindir="" 796 804 echo '#undef WITH_PLUGINS' >> config.h … … 799 807 fi 800 808 809 otrprefix="" 801 810 if [ "$otr" = "auto" ]; then 802 811 ! $PKG_CONFIG --exists libotr … … 804 813 fi 805 814 806 if [ "$otr" != "0"] && ! $PKG_CONFIG --atleast-version=4.0 --print-errors libotr; then815 if [ "$otr" != 0 ] && ! $PKG_CONFIG --atleast-version=4.0 --print-errors libotr; then 807 816 exit 1 808 817 fi 809 818 810 if [ "$otr" = "1"]; then819 if [ "$otr" = 1 ]; then 811 820 # BI == built-in 812 821 echo '#define OTR_BI' >> config.h 813 # shellcheck disable=SC2129814 822 echo "EFLAGS+=$($PKG_CONFIG --libs libotr) $(libgcrypt-config --libs)" >> Makefile.settings 815 823 echo "CFLAGS+=$($PKG_CONFIG --cflags libotr) $(libgcrypt-config --cflags)" >> Makefile.settings … … 819 827 # the libgcrypt flags aren't needed when building as plugin. add them anyway. 820 828 echo '#define OTR_PI' >> config.h 821 # shellcheck disable=SC2129822 829 echo "OTRFLAGS=$($PKG_CONFIG --libs libotr) $(libgcrypt-config --libs)" >> Makefile.settings 823 830 echo "CFLAGS+=$($PKG_CONFIG --cflags libotr) $(libgcrypt-config --cflags)" >> Makefile.settings … … 836 843 if [ "$doc" = "1" ]; then 837 844 # check this here just in case someone tries to install it in python2.4... 838 if [ ! -e "$srcdir"/doc/user-guide/help.txt ] && ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then845 if [ ! -e $srcdir/doc/user-guide/help.txt ] && ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then 839 846 echo 840 847 echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs' … … 872 879 case "$arch" in 873 880 CYGWIN* ) 874 pkgconfiglibs= "-L${libdir} -lbitlbee -no-undefined"881 pkgconfiglibs='-L${libdir} -lbitlbee -no-undefined' 875 882 esac 876 883 … … 899 906 protoobjs='' 900 907 901 if [ "$purple" = "0"]; then908 if [ "$purple" = 0 ]; then 902 909 echo '#undef WITH_PURPLE' >> config.h 903 910 else … … 933 940 echo CFLAGS+=-MMD -MF .depend/\$@.d >> Makefile.settings 934 941 for i in . lib tests protocols protocols/*/; do 935 mkdir -p "$i"/.depend942 mkdir -p $i/.depend 936 943 done 937 944 esac 938 945 939 if [ "$jabber" = "0"]; then946 if [ "$jabber" = 0 ]; then 940 947 echo '#undef WITH_JABBER' >> config.h 941 948 else … … 945 952 fi 946 953 947 if [ "$twitter" = "0"]; then954 if [ "$twitter" = 0 ]; then 948 955 echo '#undef WITH_TWITTER' >> config.h 949 956 else … … 961 968 echo "PROTOOBJS = $protoobjs" >> Makefile.settings 962 969 963 echo Architecture: "$arch"970 echo Architecture: $arch 964 971 case "$arch" in 965 972 Linux ) … … 1056 1063 1057 1064 if [ -n "$protocols" ]; then 1058 echo ' Building with these protocols:' "$protocols""$protocols_mods"1065 echo ' Building with these protocols:' $protocols$protocols_mods 1059 1066 case "$protocols" in 1060 1067 *purple*)
Note: See TracChangeset
for help on using the changeset viewer.