Changeset 2bd8f39
- Timestamp:
- 2023-01-30T19:27:28Z (21 months ago)
- Branches:
- master
- Children:
- b6df23d
- Parents:
- 8ca172f
- git-author:
- David Cantrell <dcantrell@…> (30-01-23 19:27:28)
- git-committer:
- GitHub <noreply@…> (30-01-23 19:27:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
configure
r8ca172f r2bd8f39 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; git show -s --format=%ci HEAD | sed 's/ .*$//; s/-//g')92 branch=$(cd $srcdir; git rev-parse --abbrev-ref HEAD)90 if [ -d "$srcdir"/.git ] && type git > /dev/null 2> /dev/null; then 91 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) 93 93 94 94 search='\(.*\)-\([0-9]*\)-\(g[0-9a-f]*\)' 95 95 replace="\1+$timestamp+$branch+\2-\3-git" 96 96 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) 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) 100 99 fi 101 100 102 BITLBEE_VERSION=$(echo $describe| sed "s#$search#$replace#")101 BITLBEE_VERSION=$(echo "$describe" | sed "s#$search#$replace#") 103 102 104 103 unset timestamp branch search replace describe … … 107 106 108 107 if [ "$1" = "--dump-version" ]; then 109 srcdir=$(cd $(dirname $0);pwd)108 srcdir=$(cd "$(dirname "$0")" || exit;pwd) 110 109 get_version 111 echo $BITLBEE_VERSION110 echo "$BITLBEE_VERSION" 112 111 exit 113 112 fi … … 217 216 EOF 218 217 219 srcdir=$(cd $(dirname $0);pwd)218 srcdir=$(cd "$(dirname "$0")" || exit;pwd) 220 219 currdir=$(pwd) 221 if [ "$srcdir" != "$currdir" ]; then220 if [ ! "$srcdir" = "$currdir" ]; then 222 221 echo 223 222 echo "configure script run from a different directory. Will create some symlinks..." 224 if [ ! -e Makefile -o-L Makefile ]; then223 if [ ! -e Makefile ] || [ -L Makefile ]; then 225 224 COPYDIRS="doc lib protocols tests utils" 226 mkdir -p $(cd "$srcdir"; find $COPYDIRS -type d)225 mkdir -p "$(cd "$srcdir" || exit 1; find "$COPYDIRS" -type d)" 227 226 find . -name Makefile -type l -print0 | xargs -0 rm 2> /dev/null 228 227 dst="$PWD" 229 cd "$srcdir" 230 f or i in $(find . -name Makefile -type f); do228 cd "$srcdir" || exit 1 229 find . -type f -name Makefile -print | while read -r i ; do 231 230 ln -s "$PWD${i#.}" "$dst/$i"; 232 231 done 233 cd "$dst" 232 cd "$dst" || exit 1 234 233 rm -rf .bzr 235 234 fi … … 273 272 274 273 if [ -z "$PKG_CONFIG_LIBDIR" ]; then 275 PKG_CONFIG_LIBDIR=/usr/ $target/lib/pkgconfig274 PKG_CONFIG_LIBDIR=/usr/"$target"/lib/pkgconfig 276 275 export PKG_CONFIG_LIBDIR 277 276 fi 278 277 279 if [ -d /usr/ $target/bin ]; then280 PATH=/usr/ $target/bin:$PATH281 fi 282 283 if [ -d /usr/ $target/lib ]; then278 if [ -d /usr/"$target"/bin ]; then 279 PATH=/usr/"$target"/bin:$PATH 280 fi 281 282 if [ -d /usr/"$target"/lib ]; then 284 283 systemlibdirs="$systemlibdirs /usr/$target/lib" 285 284 fi … … 327 326 fi 328 327 329 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 328 # shellcheck disable=SC2129 329 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 333 333 334 334 echo CFLAGS+=-DHAVE_CONFIG_H -D_GNU_SOURCE >> Makefile.settings 335 335 336 if [ -n "$CC" ]; then 337 CC=$CC 338 elif type gcc > /dev/null 2> /dev/null; then 336 if type gcc > /dev/null 2> /dev/null; then 339 337 CC=gcc 340 338 elif type cc > /dev/null 2> /dev/null; then … … 380 378 else 381 379 echo 382 echo 'Found glib2 '$($PKG_CONFIG glib-2.0 --modversion)', but version '$GLIB_MIN_VERSION' or newer is required.'380 echo "Found glib2 $($PKG_CONFIG glib-2.0 --modversion), but version $GLIB_MIN_VERSION or newer is required." 383 381 exit 1 384 382 fi … … 421 419 echo "EXTERNAL_JSON_PARSER=$external_json_parser" >> Makefile.settings 422 420 if [ "$external_json_parser" = "1" ]; then 421 # shellcheck disable=SC2129 423 422 echo "CFLAGS+=$(pkg-config --cflags json-parser)" >> Makefile.settings 424 423 echo "LDFLAGS_BITLBEE+=$(pkg-config --libs json-parser)" >> Makefile.settings … … 538 537 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 539 538 ret=1 540 echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null 541 if [ "$?" = "0" ]; then 539 if echo "$RESOLV_TESTCODE" | $CC -o "$TMPFILE" -x c - $LIBRESOLV >/dev/null 2>/dev/null ; then 542 540 echo "EFLAGS+=$LIBRESOLV" >> Makefile.settings 543 541 ret=0 544 542 fi 545 543 546 rm -f $TMPFILE544 rm -f "$TMPFILE" 547 545 return $ret 548 546 } … … 553 551 ret=1 554 552 for i in $systemlibdirs; do 555 if [ -f $i/libresolv.a ]; then 556 echo "$RESOLV_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null 557 if [ "$?" = "0" ]; then 558 echo 'EFLAGS+='$i'/libresolv.a' >> Makefile.settings 553 if [ -f "$i"/libresolv.a ]; then 554 if echo "$RESOLV_TESTCODE" | $CC -o "$TMPFILE" -x c - -Wl,"$i"/libresolv.a >/dev/null 2>/dev/null ; then 555 echo "EFLAGS+=$i/libresolv.a" >> Makefile.settings 559 556 ret=0 560 557 fi … … 562 559 done 563 560 564 rm -f $TMPFILE561 rm -f "$TMPFILE" 565 562 return $ret 566 563 } … … 577 574 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 578 575 ret=1 579 echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - $LIBRESOLV >/dev/null 2>/dev/null 580 if [ "$?" = "0" ]; then 576 if echo "$RESOLV_NS_TESTCODE" | $CC -o "$TMPFILE" -x c - $LIBRESOLV >/dev/null 2>/dev/null ; then 581 577 ret=0 582 578 fi 583 579 584 rm -f $TMPFILE580 rm -f "$TMPFILE" 585 581 return $ret 586 582 } … … 591 587 ret=1 592 588 for i in $systemlibdirs; do 593 if [ -f $i/libresolv.a ]; then 594 echo "$RESOLV_NS_TESTCODE" | $CC -o $TMPFILE -x c - -Wl,$i/libresolv.a >/dev/null 2>/dev/null 595 if [ "$?" = "0" ]; then 589 if [ -f "$i"/libresolv.a ]; then 590 if echo "$RESOLV_NS_TESTCODE" | $CC -o "$TMPFILE" -x c - -Wl,"$i"/libresolv.a >/dev/null 2>/dev/null ; then 596 591 ret=0 597 592 fi … … 599 594 done 600 595 601 rm -f $TMPFILE596 rm -f "$TMPFILE" 602 597 return $ret 603 598 } … … 609 604 # since we aren't actually linking with ns_* routines 610 605 # we can just compile the test code 611 echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o $TMPFILE -x c - >/dev/null 2>/dev/null 612 if [ "$?" = "0" ]; then 606 if echo "$RESOLV_NS_TYPES_TESTCODE" | $CC -o "$TMPFILE" -x c - >/dev/null 2>/dev/null ; then 613 607 ret=0 614 608 fi 615 609 616 rm -f $TMPFILE610 rm -f "$TMPFILE" 617 611 return $ret 618 612 } … … 622 616 TMPFILE=$(mktemp /tmp/bitlbee-configure.XXXXXX) 623 617 ret=1 624 echo "$BACKTRACE_TESTCODE" | $CC -o $TMPFILE -x c - >/dev/null 2>/dev/null 625 if [ "$?" = "0" ]; then 618 if echo "$BACKTRACE_TESTCODE" | $CC -o "$TMPFILE" -x c - >/dev/null 2>/dev/null ; then 626 619 ret=0 627 620 fi 628 621 629 rm -f $TMPFILE622 rm -f "$TMPFILE" 630 623 return $ret 631 624 } … … 698 691 if detect_backtrace; then 699 692 echo '#define HAVE_BACKTRACE' >> config.h 700 echo '#define CRASHFILE "'$config'crash.log"'>> config.h693 echo "#define CRASHFILE \"${config}crash.log\"" >> config.h 701 694 fi 702 695 … … 706 699 STORAGE_OBJS="$STORAGE_OBJS storage_$i.o" 707 700 done 708 echo "STORAGE_OBJS= "$STORAGE_OBJS>> Makefile.settings701 echo "STORAGE_OBJS=$STORAGE_OBJS" >> Makefile.settings 709 702 710 703 authobjs= 711 704 authlibs= 712 if [ "$pam" = 0]; then705 if [ "$pam" = "0" ]; then 713 706 echo '#undef WITH_PAM' >> config.h 714 707 else … … 721 714 authlibs=$authlibs'-lpam ' 722 715 fi 723 if [ "$ldap" = 0]; then716 if [ "$ldap" = "0" ]; then 724 717 echo '#undef WITH_LDAP' >> config.h 725 718 else … … 732 725 authlibs=$authlibs'-lldap ' 733 726 fi 734 echo AUTH_OBJS= $authobjs>> Makefile.settings735 echo EFLAGS+= $authlibs>> Makefile.settings736 737 if [ "$strip" = 0]; then727 echo AUTH_OBJS="$authobjs" >> Makefile.settings 728 echo EFLAGS+="$authlibs" >> Makefile.settings 729 730 if [ "$strip" = "0" ]; then 738 731 echo "STRIP=\# skip strip" >> Makefile.settings; 739 732 else 740 if [ "$debug" = 1]; then733 if [ "$debug" = "1" ]; then 741 734 echo 742 735 echo 'Stripping binaries does not make sense when debugging. Stripping disabled.' … … 755 748 fi 756 749 757 if [ ! "$systemd" = 0]; then750 if [ ! "$systemd" = "0" ]; then 758 751 if ! $PKG_CONFIG --exists systemd ; then 759 if [ -n "$systemdsystemunitdir" ] || [ "$systemd"-eq 1 ]; then752 if [ -n "$systemdsystemunitdir" ] || [ $systemd -eq 1 ]; then 760 753 echo "systemd requested but not found" 761 754 exit 1 … … 768 761 pkgconf_systemd_var() { 769 762 # First try deprecated variable, use newer variable if not found 770 if $PKG_CONFIG --print-variables systemd | grep -q $1; then771 $PKG_CONFIG --variable= $1systemd763 if $PKG_CONFIG --print-variables systemd | grep -q "$1" ; then 764 $PKG_CONFIG --variable="$1" systemd 772 765 else 773 $PKG_CONFIG --variable= $2systemd766 $PKG_CONFIG --variable="$2" systemd 774 767 fi 775 768 } 776 769 777 if [ "$systemd" -eq 1]; then770 if [ "$systemd" = "1" ]; then 778 771 if [ -z "$systemdsystemunitdir" ]; then 779 772 systemdsystemunitdir=$(pkgconf_systemd_var systemdsystemunitdir systemd_system_unit_dir) 780 773 fi 781 if [ -z "$tmpfiles_dir" ] ; then782 tmpfilesdir=$(pkgconf_systemd_var tmpfilesdir tmpfiles_dir)783 fi784 774 if [ -z "$sysusersdir" ] ; then 785 775 sysusersdir=$(pkgconf_systemd_var sysusersdir sysusers_dir) … … 795 785 fi 796 786 797 if [ "$plugins" = 0]; then787 if [ "$plugins" = "0" ]; then 798 788 plugindir="" 799 789 echo '#undef WITH_PLUGINS' >> config.h … … 802 792 fi 803 793 804 otrprefix=""805 794 if [ "$otr" = "auto" ]; then 806 795 ! $PKG_CONFIG --exists libotr … … 808 797 fi 809 798 810 if [ "$otr" != 0] && ! $PKG_CONFIG --atleast-version=4.0 --print-errors libotr; then799 if [ "$otr" != "0" ] && ! $PKG_CONFIG --atleast-version=4.0 --print-errors libotr; then 811 800 exit 1 812 801 fi 813 802 814 if [ "$otr" = 1]; then803 if [ "$otr" = "1" ]; then 815 804 # BI == built-in 816 805 echo '#define OTR_BI' >> config.h 806 # shellcheck disable=SC2129 817 807 echo "EFLAGS+=$($PKG_CONFIG --libs libotr) $(libgcrypt-config --libs)" >> Makefile.settings 818 808 echo "CFLAGS+=$($PKG_CONFIG --cflags libotr) $(libgcrypt-config --cflags)" >> Makefile.settings … … 822 812 # the libgcrypt flags aren't needed when building as plugin. add them anyway. 823 813 echo '#define OTR_PI' >> config.h 814 # shellcheck disable=SC2129 824 815 echo "OTRFLAGS=$($PKG_CONFIG --libs libotr) $(libgcrypt-config --libs)" >> Makefile.settings 825 816 echo "CFLAGS+=$($PKG_CONFIG --cflags libotr) $(libgcrypt-config --cflags)" >> Makefile.settings … … 838 829 if [ "$doc" = "1" ]; then 839 830 # check this here just in case someone tries to install it in python2.4... 840 if [ ! -e $srcdir/doc/user-guide/help.txt ] && ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then831 if [ ! -e "$srcdir"/doc/user-guide/help.txt ] && ! $PYTHON -m xml.etree.ElementTree > /dev/null 2>&1; then 841 832 echo 842 833 echo 'ERROR: Python (>=2.5 or 3.x) is required to generate docs' … … 850 841 get_version 851 842 852 if [ "$BITLBEE_VERSION" != "$REAL_BITLBEE_VERSION" ]; then853 echo 'Spoofing version number: '$BITLBEE_VERSION854 echo '#undef BITLBEE_VERSION'>> config.h855 echo '#define BITLBEE_VERSION "'$BITLBEE_VERSION'"'>> config.h843 if [ ! "$BITLBEE_VERSION" = "$REAL_BITLBEE_VERSION" ]; then 844 echo "Spoofing version number: $BITLBEE_VERSION" 845 echo "#undef BITLBEE_VERSION" >> config.h 846 echo "#define BITLBEE_VERSION '$BITLBEE_VERSION'" >> config.h 856 847 echo 857 848 fi … … 874 865 case "$arch" in 875 866 CYGWIN* ) 876 pkgconfiglibs= '-L${libdir} -lbitlbee -no-undefined'867 pkgconfiglibs="-L${libdir} -lbitlbee -no-undefined" 877 868 esac 878 869 … … 896 887 protoobjs='' 897 888 898 if [ "$purple" = 0]; then889 if [ "$purple" = "0" ]; then 899 890 echo '#undef WITH_PURPLE' >> config.h 900 891 else … … 930 921 echo CFLAGS+=-MMD -MF .depend/\$@.d >> Makefile.settings 931 922 for i in . lib tests protocols protocols/*/; do 932 mkdir -p $i/.depend923 mkdir -p "$i"/.depend 933 924 done 934 925 esac 935 926 936 if [ "$jabber" = 0]; then927 if [ "$jabber" = "0" ]; then 937 928 echo '#undef WITH_JABBER' >> config.h 938 929 else … … 942 933 fi 943 934 944 if [ "$twitter" = 0]; then935 if [ "$twitter" = "0" ]; then 945 936 echo '#undef WITH_TWITTER' >> config.h 946 937 else … … 958 949 echo "PROTOOBJS = $protoobjs" >> Makefile.settings 959 950 960 echo Architecture: $arch951 echo Architecture: "$arch" 961 952 case "$arch" in 962 953 Linux ) … … 1034 1025 fi 1035 1026 1036 if [ "$systemd" -eq 1]; then1027 if [ "$systemd" = "1" ]; then 1037 1028 echo ' systemd enabled.' 1038 1029 else … … 1053 1044 1054 1045 if [ -n "$protocols" ]; then 1055 echo ' Building with these protocols:' $protocols$protocols_mods1046 echo ' Building with these protocols:' "$protocols""$protocols_mods" 1056 1047 case "$protocols" in 1057 1048 *purple*)
Note: See TracChangeset
for help on using the changeset viewer.