File tree Expand file tree Collapse file tree 5 files changed +44
-4
lines changed Expand file tree Collapse file tree 5 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 11
2+ include  config.mk
3+ 
4+ CFLAGS+="-std =c99"
5+ CFLAGS+ =$(JSON_C_CFLAGS ) 
6+ LDFLAGS+ =$(JSON_C_LDFLAGS ) 
7+ 
28json-search : json-search.o
3- 	$(CC )  -ljson-c -std=c99 -Wall -Wextra json-search.o -o json-search
9+ 	$(CC )  -ljson-c $( JSON_C_LDFLAGS )   -std=c99 -Wall -Wextra json-search.o -o json-search
410
511appimagetool-x86_64.AppImage :
612	wget https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
@@ -11,7 +17,7 @@ json-search-x86_64.AppImage: json-search appimagetool-x86_64.AppImage
1117	mkdir -p json-search.AppDir/usr/bin/
1218	mkdir -p json-search.AppDir/usr/lib/
1319	cp json-search json-search.AppDir/usr/bin/
14- 	cp  $( shell  ldd json-search | grep json | cut -d ' ' -f  3)  json-search.AppDir/usr/lib/ 
20+ 	./cp_json-c.sh 
1521	./appimagetool-x86_64.AppImage json-search.AppDir
1622
1723clean :
Original file line number Diff line number Diff line change 1+ 
2+ JSON_C_CFLAGS =-I/usr/include/json-c
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ 
3+ DIR=$PWD 
4+ NO_RECOMPILE=1
5+ 
6+ echo  " "   >  config.mk
7+ echo  ' #!/bin/bash'   >  ./cp_json-c.sh
8+ chmod +x ./cp_json-c.sh
9+ 
10+ for  arg  in  $@ ;  do 
11+     echo  $(  echo  " $arg "   |  cut -d ' ='   -f 1) 
12+     if  [ " --compile-json-c"   =  $arg  ];  then 
13+ 	git clone https://github.com/json-c/json-c.git
14+ 	 mkdir json-c-build
15+ 	 cd  json-c-build
16+ 	 cmake3 ../json-c/
17+ 	 make
18+ 	 cd  -
19+ 	 NO_RECOMPILE=0
20+ 	 echo  ' JSON_C_CFLAGS=-I./json-c -I./json-c-build'   >>  config.mk
21+ 	 echo  ' JSON_C_LDFLAGS="-L./json-c-build"'   >>  config.mk
22+ 	 echo  " cp json-c-build/libjson-c.so* json-search.AppDir/usr/lib/"   >>  ./cp_json-c.sh
23+     fi 
24+     if  [ " --help"   =  $arg  ];  then 
25+ 	echo  " --compile-json-c: clone and compile json-c" 
26+     fi 
27+ done 
28+ 
29+ if  [ $NO_RECOMPILE  -eq  1 ];  then 
30+     echo  JSON_C_CFLAGS=$( pkg-config --cflags json-c)   >>  config.mk
31+     echo  " cp \$ (ldd json-search | grep json | cut -d ' ' -f  3) json-search.AppDir/usr/lib/"   >>  ./cp_json-c.sh
32+ fi 
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- " ${APPDIR} /usr/bin/json-search"   " $@ " 
3+ LD_LIBRARY_PATH= ${APPDIR} /usr/lib/  " ${APPDIR} /usr/bin/json-search"   " $@ " 
Original file line number Diff line number Diff line change 1818#include  <stdio.h> 
1919#include  <stdlib.h> 
2020#include  <string.h> 
21- #include  < json-c/json.h> 
21+ #include  " json.h" 
2222
2323#define  panic (...)				\
2424	do {					\
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments