changeset 3028:3bcd9ad27b6d

added dynamic linking flags runtime detection (-rdynamic - also now MPlayer compiles and runs fine under QNX)
author alex
date Tue, 20 Nov 2001 15:11:49 +0000
parents 7b85ba8c9be5
children 41671548fde7
files Makefile configure
diffstat 2 files changed, 32 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Nov 20 14:19:31 2001 +0000
+++ b/Makefile	Tue Nov 20 15:11:49 2001 +0000
@@ -132,6 +132,9 @@
 xa/libxa.a:
 	$(MAKE) -C xa
 
+g72x/libg72x.a:
+	$(MAKE) -C libg72x
+
 MPLAYER_DEP = $(OBJS_MPLAYER) $(LOADER_DEP) $(AV_DEP) $(COMMONLIBS) 
 MENCODER_DEP = $(OBJS_MENCODER) $(LOADER_DEP) $(AV_DEP) $(COMMONLIBS)
 
@@ -141,13 +144,13 @@
 endif
 
 $(PRG):	$(MPLAYER_DEP)
-	$(CC) -rdynamic $(CFLAGS) -o $(PRG) $(OBJS_MPLAYER) -Llibmpdemux -lmpdemux $(XMM_LIBS) $(LIRC_LIBS) $(LIB_LOADER) $(AV_LIB) -Llibmpeg2 -lmpeg2 -Llibao2 -lao2 $(A_LIBS) $(VO_LIBS) $(CSS_LIB) $(GUI_LIBS) $(ARCH_LIBS) $(OSDEP_LIBS) $(PP_LIBS) $(XA_LIBS) $(DECORE_LIBS) $(TERMCAP_LIB) -lm $(STATIC)
+	$(CC) $(CFLAGS) -o $(PRG) $(OBJS_MPLAYER) -Llibmpdemux -lmpdemux $(XMM_LIBS) $(LIRC_LIBS) $(LIB_LOADER) $(AV_LIB) -Llibmpeg2 -lmpeg2 -Llibao2 -lao2 $(A_LIBS) $(VO_LIBS) $(CSS_LIB) $(GUI_LIBS) $(ARCH_LIBS) $(OSDEP_LIBS) $(PP_LIBS) $(XA_LIBS) $(DECORE_LIBS) $(TERMCAP_LIB) -lm $(STATIC)
 
 $(PRG_FIBMAP): fibmap_mplayer.o
 	$(CC) -o $(PRG_FIBMAP) fibmap_mplayer.o
 
 $(PRG_MENCODER): $(MENCODER_DEP)
-	$(CC) -rdynamic $(CFLAGS) -o $(PRG_MENCODER) $(OBJS_MENCODER) -Llibmpeg2 -lmpeg2 -Llibmpdemux -lmpdemux $(X_LIBS) $(XMM_LIBS) $(LIB_LOADER) $(AV_LIB) -lmp3lame $(A_LIBS) $(CSS_LIB) $(GUI_LIBS) $(ARCH_LIBS) $(OSDEP_LIBS) $(PP_LIBS) $(XA_LIBS) $(DECORE_LIBS) $(ENCORE_LIBS) $(TERMCAP_LIB) -lm
+	$(CC) $(CFLAGS) -o $(PRG_MENCODER) $(OBJS_MENCODER) -Llibmpeg2 -lmpeg2 -Llibmpdemux -lmpdemux $(X_LIBS) $(XMM_LIBS) $(LIB_LOADER) $(AV_LIB) -lmp3lame $(A_LIBS) $(CSS_LIB) $(GUI_LIBS) $(ARCH_LIBS) $(OSDEP_LIBS) $(PP_LIBS) $(XA_LIBS) $(DECORE_LIBS) $(ENCORE_LIBS) $(TERMCAP_LIB) -lm
 
 # $(PRG_HQ):	depfile mplayerHQ.o $(OBJS) loader/libloader.a libmpeg2/libmpeg2.a opendivx/libdecore.a $(COMMONLIBS) encore/libencore.a
 # 	$(CC) $(CFLAGS) -o $(PRG_HQ) mplayerHQ.o $(OBJS) $(XMM_LIBS) $(LIRC_LIBS) $(A_LIBS) -lm $(TERMCAP_LIB) -Lloader -lloader -ldl -Llibmpeg2 -lmpeg2 -Lopendivx -ldecore $(VO_LIBS) -Lencore -lencore -lpthread
--- a/configure	Tue Nov 20 14:19:31 2001 +0000
+++ b/configure	Tue Nov 20 15:11:49 2001 +0000
@@ -978,6 +978,7 @@
 echores "$_kstat"
 
 
+# required for nanosleep on some systems
 echocheck "posix4"
 cat > $TMPC << EOF
 int main(void) { return 0; }
@@ -998,7 +999,7 @@
 cc_check $_ld_sock -lsocket && _ld_sock="$_ld_sock -lsocket"
 cc_check $_ld_sock -lnsl && _ld_sock="$_ld_sock -lnsl"
 if test "$_ld_sock" ; then
-  echores "$_ld_sock"
+  echores "using $_ld_sock"
 else
   echores "not needed"
 fi
@@ -1091,6 +1092,28 @@
 echores "$_dl"
 
 
+echocheck "dynamic linking"
+# FIXME !! make this dynamic detection to work
+# also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
+_ld_dl_dynamic=''
+if qnx ; then
+  _ld_dl_dynamic=''
+else
+  _ld_dl_dynamic='-rdynamic'
+fi
+#cat > $TMPC << EOF
+#int main(void) { return 0; }
+#EOF
+#if cc_check -rdynamic ; then
+#  _ld_dl_dynamic='-rdynamic'
+#elif cc_check -Bdynamic ; then
+#  _ld_dl_dynamic='-Bdynamic'
+#elif cc_check ; then
+#  _ld_dl_dynamic=''
+#fi
+echores "using $_ld_dl_dynamic"
+
+
 echocheck "pthread"
 cat > $TMPC << EOF
 #include <pthread.h>
@@ -1103,7 +1126,7 @@
 elif cc_check -pthread ; then
   _ld_pthread='-pthread'
 else
-  die "Lib pthread not found."
+  die "Lib pthread not found. (needed by windows and networking stuff)"
 fi
 echores "using $_ld_pthread"
 
@@ -2342,8 +2365,8 @@
   _confcygwin="TARGET_CYGWIN = no"
 fi
 
-_ld_arch="$_ld_pthread $_ld_dl"
-bsd && _ld_arch="-rdynamic $_ld_arch"
+_ld_arch="$_ld_pthread $_ld_dl $_ld_dl_dynamic"
+#bsd && _ld_arch="-rdynamic $_ld_arch"
 bsdos && _ld_arch="$_ld_arch -ldvd"
 
 _def_debug='#undef MP_DEBUG'