1
1
AC_PREREQ ( [ 2.60] )
2
- AC_INIT ( [ libdashbls] ,[ 1.3.3 ] )
2
+ AC_INIT ( [ libdashbls] ,[ 1.3.4 ] )
3
3
AC_CONFIG_AUX_DIR ( [ build-aux] )
4
4
AC_CONFIG_MACRO_DIR ( [ build-aux/m4] )
5
5
@@ -100,7 +100,7 @@ dnl warning about something unrelated, for example about some path issue. If tha
100
100
dnl -Werror cannot be used because all of those warnings would be turned into errors.
101
101
AX_CHECK_COMPILE_FLAG ( [ -Werror] , [ FLAG_WERROR="-Werror"] , [ FLAG_WERROR=""] )
102
102
103
- if [ [ [ "$use_debug" == "yes" || "$use_optimizations" == "no" ] ] ] ; then
103
+ if test x "$use_debug" = x "yes" -o x "$use_optimizations" = x "no"; then
104
104
dnl Clear default -g -O2 flags
105
105
if test x"$CFLAGS_overridden" = x"no"; then
106
106
CFLAGS=""
@@ -112,7 +112,7 @@ if [[[ "$use_debug" == "yes" || "$use_optimizations" == "no" ]]]; then
112
112
dnl Disable optimizations
113
113
AX_CHECK_COMPILE_FLAG ( [ -O0] , [ [ DEBUG_FLAGS="$DEBUG_FLAGS -O0"] ] , [ ] , [ [ $FLAG_WERROR] ] )
114
114
115
- if [ [ [ "$use_debug" == "yes" ] ] ] ; then
115
+ if test x "$use_debug" = x "yes"; then
116
116
dnl Prefer -g3, fall back to -g if that is unavailable.
117
117
AX_CHECK_COMPILE_FLAG (
118
118
[ -g3] ,
@@ -220,7 +220,11 @@ case $host in
220
220
GMP_LDFLAGS="-L$gmp_prefix/lib"
221
221
fi
222
222
fi
223
- ;;
223
+ ;;
224
+ *freebsd*)
225
+ GMP_CPPFLAGS="-I/usr/local/include"
226
+ GMP_LDFLAGS="-L/usr/local/lib"
227
+ ;;
224
228
esac
225
229
226
230
if test x"$want_backend" = x"auto"; then
432
436
433
437
use_pkgconfig=yes
434
438
435
- if [ [ [ "$host_cpu" == x86_64 && "$use_optimizations" == "yes" ] ] ] ; then
436
- dnl Support for AMD64 (also known as x86_64 on some platforms) processors
437
- CPU_ARCH="x64"
438
- AC_DEFINE ( [ ARCH] , [ X64] , [ Architecture.] )
439
- AC_DEFINE ( [ WSIZE] , [ 64] , [ Size of word in this architecture.] )
440
- elif [ [ [ "$host_cpu" == aarch* && "$use_optimizations" == "yes" ] ] ] ; then
441
- dnl Support for 64-bit ARM processors
442
- dnl Relic doesn't support aarch64 yet, set CPU_ARCH to none and ARCH to RELIC_NONE.
443
- CPU_ARCH="none"
444
- AC_DEFINE ( [ ARCH] , [ RELIC_NONE] , [ Architecture.] )
445
- AC_DEFINE ( [ WSIZE] , [ 64] , [ Size of word in this architecture.] )
446
- elif [ [ [ "$host_cpu" == i?86 && "$use_optimizations" == "yes" ] ] ] ; then
447
- dnl Support for Intel x86 processors
448
- CPU_ARCH="x86"
449
- AC_DEFINE ( [ ARCH] , [ X86] , [ Architecture.] )
450
- AC_DEFINE ( [ WSIZE] , [ 32] , [ Size of word in this architecture.] )
451
- elif [ [ [ "$host_cpu" == arm* && "$use_optimizations" == "yes" ] ] ] ; then
452
- dnl Support for 32-bit native ARM processors
453
- CPU_ARCH="arm"
454
- AC_DEFINE ( [ ARCH] , [ ARM] , [ Architecture.] )
455
- AC_DEFINE ( [ WSIZE] , [ 32] , [ Size of word in this architecture.] )
456
- elif [ [ [ "$host_cpu" == *64* ] ] ] ; then
457
- dnl Support for an undefined 64-bit architecture
458
- CPU_ARCH="none"
459
- AC_DEFINE ( [ ARCH] , [ RELIC_NONE] , [ Architecture.] )
460
- AC_DEFINE ( [ WSIZE] , [ 64] , [ Size of word in this architecture.] )
461
- elif [ [ [ "$host_cpu" == *32* || "$host_cpu" == arm* || "$host_cpu" == i?86 ] ] ] ; then
462
- dnl Support for an undefined 32-bit architecture
463
- CPU_ARCH="none"
464
- AC_DEFINE ( [ ARCH] , [ RELIC_NONE] , [ Architecture.] )
465
- AC_DEFINE ( [ WSIZE] , [ 32] , [ Size of word in this architecture.] )
439
+ if test x"$use_optimizations" = x"yes"; then
440
+ case $host_cpu in
441
+ amd64 | x86_64)
442
+ dnl Support for AMD64 (also known as x86_64 on some platforms) processors
443
+ CPU_ARCH="x64"
444
+ AC_DEFINE ( [ ARCH] , [ X64] , [ Architecture.] )
445
+ AC_DEFINE ( [ WSIZE] , [ 64] , [ Size of word in this architecture.] )
446
+ ;;
447
+ aarch*)
448
+ dnl Support for 64-bit ARM processors
449
+ dnl Relic does not support aarch64 yet, set CPU_ARCH to none and ARCH to RELIC_NONE.
450
+ CPU_ARCH="none"
451
+ AC_DEFINE ( [ ARCH] , [ RELIC_NONE] , [ Architecture.] )
452
+ AC_DEFINE ( [ WSIZE] , [ 64] , [ Size of word in this architecture.] )
453
+ ;;
454
+ i?86)
455
+ dnl Support for Intel x86 processors
456
+ CPU_ARCH="x86"
457
+ AC_DEFINE ( [ ARCH] , [ X86] , [ Architecture.] )
458
+ AC_DEFINE ( [ WSIZE] , [ 32] , [ Size of word in this architecture.] )
459
+ ;;
460
+ arm*)
461
+ dnl Support for 32-bit native ARM processors
462
+ CPU_ARCH="arm"
463
+ AC_DEFINE ( [ ARCH] , [ ARM] , [ Architecture.] )
464
+ AC_DEFINE ( [ WSIZE] , [ 32] , [ Size of word in this architecture.] )
465
+ ;;
466
+ *64*)
467
+ dnl Support for an undefined 64-bit architecture
468
+ CPU_ARCH="none"
469
+ AC_DEFINE ( [ ARCH] , [ RELIC_NONE] , [ Architecture.] )
470
+ AC_DEFINE ( [ WSIZE] , [ 64] , [ Size of word in this architecture.] )
471
+ ;;
472
+ *32*)
473
+ dnl Support for an undefined 32-bit architecture
474
+ CPU_ARCH="none"
475
+ AC_DEFINE ( [ ARCH] , [ RELIC_NONE] , [ Architecture.] )
476
+ AC_DEFINE ( [ WSIZE] , [ 32] , [ Size of word in this architecture.] )
477
+ ;;
478
+ *)
479
+ AC_MSG_ERROR ( [ Unable to determine host architecture, may not be supported!] )
480
+ ;;
481
+ esac
466
482
else
467
- AC_MSG_ERROR ( [ Unable to determine host architecture, may not be supported!] )
483
+ case $host_cpu in
484
+ *64*)
485
+ dnl Support for an undefined 64-bit architecture
486
+ CPU_ARCH="none"
487
+ AC_DEFINE ( [ ARCH] , [ RELIC_NONE] , [ Architecture.] )
488
+ AC_DEFINE ( [ WSIZE] , [ 64] , [ Size of word in this architecture.] )
489
+ ;;
490
+ *32* | arm* | i?86)
491
+ dnl Support for an undefined 32-bit architecture
492
+ CPU_ARCH="none"
493
+ AC_DEFINE ( [ ARCH] , [ RELIC_NONE] , [ Architecture.] )
494
+ AC_DEFINE ( [ WSIZE] , [ 32] , [ Size of word in this architecture.] )
495
+ ;;
496
+ *)
497
+ AC_MSG_ERROR ( [ Unable to determine host architecture, may not be supported!] )
498
+ ;;
499
+ esac
468
500
fi
469
501
470
502
case $host in
471
503
*darwin*)
472
504
AC_DEFINE ( [ OPSYS] , [ MACOSX] , [ Detected operation system.] )
505
+ TARGET_OS=darwin
506
+
473
507
AC_PATH_PROG ( [ BREW] ,brew ,)
474
508
if test x$BREW = x; then
475
509
AC_PATH_PROG ( [ PORT] ,port ,)
@@ -482,8 +516,10 @@ case $host in
482
516
fi
483
517
;;
484
518
*mingw*)
485
- use_pkgconfig=no
486
519
AC_DEFINE ( [ OPSYS] , [ WINDOWS] , [ Detected operation system.] )
520
+ TARGET_OS=windows
521
+
522
+ use_pkgconfig=no
487
523
LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"
488
524
489
525
dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.
@@ -496,16 +532,21 @@ case $host in
496
532
;;
497
533
*linux*)
498
534
AC_DEFINE ( [ OPSYS] , [ LINUX] , [ Detected operation system.] )
535
+ TARGET_OS=linux
536
+
499
537
RELIC_CPPFLAGS="-D_GNU_SOURCE"
500
538
;;
501
539
*android*)
502
540
AC_DEFINE ( [ OPSYS] , [ DROID] , [ Detected operation system.] )
541
+ TARGET_OS=android
503
542
;;
504
543
*freebsd*)
505
544
AC_DEFINE ( [ OPSYS] , [ FREEBSD] , [ Detected operation system.] )
545
+ TARGET_OS=freebsd
506
546
;;
507
547
*netbsd*)
508
548
AC_DEFINE ( [ OPSYS] , [ NETBSD] , [ Detected operation system.] )
549
+ TARGET_OS=netbsd
509
550
;;
510
551
*)
511
552
AC_DEFINE ( [ OPSYS] , [ RELIC_NONE] , [ Detected operation system.] )
@@ -555,7 +596,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
555
596
CFLAGS="$saved_CFLAGS"
556
597
] )
557
598
558
- if [ [ [ "$CFLAGS_overridden" == "no" && "$CXXFLAGS_overridden" == "no" ] ] ] ; then
599
+ if test x "$CFLAGS_overridden" = x "no" -a x "$CXXFLAGS_overridden" = x "no"; then
559
600
dnl Enable warnings
560
601
AX_CHECK_COMPILE_FLAG ( [ -Wall] ,[ WARN_FLAGS="$WARN_FLAGS -Wall"] , [ ] , [ [ $FLAG_WERROR] ] )
561
602
AX_CHECK_COMPILE_FLAG ( [ -Wcast-align] ,[ WARN_FLAGS="$WARN_FLAGS -Wcast-align"] , [ ] , [ [ $FLAG_WERROR] ] )
@@ -743,7 +784,6 @@ CORE_CPPFLAGS="$CORE_CPPFLAGS -DHAVE_BUILD_INFO"
743
784
744
785
case $host in
745
786
*mingw*)
746
- TARGET_OS=windows
747
787
AC_CHECK_LIB ( [ user32] , [ main] , [ ] , [ AC_MSG_ERROR ( [ libuser32 missing] ) ] )
748
788
AC_CHECK_LIB ( [ shell32] , [ SHGetSpecialFolderPathW] , [ ] , [ AC_MSG_ERROR ( [ libshell32 missing] ) ] )
749
789
AC_CHECK_LIB ( [ advapi32] , [ CryptAcquireContextW] , [ ] , [ AC_MSG_ERROR ( [ libadvapi32 missing] ) ] )
@@ -771,15 +811,10 @@ case $host in
771
811
AX_CHECK_LINK_FLAG ( [ -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1] , [ CORE_LDFLAGS="$CORE_LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"] , [ ] , [ ] )
772
812
;;
773
813
*darwin*)
774
- TARGET_OS=darwin
775
-
776
814
AX_CHECK_LINK_FLAG ( [ -Wl,-headerpad_max_install_names] , [ CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"] , [ ] , [ ] )
777
815
CORE_CPPFLAGS="$CORE_CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
778
816
OBJCXXFLAGS="$CXXFLAGS"
779
817
;;
780
- *linux*)
781
- TARGET_OS=linux
782
- ;;
783
818
esac
784
819
785
820
dnl These flags are specific to ld64, and may cause issues with other linkers.
@@ -799,19 +834,15 @@ AC_LANG_POP([C])
799
834
AC_MSG_CHECKING ( [ whether to build runtest] )
800
835
if test x$use_tests = xyes; then
801
836
AC_MSG_RESULT ( [ yes] )
802
- BUILD_TEST="yes"
803
837
else
804
838
AC_MSG_RESULT ( [ no] )
805
- BUILD_TEST=""
806
839
fi
807
840
808
841
AC_MSG_CHECKING ( [ whether to build runbench] )
809
842
if test x$use_bench = xyes; then
810
843
AC_MSG_RESULT ( [ yes] )
811
- BUILD_BENCH="yes"
812
844
else
813
845
AC_MSG_RESULT ( [ no] )
814
- BUILD_BENCH=""
815
846
fi
816
847
817
848
AM_CONDITIONAL([ TARGET_DARWIN] , [ test "$TARGET_OS" = "darwin"] )
@@ -836,8 +867,8 @@ AM_CONDITIONAL(WITH_MPC, test 1 -eq 1)
836
867
AM_CONDITIONAL(WITH_DV, test 1 -eq 1)
837
868
AM_CONDITIONAL(WITH_FBX, test 1 -eq 1)
838
869
839
- AM_CONDITIONAL([ USE_TESTS] , [ test x$BUILD_TEST = xyes ] )
840
- AM_CONDITIONAL([ USE_BENCH] , [ test x$BUILD_BENCH = xyes ] )
870
+ AM_CONDITIONAL([ USE_TESTS] , [ test x"$use_tests" = x"yes" ] )
871
+ AM_CONDITIONAL([ USE_BENCH] , [ test x"$use_bench" = x"yes" ] )
841
872
AM_CONDITIONAL([ HARDEN] , [ test "$use_hardening" = "yes"] )
842
873
AM_CONDITIONAL([ OPTIMIZE] , [ test "$use_optimizations" = "yes"] )
843
874
874
905
echo "Options used to compile and link:"
875
906
echo " target os = $TARGET_OS"
876
907
echo " backend = $want_backend"
877
- echo " build bench = $BUILD_BENCH "
878
- echo " build test = $BUILD_TEST "
908
+ echo " build bench = $use_tests "
909
+ echo " build test = $use_bench "
879
910
echo " use debug = $use_debug"
880
911
echo " use hardening = $use_hardening"
881
912
echo " use optimizations = $use_optimizations"
0 commit comments