From: Douglas William Thrift Date: Tue, 2 Feb 2010 07:02:47 +0000 (+0000) Subject: -rpath! X-Git-Tag: v0.9.432~116 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/549f29b57de520beee4050f6dc59889303e5b6c9 -rpath! --- diff --git a/GNUmakefile.in b/GNUmakefile.in index 84994c6..bc8da82 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -13,10 +13,12 @@ flex := @FLEX@ libtool := @LIBTOOL@ cxx := @CXX@ objcxx := @OBJCXX@ -flags := @CPPFLAGS@ @CXXFLAGS@ -DYYDEBUG=1 +cflags := @CPPFLAGS@ @CXXFLAGS@ -DYYDEBUG=1 +ldflags := @LDFLAGS@ +library := @LIBS@ @LTLIBAPR@ @LTLIBICONV@ paths := $(foreach path,$(paths),$(wildcard $(path))) -flags += $(foreach path,$(paths),-I$(path) -L$(path)) +cflags += $(foreach path,$(paths),-I$(path) -L$(path)) svn := $(shell svnversion) @@ -31,10 +33,10 @@ endif header := Cycript.tab.hh Parser.hpp Pooling.hpp cycript.hpp Internal.hpp Error.hpp String.hpp Exception.hpp Standard.hpp code := -code += Replace.o Output.o -code += Cycript.tab.o lex.cy.o -code += Network.o Parser.o -code += JavaScriptCore.o Library.o +code += Replace.lo Output.lo +code += Cycript.tab.lo lex.cy.lo +code += Network.lo Parser.lo +code += JavaScriptCore.lo Library.lo inject := @@ -43,9 +45,6 @@ ldid := true entitle := $(ldid) lib := lib dll := so -apr_config := apr-1-config -library := -console := -lreadline depends := restart ?= $(MAKE) @@ -55,10 +54,6 @@ uname_p ?= $(shell uname -p) -include $(uname_s).mk -include $(uname_s)-$(uname_p).mk -ifneq ($(shell pkg-config libffi --modversion 2>/dev/null),) -flags += $(shell pkg-config --cflags libffi) -endif - ifdef CY_EXECUTE ifeq ($(filter ObjectiveC,$(filters)),) ifneq ($(shell which gnustep-config 2>/dev/null),) @@ -67,18 +62,14 @@ endif endif endif -apr := $(shell $(apr_config) --link-ld) -library += $(apr) -console += $(apr) - -flags += -Wall -Werror -Wno-parentheses #-Wno-unused -flags += -fno-common +cflags += -Wall -Werror -Wno-parentheses #-Wno-unused +cflags += -fno-common ifneq ($(srcdir),.) -flags += -I. +cflags += -I. endif -flags += -I$(srcdir) -I$(srcdir)/include -I$(shell $(apr_config) --includedir) +cflags += -I$(srcdir) -I$(srcdir)/include -all += $(lib)cycript.$(dll) +all += $(lib)cycript.la filters += $(shell bison <(echo '%code{}%%_:') -o/dev/null 2>/dev/null && echo Bison24 || echo Bison23) @@ -120,7 +111,7 @@ endif all: $(all) clean:: - rm -f *.lo *.o $(lib)cycript.$(dll) $(all) Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh cyrver Cycript.yy Cycript.l control Bridge.hpp Cycript.output + rm -rf *.lo *.o .libs $(lib)cycript.$(dll) $(lib)cycript.la $(all) Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh cyrver Cycript.yy Cycript.l control Bridge.hpp Cycript.output distclean: clean rm -f GNUmakefile config.log config.status libtool @@ -140,24 +131,24 @@ lex.cy.c: Cycript.l #Parser.hpp: Parser.py Parser.dat # ./Parser.py $@ -Cycript.tab.o: Cycript.tab.cc $(header) - $(libtool) --mode=compile $(cxx) $(flags) -c -o $@ $< +Cycript.tab.lo: Cycript.tab.cc $(header) + $(libtool) --mode=compile $(cxx) $(cflags) -c -o $@ $< -lex.cy.o: lex.cy.c $(header) - $(libtool) --mode=compile $(cxx) $(flags) -c -o $@ $< +lex.cy.lo: lex.cy.c $(header) + $(libtool) --mode=compile $(cxx) $(cflags) -c -o $@ $< -%.o: %.cpp $(header) - $(libtool) --mode=compile $(cxx) $(flags) -c -o $@ $< +%.lo: %.cpp $(header) + $(libtool) --mode=compile $(cxx) $(cflags) -c -o $@ $< -%.o: %.mm $(header) - $(libtool) --mode=compile $(objcxx) $(flags) -c -o $@ $< +%.lo: %.mm $(header) + $(libtool) --mode=compile $(objcxx) $(cflags) -c -o $@ $< -$(lib)cycript.$(dll): $(code) - $(libtool) --mode=link $(cxx) $(flags) -shared -dynamiclib -o $@ $(filter %.o,$^) $(library) $(link) +$(lib)cycript.la: $(code) + $(libtool) --mode=link $(cxx) $(ldflags) -o $@ $(filter %.lo,$^) $(library) $(link) -rpath /usr/lib $(ldid) $@ -cycript: Console.o $(lib)cycript.$(dll) $(inject) - $(libtool) --mode=link $(cxx) $(flags) -o $@ $(filter %.o,$^) -L. -lcycript $(console) $(link) +cycript: Console.lo $(lib)cycript.la $(inject) + $(libtool) --mode=link $(cxx) $(ldflags) -o $@ $(filter %.lo,$^) $(lib)cycript.la $(link) -rpath /usr/lib $(entitle) cycript package: $(deb) diff --git a/configure b/configure index 25b4f59..b204cda 100755 --- a/configure +++ b/configure @@ -823,7 +823,7 @@ CXXCPP ac_ct_CXX CXXFLAGS CXX -APR +LTLIBAPR GPERF _BASH FLEX @@ -911,8 +911,8 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_shared enable_static +enable_shared with_pic enable_fast_install with_gnu_ld @@ -1557,8 +1557,8 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) @@ -6285,36 +6285,27 @@ done # Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; + yes) enable_static=yes ;; + no) enable_static=no ;; *) - enable_shared=no + enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then - enable_shared=yes + enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else - enable_shared=yes + enable_static=no fi @@ -6325,27 +6316,34 @@ fi - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; + yes) enable_shared=yes ;; + no) enable_shared=no ;; *) - enable_static=no + enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then - enable_static=yes + enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else - enable_static=yes + enable_shared=yes fi @@ -6357,6 +6355,7 @@ fi + # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" @@ -6780,11 +6779,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6783: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6782: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6787: \$? = $ac_status" >&5 + echo "$as_me:6786: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7119,11 +7118,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7122: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7121: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7126: \$? = $ac_status" >&5 + echo "$as_me:7125: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7224,11 +7223,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7227: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7226: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7231: \$? = $ac_status" >&5 + echo "$as_me:7230: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7279,11 +7278,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7282: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7281: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7286: \$? = $ac_status" >&5 + echo "$as_me:7285: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9663,7 +9662,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9666 "configure" +#line 9665 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -9759,7 +9758,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 9762 "configure" +#line 9761 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10590,7 +10589,7 @@ case $apr_found in #( fi done - APR=`$apr_config --link-ld` + LTLIBAPR=`$apr_config --link-libtool` ;; #( *) : @@ -13130,11 +13129,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13133: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13132: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13137: \$? = $ac_status" >&5 + echo "$as_me:13136: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13229,11 +13228,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13232: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13231: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13236: \$? = $ac_status" >&5 + echo "$as_me:13235: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13281,11 +13280,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13284: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13283: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13288: \$? = $ac_status" >&5 + echo "$as_me:13287: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16775,8 +16774,8 @@ double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' -enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' @@ -17595,12 +17594,12 @@ available_tags="CXX " macro_version=$macro_version macro_revision=$macro_revision -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - # Whether or not to build static libraries. build_old_libs=$enable_static +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + # What type of objects to build. pic_mode=$pic_mode diff --git a/configure.ac b/configure.ac index 994b68d..a5230c6 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.65]) AC_INIT([Cycript], [0.9], [saurik@saurik.com], [cycript], [http://www.cycript.org/]) AC_CONFIG_SRCDIR([Console.cpp]) AC_CONFIG_AUX_DIR([.]) -LT_INIT +LT_INIT([disable-static]) AX_PROG_BISON([ BISON=`echo $YACC | $SED -e 's/ -y//'` BISON_VERSION=`$BISON -V | $SED -e 's/^bison (GNU Bison) \(.*\)$/\1/p;d'` @@ -31,7 +31,7 @@ AC_CHECK_PROGS([GPERF], [gperf]) APR_FIND_APR([], [], [1], [1]) AS_CASE([$apr_found], [yes], [ AC_LIB_APPENDTOVAR([CPPFLAGS], [`$apr_config --includes`]) - AC_SUBST([APR], [`$apr_config --link-ld`]) + AC_SUBST([LTLIBAPR], [`$apr_config --link-libtool`]) ], [AC_MSG_ERROR([You need apr])]) VL_LIB_READLINE AC_PROG_CXX