muquit / mailsend

A program to send mail via SMTP from command line
Other
298 stars 68 forks source link

cannot compilesend on macos 10.13 high sierra #153

Open pdvnl opened 4 years ago

pdvnl commented 4 years ago

i'm using to make macport for mailsend using openssl 1.1.g but get an error . maybe incompatibility with openssl 1.1 ?

gcc -g -O2 -Wall -I. -I./libs/libmutils -I./libs/libmsock -I./libs/libsll -I/opt/local//include -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_CTYPE_H=1 -DHAVE_STDINT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_STDLIB_H=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_SYSLIMITS_H=1 -DHAVE_FLOCK=1 -DHAVE_SOCKET=1 -DHAVE_HTONL=1 -DHAVE_GETHOSTNAME=1 -DHAVE_GETHOSTBYADDR=1 -DHAVE_YP_GET_DEFAULT_DOMAIN=1 -DHAVE_RES_SEARCH=1 -DHAVE_INET_ATON=1 -DHAVE_DN_SKIPNAME=1 -DHAVE_MKSTEMP=1 -DHAVE_GETADDRINFO=1 -DHAVE_OPENSSL=1 -DUNIX -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MATH_H=1 -c utils.c
utils.c:795:9: error: variable has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st')
        ctx;
        ^
/opt/local//include/openssl/ossl_typ.h:102:16: note: forward declaration of 'struct hmac_ctx_st'
typedef struct hmac_ctx_st HMAC_CTX;
               ^
utils.c:835:5: warning: implicit declaration of function 'HMAC_CTX_init' is invalid in C99 [-Wimplicit-function-declaration]
    HMAC_CTX_init(&ctx);
    ^
utils.c:836:5: warning: 'HMAC_Init' is deprecated [-Wdeprecated-declarations]
    HMAC_Init(&ctx,secret,strlen(secret),md5);
    ^
/opt/local//include/openssl/hmac.h:30:1: note: 'HMAC_Init' has been explicitly marked deprecated here
DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
^
/opt/local//include/openssl/opensslconf.h:158:34: note: expanded from macro 'DEPRECATEDIN_1_1_0'
# define DEPRECATEDIN_1_1_0(f)   DECLARE_DEPRECATED(f)
                                 ^
/opt/local//include/openssl/opensslconf.h:121:55: note: expanded from macro 'DECLARE_DEPRECATED'
#   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                                      ^
2 warnings and 1 error generated.
[_20200617 mailsend.log](https://github.com/muquit/mailsend/files/4793272/_20200617.mailsend.log)
muquit commented 4 years ago

The code in trunk compiles fine with OpenSSL 1.1.1g. Here is how I tested it:

pdvnl commented 4 years ago

On 2020-06-17, at 17:07:43, muquit notifications@github.com wrote:

The code in trunk compiles fine with OpenSSL 1.1.1g. Here is how I tested it:

Compile and install OpenSSL 1.1.1g say in /usr/local/ssl111g ./configure --prefix=/usr/local/ssl111g make sudo make install Now compile mailsend ./configure --with-openssl=/usr/local/ssl111g make clean make ./mailsend -h — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/muquit/mailsend/issues/153#issuecomment-645433262, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEMAUOZHWTLEJGILTCQI2TTRXDL35ANCNFSM4OAVRDPA.

macports works like bsd ports: it does install from source.

i want to make a port for mailsend so i have to use the macports openssl

openssl by macports installs /opt/local/{bin,include,lib}/openssl, so i think i must use ./configure --with-openssl=/opt/local because mailsend needs include and libs. it finds the include otherwise the error would have been different.

any suggestions?

muquit commented 4 years ago

Makes sense.

./configure --help|grep openssl
  --with-openssl=PATH     where the root of OpenSSL is installed
  --with-openssl-includes where the OpenSSL includes are.
  --with-openssl-libraris where the OpenSSL library is installed.

If headers and libs are different locations, that can be specified as well