diff --git a/configure.ac b/configure.ac index a8d058bbb..b3ba947ef 100644 --- a/configure.ac +++ b/configure.ac @@ -187,6 +187,11 @@ darwin* | rhapsody*) # TODO: check the compiler actually does support these options CFLAGS="${CFLAGS} -no-cpp-precomp" CXXFLAGS="${CXXFLAGS} -no-cpp-precomp" + # Tell the OS X linker to allocate enough space inside the + # libhamlib.X.dylib shared object for install_name_tool(1) to + # work. This is useful when including hamlib in an app bundle. + OSXLDFLAGS="-Wl,-headerpad_max_install_names" + AC_SUBST([OSXLDFLAGS]) ;; mingw* | pw32* | cygwin*) WINLDFLAGS="-Wl,--output-def,libhamlib.def -Wl,--add-stdcall-alias" diff --git a/src/Makefile.am b/src/Makefile.am index 4bc4257a0..8a7b7a208 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ RIGSRC = rig.c serial.c misc.c register.c event.c cal.c conf.c tones.c \ lib_LTLIBRARIES = libhamlib.la libhamlib_la_SOURCES = $(RIGSRC) -libhamlib_la_LDFLAGS = $(WINLDFLAGS) -no-undefined -version-info @ABI_VERSION@:10:0 +libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info @ABI_VERSION@:10:0 libhamlib_la_CFLAGS = -DIN_HAMLIB $(AM_CFLAGS) -DHAMLIB_MODULE_DIR=\"$(libdir)\" libhamlib_la_LIBADD = @LIBLTDL@ $(top_builddir)/lib/libmisc.la \ @NET_LIBS@ @MATH_LIBS@ $(LIBUSB_LIBS)