0

There is a project using protobuf as an option of serialization protocol, but not all the users have protobuf installed. The solution I'm using now is to use AC_CHECK_LIB[(protobuf)] in configure.ac, and if HAVE_PROTOBUF AM_LDFLAGS += -lprotobuf endif in Makefile.am. What I want to do now is something like ./bootstrap.sh --enable-protobuf. Let the user to define whether include the protobuf or not, Is that possible?

nzomkxia
  • 1,219
  • 4
  • 16
  • 35
  • Yes, but I think it's rather painful with autotools. Have you considered leaving autotools and using cmake or scons instead? – arne Aug 23 '13 at 08:50
  • Is that very complicated by autotools? If yes, I'll consider about the tools you mentioned. – nzomkxia Aug 23 '13 at 09:06
  • 1
    Nah, it's not extremely complicated, but I think it's very, very ugly. – arne Aug 23 '13 at 09:07

1 Answers1

0

Read about AC_ARG_ENABLE in the autoconf manual.

Tom Tromey
  • 21,507
  • 2
  • 45
  • 63