Hi, I'm trying to integrate a program i wrote into postfix. The program generates a signature which i want to append to the RCPT TO command, this is part of my bachelor thesis. So i am calling my function for generating a signature in smtp_proto.c , and i want to add some librarys which i need to the makefile. I'm working with version 2.6.11.
The files i have added to "postfix-2.6.11/src/smtp/Makefile.in" are: ibs_sign.c, ibs_utils.c, sig.c, hash.c under SRCS; sig.h, hash.h under HDRS; /usr/local/lib/libgmp.a, /usr/local/lib/libpbc.a, /usr/local/lib/libpbc_sig.a under LIBS ibs_sign.c and ibs_utils.c are my programs, the rest are librarys i am using. I have added the edited makefile at the bottom of this mail. My problem is that it will not compile when using make, because there are all kinds of errors with the librarys i have added, mainly "undefined references". See the excerpt from make's error messages below. My program does compile if i do it by hand, but i have to use some gcc options. For example, when compiling ibs_sign.c i would use: "gcc - static ibs_sign.c -L. -lpbc -lgmp -lpbc_sig". Can anyone help me to add my program to the makefile? I have only very little experience with make unfortunately. If you think my approach is completely wrong, please feel free to add your comment too. Best regards, Tobias These are the first lines of "postfix-2.6.11/src/smtp/Makefile.in" . I have not made any changes after these lines. SHELL = /bin/sh SRCS = smtp.c smtp_connect.c smtp_proto.c smtp_chat.c smtp_session.c \ smtp_addr.c smtp_trouble.c smtp_state.c smtp_rcpt.c \ smtp_sasl_proto.c smtp_sasl_glue.c smtp_reuse.c smtp_map11.c \ smtp_sasl_auth_cache.c ibs_sign.c ibs_utils.c sig.c hash.c OBJS = smtp.o smtp_connect.o smtp_proto.o smtp_chat.o smtp_session.o \ smtp_addr.o smtp_trouble.o smtp_state.o smtp_rcpt.o \ smtp_sasl_proto.o smtp_sasl_glue.o smtp_reuse.o smtp_map11.o \ smtp_sasl_auth_cache.o HDRS = smtp.h smtp_sasl.h smtp_addr.h smtp_reuse.h smtp_sasl_auth_cache.h sig.h hash.h TESTSRC = DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE) CFLAGS = $(DEBUG) $(OPT) $(DEFS) TESTPROG= smtp_unalias smtp_map11 PROG = smtp INC_DIR = ../../include LIBS = ../../lib/libmaster.a ../../lib/libtls.a ../../lib/libdns.a \ ../../lib/libxsasl.a ../../lib/libglobal.a ../../lib/libutil.a \ /usr/local/lib/libgmp.a /usr/local/lib/libpbc.a /usr/local/lib/ libpbc_sig.a This is an excerpt from make's error messages: home/tobias/pbc-0.5.11/ecc/mpc.h:26: undefined reference to `__gmpf_clear' /home/tobias/pbc-0.5.11/ecc/mpc.h:27: undefined reference to `__gmpf_clear' /usr/local/lib/libpbc.a(libpbc_la-mpc.o): In function `mpc_mul_2exp': /home/tobias/pbc-0.5.11/ecc/mpc.c:28: undefined reference to `__gmpf_mul_2exp' /home/tobias/pbc-0.5.11/ecc/mpc.c:29: undefined reference to `__gmpf_mul_2exp' /usr/local/lib/libpbc_sig.a(sig.o): In function `bls_gen': sig.c:(.text+0x18c): undefined reference to `__gmpz_init' sig.c:(.text+0x1bd): undefined reference to `__gmpz_clear' /usr/local/lib/libpbc_sig.a(sig.o): In function `bb_verify': sig.c:(.text+0x6f9): undefined reference to `__gmpz_init' sig.c:(.text+0x72b): undefined reference to `__gmpz_clear' sig.c:(.text+0x733): undefined reference to `__gmpz_init' sig.c:(.text+0x769): undefined reference to `__gmpz_clear' /usr/local/lib/libpbc_sig.a(sig.o): In function `bb_sign': sig.c:(.text+0x96e): undefined reference to `__gmpz_init' sig.c:(.text+0x9ac): undefined reference to `__gmpz_clear' /usr/local/lib/libpbc_sig.a(sig.o): In function `bls_sign': sig.c:(.text+0xa60): undefined reference to `__gmpz_init' sig.c:(.text+0xa8d): undefined reference to `__gmpz_clear' /usr/local/lib/libpbc_sig.a(sig.o): In function `cc_verify': sig.c:(.text+0xc5d): undefined reference to `__gmpz_init' sig.c:(.text+0xcaa): undefined reference to `__gmpz_clear' /usr/local/lib/libpbc_sig.a(sig.o): In function `cc_sign': sig.c:(.text+0xe10): undefined reference to `__gmpz_init' sig.c:(.text+0xe44): undefined reference to `__gmpz_clear' sig.c:(.text+0xf3f): undefined reference to `__gmpz_init' sig.c:(.text+0xf77): undefined reference to `__gmpz_clear' /usr/local/lib/libpbc_sig.a(sig.o): In function `ib_extract': sig.c:(.text+0x1076): undefined reference to `__gmpz_init' sig.c:(.text+0x10a5): undefined reference to `__gmpz_clear' /usr/local/lib/libpbc_sig.a(sig.o): In function `ib_setup': sig.c:(.text+0x1105): undefined reference to `__gmpz_init' sig.c:(.text+0x1135): undefined reference to `__gmpz_clear' /usr/local/lib/libpbc_sig.a(sig.o): In function `bb_gen': sig.c:(.text+0x126e): undefined reference to `__gmpz_init' sig.c:(.text+0x12ab): undefined reference to `__gmpz_clear' sig.c:(.text+0x12b7): undefined reference to `__gmpz_init' sig.c:(.text+0x12f4): undefined reference to `__gmpz_clear' collect2: ld returned 1 exit status make: *** [smtp] Error 1 make: *** [update] Error 1