1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021
|
Description: Fix configuration file to work with latest autoconf
This patch fixes several elements in the configuration files that are either
obsolete or do not work with the latest autoconf version in Debian unstable.
- configure.ac: Some headers have been removed and others replaced.
- aclocal.m4: The aclocal from the latest upstream version (4.5.1) is used
- Makefile.in, samhain.spec.in, src/sh_getopt.c: Do not use VERSION as this is
not the correct value to use, use PACKAGE_VERSION instead
- compile: Add the file as it is required by autoconf
Author: Javier Fernández-Sanguino Peña <jfs@debian.org>
Forwarded: no
Last-Update: 2024-10-05
@@ -1,9 +1,9 @@
-dnl We want to override the standard _AC_INIT_PARSE_ARGS
+dnl We want to override the standard _AC_INIT_help
dnl
-AU_ALIAS([_AC_INIT_PARSE_ARGS], [SH_INIT_PARSE_ARGS])
AU_ALIAS([_AC_INIT_help], [SH_INIT_HELP])
-AC_INIT(src/samhain.c)
+AC_INIT([samhain], [4.1.4])
+AC_CONFIG_SRCDIR([src/samhain.c])
AC_ARG_VAR([LIBS], [libraries to link against, e.g. -lintl])
@@ -11,8 +11,7 @@
dnl
dnl start
dnl
-AM_INIT_AUTOMAKE(samhain, 4.1.4)
-AC_DEFINE([SAMHAIN], 1, [Application is samhain])
+AC_DEFINE([SAMHAIN], [1], [Application is samhain])
AC_CANONICAL_HOST
dnl
@@ -38,8 +37,6 @@
SH_GCC_VERSION
fi
-AC_HEADER_STDC
-
AC_CHECK_HEADERS([sys/ipc.h sys/sem.h sys/msg.h sys/uio.h fcntl.h])
@@ -237,11 +234,18 @@
AC_HEADER_DIRENT
AC_HEADER_MAJOR
AC_HEADER_TIME
+AC_CHECK_HEADERS([sys/time.h])
dnl used in minilzo.c
AC_HEADER_STAT
-AC_DECL_SYS_SIGLIST
+AC_CHECK_DECLS([sys_siglist],[],[],[#include <signal.h>
+/* NetBSD declares sys_siglist in unistd.h. */
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+])
+
-AC_CHECK_HEADERS(stddef.h libgen.h sched.h malloc.h sys/uio.h \
+AC_CHECK_HEADERS([stddef.h libgen.h sched.h malloc.h sys/uio.h \
sys/mman.h sys/param.h sys/inotify.h \
sys/vfs.h mntent.h \
sys/select.h sys/socket.h netinet/in.h \
@@ -249,7 +253,7 @@
linux/ext2_fs.h linux/fs.h ext2fs/ext2_fs.h asm/segment.h \
elf.h linux/elf.h auparse.h \
paths.h arpa/nameser.h arpa/nameser_compat.h \
- rpc/rpcent.h rpc/rpc.h sys/statvfs.h,
+ rpc/rpcent.h rpc/rpc.h sys/statvfs.h],
[],
[],
[#include <sys/types.h>]
@@ -281,69 +285,54 @@
dnl License as published by the Free Software Foundation; either version
dnl 2, or (at your option) any later version.
dnl
-AC_CHECK_HEADER(sys/acct.h,
- AC_DEFINE(HAVE_SYS_ACCT_H, ,
- [Define if you have the <sys/acct.h> header file.])
- AC_HEADER_EGREP(ac_utime, sys/acct.h,
- AC_DEFINE(HAVE_ACUTIME, ,
- [Define if <sys/acct.h> has the AC_UTIME field.])
- AC_HEADER_EGREP(comp_t.*ac_utime, sys/acct.h,
- AC_DEFINE(ACUTIME_COMPT, ,
- [Define if <sys/acct.h>'s AC_UTIME field is a COMP_T.]))
+AC_CHECK_HEADER([sys/acct.h],
+ AC_DEFINE(HAVE_SYS_ACCT_H, ,[Define if you have the <sys/acct.h> header file.])
+ DUMP_ACCT_PROG=dump-acct
+ ACCTON_PROG=accton
+ LASTCOMM_PROG=lastcomm
+ SA_PROG=sa
+ ACCTON_MAN=accton.8
+ LASTCOMM_MAN=lastcomm.1
+ SA_MAN=sa.8
+ AC_EGREP_HEADER(ac_utime, sys/acct.h,
+ AC_DEFINE(HAVE_ACUTIME, 1, [Define if <sys/acct.h> has the AC_UTIME field.])
+ AC_EGREP_HEADER(comp_t.*ac_utime, sys/acct.h,AC_DEFINE(ACUTIME_COMPT, 1, [Define if <sys/acct.h> AC_UTIME field is a COMP_T.]))
)
- AC_HEADER_EGREP(ac_stime, sys/acct.h,
- AC_DEFINE(HAVE_ACSTIME, ,
- [Define if <sys/acct.h> has the AC_STIME field.])
- AC_HEADER_EGREP(comp_t.*ac_stime, sys/acct.h,
- AC_DEFINE(ACSTIME_COMPT, ,
- [Define if <sys/acct.h>'s AC_STIME field is a COMP_T.]))
+ AC_EGREP_HEADER(ac_stime, sys/acct.h,
+ AC_DEFINE(HAVE_ACSTIME, 1, [Define if <sys/acct.h> has the AC_STIME field.])
+ AC_EGREP_HEADER(comp_t.*ac_stime, sys/acct.h,
+ AC_DEFINE(ACSTIME_COMPT, 1, [Define if <sys/acct.h> AC_STIME field is a COMP_T.]))
)
- AC_HEADER_EGREP(ac_etime, sys/acct.h,
- AC_DEFINE(HAVE_ACETIME, ,
- [Define if <sys/acct.h> has the AC_ETIME field.])
- AC_HEADER_EGREP(comp_t.*ac_etime, sys/acct.h,
- AC_DEFINE(ACETIME_COMPT, ,
- [Define if <sys/acct.h>'s AC_ETIME field is a COMP_T.]))
+ AC_EGREP_HEADER(ac_etime, sys/acct.h,
+ AC_DEFINE(HAVE_ACETIME, 1, [Define if <sys/acct.h> has the AC_ETIME field.])
+ AC_EGREP_HEADER(comp_t.*ac_etime, sys/acct.h,
+ AC_DEFINE(ACETIME_COMPT, 1, [Define if <sys/acct.h> AC_ETIME field is a COMP_T.]))
)
- AC_HEADER_EGREP(ac_io, sys/acct.h,
- AC_DEFINE(HAVE_ACIO, ,
- [Define if <sys/acct.h> has the AC_IO field.])
- AC_HEADER_EGREP(comp_t.*ac_io, sys/acct.h,
- AC_DEFINE(ACIO_COMPT, ,
- [Define if <sys/acct.h>'s AC_IO field is a COMP_T.]))
+ AC_EGREP_HEADER(ac_io, sys/acct.h,
+ AC_DEFINE(HAVE_ACIO, 1, [Define if <sys/acct.h> has the AC_IO field.])
+ AC_EGREP_HEADER(comp_t.*ac_io, sys/acct.h,
+ AC_DEFINE(ACIO_COMPT, 1, [Define if <sys/acct.h> AC_IO field is a COMP_T.]))
)
- AC_HEADER_EGREP(ac_mem, sys/acct.h,
- AC_DEFINE(HAVE_ACMEM, ,
- [Define if <sys/acct.h> has the AC_MEM field.])
- AC_HEADER_EGREP(comp_t.*ac_mem, sys/acct.h,
- AC_DEFINE(ACMEM_COMPT, ,
- [Define if <sys/acct.h>'s AC_MEM field is a COMP_T.]))
+ AC_EGREP_HEADER(ac_mem, sys/acct.h,
+ AC_DEFINE(HAVE_ACMEM, 1, [Define if <sys/acct.h> has the AC_MEM field.])
+ AC_EGREP_HEADER(comp_t.*ac_mem, sys/acct.h,
+ AC_DEFINE(ACMEM_COMPT, 1, [Define if <sys/acct.h> AC_MEM field is a COMP_T.]))
)
- AC_HEADER_EGREP(ac_minflt, sys/acct.h,
- AC_HEADER_EGREP(ac_majflt, sys/acct.h,
- AC_HEADER_EGREP(ac_swaps, sys/acct.h,
- AC_DEFINE(HAVE_PAGING, ,
- [Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields.])
- AC_HEADER_EGREP(comp_t.*ac_minflt, sys/acct.h,
- AC_DEFINE(ACMINFLT_COMPT, ,
- [Define if <sys/acct.h>'s AC_MINFLT field is a COMP_T.]))
- AC_HEADER_EGREP(comp_t.*ac_mayflt, sys/acct.h,
- AC_DEFINE(ACMAJFLT_COMPT, ,
- [Define if <sys/acct.h>'s AC_MAJFLT field is a COMP_T.]))
- AC_HEADER_EGREP(comp_t.*ac_swaps, sys/acct.h,
- AC_DEFINE(ACSWAPS_COMPT, ,
- [Define if <sys/acct.h>'s AC_SWAPS field is a COMP_T.]))
+ AC_EGREP_HEADER(ac_minflt, sys/acct.h,
+ AC_EGREP_HEADER(ac_majflt, sys/acct.h,
+ AC_EGREP_HEADER(ac_swaps, sys/acct.h,
+ AC_DEFINE(HAVE_PAGING, 1, [Define if <sys/acct.h> has the AC_MINFLT, AC_MAJFLT and AC_SWAPS fields.])
+ AC_EGREP_HEADER(comp_t.*ac_minflt, sys/acct.h,
+ AC_DEFINE(ACMINFLT_COMPT, 1, [Define if <sys/acct.h> AC_MINFLT field is a COMP_T.]))
+ AC_EGREP_HEADER(comp_t.*ac_mayflt, sys/acct.h,
+ AC_DEFINE(ACMAJFLT_COMPT, 1, [Define if <sys/acct.h> AC_MAJFLT field is a COMP_T.]))
+ AC_EGREP_HEADER(comp_t.*ac_swaps, sys/acct.h,
+ AC_DEFINE(ACSWAPS_COMPT, 1, [Define if <sys/acct.h> AC_SWAPS field is a COMP_T.]))
)
)
)
- AC_HEADER_EGREP(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T, ,
- [Define if <sys/acct.h> uses the COMP_T type.]))
- AC_HEADER_EGREP([struct acct_v3], sys/acct.h, AC_DEFINE(HAVE_ACCT_V3, ,
- [Define if <sys/acct.h> has struct acct_v3.]))
- AC_HEADER_EGREP([struct acctv2], sys/acct.h, AC_DEFINE(HAVE_ACCTV2, ,
- [Define if <sys/acct.h> has struct acctv2.]))
-
- )
+ AC_EGREP_HEADER([comp_t],[sys/acct.h],[AC_DEFINE(HAVE_COMP_T, 1, Define if <sys/acct.h> uses the COMP_T type.)])
+)
dnl need to check because AIX 4.2 does not have it
@@ -393,31 +382,30 @@
AC_CHECK_FUNC(statfs, AC_DEFINE(HAVE_STATFS) statfs="yes", statfs="no")
SL_CHECK_VA_COPY
AC_CHECK_FUNCS(vsnprintf, [SL_CHECK_VSNPRINTF])
-AC_CHECK_MLOCK
SH_STRFTIME_Z
AC_MSG_CHECKING(how to get filesystem type)
fstype=no
# The order of these tests is important.
-AC_TRY_CPP([#include <sys/statvfs.h>
-#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statvfs.h>
+#include <sys/fstyp.h>]])],[AC_DEFINE(FSTYPE_STATVFS) fstype=SVR4],[])
if test $fstype = no; then
-AC_TRY_CPP([#include <sys/statfs.h>
-#include <sys/fstyp.h>], AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statfs.h>
+#include <sys/fstyp.h>]])],[AC_DEFINE(FSTYPE_USG_STATFS) fstype=SVR3],[])
fi
if test $fstype = no; then
-AC_TRY_CPP([#include <sys/statfs.h>
-#include <sys/vmount.h>], AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/statfs.h>
+#include <sys/vmount.h>]])],[AC_DEFINE(FSTYPE_AIX_STATFS) fstype=AIX],[])
fi
if test $fstype = no; then
-AC_TRY_CPP([#include <mntent.h>], AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <mntent.h>]])],[AC_DEFINE(FSTYPE_MNTENT) fstype=4.3BSD],[])
fi
if test $fstype = no; then
AC_EGREP_HEADER(f_type;, sys/mount.h, AC_DEFINE(FSTYPE_STATFS) fstype=4.4BSD/OSF)
fi
if test $fstype = no; then
-AC_TRY_CPP([#include <sys/mount.h>
-#include <sys/fs_types.h>], AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix)
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/mount.h>
+#include <sys/fs_types.h>]])],[AC_DEFINE(FSTYPE_GETMNT) fstype=Ultrix],[])
fi
AC_MSG_RESULT($fstype)
@@ -482,7 +470,7 @@
dnl unix systems we need a size_t.
AC_MSG_CHECKING(for socklen_t)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -490,12 +478,12 @@
#include <sys/socket.h>
#endif
socklen_t x;
-], [],[
+]], [[]])],[
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[socklen_t], [type of arg3 of accept])
AC_DEFINE([HAVE_SOCKLEN_T], 1, [Define if you have socklen_t])
],[
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -503,7 +491,7 @@
#include <sys/socket.h>
#endif
int accept (int, struct sockaddr *, size_t *);
- ],[],[
+ ]])],[],[
AC_MSG_RESULT(size_t)
AC_DEFINE_UNQUOTED([ACCEPT_TYPE_ARG3],[size_t], [type of arg3 of accept])
], [
@@ -538,7 +526,7 @@
dnl checks for typedefs
dnl *****************************************
-AC_C_LONG_DOUBLE
+AC_TYPE_LONG_DOUBLE
SH_CHECK_TYPEDEF(long long, HAVE_LONG_LONG)
SH_CHECK_TYPEDEF(uint16_t, HAVE_UINT16_T)
SH_CHECK_TYPEDEF(uint32_t, HAVE_UINT32_T)
@@ -594,18 +582,12 @@
dnl
AC_MSG_CHECKING(whether struct stat has a st_flags field)
AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
- AC_TRY_COMPILE([#include <sys/stat.h>],
- [struct stat stat; stat.st_flags = 0;],
- [e2fsprogs_cv_struct_st_flags=yes],
- [e2fsprogs_cv_struct_st_flags=no]))
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[struct stat stat; stat.st_flags = 0;]])],[e2fsprogs_cv_struct_st_flags=yes],[e2fsprogs_cv_struct_st_flags=no]))
AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
if test "$e2fsprogs_cv_struct_st_flags" = yes; then
AC_MSG_CHECKING(whether st_flags field is useful)
AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
- AC_TRY_COMPILE([#include <sys/stat.h>],
- [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
- [e2fsprogs_cv_struct_st_flags_immut=yes],
- [e2fsprogs_cv_struct_st_flags_immut=no]))
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/stat.h>]], [[struct stat stat; stat.st_flags |= UF_IMMUTABLE;]])],[e2fsprogs_cv_struct_st_flags_immut=yes],[e2fsprogs_cv_struct_st_flags_immut=no]))
AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
AC_DEFINE(HAVE_STAT_FLAGS)
@@ -616,14 +598,14 @@
dnl from dbus
dnl
AC_MSG_CHECKING(for struct cmsgcred)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
-],[
+]], [[
struct cmsgcred cred;
cred.cmcred_pid = 0;
-],sh_have_struct_cmsgcred=yes,sh_have_struct_cmsgcred=no)
+]])],[sh_have_struct_cmsgcred=yes],[sh_have_struct_cmsgcred=no])
AC_MSG_RESULT($sh_have_struct_cmsgcred)
if test x$sh_have_struct_cmsgcred = xyes; then
@@ -631,13 +613,13 @@
fi
AC_MSG_CHECKING(for struct fcred)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ucred.h>
-],[
+]], [[
struct fcred sockcred;
-],sh_have_struct_fcred=yes,sh_have_struct_fcred=no)
+]])],[sh_have_struct_fcred=yes],[sh_have_struct_fcred=no])
AC_MSG_RESULT($sh_have_struct_fcred)
if test x$sh_have_struct_fcred = xyes; then
@@ -645,13 +627,13 @@
fi
AC_MSG_CHECKING(for struct sockcred)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ucred.h>
-],[
+]], [[
struct sockcred sockcred;
-],sh_have_struct_sockcred=yes,sh_have_struct_sockcred=no)
+]])],[sh_have_struct_sockcred=yes],[sh_have_struct_sockcred=no])
AC_MSG_RESULT($sh_have_struct_sockcred)
if test x$sh_have_struct_sockcred = xyes; then
@@ -659,12 +641,12 @@
fi
AC_MSG_CHECKING(for SO_PEERCRED)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
-],[
+]], [[
int test = SO_PEERCRED;
-],sh_have_SO_PEERCRED=yes,sh_have_SO_PEERCRED=no)
+]])],[sh_have_SO_PEERCRED=yes],[sh_have_SO_PEERCRED=no])
AC_MSG_RESULT($sh_have_SO_PEERCRED)
if test x$sh_have_SO_PEERCRED = xyes; then
@@ -680,8 +662,6 @@
AC_C_BIGENDIAN
AC_C_RESTRICT
-AM_SA_SIGACTION_WORKS
-
AC_ARG_ENABLE(ssp,
[ --disable-ssp disable the GCC stack protector],
[],
@@ -937,11 +917,8 @@
AC_CHECK_HEADER(tcpd.h,
[],
[ AC_MSG_ERROR([Could not find tcpd.h for libwrap. You need to install tcp_wrappers.]) ])
- AC_TRY_LINK([ #include <tcpd.h>
- int allow_severity; int deny_severity; ],
- [ hosts_access((struct request_info *) 0); ],
- [ AC_DEFINE(SH_USE_LIBWRAP,1,[Build with tcp wrapper support]) ],
- [ AC_MSG_ERROR([Could not find the libwrap library.]) ])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <tcpd.h>
+ int allow_severity; int deny_severity; ]], [[ hosts_access((struct request_info *) 0); ]])],[ AC_DEFINE(SH_USE_LIBWRAP,1,[Build with tcp wrapper support]) ],[ AC_MSG_ERROR([Could not find the libwrap library.]) ])
fi ],
AC_MSG_RESULT(no)
)
@@ -1121,7 +1098,7 @@
#
# this is from the snort configure.in
#
-AC_DEFUN(FAIL_MESSAGE,[
+AC_DEFUN([FAIL_MESSAGE],[
echo
echo
echo "**********************************************"
@@ -1135,59 +1112,6 @@
exit
])
-AC_ARG_WITH(libprelude-prefix,
- [ --with-libprelude-prefix=PFX Prefix where libprelude is installed (optional)],
- libprelude_config_prefix="$withval", libprelude_config_prefix="")
-
-AC_MSG_CHECKING(whether to use prelude)
-AC_ARG_WITH(prelude,
- [ --with-prelude Prelude IDS support [[no]]],
- [
- if test "x${withval}" = "xno"; then
- AC_MSG_RESULT(no)
- else
- AC_MSG_RESULT(yes)
- if test x$libprelude_config_prefix != x ; then
- if test x${LIBPRELUDE_CONFIG+set} != xset ; then
- LIBPRELUDE_CONFIG=$libprelude_config_prefix/bin/libprelude-config
- fi
- fi
-
- AC_PATH_PROG(LIBPRELUDE_CONFIG, libprelude-config, no)
- if test x"$LIBPRELUDE_CONFIG" = "xno" ; then
- HAVE_PRELUDE_CONFIG=no
- else
- HAVE_PRELUDE_CONFIG=yes
- fi
-dnl AC_CHECK_PROG(HAVE_PRELUDE_CONFIG, libprelude-config, yes, no)
- if test "$HAVE_PRELUDE_CONFIG" = "yes"; then
- sh_libprelude_version=`$LIBPRELUDE_CONFIG --version`
- case "$sh_libprelude_version" in
- 0.8*)
- AC_MSG_ERROR([You have Libprelude 0.8, which is too old. Version 0.9.6 or higher is required.])
- ;;
- *)
- AM_PATH_LIBPRELUDE([0.9.6],
- [
- AC_DEFINE(HAVE_LIBPRELUDE,1,[Have libprelude])
- CFLAGS="$CFLAGS $LIBPRELUDE_PTHREAD_CFLAGS"
- LDFLAGS="$LDFLAGS $LIBPRELUDE_LDFLAGS"
- LIBS="$LIBS $LIBPRELUDE_LIBS"
- ],
- [
- AC_MSG_ERROR([Could not find libprelude (if you are using --enable-static, the static library libprelude.a might be missing).])
- ])
- ;;
- esac
- else
- AC_MSG_ERROR([Could not find libprelude-config.])
- fi
- fi
- ],
- [
- AC_MSG_RESULT(no)
- ]
-)
#
# partly based on the snort configure.in
@@ -2456,20 +2380,26 @@
dnl PATH DEFAULTS
dnl
-if test "x${ac_prefix_set}" = xyes
+# Check if the prefix is set
+if test -n "${prefix}"
+then
+ ac_prefix_set="yes"
+fi
+
+if test "x${ac_prefix_set}" = "xyes"
then
- if test "x${exec_prefix}" = xNONE
+ if test "x${exec_prefix}" = "xNONE"
then
exec_prefix="${prefix}"
fi
- if test "x${prefix}" = xOPT
+ if test "x${prefix}" = "x/opt"
then
tmp_sbindir="/opt/${install_name}/bin"
tmp_sysconfdir="/etc/opt"
tmp_mandir="/opt/${install_name}/man"
tmp_localstatedir="/var/opt/${install_name}"
- elif test "x${prefix}" = xUSR
+ elif test "x${prefix}" = "x/usr"
then
tmp_sbindir="/usr/sbin"
tmp_sysconfdir="/etc"
@@ -2664,10 +2594,9 @@
AC_DEFINE_UNQUOTED(SH_INSTALL_PATH, _("${sbindir}/${install_name}"))
AC_DEFINE_UNQUOTED(SH_INSTALL_NAME, _("${install_name}"))
-AC_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
-AC_OUTPUT(
-[
+AC_CONFIG_FILES([
Makefile
samhain-install.sh
init/samhain.startLSB
@@ -2691,15 +2620,16 @@
scripts/yuleadmin.pl
scripts/check_samhain.pl
deploy.sh
-],
-[
+])
+AC_CONFIG_COMMANDS([default],[
echo timestamp > stamp-h
chmod +x samhain-install.sh
chmod +x scripts/samhainadmin.pl
chmod +x scripts/yuleadmin.pl
chmod +x scripts/check_samhain.pl
-]
-)
+
+],[])
+AC_OUTPUT
chmod +x deploy.sh
@@ -20,6 +20,8 @@
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
+PACKAGE_VERSION=[$2]
+AC_SUBST(PACKAGE_VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
@@ -409,7 +411,7 @@
x_libraries=NONE
DESTDIR=
SH_ENABLE_OPTS="selinux posix-acl asm ssp db-reload xml-log message-queue login-watch process-check port-check mounts-check logfile-monitor userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc ipv6 shellexpand suid"
-SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver kcheck gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file"
+SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver signify pubkey-checksum gpg keyid checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file"
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
@@ -1124,30 +1126,45 @@
AC_DEFUN([GCC_STACK_PROTECT_CC],[
AC_LANG_ASSERT(C)
if test "X$CC" != "X"; then
- AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-all],
+ AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-strong],
ssp_cv_cc,
[ssp_old_cflags="$CFLAGS"
- CFLAGS="$CFLAGS -fstack-protector-all"
+ CFLAGS="$CFLAGS -fstack-protector-strong"
AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
CFLAGS="$ssp_old_cflags"
])
if test $ssp_cv_cc = no; then
- AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector],
+ AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector-all],
ssp_cv_cc,
[ssp_old_cflags="$CFLAGS"
- CFLAGS="$CFLAGS -fstack-protector"
+ CFLAGS="$CFLAGS -fstack-protector-all"
AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
CFLAGS="$ssp_old_cflags"
])
- if test $ssp_cv_cc = yes; then
- CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector"
- LDFLAGS="$LDFLAGS -fstack-protector"
- AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
+ if test $ssp_cv_cc = no; then
+ AC_CACHE_CHECK([whether ${CC} accepts -fstack-protector],
+ ssp_cv_cc,
+ [ssp_old_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -fstack-protector"
+ AC_TRY_COMPILE(,, ssp_cv_cc=yes, ssp_cv_cc=no)
+ CFLAGS="$ssp_old_cflags"
+ ])
+ if test $ssp_cv_cc = yes; then
+ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector"
+ LDFLAGS="$LDFLAGS -fstack-protector"
+ AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
+ fi
+ else
+ if test $ssp_cv_cc = yes; then
+ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
+ LDFLAGS="$LDFLAGS -fstack-protector-all"
+ AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
+ fi
fi
else
if test $ssp_cv_cc = yes; then
- CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
- LDFLAGS="$LDFLAGS -fstack-protector-all"
+ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-strong"
+ LDFLAGS="$LDFLAGS -fstack-protector-strong"
AC_DEFINE([ENABLE_SSP_CC], 1, [Define if SSP C support is enabled.])
fi
fi
@@ -1210,15 +1227,15 @@
AC_DEFUN([GCC_STACK_CHECK_CC],[
AC_LANG_ASSERT(C)
if test "X$CC" != "X"; then
- AC_CACHE_CHECK([whether ${CC} accepts -fstack-check],
+ AC_CACHE_CHECK([whether ${CC} accepts -fstack-clash-protection],
stackcheck_cv_cc,
[stackcheck_old_cflags="$CFLAGS"
- CFLAGS="$CFLAGS -fstack-check"
+ CFLAGS="$CFLAGS -fstack-clash-protection"
AC_TRY_COMPILE(,, stackcheck_cv_cc=yes, stackcheck_cv_cc=no)
CFLAGS="$stackcheck_old_cflags"
])
if test $stackcheck_cv_cc = yes; then
- CFLAGS="$CFLAGS -fstack-check"
+ CFLAGS="$CFLAGS -fstack-clash-protection"
fi
fi
])
@@ -1228,10 +1245,11 @@
if test "X$CC" != "X"; then
AC_MSG_CHECKING([whether ${CC} accepts $1])
saved_cflags="$CFLAGS"
- CFLAGS="$CFLAGS -Werror $1"
+ # any -Wno- option will always succeed :-(
+ flag_check_opt=`echo $1 | sed 's,-Wno-,-W,'`
+ CFLAGS="$CFLAGS -Werror $flag_check_opt"
AC_TRY_COMPILE(,, flag_check_cv=yes, flag_check_cv=no)
CFLAGS="$saved_cflags"
-
if test $flag_check_cv = yes; then
CFLAGS="$CFLAGS $1"
AC_MSG_RESULT([yes])
@@ -63,7 +63,7 @@
INSTALL_DSYS = @INSTALL@ -m 755
PACKAGE = @PACKAGE@
-VERSION = @VERSION@
+VERSION = @PACKAGE_VERSION@
BUILD_NUM = 1
DEFAULT_MAINTAINER = Nobody Nowhere <nobody@example.com>
@@ -5,7 +5,7 @@
Summary: File integrity and host-based IDS
Name: @install_name@
-Version: @VERSION@
+Version: @PACKAGE_VERSION@
Release: 1
License: GPL
Group: System Environment/Base
@@ -619,7 +619,7 @@
fprintf (stdout,
_("This is samhain (%s), "\
"(c) 1999-2008 Rainer Wichmann (http://la-samhna.de).\n"),
- VERSION);
+ PACKAGE_VERSION);
fprintf (stdout, "%s",_("This software comes with ABSOLUTELY NO WARRANTY. "));
fprintf (stdout, "%s",_("Use at own risk.\n\n"));
@@ -709,7 +709,7 @@
fprintf (stdout,
_("This is samhain (%s), "\
"(c) 1999-2006 Rainer Wichmann (http://la-samhna.de).\n"),
- VERSION);
+ PACKAGE_VERSION);
fprintf (stdout, "%s",_("This software comes with ABSOLUTELY NO WARRANTY. "));
fprintf (stdout, "%s",_("Use at own risk.\n"));
@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN* | MSYS*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/* | msys/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
|