You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.9 KiB

  1. --- a/unix-console/Makefile
  2. +++ b/unix-console/Makefile
  3. @@ -25,7 +25,8 @@ CWARNS += -W -Wall -Wshadow -Wpointer-ar
  4. # CWARNS += -Wpacked
  5. #CFLAGS += $(CWARNS) -D_GNU_SOURCE -D_DEBUG -g3 -O0
  6. -CFLAGS += $(CWARNS) -D_GNU_SOURCE
  7. +CFLAGS += $(CWARNS) $(EXTRA_CFLAGS) -D_GNU_SOURCE
  8. +LDFLAGS += $(EXTRA_LDFLAGS)
  9. CC = @gcc
  10. RM = rm
  11. @@ -40,25 +41,25 @@ CFLAGS += -D AICCU_CONSOLE
  12. # GnuTLS Support ?
  13. # Used by TIC to secure that communication
  14. # Currently defaultly builds only on Linux, but other platforms might easily also support it
  15. -ifeq ($(shell uname | grep -c "Linux"),1)
  16. +ifneq ($(HAVE_GNUTLS),)
  17. CFLAGS += -D AICCU_GNUTLS
  18. LDFLAGS += -lgnutls
  19. endif
  20. # Linux
  21. -ifeq ($(shell uname | grep -c "Linux"),1)
  22. +ifeq ($(OS_NAME),Linux)
  23. CFLAGS += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\""
  24. SRCS += ../common/aiccu_linux.c
  25. OBJS += ../common/aiccu_linux.o
  26. -LDFLAGS += -lpthread -lresolv
  27. +LDFLAGS += -pthread -lresolv
  28. endif
  29. # FreeBSD
  30. -ifeq ($(shell uname | grep -c "FreeBSD"),1)
  31. +ifeq ($(OS_NAME),FreeBSD)
  32. CFLAGS += -D_FREEBSD
  33. # FreeBSD 4.x
  34. -ifeq ($(shell uname -r | cut -c 1),4)
  35. +ifeq ($(shell echo $(OS_VERSION) | cut -c 1),4)
  36. CFLAGS += -D AICCU_TYPE="\"freebsd4\""
  37. SRCS += ../common/aiccu_freebsd4.c
  38. OBJS += ../common/aiccu_freebsd4.o
  39. @@ -71,7 +72,7 @@ endif
  40. endif
  41. # DragonFlyBSD
  42. -ifeq ($(shell uname | grep -c "DragonFly"),1)
  43. +ifeq ($(OS_NAME),DragonFly)
  44. CFLAGS += -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\""
  45. SRCS += ../common/aiccu_freebsd4.c
  46. OBJS += ../common/aiccu_freebsd4.o
  47. @@ -79,7 +80,7 @@ CFLAGS += -pthread
  48. endif
  49. # NetBSD
  50. -ifeq ($(shell uname | grep -c "NetBSD"),1)
  51. +ifeq ($(OS_NAME),NetBSD)
  52. CFLAGS += -D_NETBSD -D AICCU_TYPE="\"kame\""
  53. # Check if net/if_tun.h has TUNSIFHEAD and enable support for it
  54. @@ -97,10 +98,10 @@ CFLAGS += -pthread -D_NETBSD_SOURCE
  55. endif
  56. # OpenBSD
  57. -ifeq ($(shell uname | grep -c "OpenBSD"),1)
  58. +ifeq ($(OS_NAME),OpenBSD)
  59. CFLAGS += -D_OPENBSD -D HAS_IFHEAD
  60. # 2.7-2.9
  61. -ifeq ($(shell uname -r | cut -c 1),2)
  62. +ifeq ($(shell echo $(OS_VERSION) | cut -c 1),2)
  63. CFLAGS += -D AICCU_TYPE="\"openbsd2\""
  64. SRCS += ../common/aiccu_openbsd2.c
  65. OBJS += ../common/aiccu_openbsd2.o
  66. @@ -114,7 +115,7 @@ CFLAGS += -pthread
  67. endif
  68. # Darwin
  69. -ifeq ($(shell uname | grep -c "Darwin"),1)
  70. +ifeq ($(OS_NAME),Darwin)
  71. CFLAGS += -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\""
  72. SRCS += ../common/aiccu_darwin.c
  73. OBJS += ../common/aiccu_darwin.o
  74. @@ -122,7 +123,7 @@ LDFLAGS += -lresolv
  75. endif
  76. # SunOS / Solaris
  77. -ifeq ($(shell uname | grep -c "SunOS"),1)
  78. +ifeq ($(OS_NAME),SunOS)
  79. CFLAGS += -D_SUNOS -D AICCU_TYPE="\"sunos\""
  80. SRCS += ../common/aiccu_sunos.c
  81. OBJS += ../common/aiccu_sunos.o
  82. @@ -130,7 +131,7 @@ LDFLAGS += -lsocket -lnsl -lresolv
  83. endif
  84. # AIX
  85. -ifeq ($(shell uname | grep -c "AIX"),1)
  86. +ifeq ($(OS_NAME),AIX)
  87. CC = @/usr/vac/bin/xlc_r
  88. CFLAGS = -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g -qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all
  89. CFLAGS += -D AICCU_CONSOLE