--- server/CMakeLists.txt.orig	2015-05-26 23:34:37 UTC
+++ server/CMakeLists.txt
@@ -21,6 +21,8 @@ configure_file(vendor.h.in vendor.h)
 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
 	../common)
 
+ADD_DEFINITIONS(-fPIC)
+
 set(FBXFAKERLIB fbx-faker)
 if(VGL_USEXV)
 	set(FBXFAKERLIB ${FBXFAKERLIB};fbxv)
@@ -73,9 +75,9 @@ if(MAPFLAG)
 	set_source_files_properties(faker-sym.cpp PROPERTIES
 		OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/faker-mapfile)
 	set_target_properties(${VGL_RRFAKER_NAME} PROPERTIES
-		LINK_FLAGS "-z defs ${MAPFLAG}${CMAKE_CURRENT_BINARY_DIR}/faker-mapfile")
+		LINK_FLAGS "-Wl,-z,defs ${MAPFLAG}${CMAKE_CURRENT_BINARY_DIR}/faker-mapfile")
 else()
-	set_target_properties(${VGL_RRFAKER_NAME} PROPERTIES LINK_FLAGS "-z defs")
+	set_target_properties(${VGL_RRFAKER_NAME} PROPERTIES LINK_FLAGS "-Wl,-z,defs")
 endif()
 if(VGL_FAKEXCB)
 	set(LIBXCB xcb xcb-glx xcb-keysyms X11-xcb)
@@ -99,7 +101,7 @@ target_link_libraries(${VGL_DLFAKER_NAME
 install(TARGETS ${VGL_DLFAKER_NAME} DESTINATION ${VGL_LIBDIR})
 
 add_library(${VGL_GEFAKER_NAME} SHARED gefaker.c)
-set_target_properties(${VGL_GEFAKER_NAME} PROPERTIES LINK_FLAGS "-z defs")
+set_target_properties(${VGL_GEFAKER_NAME} PROPERTIES LINK_FLAGS "-Wl,-z,defs")
 target_link_libraries(${VGL_GEFAKER_NAME} ${LIBDL})
 install(TARGETS ${VGL_GEFAKER_NAME} DESTINATION ${VGL_LIBDIR})
 
@@ -148,8 +150,8 @@ target_link_libraries(dlfakerut ${X11_X1
 add_library(GLdlfakerut SHARED libGLdlfakerut.c)
 
 add_executable(fakerut fakerut.cpp fakerut-supplement.c)
-target_link_libraries(fakerut "-z now ${OPENGL_gl_LIBRARY}"
-	${OPENGL_glu_LIBRARY} "-z now ${X11_X11_LIB}" ${LIBDL} vglutil)
+target_link_libraries(fakerut "-Wl,-z,now ${OPENGL_gl_LIBRARY}"
+	${OPENGL_glu_LIBRARY} "-Wl,-z,now ${X11_X11_LIB}" ${LIBDL} vglutil)
 
 add_library(vgltrans_test SHARED testplugin.cpp VGLTrans.cpp)
 if(VGL_USESSL AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
