11AC_PREREQ ( [ 2.60] ) 
2- AC_INIT ( [ libdashbls]  ,[ 1.3.3 ] ) 
2+ AC_INIT ( [ libdashbls]  ,[ 1.3.4 ] ) 
33AC_CONFIG_AUX_DIR ( [ build-aux] ) 
44AC_CONFIG_MACRO_DIR ( [ build-aux/m4] ) 
55
@@ -100,7 +100,7 @@ dnl warning about something unrelated, for example about some path issue. If tha
100100dnl  -Werror cannot be used because all of those warnings would be turned into errors.
101101AX_CHECK_COMPILE_FLAG ( [ -Werror]  , [ FLAG_WERROR="-Werror"]  , [ FLAG_WERROR=""] ) 
102102
103- if [ [ [   "$use_debug" ==  "yes" ||  "$use_optimizations" ==  "no"  ] ] ]  ; then
103+ if test x "$use_debug" = x "yes" -o x "$use_optimizations" = x "no"; then
104104  dnl  Clear default -g -O2 flags
105105  if test x"$CFLAGS_overridden" = x"no"; then
106106    CFLAGS=""
@@ -112,7 +112,7 @@ if [[[ "$use_debug" == "yes" || "$use_optimizations" == "no" ]]]; then
112112  dnl  Disable optimizations
113113  AX_CHECK_COMPILE_FLAG ( [ -O0]  , [ [ DEBUG_FLAGS="$DEBUG_FLAGS -O0"] ]  , [ ]  , [ [ $FLAG_WERROR] ] ) 
114114
115-   if [ [ [   "$use_debug" ==  "yes"  ] ] ]  ; then
115+   if test x "$use_debug" = x "yes"; then
116116    dnl  Prefer -g3, fall back to -g if that is unavailable.
117117    AX_CHECK_COMPILE_FLAG ( 
118118      [ -g3]  ,
@@ -220,7 +220,11 @@ case $host in
220220        GMP_LDFLAGS="-L$gmp_prefix/lib"
221221      fi
222222    fi
223-   ;;
223+     ;;
224+   *freebsd*)
225+     GMP_CPPFLAGS="-I/usr/local/include"
226+     GMP_LDFLAGS="-L/usr/local/lib"
227+     ;;
224228esac
225229
226230if test x"$want_backend" = x"auto"; then
432436
433437use_pkgconfig=yes
434438
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
466482else
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
468500fi
469501
470502case $host in
471503  *darwin*)
472504     AC_DEFINE ( [ OPSYS]  , [ MACOSX]  , [ Detected operation system.] ) 
505+      TARGET_OS=darwin
506+ 
473507     AC_PATH_PROG ( [ BREW]  ,brew ,) 
474508     if test x$BREW = x; then
475509       AC_PATH_PROG ( [ PORT]  ,port ,) 
@@ -482,8 +516,10 @@ case $host in
482516     fi
483517     ;;
484518  *mingw*)
485-      use_pkgconfig=no
486519     AC_DEFINE ( [ OPSYS]  , [ WINDOWS]  , [ Detected operation system.] ) 
520+      TARGET_OS=windows
521+ 
522+      use_pkgconfig=no
487523     LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"
488524
489525     dnl  libtool insists upon adding -nostdlib and a list of objects/libs to link against.
@@ -496,16 +532,21 @@ case $host in
496532     ;;
497533  *linux*)
498534    AC_DEFINE ( [ OPSYS]  , [ LINUX]  , [ Detected operation system.] ) 
535+     TARGET_OS=linux
536+ 
499537    RELIC_CPPFLAGS="-D_GNU_SOURCE"
500538    ;;
501539  *android*)
502540    AC_DEFINE ( [ OPSYS]  , [ DROID]  , [ Detected operation system.] ) 
541+     TARGET_OS=android
503542    ;;
504543  *freebsd*)
505544    AC_DEFINE ( [ OPSYS]  , [ FREEBSD]  , [ Detected operation system.] ) 
545+     TARGET_OS=freebsd
506546    ;;
507547  *netbsd*)
508548    AC_DEFINE ( [ OPSYS]  , [ NETBSD]  , [ Detected operation system.] ) 
549+     TARGET_OS=netbsd
509550    ;;
510551  *)
511552    AC_DEFINE ( [ OPSYS]  , [ RELIC_NONE]  , [ Detected operation system.] ) 
@@ -555,7 +596,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],
555596      CFLAGS="$saved_CFLAGS" 
556597    ]  ) 
557598
558- if [ [ [   "$CFLAGS_overridden" ==  "no" &&  "$CXXFLAGS_overridden" ==  "no"  ] ] ]  ; then
599+ if test x "$CFLAGS_overridden" = x "no" -a x "$CXXFLAGS_overridden" = x "no"; then
559600  dnl  Enable warnings
560601  AX_CHECK_COMPILE_FLAG ( [ -Wall]  ,[ WARN_FLAGS="$WARN_FLAGS -Wall"]  , [ ]  , [ [ $FLAG_WERROR] ] ) 
561602  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"
743784
744785case $host in
745786  *mingw*)
746-      TARGET_OS=windows
747787     AC_CHECK_LIB ( [ user32]  ,   [ main]  ,                    [ ]  , [ AC_MSG_ERROR ( [ libuser32 missing] ) ] ) 
748788     AC_CHECK_LIB ( [ shell32]  ,  [ SHGetSpecialFolderPathW]  , [ ]  , [ AC_MSG_ERROR ( [ libshell32 missing] ) ] ) 
749789     AC_CHECK_LIB ( [ advapi32]  , [ CryptAcquireContextW]  ,    [ ]  , [ AC_MSG_ERROR ( [ libadvapi32 missing] ) ] ) 
@@ -771,15 +811,10 @@ case $host in
771811     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"]  , [ ]  , [ ] ) 
772812     ;;
773813  *darwin*)
774-      TARGET_OS=darwin
775- 
776814     AX_CHECK_LINK_FLAG ( [ -Wl,-headerpad_max_install_names]  , [ CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"]  , [ ]  , [ ] ) 
777815     CORE_CPPFLAGS="$CORE_CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
778816     OBJCXXFLAGS="$CXXFLAGS"
779817     ;;
780-    *linux*)
781-      TARGET_OS=linux
782-      ;;
783818esac
784819
785820dnl  These flags are specific to ld64, and may cause issues with other linkers.
@@ -799,19 +834,15 @@ AC_LANG_POP([C])
799834AC_MSG_CHECKING ( [ whether to build runtest] ) 
800835if test x$use_tests = xyes; then
801836  AC_MSG_RESULT ( [ yes] ) 
802-   BUILD_TEST="yes"
803837else
804838  AC_MSG_RESULT ( [ no] ) 
805-   BUILD_TEST=""
806839fi
807840
808841AC_MSG_CHECKING ( [ whether to build runbench] ) 
809842if test x$use_bench = xyes; then
810843  AC_MSG_RESULT ( [ yes] ) 
811-   BUILD_BENCH="yes"
812844else
813845  AC_MSG_RESULT ( [ no] ) 
814-   BUILD_BENCH=""
815846fi
816847
817848AM_CONDITIONAL([ TARGET_DARWIN]  , [ test "$TARGET_OS" = "darwin"]  )
@@ -836,8 +867,8 @@ AM_CONDITIONAL(WITH_MPC, test 1 -eq 1)
836867AM_CONDITIONAL(WITH_DV, test 1 -eq 1)
837868AM_CONDITIONAL(WITH_FBX, test 1 -eq 1)
838869
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" ]  )
841872AM_CONDITIONAL([ HARDEN]  , [ test "$use_hardening" = "yes"]  )
842873AM_CONDITIONAL([ OPTIMIZE]  , [ test "$use_optimizations" = "yes"]  )
843874
874905echo "Options used to compile and link:"
875906echo "  target os           = $TARGET_OS"
876907echo "  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 "
879910echo "  use debug           = $use_debug"
880911echo "  use hardening       = $use_hardening"
881912echo "  use optimizations   = $use_optimizations"
0 commit comments