diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2007-09-28 18:42:21 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-09-28 18:42:21 -0600 |
commit | 2a3e33865dd9a3d064a3c0af94ef11d4aa4a6ce4 (patch) | |
tree | 340934443ff1acfa3100001391a55e24744ad9bf | |
parent | e776e7a95a4fc4fac95048665ab4c981e153b7fb (diff) |
add support for LDFLAGS env var
35 files changed, 87 insertions, 77 deletions
@@ -34,6 +34,7 @@ MINOR=0 PATCH="" DEPS="" LINK="" +LDFLAGS="" CPLUSPLUS=0 STATIC=0 DLOPEN=0 @@ -63,6 +64,7 @@ do echo ' -LDIR search in DIR for library dependencies' echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)' echo ' Not observed on all systems at this time.' + echo ' -ldflags OPT specify any additional linker flags in OPT' echo ' -cplusplus link with C++ runtime' echo ' -static make a static library (default is dynamic/shared)' echo ' -dlopen make a shared library suitable for dynamic loading' @@ -94,6 +96,10 @@ do shift 1; LINK=$1 ;; + '-ldflags') + shift 1; + LDFLAGS=$1 + ;; -l*) DEPS="$DEPS $1" ;; @@ -215,7 +221,7 @@ case $ARCH in rm -f ${LIBNAME} # make lib - ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} # finish up FINAL_LIBS="${LIBNAME}" elif [ $STATIC = 1 ] ; then @@ -273,7 +279,7 @@ case $ARCH in rm -f ${LIBNAME}.so # make lib - ${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} # make usual symlinks ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so @@ -345,10 +351,10 @@ case $ARCH in #echo "mklib: linker is" ${LINK} ${OPTS} if [ $NOPREFIX = 1 ] ; then rm -f ${LIBNAME} - ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} else rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} - ${LINK} ${OPTS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} fi FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" @@ -372,7 +378,7 @@ case $ARCH in echo "mklib: Making FreeBSD shared library: " ${LIBNAME} OPTS="-shared" rm -f ${LIBNAME} - ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} FINAL_LIBS=${LIBNAME} elif [ $STATIC = 1 ] ; then STLIB="lib${LIBNAME}.a" @@ -386,7 +392,7 @@ case $ARCH in OPTS="-shared -Wl,-soname,${SHLIB}" echo "mklib: Making FreeBSD shared library: " ${SHLIB} rm -f ${SHLIB} - ${LINK} ${OPTS} -o ${SHLIB} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${SHLIB} ${OBJECTS} ${DEPS} ln -sf ${SHLIB} "lib${LIBNAME}.so" FINAL_LIBS="${SHLIB} lib${LIBNAME}.so" fi @@ -444,7 +450,7 @@ case $ARCH in fi echo "mklib: Making IRIX " ${ABI} " shared library: " ${LIBNAME} - ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} FINAL_LIBS=${LIBNAME} fi ;; @@ -520,9 +526,9 @@ case $ARCH in # On AIX a shared library is linked differently when # you want to dlopen the file if [ $DLOPEN = "1" ] ; then - cc -G ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + cc -G ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} else - cc ${OPTS} -o ${OFILE} ${OBJECTS} ${DEPS} + cc ${OPTS} ${LDFLAGS} -o ${OFILE} ${OBJECTS} ${DEPS} ar ${X64} -r ${LIBNAME} ${OFILE} fi @@ -604,7 +610,7 @@ case $ARCH in fi echo "mklib: Making Darwin shared library: " ${LIBNAME} - ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} ln -s ${LIBNAME} ${LINKNAME} FINAL_LIBS="${LIBNAME} ${LINKNAME}" fi @@ -681,7 +687,7 @@ case $ARCH in rm -f ${LIBNAME}.so.${MAJOR} rm -f ${LIBNAME}.so # make lib - ${LINK} ${OPTS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} # make usual symlinks ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so @@ -753,7 +759,7 @@ case $ARCH in rm -f ${LIBNAME}.a # make lib - ${LINK} ${OPTS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} + ${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} # make usual symlinks ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a # finish up diff --git a/configs/default b/configs/default index a7de3f813d..620445f684 100644 --- a/configs/default +++ b/configs/default @@ -20,6 +20,7 @@ CC = cc CXX = CC CFLAGS = -O CXXFLAGS = -O +LDFLAGS = GLU_CFLAGS = # Misc tools and flags diff --git a/progs/demos/Makefile b/progs/demos/Makefile index 7bfcefd02d..4d9eb30b68 100644 --- a/progs/demos/Makefile +++ b/progs/demos/Makefile @@ -75,7 +75,7 @@ PROGS = \ # make executable from .c file: .c: $(LIB_DEP) readtex.o - $(CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -119,35 +119,35 @@ extfuncs.h: $(TOP)/progs/util/extfuncs.h reflect: reflect.o showbuffer.o readtex.o - $(CC) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(APP_LIB_DEPS) -o $@ reflect.o: reflect.c showbuffer.h $(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c shadowtex: shadowtex.o showbuffer.o - $(CC) shadowtex.o showbuffer.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) shadowtex.o showbuffer.o $(APP_LIB_DEPS) -o $@ shadowtex.o: shadowtex.c showbuffer.h $(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c gloss: gloss.o trackball.o readtex.o - $(CC) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) gloss.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@ gloss.o: gloss.c trackball.h $(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c engine: engine.o trackball.o readtex.o - $(CC) engine.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) engine.o trackball.o readtex.o $(APP_LIB_DEPS) -o $@ engine.o: engine.c trackball.h $(CC) -c -I$(INCDIR) $(CFLAGS) engine.c fslight: fslight.o - $(CC) fslight.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) fslight.o $(APP_LIB_DEPS) -o $@ fslight.o: fslight.c extfuncs.h $(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c diff --git a/progs/directfb/Makefile b/progs/directfb/Makefile index 53b100a18d..e03680e516 100644 --- a/progs/directfb/Makefile +++ b/progs/directfb/Makefile @@ -22,7 +22,7 @@ PROGS = df_gears \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### diff --git a/progs/egl/Makefile b/progs/egl/Makefile index 33447a9d57..07215604d3 100644 --- a/progs/egl/Makefile +++ b/progs/egl/Makefile @@ -25,35 +25,35 @@ default: $(PROGRAMS) demo1: demo1.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) demo1.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) demo1.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@ demo1.o: demo1.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include demo1.c demo2: demo2.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) demo2.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) demo2.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ demo2.o: demo2.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c demo3: demo3.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) demo3.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) demo3.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ demo3.o: demo3.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include demo3.c eglinfo: eglinfo.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@ eglinfo.o: eglinfo.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c eglgears: eglgears.o $(TOP)/$(LIB_DIR)/libEGL.so - $(CC) $(CFLAGS) eglgears.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) eglgears.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@ eglgears.o: eglgears.c $(HEADERS) $(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c diff --git a/progs/fbdev/Makefile b/progs/fbdev/Makefile index 0a0c77906f..92bfd043c1 100644 --- a/progs/fbdev/Makefile +++ b/progs/fbdev/Makefile @@ -22,7 +22,7 @@ INCLUDES = \ .SUFFIXES: .c .c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@ .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index a9800c5414..8b44239b43 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -28,7 +28,7 @@ PROGS = \ # make executable from .c file: .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -64,7 +64,7 @@ points.c: extfuncs.h toyball.c: extfuncs.h texdemo1: texdemo1.o readtex.o - $(CC) -I$(INCDIR) $(CFLAGS) texdemo1.o readtex.o $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o $(APP_LIB_DEPS) -o $@ texdemo1.o: texdemo1.c readtex.h extfuncs.h $(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c diff --git a/progs/miniglx/Makefile b/progs/miniglx/Makefile index 7f1e162186..56cecf4081 100644 --- a/progs/miniglx/Makefile +++ b/progs/miniglx/Makefile @@ -27,7 +27,7 @@ INCLUDES = \ .SUFFIXES: .c .c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@ .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ diff --git a/progs/osdemos/Makefile b/progs/osdemos/Makefile index f8cba9ee99..7e657744e3 100644 --- a/progs/osdemos/Makefile +++ b/progs/osdemos/Makefile @@ -26,7 +26,7 @@ PROGS = \ # make executable from .c file: .c: $(LIB_DEP) readtex.o - $(CC) -I$(INCDIR) $(CFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< readtex.o $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -56,19 +56,19 @@ showbuffer.o: showbuffer.c showbuffer.h # special case: need the -lOSMesa library: osdemo: osdemo.c - $(CC) -I$(INCDIR) $(CFLAGS) osdemo.c $(OSMESA_LIBS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) osdemo.c $(OSMESA_LIBS) -o $@ # special case: need the -lOSMesa library: ostest1: ostest1.c - $(CC) -I$(INCDIR) $(CFLAGS) ostest1.c $(OSMESA_LIBS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) ostest1.c $(OSMESA_LIBS) -o $@ # another special case: need the -lOSMesa16 library: osdemo16: osdemo16.c - $(CC) -I$(INCDIR) $(CFLAGS) osdemo16.c $(OSMESA16_LIBS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) osdemo16.c $(OSMESA16_LIBS) -o $@ # another special case: need the -lOSMesa32 library: osdemo32: osdemo32.c - $(CC) -I$(INCDIR) $(CFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) osdemo32.c $(OSMESA32_LIBS) -o $@ diff --git a/progs/redbook/Makefile b/progs/redbook/Makefile index febc74441b..078f19125a 100644 --- a/progs/redbook/Makefile +++ b/progs/redbook/Makefile @@ -24,7 +24,7 @@ PROGS = aaindex aapoly aargb accanti accpersp alpha alpha3D anti \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@ diff --git a/progs/samples/Makefile b/progs/samples/Makefile index 063008dccf..8c99e8df25 100644 --- a/progs/samples/Makefile +++ b/progs/samples/Makefile @@ -18,7 +18,7 @@ PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -27,7 +27,7 @@ default: $(PROGS) sphere: sphere.o readtex.o - $(CC) -I$(INCDIR) $(CFLAGS) sphere.o readtex.o $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) sphere.o readtex.o $(APP_LIB_DEPS) -o $@ sphere.o: sphere.c readtex.h $(CC) -c -I$(INCDIR) $(CFLAGS) sphere.c diff --git a/progs/slang/Makefile b/progs/slang/Makefile index 1c602ce49c..61db26d080 100644 --- a/progs/slang/Makefile +++ b/progs/slang/Makefile @@ -29,13 +29,13 @@ clean: # cltest: cltest.o framework.o $(LIB_DEP) - $(CC) cltest.o framework.o $(APP_LIB_DEPS) -o cltest + $(CC) $(LDFLAGS) cltest.o framework.o $(APP_LIB_DEPS) -o cltest sotest: sotest.o framework.o $(LIB_DEP) - $(CC) sotest.o framework.o $(APP_LIB_DEPS) -o sotest + $(CC) $(LDFLAGS) sotest.o framework.o $(APP_LIB_DEPS) -o sotest vstest: vstest.o framework.o $(LIB_DEP) - $(CC) vstest.o framework.o $(APP_LIB_DEPS) -o vstest + $(CC) $(LDFLAGS) vstest.o framework.o $(APP_LIB_DEPS) -o vstest # # objects diff --git a/progs/tests/Makefile b/progs/tests/Makefile index 7d9f7b62ac..e8d0edda3a 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -103,7 +103,7 @@ clean: .SUFFIXES: .c .c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ + $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ @@ -124,31 +124,31 @@ arraytexture.o: arraytexture.c readtex.h $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) arraytexture.c -o $@ afsmultiarb: afsmultiarb.o readtex.o - $(CC) $(CFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@ afsmultiarb.o: afsmultiarb.c readtex.h $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) afsmultiarb.c -o $@ drawbuffers: drawbuffers.o - $(CC) $(CFLAGS) drawbuffers.o $(LIBS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) drawbuffers.o $(LIBS) -o $@ drawbuffers.o: drawbuffers.c extfuncs.h $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) drawbuffers.c -o $@ texrect: texrect.o readtex.o - $(CC) $(CFLAGS) texrect.o readtex.o $(LIBS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@ texrect.o: texrect.c readtex.h $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) texrect.c -o $@ bug_3195: bug_3195.o readtex.o - $(CC) $(CFLAGS) bug_3195.o readtex.o $(LIBS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) bug_3195.o readtex.o $(LIBS) -o $@ bug_3195.o: bug_3195.c readtex.h $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) bug_3195.c -o $@ invert: invert.o readtex.o - $(CC) $(CFLAGS) invert.o readtex.o $(LIBS) -o $@ + $(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@ invert.o: invert.c readtex.h $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) invert.c -o $@ diff --git a/progs/tools/trace/Makefile b/progs/tools/trace/Makefile index 3f7bdcbc93..4b05fd87a5 100644 --- a/progs/tools/trace/Makefile +++ b/progs/tools/trace/Makefile @@ -17,7 +17,7 @@ default: $(TRACER) $(TRACER): $(OBJECTS) $(TOP)/bin/mklib -o $(TRACER) -noprefix -cplusplus \ - $(MKLIB_OPTIONS) $(OBJECTS) + -ldflags '$(LDFLAGS)' $(MKLIB_OPTIONS) $(OBJECTS) gltrace.cc: gltrace.py PYTHONPATH=$(TOP)/src/mesa/glapi python gltrace.py -f $(TOP)/src/mesa/glapi/gl_API.xml > gltrace.cc diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile index 341c115c07..259e20aa57 100644 --- a/progs/trivial/Makefile +++ b/progs/trivial/Makefile @@ -88,7 +88,7 @@ UTIL_FILES = readtex.h readtex.c .SUFFIXES: .c .c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ + $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ @@ -115,13 +115,13 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress. texrect: texrect.o readtex.o - $(CC) texrect.o readtex.o $(LIBS) -o $@ + $(CC) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@ texrect.o: texrect.c readtex.h $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ invert: invert.o readtex.o - $(CC) invert.o readtex.o $(LIBS) -o $@ + $(CC) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@ invert.o: invert.c readtex.h $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ diff --git a/progs/vp/Makefile b/progs/vp/Makefile index c3faeb5b60..4952a52fc9 100644 --- a/progs/vp/Makefile +++ b/progs/vp/Makefile @@ -26,7 +26,7 @@ INCLUDES = -I. -I$(TOP)/include -I../samples .SUFFIXES: .c .c: - $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@ + $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ .c.o: $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ diff --git a/progs/xdemos/Makefile b/progs/xdemos/Makefile index ba83a7dda4..c585026ad3 100644 --- a/progs/xdemos/Makefile +++ b/progs/xdemos/Makefile @@ -38,7 +38,7 @@ PROGS = glthreads \ .SUFFIXES: .c .c: $(LIB_DEP) - $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@ + $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@ ##### TARGETS ##### @@ -53,10 +53,10 @@ clean: # special cases pbinfo: pbinfo.o pbutil.o - $(CC) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@ pbdemo: pbdemo.o pbutil.o - $(CC) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@ pbinfo.o: pbinfo.c pbutil.h $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbinfo.c @@ -68,13 +68,13 @@ pbutil.o: pbutil.c pbutil.h $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbutil.c glxgears_fbconfig: glxgears_fbconfig.o pbutil.o - $(CC) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@ glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c xrotfontdemo: xrotfontdemo.o xuserotfont.o - $(CC) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@ + $(CC) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@ xuserotfont.o: xuserotfont.c xuserotfont.h $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xuserotfont.c diff --git a/src/egl/drivers/demo/Makefile b/src/egl/drivers/demo/Makefile index 5c05633df5..ad2ef38a72 100644 --- a/src/egl/drivers/demo/Makefile +++ b/src/egl/drivers/demo/Makefile @@ -21,7 +21,7 @@ default: $(TOP)/$(LIB_DIR)/demodriver.so $(TOP)/$(LIB_DIR)/demodriver.so: $(OBJECTS) - $(TOP)/bin/mklib -o demodriver.so -noprefix \ + $(TOP)/bin/mklib -o demodriver.so -noprefix -ldflags '$(LDFLAGS)' \ -install $(TOP)/$(LIB_DIR) $(OBJECTS) diff --git a/src/egl/drivers/dri/Makefile b/src/egl/drivers/dri/Makefile index cb11971c64..0214cf65a2 100644 --- a/src/egl/drivers/dri/Makefile +++ b/src/egl/drivers/dri/Makefile @@ -42,7 +42,7 @@ default: depend library Makefile library: $(TOP)/$(LIB_DIR)/libEGLdri.so $(TOP)/$(LIB_DIR)/libEGLdri.so: $(OBJECTS) - $(TOP)/bin/mklib -o EGLdri -major 1 -minor 0 \ + $(TOP)/bin/mklib -o EGLdri -ldflags '$(LDFLAGS)' -major 1 -minor 0 \ -install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS) diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile index 431eda4197..2a7046fb14 100644 --- a/src/egl/main/Makefile +++ b/src/egl/main/Makefile @@ -46,7 +46,7 @@ default: depend library library: $(TOP)/$(LIB_DIR)/libEGL.so $(TOP)/$(LIB_DIR)/libEGL.so: $(OBJECTS) - $(TOP)/bin/mklib -o EGL -major 1 -minor 0 \ + $(TOP)/bin/mklib -o EGL -ldflags '$(LDFLAGS)' -major 1 -minor 0 \ -install $(TOP)/$(LIB_DIR) -ldl $(OBJECTS) diff --git a/src/glu/mesa/Makefile b/src/glu/mesa/Makefile index 611d7a630c..fb377555be 100644 --- a/src/glu/mesa/Makefile +++ b/src/glu/mesa/Makefile @@ -45,7 +45,7 @@ $(TOP)/$(LIB_DIR): # Make the library: $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS) - @ $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CC)' \ + @ $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \ $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ $(GLU_LIB_DEPS) $(OBJECTS) diff --git a/src/glu/sgi/Makefile b/src/glu/sgi/Makefile index 2ce6ac0430..bb1c0a8aba 100644 --- a/src/glu/sgi/Makefile +++ b/src/glu/sgi/Makefile @@ -136,7 +136,7 @@ $(TOP)/$(LIB_DIR): # Make the library: $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS) - $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' \ + $(TOP)/bin/mklib -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \ -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \ -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ $(GLU_LIB_DEPS) $(OBJECTS) diff --git a/src/glut/beos/Makefile b/src/glut/beos/Makefile index 3ff928bfd7..165f43a6ce 100644 --- a/src/glut/beos/Makefile +++ b/src/glut/beos/Makefile @@ -83,7 +83,8 @@ $(TOP)/$(LIB_DIR): # Make the library $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - @$(TOP)/bin/mklib -o $(GLUT_LIB) -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ + @$(TOP)/bin/mklib -o $(GLUT_LIB) -ldflags '$(LDFLAGS)' \ + -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(GLUT_LIB_DEPS) \ $(OBJECTS) diff --git a/src/glut/directfb/Makefile b/src/glut/directfb/Makefile index 3791b16df8..aa77db91c6 100644 --- a/src/glut/directfb/Makefile +++ b/src/glut/directfb/Makefile @@ -61,7 +61,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) # Make the library $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \ + $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(OBJECTS) diff --git a/src/glut/fbdev/Makefile b/src/glut/fbdev/Makefile index d84d52ec48..948be0c7ba 100644 --- a/src/glut/fbdev/Makefile +++ b/src/glut/fbdev/Makefile @@ -63,7 +63,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) # Make the library $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \ + $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(OBJECTS) diff --git a/src/glut/ggi/Makefile b/src/glut/ggi/Makefile index 1bef6c23a3..c8805c27c0 100644 --- a/src/glut/ggi/Makefile +++ b/src/glut/ggi/Makefile @@ -32,7 +32,7 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) # Make the library $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \ + $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) \ -patch $(GLUT_TINY) $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ $(GLUT_LIB_DEPS) $(OBJECTS) diff --git a/src/glut/glx/Makefile b/src/glut/glx/Makefile index f73158ad38..9f995667b4 100644 --- a/src/glut/glx/Makefile +++ b/src/glut/glx/Makefile @@ -91,7 +91,7 @@ default: $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) # Make the library $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \ + $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ $(GLUT_LIB_DEPS) $(OBJECTS) diff --git a/src/glut/mini/Makefile b/src/glut/mini/Makefile index 177bfe2d2b..87ff43ce56 100644 --- a/src/glut/mini/Makefile +++ b/src/glut/mini/Makefile @@ -55,7 +55,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) # Make the library $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME): depend $(OBJECTS) - $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' \ + $(TOP)/bin/mklib -o $(GLUT_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GLUT_MAJOR) -minor $(GLUT_MINOR) -patch $(GLUT_TINY) \ $(GLUT_LIB_DEPS) -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(OBJECTS) diff --git a/src/glw/Makefile b/src/glw/Makefile index c32fc0ccad..727c5838be 100644 --- a/src/glw/Makefile +++ b/src/glw/Makefile @@ -48,7 +48,7 @@ clean: # Make the library $(TOP)/$(LIB_DIR)/$(GLW_LIB_NAME): $(OBJECTS) - $(TOP)/bin/mklib -o $(GLW_LIB) -linker '$(CC)' \ + $(TOP)/bin/mklib -o $(GLW_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(MAJOR) -minor $(MINOR) -patch $(TINY) \ $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \ $(GLW_LIB_DEPS) $(OBJECTS) diff --git a/src/glx/mini/Makefile b/src/glx/mini/Makefile index 71f085d5cd..96750d2c24 100644 --- a/src/glx/mini/Makefile +++ b/src/glx/mini/Makefile @@ -49,7 +49,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/miniglx.conf # Make libGL $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile - @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ + @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major 1 -minor 2 $(MKLIB_OPTIONS) \ -install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) \ $(LIBDRM_LIB) $(PCIACCESS_LIB) diff --git a/src/glx/x11/Makefile b/src/glx/x11/Makefile index 296747e0dd..9f0943a146 100644 --- a/src/glx/x11/Makefile +++ b/src/glx/x11/Makefile @@ -64,7 +64,7 @@ default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) # Make libGL $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) Makefile - $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ + $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major 1 -minor 2 $(MKLIB_OPTIONS) \ -install $(TOP)/$(LIB_DIR) $(GL_LIB_DEPS) $(OBJECTS) diff --git a/src/mesa/Makefile b/src/mesa/Makefile index c05b195957..a47cd4c023 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -65,7 +65,7 @@ linux-solo: depend subdirs libmesa.a # Stand-alone Mesa libGL, no built-in drivers (DirectFB) libgl-core: $(CORE_OBJECTS) - @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ + @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS) \ -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) $(CORE_OBJECTS) \ $(GL_LIB_DEPS) @@ -78,7 +78,7 @@ directfb: depend subdirs libgl-core # fbdev Mesa driver (libGL.so) fbdev: $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) $(COMMON_DRIVER_OBJECTS) - @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ + @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ $(CORE_OBJECTS) $(FBDEV_DRIVER_OBJECTS) \ @@ -111,7 +111,7 @@ osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) # Make the GL library $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) - @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' \ + @ $(TOP)/bin/mklib -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \ -install $(TOP)/$(LIB_DIR) \ $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(STAND_ALONE_OBJECTS) @@ -120,13 +120,13 @@ $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS) @ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \ $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \ - -major $(MESA_MAJOR) \ + -ldflags '$(LDFLAGS)' -major $(MESA_MAJOR) \ -minor $(MESA_MINOR) -patch $(MESA_TINY) \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ $(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \ else \ $(TOP)/bin/mklib -o $(OSMESA_LIB) -linker '$(CC)' \ - -major $(MESA_MAJOR) \ + -ldflags '$(LDFLAGS)' -major $(MESA_MAJOR) \ -minor $(MESA_MINOR) -patch $(GL_TINY) \ -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \ $(OSMESA_LIB_DEPS) $(OSMESA_DRIVER_OBJECTS) ; \ diff --git a/src/mesa/drivers/beos/Makefile b/src/mesa/drivers/beos/Makefile index 1897d6aa3e..9c7d6affc3 100644 --- a/src/mesa/drivers/beos/Makefile +++ b/src/mesa/drivers/beos/Makefile @@ -179,7 +179,8 @@ $(TOP)/$(LIB_DIR): mkdir $(TOP)/$(LIB_DIR) $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(MESA_MODULES) $(GLU_MODULES) - @$(TOP)/bin/mklib -o $(GL_LIB) -install $(TOP)/$(LIB_DIR) -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ + @$(TOP)/bin/mklib -o $(GL_LIB) -ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \ + -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \ $(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(OBJECTS) $(MESA_MODULES) $(GLU_MODULES) # $(GLU_OBJECTS): diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 770b19e161..3abce004c9 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -70,7 +70,7 @@ default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template - $(TOP)/bin/mklib -noprefix -o $@ \ + $(TOP)/bin/mklib -ldflags '$(LDFLAGS)' -noprefix -o $@ \ $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS) diff --git a/src/mesa/drivers/dri/glcore/Makefile b/src/mesa/drivers/dri/glcore/Makefile index a9e96970fa..968190acfc 100644 --- a/src/mesa/drivers/dri/glcore/Makefile +++ b/src/mesa/drivers/dri/glcore/Makefile @@ -61,7 +61,8 @@ default: depend $(TOP)/$(LIB_DIR)/$(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(TOP)/$(LIB_DIR) \ + CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(LIBNAME) -noprefix \ + -ldflags '$(LDFLAGS)' -install $(TOP)/$(LIB_DIR) \ $(OBJECTS) $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) |