Changeset 1592
- Timestamp:
- 02/17/10 09:10:01 (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CMakeLists.txt
r1572 r1592 175 175 set_property(TARGET imp_librt PROPERTY IMPORTED_LOCATION ${LIBRTDIR}/lib/librt.a) 176 176 else (EXISTS ${LIBRTDIR}/lib/librt.a) 177 message(STATUS " ${LIBRTDIR}/lib/librt.a not found (needed by libusb . No smartreader support)")177 message(STATUS " ${LIBRTDIR}/lib/librt.a not found (needed by libusb). No smartreader support)") 178 178 unset (HAVE_LIBRT_STATIC) 179 179 endif (EXISTS ${LIBRTDIR}/lib/librt.a) 180 else if(HAVE_LIBRT_STATIC)181 message(STATUS " no librt found (needed by libusb . No smartreader support")180 else (HAVE_LIBRT_STATIC) 181 message(STATUS " no librt found (needed by libusb). No smartreader support") 182 182 endif (HAVE_LIBRT_STATIC) 183 183 else (LIBRTDIR) … … 185 185 if (HAVE_LIBRT) 186 186 message(STATUS " librt found (needed by libusb).") 187 target_link_libraries (${exe_name} rt)188 187 else (HAVE_LIBRT) 189 188 message(STATUS " no librt found (needed by libusb. No smartreader support") … … 195 194 196 195 197 if (LIBUSBDIR) 198 check_include_file ("${LIBUSBDIR}/include/libusb-1.0/libusb.h" HAVE_LIBUSB) 199 if (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 200 if (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 201 message(STATUS " static libusb 1.0 found (${LIBUSBDIR}/lib/libusb-1.0.a). Adding smartreader support ") 202 add_definitions ("-DLIBUSB") 203 add_definitions ("-I${LIBUSBDIR}/include/") 204 add_library(imp_libusb STATIC IMPORTED) 205 set_property(TARGET imp_libusb PROPERTY IMPORTED_LOCATION ${LIBUSBDIR}/lib/libusb-1.0.a) 206 else (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 207 unset(HAVE_LIBUSB) 208 unset(HAVE_LIBRT) 209 unset(HAVE_LIBRT_STATIC) 210 endif (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 211 elseif (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 212 message(STATUS " no libusb 1.0 found or missing librt. No smartreader support") 213 endif (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 214 else (LIBUSBDIR) 215 check_include_file ("libusb-1.0/libusb.h" HAVE_LIBUSB) 216 if (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 217 if (EXISTS /usr/local/lib/libusb-1.0.a) 218 message(STATUS " static libusb 1.0 found : /usr/local/lib/libusb-1.0.a . Adding smartreader support ") 219 add_definitions ("-DLIBUSB") 220 add_definitions ("-I/usr/local/include") 221 add_library(imp_libusb STATIC IMPORTED) 222 set_property(TARGET imp_libusb PROPERTY IMPORTED_LOCATION /usr/local/lib/libusb-1.0.a) 223 else (EXISTS /usr/local/lib/libusb-1.0.a) 224 unset(HAVE_LIBUSB) 225 unset(HAVE_LIBRT) 226 unset(HAVE_LIBRT_STATIC) 227 endif (EXISTS /usr/local/lib/libusb-1.0.a) 228 else (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 229 message(STATUS " no libusb 1.0 found or missing librt. No smartreader support") 230 endif (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 231 endif (LIBUSBDIR) 196 if( HAVE_LIBRT OR HAVE_LIBRT_STATIC) 197 if (LIBUSBDIR) 198 check_include_file ("${LIBUSBDIR}/include/libusb-1.0/libusb.h" HAVE_LIBUSB) 199 if (HAVE_LIBUSB AND HAVE_PTHREAD) 200 if (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 201 message(STATUS " static libusb 1.0 found (${LIBUSBDIR}/lib/libusb-1.0.a). Adding smartreader support ") 202 add_definitions ("-DLIBUSB") 203 add_definitions ("-I${LIBUSBDIR}/include/") 204 add_library(imp_libusb STATIC IMPORTED) 205 set_property(TARGET imp_libusb PROPERTY IMPORTED_LOCATION ${LIBUSBDIR}/lib/libusb-1.0.a) 206 else (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 207 message(STATUS " static libusb 1.0 not found (${LIBUSBDIR}/lib/libusb-1.0.a). No smartreader support ") 208 unset(HAVE_LIBUSB) 209 unset(HAVE_LIBRT) 210 unset(HAVE_LIBRT_STATIC) 211 endif (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 212 else (HAVE_LIBUSB AND HAVE_PTHREAD) 213 message(STATUS " no libusb 1.0 found. No smartreader support") 214 endif (HAVE_LIBUSB AND HAVE_PTHREAD) 215 else (LIBUSBDIR) 216 check_include_file ("libusb-1.0/libusb.h" HAVE_LIBUSB) 217 if (HAVE_LIBUSB AND HAVE_PTHREAD) 218 if (EXISTS /usr/local/lib/libusb-1.0.a) 219 message(STATUS " static libusb 1.0 found : /usr/local/lib/libusb-1.0.a . Adding smartreader support ") 220 add_definitions ("-DLIBUSB") 221 add_definitions ("-I/usr/local/include") 222 add_library(imp_libusb STATIC IMPORTED) 223 set_property(TARGET imp_libusb PROPERTY IMPORTED_LOCATION /usr/local/lib/libusb-1.0.a) 224 else (EXISTS /usr/local/lib/libusb-1.0.a) 225 message(STATUS " static libusb 1.0 not found (/usr/local/lib/libusb-1.0.a) . No smartreader support ") 226 unset(HAVE_LIBUSB) 227 unset(HAVE_LIBRT) 228 unset(HAVE_LIBRT_STATIC) 229 endif (EXISTS /usr/local/lib/libusb-1.0.a) 230 else (HAVE_LIBUSB AND HAVE_PTHREAD) 231 message(STATUS " no libusb 1.0 found. No smartreader support") 232 endif (HAVE_LIBUSB AND HAVE_PTHREAD) 233 endif (LIBUSBDIR) 234 endif( HAVE_LIBRT OR HAVE_LIBRT_STATIC) 232 235 233 236 … … 282 285 add_executable (${exe_name} ${exe_srcs} ${exe_hdrs}) 283 286 target_link_libraries (${exe_name} ${csoscam} ${csmodules} ${csreaders} csctapi cscrypt) 287 if(HAVE_LIBRT AND HAVE_LIBUSB) 288 target_link_libraries (${exe_name} imp_libusb) 289 if (NOT OSCamOperatingSystem MATCHES "Mac OS X") 290 target_link_libraries (${exe_name} rt) 291 endif (NOT OSCamOperatingSystem MATCHES "Mac OS X") 292 endif(HAVE_LIBRT AND HAVE_LIBUSB) 293 294 if (HAVE_LIBRT_STATIC AND HAVE_LIBUSB) 295 target_link_libraries (${exe_name} imp_libusb) 296 if (NOT OSCamOperatingSystem MATCHES "Mac OS X") 297 target_link_libraries (${exe_name} imp_librt) 298 endif (NOT OSCamOperatingSystem MATCHES "Mac OS X") 299 endif (HAVE_LIBRT_STATIC AND HAVE_LIBUSB) 300 284 301 if (HAVE_PTHREAD) 285 302 target_link_libraries (${exe_name} pthread) … … 295 312 endif (HAVE_PCSC) 296 313 297 if (HAVE_LIBUSB)298 target_link_libraries (${exe_name} imp_libusb)299 endif (HAVE_LIBUSB)300 301 if (HAVE_LIBRT_STATIC)302 target_link_libraries (${exe_name} imp_librt)303 endif (HAVE_LIBRT_STATIC)304 305 if(HAVE_LIBRT AND NOT OSCamOperatingSystem MATCHES "Mac OS X")306 target_link_libraries (${exe_name} rt)307 endif(HAVE_LIBRT AND NOT OSCamOperatingSystem MATCHES "Mac OS X")308 314 309 315 add_dependencies (${exe_name} ${csoscam} ${csreaders} ${csmodules}) -
trunk/Maketype
r1524 r1592 84 84 85 85 $(EXEFILE1): oscam.c $(LIBFILE1) $(LIBFILE2) $(LIBFILE3) $(GENERAL) 86 $(CC) $(LDFLAGS) oscam.c $(LIBFILE1) $(LIBFILE2) $(LIBFILE3) $(LIBUSB) -o "$@" $(LIBS)86 $(CC) $(LDFLAGS) oscam.c $(LIBFILE1) $(LIBFILE2) $(LIBFILE3) $(LIBUSB) $(LIBRT) -o "$@" $(LIBS) 87 87 $(STRIP) $@ 88 88 89 89 $(EXEFILE2): utils/list_smargo.c 90 $(CC) $(LDFLAGS) utils/list_smargo.c $(LIBUSB) -o "$@" $(LIBS)90 $(CC) $(LDFLAGS) utils/list_smargo.c $(LIBUSB) $(LIBRT) -o "$@" $(LIBS) 91 91 $(STRIP) $@ 92 92 -
trunk/csctapi/CMakeLists.txt
r1391 r1592 4 4 file (GLOB csctapi_hdrs "*.h") 5 5 6 check_include_file ("usb.h" HAVE_LIBUSB)7 if (HAVE_LIBUSB)8 add_definitions ("-DLIBUSB")9 target_link_libraries (${exe_name} usb)10 endif (HAVE_LIBUSB)11 6 12 7 check_include_file ("pthread.h" HAVE_PTHREAD) 13 8 if (HAVE_PTHREAD) 14 9 add_definitions ("-DHAVE_PTHREAD_H") 15 target_link_libraries (${exe_name} pthread)16 10 endif (HAVE_PTHREAD) 11 12 if (NOT OSCamOperatingSystem MATCHES "Mac OS X") 13 if (LIBRTDIR) 14 check_include_file ("${LIBRTDIR}/include/time.h" HAVE_LIBRT_STATIC) 15 if (HAVE_LIBRT_STATIC) 16 if (EXISTS ${LIBRTDIR}/lib/librt.a) 17 add_definitions ("-I${LIBRTDIR}/include/") 18 else (EXISTS ${LIBRTDIR}/lib/librt.a) 19 unset (HAVE_LIBRT_STATIC) 20 endif (EXISTS ${LIBRTDIR}/lib/librt.a) 21 elseif (HAVE_LIBRT_STATIC) 22 set (HAVE_LIBRT_STATIC False) 23 endif (HAVE_LIBRT_STATIC) 24 else (LIBRTDIR) 25 check_include_file ("time.h" HAVE_LIBRT) 26 if (HAVE_LIBRT) 27 set (HAVE_LIBRT True) 28 else (HAVE_LIBRT) 29 set (HAVE_LIBRT False) 30 endif (HAVE_LIBRT) 31 endif (LIBRTDIR) 32 else (NOT OSCamOperatingSystem MATCHES "Mac OS X") 33 set (HAVE_LIBRT True) 34 endif (NOT OSCamOperatingSystem MATCHES "Mac OS X") 35 36 37 check_include_file ("libusb-1.0/libusb.h" HAVE_LIBUSB) 38 if (HAVE_LIBUSB AND HAVE_PTHREAD AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 39 add_definitions ("-DLIBUSB") 40 endif (HAVE_LIBUSB AND HAVE_PTHREAD AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 17 41 18 42 … … 20 44 add_definitions ("-O2 -Winline -Werror -finline-functions -fomit-frame-pointer -s -m32") 21 45 SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" ) 22 23 FIND_PATH( USB_INCLUDE usb.h)24 if( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )25 set (HAVE_LIBUSB "0")26 else ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )27 FIND_LIBRARY (USB_LIBRARY usb)28 target_link_libraries ( ${exe_name} ${USB_LIBRARY})29 include_directories( SYSTEM ${USB_INCLUDE})30 set (HAVE_LIBUSB "1")31 add_definitions ("-DLIBUSB")32 endif ( ${USB_INCLUDE} MATCHES "USB_INCLUDE-NOTFOUND" )33 46 else (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 34 47 add_definitions ("-O2 -Winline -Werror -finline-functions -fomit-frame-pointer -s") -
trunk/module-cccam.c
r1584 r1592 184 184 MSG_CW_ECM, 185 185 MSG_CARD_REMOVED = 4, 186 MSG_ DCW_SOMETHING, // this still needs to be worked out186 MSG_BAD_ECM, 187 187 MSG_KEEPALIVE, 188 188 MSG_NEW_CARD, 189 189 MSG_SRV_DATA, 190 MSG_CMD_0B = 0x0b, 190 191 MSG_CW_NOK1 = 0xfe, 191 192 MSG_CW_NOK2 = 0xff, … … 786 787 cs_debug("cccam: keepalive"); 787 788 break; 788 case MSG_DCW_SOMETHING: 789 cc->ecm_count = 1; 790 cs_log("cccam: cmd 0x05 recvd, commencing ecm count"); 789 case MSG_BAD_ECM: 790 //cc->ecm_count = 1; 791 //cs_log("cccam: cmd 0x05 recvd, commencing ecm count"); 792 cc_cmd_send(NULL, 0, MSG_BAD_ECM); 791 793 break; 794 case MSG_CMD_0B: 795 // need to work out algo (reverse) for this... 796 cc_cycle_connection(); 792 797 default: 793 798 break; … … 819 824 static void cc_send_dcw(ECM_REQUEST *er) 820 825 { 821 uchar buf[16] , cw[8];826 uchar buf[16]; 822 827 struct cc_data *cc; 823 828 … … 1127 1132 cc_crypt(&cc->block[DECRYPT], buf, 20, DECRYPT); 1128 1133 cs_ddump(buf, 20, "cccam: username '%s':", buf); 1129 strncpy(usr, buf, sizeof(usr));1134 strncpy(usr, (char *)buf, sizeof(usr)); 1130 1135 } else return -1; 1131 1136 1132 for ( i=0,account=cfg->account; account; account=account->next)1137 for (account=cfg->account; account; account=account->next) 1133 1138 if (!strcmp(usr, account->usr)) break; 1134 1139 -
trunk/oscam-config.c
r1583 r1592 538 538 } 539 539 bzero(cfg->cc_version, sizeof(cfg->cc_version)); 540 strncpy( cfg->cc_version, value, sizeof(cfg->cc_version)-1);540 strncpy((char*)cfg->cc_version, value, sizeof(cfg->cc_version)-1); 541 541 return; 542 542 } … … 547 547 } 548 548 bzero(cfg->cc_build, sizeof(cfg->cc_build)); 549 strncpy( cfg->cc_build, value, sizeof(cfg->cc_build)-1);549 strncpy((char*)cfg->cc_build, value, sizeof(cfg->cc_build)-1); 550 550 return; 551 551 } -
trunk/utils/CMakeLists.txt
r1572 r1592 1 project (Utils C)1 project (Utils C) 2 2 3 3 #----------------------- minimum version of cmake to use ------------ … … 150 150 set_property(TARGET utils_imp_librt PROPERTY IMPORTED_LOCATION ${LIBRTDIR}/lib/librt.a) 151 151 else (EXISTS ${LIBRTDIR}/lib/librt.a) 152 message(STATUS " ${LIBRTDIR}/lib/librt.a not found (needed by libusb . No smartreader support)")152 message(STATUS " ${LIBRTDIR}/lib/librt.a not found (needed by libusb). No smartreader support)") 153 153 unset (HAVE_LIBRT_STATIC) 154 154 endif (EXISTS ${LIBRTDIR}/lib/librt.a) 155 else if(HAVE_LIBRT_STATIC)156 message(STATUS " no librt found (needed by libusb . No smartreader support")155 else (HAVE_LIBRT_STATIC) 156 message(STATUS " no librt found (needed by libusb). No smartreader support") 157 157 endif (HAVE_LIBRT_STATIC) 158 158 else (LIBRTDIR) … … 160 160 if (HAVE_LIBRT) 161 161 message(STATUS " librt found (needed by libusb).") 162 target_link_libraries (${util_name} rt)163 162 else (HAVE_LIBRT) 164 163 message(STATUS " no librt found (needed by libusb. No smartreader support") … … 169 168 endif (NOT OSCamOperatingSystem MATCHES "Mac OS X") 170 169 171 172 if (LIBUSBDIR) 173 check_include_file ("${LIBUSBDIR}/include/libusb-1.0/libusb.h" HAVE_LIBUSB) 174 if (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 175 if (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 176 message(STATUS " static libusb 1.0 found (${LIBUSBDIR}/lib/libusb-1.0.a). Adding smartreader support ") 177 add_definitions ("-DLIBUSB") 178 add_definitions ("-I${LIBUSBDIR}/include/") 179 add_library(utils_imp_libusb STATIC IMPORTED) 180 set_property(TARGET utils_imp_libusb PROPERTY IMPORTED_LOCATION ${LIBUSBDIR}/lib/libusb-1.0.a) 181 else (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 182 unset(HAVE_LIBUSB) 183 unset(HAVE_LIBRT) 184 unset(HAVE_LIBRT_STATIC) 185 endif (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 186 elseif (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 187 message(STATUS " no libusb 1.0 found or missing librt. No smartreader support") 188 endif (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 189 else (LIBUSBDIR) 190 check_include_file ("libusb-1.0/libusb.h" HAVE_LIBUSB) 191 if (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 192 if (EXISTS /usr/local/lib/libusb-1.0.a) 193 message(STATUS " static libusb 1.0 found : /usr/local/lib/libusb-1.0.a . Adding smartreader support ") 194 add_definitions ("-DLIBUSB") 195 add_definitions ("-I/usr/local/include") 196 add_library(utils_imp_libusb STATIC IMPORTED) 197 set_property(TARGET utils_imp_libusb PROPERTY IMPORTED_LOCATION /usr/local/lib/libusb-1.0.a) 198 else (EXISTS /usr/local/lib/libusb-1.0.a) 199 unset(HAVE_LIBUSB) 200 unset(HAVE_LIBRT) 201 unset(HAVE_LIBRT_STATIC) 202 endif (EXISTS /usr/local/lib/libusb-1.0.a) 203 else (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 204 message(STATUS " no libusb 1.0 found or missing librt. No smartreader support") 205 endif (HAVE_LIBUSB AND HAVE_LIBRT OR HAVE_LIBRT_STATIC) 206 endif (LIBUSBDIR) 170 check_include_file ("pthread.h" HAVE_PTHREAD) 171 if (HAVE_PTHREAD) 172 message(STATUS "Utils: pthread found. Adding pthread support ") 173 add_definitions ("-DHAVE_PTHREAD_H") 174 elseif (HAVE_PTHREAD) 175 message(STATUS "Utils: no pthread found. No smartreader ") 176 unset (HAVE_LIBRT) 177 unset (HAVE_LIBRT_STATIC) 178 endif (HAVE_PTHREAD) 179 180 181 if( HAVE_LIBRT OR HAVE_LIBRT_STATIC) 182 if (LIBUSBDIR) 183 check_include_file ("${LIBUSBDIR}/include/libusb-1.0/libusb.h" HAVE_LIBUSB) 184 if (HAVE_LIBUSB AND HAVE_PTHREAD) 185 if (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 186 message(STATUS " static libusb 1.0 found (${LIBUSBDIR}/lib/libusb-1.0.a). Adding smartreader support ") 187 add_definitions ("-DLIBUSB") 188 add_definitions ("-I${LIBUSBDIR}/include/") 189 add_library(utils_imp_libusb STATIC IMPORTED) 190 set_property(TARGET utils_imp_libusb PROPERTY IMPORTED_LOCATION ${LIBUSBDIR}/lib/libusb-1.0.a) 191 else (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 192 message(STATUS " static libusb 1.0 not found (${LIBUSBDIR}/lib/libusb-1.0.a). No smartreader support ") 193 unset(HAVE_LIBUSB) 194 unset(HAVE_LIBRT) 195 unset(HAVE_LIBRT_STATIC) 196 endif (EXISTS ${LIBUSBDIR}/lib/libusb-1.0.a) 197 else (HAVE_LIBUSB AND HAVE_PTHREAD) 198 message(STATUS " no libusb 1.0 found. No smartreader support") 199 endif (HAVE_LIBUSB AND HAVE_PTHREAD) 200 else (LIBUSBDIR) 201 check_include_file ("libusb-1.0/libusb.h" HAVE_LIBUSB) 202 if (HAVE_LIBUSB AND HAVE_PTHREAD) 203 if (EXISTS /usr/local/lib/libusb-1.0.a) 204 message(STATUS " static libusb 1.0 found : /usr/local/lib/libusb-1.0.a . Adding smartreader support ") 205 add_definitions ("-DLIBUSB") 206 add_definitions ("-I/usr/local/include") 207 add_library(utils_imp_libusb STATIC IMPORTED) 208 set_property(TARGET utils_imp_libusb PROPERTY IMPORTED_LOCATION /usr/local/lib/libusb-1.0.a) 209 else (EXISTS /usr/local/lib/libusb-1.0.a) 210 message(STATUS " static libusb 1.0 not found (/usr/local/lib/libusb-1.0.a) . No smartreader support ") 211 unset(HAVE_LIBUSB) 212 unset(HAVE_LIBRT) 213 unset(HAVE_LIBRT_STATIC) 214 endif (EXISTS /usr/local/lib/libusb-1.0.a) 215 else (HAVE_LIBUSB AND HAVE_PTHREAD) 216 message(STATUS " no libusb 1.0 found. No smartreader support") 217 endif (HAVE_LIBUSB AND HAVE_PTHREAD) 218 endif (LIBUSBDIR) 219 endif( HAVE_LIBRT OR HAVE_LIBRT_STATIC) 220 207 221 208 222 #---- are we building ? … … 219 233 set (util_name "list_smargo") 220 234 add_executable (${util_name} ${exe_srcs} ${exe_hdrs}) 235 221 236 target_link_libraries (${util_name} utils_imp_libusb) 222 237 … … 228 243 target_link_libraries (${util_name} utils_imp_librt) 229 244 endif (HAVE_LIBRT_STATIC) 245 246 if (HAVE_PTHREAD) 247 target_link_libraries (${util_name} pthread) 248 endif (HAVE_PTHREAD) 230 249 231 250 #----------------------- specific options ------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.