Skip to content

Commit

Permalink
apple libhack (-install_name ../lib/libpotion), apple dylib ld fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Feb 1, 2013
1 parent dfd33c6 commit ebf8d5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Makefile
Expand Up @@ -118,7 +118,16 @@ ${GREG}: tools/greg.c tools/compile.c tools/tree.c
@${ECHO} CC $@
@${CC} -O3 -DNDEBUG -o $@ tools/greg.c tools/compile.c tools/tree.c -Itools

potion${EXE}: ${OBJ_POTION} libpotion${DLL}
ifdef APPLE
LIBHACK = ../lib/libpotion.dylib
else
LIBHACK =
endif
../lib/libpotion.dylib:
mkdir ../lib
ln -s `pwd`/libpotion.dylib ../lib/

potion${EXE}: ${OBJ_POTION} libpotion${DLL} ${LIBHACK}
@${ECHO} LINK $@
@${CC} ${CFLAGS} ${OBJ_POTION} -o $@ ${LDEXEFLAGS} -lpotion ${LIBS}
@if [ "${DEBUG}" != "1" ]; then \
Expand Down
3 changes: 2 additions & 1 deletion config.mak
Expand Up @@ -68,7 +68,8 @@ ifeq ($(shell ./tools/config.sh ${CC} apple),1)
LOADEXT = .bundle
RUNPOTION = ./potion
# in builddir: mkdir ../lib; ln -s `pwd`/libpotion.dylib ../lib/
LDDLLFLAGS = -shared -fpic -install_name "@executable_path/../lib/libpotion${DLL}"
LDDLLFLAGS = -dynamiclib -undefined dynamic_lookup -fpic \
-install_name "@executable_path/../lib/libpotion${DLL}"
LDEXEFLAGS = -L.
else
RUNPOTION = ./potion
Expand Down

0 comments on commit ebf8d5c

Please sign in to comment.